diff -u --recursive --new-file v2.1.114/linux/CREDITS linux/CREDITS --- v2.1.114/linux/CREDITS Tue Jul 21 00:15:29 1998 +++ linux/CREDITS Tue Aug 4 16:49:18 1998 @@ -192,6 +192,15 @@ E: bir7@leland.Stanford.Edu D: Original author of the Linux networking code +N: Anton Blanchard +E: anton@progsoc.uts.edu.au +W: http://www.progsoc.uts.edu.au/~anton/ +P: 1024/8462A731 4C 55 86 34 44 59 A7 99 2B 97 88 4A 88 9A 0D 97 +D: sun4 port +S: 47 Robert Street +S: Marrickville NSW 2204 +S: Australia + N: Philip Blundell E: Philip.Blundell@pobox.com D: Device driver hacking diff -u --recursive --new-file v2.1.114/linux/Documentation/Configure.help linux/Documentation/Configure.help --- v2.1.114/linux/Documentation/Configure.help Mon Aug 3 12:45:43 1998 +++ linux/Documentation/Configure.help Tue Aug 4 23:39:10 1998 @@ -4045,6 +4045,26 @@ important data. This is primarily of use to people trying to debug the middle and upper layers of the SCSI subsystem. If unsure, say N. +Fibre Channel support +CONFIG_FC4 + This is an experimental support for storage arrays connected to + the system using Fibre Optic and the "X3.269-199X Fibre Channel + Protocol for SCSI" specification. You'll also need the generic SCSI + support, as well as the drivers for the storage array itself and + for the interface adapter such as SOC. This subsystem could even + serve for IP networking, with some code extensions. + If unsure, say N. + +Sun SOC +CONFIG_FC4_SOC + Serial Optical Channel is an interface card with one or two Fibre Optic + ports, each of which can be connected to a disk array. Only the SBus + incarnation of the adapter is supported at the moment. + +SparcSTORAGE Array 100 and 200 series +CONFIG_SCSI_PLUTO + If you never bought a disk array made by Sun, go with N. + AcornSCSI support CONFIG_SCSI_ACORNSCSI_3 This enables support for the Acorn SCSI card (aka30). If you have an @@ -8281,26 +8301,6 @@ differs slightly from OSS/Free, so PLEASE READ Documentation/sound/sonicvibes. -Kernel profiling support -CONFIG_PROFILE - This is for kernel hackers who want to know how much time the kernel - spends in the various procedures. The information is stored in - /proc/profile (say Y to "/proc filesystem support"!) and in order to - read it, you need the readprofile package from - sunsite.unc.edu:/pub/Linux/kernel. Its manpage gives information - regarding the format of profiling data. To become a kernel hacker, - you can start with the Kernel Hacker's Guide at - http://www.redhat.com:8080/HyperNews/get/khg.html (to browse the - WWW, you need to have access to a machine on the Internet that has a - program like lynx or netscape). Mere mortals say N. - -Profile shift count -CONFIG_PROFILE_SHIFT - This is used to adjust the granularity with which the addresses of - executed instructions get recorded in /proc/profile. But since you - said Y to "Kernel profiling support", you must be a kernel hacker and - hence you know what this is about :-) - Magic System Request Key support CONFIG_MAGIC_SYSRQ If you say Y here, you will have some control over the system even @@ -8632,6 +8632,12 @@ WWW, you need to have access to a machine on the Internet that has a program like lynx or netscape) or mail to hackers@cafe.anu.edu.au +Support for Sun4 architecture +CONFIG_SUN4 + Use this option if, and only if, your machine is sun4. Note that + kernel compiled with this option will run on sun4 only. + (And in current version, it will probably work on sun4/330, only.) + SPARC ESP SCSI support CONFIG_SCSI_SUNESP This is the driver for the Sun ESP SCSI host adapter. The ESP @@ -9130,27 +9136,23 @@ Say Y if you need this feature; users who are only using their system-native partitioning scheme can say N here. -Build PowerMac Kernel (not PReP) +Board Type CONFIG_PMAC - There are currently two different kinds of PowerPC-based machines + There are currently several different kinds of PowerPC-based machines available: Apple Power Macintoshes and clones (such as the Motorola - Starmax series, and PReP (PowerPC Reference Platform) machines such - as the Motorola PowerStack range. Currently, a single kernel binary - only supports one type or the other. Say Y here to compile a kernel - which will run on Power Macintoshes and clones. - -Build PReP Kernel (not PowerMac) -CONFIG_PREP - Say Y here to compile a kernel which will run on PReP (PowerPC - Reference Platform) machines such as the Motorola PowerStack range. - For Power Macintosh clones, including the Motorola Starmaxes, you - should say N (and Y to the previous question). - -Processor type -CONFIG_MCOMMON - If you are compiling a kernel to run on a specific machine, you can - indicate which type of PowerPC processor it has. Currently this - option does very little. + Starmax series, PReP (PowerPC Reference Platform) machines such + as the Motorola PowerStack, Amiga Power-Up systems (APUS), CHRP and the + embedded MBX boards from Motorola. Currently, a single kernel binary + only supports one type or the other. However, there is very early work + on support CHRP, PReP and PowerMac's from a single binary. + + +Processor Type +CONFIG_6xx + There are two types of PowerPC chips supported. The more common + types (601,603,604,740,750) and the embedded versions (821 and 860). + Unless you are building a kernel for one of the embedded boards using + the 821 or 860 choose 6xx. Support for Open Firmware device tree in /proc CONFIG_PROC_DEVICETREE 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/config.in linux/arch/alpha/config.in --- v2.1.114/linux/arch/alpha/config.in Thu Jul 16 18:09:22 1998 +++ linux/arch/alpha/config.in Tue Aug 4 23:39:21 1998 @@ -279,10 +279,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 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then tristate 'Kernel FP software completion' CONFIG_MATHEMU else diff -u --recursive --new-file v2.1.114/linux/arch/alpha/defconfig linux/arch/alpha/defconfig --- v2.1.114/linux/arch/alpha/defconfig Tue Jul 21 00:15:29 1998 +++ linux/arch/alpha/defconfig Tue Aug 4 23:39:30 1998 @@ -297,6 +297,5 @@ # # Kernel hacking # -# CONFIG_PROFILE is not set CONFIG_MATHEMU=y # CONFIG_MAGIC_SYSRQ is not set diff -u --recursive --new-file v2.1.114/linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c --- v2.1.114/linux/arch/alpha/kernel/process.c Wed Jun 24 22:54:03 1998 +++ linux/arch/alpha/kernel/process.c Tue Aug 4 22:55:15 1998 @@ -81,15 +81,7 @@ current->priority = -100; while (1) { - /* - * tq_scheduler currently assumes we're running in a process - * context (ie that we hold the kernel lock..) - */ - if (tq_scheduler) { - lock_kernel(); - run_task_queue(&tq_scheduler); - unlock_kernel(); - } + run_task_queue(&tq_scheduler); /* endless idle loop with no priority at all */ current->counter = -100; if (!smp_commenced || resched_needed()) { 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/kernel/smp.c linux/arch/alpha/kernel/smp.c --- v2.1.114/linux/arch/alpha/kernel/smp.c Tue Jul 21 00:15:29 1998 +++ linux/arch/alpha/kernel/smp.c Tue Aug 4 23:57:51 1998 @@ -1,4 +1,3 @@ -#include #include #include #include @@ -336,10 +335,8 @@ #ifdef NOT_YET clear_profile_irq(mid_xlate[cpu]); -#ifdef CONFIG_PROFILE if(!user_mode(regs)) - sparc_do_profile(regs->pc); -#endif + alpha_do_profile(regs->pc); #endif if (!--prof_counter[cpu]) { @@ -349,7 +346,7 @@ if (--current->counter < 0) { current->counter = 0; - need_resched = 1; + current->need_resched = 1; } spin_lock(&ticker_lock); 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/config.in linux/arch/arm/config.in --- v2.1.114/linux/arch/arm/config.in Thu Jul 16 18:09:23 1998 +++ linux/arch/arm/config.in Tue Aug 4 23:42:17 1998 @@ -169,9 +169,5 @@ bool 'Debug kernel errors' CONFIG_DEBUG_ERRORS #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/arm/defconfig linux/arch/arm/defconfig --- v2.1.114/linux/arch/arm/defconfig Tue Jul 21 00:15:30 1998 +++ linux/arch/arm/defconfig Tue Aug 4 23:42:22 1998 @@ -263,5 +263,4 @@ # # Kernel hacking # -# CONFIG_PROFILE is not set CONFIG_MAGIC_SYSRQ=y diff -u --recursive --new-file v2.1.114/linux/arch/arm/kernel/dec21285.c linux/arch/arm/kernel/dec21285.c --- v2.1.114/linux/arch/arm/kernel/dec21285.c Tue Jul 21 00:15:30 1998 +++ linux/arch/arm/kernel/dec21285.c Tue Aug 4 16:07:17 1998 @@ -147,6 +147,10 @@ { } +__initfunc(void pcibios_fixup_bus(struct pci_bus *bus)) +{ +} + __initfunc(char *pcibios_setup(char *str)) { return str; 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 16:07:17 1998 @@ -71,8 +71,9 @@ current->priority = -100; for (;;) { + check_pgt_cache(); #if 0 //def ARCH_IDLE_OK - if (!hlt_counter && !need_resched) + if (!hlt_counter && !current->need_resched) proc_idle (); #endif run_task_queue(&tq_scheduler); 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/defconfig linux/arch/i386/defconfig --- v2.1.114/linux/arch/i386/defconfig Mon Aug 3 12:45:43 1998 +++ linux/arch/i386/defconfig Tue Aug 4 23:38:28 1998 @@ -290,6 +290,4 @@ # # Kernel hacking # -CONFIG_PROFILE=y -CONFIG_PROFILE_SHIFT=2 # CONFIG_MAGIC_SYSRQ is not set 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<need_resched) __asm("hlt"); check_pgt_cache(); - /* - * tq_scheduler currently assumes we're running in a process - * context (ie that we hold the kernel lock..) - */ - if (tq_scheduler) { - lock_kernel(); - run_task_queue(&tq_scheduler); - unlock_kernel(); - } + run_task_queue(&tq_scheduler); + /* endless idle loop with no priority at all */ current->counter = 0; schedule(); diff -u --recursive --new-file v2.1.114/linux/arch/i386/mm/init.c linux/arch/i386/mm/init.c --- v2.1.114/linux/arch/i386/mm/init.c Tue Jul 21 00:15:30 1998 +++ linux/arch/i386/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/m68k/config.in linux/arch/m68k/config.in --- v2.1.114/linux/arch/m68k/config.in Mon Aug 3 12:45:44 1998 +++ linux/arch/m68k/config.in Tue Aug 4 23:41:38 1998 @@ -356,10 +356,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 bool 'Remote debugging support' CONFIG_KGDB endmenu diff -u --recursive --new-file v2.1.114/linux/arch/m68k/defconfig linux/arch/m68k/defconfig --- v2.1.114/linux/arch/m68k/defconfig Mon Aug 3 12:45:44 1998 +++ linux/arch/m68k/defconfig Tue Aug 4 23:41:48 1998 @@ -217,5 +217,4 @@ # # Kernel hacking # -# CONFIG_PROFILE is not set CONFIG_SCSI_CONSTANTS=y 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/boot/Makefile linux/arch/mips/boot/Makefile --- v2.1.114/linux/arch/mips/boot/Makefile Wed Dec 10 10:31:09 1997 +++ linux/arch/mips/boot/Makefile Tue Aug 4 16:06:56 1998 @@ -40,8 +40,8 @@ mcopy -o zImage a:vmlinux; \ fi +# Don't build dependencies, this may die if $(CC) isn't gcc dep: - $(CPP) -M *.[cS] > .depend clean: rm -f zImage zImage.tmp mkboot diff -u --recursive --new-file v2.1.114/linux/arch/mips/config.in linux/arch/mips/config.in --- v2.1.114/linux/arch/mips/config.in Fri May 8 23:14:42 1998 +++ linux/arch/mips/config.in Tue Aug 4 23:41:09 1998 @@ -183,17 +183,6 @@ endmenu fi -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_IDECD" = "y" -o "$CONFIG_BLK_DEV_SR" = "y" -o "$CONFIG_SBPCD" = "y" -o "$CONFIG_MCD" = "y" -o "$CONFIG_CM206" = "y" -o "$CONFIG_CDU31A" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_IDECD" = "m" -o "$CONFIG_BLK_DEV_SR" = "m" -o "$CONFIG_SBPCD" = "m" -o "$CONFIG_MCD" = "m" -o "$CONFIG_CM206" = "m" -o "$CONFIG_CDU31A" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in source fs/nls/Config.in @@ -222,8 +211,4 @@ bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE fi bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG -bool 'Kernel profiling support' CONFIG_PROFILE -if [ "$CONFIG_PROFILE" = "y" ]; then - int ' Profile shift count' CONFIG_PROFILE_SHIFT 2 -fi endmenu diff -u --recursive --new-file v2.1.114/linux/arch/mips/defconfig linux/arch/mips/defconfig --- v2.1.114/linux/arch/mips/defconfig Fri May 8 23:14:43 1998 +++ linux/arch/mips/defconfig Tue Aug 4 23:41:22 1998 @@ -214,6 +214,7 @@ # AX.25 network device drivers # # CONFIG_MKISS is not set +# CONFIG_6PACK is not set # CONFIG_BPQETHER is not set # CONFIG_DMASCC is not set # CONFIG_SCC is not set @@ -231,7 +232,6 @@ # CD-ROM drivers (not for SCSI or IDE/ATAPI drives) # # CONFIG_CD_NO_IDESCSI is not set -CONFIG_CDROM=y # # Filesystems @@ -327,4 +327,3 @@ # CONFIG_CROSSCOMPILE=y # CONFIG_REMOTE_DEBUG is not set -# CONFIG_PROFILE is not set diff -u --recursive --new-file v2.1.114/linux/arch/mips/jazz/hw-access.c linux/arch/mips/jazz/hw-access.c --- v2.1.114/linux/arch/mips/jazz/hw-access.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/jazz/hw-access.c Tue Aug 4 16:06:56 1998 @@ -1,4 +1,4 @@ -/* +/* $Id: hw-access.c,v 1.5 1998/05/07 00:39:27 ralf Exp $ * Low-level hardware access stuff for Jazz family machines. * * This file is subject to the terms and conditions of the GNU General Public @@ -6,8 +6,6 @@ * for more details. * * Copyright (C) 1995, 1996, 1997 by Ralf Baechle - * - * $Id: hw-access.c,v 1.4 1998/05/01 01:33:36 ralf Exp $ */ #include #include @@ -154,6 +152,8 @@ static volatile keyboard_hardware *jazz_kh = (keyboard_hardware *) JAZZ_KEYBOARD_ADDRESS; +#define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */ + static unsigned char jazz_read_input(void) { return jazz_kh->data; @@ -161,11 +161,21 @@ static void jazz_write_output(unsigned char val) { + int status; + + do { + status = jazz_kh->command; + } while (status & KBD_STAT_IBF); jazz_kh->data = val; } static void jazz_write_command(unsigned char val) { + int status; + + do { + status = jazz_kh->command; + } while (status & KBD_STAT_IBF); jazz_kh->command = val; } diff -u --recursive --new-file v2.1.114/linux/arch/mips/jazz/int-handler.S linux/arch/mips/jazz/int-handler.S --- v2.1.114/linux/arch/mips/jazz/int-handler.S Fri May 8 23:14:43 1998 +++ linux/arch/mips/jazz/int-handler.S Tue Aug 4 16:06:57 1998 @@ -1,16 +1,17 @@ -/* - * arch/mips/jazz/pica.S +/* $Id: int-handler.S,v 1.6 1998/05/08 01:44:08 ralf Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. * - * Copyright (C) 1995, 1996 by Ralf Baechle and Andreas Busse + * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle and Andreas Busse * - * Jazz family specific stuff + * Jazz family specific interrupt stuff * * To do: On Jazz machines we remap some non-ISA interrupts to ISA * interrupts. These interrupts should use their own vectors. * Squeeze the last cycles out of the handlers. Only a dead * cycle is a good cycle. - * - * $Id: int-handler.S,v 1.5 1998/05/01 01:33:37 ralf Exp $ */ #include #include @@ -27,7 +28,6 @@ NESTED(jazz_handle_int, PT_SIZE, ra) .set noat SAVE_ALL - REG_S sp,PT_OR2(sp) CLI .set at diff -u --recursive --new-file v2.1.114/linux/arch/mips/jazz/setup.c linux/arch/mips/jazz/setup.c --- v2.1.114/linux/arch/mips/jazz/setup.c Sun Jun 7 11:16:27 1998 +++ linux/arch/mips/jazz/setup.c Tue Aug 4 16:06:57 1998 @@ -7,7 +7,7 @@ * * Copyright (C) 1996, 1997 by Ralf Baechle * - * $Id: setup.c,v 1.6 1998/05/04 09:17:45 ralf Exp $ + * $Id: setup.c,v 1.7 1998/06/10 07:21:07 davem Exp $ */ #include #include diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/entry.S linux/arch/mips/kernel/entry.S --- v2.1.114/linux/arch/mips/kernel/entry.S Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/entry.S Tue Aug 4 16:06:57 1998 @@ -7,7 +7,7 @@ * * Copyright (C) 1994, 1995 by Ralf Baechle * - * $Id: entry.S,v 1.9 1998/05/04 09:17:50 ralf Exp $ + * $Id: entry.S,v 1.10 1998/07/26 03:02:06 davem Exp $ */ /* @@ -59,6 +59,7 @@ andi t1, t0, 0x10 beqz t1, return # -> yes +#error Change this to current->need_resched --DaveM lw t1, need_resched bnez t1, reschedule lw v0, TASK_SIGPENDING($28) diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/irixelf.c linux/arch/mips/kernel/irixelf.c --- v2.1.114/linux/arch/mips/kernel/irixelf.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/irixelf.c Tue Aug 4 16:06:57 1998 @@ -725,6 +725,7 @@ current->mm->end_data = 0; current->mm->end_code = 0; current->mm->mmap = NULL; + current->flags &= ~PF_FORKNOEXEC; elf_entry = (unsigned int) elf_ex.e_entry; /* Do this so that we can load the interpreter, if need be. We will @@ -775,8 +776,7 @@ if (current->binfmt && current->binfmt->module) __MOD_INC_USE_COUNT(current->binfmt->module); - current->suid = current->euid = current->fsuid = bprm->e_uid; - current->sgid = current->egid = current->fsgid = bprm->e_gid; + compute_creds(bprm); current->flags &= ~PF_FORKNOEXEC; bprm->p = (unsigned long) create_irix_tables((char *)bprm->p, bprm->argc, bprm->envc, diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/irq.c linux/arch/mips/kernel/irq.c --- v2.1.114/linux/arch/mips/kernel/irq.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/irq.c Tue Aug 4 16:06:57 1998 @@ -1,10 +1,13 @@ -/* +/* $Id: irq.c,v 1.13 1998/05/08 01:44:12 ralf Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * * Code to handle x86 style IRQs plus some generic interrupt stuff. * * Copyright (C) 1992 Linus Torvalds - * Copyright (C) 1994, 1995, 1996, 1997 Ralf Baechle - * - * $Id: irq.c,v 1.11 1998/05/01 01:34:02 ralf Exp $ + * Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle */ #include #include @@ -310,7 +313,15 @@ return i; } +int (*irq_cannonicalize)(int irq); + +static int i8259a_irq_cannonicalize(int irq) +{ + return ((irq == 2) ? 9 : irq); +} + __initfunc(void init_IRQ(void)) { + irq_cannonicalize = i8259a_irq_cannonicalize; irq_setup(); } diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/pci.c linux/arch/mips/kernel/pci.c --- v2.1.114/linux/arch/mips/kernel/pci.c Tue Jul 21 00:15:30 1998 +++ linux/arch/mips/kernel/pci.c Tue Aug 4 16:06:57 1998 @@ -1,11 +1,13 @@ -/* +/* $Id: pci.c,v 1.11 1998/07/15 20:34:33 mj Exp $ + * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * MIPS implementation of PCI BIOS services for PCI support. + * + * Copyright (C) 1997, 1998 Ralf Baechle */ -#include #include #include #include @@ -20,10 +22,8 @@ /* * BIOS32 replacement. */ -__initfunc(unsigned long pcibios_init(unsigned long memory_start, - unsigned long memory_end)) +__initfunc(void pcibios_init(void)) { - return memory_start; } /* @@ -36,61 +36,13 @@ } /* - * Given the vendor and device ids, find the n'th instance of that device - * in the system. - */ -int pcibios_find_device (unsigned short vendor, unsigned short device_id, - unsigned short index, unsigned char *bus, - unsigned char *devfn) -{ - unsigned int curr = 0; - struct pci_dev *dev; - - for (dev = pci_devices; dev; dev = dev->next) { - if (dev->vendor == vendor && dev->device == device_id) { - if (curr == index) { - *devfn = dev->devfn; - *bus = dev->bus->number; - return PCIBIOS_SUCCESSFUL; - } - ++curr; - } - } - return PCIBIOS_DEVICE_NOT_FOUND; -} - -/* - * Given the class, find the n'th instance of that device - * in the system. - */ -int pcibios_find_class (unsigned int class_code, unsigned short index, - unsigned char *bus, unsigned char *devfn) -{ - unsigned int curr = 0; - struct pci_dev *dev; - - for (dev = pci_devices; dev; dev = dev->next) { - if (dev->class == class_code) { - if (curr == index) { - *devfn = dev->devfn; - *bus = dev->bus->number; - return PCIBIOS_SUCCESSFUL; - } - ++curr; - } - } - return PCIBIOS_DEVICE_NOT_FOUND; -} - -/* * The functions below are machine specific and must be reimplented for * each PCI chipset configuration. We just run the hook to the machine * specific implementation. */ -unsigned long pcibios_fixup (unsigned long memory_start, - unsigned long memory_end) +__initfunc(void pcibios_fixup (void)) { - return pci_ops->pcibios_fixup(memory_start, memory_end); + return pci_ops->pcibios_fixup(); } int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/process.c linux/arch/mips/kernel/process.c --- v2.1.114/linux/arch/mips/kernel/process.c Thu May 14 19:47:38 1998 +++ linux/arch/mips/kernel/process.c Tue Aug 4 16:06:57 1998 @@ -7,7 +7,7 @@ * * Copyright (C) 1994 - 1998 by Ralf Baechle and others. * - * $Id: process.c,v 1.10 1998/05/04 09:17:53 ralf Exp $ + * $Id: process.c,v 1.11 1998/05/15 13:04:01 davem Exp $ */ #include #include diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/scall_o32.S linux/arch/mips/kernel/scall_o32.S --- v2.1.114/linux/arch/mips/kernel/scall_o32.S Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/scall_o32.S Tue Aug 4 16:06:57 1998 @@ -7,7 +7,7 @@ * * Copyright (C) 1997, 1998 by Ralf Baechle * - * $Id: scall_o32.S,v 1.1 1998/05/01 01:34:21 ralf Exp $ + * $Id: scall_o32.S,v 1.2 1998/07/26 03:02:07 davem Exp $ */ #include #include @@ -73,6 +73,7 @@ 9: lw t0,PT_STATUS(sp) # returning to kernel mode? andi t1, t0, 0x10 +#error Change this to current->need_resched --DaveM lw t2, need_resched beqz t1, o32_return # -> yes bnez t2, o32_reschedule diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/setup.c linux/arch/mips/kernel/setup.c --- v2.1.114/linux/arch/mips/kernel/setup.c Sun Jun 7 11:16:27 1998 +++ linux/arch/mips/kernel/setup.c Tue Aug 4 16:06:57 1998 @@ -5,7 +5,7 @@ * Copyright (C) 1995, 1996 Ralf Baechle * Copyright (C) 1996 Stoned Elipot * - * $Id: setup.c,v 1.9 1998/05/04 09:17:56 ralf Exp $ + * $Id: setup.c,v 1.10 1998/06/10 07:21:10 davem Exp $ */ #include #include diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/signal.c linux/arch/mips/kernel/signal.c --- v2.1.114/linux/arch/mips/kernel/signal.c Sun Jun 7 11:16:27 1998 +++ linux/arch/mips/kernel/signal.c Tue Aug 4 16:06:57 1998 @@ -4,7 +4,7 @@ * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1994, 1995, 1996 Ralf Baechle * - * $Id: signal.c,v 1.12 1998/05/01 01:34:28 ralf Exp $ + * $Id: signal.c,v 1.13 1998/06/10 07:21:12 davem Exp $ * * XXX Handle lazy fp context switches correctly. */ diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/syscall.c linux/arch/mips/kernel/syscall.c --- v2.1.114/linux/arch/mips/kernel/syscall.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/syscall.c Tue Aug 4 16:06:57 1998 @@ -11,7 +11,7 @@ * Don't waste that much memory for empty entries in the syscall * table. * - * $Id: syscall.c,v 1.11 1998/05/01 01:34:30 ralf Exp $ + * $Id: syscall.c,v 1.12 1998/07/26 03:02:09 davem Exp $ */ #undef CONF_PRINT_SYSCALLS #undef CONF_DEBUG_IRIX @@ -99,7 +99,7 @@ * same for logic clocked with the processor generated * clocks. */ - if (wait_available && !need_resched) + if (wait_available && !current->need_resched) __asm__(".set\tmips3\n\t" "wait\n\t" ".set\tmips0"); diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/syscalls.h linux/arch/mips/kernel/syscalls.h --- v2.1.114/linux/arch/mips/kernel/syscalls.h Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/syscalls.h Tue Aug 4 16:06:57 1998 @@ -7,7 +7,7 @@ * * Copyright (C) 1995, 1996 by Ralf Baechle * - * $Id: syscalls.h,v 1.13 1998/05/01 01:34:34 ralf Exp $ + * $Id: syscalls.h,v 1.14 1998/05/07 00:39:37 ralf Exp $ */ /* @@ -34,7 +34,7 @@ SYS(sys_time, 1) SYS(sys_mknod, 3) SYS(sys_chmod, 2) /* 4015 */ -SYS(sys_chown, 3) +SYS(sys_lchown, 3) SYS(sys_ni_syscall, 0) SYS(sys_stat, 2) SYS(sys_lseek, 3) @@ -220,4 +220,5 @@ SYS(sys_rt_sigsuspend, 2) SYS(sys_pread, 4) /* 4200 */ SYS(sys_pwrite, 4) -SYS(sys_lchown, 3) +SYS(sys_chown, 3) +SYS(sys_getcwd, 2) diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/sysirix.c linux/arch/mips/kernel/sysirix.c --- v2.1.114/linux/arch/mips/kernel/sysirix.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/sysirix.c Tue Aug 4 16:06:57 1998 @@ -4,7 +4,7 @@ * Copyright (C) 1996 David S. Miller * Copyright (C) 1997 Miguel de Icaza * - * $Id: sysirix.c,v 1.9 1998/05/01 01:34:35 ralf Exp $ + * $Id: sysirix.c,v 1.10 1998/05/08 21:01:33 davem Exp $ */ #include diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/sysmips.c linux/arch/mips/kernel/sysmips.c --- v2.1.114/linux/arch/mips/kernel/sysmips.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/kernel/sysmips.c Tue Aug 4 16:06:57 1998 @@ -7,7 +7,7 @@ * * Copyright (C) 1995, 1996, 1997 by Ralf Baechle * - * $Id: sysmips.c,v 1.7 1998/05/01 01:34:38 ralf Exp $ + * $Id: sysmips.c,v 1.8 1998/05/08 21:01:35 davem Exp $ */ #include #include diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/time.c linux/arch/mips/kernel/time.c --- v2.1.114/linux/arch/mips/kernel/time.c Sun Jun 7 11:16:27 1998 +++ linux/arch/mips/kernel/time.c Tue Aug 4 16:06:57 1998 @@ -6,7 +6,7 @@ * This file contains the time handling details for PC-style clocks as * found in some MIPS systems. * - * $Id: time.c,v 1.8 1998/05/01 01:34:39 ralf Exp $ + * $Id: time.c,v 1.9 1998/06/10 07:21:13 davem Exp $ */ #include #include diff -u --recursive --new-file v2.1.114/linux/arch/mips/kernel/unaligned.c linux/arch/mips/kernel/unaligned.c --- v2.1.114/linux/arch/mips/kernel/unaligned.c Sun Jun 7 11:16:27 1998 +++ linux/arch/mips/kernel/unaligned.c Tue Aug 4 16:06:57 1998 @@ -7,7 +7,7 @@ * * Copyright (C) 1996, 1998 by Ralf Baechle * - * $Id: unaligned.c,v 1.3 1998/05/04 09:17:59 ralf Exp $ + * $Id: unaligned.c,v 1.4 1998/06/10 07:21:15 davem Exp $ * * This file contains exception handler for address error exception with the * special capability to execute faulting instructions in software. The diff -u --recursive --new-file v2.1.114/linux/arch/mips/lib/Makefile linux/arch/mips/lib/Makefile --- v2.1.114/linux/arch/mips/lib/Makefile Fri May 8 23:14:43 1998 +++ linux/arch/mips/lib/Makefile Tue Aug 4 16:06:57 1998 @@ -1,8 +1,7 @@ +# $Id: Makefile,v 1.8 1998/05/08 01:44:18 ralf Exp $ # # Makefile for MIPS-specific library files.. # -# $Id: Makefile,v 1.7 1998/05/04 09:18:03 ralf Exp $ -# .S.s: $(CPP) $(CFLAGS) $< -o $*.s @@ -10,7 +9,7 @@ $(CC) $(CFLAGS) -c $< -o $*.o L_TARGET = lib.a -L_OBJS = csum_partial.o csum_partial_copy.o dump_tlb.o ide-std.c ide-no.o \ +L_OBJS = csum_partial.o csum_partial_copy.o dump_tlb.o ide-std.o ide-no.o \ memset.o memcpy.o strlen_user.o strncpy_user.o tags.o watch.o # diff -u --recursive --new-file v2.1.114/linux/arch/mips/lib/csum.S linux/arch/mips/lib/csum.S --- v2.1.114/linux/arch/mips/lib/csum.S Thu Jun 26 12:33:37 1997 +++ linux/arch/mips/lib/csum.S Wed Dec 31 16:00:00 1969 @@ -1,25 +0,0 @@ -#include -#include -#include - -/* - * Compute kernel code checksum to check kernel code against corruption - * (Ancient debugging trash ...) - */ - LEAF(csum) - LONG_L t0,cacheflush - move t8,ra - jalr t0 - li t0,KSEG1 - la t1,final - li t2,KSEG1 - or t0,t2 - or t1,t2 - move v0,zero -1: lw t2,(t0) - addiu t0,4 - bne t0,t1,1b - xor v0,t2 - jr t8 - nop - END(csum) diff -u --recursive --new-file v2.1.114/linux/arch/mips/lib/csum_partial.S linux/arch/mips/lib/csum_partial.S --- v2.1.114/linux/arch/mips/lib/csum_partial.S Fri May 8 23:14:43 1998 +++ linux/arch/mips/lib/csum_partial.S Tue Aug 4 16:06:57 1998 @@ -1,14 +1,13 @@ -/* +/* $Id: csum_partial.S,v 1.2 1998/05/08 01:44:20 ralf Exp $ + * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1998 Ralf Baechle - * - * $Id: csum_partial.S,v 1.1 1998/05/04 09:18:08 ralf Exp $ */ -#include -#include +#include +#include #define ADDC(sum,reg) \ addu sum, reg; \ diff -u --recursive --new-file v2.1.114/linux/arch/mips/lib/csum_partial_copy.S linux/arch/mips/lib/csum_partial_copy.S --- v2.1.114/linux/arch/mips/lib/csum_partial_copy.S Fri May 8 23:14:43 1998 +++ linux/arch/mips/lib/csum_partial_copy.S Tue Aug 4 16:06:57 1998 @@ -1,13 +1,13 @@ -/* +/* $Id: csum_partial_copy.S,v 1.2 1998/05/07 00:39:47 ralf Exp $ + * + * Unified implementation of csum_copy_partial, csum_copy_partial_from_user + * and csum_copy_partial_nocheck. + * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1998 Ralf Baechle - * - * $Id: csum_partial_copy.S,v 1.1 1998/05/04 09:18:11 ralf Exp $ - * - * Unified implementation of csum_copy_partial and csum_copy_partial_from_user. */ #include #include @@ -179,6 +179,7 @@ .align 5 LEAF(csum_partial_copy_from_user) addu t5, src, a2 # end address for fixup +EXPORT(csum_partial_copy_nocheck) EXPORT(csum_partial_copy) move sum, zero # clear computed sum move t7, zero # clear odd flag diff -u --recursive --new-file v2.1.114/linux/arch/mips/lib/ide-std.c linux/arch/mips/lib/ide-std.c --- v2.1.114/linux/arch/mips/lib/ide-std.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/lib/ide-std.c Tue Aug 4 16:06:57 1998 @@ -20,6 +20,8 @@ case 0x170: return 15; case 0x1e8: return 11; case 0x168: return 10; + case 0x1e0: return 8; + case 0x160: return 12; default: return 0; } @@ -32,6 +34,8 @@ case 1: return 0x170; case 2: return 0x1e8; case 3: return 0x168; + case 4: return 0x1e0; + case 5: return 0x160; default: return 0; } diff -u --recursive --new-file v2.1.114/linux/arch/mips/lib/memset.c linux/arch/mips/lib/memset.c --- v2.1.114/linux/arch/mips/lib/memset.c Thu Jun 26 12:33:37 1997 +++ linux/arch/mips/lib/memset.c Wed Dec 31 16:00:00 1969 @@ -1,71 +0,0 @@ -/* linux/arch/mips/lib/memset.c - * - * This is from GNU libc. - */ - -#include - -#define op_t unsigned long int -#define OPSIZ (sizeof(op_t)) - -typedef unsigned char byte; - -void *memset(void *dstpp, char c, size_t len) -{ - long int dstp = (long int) dstpp; - - if (len >= 8) { - size_t xlen; - op_t cccc; - - cccc = (unsigned char) c; - cccc |= cccc << 8; - cccc |= cccc << 16; - - /* There are at least some bytes to set. - No need to test for LEN == 0 in this alignment loop. */ - while (dstp % OPSIZ != 0) { - ((byte *) dstp)[0] = c; - dstp += 1; - len -= 1; - } - - /* Write 8 `op_t' per iteration until less - * than 8 `op_t' remain. - */ - xlen = len / (OPSIZ * 8); - while (xlen > 0) { - ((op_t *) dstp)[0] = cccc; - ((op_t *) dstp)[1] = cccc; - ((op_t *) dstp)[2] = cccc; - ((op_t *) dstp)[3] = cccc; - ((op_t *) dstp)[4] = cccc; - ((op_t *) dstp)[5] = cccc; - ((op_t *) dstp)[6] = cccc; - ((op_t *) dstp)[7] = cccc; - dstp += 8 * OPSIZ; - xlen -= 1; - } - len %= OPSIZ * 8; - - /* Write 1 `op_t' per iteration until less than - * OPSIZ bytes remain. - */ - xlen = len / OPSIZ; - while (xlen > 0) { - ((op_t *) dstp)[0] = cccc; - dstp += OPSIZ; - xlen -= 1; - } - len %= OPSIZ; - } - - /* Write the last few bytes. */ - while (len > 0) { - ((byte *) dstp)[0] = c; - dstp += 1; - len -= 1; - } - - return dstpp; -} 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 16:06:57 1998 @@ -5,7 +5,7 @@ * * Copyright (C) 1994, 1995, 1996 by Ralf Baechle * - * $Id: init.c,v 1.14 1998/05/01 01:34:53 ralf Exp $ + * $Id: init.c,v 1.15 1998/08/04 20:48:30 davem Exp $ */ #include #include @@ -45,6 +45,22 @@ /* XXX Just get it working for now... */ flush_cache_all(); 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; } /* diff -u --recursive --new-file v2.1.114/linux/arch/mips/mm/r4xx0.c linux/arch/mips/mm/r4xx0.c --- v2.1.114/linux/arch/mips/mm/r4xx0.c Wed May 20 19:10:37 1998 +++ linux/arch/mips/mm/r4xx0.c Tue Aug 4 16:06:57 1998 @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: r4xx0.c,v 1.11 1998/05/04 09:18:31 ralf Exp $ + * $Id: r4xx0.c,v 1.13 1998/05/21 07:34:35 davem Exp $ * * To do: * diff -u --recursive --new-file v2.1.114/linux/arch/mips/sgi/kernel/indy_int.c linux/arch/mips/sgi/kernel/indy_int.c --- v2.1.114/linux/arch/mips/sgi/kernel/indy_int.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/sgi/kernel/indy_int.c Tue Aug 4 16:06:57 1998 @@ -4,7 +4,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: indy_int.c,v 1.6 1998/05/01 01:35:15 ralf Exp $ + * $Id: indy_int.c,v 1.7 1998/05/07 00:39:51 ralf Exp $ */ #include #include @@ -417,8 +417,16 @@ printk("Trying to free free IRQ%d\n",irq); } +int (*irq_cannonicalize)(int irq); + +static int indy_irq_cannonicalize(int irq) +{ + return irq; /* Sane hardware, sane code ... */ +} + __initfunc(void init_IRQ(void)) { + irq_cannonicalize = indy_irq_cannonicalize; irq_setup(); } diff -u --recursive --new-file v2.1.114/linux/arch/mips/sgi/kernel/setup.c linux/arch/mips/sgi/kernel/setup.c --- v2.1.114/linux/arch/mips/sgi/kernel/setup.c Fri May 8 23:14:43 1998 +++ linux/arch/mips/sgi/kernel/setup.c Tue Aug 4 16:06:57 1998 @@ -1,9 +1,8 @@ -/* +/* $Id: setup.c,v 1.6 1998/05/07 00:39:53 ralf Exp $ + * * setup.c: SGI specific setup, including init of the feature struct. * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) - * - * $Id: setup.c,v 1.5 1998/05/01 01:35:19 ralf Exp $ */ #include #include @@ -31,6 +30,8 @@ static volatile struct hpc_keyb *sgi_kh = (struct hpc_keyb *) (KSEG1 + 0x1fbd9800 + 64); +#define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */ + static unsigned char sgi_read_input(void) { return sgi_kh->data; @@ -38,11 +39,21 @@ static void sgi_write_output(unsigned char val) { + int status; + + do { + status = sgi_kh->command; + } while (status & KBD_STAT_IBF); sgi_kh->data = val; } static void sgi_write_command(unsigned char val) { + int status; + + do { + status = sgi_kh->command; + } while (status & KBD_STAT_IBF); sgi_kh->command = val; } diff -u --recursive --new-file v2.1.114/linux/arch/mips/sni/hw-access.c linux/arch/mips/sni/hw-access.c --- v2.1.114/linux/arch/mips/sni/hw-access.c Fri May 8 23:14:44 1998 +++ linux/arch/mips/sni/hw-access.c Tue Aug 4 16:06:57 1998 @@ -1,4 +1,5 @@ -/* +/* $Id: hw-access.c,v 1.5 1998/05/07 00:39:56 ralf Exp $ + * * Low-level hardware access stuff for SNI RM200 PCI * * This file is subject to the terms and conditions of the GNU General Public @@ -6,8 +7,6 @@ * for more details. * * Copyright (C) 1996, 1997, 1998 by Ralf Baechle - * - * $Id: hw-access.c,v 1.4 1998/05/01 01:35:32 ralf Exp $ */ #include #include @@ -163,6 +162,8 @@ rtc_write_data }; +#define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */ + static unsigned char sni_read_input(void) { return inb(KBD_DATA_REG); @@ -170,11 +171,21 @@ static void sni_write_output(unsigned char val) { + int status; + + do { + status = inb(KBD_CNTL_REG); + } while (status & KBD_STAT_IBF); outb(val, KBD_DATA_REG); } static void sni_write_command(unsigned char val) { + int status; + + do { + status = inb(KBD_CNTL_REG); + } while (status & KBD_STAT_IBF); outb(val, KBD_CNTL_REG); } diff -u --recursive --new-file v2.1.114/linux/arch/mips/sni/int-handler.S linux/arch/mips/sni/int-handler.S --- v2.1.114/linux/arch/mips/sni/int-handler.S Fri May 8 23:14:44 1998 +++ linux/arch/mips/sni/int-handler.S Tue Aug 4 16:06:57 1998 @@ -1,9 +1,8 @@ -/* +/* $Id: int-handler.S,v 1.4 1998/05/08 01:44:24 ralf Exp $ + * * SNI RM200 PCI specific interrupt handler code. * * Copyright (C) 1994 - 1997 by Ralf Baechle - * - * $Id: int-handler.S,v 1.3 1998/05/01 01:35:33 ralf Exp $ */ #include #include @@ -18,7 +17,6 @@ .align 5 NESTED(sni_rm200_pci_handle_int, PT_SIZE, sp) SAVE_ALL - REG_S sp,PT_OR2(sp) CLI .set at diff -u --recursive --new-file v2.1.114/linux/arch/mips/sni/pci.c linux/arch/mips/sni/pci.c --- v2.1.114/linux/arch/mips/sni/pci.c Fri May 8 23:14:44 1998 +++ linux/arch/mips/sni/pci.c Tue Aug 4 16:06:57 1998 @@ -1,11 +1,10 @@ -/* +/* $Id: pci.c,v 1.5 1998/05/08 01:44:26 ralf Exp $ + * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * SNI specific PCI support for RM200/RM300. - * - * $Id: pci.c,v 1.4 1998/05/01 01:35:34 ralf Exp $ */ #include #include @@ -26,8 +25,7 @@ (where & 0xfc); \ } while(0); -static unsigned long sni_rm200_pcibios_fixup (unsigned long memory_start, - unsigned long memory_end) +static void sni_rm200_pcibios_fixup (void) { /* * TODO: Fix PCI_INTERRUPT_LINE register for onboard cards. @@ -36,8 +34,6 @@ */ pcibios_write_config_byte(0, PCI_DEVFN(1, 0), PCI_INTERRUPT_LINE, PCIMT_IRQ_SCSI); - - return memory_start; } /* diff -u --recursive --new-file v2.1.114/linux/arch/mips/sni/setup.c linux/arch/mips/sni/setup.c --- v2.1.114/linux/arch/mips/sni/setup.c Sun Jun 7 11:16:27 1998 +++ linux/arch/mips/sni/setup.c Tue Aug 4 16:06:57 1998 @@ -1,4 +1,5 @@ -/* +/* $Id: setup.c,v 1.7 1998/06/10 07:21:19 davem Exp $ + * * Setup pointers to hardware-dependent routines. * * This file is subject to the terms and conditions of the GNU General Public @@ -6,8 +7,6 @@ * for more details. * * Copyright (C) 1996, 1997 by Ralf Baechle - * - * $Id: setup.c,v 1.5 1998/05/04 09:18:42 ralf Exp $ */ #include #include @@ -88,7 +87,7 @@ char boardtype[80]; unsigned char csmsr; char *p = boardtype; - unsigned int asic, cacheconf; + unsigned int asic; csmsr = *(volatile unsigned char *)PCIMT_CSMSR; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/Makefile linux/arch/ppc/Makefile --- v2.1.114/linux/arch/ppc/Makefile Fri May 8 23:14:44 1998 +++ linux/arch/ppc/Makefile Tue Aug 4 16:06:36 1998 @@ -54,6 +54,12 @@ DRIVERS += arch/ppc/8xx_io/8xx_io.a drivers/net/net.a endif +ifdef CONFIG_APUS +SUBDIRS += arch/ppc/amiga +ARCHIVES += arch/ppc/amiga/amiga.o +CORE_FILES += arch/ppc/amiga/amiga.o +endif + checks: @$(MAKE) -C arch/$(ARCH)/kernel checks @@ -78,13 +84,16 @@ ln -s chrp_defconfig arch/ppc/defconfig common_config: - rm -f .config arch/ppc/common_defconfig + rm -f .config arch/ppc/defconfig ln -s common_defconfig arch/ppc/defconfig mbx_config: rm -f .config arch/ppc/defconfig ln -s mbx_defconfig arch/ppc/defconfig +apus_config: + rm -f .config arch/ppc/defconfig + ln -s apus_defconfig arch/ppc/defconfig tags: etags */*.c include/{asm,linux}/*.h arch/ppc/kernel/*.{c,h} diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/Makefile linux/arch/ppc/amiga/Makefile --- v2.1.114/linux/arch/ppc/amiga/Makefile Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/Makefile Tue Aug 4 16:06:36 1998 @@ -0,0 +1,15 @@ +# +# Makefile for Linux arch/m68k/amiga source directory +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now in the main makefile... + +O_TARGET := amiga.o +O_OBJS := config.o amiints.o cia.o time.o \ + bootinfo.o amisound.o chipram.o ints.o +OX_OBJS := amiga_ksyms.o + +include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/amiga_ksyms.c linux/arch/ppc/amiga/amiga_ksyms.c --- v2.1.114/linux/arch/ppc/amiga/amiga_ksyms.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/amiga_ksyms.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1 @@ +#include "../../m68k/amiga/amiga_ksyms.c" diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/amiints.c linux/arch/ppc/amiga/amiints.c --- v2.1.114/linux/arch/ppc/amiga/amiints.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/amiints.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1,5 @@ +/* Rename a few functions. */ +#define amiga_request_irq request_irq +#define amiga_free_irq free_irq + +#include "../../m68k/amiga/amiints.c" diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/amisound.c linux/arch/ppc/amiga/amisound.c --- v2.1.114/linux/arch/ppc/amiga/amisound.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/amisound.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1 @@ +#include "../../m68k/amiga/amisound.c" diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/bootinfo.c linux/arch/ppc/amiga/bootinfo.c --- v2.1.114/linux/arch/ppc/amiga/bootinfo.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/bootinfo.c Tue Aug 4 23:57:51 1998 @@ -0,0 +1,74 @@ +/* + * linux/arch/ppc/amiga/bootinfo.c + * + * Extracted from arch/m68k/kernel/setup.c. + * Should be properly generalized and put somewhere else. + * Jesper + */ + +#include +#include +#include +#include + +#include +#include + +extern char cmd_line[CL_SIZE]; + +int num_memory = 0; +extern struct mem_info memory[NUM_MEMINFO]; +extern struct mem_info ramdisk; + +extern int amiga_parse_bootinfo(const struct bi_record *); +extern int atari_parse_bootinfo(const struct bi_record *); +extern int mac_parse_bootinfo(const struct bi_record *); + +__initfunc(void parse_bootinfo(const struct bi_record *record)) +{ + while (record->tag != BI_LAST) { + int unknown = 0; + const u_long *data = record->data; + switch (record->tag) { + case BI_MACHTYPE: + case BI_CPUTYPE: + case BI_FPUTYPE: + case BI_MMUTYPE: + /* Already set up by head.S */ + break; + + case BI_MEMCHUNK: + if (num_memory < NUM_MEMINFO) { + memory[num_memory].addr = data[0]; + memory[num_memory].size = data[1]; + num_memory++; + } else + printk("parse_bootinfo: too many memory chunks\n"); + break; + + case BI_RAMDISK: + ramdisk.addr = data[0]; + ramdisk.size = data[1]; + break; + + case BI_COMMAND_LINE: + strncpy(cmd_line, (const char *)data, CL_SIZE); + cmd_line[CL_SIZE-1] = '\0'; + break; + + default: + if (MACH_IS_AMIGA) + unknown = amiga_parse_bootinfo(record); + else if (MACH_IS_ATARI) + unknown = atari_parse_bootinfo(record); + else if (MACH_IS_MAC) + unknown = mac_parse_bootinfo(record); + else + unknown = 1; + } + if (unknown) + printk("parse_bootinfo: unknown tag 0x%04x ignored\n", + record->tag); + record = (struct bi_record *)((u_long)record+record->size); + } +} diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/chipram.c linux/arch/ppc/amiga/chipram.c --- v2.1.114/linux/arch/ppc/amiga/chipram.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/chipram.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1 @@ +#include "../../m68k/amiga/chipram.c" diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/cia.c linux/arch/ppc/amiga/cia.c --- v2.1.114/linux/arch/ppc/amiga/cia.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/cia.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1 @@ +#include "../../m68k/amiga/cia.c" diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/config.c linux/arch/ppc/amiga/config.c --- v2.1.114/linux/arch/ppc/amiga/config.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/config.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1,7 @@ +#define m68k_debug_device debug_device +#define m68k_num_memory num_memory +#define m68k_memory memory + +#include + +#include "../../m68k/amiga/config.c" diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/ints.c linux/arch/ppc/amiga/ints.c --- v2.1.114/linux/arch/ppc/amiga/ints.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/ints.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1,156 @@ +/* + * linux/arch/ppc/amiga/ints.c + * + * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c + * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* table for system interrupt handlers */ +irq_handler_t irq_list[SYS_IRQS]; + +static const char *default_names[SYS_IRQS] = { + "spurious int", "int1 handler", "int2 handler", "int3 handler", + "int4 handler", "int5 handler", "int6 handler", "int7 handler" +}; + +/* The number of spurious interrupts */ +volatile unsigned int num_spurious; + +#define NUM_IRQ_NODES 100 +static irq_node_t nodes[NUM_IRQ_NODES]; + + +/* + * void init_IRQ(void) + * + * Parameters: None + * + * Returns: Nothing + * + * This function should be called during kernel startup to initialize + * the IRQ handling routines. + */ + +__initfunc(void apus_init_IRQ(void)) +{ + int i; + + for (i = 0; i < SYS_IRQS; i++) { + if (mach_default_handler) + irq_list[i].handler = (*mach_default_handler)[i]; + irq_list[i].flags = IRQ_FLG_STD; + irq_list[i].dev_id = NULL; + irq_list[i].devname = default_names[i]; + } + + for (i = 0; i < NUM_IRQ_NODES; i++) + nodes[i].handler = NULL; + + mach_init_IRQ (); +} + +irq_node_t *new_irq_node(void) +{ + irq_node_t *node; + short i; + + for (node = nodes, i = NUM_IRQ_NODES-1; i >= 0; node++, i--) + if (!node->handler) + return node; + + printk ("new_irq_node: out of nodes\n"); + return NULL; +} + +int sys_request_irq(unsigned int irq, + void (*handler)(int, void *, struct pt_regs *), + unsigned long flags, const char *devname, void *dev_id) +{ + if (irq < IRQ1 || irq > IRQ7) { + printk("%s: Incorrect IRQ %d from %s\n", + __FUNCTION__, irq, devname); + return -ENXIO; + } + + if (!(irq_list[irq].flags & IRQ_FLG_STD)) { + if (irq_list[irq].flags & IRQ_FLG_LOCK) { + printk("%s: IRQ %d from %s is not replaceable\n", + __FUNCTION__, irq, irq_list[irq].devname); + return -EBUSY; + } + if (!(flags & IRQ_FLG_REPLACE)) { + printk("%s: %s can't replace IRQ %d from %s\n", + __FUNCTION__, devname, irq, irq_list[irq].devname); + return -EBUSY; + } + } + irq_list[irq].handler = handler; + irq_list[irq].flags = flags; + irq_list[irq].dev_id = dev_id; + irq_list[irq].devname = devname; + return 0; +} + +void sys_free_irq(unsigned int irq, void *dev_id) +{ + if (irq < IRQ1 || irq > IRQ7) { + printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); + return; + } + + if (irq_list[irq].dev_id != dev_id) + printk("%s: Removing probably wrong IRQ %d from %s\n", + __FUNCTION__, irq, irq_list[irq].devname); + + irq_list[irq].handler = (*mach_default_handler)[irq]; + irq_list[irq].flags = IRQ_FLG_STD; + irq_list[irq].dev_id = NULL; + irq_list[irq].devname = default_names[irq]; +} + +asmlinkage void process_int(unsigned long vec, struct pt_regs *fp) +{ + if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) { + vec -= VEC_SPUR; + kstat.irqs[0][vec]++; + irq_list[vec].handler(vec, irq_list[vec].dev_id, fp); + } else { + if (mach_process_int) + mach_process_int(vec, fp); + else + panic("Can't process interrupt vector %ld\n", vec); + return; + } +} + +int get_irq_list(char *buf) +{ + int i, len = 0; + + /* autovector interrupts */ + if (mach_default_handler) { + for (i = 0; i < SYS_IRQS; i++) { + len += sprintf(buf+len, "auto %2d: %10u ", i, + i ? kstat.irqs[0][i] : num_spurious); + if (irq_list[i].flags & IRQ_FLG_LOCK) + len += sprintf(buf+len, "L "); + else + len += sprintf(buf+len, " "); + len += sprintf(buf+len, "%s\n", irq_list[i].devname); + } + } + + len += mach_get_irq_list(buf+len); + return len; +} diff -u --recursive --new-file v2.1.114/linux/arch/ppc/amiga/time.c linux/arch/ppc/amiga/time.c --- v2.1.114/linux/arch/ppc/amiga/time.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/amiga/time.c Tue Aug 4 23:57:51 1998 @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static inline unsigned long mktime(unsigned int year, unsigned int mon, + unsigned int day, unsigned int hour, + unsigned int min, unsigned int sec); + +unsigned long apus_get_rtc_time(void) +{ + unsigned int year, mon, day, hour, min, sec; + + extern void arch_gettod(int *year, int *mon, int *day, int *hour, + int *min, int *sec); + + arch_gettod (&year, &mon, &day, &hour, &min, &sec); + + if ((year += 1900) < 1970) + year += 100; + + return mktime(year, mon, day, hour, min, sec); +} + +int apus_set_rtc_time(unsigned long nowtime) +{ + if (mach_set_clock_mmss) + return mach_set_clock_mmss (nowtime); + return -1; +} + +/* Converts Gregorian date to seconds since 1970-01-01 00:00:00. + * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 + * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. + * + * [For the Julian calendar (which was used in Russia before 1917, + * Britain & colonies before 1752, anywhere else before 1582, + * and is still in use by some communities) leave out the + * -year/100+year/400 terms, and add 10.] + * + * This algorithm was first published by Gauss (I think). + * + * WARNING: this function will overflow on 2106-02-07 06:28:16 on + * machines were long is 32-bit! (However, as time_t is signed, we + * will already get problems at other places on 2038-01-19 03:14:08) + */ +static inline unsigned long mktime(unsigned int year, unsigned int mon, + unsigned int day, unsigned int hour, + unsigned int min, unsigned int sec) +{ + if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */ + mon += 12; /* Puts Feb last since it has leap day */ + year -= 1; + } + return ((( + (unsigned long)(year/4 - year/100 + year/400 + 367*mon/12 + day) + + year*365 - 719499 + )*24 + hour /* now have hours */ + )*60 + min /* now have minutes */ + )*60 + sec; /* finally seconds */ +} + + diff -u --recursive --new-file v2.1.114/linux/arch/ppc/apus_defconfig linux/arch/ppc/apus_defconfig --- v2.1.114/linux/arch/ppc/apus_defconfig Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/apus_defconfig Tue Aug 4 16:06:36 1998 @@ -0,0 +1,373 @@ +# +# Automatically generated make config: don't edit +# + +# +# Platform support +# +CONFIG_PPC=y +CONFIG_6xx=y +# CONFIG_8xx is not set +# CONFIG_PMAC is not set +# CONFIG_PREP is not set +# CONFIG_CHRP is not set +# CONFIG_ALL_PPC is not set +CONFIG_APUS=y +# CONFIG_MBX is not set +CONFIG_MACH_SPECIFIC=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +# CONFIG_MODULES is not set +# CONFIG_PCI is not set +# CONFIG_PCI_OLD_PROC is not set +CONFIG_NET=y +# CONFIG_SYSCTL is not set +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_BINFMT_ELF=y +CONFIG_KERNEL_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_BINFMT_JAVA is not set +# CONFIG_PARPORT is not set +CONFIG_ABSTRACT_CONSOLE=y +CONFIG_FB=y +# CONFIG_VGA_CONSOLE is not set +# CONFIG_FB_COMPAT_XPMAC is not set +# CONFIG_MAC_KEYBOARD is not set +# CONFIG_MAC_FLOPPY is not set +# CONFIG_MACMOUSE is not set +# CONFIG_PROC_DEVICETREE is not set +# CONFIG_KGDB is not set +# CONFIG_XMON is not set +CONFIG_FB_CONSOLE=y +CONFIG_AMIGA=y +CONFIG_ZORRO=y +CONFIG_AMIGAMOUSE=y +CONFIG_ABSTRACT_CONSOLE=y +CONFIG_FB=y +CONFIG_AMIGA_FLOPPY=y +CONFIG_AMIGA_BUILTIN_SERIAL=y +CONFIG_GVPIOEXT=y +# CONFIG_GVPIOEXT_LP is not set +# CONFIG_GVPIOEXT_PLIP is not set +CONFIG_MULTIFACE_III_TTY=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_PROC_HARDWARE is not set + +# +# Plug and Play support +# +# CONFIG_PNP is not set + +# +# Floppy, IDE, and other block devices +# +# CONFIG_BLK_DEV_FD is not set +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +CONFIG_BLK_DEV_GAYLE=y +# CONFIG_BLK_DEV_HD_IDE is not set +CONFIG_BLK_DEV_IDEDISK=y +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_IDE_CHIPSETS is not set + +# +# Additional Block Devices +# +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_XD is not set +CONFIG_PARIDE_PARPORT=y +# CONFIG_PARIDE is not set +# CONFIG_BLK_DEV_HD is not set + +# +# Networking options +# +# CONFIG_PACKET is not set +# CONFIG_NETLINK is not set +# CONFIG_FIREWALL is not set +# CONFIG_NET_ALIAS is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +# CONFIG_IP_ACCT is not set +# CONFIG_IP_ROUTER is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_ALIAS is not set +# CONFIG_SYN_COOKIES is not set + +# +# (it is safe to leave these untouched) +# +CONFIG_INET_RARP=y +# CONFIG_IP_NOSR is not set +CONFIG_SKB_LARGE=y +# CONFIG_IPV6 is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_BRIDGE is not set +# CONFIG_LLC is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set +# CONFIG_CPU_IS_SLOW is not set +# CONFIG_NET_SCHED is not set +# CONFIG_NET_PROFILE is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_DEV_SR_VENDOR=y +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_SEAGATE is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_ULTRASTOR is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_MESH is not set +CONFIG_A3000_SCSI=y +CONFIG_A2091_SCSI=y +CONFIG_GVP11_SCSI=y +CONFIG_FASTLANE_SCSI=y +# CONFIG_A4000T_SCSI is not set +# CONFIG_A4091_SCSI is not set +# CONFIG_SCSI_MAC53C94 is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +CONFIG_NET_ETHERNET=y +CONFIG_ARIADNE=y +CONFIG_A2065=y +CONFIG_HYDRA=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_NET_ISA is not set +# CONFIG_NET_EISA is not set +# CONFIG_NET_POCKET is not set +# CONFIG_FDDI is not set +# CONFIG_DLCI is not set +CONFIG_PPP=y + +# +# CCP compressors for PPP are only built as modules. +# +CONFIG_SLIP=y +CONFIG_SLIP_COMPRESSED=y +CONFIG_SLIP_SMART=y +# CONFIG_SLIP_MODE_SLIP6 is not set +# CONFIG_NET_RADIO is not set +# CONFIG_TR is not set +# CONFIG_SHAPER is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# CD-ROM drivers (not for SCSI or IDE/ATAPI drives) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Filesystems +# +# CONFIG_QUOTA is not set +CONFIG_MINIX_FS=y +CONFIG_EXT2_FS=y +CONFIG_ISO9660_FS=y +# CONFIG_JOLIET is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +CONFIG_PROC_FS=y +CONFIG_NFS_FS=y +# CONFIG_ROOT_NFS is not set +# CONFIG_NFSD is not set +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +# CONFIG_CODA_FS is not set +# CONFIG_SMB_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_SYSV_FS is not set +CONFIG_AFFS_FS=y +# CONFIG_HFS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_UFS_FS is not set + +# +# Partition Tables +# +CONFIG_AMIGA_PARTITION=y +# CONFIG_FOREIGN_PARTITIONS is not set +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_ADFS_FS is not set +# CONFIG_DEVPTS_FS is not set +CONFIG_NLS=y + +# +# Native Language Support +# +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_KOI8_R is not set + +# +# Frame buffer devices +# +CONFIG_FB_AMIGA=y +CONFIG_FB_AMIGA_OCS=y +CONFIG_FB_AMIGA_ECS=y +CONFIG_FB_AMIGA_AGA=y +CONFIG_FB_CYBER=y +CONFIG_FB_VIRGE=y +CONFIG_FB_RETINAZ3=y +# CONFIG_FB_OF is not set +# CONFIG_FB_S3TRIO is not set +CONFIG_FB_VIRTUAL=y +# CONFIG_FBCON_ADVANCED is not set +CONFIG_FBCON_MFB=y +CONFIG_FBCON_ILBM=y +CONFIG_FBCON_AFB=y +CONFIG_FBCON_MAC=y +CONFIG_FBCON_CFB2=y +CONFIG_FBCON_CFB4=y +CONFIG_FBCON_CFB8=y +CONFIG_FBCON_CFB16=y +CONFIG_FBCON_CFB24=y +CONFIG_FBCON_CFB32=y + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_MOUSE is not set +# CONFIG_QIC02_TAPE is not set +# CONFIG_APM is not set +# CONFIG_WATCHDOG is not set +# CONFIG_RTC is not set +# CONFIG_VIDEO_DEV is not set +# CONFIG_NVRAM is not set +# CONFIG_JOYSTICK is not set +# CONFIG_MISC_RADIO is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set + +# +# Sound +# +# CONFIG_SOUND is not set diff -u --recursive --new-file v2.1.114/linux/arch/ppc/boot/head.S linux/arch/ppc/boot/head.S --- v2.1.114/linux/arch/ppc/boot/head.S Fri May 8 23:14:44 1998 +++ linux/arch/ppc/boot/head.S Tue Aug 4 16:06:36 1998 @@ -7,6 +7,8 @@ .text /* + * $Id: head.S,v 1.24 1998/07/21 02:43:50 cort Exp $ + * * This code is loaded by the ROM loader at some arbitrary location. * Move it to high memory so that it can load the kernel at 0x0000. * @@ -38,11 +40,12 @@ mr r11,r3 /* Save pointer to residual/board data */ #ifndef CONFIG_MBX - mfmsr r3 /* Turn off interrupts */ + mfmsr r3 /* Turn off interrupts */ li r4,0 ori r4,r4,MSR_EE andc r3,r3,r4 mtmsr r3 + /* check if we need to relocate ourselves to the link addr or were we loaded there to begin with -- Cort */ lis r4,start@h @@ -65,6 +68,7 @@ mr r7,r5 b start_ldr 1010: +#if 0 /* Copy relocation code down to location 0x0100 (where we hope it's safe!) */ mflr r3 addi r5,r3,start_ldr-start_ @@ -82,6 +86,7 @@ mtlr r21 mtctr r22 bctr /* Jump to code */ +#endif /* * no matter where we're loaded, move ourselves to -Ttext address */ @@ -110,13 +115,12 @@ stwu r5,4(r4) xor r6,r6,r5 bdnz 00b - lis r3,start_ldr@h + lis r3,start_ldr@h ori r3,r3,start_ldr@l mtlr r3 /* Easiest way to do an absolute jump */ blr -start_ldr: +start_ldr: #endif /* ndef CONFIG_MBX */ - /* Clear all of BSS */ lis r3,edata@h ori r3,r3,edata@l @@ -137,9 +141,10 @@ andc r1,r1,r2 /* Run loader */ #ifdef CONFIG_MBX + mr r3, r11 mr r21, r11 - bl serial_init /* Init MBX serial port */ - mr r11, r21 + bl serial_init /* Init MBX serial port */ + mr r11, r21 lis r8,start@h ori r8,r8,start@l li r9,end@h @@ -156,6 +161,7 @@ mr r5,r6 /* Checksum */ mr r6,r11 /* Residual data */ bl decompress_kernel + /* changed to use r3 (as firmware does) for kernel as ptr to residual -- Cort*/ lis r6,cmd_line@h @@ -187,7 +193,7 @@ ori r10,r10,0xdeadc0de@l stw r10,0(r9) #endif - blr + blr hang: b hang @@ -229,5 +235,71 @@ cmp 0,r6,r9 blt 2b 3: blr + +.globl _get_HID0 +_get_HID0: + mfspr r3,HID0 + blr + +.globl _put_HID0 +_put_HID0: + mtspr HID0,r3 + blr + +.globl _get_MSR +_get_MSR: + mfmsr r3 + blr + +.globl _put_MSR +_put_MSR: + mtmsr r3 + blr + +/* + * Flush instruction cache + * *** I'm really paranoid here! + */ +_GLOBAL(flush_instruction_cache) + mflr r5 + bl flush_data_cache +#ifndef CONFIG_MBX + mfspr r3,HID0 /* Caches are controlled by this register */ + li r4,0 + ori r4,r4,(HID0_ICE|HID0_ICFI) + or r3,r3,r4 /* Need to enable+invalidate to clear */ + mtspr HID0,r3 + andc r3,r3,r4 + ori r3,r3,HID0_ICE /* Enable cache */ + mtspr HID0,r3 +#endif + mtlr r5 + blr +#define NUM_CACHE_LINES 128*8 +#define CACHE_LINE_SIZE 32 +#if 0 +cache_flush_buffer: + .space NUM_CACHE_LINES*CACHE_LINE_SIZE /* CAUTION! these need to match hardware */ +#else +#define cache_flush_buffer 0x1000 +#endif + +/* + * Flush data cache + * *** I'm really paranoid here! + */ +_GLOBAL(flush_data_cache) + lis r3,cache_flush_buffer@h + ori r3,r3,cache_flush_buffer@l + li r4,NUM_CACHE_LINES + mtctr r4 +#if 0 +00: dcbz 0,r3 /* Flush cache line with minimal BUS traffic */ +#else +00: lwz r4,0(r3) +#endif + addi r3,r3,CACHE_LINE_SIZE /* Next line, please */ + bdnz 00b +10: blr .comm .stack,4096*2,4 diff -u --recursive --new-file v2.1.114/linux/arch/ppc/boot/mbxtty.c linux/arch/ppc/boot/mbxtty.c --- v2.1.114/linux/arch/ppc/boot/mbxtty.c Thu Apr 23 20:21:28 1998 +++ linux/arch/ppc/boot/mbxtty.c Tue Aug 4 16:06:36 1998 @@ -6,27 +6,29 @@ * The MBX uxes SMC1 for the serial port. We reset the port and use * only the first BD that EPPC-Bug set up as a character FIFO. * - * It's a big hack, but I don't have time right now....I want a kernel - * that boots. + * Later versions (at least 1.4, maybe earlier) of the MBX EPPC-Bug + * use COM1 instead of SMC1 as the console port. This kinda sucks + * for the rest of the kernel, so here we force the use of SMC1 again. + * I f**ked around for a day trying to figure out how to make EPPC-Bug + * use SMC1, but gave up and decided to fix it here. */ #include #include #include "../8xx_io/commproc.h" -#define CPM_CPCR ((volatile ushort *)0xfa2009c0) -#define SMC1_MODE ((volatile ushort *)0xfa200a82) -#define SMC1_TBDF ((volatile bd_t *)0xfa202c90) -#define SMC1_RBDF ((volatile bd_t *)0xfa202c10) +#define MBX_CSR1 ((volatile u_char *)0xfa100000) +#define CSR1_COMEN (u_char)0x02 static cpm8xx_t *cpmp = (cpm8xx_t *)&(((immap_t *)MBX_IMAP_ADDR)->im_cpm); void -serial_init(void) +serial_init(bd_t *bd) { volatile smc_t *sp; volatile smc_uart_t *up; volatile cbd_t *tbdf, *rbdf; volatile cpm8xx_t *cp; + uint dpaddr, memaddr; cp = cpmp; sp = (smc_t*)&(cp->cp_smc[0]); @@ -34,15 +36,84 @@ /* Disable transmitter/receiver. */ - sp->smc_smcm &= ~(SMCMR_REN | SMCMR_TEN); + sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); - tbdf = (cbd_t *)&cp->cp_dpmem[up->smc_tbase]; - rbdf = (cbd_t *)&cp->cp_dpmem[up->smc_rbase]; - - /* Issue a stop transmit, and wait for it. - */ - cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC1, CPM_CR_STOP_TX) | CPM_CR_FLG; - while (cp->cp_cpcr & CPM_CR_FLG); + if (*MBX_CSR1 & CSR1_COMEN) { + /* COM1 is enabled. Initialize SMC1 and use it for + * the console port. + */ + + /* Enable SDMA. + */ + ((immap_t *)MBX_IMAP_ADDR)->im_siu_conf.sc_sdcr = 1; + + /* Use Port B for SMCs instead of other functions. + */ + cp->cp_pbpar |= 0x00000cc0; + cp->cp_pbdir &= ~0x00000cc0; + cp->cp_pbodr &= ~0x00000cc0; + + /* Allocate space for two buffer descriptors in the DP ram. + * For now, this address seems OK, but it may have to + * change with newer versions of the firmware. + */ + dpaddr = 0x0800; + + /* Grab a few bytes from the top of memory. EPPC-Bug isn't + * running any more, so we can do this. + */ + memaddr = (bd->bi_memsize - 32) & ~15; + + /* Set the physical address of the host memory buffers in + * the buffer descriptors. + */ + rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr]; + rbdf->cbd_bufaddr = memaddr; + rbdf->cbd_sc = 0; + tbdf = rbdf + 1; + tbdf->cbd_bufaddr = memaddr+4; + tbdf->cbd_sc = 0; + + /* Set up the uart parameters in the parameter ram. + */ + up->smc_rbase = dpaddr; + up->smc_tbase = dpaddr+sizeof(cbd_t); + up->smc_rfcr = SMC_EB; + up->smc_tfcr = SMC_EB; + + /* Set UART mode, 8 bit, no parity, one stop. + * Enable receive and transmit. + */ + sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; + + /* Mask all interrupts and remove anything pending. + */ + sp->smc_smcm = 0; + sp->smc_smce = 0xff; + + /* Set up the baud rate generator. + * See 8xx_io/commproc.c for details. + */ + cp->cp_simode = 0x10000000; + cp->cp_brgc1 = + ((((bd->bi_intfreq * 1000000)/16) / 9600) << 1) | CPM_BRG_EN; + + /* Enable SMC1 for console output. + */ + *MBX_CSR1 &= ~CSR1_COMEN; + } + else { + /* SMC1 is used as console port. + */ + tbdf = (cbd_t *)&cp->cp_dpmem[up->smc_tbase]; + rbdf = (cbd_t *)&cp->cp_dpmem[up->smc_rbase]; + + /* Issue a stop transmit, and wait for it. + */ + cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC1, + CPM_CR_STOP_TX) | CPM_CR_FLG; + while (cp->cp_cpcr & CPM_CR_FLG); + } /* Make the first buffer the only buffer. */ @@ -61,7 +132,7 @@ /* Enable transmitter/receiver. */ - sp->smc_smcm |= SMCMR_REN | SMCMR_TEN; + sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; } void diff -u --recursive --new-file v2.1.114/linux/arch/ppc/boot/misc.c linux/arch/ppc/boot/misc.c --- v2.1.114/linux/arch/ppc/boot/misc.c Sun Jun 7 11:16:27 1998 +++ linux/arch/ppc/boot/misc.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,7 @@ /* * misc.c + * + * $Id: misc.c,v 1.49 1998/07/26 21:29:15 geert Exp $ * * Adapted for PowerPC by Gary Thomas * @@ -12,25 +14,14 @@ #include #include #include +#include +#include #ifdef CONFIG_MBX #include bd_t hold_board_info; #endif /* - * MBX: loads at: 0x00200000 - * board data at: end of ram - * PREP: - * powerstack 1: - * network load at: configurable - should set to link addr-0x400 - * exec. addr set to link addr - * such as load: 0x005ffc00 exec 0x00600000 - * hd/floppy/tape load at: - * powerstack 2: - * loads at: 0x00400000 - * IBM 830 (carolina): - * loads at: ??? - * * Please send me load/board info and such data for hardware not * listed here so I can keep track since things are getting tricky * with the different load addrs with different firmware. This will @@ -318,16 +309,27 @@ extern unsigned long start; char *cp, ch; unsigned long i; + BATU *u; + BATL *l; lines = 25; cols = 80; orig_x = 0; orig_y = 24; - + #ifndef CONFIG_MBX + /* + * IBM's have the MMU on, so we have to disable it or + * things get really unhappy in the kernel when + * trying to setup the BATs with the MMU on + * -- Cort + */ + flush_instruction_cache(); + _put_HID0(_get_HID0() & ~0x0000C000); + _put_MSR(_get_MSR() & ~0x0030); vga_init(0xC0000000); - /* copy the residual data */ + if (residual) memcpy(&hold_residual,residual,sizeof(RESIDUAL)); #else /* CONFIG_MBX */ @@ -336,14 +338,14 @@ _bcopy((char *)residual, (char *)&hold_board_info, sizeof(hold_board_info)); #endif /* CONFIG_MBX */ - - /* MBX/prep put the board/residual data at the end of memory */ - if ( residual ) + + /* MBX/prep sometimes put the residual/board info at the end of mem + * assume 16M for now -- Cort + */ + end_avail = (char *)0x01000000; + /* let residual data tell us it's higher */ + if ( (unsigned long)residual > 0x00800000 ) end_avail = (char *)PAGE_ALIGN((unsigned long)residual); - /* prep netboot looses the residual */ - else - end_avail = (char *)0x00800000; - puts("loaded at: "); puthex(load_addr); puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n"); @@ -384,8 +386,6 @@ size of the elf header which we strip -- Cort */ zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET); zimage_size = ZIMAGE_SIZE; - puts("zimage at: "); puthex((unsigned long)zimage_start); - puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); puts("\n"); if ( INITRD_OFFSET ) initrd_start = load_addr - 0x10000 + INITRD_OFFSET; @@ -398,11 +398,32 @@ * by the uncompress code. -- Cort */ avail_ram = (char *)PAGE_ALIGN((unsigned long)zimage_start+zimage_size); - if ( (load_addr+(num_words*4)) > (unsigned long) avail_ram ) + if ( ((load_addr+(num_words*4)) > (unsigned long) avail_ram) + && (load_addr <= 0x01000000) ) avail_ram = (char *)(load_addr+(num_words*4)); - if ( ((unsigned long)&start+(num_words*4)) > (unsigned long) avail_ram ) + if ( (((unsigned long)&start+(num_words*4)) > (unsigned long) avail_ram) + && (load_addr <= 0x01000000) ) avail_ram = (char *)((unsigned long)&start+(num_words*4)); + /* relocate zimage */ + puts("zimage at: "); puthex((unsigned long)zimage_start); + puts(" "); puthex((unsigned long)(zimage_size+zimage_start)); puts("\n"); + /* + * don't relocate the zimage if it was loaded above 16M since + * things get weird if we try to relocate -- Cort + */ + if ( (unsigned long)zimage_start <= 0x01000000 ) + { + memcpy ((void *)PAGE_ALIGN(-PAGE_SIZE+(unsigned long)end_avail-zimage_size), + (void *)zimage_start, zimage_size ); + zimage_start = (char *)PAGE_ALIGN(-PAGE_SIZE+(unsigned long)end_avail-zimage_size); + end_avail = (char *)zimage_start; + puts("relocated to: "); puthex((unsigned long)zimage_start); + puts(" "); + puthex((unsigned long)zimage_size+(unsigned long)zimage_start); + puts("\n"); + } + /* relocate initrd */ if ( initrd_start ) { @@ -427,13 +448,19 @@ puts("relocated to: "); puthex(initrd_start); puts(" "); puthex(initrd_end); puts("\n"); } - + + /* this is safe, just use it */ + avail_ram = (char *)0x00400000; + end_avail = (char *)0x00600000; puts("avail ram: "); puthex((unsigned long)avail_ram); puts(" "); puthex((unsigned long)end_avail); puts("\n"); + #ifndef CONFIG_MBX CRT_tstc(); /* Forces keyboard to be initialized */ -#endif +#endif +#ifdef CONFIG_PREP +/* I need to fix this for mbx -- Cort */ puts("\nLinux/PPC load: "); timer = 0; cp = cmd_line; @@ -452,11 +479,11 @@ } break; /* Exit 'timer' loop */ } - mdelay(1); /* 1 msec */ + udelay(1000); /* 1 msec */ } *cp = 0; puts("\n"); - +#endif /* CONFIG_PREP */ /* mappings on early boot can only handle 16M */ if ( (int)(&cmd_line[0]) > (16<<20)) puts("cmd_line located > 16M\n"); diff -u --recursive --new-file v2.1.114/linux/arch/ppc/chrp_defconfig linux/arch/ppc/chrp_defconfig --- v2.1.114/linux/arch/ppc/chrp_defconfig Wed Jul 1 19:38:53 1998 +++ linux/arch/ppc/chrp_defconfig Tue Aug 4 16:06:36 1998 @@ -12,6 +12,7 @@ # CONFIG_PREP is not set CONFIG_CHRP=y # CONFIG_ALL_PPC is not set +# CONFIG_APUS is not set # CONFIG_MBX is not set CONFIG_MACH_SPECIFIC=y @@ -21,8 +22,9 @@ CONFIG_EXPERIMENTAL=y CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set -CONFIG_KMOD=y +# CONFIG_KMOD is not set CONFIG_PCI=y +# CONFIG_PCI_QUIRKS is not set CONFIG_PCI_OLD_PROC=y CONFIG_NET=y CONFIG_SYSCTL=y @@ -33,19 +35,16 @@ # CONFIG_BINFMT_MISC is not set # CONFIG_BINFMT_JAVA is not set # CONFIG_PARPORT is not set -# CONFIG_ABSTRACT_CONSOLE is not set -CONFIG_PMAC_CONSOLE=y +CONFIG_FB=y +CONFIG_FB_COMPAT_XPMAC=y +# CONFIG_PMAC_PBOOK is not set CONFIG_MAC_KEYBOARD=y # CONFIG_MAC_FLOPPY is not set +# CONFIG_MAC_SERIAL is not set CONFIG_MACMOUSE=y CONFIG_PROC_DEVICETREE=y +# CONFIG_KGDB is not set # CONFIG_XMON is not set -CONFIG_CONTROL_VIDEO=y -CONFIG_PLATINUM_VIDEO=y -CONFIG_VALKYRIE_VIDEO=y -CONFIG_ATY_VIDEO=y -CONFIG_IMSTT_VIDEO=y -CONFIG_CHIPS_VIDEO=y # # Plug and Play support @@ -53,7 +52,7 @@ # CONFIG_PNP is not set # -# Floppy, IDE, and other block devices +# Block devices # CONFIG_BLK_DEV_FD=y CONFIG_BLK_DEV_IDE=y @@ -66,9 +65,9 @@ # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_RZ1000 is not set # CONFIG_BLK_DEV_IDEPCI is not set -# CONFIG_BLK_DEV_SL82C105 is not set +CONFIG_BLK_DEV_SL82C105=y # CONFIG_IDE_CHIPSETS is not set -CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set CONFIG_BLK_DEV_RAM=y @@ -79,11 +78,6 @@ # CONFIG_BLK_DEV_HD is not set # -# NEW devices (io_request, all ALPHA and dangerous) -# -# CONFIG_IO_REQUEST is not set - -# # Networking options # # CONFIG_PACKET is not set @@ -96,7 +90,6 @@ CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set -# CONFIG_IP_ACCT is not set # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set @@ -113,12 +106,12 @@ # CONFIG_LAPB is not set # CONFIG_BRIDGE is not set # CONFIG_LLC is not set +# CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # CONFIG_CPU_IS_SLOW is not set # CONFIG_NET_SCHED is not set -# CONFIG_NET_PROFILE is not set # # SCSI support @@ -140,12 +133,7 @@ # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set -CONFIG_SCSI_AIC7XXX=m -# CONFIG_AIC7XXX_TAGGED_QUEUEING is not set -# CONFIG_OVERRIDE_CMDS is not set -# CONFIG_AIC7XXX_PAGE_ENABLE is not set -CONFIG_AIC7XXX_PROC_STATS=y -CONFIG_AIC7XXX_RESET_DELAY=15 +# CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set @@ -159,7 +147,14 @@ # CONFIG_SCSI_GENERIC_NCR5380 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NCR53C7xx is not set -# CONFIG_SCSI_NCR53C8XX is not set +CONFIG_SCSI_NCR53C8XX=y +# CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT is not set +# CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE is not set +# CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set +CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4 +CONFIG_SCSI_NCR53C8XX_SYNC=5 +# CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT is not set +# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set @@ -184,6 +179,8 @@ # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set CONFIG_NET_ETHERNET=y +# CONFIG_MACE is not set +# CONFIG_BMAC is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set @@ -196,12 +193,15 @@ # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set # CONFIG_CS89x0 is not set -CONFIG_DE4X5=y -# CONFIG_DEC_ELCP is not set +# CONFIG_DE4X5 is not set +CONFIG_DEC_ELCP=y # CONFIG_DGRS is not set # CONFIG_EEXPRESS_PRO100 is not set -# CONFIG_TLAN is not set +# CONFIG_LNE390 is not set +# CONFIG_NE2K_PCI is not set # CONFIG_ES3210 is not set +# CONFIG_EPIC100 is not set +# CONFIG_TLAN is not set # CONFIG_ZNET is not set # CONFIG_NET_POCKET is not set # CONFIG_FDDI is not set @@ -235,13 +235,13 @@ CONFIG_EXT2_FS=y CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set -CONFIG_FAT_FS=m -CONFIG_MSDOS_FS=m +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set # CONFIG_UMSDOS_FS is not set -CONFIG_VFAT_FS=m +# CONFIG_VFAT_FS is not set CONFIG_PROC_FS=y CONFIG_NFS_FS=y -CONFIG_NFSD=y +# CONFIG_NFSD is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_CODA_FS is not set @@ -252,48 +252,32 @@ # CONFIG_AFFS_FS is not set CONFIG_HFS_FS=y # CONFIG_ROMFS_FS is not set -CONFIG_AUTOFS_FS=y +# CONFIG_AUTOFS_FS is not set # CONFIG_UFS_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_DEVPTS_FS is not set CONFIG_MAC_PARTITION=y -CONFIG_NLS=y +# CONFIG_NLS is not set # -# Native Language Support +# Console drivers # -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_KOI8_R is not set +CONFIG_FB_OF=y +CONFIG_FB_S3TRIO=y +CONFIG_FB_ATY=y +CONFIG_FB_VGA=y +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FBCON_ADVANCED is not set +CONFIG_FBCON_CFB8=y +CONFIG_FBCON_CFB16=y +CONFIG_FBCON_CFB32=y +CONFIG_FBCON_VGA=y # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SOFTCURSOR is not set CONFIG_SERIAL=y # CONFIG_SERIAL_CONSOLE is not set # CONFIG_SERIAL_EXTENDED is not set @@ -317,4 +301,5 @@ # # Sound # -# CONFIG_SOUND is not set +CONFIG_SOUND=y +# CONFIG_SOUND_OSS is not set diff -u --recursive --new-file v2.1.114/linux/arch/ppc/chrpboot/Makefile linux/arch/ppc/chrpboot/Makefile --- v2.1.114/linux/arch/ppc/chrpboot/Makefile Mon Jan 12 15:18:13 1998 +++ linux/arch/ppc/chrpboot/Makefile Tue Aug 4 16:06:36 1998 @@ -49,13 +49,9 @@ initrd.o: ramdisk.image.gz piggyback ./piggyback initrd < ramdisk.image.gz | $(AS) -o initrd.o -note.data : mknote - rm -f note.data - ./mknote > note.data - -zImage: $(OBJS) no_initrd.o note.data +zImage: $(OBJS) no_initrd.o $(LD) $(LD_ARGS) -o $@ $(OBJS) no_initrd.o $(LIBS) - objcopy zImage --add-section=.note=note.data zImage + objcopy zImage zImage zImage.initrd: $(OBJS) initrd.o $(LD) $(LD_ARGS) -o $@ $(OBJS) initrd.o $(LIBS) @@ -80,7 +76,7 @@ clean: - rm -f piggyback mknote note.data + rm -f piggyback rm -f $(OBJS) zImage fastdep: diff -u --recursive --new-file v2.1.114/linux/arch/ppc/chrpboot/mknote.c linux/arch/ppc/chrpboot/mknote.c --- v2.1.114/linux/arch/ppc/chrpboot/mknote.c Mon Jan 12 15:18:13 1998 +++ linux/arch/ppc/chrpboot/mknote.c Wed Dec 31 16:00:00 1969 @@ -1,25 +0,0 @@ -struct desc -{ - unsigned long namesz; - unsigned long descrsz; - unsigned long type; - char name[8]; - unsigned long real_mode; - unsigned long real_base; - unsigned long real_size; - unsigned long virt_base; - unsigned long virt_size; - unsigned long load_base; -}; - -int main(void) -{ - struct desc ns; - ns.namesz = 8; - ns.descrsz = 24; - ns.type = 0x1275; - strcpy(ns.name, "PowerPC"); - ns.load_base = -1; - write( 1, &ns, sizeof(struct desc)); - return 0; -} diff -u --recursive --new-file v2.1.114/linux/arch/ppc/coffboot/main.c linux/arch/ppc/coffboot/main.c --- v2.1.114/linux/arch/ppc/coffboot/main.c Thu Apr 23 20:21:28 1998 +++ linux/arch/ppc/coffboot/main.c Tue Aug 4 16:06:36 1998 @@ -50,6 +50,7 @@ } setup_bats(RAM_START); + loadbase += RAM_START; eh = (struct external_filehdr *) loadbase; ns = get_16be(eh->f_nscns); oh = get_16be(eh->f_opthdr); diff -u --recursive --new-file v2.1.114/linux/arch/ppc/common_defconfig linux/arch/ppc/common_defconfig --- v2.1.114/linux/arch/ppc/common_defconfig Wed Jul 1 19:38:53 1998 +++ linux/arch/ppc/common_defconfig Tue Aug 4 16:06:36 1998 @@ -12,6 +12,7 @@ # CONFIG_PREP is not set # CONFIG_CHRP is not set CONFIG_ALL_PPC=y +# CONFIG_APUS is not set # CONFIG_MBX is not set # @@ -20,8 +21,9 @@ CONFIG_EXPERIMENTAL=y CONFIG_MODULES=y CONFIG_MODVERSIONS=y -CONFIG_KMOD=y +# CONFIG_KMOD is not set CONFIG_PCI=y +# CONFIG_PCI_QUIRKS is not set CONFIG_PCI_OLD_PROC=y CONFIG_NET=y CONFIG_SYSCTL=y @@ -32,14 +34,15 @@ # CONFIG_BINFMT_MISC is not set # CONFIG_BINFMT_JAVA is not set # CONFIG_PARPORT is not set -CONFIG_ABSTRACT_CONSOLE=y CONFIG_FB=y -CONFIG_VGA_CONSOLE=y CONFIG_FB_COMPAT_XPMAC=y +# CONFIG_PMAC_PBOOK is not set CONFIG_MAC_KEYBOARD=y -CONFIG_MAC_FLOPPY=y -CONFIG_MACMOUSE=y +# CONFIG_MAC_FLOPPY is not set +# CONFIG_MAC_SERIAL is not set +# CONFIG_MACMOUSE is not set CONFIG_PROC_DEVICETREE=y +# CONFIG_KGDB is not set # CONFIG_XMON is not set # @@ -48,7 +51,7 @@ # CONFIG_PNP is not set # -# Floppy, IDE, and other block devices +# Block devices # CONFIG_BLK_DEV_FD=y CONFIG_BLK_DEV_IDE=y @@ -61,6 +64,7 @@ # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_RZ1000 is not set # CONFIG_BLK_DEV_IDEPCI is not set +CONFIG_BLK_DEV_SL82C105=y # CONFIG_IDE_CHIPSETS is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set @@ -73,11 +77,6 @@ # CONFIG_BLK_DEV_HD is not set # -# NEW devices (io_request, all ALPHA and dangerous) -# -# CONFIG_IO_REQUEST is not set - -# # Networking options # # CONFIG_PACKET is not set @@ -90,7 +89,6 @@ # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set -CONFIG_IP_ACCT=y # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set @@ -106,12 +104,12 @@ # CONFIG_LAPB is not set # CONFIG_BRIDGE is not set # CONFIG_LLC is not set +# CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # CONFIG_CPU_IS_SLOW is not set # CONFIG_NET_SCHED is not set -# CONFIG_NET_PROFILE is not set # # SCSI support @@ -165,6 +163,7 @@ # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_ULTRASTOR is not set +# CONFIG_SCSI_DEBUG is not set CONFIG_SCSI_MESH=y CONFIG_SCSI_MESH_SYNC_RATE=5 CONFIG_SCSI_MAC53C94=y @@ -177,6 +176,8 @@ # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set CONFIG_NET_ETHERNET=y +# CONFIG_MACE is not set +# CONFIG_BMAC is not set # CONFIG_NET_VENDOR_3COM is not set CONFIG_LANCE=y # CONFIG_NET_VENDOR_SMC is not set @@ -193,13 +194,16 @@ # CONFIG_DEC_ELCP is not set # CONFIG_DGRS is not set # CONFIG_EEXPRESS_PRO100 is not set -# CONFIG_TLAN is not set +# CONFIG_LNE390 is not set +# CONFIG_NE2K_PCI is not set # CONFIG_ES3210 is not set +# CONFIG_EPIC100 is not set +# CONFIG_TLAN is not set # CONFIG_ZNET is not set # CONFIG_NET_POCKET is not set # CONFIG_FDDI is not set # CONFIG_DLCI is not set -CONFIG_PPP=y +# CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_RADIO is not set # CONFIG_TR is not set @@ -227,14 +231,14 @@ # CONFIG_MINIX_FS is not set CONFIG_EXT2_FS=y CONFIG_ISO9660_FS=y -CONFIG_JOLIET=y -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y +# CONFIG_JOLIET is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set # CONFIG_UMSDOS_FS is not set -CONFIG_VFAT_FS=y +# CONFIG_VFAT_FS is not set CONFIG_PROC_FS=y CONFIG_NFS_FS=y -CONFIG_NFSD=y +# CONFIG_NFSD is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_CODA_FS is not set @@ -248,58 +252,30 @@ # CONFIG_AUTOFS_FS is not set # CONFIG_UFS_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_DEVPTS_FS is not set CONFIG_MAC_PARTITION=y -CONFIG_NLS=y - -# -# Native Language Support -# -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS is not set # -# Frame buffer devices +# Console drivers # -CONFIG_FB_OPEN_FIRMWARE=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FB_OF=y # CONFIG_FB_S3TRIO is not set # CONFIG_FB_ATY is not set +# CONFIG_FB_CT65550 is not set +CONFIG_FB_VGA=y # CONFIG_FB_VIRTUAL is not set # CONFIG_FBCON_ADVANCED is not set -CONFIG_FBCON_MFB=y CONFIG_FBCON_CFB8=y +CONFIG_FBCON_VGA=y # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SOFTCURSOR is not set -CONFIG_SERIAL=y -# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL is not set # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_MOUSE=y diff -u --recursive --new-file v2.1.114/linux/arch/ppc/config.in linux/arch/ppc/config.in --- v2.1.114/linux/arch/ppc/config.in Wed Jun 24 22:54:03 1998 +++ linux/arch/ppc/config.in Tue Aug 4 16:06:36 1998 @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.53 1998/05/02 12:06:12 davem Exp $ +# $Id: config.in,v 1.65 1998/07/20 18:42:27 geert Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -51,12 +51,12 @@ else define_bool CONFIG_PCI y fi -if [ "$CONFIG_PREP" = "y" ]; then - bool 'PCI quirks' CONFIG_PCI_QUIRKS - if [ "$CONFIG_PCI_QUIRKS" = "y" ]; then - bool ' PCI bridge optimization' CONFIG_PCI_OPTIMIZE - fi + +bool 'PCI quirks' CONFIG_PCI_QUIRKS +if [ "$CONFIG_PCI_QUIRKS" = "y" ]; then + bool ' PCI bridge optimization' CONFIG_PCI_OPTIMIZE fi + bool 'Backward-compatible /proc/pci' CONFIG_PCI_OLD_PROC bool 'Networking support' CONFIG_NET bool 'Sysctl support' CONFIG_SYSCTL @@ -80,22 +80,12 @@ bool 'Support for frame buffer devices' CONFIG_FB if [ "$CONFIG_FB" = "y" ]; then bool 'Backward compatibility mode for Xpmac' CONFIG_FB_COMPAT_XPMAC -else - define_bool CONFIG_ABSCON_COMPAT y fi - -if [ "$CONFIG_PMAC" = "y" ]; then - if [ "$CONFIG_FB" != "y" ]; then - define_bool CONFIG_PMAC_CONSOLE y - fi -else -# if compiling specifically for prep or chrp, or supporting all arch's - if [ "$CONFIG_FB" = "y" ]; then - bool 'Support for VGA devices' CONFIG_VGA_CONSOLE - else - bool 'Support for PowerMac console' CONFIG_PMAC_CONSOLE - fi +if [ "$CONFIG_FB" != "y" ]; then + bool 'Support for VGA Console' CONFIG_VGA_CONSOLE fi + +bool 'Power management support for PowerBook 3400/2400' CONFIG_PMAC_PBOOK bool 'Support for PowerMac keyboard' CONFIG_MAC_KEYBOARD bool 'Support for PowerMac floppy' CONFIG_MAC_FLOPPY bool 'Support for PowerMac serial ports' CONFIG_MAC_SERIAL @@ -106,17 +96,25 @@ bool 'Include kgdb kernel debugger' CONFIG_KGDB bool 'Include xmon kernel debugger' CONFIG_XMON -if [ "$CONFIG_FB" != "y" ]; then - if [ "$CONFIG_PMAC_CONSOLE" = "y" ]; then - bool 'Support for Apple "control" display' CONFIG_CONTROL_VIDEO - bool 'Support for Apple "platinum" display' CONFIG_PLATINUM_VIDEO - bool 'Support for Apple "valkyrie" display' CONFIG_VALKYRIE_VIDEO - bool 'Support for ATI Mach64 display cards' CONFIG_ATY_VIDEO - bool 'Support for IMS Twin Turbo display card' CONFIG_IMSTT_VIDEO - bool 'Support for Chips 65550 display' CONFIG_CHIPS_VIDEO - else - define_bool CONFIG_VGA_CONSOLE y +if [ "$CONFIG_APUS" = "y" ]; then + define_bool CONFIG_FB_CONSOLE y + define_bool CONFIG_AMIGA y + define_bool CONFIG_ZORRO y + define_bool CONFIG_AMIGAMOUSE y + define_bool CONFIG_ABSTRACT_CONSOLE y + define_bool CONFIG_FB y + tristate 'Amiga floppy support' CONFIG_AMIGA_FLOPPY + bool 'Amiga Gayle IDE interface support' CONFIG_BLK_DEV_GAYLE + tristate 'Amiga builtin serial support' CONFIG_AMIGA_BUILTIN_SERIAL + tristate 'GVP IO-Extender support' CONFIG_GVPIOEXT + dep_tristate 'GVP IO-Extender parallel printer support' CONFIG_GVPIOEXT_LP $CONFIG_GVPIOEXT + dep_tristate 'GVP IO-Extender PLIP support' CONFIG_GVPIOEXT_PLIP $CONFIG_GVPIOEXT + tristate 'Multiface Card III serial support' CONFIG_MULTIFACE_III_TTY + if [ "$CONFIG_AMIGA_BUILTIN_SERIAL" = "y" -o "$CONFIG_GVPIOEXT" = "y" -o \ + "$CONFIG_MULTIFACE_III_TTY" = "y" ]; then + bool 'Support for serial port console' CONFIG_SERIAL_CONSOLE fi +bool '/proc/hardware support' CONFIG_PROC_HARDWARE fi endmenu @@ -174,16 +172,24 @@ source fs/nls/Config.in +mainmenu_option next_comment +comment 'Console drivers' source drivers/video/Config.in +endmenu source drivers/char/Config.in -#mainmenu_option next_comment -#comment 'Sound' -# -#tristate 'Sound card support' CONFIG_SOUND -#if [ "$CONFIG_SOUND" != "n" ]; then -# source drivers/sound/Config.in -#fi -# -#endmenu +mainmenu_option next_comment +comment 'Sound' + +tristate 'Sound card support' CONFIG_SOUND +if [ "$CONFIG_SOUND" != "n" ]; then + if [ "$CONFIG_APUS" = "y" -o "$CONFIG_PMAC" = "y" ]; then + tristate 'Amiga or PowerMac DMA sound support' CONFIG_DMASOUND + fi + if [ "$CONFIG_PREP" = "y" -o "$CONFIG_CHRP" = "y" ]; then + source drivers/sound/Config.in + fi +fi + +endmenu diff -u --recursive --new-file v2.1.114/linux/arch/ppc/defconfig linux/arch/ppc/defconfig --- v2.1.114/linux/arch/ppc/defconfig Fri May 8 23:14:44 1998 +++ linux/arch/ppc/defconfig Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ # -# Automatically generated make config: don't edit +# Automatically generated by make menuconfig: don't edit # # @@ -24,6 +24,7 @@ # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y CONFIG_PCI=y +# CONFIG_PCI_QUIRKS is not set CONFIG_PCI_OLD_PROC=y CONFIG_NET=y CONFIG_SYSCTL=y @@ -34,8 +35,9 @@ CONFIG_BINFMT_MISC=m # CONFIG_BINFMT_JAVA is not set # CONFIG_PARPORT is not set -# CONFIG_ABSTRACT_CONSOLE is not set -CONFIG_PMAC_CONSOLE=y +# CONFIG_FB is not set +# CONFIG_VGA_CONSOLE is not set +# CONFIG_PMAC_PBOOK is not set CONFIG_MAC_KEYBOARD=y CONFIG_MAC_FLOPPY=y CONFIG_MAC_SERIAL=y @@ -43,12 +45,6 @@ CONFIG_PROC_DEVICETREE=y # CONFIG_KGDB is not set # CONFIG_XMON is not set -CONFIG_CONTROL_VIDEO=y -CONFIG_PLATINUM_VIDEO=y -CONFIG_VALKYRIE_VIDEO=y -CONFIG_ATY_VIDEO=y -CONFIG_IMSTT_VIDEO=y -CONFIG_CHIPS_VIDEO=y # # Plug and Play support @@ -56,14 +52,10 @@ # CONFIG_PNP is not set # -# Floppy, IDE, and other block devices +# Block devices # # CONFIG_BLK_DEV_FD is not set CONFIG_BLK_DEV_IDE=y - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y CONFIG_BLK_DEV_IDECD=y @@ -73,11 +65,8 @@ # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_RZ1000 is not set # CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_BLK_DEV_SL82C105 is not set # CONFIG_IDE_CHIPSETS is not set - -# -# Additional Block Devices -# # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set @@ -91,8 +80,10 @@ # # Networking options # -# CONFIG_PACKET is not set -# CONFIG_NETLINK is not set +CONFIG_PACKET=y +CONFIG_NETLINK=y +# CONFIG_RTNETLINK is not set +# CONFIG_NETLINK_DEV is not set # CONFIG_FIREWALL is not set CONFIG_NET_ALIAS=y # CONFIG_FILTER is not set @@ -101,25 +92,16 @@ CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set -# CONFIG_IP_ACCT is not set # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set CONFIG_IP_ALIAS=y # CONFIG_SYN_COOKIES is not set - -# -# (it is safe to leave these untouched) -# CONFIG_INET_RARP=y CONFIG_IP_NOSR=y CONFIG_SKB_LARGE=y # CONFIG_IPV6 is not set - -# -# -# # CONFIG_IPX is not set CONFIG_ATALK=m # CONFIG_X25 is not set @@ -132,25 +114,16 @@ # CONFIG_NET_HW_FLOWCONTROL is not set # CONFIG_CPU_IS_SLOW is not set # CONFIG_NET_SCHED is not set -# CONFIG_NET_PROFILE is not set # # SCSI support # CONFIG_SCSI=y - -# -# SCSI support type (disk, tape, CD-ROM) -# CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_ST=y CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR_VENDOR=y # CONFIG_CHR_DEV_SG is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set @@ -203,8 +176,10 @@ # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set +# CONFIG_ETHERTAP is not set CONFIG_NET_ETHERNET=y CONFIG_MACE=y +CONFIG_BMAC=y # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set @@ -221,9 +196,11 @@ CONFIG_DEC_ELCP=m # CONFIG_DGRS is not set # CONFIG_EEXPRESS_PRO100 is not set +# CONFIG_LNE390 is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_TLAN is not set # CONFIG_ES3210 is not set # CONFIG_EPIC100 is not set -# CONFIG_TLAN is not set # CONFIG_ZNET is not set # CONFIG_NET_POCKET is not set # CONFIG_FDDI is not set @@ -232,10 +209,6 @@ # CONFIG_COPS is not set # CONFIG_IPDDP is not set CONFIG_PPP=m - -# -# CCP compressors for PPP are only built as modules. -# # CONFIG_SLIP is not set # CONFIG_NET_RADIO is not set # CONFIG_TR is not set @@ -319,11 +292,14 @@ # CONFIG_NLS_KOI8_R is not set # +# Console drivers +# + +# # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SOFTCURSOR is not set # CONFIG_SERIAL is not set # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -336,9 +312,13 @@ # CONFIG_VIDEO_DEV is not set CONFIG_NVRAM=y # CONFIG_JOYSTICK is not set -# CONFIG_MISC_RADIO is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set + +# +# Sound +# +# CONFIG_SOUND is not set diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/Makefile linux/arch/ppc/kernel/Makefile --- v2.1.114/linux/arch/ppc/kernel/Makefile Fri May 8 23:14:44 1998 +++ linux/arch/ppc/kernel/Makefile Tue Aug 4 16:06:36 1998 @@ -15,11 +15,7 @@ O_OBJS := traps.o irq.o idle.o time.o process.o signal.o syscalls.o misc.o \ - bitops.o setup.o ptrace.o align.o - -ifndef CONFIG_8xx -O_OBJS += ppc_htab.o -endif + bitops.o setup.o ptrace.o align.o ppc_htab.o ifdef CONFIG_PCI O_OBJS += pci.o @@ -32,12 +28,13 @@ O_OBJS += mbx_setup.o mbx_pci.o softemu8xx.o else ifeq ($(CONFIG_APUS),y) -O_OBJS += prom.o openpic.o +O_OBJS += apus_setup.o prom.o openpic.o else O_OBJS += prep_time.o pmac_time.o chrp_time.o \ - prep_setup.o pmac_setup.o pmac_support.o chrp_setup.o \ + pmac_setup.o pmac_support.o chrp_setup.o \ prep_pci.o pmac_pci.o chrp_pci.o \ residual.o prom.o openpic.o +OX_OBJS += prep_setup.o endif endif diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/apus_setup.c linux/arch/ppc/kernel/apus_setup.c --- v2.1.114/linux/arch/ppc/kernel/apus_setup.c Wed Dec 31 16:00:00 1969 +++ linux/arch/ppc/kernel/apus_setup.c Tue Aug 4 16:06:36 1998 @@ -0,0 +1,314 @@ +/* + * linux/arch/ppc/kernel/apus_setup.c + * + * Copyright (C) 1998 Jesper Skov + * + * Basically what is needed to replace functionality found in + * arch/m68k allowing Amiga drivers to work under APUS. + * Bits of code and/or ideas from arch/m68k and arch/ppc files. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +unsigned long m68k_machtype; +char debug_device[6] = ""; + +void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata; +/* machine dependent keyboard functions */ +int (*mach_keyb_init) (void) __initdata; +int (*mach_kbdrate) (struct kbd_repeat *) = NULL; +void (*mach_kbd_leds) (unsigned int) = NULL; +/* machine dependent irq functions */ +void (*mach_init_IRQ) (void) __initdata; +void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL; +void (*mach_get_model) (char *model) = NULL; +int (*mach_get_hardware_list) (char *buffer) = NULL; +int (*mach_get_irq_list) (char *) = NULL; +void (*mach_process_int) (int, struct pt_regs *) = NULL; +/* machine dependent timer functions */ +unsigned long (*mach_gettimeoffset) (void); +void (*mach_gettod) (int*, int*, int*, int*, int*, int*); +int (*mach_hwclk) (int, struct hwclk_time*) = NULL; +int (*mach_set_clock_mmss) (unsigned long) = NULL; +void (*mach_reset)( void ); +long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */ +#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) +void (*mach_floppy_setup) (char *, int *) __initdata = NULL; +void (*mach_floppy_eject) (void) = NULL; +#endif +#ifdef CONFIG_HEARTBEAT +void (*mach_heartbeat) (int) = NULL; +#endif + +extern unsigned long amiga_model; +extern unsigned decrementer_count;/* count value for 1e6/HZ microseconds */ +extern unsigned count_period_num; /* 1 decrementer count equals */ +extern unsigned count_period_den; /* count_period_num / count_period_den us */ + +extern struct mem_info memory[NUM_MEMINFO];/* memory description */ + +extern void amiga_floppy_setup(char *, int *); +extern void config_amiga(void); + +/*********************************************************** SETUP */ +/* From arch/m68k/kernel/setup.c. */ +__initfunc(void apus_setup_arch(unsigned long * memory_start_p, + unsigned long * memory_end_p)) +{ + extern char cmd_line[]; + int i; + char *p, *q; + + /* Parse the command line for arch-specific options. + * For the m68k, this is currently only "debug=xxx" to enable printing + * certain kernel messages to some machine-specific device. */ + for( p = cmd_line; p && *p; ) { + i = 0; + if (!strncmp( p, "debug=", 6 )) { + strncpy( debug_device, p+6, sizeof(debug_device)-1 ); + debug_device[sizeof(debug_device)-1] = 0; + if ((q = strchr( debug_device, ' ' ))) *q = 0; + i = 1; + } + + if (i) { + /* option processed, delete it */ + if ((q = strchr( p, ' ' ))) + strcpy( p, q+1 ); + else + *p = 0; + } else { + if ((p = strchr( p, ' ' ))) ++p; + } + } + + config_amiga(); +} + +void apus_calibrate_decr(void) +{ + int freq, divisor; + unsigned char c = *(unsigned char*)ZTWO_VADDR(0xf00011); + + switch (c) + { + case 'A': + case 'B': + if (amiga_model == AMI_1200 || amiga_model == AMI_2000){ + freq = 1; + } else { + freq = 0; + } + break; + case 'C': + if (amiga_model == AMI_1200 || amiga_model == AMI_2000){ + freq = 0; + } else { + freq = 1; + } + break; + case 'D': + freq = 1; + break; + default: + freq = 0; + printk (" *Unknown CPU speed ID ('%c')* ", c); + break; + } + + { + int speed; + switch (freq) + { + case 0: + freq = 15000000; + speed = 60; + + /* Use status of left mouse button to select + RAM speed. */ + if (!(ciaa.pra & 0x40)) + { + APUS_WRITE (APUS_REG_WAITSTATE, + REGWAITSTATE_SETRESET + |REGWAITSTATE_PPCR + |REGWAITSTATE_PPCW); + printk (" [RAM R/W waitstate removed. " + "(expecting 60ns RAM).] "); + } + break; + case 1: + freq = 16500000; + speed = 66; + break; + } + printk ("PowerUp Bus Speed: %dMHz\n", speed); + } + + freq *= 60; /* try to make freq/1e6 an integer */ + divisor = 60; + printk("time_init: decrementer frequency = %d/%d\n", freq, divisor); + decrementer_count = freq / HZ / divisor; + count_period_num = divisor; + count_period_den = freq / 1000000; +} + +void arch_gettod(int *year, int *mon, int *day, int *hour, + int *min, int *sec) +{ + if (mach_gettod) + mach_gettod(year, mon, day, hour, min, sec); + else + *year = *mon = *day = *hour = *min = *sec = 0; +} + +/*********************************************************** FLOPPY */ +#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) +__initfunc(void floppy_setup(char *str, int *ints)) +{ + if (mach_floppy_setup) + mach_floppy_setup (str, ints); +} + +void floppy_eject(void) +{ + if (mach_floppy_eject) + mach_floppy_eject(); +} +#endif + +/*********************************************************** MEMORY */ +extern void +map_page(struct task_struct *tsk, unsigned long va, + unsigned long pa, int flags); + +#define KMAP_MAX 8 +static unsigned long kmap_chunks[KMAP_MAX*3]; +static int kmap_chunk_count = 0; + +/* Based on arch/ppc/mm/init.c:ioremap() which maps the address range + to the same virtual address as the physical address - which may + cause problems since Z3 IO space is not the same as PCI/ISA. + This should be rewritten to something more like the m68k version. */ +unsigned long kernel_map (unsigned long phys_addr, unsigned long size, + int cacheflag, unsigned long *memavailp) +{ + unsigned long v_ret, end; + /* Remap to 0x90000000. Related comment in ppc/mm/init.c. */ + static unsigned long virt = 0x90000000; + v_ret = virt; + + if (kmap_chunk_count == KMAP_MAX*3) + panic ("kernel_map: Can only map %d chunks.\n", + KMAP_MAX); + + kmap_chunks[kmap_chunk_count++] = phys_addr; + kmap_chunks[kmap_chunk_count++] = size; + kmap_chunks[kmap_chunk_count++] = v_ret; + + for (end = phys_addr + size ; phys_addr < end; + phys_addr += PAGE_SIZE, virt += PAGE_SIZE) { + map_page(&init_task, virt, phys_addr, + pgprot_val(PAGE_KERNEL_CI) | _PAGE_GUARDED); + } + return v_ret; +} + +unsigned long mm_ptov (unsigned long paddr) +{ + unsigned long ret; + if (paddr < 16*1024*1024) + ret = ZTWO_VADDR(paddr); + else { + int i; + + for (i = 0; i < kmap_chunk_count;){ + unsigned long virt = kmap_chunks[i++]; + unsigned long size = kmap_chunks[i++]; + unsigned long phys = kmap_chunks[i++]; + if (paddr >= phys + && paddr < (phys + size)){ + ret = virt + paddr - phys; + goto exit; + } + } + + ret = (unsigned long) __va(paddr); + } +exit: +#ifdef DEBUGPV + printk ("PTOV(%lx)=%lx\n", paddr, ret); +#endif + return ret; +} + +int mm_end_of_chunk (unsigned long addr, int len) +{ + if (memory[0].addr + memory[0].size == addr + len) + return 1; + return 0; +} + +/*********************************************************** CACHE */ + +#define L1_CACHE_BYTES 32 +#define MAX_CACHE_SIZE 8192 +void cache_push(__u32 addr, int length) +{ + addr = mm_ptov(addr); + + if (MAX_CACHE_SIZE < length) + length = MAX_CACHE_SIZE; + + while(length > 0){ + __asm ("dcbf 0,%0\n\t" + : : "r" (addr)); + addr += L1_CACHE_BYTES; + length -= L1_CACHE_BYTES; + } + /* Also flush trailing block */ + __asm ("dcbf 0,%0\n\t" + "sync \n\t" + : : "r" (addr)); +} +void cache_clear(__u32 addr, int length) +{ + if (MAX_CACHE_SIZE < length) + length = MAX_CACHE_SIZE; + + addr = mm_ptov(addr); + + __asm ("dcbf 0,%0\n\t" + "sync \n\t" + "icbi 0,%0 \n\t" + "isync \n\t" + : : "r" (addr)); + + addr += L1_CACHE_BYTES; + length -= L1_CACHE_BYTES; + + while(length > 0){ + __asm ("dcbf 0,%0\n\t" + "sync \n\t" + "icbi 0,%0 \n\t" + "isync \n\t" + : : "r" (addr)); + addr += L1_CACHE_BYTES; + length -= L1_CACHE_BYTES; + } + + __asm ("dcbf 0,%0\n\t" + "sync \n\t" + "icbi 0,%0 \n\t" + "isync \n\t" + : : "r" (addr)); +} diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/checks.c linux/arch/ppc/kernel/checks.c --- v2.1.114/linux/arch/ppc/kernel/checks.c Mon Jan 12 15:18:13 1998 +++ linux/arch/ppc/kernel/checks.c Tue Aug 4 16:06:36 1998 @@ -15,7 +15,6 @@ #include #include #include -#include /* * Do various before compile checks of data structures diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/chrp_pci.c linux/arch/ppc/kernel/chrp_pci.c --- v2.1.114/linux/arch/ppc/kernel/chrp_pci.c Thu Apr 23 20:21:28 1998 +++ linux/arch/ppc/kernel/chrp_pci.c Tue Aug 4 16:06:36 1998 @@ -22,14 +22,13 @@ volatile struct Hydra *Hydra = NULL; -#if 1 /* * The VLSI Golden Gate II has only 512K of PCI configuration space, so we * limit the bus number to 3 bits */ -int chrp_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char *val) +int gg2_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned char *val) { if (bus > 7) { *val = 0xff; @@ -39,8 +38,8 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short *val) +int gg2_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned short *val) { if (bus > 7) { *val = 0xffff; @@ -51,8 +50,8 @@ } -int chrp_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int *val) +int gg2_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned int *val) { if (bus > 7) { *val = 0xffffffff; @@ -62,8 +61,8 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char val) +int gg2_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned char val) { if (bus > 7) return PCIBIOS_DEVICE_NOT_FOUND; @@ -71,8 +70,8 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short val) +int gg2_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned short val) { if (bus > 7) return PCIBIOS_DEVICE_NOT_FOUND; @@ -80,21 +79,21 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int val) +int gg2_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned int val) { if (bus > 7) return PCIBIOS_DEVICE_NOT_FOUND; out_le32((unsigned int *)pci_config_addr(bus, dev_fn, offset), val); return PCIBIOS_SUCCESSFUL; } -#else -volatile unsigned int *pci_config_address=(volatile unsigned int *)0xfec00cf8; -volatile unsigned char *pci_config_data=(volatile unsigned char *)0xfee00cfc; + +extern volatile unsigned int *pci_config_address; +extern volatile unsigned char *pci_config_data; #define DEV_FN_MAX (31<<3) -int chrp_pcibios_read_config_byte(unsigned char bus, +int raven_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned char *val) @@ -106,7 +105,7 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_read_config_word(unsigned char bus, +int raven_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned short *val) @@ -120,7 +119,7 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_read_config_dword(unsigned char bus, +int raven_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned int *val) @@ -133,7 +132,7 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_write_config_byte(unsigned char bus, +int raven_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned char val) @@ -145,7 +144,7 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_write_config_word(unsigned char bus, +int raven_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned short val) @@ -158,7 +157,7 @@ return PCIBIOS_SUCCESSFUL; } -int chrp_pcibios_write_config_dword(unsigned char bus, +int raven_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned int val) @@ -170,7 +169,6 @@ out_le32((volatile unsigned int *)pci_config_data,val); return PCIBIOS_SUCCESSFUL; } -#endif /* * Temporary fixes for PCI devices. These should be replaced by OF query @@ -224,15 +222,17 @@ __initfunc(int w83c553f_init(void)) { u_char bus, dev; +#if 0 unsigned char t8; unsigned short t16; +#endif unsigned int t32; struct pci_dev *pdev; if ((pdev = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, NULL))) { bus = pdev->bus->number; dev = pdev->devfn + 1; - chrp_pcibios_read_config_dword(bus, dev, PCI_VENDOR_ID, &t32); + pcibios_read_config_dword(bus, dev, PCI_VENDOR_ID, &t32); if (t32 == (PCI_DEVICE_ID_WINBOND_82C105<<16) + PCI_VENDOR_ID_WINBOND) { #if 0 printk("Enabling SL82C105 IDE on W83C553F\n"); @@ -241,46 +241,46 @@ */ /* I/O mapping */ - chrp_pcibios_read_config_word(bus, dev, PCI_COMMAND, &t16); + pcibios_read_config_word(bus, dev, PCI_COMMAND, &t16); t16 |= PCI_COMMAND_IO; - chrp_pcibios_write_config_word(bus, dev, PCI_COMMAND, t16); + pcibios_write_config_word(bus, dev, PCI_COMMAND, t16); /* Standard IDE registers */ - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_0, + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_0, 0xffffffff); - chrp_pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_0, &t32); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_0, + pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_0, &t32); + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_0, 0x000001f0 | 1); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_1, + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_1, 0xffffffff); - chrp_pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_1, &t32); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_1, + pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_1, &t32); + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_1, 0x000003f4 | 1); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_2, + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_2, 0xffffffff); - chrp_pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_2, &t32); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_2, + pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_2, &t32); + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_2, 0x00000170 | 1); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_3, + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_3, 0xffffffff); - chrp_pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_3, &t32); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_3, + pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_3, &t32); + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_3, 0x00000374 | 1); /* IDE Bus Master Control */ - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_4, + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_4, 0xffffffff); - chrp_pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_4, &t32); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_4, + pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_4, &t32); + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_4, 0x1000 | 1); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_5, + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_5, 0xffffffff); - chrp_pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_5, &t32); - chrp_pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_5, + pcibios_read_config_dword(bus, dev, PCI_BASE_ADDRESS_5, &t32); + pcibios_write_config_dword(bus, dev, PCI_BASE_ADDRESS_5, 0x1010 | 1); /* IDE Interrupt */ - chrp_pcibios_read_config_byte(bus, dev, PCI_INTERRUPT_LINE, &t8); + pcibios_read_config_byte(bus, dev, PCI_INTERRUPT_LINE, &t8); chrp_ide_irq = t8; #endif return 1; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/chrp_setup.c linux/arch/ppc/kernel/chrp_setup.c --- v2.1.114/linux/arch/ppc/kernel/chrp_setup.c Thu Jul 16 18:09:24 1998 +++ linux/arch/ppc/kernel/chrp_setup.c Tue Aug 4 16:06:36 1998 @@ -72,34 +72,6 @@ "Disabled", "Write-Through", "Copy-Back", "Transparent Mode" }; -#if 0 -#ifdef CONFIG_BLK_DEV_IDE -int chrp_ide_ports_known; -ide_ioreg_t chrp_ide_regbase[MAX_HWIFS]; -ide_ioreg_t chrp_idedma_regbase; /* one for both channels */ -unsigned int chrp_ide_irq; - -void chrp_ide_probe(void) -{ -} - -__initfunc(void chrp_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq)) -{ - int i; - - *p = 0; - if (base == 0) - return; - for (i = 0; i < 8; ++i) - *p++ = base + i * 0x10; - *p = base + 0x160; - if (irq != NULL) { - *irq = chrp_ide_irq; - } -} -#endif /* CONFIG_BLK_DEV_IDE */ -#endif - int chrp_get_cpuinfo(char *buffer) { @@ -175,35 +147,35 @@ return inb(0x15d); } -__initfunc(static void sio_init(void)) +__initfunc(static void sio_fixup_irq(const char *name, u8 device, u8 level, + u8 type)) { - u8 irq, type; + u8 level0, type0, active; - /* select logical device 0 (KBC/Keyboard) */ - sio_write(0, 0x07); - irq = sio_read(0x70); - type = sio_read(0x71); - printk("sio: Keyboard irq %d, type %d: ", irq, type); - if (irq == 1 && type == 3) + /* select logical device */ + sio_write(device, 0x07); + active = sio_read(0x30); + level0 = sio_read(0x70); + type0 = sio_read(0x71); + printk("sio: %s irq level %d, type %d, %sactive: ", name, level0, type0, + !active ? "in" : ""); + if (level0 == level && type0 == type && active) printk("OK\n"); else { - printk("remapping to irq 1, type 3\n"); - sio_write(1, 0x70); - sio_write(3, 0x71); + printk("remapping to level %d, type %d, active\n", level, type); + sio_write(0x01, 0x30); + sio_write(level, 0x70); + sio_write(type, 0x71); } +} + +__initfunc(static void sio_init(void)) +{ + /* logical device 0 (KBC/Keyboard) */ + sio_fixup_irq("keyboard", 0, 1, 2); /* select logical device 1 (KBC/Mouse) */ - sio_write(1, 0x07); - irq = sio_read(0x70); - type = sio_read(0x71); - printk("sio: Mouse irq %d, type %d: ", irq, type); - if (irq == 12 && type == 3) - printk("OK\n"); - else { - printk("remapping to irq 12, type 3\n"); - sio_write(12, 0x70); - sio_write(3, 0x71); - } + sio_fixup_irq("mouse", 1, 12, 2); } @@ -219,20 +191,6 @@ ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the kernel) */ -#ifdef CONFIG_BLK_DEV_INITRD - /* initrd_start and size are setup by boot/head.S and kernel/head.S */ - if ( initrd_start ) - { - if (initrd_end > *memory_end_p) - { - printk("initrd extends beyond end of memory " - "(0x%08lx > 0x%08lx)\ndisabling initrd\n", - initrd_end,*memory_end_p); - initrd_start = 0; - } - } -#endif - printk("Boot arguments: %s\n", cmd_line); request_region(0x20,0x20,"pic1"); @@ -260,9 +218,5 @@ #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; -#endif -#ifdef CONFIG_ABSCON_COMPAT - /* Console wrapper */ - conswitchp = &compat_con; #endif } diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/head.S linux/arch/ppc/kernel/head.S --- v2.1.114/linux/arch/ppc/kernel/head.S Fri May 8 23:14:44 1998 +++ linux/arch/ppc/kernel/head.S Tue Aug 4 16:06:36 1998 @@ -1,6 +1,8 @@ /* * arch/ppc/kernel/head.S * + * $Id: head.S,v 1.98 1998/07/26 21:28:48 geert Exp $ + * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * @@ -31,11 +33,9 @@ #include #include #include -#ifdef CONFIG_8xx #include #include #include -#endif #ifdef CONFIG_APUS #include @@ -200,9 +200,7 @@ mr r28,r6 mr r27,r7 #ifndef CONFIG_8xx -#ifndef CONFIG_APUS bl prom_init -#endif /* * Use the first pair of BAT registers to map the 1st 16MB @@ -221,10 +219,12 @@ mtspr IBAT1U,r9 mtspr IBAT1L,r10 b 5f -4: ori r11,r11,0x1ff /* set up BAT registers for 604 */ +4: #ifndef CONFIG_APUS + ori r11,r11,0x1ff /* set up BAT registers for 604 */ li r8,2 #else + ori r11,r11,0xff /* set up an 8MB mapping */ lis r8,CYBERBASEp@h lwz r8,0(r8) addis r8,r8,KERNELBASE@h @@ -236,6 +236,17 @@ mtspr IBAT0L,r8 isync +#ifdef CONFIG_APUS + /* Unfortunately the APUS specific instructions bloat the + * code so it cannot fit in the 0x100 bytes available. We have + * to do it the crude way. */ + lis r3,KERNELBASE@h + tophys(r4,r3,r5) + lis r3,0xfff0 /* Copy to 0xfff00000 on APUS */ + li r5,0x4000 /* # bytes of memory to copy */ + li r6,0 + bl copy_and_flush /* copy the first 0x4000 bytes */ +#else /* CONFIG_APUS */ /* * We need to run with _start at physical address 0. * On CHRP, we are loaded at 0x10000 since OF on CHRP uses @@ -262,26 +273,15 @@ lwz r25,klimit@l(r9) addis r25,r25,-KERNELBASE@h li r6,0 /* Destination */ -#ifdef CONFIG_APUS - lis r9,0x6170 - ori r9,r9,0x7573 - cmpw 0,r9,r31 - bne 8f - lis r6,0xfff0 /* Copy to 0xfff00000 on APUS */ -8: -#endif li r5,0x4000 /* # bytes of memory to copy */ bl copy_and_flush /* copy the first 0x4000 bytes */ -#ifdef CONFIG_APUS - cmpw 0,r9,r31 /* That's all we need on APUS. */ - beq 2f -#endif addi r0,r3,4f@l /* jump to the address of 4f */ mtctr r0 /* in copy and do the rest. */ bctr /* jump to the copy */ 4: mr r5,r25 bl copy_and_flush /* copy the rest */ 2: +#endif /* CONFIG_APUS */ /* * we now have the 1st 16M of ram mapped with the bats. * prep needs the mmu to be turned on here, but pmac already has it on. @@ -491,6 +491,11 @@ HardwareInterrupt: EXCEPTION_PROLOG; #ifdef CONFIG_APUS + /* This is horrible, but there's no way around it. Enable the + data cache so the IRQ hardware register can be accessed + without cache intervention. Then disable interrupts and get + the current emulated m68k IPL value. */ + mfmsr 20 xori r20,r20,MSR_DR sync @@ -1163,78 +1168,6 @@ #ifndef CONFIG_8xx /* - * Continuation of the floating-point unavailable handler. - */ -load_up_fpu: - -/* - * Disable FP for the task which had the FPU previously, - * and save its floating-point registers in its thread_struct. - * Enables the FPU for use in the kernel on return. - */ -#ifndef CONFIG_APUS - lis r6,-KERNELBASE@h -#else - lis r6,CYBERBASEp@h - lwz r6,0(r6) -#endif - addis r3,r6,last_task_used_math@ha - lwz r4,last_task_used_math@l(r3) - mfmsr r5 - ori r5,r5,MSR_FP - SYNC - mtmsr r5 /* enable use of fpu now */ -#ifndef __SMP__ - SYNC - cmpi 0,r4,0 - beq 1f -#else -/* - * All the saving of last_task_used_math is handled - * by a switch_to() call to smp_giveup_fpu() in SMP so - * last_task_used_math is not used. -- Cort - */ - b 1f -#endif - add r4,r4,r6 - addi r4,r4,TSS /* want TSS of last_task_used_math */ - SAVE_32FPRS(0, r4) - mffs fr0 - stfd fr0,TSS_FPSCR-4(r4) - lwz r5,PT_REGS(r4) - add r5,r5,r6 - lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) - li r20,MSR_FP - andc r4,r4,r20 /* disable FP for previous task */ - stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) - -1: ori r23,r23,MSR_FP /* enable use of FP after return */ - mfspr r5,SPRG3 /* current task's TSS (phys) */ - lfd fr0,TSS_FPSCR-4(r5) - mtfsf 0xff,fr0 - REST_32FPRS(0, r5) -#ifndef __SMP__ - subi r4,r5,TSS - sub r4,r4,r6 - stw r4,last_task_used_math@l(r3) -#endif /* __SMP__ */ - /* restore registers and return */ - lwz r3,_CCR(r21) - lwz r4,_LINK(r21) - mtcrf 0xff,r3 - mtlr r4 - REST_GPR(1, r21) - REST_4GPRS(3, r21) - /* we haven't used ctr or xer */ - mtspr SRR1,r23 - mtspr SRR0,r22 - REST_GPR(20, r21) - REST_2GPRS(22, r21) - lwz r21,GPR21(r21) - SYNC - rfi - -/* * Load a PTE into the hash table, if possible. * The address is in r3, and r4 contains access flags: * _PAGE_USER (4) if a user-mode access, ored with @@ -1354,8 +1287,16 @@ bdnzf 2,2b beq+ found_empty - /* Choose an arbitrary slot in the primary PTEG to overwrite */ -#if 0 +#if 1 + /* + * Choose an arbitrary slot in the primary PTEG to overwrite. + * Since both the primary and secondary PTEGs are full, and we + * have no information that the PTEs in the primary PTEG are + * more important or useful than those in the secondary PTEG, + * and we know there is a definite (although small) speed + * advantage to putting the PTE in the primary PTEG, we always + * put the PTE in the primary PTEG. + */ xori r5,r5,0x40 /* clear H bit again */ lwz r2,next_slot@l(0) addi r2,r2,8 @@ -1396,6 +1337,13 @@ stw r5,0(r3) found_slot: stw r6,4(r3) + SYNC +/* + * These nop's seem to be necessary to avoid getting a machine + * check on the rfi on 601 processors. + */ + nop + nop /* * Update the hash table miss count. We only want misses here @@ -1425,10 +1373,8 @@ REST_2GPRS(1, r21) REST_4GPRS(3, r21) /* we haven't used xer */ - SYNC mtspr SRR1,r23 mtspr SRR0,r22 - SYNC REST_GPR(20, r21) REST_2GPRS(22, r21) lwz r21,GPR21(r21) @@ -1439,9 +1385,144 @@ blr next_slot: .long 0 + +/* + * FPU stuff for the 6xx/7xx follows + * -- Cort + */ +load_up_fpu: +/* + * Disable FP for the task which had the FPU previously, + * and save its floating-point registers in its thread_struct. + * Enables the FPU for use in the kernel on return. + */ +#ifndef CONFIG_APUS + lis r6,-KERNELBASE@h +#else + lis r6,CYBERBASEp@h + lwz r6,0(r6) +#endif + addis r3,r6,last_task_used_math@ha + lwz r4,last_task_used_math@l(r3) + mfmsr r5 + ori r5,r5,MSR_FP + SYNC + mtmsr r5 /* enable use of fpu now */ +#ifndef __SMP__ + SYNC + cmpi 0,r4,0 + beq 1f +#else +/* + * All the saving of last_task_used_math is handled + * by a switch_to() call to smp_giveup_fpu() in SMP so + * last_task_used_math is not used. + * + * We should never be herre on SMP anyway, sinc ethe fpu should + * always be on. + * -- Cort + */ + b 1f +#endif + add r4,r4,r6 + addi r4,r4,TSS /* want TSS of last_task_used_math */ + SAVE_32FPRS(0, r4) + mffs fr0 + stfd fr0,TSS_FPSCR-4(r4) + lwz r5,PT_REGS(r4) + add r5,r5,r6 + lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) + li r20,MSR_FP + andc r4,r4,r20 /* disable FP for previous task */ + stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) + +1: ori r23,r23,MSR_FP /* enable use of FP after return */ + mfspr r5,SPRG3 /* current task's TSS (phys) */ + lfd fr0,TSS_FPSCR-4(r5) + mtfsf 0xff,fr0 + REST_32FPRS(0, r5) +/* + * on SMP we don't really use last_task_used_math but set it + * here anyway to avoid the ifdef's -- Cort + */ + subi r4,r5,TSS + sub r4,r4,r6 + stw r4,last_task_used_math@l(r3) + /* restore registers and return */ + lwz r3,_CCR(r21) + lwz r4,_LINK(r21) + mtcrf 0xff,r3 + mtlr r4 + REST_GPR(1, r21) + REST_4GPRS(3, r21) + /* we haven't used ctr or xer */ + mtspr SRR1,r23 + mtspr SRR0,r22 + REST_GPR(20, r21) + REST_2GPRS(22, r21) + lwz r21,GPR21(r21) + SYNC + rfi + +/* + * FP unavailable trap from kernel - print a message, but let + * the task use FP in the kernel until it returns to user mode. + */ +KernelFP: + lwz r3,_MSR(r1) + ori r3,r3,MSR_FP + stw r3,_MSR(r1) /* enable use of FP after return */ + lis r3,86f@h + ori r3,r3,86f@l + mr r4,r2 /* current */ + lwz r5,_NIP(r1) + bl printk + b int_return +86: .string "floating point used in kernel (task=%p, pc=%x)\n" + .align 4 + +/* + * Disable FP for the task which had the FPU previously, + * and save its floating-point registers in its thread_struct. + * Enables the FPU for use in the kernel on return. + */ +/* smp_giveup_fpu() takes an arg to tell it where to save the fpu + * regs since last_task_used_math can't be trusted (many many race + * conditions). -- Cort + */ + .globl smp_giveup_fpu +smp_giveup_fpu: + mr r4,r3 + b 12f + .globl giveup_fpu +giveup_fpu: + lis r3,last_task_used_math@ha + lwz r4,last_task_used_math@l(r3) +12: + mfmsr r5 + ori r5,r5,MSR_FP + SYNC + mtmsr r5 /* enable use of fpu now */ + SYNC + cmpi 0,r4,0 + beqlr- /* if no previous owner, done */ + addi r4,r4,TSS /* want TSS of last_task_used_math */ + li r5,0 + stw r5,last_task_used_math@l(r3) + SAVE_32FPRS(0, r4) + mffs fr0 + stfd fr0,TSS_FPSCR-4(r4) + lwz r5,PT_REGS(r4) + lwz r3,_MSR-STACK_FRAME_OVERHEAD(r5) + li r4,MSR_FP + andc r3,r3,r4 /* disable FP for previous task */ + stw r3,_MSR-STACK_FRAME_OVERHEAD(r5) +#else /* CONFIG_8xx */ + .globl giveup_fpu +giveup_fpu: #endif /* CONFIG_8xx */ + blr -#ifndef CONFIG_APUS /* * Copy routine used to copy the kernel to start at physical address 0 * and flush and invalidate the caches as needed. @@ -1466,7 +1547,6 @@ addi r5,r5,4 addi r6,r6,4 blr -#endif #ifdef CONFIG_APUS /* On APUS the first 0x4000 bytes of the kernel will be mapped @@ -1552,9 +1632,6 @@ mr r6,r28 mr r7,r27 bl identify_machine -#ifdef CONFIG_MBX - bl set_mbx_memory -#endif bl MMU_init /* * Go back to running unmapped so we can load up new values @@ -1623,64 +1700,6 @@ mtspr SRR1,r4 rfi /* enable MMU and jump to start_kernel */ - -/* - * FP unavailable trap from kernel - print a message, but let - * the task use FP in the kernel until it returns to user mode. - */ -KernelFP: - lwz r3,_MSR(r1) - ori r3,r3,MSR_FP - stw r3,_MSR(r1) /* enable use of FP after return */ - lis r3,86f@h - ori r3,r3,86f@l - mr r4,r2 /* current */ - lwz r5,_NIP(r1) - bl printk - b int_return -86: .string "floating point used in kernel (task=%p, pc=%x)\n" - .align 4 - -/* - * Disable FP for the task which had the FPU previously, - * and save its floating-point registers in its thread_struct. - * Enables the FPU for use in the kernel on return. - */ -/* smp_giveup_fpu() takes an arg to tell it where to save the fpu - * regs since last_task_used_math can't be trusted (many many race - * conditions). -- Cort - */ - .globl smp_giveup_fpu -smp_giveup_fpu: - mr r4,r3 - b 12f - .globl giveup_fpu -giveup_fpu: - lis r3,last_task_used_math@ha - lwz r4,last_task_used_math@l(r3) -12: - mfmsr r5 - ori r5,r5,MSR_FP - SYNC - mtmsr r5 /* enable use of fpu now */ - SYNC - cmpi 0,r4,0 - beqlr- /* if no previous owner, done */ - addi r4,r4,TSS /* want TSS of last_task_used_math */ -#ifndef __SMP__ - li r5,0 - stw r5,last_task_used_math@l(r3) -#endif /* __SMP__ */ - SAVE_32FPRS(0, r4) - mffs fr0 - stfd fr0,TSS_FPSCR-4(r4) - lwz r5,PT_REGS(r4) - lwz r3,_MSR-STACK_FRAME_OVERHEAD(r5) - li r4,MSR_FP - andc r3,r3,r4 /* disable FP for previous task */ - stw r3,_MSR-STACK_FRAME_OVERHEAD(r5) - blr - /* * Handle a system call. */ @@ -1929,8 +1948,8 @@ lwz r5,_MSR(r1) and. r5,r5,r4 beq 2f -3: lis r4,lost_interrupts@ha - lwz r4,lost_interrupts@l(r4) +3: lis r4,n_lost_interrupts@ha + lwz r4,n_lost_interrupts@l(r4) cmpi 0,r4,0 beq+ 1f addi r3,r1,STACK_FRAME_OVERHEAD @@ -1949,8 +1968,7 @@ 2: lwz r3,_MSR(r1) /* Returning to user mode? */ andi. r3,r3,MSR_PR beq+ 10f /* if so, check need_resched and signals */ - lis r3,need_resched@ha - lwz r3,need_resched@l(r3) + lwz r3,NEED_RESCHED(r2) cmpi 0,r3,0 /* check need_resched flag */ beq+ 7f bl schedule @@ -1988,18 +2006,6 @@ SYNC rfi -#if 0/*def __SMP__*/ - .globl ret_from_smpfork -ret_from_smpfork: - /* drop scheduler_lock since schedule() called us */ - lis r4,scheduler_lock@ha - li r5,0 - stw r5,scheduler_lock@l+4(r4) /* owner_pc */ - stw r5,scheduler_lock@l+8(r4) /* owner_cpu */ - stw r5,scheduler_lock@l(r4) /* lock */ - b int_return -#endif /* __SMP__ */ - /* * Fake an interrupt from kernel mode. * This is used when enable_irq loses an interrupt. @@ -2215,50 +2221,6 @@ _GLOBAL(__main) blr -#ifndef CONFIG_8xx -/* - * On CHRP, the Run-Time Abstraction Services (RTAS) have to be - * called with the MMU off. - */ - .globl enter_rtas -enter_rtas: - stwu r1,-16(r1) - mflr r0 - stw r0,20(r1) - lis r4,rtas_data@ha - lwz r4,rtas_data@l(r4) - addis r4,r4,-KERNELBASE@h - lis r6,1f@ha /* physical return address for rtas */ - addi r6,r6,1f@l - addis r6,r6,-KERNELBASE@h - subi r7,r1,INT_FRAME_SIZE+STACK_UNDERHEAD - addis r7,r7,-KERNELBASE@h - lis r8,rtas_entry@ha - lwz r8,rtas_entry@l(r8) - addis r5,r8,-KERNELBASE@h - mfmsr r9 - stw r9,8(r1) - ori r0,r0,MSR_EE|MSR_SE|MSR_BE - andc r0,r9,r0 - andi. r9,r9,MSR_ME|MSR_RI - sync /* disable interrupts so SRR0/1 */ - mtmsr r0 /* don't get trashed */ - li r6,0 - mtlr r6 - mtspr SPRG2,r7 - mtspr SRR0,r8 - mtspr SRR1,r9 - rfi -1: addis r9,r1,-KERNELBASE@h - lwz r8,20(r9) /* get return address */ - lwz r9,8(r9) /* original msr value */ - li r0,0 - mtspr SPRG2,r0 - mtspr SRR0,r8 - mtspr SRR1,r9 - rfi /* return to caller */ -#endif /* CONFIG_8xx */ - #ifdef __SMP__ /* * Secondary processor begins executing here. @@ -2426,6 +2388,56 @@ .long 0 #endif /* __SMP__ */ +/* + * PROM code for specific machines follows. Put it + * here so it's easy to add arch-specific sections later. + * -- Cort + */ + +#ifndef CONFIG_8xx +/* + * On CHRP, the Run-Time Abstraction Services (RTAS) have to be + * called with the MMU off. + */ + .globl enter_rtas +enter_rtas: + stwu r1,-16(r1) + mflr r0 + stw r0,20(r1) + lis r4,rtas_data@ha + lwz r4,rtas_data@l(r4) + addis r4,r4,-KERNELBASE@h + lis r6,1f@ha /* physical return address for rtas */ + addi r6,r6,1f@l + addis r6,r6,-KERNELBASE@h + subi r7,r1,INT_FRAME_SIZE+STACK_UNDERHEAD + addis r7,r7,-KERNELBASE@h + lis r8,rtas_entry@ha + lwz r8,rtas_entry@l(r8) + addis r5,r8,-KERNELBASE@h + mfmsr r9 + stw r9,8(r1) + ori r0,r0,MSR_EE|MSR_SE|MSR_BE + andc r0,r9,r0 + andi. r9,r9,MSR_ME|MSR_RI + sync /* disable interrupts so SRR0/1 */ + mtmsr r0 /* don't get trashed */ + li r6,0 + mtlr r6 + mtspr SPRG2,r7 + mtspr SRR0,r8 + mtspr SRR1,r9 + rfi +1: addis r9,r1,-KERNELBASE@h + lwz r8,20(r9) /* get return address */ + lwz r9,8(r9) /* original msr value */ + li r0,0 + mtspr SPRG2,r0 + mtspr SRR0,r8 + mtspr SRR1,r9 + rfi /* return to caller */ +#endif /* CONFIG_8xx */ + #ifdef CONFIG_MBX /* Jump into the system reset for the MBX rom. * We first disable the MMU, and then jump to the ROM reset address. @@ -2449,7 +2461,7 @@ addi r4, r4, 0xfe000000@l mtlr r4 blr -#endif +#endif /* CONFIG_MBX */ /* * We put a few things here that have to be page-aligned. diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/idle.c linux/arch/ppc/kernel/idle.c --- v2.1.114/linux/arch/ppc/kernel/idle.c Fri May 8 23:14:44 1998 +++ linux/arch/ppc/kernel/idle.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: idle.c,v 1.37 1998/04/26 06:59:12 cort Exp $ + * $Id: idle.c,v 1.48 1998/07/30 11:29:22 davem Exp $ * * Idle daemon for PowerPC. Idle daemon will handle any action * that needs to be taken when the system becomes idle. @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ unsigned long htab_reclaim_on = 0; unsigned long zero_paged_on = 0; +unsigned long powersave_nap = 0; int idled(void *unused) { @@ -55,11 +55,11 @@ /* endless loop with no priority at all */ current->priority = -100; current->counter = -100; - + check_pgt_cache(); - if ( !need_resched && zero_paged_on ) zero_paged(); - if ( !need_resched && htab_reclaim_on ) htab_reclaim(); + if ( !current->need_resched && zero_paged_on ) zero_paged(); + if ( !current->need_resched && htab_reclaim_on ) htab_reclaim(); /* * Only processor 1 may sleep now since processor 2 would @@ -67,7 +67,7 @@ * then it can sleep. -- Cort */ #ifndef __SMP__ - if ( !need_resched ) power_save(); + if ( !current->need_resched ) power_save(); #endif /* __SMP__ */ schedule(); } @@ -75,6 +75,35 @@ return ret; } +#ifdef __SMP__ +/* + * SMP entry into the idle task - calls the same thing as the + * non-smp versions. -- Cort + */ +int cpu_idle(void *unused) +{ + idled(unused); + return 0; +} +#endif /* __SMP__ */ + +/* + * Syscall entry into the idle task. -- Cort + */ +asmlinkage int sys_idle(void) +{ + extern int media_bay_task(void *); + if(current->pid != 0) + return -EPERM; + +#ifdef CONFIG_PMAC + if (media_bay_present) + kernel_thread(media_bay_task, NULL, 0); +#endif + + idled(NULL); + return 0; /* should never execute this but it makes gcc happy -- Cort */ +} /* * Mark 'zombie' pte's in the hash table as invalid. @@ -106,12 +135,12 @@ /* go a different direction each time */ dir *= -1; for ( ptr = start; - !need_resched && (ptr != Hash_end) && (ptr != Hash); + !current->need_resched && (ptr != Hash_end) && (ptr != Hash); ptr += dir) { #else if ( !reclaim_ptr ) reclaim_ptr = Hash; - while ( !need_resched ) + while ( !current->need_resched ) { reclaim_ptr++; if ( reclaim_ptr == Hash_end ) reclaim_ptr = Hash; @@ -121,7 +150,7 @@ valid = 0; for_each_task(p) { - if ( need_resched ) + if ( current->need_resched ) goto out; /* if this vsid/context is in use */ if ( (reclaim_ptr->vsid >> 4) == p->mm->context ) @@ -136,79 +165,42 @@ reclaim_ptr->v = 0; } out: - if ( need_resched ) printk("need_resched: %x\n", need_resched); + if ( current->need_resched ) printk("need_resched: %lx\n", current->need_resched); unlock_dcache(); #endif /* CONFIG_8xx */ } - -/* - * Syscall entry into the idle task. -- Cort - */ -asmlinkage int sys_idle(void) -{ - extern int media_bay_task(void *); - if(current->pid != 0) - return -EPERM; - -#ifdef CONFIG_PMAC - if (media_bay_present) - kernel_thread(media_bay_task, NULL, 0); -#endif - - idled(NULL); - return 0; /* should never execute this but it makes gcc happy -- Cort */ -} - -#ifdef __SMP__ -/* - * SMP entry into the idle task - calls the same thing as the - * non-smp versions. -- Cort - */ -int cpu_idle(void *unused) -{ - idled(unused); - return 0; -} -#endif /* __SMP__ */ - -/* - * vars for idle task zero'ing out pages - */ -unsigned long zero_list = 0; /* head linked list of pre-zero'd pages */ -unsigned long bytecount = 0; /* pointer into the currently being zero'd page */ -unsigned long zerocount = 0; /* # currently pre-zero'd pages */ -unsigned long zerototal = 0; /* # pages zero'd over time -- for ooh's and ahhh's */ -unsigned long zeropage_hits = 0;/* # zero'd pages request that we've done */ -unsigned long zeropage_calls = 0;/* # zero'd pages request that've been made */ -#define PAGE_THRESHOLD 96 /* how many pages to keep pre-zero'd */ /* * Returns a pre-zero'd page from the list otherwise returns * NULL. */ -unsigned long get_prezerod_page(void) +unsigned long get_zero_page_fast(void) { - unsigned long page; + unsigned long page = 0; - atomic_inc((atomic_t *)&zeropage_calls); - if ( zero_list ) + atomic_inc((atomic_t *)&quicklists.zeropage_calls); + if ( zero_quicklist ) { /* atomically remove this page from the list */ - asm ( "101:lwarx %1,0,%2\n" /* reserve zero_list */ - " lwz %0,0(%1)\n" /* get next -- new zero_list */ - " stwcx. %0,0,%2\n" /* update zero_list */ + asm ( "101:lwarx %1,0,%2\n" /* reserve zero_cache */ + " lwz %0,0(%1)\n" /* get next -- new zero_cache */ + " stwcx. %0,0,%2\n" /* update zero_cache */ " bne- 101b\n" /* if lost reservation try again */ - : "=&r" (zero_list), "=&r" (page) - : "r" (&zero_list) + : "=&r" (zero_quicklist), "=&r" (page) + : "r" (&zero_quicklist) : "cc" ); +#ifdef __SMP__ + /* if another cpu beat us above this can happen -- Cort */ + if ( page == 0 ) + return 0; +#endif /* __SMP__ */ /* we can update zerocount after the fact since it is not * used for anything but control of a loop which doesn't - * matter since it won't effect anything if it zero's one + * matter since it won't affect anything if it zero's one * less page -- Cort */ - atomic_inc((atomic_t *)&zeropage_hits); - atomic_dec((atomic_t *)&zerocount); - need_resched = 1; + atomic_inc((atomic_t *)&quicklists.zeropage_hits); + atomic_dec((atomic_t *)&zero_cache_sz); /* zero out the pointer to next in the page */ *(unsigned long *)page = 0; @@ -224,12 +216,16 @@ * reschedule()'s in here so when we return we know we've * zero'd all we need to for now. */ +int zero_cache_water[2] = { 25, 96 }; /* high and low water marks for zero cache */ void zero_paged(void) { unsigned long pageptr = 0; /* current page being zero'd */ + unsigned long bytecount = 0; pte_t *pte; - - while ( zerocount <= PAGE_THRESHOLD ) + + if ( zero_cache_sz >= zero_cache_water[0] ) + return; + while ( (zero_cache_sz < zero_cache_water[1]) && (!current->need_resched) ) { /* * Mark a page as reserved so we can mess with it @@ -240,11 +236,12 @@ if ( !pageptr ) return; - if ( need_resched ) + if ( current->need_resched ) schedule(); /* * Make the page no cache so we don't blow our cache with 0's + * We should just turn off the cache instead. -- Cort */ pte = find_pte(init_task.mm, pageptr); if ( !pte ) @@ -255,20 +252,19 @@ pte_uncache(*pte); flush_tlb_page(find_vma(init_task.mm,pageptr),pageptr); - /* * Important here to not take time away from real processes. */ for ( bytecount = 0; bytecount < PAGE_SIZE ; bytecount += 4 ) { - if ( need_resched ) + if ( current->need_resched ) schedule(); *(unsigned long *)(bytecount + pageptr) = 0; } /* * If we finished zero-ing out a page add this page to - * the zero_list atomically -- we can't use + * the zero_cache atomically -- we can't use * down/up since we can't sleep in idle. * Disabling interrupts is also a bad idea since we would * steal time away from real processes. @@ -278,20 +274,20 @@ * -- Cort */ /* turn cache on for this page */ + pte_cache(*pte); flush_tlb_page(find_vma(init_task.mm,pageptr),pageptr); - /* atomically add this page to the list */ - asm ( "101:lwarx %0,0,%1\n" /* reserve zero_list */ + asm ( "101:lwarx %0,0,%1\n" /* reserve zero_cache */ " stw %0,0(%2)\n" /* update *pageptr */ #ifdef __SMP__ " sync\n" /* let store settle */ #endif - " mr %0,%2\n" /* update zero_list in reg */ - " stwcx. %2,0,%1\n" /* update zero_list in mem */ + " mr %0,%2\n" /* update zero_cache in reg */ + " stwcx. %2,0,%1\n" /* update zero_cache in mem */ " bne- 101b\n" /* if lost reservation try again */ - : "=&r" (zero_list) - : "r" (&zero_list), "r" (pageptr) + : "=&r" (zero_quicklist) + : "r" (&zero_quicklist), "r" (pageptr) : "cc" ); /* * This variable is used in the above loop and nowhere @@ -302,13 +298,11 @@ * zerocount updated yet when another processor * reads it. -- Cort */ - atomic_inc((atomic_t *)&zerocount); - atomic_inc((atomic_t *)&zerototal); + atomic_inc((atomic_t *)&zero_cache_sz); + atomic_inc((atomic_t *)&quicklists.zerototal); } } -int powersave_mode = HID0_DOZE; - void power_save(void) { unsigned long msr, hid0; @@ -321,10 +315,10 @@ case 8: /* 750 */ save_flags(msr); cli(); - if (!need_resched) { + if (!current->need_resched) { asm("mfspr %0,1008" : "=r" (hid0) :); hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE); - hid0 |= powersave_mode | HID0_DPM; + hid0 |= (powersave_nap? HID0_NAP: HID0_DOZE) | HID0_DPM; asm("mtspr 1008,%0" : : "r" (hid0)); msr |= MSR_POW; } diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/irq.c linux/arch/ppc/kernel/irq.c --- v2.1.114/linux/arch/ppc/kernel/irq.c Fri May 8 23:14:44 1998 +++ linux/arch/ppc/kernel/irq.c Tue Aug 4 16:06:36 1998 @@ -8,6 +8,7 @@ * Updated and modified by Cort Dougan (cort@cs.nmt.edu) * Adapted for Power Macintosh by Paul Mackerras * Copyright (C) 1996 Paul Mackerras (paulus@cs.anu.edu.au) + * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). * * This file contains the code used by various IRQ handling routines: * asking for different IRQ's should be done through these routines @@ -38,8 +39,8 @@ #include #include #include -#include +#include #include #include #include @@ -48,23 +49,41 @@ #include #include #include +#include #ifdef CONFIG_8xx #include #include #endif +#include +#include +#include +#define VEC_SPUR (24) +extern void process_int(unsigned long vec, struct pt_regs *fp); +extern void apus_init_IRQ(void); +extern void amiga_disable_irq(unsigned int irq); +extern void amiga_enable_irq(unsigned int irq); +#ifdef CONFIG_APUS +/* Rename a few functions. Requires the CONFIG_APUS protection. */ +#define request_irq nop_ppc_request_irq +#define free_irq nop_ppc_free_irq +#define get_irq_list nop_get_irq_list +#endif + #undef SHOW_IRQ -unsigned lost_interrupts = 0; +#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) + +int max_irqs; unsigned int local_irq_count[NR_CPUS]; static struct irqaction *irq_action[NR_IRQS]; static int spurious_interrupts = 0; -#ifndef CONFIG_8xx -static unsigned int cached_irq_mask = 0xffffffff; -#else -static unsigned int cached_irq_mask = 0xffffffff; -#endif +static unsigned int cached_irq_mask[NR_MASK_WORDS]; +unsigned int lost_interrupts[NR_MASK_WORDS]; +atomic_t n_lost_interrupts; + static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } + /*spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED;*/ #ifdef __SMP__ atomic_t __ppc_bh_counter = ATOMIC_INIT(0); @@ -74,8 +93,8 @@ static volatile unsigned char *gg2_int_ack_special; extern volatile unsigned long ipi_count; -#define cached_21 (((char *)(&cached_irq_mask))[3]) -#define cached_A1 (((char *)(&cached_irq_mask))[2]) +#define cached_21 (((char *)(cached_irq_mask))[3]) +#define cached_A1 (((char *)(cached_irq_mask))[2]) /* * These are set to the appropriate functions by init_IRQ() @@ -97,16 +116,22 @@ /* prep */ #define PREP_IRQ_MASK (((unsigned int)cached_A1)<<8) | (unsigned int)cached_21 -extern unsigned long route_pci_interrupts(void); /* pmac */ -#define IRQ_FLAG ((unsigned *)0xf3000020) -#define IRQ_ENABLE ((unsigned *)0xf3000024) -#define IRQ_ACK ((unsigned *)0xf3000028) -#define IRQ_LEVEL ((unsigned *)0xf300002c) -#define KEYBOARD_IRQ 20 /* irq number for command-power interrupt */ -#define PMAC_IRQ_MASK (~ld_le32(IRQ_ENABLE)) +struct pmac_irq_hw { + unsigned int flag; + unsigned int enable; + unsigned int ack; + unsigned int level; +}; + +/* XXX these addresses should be obtained from the device tree */ +volatile struct pmac_irq_hw *pmac_irq_hw[2] = { + (struct pmac_irq_hw *) 0xf3000020, + (struct pmac_irq_hw *) 0xf3000010, +}; +#define KEYBOARD_IRQ 20 /* irq number for command-power interrupt */ /* nasty hack for shared irq's since we need to do kmalloc calls but @@ -148,7 +173,7 @@ void i8259_mask_and_ack_irq(int irq_nr) { /* spin_lock(&irq_controller_lock);*/ - cached_irq_mask |= 1 << irq_nr; + cached_irq_mask[0] |= 1 << irq_nr; if (irq_nr > 7) { inb(0xA1); /* DUMMY */ outb(cached_A1,0xA1); @@ -167,17 +192,23 @@ void pmac_mask_and_ack_irq(int irq_nr) { - unsigned long bit = 1UL << irq_nr; + unsigned long bit = 1UL << (irq_nr & 0x1f); + int i = irq_nr >> 5; - /* spin_lock(&irq_controller_lock);*/ - cached_irq_mask |= bit; - lost_interrupts &= ~bit; - out_le32(IRQ_ACK, bit); - out_le32(IRQ_ENABLE, ~cached_irq_mask); - out_le32(IRQ_ACK, bit); - /* spin_unlock(&irq_controller_lock);*/ + if (irq_nr >= max_irqs) + return; + /*spin_lock(&irq_controller_lock);*/ + + clear_bit(irq_nr, cached_irq_mask); + if (test_and_clear_bit(irq_nr, lost_interrupts)) + atomic_dec(&n_lost_interrupts); + out_le32(&pmac_irq_hw[i]->ack, bit); + out_le32(&pmac_irq_hw[i]->enable, cached_irq_mask[i]); + out_le32(&pmac_irq_hw[i]->ack, bit); + + /*spin_unlock(&irq_controller_lock);*/ /*if ( irq_controller_lock.lock ) - panic("irq controller lock still held in mask and ack\n");*/ + panic("irq controller lock still held in mask and ack\n");*/ } void chrp_mask_and_ack_irq(int irq_nr) @@ -199,18 +230,26 @@ static void pmac_set_irq_mask(int irq_nr) { - unsigned long bit = 1UL << irq_nr; + unsigned long bit = 1UL << (irq_nr & 0x1f); + int i = irq_nr >> 5; + + if (irq_nr >= max_irqs) + return; + + /* enable unmasked interrupts */ + out_le32(&pmac_irq_hw[i]->enable, cached_irq_mask[i]); - /* this could be being enabled or disabled - so use cached_irq_mask */ - out_le32(IRQ_ENABLE, ~cached_irq_mask /* enable all unmasked */ ); /* * Unfortunately, setting the bit in the enable register * when the device interrupt is already on *doesn't* set * the bit in the flag register or request another interrupt. */ - if ((bit & ~cached_irq_mask) - && (ld_le32(IRQ_LEVEL) & bit) && !(ld_le32(IRQ_FLAG) & bit)) - lost_interrupts |= bit; + if ((bit & cached_irq_mask[i]) + && (ld_le32(&pmac_irq_hw[i]->level) & bit) + && !(ld_le32(&pmac_irq_hw[i]->flag) & bit)) { + if (!test_and_set_bit(irq_nr, lost_interrupts)) + atomic_inc(&n_lost_interrupts); + } } /* @@ -219,25 +258,25 @@ */ static void i8259_mask_irq(unsigned int irq_nr) { - cached_irq_mask |= 1 << irq_nr; + cached_irq_mask[0] |= 1 << irq_nr; i8259_set_irq_mask(irq_nr); } static void i8259_unmask_irq(unsigned int irq_nr) { - cached_irq_mask &= ~(1 << irq_nr); + cached_irq_mask[0] &= ~(1 << irq_nr); i8259_set_irq_mask(irq_nr); } static void pmac_mask_irq(unsigned int irq_nr) { - cached_irq_mask |= 1 << irq_nr; + clear_bit(irq_nr, cached_irq_mask); pmac_set_irq_mask(irq_nr); } static void pmac_unmask_irq(unsigned int irq_nr) { - cached_irq_mask &= ~(1 << irq_nr); + set_bit(irq_nr, cached_irq_mask); pmac_set_irq_mask(irq_nr); } @@ -259,16 +298,16 @@ #else /* CONFIG_8xx */ static void mbx_mask_irq(unsigned int irq_nr) { - cached_irq_mask &= ~(1 << (31-irq_nr)); + cached_irq_mask[0] &= ~(1 << (31-irq_nr)); ((immap_t *)MBX_IMAP_ADDR)->im_siu_conf.sc_simask = - cached_irq_mask; + cached_irq_mask[0]; } static void mbx_unmask_irq(unsigned int irq_nr) { - cached_irq_mask |= (1 << (31-irq_nr)); + cached_irq_mask[0] |= (1 << (31-irq_nr)); ((immap_t *)MBX_IMAP_ADDR)->im_siu_conf.sc_simask = - cached_irq_mask; + cached_irq_mask[0]; } #endif /* CONFIG_8xx */ @@ -527,9 +566,9 @@ #ifdef __SMP__ if ( cpu != 0 ) { - if ( !lost_interrupts ) + if (!atomic_read(&n_lost_interrupts)) { - extern smp_message_recv(void); + extern void smp_message_recv(void); goto out; ipi_count++; @@ -545,10 +584,17 @@ switch ( _machine ) { case _MACH_Pmac: - bits = ld_le32(IRQ_FLAG) | lost_interrupts; - for (irq = NR_IRQS - 1; irq >= 0; --irq) - if (bits & (1U << irq)) - break; + for (irq = max_irqs - 1; irq > 0; irq -= 32) { + int i = irq >> 5, lz; + bits = ld_le32(&pmac_irq_hw[i]->flag) + | lost_interrupts[i]; + if (bits == 0) + continue; + /* lz = number of 0 bits to left of most sig. 1 */ + asm ("cntlzw %0,%1" : "=r" (lz) : "r" (bits)); + irq -= lz; + break; + } break; case _MACH_chrp: irq = openpic_irq(0); @@ -604,10 +650,41 @@ } bits = 1UL << irq; break; +#ifdef CONFIG_APUS + case _MACH_apus: + { + int old_level, new_level; + + old_level = ~(regs->mq) & IPLEMU_IPLMASK; + new_level = (~(regs->mq) >> 3) & IPLEMU_IPLMASK; + + if (new_level == 0) + { + goto apus_out; + } + + APUS_WRITE(APUS_IPL_EMU, IPLEMU_IPLMASK); + APUS_WRITE(APUS_IPL_EMU, (IPLEMU_SETRESET + | (~(new_level) & IPLEMU_IPLMASK))); + APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT); + + process_int (VEC_SPUR+new_level, regs); + + APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_DISABLEINT); + APUS_WRITE(APUS_IPL_EMU, IPLEMU_IPLMASK); + APUS_WRITE(APUS_IPL_EMU, (IPLEMU_SETRESET + | (~(old_level) & IPLEMU_IPLMASK))); + +apus_out: + hardirq_exit(cpu); + APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT); + goto out2; + } +#endif } if (irq < 0) { - printk("Bogus interrupt from PC = %lx\n", regs->nip); + printk(KERN_DEBUG "Bogus interrupt from PC = %lx\n", regs->nip); goto out; } @@ -624,7 +701,7 @@ status = 0; action = irq_action[irq]; kstat.irqs[cpu][irq]++; - if ( action && action->handler) { + if (action && action->handler) { if (!(action->flags & SA_INTERRUPT)) __sti(); do { @@ -656,7 +733,10 @@ openpic_eoi(0); #endif /* CONFIG_8xx */ hardirq_exit(cpu); - + +#ifdef CONFIG_APUS +out2: +#endif /* restore the HID0 in case dcache was off - see idle.c * this hack should leave for a better solution -- Cort */ lock_dcache(dcache_locked); @@ -770,6 +850,7 @@ __initfunc(void init_IRQ(void)) { extern void xmon_irq(int, void *, struct pt_regs *); + int i; #ifndef CONFIG_8xx switch (_machine) @@ -778,8 +859,13 @@ mask_and_ack_irq = pmac_mask_and_ack_irq; mask_irq = pmac_mask_irq; unmask_irq = pmac_unmask_irq; - - *IRQ_ENABLE = 0; + + /* G3 powermacs have 64 interrupts, others have 32 */ + max_irqs = (find_devices("mac-io") ? 64 : 32); + printk("System has %d possible interrupts\n", max_irqs); + + for (i = 0; i * 32 < max_irqs; ++i) + out_le32(&pmac_irq_hw[i]->enable, 0); #ifdef CONFIG_XMON request_irq(KEYBOARD_IRQ, xmon_irq, 0, "NMI", 0); #endif /* CONFIG_XMON */ @@ -792,6 +878,7 @@ ioremap(GG2_INT_ACK_SPECIAL, 1); openpic_init(); i8259_init(); + cached_irq_mask[0] = cached_irq_mask[1] = ~0UL; #ifdef CONFIG_XMON request_irq(openpic_to_irq(HYDRA_INT_ADB_NMI), xmon_irq, 0, "NMI", 0); @@ -801,9 +888,9 @@ mask_and_ack_irq = i8259_mask_and_ack_irq; mask_irq = i8259_mask_irq; unmask_irq = i8259_unmask_irq; + cached_irq_mask[0] = ~0UL; i8259_init(); - route_pci_interrupts(); /* * According to the Carolina spec from ibm irqs 0,1,2, and 8 * must be edge triggered. Also, the pci intrs must be level @@ -838,6 +925,13 @@ } break; - } +#ifdef CONFIG_APUS + case _MACH_apus: + mask_irq = amiga_disable_irq; + unmask_irq = amiga_enable_irq; + apus_init_IRQ(); + break; +#endif + } #endif /* CONFIG_8xx */ } diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/misc.S linux/arch/ppc/kernel/misc.S --- v2.1.114/linux/arch/ppc/kernel/misc.S Fri May 8 23:14:44 1998 +++ linux/arch/ppc/kernel/misc.S Tue Aug 4 16:06:36 1998 @@ -72,8 +72,8 @@ beqlr /* nothing to do if state == 0 */ _GLOBAL(__sti) _GLOBAL(_hard_sti) - lis r4,lost_interrupts@ha - lwz r4,lost_interrupts@l(r4) + lis r4,n_lost_interrupts@ha + lwz r4,n_lost_interrupts@l(r4) mfmsr r3 /* Get current state */ ori r3,r3,MSR_EE /* Turn on 'EE' bit */ cmpi 0,r4,0 /* lost interrupts to process first? */ @@ -93,8 +93,8 @@ stw r0,20(r1) stw r3,8(r1) 1: bl fake_interrupt - lis r4,lost_interrupts@ha - lwz r4,lost_interrupts@l(r4) + lis r4,n_lost_interrupts@ha + lwz r4,n_lost_interrupts@l(r4) cmpi 0,r4,0 bne- 1b lwz r3,8(r1) @@ -222,11 +222,18 @@ * outsw(port, buf, len) * insl(port, buf, len) * outsl(port, buf, len) + * insw_ns(port, buf, len) + * outsw_ns(port, buf, len) + * insl_ns(port, buf, len) + * outsl_ns(port, buf, len) + * + * The *_ns versions don't do byte-swapping. */ _GLOBAL(_insb) mtctr r5 subi r4,r4,1 00: lbz r5,0(r3) + eieio stbu r5,1(r4) bdnz 00b blr @@ -236,6 +243,7 @@ subi r4,r4,1 00: lbzu r5,1(r4) stb r5,0(r3) + eieio bdnz 00b blr @@ -243,6 +251,7 @@ mtctr r5 subi r4,r4,2 00: lhbrx r5,0,r3 + eieio sthu r5,2(r4) bdnz 00b blr @@ -251,6 +260,7 @@ mtctr r5 subi r4,r4,2 00: lhzu r5,2(r4) + eieio sthbrx r5,0,r3 bdnz 00b blr @@ -259,6 +269,7 @@ mtctr r5 subi r4,r4,4 00: lwbrx r5,0,r3 + eieio stwu r5,4(r4) bdnz 00b blr @@ -267,23 +278,46 @@ mtctr r5 subi r4,r4,4 00: lwzu r5,4(r4) - stwbrx r5,0,r3 + stwbrx r5,0,r3 + eieio bdnz 00b blr _GLOBAL(ide_insw) +_GLOBAL(_insw_ns) mtctr r5 subi r4,r4,2 -00: lhzx r5,0,r3 +00: lhz r5,0(r3) + eieio sthu r5,2(r4) bdnz 00b blr _GLOBAL(ide_outsw) +_GLOBAL(_outsw_ns) mtctr r5 subi r4,r4,2 00: lhzu r5,2(r4) - sthx r5,0,r3 + sth r5,0(r3) + eieio + bdnz 00b + blr + +_GLOBAL(_insl_ns) + mtctr r5 + subi r4,r4,4 +00: lwz r5,0(r3) + eieio + stwu r5,4(r4) + bdnz 00b + blr + +_GLOBAL(_outsl_ns) + mtctr r5 + subi r4,r4,4 +00: lwzu r5,4(r4) + stw r5,0(r3) + eieio bdnz 00b blr @@ -413,7 +447,8 @@ SYSCALL(fork) SYSCALL(delete_module) SYSCALL(_exit) - +SYSCALL(lseek) +SYSCALL(read) /* Why isn't this a) automatic, b) written in 'C'? */ .data @@ -603,6 +638,4 @@ .long sys_pwrite /* 180 */ .long sys_chown .long sys_getcwd - .long sys_xstat - .long sys_xmknod - .space (NR_syscalls-185)*4 + .space (NR_syscalls-183)*4 diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/mk_defs.c linux/arch/ppc/kernel/mk_defs.c --- v2.1.114/linux/arch/ppc/kernel/mk_defs.c Thu Apr 23 20:21:29 1998 +++ linux/arch/ppc/kernel/mk_defs.c Tue Aug 4 16:06:36 1998 @@ -27,7 +27,7 @@ #define DEFINE(sym, val) \ asm volatile("\n#define\t" #sym "\t%0" : : "i" (val)) -void +int main(void) { DEFINE(KERNELBASE, KERNELBASE); @@ -46,6 +46,7 @@ DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); DEFINE(PF_TRACESYS, PF_TRACESYS); DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); + DEFINE(NEED_RESCHED, offsetof(struct task_struct, need_resched)); DEFINE(TSS_FPR0, offsetof(struct thread_struct, fpr[0])); DEFINE(TSS_FPSCR, offsetof(struct thread_struct, fpscr)); DEFINE(TSS_SMP_FORK_RET, offsetof(struct thread_struct, smp_fork_ret)); @@ -98,4 +99,5 @@ DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); + return 0; } diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/pci.c linux/arch/ppc/kernel/pci.c --- v2.1.114/linux/arch/ppc/kernel/pci.c Tue Jul 21 00:15:30 1998 +++ linux/arch/ppc/kernel/pci.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: pci.c,v 1.27 1998/04/24 02:46:47 cort Exp $ + * $Id: pci.c,v 1.36 1998/08/02 23:22:11 paulus Exp $ * Common pmac/prep/chrp pci routines. -- Cort */ @@ -16,15 +16,17 @@ #include #include #include +#include +#include #include +#include -#if !defined(CONFIG_MACH_SPECIFIC) || defined(CONFIG_PMAC) unsigned long isa_io_base; -#endif /* CONFIG_MACH_SPECIFIC || CONFIG_PMAC */ -#if !defined(CONFIG_MACH_SPECIFIC) unsigned long isa_mem_base; unsigned long pci_dram_offset; -#endif /* CONFIG_MACH_SPECIFIC */ + +unsigned int * pci_config_address; +unsigned char * pci_config_data; /* * It would be nice if we could create a include/asm/pci.h and have just @@ -49,57 +51,34 @@ int (*ptr_pcibios_write_config_dword)(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned int val); -extern int pmac_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char *val); -extern int pmac_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short *val); -extern int pmac_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int *val); -extern int pmac_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char val); -extern int pmac_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short val); -extern int pmac_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int val); - -extern int chrp_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char *val); -extern int chrp_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short *val); -extern int chrp_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int *val); -extern int chrp_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char val); -extern int chrp_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short val); -extern int chrp_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int val); - -extern int prep_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char *val); -extern int prep_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short *val); -extern int prep_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int *val); -extern int prep_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char val); -extern int prep_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short val); -extern int prep_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int val); - -extern int mbx_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char *val); -extern int mbx_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short *val); -extern int mbx_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int *val); -extern int mbx_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned char val); -extern int mbx_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned short val); -extern int mbx_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, - unsigned char offset, unsigned int val); +#define decl_config_access_method(name) \ +extern int name##_pcibios_read_config_byte(unsigned char bus, \ + unsigned char dev_fn, unsigned char offset, unsigned char *val); \ +extern int name##_pcibios_read_config_word(unsigned char bus, \ + unsigned char dev_fn, unsigned char offset, unsigned short *val); \ +extern int name##_pcibios_read_config_dword(unsigned char bus, \ + unsigned char dev_fn, unsigned char offset, unsigned int *val); \ +extern int name##_pcibios_write_config_byte(unsigned char bus, \ + unsigned char dev_fn, unsigned char offset, unsigned char val); \ +extern int name##_pcibios_write_config_word(unsigned char bus, \ + unsigned char dev_fn, unsigned char offset, unsigned short val); \ +extern int name##_pcibios_write_config_dword(unsigned char bus, \ + unsigned char dev_fn, unsigned char offset, unsigned int val) + +#define set_config_access_method(name) \ + ptr_pcibios_read_config_byte = name##_pcibios_read_config_byte; \ + ptr_pcibios_read_config_word = name##_pcibios_read_config_word; \ + ptr_pcibios_read_config_dword = name##_pcibios_read_config_dword; \ + ptr_pcibios_write_config_byte = name##_pcibios_write_config_byte; \ + ptr_pcibios_write_config_word = name##_pcibios_write_config_word; \ + ptr_pcibios_write_config_dword = name##_pcibios_write_config_dword + +decl_config_access_method(pmac); +decl_config_access_method(grackle); +decl_config_access_method(gg2); +decl_config_access_method(raven); +decl_config_access_method(prep); +decl_config_access_method(mbx); int pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, unsigned char offset, unsigned char *val) @@ -144,48 +123,67 @@ __initfunc(void setup_pci_ptrs(void)) { + PPC_DEVICE *hostbridge; #ifndef CONFIG_MBX switch (_machine) { case _MACH_prep: - ptr_pcibios_read_config_byte = prep_pcibios_read_config_byte; - ptr_pcibios_read_config_word = prep_pcibios_read_config_word; - ptr_pcibios_read_config_dword = prep_pcibios_read_config_dword; - ptr_pcibios_write_config_byte = prep_pcibios_write_config_byte; - ptr_pcibios_write_config_word = prep_pcibios_write_config_word; - ptr_pcibios_write_config_dword = prep_pcibios_write_config_dword; + hostbridge=residual_find_device(PROCESSORDEVICE, NULL, + BridgeController, PCIBridge, + -1, 0); + if (hostbridge && + hostbridge->DeviceId.Interface == PCIBridgeIndirect) { + PnP_TAG_PACKET * pkt; + set_config_access_method(raven); + pkt=PnP_find_large_vendor_packet( + res->DevicePnPHeap+hostbridge->AllocatedOffset, + 3, 0); + if(pkt) { +#define p pkt->L4_Pack.L4_Data.L4_PPCPack + pci_config_address= (unsigned *) + ld_le32((unsigned *) p.PPCData); + pci_config_data= (unsigned char *) + ld_le32((unsigned *) (p.PPCData+8)); + } else {/* default values */ + pci_config_address= (unsigned *) 0x80000cf8; + pci_config_data= (unsigned char *) 0x80000cfc; + } + } else { + set_config_access_method(prep); + } break; case _MACH_Pmac: - ptr_pcibios_read_config_byte = pmac_pcibios_read_config_byte; - ptr_pcibios_read_config_word = pmac_pcibios_read_config_word; - ptr_pcibios_read_config_dword = pmac_pcibios_read_config_dword; - ptr_pcibios_write_config_byte = pmac_pcibios_write_config_byte; - ptr_pcibios_write_config_word = pmac_pcibios_write_config_word; - ptr_pcibios_write_config_dword = pmac_pcibios_write_config_dword; + if (find_devices("pci") != 0) { + /* looks like a G3 powermac */ + set_config_access_method(grackle); + } else { + set_config_access_method(pmac); + } break; case _MACH_chrp: - ptr_pcibios_read_config_byte = chrp_pcibios_read_config_byte; - ptr_pcibios_read_config_word = chrp_pcibios_read_config_word; - ptr_pcibios_read_config_dword = chrp_pcibios_read_config_dword; - ptr_pcibios_write_config_byte = chrp_pcibios_write_config_byte; - ptr_pcibios_write_config_word = chrp_pcibios_write_config_word; - ptr_pcibios_write_config_dword = chrp_pcibios_write_config_dword; + if ( !strncmp("MOT", + get_property(find_path_device("/"), "model", NULL),3) ) + { + isa_io_base = 0xfe000000; + set_config_access_method(raven); + } + else + { + isa_io_base = GG2_ISA_IO_BASE; + set_config_access_method(gg2); + } break; default: printk("setup_pci_ptrs(): unknown machine type!\n"); } -#else /* CONFIG_MBX */ - ptr_pcibios_read_config_byte = mbx_pcibios_read_config_byte; - ptr_pcibios_read_config_word = mbx_pcibios_read_config_word; - ptr_pcibios_read_config_dword = mbx_pcibios_read_config_dword; - ptr_pcibios_write_config_byte = mbx_pcibios_write_config_byte; - ptr_pcibios_write_config_word = mbx_pcibios_write_config_word; - ptr_pcibios_write_config_dword = mbx_pcibios_write_config_dword; +#else /* CONFIG_MBX */ + set_config_access_method(mbx); #endif /* CONFIG_MBX */ +#undef set_config_access_method } __initfunc(void pcibios_fixup(void)) { - extern route_pci_interrupts(void); + extern unsigned long route_pci_interrupts(void); struct pci_dev *dev; extern struct bridge_data **bridges; extern unsigned char *Motherboard_map; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/pmac_pci.c linux/arch/ppc/kernel/pmac_pci.c --- v2.1.114/linux/arch/ppc/kernel/pmac_pci.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/pmac_pci.c Tue Aug 4 23:57:51 1998 @@ -12,7 +12,6 @@ * 2 of the License, or (at your option) any later version. */ -#include #include #include #include @@ -33,6 +32,7 @@ */ #define APPLE_VENDID 0x106b #define BANDIT_DEVID 1 +#define BANDIT_DEVID_2 8 #define BANDIT_REVID 3 #define BANDIT_DEVNUM 11 @@ -96,8 +96,10 @@ struct bridge_data *bp; *val = 0xffff; - if (bus > max_bus || (bp = bridges[bus]) == 0 || (offset & 1) != 0) + if (bus > max_bus || (bp = bridges[bus]) == 0) return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 1) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; if (bus == bp->bus_number) { if (dev_fn < (11 << 3)) return PCIBIOS_DEVICE_NOT_FOUND; @@ -118,8 +120,10 @@ struct bridge_data *bp; *val = 0xffffffff; - if (bus > max_bus || (bp = bridges[bus]) == 0 || (offset & 3) != 0) + if (bus > max_bus || (bp = bridges[bus]) == 0) return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 3) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; if (bus == bp->bus_number) { if (dev_fn < (11 << 3)) return PCIBIOS_DEVICE_NOT_FOUND; @@ -160,8 +164,10 @@ { struct bridge_data *bp; - if (bus > max_bus || (bp = bridges[bus]) == 0 || (offset & 1) != 0) + if (bus > max_bus || (bp = bridges[bus]) == 0) return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 1) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; if (bus == bp->bus_number) { if (dev_fn < (11 << 3)) return PCIBIOS_DEVICE_NOT_FOUND; @@ -181,8 +187,10 @@ { struct bridge_data *bp; - if (bus > max_bus || (bp = bridges[bus]) == 0 || (offset & 3) != 0) + if (bus > max_bus || (bp = bridges[bus]) == 0) return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 3) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; if (bus == bp->bus_number) { if (dev_fn < (11 << 3)) return PCIBIOS_DEVICE_NOT_FOUND; @@ -197,6 +205,92 @@ return PCIBIOS_SUCCESSFUL; } +#define GRACKLE_CFA(b, d, o) (0x80 | ((b) << 8) | ((d) << 16) \ + | (((o) & ~3) << 24)) + +int grackle_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned char *val) +{ + struct bridge_data *bp; + + *val = 0xff; + if (bus > max_bus || (bp = bridges[bus]) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; + out_be32(bp->cfg_addr, GRACKLE_CFA(bus, dev_fn, offset)); + *val = in_8(bp->cfg_data + (offset & 3)); + return PCIBIOS_SUCCESSFUL; +} + +int grackle_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned short *val) +{ + struct bridge_data *bp; + + *val = 0xffff; + if (bus > max_bus || (bp = bridges[bus]) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 1) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; + out_be32(bp->cfg_addr, GRACKLE_CFA(bus, dev_fn, offset)); + *val = in_le16((volatile unsigned short *)(bp->cfg_data + (offset&3))); + return PCIBIOS_SUCCESSFUL; +} + +int grackle_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned int *val) +{ + struct bridge_data *bp; + + *val = 0xffffffff; + if (bus > max_bus || (bp = bridges[bus]) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 3) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; + out_be32(bp->cfg_addr, GRACKLE_CFA(bus, dev_fn, offset)); + *val = in_le32((volatile unsigned int *)bp->cfg_data); + return PCIBIOS_SUCCESSFUL; +} + +int grackle_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned char val) +{ + struct bridge_data *bp; + + if (bus > max_bus || (bp = bridges[bus]) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; + out_be32(bp->cfg_addr, GRACKLE_CFA(bus, dev_fn, offset)); + out_8(bp->cfg_data + (offset & 3), val); + return PCIBIOS_SUCCESSFUL; +} + +int grackle_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned short val) +{ + struct bridge_data *bp; + + if (bus > max_bus || (bp = bridges[bus]) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 1) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; + out_be32(bp->cfg_addr, GRACKLE_CFA(bus, dev_fn, offset)); + out_le16((volatile unsigned short *)(bp->cfg_data + (offset&3)), val); + return PCIBIOS_SUCCESSFUL; +} + +int grackle_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn, + unsigned char offset, unsigned int val) +{ + struct bridge_data *bp; + + if (bus > max_bus || (bp = bridges[bus]) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; + if ((offset & 1) != 0) + return PCIBIOS_BAD_REGISTER_NUMBER; + out_be32(bp->cfg_addr, GRACKLE_CFA(bus, dev_fn, offset)); + out_le32((volatile unsigned int *)bp->cfg_data, val); + return PCIBIOS_SUCCESSFUL; +} + /* * For a bandit bridge, turn on cache coherency if necessary. * N.B. we can't use pcibios_*_config_* here because bridges[] @@ -211,7 +305,17 @@ out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + PCI_VENDOR_ID); udelay(2); vendev = in_le32((volatile unsigned int *)bp->cfg_data); - if (vendev != (BANDIT_DEVID << 16) + APPLE_VENDID) { + if (vendev == (BANDIT_DEVID << 16) + APPLE_VENDID) { + /* read the revision id */ + out_le32(bp->cfg_addr, + (1UL << BANDIT_DEVNUM) + PCI_REVISION_ID); + udelay(2); + rev = in_8(bp->cfg_data); + if (rev != BANDIT_REVID) + printk(KERN_WARNING + "Unknown revision %d for bandit at %p\n", + rev, bp->io_base); + } else if (vendev != (BANDIT_DEVID_2 << 16) + APPLE_VENDID) { printk(KERN_WARNING "bandit isn't? (%x)\n", vendev); return; } @@ -246,6 +350,7 @@ max_bus = 0; add_bridges(find_devices("bandit"), &mem_start); add_bridges(find_devices("chaos"), &mem_start); + add_bridges(find_devices("pci"), &mem_start); bridges = (struct bridge_data **) mem_start; mem_start += (max_bus + 1) * sizeof(struct bridge_data *); memset(bridges, 0, (max_bus + 1) * sizeof(struct bridge_data *)); @@ -256,6 +361,11 @@ return mem_start; } +/* + * We assume that if we have a G3 powermac, we have one bridge called + * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise, + * if we have one or more bandit or chaos bridges, we don't have a MPC106. + */ __initfunc(static void add_bridges(struct device_node *dev, unsigned long *mem_ptr)) { int *bus_range; @@ -284,15 +394,22 @@ printk(" controlled by %s at %x\n", dev->name, addr->address); bp = (struct bridge_data *) *mem_ptr; *mem_ptr += sizeof(struct bridge_data); - bp->cfg_addr = (volatile unsigned int *) - ioremap(addr->address + 0x800000, 0x1000); - bp->cfg_data = (volatile unsigned char *) - ioremap(addr->address + 0xc00000, 0x1000); - bp->io_base = (void *) ioremap(addr->address, 0x10000); -#ifdef CONFIG_PMAC + if (strcmp(dev->name, "pci") != 0) { + bp->cfg_addr = (volatile unsigned int *) + ioremap(addr->address + 0x800000, 0x1000); + bp->cfg_data = (volatile unsigned char *) + ioremap(addr->address + 0xc00000, 0x1000); + bp->io_base = (void *) ioremap(addr->address, 0x10000); + } else { + /* XXX */ + bp->cfg_addr = (volatile unsigned int *) + ioremap(0xfec00000, 0x1000); + bp->cfg_data = (volatile unsigned char *) + ioremap(0xfee00000, 0x1000); + bp->io_base = (void *) ioremap(0xfe000000, 0x10000); + } if (isa_io_base == 0) isa_io_base = (unsigned long) bp->io_base; -#endif bp->bus_number = bus_range[0]; bp->max_bus = bus_range[1]; bp->next = bridge_list; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c --- v2.1.114/linux/arch/ppc/kernel/pmac_setup.c Thu Jul 16 18:09:24 1998 +++ linux/arch/ppc/kernel/pmac_setup.c Tue Aug 4 16:06:36 1998 @@ -96,6 +96,18 @@ } #endif +/* + * Dummy mksound function that does nothing. + * The real one is in the dmasound driver. + */ +static void +pmac_mksound(unsigned int hz, unsigned int ticks) +{ +} + +static volatile u32 *sysctrl_regs; +static volatile u32 *feature_addr; + __initfunc(void pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p)) { @@ -124,7 +136,8 @@ /* this area has the CPU identification register and some registers used by smp boards */ - ioremap(0xf8000000, 0x1000); + sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000); + __ioremap(0xffc00000, 0x400000, pgprot_val(PAGE_READONLY)); *memory_start_p = pmac_find_bridges(*memory_start_p, *memory_end_p); @@ -140,16 +153,10 @@ #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif -#ifdef CONFIG_ABSCON_COMPAT - /* Console wrapper */ - conswitchp = &compat_con; -#endif kd_mksound = pmac_mksound; } -static volatile u32 *feature_addr; - __initfunc(static void ohare_init(void)) { struct device_node *np; @@ -173,6 +180,19 @@ out_le32(feature_addr, in_le32(feature_addr) | PBOOK_FEATURES); printk(KERN_DEBUG "feature reg = %x\n", in_le32(feature_addr)); } + + /* + * Turn on the L2 cache. + * We assume that we have a PSX memory controller iff + * we have an ohare I/O controller. + */ + if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) { + if (sysctrl_regs[4] & 0x10) + sysctrl_regs[4] |= 0x04000020; + else + sysctrl_regs[4] |= 0x04000000; + printk(KERN_INFO "Level 2 cache enabled\n"); + } } extern char *bootpath; @@ -189,9 +209,6 @@ if (_machine == _MACH_Pmac) { media_bay_init(); } -#ifdef CONFIG_PMAC_CONSOLE - pmac_find_display(); -#endif } __initfunc(void @@ -298,6 +315,10 @@ p = find_devices("ATA"); if (p == NULL) p = find_devices("IDE"); + if (p == NULL) + p = find_type_devices("ide"); + if (p == NULL) + p = find_type_devices("ata"); /* Move removable devices such as the media-bay CDROM on the PB3400 to the end of the list. */ for (; p != NULL; p = p->next) { diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/pmac_time.c linux/arch/ppc/kernel/pmac_time.c --- v2.1.114/linux/arch/ppc/kernel/pmac_time.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/pmac_time.c Tue Aug 4 23:57:51 1998 @@ -7,6 +7,7 @@ * Paul Mackerras August 1996. * Copyright (C) 1996 Paul Mackerras. */ +#include #include #include #include @@ -134,6 +135,34 @@ return 1; } +#ifdef CONFIG_PMAC_PBOOK +/* + * Reset the time after a sleep. + */ +static int time_sleep_notify(struct notifier_block *this, unsigned long event, + void *x) +{ + static unsigned long time_diff; + + switch (event) { + case PBOOK_SLEEP: + time_diff = xtime.tv_sec - pmac_get_rtc_time(); + break; + case PBOOK_WAKE: + xtime.tv_sec = pmac_get_rtc_time() + time_diff; + xtime.tv_usec = 0; + set_dec(decrementer_count); + last_rtc_update = xtime.tv_sec; + break; + } + return NOTIFY_DONE; +} + +static struct notifier_block time_sleep_notifier = { + time_sleep_notify, NULL, 100 +}; +#endif /* CONFIG_PMAC_PBOOK */ + /* * Query the OF and get the decr frequency. * This was taken from the pmac time_init() when merging the prep/pmac @@ -143,6 +172,10 @@ { struct device_node *cpu; int freq, *fp, divisor; + +#ifdef CONFIG_PMAC_PBOOK + notifier_chain_register(&sleep_notifier_list, &time_sleep_notifier); +#endif /* CONFIG_PMAC_PBOOK */ if (via_calibrate_decr()) return; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/ppc-stub.c linux/arch/ppc/kernel/ppc-stub.c --- v2.1.114/linux/arch/ppc/kernel/ppc-stub.c Sun Jun 7 11:16:28 1998 +++ linux/arch/ppc/kernel/ppc-stub.c Tue Aug 4 16:06:36 1998 @@ -1,4 +1,4 @@ -/* $Id: ppc-stub.c,v 1.2 1998/04/11 17:29:03 geert Exp $ +/* $Id: ppc-stub.c,v 1.4 1998/07/28 08:25:01 paulus Exp $ * ppc-stub.c: KGDB support for the Linux kernel. * * adapted from arch/sparc/kernel/sparc-stub.c for the PowerPC @@ -385,7 +385,6 @@ debugger_iabr_match = kgdb_iabr_match; debugger_dabr_match = kgdb_dabr_match; - kgdb_interruptible(1); initialized = 1; } diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/ppc_htab.c linux/arch/ppc/kernel/ppc_htab.c --- v2.1.114/linux/arch/ppc/kernel/ppc_htab.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/ppc_htab.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: ppc_htab.c,v 1.18 1998/04/24 12:29:39 davem Exp $ + * $Id: ppc_htab.c,v 1.21 1998/05/13 22:34:55 cort Exp $ * * PowerPC hash table management proc entry. Will show information * about the current hash table and will allow changes to it. @@ -89,7 +89,6 @@ #define PMC1 953 #define PMC2 954 -#ifndef CONFIG_8xx char *pmc1_lookup(unsigned long mmcr0) { switch ( mmcr0 & (0x7f<<7) ) @@ -125,7 +124,6 @@ return "unknown"; } } -#endif /* CONFIG_8xx */ /* * print some useful info about the hash table. This function @@ -135,7 +133,6 @@ static ssize_t ppc_htab_read(struct file * file, char * buf, size_t count, loff_t *ppos) { -#ifndef CONFIG_8xx unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0; int n = 0, valid; unsigned int kptes = 0, overflow = 0, uptes = 0, zombie_ptes = 0; @@ -239,12 +236,14 @@ n += sprintf( buffer + n, "Reloads\t\t: %08lx\n" - "Evicts\t\t: %08lx\n" - "Non-error misses: %08lx\n" - "Error misses\t: %08lx\n", - htab_reloads, htab_evicts, pte_misses, pte_errors); + "Evicts\t\t: %08lx\n", + htab_reloads, htab_evicts); return_string: + n += sprintf( buffer + n, + "Non-error misses: %08lx\n" + "Error misses\t: %08lx\n", + pte_misses, pte_errors); if (*ppos >= strlen(buffer)) return 0; if (n > strlen(buffer) - *ppos) @@ -252,9 +251,6 @@ copy_to_user(buf, buffer + *ppos, n); *ppos += n; return n; -#else /* CONFIG_8xx */ - return 0; -#endif /* CONFIG_8xx */ } /* diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/ppc_ksyms.c linux/arch/ppc/kernel/ppc_ksyms.c --- v2.1.114/linux/arch/ppc/kernel/ppc_ksyms.c Thu Apr 23 20:21:29 1998 +++ linux/arch/ppc/kernel/ppc_ksyms.c Tue Aug 4 16:06:36 1998 @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include #include @@ -22,6 +24,9 @@ #include #include +#define __KERNEL_SYSCALLS__ +#include + extern void transfer_to_handler(void); extern void int_return(void); extern void syscall_trace(void); @@ -31,10 +36,13 @@ extern void ProgramCheckException(struct pt_regs *regs); extern void SingleStepException(struct pt_regs *regs); extern int sys_sigreturn(struct pt_regs *regs); -extern unsigned lost_interrupts; +extern atomic_t n_lost_interrupts; extern void do_lost_interrupts(unsigned long); extern int do_signal(sigset_t *, struct pt_regs *); +asmlinkage long long __ashrdi3(long long, int); +asmlinkage int abs(int); + EXPORT_SYMBOL(do_signal); EXPORT_SYMBOL(syscall_trace); EXPORT_SYMBOL(transfer_to_handler); @@ -46,18 +54,16 @@ EXPORT_SYMBOL(ProgramCheckException); EXPORT_SYMBOL(SingleStepException); EXPORT_SYMBOL(sys_sigreturn); -EXPORT_SYMBOL(lost_interrupts); +EXPORT_SYMBOL(n_lost_interrupts); EXPORT_SYMBOL(do_lost_interrupts); EXPORT_SYMBOL(__ppc_bh_counter); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); +EXPORT_SYMBOL(local_irq_count); -#if !defined(CONFIG_MACH_SPECIFIC) || defined(CONFIG_PMAC) EXPORT_SYMBOL(isa_io_base); -#endif -#if !defined(CONFIG_MACH_SPECIFIC) +EXPORT_SYMBOL(isa_mem_base); EXPORT_SYMBOL(pci_dram_offset); -#endif EXPORT_SYMBOL(atomic_add); EXPORT_SYMBOL(atomic_sub); @@ -124,11 +130,16 @@ EXPORT_SYMBOL(_outsw); EXPORT_SYMBOL(_insl); EXPORT_SYMBOL(_outsl); +EXPORT_SYMBOL(_insw_ns); +EXPORT_SYMBOL(_outsw_ns); +EXPORT_SYMBOL(_insl_ns); +EXPORT_SYMBOL(_outsl_ns); EXPORT_SYMBOL(ioremap); EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(iounmap); EXPORT_SYMBOL(start_thread); +EXPORT_SYMBOL(__kernel_thread); EXPORT_SYMBOL(__down_interruptible); @@ -152,6 +163,9 @@ EXPORT_SYMBOL(pmu_request); EXPORT_SYMBOL(pmu_send_request); EXPORT_SYMBOL(pmu_poll); +#ifdef CONFIG_PMAC_PBOOK +EXPORT_SYMBOL(sleep_notifier_list); +#endif CONFIG_PMAC_PBOOK EXPORT_SYMBOL(abort); EXPORT_SYMBOL(find_devices); EXPORT_SYMBOL(find_type_devices); @@ -160,3 +174,18 @@ EXPORT_SYMBOL(pci_io_base); EXPORT_SYMBOL(pci_device_loc); EXPORT_SYMBOL(note_scsi_host); +EXPORT_SYMBOL(kd_mksound); +#ifdef CONFIG_PMAC +EXPORT_SYMBOL(nvram_read_byte); +EXPORT_SYMBOL(nvram_write_byte); +#endif /* CONFIG_PMAC */ + +#ifdef CONFIG_SOUND_MODULE +EXPORT_SYMBOL(abs); +#endif + +/* The following are special because they're not called + explicitly (the C compiler generates them). Fortunately, + their interface isn't gonna change any time soon now, so + it's OK to leave it out of version control. */ +EXPORT_SYMBOL_NOVERS(__ashrdi3); diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/prep_pci.c linux/arch/ppc/kernel/prep_pci.c --- v2.1.114/linux/arch/ppc/kernel/prep_pci.c Thu Apr 23 20:21:29 1998 +++ linux/arch/ppc/kernel/prep_pci.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: prep_pci.c,v 1.16 1998/02/23 02:47:32 davem Exp $ + * $Id: prep_pci.c,v 1.20 1998/06/19 16:48:45 cort Exp $ * PReP pci functions. * Originally by Gary Thomas * rewritten and updated by Cort Dougan (cort@cs.nmt.edu) @@ -30,7 +30,7 @@ /* Tables for known hardware */ /* Motorola PowerStackII - Utah */ -static char Utah_pci_IRQ_map[23] = +static char Utah_pci_IRQ_map[23] __prepdata = { 0, /* Slot 0 - unused */ 0, /* Slot 1 - unused */ @@ -59,7 +59,7 @@ 0, }; -static char Utah_pci_IRQ_routes[] = +static char Utah_pci_IRQ_routes[] __prepdata = { 0, /* Line 0 - Unused */ 9, /* Line 1 */ @@ -70,7 +70,7 @@ /* Motorola PowerStackII - Omaha */ /* no integrated SCSI or ethernet */ -static char Omaha_pci_IRQ_map[23] = +static char Omaha_pci_IRQ_map[23] __prepdata = { 0, /* Slot 0 - unused */ 0, /* Slot 1 - unused */ @@ -97,7 +97,7 @@ 0, }; -static char Omaha_pci_IRQ_routes[] = +static char Omaha_pci_IRQ_routes[] __prepdata = { 0, /* Line 0 - Unused */ 9, /* Line 1 */ @@ -107,7 +107,7 @@ }; /* Motorola PowerStack */ -static char Blackhawk_pci_IRQ_map[16] = +static char Blackhawk_pci_IRQ_map[16] __prepdata = { 0, /* Slot 0 - unused */ 0, /* Slot 1 - unused */ @@ -127,7 +127,7 @@ 0, /* Slot 15 - unused */ }; -static char Blackhawk_pci_IRQ_routes[] = +static char Blackhawk_pci_IRQ_routes[] __prepdata = { 0, /* Line 0 - Unused */ 9, /* Line 1 */ @@ -137,7 +137,7 @@ }; /* Motorola MVME16xx */ -static char Genesis_pci_IRQ_map[16] = +static char Genesis_pci_IRQ_map[16] __prepdata = { 0, /* Slot 0 - unused */ 0, /* Slot 1 - unused */ @@ -157,7 +157,7 @@ 0, /* Slot 15 - unused */ }; -static char Genesis_pci_IRQ_routes[] = +static char Genesis_pci_IRQ_routes[] __prepdata = { 0, /* Line 0 - Unused */ 10, /* Line 1 */ @@ -167,7 +167,7 @@ }; /* Motorola Series-E */ -static char Comet_pci_IRQ_map[16] = +static char Comet_pci_IRQ_map[16] __prepdata = { 0, /* Slot 0 - unused */ 0, /* Slot 1 - unused */ @@ -187,7 +187,7 @@ 0, /* Slot 15 - unused */ }; -static char Comet_pci_IRQ_routes[] = +static char Comet_pci_IRQ_routes[] __prepdata = { 0, /* Line 0 - Unused */ 10, /* Line 1 */ @@ -201,7 +201,7 @@ * This is actually based on the Carolina motherboard * -- Cort */ -static char ibm8xx_pci_IRQ_map[23] = { +static char ibm8xx_pci_IRQ_map[23] __prepdata = { 0, /* Slot 0 - unused */ 0, /* Slot 1 - unused */ 0, /* Slot 2 - unused */ @@ -226,7 +226,7 @@ 0, /* Slot 21 - unused */ 2, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */ }; -static char ibm8xx_pci_IRQ_routes[] = { +static char ibm8xx_pci_IRQ_routes[] __prepdata = { 0, /* Line 0 - unused */ 13, /* Line 1 */ 10, /* Line 2 */ @@ -235,7 +235,7 @@ }; /* IBM Nobis and 850 */ -static char Nobis_pci_IRQ_map[23] ={ +static char Nobis_pci_IRQ_map[23] __prepdata ={ 0, /* Slot 0 - unused */ 0, /* Slot 1 - unused */ 0, /* Slot 2 - unused */ @@ -254,7 +254,7 @@ 0, /* Slot 15 - unused */ }; -static char Nobis_pci_IRQ_routes[] = { +static char Nobis_pci_IRQ_routes[] __prepdata = { 0, /* Line 0 - Unused */ 13, /* Line 1 */ 13, /* Line 2 */ @@ -270,12 +270,7 @@ #define CAROLINA_IRQ_EDGE_MASK_LO 0x00 /* IRQ's 0-7 */ #define CAROLINA_IRQ_EDGE_MASK_HI 0xA4 /* IRQ's 8-15 [10,13,15] */ -/* - * FIXME: This code incorrectly assumes there's only bus #0, breaking all - * PCI-to-PCI bridges. Also multi-function devices are not supported - * at all. [mj] - */ - +__prep int prep_pcibios_read_config_dword (unsigned char bus, unsigned char dev, unsigned char offset, unsigned int *val) @@ -297,6 +292,7 @@ return PCIBIOS_SUCCESSFUL; } +__prep int prep_pcibios_read_config_word (unsigned char bus, unsigned char dev, unsigned char offset, unsigned short *val) @@ -317,6 +313,7 @@ return PCIBIOS_SUCCESSFUL; } +__prep int prep_pcibios_read_config_byte (unsigned char bus, unsigned char dev, unsigned char offset, unsigned char *val) @@ -337,6 +334,7 @@ return PCIBIOS_SUCCESSFUL; } +__prep int prep_pcibios_write_config_dword (unsigned char bus, unsigned char dev, unsigned char offset, unsigned int val) @@ -356,6 +354,7 @@ return PCIBIOS_SUCCESSFUL; } +__prep int prep_pcibios_write_config_word (unsigned char bus, unsigned char dev, unsigned char offset, unsigned short val) @@ -375,6 +374,7 @@ return PCIBIOS_SUCCESSFUL; } +__prep int prep_pcibios_write_config_byte (unsigned char bus, unsigned char dev, unsigned char offset, unsigned char val) @@ -418,6 +418,7 @@ Motherboard_map_name = "Omaha (PowerStack II Pro3000)"; Motherboard_map = Omaha_pci_IRQ_map; Motherboard_routes = Omaha_pci_IRQ_routes; + break; case 0x60: /* PowerStackII Pro4000 */ Motherboard_map_name = "Utah (Powerstack II Pro4000)"; Motherboard_map = Utah_pci_IRQ_map; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/prep_setup.c linux/arch/ppc/kernel/prep_setup.c --- v2.1.114/linux/arch/ppc/kernel/prep_setup.c Wed Jun 24 22:54:04 1998 +++ linux/arch/ppc/kernel/prep_setup.c Tue Aug 4 16:06:36 1998 @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -36,8 +37,9 @@ #include #include #include +#include -#ifdef CONFIG_SOUND +#if defined(CONFIG_SOUND) || defined(CONFIG_SOUND_MODULE) #include <../drivers/sound/sound_config.h> #include <../drivers/sound/dev_table.h> #endif @@ -60,24 +62,11 @@ extern int rd_image_start; /* starting block # of image */ #endif -__initfunc(void prep_ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)) -{ - ide_ioreg_t port = base; - int i = 8; - - while (i--) - *p++ = port++; - *p++ = base + 0x206; - if (irq != NULL) - *irq = 0; -} - - +__prep int prep_get_cpuinfo(char *buffer) { extern char *Motherboard_map_name; - extern RESIDUAL res; int len, i; #ifdef __SMP__ @@ -88,61 +77,41 @@ len = sprintf(buffer,"machine\t\t: PReP %s\n",Motherboard_map_name); - if ( res.ResidualLength == 0 ) + len += sprintf(buffer+len,"L2\t\t: "); + switch(*((unsigned char *)CACHECRBA) & L2CACHE_MASK) + { + case L2CACHE_512KB: + len += sprintf(buffer+len,"512Kb\n"); + break; + case L2CACHE_256KB: + len += sprintf(buffer+len,"256Kb\n"); + break; + case L2CACHE_1MB: + len += sprintf(buffer+len,"1MB\n"); + break; + case L2CACHE_NONE: + len += sprintf(buffer+len,"none\n"); + break; + default: + len += sprintf(buffer+len,"%x\n", *((unsigned char *)CACHECRBA)); + } + + if ( res->ResidualLength == 0 ) return len; /* print info about SIMMs */ len += sprintf(buffer+len,"simms\t\t: "); - for ( i = 0 ; (res.ActualNumMemories) && (i < MAX_MEMS) ; i++ ) + for ( i = 0 ; (res->ActualNumMemories) && (i < MAX_MEMS) ; i++ ) { - if ( res.Memories[i].SIMMSize != 0 ) + if ( res->Memories[i].SIMMSize != 0 ) len += sprintf(buffer+len,"%d:%ldM ",i, - (res.Memories[i].SIMMSize > 1024) ? - res.Memories[i].SIMMSize>>20 : - res.Memories[i].SIMMSize); + (res->Memories[i].SIMMSize > 1024) ? + res->Memories[i].SIMMSize>>20 : + res->Memories[i].SIMMSize); } len += sprintf(buffer+len,"\n"); #if 0 - /* TLB */ - len += sprintf(buffer+len,"tlb\t\t:"); - switch(res.VitalProductData.TLBAttrib) - { - case CombinedTLB: - len += sprintf(buffer+len," %ld entries\n", - res.VitalProductData.TLBSize); - break; - case SplitTLB: - len += sprintf(buffer+len," (split I/D) %ld/%ld entries\n", - res.VitalProductData.I_TLBSize, - res.VitalProductData.D_TLBSize); - break; - case NoneTLB: - len += sprintf(buffer+len," not present\n"); - break; - } - /* L1 */ - len += sprintf(buffer+len,"l1\t\t: "); - switch(res.VitalProductData.CacheAttrib) - { - case CombinedCAC: - len += sprintf(buffer+len,"%ldkB LineSize %ldB\n", - res.VitalProductData.CacheSize, - res.VitalProductData.CacheLineSize); - break; - case SplitCAC: - len += sprintf(buffer+len,"(split I/D) %ldkB/%ldkB Linesize %ldB/%ldB\n", - res.VitalProductData.I_CacheSize, - res.VitalProductData.D_CacheSize, - res.VitalProductData.D_CacheLineSize, - res.VitalProductData.D_CacheLineSize); - break; - case NoneCAC: - len += sprintf(buffer+len,"not present\n"); - break; - } -#endif - /* L2 */ if ( (inb(IBM_EQUIP_PRESENT) & 1) == 0) /* l2 present */ { @@ -154,6 +123,7 @@ { len += sprintf(buffer+len,"l2\t\t: not present\n"); } +#endif return len; } @@ -186,19 +156,6 @@ break; } -#ifdef CONFIG_BLK_DEV_INITRD - /* initrd_start and size are setup by boot/head.S and kernel/head.S */ - if ( initrd_start ) - { - if (initrd_end > *memory_end_p) - { - printk("initrd extends beyond end of memory " - "(0x%08lx > 0x%08lx)\ndisabling initrd\n", - initrd_end,*memory_end_p); - initrd_start = 0; - } - } -#endif /* make the serial port the console */ /* strcat(cmd_line,"console=ttyS0,9600n8"); */ /* use the normal console but send output to the serial port, too */ @@ -257,8 +214,21 @@ #ifdef CONFIG_VGA_CONSOLE conswitchp = &vga_con; #endif -#ifdef CONFIG_ABSCON_COMPAT - /* Console wrapper */ - conswitchp = &compat_con; -#endif } + +__initfunc(void prep_ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)) +{ + ide_ioreg_t port = base; + int i = 8; + + while (i--) + *p++ = port++; + *p++ = base + 0x206; + if (irq != NULL) + *irq = 0; +} + +#ifdef CONFIG_SOUND_MODULE +EXPORT_SYMBOL(ppc_cs4232_dma); +EXPORT_SYMBOL(ppc_cs4232_dma2); +#endif diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/prep_time.c linux/arch/ppc/kernel/prep_time.c --- v2.1.114/linux/arch/ppc/kernel/prep_time.c Thu May 14 19:47:38 1998 +++ linux/arch/ppc/kernel/prep_time.c Tue Aug 4 16:06:36 1998 @@ -44,7 +44,7 @@ /* * translate from mc146818 to m48t18 addresses */ -unsigned int clock_transl[] = { MOTO_RTC_SECONDS,0 /* alarm */, +unsigned int clock_transl[] __prepdata = { MOTO_RTC_SECONDS,0 /* alarm */, MOTO_RTC_MINUTES,0 /* alarm */, MOTO_RTC_HOURS,0 /* alarm */, /* 4,5 */ MOTO_RTC_DAY_OF_WEEK, @@ -54,6 +54,7 @@ MOTO_RTC_CONTROLA, MOTO_RTC_CONTROLB /* 10,11 */ }; +__prep int prep_cmos_clock_read(int addr) { if ( _prep_type == _PREP_IBM ) @@ -69,6 +70,7 @@ return -1; } +__prep void prep_cmos_clock_write(unsigned long val, int addr) { if ( _prep_type == _PREP_IBM ) @@ -89,6 +91,7 @@ /* * Set the hardware clock. -- Cort */ +__prep int prep_set_rtc_time(unsigned long nowtime) { unsigned char save_control, save_freq_select; @@ -135,6 +138,7 @@ return 0; } +__prep unsigned long prep_get_rtc_time(void) { unsigned int year, mon, day, hour, min, sec; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/process.c linux/arch/ppc/kernel/process.c --- v2.1.114/linux/arch/ppc/kernel/process.c Thu Apr 23 20:21:29 1998 +++ linux/arch/ppc/kernel/process.c Tue Aug 4 16:06:36 1998 @@ -30,12 +30,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -46,6 +46,8 @@ extern unsigned long _get_SP(void); extern spinlock_t scheduler_lock; +struct task_struct *last_task_used_math = NULL; + #undef SHOW_TASK_SWITCHES 1 #undef CHECK_STACK 1 @@ -437,7 +439,7 @@ /* * Low level print for debugging - Cort */ -int ll_printk(const char *fmt, ...) +__initfunc(int ll_printk(const char *fmt, ...)) { va_list args; char buf[256]; @@ -453,10 +455,10 @@ int lines = 24, cols = 80; int orig_x = 0, orig_y = 0; -void ll_puts(const char *s) +__initfunc(void ll_puts(const char *s)) { int x,y; - char *vidmem = (char *)(_ISA_MEM_BASE + 0xB8000) /*0xC00B8000*/; + char *vidmem = (char *)/*(_ISA_MEM_BASE + 0xB8000) */0xD00B8000; char c; extern int mem_init_done; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c --- v2.1.114/linux/arch/ppc/kernel/prom.c Sun Jun 7 11:16:28 1998 +++ linux/arch/ppc/kernel/prom.c Tue Aug 4 16:06:36 1998 @@ -1,4 +1,6 @@ /* + * $Id: prom.c,v 1.32 1998/07/28 20:28:46 geert Exp $ + * * Procedures for interfacing to the Open Firmware PROM on * Power Macintosh computers. * @@ -78,7 +80,7 @@ unsigned int rtas_data = 0; /* virtual pointer */ unsigned int rtas_entry = 0; /* physical pointer */ unsigned int rtas_size = 0; -char chunk[PAGE_SIZE*64]; +unsigned int old_rtas = 0; static struct device_node *allnodes = 0; @@ -122,8 +124,7 @@ #define ALIGN(x) (((x) + sizeof(unsigned long)-1) & -sizeof(unsigned long)) -__pmac - +__openfirmware static void prom_exit() { @@ -138,6 +139,7 @@ ; } +__openfirmware void prom_enter(void) { @@ -150,6 +152,7 @@ RELOC(prom)(&args); } +__openfirmware static void * call_prom(const char *service, int nargs, int nret, ...) { @@ -171,6 +174,7 @@ return prom_args.args[nargs]; } +__openfirmware void prom_print(const char *msg) { @@ -191,15 +195,11 @@ } } - -#ifdef CONFIG_ALL_PPC -unsigned char OF_type[16], OF_model[16]; -#endif - /* * We enter here early on, when the Open Firmware prom is still * handling exceptions and the MMU hash table for us. */ +__openfirmware void prom_init(int r3, int r4, prom_entry pp) { @@ -212,7 +212,11 @@ /* check if we're prep, return if we are */ if ( *(unsigned long *)(0) == 0xdeadc0de ) return; - + + /* check if we're apus, return if we are */ + if ( r3 == 0x61707573 ) + return; + /* First get a handle for the stdout device */ RELOC(prom) = pp; RELOC(prom_chosen) = call_prom(RELOC("finddevice"), 1, 1, @@ -256,11 +260,10 @@ RELOC(rtas_data) = 0; } else { mem = (mem + 4095) & -4096; /* round to page bdry */ - RELOC(rtas_data) = mem - KERNELBASE; + RELOC(rtas_data) = mem + KERNELBASE; mem += RELOC(rtas_size); } prom_rtas = call_prom(RELOC("open"), 1, 1, RELOC("/rtas")); - RELOC(rtas_data) = ((ulong)chunk+4095)&-4096; { int i, nargs; struct prom_args prom_args; @@ -270,7 +273,7 @@ prom_args.nret = 2; prom_args.args[0] = RELOC("instantiate-rtas"); prom_args.args[1] = prom_rtas; - prom_args.args[2] = ((void *)RELOC(rtas_data)-KERNELBASE); + prom_args.args[2] = ((void *)RELOC(rtas_data)-KERNELBASE-offset); RELOC(prom)(&prom_args); if (prom_args.args[nargs] != 0) i = 0; @@ -283,22 +286,7 @@ else prom_print(RELOC(" done\n")); } - RELOC(klimit) = (char *) (mem - offset); -#ifdef CONFIG_ALL_PPC - { - - ihandle prom_root; - - RELOC(prom_root) = call_prom(RELOC("finddevice"), 1, 1, RELOC("/")); - call_prom(RELOC("getprop"), 4, 1, RELOC(prom_root), - RELOC("device_type"), RELOC(OF_type), - (void *) 16); - call_prom(RELOC("getprop"), 4, 1, RELOC(prom_root), - RELOC("model"), RELOC(OF_model), - (void *) 16); - } -#endif } /* @@ -309,13 +297,14 @@ * So we check whether we will need to open the display, * and if so, open it now. */ +__openfirmware static unsigned long check_display(unsigned long mem) { phandle node; ihandle ih; unsigned long offset = reloc_offset(); - char type[16], *path; + char type[16], name[16], *path; for (node = 0; prom_next_node(&node); ) { type[0] = 0; @@ -334,9 +323,17 @@ ih = call_prom(RELOC("open"), 1, 1, path); if (ih == 0 || ih == (ihandle) -1) { prom_print(RELOC("... failed\n")); - continue; + /* platinum kludge. platinum is a valid display, + * but not handled by OF. Make sure prom_num_display + * is incremented anyway + */ + call_prom(RELOC("getprop"), 4, 1, node, RELOC("name"), + name, sizeof(name)); + if (strncmp(name, RELOC("platinum"), 8)) + continue; + } else { + prom_print(RELOC("... ok\n")); } - prom_print(RELOC("... ok\n")); mem += strlen(path) + 1; RELOC(prom_display_paths[RELOC(prom_num_displays)++]) = PTRUNRELOC(path); @@ -346,6 +343,7 @@ return ALIGN(mem); } +__openfirmware static int prom_next_node(phandle *nodep) { @@ -368,6 +366,7 @@ /* * Make a copy of the device tree from the PROM. */ +__openfirmware static unsigned long copy_device_tree(unsigned long mem_start, unsigned long mem_end) { @@ -388,6 +387,7 @@ return new_start; } +__openfirmware static unsigned long inspect_node(phandle node, struct device_node *dad, unsigned long mem_start, unsigned long mem_end, @@ -472,6 +472,7 @@ * It traverses the device tree and fills in the name, type, * {n_}addrs and {n_}intrs fields of each node. */ +__openfirmware void finish_device_tree(void) { @@ -483,6 +484,7 @@ klimit = (char *) mem; } +__openfirmware static unsigned long finish_node(struct device_node *np, unsigned long mem_start, interpret_func *ifunc) @@ -493,8 +495,9 @@ np->type = get_property(np, "device_type", 0); /* get the device addresses and interrupts */ - if (ifunc != NULL) + if (ifunc != NULL) { mem_start = ifunc(np, mem_start); + } if (!strcmp(np->name, "device-tree")) ifunc = interpret_root_props; @@ -520,6 +523,7 @@ return mem_start; } +__openfirmware static unsigned long interpret_pci_props(struct device_node *np, unsigned long mem_start) { @@ -560,6 +564,7 @@ return mem_start; } +__openfirmware static unsigned long interpret_dbdma_props(struct device_node *np, unsigned long mem_start) { @@ -608,6 +613,7 @@ return mem_start; } +__openfirmware static unsigned long interpret_macio_props(struct device_node *np, unsigned long mem_start) { @@ -656,6 +662,7 @@ return mem_start; } +__openfirmware static unsigned long interpret_isa_props(struct device_node *np, unsigned long mem_start) { @@ -693,6 +700,7 @@ return mem_start; } +__openfirmware static unsigned long interpret_root_props(struct device_node *np, unsigned long mem_start) { @@ -734,6 +742,7 @@ /* * Construct and return a list of the device_nodes with a given name. */ +__openfirmware struct device_node * find_devices(const char *name) { @@ -753,6 +762,7 @@ /* * Construct and return a list of the device_nodes with a given type. */ +__openfirmware struct device_node * find_type_devices(const char *type) { @@ -773,6 +783,7 @@ * Construct and return a list of the device_nodes with a given type * and compatible property. */ +__openfirmware struct device_node * find_compatible_devices(const char *type, const char *compat) { @@ -797,6 +808,7 @@ /* * Find the device_node with a given full_name. */ +__openfirmware struct device_node * find_path_device(const char *path) { @@ -811,6 +823,7 @@ /* * Find the device_node with a given phandle. */ +__openfirmware struct device_node * find_phandle(phandle ph) { @@ -826,6 +839,7 @@ * Find a property with a given name for a given node * and return the value. */ +__openfirmware unsigned char * get_property(struct device_node *np, const char *name, int *lenp) { @@ -840,6 +854,7 @@ return 0; } +__openfirmware void print_properties(struct device_node *np) { @@ -890,6 +905,7 @@ } } +__openfirmware int call_rtas(const char *service, int nargs, int nret, unsigned long *outputs, ...) @@ -925,6 +941,7 @@ return u.words[nargs+3]; } +__openfirmware void abort() { diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/ptrace.c linux/arch/ppc/kernel/ptrace.c --- v2.1.114/linux/arch/ppc/kernel/ptrace.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/ptrace.c Tue Aug 4 16:06:36 1998 @@ -46,7 +46,7 @@ */ static inline long get_reg(struct task_struct *task, int regno) { - if (regno <= PT_MQ) + if (regno < sizeof(struct pt_regs) / sizeof(unsigned long)) return ((unsigned long *)task->tss.regs)[regno]; return (0); } diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/residual.c linux/arch/ppc/kernel/residual.c --- v2.1.114/linux/arch/ppc/kernel/residual.c Thu Apr 23 20:21:29 1998 +++ linux/arch/ppc/kernel/residual.c Tue Aug 4 23:57:51 1998 @@ -1,11 +1,28 @@ /* - * $Id: residual.c,v 1.7 1998/03/08 05:49:20 davem Exp $ + * $Id: residual.c,v 1.10 1998/07/09 22:23:18 cort Exp $ * * Code to deal with the PReP residual data. * * Written by: Cort Dougan (cort@cs.nmt.edu) * Improved _greatly_ and rewritten by Gabriel Paubert (paubert@iram.es) + * + * This file is based on the following documentation: + * + * IBM Power Personal Systems Architecture + * Residual Data + * Document Number: PPS-AR-FW0001 + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * */ + +#include +#include +#include +#include + #if 0 #include #include @@ -28,11 +45,9 @@ #include #include -#include #include #include #include -#include const char * PnP_BASE_TYPES[]= { @@ -492,17 +507,17 @@ return; /* make sure we have residual data first */ - if ( res.ResidualLength == 0 ) + if ( res->ResidualLength == 0 ) return; - printk("Residual: %ld devices\n", res.ActualNumDevices); + printk("Residual: %ld devices\n", res->ActualNumDevices); for ( i = 0; - i < res.ActualNumDevices ; + i < res->ActualNumDevices ; i++) { char decomp[4], sn[20]; const char * s; - dev = &res.Devices[i]; + dev = &res->Devices[i]; s = PnP_INTERFACE_STR(did.BaseType, did.SubType, did.Interface); if(!s) { @@ -538,18 +553,18 @@ PnP_SUB_TYPE_STR(did.BaseType,did.SubType), s); printpackets( (union _PnP_TAG_PACKET *) - &res.DevicePnPHeap[dev->AllocatedOffset], "allocated"); + &res->DevicePnPHeap[dev->AllocatedOffset], "allocated"); printpackets( (union _PnP_TAG_PACKET *) - &res.DevicePnPHeap[dev->PossibleOffset], "possible"); + &res->DevicePnPHeap[dev->PossibleOffset], "possible"); printpackets( (union _PnP_TAG_PACKET *) - &res.DevicePnPHeap[dev->CompatibleOffset], "compatible"); + &res->DevicePnPHeap[dev->CompatibleOffset], "compatible"); } } static void printVPD(void) { -#define vpd res.VitalProductData +#define vpd res->VitalProductData int ps=vpd.PageSize, i, j; static const char* Usage[]={ "FirmwareStack", "FirmwareHeap", "FirmwareCode", "BootImage", @@ -594,11 +609,11 @@ printk("WordWidth, PageSize: %ld, %d\n", vpd.WordWidth, ps); printk("Cache sector size, Lock granularity: %ld, %ld\n", vpd.CoherenceBlockSize, vpd.GranuleSize); - for (i=0; iActualNumMemSegs; i++) { + int mask=res->Segs[i].Usage, first, j; printk("%8.8lx-%8.8lx ", - res.Segs[i].BasePage*ps, - (res.Segs[i].PageCount+res.Segs[i].BasePage)*ps-1); + res->Segs[i].BasePage*ps, + (res->Segs[i].PageCount+res->Segs[i].BasePage)*ps-1); for(j=15, first=1; j>=0; j--) { if (mask&(1<DeviceId /* make sure we have residual data first */ - if ( res.ResidualLength == 0 ) + if ( res->ResidualLength == 0 ) return; - printk("Residual: %ld devices\n", res.ActualNumDevices); + printk("Residual: %ld devices\n", res->ActualNumDevices); for ( i = 0; - i < res.ActualNumDevices ; + i < res->ActualNumDevices ; i++) { - dev = &res.Devices[i]; + dev = &res->Devices[i]; /* * pci devices */ @@ -653,7 +668,7 @@ printk(" pnp:"); /* get pnp info on the device */ pkt = (union _PnP_TAG_PACKET *) - &res.DevicePnPHeap[dev->AllocatedOffset]; + &res->DevicePnPHeap[dev->AllocatedOffset]; for (; pkt->S1_Pack.Tag != DF_END_TAG; pkt++ ) { @@ -714,3 +729,125 @@ #endif #endif /* 0 */ +/* Returns the device index in the residual data, + any of the search items may be set as -1 for wildcard, + DevID number field (second halfword) is big endian ! + + Examples: + - search for the Interrupt controller (8259 type), 2 methods: + 1) i8259 = residual_find_device(~0, + NULL, + SystemPeripheral, + ProgrammableInterruptController, + ISA_PIC, + 0); + 2) i8259 = residual_find_device(~0, "PNP0000", -1, -1, -1, 0) + + - search for the first two serial devices, whatever their type) + iserial1 = residual_find_device(~0,NULL, + CommunicationsDevice, + RS232Device, + -1, 0) + iserial2 = residual_find_device(~0,NULL, + CommunicationsDevice, + RS232Device, + -1, 1) + - but search for typical COM1 and COM2 is not easy due to the + fact that the interface may be anything and the name "PNP0500" or + "PNP0501". Quite bad. + +*/ + +/* devid are easier to uncompress than to compress, so to minimize bloat +in this rarely used area we unencode and compare */ + +/* in residual data number is big endian in the device table and +little endian in the heap, so we use two parameters to avoid writing +two very similar functions */ + +static int same_DevID(unsigned short vendor, + unsigned short Number, + char * str) +{ + static unsigned const char hexdigit[]="0123456789ABCDEF"; + if (strlen(str)!=7) return 0; + if ( ( ((vendor>>10)&0x1f)+'A'-1 == str[0]) && + ( ((vendor>>5)&0x1f)+'A'-1 == str[1]) && + ( (vendor&0x1f)+'A'-1 == str[2]) && + (hexdigit[(Number>>12)&0x0f] == str[3]) && + (hexdigit[(Number>>8)&0x0f] == str[4]) && + (hexdigit[(Number>>4)&0x0f] == str[5]) && + (hexdigit[Number&0x0f] == str[6]) ) return 1; + return 0; +} + +PPC_DEVICE *residual_find_device(unsigned long BusMask, + unsigned char * DevID, + int BaseType, + int SubType, + int Interface, + int n) +{ + int i; + if ( !res->ResidualLength ) return NULL; + for (i=0; iActualNumDevices; i++) { +#define Dev res->Devices[i].DeviceId + if ( (Dev.BusId&BusMask) && + (BaseType==-1 || Dev.BaseType==BaseType) && + (SubType==-1 || Dev.SubType==SubType) && + (Interface==-1 || Dev.Interface==Interface) && + (DevID==NULL || same_DevID((Dev.DevId>>16)&0xffff, + Dev.DevId&0xffff, DevID)) && + !(n--) ) return res->Devices+i; +#undef Dev + } + return 0; +} + +PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, + unsigned packet_tag, + int n) +{ + unsigned mask, masked_tag, size; + if(!p) return 0; + if (tag_type(packet_tag)) mask=0xff; else mask=0xF8; + masked_tag = packet_tag&mask; + for(; *p != END_TAG; p+=size) { + if ((*p & mask) == masked_tag && !(n--)) + return (PnP_TAG_PACKET *) p; + if (tag_type(*p)) + size=ld_le16((unsigned short *)(p+1))+3; + else + size=tag_small_count(*p)+1; + } + return 0; /* not found */ +} + +PnP_TAG_PACKET *PnP_find_small_vendor_packet(unsigned char *p, + unsigned packet_type, + int n) +{ + int next=0; + while (p) { + p = (unsigned char *) PnP_find_packet(p, 0x70, next); + if (p && p[1]==packet_type && !(n--)) + return (PnP_TAG_PACKET *) p; + next = 1; + }; + return 0; /* not found */ +} + +PnP_TAG_PACKET *PnP_find_large_vendor_packet(unsigned char *p, + unsigned packet_type, + int n) +{ + int next=0; + while (p) { + p = (unsigned char *) PnP_find_packet(p, 0x84, next); + if (p && p[3]==packet_type && !(n--)) + return (PnP_TAG_PACKET *) p; + next = 1; + }; + return 0; /* not found */ +} + diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/setup.c linux/arch/ppc/kernel/setup.c --- v2.1.114/linux/arch/ppc/kernel/setup.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/setup.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: setup.c,v 1.77 1998/05/04 07:24:38 geert Exp $ + * $Id: setup.c,v 1.95 1998/07/20 19:03:47 geert Exp $ * Common prep/pmac/chrp boot and setup code. */ @@ -19,20 +19,20 @@ #include #include #include -#ifdef CONFIG_MBX -#include -#endif -/* ifdef APUS specific stuff until the merge is completed. -jskov */ -#ifdef CONFIG_APUS +#include #include #include #include +#ifdef CONFIG_MBX +#include +#endif + +/* APUS defs */ extern unsigned long m68k_machtype; -extern void amiga_reset (void); -extern struct mem_info m68k_ramdisk; -extern int m68k_parse_bootinfo(const struct bi_record *); +extern struct mem_info ramdisk; +extern int parse_bootinfo(const struct bi_record *); extern char _end[]; -#endif +/* END APUS defs */ extern char cmd_line[512]; char saved_command_line[256]; @@ -47,7 +47,9 @@ #endif /* ! CONFIG_MACH_SPECIFIC */ /* copy of the residual data */ -RESIDUAL res; +unsigned char __res[sizeof(RESIDUAL)] __prepdata = {0,}; +RESIDUAL *res = (RESIDUAL *)&__res; + int _prep_type; /* @@ -57,10 +59,9 @@ * that is. -- Cort */ #ifndef CONFIG_MBX -#if !defined(CONFIG_PMAC_CONSOLE) struct screen_info screen_info = { 0, 25, /* orig-x, orig-y */ - { 0, 0 }, /* unused */ + 0, /* unused */ 0, /* orig-video-page */ 0, /* orig-video-mode */ 80, /* orig-video-cols */ @@ -80,7 +81,6 @@ __initfunc(void pmac_find_display(void)) { } -#endif #else /* CONFIG_MBX */ @@ -89,7 +89,7 @@ */ struct screen_info screen_info = { 0, 25, /* orig-x, orig-y */ - { 0, 0 }, /* unused */ + 0, /* unused */ 0, /* orig-video-page */ 0, /* orig-video-mode */ 80, /* orig-video-cols */ @@ -161,19 +161,15 @@ break; case _MACH_apus: cli(); - /* APUS:FIXME: Reset the system. Apparently there's - * more magic to it than this!?!? - */ -#if 0 + + APUS_WRITE(APUS_REG_LOCK, + REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK2); + APUS_WRITE(APUS_REG_LOCK, + REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK3); + APUS_WRITE(APUS_REG_LOCK, + REGLOCK_BLACKMAGICK2|REGLOCK_BLACKMAGICK3); APUS_WRITE(APUS_REG_SHADOW, REGSHADOW_SELFRESET); - APUS_WRITE(APUS_REG_RESET, - REGRESET_PPCRESET|REGRESET_M68KRESET| - REGRESET_AMIGARESET|REGRESET_AUXRESET| - REGRESET_SCSIRESET); -#endif - printk("\n**************************************\n"); - printk("*** You can make a hard reset now! ***\n"); - printk("**************************************\n"); + APUS_WRITE(APUS_REG_RESET, REGRESET_AMIGARESET); for(;;); break; } @@ -220,13 +216,11 @@ case _MACH_prep: machine_restart(NULL); -#ifdef CONFIG_APUS case _MACH_apus: #if defined(CONFIG_APM) && defined(CONFIG_APM_POWER_OFF) apm_set_power_state(APM_STATE_OFF); for (;;); #endif -#endif } for (;;); #else /* CONFIG_MBX */ @@ -238,11 +232,7 @@ { if ( _machine == _MACH_Pmac ) { -#if 0 - prom_exit(); /* doesn't work because prom is trashed */ -#else - machine_power_off(); /* for now */ -#endif + machine_power_off(); } else /* prep, chrp or apus */ machine_restart(NULL); @@ -252,7 +242,7 @@ #ifdef CONFIG_BLK_DEV_IDE void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq) { -#ifndef CONFIG_MBX +#if !defined(CONFIG_MBX) && !defined(CONFIG_APUS) switch (_machine) { case _MACH_Pmac: pmac_ide_init_hwif_ports(p,base,irq); @@ -383,17 +373,16 @@ len += sprintf(len+buffer, "603ev\n"); break; case 8: - len += sprintf(len+buffer,"750\n"); + len += sprintf(len+buffer, "750\n"); cr = _get_L2CR(); - len += sprintf(len+buffer,"L2CR\t\t: %lx\n",cr); - if ( cr & (0x1<<1)) cr = 256; - else if ( cr & (0x2<<1)) cr = 512; - else if ( cr & (0x3<<1)) cr = 1024; + if ( cr & (0x1<<28)) cr = 256; + else if ( cr & (0x2<<28)) cr = 512; + else if ( cr & (0x3<<28)) cr = 1024; else cr = 0; - len += sprintf(len+buffer,"on-chip l2\t: " + len += sprintf(len+buffer, "on-chip l2\t: " "%ld KB (%s)\n", - cr,(_get_L2CR()&1) ? "on" : "off"); - len += sprintf(len+buffer,"temperature \t: %lu C\n", + cr,(_get_L2CR()&0x80000000) ? "on" : "off"); + len += sprintf(len+buffer, "temperature \t: %lu C\n", cpu_temp()); break; case 9: @@ -436,11 +425,11 @@ if ( is_prep ) { len += sprintf(len+buffer, "clock\t\t: "); - if ( res.ResidualLength ) + if ( res->ResidualLength ) len += sprintf(len+buffer, "%ldMHz\n", - (res.VitalProductData.ProcessorHz > 1024) ? - res.VitalProductData.ProcessorHz>>20 : - res.VitalProductData.ProcessorHz); + (res->VitalProductData.ProcessorHz > 1024) ? + res->VitalProductData.ProcessorHz>>20 : + res->VitalProductData.ProcessorHz); else len += sprintf(len+buffer, "???\n"); } @@ -479,15 +468,16 @@ * Ooh's and aah's info about zero'd pages in idle task */ { - extern unsigned int zerocount, zerototal, zeropage_hits,zeropage_calls; - len += sprintf(buffer+len,"zero pages\t: total %u (%luKb) " - "current: %u (%luKb) hits: %u/%u (%u%%)\n", - zerototal, (zerototal*PAGE_SIZE)>>10, - zerocount, (zerocount*PAGE_SIZE)>>10, - zeropage_hits,zeropage_calls, + len += sprintf(buffer+len,"zero pages\t: total %lu (%luKb) " + "current: %lu (%luKb) hits: %lu/%lu (%lu%%)\n", + quicklists.zerototal, + (quicklists.zerototal*PAGE_SIZE)>>10, + quicklists.zero_sz, + (quicklists.zero_sz*PAGE_SIZE)>>10, + quicklists.zeropage_hits,quicklists.zeropage_calls, /* : 1 below is so we don't div by zero */ - (zeropage_hits*100) / - ((zeropage_calls)?zeropage_calls:1)); + (quicklists.zeropage_hits*100) / + ((quicklists.zeropage_calls)?quicklists.zeropage_calls:1)); } #ifndef CONFIG_MBX @@ -502,11 +492,10 @@ case _MACH_chrp: len += chrp_get_cpuinfo(buffer+len); break; -#ifdef CONFIG_APUS case _MACH_apus: - len += apus_get_cpuinfo(buffer+len); + /* Not much point in printing m68k info when it is not + used. */ break; -#endif } #endif /* ndef CONFIG_MBX */ return len; @@ -522,53 +511,29 @@ { extern void setup_pci_ptrs(void); #ifndef CONFIG_MBX - -#ifdef CONFIG_APUS - if ( r3 == 0x61707573 ) - { - /* Parse bootinfo. The bootinfo is located right after - the kernel bss */ - m68k_parse_bootinfo((const struct bi_record *)&_end); - - have_of = 0; - -#ifdef CONFIG_BLK_DEV_INITRD - /* Take care of initrd if we have one. Use data from - bootinfo to avoid the need to initialize PPC - registers when kernel is booted via a PPC reset. */ - if ( m68k_ramdisk.addr ) { - initrd_start = (unsigned long) __va(m68k_ramdisk.addr); - initrd_end = (unsigned long) - __va(m68k_ramdisk.size + m68k_ramdisk.addr); - } -#endif /* CONFIG_BLK_DEV_INITRD */ - - return 0; - } -#endif /* CONFIG_APUS */ - #ifndef CONFIG_MACH_SPECIFIC + char *model; /* prep boot loader tells us if we're prep or not */ if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) ) { _machine = _MACH_prep; have_of = 0; + } + /* boot loader will tell us if we're APUS */ + else if ( r3 == 0x61707573 ) + { + _machine = _MACH_apus; + have_of = 0; + r3 = 0; } else { - /* need to ask OF if we're chrp or pmac */ - extern unsigned char OF_type[16], OF_model[16]; - prom_print(OF_type); - prom_print(OF_model); - if ( !strncmp("chrp", OF_type,4) ) - { + have_of = 1; + /* ask the OF info if we're a chrp or pmac */ + model = get_property(find_path_device("/"), "type", NULL); + if ( !strncmp("chrp",model,4) ) _machine = _MACH_chrp; - } else - { - /*if ( !strncmp("Power Macintosh", type,15) )*/ _machine = _MACH_Pmac; - } - _machine = _MACH_Pmac; } #endif /* CONFIG_MACH_SPECIFIC */ @@ -613,18 +578,15 @@ cmd_line[sizeof(cmd_line) - 1] = 0; } -#ifdef CONFIG_PCI - /* so that pmac/chrp can use pci to find its console -- Cort */ - setup_pci_ptrs(); -#endif switch (_machine) { case _MACH_Pmac: -#if !defined(CONFIG_MACH_SPECIFIC) + setup_pci_ptrs(); /* isa_io_base gets set in pmac_find_bridges */ isa_mem_base = PMAC_ISA_MEM_BASE; pci_dram_offset = PMAC_PCI_DRAM_OFFSET; +#if !defined(CONFIG_MACH_SPECIFIC) ISA_DMA_THRESHOLD = ~0L; DMA_MODE_READ = 1; DMA_MODE_WRITE = 2; @@ -633,20 +595,21 @@ case _MACH_prep: /* make a copy of residual data */ if ( r3 ) - memcpy((void *)&res,(void *)(r3+KERNELBASE), + memcpy((void *)res,(void *)(r3+KERNELBASE), sizeof(RESIDUAL)); -#if !defined(CONFIG_MACH_SPECIFIC) + setup_pci_ptrs(); isa_io_base = PREP_ISA_IO_BASE; isa_mem_base = PREP_ISA_MEM_BASE; pci_dram_offset = PREP_PCI_DRAM_OFFSET; +#if !defined(CONFIG_MACH_SPECIFIC) ISA_DMA_THRESHOLD = 0x00ffffff; DMA_MODE_READ = 0x44; DMA_MODE_WRITE = 0x48; #endif /* ! CONFIG_MACH_SPECIFIC */ /* figure out what kind of prep workstation we are */ - if ( res.ResidualLength != 0 ) + if ( res->ResidualLength != 0 ) { - if ( !strncmp(res.VitalProductData.PrintableModel,"IBM",3) ) + if ( !strncmp(res->VitalProductData.PrintableModel,"IBM",3) ) _prep_type = _PREP_IBM; else _prep_type = _PREP_Motorola; @@ -669,23 +632,48 @@ } break; case _MACH_chrp: + setup_pci_ptrs(); #ifdef CONFIG_BLK_DEV_INITRD /* take care of initrd if we have one */ if ( r3 ) { initrd_start = r3 + KERNELBASE; - initrd_end = r3+ r4 + KERNELBASE; + initrd_end = r3 + r4 + KERNELBASE; } #endif /* CONFIG_BLK_DEV_INITRD */ -#if !defined(CONFIG_MACH_SPECIFIC) - isa_io_base = CHRP_ISA_IO_BASE; + /* isa_io_base set by setup_pci_ptrs() */ isa_mem_base = CHRP_ISA_MEM_BASE; pci_dram_offset = CHRP_PCI_DRAM_OFFSET; +#if !defined(CONFIG_MACH_SPECIFIC) ISA_DMA_THRESHOLD = ~0L; DMA_MODE_READ = 0x44; DMA_MODE_WRITE = 0x48; #endif /* ! CONFIG_MACH_SPECIFIC */ break; +#ifdef CONFIG_APUS + case _MACH_apus: + setup_pci_ptrs(); + /* Parse bootinfo. The bootinfo is located right after + the kernel bss */ + parse_bootinfo((const struct bi_record *)&_end); +#ifdef CONFIG_BLK_DEV_INITRD + /* Take care of initrd if we have one. Use data from + bootinfo to avoid the need to initialize PPC + registers when kernel is booted via a PPC reset. */ + if ( ramdisk.addr ) { + initrd_start = (unsigned long) __va(ramdisk.addr); + initrd_end = (unsigned long) + __va(ramdisk.size + ramdisk.addr); + } + /* Make sure code below is not executed. */ + r4 = 0; + r6 = 0; +#endif /* CONFIG_BLK_DEV_INITRD */ +#if !defined(CONFIG_MACH_SPECIFIC) + ISA_DMA_THRESHOLD = 0x00ffffff; +#endif /* ! CONFIG_MACH_SPECIFIC */ + break; +#endif default: printk("Unknown machine type in identify_machine!\n"); } @@ -693,8 +681,10 @@ if ( r3 ) memcpy( (void *)&res,(void *)(r3+KERNELBASE), sizeof(bd_t) ); - + +#ifdef CONFIG_PCI setup_pci_ptrs(); +#endif #ifdef CONFIG_BLK_DEV_INITRD /* take care of initrd if we have one */ @@ -711,7 +701,6 @@ *(char *)(r7+KERNELBASE) = 0; strcpy(cmd_line, (char *)(r6+KERNELBASE)); } - #endif /* CONFIG_MBX */ return 0; } @@ -722,8 +711,8 @@ extern void pmac_setup_arch(unsigned long *, unsigned long *); extern void chrp_setup_arch(unsigned long *, unsigned long *); extern void prep_setup_arch(unsigned long *, unsigned long *); - extern void apus_setup_arch(char **, unsigned long *, unsigned long *); extern void mbx_setup_arch(unsigned long *, unsigned long *); + extern void apus_setup_arch(unsigned long *, unsigned long *); extern int panic_timeout; extern char _etext[], _edata[]; extern char *klimit; @@ -749,6 +738,21 @@ *memory_start_p = find_available_memory(); *memory_end_p = (unsigned long) end_of_DRAM; + +#ifdef CONFIG_BLK_DEV_INITRD + /* initrd_start and size are setup by boot/head.S and kernel/head.S */ + if ( initrd_start ) + { + if (initrd_end > *memory_end_p) + { + printk("initrd extends beyond end of memory " + "(0x%08lx > 0x%08lx)\ndisabling initrd\n", + initrd_end,*memory_end_p); + initrd_start = 0; + } + } +#endif + #ifdef CONFIG_MBX mbx_setup_arch(memory_start_p,memory_end_p); #else /* CONFIG_MBX */ @@ -762,12 +766,12 @@ case _MACH_chrp: chrp_setup_arch(memory_start_p, memory_end_p); break; -#ifdef CONFIG_APUS +#ifdef CONFIG_APUS case _MACH_apus: m68k_machtype = MACH_AMIGA; - apus_setup_arch(cmdline_p,memory_start_p,memory_end_p); + apus_setup_arch(memory_start_p,memory_end_p); break; -#endif +#endif default: printk("Unknown machine %d in setup_arch()\n", _machine); } diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/signal.c linux/arch/ppc/kernel/signal.c --- v2.1.114/linux/arch/ppc/kernel/signal.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/signal.c Tue Aug 4 16:06:36 1998 @@ -1,6 +1,8 @@ /* * linux/arch/ppc/kernel/signal.c * + * $Id: signal.c,v 1.16 1998/06/16 23:34:10 cort Exp $ + * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c --- v2.1.114/linux/arch/ppc/kernel/smp.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/smp.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: smp.c,v 1.24 1998/04/27 09:02:37 cort Exp $ + * $Id: smp.c,v 1.28 1998/08/04 04:47:45 cort Exp $ * * Smp support for ppc. * @@ -43,8 +43,8 @@ struct cpuinfo_PPC cpu_data[NR_CPUS]; struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 }; volatile unsigned char active_kernel_processor = NO_PROC_ID; /* Processor holding kernel spinlock */ - volatile unsigned long ipi_count; +spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; unsigned int prof_multiplier[NR_CPUS]; unsigned int prof_counter[NR_CPUS]; @@ -81,7 +81,7 @@ p->counter -= 1; if (p->counter < 0) { p->counter = 0; - need_resched = 1; + current->need_resched = 1; } if (p->priority < DEF_PRIORITY) { kstat.cpu_nice += user; @@ -137,6 +137,12 @@ smp_message[smp_processor_id()] = -1; } +void smp_send_reschedule(int cpu) +{ + /* for now, nothing */ +} + + spinlock_t mesg_pass_lock = SPIN_LOCK_UNLOCKED; void smp_message_pass(int target, int msg, unsigned long data, int wait) { @@ -222,13 +228,13 @@ /* interrupt secondary to begin executing code */ *(volatile unsigned long *)(0xf80000c0) = 0L; eieio(); - /* wait to see if the secondary made a callin (is actually up) */ - for ( timeout = 0; timeout < 15000 ; timeout++ ) - { - if(cpu_callin_map[1]) - break; - udelay(100); - } + /* + * wait to see if the secondary made a callin (is actually up). + * udelay() isn't accurate here since we haven't yet called + * calibrate_delay() so use this value that I found through + * experimentation. -- Cort + */ + udelay(1); if(cpu_callin_map[1]) { cpu_number_map[1] = 1; __cpu_logical_map[i] = 1; diff -u --recursive --new-file v2.1.114/linux/arch/ppc/kernel/time.c linux/arch/ppc/kernel/time.c --- v2.1.114/linux/arch/ppc/kernel/time.c Fri May 8 23:14:45 1998 +++ linux/arch/ppc/kernel/time.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: time.c,v 1.32 1998/04/24 12:29:38 davem Exp $ + * $Id: time.c,v 1.35 1998/07/24 11:05:47 geert Exp $ * Common time routines among all ppc machines. * * Written by Cort Dougan (cort@cs.nmt.edu) to merge @@ -95,10 +95,12 @@ * update the rtc when needed */ if ( xtime.tv_sec > last_rtc_update + 660 ) + { if (set_rtc_time(xtime.tv_sec) == 0) last_rtc_update = xtime.tv_sec; else last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ + } } } #ifdef __SMP__ @@ -199,8 +201,7 @@ prep_calibrate_decr(); set_rtc_time = prep_set_rtc_time; break; -/* ifdef APUS specific stuff until the merge is completed. -jskov */ -#ifdef CONFIG_APUS +#ifdef CONFIG_APUS case _MACH_apus: { xtime.tv_sec = apus_get_rtc_time(); @@ -208,7 +209,7 @@ set_rtc_time = apus_set_rtc_time; break; } -#endif +#endif } xtime.tv_usec = 0; #else /* CONFIG_MBX */ diff -u --recursive --new-file v2.1.114/linux/arch/ppc/lib/locks.c linux/arch/ppc/lib/locks.c --- v2.1.114/linux/arch/ppc/lib/locks.c Thu Apr 23 20:21:29 1998 +++ linux/arch/ppc/lib/locks.c Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: locks.c,v 1.17 1998/03/26 22:19:38 cort Exp $ + * $Id: locks.c,v 1.18 1998/07/28 03:50:27 cort Exp $ * * Locks for smp ppc * @@ -18,7 +18,7 @@ #define DEBUG_LOCKS 1 #undef INIT_STUCK -#define INIT_STUCK 1000000 +#define INIT_STUCK 10000 void _spin_lock(spinlock_t *lock) { @@ -120,7 +120,7 @@ { #ifdef DEBUG_LOCKS if ( rw->lock == 0 ) - printk("_read_unlock(): %s/%d (nip %08lX) lock %lx", + printk("_read_unlock(): %s/%d (nip %08lX) lock %lx\n", current->comm,current->pid,current->tss.regs->nip, rw->lock); #endif /* DEBUG_LOCKS */ @@ -176,7 +176,7 @@ { #ifdef DEBUG_LOCKS if ( !(rw->lock & (1<<31)) ) - printk("_write_lock(): %s/%d (nip %08lX) lock %lx", + printk("_write_lock(): %s/%d (nip %08lX) lock %lx\n", current->comm,current->pid,current->tss.regs->nip, rw->lock); #endif /* DEBUG_LOCKS */ diff -u --recursive --new-file v2.1.114/linux/arch/ppc/mbx_defconfig linux/arch/ppc/mbx_defconfig --- v2.1.114/linux/arch/ppc/mbx_defconfig Fri May 8 23:14:45 1998 +++ linux/arch/ppc/mbx_defconfig Tue Aug 4 16:06:36 1998 @@ -33,7 +33,6 @@ # CONFIG_BINFMT_MISC is not set # CONFIG_BINFMT_JAVA is not set # CONFIG_PARPORT is not set -# CONFIG_PMAC_CONSOLE is not set # CONFIG_MAC_KEYBOARD is not set # CONFIG_MAC_FLOPPY is not set # CONFIG_MAC_SERIAL is not set @@ -77,7 +76,6 @@ CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y # CONFIG_IP_PNP_RARP is not set -# CONFIG_IP_ACCT is not set # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set @@ -133,7 +131,6 @@ # CD-ROM drivers (not for SCSI or IDE/ATAPI drives) # # CONFIG_CD_NO_IDESCSI is not set -# CONFIG_CDROM is not set # # Filesystems @@ -186,3 +183,8 @@ # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set + +# +# Sound +# +# CONFIG_SOUND is not set 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 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: init.c,v 1.94 1998/05/06 02:07:36 paulus Exp $ + * $Id: init.c,v 1.115 1998/08/04 20:48:38 davem Exp $ * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) @@ -45,16 +45,12 @@ #include #include #include -#ifdef CONFIG_8xx #include -#endif -#ifdef CONFIG_MBX #include -#endif -#ifdef CONFIG_APUS /* ifdef APUS specific stuff until the merge is completed. -jskov */ +/* APUS includes */ #include #include -#endif +/* END APUS includes */ int prom_trashed; int next_mmu_context; @@ -67,21 +63,23 @@ extern char __prep_begin, __prep_end; extern char __pmac_begin, __pmac_end; extern char __openfirmware_begin, __openfirmware_end; -extern RESIDUAL res; char *klimit = _end; struct device_node *memory_node; unsigned long ioremap_base; unsigned long ioremap_bot; unsigned long avail_start; -#ifndef __SMP__ struct pgtable_cache_struct quicklists; -#endif +struct mem_info memory[NUM_MEMINFO]; void MMU_init(void); static void *MMU_get_page(void); unsigned long *prep_find_end_of_memory(void); unsigned long *pmac_find_end_of_memory(void); +unsigned long *apus_find_end_of_memory(void); extern unsigned long *find_end_of_memory(void); +#ifdef CONFIG_MBX +unsigned long *mbx_find_end_of_memory(void); +#endif /* CONFIG_MBX */ static void mapin_ram(void); void map_page(struct task_struct *, unsigned long va, unsigned long pa, int flags); @@ -90,10 +88,10 @@ extern struct task_struct *current_set[NR_CPUS]; -#ifndef CONFIG_8xx -unsigned long _SDR1; PTE *Hash, *Hash_end; unsigned long Hash_size, Hash_mask; +#ifndef CONFIG_8xx +unsigned long _SDR1; static void hash_init(void); union ubat { /* BAT register values to be loaded */ BAT bat; @@ -107,9 +105,6 @@ unsigned long phys; } bat_addrs[4]; #endif /* CONFIG_8xx */ -#ifdef CONFIG_MBX -void set_mbx_memory(void); -#endif /* CONFIG_MBX */ /* * this tells the system to map all of ram with the segregs @@ -128,19 +123,20 @@ pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) { - pte_t *pte; + pte_t *pte/* = (pte_t *) __get_free_page(GFP_KERNEL)*/; - pte = (pte_t *) __get_free_page(GFP_KERNEL); if (pmd_none(*pmd)) { + if ( (pte = (pte_t *) get_zero_page_fast()) == NULL ) + if ((pte = (pte_t *) __get_free_page(GFP_KERNEL))) + clear_page((unsigned long)pte); if (pte) { - clear_page((unsigned long)pte); pmd_val(*pmd) = (unsigned long)pte; return pte + offset; } pmd_val(*pmd) = (unsigned long)BAD_PAGETABLE; return NULL; } - free_page((unsigned long)pte); + /*free_page((unsigned long)pte);*/ if (pmd_bad(*pmd)) { __bad_pte(pmd); return NULL; @@ -148,6 +144,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 @@ -165,7 +177,6 @@ pte_t * __bad_pagetable(void) { - /*memset((void *)empty_bad_page_table, 0, PAGE_SIZE);*/ __clear_user((void *)empty_bad_page_table, PAGE_SIZE); return (pte_t *) empty_bad_page_table; } @@ -174,7 +185,6 @@ pte_t __bad_page(void) { - /*memset((void *)empty_bad_page, 0, PAGE_SIZE);*/ __clear_user((void *)empty_bad_page, PAGE_SIZE); return pte_mkdirty(mk_pte(empty_bad_page, PAGE_SHARED)); } @@ -311,7 +321,8 @@ v = (ioremap_bot -= size); } - flags |= pgprot_val(PAGE_KERNEL); + if ((flags & _PAGE_PRESENT) == 0) + flags |= pgprot_val(PAGE_KERNEL); if (flags & (_PAGE_NO_CACHE | _PAGE_WRITETHRU)) flags |= _PAGE_GUARDED; for (i = 0; i < size; i += PAGE_SIZE) @@ -425,7 +436,6 @@ { #ifndef CONFIG_8xx __clear_user(Hash, Hash_size); - /*memset(Hash, 0, Hash_size);*/ _tlbia(); #else asm volatile ("tlbia" : : ); @@ -771,11 +781,10 @@ #define IO_PAGE (_PAGE_NO_CACHE | _PAGE_GUARDED | _PAGE_RW) #ifdef __SMP__ -#define RAM_PAGE (_PAGE_COHERENT | _PAGE_RW) +#define RAM_PAGE (_PAGE_RW|_PAGE_COHERENT) #else #define RAM_PAGE (_PAGE_RW) #endif - #endif /* CONFIG_8xx */ /* @@ -792,12 +801,18 @@ #ifndef MAP_RAM_WITH_SEGREGS /* Set up BAT2 and if necessary BAT3 to cover RAM. */ + mem_base = __pa(KERNELBASE); tot = (unsigned long)end_of_DRAM - KERNELBASE; - for (bl = 128<<10; bl < 256<<20; bl <<= 1) + for (bl = 128<<10; bl < 256<<20; bl <<= 1) { if (bl * 2 > tot) break; + /* On some APUS systems, memory grows downwards, i.e., + 24MB will be 8MB aligned. Handle that properly by + mapping first 8MB, then 16MB. */ + if (((bl * 2) - 1) & mem_base) + break; + } - mem_base = __pa(KERNELBASE); setbat(2, KERNELBASE, mem_base, bl, RAM_PAGE); done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1; if (done < tot) { @@ -869,7 +884,7 @@ { unsigned long a; unsigned long num_freed_pages = 0, num_prep_pages = 0, - num_pmac_pages = 0; + num_pmac_pages = 0, num_openfirmware_pages = 0; #define FREESEC(START,END,CNT) do { \ a = (unsigned long)(&START); \ @@ -890,11 +905,11 @@ break; case _MACH_prep: FREESEC(__pmac_begin,__pmac_end,num_pmac_pages); - FREESEC(__openfirmware_begin,__openfirmware_end,num_pmac_pages); + FREESEC(__openfirmware_begin,__openfirmware_end,num_openfirmware_pages); break; case _MACH_mbx: FREESEC(__pmac_begin,__pmac_end,num_pmac_pages); - FREESEC(__openfirmware_begin,__openfirmware_end,num_pmac_pages); + FREESEC(__openfirmware_begin,__openfirmware_end,num_openfirmware_pages); FREESEC(__prep_begin,__prep_end,num_prep_pages); break; } @@ -905,6 +920,8 @@ printk(" %ldk prep",(num_prep_pages*PAGE_SIZE)>>10); if ( num_pmac_pages ) printk(" %ldk pmac",(num_pmac_pages*PAGE_SIZE)>>10); + if ( num_openfirmware_pages ) + printk(" %ldk open firmware",(num_openfirmware_pages*PAGE_SIZE)>>10); printk("\n"); } @@ -920,10 +937,8 @@ #ifndef CONFIG_8xx if (have_of) end_of_DRAM = pmac_find_end_of_memory(); -#ifdef CONFIG_APUS else if (_machine == _MACH_apus ) end_of_DRAM = apus_find_end_of_memory(); -#endif else /* prep */ end_of_DRAM = prep_find_end_of_memory(); @@ -941,33 +956,31 @@ */ switch (_machine) { case _MACH_prep: - setbat(0, 0x80000000, 0x80000000, 0x10000000, - IO_PAGE + ((_prep_type == _PREP_IBM)? _PAGE_USER: 0)); - setbat(1, 0xd0000000, 0xc0000000, 0x10000000, - IO_PAGE + ((_prep_type == _PREP_IBM)? _PAGE_USER: 0)); + setbat(0, 0x80000000, 0x80000000, 0x10000000, IO_PAGE); + setbat(1, 0xd0000000, 0xc0000000, 0x10000000, IO_PAGE); break; case _MACH_chrp: - setbat(0, 0xf8000000, 0xf8000000, 0x20000, IO_PAGE); + setbat(0, 0xf8000000, 0xf8000000, 0x08000000, IO_PAGE); break; case _MACH_Pmac: setbat(0, 0xf3000000, 0xf3000000, 0x100000, IO_PAGE); ioremap_base = 0xf0000000; break; -#ifdef CONFIG_APUS case _MACH_apus: - /* Map Cyberstorm PPC registers. */ - /* FIXME:APUS: Performance penalty here. Restrict it - * to the Cyberstorm registers. - */ - setbat(0, 0xfff00000, 0xfff00000, 0x00080000, IO_PAGE); + /* Map PPC exception vectors. */ + setbat(0, 0xfff00000, 0xfff00000, 0x00010000, RAM_PAGE); /* Map chip and ZorroII memory */ setbat(1, zTwoBase, 0x00000000, 0x01000000, IO_PAGE); + /* Note: a temporary hack in arch/ppc/amiga/setup.c + (kernel_map) remaps individual IO regions to + 0x90000000. */ break; -#endif } ioremap_bot = ioremap_base; #else /* CONFIG_8xx */ - +#ifdef CONFIG_MBX + end_of_DRAM = mbx_find_end_of_memory(); +#endif /* CONFIG_MBX */ /* Map in all of RAM starting at KERNELBASE */ mapin_ram(); @@ -983,385 +996,404 @@ #endif /* CONFIG_8xx */ } -static void * -MMU_get_page() +/* + * Find some memory for setup_arch to return. + * We use the last chunk of available memory as the area + * that setup_arch returns, making sure that there are at + * least 32 pages unused before this for MMU_get_page to use. + */ +__initfunc(unsigned long find_available_memory(void)) { - void *p; + int i; + unsigned long a, free; + unsigned long start, end; - if (mem_init_done) { - p = (void *) __get_free_page(GFP_KERNEL); - if (p == 0) - panic("couldn't get a page in MMU_get_page"); - } else { - p = find_mem_piece(PAGE_SIZE, PAGE_SIZE); + free = 0; + if (_machine == _MACH_mbx) { + /* Return the first, not the last region, because we + * may not yet have properly initialized the additonal + * memory DIMM. + */ + a = PAGE_ALIGN(phys_avail.regions[0].address); + avail_start = (unsigned long) __va(a); + return avail_start; + } + + for (i = 0; i < phys_avail.n_regions - 1; ++i) { + start = phys_avail.regions[i].address; + end = start + phys_avail.regions[i].size; + free += (end & PAGE_MASK) - PAGE_ALIGN(start); } - memset(p, 0, PAGE_SIZE); - return p; + a = PAGE_ALIGN(phys_avail.regions[i].address); + if (free < 32 * PAGE_SIZE) + a += 32 * PAGE_SIZE - free; + avail_start = (unsigned long) __va(a); + return avail_start; } -void * -ioremap(unsigned long addr, unsigned long size) -{ - return __ioremap(addr, size, _PAGE_NO_CACHE); -} - -void * -__ioremap(unsigned long addr, unsigned long size, unsigned long flags) +/* + * paging_init() sets up the page tables - in fact we've already done this. + */ +__initfunc(unsigned long paging_init(unsigned long start_mem, unsigned long end_mem)) { - unsigned long p, v, i; - + extern unsigned long free_area_init(unsigned long, unsigned long); /* - * Choose an address to map it to. - * Once the vmalloc system is running, we use it. - * Before then, we map addresses >= ioremap_base - * virt == phys; for addresses below this we use - * space going down from ioremap_base (ioremap_bot - * records where we're up to). - * - * We should also look out for a frame buffer and - * map it with a free BAT register, if there is one. + * Grab some memory for bad_page and bad_pagetable to use. */ - p = addr & PAGE_MASK; - size = PAGE_ALIGN(addr + size) - p; - if (size == 0) - return NULL; + empty_bad_page = PAGE_ALIGN(start_mem); + empty_bad_page_table = empty_bad_page + PAGE_SIZE; + start_mem = empty_bad_page + 2 * PAGE_SIZE; - if (mem_init_done) { - struct vm_struct *area; - area = get_vm_area(size); - if (area == 0) - return NULL; - v = VMALLOC_VMADDR(area->addr); - } else { - if (p >= ioremap_base) - v = p; - else - v = (ioremap_bot -= size); - } - - flags |= pgprot_val(PAGE_KERNEL); - if (flags & (_PAGE_NO_CACHE | _PAGE_WRITETHRU)) - flags |= _PAGE_GUARDED; - for (i = 0; i < size; i += PAGE_SIZE) - map_page(&init_task, v+i, p+i, flags); - - return (void *) (v + (addr & ~PAGE_MASK)); -} - -void iounmap(void *addr) -{ - /* XXX todo */ + /* note: free_area_init uses its second argument + to size the mem_map array. */ + start_mem = free_area_init(start_mem, end_mem); + return start_mem; } -unsigned long iopa(unsigned long addr) +__initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem)) { - unsigned long idx; - pmd_t *pd; - pte_t *pg; -#ifndef CONFIG_8xx - int b; -#endif - idx = addr & ~PAGE_MASK; - addr = addr & PAGE_MASK; - -#ifndef CONFIG_8xx - /* Check the BATs */ - for (b = 0; b < 4; ++b) - if (addr >= bat_addrs[b].start && addr <= bat_addrs[b].limit) - return bat_addrs[b].phys | idx; -#endif /* CONFIG_8xx */ - /* Do we have a page table? */ - if (init_task.mm->pgd == NULL) - return 0; - - /* Use upper 10 bits of addr to index the first level map */ - pd = (pmd_t *) (init_task.mm->pgd + (addr >> PGDIR_SHIFT)); - if (pmd_none(*pd)) - return 0; - - /* Use middle 10 bits of addr to index the second-level map */ - pg = pte_offset(pd, addr); - return (pte_val(*pg) & PAGE_MASK) | idx; -} + unsigned long addr; + int i; + unsigned long a, lim; + int codepages = 0; + int datapages = 0; + int initpages = 0; + extern unsigned int rtas_data, rtas_size; + + end_mem &= PAGE_MASK; + high_memory = (void *) end_mem; + max_mapnr = MAP_NR(high_memory); + + /* mark usable pages in the mem_map[] */ + start_mem = PAGE_ALIGN(start_mem); + + num_physpages = max_mapnr; /* RAM is assumed contiguous */ + remove_mem_piece(&phys_avail, __pa(avail_start), + start_mem - avail_start, 1); + + for (addr = PAGE_OFFSET; addr < end_mem; addr += PAGE_SIZE) + set_bit(PG_reserved, &mem_map[MAP_NR(addr)].flags); + + for (i = 0; i < phys_avail.n_regions; ++i) { + a = (unsigned long) __va(phys_avail.regions[i].address); + lim = a + phys_avail.regions[i].size; + a = PAGE_ALIGN(a); + for (; a < lim; a += PAGE_SIZE) + clear_bit(PG_reserved, &mem_map[MAP_NR(a)].flags); + } + phys_avail.n_regions = 0; + + /* free the prom's memory - no-op on prep */ + for (i = 0; i < prom_mem.n_regions; ++i) { + a = (unsigned long) __va(prom_mem.regions[i].address); + lim = a + prom_mem.regions[i].size; + a = PAGE_ALIGN(a); + for (; a < lim; a += PAGE_SIZE) + clear_bit(PG_reserved, &mem_map[MAP_NR(a)].flags); + } -void -map_page(struct task_struct *tsk, unsigned long va, - unsigned long pa, int flags) -{ - pmd_t *pd; - pte_t *pg; -#ifndef CONFIG_8xx - int b; -#endif + prom_trashed = 1; - if (tsk->mm->pgd == NULL) { - /* Allocate upper level page map */ - tsk->mm->pgd = (pgd_t *) MMU_get_page(); - } - /* Use upper 10 bits of VA to index the first level map */ - pd = (pmd_t *) (tsk->mm->pgd + (va >> PGDIR_SHIFT)); - if (pmd_none(*pd)) { -#ifndef CONFIG_8xx - /* - * Need to allocate second-level table, but first - * check whether this address is already mapped by - * the BATs; if so, don't bother allocating the page. - */ - for (b = 0; b < 4; ++b) { - if (va >= bat_addrs[b].start - && va <= bat_addrs[b].limit) { - /* XXX should check the phys address matches */ - return; - } + for (addr = PAGE_OFFSET; addr < end_mem; addr += PAGE_SIZE) { + if (PageReserved(mem_map + MAP_NR(addr))) { + if (addr < (ulong) etext) + codepages++; + else if (addr >= (unsigned long)&__init_begin + && addr < (unsigned long)&__init_end) + initpages++; + else if (addr < (ulong) start_mem) + datapages++; + continue; } + atomic_set(&mem_map[MAP_NR(addr)].count, 1); +#ifdef CONFIG_BLK_DEV_INITRD + if (!initrd_start || + addr < (initrd_start & PAGE_MASK) || addr >= initrd_end) +#endif /* CONFIG_BLK_DEV_INITRD */ +#ifndef CONFIG_8xx + if ( !rtas_data || + addr < (rtas_data & PAGE_MASK) || + addr >= (rtas_data+rtas_size)) #endif /* CONFIG_8xx */ - pg = (pte_t *) MMU_get_page(); - pmd_val(*pd) = (unsigned long) pg; + free_page(addr); } - /* Use middle 10 bits of VA to index the second-level map */ - pg = pte_offset(pd, va); - set_pte(pg, mk_pte_phys(pa & PAGE_MASK, __pgprot(flags))); -#ifndef CONFIG_8xx - flush_hash_page(0, va); -#endif -} - -/* - * TLB flushing: - * - * - flush_tlb_all() flushes all processes TLBs - * - flush_tlb_mm(mm) flushes the specified mm context TLB's - * - flush_tlb_page(vma, vmaddr) flushes one page - * - flush_tlb_range(mm, start, end) flushes a range of pages - * - * since the hardware hash table functions as an extension of the - * tlb as far as the linux tables are concerned, flush it too. - * -- Cort - */ -/* - * Flush all tlb/hash table entries (except perhaps for those - * mapping RAM starting at PAGE_OFFSET, since they never change). - */ -void -local_flush_tlb_all(void) -{ -#ifndef CONFIG_8xx - memset(Hash, 0, Hash_size); - _tlbia(); -#else - asm volatile ("tlbia" : : ); -#endif + printk("Memory: %luk available (%dk kernel code, %dk data, %dk init) [%08x,%08lx]\n", + (unsigned long) nr_free_pages << (PAGE_SHIFT-10), + codepages << (PAGE_SHIFT-10), + datapages << (PAGE_SHIFT-10), + initpages << (PAGE_SHIFT-10), + PAGE_OFFSET, end_mem); + mem_init_done = 1; } +#ifdef CONFIG_MBX /* - * Flush all the (user) entries for the address space described - * by mm. We can't rely on mm->mmap describing all the entries - * that might be in the hash table. + * This is a big hack right now, but it may turn into something real + * someday. + * + * For the MBX860 (at this time anyway), there is nothing to initialize + * associated the PROM. Rather than include all of the prom.c + * functions in the image just to get prom_init, all we really need right + * now is the initialization of the physical memory region. */ -void -local_flush_tlb_mm(struct mm_struct *mm) +__initfunc(unsigned long *mbx_find_end_of_memory(void)) { -#ifndef CONFIG_8xx - mm->context = NO_CONTEXT; - if (mm == current->mm) - activate_context(current); -#else - asm volatile ("tlbia" : : ); -#endif -} + unsigned long kstart, ksize; + bd_t *binfo; + volatile memctl8xx_t *mcp; + unsigned long *ret; + + binfo = (bd_t *)&res; -void -local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) -{ -#ifndef CONFIG_8xx - if (vmaddr < TASK_SIZE) - flush_hash_page(vma->vm_mm->context, vmaddr); - else - flush_hash_page(0, vmaddr); -#else - asm volatile ("tlbia" : : ); -#endif -} + /* + * The MBX does weird things with the mmaps for ram. + * If there's no DIMM, it puts the onboard DRAM at + * 0, if there is a DIMM it sticks it at 0 and puts + * the DRAM at the end of the DIMM. + * + * In fact, it might be the best idea to just read the DRAM + * config registers and set the mem areas accordingly. + */ + mcp = (memctl8xx_t *)(&(((immap_t *)MBX_IMAP_ADDR)->im_memctl)); + phys_mem.regions[0].address = 0; + phys_mem.regions[0].size = binfo->bi_memsize; + + phys_mem.n_regions = 1; + + ret = __va(phys_mem.regions[0].address+ + phys_mem.regions[0].size); + phys_avail = phys_mem; + kstart = __pa(_stext); /* should be 0 */ + ksize = PAGE_ALIGN(_end - _stext); + remove_mem_piece(&phys_avail, kstart, ksize, 0); + return ret; +} +#endif /* CONFIG_MBX */ +#ifndef CONFIG_8xx /* - * for each page addr in the range, call MMU_invalidate_page() - * if the range is very large and the hash table is small it might be - * faster to do a search of the hash table and just invalidate pages - * that are in the range but that's for study later. - * -- Cort + * On systems with Open Firmware, collect information about + * physical RAM and which pieces are already in use. + * At this point, we have (at least) the first 8MB mapped with a BAT. + * Our text, data, bss use something over 1MB, starting at 0. + * Open Firmware may be using 1MB at the 4MB point. */ -void -local_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) +__initfunc(unsigned long *pmac_find_end_of_memory(void)) { -#ifndef CONFIG_8xx - start &= PAGE_MASK; - - if (end - start > 20 * PAGE_SIZE) - { - flush_tlb_mm(mm); - return; - } + unsigned long a, total; + unsigned long kstart, ksize; + int i; - for (; start < end && start < TASK_SIZE; start += PAGE_SIZE) - { - flush_hash_page(mm->context, start); + memory_node = find_devices("memory"); + if (memory_node == NULL) { + printk(KERN_ERR "can't find memory node\n"); + abort(); } -#else - asm volatile ("tlbia" : : ); -#endif -} -/* - * The context counter has overflowed. - * We set mm->context to NO_CONTEXT for all mm's in the system. - * We assume we can get to all mm's by looking as tsk->mm for - * all tasks in the system. - */ -void -mmu_context_overflow(void) -{ -#ifndef CONFIG_8xx - struct task_struct *tsk; + /* + * Find out where physical memory is, and check that it + * starts at 0 and is contiguous. It seems that RAM is + * always physically contiguous on Power Macintoshes, + * because MacOS can't cope if it isn't. + * + * Supporting discontiguous physical memory isn't hard, + * it just makes the virtual <-> physical mapping functions + * more complicated (or else you end up wasting space + * in mem_map). + */ + get_mem_prop("reg", &phys_mem); + if (phys_mem.n_regions == 0) + panic("No RAM??"); + a = phys_mem.regions[0].address; + if (a != 0) + panic("RAM doesn't start at physical address 0"); + total = phys_mem.regions[0].size; + if (phys_mem.n_regions > 1) { + printk("RAM starting at 0x%x is not contiguous\n", + phys_mem.regions[1].address); + printk("Using RAM from 0 to 0x%lx\n", total-1); + phys_mem.n_regions = 1; + } + + /* record which bits the prom is using */ + get_mem_prop("available", &phys_avail); + prom_mem = phys_mem; + for (i = 0; i < phys_avail.n_regions; ++i) + remove_mem_piece(&prom_mem, phys_avail.regions[i].address, + phys_avail.regions[i].size, 1); - printk(KERN_DEBUG "mmu_context_overflow\n"); - read_lock(&tasklist_lock); - for_each_task(tsk) { - if (tsk->mm) - tsk->mm->context = NO_CONTEXT; - } - read_unlock(&tasklist_lock); - flush_hash_segments(0x10, 0xffffff); - next_mmu_context = 0; - /* make sure current always has a context */ - current->mm->context = MUNGE_CONTEXT(++next_mmu_context); - set_context(current->mm->context); -#else - /* We set the value to -1 because it is pre-incremented before - * before use. + /* + * phys_avail records memory we can use now. + * prom_mem records memory allocated by the prom that we + * don't want to use now, but we'll reclaim later. + * Make sure the kernel text/data/bss is in neither. */ - next_mmu_context = -1; -#endif + kstart = __pa(_stext); /* should be 0 */ + ksize = PAGE_ALIGN(klimit - _stext); + remove_mem_piece(&phys_avail, kstart, ksize, 0); + remove_mem_piece(&prom_mem, kstart, ksize, 0); + remove_mem_piece(&phys_avail, 0, 0x4000, 0); + remove_mem_piece(&prom_mem, 0, 0x4000, 0); + + return __va(total); } -#if 0 /* - * Cache flush functions - these functions cause caches to be flushed - * on _all_ processors due to their use of dcbf. local_flush_cache_all() is - * the only function that will not act on all processors in the system. + * This finds the amount of physical ram and does necessary + * setup for prep. This is pretty architecture specific so + * this will likely stay seperate from the pmac. * -- Cort */ -void local_flush_cache_all(void) +__initfunc(unsigned long *prep_find_end_of_memory(void)) { -#if 0 - unsigned long hid0,tmp; - asm volatile( - "mfspr %0,1008 \n\t" - "mr %1,%0 \n\t" - "or %0,%2,%2 \n\t" - "mtspr 1008,%0 \n\t" - "sync \n\t" - "isync \n\t" - "andc %0,%0,%2 \n\t" - "mtspr 1008,%0 \n\t" - : "=r" (tmp), "=r" (hid0) - : "r" (HID0_ICFI|HID0_DCI) - ); -#endif -} + unsigned long kstart, ksize; + unsigned long total; + total = res->TotalMemory; -void local_flush_cache_mm(struct mm_struct *mm) -{ - struct vm_area_struct *vma = NULL; - vma = mm->mmap; - while(vma) + if (total == 0 ) { - local_flush_cache_range(mm,vma->vm_start,vma->vm_end); - vma = vma->vm_next; + /* + * I need a way to probe the amount of memory if the residual + * data doesn't contain it. -- Cort + */ + printk("Ramsize from residual data was 0 -- Probing for value\n"); + total = 0x02000000; + printk("Ramsize default to be %ldM\n", total>>20); } -} + append_mem_piece(&phys_mem, 0, total); + phys_avail = phys_mem; + kstart = __pa(_stext); /* should be 0 */ + ksize = PAGE_ALIGN(klimit - _stext); + remove_mem_piece(&phys_avail, kstart, ksize, 0); + remove_mem_piece(&phys_avail, 0, 0x4000, 0); -void local_flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr) -{ - unsigned long i; - vmaddr = PAGE_ALIGN(vmaddr); - for ( i = vmaddr ; i <= (vmaddr+PAGE_SIZE); i += 32 ) - asm volatile("dcbf %0,%1\n\ticbi %0,%1\n\t" :: "r" (i), "r" (0)); + return (__va(total)); } -void local_flush_cache_range(struct mm_struct *mm, unsigned long start, - unsigned long end) -{ - unsigned long i; - for ( i = start ; i <= end; i += 32 ) - asm volatile("dcbf %0,%1\n\ticbi %0,%1\n\t" :: "r" (i), "r" (0)); -} -#endif - -#ifdef CONFIG_MBX -/* - * This is a big hack right now, but it may turn into something real - * someday. - * - * For the MBX860 (at this time anyway), there is nothing to initialize - * the associated PROM. Rather than include all of the prom.c - * functions in the image just to get prom_init, all we really need right - * now is the initialization of the physical memory region. - */ -void -set_mbx_memory(void) +#define HARDWARE_MAPPED_SIZE (512*1024) +__initfunc(unsigned long *apus_find_end_of_memory(void)) { unsigned long kstart, ksize; - bd_t *binfo; -#ifdef DIMM_8xx - volatile memctl8xx_t *mcp; -#endif - - binfo = (bd_t *)&res; - /* The MBX can have up to three memory regions, the on-board - * DRAM plus two more banks of DIMM socket memory. The DIMM is - * 64 bits, seen from the processor as two 32 bit banks. - * The on-board DRAM is reflected in the board information - * structure, and is either 4 Mbytes or 16 Mbytes. - * I think there is a way to program the serial EEPROM information - * so EPPC-Bug will initialize this memory, but I have not - * done that and it may not be a wise thing to do. If you - * remove the DIMM without reprogramming the EEPROM, bad things - * could happen since EPPC-Bug tries to use the upper 128K of - * memory. + /* Add the chunk that ADOS does not see. This may also + * include a ROM mapping which we reclaim. The top 512KB is + * removed again below. + * Do it by aligning the size to the nearest 2MB limit upwards. */ - phys_mem.n_regions = 1; - phys_mem.regions[0].address = 0; - phys_mem.regions[0].size = binfo->bi_memsize; - end_of_DRAM = __va(binfo->bi_memsize); + memory[0].size = ((memory[0].size+0x001fffff) & 0xffe00000); -#ifdef DIMM_8xx - /* This is a big hack. It assumes my 32 Mbyte DIMM in a 40 MHz - * MPC860. Don't do this (or change this) if you are running - * something else. + append_mem_piece(&phys_mem, memory[0].addr, memory[0].size); + + phys_avail = phys_mem; + kstart = __pa(_stext); + ksize = PAGE_ALIGN(klimit - _stext); + remove_mem_piece(&phys_avail, kstart, ksize, 1); + + /* Remove the upper HARDWARE_MAPPED_SIZE bytes where the address + * range 0xfff00000-0xfffx0000 is mapped to. + * We do it this way to ensure that the memory registered in the + * system has a power-of-two size. */ - mcp = (memctl8xx_t *)(&(((immap_t *)MBX_IMAP_ADDR)->im_memctl)); + remove_mem_piece(&phys_avail, + (memory[0].addr + memory[0].size + - HARDWARE_MAPPED_SIZE), + HARDWARE_MAPPED_SIZE, 1); + + /* FIXME:APUS: Only handles one block of memory! Problem is + * that the VTOP/PTOV code in head.S would be a mess if it had + * to handle more than one block. + */ + return __va(memory[0].addr + memory[0].size); +} - mcp->memc_or2 = (~(DIMM_SIZE-1) | 0x00000400); - mcp->memc_br2 = DIMM_SIZE | 0x00000081; - mcp->memc_or3 = (~((2*DIMM_SIZE)-1) | 0x00000400); - mcp->memc_br3 = 2*DIMM_SIZE | 0x00000081; +/* + * Initialize the hash table and patch the instructions in head.S. + */ +__initfunc(static void hash_init(void)) +{ + int Hash_bits; + unsigned long h, ramsize; + extern unsigned int hash_page_patch_A[], hash_page_patch_B[], + hash_page_patch_C[]; - phys_mem.regions[phys_mem.n_regions].address = DIMM_SIZE; - phys_mem.regions[phys_mem.n_regions++].size = DIMM_SIZE; - phys_mem.regions[phys_mem.n_regions].address = 2 * DIMM_SIZE; - phys_mem.regions[phys_mem.n_regions++].size = DIMM_SIZE; + /* + * Allow 64k of hash table for every 16MB of memory, + * up to a maximum of 2MB. + */ + ramsize = (ulong)end_of_DRAM - KERNELBASE; + for (h = 64<<10; h < ramsize / 256 && h < 2<<20; h *= 2) + ; + Hash_size = h; + Hash_mask = (h >> 6) - 1; + +#ifdef NO_RELOAD_HTAB + /* shrink the htab since we don't use it on 603's -- Cort */ + switch (_get_PVR()>>16) { + case 3: /* 603 */ + case 6: /* 603e */ + case 7: /* 603ev */ + Hash_size = 0; + Hash_mask = 0; + break; + default: + /* on 601/4 let things be */ + break; + } +#endif /* NO_RELOAD_HTAB */ + + /* Find some memory for the hash table. */ + if ( Hash_size ) + Hash = find_mem_piece(Hash_size, Hash_size); + else + Hash = 0; - end_of_DRAM = __va(3 * DIMM_SIZE); + printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n", + ramsize >> 20, Hash_size >> 10, Hash); + if ( Hash_size ) + { +#ifdef CONFIG_APUS +#define b(x) ((unsigned int*)(((unsigned long)(x)) - KERNELBASE + 0xfff00000)) +#else +#define b(x) (x) #endif + /*memset(Hash, 0, Hash_size);*/ + __clear_user(Hash, Hash_size); + + Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); - phys_avail = phys_mem; + /* + * Patch up the instructions in head.S:hash_page + */ + Hash_bits = ffz(~Hash_size) - 6; + *b(hash_page_patch_A) = (*b(hash_page_patch_A) & ~0xffff) + | (__pa(Hash) >> 16); + *b(hash_page_patch_A + 1) = (*b(hash_page_patch_A + 1)& ~0x7c0) + | ((26 - Hash_bits) << 6); + if (Hash_bits > 16) + Hash_bits = 16; + *b(hash_page_patch_A + 2) = (*b(hash_page_patch_A + 2)& ~0x7c0) + | ((26 - Hash_bits) << 6); + *b(hash_page_patch_B) = (*b(hash_page_patch_B) & ~0xffff) + | (Hash_mask >> 10); + *b(hash_page_patch_C) = (*b(hash_page_patch_C) & ~0xffff) + | (Hash_mask >> 10); +#if 0 /* see hash_page in head.S, note also patch_C ref below */ + *b(hash_page_patch_D) = (*b(hash_page_patch_D) & ~0xffff) + | (Hash_mask >> 10); +#endif + /* + * Ensure that the locations we've patched have been written + * out from the data cache and invalidated in the instruction + * cache, on those machines with split caches. + */ + flush_icache_range((unsigned long) b(hash_page_patch_A), + (unsigned long) b(hash_page_patch_C + 1)); + } + else + Hash_end = 0; - kstart = __pa(_stext); /* should be 0 */ - ksize = PAGE_ALIGN(_end - _stext); - remove_mem_piece(&phys_avail, kstart, ksize, 0); } -#endif +#endif /* ndef CONFIG_8xx */ diff -u --recursive --new-file v2.1.114/linux/arch/ppc/pmac_defconfig linux/arch/ppc/pmac_defconfig --- v2.1.114/linux/arch/ppc/pmac_defconfig Fri May 8 23:14:45 1998 +++ linux/arch/ppc/pmac_defconfig Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ # -# Automatically generated make config: don't edit +# Automatically generated by make menuconfig: don't edit # # @@ -24,6 +24,7 @@ # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y CONFIG_PCI=y +# CONFIG_PCI_QUIRKS is not set CONFIG_PCI_OLD_PROC=y CONFIG_NET=y CONFIG_SYSCTL=y @@ -34,8 +35,9 @@ CONFIG_BINFMT_MISC=m # CONFIG_BINFMT_JAVA is not set # CONFIG_PARPORT is not set -# CONFIG_ABSTRACT_CONSOLE is not set -CONFIG_PMAC_CONSOLE=y +# CONFIG_FB is not set +# CONFIG_VGA_CONSOLE is not set +# CONFIG_PMAC_PBOOK is not set CONFIG_MAC_KEYBOARD=y CONFIG_MAC_FLOPPY=y CONFIG_MAC_SERIAL=y @@ -43,12 +45,6 @@ CONFIG_PROC_DEVICETREE=y # CONFIG_KGDB is not set # CONFIG_XMON is not set -CONFIG_CONTROL_VIDEO=y -CONFIG_PLATINUM_VIDEO=y -CONFIG_VALKYRIE_VIDEO=y -CONFIG_ATY_VIDEO=y -CONFIG_IMSTT_VIDEO=y -CONFIG_CHIPS_VIDEO=y # # Plug and Play support @@ -56,14 +52,10 @@ # CONFIG_PNP is not set # -# Floppy, IDE, and other block devices +# Block devices # # CONFIG_BLK_DEV_FD is not set CONFIG_BLK_DEV_IDE=y - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y CONFIG_BLK_DEV_IDECD=y @@ -73,11 +65,8 @@ # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_RZ1000 is not set # CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_BLK_DEV_SL82C105 is not set # CONFIG_IDE_CHIPSETS is not set - -# -# Additional Block Devices -# # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_MD is not set @@ -91,8 +80,10 @@ # # Networking options # -# CONFIG_PACKET is not set -# CONFIG_NETLINK is not set +CONFIG_PACKET=y +CONFIG_NETLINK=y +# CONFIG_RTNETLINK is not set +# CONFIG_NETLINK_DEV is not set # CONFIG_FIREWALL is not set CONFIG_NET_ALIAS=y # CONFIG_FILTER is not set @@ -101,25 +92,16 @@ CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set -# CONFIG_IP_ACCT is not set # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set CONFIG_IP_ALIAS=y # CONFIG_SYN_COOKIES is not set - -# -# (it is safe to leave these untouched) -# CONFIG_INET_RARP=y CONFIG_IP_NOSR=y CONFIG_SKB_LARGE=y # CONFIG_IPV6 is not set - -# -# -# # CONFIG_IPX is not set CONFIG_ATALK=m # CONFIG_X25 is not set @@ -132,25 +114,16 @@ # CONFIG_NET_HW_FLOWCONTROL is not set # CONFIG_CPU_IS_SLOW is not set # CONFIG_NET_SCHED is not set -# CONFIG_NET_PROFILE is not set # # SCSI support # CONFIG_SCSI=y - -# -# SCSI support type (disk, tape, CD-ROM) -# CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_ST=y CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR_VENDOR=y # CONFIG_CHR_DEV_SG is not set - -# -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs -# # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set @@ -203,8 +176,10 @@ # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set +# CONFIG_ETHERTAP is not set CONFIG_NET_ETHERNET=y CONFIG_MACE=y +CONFIG_BMAC=y # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set @@ -221,9 +196,11 @@ CONFIG_DEC_ELCP=m # CONFIG_DGRS is not set # CONFIG_EEXPRESS_PRO100 is not set +# CONFIG_LNE390 is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_TLAN is not set # CONFIG_ES3210 is not set # CONFIG_EPIC100 is not set -# CONFIG_TLAN is not set # CONFIG_ZNET is not set # CONFIG_NET_POCKET is not set # CONFIG_FDDI is not set @@ -232,10 +209,6 @@ # CONFIG_COPS is not set # CONFIG_IPDDP is not set CONFIG_PPP=m - -# -# CCP compressors for PPP are only built as modules. -# # CONFIG_SLIP is not set # CONFIG_NET_RADIO is not set # CONFIG_TR is not set @@ -319,11 +292,14 @@ # CONFIG_NLS_KOI8_R is not set # +# Console drivers +# + +# # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SOFTCURSOR is not set # CONFIG_SERIAL is not set # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set @@ -336,9 +312,13 @@ # CONFIG_VIDEO_DEV is not set CONFIG_NVRAM=y # CONFIG_JOYSTICK is not set -# CONFIG_MISC_RADIO is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set + +# +# Sound +# +# CONFIG_SOUND is not set diff -u --recursive --new-file v2.1.114/linux/arch/ppc/prep_defconfig linux/arch/ppc/prep_defconfig --- v2.1.114/linux/arch/ppc/prep_defconfig Wed Jul 1 19:38:53 1998 +++ linux/arch/ppc/prep_defconfig Tue Aug 4 16:06:36 1998 @@ -12,6 +12,7 @@ CONFIG_PREP=y # CONFIG_CHRP is not set # CONFIG_ALL_PPC is not set +# CONFIG_APUS is not set # CONFIG_MBX is not set CONFIG_MACH_SPECIFIC=y @@ -23,7 +24,7 @@ CONFIG_MODVERSIONS=y CONFIG_KMOD=y CONFIG_PCI=y -# CONFIG_PCI_OPTIMIZE is not set +# CONFIG_PCI_QUIRKS is not set CONFIG_PCI_OLD_PROC=y CONFIG_NET=y CONFIG_SYSCTL=y @@ -34,14 +35,16 @@ # CONFIG_BINFMT_MISC is not set # CONFIG_BINFMT_JAVA is not set # CONFIG_PARPORT is not set -# CONFIG_ABSTRACT_CONSOLE is not set -# CONFIG_PMAC_CONSOLE is not set +# CONFIG_FB is not set +CONFIG_VGA_CONSOLE=y +# CONFIG_PMAC_PBOOK is not set # CONFIG_MAC_KEYBOARD is not set # CONFIG_MAC_FLOPPY is not set +# CONFIG_MAC_SERIAL is not set # CONFIG_MACMOUSE is not set # CONFIG_PROC_DEVICETREE is not set +# CONFIG_KGDB is not set # CONFIG_XMON is not set -CONFIG_VGA_CONSOLE=y # # Plug and Play support @@ -49,7 +52,7 @@ # CONFIG_PNP is not set # -# Floppy, IDE, and other block devices +# Block devices # CONFIG_BLK_DEV_FD=y CONFIG_BLK_DEV_IDE=y @@ -62,6 +65,7 @@ # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_RZ1000 is not set # CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_BLK_DEV_SL82C105 is not set # CONFIG_IDE_CHIPSETS is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_NBD is not set @@ -74,11 +78,6 @@ # CONFIG_BLK_DEV_HD is not set # -# NEW devices (io_request, all ALPHA and dangerous) -# -# CONFIG_IO_REQUEST is not set - -# # Networking options # # CONFIG_PACKET is not set @@ -91,13 +90,12 @@ # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set -CONFIG_IP_ACCT=y # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_ALIAS is not set CONFIG_SYN_COOKIES=y -CONFIG_INET_RARP=y +# CONFIG_INET_RARP is not set # CONFIG_IP_NOSR is not set CONFIG_SKB_LARGE=y # CONFIG_IPV6 is not set @@ -107,12 +105,12 @@ # CONFIG_LAPB is not set # CONFIG_BRIDGE is not set # CONFIG_LLC is not set +# CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # CONFIG_CPU_IS_SLOW is not set # CONFIG_NET_SCHED is not set -# CONFIG_NET_PROFILE is not set # # SCSI support @@ -149,11 +147,11 @@ # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NCR53C7xx is not set CONFIG_SCSI_NCR53C8XX=y -# CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT is not set -CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE=y -CONFIG_SCSI_NCR53C8XX_IOMAPPED=y +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4 CONFIG_SCSI_NCR53C8XX_SYNC=5 +# CONFIG_SCSI_NCR53C8XX_PROFILE is not set +CONFIG_SCSI_NCR53C8XX_IOMAPPED=y # CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set @@ -178,6 +176,8 @@ # CONFIG_DUMMY is not set # CONFIG_EQUALIZER is not set CONFIG_NET_ETHERNET=y +# CONFIG_MACE is not set +# CONFIG_BMAC is not set # CONFIG_NET_VENDOR_3COM is not set CONFIG_LANCE=y # CONFIG_NET_VENDOR_SMC is not set @@ -194,13 +194,16 @@ # CONFIG_DEC_ELCP is not set # CONFIG_DGRS is not set # CONFIG_EEXPRESS_PRO100 is not set -# CONFIG_TLAN is not set +# CONFIG_LNE390 is not set +# CONFIG_NE2K_PCI is not set # CONFIG_ES3210 is not set +# CONFIG_EPIC100 is not set +# CONFIG_TLAN is not set # CONFIG_ZNET is not set # CONFIG_NET_POCKET is not set # CONFIG_FDDI is not set # CONFIG_DLCI is not set -CONFIG_PPP=y +CONFIG_PPP=m # CONFIG_SLIP is not set # CONFIG_NET_RADIO is not set # CONFIG_TR is not set @@ -228,14 +231,14 @@ # CONFIG_MINIX_FS is not set CONFIG_EXT2_FS=y CONFIG_ISO9660_FS=y -CONFIG_JOLIET=y -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y +# CONFIG_JOLIET is not set +CONFIG_FAT_FS=m +CONFIG_MSDOS_FS=m # CONFIG_UMSDOS_FS is not set -CONFIG_VFAT_FS=y +# CONFIG_VFAT_FS is not set CONFIG_PROC_FS=y CONFIG_NFS_FS=y -CONFIG_NFSD=y +# CONFIG_NFSD is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_CODA_FS is not set @@ -249,6 +252,7 @@ # CONFIG_AUTOFS_FS is not set # CONFIG_UFS_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_DEVPTS_FS is not set # CONFIG_MAC_PARTITION is not set CONFIG_NLS=y @@ -283,11 +287,14 @@ # CONFIG_NLS_KOI8_R is not set # +# Console drivers +# + +# # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SOFTCURSOR is not set CONFIG_SERIAL=y CONFIG_SERIAL_CONSOLE=y # CONFIG_SERIAL_EXTENDED is not set diff -u --recursive --new-file v2.1.114/linux/arch/sparc/Makefile linux/arch/sparc/Makefile --- v2.1.114/linux/arch/sparc/Makefile Fri May 8 23:14:45 1998 +++ linux/arch/sparc/Makefile Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.35 1998/04/18 03:40:53 davem Exp $ +# $Id: Makefile,v 1.36 1998/06/02 00:36:40 davem Exp $ # sparc/Makefile # # Makefile for the architecture dependent flags and dependencies on the @@ -16,7 +16,7 @@ # debugging of the kernel to get the proper debugging information. #CFLAGS := $(CFLAGS) -g -pipe -fcall-used-g5 -fcall-used-g7 -CFLAGS := $(CFLAGS) -pipe -fcall-used-g5 -fcall-used-g7 +CFLAGS := $(CFLAGS) -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 #LINKFLAGS = -N -Ttext 0xf0004000 LINKFLAGS = -T arch/sparc/vmlinux.lds diff -u --recursive --new-file v2.1.114/linux/arch/sparc/ap1000/aplib.c linux/arch/sparc/ap1000/aplib.c --- v2.1.114/linux/arch/sparc/ap1000/aplib.c Mon Jan 12 15:15:43 1998 +++ linux/arch/sparc/ap1000/aplib.c Tue Aug 4 16:03:34 1998 @@ -455,7 +455,7 @@ while (counter == aplib->rbuf_flag1 + aplib->rbuf_flag2) { tnet_check_completion(); - if (need_resched) + if (current->need_resched) break; if (signal_pending(current)) break; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/ap1000/mpp.c linux/arch/sparc/ap1000/mpp.c --- v2.1.114/linux/arch/sparc/ap1000/mpp.c Mon Jan 12 15:15:43 1998 +++ linux/arch/sparc/ap1000/mpp.c Tue Aug 4 16:03:34 1998 @@ -28,7 +28,7 @@ void mpp_schedule(struct cap_request *req) { mpp_current_task = req->data[0]; - need_resched = 1; + current->need_resched = 1; mark_bh(TQUEUE_BH); } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/ap1000/msc.c linux/arch/sparc/ap1000/msc.c --- v2.1.114/linux/arch/sparc/ap1000/msc.c Mon Feb 23 18:12:03 1998 +++ linux/arch/sparc/ap1000/msc.c Tue Aug 4 16:03:34 1998 @@ -337,7 +337,7 @@ #endif MSC_OUT(MSC_INTR, AP_SET_INTR_MASK << MSC_INTR_QBMFUL_SH); intr_mask |= (AP_INTR_REQ << MSC_INTR_QBMFUL_SH); - need_resched = 1; + current->need_resched = 1; block_parallel_tasks = 1; mark_bh(TQUEUE_BH); } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/ap1000/timer.c linux/arch/sparc/ap1000/timer.c --- v2.1.114/linux/arch/sparc/ap1000/timer.c Mon Feb 23 18:12:03 1998 +++ linux/arch/sparc/ap1000/timer.c Tue Aug 4 23:40:54 1998 @@ -7,7 +7,6 @@ */ /* routines to control the AP1000 timer chip */ -#include /* for CONFIG_PROFILE */ #include #include #include @@ -74,8 +73,6 @@ last_freerun = new_freerun; } -#ifdef CONFIG_PROFILE - static void profile_interrupt(int irq, void *dev_id, struct pt_regs * regs) { if (prof_buffer && current->pid) { @@ -98,8 +95,6 @@ } } -#endif - void ap_init_timers(void) { extern void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs); @@ -114,12 +109,10 @@ (SA_INTERRUPT | SA_STATIC_ALLOC), "timer", NULL); -#ifdef CONFIG_PROFILE request_irq(APTIM0_IRQ, profile_interrupt, (SA_INTERRUPT | SA_STATIC_ALLOC), "profile", NULL); -#endif ap_clear_clock_irq(); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/ap1000/tnet.c linux/arch/sparc/ap1000/tnet.c --- v2.1.114/linux/arch/sparc/ap1000/tnet.c Tue Feb 17 13:12:45 1998 +++ linux/arch/sparc/ap1000/tnet.c Tue Aug 4 16:03:34 1998 @@ -612,7 +612,7 @@ static void reschedule(void) { - need_resched = 1; + current->need_resched = 1; mark_bh(TQUEUE_BH); } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/config.in linux/arch/sparc/config.in --- v2.1.114/linux/arch/sparc/config.in Thu Jul 16 18:09:24 1998 +++ linux/arch/sparc/config.in Tue Aug 4 23:39:45 1998 @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.55 1998/04/12 06:20:22 davem Exp $ +# $Id: config.in,v 1.58 1998/07/29 05:06:41 davem Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -55,10 +55,7 @@ define_bool CONFIG_SUN_AUXIO y define_bool CONFIG_SUN_IO y if [ "$CONFIG_SUN4" = "y" ]; then - if [ "$CONFIG_DUMMY_CONSOLE" = "n" ]; then - bool 'Sun FB drivers appear in PROCFS' SUN_FBS_IN_PROCFS - bool 'bwtwo support' SUN_FB_BWTWO - fi + bool 'Force early PROM Console' CONFIG_SUN4_FORCECONSOLE else source drivers/sbus/char/Config.in source drivers/sbus/audio/Config.in @@ -188,9 +185,5 @@ mainmenu_option next_comment comment 'Kernel hacking' -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/sparc/defconfig linux/arch/sparc/defconfig --- v2.1.114/linux/arch/sparc/defconfig Fri May 8 23:14:45 1998 +++ linux/arch/sparc/defconfig Tue Aug 4 23:39:54 1998 @@ -21,6 +21,27 @@ CONFIG_VT_CONSOLE=y # CONFIG_AP1000 is not set # CONFIG_SUN4 is not set + +# +# Console drivers +# +CONFIG_PROM_CONSOLE=y +CONFIG_FB=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FB_SBUS=y +CONFIG_FB_CGSIX=y +CONFIG_FB_BWTWO=y +CONFIG_FB_CGTHREE=y +CONFIG_FB_TCX=y +CONFIG_FB_CGFOURTEEN=y +CONFIG_FB_LEO=y +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FBCON_ADVANCED is not set +CONFIG_FBCON_MFB=y +CONFIG_FBCON_CFB8=y +CONFIG_FBCON_FONTWIDTH8_ONLY=y +CONFIG_FONT_SUN8x16=y +# CONFIG_FBCON_FONTS is not set CONFIG_SBUS=y CONFIG_SBUSCHAR=y CONFIG_SUN_MOUSE=y @@ -33,20 +54,6 @@ CONFIG_SUN_IO=y # -# SBUS Frame Buffer support -# -SUN_FBS_IN_PROCFS=y -CONFIG_SUN_FB_DISPLAY=y -SUN_FB_CGSIX=y -SUN_FB_TCX=y -SUN_FB_CGTHREE=y -SUN_FB_CGFOURTEEN=y -SUN_FB_BWTWO=y -SUN_FB_LEO=y -TADPOLE_FB_WEITEK=y -SUN_FB_CREATOR=y - -# # Misc Linux/SPARC drivers # CONFIG_SUN_OPENPROMIO=m @@ -101,10 +108,8 @@ # CONFIG_IP_PNP is not set CONFIG_IP_FIREWALL=y # CONFIG_IP_FIREWALL_NETLINK is not set -# CONFIG_IP_FIREWALL_VERBOSE is not set # CONFIG_IP_TRANSPARENT_PROXY is not set # CONFIG_IP_ALWAYS_DEFRAG is not set -# CONFIG_IP_ACCT is not set CONFIG_IP_MASQUERADE=y # @@ -151,6 +156,8 @@ # CONFIG_NET_HW_FLOWCONTROL is not set # CONFIG_CPU_IS_SLOW is not set CONFIG_NET_SCHED=y +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_CSZ=m CONFIG_NET_SCH_PRIO=y @@ -159,7 +166,7 @@ # CONFIG_NET_SCH_TEQL is not set CONFIG_NET_SCH_TBF=y # CONFIG_NET_QOS is not set -# CONFIG_NET_PROFILE is not set +# CONFIG_NET_CLS is not set # # ISDN subsystem @@ -308,5 +315,4 @@ # # Kernel hacking # -# CONFIG_PROFILE is not set # CONFIG_MAGIC_SYSRQ is not set diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/Makefile linux/arch/sparc/kernel/Makefile --- v2.1.114/linux/arch/sparc/kernel/Makefile Tue Jul 21 00:15:30 1998 +++ linux/arch/sparc/kernel/Makefile Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.43 1998/03/09 14:03:34 jj Exp $ +# $Id: Makefile,v 1.45 1998/07/28 16:52:42 jj Exp $ # Makefile for the linux kernel. # # Note! Dependencies are done automagically by 'make dep', which also @@ -25,6 +25,10 @@ unaligned.o muldiv.o OX_OBJS := sparc_ksyms.o + +ifdef CONFIG_SUN4 +O_OBJS += sun4setup.o +endif ifdef SMP O_OBJS += trampoline.o smp.o sun4m_smp.o sun4d_smp.o diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/entry.S linux/arch/sparc/kernel/entry.S --- v2.1.114/linux/arch/sparc/kernel/entry.S Sun Jun 7 11:16:28 1998 +++ linux/arch/sparc/kernel/entry.S Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.149 1998/03/19 15:36:30 jj Exp $ +/* $Id: entry.S,v 1.152 1998/07/29 16:32:24 jj Exp $ * arch/sparc/kernel/entry.S: Sparc trap low-level entry points. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -1265,6 +1265,22 @@ mov %o7, %l5 add %sp, REGWIN_SZ, %o0 ! pt_regs *regs arg call C_LABEL(sparc_pipe) + mov %l5, %o7 + + .align 4 + .globl C_LABEL(sys_sigaltstack) +C_LABEL(sys_sigaltstack): + mov %o7, %l5 + mov %fp, %o2 + call C_LABEL(do_sigaltstack) + mov %l5, %o7 + + .align 4 + .globl C_LABEL(sys_sigstack) +C_LABEL(sys_sigstack): + mov %o7, %l5 + mov %fp, %o2 + call C_LABEL(do_sys_sigstack) mov %l5, %o7 .align 4 diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/head.S linux/arch/sparc/kernel/head.S --- v2.1.114/linux/arch/sparc/kernel/head.S Sun Jun 7 11:16:28 1998 +++ linux/arch/sparc/kernel/head.S Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: head.S,v 1.91 1998/04/24 13:40:48 jj Exp $ +/* $Id: head.S,v 1.92 1998/06/10 07:21:55 davem Exp $ * head.S: The initial boot code for the Sparc port of Linux. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/idprom.c linux/arch/sparc/kernel/idprom.c --- v2.1.114/linux/arch/sparc/kernel/idprom.c Fri Dec 13 01:37:30 1996 +++ linux/arch/sparc/kernel/idprom.c Tue Aug 4 16:03:34 1998 @@ -1,10 +1,11 @@ -/* $Id: idprom.c,v 1.22 1996/11/13 05:09:25 davem Exp $ +/* $Id: idprom.c,v 1.23 1998/07/28 16:52:44 jj Exp $ * idprom.c: Routines to load the idprom into kernel addresses and * interpret the data contained within. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ +#include #include #include #include @@ -12,6 +13,10 @@ #include #include #include /* Fun with Sun released architectures. */ +#ifdef CONFIG_SUN4 +#include +extern void sun4setup(void); +#endif struct idprom *idprom; static struct idprom idprom_buffer; @@ -98,4 +103,7 @@ idprom->id_ethaddr[0], idprom->id_ethaddr[1], idprom->id_ethaddr[2], idprom->id_ethaddr[3], idprom->id_ethaddr[4], idprom->id_ethaddr[5]); +#ifdef CONFIG_SUN4 + sun4setup(); +#endif } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/irq.c linux/arch/sparc/kernel/irq.c --- v2.1.114/linux/arch/sparc/kernel/irq.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/irq.c Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.85 1998/03/09 14:03:40 jj Exp $ +/* $Id: irq.c,v 1.86 1998/06/04 09:54:49 jj Exp $ * arch/sparc/kernel/irq.c: Interrupt request handling routines. On the * Sparc the IRQ's are basically 'cast in stone' * and you are supposed to probe the prom's device @@ -584,9 +584,6 @@ if (!handler) return -EINVAL; - if (irqflags & SA_DCOOKIE) - dev_id = ((struct devid_cookie *)dev_id)->real_dev_id; - action = *(cpu_irq + irq_action); if (action) { if ((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) { 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 22:55:15 1998 @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.110 1998/04/08 16:15:51 jj Exp $ +/* $Id: process.c,v 1.118 1998/08/04 20:48:47 davem Exp $ * linux/arch/sparc/kernel/process.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -40,8 +41,8 @@ #include extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *); -extern void srmmu_check_pgt_cache(void); +struct task_struct *last_task_used_math = NULL; struct task_struct *current_set[NR_CPUS] = {&init_task, }; #ifndef __SMP__ @@ -92,9 +93,8 @@ } } restore_flags(flags); - check_pgt_cache(); - } else - srmmu_check_pgt_cache(); + } + check_pgt_cache(); schedule(); } ret = 0; @@ -113,18 +113,10 @@ current->priority = -100; while(1) { srmmu_check_pgt_cache(); - /* - * tq_scheduler currently assumes we're running in a process - * context (ie that we hold the kernel lock..) - */ - if (tq_scheduler) { - lock_kernel(); - run_task_queue(&tq_scheduler); - unlock_kernel(); - } + run_task_queue(&tq_scheduler); /* endless idle loop with no priority at all */ current->counter = -100; - if(!smp_commenced || need_resched) + if(!smp_commenced || current->need_resched) schedule(); } } @@ -143,7 +135,7 @@ extern char reboot_command []; #ifdef CONFIG_SUN_CONSOLE -extern void console_restore_palette (void); +extern void (*prom_palette)(int); extern int serial_console; #endif @@ -153,8 +145,8 @@ mdelay(8); cli(); #ifdef CONFIG_SUN_CONSOLE - if (!serial_console) - console_restore_palette (); + if (!serial_console && prom_palette) + prom_palette (1); #endif prom_halt(); panic("Halt failed!"); @@ -171,8 +163,8 @@ p = strchr (reboot_command, '\n'); if (p) *p = 0; #ifdef CONFIG_SUN_CONSOLE - if (!serial_console) - console_restore_palette (); + if (!serial_console && prom_palette) + prom_palette (1); #endif if (cmd) prom_reboot(cmd); @@ -332,9 +324,6 @@ printk("fsr: 0x%08lx fpqdepth: 0x%08lx\n", tss->fsr, tss->fpqdepth); /* XXX missing: fpqueue */ - printk("sstk_info.stack: 0x%08lx sstk_info.status: 0x%08lx\n", - (unsigned long)tss->sstk_info.the_stack, - (unsigned long)tss->sstk_info.cur_status); printk("flags: 0x%08lx current_ds: 0x%08lx\n", tss->flags, tss->current_ds.seg); show_regwindow((struct reg_window *)tss->ksp); @@ -368,8 +357,6 @@ void flush_thread(void) { current->tss.w_saved = 0; - current->tss.sstk_info.cur_status = 0; - current->tss.sstk_info.the_stack = 0; /* No new signal delivery by default */ current->tss.new_signal = 0; @@ -539,7 +526,7 @@ * This is a clone() call with supplied user stack. * Set some valid stack frames to give to the child. */ - childstack = (struct sparc_stackf *) sp; + childstack = (struct sparc_stackf *) (sp & ~0x7UL); parentstack = (struct sparc_stackf *) regs->u_regs[UREG_FP]; #if 0 diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/rtrap.S linux/arch/sparc/kernel/rtrap.S --- v2.1.114/linux/arch/sparc/kernel/rtrap.S Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/rtrap.S Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: rtrap.S,v 1.50 1998/02/05 14:18:43 jj Exp $ +/* $Id: rtrap.S,v 1.51 1998/07/26 03:02:38 davem Exp $ * rtrap.S: Return from Sparc trap low-level code. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -61,14 +61,14 @@ C_LABEL(ret_trap_lockless_ipi): andcc %t_psr, PSR_PS, %g0 be 1f - sethi %hi(C_LABEL(need_resched)), %twin_tmp1 + nop wr %t_psr, 0x0, %psr b ret_trap_kernel nop 1: - ld [%twin_tmp1 + %lo(C_LABEL(need_resched))], %g2 + ld [%curptr + AOFF_task_need_resched], %g2 orcc %g2, %g0, %g0 be signal_p ld [%curptr + AOFF_task_sigpending], %g2 diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/setup.c linux/arch/sparc/kernel/setup.c --- v2.1.114/linux/arch/sparc/kernel/setup.c Thu Jul 16 18:09:24 1998 +++ linux/arch/sparc/kernel/setup.c Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.93 1998/03/09 14:03:18 jj Exp $ +/* $Id: setup.c,v 1.99 1998/07/28 16:52:45 jj Exp $ * linux/arch/sparc/kernel/setup.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -47,7 +47,7 @@ struct screen_info screen_info = { 0, 0, /* orig-x, orig-y */ - { 0, 0, }, /* unused */ + 0, /* unused */ 0, /* orig-video-page */ 0, /* orig-video-mode */ 128, /* orig-video-cols */ @@ -66,9 +66,10 @@ */ extern unsigned long trapbase; +extern int serial_console; extern void breakpoint(void); #if CONFIG_SUN_CONSOLE -extern void console_restore_palette(void); +void (*prom_palette)(int); #endif asmlinkage void sys_sync(void); /* it's really int */ @@ -90,7 +91,8 @@ "nop\n\t" : : "r" (&trapbase)); #ifdef CONFIG_SUN_CONSOLE - console_restore_palette (); + if (prom_palette) + prom_palette(1); #endif prom_printf("PROM SYNC COMMAND...\n"); show_free_areas(); @@ -217,6 +219,15 @@ } else if (!strncmp (commands, "ttyb", 4)) { console_fb = 3; prom_printf ("Using /dev/ttyb as console.\n"); +#if defined(CONFIG_PROM_CONSOLE) + } else if (!strncmp (commands, "prom", 4)) { + char *p; + + for (p = commands - 8; *p && *p != ' '; p++) + *p = ' '; + conswitchp = &prom_con; + console_fb = 1; +#endif } else { console_fb = 1; } @@ -321,6 +332,9 @@ switch(sparc_cpu_model) { case sun4: printk("SUN4\n"); +#ifdef CONFIG_SUN4_FORCECONSOLE + register_console(&prom_console); +#endif packed = 0; break; case sun4c: @@ -352,6 +366,11 @@ break; }; +#ifdef CONFIG_DUMMY_CONSOLE + conswitchp = &dummy_con; +#elif defined(CONFIG_PROM_CONSOLE) + conswitchp = &prom_con; +#endif boot_flags_init(*cmdline_p); idprom_init(); @@ -410,7 +429,6 @@ *memory_start_p = sun_serial_setup(*memory_start_p); /* set this up ASAP */ #endif { - extern int serial_console; /* in console.c, of course */ #if !CONFIG_SUN_SERIAL serial_console = 0; #else @@ -464,13 +482,8 @@ init_task.mm->context = (unsigned long) NO_CONTEXT; init_task.tss.kregs = &fake_swapper_regs; - if (!serial_console) { -#ifdef CONFIG_PROM_CONSOLE - conswitchp = &prom_con; -#elif defined(CONFIG_DUMMY_CONSOLE) - conswitchp = &dummy_con; -#endif - } + if (serial_console) + conswitchp = NULL; } asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on) diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/signal.c linux/arch/sparc/kernel/signal.c --- v2.1.114/linux/arch/sparc/kernel/signal.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/signal.c Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.79 1998/04/04 07:11:41 davem Exp $ +/* $Id: signal.c,v 1.82 1998/07/31 05:18:51 jj Exp $ * linux/arch/sparc/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds @@ -85,6 +85,7 @@ sigset_t mask; __siginfo_fpu_t *fpu_save; unsigned int insns [2]; + stack_t stack; __siginfo_fpu_t fpu_state; }; @@ -187,9 +188,10 @@ } } -static inline void +static inline int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t *fpu) { + int err; #ifdef __SMP__ if (current->flags & PF_USEDFPU) regs->psr &= ~PSR_EF; @@ -202,15 +204,16 @@ current->used_math = 1; current->flags &= ~PF_USEDFPU; - copy_from_user(¤t->tss.float_regs[0], &fpu->si_float_regs[0], + err = copy_from_user(¤t->tss.float_regs[0], &fpu->si_float_regs[0], (sizeof(unsigned long) * 32)); - __get_user(current->tss.fsr, &fpu->si_fsr); - __get_user(current->tss.fpqdepth, &fpu->si_fpqdepth); + err |= __get_user(current->tss.fsr, &fpu->si_fsr); + err |= __get_user(current->tss.fpqdepth, &fpu->si_fpqdepth); if (current->tss.fpqdepth != 0) - copy_from_user(¤t->tss.fpqueue[0], + err |= copy_from_user(¤t->tss.fpqueue[0], &fpu->si_fpqueue[0], ((sizeof(unsigned long) + (sizeof(unsigned long *)))*16)); + return err; } static inline void do_new_sigreturn (struct pt_regs *regs) @@ -218,6 +221,8 @@ struct new_signal_frame *sf; unsigned long up_psr, pc, npc; sigset_t set; + __siginfo_fpu_t *fpu_save; + int err; sf = (struct new_signal_frame *) regs->u_regs [UREG_FP]; @@ -228,29 +233,33 @@ if (((uint) sf) & 3) goto segv_and_exit; - __get_user(pc, &sf->info.si_regs.pc); - __get_user(npc, &sf->info.si_regs.npc); + err = __get_user(pc, &sf->info.si_regs.pc); + err |= __get_user(npc, &sf->info.si_regs.npc); if ((pc | npc) & 3) goto segv_and_exit; /* 2. Restore the state */ up_psr = regs->psr; - copy_from_user(regs, &sf->info.si_regs, sizeof (struct pt_regs)); + err |= copy_from_user(regs, &sf->info.si_regs, sizeof (struct pt_regs)); /* User can only change condition codes and FPU enabling in %psr. */ regs->psr = (up_psr & ~(PSR_ICC | PSR_EF)) | (regs->psr & (PSR_ICC | PSR_EF)); - if (sf->fpu_save) - restore_fpu_state(regs, sf->fpu_save); + err |= __get_user(fpu_save, &sf->fpu_save); + + if (fpu_save) + err |= restore_fpu_state(regs, sf->fpu_save); /* This is pretty much atomic, no amount locking would prevent * the races which exist anyways. */ - if (__get_user(set.sig[0], &sf->info.si_mask) || - copy_from_user(&set.sig[1], &sf->extramask, - (_NSIG_WORDS-1) * sizeof(unsigned int))) + err |= __get_user(set.sig[0], &sf->info.si_mask); + err |= copy_from_user(&set.sig[1], &sf->extramask, + (_NSIG_WORDS-1) * sizeof(unsigned int)); + + if (err) goto segv_and_exit; sigdelsetmask(&set, ~_BLOCKABLE); @@ -271,6 +280,7 @@ struct sigcontext *scptr; unsigned long pc, npc, psr; sigset_t set; + int err; synchronize_user_stack(); @@ -284,8 +294,8 @@ (((unsigned long) scptr) & 3)) goto segv_and_exit; - __get_user(pc, &scptr->sigc_pc); - __get_user(npc, &scptr->sigc_npc); + err = __get_user(pc, &scptr->sigc_pc); + err |= __get_user(npc, &scptr->sigc_npc); if((pc | npc) & 3) goto segv_and_exit; @@ -293,10 +303,12 @@ /* This is pretty much atomic, no amount locking would prevent * the races which exist anyways. */ - if (__get_user(set.sig[0], &scptr->sigc_mask) || - /* Note that scptr + 1 points to extramask */ - copy_from_user(&set.sig[1], scptr + 1, - (_NSIG_WORDS - 1) * sizeof(unsigned int))) + err |= __get_user(set.sig[0], &scptr->sigc_mask); + /* Note that scptr + 1 points to extramask */ + err |= copy_from_user(&set.sig[1], scptr + 1, + (_NSIG_WORDS - 1) * sizeof(unsigned int)); + + if (err) goto segv_and_exit; sigdelsetmask(&set, ~_BLOCKABLE); @@ -305,26 +317,24 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - __get_user(current->tss.sstk_info.cur_status, &scptr->sigc_onstack); - current->tss.sstk_info.cur_status &= 1; - regs->pc = pc; regs->npc = npc; - __get_user(regs->u_regs[UREG_FP], &scptr->sigc_sp); - __get_user(regs->u_regs[UREG_I0], &scptr->sigc_o0); - __get_user(regs->u_regs[UREG_G1], &scptr->sigc_g1); + err = __get_user(regs->u_regs[UREG_FP], &scptr->sigc_sp); + err |= __get_user(regs->u_regs[UREG_I0], &scptr->sigc_o0); + err |= __get_user(regs->u_regs[UREG_G1], &scptr->sigc_g1); /* User can only change condition codes in %psr. */ - __get_user(psr, &scptr->sigc_psr); + err |= __get_user(psr, &scptr->sigc_psr); + if (err) + goto segv_and_exit; + regs->psr &= ~(PSR_ICC); regs->psr |= (psr & PSR_ICC); return; segv_and_exit: - /* Ugh, we need to grab master lock in these rare cases ;-( */ - lock_kernel(); - do_exit(SIGSEGV); + send_sig(SIGSEGV, current, 1); } asmlinkage void do_rt_sigreturn(struct pt_regs *regs) @@ -333,6 +343,8 @@ unsigned int psr, pc, npc; __siginfo_fpu_t *fpu_save; sigset_t set; + stack_t st; + int err; synchronize_user_stack(); sf = (struct rt_signal_frame *) regs->u_regs[UREG_FP]; @@ -340,40 +352,35 @@ (((unsigned long) sf) & 0x03)) goto segv; - get_user(pc, &sf->regs.pc); - __get_user(npc, &sf->regs.npc); - if((pc | npc) & 0x03) - goto segv; - - regs->pc = pc; - regs->npc = npc; + err = get_user(pc, &sf->regs.pc); + err |= __get_user(npc, &sf->regs.npc); + err |= ((pc | npc) & 0x03); - __get_user(regs->y, &sf->regs.y); - __get_user(psr, &sf->regs.psr); + err |= __get_user(regs->y, &sf->regs.y); + err |= __get_user(psr, &sf->regs.psr); - __get_user(regs->u_regs[UREG_G1], &sf->regs.u_regs[UREG_G1]); - __get_user(regs->u_regs[UREG_G2], &sf->regs.u_regs[UREG_G2]); - __get_user(regs->u_regs[UREG_G3], &sf->regs.u_regs[UREG_G3]); - __get_user(regs->u_regs[UREG_G4], &sf->regs.u_regs[UREG_G4]); - __get_user(regs->u_regs[UREG_G5], &sf->regs.u_regs[UREG_G5]); - __get_user(regs->u_regs[UREG_G6], &sf->regs.u_regs[UREG_G6]); - __get_user(regs->u_regs[UREG_G7], &sf->regs.u_regs[UREG_G7]); - __get_user(regs->u_regs[UREG_I0], &sf->regs.u_regs[UREG_I0]); - __get_user(regs->u_regs[UREG_I1], &sf->regs.u_regs[UREG_I1]); - __get_user(regs->u_regs[UREG_I2], &sf->regs.u_regs[UREG_I2]); - __get_user(regs->u_regs[UREG_I3], &sf->regs.u_regs[UREG_I3]); - __get_user(regs->u_regs[UREG_I4], &sf->regs.u_regs[UREG_I4]); - __get_user(regs->u_regs[UREG_I5], &sf->regs.u_regs[UREG_I5]); - __get_user(regs->u_regs[UREG_I6], &sf->regs.u_regs[UREG_I6]); - __get_user(regs->u_regs[UREG_I7], &sf->regs.u_regs[UREG_I7]); + err |= __copy_from_user(®s->u_regs[UREG_G1], &sf->regs.u_regs[UREG_G1], 15*sizeof(u32)); regs->psr = (regs->psr & ~PSR_ICC) | (psr & PSR_ICC); - __get_user(fpu_save, &sf->fpu_save); + err |= __get_user(fpu_save, &sf->fpu_save); + if(fpu_save) - restore_fpu_state(regs, &sf->fpu_state); - if(copy_from_user(&set, &sf->mask, sizeof(sigset_t))) + err |= restore_fpu_state(regs, &sf->fpu_state); + err |= copy_from_user(&set, &sf->mask, sizeof(sigset_t)); + + err |= __copy_from_user(&st, &sf->stack, sizeof(stack_t)); + + if (err) goto segv; + + regs->pc = pc; + regs->npc = npc; + + /* It is more difficult to avoid calling this function than to + call it and ignore errors. */ + do_sigaltstack(&st, NULL, (unsigned long)sf); + sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = set; @@ -381,8 +388,7 @@ spin_unlock_irq(¤t->sigmask_lock); return; segv: - lock_kernel(); - do_exit(SIGSEGV); + send_sig(SIGSEGV, current, 1); } /* Checks if the fp is valid */ @@ -397,6 +403,20 @@ return 0; } +static inline void *get_sigframe(struct sigaction *sa, struct pt_regs *regs, unsigned long framesize) +{ + unsigned long sp; + + sp = regs->u_regs[UREG_FP]; + + /* This is the X/Open sanctioned signal stack switching. */ + if (sa->sa_flags & SA_ONSTACK) { + if (!on_sig_stack(sp) && !((current->sas_ss_sp + current->sas_ss_size) & 7)) + sp = current->sas_ss_sp + current->sas_ss_size; + } + return (void *)(sp - framesize); +} + static inline void setup_frame(struct sigaction *sa, unsigned long pc, unsigned long npc, struct pt_regs *regs, int signr, sigset_t *oldset) @@ -404,11 +424,9 @@ struct signal_sframe *sframep; struct sigcontext *sc; int window = 0; - int old_status = current->tss.sstk_info.cur_status; synchronize_user_stack(); - sframep = (struct signal_sframe *) regs->u_regs[UREG_FP]; - sframep = (struct signal_sframe *) (((unsigned long) sframep)-SF_ALIGNEDSZ); + sframep = (struct signal_sframe *)get_sigframe(sa, regs, SF_ALIGNEDSZ); if (invalid_frame_pointer (sframep, sizeof(*sframep))){ #ifdef DEBUG_SIGNALS /* fills up the console logs during crashme runs, yuck... */ printk("%s [%d]: User has trashed signal stack\n", @@ -425,7 +443,7 @@ sc = &sframep->sig_context; /* We've already made sure frame pointer isn't in kernel space... */ - __put_user(old_status, &sc->sigc_onstack); + __put_user((sas_ss_flags(regs->u_regs[UREG_FP]) == SS_ONSTACK), &sc->sigc_onstack); __put_user(oldset->sig[0], &sc->sigc_mask); __copy_to_user(sframep->extramask, &oldset->sig[1], (_NSIG_WORDS - 1) * sizeof(unsigned int)); @@ -519,14 +537,16 @@ if (!current->used_math) sigframe_size -= sizeof(__siginfo_fpu_t); - sf = (struct new_signal_frame *)(regs->u_regs[UREG_FP] - sigframe_size); + sf = (struct new_signal_frame *)get_sigframe(&ka->sa, regs, sigframe_size); if (invalid_frame_pointer (sf, sigframe_size)) goto sigill_and_return; if (current->tss.w_saved != 0) { +#ifdef DEBUG_SIGNALS printk ("%s [%d]: Invalid user stack frame for " "signal delivery.\n", current->comm, current->pid); +#endif goto sigill_and_return; } @@ -535,9 +555,9 @@ if (current->used_math) { save_fpu_state(regs, &sf->fpu_state); - sf->fpu_save = &sf->fpu_state; + __put_user(&sf->fpu_state, &sf->fpu_save); } else { - sf->fpu_save = NULL; + __put_user(0, &sf->fpu_save); } __put_user(oldset->sig[0], &sf->info.si_mask); @@ -587,7 +607,7 @@ sigframe_size = RT_ALIGNEDSZ; if(!current->used_math) sigframe_size -= sizeof(__siginfo_fpu_t); - sf = (struct rt_signal_frame *)(regs->u_regs[UREG_FP] - sigframe_size); + sf = (struct rt_signal_frame *)get_sigframe(&ka->sa, regs, sigframe_size); if(invalid_frame_pointer(sf, sigframe_size)) goto sigill; if(current->tss.w_saved != 0) @@ -609,6 +629,12 @@ __put_user(0, &sf->fpu_save); } __copy_to_user(&sf->mask, &oldset->sig[0], sizeof(sigset_t)); + + /* Setup sigaltstack */ + __put_user(current->sas_ss_sp, &sf->stack.ss_sp); + __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); + __put_user(current->sas_ss_size, &sf->stack.ss_size); + copy_to_user(sf, (char *) regs->u_regs [UREG_FP], sizeof (struct reg_window)); @@ -652,8 +678,7 @@ int window = 0; synchronize_user_stack(); - sfp = (svr4_signal_frame_t *) regs->u_regs[UREG_FP] - REGWIN_SZ; - sfp = (svr4_signal_frame_t *) (((unsigned long) sfp)-SVR4_SF_ALIGNED); + sfp = (svr4_signal_frame_t *) get_sigframe(sa, regs, SVR4_SF_ALIGNED + REGWIN_SZ); if (invalid_frame_pointer (sfp, sizeof (*sfp))){ #ifdef DEBUG_SIGNALS @@ -695,10 +720,10 @@ copy_to_user(&(*gr)[SVR4_G1], ®s->u_regs [UREG_G1], sizeof (long) * 7); copy_to_user(&(*gr)[SVR4_O0], ®s->u_regs [UREG_I0], sizeof (long) * 8); - /* Setup sigaltstack, FIXME */ - __put_user(0xdeadbeef, &uc->stack.sp); - __put_user(0, &uc->stack.size); - __put_user(0, &uc->stack.flags); /* Possible: ONSTACK, DISABLE */ + /* Setup sigaltstack */ + __put_user(current->sas_ss_sp, &uc->stack.sp); + __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &uc->stack.flags); + __put_user(current->sas_ss_size, &uc->stack.size); /* Save the currently window file: */ @@ -799,10 +824,10 @@ copy_to_user(&(*gr)[SVR4_G1], ®s->u_regs [UREG_G1], sizeof (uint) * 7); copy_to_user(&(*gr)[SVR4_O0], ®s->u_regs [UREG_I0], sizeof (uint) * 8); - /* Setup sigaltstack, FIXME */ - __put_user(0xdeadbeef, &uc->stack.sp); - __put_user(0, &uc->stack.size); - __put_user(0, &uc->stack.flags); /* Possible: ONSTACK, DISABLE */ + /* Setup sigaltstack */ + __put_user(current->sas_ss_sp, &uc->stack.sp); + __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &uc->stack.flags); + __put_user(current->sas_ss_size, &uc->stack.size); /* The register file is not saved * we have already stuffed all of it with sync_user_stack @@ -822,6 +847,8 @@ unsigned long pc, npc, psr; sigset_t set; svr4_sigset_t setv; + int err; + stack_t st; /* Fixme: restore windows, or is this already taken care of in * svr4_setup_frame when sync_user_windows is done? @@ -839,8 +866,8 @@ /* Check for valid PC and nPC */ gr = &c->mcontext.greg; - __get_user(pc, &((*gr)[SVR4_PC])); - __get_user(npc, &((*gr)[SVR4_NPC])); + err = __get_user(pc, &((*gr)[SVR4_PC])); + err |= __get_user(npc, &((*gr)[SVR4_NPC])); if((pc | npc) & 3) goto sigsegv_and_return; @@ -852,8 +879,19 @@ /* This is pretty much atomic, no amount locking would prevent * the races which exist anyways. */ - if (__copy_from_user(&setv, &c->sigmask, sizeof(svr4_sigset_t))) + err |= __copy_from_user(&setv, &c->sigmask, sizeof(svr4_sigset_t)); + + err |= __get_user(st.ss_sp, &c->stack.sp); + err |= __get_user(st.ss_flags, &c->stack.flags); + err |= __get_user(st.ss_size, &c->stack.size); + + if (err) goto sigsegv_and_return; + + /* It is more difficult to avoid calling this function than to + call it and ignore errors. */ + do_sigaltstack(&st, NULL, regs->u_regs[UREG_I6]); + set.sig[0] = setv.sigbits[0]; set.sig[1] = setv.sigbits[1]; if (_NSIG_WORDS >= 4) { @@ -1067,24 +1105,36 @@ } asmlinkage int -sys_sigstack(struct sigstack *ssptr, struct sigstack *ossptr) +do_sys_sigstack(struct sigstack *ssptr, struct sigstack *ossptr, unsigned long sp) { int ret = -EFAULT; - lock_kernel(); /* First see if old state is wanted. */ - if(ossptr) { - if(copy_to_user(ossptr, ¤t->tss.sstk_info, sizeof(struct sigstack))) + if (ossptr) { + if (put_user(current->sas_ss_sp + current->sas_ss_size, &ossptr->the_stack) || + __put_user(on_sig_stack(sp), &ossptr->cur_status)) goto out; } /* Now see if we want to update the new state. */ - if(ssptr) { - if(copy_from_user(¤t->tss.sstk_info, ssptr, sizeof(struct sigstack))) + if (ssptr) { + void *ss_sp; + + if (get_user((long)ss_sp, &ssptr->the_stack)) goto out; + /* If the current stack was set with sigaltstack, don't + swap stacks while we are on it. */ + ret = -EPERM; + if (current->sas_ss_sp && on_sig_stack(sp)) + goto out; + + /* Since we don't know the extent of the stack, and we don't + track onstack-ness, but rather calculate it, we must + presume a size. Ho hum this interface is lossy. */ + current->sas_ss_sp = (unsigned long)ss_sp - SIGSTKSZ; + current->sas_ss_size = SIGSTKSZ; } ret = 0; out: - unlock_kernel(); return ret; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/smp.c linux/arch/sparc/kernel/smp.c --- v2.1.114/linux/arch/sparc/kernel/smp.c Sat Apr 25 18:13:10 1998 +++ linux/arch/sparc/kernel/smp.c Tue Aug 4 16:03:34 1998 @@ -60,7 +60,9 @@ * compared to the Alpha and the Intel no? Most Sparcs have 'swap' * instruction which is much better... */ -struct klock_info klock_info = { KLOCK_CLEAR, 0 }; + +/* Kernel spinlock */ +spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; volatile unsigned long ipi_count; @@ -238,7 +240,7 @@ /* Reschedule call back. */ void smp_reschedule_irq(void) { - need_resched = 1; + current->need_resched = 1; } /* Stopping processors. */ diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sparc_ksyms.c linux/arch/sparc/kernel/sparc_ksyms.c --- v2.1.114/linux/arch/sparc/kernel/sparc_ksyms.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/sparc_ksyms.c Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: sparc_ksyms.c,v 1.64 1998/03/19 15:36:43 jj Exp $ +/* $Id: sparc_ksyms.c,v 1.65 1998/06/04 09:54:50 jj Exp $ * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -175,6 +175,7 @@ #endif EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(enable_irq)); EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(disable_irq)); +EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(__irq_itoa)); EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_v2p)); EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_unlockarea)); EXPORT_SYMBOL_NOVERS(BTFIXUP_CALL(mmu_lockarea)); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sun4c_irq.c linux/arch/sparc/kernel/sun4c_irq.c --- v2.1.114/linux/arch/sparc/kernel/sun4c_irq.c Sat Apr 25 18:13:10 1998 +++ linux/arch/sparc/kernel/sun4c_irq.c Tue Aug 4 23:57:51 1998 @@ -9,6 +9,7 @@ * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk) */ +#include #include #include #include @@ -108,9 +109,22 @@ volatile struct sun4c_timer_info *sun4c_timers; +#ifdef CONFIG_SUN4 +/* This is an ugly hack to work around the + current timer code, and make it work with + the sun4/260 intersil + */ +volatile struct sun4c_timer_info sun4_timer; +#endif + static void sun4c_clear_clock_irq(void) { volatile unsigned int clear_intr; +#ifdef CONFIG_SUN4 + if( idprom->id_machtype == SM_SUN4 | SM_4_260 ) + clear_intr = sun4_timer.timer_limit10; + else +#endif clear_intr = sun4c_timers->timer_limit10; } @@ -131,6 +145,11 @@ /* Map the Timer chip, this is implemented in hardware inside * the cache chip on the sun4c. */ +#ifdef CONFIG_SUN4 + if (idprom->id_machtype == SM_SUN4 | SM_4_260) + sun4c_timers = &sun4_timer; + else +#endif sun4c_timers = sparc_alloc_io (SUN_TIMER_PHYSADDR, 0, sizeof(struct sun4c_timer_info), "timer", 0x0, 0x0); @@ -152,6 +171,7 @@ prom_halt(); } + sun4c_enable_irq(10); claim_ticker14(NULL, PROFILE_IRQ, 0); } @@ -159,6 +179,8 @@ static void sun4c_nop(void) {} #endif +extern char *sun4m_irq_itoa(unsigned int irq); + __initfunc(void sun4c_init_IRQ(void)) { struct linux_prom_registers int_regs[2]; @@ -166,7 +188,7 @@ if (ARCH_SUN4) { interrupt_enable = - (char *) sparc_alloc_io(SUN4_IE_PHYSADDR, 0, + (char *) sparc_alloc_io(sun4_ie_physaddr, 0, PAGE_SIZE, "sun4c_interrupts", 0x0, 0x0); @@ -193,6 +215,7 @@ BTFIXUPSET_CALL(clear_clock_irq, sun4c_clear_clock_irq, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(clear_profile_irq, sun4c_clear_profile_irq, BTFIXUPCALL_NOP); BTFIXUPSET_CALL(load_profile_irq, sun4c_load_profile_irq, BTFIXUPCALL_NOP); + BTFIXUPSET_CALL(__irq_itoa, sun4m_irq_itoa, BTFIXUPCALL_NORM); init_timers = sun4c_init_timers; #ifdef __SMP__ BTFIXUPSET_CALL(set_cpu_int, sun4c_nop, BTFIXUPCALL_NOP); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sun4d_irq.c linux/arch/sparc/kernel/sun4d_irq.c --- v2.1.114/linux/arch/sparc/kernel/sun4d_irq.c Fri May 8 23:14:45 1998 +++ linux/arch/sparc/kernel/sun4d_irq.c Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: sun4d_irq.c,v 1.13 1998/04/15 14:58:33 jj Exp $ +/* $Id: sun4d_irq.c,v 1.14 1998/06/04 09:54:47 jj Exp $ * arch/sparc/kernel/sun4d_irq.c: * SS1000/SC2000 interrupt handling. * @@ -237,41 +237,32 @@ irq_exit(cpu, irq); } +unsigned int sun4d_build_irq(struct linux_sbus_device *sdev, int irq) +{ + int sbusl = pil_to_sbus[irq]; + + if (sbusl) + return ((sdev->my_bus->board + 1) << 5) + (sbusl << 2) + sdev->slot; + else + return irq; +} + int sun4d_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char * devname, void *dev_id) { struct irqaction *action, *tmp = NULL, **actionp; unsigned long flags; - int sbusl; - unsigned int *ret = NULL; - struct linux_sbus_device *sdev = NULL; - if(irq > 14) + if(irq > 14 && irq < (1 << 5)) return -EINVAL; if (!handler) return -EINVAL; - - if (irqflags & SA_DCOOKIE) { - struct devid_cookie *d = (struct devid_cookie *)dev_id; - - dev_id = d->real_dev_id; - sdev = (struct linux_sbus_device *)d->bus_cookie; - ret = &d->ret_ino; - } - - sbusl = pil_to_sbus[irq]; - if (sbusl && !sdev) { - printk ("Attempt to register SBUS IRQ %d without DCOOKIE\n", irq); - return -EINVAL; - } - if (sbusl) { - actionp = &(sbus_actions[(sdev->my_bus->board << 5) + - (sbusl << 2) + sdev->slot].action); - *ret = ((sdev->my_bus->board + 1) << 5) + - (sbusl << 2) + sdev->slot; - } else + + if (irq >= (1 << 5)) + actionp = &(sbus_actions[irq - (1 << 5)].action); + else actionp = irq + irq_action; action = *actionp; @@ -521,6 +512,17 @@ } } +static char *sun4d_irq_itoa(unsigned int irq) +{ + static char buff[16]; + + if (irq < (1 << 5)) + sprintf(buff, "%d", irq); + else + sprintf(buff, "%d,%x", sbus_to_pil[(irq >> 2) & 7], irq); + return buff; +} + __initfunc(void sun4d_init_IRQ(void)) { __cli(); @@ -530,6 +532,7 @@ BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM); + BTFIXUPSET_CALL(__irq_itoa, sun4d_irq_itoa, BTFIXUPCALL_NORM); init_timers = sun4d_init_timers; #ifdef __SMP__ BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sun4d_smp.c linux/arch/sparc/kernel/sun4d_smp.c --- v2.1.114/linux/arch/sparc/kernel/sun4d_smp.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/sun4d_smp.c Tue Aug 4 23:40:28 1998 @@ -6,7 +6,6 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ -#include /* for CONFIG_PROFILE */ #include #include @@ -437,8 +436,6 @@ /* Protects counters touched during level14 ticker */ static spinlock_t ticker_lock = SPIN_LOCK_UNLOCKED; -#ifdef CONFIG_PROFILE - /* 32-bit Sparc specific profiling function. */ static inline void sparc_do_profile(unsigned long pc) { @@ -457,8 +454,6 @@ } } -#endif - extern unsigned int prof_multiplier[NR_CPUS]; extern unsigned int prof_counter[NR_CPUS]; @@ -484,10 +479,9 @@ show_leds(cpu); } -#ifdef CONFIG_PROFILE if(!user_mode(regs)) sparc_do_profile(regs->pc); -#endif + if(!--prof_counter[cpu]) { int user = user_mode(regs); if(current->pid) { @@ -495,7 +489,7 @@ if(--current->counter < 0) { current->counter = 0; - need_resched = 1; + current->need_resched = 1; } spin_lock(&ticker_lock); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sun4m_irq.c linux/arch/sparc/kernel/sun4m_irq.c --- v2.1.114/linux/arch/sparc/kernel/sun4m_irq.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/sun4m_irq.c Tue Aug 4 16:03:34 1998 @@ -211,6 +211,13 @@ sun4m_timers->cpu_timers[cpu].l14_timer_limit = limit; } +char *sun4m_irq_itoa(unsigned int irq) +{ + static char buff[16]; + sprintf(buff, "%d", irq); + return buff; +} + __initfunc(static void sun4m_init_timers(void (*counter_fn)(int, void *, struct pt_regs *))) { int reg_count, irq, cpu; @@ -356,6 +363,7 @@ BTFIXUPSET_CALL(clear_clock_irq, sun4m_clear_clock_irq, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(clear_profile_irq, sun4m_clear_profile_irq, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(load_profile_irq, sun4m_load_profile_irq, BTFIXUPCALL_NORM); + BTFIXUPSET_CALL(__irq_itoa, sun4m_irq_itoa, BTFIXUPCALL_NORM); init_timers = sun4m_init_timers; #ifdef __SMP__ BTFIXUPSET_CALL(set_cpu_int, sun4m_send_ipi, BTFIXUPCALL_NORM); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sun4m_smp.c linux/arch/sparc/kernel/sun4m_smp.c --- v2.1.114/linux/arch/sparc/kernel/sun4m_smp.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/sun4m_smp.c Tue Aug 4 23:42:54 1998 @@ -3,7 +3,6 @@ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) */ -#include /* for CONFIG_PROFILE */ #include #include @@ -433,8 +432,6 @@ /* Protects counters touched during level14 ticker */ static spinlock_t ticker_lock = SPIN_LOCK_UNLOCKED; -#ifdef CONFIG_PROFILE - /* 32-bit Sparc specific profiling function. */ static inline void sparc_do_profile(unsigned long pc) { @@ -453,8 +450,6 @@ } } -#endif - extern unsigned int prof_multiplier[NR_CPUS]; extern unsigned int prof_counter[NR_CPUS]; @@ -467,10 +462,10 @@ int cpu = smp_processor_id(); clear_profile_irq(mid_xlate[cpu]); -#ifdef CONFIG_PROFILE + if(!user_mode(regs)) sparc_do_profile(regs->pc); -#endif + if(!--prof_counter[cpu]) { int user = user_mode(regs); if(current->pid) { @@ -478,7 +473,7 @@ if(--current->counter < 0) { current->counter = 0; - need_resched = 1; + current->need_resched = 1; } spin_lock(&ticker_lock); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sun4setup.c linux/arch/sparc/kernel/sun4setup.c --- v2.1.114/linux/arch/sparc/kernel/sun4setup.c Wed Dec 31 16:00:00 1969 +++ linux/arch/sparc/kernel/sun4setup.c Tue Aug 4 23:57:51 1998 @@ -0,0 +1,74 @@ +/* sun4setup.c: Setup the hardware address of various items in the sun4 + * architecture. Called from idprom_init + * + * Copyright (C) 1998 Chris G. Davis (cdavis@cois.on.ca) + */ + +#include +#include +#include +#include +#include + +int sun4_memreg_physaddr; +int sun4_ie_physaddr; +int sun4_clock_physaddr; +int sun4_timer_physaddr; +int sun4_eth_physaddr; +int sun4_si_physaddr; +int sun4_bwtwo_physaddr; +int sun4_zs0_physaddr; +int sun4_zs1_physaddr; +int sun4_dma_physaddr; +int sun4_esp_physaddr; +int sun4_ie_physaddr; + +__initfunc(void sun4setup()) +{ + printk("Sun4 Hardware Setup v1.0 18/May/98 Chris Davis (cdavis@cois.on.ca). "); + /* + setup standard sun4 info + */ + sun4_ie_physaddr=SUN4_IE_PHYSADDR; + + /* + setup model specific info + */ + switch(idprom->id_machtype) { + case (SM_SUN4 | SM_4_260 ): + printk("Setup for a SUN4/260\n"); + sun4_memreg_physaddr=SUN4_200_MEMREG_PHYSADDR; + sun4_clock_physaddr=SUN4_200_CLOCK_PHYSADDR; + sun4_timer_physaddr=SUN4_UNUSED_PHYSADDR; + sun4_eth_physaddr=SUN4_200_ETH_PHYSADDR; + sun4_si_physaddr=SUN4_200_SI_PHYSADDR; + sun4_bwtwo_physaddr=SUN4_200_BWTWO_PHYSADDR; + sun4_dma_physaddr=SUN4_UNUSED_PHYSADDR; + sun4_esp_physaddr=SUN4_UNUSED_PHYSADDR; + break; + case (SM_SUN4 | SM_4_330 ): + printk("Setup for a SUN4/330\n"); + sun4_memreg_physaddr=SUN4_300_MEMREG_PHYSADDR; + sun4_clock_physaddr=SUN4_300_CLOCK_PHYSADDR; + sun4_timer_physaddr=SUN4_300_TIMER_PHYSADDR; + sun4_eth_physaddr=SUN4_300_ETH_PHYSADDR; + sun4_si_physaddr=SUN4_UNUSED_PHYSADDR; + sun4_bwtwo_physaddr=SUN4_300_BWTWO_PHYSADDR; + sun4_dma_physaddr=SUN4_300_DMA_PHYSADDR; + sun4_esp_physaddr=SUN4_300_ESP_PHYSADDR; + break; + case (SM_SUN4 | SM_4_470 ): + printk("Setup for a SUN4/470\n"); + sun4_memreg_physaddr=SUN4_400_MEMREG_PHYSADDR; + sun4_clock_physaddr=SUN4_400_CLOCK_PHYSADDR; + sun4_timer_physaddr=SUN4_400_TIMER_PHYSADDR; + sun4_eth_physaddr=SUN4_400_ETH_PHYSADDR; + sun4_si_physaddr=SUN4_UNUSED_PHYSADDR; + sun4_bwtwo_physaddr=SUN4_400_BWTWO_PHYSADDR; + sun4_dma_physaddr=SUN4_400_DMA_PHYSADDR; + sun4_esp_physaddr=SUN4_400_ESP_PHYSADDR; + break; + default: + } +} + diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sys_sparc.c linux/arch/sparc/kernel/sys_sparc.c --- v2.1.114/linux/arch/sparc/kernel/sys_sparc.c Tue Jun 23 10:01:22 1998 +++ linux/arch/sparc/kernel/sys_sparc.c Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: sys_sparc.c,v 1.40 1998/03/28 08:29:26 davem Exp $ +/* $Id: sys_sparc.c,v 1.46 1998/08/03 23:58:01 davem Exp $ * linux/arch/sparc/kernel/sys_sparc.c * * This file contains various random system calls that @@ -37,19 +37,11 @@ asmlinkage unsigned long sparc_brk(unsigned long brk) { - unsigned long ret; - - lock_kernel(); if(ARCH_SUN4C_SUN4) { - if(brk >= 0x20000000 && brk < 0xe0000000) { - ret = current->mm->brk; - goto out; - } + if(brk >= 0x20000000 && brk < 0xe0000000) + return current->mm->brk; } - ret = sys_brk(brk); -out: - unlock_kernel(); - return ret; + return sys_brk(brk); } /* @@ -181,8 +173,6 @@ return err; } -extern unsigned long get_unmapped_area(unsigned long addr, unsigned long len); - /* Linux version of mmap */ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, @@ -334,22 +324,22 @@ asmlinkage int sys_getdomainname(char *name, int len) { - int nlen; - int err = -EFAULT; - - down(&uts_sem); - - nlen = strlen(system_utsname.domainname); + int nlen; + int err = -EFAULT; + + down(&uts_sem); + + nlen = strlen(system_utsname.domainname) + 1; if (nlen < len) len = nlen; if(len > __NEW_UTS_LEN) - goto done + goto done; if(copy_to_user(name, system_utsname.domainname, len)) goto done; - err=0; -done: - up(&uts_sem); + err = 0; +done: + up(&uts_sem); return err; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sys_sunos.c linux/arch/sparc/kernel/sys_sunos.c --- v2.1.114/linux/arch/sparc/kernel/sys_sunos.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/sys_sunos.c Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: sys_sunos.c,v 1.87 1998/03/29 03:48:16 shadow Exp $ +/* $Id: sys_sunos.c,v 1.91 1998/06/16 04:37:04 davem Exp $ * sys_sunos.c: SunOS specific syscall compatibility support. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -60,8 +60,6 @@ /* NR_OPEN is now larger and dynamic in recent kernels. */ #define SUNOS_NR_OPEN 256 -extern unsigned long get_unmapped_area(unsigned long addr, unsigned long len); - /* We use the SunOS mmap() semantics. */ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, @@ -569,25 +567,6 @@ return error; } -asmlinkage int sunos_getdomainname(char *name, int len) -{ - int nlen = strlen(system_utsname.domainname); - int ret = -EFAULT; - - lock_kernel(); - if (nlen < len) - len = nlen; - - if(len > __NEW_UTS_LEN) - goto out; - if(copy_to_user(name, system_utsname.domainname, len)) - goto out; - ret = 0; -out: - unlock_kernel(); - return ret; -} - struct sunos_utsname { char sname[9]; char nname[9]; @@ -601,7 +580,7 @@ { int ret = -EFAULT; - lock_kernel(); + down(&uts_sem); if(!name) goto out; if(copy_to_user(&name->sname[0], &system_utsname.sysname[0], sizeof(name->sname) - 1)) @@ -613,7 +592,7 @@ copy_to_user(&name->mach[0], &system_utsname.machine[0], sizeof(name->mach) - 1); ret = 0; out: - unlock_kernel(); + up(&uts_sem); return ret; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/systbls.S linux/arch/sparc/kernel/systbls.S --- v2.1.114/linux/arch/sparc/kernel/systbls.S Fri May 8 23:14:45 1998 +++ linux/arch/sparc/kernel/systbls.S Tue Aug 4 16:03:34 1998 @@ -1,4 +1,4 @@ -/* $Id: systbls.S,v 1.72 1998/04/14 13:49:46 jj Exp $ +/* $Id: systbls.S,v 1.75 1998/07/28 13:07:48 jj Exp $ * systbls.S: System call entry point tables for OS compatibility. * The native Linux system call table lives here also. * @@ -23,17 +23,17 @@ /*5*/ .long C_LABEL(sys_open), C_LABEL(sys_close), C_LABEL(sys_wait4) .long C_LABEL(sys_creat), C_LABEL(sys_link) /*10*/ .long C_LABEL(sys_unlink), C_LABEL(sunos_execv), C_LABEL(sys_chdir) - .long C_LABEL(sys_xstat), C_LABEL(sys_mknod) + .long C_LABEL(sys_nis_syscall), C_LABEL(sys_mknod) /*15*/ .long C_LABEL(sys_chmod), C_LABEL(sys_lchown), C_LABEL(sparc_brk) - .long C_LABEL(sys_xmknod), C_LABEL(sys_lseek) -/*20*/ .long C_LABEL(sys_getpid), C_LABEL(sys_nis_syscall), C_LABEL(sys_nis_syscall) + .long C_LABEL(sys_nis_syscall), C_LABEL(sys_lseek) +/*20*/ .long C_LABEL(sys_getpid), C_LABEL(sys_capget), C_LABEL(sys_capset) .long C_LABEL(sys_setuid), C_LABEL(sys_getuid) /*25*/ .long C_LABEL(sys_time), C_LABEL(sys_ptrace), C_LABEL(sys_alarm) - .long C_LABEL(sys_nis_syscall), C_LABEL(sys_pause) + .long C_LABEL(sys_sigaltstack), C_LABEL(sys_pause) /*30*/ .long C_LABEL(sys_utime), C_LABEL(sys_nis_syscall), C_LABEL(sys_nis_syscall) .long C_LABEL(sys_access), C_LABEL(sys_nice), C_LABEL(sys_nis_syscall) .long C_LABEL(sys_sync), C_LABEL(sys_kill), C_LABEL(sys_newstat) - .long C_LABEL(sys_nis_syscall), C_LABEL(sys_newlstat), C_LABEL(sys_dup) + .long C_LABEL(sys_sendfile), C_LABEL(sys_newlstat), C_LABEL(sys_dup) .long C_LABEL(sys_pipe), C_LABEL(sys_times), C_LABEL(sys_nis_syscall) .long C_LABEL(sys_nis_syscall), C_LABEL(sys_setgid), C_LABEL(sys_getgid) .long C_LABEL(sys_signal), C_LABEL(sys_geteuid) @@ -69,8 +69,7 @@ .long C_LABEL(sys_setregid), C_LABEL(sys_rename), C_LABEL(sys_truncate) .long C_LABEL(sys_ftruncate), C_LABEL(sys_flock), C_LABEL(sys_nis_syscall) .long C_LABEL(sys_nis_syscall), C_LABEL(sys_nis_syscall), C_LABEL(sys_nis_syscall) - - .long C_LABEL(sys_mkdir), C_LABEL(sys_rmdir), C_LABEL(sys_nis_syscall) + .long C_LABEL(sys_mkdir), C_LABEL(sys_rmdir), C_LABEL(sys_utimes) .long C_LABEL(sys_nis_syscall), C_LABEL(sys_nis_syscall), C_LABEL(sys_nis_syscall) .long C_LABEL(sys_nis_syscall), C_LABEL(sys_nis_syscall), C_LABEL(sys_getrlimit) .long C_LABEL(sys_setrlimit), C_LABEL(sys_nis_syscall), C_LABEL(sys_prctl) @@ -187,7 +186,7 @@ .long C_LABEL(sys_poll), C_LABEL(sunos_nosys), C_LABEL(sunos_nosys) .long C_LABEL(sunos_getdirentries), C_LABEL(sys_statfs), C_LABEL(sys_fstatfs) .long C_LABEL(sys_umount), C_LABEL(sunos_nosys), C_LABEL(sunos_nosys) - .long C_LABEL(sunos_getdomainname), C_LABEL(sys_setdomainname) + .long C_LABEL(sys_getdomainname), C_LABEL(sys_setdomainname) .long C_LABEL(sunos_nosys), C_LABEL(sys_quotactl), C_LABEL(sunos_nosys) .long C_LABEL(sunos_mount), C_LABEL(sys_ustat), C_LABEL(sunos_semsys) .long C_LABEL(sunos_msgsys), C_LABEL(sunos_shmsys), C_LABEL(sunos_audit) diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/time.c linux/arch/sparc/kernel/time.c --- v2.1.114/linux/arch/sparc/kernel/time.c Thu Apr 23 20:21:30 1998 +++ linux/arch/sparc/kernel/time.c Tue Aug 4 16:03:34 1998 @@ -1,9 +1,12 @@ -/* $Id: time.c,v 1.32 1998/03/23 08:41:13 jj Exp $ +/* $Id: time.c,v 1.33 1998/07/28 16:52:48 jj Exp $ * linux/arch/sparc/kernel/time.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) * + * Chris Davis (cdavis@cois.on.ca) 03/27/1998 + * Added support for the intersil on the sun4/4200 + * * This file handles the Sparc specific time handling details. */ #include @@ -34,6 +37,27 @@ struct mostek48t08 *mstk48t08_regs = 0; static int set_rtc_mmss(unsigned long); +#ifdef CONFIG_SUN4 +struct intersil *intersil_clock; +#define intersil_cmd(intersil_reg, intsil_cmd) intersil_reg->int_cmd_reg = \ + (intsil_cmd) + +#define intersil_intr(intersil_reg, intsil_cmd) intersil_reg->int_intr_reg = \ + (intsil_cmd) + +#define intersil_start(intersil_reg) intersil_cmd(intersil_reg, \ + ( INTERSIL_START | INTERSIL_32K | INTERSIL_NORMAL | INTERSIL_24H |\ + INTERSIL_INTR_ENABLE)) + +#define intersil_stop(intersil_reg) intersil_cmd(intersil_reg, \ + ( INTERSIL_STOP | INTERSIL_32K | INTERSIL_NORMAL | INTERSIL_24H |\ + INTERSIL_INTR_ENABLE)) + +#define intersil_read_intr(intersil_reg, towhere) towhere = \ + intersil_reg->int_intr_reg + +#endif + __volatile__ unsigned int *master_l10_counter; __volatile__ unsigned int *master_l10_limit; @@ -46,6 +70,12 @@ /* last time the cmos clock got updated */ static long last_rtc_update=0; +#ifdef CONFIG_SUN4 + int temp; + intersil_read_intr(intersil_clock, temp); + /* re-enable the irq */ + enable_pil_irq(10); +#endif clear_clock_irq(); do_timer(regs); @@ -154,20 +184,52 @@ return (data1 == data2); /* Was the write blocked? */ } -/* Probe for the real time clock chip on Sun4/300. */ +/* Probe for the real time clock chip on Sun4 */ static __inline__ void sun4_clock_probe(void) { - sp_clock_typ = MSTK48T02; - mstk48t02_regs = (struct mostek48t02 *) - sparc_alloc_io(SUN4_300_MOSTEK_PHYSADDR, 0, - sizeof(*mstk48t02_regs), - "clock", 0x0, 0x0); - mstk48t08_regs = 0; /* To catch weirdness */ - /* Kick start the clock if it is completely stopped. */ - if (mstk48t02_regs->sec & MSTK_STOP) { - kick_start_clock(); - } +#ifdef CONFIG_SUN4 + int temp; + + if( idprom->id_machtype == (SM_SUN4 | SM_4_330) ) { + sp_clock_typ = MSTK48T02; + mstk48t02_regs = (struct mostek48t02 *) + sparc_alloc_io(sun4_clock_physaddr, 0, + sizeof(*mstk48t02_regs), + "clock", 0x0, 0x0); + mstk48t08_regs = 0; /* To catch weirdness */ + intersil_clock = 0; /* just in case */ + + /* Kick start the clock if it is completely stopped. */ + if (mstk48t02_regs->sec & MSTK_STOP) + kick_start_clock(); + } else if( idprom->id_machtype == (SM_SUN4 | SM_4_260)) { + /* intersil setup code */ + printk("Clock: INTERSIL at %8x ",sun4_clock_physaddr); + sp_clock_typ = INTERSIL; + intersil_clock = (struct intersil *) + sparc_alloc_io(sun4_clock_physaddr, 0, + sizeof(*intersil_clock), + "clock", 0x0, 0x0); + mstk48t02_regs = 0; /* just be sure */ + mstk48t08_regs = 0; /* ditto */ + /* initialise the clock */ + + intersil_intr(intersil_clock,INTERSIL_INT_100HZ); + + intersil_start(intersil_clock); + + intersil_read_intr(intersil_clock, temp); + while (!(temp & 0x80)) + intersil_read_intr(intersil_clock, temp); + + intersil_read_intr(intersil_clock, temp); + while (!(temp & 0x80)) + intersil_read_intr(intersil_clock, temp); + intersil_stop(intersil_clock); + + } +#endif } /* Probe for the mostek real time clock chip. */ @@ -259,6 +321,11 @@ unsigned int year, mon, day, hour, min, sec; struct mostek48t02 *mregs; +#ifdef CONFIG_SUN4 + int temp; + struct intersil *iregs; +#endif + do_get_fast_time = do_gettimeofday; #if CONFIG_AP1000 @@ -273,6 +340,10 @@ clock_probe(); init_timers(timer_interrupt); + +#ifdef CONFIG_SUN4 + if(idprom->id_machtype == (SM_SUN4 | SM_4_330)) { +#endif mregs = mstk48t02_regs; if(!mregs) { @@ -289,6 +360,38 @@ xtime.tv_sec = mktime(year, mon, day, hour, min, sec); xtime.tv_usec = 0; mregs->creg &= ~MSTK_CREG_READ; +#ifdef CONFIG_SUN4 + } else if(idprom->id_machtype == (SM_SUN4 | SM_4_260) ) { + /* initialise the intersil on sun4 */ + + iregs=intersil_clock; + if(!iregs) { + prom_printf("Something wrong, clock regs not mapped yet.\n"); + prom_halt(); + } + + intersil_intr(intersil_clock,INTERSIL_INT_100HZ); + disable_pil_irq(10); + intersil_stop(iregs); + intersil_read_intr(intersil_clock, temp); + + temp = iregs->clk.int_csec; + + sec = iregs->clk.int_sec; + min = iregs->clk.int_min; + hour = iregs->clk.int_hour; + day = iregs->clk.int_day; + mon = iregs->clk.int_month; + year = MSTK_CVT_YEAR(iregs->clk.int_year); + + enable_pil_irq(10); + intersil_start(iregs); + + xtime.tv_sec = mktime(year, mon, day, hour, min, sec); + xtime.tv_usec = 0; + printk("%u/%u/%u %u:%u:%u\n",day,mon,year,hour,min,sec); + } +#endif /* Now that OBP ticker has been silenced, it is safe to enable IRQ. */ __sti(); @@ -375,11 +478,39 @@ { int real_seconds, real_minutes, mostek_minutes; struct mostek48t02 *regs = mstk48t02_regs; +#ifdef CONFIG_SUN4 + struct intersil *iregs = intersil_clock; + int temp; +#endif /* Not having a register set can lead to trouble. */ - if (!regs) + if (!regs) { +#ifdef CONFIG_SUN4 + if(!iregs) return -1; + else { + temp = iregs->clk.int_csec; + + mostek_minutes = iregs->clk.int_min; + + real_seconds = nowtime % 60; + real_minutes = nowtime / 60; + if (((abs(real_minutes - mostek_minutes) + 15)/30) & 1) + real_minutes += 30; /* correct for half hour time zone */ + real_minutes %= 60; + + if (abs(real_minutes - mostek_minutes) < 30) { + intersil_stop(iregs); + iregs->clk.int_sec=real_seconds; + iregs->clk.int_min=real_minutes; + intersil_start(iregs); + } else + return -1; + return 0; + } +#endif + } /* Read the current RTC minutes. */ regs->creg |= MSTK_CREG_READ; mostek_minutes = MSTK_REG_MIN(regs); diff -u --recursive --new-file v2.1.114/linux/arch/sparc/lib/Makefile linux/arch/sparc/lib/Makefile --- v2.1.114/linux/arch/sparc/lib/Makefile Tue Jul 21 00:15:30 1998 +++ linux/arch/sparc/lib/Makefile Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.25 1998/01/30 10:58:43 jj Exp $ +# $Id: Makefile,v 1.26 1998/07/26 03:02:43 davem Exp $ # Makefile for Sparc library files.. # diff -u --recursive --new-file v2.1.114/linux/arch/sparc/lib/locks.S linux/arch/sparc/lib/locks.S --- v2.1.114/linux/arch/sparc/lib/locks.S Wed Apr 23 19:01:16 1997 +++ linux/arch/sparc/lib/locks.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: locks.S,v 1.12 1997/04/22 18:48:07 davem Exp $ +/* $Id: locks.S,v 1.13 1998/07/30 11:29:28 davem Exp $ * locks.S: SMP low-level lock primitives on Sparc. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -20,8 +20,8 @@ * itself in %g1, %g4 must be restored into %o7 when we return, * and the caller wants us to return to him at three instructions * previous to the call instruction which got us here. See how - * this is used in asm/smp_lock.h and asm/spinlock.h if what I - * just said confuses you to no end. + * this is used in asm/spinlock.h if what I just said confuses + * you to no end. */ .globl ___spinlock_waitfor ___spinlock_waitfor: @@ -30,74 +30,6 @@ ldub [%g1], %g2 ldstub [%g1], %g2 jmpl %o7 - 12, %g0 - mov %g4, %o7 - -___lk_busy_spin: - orcc %g2, 0, %g0 - bne,a ___lk_busy_spin - ldub [%g1 + 0], %g2 - b 1f - ldstub [%g1 + 0], %g2 - - .globl ___lock_kernel -___lock_kernel: - addcc %g2, -1, %g2 - bcs,a 9f - st %g2, [%g6 + AOFF_task_lock_depth] - rd %psr, %g3 - or %g3, PSR_PIL, %g2 - wr %g2, 0x0, %psr - nop; nop; nop - ldstub [%g1 + 0], %g2 -1: orcc %g2, 0, %g0 - bne,a ___lk_busy_spin - ldub [%g1 + 0], %g2 - stb %g5, [%g1 + 1] - mov -1, %g2 - st %g2, [%g6 + AOFF_task_lock_depth] - wr %g3, 0x0, %psr - nop; nop; nop -9: jmpl %o7 + 0x8, %g0 - mov %g4, %o7 - - .globl ___lock_reacquire_kernel -___lock_reacquire_kernel: - rd %psr, %g3 - or %g3, PSR_PIL, %g7 - wr %g7, 0x0, %psr - nop; nop; nop - st %g2, [%g6 + AOFF_task_lock_depth] - ldstub [%g1 + 0], %g2 -1: orcc %g2, 0, %g0 - be 3f - ldub [%g1 + 0], %g2 -2: orcc %g2, 0, %g0 - bne,a 2b - ldub [%g1 + 0], %g2 - b 1b - ldstub [%g1 + 0], %g2 -3: stb %g5, [%g1 + 1] - wr %g3, 0x0, %psr - nop; nop; nop - jmpl %o7 + 0x8, %g0 - mov %g4, %o7 - - .globl ___unlock_kernel -___unlock_kernel: - addcc %g2, 1, %g2 - bne,a 1f - st %g2, [%g6 + AOFF_task_lock_depth] - rd %psr, %g3 - or %g3, PSR_PIL, %g2 - wr %g2, 0x0, %psr - nop; nop; nop - mov NO_PROC_ID, %g2 - stb %g2, [%g1 + 1] - stb %g0, [%g1 + 0] - st %g0, [%g6 + AOFF_task_lock_depth] - wr %g3, 0x0, %psr - nop; nop; nop; -1: jmpl %o7 + 0x8, %g0 mov %g4, %o7 /* Read/writer locks, as usual this is overly clever to make it diff -u --recursive --new-file v2.1.114/linux/arch/sparc/mm/Makefile linux/arch/sparc/mm/Makefile --- v2.1.114/linux/arch/sparc/mm/Makefile Tue Jul 21 00:15:30 1998 +++ linux/arch/sparc/mm/Makefile Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.30 1998/03/09 14:03:53 jj Exp $ +# $Id: Makefile,v 1.31 1998/07/26 03:02:45 davem Exp $ # Makefile for the linux Sparc-specific parts of the memory manager. # # Note! Dependencies are done automagically by 'make dep', which also 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 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: srmmu.c,v 1.171 1998/04/24 15:03:35 jj Exp $ +/* $Id: srmmu.c,v 1.173 1998/08/04 20:48:57 davem Exp $ * srmmu.c: SRMMU specific routines for memory management. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -1034,7 +1034,7 @@ FLUSH_BEGIN(mm) flush_user_windows(); - save_and_cli(flags); + __save_and_cli(flags); octx = srmmu_get_context(); srmmu_set_context(mm->context); a = 0x20; b = 0x40; c = 0x60; @@ -1058,7 +1058,7 @@ "r" (e), "r" (f), "r" (g)); } while(faddr); srmmu_set_context(octx); - restore_flags(flags); + __restore_flags(flags); FLUSH_END } @@ -1070,7 +1070,7 @@ FLUSH_BEGIN(mm) flush_user_windows(); - save_and_cli(flags); + __save_and_cli(flags); octx = srmmu_get_context(); srmmu_set_context(mm->context); a = 0x20; b = 0x40; c = 0x60; @@ -1099,7 +1099,7 @@ start += SRMMU_PMD_SIZE; } srmmu_set_context(octx); - restore_flags(flags); + __restore_flags(flags); FLUSH_END } @@ -1112,7 +1112,7 @@ FLUSH_BEGIN(mm) flush_user_windows(); - save_and_cli(flags); + __save_and_cli(flags); octx = srmmu_get_context(); srmmu_set_context(mm->context); a = 0x20; b = 0x40; c = 0x60; @@ -1138,7 +1138,7 @@ "r" (e), "r" (f), "r" (g)); } while(line != page); srmmu_set_context(octx); - restore_flags(flags); + __restore_flags(flags); FLUSH_END } @@ -2019,7 +2019,7 @@ pmd_t *pmdp; pte_t *ptep; - save_and_cli(flags); + __save_and_cli(flags); file = vma->vm_file; if (!file) @@ -2065,7 +2065,7 @@ flush_tlb_page(vma, address); } done: - restore_flags(flags); + __restore_flags(flags); } } @@ -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 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sun4c.c,v 1.164 1998/05/02 12:06:19 davem Exp $ +/* $Id: sun4c.c,v 1.166 1998/08/04 20:49:05 davem Exp $ * sun4c.c: Doing in software what should be done in hardware. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -611,9 +611,8 @@ break; case (SM_SUN4|SM_4_260): - prom_printf("No support for 4200 yet\n"); - prom_halt(); - num_segmaps = 512; + /* should be 512 segmaps. when it get fixed */ + num_segmaps = 256; num_contexts = 16; break; @@ -658,7 +657,7 @@ struct linux_prom_registers regs[1]; if (ARCH_SUN4) { - sun4c_memerr_reg = sparc_alloc_io(SUN4_MEMREG_PHYSADDR, 0, + sun4c_memerr_reg = sparc_alloc_io(sun4_memreg_physaddr, 0, PAGE_SIZE, "memory parity error", 0x0, 0); @@ -756,11 +755,13 @@ ~bits_off); } +/* the 4/260 dies real hard on the prom_putsegment line. + not sure why, but it seems to work without it cgd */ static inline void sun4c_init_map_kernelprom(unsigned long kernel_end) { unsigned long vaddr; unsigned char pseg, ctx; - +#ifndef CONFIG_SUN4 for(vaddr = KADB_DEBUGGER_BEGVM; vaddr < LINUX_OPPROM_ENDVM; vaddr += SUN4C_REAL_PGDIR_SIZE) { @@ -772,6 +773,7 @@ fix_permissions(vaddr, _SUN4C_PAGE_PRIV, 0); } } +#endif for(vaddr = KERNBASE; vaddr < kernel_end; vaddr += SUN4C_REAL_PGDIR_SIZE) { pseg = sun4c_get_segmap(vaddr); mmu_entry_pool[pseg].locked = 1; @@ -2536,6 +2538,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 +2821,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/sparc/prom/misc.c linux/arch/sparc/prom/misc.c --- v2.1.114/linux/arch/sparc/prom/misc.c Thu Apr 23 20:21:31 1998 +++ linux/arch/sparc/prom/misc.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.16 1998/03/09 14:04:25 jj Exp $ +/* $Id: misc.c,v 1.17 1998/07/21 10:36:22 jj Exp $ * misc.c: Miscellaneous prom functions that don't belong * anywhere else. * @@ -45,8 +45,7 @@ /* We want to do this more nicely some day. */ #ifdef CONFIG_SUN_CONSOLE -extern void console_restore_palette(void); -extern void set_palette(void); +extern void (*prom_palette)(int); extern int serial_console; #endif @@ -63,8 +62,8 @@ kernel_enter_debugger(); #ifdef CONFIG_SUN_CONSOLE - if(!serial_console) - console_restore_palette (); + if(!serial_console && prom_palette) + prom_palette (1); #endif install_obp_ticker(); save_flags(flags); cli(); @@ -76,8 +75,8 @@ TURN_ON_LED; #endif #ifdef CONFIG_SUN_CONSOLE - if(!serial_console) - set_palette (); + if(!serial_console && prom_palette) + prom_palette (0); #endif } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/Makefile linux/arch/sparc64/Makefile --- v2.1.114/linux/arch/sparc64/Makefile Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/Makefile Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.26 1998/04/18 03:40:54 davem Exp $ +# $Id: Makefile,v 1.27 1998/07/27 07:36:16 davem Exp $ # sparc64/Makefile # # Makefile for the architecture dependent flags and dependencies on the @@ -19,13 +19,20 @@ RANLIB = sparc64-linux-ranlib ELFTOAOUT = elftoaout +IS_EGCS := $(shell if $(CC) --version 2>&1 | grep 'egcs' > /dev/null; then echo y; else echo n; fi) + # # Uncomment the first CFLAGS if you are doing kgdb source level # debugging of the kernel to get the proper debugging information. #CFLAGS := $(CFLAGS) -g -pipe -fcall-used-g5 -fcall-used-g7 -CFLAGS := $(CFLAGS) -pipe -mno-fpu -mtune=ultrasparc -mmedlow \ - -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare +ifneq ($(IS_EGCS),y) + CFLAGS := $(CFLAGS) -pipe -mno-fpu -mtune=ultrasparc -mmedlow \ + -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare +else + CFLAGS := $(CFLAGS) -pipe -mno-fpu -mtune=ultrasparc -mcmodel=medlow \ + -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare +endif LINKFLAGS = -T arch/sparc64/vmlinux.lds diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/config.in linux/arch/sparc64/config.in --- v2.1.114/linux/arch/sparc64/config.in Thu Jul 16 18:09:24 1998 +++ linux/arch/sparc64/config.in Tue Aug 4 23:42:02 1998 @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.51 1998/07/08 10:21:14 jj Exp $ +# $Id: config.in,v 1.55 1998/08/03 15:28:38 davem Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -76,12 +76,14 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then tristate 'Solaris binary emulation' CONFIG_SOLARIS_EMUL fi -endmenu if [ "$CONFIG_PCI" = "y" ]; then tristate 'Parallel port support' CONFIG_PARPORT if [ "$CONFIG_PARPORT" != "n" ]; then dep_tristate ' Ultra/AX-style hardware' CONFIG_PARPORT_AX $CONFIG_PARPORT + if [ "$CONFIG_PARPORT_AX" = "m" ]; then + define_bool CONFIG_PARPORT_LOWLEVEL_MODULE y + fi if [ "$CONFIG_PARPORT_AX" != "n" ]; then bool ' Support foreign hardware' CONFIG_PARPORT_OTHER fi @@ -92,6 +94,7 @@ fi tristate 'SUNW,envctrl support' CONFIG_ENVCTRL fi +endmenu mainmenu_option next_comment comment 'Floppy, IDE, and other block devices' @@ -124,6 +127,7 @@ dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE define_bool CONFIG_BLK_DEV_IDEPCI y define_bool CONFIG_BLK_DEV_IDEDMA y + define_bool CONFIG_IDEDMA_AUTO y define_bool CONFIG_BLK_DEV_NS87415 y define_bool CONFIG_BLK_DEV_CMD646 y fi @@ -177,11 +181,11 @@ fi dep_tristate 'NCR53C8XX SCSI support' CONFIG_SCSI_NCR53C8XX $CONFIG_SCSI if [ "$CONFIG_SCSI_NCR53C8XX" != "n" ]; then - bool ' detect and read serial NVRAMs' CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT - bool ' enable tagged command queueing' CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE - int ' maximum number of queued commands' CONFIG_SCSI_NCR53C8XX_MAX_TAGS 12 + int ' default tagged command queue depth' CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS 8 + int ' maximum number of queued commands' CONFIG_SCSI_NCR53C8XX_MAX_TAGS 32 int ' synchronous transfers frequency in MHz' CONFIG_SCSI_NCR53C8XX_SYNC 10 - if [ "$CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE" != "y" ]; then + bool ' enable profiling' CONFIG_SCSI_NCR53C8XX_PROFILE + if [ "$CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS" = "0" ]; then bool ' not allow targets to disconnect' CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT fi if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then @@ -219,6 +223,7 @@ tristate 'MyriCOM Gigabit Ethernet support' CONFIG_MYRI_SBUS if [ "$CONFIG_PCI" = "y" ]; then tristate 'Generic DECchip & DIGITAL EtherWORKS PCI/EISA' CONFIG_DE4X5 + tristate '3c590/3c900 series (592/595/597) "Vortex/Boomerang" support' CONFIG_VORTEX fi # bool 'FDDI driver support' CONFIG_FDDI # if [ "$CONFIG_FDDI" = "y" ]; then @@ -240,10 +245,6 @@ mainmenu_option next_comment comment 'Kernel hacking' -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 bool 'ECache flush trap support at ta 0x72' CONFIG_EC_FLUSH_TRAP endmenu diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/defconfig linux/arch/sparc64/defconfig --- v2.1.114/linux/arch/sparc64/defconfig Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/defconfig Tue Aug 4 23:42:09 1998 @@ -20,6 +20,30 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y # CONFIG_AP1000 is not set + +# +# Console drivers +# +CONFIG_PROM_CONSOLE=y +CONFIG_FB=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FB_SBUS=y +CONFIG_FB_CREATOR=y +CONFIG_FB_CGSIX=y +# CONFIG_FB_BWTWO is not set +# CONFIG_FB_CGTHREE is not set +# CONFIG_FB_LEO is not set +CONFIG_FB_PCI=y +CONFIG_FB_ATY=y +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FBCON_ADVANCED is not set +CONFIG_FBCON_CFB8=y +CONFIG_FBCON_CFB16=y +CONFIG_FBCON_CFB24=y +CONFIG_FBCON_CFB32=y +CONFIG_FBCON_FONTWIDTH8_ONLY=y +CONFIG_FONT_SUN8x16=y +# CONFIG_FBCON_FONTS is not set CONFIG_SBUS=y CONFIG_SBUSCHAR=y CONFIG_SUN_MOUSE=y @@ -31,20 +55,7 @@ CONFIG_SUN_AUXIO=y CONFIG_SUN_IO=y CONFIG_PCI=y - -# -# SBUS Frame Buffer support -# -SUN_FBS_IN_PROCFS=y -CONFIG_SUN_FB_DISPLAY=y -SUN_FB_CGSIX=y -SUN_FB_TCX=y -SUN_FB_CGTHREE=y -SUN_FB_CGFOURTEEN=y -SUN_FB_BWTWO=y -SUN_FB_LEO=y -TADPOLE_FB_WEITEK=y -SUN_FB_CREATOR=y +CONFIG_PCI_CONSOLE=y # # Misc Linux/SPARC drivers @@ -71,7 +82,7 @@ CONFIG_SPARC32_COMPAT=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_ELF32=y -CONFIG_BINFMT_AOUT32=y +# CONFIG_BINFMT_AOUT32 is not set CONFIG_BINFMT_MISC=m CONFIG_BINFMT_JAVA=m CONFIG_SOLARIS_EMUL=m @@ -103,6 +114,7 @@ # CONFIG_BLK_DEV_IDESCSI is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_BLK_DEV_IDEDMA=y +CONFIG_IDEDMA_AUTO=y CONFIG_BLK_DEV_NS87415=y CONFIG_BLK_DEV_CMD646=y @@ -110,7 +122,9 @@ # Networking options # CONFIG_PACKET=y -# CONFIG_NETLINK is not set +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +# CONFIG_NETLINK_DEV is not set # CONFIG_FIREWALL is not set CONFIG_NET_ALIAS=y # CONFIG_FILTER is not set @@ -119,11 +133,11 @@ # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set -# CONFIG_IP_ACCT is not set # CONFIG_IP_ROUTER is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set CONFIG_IP_ALIAS=y +# CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set # @@ -152,15 +166,17 @@ # CONFIG_NET_HW_FLOWCONTROL is not set # CONFIG_CPU_IS_SLOW is not set CONFIG_NET_SCHED=y -CONFIG_NET_SCH_CBQ=y -CONFIG_NET_SCH_CSZ=y -CONFIG_NET_SCH_PRIO=y -CONFIG_NET_SCH_RED=y -CONFIG_NET_SCH_SFQ=y -# CONFIG_NET_SCH_TEQL is not set -CONFIG_NET_SCH_TBF=y +CONFIG_NETLINK=y +CONFIG_RTNETLINK=y +CONFIG_NET_SCH_CBQ=m +CONFIG_NET_SCH_CSZ=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_SFQ=m +CONFIG_NET_SCH_TEQL=m +CONFIG_NET_SCH_TBF=m # CONFIG_NET_QOS is not set -# CONFIG_NET_PROFILE is not set +# CONFIG_NET_CLS is not set # # SCSI support @@ -194,10 +210,10 @@ # CONFIG_AIC7XXX_PROC_STATS is not set CONFIG_AIC7XXX_RESET_DELAY=5 CONFIG_SCSI_NCR53C8XX=y -CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT=y -CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE=y -CONFIG_SCSI_NCR53C8XX_MAX_TAGS=12 +CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8 +CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32 CONFIG_SCSI_NCR53C8XX_SYNC=10 +# CONFIG_SCSI_NCR53C8XX_PROFILE is not set # CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set # @@ -234,6 +250,7 @@ CONFIG_SUNQE=m CONFIG_MYRI_SBUS=m CONFIG_DE4X5=y +CONFIG_VORTEX=m # # Filesystems @@ -275,7 +292,7 @@ CONFIG_SMD_DISKLABEL=y CONFIG_SOLARIS_X86_PARTITION=y # CONFIG_ADFS_FS is not set -CONFIG_DEVPTS_FS=y +# CONFIG_DEVPTS_FS is not set # CONFIG_MAC_PARTITION is not set CONFIG_NLS=y @@ -317,6 +334,5 @@ # # Kernel hacking # -# CONFIG_PROFILE is not set # CONFIG_MAGIC_SYSRQ is not set # CONFIG_EC_FLUSH_TRAP is not set diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/Makefile linux/arch/sparc64/kernel/Makefile --- v2.1.114/linux/arch/sparc64/kernel/Makefile Tue Jul 21 00:15:30 1998 +++ linux/arch/sparc64/kernel/Makefile Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.36 1998/02/01 11:15:55 ecd Exp $ +# $Id: Makefile,v 1.38 1998/07/26 03:02:47 davem Exp $ # Makefile for the linux kernel. # # Note! Dependencies are done automagically by 'make dep', which also @@ -39,8 +39,8 @@ O_OBJS += binfmt_aout32.o endif -head.o: head.S ttable.S itlb_miss.S dtlb_miss.S dtlb_prot.S etrap.S rtrap.S \ - winfixup.S entry.S +head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \ + etrap.S rtrap.S winfixup.S entry.S $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $*.S -o $*.o # diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/auxio.c linux/arch/sparc64/kernel/auxio.c --- v2.1.114/linux/arch/sparc64/kernel/auxio.c Thu Sep 4 12:54:48 1997 +++ linux/arch/sparc64/kernel/auxio.c Tue Aug 4 16:03:35 1998 @@ -42,9 +42,13 @@ struct linux_ebus_device *edev = 0; unsigned long led_auxio; - for_all_ebusdev(edev, ebus) - if (!strcmp(edev->prom_name, "auxio")) - break; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if (!strcmp(edev->prom_name, "auxio")) + goto ebus_done; + } + } + ebus_done: if (edev) { if (check_region(edev->base_address[0], diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/central.c linux/arch/sparc64/kernel/central.c --- v2.1.114/linux/arch/sparc64/kernel/central.c Thu Apr 23 20:21:31 1998 +++ linux/arch/sparc64/kernel/central.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: central.c,v 1.5 1998/02/12 15:57:59 jj Exp $ +/* $Id: central.c,v 1.6 1998/05/14 13:35:45 jj Exp $ * central.c: Central FHC driver for Sunfire/Starfire/Wildfire. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -29,13 +29,10 @@ char namebuf[128]; int cnode, fnode, err; - printk("CENTRAL: "); cnode = prom_finddevice("/central"); - if(cnode == 0 || cnode == -1) { - printk("no central found.\n"); + if(cnode == 0 || cnode == -1) return memory_start; - } - printk("found central PROM node.\n"); + printk("CENTRAL: found central PROM node %08x.\n", cnode); /* Ok we got one, grab some memory for software state. */ memory_start = long_align(memory_start); diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/devices.c linux/arch/sparc64/kernel/devices.c --- v2.1.114/linux/arch/sparc64/kernel/devices.c Thu Apr 23 20:21:31 1998 +++ linux/arch/sparc64/kernel/devices.c Tue Aug 4 16:03:35 1998 @@ -48,19 +48,23 @@ prom_getproperty(scan, "upa-portid", (char *) &thismid, sizeof(thismid)); linux_cpus[cpu_ctr].mid = thismid; - prom_printf("Found CPU %d \n", +#ifdef __SMP__ + prom_printf("Found CPU %d (node=%08x,mid=%d)\n", cpu_ctr, (unsigned) scan, thismid); - printk("Found CPU %d \n", + printk("Found CPU %d (node=%08x,mid=%d)\n", cpu_ctr, (unsigned) scan, thismid); +#endif cpu_ctr++; } }; if(cpu_ctr == 0) { - printk("No CPU nodes found, cannot continue.\n"); + prom_printf("No CPU nodes found, cannot continue.\n"); prom_halt(); } +#ifdef __SMP__ printk("Found %d CPU prom device tree node(s).\n", cpu_ctr); +#endif }; prom_node_cpu = cpu_nds[0]; diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/dtlb_backend.S linux/arch/sparc64/kernel/dtlb_backend.S --- v2.1.114/linux/arch/sparc64/kernel/dtlb_backend.S Wed Dec 31 16:00:00 1969 +++ linux/arch/sparc64/kernel/dtlb_backend.S Tue Aug 4 16:03:35 1998 @@ -0,0 +1,69 @@ +/* $Id: dtlb_backend.S,v 1.4 1998/06/15 16:59:34 jj Exp $ + * dtlb_backend.S: Back end to DTLB miss replacement strategy. + * This is included directly into the trap table. + * + * Copyright (C) 1996,1998 David S. Miller (davem@dm.cobaltmicro.com) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) + */ + +#define TAG_CONTEXT_BITS 0x3ff +#define VPTE_SHIFT (PAGE_SHIFT - 3) +#define PMD_SHIFT (23 - PAGE_SHIFT + 3) +#define PGD_SHIFT (34 - PAGE_SHIFT + 3) +#define VPTE_BITS (_PAGE_CP | _PAGE_P | _PAGE_W) + +/* Ways we can get here: + * + * 1) Nucleus loads and stores to/from PA-->VA direct mappings at tl>1. + * 2) Nucleus loads and stores to/from user/kernel window save areas. + * 3) VPTE misses from dtlb_base, dtlb_prot, and itlb_base. But this only + * happens for non-nucleus contexts. Nucleus VPTE's cannot work because + * of how OBP uses the same part of the address space in ctx 0. + */ + +/* TLB1 ** ICACHE line 1: tl1 DTLB and quick VPTE miss */ + ldxa [%g1 + %g1] ASI_DMMU, %g4 ! Get TAG_ACCESS + add %g3, %g3, %g5 ! Compute VPTE base + cmp %g4, %g5 ! VPTE miss? + blu,pn %xcc, .-0x4004 ! Fall to tl0 miss + andcc %g4, TAG_CONTEXT_BITS, %g5 ! From Nucleus? (for tl0 miss) + sllx %g6, VPTE_SHIFT, %g4 ! Position TAG_ACCESS + or %g4, %g5, %g4 ! Prepare TAG_ACCESS + mov TSB_REG, %g1 ! Grab TSB reg + +/* TLB1 ** ICACHE line 2: Quick VPTE miss */ + ldxa [%g1] ASI_DMMU, %g5 ! Doing PGD caching? + srlx %g6, (PMD_SHIFT - 1), %g1 ! Position PMD offset + be,pn %xcc, sparc64_vpte_nucleus ! Is it from Nucleus? + and %g1, 0xffe, %g1 ! Mask PMD offset bits + brnz,pt %g5, sparc64_vpte_continue ! Yep, go like smoke + nop ! Pipe bubble... + srlx %g6, (PGD_SHIFT - 2), %g5 ! Position PGD offset + and %g5, 0xffc, %g5 ! Mask PGD offset + +/* TLB1 ** ICACHE line 3: Quick VPTE miss */ + lduwa [%g7 + %g5] ASI_PHYS_USE_EC, %g5! Load PGD + brz,pn %g5, 2f ! Valid? +sparc64_vpte_continue: + add %g1, %g1, %g1 ! Position PMD offset once again + lduwa [%g5 + %g1] ASI_PHYS_USE_EC, %g5! Load PMD + brz,pn %g5, 2f ! Valid? + sllx %g2, 62, %g1 ! Put _PAGE_VALID into %g1 + or %g5, VPTE_BITS, %g5 ! Prepare VPTE data + or %g5, %g1, %g5 ! ... + +/* TLB1 ** ICACHE line 4: Quick VPTE miss */ + mov TLB_SFSR, %g1 ! Restore %g1 value + stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Load VPTE into TLB + membar #Sync ! Synchronize ASI stores + stxa %g4, [%g1 + %g1] ASI_DMMU ! Restore previous TAG_ACCESS + retry ! Load PTE once again +2: mov TLB_SFSR, %g1 ! Restore %g1 value + stxa %g4, [%g1 + %g1] ASI_DMMU ! Restore previous TAG_ACCESS + done ! Slick trick + +#undef TAG_CONTEXT_BITS +#undef VPTE_SHIFT +#undef PMD_SHIFT +#undef PGD_SHIFT +#undef VPTE_BITS diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/dtlb_base.S linux/arch/sparc64/kernel/dtlb_base.S --- v2.1.114/linux/arch/sparc64/kernel/dtlb_base.S Wed Dec 31 16:00:00 1969 +++ linux/arch/sparc64/kernel/dtlb_base.S Tue Aug 4 16:03:35 1998 @@ -0,0 +1,98 @@ +/* $Id: dtlb_base.S,v 1.4 1998/06/15 16:59:30 jj Exp $ + * dtlb_base.S: Front end to DTLB miss replacement strategy. + * This is included directly into the trap table. + * + * Copyright (C) 1996,1998 David S. Miller (davem@dm.cobaltmicro.com) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) + */ + +#define TAG_CONTEXT_BITS 0x3ff +#define VPTE_SHIFT (PAGE_SHIFT - 3) +#define KERN_HIGHBITS ((_PAGE_VALID | _PAGE_SZ4MB) ^ 0xfffff80000000000) +#define KERN_LOWBITS (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W) +#define KERN_LOWBITS_IO (_PAGE_E | _PAGE_P | _PAGE_W) +#define KERN_IOBITS (KERN_LOWBITS ^ KERN_LOWBITS_IO) + +/* %g1 TLB_SFSR (%g1 + %g1 == TLB_TAG_ACCESS) + * %g2 (KERN_HIGHBITS | KERN_LOWBITS) + * %g3 VPTE base (0xfffffffe00000000) Spitfire/Blackbird (44-bit VA space) + * (0xffe0000000000000) Cheetah (64-bit VA space) + * %g7 __pa(current->mm->pgd) + * + * The VPTE base value is completely magic, but note that + * nothing else in the kernel other than these TLB miss + * handlers know anything about the VPTE mechanism or + * how it works. Consider the 44-bit VADDR Ultra-I/II + * case as an example: + * + * VA[0 : (1<<43)] produce VPTE index [%g3 : 0] + * VA[0 : -(1<<43)] produce VPTE index [%g3-(1<<(43-PAGE_SHIFT+3)) : %g3] + * + * For Cheetah's 64-bit VADDR space this is: + * + * VA[0 : (1<<63)] produce VPTE index [%g3 : 0] + * VA[0 : -(1<<63)] produce VPTE index [%g3-(1<<(63-PAGE_SHIFT+3)) : %g3] + * + * If you're paying attention you'll notice that this means half of + * the VPTE table is above %g3 and half is below, low VA addresses + * map progressively upwards from %g3, and high VA addresses map + * progressively downwards from %g3. This trick was needed to make + * the same 8 instruction handler work both for Spitfire/Blackbird's + * peculiar VA space hole configuration and the full 64-bit VA space + * one of Cheetah at the same time. + */ + +/* Ways we can get here: + * + * 1) Nucleus loads and stores to/from PA-->VA direct mappings. + * 2) Nucleus loads and stores to/from vmalloc() areas. + * 3) User loads and stores. + * 4) User space accesses by nucleus at tl0 + */ + +/* DTLB ** ICACHE line 1: Quick user TLB misses */ + ldxa [%g1 + %g1] ASI_DMMU, %g4 ! Get TAG_ACCESS + andcc %g4, TAG_CONTEXT_BITS, %g0 ! From Nucleus? + be,pn %xcc, 3f ! Yep, special processing + srax %g4, VPTE_SHIFT, %g6 ! Create VPTE offset + ldxa [%g3 + %g6] ASI_S, %g5 ! Load VPTE +1: brlz,pt %g5, 2f ! Valid, load into TLB + and %g5, (_PAGE_PRESENT|_PAGE_READ), %g4 ! Mask readable bits + ba,a,pt %xcc, 4f ! Invalid, branch out + +/* DTLB ** ICACHE line 2: Quick kernel TLB misses */ +3: brgez,a,pn %g4, 1b ! Kernel virtual map? + ldxa [%g3 + %g6] ASI_N, %g5 ! Yep, load k-vpte + srlx %g4, 40, %g5 ! Else compute phys-kpte + andcc %g5, 1, %g0 ! I/O area? + be,pt %xcc, 2f ! Nope, go and load TLB + xor %g2, %g4, %g5 ! Finish bit twiddles + ba,pt %xcc, 2f ! Yes, I/O space, back back + xor %g5, (KERN_IOBITS), %g5 ! After set E, clear CP/CV + +/* DTLB ** ICACHE line 3: winfixups+real_faults */ +4: cmp %g4, (_PAGE_PRESENT|_PAGE_READ) ! Readable page? + be,pn %xcc, 5f ! Yep, refbit update + sllx %g1, 60, %g4 ! Get valid bit + rdpr %pstate, %g5 ! Move into alternate globals + wrpr %g5, PSTATE_AG|PSTATE_MG, %pstate + rdpr %tl, %g4 ! See where we came from. + cmp %g4, 1 ! Is etrap/rtrap window fault? + mov TLB_TAG_ACCESS, %g4 ! Prepare for fault processing + +/* DTLB ** ICACHE line 4: padding */ + be,pt %xcc, sparc64_realfault_common ! Jump to normal fault handling + ldxa [%g4] ASI_DMMU, %g5 ! And load faulting VA page + ba,a,pt %xcc, winfix_trampoline ! Call window fixup code +5: or %g5, _PAGE_ACCESSED, %g5 ! Indicate reference + or %g5, %g4, %g5 ! Set valid + stxa %g5, [%g3 + %g6] ASI_S ! Update PTE table (cant trap) +2: stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Reload TLB + retry ! Trap return + +#undef TAG_CONTEXT_BITS +#undef VPTE_SHIFT +#undef KERN_HIGHBITS +#undef KERN_LOWBITS +#undef KERN_LOWBITS_IO +#undef KERN_IOBITS diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/dtlb_miss.S linux/arch/sparc64/kernel/dtlb_miss.S --- v2.1.114/linux/arch/sparc64/kernel/dtlb_miss.S Thu Apr 23 20:21:31 1998 +++ linux/arch/sparc64/kernel/dtlb_miss.S Wed Dec 31 16:00:00 1969 @@ -1,83 +0,0 @@ -/* $Id: dtlb_miss.S,v 1.15 1998/01/14 17:14:44 jj Exp $ - * dtlb_miss.S: Data TLB miss code, this is included directly - * into the trap table. - * - * Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -/* The basic algorithm is: - * - * if(faulting_context != 0) { - * pgd = pgd_offset(current->mm.pgd, fault_address); - * page_table_walk_continue: - * pmd = pmd_offset(pgd, fault_address); - * pte = pte_offset(pmd, fault_address); - * if(pte & _PAGE_V) { - * tlb_load(pte, fault_address); - * return_from_trap(); - * } - * goto longer_processing; - * } else { - * if(fault_address >= PAGE_OFFSET) { - * pte_val = PAGE_KERNEL; - * if (fault_address & 0x10000000000) - * pte_val = PAGE_KERNEL_IO; - * tlb_load(__pa(fault_address) | pte_val); - * return_from_trap(); - * } else { - * pgd = pgd_offset(swapper_pg_dir, fault_address); - * goto page_table_walk_continue; - * } - * } - * - * This is optimized for user TLB misses on purpose. - */ - -#define KERN_HIGHBITS ((_PAGE_VALID | _PAGE_SZ4MB) ^ 0xfffff80000000000) -#define KERN_LOWBITS (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W) -#define KERN_LOWBITS_IO (_PAGE_E | _PAGE_P | _PAGE_W) - - /* ICACHE line 1 */ - /*0x00*/ ldxa [%g0] ASI_DMMU, %g1 ! Get TAG_TARGET - /*0x04*/ srlx %g1, 10, %g3 ! Position PGD offset - /*0x08*/ andcc %g1, %g2, %g0 ! Test CONTEXT bits - /*0x0c*/ and %g3, 0xffc, %g3 ! Mask PGD offset - /*0x18*/ and %g1, 0xffe, %g4 ! Mask PMD offset - /*0x14*/ be,pn %xcc, 3f ! Context 0 == kernel - /*0x10*/ add %g4, %g4, %g4 ! Position PMD offset - /*0x1c*/ ldxa [%g0] ASI_DMMU_TSB_8KB_PTR, %g1 ! For PTE offset - - /* ICACHE line 2 */ - /*0x20*/ lduwa [%g7 + %g3] ASI_PHYS_USE_EC, %g5 ! Load PGD - /*0x24*/ srlx %g1, 1, %g1 ! PTE offset -2:/*0x28*/ lduwa [%g5 + %g4] ASI_PHYS_USE_EC, %g3 ! Load PMD - /*0x2c*/ ldxa [%g3 + %g1] ASI_PHYS_USE_EC, %g5 ! Load PTE - /*0x30*/ brgez,pn %g5, sparc64_dtlb_refbit_catch ! Valid set? - /*0x34*/ nop ! delay - /*0x38*/ stxa %g5, [%g0] ASI_DTLB_DATA_IN ! TLB load - /*0x3c*/ retry ! Trap return - -3: /* ICACHE line 3 */ - /*0x40*/ sllx %g1, 22, %g5 ! This is now physical page + PAGE_OFFSET - /*0x44*/ brgez,pn %g5, 4f ! If >= 0, then walk down page tables - /*0x48*/ or %g2, (KERN_LOWBITS), %g1 ! Construct PTE ^ PAGE_OFFSET - /*0x4c*/ andcc %g3, 0x100, %g0 ! Slick trick... - /*0x50*/ bne,a,pn %icc, 5f ! Is it an IO page? - /*0x54*/ or %g2, (KERN_LOWBITS_IO), %g1 ! Aha, it is IO... -5:/*0x58*/ xor %g1, %g5, %g1 ! Slick trick II... - /*0x5c*/ stxa %g1, [%g0] ASI_DTLB_DATA_IN ! TLB load - - /* ICACHE line 4 */ - /*0x60*/ retry ! Trap return - /*0x64*/ nop - /*0x68*/ nop - /*0x6c*/ nop -4:/*0x70*/ ldxa [%g0] ASI_DMMU_TSB_8KB_PTR, %g1 ! For PTE offset - /*0x74*/ lduwa [%g6 + %g3] ASI_PHYS_USE_EC, %g5 ! Load kern PGD - /*0x78*/ ba,pt %xcc, 2b ! Go back up top - /*0x7c*/ srlx %g1, 1, %g1 - -#undef KERN_HIGHBITS -#undef KERN_LOWBITS -#undef KERN_LOWBITS_IO diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/dtlb_prot.S linux/arch/sparc64/kernel/dtlb_prot.S --- v2.1.114/linux/arch/sparc64/kernel/dtlb_prot.S Thu Apr 23 20:21:31 1998 +++ linux/arch/sparc64/kernel/dtlb_prot.S Tue Aug 4 16:03:35 1998 @@ -1,56 +1,62 @@ -/* $Id: dtlb_prot.S,v 1.15 1998/01/14 17:14:46 jj Exp $ - * dtlb_prot.S: Data TLB protection code, this is included directly - * into the trap table. +/* $Id: dtlb_prot.S,v 1.17 1998/05/25 16:59:11 davem Exp $ + * dtlb_prot.S: DTLB protection trap strategy. + * This is included directly into the trap table. * - * Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1996,1998 David S. Miller (davem@dm.cobaltmicro.com) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) */ - /* We know kernel never takes protection trap, - * this makes this routine a lot easier than it - * would be otherwise. - */ - -#define MODIFIED_BITS (_PAGE_WRITE | _PAGE_W | _PAGE_MODIFIED | _PAGE_ACCESSED) - - /* ICACHE line 1 */ - /*0x00*/ ldxa [%g0] ASI_DMMU, %g1 ! Get TAG_TARGET - /*0x04*/ srlx %g1, 10, %g3 ! Position PGD offset - /*0x08*/ and %g1, 0xffe, %g4 ! Mask PMD offset - /*0x0c*/ and %g3, 0xffc, %g3 ! Mask PGD offset - /*0x10*/ add %g4, %g4, %g4 ! Position PMD offset - /*0x14*/ lduwa [%g7 + %g3] ASI_PHYS_USE_EC, %g5 ! Load PGD - /*0x18*/ lduwa [%g5 + %g4] ASI_PHYS_USE_EC, %g4 ! Load PMD - /*0x1c*/ ldxa [%g0] ASI_DMMU_TSB_8KB_PTR, %g1 ! For PTE offset - - /* ICACHE line 2 */ - /*0x20*/ srlx %g1, 1, %g1 ! PTE offset - /*0x24*/ ldxa [%g4 + %g1] ASI_PHYS_USE_EC, %g3 ! Load PTE - /*0x28*/ andcc %g3, _PAGE_WRITE, %g0 ! Writable? - /*0x2c*/ be,pt %xcc, sparc64_dtlb_prot_catch ! Nope... - /*0x30*/ or %g3, (MODIFIED_BITS), %g3 ! Yes it is - /*0x34*/ mov TLB_TAG_ACCESS, %g5 ! Get the page - /*0x38*/ add %g1, %g4, %g1 ! to get a tmpreg - /*0x3c*/ ldxa [%g5] ASI_DMMU, %g4 ! From MMU - - /* ICACHE line 3 */ - /*0x40*/ mov TLB_SFSR, %g5 ! read SFSR - /*0x44*/ srlx %g4, 13, %g4 ! Prepare... - /*0x48*/ ldxa [%g5] ASI_DMMU, %g5 ! from DMMU for - /*0x4c*/ sllx %g4, 13, %g4 ! ...and mask page - /*0x50*/ and %g5, 0x10, %g5 ! context bit - /*0x54*/ or %g4, %g5, %g4 ! for prot trap -1:/*0x58*/ stxa %g0, [%g4] ASI_DMMU_DEMAP ! TLB flush page - /*0x5c*/ membar #Sync ! Synchronize - - /* ICACHE line 4 */ - /*0x60*/ stxa %g3, [%g1] ASI_PHYS_USE_EC ! Update sw PTE - /*0x64*/ stxa %g3, [%g0] ASI_DTLB_DATA_IN ! TLB load - /*0x68*/ retry ! Trap return - /*0x6c*/ nop - /*0x70*/ nop - /*0x74*/ nop - /*0x78*/ nop - /*0x7c*/ nop +#define TAG_CONTEXT_BITS 0x3ff +#define VPTE_SHIFT (PAGE_SHIFT - 3) +#define MODIFIED_BITS (_PAGE_WRITE | _PAGE_W | _PAGE_MODIFIED | _PAGE_ACCESSED) +/* Ways we can get here: + * + * [TL == 0] 1) User stores to readonly pages. + * [TL == 0] 2) Nucleus stores to user readonly pages. + * [TL > 0] 3) Nucleus stores to user readonly stack frame. + */ + +/* PROT ** ICACHE line 1: User DTLB protection trap */ + ldxa [%g1] ASI_DMMU, %g6 ! Primary or Secondary ctx? + and %g6, 0x10, %g6 ! Get pri/sec ctx bit + stxa %g0, [%g1] ASI_DMMU ! Clear SFSR FaultValid bit + membar #Sync ! Synchronize ASI stores + ldxa [%g1 + %g1] ASI_DMMU, %g4 ! Load TAG_ACCESS + andn %g4, TAG_CONTEXT_BITS, %g4 ! Clear CTX bits + stxa %g0, [%g4 + %g6] ASI_DMMU_DEMAP ! Perform TLB flush of page + membar #Sync ! Synchronize ASI stores + +/* PROT ** ICACHE line 2: Further normal processing */ + srax %g4, VPTE_SHIFT, %g6 ! Compute VPTE offset + ldxa [%g3 + %g6] ASI_S, %g5 ! Load PTE entry + andcc %g5, _PAGE_WRITE, %g0 ! Writable page? + be,pt %xcc, 1f ! Nope, real fault + or %g5, (MODIFIED_BITS), %g5 ! Mark as writable/modified + stxa %g5, [%g3 + %g6] ASI_S ! Update PTE entry + stxa %g5, [%g0] ASI_DTLB_DATA_IN ! Load PTE into TLB + retry ! Trap return + +/* PROT ** ICACHE line 3: Real user faults */ +1: rdpr %pstate, %g5 ! Move into alternate globals + wrpr %g5, PSTATE_AG|PSTATE_MG, %pstate + rdpr %tl, %g4 ! Need to do a winfixup? + cmp %g4, 1 ! Trap level >1? + mov TLB_TAG_ACCESS, %g4 ! Prepare reload of vaddr + bgu,pn %xcc, winfix_trampoline ! Yes, perform winfixup + ldxa [%g4] ASI_DMMU, %g5 ! Put tagaccess in %g5 + sethi %hi(1f), %g7 ! Nope, normal fault + +/* PROT ** ICACHE line 4: More real fault processing */ + ba,pt %xcc, etrap ! Save state +1: or %g7, %lo(1b), %g7 ! ... + ba,pt %xcc, sparc64_realfault_continue! Now call the fault handler + mov 1, %o2 ! Indicate this was a write + nop + nop + nop + nop + +#undef TAG_CONTEXT_BITS +#undef VPTE_SHIFT #undef MODIFIED_BITS diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/ebus.c linux/arch/sparc64/kernel/ebus.c --- v2.1.114/linux/arch/sparc64/kernel/ebus.c Thu Jul 16 18:09:24 1998 +++ linux/arch/sparc64/kernel/ebus.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: ebus.c,v 1.26 1998/04/21 06:34:02 ecd Exp $ +/* $Id: ebus.c,v 1.29 1998/07/01 15:39:44 jj Exp $ * ebus.c: PCI to EBus bridge device. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -51,7 +51,13 @@ static inline unsigned long ebus_alloc(size_t size) { - return (unsigned long)kmalloc(size, GFP_ATOMIC); + unsigned long mem; + + mem = (unsigned long)kmalloc(size, GFP_ATOMIC); + if (!mem) + panic(__FUNCTION__ ": out of memory"); + memset((char *)mem, 0, size); + return mem; } __initfunc(void ebus_intmap_match(struct linux_ebus *ebus, @@ -140,7 +146,7 @@ if (dev->num_irqs) { dprintf(" IRQ%s", dev->num_irqs > 1 ? "s" : ""); for (i = 0; i < dev->num_irqs; i++) - dprintf(" %08x", dev->irqs[i]); + dprintf(" %s", __irq_itoa(dev->irqs[i])); dprintf("\n"); } #endif @@ -194,7 +200,7 @@ if (dev->num_irqs) { dprintf(" IRQ%s", dev->num_irqs > 1 ? "s" : ""); for (i = 0; i < dev->num_irqs; i++) - dprintf(" %08x", dev->irqs[i]); + dprintf(" %s", __irq_itoa(dev->irqs[i])); dprintf("\n"); } #endif diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/entry.S linux/arch/sparc64/kernel/entry.S --- v2.1.114/linux/arch/sparc64/kernel/entry.S Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/entry.S Tue Aug 4 16:03:35 1998 @@ -1,10 +1,10 @@ -/* $Id: entry.S,v 1.78 1998/05/01 20:36:24 davem Exp $ +/* $Id: entry.S,v 1.87 1998/07/29 16:32:28 jj Exp $ * arch/sparc64/kernel/entry.S: Sparc64 trap low-level entry points. * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ #include @@ -18,6 +18,7 @@ #include #include #include +#include /* #define SYSCALL_TRACING */ @@ -26,115 +27,23 @@ #define NR_SYSCALLS 256 /* Each OS is different... */ .text - .globl sparc64_dtlb_prot_catch, sparc64_dtlb_refbit_catch - .globl sparc64_itlb_refbit_catch - - /* Note, DMMU SFAR not updated for fast tlb data access miss - * traps, so we must use tag access to find the right page. - * However for DMMU fast protection traps it is updated so - * we use, but we must also clear it _before_ we enable interrupts - * and save state because there is a race where we can push a user - * window right now in etrap, a protection fault happens (for example - * to update the dirty bit) and since we left crap in the sfsr - * it will not get updated properly. - */ - .align 32 -sparc64_dtlb_prot_catch: - wr %g0, ASI_DMMU, %asi - rdpr %pstate, %g1 - wrpr %g1, PSTATE_AG|PSTATE_MG, %pstate - rdpr %tl, %g3 - ldxa [%g0 + TLB_TAG_ACCESS] %asi, %g5 - stxa %g0, [%g0 + TLB_SFSR] %asi - membar #Sync - cmp %g3, 1 - - bgu,a,pn %icc, winfix_trampoline - rdpr %tpc, %g3 - sethi %hi(109f), %g7 - ba,pt %xcc, etrap -109: or %g7, %lo(109b), %g7 - b,pt %xcc, 1f - mov 1, %o2 - .align 32 -sparc64_dtlb_refbit_catch: - and %g5, ((_PAGE_PRESENT | _PAGE_READ) >> 9), %g4 - cmp %g4, ((_PAGE_PRESENT | _PAGE_READ) >> 9) - be,a,pt %xcc, 2f - mov 1, %g4 - wr %g0, ASI_DMMU, %asi - rdpr %pstate, %g1 - wrpr %g1, PSTATE_AG|PSTATE_MG, %pstate - - rdpr %tl, %g3 - ldxa [%g0 + TLB_TAG_ACCESS] %asi, %g5 - cmp %g3, 1 - bgu,pn %icc, winfix_trampoline - rdpr %tpc, %g3 - sethi %hi(109f), %g7 - b,pt %xcc, etrap -109: or %g7, %lo(109b), %g7 - - clr %o2 -1: srlx %l5, PAGE_SHIFT, %o1 - add %sp, STACK_BIAS + REGWIN_SZ, %o0 - call do_sparc64_fault - sllx %o1, PAGE_SHIFT, %o1 - b,pt %xcc, rtrap - clr %l6 .align 32 -sparc64_itlb_refbit_catch: - and %g5, ((_PAGE_PRESENT | _PAGE_READ) >> 9), %g4 - cmp %g4, ((_PAGE_PRESENT | _PAGE_READ) >> 9) - be,a,pt %xcc, 3f - mov 1, %g4 - rdpr %pstate, %g1 - wrpr %g1, PSTATE_AG|PSTATE_MG, %pstate - rdpr %tpc, %g5 - sethi %hi(109f), %g7 - b,pt %xcc, etrap -109: or %g7, %lo(109b), %g7 - b,pt %xcc, 1b - clr %o2 - - .align 32 -2: sllx %g4, 63, %g4 ! _PAGE_VALID - or %g5, _PAGE_ACCESSED, %g5 - or %g5, %g4, %g5 - stxa %g5, [%g3 + %g1] ASI_PHYS_USE_EC ! store new PTE - stxa %g5, [%g0] ASI_DTLB_DATA_IN ! TLB load - retry - - .align 32 -3: sllx %g4, 63, %g4 ! _PAGE_VALID - or %g5, _PAGE_ACCESSED, %g5 - or %g5, %g4, %g5 - stxa %g5, [%g3 + %g1] ASI_PHYS_USE_EC ! store new PTE - stxa %g5, [%g0] ASI_ITLB_DATA_IN ! TLB load - retry - -#define FPDIS_OFF (((PAGE_SIZE<<1)-((64*4)+(2*8))) & ~(64 - 1)) /* This is trivial with the new code... */ .align 32 .globl do_fpdis do_fpdis: - lduh [%g6 + AOFF_task_tss + AOFF_thread_flags], %g5 ! Load Group + ldub [%g6 + AOFF_task_tss + AOFF_thread_fpsaved], %g5 ! Load Group sethi %hi(TSTATE_PEF), %g4 ! IEU0 - sethi %hi(FPDIS_OFF), %g3 ! IEU1 wr %g0, FPRS_FEF, %fprs ! LSU Group+4bubbles - andcc %g5, SPARC_FLAG_USEDFPU, %g0 ! IEU1 Group - or %g3, %lo(FPDIS_OFF), %g2 ! IEU0 - sethi %hi(empty_zero_page), %g1 ! IEU0 Group - add %g6, %g2, %g2 ! IEU1 - be,a,pn %icc, 1f ! CTI - clr %g7 ! IEU0 Group - add %g2, 0x100, %g1 ! IEU1 - ldx [%g2 + 0x108], %g7 ! Load -1: andcc %g5, SPARC_FLAG_USEDFPUL, %g0 ! IEU1 Group + andcc %g5, FPRS_FEF, %g0 ! IEU1 Group + be,a,pt %icc, 1f ! CTI + clr %g7 ! IEU0 + ldub [%g6 + AOFF_task_tss + AOFF_thread_gsr], %g7 ! Load Group +1: andcc %g5, FPRS_DL, %g0 ! IEU1 bne,pn %icc, 2f ! CTI fzero %f0 ! FPA - andcc %g5, SPARC_FLAG_USEDFPUU, %g0 ! IEU1 Group + andcc %g5, FPRS_DU, %g0 ! IEU1 Group bne,pn %icc, 1f ! CTI fzero %f2 ! FPA faddd %f0, %f2, %f4 @@ -168,17 +77,18 @@ b,pt %xcc, fpdis_exit2 faddd %f0, %f2, %f60 1: mov SECONDARY_CONTEXT, %g3 + add %g6, AOFF_task_fpregs + 0x80, %g1 faddd %f0, %f2, %f4 fmuld %f0, %f2, %f6 ldxa [%g3] ASI_DMMU, %g5 + add %g6, AOFF_task_fpregs + 0xc0, %g2 stxa %g0, [%g3] ASI_DMMU faddd %f0, %f2, %f8 fmuld %f0, %f2, %f10 - flush %g2 - wr %g0, ASI_BLK_S, %asi ! grrr, where is ASI_BLK_NUCLEUS 8-( + flush %g6 membar #StoreLoad | #LoadLoad - ldda [%g2 + 0x080] %asi, %f32 - ldda [%g2 + 0x0c0] %asi, %f48 + ldda [%g1] ASI_BLK_S, %f32 ! grrr, where is ASI_BLK_NUCLEUS 8-( + ldda [%g2] ASI_BLK_S, %f48 faddd %f0, %f2, %f12 fmuld %f0, %f2, %f14 faddd %f0, %f2, %f16 @@ -191,20 +101,21 @@ fmuld %f0, %f2, %f30 b,pt %xcc, fpdis_exit membar #Sync -2: andcc %g5, SPARC_FLAG_USEDFPUU, %g0 +2: andcc %g5, FPRS_DU, %g0 bne,pt %icc, 3f fzero %f32 mov SECONDARY_CONTEXT, %g3 fzero %f34 ldxa [%g3] ASI_DMMU, %g5 + add %g6, AOFF_task_fpregs, %g1 stxa %g0, [%g3] ASI_DMMU + add %g6, AOFF_task_fpregs + 0x40, %g2 faddd %f32, %f34, %f36 fmuld %f32, %f34, %f38 - flush %g2 - wr %g0, ASI_BLK_S, %asi ! grrr, where is ASI_BLK_NUCLEUS 8-( + flush %g6 membar #StoreLoad | #LoadLoad - ldda [%g2 + 0x000] %asi, %f0 - ldda [%g2 + 0x040] %asi, %f16 + ldda [%g1] ASI_BLK_S, %f0 ! grrr, where is ASI_BLK_NUCLEUS 8-( + ldda [%g2] ASI_BLK_S, %f16 faddd %f32, %f34, %f40 fmuld %f32, %f34, %f42 faddd %f32, %f34, %f44 @@ -220,22 +131,24 @@ b,pt %xcc, fpdis_exit membar #Sync 3: mov SECONDARY_CONTEXT, %g3 + add %g6, AOFF_task_fpregs, %g1 ldxa [%g3] ASI_DMMU, %g5 + mov 0x40, %g2 stxa %g0, [%g3] ASI_DMMU - flush %g2 - wr %g0, ASI_BLK_S, %asi ! grrr, where is ASI_BLK_NUCLEUS 8-( + flush %g6 membar #StoreLoad | #LoadLoad - ldda [%g2 + 0x000] %asi, %f0 - ldda [%g2 + 0x040] %asi, %f16 - ldda [%g2 + 0x080] %asi, %f32 - ldda [%g2 + 0x0c0] %asi, %f48 + ldda [%g1] ASI_BLK_S, %f0 ! grrr, where is ASI_BLK_NUCLEUS 8-( + ldda [%g1 + %g2] ASI_BLK_S, %f16 + add %g1, 0x80, %g1 + ldda [%g1] ASI_BLK_S, %f32 + ldda [%g1 + %g2] ASI_BLK_S, %f48 membar #Sync fpdis_exit: stxa %g5, [%g3] ASI_DMMU - flush %g2 + flush %g6 fpdis_exit2: wr %g7, 0, %gsr - ldx [%g1], %fsr + ldx [%g6 + AOFF_task_tss + AOFF_thread_xfsr], %fsr rdpr %tstate, %g3 or %g3, %g4, %g3 ! anal... wrpr %g3, %tstate @@ -298,8 +211,10 @@ add %g2, 0x10, %g2 ldxa [%g2] ASI_UDB_INTR_R, %g7 stxa %g0, [%g0] ASI_INTR_RECEIVE + membar #Sync jmpl %g3, %g0 - membar #Sync + nop + do_ivec_spurious: srl %g3, 3, %g3 sethi %hi(ivec_spurious_cookie), %g2 @@ -586,6 +501,8 @@ .globl sys_sigreturn, sys_rt_sigreturn .globl sys32_sigreturn, sys32_rt_sigreturn .globl sys32_execve, sys_ptrace + .globl sys_sigaltstack, sys32_sigaltstack + .globl sys32_sigstack .align 32 sys_pipe: sethi %hi(sparc_pipe), %g1 add %sp, STACK_BIAS + REGWIN_SZ, %o0 @@ -609,6 +526,19 @@ add %sp, STACK_BIAS + REGWIN_SZ, %o1 jmpl %g1 + %lo(sparc_memory_ordering), %g0 nop +sys_sigaltstack:sethi %hi(do_sigaltstack), %g1 + add %i6, STACK_BIAS, %o2 + jmpl %g1 + %lo(do_sigaltstack), %g1 + nop +sys32_sigstack: sethi %hi(do_sys32_sigstack), %g1 + mov %i6, %o2 + jmpl %g1 + %lo(do_sys32_sigstack), %g1 + nop +sys32_sigaltstack: + sethi %hi(do_sys32_sigaltstack), %g1 + mov %i6, %o2 + jmpl %g1 + %lo(do_sys32_sigaltstack), %g1 + nop .align 32 sys_sigsuspend: add %sp, STACK_BIAS + REGWIN_SZ, %o0 @@ -687,8 +617,8 @@ * In fact we should take advantage of that fact for other things * during system calls... */ - .globl sys_fork, sys_vfork, sys_clone - .globl ret_from_syscall, ret_from_smpfork + .globl sys_fork, sys_vfork, sys_clone, sparc_exit + .globl ret_from_syscall .align 32 sys_fork: sys_vfork: mov SIGCHLD, %o0 @@ -699,15 +629,31 @@ movrz %o1, %fp, %o1 call do_fork mov %l5, %o7 +ret_from_syscall: + /* Clear SPARC_FLAG_NEWCHILD, switch_to leaves tss.flags in + * %o7 for us. + */ + andn %o7, 0x100, %o7 + sth %o7, [%g6 + AOFF_task_tss + AOFF_thread_flags] #ifdef __SMP__ -ret_from_smpfork: sethi %hi(scheduler_lock), %o4 membar #StoreStore | #LoadStore stb %g0, [%o4 + %lo(scheduler_lock)] #endif -ret_from_syscall: b,pt %xcc, ret_sys_call ldx [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0], %o0 +sparc_exit: rdpr %otherwin, %g1 + rdpr %pstate, %g2 + wrpr %g2, PSTATE_IE, %pstate + rdpr %cansave, %g3 + add %g3, %g1, %g3 + wrpr %g3, 0x0, %cansave + wrpr %g0, 0x0, %otherwin + wrpr %g2, 0x0, %pstate + mov %o7, %l5 + sth %g0, [%g6 + AOFF_task_tss + AOFF_thread_w_saved] + call sys_exit + mov %l5, %o7 linux_sparc_ni_syscall: sethi %hi(sys_ni_syscall), %l7 diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/etrap.S linux/arch/sparc64/kernel/etrap.S --- v2.1.114/linux/arch/sparc64/kernel/etrap.S Mon Jan 12 15:15:44 1998 +++ linux/arch/sparc64/kernel/etrap.S Tue Aug 4 16:03:35 1998 @@ -1,8 +1,8 @@ -/* $Id: etrap.S,v 1.39 1997/10/24 11:57:47 jj Exp $ +/* $Id: etrap.S,v 1.40 1998/06/12 14:54:03 jj Exp $ * etrap.S: Preparing for entry into the kernel on Sparc V9. * * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1997, 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ #include @@ -12,41 +12,32 @@ #include #include -#define FPUREG_SZ ((64 * 4) + (2 * 8)) -#define TASK_REGOFF ((((PAGE_SIZE<<1)-FPUREG_SZ)&~(64-1)) - \ - TRACEREG_SZ-REGWIN_SZ) -#define FPU_OFF (STACK_BIAS + REGWIN_SZ + TRACEREG_SZ) +#define TASK_REGOFF ((PAGE_SIZE<<1)-TRACEREG_SZ-REGWIN_SZ) /* * On entry, %g7 is return address - 0x4. * %g4 and %g5 will be preserved %l4 and %l5 respectively. */ - .text - .align 32 -etrap_priv: or %g1, %g3, %g1 ! IEU0 Group - rd %fprs, %g3 ! Single Group+4bubbles - sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU0 Group - andcc %g3, FPRS_FEF, %g0 ! IEU1 - add %g2, REGWIN_SZ + TRACEREG_SZ - FPUREG_SZ, %g3 ! IEU0 Group - be,pt %icc, 1f ! CTI - andcc %g1, TSTATE_PRIV, %g0 ! IEU1 - andn %g3, (64 - 1), %g3 ! IEU0 Group - ba,pt %xcc, 1f ! CTI - sub %g3, REGWIN_SZ + TRACEREG_SZ, %g2 ! IEU0 Group - + .text .align 32 .globl etrap, etrap_irq, etraptl1 + .globl scetrap etrap: rdpr %pil, %g2 ! Single Group etrap_irq: rdpr %tstate, %g1 ! Single Group sllx %g2, 20, %g3 ! IEU0 Group andcc %g1, TSTATE_PRIV, %g0 ! IEU1 - bne,pn %xcc, etrap_priv ! CTI - sethi %hi(TASK_REGOFF), %g2 ! IEU0 Group - or %g1, %g3, %g1 ! IEU1 + or %g1, %g3, %g1 ! IEU0 Group + bne,a,pn %xcc, 1f ! CTI + sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1 + sethi %hi(TASK_REGOFF), %g2 ! IEU0 Group + sethi %hi(TSTATE_PEF), %g3 ! IEU1 or %g2, %lo(TASK_REGOFF), %g2 ! IEU0 Group - add %g6, %g2, %g2 ! IEU0 Group + and %g1, %g3, %g3 ! IEU1 + brnz,pn %g3, 1f ! CTI+IEU1 Group + add %g6, %g2, %g2 ! IEU0 + wr %g0, 0, %fprs ! Single Group+4bubbles 1: rdpr %tpc, %g3 ! Single Group stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE] ! Store Group rdpr %tnpc, %g1 ! Single Group @@ -56,62 +47,27 @@ st %g3, [%g2 + REGWIN_SZ + PT_V9_Y] ! Store Group save %g2, -STACK_BIAS, %sp ! The ordering here is ! Single Group rdpr %pstate, %g1 ! critical, see winfixup ! Single Group+9bubbles - bne,pn %xcc, 2f ! CTI Group - sethi %hi(TSTATE_PEF), %l2 ! IEU0 - mov PRIMARY_CONTEXT, %l4 ! IEU1 + andn %g6, 0x1f, %l6 ! IEU0 Group + bne,pn %xcc, 3f ! CTI + mov PRIMARY_CONTEXT, %l4 ! IEU1 rdpr %canrestore, %g3 ! Single Group+4bubbles rdpr %wstate, %g2 ! Single Group+4bubbles wrpr %g0, 7, %cleanwin ! Single Group+4bubbles wrpr %g0, 0, %canrestore ! Single Group+4bubbles sll %g2, 3, %g2 ! IEU0 Group - mov SECONDARY_CONTEXT, %l5 ! IEU1 + mov 1, %l5 ! IEU1 + stb %l5, [%l6 + AOFF_task_tss + AOFF_thread_fpdepth] ! Store wrpr %g3, 0, %otherwin ! Single Group+4bubbles wrpr %g2, 0, %wstate ! Single Group+4bubbles - rdpr %tstate, %l3 ! Single Group ldxa [%l4] ASI_DMMU, %g2 ! Load Group stxa %g0, [%l4] ASI_DMMU ! Store Group - stxa %g2, [%l5] ASI_DMMU ! Store Group - flush %g6 ! Single Group+9bubbles - andcc %l3, %l2, %g0 ! IEU1 Group - be,a,pt %icc, 6f ! CTI - st %g0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_FPRS] ! Store - rd %fprs, %l0 ! Single Group+4bubbles - andcc %l0, FPRS_FEF, %g0 ! IEU1 Group - be,pn %icc, 6f ! CTI - st %l0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_FPRS] ! Store - lduh [%g6 + AOFF_task_tss + AOFF_thread_flags], %l4 ! Load Group - stx %fsr, [%sp + FPU_OFF + 0x100] ! Single Group - or %l4, %l0, %l4 ! IEU0 Group - ba,pt %xcc, 3f ! CTI - sth %l4, [%g6 + AOFF_task_tss + AOFF_thread_flags] ! Store -2: rd %fprs, %l0 ! Single Group+4bubbles - andcc %l0, FPRS_FEF, %g0 ! IEU1 Group - be,pn %icc, 6f ! CTI - st %l0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_FPRS] ! Store - stx %fsr, [%sp + FPU_OFF + 0x100] ! Single Group -3: rd %gsr, %l7 ! Single Group+4bubbles - cmp %l0, FPRS_FEF ! IEU1 Group - be,pn %icc, 6f ! CTI - stx %l7, [%sp + FPU_OFF + 0x108] ! Store - wr %g0, ASI_BLK_P, %asi ! Singe Group+4bubbles - andcc %l0, FPRS_DL, %g0 ! IEU1 Group - be,pn %icc, 4f ! CTI - membar #StoreStore | #LoadStore ! Memory - stda %f0, [%sp + FPU_OFF + 0x000] %asi ! Store Group - stda %f16, [%sp + FPU_OFF + 0x040] %asi ! Store Group - andcc %l0, FPRS_DU, %g0 ! IEU1 - be,pn %icc, 5f ! CTI - nop ! IEU0 Group -4: stda %f32, [%sp + FPU_OFF + 0x080] %asi ! Store Group - stda %f48, [%sp + FPU_OFF + 0x0c0] %asi ! Store Group -5: membar #Sync ! Memory -6: wr %g0, 0x0, %fprs ! Single Group+4bubbles - wrpr %g0, 0x0, %tl ! Single Group+4bubbles + stxa %g2, [%l4 + %l4] ASI_DMMU ! Store Group + flush %l6 ! Single Group+9bubbles +2: wrpr %g0, 0x0, %tl ! Single Group+4bubbles andn %g1, PSTATE_MM, %l1 ! IEU0 Group mov %g4, %l4 ! IEU1 mov %g5, %l5 ! IEU0 Group mov %g7, %l2 ! IEU1 - mov %g6, %l6 ! IEU0 Group wrpr %l1, (PSTATE_AG|PSTATE_RMO), %pstate ! Single Group+4bubbles stx %g1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G1] ! Store Group stx %g2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G2] ! Store Group @@ -134,8 +90,80 @@ jmpl %l2 + 0x4, %g0 ! CTI Group mov %l6, %g6 ! IEU0 +3: ldub [%l6 + AOFF_task_tss + AOFF_thread_fpdepth], %l5 ! Load Group + add %l6, AOFF_task_tss + AOFF_thread_fpsaved + 1, %l4 ! IEU0 + srl %l5, 1, %l3 ! IEU0 Group + add %l5, 2, %l5 ! IEU1 + stb %l5, [%l6 + AOFF_task_tss + AOFF_thread_fpdepth] ! Store + ba,pt %xcc, 2b ! CTI + stb %g0, [%l4 + %l3] ! Store Group + etraptl1: rdpr %tstate, %g1 ! Single Group+4bubbles - ba,pt %xcc, etrap_priv ! CTI Group - clr %g3 ! IEU0 + sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1 + ba,pt %xcc, 1b ! CTI Group + andcc %g1, TSTATE_PRIV, %g0 ! IEU0 + +scetrap: rdpr %pil, %g2 ! Single Group + rdpr %tstate, %g1 ! Single Group + sllx %g2, 20, %g3 ! IEU0 Group + andcc %g1, TSTATE_PRIV, %g0 ! IEU1 + or %g1, %g3, %g1 ! IEU0 Group + bne,a,pn %xcc, 1f ! CTI + sub %sp, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1 + sethi %hi(TASK_REGOFF), %g2 ! IEU0 Group + sethi %hi(TSTATE_PEF), %g3 ! IEU1 + or %g2, %lo(TASK_REGOFF), %g2 ! IEU0 Group + and %g1, %g3, %g3 ! IEU1 + brnz,pn %g3, 1f ! CTI+IEU1 Group + add %g6, %g2, %g2 ! IEU0 + wr %g0, 0, %fprs ! Single Group+4bubbles +1: rdpr %tpc, %g3 ! Single Group + stx %g1, [%g2 + REGWIN_SZ + PT_V9_TSTATE] ! Store Group + rdpr %tnpc, %g1 ! Single Group + stx %g3, [%g2 + REGWIN_SZ + PT_V9_TPC] ! Store Group + stx %g1, [%g2 + REGWIN_SZ + PT_V9_TNPC] ! Store Group + st %g0, [%g2 + REGWIN_SZ + PT_V9_Y] ! Store Group + save %g2, -STACK_BIAS, %sp ! The ordering here is ! Single Group + rdpr %pstate, %g1 ! critical, see winfixup ! Single Group+9bubbles + andn %g6, 0x1f, %l6 ! IEU0 Group + bne,pn %xcc, 2f ! CTI + mov PRIMARY_CONTEXT, %l4 ! IEU1 + rdpr %canrestore, %g3 ! Single Group+4bubbles + rdpr %wstate, %g2 ! Single Group+4bubbles + wrpr %g0, 7, %cleanwin ! Single Group+4bubbles + wrpr %g0, 0, %canrestore ! Single Group+4bubbles + sll %g2, 3, %g2 ! IEU0 Group + wrpr %g3, 0, %otherwin ! Single Group+4bubbles + wrpr %g2, 0, %wstate ! Single Group+4bubbles + ldxa [%l4] ASI_DMMU, %g2 ! Load Group + stxa %g0, [%l4] ASI_DMMU ! Store Group + stxa %g2, [%l4 + %l4] ASI_DMMU ! Store Group + flush %l6 ! Single Group+9bubbles +2: wrpr %g0, 0x0, %tl ! Single Group+4bubbles + andn %g1, PSTATE_MM, %l1 ! IEU0 Group + mov %g4, %l4 ! IEU1 + mov %g5, %l5 ! IEU0 Group + mov %g7, %l2 ! IEU1 + wrpr %l1, (PSTATE_AG|PSTATE_RMO), %pstate ! Single Group+4bubbles + stx %g1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G1] ! Store Group + stx %g2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G2] ! Store Group + stx %g3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G3] ! Store Group + stx %g4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G4] ! Store Group + stx %g5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G5] ! Store Group + stx %g6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G6] ! Store Group + stx %g7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_G7] ! Store Group + stx %i0, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I0] ! Store Group + stx %i1, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I1] ! Store Group + stx %i2, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I2] ! Store Group + stx %i3, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I3] ! Store Group + stx %i4, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I4] ! Store Group + sethi %uhi(PAGE_OFFSET), %g4 ! IEU0 + stx %i5, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I5] ! Store Group + stx %i6, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I6] ! Store Group + sllx %g4, 32, %g4 ! IEU0 + stx %i7, [%sp + STACK_BIAS + REGWIN_SZ + PT_V9_I7] ! Store Group + wrpr %l1, (PSTATE_IE|PSTATE_AG|PSTATE_RMO), %pstate ! Single Group+4bubbles + jmpl %l2 + 0x4, %g0 ! CTI Group + mov %l6, %g6 ! IEU0 + #undef TASK_REGOFF -#undef FPUREG_SZ diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/head.S linux/arch/sparc64/kernel/head.S --- v2.1.114/linux/arch/sparc64/kernel/head.S Thu Apr 23 20:21:31 1998 +++ linux/arch/sparc64/kernel/head.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: head.S,v 1.49 1998/03/03 12:31:17 jj Exp $ +/* $Id: head.S,v 1.53 1998/06/15 16:59:35 jj Exp $ * head.S: Initial boot code for the Sparc64 port of Linux. * * Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -89,6 +89,7 @@ * (PSTATE_PRIV | PSTATE_PEF | PSTATE_IE) in %pstate. */ wrpr %g0, (PSTATE_PRIV|PSTATE_PEF|PSTATE_IE), %pstate + wr %g0, 0, %fprs #ifdef __SMP__ /* Ugly but necessary... */ @@ -348,17 +349,30 @@ /* Set up MMU globals */ wrpr %o1, (PSTATE_MG|PSTATE_IE), %pstate - /* Set KERN_HIGHBITS used by dTLB miss handler. */ -#define KERN_HIGHBITS ((_PAGE_VALID | _PAGE_SZ4MB) ^ 0xfffff80000000000) + /* Set fixed globals used by dTLB miss handler. */ +#define KERN_HIGHBITS ((_PAGE_VALID | _PAGE_SZ4MB) ^ 0xfffff80000000000) +#define KERN_LOWBITS (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W) +#ifdef THIS_IS_CHEETAH +#error Dave, make sure you took care of other issues in rest of sparc64 code... +#define VPTE_BASE 0xffe0000000000000 +#else /* Spitfire/Blackbird */ +#define VPTE_BASE 0xfffffffe00000000 +#endif + mov TSB_REG, %g1 + stxa %g0, [%g1] ASI_DMMU + membar #Sync + mov TLB_SFSR, %g1 sethi %uhi(KERN_HIGHBITS), %g2 + or %g2, %ulo(KERN_HIGHBITS), %g2 sllx %g2, 32, %g2 -#undef KERN_HIGHBITS - - /* Kernel PGDIR used by TLB miss handlers. */ - mov %i0, %g6 - - /* To catch bootup bugs, this is user PGDIR for TLB miss handlers. */ + or %g2, KERN_LOWBITS, %g2 + sethi %uhi(VPTE_BASE), %g3 + or %g3, %ulo(VPTE_BASE), %g3 + sllx %g3, 32, %g3 clr %g7 +#undef KERN_HIGHBITS +#undef KERN_LOWBITS +#undef VPTE_BASE /* Setup Interrupt globals */ wrpr %o1, (PSTATE_IG|PSTATE_IE), %pstate @@ -372,14 +386,6 @@ wrpr %g0, %g0, %wstate wrpr %o1, PSTATE_IE, %pstate - /* Zap TSB BASE to zero with TSB_size==1. */ - mov TSB_REG, %o4 - mov 1, %o5 - stxa %o5, [%o4] ASI_DMMU - stxa %o5, [%o4] ASI_IMMU - - membar #Sync - sethi %hi(sparc64_ttable_tl0), %g5 call prom_set_trap_table mov %g5, %o0 @@ -403,6 +409,12 @@ #include "ttable.S" #include "systbls.S" + + .align 1024 + .globl swapper_pg_dir +swapper_pg_dir: + .word 0 + #include "etrap.S" #include "rtrap.S" #include "winfixup.S" @@ -420,3 +432,4 @@ __ret_efault: ret restore %g0, -EFAULT, %o0 + diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/ioctl32.c linux/arch/sparc64/kernel/ioctl32.c --- v2.1.114/linux/arch/sparc64/kernel/ioctl32.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/ioctl32.c Tue Aug 4 16:03:35 1998 @@ -1,7 +1,8 @@ -/* $Id: ioctl32.c,v 1.37 1998/05/06 05:34:13 davem Exp $ +/* $Id: ioctl32.c,v 1.48 1998/08/03 23:58:04 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) * * These routines maintain argument size conversion between 32bit and 64bit * ioctls. @@ -30,6 +31,9 @@ #include #include #include +#include +#include +#include #include /* Ugly hack. */ @@ -44,6 +48,8 @@ #include #include #include +#include +#include /* As gcc will warn about casting u32 to some ptr, we have to cast it to * unsigned long first, and that's what is A() for. @@ -392,7 +398,7 @@ } f.red = red; f.green = green; f.blue = blue; set_fs (KERNEL_DS); - ret = sys_ioctl (fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP : FBIOGETCMAP, (long)&f); + ret = sys_ioctl (fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (long)&f); set_fs (old_fs); if (!ret && cmd == FBIOGETCMAP32) { if (copy_to_user ((char *)A(r), red, f.count) || @@ -458,7 +464,162 @@ set_fs (old_fs); return ret; } - + +struct fb_fix_screeninfo32 { + char id[16]; + __kernel_caddr_t32 smem_start; + __u32 smem_len; + __u32 type; + __u32 type_aux; + __u32 visual; + __u16 xpanstep; + __u16 ypanstep; + __u16 ywrapstep; + __u32 line_length; + __kernel_caddr_t32 mmio_start; + __u32 mmio_len; + __u32 accel; + __u16 reserved[3]; +}; + +struct fb_cmap32 { + __u32 start; + __u32 len; + __kernel_caddr_t32 red; + __kernel_caddr_t32 green; + __kernel_caddr_t32 blue; + __kernel_caddr_t32 transp; +}; + +static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, u32 arg) +{ + mm_segment_t old_fs = get_fs(); + u32 red = 0, green = 0, blue = 0, transp = 0; + struct fb_fix_screeninfo fix; + struct fb_cmap cmap; + void *karg; + int err = 0; + + switch (cmd) { + case FBIOGET_FSCREENINFO: + karg = &fix; + break; + case FBIOGETCMAP: + case FBIOPUTCMAP: + karg = &cmap; + if (__get_user(cmap.start, &((struct fb_cmap32 *)A(arg))->start) || + __get_user(cmap.len, &((struct fb_cmap32 *)A(arg))->len) || + __get_user(red, &((struct fb_cmap32 *)A(arg))->red) || + __get_user(green, &((struct fb_cmap32 *)A(arg))->green) || + __get_user(blue, &((struct fb_cmap32 *)A(arg))->blue) || + __get_user(transp, &((struct fb_cmap32 *)A(arg))->transp)) + return -EFAULT; + cmap.red = kmalloc(cmap.len * sizeof(__u16), GFP_KERNEL); + if (!cmap.red) + return -ENOMEM; + cmap.green = kmalloc(cmap.len * sizeof(__u16), GFP_KERNEL); + if (!cmap.green) { + kfree(cmap.red); + return -ENOMEM; + } + cmap.blue = kmalloc(cmap.len * sizeof(__u16), GFP_KERNEL); + if (!cmap.blue) { + kfree(cmap.red); + kfree(cmap.green); + return -ENOMEM; + } + if (transp) { + cmap.transp = kmalloc(cmap.len * sizeof(__u16), GFP_KERNEL); + if (!cmap.transp) { + kfree(cmap.red); + kfree(cmap.green); + kfree(cmap.blue); + return -ENOMEM; + } + } else { + cmap.transp = NULL; + } + if (cmd == FBIOGETCMAP) + break; + + if (__copy_from_user(cmap.red, (char *)A(((struct fb_cmap32 *)A(arg))->red), + cmap.len * sizeof(__u16)) || + __copy_from_user(cmap.green, (char *)A(((struct fb_cmap32 *)A(arg))->green), + cmap.len * sizeof(__u16)) || + __copy_from_user(cmap.blue, (char *)A(((struct fb_cmap32 *)A(arg))->blue), + cmap.len * sizeof(__u16)) || + (cmap.transp && + __copy_from_user(cmap.transp, (char *)A(((struct fb_cmap32 *)A(arg))->transp), + cmap.len * sizeof(__u16)))) { + kfree(cmap.red); + kfree(cmap.green); + kfree(cmap.blue); + if (cmap.transp) + kfree(cmap.transp); + return -EFAULT; + } + break; + default: + printk("%s: Unknown fb ioctl cmd fd(%d) cmd(%08x) arg(%08x)\n", + __FUNCTION__, fd, cmd, arg); + return -ENOSYS; + } + set_fs(KERNEL_DS); + err = sys_ioctl(fd, cmd, (unsigned long)karg); + set_fs(old_fs); + if (err) + return err; + switch (cmd) { + case FBIOGET_FSCREENINFO: + if (__copy_to_user((char *)((struct fb_fix_screeninfo32 *)A(arg))->id, + (char *)fix.id, sizeof(fix.id)) || + __put_user((__u32)(unsigned long)fix.smem_start, + &((struct fb_fix_screeninfo32 *)A(arg))->smem_start) || + __put_user(fix.smem_len, &((struct fb_fix_screeninfo32 *)A(arg))->smem_len) || + __put_user(fix.type, &((struct fb_fix_screeninfo32 *)A(arg))->type) || + __put_user(fix.type_aux, &((struct fb_fix_screeninfo32 *)A(arg))->type_aux) || + __put_user(fix.visual, &((struct fb_fix_screeninfo32 *)A(arg))->visual) || + __put_user(fix.xpanstep, &((struct fb_fix_screeninfo32 *)A(arg))->xpanstep) || + __put_user(fix.ypanstep, &((struct fb_fix_screeninfo32 *)A(arg))->ypanstep) || + __put_user(fix.ywrapstep, &((struct fb_fix_screeninfo32 *)A(arg))->ywrapstep) || + __put_user(fix.line_length, &((struct fb_fix_screeninfo32 *)A(arg))->line_length) || + __put_user((__u32)(unsigned long)fix.mmio_start, + &((struct fb_fix_screeninfo32 *)A(arg))->mmio_start) || + __put_user(fix.mmio_len, &((struct fb_fix_screeninfo32 *)A(arg))->mmio_len) || + __put_user(fix.accel, &((struct fb_fix_screeninfo32 *)A(arg))->accel) || + __copy_to_user((char *)((struct fb_fix_screeninfo32 *)A(arg))->reserved, + (char *)fix.reserved, sizeof(fix.reserved))) + return -EFAULT; + break; + case FBIOGETCMAP: + if (__copy_to_user((char *)A(((struct fb_cmap32 *)A(arg))->red), cmap.red, + cmap.len * sizeof(__u16)) || + __copy_to_user((char *)A(((struct fb_cmap32 *)A(arg))->green), cmap.blue, + cmap.len * sizeof(__u16)) || + __copy_to_user((char *)A(((struct fb_cmap32 *)A(arg))->blue), cmap.blue, + cmap.len * sizeof(__u16)) || + (cmap.transp && + __copy_to_user((char *)A(((struct fb_cmap32 *)A(arg))->transp), cmap.transp, + cmap.len * sizeof(__u16)))) { + kfree(cmap.red); + kfree(cmap.green); + kfree(cmap.blue); + if (cmap.transp) + kfree(cmap.transp); + return -EFAULT; + } + /* fall through */ + case FBIOPUTCMAP: + kfree(cmap.red); + kfree(cmap.green); + kfree(cmap.blue); + if (cmap.transp) + kfree(cmap.transp); + break; + } + return 0; +} + static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, u32 arg) { mm_segment_t old_fs = get_fs(); @@ -1128,6 +1289,139 @@ return err; } +extern int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); + +static int vt_check(struct file *file) +{ + struct tty_struct *tty; + struct inode *inode = file->f_dentry->d_inode; + + if (file->f_op->ioctl != tty_ioctl) + return -EINVAL; + + tty = (struct tty_struct *)file->private_data; + if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) + return -EINVAL; + + if (tty->driver.ioctl != vt_ioctl) + return -EINVAL; + + /* + * To have permissions to do most of the vt ioctls, we either have + * to be the owner of the tty, or super-user. + */ + if (current->tty == tty || suser()) + return 1; + return 0; +} + +struct consolefontdesc32 { + unsigned short charcount; /* characters in font (256 or 512) */ + unsigned short charheight; /* scan lines per character (1-32) */ + u32 chardata; /* font data in expanded form */ +}; + +static int do_fontx_ioctl(struct file *file, int cmd, struct consolefontdesc32 *user_cfd) +{ + struct consolefontdesc cfdarg; + struct console_font_op op; + int i, perm; + + perm = vt_check(file); + if (perm < 0) return perm; + + if (copy_from_user(&cfdarg, user_cfd, sizeof(struct consolefontdesc32))) + return -EFAULT; + + cfdarg.chardata = (unsigned char *)A(((struct consolefontdesc32 *)&cfdarg)->chardata); + + switch (cmd) { + case PIO_FONTX: + if (!perm) + return -EPERM; + op.op = KD_FONT_OP_SET; + op.flags = 0; + op.width = 8; + op.height = cfdarg.charheight; + op.charcount = cfdarg.charcount; + op.data = cfdarg.chardata; + return con_font_op(fg_console, &op); + case GIO_FONTX: + if (!cfdarg.chardata) + return 0; + op.op = KD_FONT_OP_GET; + op.flags = 0; + op.width = 8; + op.height = cfdarg.charheight; + op.charcount = cfdarg.charcount; + op.data = cfdarg.chardata; + i = con_font_op(fg_console, &op); + if (i) + return i; + cfdarg.charheight = op.height; + cfdarg.charcount = op.charcount; + ((struct consolefontdesc32 *)&cfdarg)->chardata = (unsigned long)cfdarg.chardata; + if (copy_to_user(user_cfd, &cfdarg, sizeof(struct consolefontdesc32))) + return -EFAULT; + return 0; + } + return -EINVAL; +} + +struct console_font_op32 { + unsigned int op; /* operation code KD_FONT_OP_* */ + unsigned int flags; /* KD_FONT_FLAG_* */ + unsigned int width, height; /* font size */ + unsigned int charcount; + u32 data; /* font data with height fixed to 32 */ +}; + +static int do_kdfontop_ioctl(struct file *file, struct console_font_op32 *fontop) +{ + struct console_font_op op; + int perm = vt_check(file), i; + struct vt_struct *vt; + + if (perm < 0) return perm; + + if (copy_from_user(&op, (void *) fontop, sizeof(struct console_font_op32))) + return -EFAULT; + if (!perm && op.op != KD_FONT_OP_GET) + return -EPERM; + op.data = (unsigned char *)A(((struct console_font_op32 *)&op)->data); + op.flags |= KD_FONT_FLAG_OLD; + vt = (struct vt_struct *)((struct tty_struct *)file->private_data)->driver_data; + i = con_font_op(vt->vc_num, &op); + if (i) return i; + ((struct console_font_op32 *)&op)->data = (unsigned long)op.data; + if (copy_to_user((void *) fontop, &op, sizeof(struct console_font_op32))) + return -EFAULT; + return 0; +} + +struct unimapdesc32 { + unsigned short entry_ct; + u32 entries; +}; + +static int do_unimap_ioctl(struct file *file, int cmd, struct unimapdesc32 *user_ud) +{ + struct unimapdesc32 tmp; + int perm = vt_check(file); + + if (perm < 0) return perm; + if (copy_from_user(&tmp, user_ud, sizeof tmp)) + return -EFAULT; + switch (cmd) { + case PIO_UNIMAP: + if (!perm) return -EPERM; + return con_set_unimap(fg_console, tmp.entry_ct, (struct unipair *)A(tmp.entries)); + case GIO_UNIMAP: + return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), (struct unipair *)A(tmp.entries)); + } + return 0; +} + asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, u32 arg) { struct file * filp; @@ -1200,6 +1494,10 @@ case BLKRAGET: case BLKGETSIZE: + case 0x1260: + /* The mkswap binary hard codes it to Intel value :-((( */ + if(cmd == 0x1260) + cmd = BLKGETSIZE; error = w_long(fd, cmd, arg); goto out; @@ -1212,6 +1510,12 @@ error = fbiogscursor(fd, cmd, arg); goto out; + case FBIOGET_FSCREENINFO: + case FBIOGETCMAP: + case FBIOPUTCMAP: + error = fb_ioctl_trans(fd, cmd, arg); + goto out; + case HDIO_GET_KEEPSETTINGS: case HDIO_GET_UNMASKINTR: case HDIO_GET_DMA: @@ -1263,7 +1567,21 @@ case AUTOFS_IOC_SETTIMEOUT: error = rw_long(fd, cmd, arg); goto out; + + case PIO_FONTX: + case GIO_FONTX: + error = do_fontx_ioctl(filp, cmd, (struct consolefontdesc32 *)A(arg)); + goto out; + + case PIO_UNIMAP: + case GIO_UNIMAP: + error = do_unimap_ioctl(filp, cmd, (struct unimapdesc32 *)A(arg)); + goto out; + case KDFONTOP: + error = do_kdfontop_ioctl(filp, (struct console_font_op32 *)A(arg)); + goto out; + /* List here exlicitly which ioctl's are known to have * compatable types passed or none at all... */ @@ -1315,6 +1633,17 @@ case FBIOGCURPOS: case FBIOGCURMAX: + case FBIOGET_VSCREENINFO: + case FBIOPUT_VSCREENINFO: + case FBIOPAN_DISPLAY: + case FBIOGET_FCURSORINFO: + case FBIOGET_VCURSORINFO: + case FBIOPUT_VCURSORINFO: + case FBIOGET_CURSORSTATE: + case FBIOPUT_CURSORSTATE: + case FBIOGET_CON2FBMAP: + case FBIOPUT_CON2FBMAP: + /* Little f */ case FIOCLEX: case FIONCLEX: @@ -1397,6 +1726,12 @@ case KDSKBLED: case KDGETLED: case KDSETLED: + case GIO_SCRNMAP: + case PIO_SCRNMAP: + case GIO_UNISCRNMAP: + case PIO_UNISCRNMAP: + case PIO_FONTRESET: + case PIO_UNIMAPCLR: /* Little k */ case KIOCTYPE: @@ -1438,9 +1773,11 @@ case VUIDSFORMAT: case VUIDGFORMAT: - /* Little p (/dev/rtc etc.) */ + /* Little p (/dev/rtc, /dev/envctrl, etc.) */ case RTCGET: case RTCSET: + case I2CIOCSADR: + case I2CIOCGADR: /* Little m */ case MTIOCTOP: @@ -1537,6 +1874,14 @@ /* Big L */ case LOOP_SET_FD: case LOOP_CLR_FD: + + /* Big A */ + case AUDIO_GETINFO: + case AUDIO_SETINFO: + case AUDIO_DRAIN: + case AUDIO_GETDEV: + case AUDIO_GETDEV_SUNOS: + case AUDIO_FLUSH: /* AUTOFS */ case AUTOFS_IOC_READY: diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/ioport.c linux/arch/sparc64/kernel/ioport.c --- v2.1.114/linux/arch/sparc64/kernel/ioport.c Thu Sep 4 12:54:48 1997 +++ linux/arch/sparc64/kernel/ioport.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: ioport.c,v 1.13 1997/08/18 01:20:22 davem Exp $ +/* $Id: ioport.c,v 1.14 1998/05/11 06:23:36 davem Exp $ * ioport.c: Simple io mapping allocator. * * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) @@ -20,7 +20,6 @@ /* This points to the next to use virtual memory for io mappings */ static unsigned long dvma_next_free = DVMA_VADDR; -unsigned long sparc_iobase_vaddr = IOBASE_VADDR; extern void mmu_map_dma_area(unsigned long addr, int len, __u32 *dvma_addr); @@ -33,7 +32,9 @@ * Input: * address: Physical address to map * virtual: if non zero, specifies a fixed virtual address where - * the mapping should take place. + * the mapping should take place, not supported on Ultra + * and this feature is scheduled to be removed as nobody + * uses it. -DaveM * len: the length of the mapping * bus_type: Optional high word of physical address. * @@ -44,59 +45,24 @@ void *sparc_alloc_io (u32 address, void *virtual, int len, char *name, u32 bus_type, int rdonly) { - unsigned long vaddr, base_address; unsigned long addr = ((unsigned long)address) + (((unsigned long)bus_type)<<32); - unsigned long offset = (addr & (~PAGE_MASK)); + unsigned long vaddr = (unsigned long) __va(addr); - if (virtual) { - vaddr = (unsigned long) virtual; + if(virtual) + panic("sparc_alloc_io: Fixed virtual mappings unsupported on Ultra."); - len += offset; - if(((unsigned long) virtual + len) > (IOBASE_VADDR + IOBASE_LEN)) { - prom_printf("alloc_io: Mapping outside IOBASE area\n"); - prom_halt(); - } - if(check_region ((vaddr | offset), len)) { - prom_printf("alloc_io: 0x%lx is already in use\n", vaddr); - prom_halt(); - } - - /* Tell Linux resource manager about the mapping */ - request_region ((vaddr | offset), len, name); - } else { - unsigned long vaddr = (unsigned long) __va(addr); - - if(!check_region(vaddr, len)) - request_region(vaddr, len, name); - - return (void *) vaddr; - } - - base_address = vaddr; - /* Do the actual mapping */ - for (; len > 0; len -= PAGE_SIZE) { - mapioaddr(addr, vaddr, bus_type, rdonly); - vaddr += PAGE_SIZE; - addr += PAGE_SIZE; - } + if(!check_region(vaddr, len)) + request_region(vaddr, len, name); - return (void *) (base_address | offset); + return (void *) vaddr; } void sparc_free_io (void *virtual, int len) { unsigned long vaddr = (unsigned long) virtual & PAGE_MASK; - unsigned long plen = (((unsigned long)virtual & ~PAGE_MASK) + len + PAGE_SIZE-1) & PAGE_MASK; - + unsigned long plen = (((unsigned long)virtual & ~PAGE_MASK) + + len + PAGE_SIZE-1) & PAGE_MASK; release_region(vaddr, plen); - - if (((unsigned long)virtual) >= PAGE_OFFSET + 0x10000000000UL) - return; - - for (; plen != 0;) { - plen -= PAGE_SIZE; - unmapioaddr(vaddr + plen); - } } /* Does DVMA allocations with PAGE_SIZE granularity. How this basically diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/irq.c linux/arch/sparc64/kernel/irq.c --- v2.1.114/linux/arch/sparc64/kernel/irq.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/irq.c Tue Aug 4 16:03:35 1998 @@ -1,8 +1,9 @@ -/* $Id: irq.c,v 1.53 1998/04/20 07:14:58 ecd Exp $ +/* $Id: irq.c,v 1.61 1998/08/02 14:51:38 ecd Exp $ * irq.c: UltraSparc IRQ handling/init/registry. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) + * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ #include @@ -54,35 +55,6 @@ unsigned long ivector_to_mask[NUM_IVECS]; -struct ino_bucket { - struct ino_bucket *next; - unsigned int ino; - unsigned int *imap; - unsigned int *iclr; - unsigned char *imap_refcnt; -}; - -#define INO_HASHSZ (NUM_HARD_IVECS >> 2) -#define NUM_INO_STATIC 4 -static struct ino_bucket *ino_hash[INO_HASHSZ] = { NULL, }; -static struct ino_bucket static_ino_buckets[NUM_INO_STATIC]; -static int static_ino_bucket_count = 0; - -static inline struct ino_bucket *__ino_lookup(unsigned int hash, unsigned int ino) -{ - struct ino_bucket *ret = ino_hash[hash]; - - for(ret = ino_hash[hash]; ret && ret->ino != ino; ret = ret->next) - ; - - return ret; -} - -static inline struct ino_bucket *ino_lookup(unsigned int ino) -{ - return __ino_lookup((ino & (INO_HASHSZ - 1)), ino); -} - /* This is based upon code in the 32-bit Sparc kernel written mostly by * David Redman (djhr@tadpole.co.uk). */ @@ -96,6 +68,24 @@ NULL, NULL, NULL, NULL, NULL, NULL , NULL, NULL }; +#define IBF_DMA_SYNC 0x01 +#define IBF_PCI 0x02 +#define IBF_ACTIVE 0x04 + +#define __imap(bucket) ((bucket)->iclr + (bucket)->imap_off) +#define __bucket(irq) ((struct ino_bucket *)(unsigned long)(irq)) +#define __irq(bucket) ((unsigned int)(unsigned long)(bucket)) + +static struct ino_bucket *bucket_base, *buckets, *endbuckets; + +__initfunc(unsigned long irq_init(unsigned long start_mem, unsigned long end_mem)) +{ + start_mem = (start_mem + 15) & ~15; + bucket_base = buckets = (struct ino_bucket *)start_mem; + endbuckets = buckets + 2048; + return (unsigned long)endbuckets; +} + int get_irq_list(char *buf) { int i, len = 0; @@ -188,22 +178,6 @@ #define NUM_SYSIO_OFFSETS (sizeof(sysio_irq_offsets) / sizeof(sysio_irq_offsets[0])) -/* XXX Old compatability cruft, get rid of me when all drivers have been - * XXX converted to dcookie registry calls... -DaveM - */ -static unsigned int *sysio_irq_to_imap(unsigned int irq) -{ - unsigned long offset; - struct sysio_regs *sregs; - - if((irq >= NUM_SYSIO_OFFSETS) || - ((offset = sysio_irq_offsets[irq]) == ((unsigned long)-1))) - return NULL; - sregs = SBus_chain->iommu->sysio_regs; - offset += ((unsigned long) sregs); - return ((unsigned int *)offset); -} - /* Convert Interrupt Mapping register pointer to assosciated * Interrupt Clear register pointer, SYSIO specific version. */ @@ -220,10 +194,10 @@ #ifdef CONFIG_PCI /* PCI PSYCHO INO number to Sparc PIL level. */ unsigned char psycho_ino_to_pil[] = { - 7, 5, 5, 2, /* PCI A slot 0 Int A, B, C, D */ - 7, 5, 5, 2, /* PCI A slot 1 Int A, B, C, D */ - 7, 5, 5, 2, /* PCI A slot 2 Int A, B, C, D */ - 7, 5, 5, 2, /* PCI A slot 3 Int A, B, C, D */ + 7, 5, 4, 2, /* PCI A slot 0 Int A, B, C, D */ + 7, 5, 4, 2, /* PCI A slot 1 Int A, B, C, D */ + 7, 5, 4, 2, /* PCI A slot 2 Int A, B, C, D */ + 7, 5, 4, 2, /* PCI A slot 3 Int A, B, C, D */ 6, 4, 3, 1, /* PCI B slot 0 Int A, B, C, D */ 6, 4, 3, 1, /* PCI B slot 1 Int A, B, C, D */ 6, 4, 3, 1, /* PCI B slot 2 Int A, B, C, D */ @@ -264,21 +238,14 @@ #endif /* Now these are always passed a true fully specified sun4u INO. */ -void enable_irq(unsigned int ino) +void enable_irq(unsigned int irq) { - struct ino_bucket *bucket; + struct ino_bucket *bucket = __bucket(irq); unsigned long tid; unsigned int *imap; -#ifdef CONFIG_PCI - if(PCI_IRQ_P(ino)) - ino &= (PCI_IRQ_IGN | PCI_IRQ_INO); -#endif - bucket = ino_lookup(ino); - if(!bucket) - return; - - imap = bucket->imap; + imap = __imap(bucket); + if (!imap) return; /* We send it to our UPA MID, for SMP this will be different. */ __asm__ __volatile__("ldxa [%%g0] %1, %0" : "=r" (tid) : "i" (ASI_UPA_CONFIG)); @@ -290,26 +257,19 @@ * However for Graphics and UPA Slave devices the full * SYSIO_IMAP_INR field can be set by the programmer here. * - * Things like FFB can now be handled via the dcookie mechanism. + * Things like FFB can now be handled via the new IRQ mechanism. */ *imap = SYSIO_IMAP_VALID | (tid & SYSIO_IMAP_TID); } /* This now gets passed true ino's as well. */ -void disable_irq(unsigned int ino) +void disable_irq(unsigned int irq) { - struct ino_bucket *bucket; + struct ino_bucket *bucket = __bucket(irq); unsigned int *imap; -#ifdef CONFIG_PCI - if(PCI_IRQ_P(ino)) - ino &= (PCI_IRQ_IGN | PCI_IRQ_INO); -#endif - bucket = ino_lookup(ino); - if(!bucket) - return; - - imap = bucket->imap; + imap = __imap(bucket); + if (!imap) return; /* NOTE: We do not want to futz with the IRQ clear registers * and move the state to IDLE, the SCSI code does call @@ -319,267 +279,156 @@ *imap &= ~(SYSIO_IMAP_VALID); } -static void get_irq_translations(int *cpu_irq, int *ivindex_fixup, - unsigned int **imap, unsigned int **iclr, - void *busp, unsigned long flags, - unsigned int irq) +unsigned int build_irq(int pil, int inofixup, unsigned int *iclr, unsigned int *imap) { - if(*cpu_irq != -1 && *imap != NULL && *iclr != NULL) - return; - - if(*cpu_irq != -1 || *imap != NULL || *iclr != NULL || busp == NULL) { - printk("get_irq_translations: Partial specification, this is bad.\n"); - printk("get_irq_translations: cpu_irq[%d] imap[%p] iclr[%p] busp[%p]\n", - *cpu_irq, *imap, *iclr, busp); - panic("Bad IRQ translations..."); - } - - if(SA_BUS(flags) == SA_SBUS) { - struct linux_sbus *sbusp = busp; - struct sysio_regs *sregs = sbusp->iommu->sysio_regs; - unsigned long offset; - - *cpu_irq = sysio_ino_to_pil[irq]; - if(*cpu_irq == 0) { - printk("get_irq_translations: Bad SYSIO INO[%x]\n", irq); - panic("Bad SYSIO IRQ translations..."); - } - offset = sysio_irq_offsets[irq]; - if(offset == ((unsigned long)-1)) { - printk("get_irq_translations: Bad SYSIO INO[%x] cpu[%d]\n", - irq, *cpu_irq); - panic("BAD SYSIO IRQ offset..."); - } - offset += ((unsigned long)sregs); - *imap = ((unsigned int *)offset); - - /* SYSIO inconsistancy. For external SLOTS, we have to select - * the right ICLR register based upon the lower SBUS irq level - * bits. - */ - if(irq >= 0x20) { - *iclr = sysio_imap_to_iclr(*imap); - } else { - unsigned long iclraddr; - int sbus_slot = (irq & 0x18)>>3; - int sbus_level = irq & 0x7; - - switch(sbus_slot) { - case 0: - *iclr = &sregs->iclr_slot0; - break; - case 1: - *iclr = &sregs->iclr_slot1; - break; - case 2: - *iclr = &sregs->iclr_slot2; - break; - case 3: - *iclr = &sregs->iclr_slot3; - break; - }; + if (buckets == endbuckets) + panic("Out of IRQ buckets. Should not happen.\n"); + buckets->pil = pil; + if (pil && (!iclr || !imap)) { + prom_printf("Invalid build_irq %d %d %016lx %016lx\n", pil, inofixup, iclr, imap); + prom_halt(); + } + if (imap) + buckets->ino = (*imap & (SYSIO_IMAP_IGN | SYSIO_IMAP_INO)) + inofixup; + else + buckets->ino = 0; + + buckets->iclr = iclr; + buckets->flags = 0; + buckets->imap_off = imap - iclr; + return __irq(buckets++); +} - iclraddr = (unsigned long) *iclr; - iclraddr += ((sbus_level - 1) * 8); - *iclr = (unsigned int *) iclraddr; - -#if 0 /* DEBUGGING */ - printk("SYSIO_FIXUP: slot[%x] level[%x] iclr[%p] ", - sbus_slot, sbus_level, *iclr); -#endif +unsigned int sbus_build_irq(void *buscookie, unsigned int ino) +{ + struct linux_sbus *sbus = (struct linux_sbus *)buscookie; + struct sysio_regs *sregs = sbus->iommu->sysio_regs; + unsigned long offset; + int pil; + unsigned int *imap, *iclr; + int sbus_level = 0; - /* Also, make sure this is accounted for in ivindex - * computations done by the caller. - */ - *ivindex_fixup = sbus_level; - } - return; - } -#ifdef CONFIG_PCI - if(SA_BUS(flags) == SA_PCI) { - struct pci_bus *pbusp = busp; - struct linux_pbm_info *pbm = pbusp->sysdata; - struct psycho_regs *pregs = pbm->parent->psycho_regs; - unsigned long offset; - - *cpu_irq = psycho_ino_to_pil[irq & 0x3f]; - if(*cpu_irq == 0) { - printk("get_irq_translations: Bad PSYCHO INO[%x]\n", irq); - panic("Bad PSYCHO IRQ translations..."); - } - offset = psycho_imap_offset(irq); - if(offset == ((unsigned long)-1)) { - printk("get_irq_translations: Bad PSYCHO INO[%x] cpu[%d]\n", - irq, *cpu_irq); - panic("Bad PSYCHO IRQ offset..."); - } - offset += ((unsigned long)pregs); - *imap = ((unsigned int *)offset) + 1; - *iclr = (unsigned int *) - (((unsigned long)pregs) + psycho_iclr_offset(irq)); - return; - } -#endif -#if 0 /* XXX More to do before we can use this. -DaveM */ - if(SA_BUS(flags) == SA_FHC) { - struct fhc_bus *fbusp = busp; - struct fhc_regs *fregs = fbusp->regs; - unsigned long offset; - - *cpu_irq = fhc_ino_to_pil[irq]; - if(*cpu_irq == 0) { - printk("get_irq_translations: Bad FHC INO[%x]\n", irq); - panic("Bad FHC IRQ translations..."); - } - offset = fhc_irq_offset[*cpu_irq]; - if(offset == ((unsigned long)-1)) { - printk("get_irq_translations: Bad FHC INO[%x] cpu[%d]\n", - irq, *cpu_irq); - panic("Bad FHC IRQ offset..."); - } - offset += ((unsigned long)pregs); - *imap = (((unsigned int *)offset)+1); - *iclr = fhc_imap_to_iclr(*imap); - return; + pil = sysio_ino_to_pil[ino]; + if(!pil) { + printk("sbus_irq_build: Bad SYSIO INO[%x]\n", ino); + panic("Bad SYSIO IRQ translations..."); + } + offset = sysio_irq_offsets[ino]; + if(offset == ((unsigned long)-1)) { + printk("get_irq_translations: Bad SYSIO INO[%x] cpu[%d]\n", + ino, pil); + panic("BAD SYSIO IRQ offset..."); + } + offset += ((unsigned long)sregs); + imap = ((unsigned int *)offset); + + /* SYSIO inconsistancy. For external SLOTS, we have to select + * the right ICLR register based upon the lower SBUS irq level + * bits. + */ + if(ino >= 0x20) { + iclr = sysio_imap_to_iclr(imap); + } else { + unsigned long iclraddr; + int sbus_slot = (ino & 0x18)>>3; + + sbus_level = ino & 0x7; + + switch(sbus_slot) { + case 0: + iclr = &sregs->iclr_slot0; + break; + case 1: + iclr = &sregs->iclr_slot1; + break; + case 2: + iclr = &sregs->iclr_slot2; + break; + default: + case 3: + iclr = &sregs->iclr_slot3; + break; + }; + + iclraddr = (unsigned long) iclr; + iclraddr += ((sbus_level - 1) * 8); + iclr = (unsigned int *) iclraddr; } -#endif - printk("get_irq_translations: IRQ register for unknown bus type.\n"); - printk("get_irq_translations: BUS[%lx] IRQ[%x]\n", - SA_BUS(flags), irq); - panic("Bad IRQ bus type..."); + return build_irq(pil, sbus_level, iclr, imap); } #ifdef CONFIG_PCI -static void pci_irq_frobnicate(int *cpu_irq, int *ivindex_fixup, - unsigned int **imap, unsigned int **iclr, - unsigned int irq) -{ - struct linux_psycho *psycho; - struct psycho_regs *pregs; - unsigned long addr, imoff; - - psycho = psycho_by_index((irq & PCI_IRQ_BUSNO) >> PCI_IRQ_BUSNO_SHFT); - if (!psycho) { - printk("get_irq_translations: BAD PSYCHO BUSNO[%x]\n", irq); - panic("Bad PSYCHO IRQ frobnication..."); - } - pregs = psycho->psycho_regs; +unsigned int psycho_build_irq(void *buscookie, int imap_off, int ino, int need_dma_sync) +{ + struct linux_psycho *psycho = (struct linux_psycho *)buscookie; + struct psycho_regs *pregs = psycho->psycho_regs; + unsigned long addr; + struct ino_bucket *bucket; + int pil; + unsigned int *imap, *iclr; + int inofixup = 0; + pil = psycho_ino_to_pil[ino & PCI_IRQ_INO]; + addr = (unsigned long) &pregs->imap_a_slot0; - imoff = (irq & PCI_IRQ_IMAP_OFF) >> PCI_IRQ_IMAP_OFF_SHFT; - addr = addr + imoff; - - *imap = ((unsigned int *)addr) + 1; + addr = addr + imap_off; + imap = ((unsigned int *)addr) + 1; addr = (unsigned long) pregs; - addr += psycho_iclr_offset(irq & (PCI_IRQ_INO)); - *iclr = ((unsigned int *)addr) + 1; + addr += psycho_iclr_offset(ino & (PCI_IRQ_INO)); + iclr = ((unsigned int *)addr) + 1; - *cpu_irq = psycho_ino_to_pil[irq & (PCI_IRQ_INO)]; - if(*cpu_irq == 0) { - printk("get_irq_translations: BAD PSYCHO INO[%x]\n", irq); - panic("Bad PSYCHO IRQ frobnication..."); - } + if(!(ino & 0x20)) + inofixup = ino & 0x03; - /* IVINDEX fixup only needed for PCI slot irq lines. */ - if(!(irq & 0x20)) - *ivindex_fixup = irq & 0x03; + bucket = __bucket(build_irq(pil, inofixup, iclr, imap)); + + if (need_dma_sync) + bucket->flags |= IBF_DMA_SYNC; + + bucket->flags |= IBF_PCI; + return __irq(bucket); } #endif -/* Once added, they are never removed. */ -static struct ino_bucket *add_ino_hash(unsigned int ivindex, - unsigned int *imap, unsigned int *iclr, - unsigned long flags) -{ - struct ino_bucket *new = NULL, **hashp; - unsigned int hash = (ivindex & (INO_HASHSZ - 1)); - - new = __ino_lookup(hash, ivindex); - if(new) - return new; - if(flags & SA_STATIC_ALLOC) { - if(static_ino_bucket_count < NUM_INO_STATIC) - new = &static_ino_buckets[static_ino_bucket_count++]; - else - printk("Request for ino bucket SA_STATIC_ALLOC failed " - "using kmalloc\n"); - } - if(new == NULL) - new = kmalloc(sizeof(struct ino_bucket), GFP_KERNEL); - if(new) { - hashp = &ino_hash[hash]; - new->imap = imap; - new->iclr = iclr; - new->ino = ivindex; - new->next = *hashp; - *hashp = new; - } - return new; -} - int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long irqflags, const char *name, void *dev_id) { struct irqaction *action, *tmp = NULL; - struct devid_cookie *dcookie = NULL; - struct ino_bucket *bucket = NULL; + struct ino_bucket *bucket = __bucket(irq); unsigned long flags; - unsigned int *imap, *iclr; - void *bus_id = NULL; - int ivindex = -1, ivindex_fixup, cpu_irq = -1, pending = 0; + int pending = 0; + + if (irq < 0x400000 || (irq & 0x80000000)) { + prom_printf("request_irq with old style irq %08x %016lx\n", irq, handler); + prom_halt(); + } if(!handler) return -EINVAL; - imap = iclr = NULL; - - ivindex_fixup = 0; - - if (irq == 0) { - cpu_irq = irq; - irqflags &= ~(SA_IMAP_MASKED); - } else { + if (!bucket->pil) + irqflags &= ~SA_IMAP_MASKED; + else { irqflags |= SA_IMAP_MASKED; -#ifdef CONFIG_PCI - if(PCI_IRQ_P(irq)) { - pci_irq_frobnicate(&cpu_irq, &ivindex_fixup, &imap, &iclr, irq); - if (irq & PCI_IRQ_DMA_SYNC) - irqflags |= SA_DMA_SYNC; - } else -#endif - if(irqflags & SA_DCOOKIE) { - if(!dev_id) { - printk("request_irq: SA_DCOOKIE but dev_id is NULL!\n"); - panic("Bogus irq registry."); - } - dcookie = dev_id; - dev_id = dcookie->real_dev_id; - cpu_irq = dcookie->pil; - imap = dcookie->imap; - iclr = dcookie->iclr; - bus_id = dcookie->bus_cookie; - get_irq_translations(&cpu_irq, &ivindex_fixup, &imap, - &iclr, bus_id, irqflags, irq); - } else { - /* XXX NOTE: This code is maintained for compatability until I can - * XXX verify that all drivers sparc64 will use are updated - * XXX to use the new IRQ registry dcookie interface. -DaveM + if (bucket->flags & IBF_PCI) { + /* + * PCI IRQs should never use SA_INTERRUPT. */ - cpu_irq = sysio_ino_to_pil[irq]; - imap = sysio_irq_to_imap(irq); - if(!imap) { - printk("request_irq: BAD, null imap for old style " - "irq registry IRQ[%x].\n", irq); - panic("Bad IRQ registery..."); - } - iclr = sysio_imap_to_iclr(imap); + irqflags &= ~(SA_INTERRUPT); + + /* + * Check wether we _should_ use DMA Write Sync + * (for devices behind bridges behind APB). + * + * XXX: Not implemented, yet. + */ + if (bucket->flags & IBF_DMA_SYNC) + irqflags |= SA_DMA_SYNC; } - ivindex = (*imap & (SYSIO_IMAP_IGN | SYSIO_IMAP_INO)); - ivindex += ivindex_fixup; } - action = *(cpu_irq + irq_action); + action = *(bucket->pil + irq_action); if(action) { if((action->flags & SA_SHIRQ) && (irqflags & SA_SHIRQ)) for (tmp = action; tmp->next; tmp = tmp->next) @@ -589,7 +438,7 @@ if((action->flags & SA_INTERRUPT) ^ (irqflags & SA_INTERRUPT)) { printk("Attempt to mix fast and slow interrupts on IRQ%d " - "denied\n", irq); + "denied\n", bucket->pil); return -EBUSY; } action = NULL; /* Or else! */ @@ -617,22 +466,11 @@ } if (irqflags & SA_IMAP_MASKED) { - bucket = add_ino_hash(ivindex, imap, iclr, irqflags); - if(!bucket) { - kfree(action); - restore_flags(flags); - return -ENOMEM; - } - - pending = ((ivector_to_mask[ivindex] & 0x80000000) != 0); - ivector_to_mask[ivindex] = (1 << cpu_irq); + pending = ((ivector_to_mask[bucket->ino] & 0x80000000) != 0); + ivector_to_mask[bucket->ino] = (1 << bucket->pil); if(pending) - ivector_to_mask[ivindex] |= 0x80000000; - - if(dcookie) { - dcookie->ret_ino = ivindex; - dcookie->ret_pil = cpu_irq; - } + ivector_to_mask[bucket->ino] |= 0x80000000; + bucket->flags |= IBF_ACTIVE; } action->mask = (unsigned long) bucket; @@ -645,13 +483,13 @@ if(tmp) tmp->next = action; else - *(cpu_irq + irq_action) = action; + *(bucket->pil + irq_action) = action; - enable_irq(ivindex); + enable_irq(irq); /* We ate the IVEC already, this makes sure it does not get lost. */ if(pending) - set_softint(1 << cpu_irq); + set_softint(1 << bucket->pil); restore_flags(flags); #ifdef __SMP__ @@ -666,23 +504,16 @@ struct irqaction *action; struct irqaction *tmp = NULL; unsigned long flags; - unsigned int *imap = NULL; - unsigned int cpu_irq; - int ivindex = -1; + struct ino_bucket *bucket = __bucket(irq), *bp; - if(irq == 0) { - cpu_irq = irq; - } else { -#ifdef CONFIG_PCI - if(PCI_IRQ_P(irq)) - cpu_irq = psycho_ino_to_pil[irq & PCI_IRQ_INO]; - else -#endif - cpu_irq = sysio_ino_to_pil[irq]; + if (irq < 0x400000 || (irq & 0x80000000)) { + prom_printf("free_irq with old style irq %08x\n", irq); + prom_halt(); } - action = *(cpu_irq + irq_action); + + action = *(bucket->pil + irq_action); if(!action->handler) { - printk("Freeing free IRQ %d\n", irq); + printk("Freeing free IRQ %d\n", bucket->pil); return; } if(dev_id) { @@ -692,17 +523,17 @@ tmp = action; } if(!action) { - printk("Trying to free free shared IRQ %d\n", irq); + printk("Trying to free free shared IRQ %d\n", bucket->pil); return; } } else if(action->flags & SA_SHIRQ) { - printk("Trying to free shared IRQ %d with NULL device ID\n", irq); + printk("Trying to free shared IRQ %d with NULL device ID\n", bucket->pil); return; } if(action->flags & SA_STATIC_ALLOC) { printk("Attempt to free statically allocated IRQ %d (%s)\n", - irq, action->name); + bucket->pil, action->name); return; } @@ -710,43 +541,35 @@ if(action && tmp) tmp->next = action->next; else - *(cpu_irq + irq_action) = action->next; + *(bucket->pil + irq_action) = action->next; if(action->flags & SA_IMAP_MASKED) { - struct ino_bucket *bucket = (struct ino_bucket *)action->mask; + unsigned int *imap = __imap(bucket); - imap = bucket->imap; - if(imap != NULL) { - ivindex = bucket->ino; - ivector_to_mask[ivindex] = 0; - } - else - printk("free_irq: WHeee, SYSIO_MASKED yet no imap reg.\n"); - } - - kfree(action); - - if(ivindex != -1) { - struct ino_bucket *bp; - int i, count = 0; - - /* The trick is that we can't turn the thing off when there - * are potentially other sub-irq level references. + /* + * Only free when no other shared irq uses this bucket. */ - if(imap != NULL) { - for(i = 0; i < INO_HASHSZ; i++) { - bp = ino_hash[i]; - while(bp) { - if(bp->imap == imap) - count++; - bp = bp->next; - } - } - } - if(count < 2) - disable_irq(ivindex); + tmp = *(bucket->pil + irq_action); + for( ; tmp; tmp = tmp->next) + if ((struct ino_bucket *)tmp->mask == bucket) + goto out; + + ivector_to_mask[bucket->ino] = 0; + + bucket->flags &= ~IBF_ACTIVE; + for (bp = bucket_base; bp < endbuckets; bp++) + if (__imap(bp) == imap && (bp->flags & IBF_ACTIVE)) + break; + /* + * Only disable when no other sub-irq levels of + * the same imap are active. + */ + if (bp == endbuckets) + disable_irq(irq); } +out: + kfree(action); restore_flags(flags); } @@ -982,7 +805,7 @@ if(!(ivector_to_mask[bucket->ino] & 0x80000000)) continue; } - act->handler(irq, act->dev_id, regs); + act->handler(__irq(bucket), act->dev_id, regs); } while((act = act->next) != NULL); act = action; do { @@ -1047,61 +870,23 @@ unsigned long irqflags, const char *name, void *dev_id) { struct irqaction *action; - struct devid_cookie *dcookie = NULL; - struct ino_bucket *bucket = NULL; + struct ino_bucket *bucket = __bucket(irq); unsigned long flags; - unsigned int *imap, *iclr; - void *bus_id = NULL; - int ivindex = -1, ivindex_fixup, cpu_irq = -1; + if (irq < 0x400000 || (irq & 0x80000000)) { + prom_printf("request_irq with old style irq %08x %016lx\n", irq, handler); + prom_halt(); + } + if(!handler) return -EINVAL; - imap = iclr = NULL; - ivindex_fixup = 0; - - if ((irq == 0) || (irq == 14)) { + if ((bucket->pil == 0) || (bucket->pil == 14)) { printk("request_fast_irq: Trying to register shared IRQ 0 or 14.\n"); return -EBUSY; } -#ifdef CONFIG_PCI - if(PCI_IRQ_P(irq)) { - pci_irq_frobnicate(&cpu_irq, &ivindex_fixup, &imap, &iclr, irq); - } else -#endif - if(irqflags & SA_DCOOKIE) { - if(!dev_id) { - printk("request_fast_irq: SA_DCOOKIE but dev_id is NULL!\n"); - panic("Bogus irq registry."); - } - dcookie = dev_id; - dev_id = dcookie->real_dev_id; - cpu_irq = dcookie->pil; - imap = dcookie->imap; - iclr = dcookie->iclr; - bus_id = dcookie->bus_cookie; - get_irq_translations(&cpu_irq, &ivindex_fixup, &imap, - &iclr, bus_id, irqflags, irq); - } else { - /* XXX NOTE: This code is maintained for compatability until I can - * XXX verify that all drivers sparc64 will use are updated - * XXX to use the new IRQ registry dcookie interface. -DaveM - */ - cpu_irq = sysio_ino_to_pil[irq]; - imap = sysio_irq_to_imap(irq); - if(!imap) { - printk("request_irq: BAD, null imap for old style " - "irq registry IRQ[%x].\n", irq); - panic("Bad IRQ registery..."); - } - iclr = sysio_imap_to_iclr(imap); - } - - ivindex = (*imap & (SYSIO_IMAP_IGN | SYSIO_IMAP_INO)); - ivindex += ivindex_fixup; - - action = *(cpu_irq + irq_action); + action = *(bucket->pil + irq_action); if(action) { if(action->flags & SA_SHIRQ) panic("Trying to register fast irq when already shared.\n"); @@ -1116,7 +901,7 @@ action = &static_irqaction[static_irq_count++]; else printk("Request for IRQ%d (%s) SA_STATIC_ALLOC failed " - "using kmalloc\n", irq, name); + "using kmalloc\n", bucket->pil, name); } if(action == NULL) action = (struct irqaction *)kmalloc(sizeof(struct irqaction), @@ -1125,21 +910,9 @@ restore_flags(flags); return -ENOMEM; } - install_fast_irq(cpu_irq, handler); - - bucket = add_ino_hash(ivindex, imap, iclr, irqflags); - if(!bucket) { - kfree(action); - restore_flags(flags); - return -ENOMEM; - } + install_fast_irq(bucket->pil, handler); - ivector_to_mask[ivindex] = (1 << cpu_irq); - - if(dcookie) { - dcookie->ret_ino = ivindex; - dcookie->ret_pil = cpu_irq; - } + ivector_to_mask[bucket->ino] = (1 << bucket->pil); action->mask = (unsigned long) bucket; action->handler = handler; @@ -1148,8 +921,8 @@ action->name = name; action->next = NULL; - *(cpu_irq + irq_action) = action; - enable_irq(ivindex); + *(bucket->pil + irq_action) = action; + enable_irq(irq); restore_flags(flags); #ifdef __SMP__ @@ -1177,15 +950,21 @@ unsigned long *clock) { unsigned long flags; - unsigned long timer_tick_offset; + extern unsigned long timer_tick_offset; int node, err; +#ifdef __SMP__ + extern void smp_tick_init(void); +#endif node = linux_cpus[0].prom_node; *clock = prom_getint(node, "clock-frequency"); timer_tick_offset = *clock / HZ; +#ifdef __SMP__ + smp_tick_init(); +#endif /* Register IRQ handler. */ - err = request_irq(0, cfunc, (SA_INTERRUPT | SA_STATIC_ALLOC), + err = request_irq(build_irq(0, 0, NULL, NULL), cfunc, (SA_INTERRUPT | SA_STATIC_ALLOC), "timer", NULL); if(err) { @@ -1239,7 +1018,7 @@ while(p) { if(p->flags & SA_IMAP_MASKED) { struct ino_bucket *bucket = (struct ino_bucket *)p->mask; - unsigned int *imap = bucket->imap; + unsigned int *imap = __imap(bucket); unsigned int val; unsigned long tid = __cpu_logical_map[cpu] << 9; diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/itlb_base.S linux/arch/sparc64/kernel/itlb_base.S --- v2.1.114/linux/arch/sparc64/kernel/itlb_base.S Wed Dec 31 16:00:00 1969 +++ linux/arch/sparc64/kernel/itlb_base.S Tue Aug 4 16:03:35 1998 @@ -0,0 +1,69 @@ +/* $Id: itlb_base.S,v 1.5 1998/06/15 16:59:32 jj Exp $ + * itlb_base.S: Front end to ITLB miss replacement strategy. + * This is included directly into the trap table. + * + * Copyright (C) 1996,1998 David S. Miller (davem@dm.cobaltmicro.com) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) + */ + +#define TAG_CONTEXT_BITS 0x3ff +#define VPTE_SHIFT (PAGE_SHIFT - 3) + +/* Ways we can get here: + * + * 1) Nucleus instruction misses from module code. + * 2) All user instruction misses. + * + * All real page faults merge their code paths to the + * sparc64_realfault_* labels below. + */ + + .globl sparc64_vpte_patchme + +/* ITLB ** ICACHE line 1: Quick user TLB misses */ + ldxa [%g1 + %g1] ASI_IMMU, %g4 ! Get TAG_ACCESS + srax %g4, VPTE_SHIFT, %g6 ! Create VPTE offset + ldxa [%g3 + %g6] ASI_P, %g5 ! Load VPTE +1: brgez,pn %g5, 3f ! Not valid, branch out + and %g5, (_PAGE_PRESENT|_PAGE_READ), %g4 ! Mask readable bits +2: stxa %g5, [%g0] ASI_ITLB_DATA_IN ! Load PTE into TLB + retry ! Trap return +3: cmp %g4, (_PAGE_PRESENT|_PAGE_READ) ! Readable page? + +/* ITLB ** ICACHE line 2: Quick user ref updates */ + bne,pn %xcc, 4f ! Nope, real missing page + sllx %g1, 60, %g4 ! Sliiickkk... + or %g5, _PAGE_ACCESSED, %g5 ! Mark as touched + or %g5, %g4, %g5 ! Allow user to see it + ba,pt %xcc, 2b ! Branch to load TLB + stxa %g5, [%g3 + %g6] ASI_S ! Update PTE table +4: rdpr %pstate, %g4 ! Move into alternate globals + wrpr %g4, PSTATE_AG|PSTATE_MG, %pstate + +/* ITLB ** ICACHE line 3: Real faults */ + rdpr %tpc, %g5 ! And load faulting VA +sparc64_realfault_common: ! Called by TL0 dtlb_miss too + sethi %hi(1f), %g7 ! Save state + ba,pt %xcc, etrap ! ... +1: or %g7, %lo(1b), %g7 ! ... + clr %o2 ! It was read +sparc64_realfault_continue: ! Called by dtlb_prot handler + srlx %l5, PAGE_SHIFT, %o1 ! Page align faulting VA + add %sp, STACK_BIAS + REGWIN_SZ, %o0! Compute pt_regs arg + call do_sparc64_fault ! Call fault handler + +/* ITLB ** ICACHE line 4: Call fault processing code */ + sllx %o1, PAGE_SHIFT, %o1 ! Finish page alignment + ba,a,pt %xcc, rtrap_clr_l6 ! Restore cpu state +winfix_trampoline: + rdpr %tpc, %g3 ! Prepare winfixup TNPC + or %g3, 0x7c, %g3 ! Compute offset to branch + wrpr %g3, %tnpc ! Write it into TNPC + done ! Do it to it +sparc64_vpte_nucleus: + ba,pt %xcc, sparc64_vpte_continue ! Part of dtlb_backend +sparc64_vpte_patchme: + sethi %hi(0), %g5 ! This has to be patched + +#undef TAG_CONTEXT_BITS +#undef VPTE_SHIFT diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/itlb_miss.S linux/arch/sparc64/kernel/itlb_miss.S --- v2.1.114/linux/arch/sparc64/kernel/itlb_miss.S Thu Apr 23 20:21:31 1998 +++ linux/arch/sparc64/kernel/itlb_miss.S Wed Dec 31 16:00:00 1969 @@ -1,49 +0,0 @@ -/* $Id: itlb_miss.S,v 1.12 1998/01/14 17:14:47 jj Exp $ - * itlb_miss.S: Instruction TLB miss code, this is included directly - * into the trap table. - * - * Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -/* Gratuitous comment. */ - - /* ICACHE line 1 */ - /*0x00*/ ldxa [%g0] ASI_IMMU, %g1 ! Get TAG_TARGET - /*0x04*/ srlx %g1, 10, %g3 ! Position PGD offset - /*0x08*/ andcc %g1, %g2, %g0 ! Test CONTEXT bits - /*0x0c*/ and %g3, 0xffc, %g3 ! Mask PGD offset - /*0x10*/ and %g1, 0xffe, %g4 ! Mask PMD offset - /*0x14*/ ldxa [%g0] ASI_IMMU_TSB_8KB_PTR, %g1 ! For PTE offset - /*0x18*/ be,pn %xcc, 3f ! Context 0 == kernel - /*0x1c*/ add %g4, %g4, %g4 ! Position PMD offset - - /* ICACHE line 2 */ - /*0x20*/ lduwa [%g7 + %g3] ASI_PHYS_USE_EC, %g5 ! Load user PGD - /*0x24*/ srlx %g1, 1, %g1 ! PTE offset - /*0x28*/ lduwa [%g5 + %g4] ASI_PHYS_USE_EC, %g3 ! Load PMD - /*0x2c*/ ldxa [%g3 + %g1] ASI_PHYS_USE_EC, %g5 ! Load PTE - /*0x30*/ brgez,pn %g5, sparc64_itlb_refbit_catch ! Valid set? - /*0x34*/ nop ! delay - /*0x38*/ stxa %g5, [%g0] ASI_ITLB_DATA_IN ! TLB load - /*0x3c*/ retry ! Trap return - -3: /* ICACHE line 3 */ - /*0x40*/ lduwa [%g6 + %g3] ASI_PHYS_USE_EC, %g5 ! Load kern PGD - /*0x44*/ srlx %g1, 1, %g1 ! PTE offset - /*0x48*/ lduwa [%g5 + %g4] ASI_PHYS_USE_EC, %g3 ! Load PMD - /*0x4c*/ ldxa [%g3 + %g1] ASI_PHYS_USE_EC, %g5 ! Load PTE - /*0x50*/ brgez,pn %g5, sparc64_itlb_refbit_catch ! Valid set? - /*0x54*/ nop ! delay - /*0x58*/ stxa %g5, [%g0] ASI_ITLB_DATA_IN ! TLB load - /*0x5c*/ retry ! Trap return - - /* ICACHE line 4 */ - /*0x60*/ nop - /*0x64*/ nop - /*0x68*/ nop - /*0x6c*/ nop - /*0x70*/ nop - /*0x74*/ nop - /*0x78*/ nop - /*0x7c*/ 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 22:55:15 1998 @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.54 1998/04/28 08:23:28 davem Exp $ +/* $Id: process.c,v 1.70 1998/08/04 20:49:15 davem Exp $ * arch/sparc64/kernel/process.c * * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) @@ -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... ;) */ @@ -91,10 +52,10 @@ return -EPERM; /* endless idle loop with no priority at all */ - current->priority = -100; - current->counter = -100; + current->priority = 0; + current->counter = 0; for (;;) { - ultra_check_pgt_cache(); + check_pgt_cache(); run_task_queue(&tq_scheduler); schedule(); } @@ -108,17 +69,13 @@ */ asmlinkage int cpu_idle(void) { - current->priority = -100; + current->priority = 0; while(1) { check_pgt_cache(); - if(tq_scheduler) { - lock_kernel(); - run_task_queue(&tq_scheduler); - unlock_kernel(); - } + run_task_queue(&tq_scheduler); barrier(); - current->counter = -100; - if(need_resched) + current->counter = 0; + if(current->need_resched) schedule(); barrier(); } @@ -138,7 +95,7 @@ extern char reboot_command []; #ifdef CONFIG_SUN_CONSOLE -extern void console_restore_palette (void); +extern void (*prom_palette)(int); extern int serial_console; #endif @@ -148,8 +105,8 @@ mdelay(8); cli(); #ifdef CONFIG_SUN_CONSOLE - if (!serial_console) - console_restore_palette (); + if (!serial_console && prom_palette) + prom_palette (1); #endif prom_halt(); panic("Halt failed!"); @@ -166,8 +123,8 @@ p = strchr (reboot_command, '\n'); if (p) *p = 0; #ifdef CONFIG_SUN_CONSOLE - if (!serial_console) - console_restore_palette (); + if (!serial_console && prom_palette) + prom_palette (1); #endif if (cmd) prom_reboot(cmd); @@ -311,7 +268,7 @@ smp_processor_id(), local_irq_count, atomic_read(&global_irq_count)); #endif - printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x\n", regs->tstate, + printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x\n", regs->tstate, regs->tpc, regs->tnpc, regs->y); printk("g0: %016lx g1: %016lx g2: %016lx g3: %016lx\n", regs->u_regs[0], regs->u_regs[1], regs->u_regs[2], @@ -334,22 +291,22 @@ #ifdef VERBOSE_SHOWREGS static void idump_from_user (unsigned int *pc) { - int i; - int code; - - if((((unsigned long) pc) & 3)) - return; - - pc -= 3; - for(i = -3; i < 6; i++) { - get_user(code, pc); - printk("%c%08x%c",i?' ':'<',code,i?' ':'>'); - pc++; - } - printk("\n"); + int i; + int code; + + if((((unsigned long) pc) & 3)) + return; + + pc -= 3; + for(i = -3; i < 6; i++) { + get_user(code, pc); + printk("%c%08x%c",i?' ':'<',code,i?' ':'>'); + pc++; + } + printk("\n"); } #endif - + void show_regs(struct pt_regs *regs) { #ifdef VERBOSE_SHOWREGS @@ -378,7 +335,7 @@ void show_regs32(struct pt_regs32 *regs) { - printk("PSR: %08x PC: %08x NPC: %08x Y: %08x\n", regs->psr, + printk("PSR: %08x PC: %08x NPC: %08x Y: %08x\n", regs->psr, regs->pc, regs->npc, regs->y); printk("g0: %08x g1: %08x g2: %08x g3: %08x\n", regs->u_regs[0], regs->u_regs[1], regs->u_regs[2], @@ -405,7 +362,6 @@ printk("sig_address: 0x%016lx\n", tss->sig_address); printk("sig_desc: 0x%016lx\n", tss->sig_desc); printk("ksp: 0x%016lx\n", tss->ksp); - printk("kpc: 0x%08x\n", tss->kpc); if (tss->w_saved) { for (i = 0; i < NSWINS; i++) { @@ -417,10 +373,6 @@ printk("w_saved: 0x%04x\n", tss->w_saved); } - printk("sstk_info.stack: 0x%016lx\n", - (unsigned long)tss->sstk_info.the_stack); - printk("sstk_info.status: 0x%016lx\n", - (unsigned long)tss->sstk_info.cur_status); printk("flags: 0x%08x\n", tss->flags); printk("current_ds: 0x%016lx\n", tss->current_ds.seg); } @@ -439,13 +391,10 @@ void flush_thread(void) { current->tss.w_saved = 0; - current->tss.sstk_info.cur_status = 0; - current->tss.sstk_info.the_stack = 0; /* No new signal delivery by default. */ current->tss.new_signal = 0; - current->tss.flags &= ~(SPARC_FLAG_USEDFPU | SPARC_FLAG_USEDFPUL | - SPARC_FLAG_USEDFPUU); + current->tss.fpsaved[0] = 0; /* Now, this task is no longer a kernel thread. */ current->tss.current_ds = USER_DS; @@ -461,6 +410,8 @@ get_mmu_context(current); spin_unlock(&scheduler_lock); } + if (current->tss.flags & SPARC_FLAG_32BIT) + __asm__ __volatile__("stxa %%g0, [%0] %1" : : "r"(TSB_REG), "i"(ASI_DMMU)); current->tss.ctx = current->mm->context & 0x3ff; spitfire_set_secondary_context (current->tss.ctx); __asm__ __volatile__("flush %g6"); @@ -477,6 +428,13 @@ __get_user(fp, &(((struct reg_window *)psp)->ins[6])); } else __get_user(fp, &(((struct reg_window32 *)psp)->ins[6])); + + /* Now 8-byte align the stack as this is mandatory in the + * Sparc ABI due to how register windows work. This hides + * the restriction from thread libraries etc. -DaveM + */ + csp &= ~7UL; + distance = fp - psp; rval = (csp - distance); if(copy_in_user(rval, psp, distance)) @@ -576,38 +534,21 @@ * allocate the task_struct and kernel stack in * do_fork(). */ -#ifdef __SMP__ -extern void ret_from_smpfork(void); -#else -extern void ret_from_syscall(void); -#endif - int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, struct task_struct *p, struct pt_regs *regs) { - unsigned long stack_offset; char *child_trap_frame; - int tframe_size; /* Calculate offset to stack_frame & pt_regs */ - stack_offset = (((PAGE_SIZE << 1) - - ((sizeof(unsigned int)*64) + (2*sizeof(unsigned long)))) & - ~(64 - 1)) - (TRACEREG_SZ+REGWIN_SZ); - tframe_size = (TRACEREG_SZ + REGWIN_SZ) + - (sizeof(unsigned int) * 64) + (2 * sizeof(unsigned long)); - child_trap_frame = ((char *)p) + stack_offset; - memcpy(child_trap_frame, (((struct reg_window *)regs)-1), tframe_size); + child_trap_frame = ((char *)p) + ((PAGE_SIZE << 1) - (TRACEREG_SZ+REGWIN_SZ)); + memcpy(child_trap_frame, (((struct reg_window *)regs)-1), (TRACEREG_SZ+REGWIN_SZ)); p->tss.ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; -#ifdef __SMP__ - p->tss.kpc = ((unsigned int) ((unsigned long) ret_from_smpfork)) - 0x8; -#else - p->tss.kpc = ((unsigned int) ((unsigned long) ret_from_syscall)) - 0x8; -#endif p->tss.kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct reg_window)); p->tss.cwp = (regs->tstate + 1) & TSTATE_CWP; + p->tss.fpsaved[0] = 0; if(regs->tstate & TSTATE_PRIV) { p->tss.kregs->u_regs[UREG_FP] = p->tss.ksp; - p->tss.flags |= SPARC_FLAG_KTHREAD; + p->tss.flags |= (SPARC_FLAG_KTHREAD | SPARC_FLAG_NEWCHILD); p->tss.current_ds = KERNEL_DS; p->tss.ctx = 0; __asm__ __volatile__("flushw"); @@ -617,11 +558,12 @@ p->tss.kregs->u_regs[UREG_G6] = (unsigned long) p; } else { if(current->tss.flags & SPARC_FLAG_32BIT) { - sp &= 0x00000000ffffffff; - regs->u_regs[UREG_FP] &= 0x00000000ffffffff; + sp &= 0x00000000ffffffffUL; + regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; } p->tss.kregs->u_regs[UREG_FP] = sp; - p->tss.flags &= ~SPARC_FLAG_KTHREAD; + p->tss.flags = (p->tss.flags & ~SPARC_FLAG_KTHREAD) | + SPARC_FLAG_NEWCHILD; p->tss.current_ds = USER_DS; p->tss.ctx = (p->mm->context & 0x3ff); if (sp != regs->u_regs[UREG_FP]) { @@ -706,7 +648,8 @@ putname(filename); if(!error) { fprs_write(0); - regs->fprs = 0; + current->tss.xfsr[0] = 0; + current->tss.fpsaved[0] = 0; regs->tstate &= ~TSTATE_PEF; } out: diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/psycho.c linux/arch/sparc64/kernel/psycho.c --- v2.1.114/linux/arch/sparc64/kernel/psycho.c Tue Jul 21 00:15:30 1998 +++ linux/arch/sparc64/kernel/psycho.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: psycho.c,v 1.54 1998/05/01 19:16:32 ecd Exp $ +/* $Id: psycho.c,v 1.63 1998/08/02 05:55:42 ecd Exp $ * psycho.c: Ultra/AX U2P PCI controller support. * * Copyright (C) 1997 David S. Miller (davem@caipfs.rutgers.edu) @@ -14,6 +14,8 @@ #include #include /* for sanity check... */ +#include +#include #undef PROM_DEBUG #undef FIXUP_REGS_DEBUG @@ -27,8 +29,13 @@ #define dprintf printk #endif + unsigned long pci_dvma_offset = 0x00000000UL; -unsigned long pci_dvma_mask = 0xffffffffUL; +unsigned long pci_dvma_mask = 0xffffffffUL; + +unsigned long pci_dvma_v2p_hash[PCI_DVMA_HASHSZ]; +unsigned long pci_dvma_p2v_hash[PCI_DVMA_HASHSZ]; + #ifndef CONFIG_PCI @@ -97,10 +104,20 @@ */ static int pci_probe_enable = 0; +static __inline__ void set_dvma_hash(unsigned long paddr, unsigned long daddr) +{ + unsigned long dvma_addr = pci_dvma_offset + daddr; + unsigned long vaddr = (unsigned long)__va(paddr); + + pci_dvma_v2p_hash[pci_dvma_ahashfn(paddr)] = dvma_addr - vaddr; + pci_dvma_p2v_hash[pci_dvma_ahashfn(dvma_addr)] = vaddr - dvma_addr; +} + __initfunc(static void psycho_iommu_init(struct linux_psycho *psycho, int tsbsize)) { + struct linux_mlist_p1275 *mlist; unsigned long tsbbase; - unsigned long control, i; + unsigned long control, i, n; unsigned long *iopte; unsigned long order; @@ -122,12 +139,36 @@ } tsbbase = __get_free_pages(GFP_DMA, order); iopte = (unsigned long *)tsbbase; - for(i = 0; i < (tsbsize * 1024); i++) { - *iopte = (IOPTE_VALID | IOPTE_64K | - IOPTE_CACHE | IOPTE_WRITE); - *iopte |= (i << 16); - iopte++; + + memset(pci_dvma_v2p_hash, 0, sizeof(pci_dvma_v2p_hash)); + memset(pci_dvma_p2v_hash, 0, sizeof(pci_dvma_p2v_hash)); + + n = 0; + mlist = *prom_meminfo()->p1275_totphys; + while (mlist) { + unsigned long paddr = mlist->start_adr; + + for (i = 0; i < (mlist->num_bytes >> 16); i++) { + + *iopte = (IOPTE_VALID | IOPTE_64K | + IOPTE_CACHE | IOPTE_WRITE); + *iopte |= paddr; + + if (!(n & 0xff)) + set_dvma_hash(paddr, (n << 16)); + + if (++n > (tsbsize * 1024)) + goto out; + + paddr += (1 << 16); + iopte++; + } + + mlist = mlist->theres_more; } +out: + if (mlist) + printk("WARNING: not all physical memory mapped in IOMMU\n"); psycho->psycho_regs->iommu_tsbbase = __pa(tsbbase); @@ -136,15 +177,15 @@ control |= (IOMMU_CTRL_TBWSZ | IOMMU_CTRL_ENAB); switch(tsbsize) { case 8: - pci_dvma_mask = 0x1fffffffUL; + pci_dvma_mask = 0x1fffffffUL; control |= IOMMU_TSBSZ_8K; break; case 16: - pci_dvma_mask = 0x3fffffffUL; + pci_dvma_mask = 0x3fffffffUL; control |= IOMMU_TSBSZ_16K; break; case 32: - pci_dvma_mask = 0x7fffffffUL; + pci_dvma_mask = 0x7fffffffUL; control |= IOMMU_TSBSZ_32K; break; default: @@ -258,8 +299,8 @@ prom_halt(); } - psycho_iommu_init(sabre, tsbsize); pci_dvma_offset = vdma[0]; + psycho_iommu_init(sabre, tsbsize); printk("SABRE: DVMA at %08x [%08x]\n", vdma[0], vdma[1]); #ifdef PROM_DEBUG @@ -448,8 +489,8 @@ psycho->pci_config_space); #endif - psycho_iommu_init(psycho, 32); pci_dvma_offset = 0x80000000UL; + psycho_iommu_init(psycho, 32); is_pbm_a = ((pr_regs[0].phys_addr & 0x6000) == 0x2000); @@ -777,22 +818,15 @@ __initfunc(static int pdev_to_pnode_sibtraverse(struct linux_pbm_info *pbm, struct pci_dev *pdev, - int node)) + int pnode)) { struct linux_prom_pci_registers pregs[PROMREG_MAX]; + int node; int err; - while(node) { - int child; + node = prom_getchild(pnode); + while (node) { - child = prom_getchild(node); - if(child != 0 && child != -1) { - int res; - - res = pdev_to_pnode_sibtraverse(pbm, pdev, child); - if(res != 0 && res != -1) - return res; - } err = prom_getproperty(node, "reg", (char *)&pregs[0], sizeof(pregs)); if(err != 0 && err != -1) { u32 devfn = (pregs[0].phys_hi >> 8) & 0xff; @@ -806,12 +840,13 @@ return 0; } -__initfunc(static void pdev_cookie_fillin(struct linux_pbm_info *pbm, struct pci_dev *pdev)) +__initfunc(static void pdev_cookie_fillin(struct linux_pbm_info *pbm, + struct pci_dev *pdev, int pnode)) { struct pcidev_cookie *pcp; - int node = prom_getchild(pbm->prom_node); + int node; - node = pdev_to_pnode_sibtraverse(pbm, pdev, node); + node = pdev_to_pnode_sibtraverse(pbm, pdev, pnode); if(node == 0) node = -1; pcp = pci_devcookie_alloc(); @@ -825,7 +860,8 @@ } __initfunc(static void fill_in_pbm_cookies(struct pci_bus *pbus, - struct linux_pbm_info *pbm)) + struct linux_pbm_info *pbm, + int node)) { struct pci_dev *pdev; @@ -837,10 +873,12 @@ #endif for(pdev = pbus->devices; pdev; pdev = pdev->sibling) - pdev_cookie_fillin(pbm, pdev); + pdev_cookie_fillin(pbm, pdev, node); - for(pbus = pbus->children; pbus; pbus = pbus->next) - fill_in_pbm_cookies(pbus, pbm); + for(pbus = pbus->children; pbus; pbus = pbus->next) { + struct pcidev_cookie *pcp = pbus->self->sysdata; + fill_in_pbm_cookies(pbus, pbm, pcp->prom_node); + } } __initfunc(static void sabre_cookie_fillin(struct linux_psycho *sabre)) @@ -849,9 +887,11 @@ for(pbus = pbus->children; pbus; pbus = pbus->next) { if (pbus->number == sabre->pbm_A.pci_first_busno) - pdev_cookie_fillin(&sabre->pbm_A, pbus->self); + pdev_cookie_fillin(&sabre->pbm_A, pbus->self, + sabre->pbm_A.prom_node); else if (pbus->number == sabre->pbm_B.pci_first_busno) - pdev_cookie_fillin(&sabre->pbm_B, pbus->self); + pdev_cookie_fillin(&sabre->pbm_B, pbus->self, + sabre->pbm_B.prom_node); } } @@ -1431,13 +1471,12 @@ /* Exported for EBUS probing layer. */ __initfunc(unsigned int psycho_irq_build(struct linux_pbm_info *pbm, struct pci_dev *pdev, - unsigned int full_ino)) + unsigned int ino)) { - unsigned long imap_off, ign, ino; + unsigned long imap_off; int need_dma_sync = 0; - ign = (full_ino & PSYCHO_IMAP_IGN) >> 6; - ino = (full_ino & PSYCHO_IMAP_INO); + ino &= PSYCHO_IMAP_INO; /* Compute IMAP register offset, generic IRQ layer figures out * the ICLR register address as this is simple given the 32-bit @@ -1513,10 +1552,7 @@ break; default: - /* We don't expect anything else. The other possible - * values are not found in PCI device nodes, and are - * so hardware specific that they should use DCOOKIE's - * anyways. + /* We don't expect anything else. */ prom_printf("psycho_irq_build: Wacky INO [%x]\n", ino); prom_halt(); @@ -1528,7 +1564,7 @@ need_dma_sync = 1; } - return pci_irq_encode(imap_off, pbm->parent->index, ign, ino, need_dma_sync); + return psycho_build_irq(pbm->parent, imap_off, ino, need_dma_sync); } __initfunc(static int pbm_intmap_match(struct linux_pbm_info *pbm, @@ -1559,6 +1595,9 @@ if(i == 0 || i == -1) goto out; + /* Use low slot number bits of child as IRQ line. */ + *interrupt = ((pdev->devfn >> 3) & 3) + 1; + preg = &ppreg; } @@ -1566,20 +1605,29 @@ mid = preg->phys_mid & pbm->pbm_intmask.phys_mid; lo = preg->phys_lo & pbm->pbm_intmask.phys_lo; irq = *interrupt & pbm->pbm_intmask.interrupt; +#ifdef FIXUP_IRQ_DEBUG + dprintf("intmap_match: [%02x.%02x.%x] key: [%08x.%08x.%08x.%08x] ", + pdev->bus->number, pdev->devfn >> 3, pdev->devfn & 7, + hi, mid, lo, irq); +#endif for (i = 0; i < pbm->num_pbm_intmap; i++) { if ((pbm->pbm_intmap[i].phys_hi == hi) && (pbm->pbm_intmap[i].phys_mid == mid) && (pbm->pbm_intmap[i].phys_lo == lo) && (pbm->pbm_intmap[i].interrupt == irq)) { +#ifdef FIXUP_IRQ_DEBUG + dprintf("irq: [%08x]", pbm->pbm_intmap[i].cinterrupt); +#endif *interrupt = pbm->pbm_intmap[i].cinterrupt; - return *interrupt; + return 1; } } out: - prom_printf("pbm_intmap_match: IRQ [%08x.%08x.%08x.%08x] " - "not found in interrupt-map\n", preg->phys_hi, - preg->phys_mid, preg->phys_lo, *interrupt); + prom_printf("pbm_intmap_match: bus %02x, devfn %02x: ", + pdev->bus->number, pdev->devfn); + prom_printf("IRQ [%08x.%08x.%08x.%08x] not found in interrupt-map\n", + preg->phys_hi, preg->phys_mid, preg->phys_lo, *interrupt); prom_halt(); } @@ -1610,8 +1658,8 @@ (pbm->parent->upa_portid << 6) | prom_irq); #ifdef FIXUP_IRQ_DEBUG - dprintf("interrupt-map specified prom_irq[%x] pdev->irq[%x]", - prom_irq, pdev->irq); + dprintf("interrupt-map specified: prom_irq[%x] pdev->irq[%x]", + prom_irq, pdev->irq); #endif /* See if fully specified already (ie. for onboard devices like hme) */ } else if(((prom_irq & PSYCHO_IMAP_IGN) >> 6) == pbm->parent->upa_portid) { @@ -1847,9 +1895,11 @@ sabre_cookie_fillin(psycho); fill_in_pbm_cookies(&psycho->pbm_A.pci_bus, - &psycho->pbm_A); + &psycho->pbm_A, + psycho->pbm_A.prom_node); fill_in_pbm_cookies(&psycho->pbm_B.pci_bus, - &psycho->pbm_B); + &psycho->pbm_B, + psycho->pbm_B.prom_node); /* See what OBP has taken care of already. */ record_assignments(&psycho->pbm_A); diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/ptrace.c linux/arch/sparc64/kernel/ptrace.c --- v2.1.114/linux/arch/sparc64/kernel/ptrace.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/ptrace.c Tue Aug 4 16:03:35 1998 @@ -24,6 +24,7 @@ #include #include #include +#include #define MAGIC_CONSTANT 0x80000000 @@ -355,9 +356,11 @@ case 0: v = t->ksp; break; +#if 0 case 4: v = t->kpc; break; +#endif case 8: v = t->kpsr; break; @@ -832,11 +835,11 @@ unsigned int insn; } fpq[16]; } *fps = (struct fps *) addr; - unsigned long *fpregs = (unsigned long *)(child->tss.kregs+1); + unsigned long *fpregs = (unsigned long *)(((char *)child) + AOFF_task_fpregs); if (copy_to_user(&fps->regs[0], fpregs, (32 * sizeof(unsigned int))) || - __put_user(((unsigned int)fpregs[32]), (&fps->fsr)) || + __put_user(child->tss.xfsr[0], (&fps->fsr)) || __put_user(0, (&fps->fpqd)) || __put_user(0, (&fps->flags)) || __put_user(0, (&fps->extra)) || @@ -853,11 +856,11 @@ unsigned int regs[64]; unsigned long fsr; } *fps = (struct fps *) addr; - unsigned long *fpregs = (unsigned long *)(child->tss.kregs+1); + unsigned long *fpregs = (unsigned long *)(((char *)child) + AOFF_task_fpregs); if (copy_to_user(&fps->regs[0], fpregs, (64 * sizeof(unsigned int))) || - __put_user(fpregs[32], (&fps->fsr))) { + __put_user(child->tss.xfsr[0], (&fps->fsr))) { pt_error_return(regs, EFAULT); goto out; } @@ -877,7 +880,7 @@ unsigned int insn; } fpq[16]; } *fps = (struct fps *) addr; - unsigned long *fpregs = (unsigned long *)(child->tss.kregs+1); + unsigned long *fpregs = (unsigned long *)(((char *)child) + AOFF_task_fpregs); unsigned fsr; if (copy_from_user(fpregs, &fps->regs[0], @@ -886,8 +889,11 @@ pt_error_return(regs, EFAULT); goto out; } - fpregs[32] &= 0xffffffff00000000UL; - fpregs[32] |= fsr; + child->tss.xfsr[0] &= 0xffffffff00000000UL; + child->tss.xfsr[0] |= fsr; + if (!(child->tss.fpsaved[0] & FPRS_FEF)) + child->tss.gsr[0] = 0; + child->tss.fpsaved[0] |= (FPRS_FEF | FPRS_DL); pt_succ_return(regs, 0); goto out; } @@ -897,14 +903,17 @@ unsigned int regs[64]; unsigned long fsr; } *fps = (struct fps *) addr; - unsigned long *fpregs = (unsigned long *)(child->tss.kregs+1); + unsigned long *fpregs = (unsigned long *)(((char *)child) + AOFF_task_fpregs); if (copy_from_user(fpregs, &fps->regs[0], (64 * sizeof(unsigned int))) || - __get_user(fpregs[32], (&fps->fsr))) { + __get_user(child->tss.xfsr[0], (&fps->fsr))) { pt_error_return(regs, EFAULT); goto out; } + if (!(child->tss.fpsaved[0] & FPRS_FEF)) + child->tss.gsr[0] = 0; + child->tss.fpsaved[0] |= (FPRS_FEF | FPRS_DL | FPRS_DU); pt_succ_return(regs, 0); goto out; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/rtrap.S linux/arch/sparc64/kernel/rtrap.S --- v2.1.114/linux/arch/sparc64/kernel/rtrap.S Mon Jan 12 15:15:44 1998 +++ linux/arch/sparc64/kernel/rtrap.S Tue Aug 4 16:03:35 1998 @@ -1,7 +1,7 @@ -/* $Id: rtrap.S,v 1.37 1997/12/11 15:14:54 jj Exp $ +/* $Id: rtrap.S,v 1.39 1998/07/26 03:02:49 davem Exp $ * rtrap.S: Preparing for return from trap on Sparc V9. * - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) */ @@ -10,13 +10,15 @@ #include #include #include +#include + +#define PTREGS_OFF (STACK_BIAS + REGWIN_SZ) .text .align 32 .globl rtrap_clr_l6, rtrap -#define PTREGS_OFF (STACK_BIAS + REGWIN_SZ) -rtrap_clr_l6: ba,pt %xcc, rtrap - clr %l6 +rtrap_clr_l6: clr %l6 + /* Fall through */ rtrap: sethi %hi(bh_active), %l2 sethi %hi(bh_mask), %l1 ldx [%l2 + %lo(bh_active)], %l4 @@ -37,24 +39,37 @@ be,pt %icc, to_user andn %l7, PSTATE_IE, %l7 - ld [%sp + PTREGS_OFF + PT_V9_FPRS], %l2 + ldub [%g6 + AOFF_task_tss + AOFF_thread_fpdepth], %l5 + brz,pt %l5, rt_continue + srl %l5, 1, %o0 + add %g6, AOFF_task_tss + AOFF_thread_fpsaved, %l6 + ldub [%l6 + %o0], %l2 + sub %l5, 2, %l5 + add %g6, AOFF_task_tss + AOFF_thread_gsr, %o1 andcc %l2, FPRS_FEF, %g0 - be,pt %icc, rt_continue + be,pt %icc, 2f and %l2, FPRS_DL, %l6 - wr %g0, FPRS_FEF, %fprs - ldx [%sp + PTREGS_OFF + TRACEREG_SZ + 0x108], %g5 + rd %fprs, %g5 + wr %g5, FPRS_FEF, %fprs + ldub [%o1 + %o0], %g5 + sll %o0, 3, %o5 + add %g6, AOFF_task_tss + AOFF_thread_xfsr, %o1 membar #StoreLoad | #LoadLoad + sll %o0, 8, %o2 + add %g6, AOFF_task_fpregs, %o3 brz,pn %l6, 1f - wr %g0, ASI_BLK_P, %asi - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x000] %asi, %f0 - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x040] %asi, %f16 + add %g6, AOFF_task_fpregs+0x40, %o4 + ldda [%o3 + %o2] ASI_BLK_P, %f0 + ldda [%o4 + %o2] ASI_BLK_P, %f16 1: andcc %l2, FPRS_DU, %g0 be,pn %icc, 1f wr %g5, 0, %gsr - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x080] %asi, %f32 - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x0c0] %asi, %f48 + add %o2, 0x80, %o2 + ldda [%o3 + %o2] ASI_BLK_P, %f32 + ldda [%o4 + %o2] ASI_BLK_P, %f48 1: membar #Sync - ldx [%sp + PTREGS_OFF + TRACEREG_SZ + 0x100], %fsr + ldx [%o1 + %o5], %fsr +2: stb %l5, [%g6 + AOFF_task_tss + AOFF_thread_fpdepth] rt_continue: lduh [%g6 + AOFF_task_tss + AOFF_thread_ctx], %l0 ldx [%sp + PTREGS_OFF + PT_V9_G1], %g1 ldx [%sp + PTREGS_OFF + PT_V9_G2], %g2 @@ -86,11 +101,10 @@ wrpr %l1, %g0, %tstate wrpr %l2, %g0, %tpc wrpr %o2, %g0, %tnpc - mov PRIMARY_CONTEXT, %l7 brnz,pn %l3, kern_rtt - mov SECONDARY_CONTEXT, %o4 + mov PRIMARY_CONTEXT, %l7 stxa %l0, [%l7] ASI_DMMU - stxa %l0, [%o4] ASI_DMMU + stxa %l0, [%l7 + %l7] ASI_DMMU flush %o5 rdpr %wstate, %l1 @@ -106,8 +120,7 @@ retry kern_rtt: restore retry -to_user: sethi %hi(need_resched), %l0 - ldx [%l0 + %lo(need_resched)], %l0 +to_user: ldx [%g6 + AOFF_task_need_resched], %l0 wrpr %l7, PSTATE_IE, %pstate orcc %g0, %l0, %g0 be,a,pt %xcc, check_signal @@ -116,8 +129,7 @@ call schedule nop lduw [%g6 + AOFF_task_sigpending], %l0 -check_signal: ld [%sp + PTREGS_OFF + PT_V9_FPRS], %l2 - brz,a,pt %l0, check_user_wins +check_signal: brz,a,pt %l0, check_user_wins lduh [%g6 + AOFF_task_tss + AOFF_thread_w_saved], %o2 clr %o0 mov %l5, %o2 @@ -127,112 +139,20 @@ lduh [%g6 + AOFF_task_tss + AOFF_thread_w_saved], %o2 clr %l6 check_user_wins:brz,pt %o2, 1f - sethi %hi(TSTATE_PEF), %o3 + sethi %hi(TSTATE_PEF), %l6 call fault_in_user_windows add %sp, STACK_BIAS + REGWIN_SZ, %o0 - sethi %hi(TSTATE_PEF), %o3 -1: andcc %l2, FPRS_FEF, %g0 - be,a,pt %icc, rt_continue - andn %l1, %o3, %l1 ! If fprs.FEF is not set, disable tstate.PEF - ldx [%sp + PTREGS_OFF + TRACEREG_SZ + 0x108], %o3 - lduh [%g6 + AOFF_task_tss + AOFF_thread_flags], %l2 - wr %g0, FPRS_FEF, %fprs - wr %o3, 0, %gsr - andcc %l2, SPARC_FLAG_USEDFPUL, %g0 - bne,pn %icc, 2f - andcc %l2, SPARC_FLAG_USEDFPUU, %g0 - fzero %f0 - bne,pn %icc, 1f - fzero %f2 - faddd %f0, %f2, %f4 - fmuld %f0, %f2, %f6 - faddd %f0, %f2, %f8 - fmuld %f0, %f2, %f10 - faddd %f0, %f2, %f12 - fmuld %f0, %f2, %f14 - faddd %f0, %f2, %f16 - fmuld %f0, %f2, %f18 - faddd %f0, %f2, %f20 - fmuld %f0, %f2, %f22 - faddd %f0, %f2, %f24 - fmuld %f0, %f2, %f26 - faddd %f0, %f2, %f28 - fmuld %f0, %f2, %f30 - faddd %f0, %f2, %f32 - fmuld %f0, %f2, %f34 - faddd %f0, %f2, %f36 - fmuld %f0, %f2, %f38 - faddd %f0, %f2, %f40 - fmuld %f0, %f2, %f42 - faddd %f0, %f2, %f44 - fmuld %f0, %f2, %f46 - faddd %f0, %f2, %f48 - fmuld %f0, %f2, %f50 - faddd %f0, %f2, %f52 - fmuld %f0, %f2, %f54 - faddd %f0, %f2, %f56 - fmuld %f0, %f2, %f58 - faddd %f0, %f2, %f60 - ldx [%sp + PTREGS_OFF + TRACEREG_SZ + 0x100], %fsr - ba,pt %xcc, rt_continue - wr %g0, FPRS_FEF, %fprs -1: wr %g0, ASI_BLK_P, %asi - membar #StoreLoad | #LoadLoad - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x080] %asi, %f32 - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x0c0] %asi, %f48 - faddd %f0, %f2, %f4 - fmuld %f0, %f2, %f6 - faddd %f0, %f2, %f8 - fmuld %f0, %f2, %f10 - faddd %f0, %f2, %f12 - fmuld %f0, %f2, %f14 - faddd %f0, %f2, %f16 - fmuld %f0, %f2, %f18 - faddd %f0, %f2, %f20 - fmuld %f0, %f2, %f22 - faddd %f0, %f2, %f24 - fmuld %f0, %f2, %f26 - faddd %f0, %f2, %f28 - fmuld %f0, %f2, %f30 - membar #Sync - ldx [%sp + PTREGS_OFF + TRACEREG_SZ + 0x100], %fsr - ba,pt %xcc, rt_continue - wr %g0, FPRS_FEF, %fprs -2: membar #StoreLoad | #LoadLoad - andcc %l2, SPARC_FLAG_USEDFPUU, %g0 - bne,pt %icc, 3f - wr %g0, ASI_BLK_P, %asi - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x000] %asi, %f0 - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x040] %asi, %f16 - fzero %f32 - fzero %f34 - faddd %f32, %f34, %f36 - fmuld %f32, %f34, %f38 - faddd %f32, %f34, %f40 - fmuld %f32, %f34, %f42 - faddd %f32, %f34, %f44 - fmuld %f32, %f34, %f46 - faddd %f32, %f34, %f48 - fmuld %f32, %f34, %f50 - faddd %f32, %f34, %f52 - fmuld %f32, %f34, %f54 - faddd %f32, %f34, %f56 - fmuld %f32, %f34, %f58 - faddd %f32, %f34, %f60 - fmuld %f32, %f34, %f62 - membar #Sync - ldx [%sp + PTREGS_OFF + TRACEREG_SZ + 0x100], %fsr - ba,pt %xcc, rt_continue - wr %g0, FPRS_FEF, %fprs -3: ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x000] %asi, %f0 - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x040] %asi, %f16 - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x080] %asi, %f32 - ldda [%sp + PTREGS_OFF + TRACEREG_SZ + 0x0c0] %asi, %f48 - membar #Sync - ldx [%sp + PTREGS_OFF + TRACEREG_SZ + 0x100], %fsr - ba,pt %xcc, rt_continue - wr %g0, FPRS_FEF, %fprs +1: andcc %l1, %l6, %g0 + be,pt %xcc, rt_continue + stb %g0, [%g6 + AOFF_task_tss + AOFF_thread_fpdepth] ! This is neccessary for non-syscall rtraps only + + rd %fprs, %l5 + andcc %l5, FPRS_FEF, %g0 + be,a,pn %icc, rt_continue + andn %l1, %l6, %l1 + ba,pt %xcc, rt_continue+4 + lduh [%g6 + AOFF_task_tss + AOFF_thread_ctx], %l0 #undef PTREGS_OFF diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/setup.c linux/arch/sparc64/kernel/setup.c --- v2.1.114/linux/arch/sparc64/kernel/setup.c Thu Jul 16 18:09:24 1998 +++ linux/arch/sparc64/kernel/setup.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.26 1998/07/08 10:21:15 jj Exp $ +/* $Id: setup.c,v 1.30 1998/07/24 09:50:08 jj Exp $ * linux/arch/sparc64/kernel/setup.c * * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) @@ -66,9 +66,7 @@ extern unsigned long sparc64_ttable_tl0; #if CONFIG_SUN_CONSOLE -void console_restore_palette(void) { -/* FIXME */ -} +void (*prom_palette)(int); #endif asmlinkage void sys_sync(void); /* it's really int */ @@ -82,7 +80,8 @@ __asm__ __volatile__("wrpr %0, 0x0, %%tba\n\t" : : "r" (&sparc64_ttable_tl0)); #ifdef CONFIG_SUN_CONSOLE - console_restore_palette (); + if (prom_palette) + prom_palette (1); #endif prom_printf("PROM SYNC COMMAND...\n"); show_free_areas(); @@ -193,6 +192,15 @@ } else if (!strncmp (commands, "ttyb", 4)) { console_fb = 3; prom_printf ("Using /dev/ttyb as console.\n"); +#if defined(CONFIG_PROM_CONSOLE) + } else if (!strncmp (commands, "prom", 4)) { + char *p; + + for (p = commands - 8; *p && *p != ' '; p++) + *p = ' '; + conswitchp = &prom_con; + console_fb = 1; +#endif } else { console_fb = 1; } @@ -283,6 +291,12 @@ printk("ARCH: SUN4U\n"); +#ifdef CONFIG_DUMMY_CONSOLE + conswitchp = &dummy_con; +#elif defined(CONFIG_PROM_CONSOLE) + conswitchp = &prom_con; +#endif + boot_flags_init(*cmdline_p); idprom_init(); @@ -409,13 +423,8 @@ #else serial_console = 0; #endif - if (!serial_console) { -#ifdef CONFIG_PROM_CONSOLE - conswitchp = &prom_con; -#elif defined(CONFIG_DUMMY_CONSOLE) - conswitchp = &dummy_con; -#endif - } + if (serial_console) + conswitchp = NULL; } asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on) diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/signal.c linux/arch/sparc64/kernel/signal.c --- v2.1.114/linux/arch/sparc64/kernel/signal.c Mon Jan 12 15:15:44 1998 +++ linux/arch/sparc64/kernel/signal.c Tue Aug 4 16:03:35 1998 @@ -1,11 +1,11 @@ -/* $Id: signal.c,v 1.27 1997/12/15 15:04:44 jj Exp $ +/* $Id: signal.c,v 1.30 1998/07/30 11:29:34 davem Exp $ * arch/sparc64/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ #include @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -25,8 +26,8 @@ #include #include #include -#include #include +#include #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) @@ -104,8 +105,10 @@ __get_user(fenab, &(ucp->uc_mcontext.mc_fpregs.mcfpu_enab)); if(fenab) { - unsigned long *fpregs = (unsigned long *)(regs+1); + unsigned long *fpregs = (unsigned long *)(((char *)current) + AOFF_task_fpregs); unsigned long fprs; + + fprs_write(0); __get_user(fprs, &(ucp->uc_mcontext.mc_fpregs.mcfpu_fprs)); if (fprs & FPRS_DL) copy_from_user(fpregs, &(ucp->uc_mcontext.mc_fpregs.mcfpu_fregs), @@ -113,10 +116,9 @@ if (fprs & FPRS_DU) copy_from_user(fpregs+16, ((unsigned long *)&(ucp->uc_mcontext.mc_fpregs.mcfpu_fregs))+16, (sizeof(unsigned int) * 32)); - __get_user(fpregs[32], &(ucp->uc_mcontext.mc_fpregs.mcfpu_fsr)); - __get_user(fpregs[33], &(ucp->uc_mcontext.mc_fpregs.mcfpu_gsr)); - regs->fprs = fprs; - regs->tstate |= TSTATE_PEF; + __get_user(current->tss.xfsr[0], &(ucp->uc_mcontext.mc_fpregs.mcfpu_fsr)); + __get_user(current->tss.gsr[0], &(ucp->uc_mcontext.mc_fpregs.mcfpu_gsr)); + regs->tstate &= ~TSTATE_PEF; } return; do_sigsegv: @@ -131,11 +133,18 @@ mc_gregset_t *grp; mcontext_t *mcp; unsigned long fp, i7; - unsigned char fenab = (current->tss.flags & SPARC_FLAG_USEDFPU); + unsigned char fenab; synchronize_user_stack(); if(tp->w_saved || clear_user(ucp, sizeof(*ucp))) goto do_sigsegv; + +#if 1 + fenab = 0; /* IMO get_context is like any other system call, thus modifies FPU state -jj */ +#else + fenab = (current->tss.fpsaved[0] & FPRS_FEF); +#endif + mcp = &ucp->uc_mcontext; grp = &mcp->mc_gregs; @@ -175,25 +184,18 @@ __put_user(fenab, &(mcp->mc_fpregs.mcfpu_enab)); if(fenab) { - unsigned long *fpregs = (unsigned long *)(regs+1); + unsigned long *fpregs = (unsigned long *)(((char *)current) + AOFF_task_fpregs); unsigned long fprs; - fprs = (regs->fprs & FPRS_FEF) | - (current->tss.flags & (SPARC_FLAG_USEDFPUL | SPARC_FLAG_USEDFPUU)); + fprs = current->tss.fpsaved[0]; if (fprs & FPRS_DL) copy_to_user(&(mcp->mc_fpregs.mcfpu_fregs), fpregs, (sizeof(unsigned int) * 32)); - else - clear_user(&(mcp->mc_fpregs.mcfpu_fregs), - (sizeof(unsigned int) * 32)); if (fprs & FPRS_DU) copy_to_user(((unsigned long *)&(mcp->mc_fpregs.mcfpu_fregs))+16, fpregs+16, (sizeof(unsigned int) * 32)); - else - clear_user(((unsigned long *)&(mcp->mc_fpregs.mcfpu_fregs))+16, - (sizeof(unsigned int) * 32)); - __put_user(fpregs[32], &(mcp->mc_fpregs.mcfpu_fsr)); - __put_user(fpregs[33], &(mcp->mc_fpregs.mcfpu_gsr)); + __put_user(current->tss.xfsr[0], &(mcp->mc_fpregs.mcfpu_fsr)); + __put_user(current->tss.gsr[0], &(mcp->mc_fpregs.mcfpu_gsr)); __put_user(fprs, &(mcp->mc_fpregs.mcfpu_fprs)); } return; @@ -224,6 +226,7 @@ sigset_t mask; __siginfo_fpu_t * fpu_save; unsigned int insns [2]; + stack_t stack; __siginfo_fpu_t fpu_state; }; @@ -331,23 +334,26 @@ } } -static inline void +static inline int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t *fpu) { - unsigned long *fpregs = (unsigned long *)(regs+1); + unsigned long *fpregs = (unsigned long *)(((char *)current) + AOFF_task_fpregs); unsigned long fprs; - - __get_user(fprs, &fpu->si_fprs); + int err; + + err = __get_user(fprs, &fpu->si_fprs); + fprs_write(0); + regs->tstate &= ~TSTATE_PEF; if (fprs & FPRS_DL) - copy_from_user(fpregs, &fpu->si_float_regs[0], + err |= copy_from_user(fpregs, &fpu->si_float_regs[0], (sizeof(unsigned int) * 32)); if (fprs & FPRS_DU) - copy_from_user(fpregs+16, &fpu->si_float_regs[32], + err |= copy_from_user(fpregs+16, &fpu->si_float_regs[32], (sizeof(unsigned int) * 32)); - __get_user(fpregs[32], &fpu->si_fsr); - __get_user(fpregs[33], &fpu->si_gsr); - regs->fprs = fprs; - regs->tstate |= TSTATE_PEF; + err |= __get_user(current->tss.xfsr[0], &fpu->si_fsr); + err |= __get_user(current->tss.gsr[0], &fpu->si_gsr); + current->tss.fpsaved[0] |= fprs; + return err; } void do_sigreturn(struct pt_regs *regs) @@ -356,6 +362,7 @@ unsigned long tpc, tnpc, tstate; __siginfo_fpu_t *fpu_save; sigset_t set; + int err; synchronize_user_stack (); sf = (struct new_signal_frame *) @@ -365,34 +372,33 @@ if (((unsigned long) sf) & 3) goto segv; - if (get_user(tpc, &sf->info.si_regs.tpc) || - __get_user(tnpc, &sf->info.si_regs.tnpc) || - ((tpc | tnpc) & 3)) - goto segv; - - regs->tpc = tpc; - regs->tnpc = tnpc; + err = get_user(tpc, &sf->info.si_regs.tpc); + err |= __get_user(tnpc, &sf->info.si_regs.tnpc); + err |= ((tpc | tnpc) & 3); /* 2. Restore the state */ - if (__get_user(regs->y, &sf->info.si_regs.y) || - __get_user(tstate, &sf->info.si_regs.tstate) || - copy_from_user(regs->u_regs, sf->info.si_regs.u_regs, sizeof(regs->u_regs))) - goto segv; + err |= __get_user(regs->y, &sf->info.si_regs.y); + err |= __get_user(tstate, &sf->info.si_regs.tstate); + err |= copy_from_user(regs->u_regs, sf->info.si_regs.u_regs, sizeof(regs->u_regs)); /* User can only change condition codes in %tstate. */ regs->tstate &= ~(TSTATE_ICC); regs->tstate |= (tstate & TSTATE_ICC); - if (__get_user(fpu_save, &sf->fpu_save)) - goto segv; + err |= __get_user(fpu_save, &sf->fpu_save); if (fpu_save) - restore_fpu_state(regs, &sf->fpu_state); - if (__get_user(set.sig[0], &sf->info.si_mask) || - (_NSIG_WORDS > 1 && - __copy_from_user(&set.sig[1], &sf->extramask, - sizeof(sf->extramask)))) + err |= restore_fpu_state(regs, &sf->fpu_state); + + err |= __get_user(set.sig[0], &sf->info.si_mask); + if (_NSIG_WORDS > 1) + err |= __copy_from_user(&set.sig[1], &sf->extramask, sizeof(sf->extramask)); + + if (err) goto segv; + regs->tpc = tpc; + regs->tnpc = tnpc; + sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = set; @@ -400,8 +406,7 @@ spin_unlock_irq(¤t->sigmask_lock); return; segv: - lock_kernel(); - do_exit(SIGSEGV); + send_sig(SIGSEGV, current, 1); } void do_rt_sigreturn(struct pt_regs *regs) @@ -410,6 +415,8 @@ unsigned long tpc, tnpc, tstate; __siginfo_fpu_t *fpu_save; sigset_t set; + stack_t st; + int err; synchronize_user_stack (); sf = (struct rt_signal_frame *) @@ -419,31 +426,36 @@ if (((unsigned long) sf) & 3) goto segv; - if (get_user(tpc, &sf->regs.tpc) || - __get_user(tnpc, &sf->regs.tnpc) || - ((tpc | tnpc) & 3)) - goto segv; - - regs->tpc = tpc; - regs->tnpc = tnpc; + err = get_user(tpc, &sf->regs.tpc); + err |= __get_user(tnpc, &sf->regs.tnpc); + err |= ((tpc | tnpc) & 3); /* 2. Restore the state */ - if (__get_user(regs->y, &sf->regs.y) || - __get_user(tstate, &sf->regs.tstate) || - copy_from_user(regs->u_regs, sf->regs.u_regs, sizeof(regs->u_regs))) - goto segv; + err |= __get_user(regs->y, &sf->regs.y); + err |= __get_user(tstate, &sf->regs.tstate); + err |= copy_from_user(regs->u_regs, sf->regs.u_regs, sizeof(regs->u_regs)); /* User can only change condition codes in %tstate. */ regs->tstate &= ~(TSTATE_ICC); regs->tstate |= (tstate & TSTATE_ICC); - if (__get_user(fpu_save, &sf->fpu_save)) - goto segv; + err |= __get_user(fpu_save, &sf->fpu_save); if (fpu_save) - restore_fpu_state(regs, &sf->fpu_state); + err |= restore_fpu_state(regs, &sf->fpu_state); - if (__copy_from_user(&set, &sf->mask, sizeof(sigset_t))) + err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); + err |= __copy_from_user(&st, &sf->stack, sizeof(stack_t)); + + if (err) goto segv; + + regs->tpc = tpc; + regs->tnpc = tnpc; + + /* It is more difficult to avoid calling this function than to + call it and ignore errors. */ + do_sigaltstack(&st, NULL, (unsigned long)sf); + sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = set; @@ -451,8 +463,7 @@ spin_unlock_irq(¤t->sigmask_lock); return; segv: - lock_kernel(); - do_exit(SIGSEGV); + send_sig(SIGSEGV, current, 1); } /* Checks if the fp is valid */ @@ -469,24 +480,30 @@ unsigned long *fpregs = (unsigned long *)(regs+1); unsigned long fprs; - fprs = (regs->fprs & FPRS_FEF) | - (current->tss.flags & (SPARC_FLAG_USEDFPUL | SPARC_FLAG_USEDFPUU)); + fprs = current->tss.fpsaved[0]; if (fprs & FPRS_DL) copy_to_user(&fpu->si_float_regs[0], fpregs, (sizeof(unsigned int) * 32)); - else - clear_user(&fpu->si_float_regs[0], - (sizeof(unsigned int) * 32)); if (fprs & FPRS_DU) copy_to_user(&fpu->si_float_regs[32], fpregs+16, (sizeof(unsigned int) * 32)); - else - clear_user(&fpu->si_float_regs[32], - (sizeof(unsigned int) * 32)); - __put_user(fpregs[32], &fpu->si_fsr); - __put_user(fpregs[33], &fpu->si_gsr); + __put_user(current->tss.xfsr[0], &fpu->si_fsr); + __put_user(current->tss.gsr[0], &fpu->si_gsr); __put_user(fprs, &fpu->si_fprs); - regs->tstate &= ~TSTATE_PEF; +} + +static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, unsigned long framesize) +{ + unsigned long sp; + + sp = regs->u_regs[UREG_FP] + STACK_BIAS; + + /* This is the X/Open sanctioned signal stack switching. */ + if (ka->sa.sa_flags & SA_ONSTACK) { + if (!on_sig_stack(sp) && !((current->sas_ss_sp + current->sas_ss_size) & 7)) + sp = current->sas_ss_sp + current->sas_ss_size; + } + return (void *)(sp - framesize); } static inline void @@ -498,12 +515,14 @@ /* 1. Make sure everything is clean */ synchronize_user_stack(); + save_and_clear_fpu(); + sigframe_size = NF_ALIGNEDSZ; - if (!(current->tss.flags & SPARC_FLAG_USEDFPU)) + + if (!(current->tss.fpsaved[0] & FPRS_FEF)) sigframe_size -= sizeof(__siginfo_fpu_t); - sf = (struct new_signal_frame *) - (regs->u_regs[UREG_FP] + STACK_BIAS - sigframe_size); + sf = (struct new_signal_frame *)get_sigframe(ka, regs, sigframe_size); if (invalid_frame_pointer (sf, sigframe_size)) goto sigill; @@ -516,8 +535,8 @@ /* 2. Save the current process state */ copy_to_user(&sf->info.si_regs, regs, sizeof (*regs)); - - if (current->tss.flags & SPARC_FLAG_USEDFPU) { + + if (current->tss.fpsaved[0] & FPRS_FEF) { save_fpu_state(regs, &sf->fpu_state); __put_user((u64)&sf->fpu_state, &sf->fpu_save); } else { @@ -582,12 +601,13 @@ /* 1. Make sure everything is clean */ synchronize_user_stack(); + save_and_clear_fpu(); + sigframe_size = RT_ALIGNEDSZ; - if (!(current->tss.flags & SPARC_FLAG_USEDFPU)) + if (!(current->tss.fpsaved[0] & FPRS_FEF)) sigframe_size -= sizeof(__siginfo_fpu_t); - sf = (struct rt_signal_frame *) - (regs->u_regs[UREG_FP] + STACK_BIAS - sigframe_size); + sf = (struct rt_signal_frame *)get_sigframe(ka, regs, sigframe_size); if (invalid_frame_pointer (sf, sigframe_size)) goto sigill; @@ -601,12 +621,17 @@ /* 2. Save the current process state */ copy_to_user(&sf->regs, regs, sizeof (*regs)); - if (current->tss.flags & SPARC_FLAG_USEDFPU) { + if (current->tss.fpsaved[0] & FPRS_FEF) { save_fpu_state(regs, &sf->fpu_state); __put_user((u64)&sf->fpu_state, &sf->fpu_save); } else { __put_user(0, &sf->fpu_save); } + + /* Setup sigaltstack */ + __put_user(current->sas_ss_sp, &sf->stack.ss_sp); + __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); + __put_user(current->sas_ss_size, &sf->stack.ss_size); copy_to_user(&sf->mask, oldset, sizeof(sigset_t)); @@ -827,29 +852,4 @@ regs->tnpc -= 4; } return 0; -} - -asmlinkage int -sys_sigstack(struct sigstack *ssptr, struct sigstack *ossptr) -{ - int ret = -EFAULT; - - lock_kernel(); - /* First see if old state is wanted. */ - if(ossptr) { - if (put_user ((u64)current->tss.sstk_info.the_stack, &ossptr->the_stack) || - __put_user (current->tss.sstk_info.cur_status, &ossptr->cur_status)) - goto out; - } - - /* Now see if we want to update the new state. */ - if(ssptr) { - if (get_user ((u64)current->tss.sstk_info.the_stack, &ssptr->the_stack) || - __put_user (current->tss.sstk_info.cur_status, &ssptr->cur_status)) - goto out; - } - ret = 0; -out: - unlock_kernel(); - return ret; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/signal32.c linux/arch/sparc64/kernel/signal32.c --- v2.1.114/linux/arch/sparc64/kernel/signal32.c Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/kernel/signal32.c Tue Aug 4 16:03:35 1998 @@ -1,11 +1,11 @@ -/* $Id: signal32.c,v 1.35 1998/04/01 07:00:43 davem Exp $ +/* $Id: signal32.c,v 1.41 1998/07/30 11:29:32 davem Exp $ * arch/sparc64/kernel/signal32.c * * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ #include @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -24,7 +25,7 @@ #include #include #include -#include +#include #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) @@ -36,6 +37,8 @@ /* This turned off for production... */ /* #define DEBUG_SIGNALS 1 */ +/* #define DEBUG_SIGNALS_TRACE 1 */ +/* #define DEBUG_SIGNALS_MAPS 1 */ /* Signal frames: the original one (compatible with SunOS): * @@ -82,6 +85,7 @@ sigset_t32 mask; /* __siginfo_fpu32_t * */ u32 fpu_save; unsigned int insns [2]; + stack_t32 stack; __siginfo_fpu_t fpu_state; }; @@ -178,20 +182,23 @@ } } -static inline void restore_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t *fpu) +static inline int restore_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t *fpu) { - unsigned long *fpregs = (unsigned long *)(regs + 1); + unsigned long *fpregs = (unsigned long *)(((char *)current) + AOFF_task_fpregs); unsigned long fprs; + int err; - __get_user(fprs, &fpu->si_fprs); + err = __get_user(fprs, &fpu->si_fprs); + fprs_write(0); + regs->tstate &= ~TSTATE_PEF; if (fprs & FPRS_DL) - copy_from_user(fpregs, &fpu->si_float_regs[0], (sizeof(unsigned int) * 32)); + err |= copy_from_user(fpregs, &fpu->si_float_regs[0], (sizeof(unsigned int) * 32)); if (fprs & FPRS_DU) - copy_from_user(fpregs+16, &fpu->si_float_regs[32], (sizeof(unsigned int) * 32)); - __get_user(fpregs[32], &fpu->si_fsr); - __get_user(fpregs[33], &fpu->si_gsr); - regs->fprs = fprs; - regs->tstate |= TSTATE_PEF; + err |= copy_from_user(fpregs+16, &fpu->si_float_regs[32], (sizeof(unsigned int) * 32)); + err |= __get_user(current->tss.xfsr[0], &fpu->si_fsr); + err |= __get_user(current->tss.gsr[0], &fpu->si_gsr); + current->tss.fpsaved[0] |= fprs; + return err; } void do_new_sigreturn32(struct pt_regs *regs) @@ -201,6 +208,7 @@ unsigned pc, npc, fpu_save; sigset_t set; unsigned seta[_NSIG_WORDS32]; + int err; regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; sf = (struct new_signal_frame32 *) regs->u_regs [UREG_FP]; @@ -220,34 +228,35 @@ regs->tnpc = npc; /* 2. Restore the state */ - __get_user(regs->y, &sf->info.si_regs.y); - __get_user(psr, &sf->info.si_regs.psr); + err = __get_user(regs->y, &sf->info.si_regs.y); + err |= __get_user(psr, &sf->info.si_regs.psr); - __get_user(regs->u_regs[UREG_G1], &sf->info.si_regs.u_regs[UREG_G1]); - __get_user(regs->u_regs[UREG_G2], &sf->info.si_regs.u_regs[UREG_G2]); - __get_user(regs->u_regs[UREG_G3], &sf->info.si_regs.u_regs[UREG_G3]); - __get_user(regs->u_regs[UREG_G4], &sf->info.si_regs.u_regs[UREG_G4]); - __get_user(regs->u_regs[UREG_G5], &sf->info.si_regs.u_regs[UREG_G5]); - __get_user(regs->u_regs[UREG_G6], &sf->info.si_regs.u_regs[UREG_G6]); - __get_user(regs->u_regs[UREG_G7], &sf->info.si_regs.u_regs[UREG_G7]); - __get_user(regs->u_regs[UREG_I0], &sf->info.si_regs.u_regs[UREG_I0]); - __get_user(regs->u_regs[UREG_I1], &sf->info.si_regs.u_regs[UREG_I1]); - __get_user(regs->u_regs[UREG_I2], &sf->info.si_regs.u_regs[UREG_I2]); - __get_user(regs->u_regs[UREG_I3], &sf->info.si_regs.u_regs[UREG_I3]); - __get_user(regs->u_regs[UREG_I4], &sf->info.si_regs.u_regs[UREG_I4]); - __get_user(regs->u_regs[UREG_I5], &sf->info.si_regs.u_regs[UREG_I5]); - __get_user(regs->u_regs[UREG_I6], &sf->info.si_regs.u_regs[UREG_I6]); - __get_user(regs->u_regs[UREG_I7], &sf->info.si_regs.u_regs[UREG_I7]); + err |= __get_user(regs->u_regs[UREG_G1], &sf->info.si_regs.u_regs[UREG_G1]); + err |= __get_user(regs->u_regs[UREG_G2], &sf->info.si_regs.u_regs[UREG_G2]); + err |= __get_user(regs->u_regs[UREG_G3], &sf->info.si_regs.u_regs[UREG_G3]); + err |= __get_user(regs->u_regs[UREG_G4], &sf->info.si_regs.u_regs[UREG_G4]); + err |= __get_user(regs->u_regs[UREG_G5], &sf->info.si_regs.u_regs[UREG_G5]); + err |= __get_user(regs->u_regs[UREG_G6], &sf->info.si_regs.u_regs[UREG_G6]); + err |= __get_user(regs->u_regs[UREG_G7], &sf->info.si_regs.u_regs[UREG_G7]); + err |= __get_user(regs->u_regs[UREG_I0], &sf->info.si_regs.u_regs[UREG_I0]); + err |= __get_user(regs->u_regs[UREG_I1], &sf->info.si_regs.u_regs[UREG_I1]); + err |= __get_user(regs->u_regs[UREG_I2], &sf->info.si_regs.u_regs[UREG_I2]); + err |= __get_user(regs->u_regs[UREG_I3], &sf->info.si_regs.u_regs[UREG_I3]); + err |= __get_user(regs->u_regs[UREG_I4], &sf->info.si_regs.u_regs[UREG_I4]); + err |= __get_user(regs->u_regs[UREG_I5], &sf->info.si_regs.u_regs[UREG_I5]); + err |= __get_user(regs->u_regs[UREG_I6], &sf->info.si_regs.u_regs[UREG_I6]); + err |= __get_user(regs->u_regs[UREG_I7], &sf->info.si_regs.u_regs[UREG_I7]); /* User can only change condition codes in %tstate. */ regs->tstate &= ~(TSTATE_ICC); regs->tstate |= psr_to_tstate_icc(psr); - __get_user(fpu_save, &sf->fpu_save); + err |= __get_user(fpu_save, &sf->fpu_save); if (fpu_save) - restore_fpu_state32(regs, &sf->fpu_state); - if (__get_user(seta[0], &sf->info.si_mask) || - copy_from_user(seta+1, &sf->extramask, (_NSIG_WORDS32 - 1) * sizeof(unsigned))) + err |= restore_fpu_state32(regs, &sf->fpu_state); + err |= __get_user(seta[0], &sf->info.si_mask); + err |= copy_from_user(seta+1, &sf->extramask, (_NSIG_WORDS32 - 1) * sizeof(unsigned)); + if (err) goto segv; switch (_NSIG_WORDS) { case 4: set.sig[3] = seta[6] + (((long)seta[7]) << 32); @@ -262,8 +271,7 @@ spin_unlock_irq(¤t->sigmask_lock); return; segv: - lock_kernel(); - do_exit(SIGSEGV); + send_sig(SIGSEGV, current, 1); } asmlinkage void do_sigreturn32(struct pt_regs *regs) @@ -272,6 +280,7 @@ unsigned pc, npc, psr; sigset_t set; unsigned seta[_NSIG_WORDS32]; + int err; synchronize_user_stack(); if (current->tss.new_signal) @@ -284,15 +293,16 @@ (((unsigned long) scptr) & 3)) goto segv; - __get_user(pc, &scptr->sigc_pc); - __get_user(npc, &scptr->sigc_npc); + err = __get_user(pc, &scptr->sigc_pc); + err |= __get_user(npc, &scptr->sigc_npc); if((pc | npc) & 3) goto segv; /* Nice try. */ - if (__get_user(seta[0], &scptr->sigc_mask) || - /* Note that scptr + 1 points to extramask */ - copy_from_user(seta+1, scptr + 1, (_NSIG_WORDS32 - 1) * sizeof(unsigned))) + err |= __get_user(seta[0], &scptr->sigc_mask); + /* Note that scptr + 1 points to extramask */ + err |= copy_from_user(seta+1, scptr + 1, (_NSIG_WORDS32 - 1) * sizeof(unsigned)); + if (err) goto segv; switch (_NSIG_WORDS) { case 4: set.sig[3] = seta[6] + (((long)seta[7]) << 32); @@ -306,22 +316,21 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - __get_user(current->tss.sstk_info.cur_status, &scptr->sigc_onstack); - current->tss.sstk_info.cur_status &= 1; regs->tpc = pc; regs->tnpc = npc; - __get_user(regs->u_regs[UREG_FP], &scptr->sigc_sp); - __get_user(regs->u_regs[UREG_I0], &scptr->sigc_o0); - __get_user(regs->u_regs[UREG_G1], &scptr->sigc_g1); + err = __get_user(regs->u_regs[UREG_FP], &scptr->sigc_sp); + err |= __get_user(regs->u_regs[UREG_I0], &scptr->sigc_o0); + err |= __get_user(regs->u_regs[UREG_G1], &scptr->sigc_g1); /* User can only change condition codes in %tstate. */ - __get_user(psr, &scptr->sigc_psr); + err |= __get_user(psr, &scptr->sigc_psr); + if (err) + goto segv; regs->tstate &= ~(TSTATE_ICC); regs->tstate |= psr_to_tstate_icc(psr); return; segv: - lock_kernel (); - do_exit (SIGSEGV); + send_sig(SIGSEGV, current, 1); } asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) @@ -331,6 +340,8 @@ unsigned pc, npc, fpu_save; sigset_t set; sigset_t32 seta; + stack_t st; + int err; synchronize_user_stack(); regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; @@ -351,34 +362,43 @@ regs->tnpc = npc; /* 2. Restore the state */ - __get_user(regs->y, &sf->regs.y); - __get_user(psr, &sf->regs.psr); + err = __get_user(regs->y, &sf->regs.y); + err |= __get_user(psr, &sf->regs.psr); - __get_user(regs->u_regs[UREG_G1], &sf->regs.u_regs[UREG_G1]); - __get_user(regs->u_regs[UREG_G2], &sf->regs.u_regs[UREG_G2]); - __get_user(regs->u_regs[UREG_G3], &sf->regs.u_regs[UREG_G3]); - __get_user(regs->u_regs[UREG_G4], &sf->regs.u_regs[UREG_G4]); - __get_user(regs->u_regs[UREG_G5], &sf->regs.u_regs[UREG_G5]); - __get_user(regs->u_regs[UREG_G6], &sf->regs.u_regs[UREG_G6]); - __get_user(regs->u_regs[UREG_G7], &sf->regs.u_regs[UREG_G7]); - __get_user(regs->u_regs[UREG_I0], &sf->regs.u_regs[UREG_I0]); - __get_user(regs->u_regs[UREG_I1], &sf->regs.u_regs[UREG_I1]); - __get_user(regs->u_regs[UREG_I2], &sf->regs.u_regs[UREG_I2]); - __get_user(regs->u_regs[UREG_I3], &sf->regs.u_regs[UREG_I3]); - __get_user(regs->u_regs[UREG_I4], &sf->regs.u_regs[UREG_I4]); - __get_user(regs->u_regs[UREG_I5], &sf->regs.u_regs[UREG_I5]); - __get_user(regs->u_regs[UREG_I6], &sf->regs.u_regs[UREG_I6]); - __get_user(regs->u_regs[UREG_I7], &sf->regs.u_regs[UREG_I7]); + err |= __get_user(regs->u_regs[UREG_G1], &sf->regs.u_regs[UREG_G1]); + err |= __get_user(regs->u_regs[UREG_G2], &sf->regs.u_regs[UREG_G2]); + err |= __get_user(regs->u_regs[UREG_G3], &sf->regs.u_regs[UREG_G3]); + err |= __get_user(regs->u_regs[UREG_G4], &sf->regs.u_regs[UREG_G4]); + err |= __get_user(regs->u_regs[UREG_G5], &sf->regs.u_regs[UREG_G5]); + err |= __get_user(regs->u_regs[UREG_G6], &sf->regs.u_regs[UREG_G6]); + err |= __get_user(regs->u_regs[UREG_G7], &sf->regs.u_regs[UREG_G7]); + err |= __get_user(regs->u_regs[UREG_I0], &sf->regs.u_regs[UREG_I0]); + err |= __get_user(regs->u_regs[UREG_I1], &sf->regs.u_regs[UREG_I1]); + err |= __get_user(regs->u_regs[UREG_I2], &sf->regs.u_regs[UREG_I2]); + err |= __get_user(regs->u_regs[UREG_I3], &sf->regs.u_regs[UREG_I3]); + err |= __get_user(regs->u_regs[UREG_I4], &sf->regs.u_regs[UREG_I4]); + err |= __get_user(regs->u_regs[UREG_I5], &sf->regs.u_regs[UREG_I5]); + err |= __get_user(regs->u_regs[UREG_I6], &sf->regs.u_regs[UREG_I6]); + err |= __get_user(regs->u_regs[UREG_I7], &sf->regs.u_regs[UREG_I7]); /* User can only change condition codes in %tstate. */ regs->tstate &= ~(TSTATE_ICC); regs->tstate |= psr_to_tstate_icc(psr); - __get_user(fpu_save, &sf->fpu_save); + err |= __get_user(fpu_save, &sf->fpu_save); if (fpu_save) - restore_fpu_state32(regs, &sf->fpu_state); - if (copy_from_user(&seta, &sf->mask, sizeof(sigset_t32))) - goto segv; + err |= restore_fpu_state32(regs, &sf->fpu_state); + err |= copy_from_user(&seta, &sf->mask, sizeof(sigset_t32)); + err |= __get_user((long)st.ss_sp, &sf->stack.ss_sp); + err |= __get_user(st.ss_flags, &sf->stack.ss_flags); + err |= __get_user(st.ss_size, &sf->stack.ss_size); + if (err) + goto segv; + + /* It is more difficult to avoid calling this function than to + call it and ignore errors. */ + do_sigaltstack(&st, NULL, (unsigned long)sf); + switch (_NSIG_WORDS) { case 4: set.sig[3] = seta.sig[6] + (((long)seta.sig[7]) << 32); case 3: set.sig[2] = seta.sig[4] + (((long)seta.sig[5]) << 32); @@ -392,8 +412,7 @@ spin_unlock_irq(¤t->sigmask_lock); return; segv: - lock_kernel(); - do_exit(SIGSEGV); + send_sig(SIGSEGV, current, 1); } /* Checks if the fp is valid */ @@ -404,6 +423,21 @@ return 0; } +static inline void *get_sigframe(struct sigaction *sa, struct pt_regs *regs, unsigned long framesize) +{ + unsigned long sp; + + regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; + sp = regs->u_regs[UREG_FP]; + + /* This is the X/Open sanctioned signal stack switching. */ + if (sa->sa_flags & SA_ONSTACK) { + if (!on_sig_stack(sp) && !((current->sas_ss_sp + current->sas_ss_size) & 7)) + sp = current->sas_ss_sp + current->sas_ss_size; + } + return (void *)(sp - framesize); +} + static void setup_frame32(struct sigaction *sa, unsigned long pc, unsigned long npc, struct pt_regs *regs, int signr, sigset_t *oldset) @@ -415,13 +449,12 @@ #if 0 int window = 0; #endif - int old_status = current->tss.sstk_info.cur_status; unsigned psr; synchronize_user_stack(); - regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; - sframep = (struct signal_sframe32 *) regs->u_regs[UREG_FP]; - sframep = (struct signal_sframe32 *) (((unsigned long) sframep)-SF_ALIGNEDSZ); + save_and_clear_fpu(); + + sframep = (struct signal_sframe32 *)get_sigframe(sa, regs, SF_ALIGNEDSZ); if (invalid_frame_pointer (sframep, sizeof(*sframep))){ #ifdef DEBUG_SIGNALS /* fills up the console logs during crashme runs, yuck... */ printk("%s [%d]: User has trashed signal stack\n", @@ -439,7 +472,7 @@ sc = &sframep->sig_context; /* We've already made sure frame pointer isn't in kernel space... */ - __put_user(old_status, &sc->sigc_onstack); + __put_user((sas_ss_flags(regs->u_regs[UREG_FP]) == SS_ONSTACK), &sc->sigc_onstack); switch (_NSIG_WORDS) { case 4: seta[7] = (oldset->sig[3] >> 32); @@ -457,7 +490,7 @@ __put_user(pc, &sc->sigc_pc); __put_user(npc, &sc->sigc_npc); psr = tstate_to_psr (regs->tstate); - if(current->tss.flags & SPARC_FLAG_USEDFPU) + if(current->tss.fpsaved[0] & FPRS_FEF) psr |= PSR_EF; __put_user(psr, &sc->sigc_psr); __put_user(regs->u_regs[UREG_G1], &sc->sigc_g1); @@ -501,23 +534,17 @@ static inline void save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t *fpu) { - unsigned long *fpregs = (unsigned long *)(regs+1); + unsigned long *fpregs = (unsigned long *)(((char *)current) + AOFF_task_fpregs); unsigned long fprs; - fprs = (regs->fprs & FPRS_FEF) | - (current->tss.flags & (SPARC_FLAG_USEDFPUL | SPARC_FLAG_USEDFPUU)); + fprs = current->tss.fpsaved[0]; if (fprs & FPRS_DL) copy_to_user(&fpu->si_float_regs[0], fpregs, (sizeof(unsigned int) * 32)); - else - clear_user(&fpu->si_float_regs[0], (sizeof(unsigned int) * 32)); if (fprs & FPRS_DU) copy_to_user(&fpu->si_float_regs[32], fpregs+16, (sizeof(unsigned int) * 32)); - else - clear_user(&fpu->si_float_regs[32], (sizeof(unsigned int) * 32)); - __put_user(fpregs[32], &fpu->si_fsr); - __put_user(fpregs[33], &fpu->si_gsr); + __put_user(current->tss.xfsr[0], &fpu->si_fsr); + __put_user(current->tss.gsr[0], &fpu->si_gsr); __put_user(fprs, &fpu->si_fprs); - regs->tstate &= ~TSTATE_PEF; } static inline void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, @@ -531,12 +558,13 @@ /* 1. Make sure everything is clean */ synchronize_user_stack(); + save_and_clear_fpu(); + sigframe_size = NF_ALIGNEDSZ; - if (!(current->tss.flags & SPARC_FLAG_USEDFPU)) + if (!(current->tss.fpsaved[0] & FPRS_FEF)) sigframe_size -= sizeof(__siginfo_fpu_t); - regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; - sf = (struct new_signal_frame32 *)(regs->u_regs[UREG_FP] - sigframe_size); + sf = (struct new_signal_frame32 *)get_sigframe(&ka->sa, regs, sigframe_size); if (invalid_frame_pointer (sf, sigframe_size)) { #ifdef DEBUG_SIGNALS @@ -559,7 +587,7 @@ __put_user(regs->tnpc, &sf->info.si_regs.npc); __put_user(regs->y, &sf->info.si_regs.y); psr = tstate_to_psr (regs->tstate); - if(current->tss.flags & SPARC_FLAG_USEDFPU) + if(current->tss.fpsaved[0] & FPRS_FEF) psr |= PSR_EF; __put_user(psr, &sf->info.si_regs.psr); for (i = 0; i < 16; i++) @@ -649,9 +677,10 @@ int i; synchronize_user_stack(); + save_and_clear_fpu(); + regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; - sfp = (svr4_signal_frame_t *) regs->u_regs[UREG_FP] - REGWIN_SZ; - sfp = (svr4_signal_frame_t *) (((unsigned long) sfp)-SVR4_SF_ALIGNED); + sfp = (svr4_signal_frame_t *) get_sigframe(sa, regs, REGWIN_SZ + SVR4_SF_ALIGNED); if (invalid_frame_pointer (sfp, sizeof (*sfp))){ #ifdef DEBUG_SIGNALS @@ -688,7 +717,7 @@ __put_user(regs->tpc, &((*gr) [SVR4_PC])); __put_user(regs->tnpc, &((*gr) [SVR4_NPC])); psr = tstate_to_psr (regs->tstate); - if(current->tss.flags & SPARC_FLAG_USEDFPU) + if(current->tss.fpsaved[0] & FPRS_FEF) psr |= PSR_EF; __put_user(psr, &((*gr) [SVR4_PSR])); __put_user(regs->y, &((*gr) [SVR4_Y])); @@ -699,10 +728,10 @@ for (i = 0; i < 8; i++) __put_user(regs->u_regs[UREG_I0+i], (&(*gr)[SVR4_O0])+i); - /* Setup sigaltstack, FIXME */ - __put_user(0xdeadbeef, &uc->stack.sp); - __put_user(0, &uc->stack.size); - __put_user(0, &uc->stack.flags); /* Possible: ONSTACK, DISABLE */ + /* Setup sigaltstack */ + __put_user(current->sas_ss_sp, &uc->stack.sp); + __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &uc->stack.flags); + __put_user(current->sas_ss_size, &uc->stack.size); /* Save the currently window file: */ @@ -773,6 +802,8 @@ int i; synchronize_user_stack(); + save_and_clear_fpu(); + if (current->tss.w_saved){ printk ("Uh oh, w_saved is not zero (%d)\n", (int) current->tss.w_saved); lock_kernel(); @@ -797,9 +828,14 @@ /* Store registers */ __put_user(regs->tpc, &uc->mcontext.greg [SVR4_PC]); __put_user(regs->tnpc, &uc->mcontext.greg [SVR4_NPC]); - __put_user((tstate_to_psr(regs->tstate) | - ((current->tss.flags & SPARC_FLAG_USEDFPU) ? PSR_EF : 0)), - &uc->mcontext.greg [SVR4_PSR]); +#if 1 + __put_user(0, &uc->mcontext.greg [SVR4_PSR]); +#else + i = tstate_to_psr(regs->tstate) & ~PSR_EF; + if (current->tss.fpsaved[0] & FPRS_FEF) + i |= PSR_EF; + __put_user(i, &uc->mcontext.greg [SVR4_PSR]); +#endif __put_user(regs->y, &uc->mcontext.greg [SVR4_Y]); /* Copy g [1..7] and o [0..7] registers */ @@ -808,10 +844,10 @@ for (i = 0; i < 8; i++) __put_user(regs->u_regs[UREG_I0+i], (&(*gr)[SVR4_O0])+i); - /* Setup sigaltstack, FIXME */ - __put_user(0xdeadbeef, &uc->stack.sp); - __put_user(0, &uc->stack.size); - __put_user(0, &uc->stack.flags); /* Possible: ONSTACK, DISABLE */ + /* Setup sigaltstack */ + __put_user(current->sas_ss_sp, &uc->stack.sp); + __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &uc->stack.flags); + __put_user(current->sas_ss_size, &uc->stack.size); /* The register file is not saved * we have already stuffed all of it with sync_user_stack @@ -828,7 +864,8 @@ u32 pc, npc, psr; sigset_t set; svr4_sigset_t setv; - int i; + int i, err; + stack_t st; /* Fixme: restore windows, or is this already taken care of in * svr4_setup_frame when sync_user_windows is done? @@ -851,20 +888,34 @@ /* Check for valid PC and nPC */ gr = &c->mcontext.greg; - __get_user(pc, &((*gr)[SVR4_PC])); - __get_user(npc, &((*gr)[SVR4_NPC])); + err = __get_user(pc, &((*gr)[SVR4_PC])); + err |= __get_user(npc, &((*gr)[SVR4_NPC])); if((pc | npc) & 3) { +#ifdef DEBUG_SIGNALS printk ("setcontext, PC or nPC were bogus\n"); +#endif goto sigsegv; } + /* Retrieve information from passed ucontext */ - /* note that nPC is ored a 1, this is used to inform entry.S */ - /* that we don't want it to mess with our PC and nPC */ - if (copy_from_user (&setv, &c->sigmask, sizeof(svr4_sigset_t))) - goto sigsegv; + /* note that nPC is ored a 1, this is used to inform entry.S */ + /* that we don't want it to mess with our PC and nPC */ + + err |= copy_from_user (&setv, &c->sigmask, sizeof(svr4_sigset_t)); set.sig[0] = setv.sigbits[0] | (((long)setv.sigbits[1]) << 32); if (_NSIG_WORDS >= 2) set.sig[1] = setv.sigbits[2] | (((long)setv.sigbits[3]) << 32); + + err |= __get_user((long)st.ss_sp, &c->stack.sp); + err |= __get_user(st.ss_flags, &c->stack.flags); + err |= __get_user(st.ss_size, &c->stack.size); + if (err) + goto sigsegv; + + /* It is more difficult to avoid calling this function than to + call it and ignore errors. */ + do_sigaltstack(&st, NULL, regs->u_regs[UREG_I6]); + sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = set; @@ -904,12 +955,13 @@ /* 1. Make sure everything is clean */ synchronize_user_stack(); + save_and_clear_fpu(); + sigframe_size = RT_ALIGNEDSZ; - if (!(current->tss.flags & SPARC_FLAG_USEDFPU)) + if (!(current->tss.fpsaved[0] & FPRS_FEF)) sigframe_size -= sizeof(__siginfo_fpu_t); - regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; - sf = (struct rt_signal_frame32 *)(regs->u_regs[UREG_FP] - sigframe_size); + sf = (struct rt_signal_frame32 *)get_sigframe(&ka->sa, regs, sigframe_size); if (invalid_frame_pointer (sf, sigframe_size)) { #ifdef DEBUG_SIGNALS @@ -932,7 +984,7 @@ __put_user(regs->tnpc, &sf->regs.npc); __put_user(regs->y, &sf->regs.y); psr = tstate_to_psr (regs->tstate); - if(current->tss.flags & SPARC_FLAG_USEDFPU) + if(current->tss.fpsaved[0] & FPRS_FEF) psr |= PSR_EF; __put_user(psr, &sf->regs.psr); for (i = 0; i < 16; i++) @@ -944,6 +996,11 @@ } else { __put_user(0, &sf->fpu_save); } + + /* Setup sigaltstack */ + __put_user(current->sas_ss_sp, &sf->stack.ss_sp); + __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); + __put_user(current->sas_ss_size, &sf->stack.ss_size); switch (_NSIG_WORDS) { case 4: seta.sig[7] = (oldset->sig[3] >> 32); @@ -1048,6 +1105,60 @@ } } +#ifdef DEBUG_SIGNALS_MAPS + +#define MAPS_LINE_FORMAT "%016lx-%016lx %s %016lx %s %lu " + +static inline void read_maps (void) +{ + struct vm_area_struct * map, * next; + char * buffer; + ssize_t i; + + buffer = (char*)__get_free_page(GFP_KERNEL); + if (!buffer) + return; + + for (map = current->mm->mmap ; map ; map = next ) { + /* produce the next line */ + char *line; + char str[5], *cp = str; + int flags; + kdev_t dev; + unsigned long ino; + + /* + * Get the next vma now (but it won't be used if we sleep). + */ + next = map->vm_next; + flags = map->vm_flags; + + *cp++ = flags & VM_READ ? 'r' : '-'; + *cp++ = flags & VM_WRITE ? 'w' : '-'; + *cp++ = flags & VM_EXEC ? 'x' : '-'; + *cp++ = flags & VM_MAYSHARE ? 's' : 'p'; + *cp++ = 0; + + dev = 0; + ino = 0; + if (map->vm_file != NULL) { + dev = map->vm_file->f_dentry->d_inode->i_dev; + ino = map->vm_file->f_dentry->d_inode->i_ino; + line = d_path(map->vm_file->f_dentry, buffer, PAGE_SIZE); + } + printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_offset, + kdevname(dev), ino); + if (map->vm_file != NULL) + printk("%s\n", line); + else + printk("\n"); + } + free_page((unsigned long)buffer); + return; +} + +#endif + /* Note that 'init' is a special process: it doesn't get signals it doesn't * want to handle. Thus you cannot kill init even with a SIGKILL even by * mistake. @@ -1144,8 +1255,25 @@ } #ifdef DEBUG_SIGNALS /* Very useful to debug dynamic linker problems */ - printk ("Sig ILL going...\n"); + printk ("Sig %ld going for %s[%d]...\n", signr, current->comm, current->pid); show_regs (regs); +#ifdef DEBUG_SIGNALS_TRACE + { + struct reg_window32 *rw = (struct reg_window32 *)(regs->u_regs[UREG_FP] & 0xffffffff); + unsigned int ins[8]; + + while(rw && + !(((unsigned long) rw) & 0x3)) { + copy_from_user(ins, &rw->ins[0], sizeof(ins)); + printk("Caller[%08x](%08x,%08x,%08x,%08x,%08x,%08x)\n", ins[7], ins[0], ins[1], ins[2], ins[3], ins[4], ins[5]); + rw = (struct reg_window32 *)(unsigned long)ins[6]; + } + } +#endif +#ifdef DEBUG_SIGNALS_MAPS + printk("Maps:\n"); + read_maps(); +#endif #endif /* fall through */ default: @@ -1178,28 +1306,60 @@ int cur_status; }; -asmlinkage int sys32_sigstack(u32 u_ssptr, u32 u_ossptr) +asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp) { struct sigstack32 *ssptr = (struct sigstack32 *)((unsigned long)(u_ssptr)); struct sigstack32 *ossptr = (struct sigstack32 *)((unsigned long)(u_ossptr)); int ret = -EFAULT; - lock_kernel(); /* First see if old state is wanted. */ - if(ossptr) { - if (put_user ((u64)current->tss.sstk_info.the_stack, &ossptr->the_stack) || - __put_user (current->tss.sstk_info.cur_status, &ossptr->cur_status)) + if (ossptr) { + if (put_user(current->sas_ss_sp + current->sas_ss_size, &ossptr->the_stack) || + __put_user(on_sig_stack(sp), &ossptr->cur_status)) goto out; } - + /* Now see if we want to update the new state. */ - if(ssptr) { - if (get_user ((u64)current->tss.sstk_info.the_stack, &ssptr->the_stack) || - __put_user (current->tss.sstk_info.cur_status, &ssptr->cur_status)) + if (ssptr) { + void *ss_sp; + + if (get_user((long)ss_sp, &ssptr->the_stack)) goto out; + /* If the current stack was set with sigaltstack, don't + swap stacks while we are on it. */ + ret = -EPERM; + if (current->sas_ss_sp && on_sig_stack(sp)) + goto out; + + /* Since we don't know the extent of the stack, and we don't + track onstack-ness, but rather calculate it, we must + presume a size. Ho hum this interface is lossy. */ + current->sas_ss_sp = (unsigned long)ss_sp - SIGSTKSZ; + current->sas_ss_size = SIGSTKSZ; } + ret = 0; out: - unlock_kernel(); + return ret; +} + +asmlinkage int do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp) +{ + stack_t uss, uoss; + int ret; + mm_segment_t old_fs; + + if (ussa && (get_user((long)uss.ss_sp, &((stack_t32 *)(long)ussa)->ss_sp) || + __get_user(uss.ss_flags, &((stack_t32 *)(long)ussa)->ss_flags) || + __get_user(uss.ss_size, &((stack_t32 *)(long)ussa)->ss_size))) + return -EFAULT; + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = do_sigaltstack(ussa ? &uss : NULL, uossa ? &uoss : NULL, sp); + set_fs(old_fs); + if (!ret && uossa && (put_user((long)uoss.ss_sp, &((stack_t32 *)(long)uossa)->ss_sp) || + __put_user(uoss.ss_flags, &((stack_t32 *)(long)uossa)->ss_flags) || + __put_user(uoss.ss_size, &((stack_t32 *)(long)uossa)->ss_size))) + return -EFAULT; return ret; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c --- v2.1.114/linux/arch/sparc64/kernel/smp.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/smp.c Tue Aug 4 23:57:51 1998 @@ -3,7 +3,6 @@ * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) */ -#include #include #include #include @@ -48,7 +47,8 @@ volatile int cpu_number_map[NR_CPUS]; volatile int __cpu_logical_map[NR_CPUS]; -struct klock_info klock_info = { KLOCK_CLEAR, 0 }; +/* Kernel spinlock */ +spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; __initfunc(void smp_setup(char *str, int *ints)) { @@ -63,8 +63,7 @@ for (i = 0; i < NR_CPUS; i++) if(cpu_present_map & (1UL << i)) len += sprintf(buf + len, - "CPU%d:\t\t%s\n", - i, klock_info.akp == i ? "akp" : "online"); + "CPU%d:\t\tonline\n", i return len; } @@ -86,8 +85,8 @@ cpu_data[id].udelay_val = loops_per_sec; cpu_data[id].irq_count = 0; cpu_data[id].pgcache_size = 0; + cpu_data[id].pgdcache_size = 0; cpu_data[id].pgd_cache = NULL; - cpu_data[id].pmd_cache = NULL; cpu_data[id].pte_cache = NULL; } @@ -163,8 +162,6 @@ panic("SMP bolixed\n"); } -static void smp_tickoffset_init(void); - extern struct prom_cpuinfo linux_cpus[NR_CPUS]; extern unsigned long smp_trampoline; @@ -174,23 +171,8 @@ int cpucount = 0, i; printk("Entering UltraSMPenguin Mode...\n"); - boot_cpu_id = hard_smp_processor_id(); - smp_tickoffset_init(); __sti(); - cpu_present_map = 0; - for(i = 0; i < linux_num_cpus; i++) - cpu_present_map |= (1UL << linux_cpus[i].mid); - for(i = 0; i < NR_CPUS; i++) { - cpu_number_map[i] = -1; - __cpu_logical_map[i] = -1; - } - cpu_number_map[boot_cpu_id] = 0; - prom_cpu_nodes[boot_cpu_id] = linux_cpus[0].prom_node; - __cpu_logical_map[0] = boot_cpu_id; - klock_info.akp = boot_cpu_id; - current->processor = boot_cpu_id; smp_store_cpu_info(boot_cpu_id); - smp_setup_percpu_timer(); if(linux_num_cpus == 1) return; @@ -406,7 +388,7 @@ smp_cross_call(&xcall_flush_tlb_mm, ctx, 0, 0); local_flush_and_out: - __flush_tlb_mm(ctx); + __flush_tlb_mm(ctx, SECONDARY_CONTEXT); } void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start, @@ -422,7 +404,9 @@ smp_cross_call(&xcall_flush_tlb_range, ctx, start, end); local_flush_and_out: - __flush_tlb_range(ctx, start, end); + start &= PAGE_MASK; + end &= PAGE_MASK; + __flush_tlb_range(ctx, start, SECONDARY_CONTEXT, end, PAGE_SIZE, (end-start)); } void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page) @@ -449,7 +433,7 @@ smp_cross_call(&xcall_flush_tlb_page, ctx, page, 0); local_flush_and_out: - __flush_tlb_page(ctx, page); + __flush_tlb_page(ctx, (page & PAGE_MASK), SECONDARY_CONTEXT); } /* CPU capture. */ @@ -511,8 +495,7 @@ static inline void sparc64_do_profile(unsigned long pc) { -#ifdef CONFIG_PROFILE - if(prof_buffer && current->pid) { + if (prof_buffer && current->pid) { extern int _stext; pc -= (unsigned long) &_stext; @@ -522,7 +505,6 @@ pc = prof_len - 1; atomic_inc((atomic_t *)&prof_buffer[pc]); } -#endif } static unsigned long current_tick_offset; @@ -554,8 +536,8 @@ do { if(!user) sparc64_do_profile(regs->tpc); - if(!--prof_counter(cpu)) { - + if(!--prof_counter(cpu)) + { if (cpu == boot_cpu_id) { extern void irq_enter(int, int); extern void irq_exit(int, int); @@ -574,7 +556,7 @@ update_one_process(current, 1, user, !user, cpu); if(--current->counter < 0) { current->counter = 0; - need_resched = 1; + current->need_resched = 1; } if(user) { @@ -592,7 +574,6 @@ atomic_inc((atomic_t *)inc); atomic_inc((atomic_t *)inc2); } - prof_counter(cpu) = prof_multiplier(cpu); } @@ -611,49 +592,6 @@ prof_counter(cpu) = prof_multiplier(cpu) = 1; - if (cpu == boot_cpu_id) { - extern unsigned long tl0_itick; - extern unsigned long tl0_smp_itick; - unsigned long flags; - - save_flags(flags); cli(); - - /* - * Steal TICK_INT interrupts from timer_interrupt(). - */ - __asm__ __volatile__(" - .globl tl0_smp_itick - b,pt %%xcc, 1f - nop - - tl0_smp_itick: - rdpr %%pil, %%g2 - wrpr %%g0, 15, %%pil - b,pt %%xcc, etrap_irq - rd %%pc, %%g7 - call smp_percpu_timer_interrupt - add %%sp, %0, %%o0 - b,pt %%xcc, rtrap - clr %%l6 - - 1:" - : /* no outputs */ - : "i" (STACK_BIAS + REGWIN_SZ)); - - memcpy(&tl0_itick, &tl0_smp_itick, 8 * 4); - - __asm__ __volatile__(" - membar #StoreStore - flush %0 + 0x00 - flush %0 + 0x08 - flush %0 + 0x10 - flush %0 + 0x18" - : /* no outputs */ - : "r" (&tl0_itick)); - - restore_flags(flags); - } - __asm__ __volatile__("rd %%tick, %%g1\n\t" "add %%g1, %0, %%g1\n\t" "wr %%g1, 0x0, %%tick_cmpr" @@ -662,12 +600,27 @@ : "g1"); } -__initfunc(static void smp_tickoffset_init(void)) +__initfunc(void smp_tick_init(void)) { + int i; + + boot_cpu_id = hard_smp_processor_id(); current_tick_offset = timer_tick_offset; + cpu_present_map = 0; + for(i = 0; i < linux_num_cpus; i++) + cpu_present_map |= (1UL << linux_cpus[i].mid); + for(i = 0; i < NR_CPUS; i++) { + cpu_number_map[i] = -1; + __cpu_logical_map[i] = -1; + } + cpu_number_map[boot_cpu_id] = 0; + prom_cpu_nodes[boot_cpu_id] = linux_cpus[0].prom_node; + __cpu_logical_map[0] = boot_cpu_id; + current->processor = boot_cpu_id; + prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1; } -__initfunc(int setup_profiling_timer(unsigned int multiplier)) +int __init setup_profiling_timer(unsigned int multiplier) { unsigned long flags; int i; diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/sparc64_ksyms.c linux/arch/sparc64/kernel/sparc64_ksyms.c --- v2.1.114/linux/arch/sparc64/kernel/sparc64_ksyms.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/sparc64_ksyms.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sparc64_ksyms.c,v 1.36 1998/04/16 07:07:19 ecd Exp $ +/* $Id: sparc64_ksyms.c,v 1.39 1998/07/04 12:35:59 ecd Exp $ * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -139,6 +139,8 @@ EXPORT_SYMBOL(ebus_chain); EXPORT_SYMBOL(pci_dvma_offset); EXPORT_SYMBOL(pci_dvma_mask); +EXPORT_SYMBOL(pci_dvma_v2p_hash); +EXPORT_SYMBOL(pci_dvma_p2v_hash); EXPORT_SYMBOL(empty_zero_page); EXPORT_SYMBOL(outsb); EXPORT_SYMBOL(outsw); diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/sys32.S linux/arch/sparc64/kernel/sys32.S --- v2.1.114/linux/arch/sparc64/kernel/sys32.S Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/kernel/sys32.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sys32.S,v 1.5 1998/03/24 05:57:56 ecd Exp $ +/* $Id: sys32.S,v 1.6 1998/06/28 08:28:22 ecd Exp $ * sys32.S: I-cache tricks for 32-bit compatability layer simple * conversions. * @@ -84,7 +84,7 @@ srl %o3, 0, %o3 mov %o7, %g1 srl %o4, 0, %o4 - call sys_setsockopt + call sys_getsockopt mov %g1, %o7 .globl sys32_bdflush diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/sys_sparc.c linux/arch/sparc64/kernel/sys_sparc.c --- v2.1.114/linux/arch/sparc64/kernel/sys_sparc.c Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/kernel/sys_sparc.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sys_sparc.c,v 1.13 1998/03/29 10:10:52 davem Exp $ +/* $Id: sys_sparc.c,v 1.20 1998/08/03 20:03:26 davem Exp $ * linux/arch/sparc64/kernel/sys_sparc.c * * This file contains various random system calls that @@ -38,17 +38,9 @@ asmlinkage unsigned long sparc_brk(unsigned long brk) { - unsigned long ret; - - lock_kernel(); - if(brk >= 0x80000000000UL) { /* VM hole */ - ret = current->mm->brk; - goto out; - } - ret = sys_brk(brk); -out: - unlock_kernel(); - return ret; + if(brk >= 0x80000000000UL) /* VM hole */ + return current->mm->brk; + return sys_brk(brk); } /* @@ -129,16 +121,6 @@ if (call <= SHMCTL) switch (call) { case SHMAT: - if (first >= 0) { - extern struct shmid_ds *shm_segs[]; - struct shmid_ds *shp = shm_segs[(unsigned int) first % SHMMNI]; - if (shp == IPC_UNUSED || shp == IPC_NOID) { - err = -ENOMEM; - if ((unsigned long)ptr >= 0x80000000000UL - shp->shm_segsz && - (unsigned long)ptr < 0xfffff80000000000UL) - goto out; /* Somebody is trying to fool us */ - } - } err = sys_shmat (first, (char *) ptr, second, (ulong *) third); goto out; case SHMDT: @@ -161,8 +143,6 @@ return err; } -extern unsigned long get_unmapped_area(unsigned long addr, unsigned long len); - /* Linux version of mmap */ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, @@ -245,15 +225,23 @@ asmlinkage int sys_getdomainname(char *name, int len) { - int nlen = strlen(system_utsname.domainname); + int nlen; + int err = -EFAULT; + + down(&uts_sem); + + nlen = strlen(system_utsname.domainname) + 1; if (nlen < len) len = nlen; if(len > __NEW_UTS_LEN) - return -EFAULT; + goto done; if(copy_to_user(name, system_utsname.domainname, len)) - return -EFAULT; - return 0; + goto done; + err = 0; +done: + up(&uts_sem); + return err; } /* only AP+ systems have sys_aplib */ diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/sys_sparc32.c linux/arch/sparc64/kernel/sys_sparc32.c --- v2.1.114/linux/arch/sparc64/kernel/sys_sparc32.c Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/sys_sparc32.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sys_sparc32.c,v 1.83 1998/05/04 05:35:39 jj Exp $ +/* $Id: sys_sparc32.c,v 1.90 1998/07/29 16:32:30 jj Exp $ * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -58,27 +58,10 @@ */ #define A(x) ((unsigned long)x) -extern char * getname_quicklist; -extern int getname_quickcount; -extern spinlock_t getname_quicklock; - -/* Tuning: increase locality by reusing same pages again... - * if getname_quicklist becomes too long on low memory machines, either a limit - * should be added or after a number of cycles some pages should - * be released again ... - */ static inline char * get_page(void) { char * res; - spin_lock(&getname_quicklock); - res = getname_quicklist; - if (res) { - getname_quicklist = *(char**)res; - getname_quickcount--; - } - spin_unlock(&getname_quicklock); - if (!res) - res = (char*)__get_free_page(GFP_KERNEL); + res = (char *)__get_free_page(GFP_KERNEL); return res; } @@ -1242,27 +1225,6 @@ return ret; } -extern asmlinkage int sys_xstat(int ver, char *filename, struct stat64 * statbuf); - -asmlinkage int sys32_xstat(int ver, u32 file, u32 statbuf) -{ - switch (ver & __XSTAT_VER_MASK) { - case __XSTAT_VER_1: - switch (ver & __XSTAT_VER_TYPEMASK) { - case __XSTAT_VER_XSTAT: - return sys32_newstat(file, statbuf); - case __XSTAT_VER_LXSTAT: - return sys32_newlstat(file, statbuf); - case __XSTAT_VER_FXSTAT: - return sys32_newfstat(file, statbuf); - } - return -EINVAL; - case __XSTAT_VER_2: - return sys_xstat(ver, (char *)A(file), (struct stat64 *)A(statbuf)); - } - return -EINVAL; -} - extern asmlinkage int sys_sysfs(int option, unsigned long arg1, unsigned long arg2); asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2) @@ -2551,16 +2513,14 @@ return 0; p -= len; pos = p; while (len) { - char *pag = (char *) page[pos/PAGE_SIZE]; + char *pag; int offset, bytes_to_copy; offset = pos % PAGE_SIZE; - if(!pag) { - pag = (char *) page[pos/PAGE_SIZE] = get_user_page(pos); - if(!pag) - return 0; - clear_page(pag); - } + if (!(pag = (char *) page[pos/PAGE_SIZE]) && + !(pag = (char *) page[pos/PAGE_SIZE] = + (unsigned long *) get_free_page(GFP_USER))) + return 0; bytes_to_copy = PAGE_SIZE - offset; if (bytes_to_copy > len) bytes_to_copy = len; @@ -2659,7 +2619,8 @@ if(!error) { fprs_write(0); - regs->fprs = 0; + current->tss.xfsr[0] = 0; + current->tss.fpsaved[0] = 0; regs->tstate &= ~TSTATE_PEF; } out: @@ -3506,5 +3467,26 @@ unlock_kernel(); if (ret == PER_LINUX32) ret = PER_LINUX; + return ret; +} + +extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count); + +asmlinkage int sys32_sendfile(int out_fd, int in_fd, u32 offset, s32 count) +{ + mm_segment_t old_fs = get_fs(); + int ret; + off_t of; + + if (offset && get_user(of, (__kernel_off_t32 *)A(offset))) + return -EFAULT; + + set_fs(KERNEL_DS); + ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); + set_fs(old_fs); + + if (!ret && offset && put_user(of, (__kernel_off_t32 *)A(offset))) + return -EFAULT; + return ret; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/sys_sunos32.c linux/arch/sparc64/kernel/sys_sunos32.c --- v2.1.114/linux/arch/sparc64/kernel/sys_sunos32.c Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/kernel/sys_sunos32.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sys_sunos32.c,v 1.11 1998/03/29 10:10:55 davem Exp $ +/* $Id: sys_sunos32.c,v 1.16 1998/06/16 04:37:06 davem Exp $ * sys_sunos32.c: SunOS binary compatability layer on sparc64. * * Copyright (C) 1995, 1996, 1997 David S. Miller (davem@caip.rutgers.edu) @@ -56,8 +56,6 @@ #define SUNOS_NR_OPEN 256 -extern unsigned long get_unmapped_area(unsigned long addr, unsigned long len); - asmlinkage u32 sunos_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u32 off) { struct file *file = NULL; @@ -259,12 +257,12 @@ * *or* the passed base address is not aligned on a page boundary you * get an error. */ -asmlinkage int sunos_mincore(u32 addr, u32 len, u32 u_array) +asmlinkage int sunos_mincore(u32 __addr, u32 len, u32 u_array) { pgd_t *pgdp; pmd_t *pmdp; pte_t *ptep; - unsigned long limit; + unsigned long limit, addr = (unsigned long)__addr; int num_pages, pnum, retval = -EINVAL; char *array = (char *)A(u_array); @@ -523,26 +521,6 @@ return error; } -asmlinkage int sunos_getdomainname(u32 u_name, int len) -{ - int nlen = strlen(system_utsname.domainname); - int ret = -EFAULT; - char *name = (char *)A(u_name); - - lock_kernel(); - if (nlen < len) - len = nlen; - - if(len > __NEW_UTS_LEN) - goto out; - if(copy_to_user(name, system_utsname.domainname, len)) - goto out; - ret = 0; -out: - unlock_kernel(); - return ret; -} - struct sunos_utsname { char sname[9]; char nname[9]; @@ -557,7 +535,7 @@ struct sunos_utsname *name = (struct sunos_utsname *)A(u_name); int ret = -EFAULT; - lock_kernel(); + down(&uts_sem); if(!name) goto out; if(copy_to_user(&name->sname[0], @@ -573,7 +551,7 @@ copy_to_user(&name->mach[0], &system_utsname.machine[0], sizeof(name->mach) - 1); ret = 0; out: - unlock_kernel(); + up(&uts_sem); return ret; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/systbls.S linux/arch/sparc64/kernel/systbls.S --- v2.1.114/linux/arch/sparc64/kernel/systbls.S Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/kernel/systbls.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: systbls.S,v 1.42 1998/04/14 13:49:52 jj Exp $ +/* $Id: systbls.S,v 1.47 1998/07/28 13:07:55 jj Exp $ * systbls.S: System call entry point tables for OS compatibility. * The native Linux system call table lives here also. * @@ -17,14 +17,14 @@ .globl sys_call_table32 sys_call_table32: -/*0*/ .word sys_setup, sys_exit, sys_fork, sys_read, sys_write +/*0*/ .word sys_setup, sparc_exit, sys_fork, sys_read, sys_write /*5*/ .word sys_open, sys_close, sys32_wait4, sys_creat, sys_link -/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys32_xstat, sys32_mknod -/*15*/ .word sys32_chmod, sys32_lchown, sparc_brk, sys_xmknod, sys32_lseek -/*20*/ .word sys_getpid, sys_nis_syscall, sys_nis_syscall, sys_setuid, sys_getuid -/*25*/ .word sys_time, sys_ptrace, sys_alarm, sys_nis_syscall, sys32_pause +/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_nis_syscall, sys32_mknod +/*15*/ .word sys32_chmod, sys32_lchown, sparc_brk, sys_nis_syscall, sys32_lseek +/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid +/*25*/ .word sys_time, sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause /*30*/ .word sys32_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice - .word sys_nis_syscall, sys_sync, sys_kill, sys32_newstat, sys_nis_syscall + .word sys_nis_syscall, sys_sync, sys_kill, sys32_newstat, sys32_sendfile /*40*/ .word sys32_newlstat, sys_dup, sys_pipe, sys32_times, sys_nis_syscall .word sys_nis_syscall, sys_setgid, sys_getgid, sys_signal, sys_geteuid /*50*/ .word sys_getegid, sys_acct, sys_nis_syscall, sys_nis_syscall, sys32_ioctl @@ -65,8 +65,8 @@ .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid /*230*/ .word sys32_select, sys_time, sys_nis_syscall, sys_stime, sys_nis_syscall .word sys_nis_syscall, sys_llseek, sys_mlock, sys_munlock, sys_mlockall -/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_nis_syscall, sys_nis_syscall - .word sys_nis_syscall, sys_sched_get_priority_max, sys_sched_get_priority_min, sys32_sched_rr_get_interval, sys32_nanosleep +/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler + .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys32_sched_rr_get_interval, sys32_nanosleep /*250*/ .word sys_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys32_nfsservctl .word sys_aplib @@ -76,14 +76,14 @@ .globl sys_call_table64, sys_call_table sys_call_table64: sys_call_table: -/*0*/ .word sys_setup, sys_exit, sys_fork, sys_read, sys_write +/*0*/ .word sys_setup, sparc_exit, sys_fork, sys_read, sys_write /*5*/ .word sys_open, sys_close, sys_wait4, sys_creat, sys_link -/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_xstat, sys_mknod -/*15*/ .word sys_chmod, sys_lchown, sparc_brk, sys_xmknod, sys_lseek -/*20*/ .word sys_getpid, sys_nis_syscall, sys_nis_syscall, sys_setuid, sys_getuid -/*25*/ .word sys_time, sys_ptrace, sys_alarm, sys_nis_syscall, sys_nis_syscall +/*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_nis_syscall, sys_mknod +/*15*/ .word sys_chmod, sys_lchown, sparc_brk, sys_nis_syscall, sys_lseek +/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid +/*25*/ .word sys_time, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice - .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_nis_syscall + .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile /*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall .word sys_nis_syscall, sys_setgid, sys_getgid, sys_signal, sys_geteuid /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl @@ -124,8 +124,8 @@ .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid /*230*/ .word sys_select, sys_time, sys_nis_syscall, sys_stime, sys_nis_syscall .word sys_nis_syscall, sys_llseek, sys_mlock, sys_munlock, sys_mlockall -/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_nis_syscall, sys_nis_syscall - .word sys_nis_syscall, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep +/*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler + .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep /*250*/ .word sys_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl .word sys_aplib @@ -134,7 +134,7 @@ .align 1024 .globl sunos_sys_table sunos_sys_table: -/*0*/ .word sunos_indir, sys_exit, sys_fork +/*0*/ .word sunos_indir, sparc_exit, sys_fork .word sunos_read, sunos_write, sunos_open .word sys_close, sunos_wait4, sys_creat .word sys_link, sys_unlink, sunos_execv @@ -189,7 +189,7 @@ .word sys_poll, sunos_nosys, sunos_nosys .word sunos_getdirentries, sys32_statfs, sys32_fstatfs .word sys_umount, sunos_nosys, sunos_nosys - .word sunos_getdomainname, sys_setdomainname + .word sys_getdomainname, sys_setdomainname .word sunos_nosys, sys32_quotactl, sunos_nosys .word sunos_mount, sys_ustat, sunos_semsys .word sunos_nosys, sunos_shmsys, sunos_audit diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/time.c linux/arch/sparc64/kernel/time.c --- v2.1.114/linux/arch/sparc64/kernel/time.c Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/kernel/time.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.13 1998/03/15 17:23:47 ecd Exp $ +/* $Id: time.c,v 1.15 1998/05/12 22:38:29 ecd Exp $ * time.c: UltraSparc timer and TOD clock support. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -227,13 +227,17 @@ struct linux_prom_registers clk_reg[2]; char model[128]; int node, busnd = -1, err; +#ifdef CONFIG_PCI + struct linux_ebus *ebus = 0; +#endif if(central_bus != NULL) { busnd = central_bus->child->prom_node; } #ifdef CONFIG_PCI else if (ebus_chain != NULL) { - busnd = ebus_chain->prom_node; + ebus = ebus_chain; + busnd = ebus->prom_node; } #endif else { @@ -253,6 +257,15 @@ strcmp(model, "mk48t08") && strcmp(model, "mk48t59")) { node = prom_getsibling(node); +#ifdef CONFIG_PCI + if ((node == 0) && ebus) { + ebus = ebus->next; + if (ebus) { + busnd = ebus->prom_node; + node = prom_getchild(busnd); + } + } +#endif if(node == 0) { prom_printf("clock_probe: Cannot find timer chip\n"); prom_halt(); @@ -275,7 +288,7 @@ else if (ebus_chain) { struct linux_ebus_device *edev; - for_each_ebusdev(edev, ebus_chain) + for_each_ebusdev(edev, ebus) if (edev->prom_node == node) break; if (!edev) { diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/trampoline.S linux/arch/sparc64/kernel/trampoline.S --- v2.1.114/linux/arch/sparc64/kernel/trampoline.S Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/kernel/trampoline.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: trampoline.S,v 1.3 1998/02/22 21:06:11 jj Exp $ +/* $Id: trampoline.S,v 1.5 1998/05/25 05:31:45 davem Exp $ * trampoline.S: Jump start slave processors on sparc64. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -172,13 +172,29 @@ mov %o2, %g6 wrpr %o1, (PSTATE_MG | PSTATE_IE), %pstate -#define KERN_HIGHBITS ((_PAGE_VALID | _PAGE_SZ4MB) ^ 0xfffff80000000000) - sethi %uhi(KERN_HIGHBITS), %g2 - sllx %g2, 32, %g2 -#undef KERN_HIGHBITS - ldx [%o2 + AOFF_task_mm], %g6 - ldx [%g6 + AOFF_mm_pgd], %g6 +#define KERN_HIGHBITS ((_PAGE_VALID | _PAGE_SZ4MB) ^ 0xfffff80000000000) +#define KERN_LOWBITS (_PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_W) +#ifdef THIS_IS_CHEETAH +#error Dave, make sure you took care of other issues in rest of sparc64 code... +#define VPTE_BASE 0xffe0000000000000 +#else /* Spitfire/Blackbird */ +#define VPTE_BASE 0xfffffffe00000000 +#endif + mov TSB_REG, %g1 + stxa %g0, [%g1] ASI_DMMU + membar #Sync + mov TLB_SFSR, %g1 + sethi %uhi(KERN_HIGHBITS), %g2 + or %g2, %ulo(KERN_HIGHBITS), %g2 + sllx %g2, 32, %g2 + or %g2, KERN_LOWBITS, %g2 + sethi %uhi(VPTE_BASE), %g3 + or %g3, %ulo(VPTE_BASE), %g3 + sllx %g3, 32, %g3 clr %g7 +#undef KERN_HIGHBITS +#undef KERN_LOWBITS +#undef VPTE_BASE wrpr %o1, (PSTATE_IG | PSTATE_IE), %pstate sethi %hi(ivector_to_mask), %g5 @@ -186,14 +202,6 @@ mov 0x40, %g2 wrpr %g0, 0, %wstate - wrpr %o1, PSTATE_IE, %pstate - - mov TSB_REG, %o4 - mov 1, %o5 - stxa %o5, [%o4] ASI_DMMU - stxa %o5, [%o4] ASI_IMMU - membar #Sync - or %o1, PSTATE_IE, %o1 wrpr %o1, 0, %pstate diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/traps.c linux/arch/sparc64/kernel/traps.c --- v2.1.114/linux/arch/sparc64/kernel/traps.c Thu May 7 22:51:47 1998 +++ linux/arch/sparc64/kernel/traps.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: traps.c,v 1.49 1998/04/06 16:09:38 jj Exp $ +/* $Id: traps.c,v 1.51 1998/06/12 14:54:20 jj Exp $ * arch/sparc64/kernel/traps.c * * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) @@ -316,10 +316,10 @@ void do_fpieee(struct pt_regs *regs) { -#ifdef DEBUG_FPU - struct fpustate *f = FPUSTATE; - - printk("fpieee %016lx\n", f->fsr); +#ifdef DEBUG_FPU + save_and_clear_fpu(); + + printk("fpieee %016lx\n", current->tss.xfsr[0]); #endif do_fpe_common(regs); } @@ -331,7 +331,8 @@ struct fpustate *f = FPUSTATE; int ret = 0; - switch ((f->fsr & 0x1c000)) { + save_and_clear_fpu(); + switch ((current->tss.xfsr[0] & 0x1c000)) { case (2 << 14): /* unfinished_FPop */ case (3 << 14): /* unimplemented_FPop */ ret = do_mathemu(regs, f); @@ -339,7 +340,7 @@ } if (ret) return; #ifdef DEBUG_FPU - printk("fpother %016lx\n", f->fsr); + printk("fpother %016lx\n", current->tss.xfsr[0]); #endif do_fpe_common(regs); } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/ttable.S linux/arch/sparc64/kernel/ttable.S --- v2.1.114/linux/arch/sparc64/kernel/ttable.S Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/kernel/ttable.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: ttable.S,v 1.23 1998/03/15 17:23:48 ecd Exp $ +/* $Id: ttable.S,v 1.25 1998/05/23 18:24:53 jj Exp $ * ttable.S: Sparc V9 Trap Table(s) with SpitFire extensions. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -6,7 +6,7 @@ #include - .globl sparc64_ttable_tl0, tl0_itick, sparc64_ttable_tl1, + .globl sparc64_ttable_tl0, sparc64_ttable_tl1, sparc64_ttable_tl0: tl0_resv000: BOOT_KERNEL BTRAP(0x1) BTRAP(0x2) BTRAP(0x3) @@ -45,7 +45,11 @@ tl0_irq9: TRAP_IRQ(handler_irq, 9) TRAP_IRQ(handler_irq, 10) tl0_irq11: TRAP_IRQ(handler_irq, 11) TRAP_IRQ(handler_irq, 12) tl0_irq13: TRAP_IRQ(handler_irq, 13) -tl0_itick: TRAP_IRQ(handler_irq, 14) +#ifndef __SMP__ +tl0_irq14: TRAP_IRQ(handler_irq, 14) +#else +tl0_irq14: TICK_SMP_IRQ +#endif tl0_irq15: TRAP_IRQ(handler_irq, 15) tl0_resv050: BTRAP(0x50) BTRAP(0x51) BTRAP(0x52) BTRAP(0x53) BTRAP(0x54) BTRAP(0x55) tl0_resv056: BTRAP(0x56) BTRAP(0x57) BTRAP(0x58) BTRAP(0x59) BTRAP(0x5a) BTRAP(0x5b) @@ -55,9 +59,9 @@ tl0_vaw: TRAP(do_vaw) tl0_cee: TRAP(do_cee) tl0_iamiss: -#include "itlb_miss.S" +#include "itlb_base.S" tl0_damiss: -#include "dtlb_miss.S" +#include "dtlb_base.S" tl0_daprot: #include "dtlb_prot.S" tl0_resv070: BTRAP(0x70) BTRAP(0x71) BTRAP(0x72) BTRAP(0x73) BTRAP(0x74) BTRAP(0x75) @@ -199,10 +203,9 @@ tl1_paw: TRAPTL1(do_paw_tl1) tl1_vaw: TRAPTL1(do_vaw_tl1) tl1_cee: TRAPTL1(do_cee_tl1) -tl1_iamiss: -#include "itlb_miss.S" +tl1_iamiss: BTRAPTL1(0x64) BTRAPTL1(0x65) BTRAPTL1(0x66) BTRAPTL1(0x67) tl1_damiss: -#include "dtlb_miss.S" +#include "dtlb_backend.S" tl1_daprot: #include "dtlb_prot.S" tl1_resv070: BTRAPTL1(0x70) BTRAPTL1(0x71) BTRAPTL1(0x72) BTRAPTL1(0x73) diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/unaligned.c linux/arch/sparc64/kernel/unaligned.c --- v2.1.114/linux/arch/sparc64/kernel/unaligned.c Mon Jan 12 15:15:44 1998 +++ linux/arch/sparc64/kernel/unaligned.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: unaligned.c,v 1.8 1997/10/14 16:21:24 jj Exp $ +/* $Id: unaligned.c,v 1.10 1998/06/19 13:00:32 jj Exp $ * unaligned.c: Unaligned load/store trap handling with special * cases for the kernel to do them more quickly. * @@ -453,7 +453,7 @@ } else { struct reg_window *win; win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); - get_user(ret, &win->locals[rd - 16]); + put_user(ret, &win->locals[rd - 16]); } } advance(regs); @@ -470,11 +470,12 @@ int freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); struct fpustate *f = FPUSTATE; int asi = decode_asi(insn, regs); - int flag = (freg < 32) ? SPARC_FLAG_USEDFPUL : SPARC_FLAG_USEDFPUU; + int flag = (freg < 32) ? FPRS_DL : FPRS_DU; - f->fsr &= ~0x1c000; + save_and_clear_fpu(); + current->tss.xfsr[0] &= ~0x1c000; if (freg & 3) { - f->fsr |= (6 << 14) /* invalid_fp_register */; + current->tss.xfsr[0] |= (6 << 14) /* invalid_fp_register */; do_fpother(regs); return 0; } @@ -482,7 +483,7 @@ /* STQ */ u64 first = 0, second = 0; - if (current->tss.flags & flag) { + if (current->tss.fpsaved[0] & flag) { first = *(u64 *)&f->regs[freg]; second = *(u64 *)&f->regs[freg+2]; } @@ -545,13 +546,11 @@ second = le32_to_cpup(&third); third = tmp; } - regs->fprs |= FPRS_FEF; - if (!(current->tss.flags & SPARC_FLAG_USEDFPU)) { - current->tss.flags |= SPARC_FLAG_USEDFPU; - f->fsr = 0; - f->gsr = 0; + if (!(current->tss.fpsaved[0] & FPRS_FEF)) { + current->tss.fpsaved[0] = FPRS_FEF; + current->tss.gsr[0] = 0; } - if (!(current->tss.flags & flag)) { + if (!(current->tss.fpsaved[0] & flag)) { if (freg < 32) memset(f->regs, 0, 32*sizeof(u32)); else @@ -561,7 +560,7 @@ f->regs[freg+1] = second; f->regs[freg+2] = third; f->regs[freg+3] = fourth; - current->tss.flags |= flag; + current->tss.fpsaved[0] |= flag; } advance(regs); return 1; @@ -593,25 +592,24 @@ } else goto daex; } + save_and_clear_fpu(); freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); value = (((u64)first) << 32) | second; if (asi & 0x8) /* Little */ value = __swab64p(&value); - flag = (freg < 32) ? SPARC_FLAG_USEDFPUL : SPARC_FLAG_USEDFPUU; - regs->fprs |= FPRS_FEF; - if (!(current->tss.flags & SPARC_FLAG_USEDFPU)) { - current->tss.flags |= SPARC_FLAG_USEDFPU; - f->fsr = 0; - f->gsr = 0; + flag = (freg < 32) ? FPRS_DL : FPRS_DU; + if (!(current->tss.fpsaved[0] & FPRS_FEF)) { + current->tss.fpsaved[0] = FPRS_FEF; + current->tss.gsr[0] = 0; } - if (!(current->tss.flags & flag)) { + if (!(current->tss.fpsaved[0] & flag)) { if (freg < 32) memset(f->regs, 0, 32*sizeof(u32)); else memset(f->regs+32, 0, 32*sizeof(u32)); } *(u64 *)(f->regs + freg) = value; - current->tss.flags |= flag; + current->tss.fpsaved[0] |= flag; } else { daex: data_access_exception(regs); return; @@ -638,10 +636,11 @@ freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); asi = sfsr >> 16; value = 0; - flag = (freg < 32) ? SPARC_FLAG_USEDFPUL : SPARC_FLAG_USEDFPUU; + flag = (freg < 32) ? FPRS_DL : FPRS_DU; if (asi > ASI_SNFL) goto daex; - if (current->tss.flags & flag) + save_and_clear_fpu(); + if (current->tss.fpsaved[0] & flag) value = *(u64 *)&f->regs[freg]; switch (asi) { case ASI_P: diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/kernel/winfixup.S linux/arch/sparc64/kernel/winfixup.S --- v2.1.114/linux/arch/sparc64/kernel/winfixup.S Mon Jan 12 15:15:44 1998 +++ linux/arch/sparc64/kernel/winfixup.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: winfixup.S,v 1.22 1997/10/24 11:57:48 jj Exp $ +/* $Id: winfixup.S,v 1.24 1998/06/12 14:54:19 jj Exp $ * * winfixup.S: Handle cases where user stack pointer is found to be bogus. * @@ -60,15 +60,14 @@ sll %g2, 3, %g2 ! NORMAL-->OTHER wrpr %g0, 0x0, %canrestore ! Standard etrap stuff. - wr %g0, 0x0, %fprs ! zap FPU just in case... wrpr %g2, 0x0, %wstate ! This must be consistant. wrpr %g0, 0x0, %otherwin ! We know this. mov PRIMARY_CONTEXT, %g1 ! Change contexts... stxa %g0, [%g1] ASI_DMMU ! Back into the nucleus. flush %g6 ! Flush instruction buffers rdpr %pstate, %l1 ! Prepare to change globals. - mov %g6, %o7 ! Get current. + andn %l1, PSTATE_MM, %l1 ! We want to be in RMO srlx %g5, PAGE_SHIFT, %o1 ! Fault address wrpr %g0, 0x0, %tl ! Out of trap levels. @@ -166,12 +165,6 @@ add %sp, STACK_BIAS + REGWIN_SZ, %o0 ba,pt %xcc, rtrap clr %l6 -winfix_trampoline: - andn %g3, 0x7f, %g3 - add %g3, 0x7c, %g3 - - wrpr %g3, %tnpc - done .globl winfix_mna, fill_fixup_mna, spill_fixup_mna winfix_mna: diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/Makefile linux/arch/sparc64/lib/Makefile --- v2.1.114/linux/arch/sparc64/lib/Makefile Thu Sep 4 12:54:48 1997 +++ linux/arch/sparc64/lib/Makefile Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.15 1997/08/19 03:11:50 davem Exp $ +# $Id: Makefile,v 1.16 1998/06/12 14:53:53 jj Exp $ # Makefile for Sparc library files.. # @@ -6,7 +6,7 @@ OBJS = PeeCeeI.o blockops.o locks.o strlen.o strncmp.o \ memscan.o strncpy_from_user.o strlen_user.o memcmp.o checksum.o \ - VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o + VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o VISsave.o lib.a: $(OBJS) $(AR) rcs lib.a $(OBJS) diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/VISbzero.S linux/arch/sparc64/lib/VISbzero.S --- v2.1.114/linux/arch/sparc64/lib/VISbzero.S Thu Sep 4 12:54:48 1997 +++ linux/arch/sparc64/lib/VISbzero.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: VISbzero.S,v 1.8 1997/08/22 15:54:50 jj Exp $ +/* $Id: VISbzero.S,v 1.9 1998/06/12 14:53:50 jj Exp $ * VISbzero.S: High speed clear operations utilizing the UltraSparc * Visual Instruction Set. * @@ -9,6 +9,8 @@ #include "VIS.h" #ifdef __KERNEL__ +#include + #define EXN(x,y,a,b,z) \ 98: x,y; \ .section .fixup; \ @@ -141,9 +143,9 @@ 6: andncc %o1, 0x3f, %o3 7: be,pn %xcc, 9f #ifdef __KERNEL__ - rd %asi, %g7 - wr %g0, FPRS_FEF, %fprs - wr %g7, ASI_BLK_XOR, %asi + rd %asi, %o4 + wr %o4, ASI_BLK_XOR, %asi + VISEntryHalf #else wr %g0, ASI_BLK_P, %asi #endif @@ -178,8 +180,8 @@ add %o0, 256, %o0 12: #ifdef __KERNEL__ - wr %g0, 0, %fprs - wr %g7, 0x0, %asi + VISExitHalf + wr %o4, 0x0, %asi #else #ifndef REGS_64BIT wr %g0, FPRS_FEF, %fprs diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/VIScopy.S linux/arch/sparc64/lib/VIScopy.S --- v2.1.114/linux/arch/sparc64/lib/VIScopy.S Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/lib/VIScopy.S Tue Aug 4 16:03:35 1998 @@ -1,9 +1,9 @@ -/* $Id: VIScopy.S,v 1.15 1998/04/26 07:21:54 davem Exp $ +/* $Id: VIScopy.S,v 1.18 1998/06/12 14:53:55 jj Exp $ * VIScopy.S: High speed copy operations utilizing the UltraSparc * Visual Instruction Set. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz) */ #include "VIS.h" @@ -24,12 +24,15 @@ */ #ifdef __KERNEL__ + +#include + #define FPU_CLEAN_RETL \ - wr %g0, 0, %fprs; \ + VISExit \ retl; \ clr %o0; #define FPU_RETL \ - wr %g0, 0, %fprs; \ + VISExit \ retl; \ clr %o0; #define NORMAL_RETL \ @@ -40,7 +43,7 @@ .section .fixup; \ .align 4; \ 99: ba VIScopyfixup_ret; \ - a, b, %o0; \ + a, b, %o1; \ .section __ex_table; \ .align 4; \ .word 98b, 99b; \ @@ -52,7 +55,7 @@ .align 4; \ 99: c, d, e; \ ba VIScopyfixup_ret; \ - a, b, %o0; \ + a, b, %o1; \ .section __ex_table; \ .align 4; \ .word 98b, 99b; \ @@ -298,10 +301,6 @@ .globl __memcpy_entry .type __memcpy_entry,@function - - .globl copy_page - .type copy_page,@function - memcpy_private: __memcpy: memcpy: mov ASI_BLK_P, asi_src ! IEU0 Group @@ -310,12 +309,6 @@ retl clr %o0 -copy_page: wr %g0, FPRS_FEF, %fprs ! FPU Group - sethi %hi(8192), %o2 ! IEU0 Group - mov ASI_BLK_P, asi_src ! IEU1 - b,pt %xcc, dest_is_64byte_aligned ! CTI - mov ASI_BLK_P, asi_dest ! IEU0 Group - .align 32 .globl __copy_from_user .type __copy_from_user,@function @@ -355,7 +348,11 @@ #endif VIS_enter: be,pt %xcc, dest_is_8byte_aligned ! CTI +#ifdef __KERNEL__ + nop ! IEU0 Group +#else andcc %o0, 0x38, %g5 ! IEU1 Group +#endif do_dest_8byte_align: mov 8, %g1 ! IEU0 sub %g1, %g2, %g2 ! IEU0 Group @@ -377,7 +374,8 @@ EX(LDUB [%o1] ASINORMAL, %o5, add %o2, %g2) ! Load Group add %o0, 2, %o0 ! IEU0 - EX(LDUB [%o1 + 1] ASINORMAL, %g3, + EX2(LDUB [%o1 + 1] ASINORMAL, %g3, + sub %o0, 2, %o0, add %o2, %g2) ! Load Group ASI_SETDST_NOBLK ! LSU Group subcc %g2, 2, %g2 ! IEU1 Group @@ -389,17 +387,17 @@ EX2(STB %g3, [%o0 - 1] ASINORMAL, add %g2, 1, %g2, add %o2, %g2) ! Store -3: andcc %o0, 0x38, %g5 ! IEU1 Group -dest_is_8byte_aligned: - be,pt %icc, dest_is_64byte_aligned ! CTI #ifdef __KERNEL__ - wr %g0, FPRS_FEF, %fprs ! FPU Group -do_dest_64byte_align: - mov 64, %g1 ! IEU0 Group +3: +dest_is_8byte_aligned: + VISEntry + andcc %o0, 0x38, %g5 ! IEU1 Group #else - mov 64, %g1 ! IEU0 Group -do_dest_64byte_align: +3: andcc %o0, 0x38, %g5 ! IEU1 Group +dest_is_8byte_aligned: #endif + be,pt %icc, dest_is_64byte_aligned ! CTI + mov 64, %g1 ! IEU0 fmovd %f0, %f2 ! FPU sub %g1, %g5, %g5 ! IEU0 Group ASI_SETSRC_NOBLK ! LSU Group @@ -646,7 +644,9 @@ 2: ASI_SETSRC_NOBLK ! LSU Group EXO2(LDUB [%o1] ASINORMAL, %g5) ! LOAD Group add %o0, 2, %o0 ! IEU0 - EXO2(LDUB [%o1 + 1] ASINORMAL, %o5) ! LOAD Group + EX2(LDUB [%o1 + 1] ASINORMAL, %o5, + sub %o0, 2, %o0, + add %o2, %g0) ! LOAD Group add %o1, 2, %o1 ! IEU0 ASI_SETDST_NOBLK ! LSU Group subcc %o2, 2, %o2 ! IEU1 Group @@ -866,9 +866,9 @@ ASI_SETSRC_NOBLK ! LSU Group EX(LDX [%o1] ASINORMAL, %g2, and %o2, 0xf) ! Load Group - add %o1, 8, %o1 ! IEU0 + add %o0, 8, %o0 ! IEU0 ASI_SETDST_NOBLK ! LSU Group - add %o0, 8, %o0 ! IEU0 Group + add %o1, 8, %o1 ! IEU0 Group EX(STX %g2, [%o0 - 0x8] ASINORMAL, and %o2, 0xf) ! Store 85: be,pt %xcc, 1f ! CTI @@ -876,9 +876,9 @@ ASI_SETSRC_NOBLK ! LSU Group EX(LDUW [%o1] ASINORMAL, %g2, and %o2, 0x7) ! Load Group - add %o1, 4, %o1 ! IEU0 + add %o0, 4, %o0 ! IEU0 ASI_SETDST_NOBLK ! LSU Group - add %o0, 4, %o0 ! IEU0 Group + add %o1, 4, %o1 ! IEU0 Group EX(STW %g2, [%o0 - 0x4] ASINORMAL, and %o2, 0x7) ! Store 1: be,pt %xcc, 1f ! CTI @@ -886,9 +886,9 @@ ASI_SETSRC_NOBLK ! LSU Group EX(LDUH [%o1] ASINORMAL, %g2, and %o2, 0x3) ! Load Group - add %o1, 2, %o1 ! IEU0 + add %o0, 2, %o0 ! IEU0 ASI_SETDST_NOBLK ! LSU Group - add %o0, 2, %o0 ! IEU0 Group + add %o1, 2, %o1 ! IEU0 Group EX(STH %g2, [%o0 - 0x2] ASINORMAL, and %o2, 0x3) ! Store 1: be,pt %xcc, 1f ! CTI @@ -920,7 +920,7 @@ add %o2, 1) ! Store 2: #ifdef __KERNEL__ - wr %g0, FPRS_FEF, %fprs ! FPU Group + VISEntry #endif andn %o2, 7, %g5 ! IEU0 Group and %o2, 7, %o2 ! IEU1 @@ -976,25 +976,31 @@ .section .fixup .align 4 VIScopyfixup_reto2: - mov %o2, %o0 + mov %o2, %o1 VIScopyfixup_ret: /* If this is copy_from_user(), zero out the rest of the * kernel buffer. */ andcc asi_src, 0x1, %g0 - bne 1f - mov %o0, %o4 - /* XXX Here, somehow get original kernel pointer (was in %o0) - * XXX and bzero() all remaining bytes in kernel buffer. - */ -1: retl - wr %g0, 0, %fprs + be,pt %icc, 1f + andcc asi_dest, 0x1, %g0 + bne,pn %icc, 1f + VISExit + save %sp, -160, %sp + mov %i0, %o0 + call __bzero + mov %i1, %o1 + restore +1: mov %o1, %o0 + retl + nop VIScopyfixup1: subcc %g2, 18, %g2 + add %o0, 32, %o0 bgeu,a,pt %icc, VIScopyfixup1 sub %g7, 32, %g7 + sub %o0, 32, %o0 rd %pc, %g5 - add %g2, 18, %g2 - add %g2, 20, %g2 + add %g2, (18 + 16), %g2 ldub [%g5 + %g2], %g2 ba,a,pt %xcc, 2f .byte 0, 0, 0, 0, 0, 0, 0, 4, 4, 8, 12, 12, 16, 20, 20, 24, 28, 28 @@ -1003,41 +1009,43 @@ 1: subcc %g2, 10, %g2 bgeu,a,pt %icc, 1b sub %g7, 16, %g7 + sub %o0, %g7, %o0 rd %pc, %g5 - add %g2, 10, %g2 - add %g2, 20, %g2 + add %g2, (10 + 16), %g2 ldub [%g5 + %g2], %g2 ba,a,pt %xcc, 4f .byte 0, 0, 0, 0, 0, 4, 4, 8, 12, 12 .align 4 VIScopyfixup3: subcc %g2, 10, %g2 + add %o0, 32, %o0 bgeu,a,pt %icc, VIScopyfixup3 sub %g7, 32, %g7 + sub %o0, 32, %o0 rd %pc, %g5 - add %g2, 10, %g2 - add %g2, 20, %g2 + add %g2, (10 + 16), %g2 ldub [%g5 + %g2], %g2 ba,a,pt %xcc, 2f .byte 0, 0, 0, 0, 0, 0, 0, 8, 16, 24 .align 4 -2: and %g1, 0x7f, %g1 +2: and %o2, 0x7f, %o2 sub %g7, %g2, %g7 ba,pt %xcc, VIScopyfixup_ret - add %g7, %g1, %o0 + add %g7, %o2, %o1 VIScopyfixup4: mov (7 * 16), %g7 3: subcc %g2, 6, %g2 bgeu,a,pt %icc, 3b sub %g7, 16, %g7 + sub %o0, %g7, %o0 rd %pc, %g5 - add %g2, 6, %g2 - add %g2, 20, %g2 + add %g2, (6 + 16), %g2 ldub [%g5 + %g2], %g2 ba,a,pt %xcc, 4f .byte 0, 0, 0, 0, 0, 8 .align 4 -4: and %g1, 7, %g1 +4: and %o2, 0xf, %o2 + sub %g7, %g2, %g7 ba,pt %xcc, VIScopyfixup_ret - add %g7, %g1, %o0 + add %g7, %o2, %o1 VIScopyfixup_vis3: sub %o2, 0x80, %o2 VIScopyfixup_vis2: @@ -1047,13 +1055,13 @@ VIScopyfixup_vis1: add %g7, %g3, %g7 ba,pt %xcc, VIScopyfixup_ret - add %o2, %g7, %o0 + add %o2, %g7, %o1 VIScopyfixup_vis5: add %g3, 8, %g3 VIScopyfixup_vis4: add %g3, 8, %g3 ba,pt %xcc, VIScopyfixup_ret - add %o2, %g3, %o0 + add %o2, %g3, %o1 #endif #ifdef __KERNEL__ diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/VIScsum.S linux/arch/sparc64/lib/VIScsum.S --- v2.1.114/linux/arch/sparc64/lib/VIScsum.S Thu Sep 4 12:54:48 1997 +++ linux/arch/sparc64/lib/VIScsum.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: VIScsum.S,v 1.2 1997/08/08 08:34:05 jj Exp $ +/* $Id: VIScsum.S,v 1.3 1998/06/12 14:53:57 jj Exp $ * VIScsum.S: High bandwidth IP checksumming utilizing the UltraSparc * Visual Instruction Set. * @@ -26,6 +26,7 @@ #ifdef __KERNEL__ #include #include +#include #else #define ASI_BLK_P 0xf0 #define FRPS_FEF 0x04 @@ -278,13 +279,13 @@ add %o2, 1, %o2 /* IEU0 */ 3: cmp %o1, 0xc0 /* IEU1 Group */ blu,pn %icc, 20f /* CTI */ - sllx %o2, 32, %g1 /* IEU0 */ - addcc %o2, %g1, %o2 /* IEU1 Group */ - sub %o1, 0xc0, %o1 /* IEU0 */ - wr %g0, ASI_BLK_P, %asi /* LSU Group */ + sllx %o2, 32, %g5 /* IEU0 */ #ifdef __KERNEL__ - wr %g0, FPRS_FEF, %fprs /* LSU Group */ + VISEntry #endif + addcc %o2, %g5, %o2 /* IEU1 Group */ + sub %o1, 0xc0, %o1 /* IEU0 */ + wr %g0, ASI_BLK_P, %asi /* LSU Group */ membar #StoreLoad /* LSU Group */ srlx %o2, 32, %o2 /* IEU0 Group */ bcs,a,pn %xcc, 1f /* CTI */ @@ -340,7 +341,7 @@ END_THE_TRICK(f60,f62,f0,f2,f4,f6,f8,f10,f12,f14,f16,f18,f20,f22,f24,f26,f28,f30) and %o1, 0x3f, %o1 /* IEU0 Group */ #ifdef __KERNEL__ - wr %g0, 0, %fprs /* LSU Group */ + VISExit #endif 20: andcc %o1, 0xf0, %g1 /* IEU1 Group */ be,pn %icc, 23f /* CTI */ diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/VIScsumcopy.S linux/arch/sparc64/lib/VIScsumcopy.S --- v2.1.114/linux/arch/sparc64/lib/VIScsumcopy.S Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/lib/VIScsumcopy.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: VIScsumcopy.S,v 1.4 1998/04/01 08:29:52 davem Exp $ +/* $Id: VIScsumcopy.S,v 1.5 1998/06/12 14:53:48 jj Exp $ * VIScsumcopy.S: High bandwidth IP checksumming with simultaneous * copying utilizing the UltraSparc Visual Instruction Set. * @@ -27,6 +27,7 @@ #include #include #include +#include #else #define ASI_P 0x80 #define ASI_BLK_P 0xf0 @@ -42,11 +43,11 @@ #define sum o3 #define x1 g1 #define x2 g2 -#define x3 g3 +#define x3 o4 #define x4 g4 #define x5 g5 #define x6 g7 -#define x7 o4 +#define x7 g3 #define x8 o5 /* Dobrou noc, SunSoft engineers. Spete sladce. @@ -248,7 +249,7 @@ csum_partial_copy_vis: andcc %dst, 7, %g0 /* IEU1 Group */ be,pt %icc, 4f /* CTI */ - and %dst, 0x38, %g3 /* IEU0 */ + and %dst, 0x38, %o4 /* IEU0 */ mov 1, %g5 /* IEU0 Group */ andcc %dst, 2, %g0 /* IEU1 */ be,pt %icc, 1f /* CTI */ @@ -266,18 +267,18 @@ add %sum, %g5, %sum /* IEU0 */ 1: lduwa [%src] %asi, %g2 /* Load */ brz,a,pn %g7, 4f /* CTI+IEU1 Group */ - and %dst, 0x38, %g3 /* IEU0 */ + and %dst, 0x38, %o4 /* IEU0 */ add %dst, 4, %dst /* IEU0 Group */ sub %len, 4, %len /* IEU1 */ addcc %g2, %sum, %sum /* IEU1 Group */ bcs,a,pn %icc, 1f /* CTI */ add %sum, 1, %sum /* IEU0 */ -1: and %dst, 0x38, %g3 /* IEU0 Group */ +1: and %dst, 0x38, %o4 /* IEU0 Group */ stw %g2, [%dst - 4] /* Store */ add %src, 4, %src /* IEU1 */ 4: #ifdef __KERNEL__ - wr %g0, FPRS_FEF, %fprs /* LSU Group */ + VISEntry #endif mov %src, %g7 /* IEU1 Group */ fzero %f48 /* FPA */ @@ -291,10 +292,10 @@ sub %sum, 1, %sum /* IEU0 */ 1: srl %sum, 0, %sum /* IEU0 Group */ clr %g5 /* IEU1 */ - brz,pn %g3, 3f /* CTI+IEU1 Group */ - sub %g1, %g3, %g1 /* IEU0 */ + brz,pn %o4, 3f /* CTI+IEU1 Group */ + sub %g1, %o4, %g1 /* IEU0 */ ldda [%src] %asi, %f0 /* Load */ - clr %g3 /* IEU0 Group */ + clr %o4 /* IEU0 Group */ andcc %dst, 8, %g0 /* IEU1 */ be,pn %icc, 1f /* CTI */ ldda [%src + 8] %asi, %f2 /* Load Group */ @@ -303,7 +304,7 @@ fpadd32 %f0, %f48, %f50 /* FPA */ addcc %dst, 8, %dst /* IEU1 Group */ faligndata %f0, %f2, %f16 /* FPA */ - fcmpgt32 %f48, %f50, %g3 /* FPM Group */ + fcmpgt32 %f48, %f50, %o4 /* FPM Group */ fmovd %f2, %f0 /* FPA Group */ ldda [%src + 8] %asi, %f2 /* Load */ std %f16, [%dst - 8] /* Store */ @@ -318,13 +319,13 @@ faligndata %f0, %f2, %f16 /* FPA */ fcmpgt32 %f48, %f50, %g5 /* FPM Group */ sub %len, 16, %len /* IEU0 */ - inc %g3 /* IEU1 */ + inc %o4 /* IEU1 */ std %f16, [%dst - 16] /* Store Group */ fpadd32 %f2, %f50, %f48 /* FPA */ - srl %g3, 1, %o5 /* IEU0 */ + srl %o4, 1, %o5 /* IEU0 */ faligndata %f2, %f4, %f18 /* FPA Group */ std %f18, [%dst - 8] /* Store */ - fcmpgt32 %f50, %f48, %g3 /* FPM Group */ + fcmpgt32 %f50, %f48, %o4 /* FPM Group */ add %o5, %sum, %sum /* IEU0 */ ldda [%src + 8] %asi, %f2 /* Load */ fmovd %f4, %f0 /* FPA */ @@ -337,18 +338,18 @@ add %dst, 32, %dst /* IEU1 */ faligndata %f0, %f2, %f16 /* FPA */ fcmpgt32 %f48, %f50, %o5 /* FPM Group */ - inc %g3 /* IEU0 */ + inc %o4 /* IEU0 */ ldda [%src + 24] %asi, %f6 /* Load */ - srl %g3, 1, %g3 /* IEU0 Group */ + srl %o4, 1, %o4 /* IEU0 Group */ add %g5, %sum, %sum /* IEU1 */ ldda [%src + 32] %asi, %f8 /* Load */ fpadd32 %f2, %f50, %f48 /* FPA */ faligndata %f2, %f4, %f18 /* FPA Group */ sub %len, 32, %len /* IEU0 */ std %f16, [%dst - 32] /* Store */ - fcmpgt32 %f50, %f48, %o4 /* FPM Group */ + fcmpgt32 %f50, %f48, %g3 /* FPM Group */ inc %o5 /* IEU0 */ - add %g3, %sum, %sum /* IEU1 */ + add %o4, %sum, %sum /* IEU1 */ fpadd32 %f4, %f48, %f50 /* FPA */ faligndata %f4, %f6, %f20 /* FPA Group */ srl %o5, 1, %o5 /* IEU0 */ @@ -356,14 +357,14 @@ add %o5, %sum, %sum /* IEU0 */ std %f18, [%dst - 24] /* Store */ fpadd32 %f6, %f50, %f48 /* FPA */ - inc %o4 /* IEU0 Group */ + inc %g3 /* IEU0 Group */ std %f20, [%dst - 16] /* Store */ add %src, 32, %src /* IEU1 */ faligndata %f6, %f8, %f22 /* FPA */ - fcmpgt32 %f50, %f48, %g3 /* FPM Group */ - srl %o4, 1, %o4 /* IEU0 */ + fcmpgt32 %f50, %f48, %o4 /* FPM Group */ + srl %g3, 1, %g3 /* IEU0 */ std %f22, [%dst - 8] /* Store */ - add %o4, %sum, %sum /* IEU0 Group */ + add %g3, %sum, %sum /* IEU0 Group */ 3: rd %asi, %g2 /* LSU Group + 4 bubbles */ #ifdef __KERNEL__ 4: sethi %hi(vis0s), %g7 /* IEU0 Group */ @@ -371,16 +372,16 @@ 4: rd %pc, %g7 /* LSU Group + 4 bubbles */ #endif inc %g5 /* IEU0 Group */ - and %src, 0x38, %o4 /* IEU1 */ + and %src, 0x38, %g3 /* IEU1 */ membar #StoreLoad /* LSU Group */ srl %g5, 1, %g5 /* IEU0 */ - inc %g3 /* IEU1 */ - sll %o4, 8, %o4 /* IEU0 Group */ + inc %o4 /* IEU1 */ + sll %g3, 8, %g3 /* IEU0 Group */ sub %len, 0xc0, %len /* IEU1 */ addcc %g5, %sum, %sum /* IEU1 Group */ - srl %g3, 1, %g3 /* IEU0 */ - add %g7, %o4, %g7 /* IEU0 Group */ - add %g3, %sum, %sum /* IEU1 */ + srl %o4, 1, %o4 /* IEU0 */ + add %g7, %g3, %g7 /* IEU0 Group */ + add %o4, %sum, %sum /* IEU1 */ #ifdef __KERNEL__ jmpl %g7 + %lo(vis0s), %g0 /* CTI+IEU1 Group */ #else @@ -815,7 +816,7 @@ END_THE_TRICK2( f48,f50,f52,f54,f56,f58,f60,f10,f12,f62) membar #Sync /* LSU Group */ #ifdef __KERNEL__ - wr %g0, 0, %fprs /* LSU Group */ + VISExit add %sp, 8, %sp /* IEU0 Group */ #endif 23: brnz,pn %len, 26f /* CTI+IEU1 Group */ @@ -834,12 +835,12 @@ #endif 26: andcc %len, 8, %g0 /* IEU1 Group */ be,pn %icc, 1f /* CTI */ - lduwa [%src] %asi, %g3 /* Load */ + lduwa [%src] %asi, %o4 /* Load */ lduwa [%src+4] %asi, %g2 /* Load Group */ add %src, 8, %src /* IEU0 */ add %dst, 8, %dst /* IEU1 */ - sllx %g3, 32, %g5 /* IEU0 Group */ - stw %g3, [%dst - 8] /* Store */ + sllx %o4, 32, %g5 /* IEU0 Group */ + stw %o4, [%dst - 8] /* Store */ or %g5, %g2, %g5 /* IEU0 Group */ stw %g2, [%dst - 4] /* Store */ addcc %g5, %sum, %sum /* IEU1 Group */ @@ -855,11 +856,11 @@ stw %g7, [%dst - 4] /* Store */ 1: andcc %len, 2, %g0 /* IEU1 */ be,a,pn %icc, 1f /* CTI */ - clr %o4 /* IEU0 Group */ + clr %g3 /* IEU0 Group */ lduha [%src] %asi, %g7 /* Load */ add %src, 2, %src /* IEU1 */ add %dst, 2, %dst /* IEU0 Group */ - sll %g7, 16, %o4 /* IEU0 Group */ + sll %g7, 16, %g3 /* IEU0 Group */ sth %g7, [%dst - 2] /* Store */ 1: andcc %len, 1, %g0 /* IEU1 */ be,a,pn %icc, 1f /* CTI */ @@ -867,9 +868,9 @@ lduba [%src] %asi, %g7 /* Load */ sll %g7, 8, %o5 /* IEU0 Group */ stb %g7, [%dst] /* Store */ -1: or %g2, %o4, %o4 /* IEU1 */ - or %o5, %o4, %o4 /* IEU0 Group (regdep) */ - addcc %o4, %sum, %sum /* IEU1 Group (regdep) */ +1: or %g2, %g3, %g3 /* IEU1 */ + or %o5, %g3, %g3 /* IEU0 Group (regdep) */ + addcc %g3, %sum, %sum /* IEU1 Group (regdep) */ bcs,a,pn %xcc, 1f /* CTI */ add %sum, 1, %sum /* IEU0 */ 1: ba,pt %xcc, 25b /* CTI Group */ diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/VISmemset.S linux/arch/sparc64/lib/VISmemset.S --- v2.1.114/linux/arch/sparc64/lib/VISmemset.S Thu Sep 4 12:54:48 1997 +++ linux/arch/sparc64/lib/VISmemset.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: VISmemset.S,v 1.7 1997/08/22 15:54:56 jj Exp $ +/* $Id: VISmemset.S,v 1.8 1998/06/12 14:53:59 jj Exp $ * VISmemset.S: High speed memset operations utilizing the UltraSparc * Visual Instruction Set. * @@ -32,6 +32,9 @@ #endif #ifdef __KERNEL__ + +#include + #define RETL clr %o0 #else #define RETL mov %g3, %o0 @@ -135,8 +138,9 @@ #endif add %o0, 32, %o0 7: be,pn %xcc, 9f + nop #ifdef __KERNEL__ - wr %g0, FPRS_FEF, %fprs + VISEntryHalf #endif ldd [%o0 - 8], %f0 18: wr %g0, ASI_BLK_P, %asi @@ -170,7 +174,7 @@ add %o0, 256, %o0 12: #ifdef __KERNEL__ - wr %g0, 0, %fprs + VISExitHalf #else #ifndef REGS_64BIT wr %g0, FPRS_FEF, %fprs @@ -231,10 +235,9 @@ #endif andncc %o2, 0x3f, %o3 be,pn %xcc, 9b -#ifdef __KERNEL__ - wr %g0, FPRS_FEF, %fprs -#else nop +#ifdef __KERNEL__ + VISEntryHalf #endif ba,pt %xcc, 18b ldd [%o0], %f0 diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/VISsave.S linux/arch/sparc64/lib/VISsave.S --- v2.1.114/linux/arch/sparc64/lib/VISsave.S Wed Dec 31 16:00:00 1969 +++ linux/arch/sparc64/lib/VISsave.S Tue Aug 4 16:03:35 1998 @@ -0,0 +1,122 @@ +/* $Id: VISsave.S,v 1.2 1998/06/19 12:14:25 jj Exp $ + * VISsave.S: Code for saving FPU register state for + * VIS routines. One should not call this directly, + * but use macros provided in . + * + * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) + */ + +#include +#include +#include +#include + + .text + .globl VISenter, VISenterhalf + + /* On entry: %o5=current FPRS value, %g7 is callers address */ + /* May clobber %o5, %g1, %g2, %g3, %g7, %icc, %xcc */ + + .align 32 +VISenter: + ldub [%g6 + AOFF_task_tss + AOFF_thread_fpdepth], %g1 + brnz,a,pn %g1, 1f + cmp %g1, 1 + stb %g0, [%g6 + AOFF_task_tss + AOFF_thread_fpsaved] + stx %fsr, [%g6 + AOFF_task_tss + AOFF_thread_xfsr] +9: jmpl %g7 + %g0, %g0 + nop +1: bne,pn %icc, 2f + + srl %g1, 1, %g1 +vis1: ldub [%g6 + AOFF_task_tss + AOFF_thread_fpsaved], %g3 + stx %fsr, [%g6 + AOFF_task_tss + AOFF_thread_xfsr] + or %g3, %o5, %g3 + stb %g3, [%g6 + AOFF_task_tss + AOFF_thread_fpsaved] + rd %gsr, %g3 + clr %g1 + ba,pt %xcc, 3f + + stb %g3, [%g6 + AOFF_task_tss + AOFF_thread_gsr] +2: add %g6, %g1, %g3 + cmp %o5, FPRS_DU + be,pn %icc, 6f + sll %g1, 3, %g1 + stb %o5, [%g3 + AOFF_task_tss + AOFF_thread_fpsaved] + rd %gsr, %g2 + stb %g2, [%g3 + AOFF_task_tss + AOFF_thread_gsr] + + add %g6, %g1, %g2 + stx %fsr, [%g2 + AOFF_task_tss + AOFF_thread_xfsr] + sll %g1, 5, %g1 +3: andcc %o5, FPRS_DL|FPRS_DU, %g0 + be,pn %icc, 9b + add %g6, AOFF_task_fpregs, %g2 + andcc %o5, FPRS_DL, %g0 + membar #StoreStore | #LoadStore + + be,pn %icc, 4f + add %g6, AOFF_task_fpregs+0x40, %g3 + stda %f0, [%g2 + %g1] ASI_BLK_P + stda %f16, [%g3 + %g1] ASI_BLK_P + andcc %o5, FPRS_DU, %g0 + be,pn %icc, 5f +4: add %g1, 128, %g1 + stda %f32, [%g2 + %g1] ASI_BLK_P + + stda %f48, [%g3 + %g1] ASI_BLK_P +5: membar #Sync + jmpl %g7 + %g0, %g0 + nop + +6: ldub [%g3 + AOFF_task_tss + AOFF_thread_fpsaved], %o5 + or %o5, FPRS_DU, %o5 + add %g6, AOFF_task_fpregs+0x80, %g2 + stb %o5, [%g3 + AOFF_task_tss + AOFF_thread_fpsaved] + + sll %g1, 5, %g1 + add %g6, AOFF_task_fpregs+0xc0, %g3 + membar #StoreStore | #LoadStore + stda %f32, [%g2 + %g1] ASI_BLK_P + stda %f48, [%g3 + %g1] ASI_BLK_P + membar #Sync + jmpl %g7 + %g0, %g0 + nop + + .align 32 +VISenterhalf: + ldub [%g6 + AOFF_task_tss + AOFF_thread_fpdepth], %g1 + brnz,a,pn %g1, 1f + cmp %g1, 1 + stb %g0, [%g6 + AOFF_task_tss + AOFF_thread_fpsaved] + stx %fsr, [%g6 + AOFF_task_tss + AOFF_thread_xfsr] + clr %o5 + jmpl %g7 + %g0, %g0 + wr %g0, FPRS_FEF, %fprs + +1: bne,pn %icc, 2f + srl %g1, 1, %g1 + ba,pt %xcc, vis1 + sub %g7, 8, %g7 +2: addcc %g6, %g1, %g3 + sll %g1, 3, %g1 + andn %o5, FPRS_DU, %g2 + stb %g2, [%g3 + AOFF_task_tss + AOFF_thread_fpsaved] + + rd %gsr, %g2 + stb %g2, [%g3 + AOFF_task_tss + AOFF_thread_gsr] + add %g6, %g1, %g2 + stx %fsr, [%g2 + AOFF_task_tss + AOFF_thread_xfsr] + sll %g1, 5, %g1 +3: andcc %o5, FPRS_DL, %g0 + be,pn %icc, 4f + add %g6, AOFF_task_fpregs, %g2 + + membar #StoreStore | #LoadStore + add %g6, AOFF_task_fpregs+0x40, %g3 + stda %f0, [%g2 + %g1] ASI_BLK_P + stda %f16, [%g3 + %g1] ASI_BLK_P + membar #Sync +4: and %o5, FPRS_DU, %o5 + jmpl %g7 + %g0, %g0 + wr %o5, FPRS_FEF, %fprs diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/blockops.S linux/arch/sparc64/lib/blockops.S --- v2.1.114/linux/arch/sparc64/lib/blockops.S Sat Aug 16 09:51:09 1997 +++ linux/arch/sparc64/lib/blockops.S Tue Aug 4 16:03:35 1998 @@ -1,52 +1,66 @@ -/* $Id: blockops.S,v 1.11 1997/07/29 09:35:36 davem Exp $ - * arch/sparc64/lib/blockops.S: UltraSparc block zero optimized routines. +/* $Id: blockops.S,v 1.14 1998/06/12 14:53:46 jj Exp $ + * blockops.S: UltraSparc block zero optimized routines. * - * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1996,1998 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ #include "VIS.h" +#include + +#define TOUCH(reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7) \ + fmovd %reg0, %f48; fmovd %reg1, %f50; \ + fmovd %reg2, %f52; fmovd %reg3, %f54; \ + fmovd %reg4, %f56; fmovd %reg5, %f58; \ + fmovd %reg6, %f60; fmovd %reg7, %f62; .text .align 32 - - .globl __bfill64 -__bfill64: /* %o0 = buf, %o1= ptr to pattern */ - wr %g0, FPRS_FEF, %fprs ! FPU Group - ldd [%o1], %f48 ! Load Group - wr %g0, ASI_BLK_P, %asi ! LSU Group - membar #StoreLoad | #StoreStore | #LoadStore ! LSU Group - mov 32, %g2 ! IEU0 Group - - /* Cannot perform real arithmatic on the pattern, that can - * lead to fp_exception_other ;-) - */ - fmovd %f48, %f50 ! FPA Group - fmovd %f48, %f52 ! FPA Group - fmovd %f48, %f54 ! FPA Group - fmovd %f48, %f56 ! FPA Group - fmovd %f48, %f58 ! FPA Group - fmovd %f48, %f60 ! FPA Group - fmovd %f48, %f62 ! FPA Group - -1: stda %f48, [%o0 + 0x00] %asi ! Store Group - stda %f48, [%o0 + 0x40] %asi ! Store Group - stda %f48, [%o0 + 0x80] %asi ! Store Group - stda %f48, [%o0 + 0xc0] %asi ! Store Group - subcc %g2, 1, %g2 ! IEU1 Group - bne,pt %icc, 1b ! CTI - add %o0, 0x100, %o0 ! IEU0 - membar #StoreLoad | #StoreStore ! LSU Group - - jmpl %o7 + 0x8, %g0 ! CTI Group brk forced - wr %g0, 0, %fprs ! FPU Group + .globl copy_page + .type copy_page,@function +copy_page: /* %o0=dest, %o1=src */ + VISEntry + membar #LoadStore | #StoreStore | #StoreLoad + ldda [%o1] ASI_BLK_P, %f0 + add %o1, 0x40, %o1 + ldda [%o1] ASI_BLK_P, %f16 + add %o1, 0x40, %o1 + sethi %hi(8192), %o2 +1: TOUCH(f0, f2, f4, f6, f8, f10, f12, f14) + ldda [%o1] ASI_BLK_P, %f32 + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + stda %f48, [%o0] ASI_BLK_P + add %o0, 0x40, %o0 + TOUCH(f16, f18, f20, f22, f24, f26, f28, f30) + ldda [%o1] ASI_BLK_P, %f0 + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + stda %f48, [%o0] ASI_BLK_P + add %o0, 0x40, %o0 + TOUCH(f32, f34, f36, f38, f40, f42, f44, f46) + ldda [%o1] ASI_BLK_P, %f16 + add %o1, 0x40, %o1 + sub %o2, 0x40, %o2 + stda %f48, [%o0] ASI_BLK_P + cmp %o2, 0x80 + bne,pt %xcc, 1b + add %o0, 0x40, %o0 + membar #Sync + stda %f0, [%o0] ASI_BLK_P + add %o0, 0x40, %o0 + stda %f16, [%o0] ASI_BLK_P + membar #StoreStore | #StoreLoad + jmpl %o7 + 0x8, %g0 + VISExit .align 32 .globl __bzero_1page -__bzero_1page: - wr %g0, FPRS_FEF, %fprs ! FPU Group + .type __bzero_1page,@function +__bzero_1page: /* %o0=dest */ + VISEntryHalf fzero %f0 ! FPA Group - mov 32, %g1 ! IEU0 + mov 32, %o1 ! IEU0 fzero %f2 ! FPA Group faddd %f0, %f2, %f4 ! FPA Group fmuld %f0, %f2, %f6 ! FPM @@ -62,9 +76,9 @@ stda %f0, [%o0 + 0x80] %asi ! Store Group stda %f0, [%o0 + 0xc0] %asi ! Store Group - subcc %g1, 1, %g1 ! IEU1 + subcc %o1, 1, %o1 ! IEU1 bne,pt %icc, 1b ! CTI add %o0, 0x100, %o0 ! IEU0 Group - membar #StoreLoad | #StoreStore ! LSU Group + membar #StoreStore | #StoreLoad ! LSU Group jmpl %o7 + 0x8, %g0 ! CTI Group brk forced - wr %g0, 0, %fprs ! FPU Group + VISExitHalf diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/lib/memscan.S linux/arch/sparc64/lib/memscan.S --- v2.1.114/linux/arch/sparc64/lib/memscan.S Thu Mar 27 14:40:01 1997 +++ linux/arch/sparc64/lib/memscan.S Tue Aug 4 16:03:35 1998 @@ -1,116 +1,129 @@ -/* $Id: memscan.S,v 1.1 1997/03/14 21:04:24 jj Exp $ - * memscan.S: Optimized memscan for the Sparc64. +/* $Id: memscan.S,v 1.2 1998/05/21 14:42:22 jj Exp $ + * memscan.S: Optimized memscan for Sparc64. * - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) + * Copyright (C) 1998 David S. Miller (davem@dm.cobaltmicro.com) */ -/* In essence, this is just a fancy strlen. */ - -#define LO_MAGIC 0x01010101 -#define HI_MAGIC 0x80808080 +#define HI_MAGIC 0x8080808080808080 +#define LO_MAGIC 0x0101010101010101 +#define ASI_PL 0x88 .text - .align 4 - .globl __memscan_zero, __memscan_generic - .globl memscan + .align 32 + .globl __memscan_zero, __memscan_generic + .globl memscan + __memscan_zero: - /* %o0 = addr, %o1 = size */ - brlez,pn %o1, 0f - andcc %o0, 3, %g0 - be,pt %icc, 9f - sethi %hi(HI_MAGIC), %o4 - ldub [%o0], %o5 - subcc %o1, 1, %o1 - brz,pn %o5, 10f - add %o0, 1, %o0 - be,pn %xcc, 0f - andcc %o0, 3, %g0 - be,pn %icc, 4f - or %o4, %lo(HI_MAGIC), %o3 - ldub [%o0], %o5 - subcc %o1, 1, %o1 - brz,pn %o5, 10f - add %o0, 1, %o0 - be,pn %xcc, 0f - andcc %o0, 3, %g0 - be,pt %icc, 5f - sethi %hi(LO_MAGIC), %o4 - ldub [%o0], %o5 - subcc %o1, 1, %o1 - brz,pn %o5, 10f - add %o0, 1, %o0 - be,pn %xcc, 0f - or %o4, %lo(LO_MAGIC), %o2 - ba,pt %xcc, 2f - ld [%o0], %o5 -9: - or %o4, %lo(HI_MAGIC), %o3 -4: - sethi %hi(LO_MAGIC), %o4 -5: - or %o4, %lo(LO_MAGIC), %o2 - ld [%o0], %o5 -2: - sub %o5, %o2, %o4 - sub %o1, 4, %o1 - andcc %o4, %o3, %g0 - be,pn %icc, 1f - add %o0, 4, %o0 - brgz,pt %o1, 2b - ld [%o0], %o5 + /* %o0 = bufp, %o1 = size */ + brlez,pn %o1, szzero + andcc %o0, 7, %g0 + be,pt %icc, we_are_aligned + sethi %hi(HI_MAGIC), %o4 + ldub [%o0], %o5 +1: subcc %o1, 1, %o1 + brz,pn %o5, 10f + add %o0, 1, %o0 + be,pn %xcc, szzero + andcc %o0, 7, %g0 + bne,a,pn %icc, 1b + ldub [%o0], %o5 +we_are_aligned: + ldxa [%o0] ASI_PL, %o5 + or %o4, %lo(HI_MAGIC), %o3 + sllx %o3, 32, %o4 + or %o4, %o3, %o3 + + srlx %o3, 7, %o2 +msloop: + sub %o1, 8, %o1 + add %o0, 8, %o0 + sub %o5, %o2, %o4 + xor %o4, %o5, %o4 + andcc %o4, %o3, %g3 + bne,pn %xcc, check_bytes + srlx %o4, 32, %g3 + + brgz,a,pt %o1, msloop + ldxa [%o0] ASI_PL, %o5 +check_bytes: + bne,a,pn %icc, 2f + andcc %o5, 0xff, %g0 + add %o0, -5, %g2 + ba,pt %xcc, 3f + srlx %o5, 32, %g5 + +2: srlx %o5, 8, %g5 + be,pn %icc, 1f + add %o0, -8, %g2 + andcc %g5, 0xff, %g0 + srlx %g5, 8, %g5 + be,pn %icc, 1f + inc %g2 + andcc %g5, 0xff, %g0 + + srlx %g5, 8, %g5 + be,pn %icc, 1f + inc %g2 + andcc %g5, 0xff, %g0 + srlx %g5, 8, %g5 + be,pn %icc, 1f + inc %g2 + andcc %g3, %o3, %g0 + + be,a,pn %icc, 2f + mov %o0, %g2 +3: andcc %g5, 0xff, %g0 + srlx %g5, 8, %g5 + be,pn %icc, 1f + inc %g2 + andcc %g5, 0xff, %g0 + srlx %g5, 8, %g5 + + be,pn %icc, 1f + inc %g2 + andcc %g5, 0xff, %g0 + srlx %g5, 8, %g5 + be,pn %icc, 1f + inc %g2 + andcc %g5, 0xff, %g0 + srlx %g5, 8, %g5 + + be,pn %icc, 1f + inc %g2 +2: brgz,a,pt %o1, msloop + ldxa [%o0] ASI_PL, %o5 + inc %g2 +1: add %o0, %o1, %o0 + cmp %g2, %o0 retl - add %o0, %o1, %o0 -1: - /* Check every byte. */ - srl %o5, 24, %g5 - andcc %g5, 0xff, %g0 - be,pn %icc, 1f - add %o0, -4, %o4 - srl %o5, 16, %g5 - andcc %g5, 0xff, %g0 - be,pn %icc, 1f - add %o4, 1, %o4 - srl %o5, 8, %g5 - andcc %g5, 0xff, %g0 - be,pn %icc, 1f - add %o4, 1, %o4 - andcc %o5, 0xff, %g0 - be,pn %icc, 1f - add %o4, 1, %o4 - brgz,pt %o1, 2b - ld [%o0], %o5 -1: - add %o0, %o1, %o0 - cmp %o4, %o0 - retl - movle %xcc, %o4, %o0 -0: - retl + + movle %xcc, %g2, %o0 +10: retl + sub %o0, 1, %o0 +szzero: retl nop -10: - retl - sub %o0, 1, %o0 memscan: __memscan_generic: /* %o0 = addr, %o1 = c, %o2 = size */ - brz,pn %o2, 3f - add %o0, %o2, %o3 - ldub [%o0], %o5 - sub %g0, %o2, %o4 + brz,pn %o2, 3f + add %o0, %o2, %o3 + ldub [%o0], %o5 + sub %g0, %o2, %o4 1: - cmp %o5, %o1 - be,pn %icc, 2f - addcc %o4, 1, %o4 - bne,a,pt %xcc, 1b - ldub [%o3 + %o4], %o5 + cmp %o5, %o1 + be,pn %icc, 2f + addcc %o4, 1, %o4 + bne,a,pt %xcc, 1b + ldub [%o3 + %o4], %o5 retl /* The delay slot is the same as the next insn, this is just to make it look more awful */ 2: - add %o3, %o4, %o0 + add %o3, %o4, %o0 retl - sub %o0, 1, %o0 + sub %o0, 1, %o0 3: retl nop diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/math-emu/math.c linux/arch/sparc64/math-emu/math.c --- v2.1.114/linux/arch/sparc64/math-emu/math.c Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/math-emu/math.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: math.c,v 1.4 1998/04/06 16:09:57 jj Exp $ +/* $Id: math.c,v 1.5 1998/06/12 14:54:27 jj Exp $ * arch/sparc64/math-emu/math.c * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -122,59 +122,57 @@ if (type) { void *rs1 = NULL, *rs2 = NULL, *rd = NULL; - freg = (f->fsr >> 14) & 0xf; + freg = (current->tss.xfsr[0] >> 14) & 0xf; if (freg != (type >> 8)) goto err; - f->fsr &= ~0x1c000; + current->tss.xfsr[0] &= ~0x1c000; freg = ((insn >> 14) & 0x1f); switch (type & 0x3) { case 3: if (freg & 2) { - f->fsr |= (6 << 14) /* invalid_fp_register */; + current->tss.xfsr[0] |= (6 << 14) /* invalid_fp_register */; goto err; } case 2: freg = ((freg & 1) << 5) | (freg & 0x1e); case 1: rs1 = (void *)&f->regs[freg]; - flags = (freg < 32) ? SPARC_FLAG_USEDFPUL : SPARC_FLAG_USEDFPUU; - if (!(current->tss.flags & flags)) - rs1 = (void *)&zero; + flags = (freg < 32) ? FPRS_DL : FPRS_DU; + if (!(current->tss.fpsaved[0] & flags)) + rs1 = (void *)&zero; break; } freg = (insn & 0x1f); switch ((type >> 2) & 0x3) { case 3: if (freg & 2) { - f->fsr |= (6 << 14) /* invalid_fp_register */; + current->tss.xfsr[0] |= (6 << 14) /* invalid_fp_register */; goto err; } case 2: freg = ((freg & 1) << 5) | (freg & 0x1e); case 1: rs2 = (void *)&f->regs[freg]; - flags = (freg < 32) ? SPARC_FLAG_USEDFPUL : SPARC_FLAG_USEDFPUU; - if (!(current->tss.flags & flags)) + flags = (freg < 32) ? FPRS_DL : FPRS_DU; + if (!(current->tss.fpsaved[0] & flags)) rs2 = (void *)&zero; break; } freg = ((insn >> 25) & 0x1f); switch ((type >> 4) & 0x3) { - case 0: rd = (void *)(((long)&f->fsr) | (freg & 3)); break; + case 0: rd = (void *)(((long)¤t->tss.xfsr[0]) | (freg & 3)); break; case 3: if (freg & 2) { - f->fsr |= (6 << 14) /* invalid_fp_register */; + current->tss.xfsr[0] |= (6 << 14) /* invalid_fp_register */; goto err; } case 2: freg = ((freg & 1) << 5) | (freg & 0x1e); case 1: rd = (void *)&f->regs[freg]; - flags = (freg < 32) ? SPARC_FLAG_USEDFPUL : SPARC_FLAG_USEDFPUU; - regs->fprs |= FPRS_FEF; - if (!(current->tss.flags & SPARC_FLAG_USEDFPU)) { - current->tss.flags |= SPARC_FLAG_USEDFPU; - f->fsr = 0; - f->gsr = 0; + flags = (freg < 32) ? FPRS_DL : FPRS_DU; + if (!(current->tss.fpsaved[0] & FPRS_FEF)) { + current->tss.fpsaved[0] = FPRS_FEF; + current->tss.gsr[0] = 0; } - if (!(current->tss.flags & flags)) { + if (!(current->tss.fpsaved[0] & flags)) { if (freg < 32) memset(f->regs, 0, 32*sizeof(u32)); else memset(f->regs+32, 0, 32*sizeof(u32)); } - current->tss.flags |= flags; + current->tss.fpsaved[0] |= flags; break; } func(rd, rs2, rs1); diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/math-emu/op-common.h linux/arch/sparc64/math-emu/op-common.h --- v2.1.114/linux/arch/sparc64/math-emu/op-common.h Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/math-emu/op-common.h Tue Aug 4 16:03:35 1998 @@ -83,8 +83,17 @@ { \ _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \ _FP_ROUND(wc, X); \ - X##_e = _FP_FRAC_OVERP_##wc(fs, X); \ - _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ + _FP_FRAC_SLL_##wc(X, 1); \ + if (_FP_FRAC_OVERP_##wc(fs, X)) \ + { \ + X##_e = 1; \ + _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ + } \ + else \ + { \ + X##_e = 0; \ + _FP_FRAC_SRL_##wc(X, _FP_WORKBITS+1); \ + } \ } \ else \ { \ diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/mm/Makefile linux/arch/sparc64/mm/Makefile --- v2.1.114/linux/arch/sparc64/mm/Makefile Tue Jul 21 00:15:30 1998 +++ linux/arch/sparc64/mm/Makefile Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 1997/07/24 12:15:08 davem Exp $ +# $Id: Makefile,v 1.5 1998/07/26 03:02:54 davem Exp $ # Makefile for the linux Sparc64-specific parts of the memory manager. # # Note! Dependencies are done automagically by 'make dep', which also diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/mm/asyncd.c linux/arch/sparc64/mm/asyncd.c --- v2.1.114/linux/arch/sparc64/mm/asyncd.c Mon Jan 12 15:15:44 1998 +++ linux/arch/sparc64/mm/asyncd.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: asyncd.c,v 1.3 1997/12/11 15:15:58 jj Exp $ +/* $Id: asyncd.c,v 1.4 1998/05/24 02:53:58 davem Exp $ * The asyncd kernel daemon. This handles paging on behalf of * processes that receive page faults due to remote (async) memory * accesses. @@ -108,7 +108,7 @@ static int fault_in_page(int taskid, struct vm_area_struct *vma, - unsigned address,int write) + unsigned long address, int write) { static unsigned last_address; static int last_task, loop_counter; 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 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.81 1998/05/04 05:35:43 jj Exp $ +/* $Id: init.c,v 1.93 1998/08/04 20:49:25 davem Exp $ * arch/sparc64/mm/init.c * * Copyright (C) 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -36,22 +36,54 @@ /* Ugly, but necessary... -DaveM */ unsigned long phys_base; -unsigned int null_pte_table; -unsigned long two_null_pmd_table, two_null_pte_table; - -extern unsigned long empty_null_pmd_table; -extern unsigned long empty_null_pte_table; unsigned long tlb_context_cache = CTX_FIRST_VERSION; /* References to section boundaries */ extern char __init_begin, __init_end, etext, __bss_start; -extern void __bfill64(void *, unsigned long *); - -static __inline__ void __init_pmd(pmd_t *pmdp) +int do_check_pgt_cache(int low, int high) { - __bfill64((void *)pmdp, &two_null_pte_table); + 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; } /* @@ -67,21 +99,6 @@ * ZERO_PAGE is a special page that is used for zero-initialized * data and COW. */ -pmd_t *__bad_pmd(void) -{ - pmd_t *pmdp = (pmd_t *) &empty_bad_pmd_table; - - __init_pmd(pmdp); - return pmdp; -} - -pte_t *__bad_pte(void) -{ - memset((void *) &empty_bad_pte_table, 0, PAGE_SIZE); - return (pte_t *) (((unsigned long)&empty_bad_pte_table) - - ((unsigned long)&empty_zero_page) + phys_base + PAGE_OFFSET); -} - pte_t __bad_page(void) { memset((void *) &empty_bad_page, 0, PAGE_SIZE); @@ -484,35 +501,42 @@ unsigned long data; }; -#define MAX_TRANSLATIONS 64 static inline void inherit_prom_mappings(void) { - struct linux_prom_translation transl[MAX_TRANSLATIONS]; + struct linux_prom_translation *trans; pgd_t *pgdp; pmd_t *pmdp; pte_t *ptep; int node, n, i; node = prom_finddevice("/virtual-memory"); - if ((n = prom_getproperty(node, "translations", (char *) transl, - sizeof(transl))) == -1) { + n = prom_getproplen(node, "translations"); + if (n == 0 || n == -1) { + prom_printf("Couldn't get translation property\n"); + prom_halt(); + } + + for (i = 1; i < n; i <<= 1) /* empty */; + trans = sparc_init_alloc(&mempool, i); + + if (prom_getproperty(node, "translations", (char *)trans, i) == -1) { prom_printf("Couldn't get translation property\n"); prom_halt(); } - n = n / sizeof(transl[0]); + n = n / sizeof(*trans); for (i = 0; i < n; i++) { unsigned long vaddr; - if (transl[i].virt >= 0xf0000000 && transl[i].virt < 0x100000000) { - for (vaddr = transl[i].virt; - vaddr < transl[i].virt + transl[i].size; + if (trans[i].virt >= 0xf0000000 && trans[i].virt < 0x100000000) { + for (vaddr = trans[i].virt; + vaddr < trans[i].virt + trans[i].size; vaddr += PAGE_SIZE) { pgdp = pgd_offset(init_task.mm, vaddr); if (pgd_none(*pgdp)) { pmdp = sparc_init_alloc(&mempool, PMD_TABLE_SIZE); - __init_pmd(pmdp); + clear_page(pmdp); pgd_set(pgdp, pmdp); } pmdp = pmd_offset(pgdp, vaddr); @@ -522,13 +546,49 @@ pmd_set(pmdp, ptep); } ptep = pte_offset(pmdp, vaddr); - set_pte (ptep, __pte(transl[i].data | _PAGE_MODIFIED)); - transl[i].data += PAGE_SIZE; + set_pte (ptep, __pte(trans[i].data | _PAGE_MODIFIED)); + trans[i].data += PAGE_SIZE; } } } } +/* The OBP specifications for sun4u mark 0xfffffffc00000000 and + * upwards as reserved for use by the firmware (I wonder if this + * will be the same on Cheetah...). We use this virtual address + * range for the VPTE table mappings of the nucleus so we need + * to zap them when we enter the PROM. -DaveM + */ +static void __flush_nucleus_vptes(void) +{ + unsigned long pstate; + unsigned long prom_reserved_base = 0xfffffffc00000000UL; + int i; + + __asm__ __volatile__("rdpr %%pstate, %0\n\t" + "wrpr %0, %1, %%pstate\n\t" + "flushw" + : "=r" (pstate) + : "i" (PSTATE_IE)); + + /* Only DTLB must be checked for VPTE entries. */ + for(i = 0; i < 63; i++) { + unsigned long tag = spitfire_get_dtlb_tag(i); + + if(((tag & ~(PAGE_MASK)) == 0) && + ((tag & (PAGE_MASK)) >= prom_reserved_base)) { + __asm__ __volatile__("stxa %%g0, [%0] %1" + : /* no outputs */ + : "r" (TLB_TAG_ACCESS), "i" (ASI_DMMU)); + membar("#Sync"); + spitfire_put_dtlb_data(i, 0x0UL); + membar("#Sync"); + } + } + __asm__ __volatile__("wrpr %0, 0, %%pstate" + : : "r" (pstate)); +} + static int prom_ditlb_set = 0; int prom_itlb_ent, prom_dtlb_ent; unsigned long prom_itlb_tag, prom_itlb_data; @@ -536,8 +596,12 @@ void prom_world(int enter) { - if (!prom_ditlb_set) return; + if (!prom_ditlb_set) + return; if (enter) { + /* Kick out nucleus VPTEs. */ + __flush_nucleus_vptes(); + /* Install PROM world. */ __asm__ __volatile__("stxa %0, [%1] %2" : : "r" (prom_dtlb_tag), "r" (TLB_TAG_ACCESS), @@ -698,74 +762,76 @@ : : "r" (pstate)); } -unsigned long mmu_context_bmap[1UL << (CTX_VERSION_SHIFT - 6)]; +#define CTX_BMAP_SLOTS (1UL << (CTX_VERSION_SHIFT - 6)) +unsigned long mmu_context_bmap[CTX_BMAP_SLOTS]; /* We are always protected by scheduler_lock under SMP. * Caller does TLB context flushing on local CPU if necessary. + * + * We must be careful about boundary cases so that we never + * let the user have CTX 0 (nucleus) or we ever use a CTX + * version of zero (and thus NO_CONTEXT would not be caught + * by version mis-match tests in mmu_context.h). */ void get_new_mmu_context(struct mm_struct *mm) { unsigned long ctx = (tlb_context_cache + 1) & ~(CTX_VERSION_MASK); unsigned long new_ctx; - if (mm->context != NO_CONTEXT && !((mm->context ^ tlb_context_cache) & CTX_VERSION_MASK)) + if (ctx == 0) + ctx = 1; + if ((mm->context != NO_CONTEXT) && + !((mm->context ^ tlb_context_cache) & CTX_VERSION_MASK)) clear_bit(mm->context & ~(CTX_VERSION_MASK), mmu_context_bmap); new_ctx = find_next_zero_bit(mmu_context_bmap, 1UL << CTX_VERSION_SHIFT, ctx); if (new_ctx >= (1UL << CTX_VERSION_SHIFT)) { new_ctx = find_next_zero_bit(mmu_context_bmap, ctx, 1); if (new_ctx >= ctx) { - new_ctx = (tlb_context_cache & CTX_VERSION_MASK) + CTX_FIRST_VERSION; + int i; + new_ctx = (tlb_context_cache & CTX_VERSION_MASK) + + CTX_FIRST_VERSION; + if (new_ctx == 1) + new_ctx = CTX_FIRST_VERSION; + + /* Don't call memset, for 16 entries that's just + * plain silly... + */ mmu_context_bmap[0] = 3; - memset(mmu_context_bmap + sizeof(long), 0, sizeof(mmu_context_bmap) - sizeof(long)); + mmu_context_bmap[1] = 0; + mmu_context_bmap[2] = 0; + mmu_context_bmap[3] = 0; + for(i = 4; i < CTX_BMAP_SLOTS; i += 4) { + mmu_context_bmap[i + 0] = 0; + mmu_context_bmap[i + 1] = 0; + mmu_context_bmap[i + 2] = 0; + mmu_context_bmap[i + 3] = 0; + } goto out; } } set_bit(new_ctx, mmu_context_bmap); new_ctx |= (tlb_context_cache & CTX_VERSION_MASK); -out: tlb_context_cache = new_ctx; +out: + tlb_context_cache = new_ctx; mm->context = new_ctx; mm->cpu_vm_mask = 0; } -#ifdef __SMP__ -spinlock_t user_page_lock = SPIN_LOCK_UNLOCKED; -#endif -struct upcache user_page_cache[2] __attribute__((aligned(32))); - -unsigned long get_user_page_slow(int which) -{ - unsigned long chunk; - struct upcache *up = &user_page_cache[!which]; - struct page *p; - - do { chunk = __get_free_pages(GFP_KERNEL, 1); } while(chunk==0); - p = mem_map + MAP_NR(chunk); - atomic_set(&p->count, 1); - atomic_set(&(p+1)->count, 1); - p->age = (p+1)->age = PAGE_INITIAL_AGE; - spin_lock(&user_page_lock); - if(up->count < USER_PAGE_WATER) { - struct page *new = p + !which; - new->next = up->list; - up->list = new; - up->count++; - } else - free_pages((chunk+(PAGE_SIZE*(!which))), 0); - spin_unlock(&user_page_lock); - return page_address(p + which); -} - #ifndef __SMP__ struct pgtable_cache_struct pgt_quicklists; #endif +/* XXX Add __GFP_HIGH to these calls to "fool" page allocator + * XXX so we don't go to swap so quickly... then do the same + * XXX for get_user_page as well -DaveM + */ pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long offset) { pmd_t *pmd; pmd = (pmd_t *) __get_free_page(GFP_DMA|GFP_KERNEL); if(pmd) { - __init_pmd(pmd); + clear_page(pmd); pgd_set(pgd, pmd); return pmd + offset; } @@ -778,7 +844,7 @@ pte = (pte_t *) __get_free_page(GFP_DMA|GFP_KERNEL); if(pte) { - memset((void *)pte, 0, PTE_TABLE_SIZE); + clear_page(pte); pmd_set(pmd, pte); return pte + offset; } @@ -795,15 +861,14 @@ while (start < end) { pgdp = pgd_offset(init_task.mm, start); if (pgd_none(*pgdp)) { - pmdp = sparc_init_alloc(&mempool, - PMD_TABLE_SIZE); - __init_pmd(pmdp); + pmdp = sparc_init_alloc(&mempool, PAGE_SIZE); + clear_page(pmdp); pgd_set(pgdp, pmdp); } pmdp = pmd_offset(pgdp, start); if (pmd_none(*pmdp)) { - ptep = sparc_init_alloc(&mempool, - PTE_TABLE_SIZE); + ptep = sparc_init_alloc(&mempool, PAGE_SIZE); + clear_page(ptep); pmd_set(pmdp, ptep); } start = (start + PMD_SIZE) & PMD_MASK; @@ -833,6 +898,7 @@ set_pte(ptep, pte); } +/* XXX no longer used, remove me... -DaveM */ void sparc_ultra_unmapioaddr(unsigned long virt_addr) { pgd_t *pgdp; @@ -867,11 +933,11 @@ { int slot; - printk ("Contents of dtlb: "); + prom_printf ("Contents of dtlb: "); for (slot = 0; slot < 14; slot++) printk (" "); - printk ("%2x:%016lx,%016lx\n", 0, spitfire_get_dtlb_tag(0), spitfire_get_dtlb_data(0)); + prom_printf ("%2x:%016lx,%016lx\n", 0, spitfire_get_dtlb_tag(0), spitfire_get_dtlb_data(0)); for (slot = 1; slot < 64; slot+=3) { - printk ("%2x:%016lx,%016lx %2x:%016lx,%016lx %2x:%016lx,%016lx\n", + prom_printf ("%2x:%016lx,%016lx %2x:%016lx,%016lx %2x:%016lx,%016lx\n", slot, spitfire_get_dtlb_tag(slot), spitfire_get_dtlb_data(slot), slot+1, spitfire_get_dtlb_tag(slot+1), spitfire_get_dtlb_data(slot+1), slot+2, spitfire_get_dtlb_tag(slot+2), spitfire_get_dtlb_data(slot+2)); @@ -886,16 +952,15 @@ __initfunc(unsigned long paging_init(unsigned long start_mem, unsigned long end_mem)) { - extern unsigned long phys_base; - extern void setup_tba(unsigned long kpgdir); - extern void __bfill64(void *, unsigned long *); - pmd_t *pmdp; - int i; + extern void setup_tba(void); + extern pmd_t swapper_pmd_dir[1024]; + extern unsigned long irq_init(unsigned long start_mem, unsigned long end_mem); + extern unsigned int sparc64_vpte_patchme[1]; unsigned long alias_base = phys_base + PAGE_OFFSET; unsigned long pt; unsigned long flags; unsigned long shift = alias_base - ((unsigned long)&empty_zero_page); - + set_bit(0, mmu_context_bmap); /* We assume physical memory starts at some 4mb multiple, * if this were not true we wouldn't boot up to this point @@ -922,44 +987,28 @@ * work. */ init_mm.pgd += ((shift) / (sizeof(pgd_t))); - - /* The funny offsets are to make page table operations much quicker and - * requite less state, see pgtable.h for gory details. - * pgtable.h assumes null_pmd_table is null_pte_table - PAGE_SIZE, let's - * check it now. - */ - null_pte_table=__pa(((unsigned long)&empty_null_pte_table)+shift); - if (null_pmd_table != __pa(((unsigned long)&empty_null_pmd_table)+shift)) { - prom_printf("null_p{md|te}_table broken.\n"); - prom_halt(); - } - two_null_pmd_table = (((unsigned long)null_pmd_table) << 32) | null_pmd_table; - two_null_pte_table = (((unsigned long)null_pte_table) << 32) | null_pte_table; - - pmdp = (pmd_t *) &empty_null_pmd_table; - for(i = 0; i < PTRS_PER_PMD; i++) - pmd_val(pmdp[i]) = null_pte_table; - - memset((void *) &empty_null_pte_table, 0, PTE_TABLE_SIZE); + + memset(swapper_pmd_dir, 0, sizeof(swapper_pmd_dir)); /* Now can init the kernel/bad page tables. */ - __bfill64((void *)swapper_pg_dir, &two_null_pmd_table); - __bfill64((void *)&empty_bad_pmd_table, &two_null_pte_table); + pgd_set(&swapper_pg_dir[0], swapper_pmd_dir + (shift / sizeof(pgd_t))); + + sparc64_vpte_patchme[0] |= (init_mm.pgd[0] >> 10); + + start_mem = irq_init(start_mem, end_mem); /* We use mempool to create page tables, therefore adjust it up * such that __pa() macros etc. work. */ mempool = PAGE_ALIGN(start_mem) + shift; - /* FIXME: This should be done much nicer. - * Just now we allocate 64M for each. - */ - allocate_ptable_skeleton(IOBASE_VADDR, IOBASE_VADDR + 0x4000000); + /* Allocate 64M for dynamic DVMA mapping area. */ allocate_ptable_skeleton(DVMA_VADDR, DVMA_VADDR + 0x4000000); inherit_prom_mappings(); + /* Ok, we can use our TLB miss and window trap handlers safely. */ - setup_tba((unsigned long)init_mm.pgd); + setup_tba(); /* Really paranoid. */ flushi((long)&empty_zero_page); @@ -985,6 +1034,10 @@ return device_scan (PAGE_ALIGN (start_mem)); } +/* XXX Add also PG_Hole flag, set it in the page structs here, + * XXX remove FREE_UNUSED_MEM_MAP code, and the nfsd file handle + * problems will all be gone. -DaveM + */ __initfunc(static void taint_real_pages(unsigned long start_mem, unsigned long end_mem)) { unsigned long tmp = 0, paddr, endaddr; @@ -1028,6 +1081,7 @@ unsigned long addr; unsigned long alias_base = phys_base + PAGE_OFFSET - (long)(&empty_zero_page); struct page *page, *end; + int i; end_mem &= PAGE_MASK; max_mapnr = MAP_NR(end_mem); @@ -1100,6 +1154,19 @@ #endif free_page(addr); } + +#ifndef __SMP__ + { + /* Put empty_pg_dir on pgd_quicklist */ + extern pgd_t empty_pg_dir[1024]; + unsigned long addr = (unsigned long)empty_pg_dir; + + memset(empty_pg_dir, 0, sizeof(empty_pg_dir)); + addr += alias_base; + mem_map[MAP_NR(addr)].pprev_hash = 0; + free_pgd_fast((pgd_t *)addr); + } +#endif printk("Memory: %uk available (%dk kernel code, %dk data, %dk init) [%016lx,%016lx]\n", nr_free_pages << (PAGE_SHIFT-10), @@ -1108,11 +1175,18 @@ initpages << (PAGE_SHIFT-10), PAGE_OFFSET, end_mem); - freepages.low = nr_free_pages >> 7; - if(freepages.low < 48) - freepages.low = 48; - freepages.low = freepages.low + (freepages.low >> 1); - freepages.high = freepages.low + freepages.low; + /* NOTE NOTE NOTE NOTE + * Please keep track of things and make sure this + * always matches the code in mm/page_alloc.c -DaveM + */ + i = nr_free_pages >> 7; + if (i < 48) + i = 48; + if (i > 256) + i = 256; + freepages.min = i; + freepages.low = i << 1; + freepages.high = freepages.low + i; } void free_initmem (void) diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/mm/modutil.c linux/arch/sparc64/mm/modutil.c --- v2.1.114/linux/arch/sparc64/mm/modutil.c Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/mm/modutil.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: modutil.c,v 1.3 1998/01/16 16:35:02 jj Exp $ +/* $Id: modutil.c,v 1.4 1998/07/26 06:29:08 davem Exp $ * arch/sparc64/mm/modutil.c * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -33,32 +33,6 @@ } } printk("Trying to unmap nonexistent module vm area (%p)\n", addr); -} - -void module_shrink(void * addr, unsigned long size) -{ - struct vm_struct *tmp; - - if (!addr) - return; - if ((PAGE_SIZE-1) & (unsigned long) addr) { - printk("Trying to shrink module with bad address (%p)\n", addr); - return; - } - size = PAGE_ALIGN(size); - if (!size) - module_unmap(addr); - for (tmp = modvmlist; tmp; tmp = tmp->next) { - if (tmp->addr == addr) { - if (size > tmp->size - PAGE_SIZE) { - printk("Trying to expand module with module_shrink()\n"); - return; - } - vmfree_area_pages(VMALLOC_VMADDR(tmp->addr)+size, tmp->size-size); - return; - } - } - printk("Trying to shrink nonexistent module vm area (%p)\n", addr); } void * module_map (unsigned long size) diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/mm/ultra.S linux/arch/sparc64/mm/ultra.S --- v2.1.114/linux/arch/sparc64/mm/ultra.S Fri May 8 23:14:46 1998 +++ linux/arch/sparc64/mm/ultra.S Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: ultra.S,v 1.21 1998/04/28 08:23:30 davem Exp $ +/* $Id: ultra.S,v 1.24 1998/05/22 11:02:56 davem Exp $ * ultra.S: Don't expand these all over the place... * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -8,90 +8,119 @@ #include #include - /* All callers check mm->context != NO_CONTEXT for us. */ + /* This file is meant to be read efficiently by the CPU, not humans. + * Staraj sie tego nikomu nie pierdolnac... + */ .text .align 32 - .globl __flush_tlb_mm, __flush_tlb_range, __flush_tlb_page -__flush_tlb_mm: /* %o0 == (mm->context & 0x3ff) */ - mov SECONDARY_CONTEXT, %g7 -9: ldxa [%g7] ASI_DMMU, %g2 + .globl __flush_tlb_page, __flush_tlb_mm, __flush_tlb_range +__flush_tlb_page: /* %o0=(ctx & 0x3ff), %o1=page&PAGE_MASK, %o2=SECONDARY_CONTEXT */ +/*IC1*/ ldxa [%o2] ASI_DMMU, %g2 cmp %g2, %o0 - bne,pn %icc, 1f + bne,pn %icc, __flush_tlb_page_slow + or %o1, 0x10, %g3 + stxa %g0, [%g3] ASI_DMMU_DEMAP + stxa %g0, [%g3] ASI_IMMU_DEMAP + retl + flush %g6 +__flush_tlb_mm: /* %o0=(ctx & 0x3ff), %o1=SECONDARY_CONTEXT */ +/*IC2*/ ldxa [%o1] ASI_DMMU, %g2 + cmp %g2, %o0 + bne,pn %icc, __flush_tlb_mm_slow mov 0x50, %g3 stxa %g0, [%g3] ASI_DMMU_DEMAP stxa %g0, [%g3] ASI_IMMU_DEMAP retl flush %g6 -1: rdpr %pstate, %g1 +__flush_tlb_range: /* %o0=(ctx&0x3ff), %o1=start&PAGE_MASK, %o2=SECONDARY_CONTEXT, + * %o3=end&PAGE_MASK, %o4=PAGE_SIZE, %o5=(end - start) + */ +#define TLB_MAGIC 206 /* Students, do you know how I calculated this? -DaveM */ +/*IC3*/ cmp %o5, %o4 + be,pt %xcc, __flush_tlb_page + srlx %o5, 13, %g5 + cmp %g5, TLB_MAGIC + bgeu,pn %icc, __flush_tlb_range_constant_time + or %o1, 0x10, %g5 + ldxa [%o2] ASI_DMMU, %g2 + cmp %g2, %o0 +__flush_tlb_range_page_by_page: +/*IC4*/ bne,pn %icc, __flush_tlb_range_pbp_slow + sub %o5, %o4, %o5 +1: stxa %g0, [%g5 + %o5] ASI_DMMU_DEMAP + stxa %g0, [%g5 + %o5] ASI_IMMU_DEMAP + brnz,pt %o5, 1b + sub %o5, %o4, %o5 + retl + flush %g6 +__flush_tlb_range_constant_time: /* %o0=ctx, %o1=start, %o3=end */ +/*IC5*/ rdpr %pstate, %g1 wrpr %g1, PSTATE_IE, %pstate - stxa %o0, [%g7] ASI_DMMU + mov (62 << 3), %g2 +1: ldxa [%g2] ASI_ITLB_TAG_READ, %o4 + and %o4, 0x3ff, %o5 + cmp %o5, %o0 + bne,pt %icc, 2f + andn %o4, 0x3ff, %o4 +/*IC6*/ cmp %o4, %o1 + blu,pt %xcc, 2f + cmp %o4, %o3 + blu,pn %xcc, 4f +2: ldxa [%g2] ASI_DTLB_TAG_READ, %o4 + and %o4, 0x3ff, %o5 + cmp %o5, %o0 + andn %o4, 0x3ff, %o4 +/*IC7*/ bne,pt %icc, 3f + cmp %o4, %o1 + blu,pt %xcc, 3f + cmp %o4, %o3 + blu,pn %xcc, 5f + nop +3: brnz,pt %g2, 1b + sub %g2, (1 << 3), %g2 +/*IC8*/ retl + wrpr %g1, 0x0, %pstate +4: stxa %g0, [%g2] ASI_ITLB_DATA_ACCESS + ba,pt %xcc, 2b + flush %g6 +5: stxa %g0, [%g2] ASI_DTLB_DATA_ACCESS + ba,pt %xcc, 3b + flush %g6 +__flush_tlb_mm_slow: +/*IC9*/ rdpr %pstate, %g1 + wrpr %g1, PSTATE_IE, %pstate + stxa %o0, [%o1] ASI_DMMU stxa %g0, [%g3] ASI_DMMU_DEMAP stxa %g0, [%g3] ASI_IMMU_DEMAP flush %g6 - stxa %g2, [%g7] ASI_DMMU + stxa %g2, [%o1] ASI_DMMU flush %g6 - retl +/*IC10*/retl wrpr %g1, 0, %pstate - nop -__flush_tlb_range: /* %o0 == (mm->context & 0x3ff), %o1 == start, %o2 == end */ - sethi %hi(8192 - 1), %g5 - or %g5, %lo(8192 - 1), %g5 - andn %o1, %g5, %o1 - andn %o2, %g5, %o2 - - sub %o2, %o1, %o3 - add %g5, 1, %g5 - orcc %o1, 0x10, %o1 - srlx %o3, 13, %o4 - cmp %o4, 96 - bgu,pn %icc, 9b - mov SECONDARY_CONTEXT, %g7 - ldxa [%g7] ASI_DMMU, %g2 - - nop - nop - cmp %g2, %o0 - be,pt %icc, 1f - sub %o3, %g5, %o3 +__flush_tlb_page_slow: rdpr %pstate, %g1 wrpr %g1, PSTATE_IE, %pstate - stxa %o0, [%g7] ASI_DMMU - -1: stxa %g0, [%o1 + %o3] ASI_DMMU_DEMAP - stxa %g0, [%o1 + %o3] ASI_IMMU_DEMAP - brnz,pt %o3, 1b - sub %o3, %g5, %o3 - flush %g6 - be,pt %icc, 1f - nop - stxa %g2, [%g7] ASI_DMMU - - flush %g6 - wrpr %g1, 0, %pstate -1: retl - nop - - .align 32 -__flush_tlb_page: /* %o0 == (mm->context & 0x3ff), %o1 == page & PAGE_MASK */ - mov SECONDARY_CONTEXT, %g7 - ldxa [%g7] ASI_DMMU, %g2 - cmp %g2, %o0 - bne,pt %icc, 1f - or %o1, 0x10, %g3 + stxa %o0, [%o2] ASI_DMMU stxa %g0, [%g3] ASI_DMMU_DEMAP stxa %g0, [%g3] ASI_IMMU_DEMAP + flush %g6 +/*IC11*/stxa %g2, [%o2] ASI_DMMU + flush %g6 retl - flush %g6 -1: rdpr %pstate, %g1 + wrpr %g1, 0, %pstate +__flush_tlb_range_pbp_slow: + rdpr %pstate, %g1 wrpr %g1, PSTATE_IE, %pstate - stxa %o0, [%g7] ASI_DMMU - stxa %g0, [%g3] ASI_DMMU_DEMAP - stxa %g0, [%g3] ASI_IMMU_DEMAP + stxa %o0, [%o2] ASI_DMMU +2: stxa %g0, [%g5 + %o5] ASI_DMMU_DEMAP + stxa %g0, [%g5 + %o5] ASI_IMMU_DEMAP + brnz,pt %o5, 2b + sub %o5, %o4, %o5 flush %g6 - stxa %g2, [%g7] ASI_DMMU +/*IC13*/stxa %g2, [%o2] ASI_DMMU flush %g6 retl - wrpr %g1, 0, %pstate + wrpr %g1, 0x0, %pstate #ifdef __SMP__ /* These are all called by the slaves of a cross call, at @@ -106,6 +135,8 @@ * %g2 scratch 1 * %g3 scratch 2 * %g4 scratch 3 + * + * TODO: Make xcall TLB range flushes use the tricks above... -DaveM */ .align 32 .globl xcall_flush_tlb_page, xcall_flush_tlb_mm, xcall_flush_tlb_range diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/prom/misc.c linux/arch/sparc64/prom/misc.c --- v2.1.114/linux/arch/sparc64/prom/misc.c Thu Jul 31 13:09:17 1997 +++ linux/arch/sparc64/prom/misc.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.9 1997/07/24 12:15:11 davem Exp $ +/* $Id: misc.c,v 1.10 1998/07/21 10:36:29 jj Exp $ * misc.c: Miscellaneous prom functions that don't belong * anywhere else. * @@ -33,8 +33,7 @@ /* We want to do this more nicely some day. */ #ifdef CONFIG_SUN_CONSOLE -extern void console_restore_palette(void); -extern void set_palette(void); +extern void (*prom_palette)(int); extern int serial_console; #endif @@ -52,10 +51,8 @@ /* kernel_enter_debugger(); */ #ifdef CONFIG_SUN_CONSOLE -#if 0 - if(!serial_console) - console_restore_palette (); -#endif + if(!serial_console && prom_palette) + prom_palette (1); #endif /* install_obp_ticker(); */ save_flags(flags); cli(); @@ -63,10 +60,8 @@ restore_flags(flags); /* install_linux_ticker(); */ #ifdef CONFIG_SUN_CONSOLE -#if 0 - if(!serial_console) - set_palette (); -#endif + if(!serial_console && prom_palette) + prom_palette (0); #endif } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/solaris/fs.c linux/arch/sparc64/solaris/fs.c --- v2.1.114/linux/arch/sparc64/solaris/fs.c Thu May 14 19:47:38 1998 +++ linux/arch/sparc64/solaris/fs.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: fs.c,v 1.8 1998/03/29 10:11:02 davem Exp $ +/* $Id: fs.c,v 1.10 1998/05/09 06:15:45 davem Exp $ * fs.c: fs related syscall emulation for Solaris * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/solaris/ipc.c linux/arch/sparc64/solaris/ipc.c --- v2.1.114/linux/arch/sparc64/solaris/ipc.c Mon Jan 12 15:15:44 1998 +++ linux/arch/sparc64/solaris/ipc.c Tue Aug 4 16:03:35 1998 @@ -1,9 +1,10 @@ -/* $Id: ipc.c,v 1.2 1997/09/18 10:38:27 rth Exp $ +/* $Id: ipc.c,v 1.3 1998/07/30 11:29:47 davem Exp $ * ipc.c: Solaris IPC emulation * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ +#include #include #include #include diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/solaris/misc.c linux/arch/sparc64/solaris/misc.c --- v2.1.114/linux/arch/sparc64/solaris/misc.c Sun Jun 7 11:16:28 1998 +++ linux/arch/sparc64/solaris/misc.c Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.10 1998/04/01 05:16:06 davem Exp $ +/* $Id: misc.c,v 1.12 1998/06/16 04:37:08 davem Exp $ * misc.c: Miscelaneous syscall emulation for Solaris * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -188,6 +188,7 @@ asmlinkage int solaris_utsname(u32 buf) { /* Why should we not lie a bit? */ + down(&uts_sem); set_utsfield(((struct sol_utsname *)A(buf))->sysname, "SunOS", 0, 0); set_utsfield(((struct sol_utsname *)A(buf))->nodename, @@ -198,6 +199,7 @@ "Generic", 0, 0); set_utsfield(((struct sol_utsname *)A(buf))->machine, machine(), 0, 0); + up(&uts_sem); return 0; } diff -u --recursive --new-file v2.1.114/linux/arch/sparc64/vmlinux.lds linux/arch/sparc64/vmlinux.lds --- v2.1.114/linux/arch/sparc64/vmlinux.lds Thu Apr 23 20:21:32 1998 +++ linux/arch/sparc64/vmlinux.lds Tue Aug 4 16:03:35 1998 @@ -6,7 +6,8 @@ SECTIONS { empty_zero_page = 0x0000000000400000; - swapper_pg_dir = 0x0000000000402000; + swapper_pmd_dir = 0x0000000000402000; + empty_pg_dir = 0x0000000000403000; . = 0x4000; .text 0x0000000000404000 : { @@ -47,16 +48,6 @@ *(.dynbss) *(.bss) *(COMMON) - . = ALIGN(8192); - empty_bad_pmd_table = .; - . += 8192; - empty_bad_pte_table = .; - . += 8192; - . += 0x40; - empty_null_pmd_table = .; - . += 8192; - empty_null_pte_table = .; - . += 8192; } _end = . ; PROVIDE (end = .); diff -u --recursive --new-file v2.1.114/linux/drivers/Makefile linux/drivers/Makefile --- v2.1.114/linux/drivers/Makefile Mon Aug 3 12:45:44 1998 +++ linux/drivers/Makefile Tue Aug 4 16:49:18 1998 @@ -10,7 +10,7 @@ SUB_DIRS := block char net misc sound MOD_SUB_DIRS := $(SUB_DIRS) sbus ALL_SUB_DIRS := $(SUB_DIRS) pci scsi sbus cdrom isdn pnp \ - macintosh video dio zorro + macintosh video dio zorro fc4 ifdef CONFIG_DIO SUB_DIRS += dio @@ -80,6 +80,15 @@ ifeq ($(CONFIG_AP1000),y) SUB_DIRS += ap1000 ALL_SUB_DIRS += ap1000 +endif + +ifeq ($(CONFIG_FC4),y) +SUB_DIRS += fc4 +MOD_SUB_DIRS += fc4 +else + ifeq ($(CONFIG_FC4),m) + MOD_SUB_DIRS += fc4 + endif endif # When MOD_LIST_NAME is set, make will try to add $(MOD_SUB_DIRS).o to diff -u --recursive --new-file v2.1.114/linux/drivers/block/Config.in linux/drivers/block/Config.in --- v2.1.114/linux/drivers/block/Config.in Mon Aug 3 12:45:44 1998 +++ linux/drivers/block/Config.in Tue Aug 4 16:56:37 1998 @@ -45,7 +45,7 @@ fi fi fi - if [ "$CONFIG_CHRP" = "y" ]; then + if [ "$CONFIG_PPC" = "y" ]; then bool ' WInbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 fi fi diff -u --recursive --new-file v2.1.114/linux/drivers/block/cmd646.c linux/drivers/block/cmd646.c --- v2.1.114/linux/drivers/block/cmd646.c Mon Apr 6 17:40:59 1998 +++ linux/drivers/block/cmd646.c Tue Aug 4 16:56:37 1998 @@ -1,20 +1,248 @@ -/* $Id: cmd646.c,v 1.1 1998/03/15 13:29:10 ecd Exp $ - * cmd646.c: Enable interrupts at initialization time on Ultra/PCI machines +/* $Id: cmd646.c,v 1.10 1998/08/03 15:28:42 davem Exp $ + * cmd646.c: Enable interrupts at initialization time on Ultra/PCI machines. + * Note, this driver is not used at all on other systems because + * there the "BIOS" has done all of the following already. + * Due to massive hardware bugs, UltraDMA is only supported + * on the 646U2 and not on the 646U. * * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) + * Copyright (C) 1998 David S. Miller (davem@dm.cobaltmicro.com) */ +#include #include +#include +#include #include "ide.h" +static int cmd646_config_drive_for_dma(ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = HWIF(drive); + + /* Even if the drive is not _currently_ in a DMA + * mode, we succeed, and we'll enable it manually + * below in cmd646_dma_onoff. + * + * This is done for disks only, CDROMs and other + * IDE devices are just too quirky. + */ + if((id != NULL) && + ((id->capability & 1) != 0) && + hwif->autodma && + (drive->media == ide_disk)) { + if(id->field_valid & 0x0004) { + if(id->dma_ultra & 0x0007) + return hwif->dmaproc(ide_dma_on, drive); + } + if(id->field_valid & 0x0002) + if((id->dma_mword & 0x0004) || (id->dma_1word & 0x0004)) + return hwif->dmaproc(ide_dma_on, drive); + } + return hwif->dmaproc(ide_dma_off_quietly, drive); +} + +/* This is fun. -DaveM */ +#define IDE_SETXFER 0x03 +#define IDE_SETFEATURE 0xef +#define IDE_DMA2_ENABLE 0x22 +#define IDE_DMA1_ENABLE 0x21 +#define IDE_DMA0_ENABLE 0x20 +#define IDE_UDMA2_ENABLE 0x42 +#define IDE_UDMA1_ENABLE 0x41 +#define IDE_UDMA0_ENABLE 0x40 + +static __inline__ unsigned char dma2_bits_to_command(unsigned char bits) +{ + if(bits & 0x04) + return IDE_DMA2_ENABLE; + if(bits & 0x02) + return IDE_DMA1_ENABLE; + return IDE_DMA0_ENABLE; +} + +static __inline__ unsigned char udma2_bits_to_command(unsigned char bits) +{ + if(bits & 0x04) + return IDE_UDMA2_ENABLE; + if(bits & 0x02) + return IDE_UDMA1_ENABLE; + return IDE_UDMA0_ENABLE; +} + +static __inline__ int wait_for_ready(ide_drive_t *drive) +{ + int timeout = 100; + byte stat; + + while(--timeout) { + stat = GET_STAT(); + + printk("STAT(%2x) ", stat); + if(!(stat & BUSY_STAT)) { + if((stat & READY_STAT) || (stat & ERR_STAT)) + break; + } + udelay(100); + } + if((stat & ERR_STAT) || timeout <= 0) + return 1; + return 0; +} + +static void cmd646_do_setfeature(ide_drive_t *drive, byte command) +{ + unsigned long flags; + byte old_select; + + save_flags(flags); + cli(); + printk("SELECT "); + old_select = IN_BYTE(IDE_SELECT_REG); + OUT_BYTE(drive->select.all, IDE_SELECT_REG); + printk("SETXFER "); + OUT_BYTE(IDE_SETXFER, IDE_FEATURE_REG); + printk("CMND "); + OUT_BYTE(command, IDE_NSECTOR_REG); + printk("wait "); + if(wait_for_ready(drive)) + goto out; + printk("SETFEATURE "); + OUT_BYTE(IDE_SETFEATURE, IDE_COMMAND_REG); + printk("wait "); + (void) wait_for_ready(drive); +out: + OUT_BYTE(old_select, IDE_SELECT_REG); + restore_flags(flags); +} + +static void cmd646_dma2_enable(ide_drive_t *drive, unsigned long dma_base) +{ + byte unit = (drive->select.b.unit & 0x01); + byte bits = (drive->id->dma_mword | drive->id->dma_1word) & 0x07; + + printk("CMD646: MDMA enable ["); + if((((drive->id->dma_mword & 0x0007) << 8) != + (drive->id->dma_mword & 0x0700))) + cmd646_do_setfeature(drive, dma2_bits_to_command(bits)); + printk("DMA_CAP "); + outb(inb(dma_base+2)|(1<<(5+unit)), dma_base+2); + printk("DONE]\n"); +} + +static void cmd646_udma_enable(ide_drive_t *drive, unsigned long dma_base) +{ + byte unit = (drive->select.b.unit & 0x01); + byte udma_ctrl, bits = drive->id->dma_ultra & 0x07; + byte udma_timing_bits; + + printk("CMD646: UDMA enable ["); + if(((drive->id->dma_ultra & 0x0007) << 8) != + (drive->id->dma_ultra & 0x0700)) + cmd646_do_setfeature(drive, udma2_bits_to_command(bits)); + + /* Enable DMA and UltraDMA */ + printk("DMA_CAP "); + outb(inb(dma_base+2)|(1<<(5+unit)), dma_base+2); + + udma_ctrl = inb(dma_base + 3); + + /* Put this channel into UDMA mode. */ + printk("UDMA_CTRL "); + udma_ctrl |= (1 << unit); + + /* Set UDMA2 usable timings. */ + if(bits & 0x04) + udma_timing_bits = 0x10; + else if(bits & 0x02) + udma_timing_bits = 0x20; + else + udma_timing_bits = 0x30; + udma_ctrl &= ~(0x30 << (unit * 2)); + udma_ctrl |= (udma_timing_bits << (unit * 2)); + + outb(udma_ctrl, dma_base+3); + printk("DONE]\n"); +} + +static int cmd646_dma_onoff(ide_drive_t *drive, int enable) +{ + if(enable) { + ide_hwif_t *hwif = HWIF(drive); + unsigned long dma_base = hwif->dma_base; + struct hd_driveid *id = drive->id; + unsigned int class_rev; + + /* UltraDMA only supported on PCI646U and PCI646U2, + * which correspond to revisions 0x03 and 0x05 respectively. + * Actually, although the CMD tech support people won't + * tell me the details, the 0x03 revision cannot support + * UDMA correctly without hardware modifications, and even + * then it only works with Quantum disks due to some + * hold time assumptions in the 646U part which are fixed + * in the 646U2. + * So we only do UltraDMA on revision 0x05 chipsets. + */ + pci_read_config_dword(hwif->pci_dev, + PCI_CLASS_REVISION, + &class_rev); + class_rev &= 0xff; + if((class_rev == 0x05) && + (id->field_valid & 0x0004) && + (id->dma_ultra & 0x07)) { + /* UltraDMA modes. */ + cmd646_udma_enable(drive, dma_base); + } else { + /* Normal MultiWord DMA modes. */ + cmd646_dma2_enable(drive, dma_base); + } + } + drive->using_dma = enable; + return 0; +} + +static int cmd646_dmaproc(ide_dma_action_t func, ide_drive_t *drive) +{ + if(func == ide_dma_check) + return cmd646_config_drive_for_dma(drive); + else if(func == ide_dma_on || func == ide_dma_off || func == ide_dma_off_quietly) + return cmd646_dma_onoff(drive, (func == ide_dma_on)); + + /* Other cases are done by generic IDE-DMA code. */ + return ide_dmaproc(func, drive); +} + __initfunc(void ide_init_cmd646 (ide_hwif_t *hwif)) { -#ifdef __sparc_v9__ struct pci_dev *dev = hwif->pci_dev; unsigned char mrdmode; + hwif->chipset = ide_cmd646; + + /* Set a good latency timer value. */ + (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 240); + + /* Setup interrupts. */ (void) pci_read_config_byte(dev, 0x71, &mrdmode); mrdmode &= ~(0x30); (void) pci_write_config_byte(dev, 0x71, mrdmode); -#endif + + /* Use MEMORY READ LINE for reads. + * NOTE: Although not mentioned in the PCI0646U specs, + * these bits are write only and won't be read + * back as set or not. The PCI0646U2 specs clarify + * this point. + */ + (void) pci_write_config_byte(dev, 0x71, mrdmode | 0x02); + + /* Set reasonable active/recovery/address-setup values. */ + (void) pci_write_config_byte(dev, 0x53, 0x40); + (void) pci_write_config_byte(dev, 0x54, 0x3f); + (void) pci_write_config_byte(dev, 0x55, 0x40); + (void) pci_write_config_byte(dev, 0x56, 0x3f); + (void) pci_write_config_byte(dev, 0x57, 0x5c); + (void) pci_write_config_byte(dev, 0x58, 0x3f); + (void) pci_write_config_byte(dev, 0x5b, 0x3f); + + hwif->dmaproc = &cmd646_dmaproc; } diff -u --recursive --new-file v2.1.114/linux/drivers/block/genhd.c linux/drivers/block/genhd.c --- v2.1.114/linux/drivers/block/genhd.c Wed Jun 24 22:54:04 1998 +++ linux/drivers/block/genhd.c Tue Aug 4 16:49:18 1998 @@ -1097,6 +1097,9 @@ #ifdef CONFIG_MD_BOOT extern void md_setup_drive(void) __init; #endif +#ifdef CONFIG_FC4_SOC + extern int soc_probe(void); +#endif struct gendisk *p; int nr=0; @@ -1106,6 +1109,10 @@ chr_dev_init(); blk_dev_init(); sti(); +#ifdef CONFIG_FC4_SOC + /* This has to be done before scsi_dev_init */ + soc_probe(); +#endif #ifdef CONFIG_SCSI scsi_dev_init(); #endif diff -u --recursive --new-file v2.1.114/linux/drivers/block/ide-pci.c linux/drivers/block/ide-pci.c --- v2.1.114/linux/drivers/block/ide-pci.c Mon Aug 3 12:45:44 1998 +++ linux/drivers/block/ide-pci.c Tue Aug 4 16:56:37 1998 @@ -271,8 +271,9 @@ printk("%s: bad irq (%d): will probe later\n", d->name, pciirq); pciirq = 0; } else { -#ifdef __sparc_v9__ - printk("%s: 100%% native mode on irq %08x\n", d->name, pciirq); +#ifdef __sparc__ + printk("%s: 100%% native mode on irq %s\n", + d->name, __irq_itoa(pciirq)); #else printk("%s: 100%% native mode on irq %d\n", d->name, pciirq); #endif diff -u --recursive --new-file v2.1.114/linux/drivers/block/ide-probe.c linux/drivers/block/ide-probe.c --- v2.1.114/linux/drivers/block/ide-probe.c Thu May 7 22:51:48 1998 +++ linux/drivers/block/ide-probe.c Tue Aug 4 16:56:37 1998 @@ -568,14 +568,23 @@ hwgroup->hwif = HWIF(hwgroup->drive); restore_flags(flags); /* all CPUs; safe now that hwif->hwgroup is set up */ -#ifndef __mc68000__ +#if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__) printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", hwif->name, - hwif->io_ports[IDE_DATA_OFFSET], hwif->io_ports[IDE_DATA_OFFSET]+7, hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq); + hwif->io_ports[IDE_DATA_OFFSET], + hwif->io_ports[IDE_DATA_OFFSET]+7, + hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq); +#elif defined(__sparc__) + printk("%s at 0x%03x-0x%03x,0x%03x on irq %s", hwif->name, + hwif->io_ports[IDE_DATA_OFFSET], + hwif->io_ports[IDE_DATA_OFFSET]+7, + hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq)); #else - printk("%s at %p on irq 0x%08x", hwif->name, hwif->io_ports[IDE_DATA_OFFSET], hwif->irq); -#endif /* __mc68000__ */ + printk("%s at %p on irq 0x%08x", hwif->name, + hwif->io_ports[IDE_DATA_OFFSET], hwif->irq); +#endif /* __mc68000__ && CONFIG_APUS */ if (match) - printk(" (%sed with %s)", hwif->sharing_irq ? "shar" : "serializ", match->name); + printk(" (%sed with %s)", + hwif->sharing_irq ? "shar" : "serializ", match->name); printk("\n"); return 0; } diff -u --recursive --new-file v2.1.114/linux/drivers/block/ide.h linux/drivers/block/ide.h --- v2.1.114/linux/drivers/block/ide.h Mon Aug 3 12:45:44 1998 +++ linux/drivers/block/ide.h Wed Aug 5 00:03:00 1998 @@ -305,7 +305,7 @@ ide_cmd640, ide_dtc2278, ide_ali14xx, ide_qd6580, ide_umc8672, ide_ht6560b, ide_pdc4030, ide_rz1000, ide_trm290, - ide_4drives + ide_cmd646, ide_4drives } hwif_chipset_t; typedef struct ide_pci_devid_s { diff -u --recursive --new-file v2.1.114/linux/drivers/block/ns87415.c linux/drivers/block/ns87415.c --- v2.1.114/linux/drivers/block/ns87415.c Thu May 7 22:51:48 1998 +++ linux/drivers/block/ns87415.c Tue Aug 4 16:56:37 1998 @@ -130,6 +130,19 @@ int timeout; byte stat; /* + * Put reasonable values in the timing registers + * for DMA2 mode performance. + */ + pci_write_config_byte(dev, 0x44, 0xfe); + pci_write_config_byte(dev, 0x45, 0xfe); + pci_write_config_byte(dev, 0x48, 0xfe); + pci_write_config_byte(dev, 0x49, 0xfe); + pci_write_config_byte(dev, 0x4c, 0xfe); + pci_write_config_byte(dev, 0x4d, 0xfe); + pci_write_config_byte(dev, 0x50, 0xfe); + pci_write_config_byte(dev, 0x51, 0xfe); + + /* * XXX: Reset the device, if we don't it will not respond * to SELECT_DRIVE() properly during first probe_hwif(). */ diff -u --recursive --new-file v2.1.114/linux/drivers/block/sl82c105.c linux/drivers/block/sl82c105.c --- v2.1.114/linux/drivers/block/sl82c105.c Thu May 7 22:51:48 1998 +++ linux/drivers/block/sl82c105.c Tue Aug 4 16:56:37 1998 @@ -38,7 +38,10 @@ pci_write_config_dword(dev, 0x40, 0x10ff08a1); } -#if 0 /* nobody ever calls these.. ?? */ +/* nobody ever calls these.. ?? -mlord + * + * Yes somebody certainly does, check asm-ppc/ide.h for the place. -DaveM + */ void chrp_ide_probe(void) { struct pci_dev *pdev = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, NULL); @@ -68,4 +71,3 @@ if (irq != NULL) *irq = chrp_ide_irq; } -#endif 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/cyclades.c linux/drivers/char/cyclades.c --- v2.1.114/linux/drivers/char/cyclades.c Sun Jun 7 11:16:29 1998 +++ linux/drivers/char/cyclades.c Tue Aug 4 15:00:04 1998 @@ -1,7 +1,7 @@ #define BLOCKMOVE #define Z_WAKE static char rcsid[] = -"$Revision: 2.2.1.3 $$Date: 1998/06/01 12:09:10 $"; +"$Revision: 2.2.1.4 $$Date: 1998/08/04 11:02:50 $"; /* * linux/drivers/char/cyclades.c @@ -31,6 +31,12 @@ * void cleanup_module(void); * * $Log: cyclades.c,v $ + * Revision 2.2.1.4 1998/08/04 11:02:50 ivan + * /proc/cyclades implementation with great collaboration of + * Marc Lewis ; + * cyy_interrupt was changed to avoid occurence of kernel oopses + * during PPP operation. + * * Revision 2.2.1.3 1998/06/01 12:09:10 ivan * General code review in order to comply with 2.1 kernel standards; * data loss prevention for slow devices revisited (cy_wait_until_sent @@ -143,7 +149,7 @@ * Price for help on this) * * Revision 1.36.4.21 1996/09/10 17:00:10 bentson - * shift from cpu-bound to memcopy in cyz_polling operation + * shift from CPU-bound to memcopy in cyz_polling operation * * Revision 1.36.4.20 1996/09/09 18:30:32 Bentson * Added support to set and report higher speeds. @@ -557,6 +563,10 @@ #include #include +#ifdef CONFIG_PROC_FS +#include +#include +#endif #define cy_put_user put_user @@ -589,6 +599,8 @@ #define STD_COM_FLAGS (0) +#define JIFFIES_DIFF(n, j) ((n) >= (j) ? (n) - (j) : ULONG_MAX - (n) + (j)) + static DECLARE_TASK_QUEUE(tq_cyclades); static struct tty_driver cy_serial_driver, cy_callout_driver; @@ -748,6 +760,10 @@ static void show_status(int); #endif +#ifdef CONFIG_PROC_FS +static int cyclades_get_proc_info(char *, char **, off_t , int , int *, void *); +#endif + /* The Cyclades-Z polling cycle is defined by this variable */ static long cyz_polling_cycle = CZ_DEF_POLL; @@ -1202,11 +1218,13 @@ TTY_FRAME; *tty->flip.char_buf_ptr++ = cy_readb(base_addr+(CyRDSR<idle_stats.frame_errs++; }else if(data & CyPARITY){ *tty->flip.flag_buf_ptr++ = TTY_PARITY; *tty->flip.char_buf_ptr++ = cy_readb(base_addr+(CyRDSR<idle_stats.parity_errs++; }else if(data & CyOVERRUN){ *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; @@ -1223,6 +1241,7 @@ *tty->flip.char_buf_ptr++ = cy_readb(base_addr+(CyRDSR<idle_stats.overruns++; /* These two conditions may imply */ /* a normal read should be done. */ /* }else if(data & CyTIMEOUT){ */ @@ -1239,6 +1258,7 @@ /* there was a software buffer overrun and nothing could be done about it!!! */ + info->idle_stats.overruns++; } } else { /* normal character reception */ /* load # chars available from the chip */ @@ -1251,6 +1271,8 @@ info->mon.char_max = char_count; info->mon.char_last = char_count; #endif + info->idle_stats.recv_bytes += char_count; + info->idle_stats.recv_idle = jiffies; while(char_count--){ if (tty->flip.count >= TTY_FLIPBUF_SIZE){ break; @@ -1345,25 +1367,25 @@ info->x_break = 0; } - if (!info->xmit_cnt){ - cy_writeb((u_long)base_addr+(CySRER<xmit_buf == 0){ - cy_writeb((u_long)base_addr+(CySRER<tty->stopped || info->tty->hw_stopped){ - cy_writeb((u_long)base_addr+(CySRER< 0){ - if (!info->xmit_cnt){ + if (!info->xmit_cnt){ + cy_writeb((u_long)base_addr+(CySRER<xmit_buf == 0){ + cy_writeb((u_long)base_addr+(CySRER<tty->stopped || info->tty->hw_stopped){ + cy_writeb((u_long)base_addr+(CySRER<mon.char_max = char_count; info->mon.char_last = char_count; #endif + info->idle_stats.recv_bytes += char_count; + info->idle_stats.recv_idle = jiffies; if( tty == 0){ /* flush received characters */ rx_get = (rx_get + char_count) & (rx_bufsize - 1); @@ -1952,6 +1976,10 @@ clear_bit(TTY_IO_ERROR, &info->tty->flags); } info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; + memset((char *)&info->idle_stats, 0, sizeof(info->idle_stats)); + info->idle_stats.in_use = + info->idle_stats.recv_idle = + info->idle_stats.xmit_idle = jiffies; restore_flags(flags); } else { struct FIRM_ID *firm_id; @@ -2013,6 +2041,10 @@ } info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; + memset((char *)&info->idle_stats, 0, sizeof(info->idle_stats)); + info->idle_stats.in_use = + info->idle_stats.recv_idle = + info->idle_stats.xmit_idle = jiffies; } #ifdef CY_DEBUG_OPEN @@ -2787,6 +2819,10 @@ ret += c; } } + + info->idle_stats.xmit_bytes += ret; + info->idle_stats.xmit_idle = jiffies; + if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) { start_xmit(info); } @@ -2826,6 +2862,8 @@ info->xmit_buf[info->xmit_head++] = ch; info->xmit_head &= SERIAL_XMIT_SIZE - 1; info->xmit_cnt++; + info->idle_stats.xmit_bytes++; + info->idle_stats.xmit_idle = jiffies; restore_flags(flags); } /* cy_put_char */ @@ -3924,10 +3962,13 @@ case CYGETCD1400VER: ret_val = info->chip_rev; break; - case CYZPOLLCYCLE: - cyz_polling_cycle = (HZ * arg) / 1000; + case CYZSETPOLLCYCLE: + cyz_polling_cycle = (arg * HZ) / 1000; ret_val = 0; break; + case CYZGETPOLLCYCLE: + ret_val = (cyz_polling_cycle * 1000) / HZ; + break; case CYSETWAIT: info->closing_wait = (unsigned short)arg * HZ/100; ret_val = 0; @@ -4876,6 +4917,65 @@ __DATE__, __TIME__); } /* show_version */ +#ifdef CONFIG_PROC_FS +static int +cyclades_get_proc_info(char *buf, char **start, off_t offset, int length, + int *eof, void *data) +{ + struct cyclades_port *info; + int i; + int len=0; + off_t begin=0; + off_t pos=0; + int size; + __u32 cur_jifs = jiffies; + + size = sprintf(buf, "Dev TimeOpen BytesOut IdleOut BytesIn IdleIn Overruns Ldisc\n"); + + pos += size; + len += size; + + /* Output one line for each known port */ + for (i = 0; i < NR_PORTS && cy_port[i].line >= 0; i++) { + info = &cy_port[i]; + + if (info->count) + size = sprintf(buf+len, + "%3d %8lu %10lu %8lu %10lu %8lu %9lu %6ld\n", + info->line, + JIFFIES_DIFF(info->idle_stats.in_use, cur_jifs) / HZ, + info->idle_stats.xmit_bytes, + JIFFIES_DIFF(info->idle_stats.xmit_idle, cur_jifs) / HZ, + info->idle_stats.recv_bytes, + JIFFIES_DIFF(info->idle_stats.recv_idle, cur_jifs) / HZ, + info->idle_stats.overruns, + info->tty->ldisc.num); + else + size = sprintf(buf+len, + "%3d %8lu %10lu %8lu %10lu %8lu %9lu %6ld\n", + info->line, 0L, 0L, 0L, 0L, 0L, 0L, 0L); + len += size; + pos = begin + len; + + if (pos < offset) { + len = 0; + begin = pos; + } + if (pos > offset + length) + goto done; + } + *eof = 1; +done: + *start = buf + (offset - begin); /* Start of wanted data */ + len -= (offset - begin); /* Start slop */ + if (len > length) + len = length; /* Ending slop */ + if (len < 0) + len = 0; + return len; +} +#endif + /* The serial driver boot-time initialization code! Hardware I/O ports are mapped to character special devices on a @@ -4905,6 +5005,7 @@ unsigned long mailbox; unsigned short chip_number; int nports; + struct proc_dir_entry *ent; show_version(); @@ -5145,6 +5246,16 @@ #endif } +#ifdef CONFIG_PROC_FS + ent = create_proc_entry("cyclades", S_IFREG | S_IRUGO, 0); + ent->read_proc = cyclades_get_proc_info; +#endif +#if 0 +#ifdef CONFIG_PROC_FS + proc_register(&proc_root, &cyclades_proc_entry); +#endif +#endif + return 0; } /* cy_init */ @@ -5187,6 +5298,10 @@ free_irq(cy_card[i].irq,NULL); } } +#ifdef CONFIG_PROC_FS + remove_proc_entry("cyclades", 0); +#endif + } /* cleanup_module */ #else /* called by linux/init/main.c to parse command line options */ 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/misc.c linux/drivers/char/misc.c --- v2.1.114/linux/drivers/char/misc.c Mon Aug 3 12:45:45 1998 +++ linux/drivers/char/misc.c Tue Aug 4 16:49:18 1998 @@ -85,6 +85,7 @@ extern int radio_init(void); extern void hfmodem_init(void); extern int pc110pad_init(void); +extern int pmu_device_init(void); #ifdef CONFIG_PROC_FS static int misc_read_proc(char *buf, char **start, off_t offset, @@ -279,6 +280,9 @@ #endif #ifdef CONFIG_HFMODEM hfmodem_init(); +#endif +#ifdef CONFIG_PMAC_PBOOK + pmu_device_init(); #endif #endif /* !MODULE */ if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { diff -u --recursive --new-file v2.1.114/linux/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c --- v2.1.114/linux/drivers/char/pc_keyb.c Tue Jun 23 10:01:22 1998 +++ linux/drivers/char/pc_keyb.c Tue Aug 4 16:57:10 1998 @@ -224,7 +224,7 @@ -unsigned char kbd_read_mask = KBD_STAT_OBF; /* Modified by psaux.c */ +unsigned char pckbd_read_mask = KBD_STAT_OBF; /* Modified by psaux.c */ /* used only by send_data - set by keyboard_interrupt */ static volatile unsigned char reply_expected = 0; @@ -559,7 +559,7 @@ unsigned char scancode; /* mouse data? */ - if (status & kbd_read_mask & KBD_STAT_MOUSE_OBF) + if (status & pckbd_read_mask & KBD_STAT_MOUSE_OBF) break; scancode = inb(KBD_DATA_REG); diff -u --recursive --new-file v2.1.114/linux/drivers/char/pc_keyb.h linux/drivers/char/pc_keyb.h --- v2.1.114/linux/drivers/char/pc_keyb.h Tue Apr 14 14:29:20 1998 +++ linux/drivers/char/pc_keyb.h Tue Aug 4 16:57:10 1998 @@ -23,7 +23,7 @@ * Internal variables of the driver */ -extern unsigned char kbd_read_mask; +extern unsigned char pckbd_read_mask; extern unsigned char aux_device_present; /* diff -u --recursive --new-file v2.1.114/linux/drivers/char/psaux.c linux/drivers/char/psaux.c --- v2.1.114/linux/drivers/char/psaux.c Tue Mar 10 10:03:31 1998 +++ linux/drivers/char/psaux.c Tue Aug 4 16:57:10 1998 @@ -613,7 +613,7 @@ printk(KERN_INFO "PS/2 auxiliary pointing device detected -- driver installed.\n"); aux_present = 1; #ifdef CONFIG_VT - kbd_read_mask = AUX_STAT_OBF; + pckbd_read_mask = AUX_STAT_OBF; #endif } else { return -EIO; 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/stallion.c linux/drivers/char/stallion.c --- v2.1.114/linux/drivers/char/stallion.c Wed Jun 24 22:54:05 1998 +++ linux/drivers/char/stallion.c Tue Aug 4 22:59:46 1998 @@ -46,6 +46,8 @@ #include #include #include +#include + #include #include #include @@ -2001,7 +2003,6 @@ /* * Service an off-level request for some channel. */ - static void stl_offintr(void *private) { stlport_t *portp; @@ -2016,10 +2017,12 @@ if (portp == (stlport_t *) NULL) return; + tty = portp->tty; if (tty == (struct tty_struct *) NULL) return; + lock_kernel(); if (test_bit(ASYI_TXLOW, &portp->istate)) { if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) @@ -2041,6 +2044,7 @@ } } } + unlock_kernel(); } /*****************************************************************************/ diff -u --recursive --new-file v2.1.114/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c --- v2.1.114/linux/drivers/char/tty_io.c Tue Jul 21 00:15:31 1998 +++ linux/drivers/char/tty_io.c Tue Aug 4 22:59:08 1998 @@ -80,6 +80,7 @@ #include #endif #include +#include #include #include @@ -371,17 +372,24 @@ NULL /* hung_up_tty_fasync */ }; +/* + * This can be called through the "tq_scheduler" + * task-list. That is process synchronous, but + * doesn't hold any locks, so we need to make + * sure we have the appropriate locks for what + * we're doing.. + */ void do_tty_hangup(void *data) { struct tty_struct *tty = (struct tty_struct *) data; struct file * filp; struct task_struct *p; - unsigned long flags; if (!tty) return; - - save_flags(flags); cli(); + + /* inuse_filps is protected by the single kernel lock */ + lock_kernel(); check_tty_count(tty, "do_tty_hangup"); for (filp = inuse_filps; filp; filp = filp->f_next) { @@ -400,13 +408,21 @@ filp->f_op = &hung_up_tty_fops; } - if (tty->ldisc.flush_buffer) - tty->ldisc.flush_buffer(tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); - if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) && - tty->ldisc.write_wakeup) - (tty->ldisc.write_wakeup)(tty); + /* FIXME! What are the locking issues here? This may me overdoing things.. */ + { + unsigned long flags; + + save_flags(flags); cli(); + if (tty->ldisc.flush_buffer) + tty->ldisc.flush_buffer(tty); + if (tty->driver.flush_buffer) + tty->driver.flush_buffer(tty); + if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) && + tty->ldisc.write_wakeup) + (tty->ldisc.write_wakeup)(tty); + restore_flags(flags); + } + wake_up_interruptible(&tty->write_wait); wake_up_interruptible(&tty->read_wait); @@ -449,7 +465,7 @@ tty->ctrl_status = 0; if (tty->driver.hangup) (tty->driver.hangup)(tty); - restore_flags(flags); + unlock_kernel(); } void tty_hangup(struct tty_struct * tty) @@ -459,7 +475,7 @@ printk("%s hangup...\n", tty_name(tty, buf)); #endif - queue_task(&tty->tq_hangup, &tq_timer); + queue_task(&tty->tq_hangup, &tq_scheduler); } void tty_vhangup(struct tty_struct * tty) @@ -1158,6 +1174,7 @@ * Make sure that the tty's task queue isn't activated. */ run_task_queue(&tq_timer); + run_task_queue(&tq_scheduler); /* * The release_mem function takes care of the details of clearing 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/fc4/soc.c linux/drivers/fc4/soc.c --- v2.1.114/linux/drivers/fc4/soc.c Thu May 14 19:47:39 1998 +++ linux/drivers/fc4/soc.c Tue Aug 4 16:49:18 1998 @@ -501,7 +501,6 @@ static inline void soc_init(struct linux_sbus_device *sdev, int no) { - struct devid_cookie dcookie; unsigned char tmp[60]; int propl; struct soc *s; @@ -599,40 +598,15 @@ soc_disable (s); - irq = sdev->irqs[0].pri; + irq = sdev->irqs[0]; -#ifndef __sparc_v9__ - if (sparc_cpu_model != sun4d) { - if (request_irq (irq, soc_intr, SA_SHIRQ, "SOC", (void *)s)) { - soc_printk ("Cannot order irq %d to go\n", irq); - socs = s->next; - return; - } - } else { - dcookie.real_dev_id = s; - dcookie.bus_cookie = sdev; - if (request_irq(irq, soc_intr, (SA_SHIRQ | SA_DCOOKIE), "SOC", &dcookie)) { - soc_printk ("Cannot order irq %d to go\n", irq); - socs = s->next; - return; - } - SOD(("IRQ %d %x\n", irq, dcookie.ret_ino)) - irq = dcookie.ret_ino; - } -#else - dcookie.real_dev_id = s; - dcookie.imap = dcookie.iclr = 0; - dcookie.pil = -1; - dcookie.bus_cookie = sdev->my_bus; - if (request_irq (irq, soc_intr, (SA_SHIRQ | SA_SBUS | SA_DCOOKIE), "SOC", &dcookie)) { + if (request_irq (irq, soc_intr, SA_SHIRQ, "SOC", (void *)s)) { soc_printk ("Cannot order irq %d to go\n", irq); socs = s->next; return; } - irq = dcookie.ret_ino; -#endif - SOD(("SOC uses IRQ%d\n", irq)) + SOD(("SOC uses IRQ%s\n", __irq_itoa(irq))) s->port[0].fc.irq = irq; s->port[1].fc.irq = irq; 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/macintosh/Makefile linux/drivers/macintosh/Makefile --- v2.1.114/linux/drivers/macintosh/Makefile Fri May 8 23:14:47 1998 +++ linux/drivers/macintosh/Makefile Tue Aug 4 16:08:05 1998 @@ -31,30 +31,6 @@ L_OBJS += mac_keyb.o endif -ifdef CONFIG_VT - ifdef CONFIG_PMAC_CONSOLE - L_OBJS += pmac-cons.o - ifdef CONFIG_CONTROL_VIDEO - L_OBJS += control.o - endif - ifdef CONFIG_PLATINUM_VIDEO - L_OBJS += platinum.o - endif - ifdef CONFIG_VALKYRIE_VIDEO - L_OBJS += valkyrie.o - endif - ifdef CONFIG_CHIPS_VIDEO - L_OBJS += chips.o - endif - ifdef CONFIG_ATY_VIDEO - L_OBJS += aty.o - endif - ifdef CONFIG_IMSTT_VIDEO - L_OBJS += imstt.o - endif - endif -endif - include $(TOPDIR)/Rules.make # Integrated in mac_keyb.c diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/ati-gt.h linux/drivers/macintosh/ati-gt.h --- v2.1.114/linux/drivers/macintosh/ati-gt.h Mon Jan 12 15:18:13 1998 +++ linux/drivers/macintosh/ati-gt.h Wed Dec 31 16:00:00 1969 @@ -1,203 +0,0 @@ -/* the usage for the following structs vary from the gx and vt: -and sdram and sgram gt's - pll registers (sdram) 6,7,11; - crtc_h_sync_strt_wid[3]; - dsp1[3] (sdram,sgram,unused) - dsp2[3] (offset regbase+24, depends on colour mode); - crtc_h_tot_disp,crtc_v_tot_disp,crtc_v_sync_strt_wid,unused; - pll registers (sgram) 7,11; -*/ - -/* Register values for 1280x1024, 75Hz mode (20). no 16/32 */ -static struct aty_regvals aty_gt_reg_init_20 = { - { 0x41, 0xf9, 0x04 }, - { 0xe02a7, 0x1401a6, 0 }, - { 0x260957, 0x2806d6, 0 }, - { 0x10006b6, 0x20006b6, 0x30006b6 }, - - 0x9f00d2, 0x03ff0429, 0x30400, 0, - { 0xb5, 0x04 } -}; - -#if 0 -/* Register values for 1280x960, 75Hz mode (19) */ -static struct aty_regvals aty_gt_reg_init_19 = { -}; -#endif - -/* Register values for 1152x870, 75Hz mode (18) */ -static struct aty_regvals aty_gt_reg_init_18 = { - { 0x41, 0xe6, 0x04 }, - { 0x300295, 0x300194, 0x300593 }, - { 0x260a1c, 0x380561, 0}, - { 0x1000744, 0x2000744, 0x3000744 }, - - 0x8f00b5, 0x3650392, 0x230368, 0, - { 0xe6, 0x04 } -}; - -/* Register values for 1024x768, 75Hz mode (17), 32 bpp untested */ -static struct aty_regvals aty_gt_reg_init_17 = { - { 0x41, 0xb5, 0x04 }, - { 0xc0283, 0xc0182, 0xc0581 }, - { 0x36066d, 0x3806d6, 0}, - { 0xa0049e, 0x100049e, 0x200049e }, - - 0x7f00a3, 0x2ff031f, 0x30300, 0, - { 0xb8, 0x04 } -}; - -#if 0 -/* Register values for x, Hz mode (16) */ -static struct aty_regvals aty_gt_reg_init_16 = { -}; -#endif - -/* Register values for 1024x768, 70Hz mode (15) */ -static struct aty_regvals aty_gt_reg_init_15 = { - { 0x41, 0xad, 0x04 }, - { 0x310284, 0x310183, 0x310582 }, - { 0x0, 0x380727 }, - { 0x0 }, - 0x7f00a5, 0x2ff0325, 0x260302, -}; - -/* Register values for 1024x768, 60Hz mode (14) */ -static struct aty_regvals aty_gt_reg_init_14 = { - { 0x40, 0xe1, 0x14 }, - { 0x310284, 0x310183, 0x310582 }, - { 0x3607c0, 0x380840, 0x0 }, - { 0xa80592, 0x1000592, 0x0 }, - - 0x7f00a7, 0x2ff0325, 0x260302, 0, - { 0xe1, 0x14 } -}; - -/* Register values for 832x624, 75Hz mode (13) */ -static struct aty_regvals aty_gt_reg_init_13 = { - { 0x40, 0xc6, 0x14 }, - { 0x28026d, 0x28016c, 0x28056b }, - { 0x3608cf, 0x380960, 0 }, - { 0xb00655, 0x1000655, 0x2000655 }, - - 0x67008f, 0x26f029a, 0x230270, 0, - { 0xc6, 0x14 } -}; - -/* Register values for 800x600, 75Hz mode (12) */ -static struct aty_regvals aty_gt_reg_init_12 = { - { 0x42, 0xe4, 0x04 }, - { 0xa0267, 0xa0166, 0x0a0565}, - { 0x360a33, 0x48056d, 0}, - { 0xc00755, 0x1000755, 0x02000755}, - - 0x630083, 0x2570270, 0x30258, 0, - { 0xe4, 0x4 } -}; - -/* Register values for 800x600, 72Hz mode (11) */ -static struct aty_regvals aty_gt_reg_init_11 = { - { 0x42, 0xe6, 0x04 }, - { 0xf026c, 0xf016b, 0xf056a }, - { 0x360a1d, 0x480561, 0}, - { 0xc00745, 0x1000745, 0x2000745 }, - - 0x630081, 0x02570299, 0x6027c -}; - -/* Register values for 800x600, 60Hz mode (10) */ -static struct aty_regvals aty_gt_reg_init_10 = { - { 0x42, 0xb8, 0x04 }, - { 0x10026a, 0x100169, 0x100568 }, - { 0x460652, 0x4806ba, 0}, - { 0x68048b, 0xa0048b, 0x100048b }, - - 0x630083, 0x02570273, 0x40258, 0, - { 0xb8, 0x4 } -}; - -/* Register values for 800x600, 56Hz mode (9) */ -static struct aty_regvals aty_gt_reg_init_9 = { - { 0x42, 0xf9, 0x14 }, - { 0x90268, 0x90167, 0x090566 }, - { 0x460701, 0x480774, 0}, - { 0x700509, 0xa80509, 0x1000509 }, - - 0x63007f, 0x2570270, 0x20258 -}; - -#if 0 -/* Register values for 768x576, 50Hz mode (8) */ -static struct aty_regvals aty_gt_reg_init_8 = { -}; - -/* Register values for 640x870, 75Hz Full Page Display (7) */ -static struct aty_regvals aty_gt_reg_init_7 = { -}; -#endif - -/* Register values for 640x480, 67Hz mode (6) */ -static struct aty_regvals aty_gt_reg_init_6 = { - { 0x42, 0xd1, 0x14 }, - { 0x280259, 0x280158, 0x280557 }, - { 0x460858, 0x4808e2, 0}, - { 0x780600, 0xb00600, 0x1000600 }, - - 0x4f006b, 0x1df020c, 0x2301e2, 0, - { 0x8b, 0x4 } -}; - -/* Register values for 640x480, 60Hz mode (5) */ -static struct aty_regvals aty_gt_reg_init_5 = { - { 0x43, 0xe8, 0x04 }, - { 0x2c0253, 0x2c0152, 0x2c0551 }, - { 0x460a06, 0x580555, 0}, - { 0x880734, 0xc00734, 0x1000734 }, - - 0x4f0063, 0x1df020c, 0x2201e9, 0, - { 0xe8, 0x04 } -}; - -#if 0 -/* Register values for x, Hz mode (4) */ -static struct aty_regvals aty_gt_reg_init_4 = { -}; - -/* Register values for x, Hz mode (3) */ -static struct aty_regvals aty_gt_reg_init_3 = { -}; - -/* Register values for x, Hz mode (2) */ -static struct aty_regvals aty_gt_reg_init_2 = { -}; - -/* Register values for x, Hz mode (1) */ -static struct aty_regvals aty_gt_reg_init_1 = { -}; -#endif - -/* yikes, more data structures (dsp2) - * XXX kludge for sgram - */ -static int sgram_dsp[20][3] = { - {0,0,0}, - {0,0,0}, - {0,0,0}, - {0,0,0}, - {0x5203d7,0x7803d9,0xb803dd}, //5 - {0x940666,0xe0066a,0x1700672}, //6 - {0,0,0}, - {0,0,0}, - {0x88055f,0xd80563,0x170056b}, //9 - {0x8404d9,0xb804dd,0x17004e5}, //10 - {0x7803e2,0xb803e6,0x17003ee}, //11 - {0x7803eb,0xb803ef,0x17003f7}, //12 - {0xe806c5,0x17006cd,0x2e006dd}, //13 - {0xe005f6,0x17005fe,0x2e0060e}, //14 - {0xd8052c,0x1700534,0x2e00544}, //15 - {0,0,0}, - {0xb804f2,0x17004e5,0x2e0050a}, //17 - {0xb803e6,0x17003ee,0x2e003fe}, //18 - {0,0,0}, - {0,0,0}, -}; diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/ati-gx.h linux/drivers/macintosh/ati-gx.h --- v2.1.114/linux/drivers/macintosh/ati-gx.h Thu Apr 23 20:21:33 1998 +++ linux/drivers/macintosh/ati-gx.h Wed Dec 31 16:00:00 1969 @@ -1,122 +0,0 @@ -/* Register values for 1280x1024, 75Hz (WAS 60) mode (20) */ -static struct aty_regvals aty_gx_reg_init_20 = { - { 0x200, 0x200, 0x200 }, - - { 0x1200a5, 0x1200a3, 0x1200a3 }, - { 0x30c0200, 0x30e0300, 0x30e0300 }, - { 0x2, 0x3, 0x3 }, - - 0x9f00d2, 0x3ff0429, 0x30400, 0x28100040, - { 0xd4, 0x9 } -}; - -/* Register values for 1152x870, 75Hz mode (18) */ -static struct aty_regvals aty_gx_reg_init_18 = { - { 0x200, 0x200, 0x200 }, - - { 0x300097, 0x300095, 0x300094 }, - { 0x3090200, 0x30e0300, 0x30e0600 }, - { 0x2, 0x3, 0x6 }, - - 0x8f00b5, 0x3650392, 0x230368, 0x24100040, - { 0x53, 0x3 } -}; - -/* Register values for 1024x768, 75Hz mode (17) */ -static struct aty_regvals aty_gx_reg_init_17 = { - { 0x200, 0x200, 0x200 }, - - { 0x2c0087, 0x2c0085, 0x2c0084 }, - { 0x3070200, 0x30e0300, 0x30e0600 }, - { 0x2, 0x3, 0x6 }, - - 0x7f00a5, 0x2ff0323, 0x230302, 0x20100000, - { 0x42, 0x3 } -}; - -/* Register values for 1024x768, 72Hz mode (15) */ -static struct aty_regvals aty_gx_reg_init_15 = { - { 0, 0, 0 }, - - { 0x310086, 0x310084, 0x310084 }, - { 0x3070200, 0x30e0300, 0x30e0300 }, - { 0x2002312, 0x3002312, 0x3002312 }, - - 0x7f00a5, 0x2ff0325, 0x260302, 0x20100000, - { 0x88, 0x7 } -}; - -/* Register values for 1024x768, 60Hz mode (14) */ -static struct aty_regvals aty_gx_reg_init_14 = { - { 0, 0, 0 }, - - { 0x310086, 0x310084, 0x310084 }, - { 0x3060200, 0x30d0300, 0x30d0300 }, - { 0x2002312, 0x3002312, 0x3002312 }, - - 0x7f00a7, 0x2ff0325, 0x260302, 0x20100000, - { 0x6c, 0x6 } -}; - -/* Register values for 832x624, 75Hz mode (13) */ -static struct aty_regvals aty_gx_reg_init_13 = { - { 0x200, 0x200, 0x200 }, - - { 0x28006f, 0x28006d, 0x28006c }, - { 0x3050200, 0x30b0300, 0x30e0600 }, - { 0x2, 0x3, 0x6 }, - - 0x67008f, 0x26f029a, 0x230270, 0x1a100040, - { 0x4f, 0x5 } -}; - -#if 0 /* not filled in yet */ -/* Register values for 800x600, 75Hz mode (12) */ -static struct aty_regvals aty_gx_reg_init_12 = { - { 0x10, 0x28, 0x50 }, - { }, - { } /* pixel clock = 49.11MHz for V=74.40Hz */ -}; - -/* Register values for 800x600, 72Hz mode (11) */ -static struct aty_regvals aty_gx_reg_init_11 = { - { 0x10, 0x28, 0x50 }, - { }, - { } /* pixel clock = 49.63MHz for V=71.66Hz */ -}; - -/* Register values for 800x600, 60Hz mode (10) */ -static struct aty_regvals aty_gx_reg_init_10 = { - { 0x10, 0x28, 0x50 }, - { }, - { } /* pixel clock = 41.41MHz for V=59.78Hz */ -}; - -/* Register values for 640x870, 75Hz Full Page Display (7) */ -static struct aty_regvals aty_gx_reg_init_7 = { - { 0x10, 0x30, 0x68 }, - { }, - { } /* pixel clock = 57.29MHz for V=75.01Hz */ -}; -#endif - -/* Register values for 640x480, 67Hz mode (6) */ -static struct aty_regvals aty_gx_reg_init_6 = { - { 0x200, 0x200, 0x200 }, - - { 0x28005b, 0x280059, 0x280058 }, - { 0x3040200, 0x3060300, 0x30c0600 }, - { 0x2002312, 0x3002312, 0x6002312 }, - - 0x4f006b, 0x1df020c, 0x2301e2, 0x14100040, - { 0x35, 0x07 } -}; - -#if 0 /* not filled in yet */ -/* Register values for 640x480, 60Hz mode (5) */ -static struct aty_regvals aty_gx_reg_init_5 = { - { 0x200, 0x200, 0x200 }, - { }, - { 0x35, 0x07 } -}; -#endif diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/ati-vt.h linux/drivers/macintosh/ati-vt.h --- v2.1.114/linux/drivers/macintosh/ati-vt.h Mon Jan 12 15:18:13 1998 +++ linux/drivers/macintosh/ati-vt.h Wed Dec 31 16:00:00 1969 @@ -1,147 +0,0 @@ -/* Register values for 1280x1024, 60Hz mode (20) */ -static struct aty_regvals aty_vt_reg_init_20 = { - { 0, 0, 0 }, - - { 0x002e02a7, 0x002e02a7, 0 }, - { 0x03070200, 0x03070200, 0 }, - { 0x0a00cb22, 0x0b00cb23, 0 }, - - 0x009f00d2, 0x03ff0429, 0x00030400, 0x28000000, - { 0x00, 0xaa } -}; - -/* Register values for 1280x960, 75Hz mode (19) */ -static struct aty_regvals aty_vt_reg_init_19 = { - { 0, 0, 0 }, - { 0x003202a3, 0x003201a2, 0 }, - { 0x030b0200, 0x030b0300, 0 }, - { 0x0a00cb22, 0x0b00cb23, 0 }, - - 0x009f00d1, 0x03bf03e7, 0x000303c0, 0x28000000, - { 0x00, 0xc6 } -}; - -/* Register values for 1152x870, 75Hz mode (18) */ -static struct aty_regvals aty_vt_reg_init_18 = { - { 0, 0, 0 }, - - { 0x00300295, 0x00300194, 0 }, - { 0x03080200, 0x03080300, 0 }, - { 0x0a00cb21, 0x0b00cb22, 0 }, - - 0x008f00b5, 0x03650392, 0x00230368, 0x24000000, - { 0x00, 0x9d } -}; - -/* Register values for 1024x768, 75Hz mode (17) */ -static struct aty_regvals aty_vt_reg_init_17 = { - { 0, 0, 0 }, - - { 0x002c0283, 0x002c0182, 0 }, - { 0x03080200, 0x03080300, 0 }, - { 0x0a00cb21, 0x0b00cb22, 0 }, - - 0x007f00a3, 0x02ff031f, 0x00030300, 0x20000000, - { 0x01, 0xf7 } -}; - -/* Register values for 1024x768, 70Hz mode (15) */ -static struct aty_regvals aty_vt_reg_init_15 = { - { 0, 0, 0 }, - { 0x00310284, 0x00310183, 0 }, - { 0x03080200, 0x03080300, 0 }, - { 0x0a00cb21, 0x0b00cb22, 0 }, - - 0x007f00a5, 0x02ff0325, 0x00260302, 0x20000000, - { 0x01, 0xeb } -}; - -/* Register values for 1024x768, 60Hz mode (14) */ -static struct aty_regvals aty_vt_reg_init_14 = { - { 0, 0, 0 }, - - { 0x00310284, 0x00310183, 0x00310582 }, /* 32 bit 0x00310582 */ - { 0x03080200, 0x03080300, 0x03070600 }, /* 32 bit 0x03070600 */ - { 0x0a00cb21, 0x0b00cb22, 0x0e00cb23 }, - - 0x007f00a7, 0x02ff0325, 0x00260302, 0x20000000, - { 0x01, 0xcc } -}; - -/* Register values for 832x624, 75Hz mode (13) */ -static struct aty_regvals aty_vt_reg_init_13 = { - { 0, 0, 0 }, - - { 0x0028026d, 0x0028016c, 0x0028056b }, - { 0x03080200, 0x03070300, 0x03090600 }, - { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 }, - - 0x0067008f, 0x026f029a, 0x00230270, 0x1a000000, - { 0x01, 0xb4 } -}; - -/* Register values for 800x600, 75Hz mode (12) */ -static struct aty_regvals aty_vt_reg_init_12 = { - { 0, 0, 0 }, - - { 0x002a0267, 0x002a0166, 0x002a0565 }, - { 0x03040200, 0x03060300, 0x03070600 }, - { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 }, - - 0x00630083, 0x02570270, 0x00030258, 0x19000000, - { 0x01, 0x9c } -}; - -/* Register values for 800x600, 72Hz mode (11) */ -static struct aty_regvals aty_vt_reg_init_11 = { - { 0, 0, 0 }, - - { 0x002f026c, 0x002f016b, 0x002f056a }, - { 0x03050200, 0x03070300, 0x03090600 }, - { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 }, - - 0x00630081, 0x02570299, 0x0006027c, 0x19000000, - { 0x01, 0x9d } -}; - -/* Register values for 800x600, 60Hz mode (10) */ -static struct aty_regvals aty_vt_reg_init_10 = { - { 0, 0, 0 }, - - { 0x0030026a, 0x00300169, 0x00300568 }, - { 0x03050200, 0x03070300, 0x03090600 }, - { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 }, - - 0x00630083, 0x02570273, 0x00040258, 0x19000000, - { 0x02, 0xfb } -}; - -/* Register values for 640x480, 67Hz mode (6) */ -static struct aty_regvals aty_vt_reg_init_6 = { - { 0, 0, 0 }, - - { 0x00280259, 0x00280158, 0x00280557 }, - { 0x03050200, 0x03070300, 0x030a0600 }, - { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 }, - - 0x004f006b, 0x01df020c, 0x002301e2, 0x14000000, - { 0x02, 0xbe } -}; - -/* Register values for 640x480, 60Hz mode (5) */ -static struct aty_regvals aty_vt_reg_init_5 = { - { 0, 0, 0 }, - - { 0x002c0253, 0x002c0152, 0x002c0551 }, - { 0x03050200, 0x03070300, 0x03090600 }, - { 0x0a00cb21, 0x0b00cb21, 0x0e00cb22 }, - - 0x004f0063, 0x01df020c, 0x002201e9, 0x14000000, - { 0x02, 0x9e } -}; - /* 8 bit 15 bit 32 bit */ -static int vt_mem_cntl[3][3] = { { 0x0A00CB21, 0x0B00CB21, 0x0E00CB21 }, /* 1 MB VRAM */ - { 0x0A00CB22, 0x0B00CB22, 0x0E00CB22 }, /* 2 MB VRAM */ - { 0x0200053B, 0x0300053B, 0x0600053B } /* 4 M B VRAM */ - }; - diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/aty.c linux/drivers/macintosh/aty.c --- v2.1.114/linux/drivers/macintosh/aty.c Wed Jun 24 22:54:05 1998 +++ linux/drivers/macintosh/aty.c Wed Dec 31 16:00:00 1969 @@ -1,845 +0,0 @@ -/* - * aty.c: Console support for ATI/mach64 display adaptor cards. - * - * Copyright (C) 1997 Michael AK Tesch - * written with much help from Jon Howell - * changes to support the vt chip set by harry ac eaton - * gt chipset support, scrollback console by anthony tong - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pmac-cons.h" -#include "aty.h" -#ifdef CONFIG_ABSCON_COMPAT -#include -#endif - -struct aty_cmap_regs { - unsigned char windex; - unsigned char lut; - unsigned char mask; - unsigned char rindex; - unsigned char cntl; -}; - -typedef struct aty_regvals { - int offset[3]; /* first pixel address */ - - int crtc_h_sync_strt_wid[3]; /* depth dependent */ - int crtc_gen_cntl[3]; - int mem_cntl[3]; - - int crtc_h_tot_disp; /* mode dependent */ - int crtc_v_tot_disp; - int crtc_v_sync_strt_wid; - int crtc_off_pitch; - - unsigned char clock_val[2]; /* vals for 20 and 21 */ -} aty_regvals; - -struct rage_regvals { - int h_total, h_sync_start, h_sync_width; - int v_total, v_sync_start, v_sync_width; - int h_sync_neg, v_sync_neg; -}; - -static int aty_vram_reqd(int vmode, int cmode); -static aty_regvals *get_aty_struct(void); - -static unsigned char *frame_buffer; -static unsigned long frame_buffer_phys; -static int total_vram; /* total amount of video memory, bytes */ -static int chip_type; /* what chip type was detected */ - -static unsigned long ati_regbase; -static unsigned long ati_regbase_phys; -static struct aty_cmap_regs *aty_cmap_regs; - -#if 0 -/* this array contains the number of bytes/line for each mode and color depth */ -static int pitch[20][3] = { - {512, 1024, 2048}, /* mode 1 */ - {512, 1024, 2048}, /* mode 2 */ - {640, 1024, 2048}, /* mode 3 */ - {640, 1024, 2048}, /* mode 4 */ - {640, 1280, 2560}, /* mode 5 */ - {640, 1280, 2560}, /* mode 6 */ - {640, 1280, 2560}, /* mode 7 */ - {800, 1600, 3200}, /* mode 8 */ - {768, 1536, 2072}, /* mode 9 */ - {800, 1600, 3200}, /* mode 10 */ - {800, 1600, 3200}, /* mode 11 */ - {800, 1600, 3200}, /* mode 12 */ - {832, 1664, 3328}, /* mode 13 */ - {1024, 2048, 4096}, /* mode 14 */ - {1024, 2048, 4096}, /* mode 15 */ - {1024, 2048, 4096}, /* mode 16 */ - {1024, 2048, 4096}, /* mode 17 */ - {1152, 2304, 4608}, /* mode 18 */ - {1280, 2560, 5120}, /* mode 19 */ - {1280, 2560, 5120} /* mode 20 */ -}; -#endif - -#include "ati-gx.h" -#include "ati-gt.h" -#include "ati-vt.h" - -static struct aty_regvals *aty_gt_reg_init[20] = { - NULL, NULL, NULL, NULL, - &aty_gt_reg_init_5, - &aty_gt_reg_init_6, - NULL, NULL, - &aty_gt_reg_init_9, - &aty_gt_reg_init_10, - &aty_gt_reg_init_11, - &aty_gt_reg_init_12, - &aty_gt_reg_init_13, - &aty_gt_reg_init_14, - &aty_gt_reg_init_15, - NULL, - &aty_gt_reg_init_17, - &aty_gt_reg_init_18, - NULL, - &aty_gt_reg_init_20 -}; - -static struct aty_regvals *aty_gx_reg_init[20] = { - NULL, NULL, NULL, NULL, - &aty_gx_reg_init_6, - &aty_gx_reg_init_6, - NULL, NULL, NULL, NULL, NULL, NULL, - &aty_gx_reg_init_13, - &aty_gx_reg_init_14, - &aty_gx_reg_init_15, - NULL, - &aty_gx_reg_init_17, - &aty_gx_reg_init_18, - NULL, - &aty_gx_reg_init_20 -}; - -static struct aty_regvals *aty_vt_reg_init[21] = { - NULL, NULL, NULL, NULL, - &aty_vt_reg_init_5, - &aty_vt_reg_init_6, - NULL, NULL, NULL, - &aty_vt_reg_init_10, - &aty_vt_reg_init_11, - &aty_vt_reg_init_12, - &aty_vt_reg_init_13, - &aty_vt_reg_init_14, - &aty_vt_reg_init_15, - NULL, - &aty_vt_reg_init_17, - &aty_vt_reg_init_18, - &aty_vt_reg_init_19, - &aty_vt_reg_init_20 -}; - -__openfirmware - -static inline int -aty_vram_reqd(int vmode, int cmode) -{ - return vmode_attrs[vmode - 1].vres * - (vmode_attrs[vmode - 1].hres << cmode); -} - -extern inline unsigned aty_ld_le32(volatile unsigned long addr) -{ - register unsigned long temp = ati_regbase,val; - - asm("lwbrx %0,%1,%2": "=r"(val):"r"(addr), "r"(temp)); - return val; -} - -extern inline void aty_st_le32(volatile unsigned long addr, unsigned val) -{ - register unsigned long temp = ati_regbase; - asm("stwbrx %0,%1,%2": : "r"(val), "r"(addr), "r"(temp):"memory"); -} - -extern inline unsigned char aty_ld_8(volatile unsigned long addr) -{ - return *(char *) ((long) addr + (long) ati_regbase); -} - -extern inline void aty_st_8(volatile unsigned long addr, unsigned char val) -{ - *(unsigned char *) (addr + (unsigned long) ati_regbase) = val; -} - -static void aty_st_514(int offset, char val) -{ - aty_WaitQueue(5); - aty_st_8(DAC_CNTL, 1); - aty_st_8(DAC_W_INDEX, offset & 0xff); /* right addr byte */ - aty_st_8(DAC_DATA, (offset >> 8) & 0xff); /* left addr byte */ - eieio(); - aty_st_8(DAC_MASK, val); - eieio(); - aty_st_8(DAC_CNTL, 0); -} - -static void -aty_st_pll(int offset, char val) -{ - aty_WaitQueue(3); - aty_st_8(CLOCK_CNTL + 1, (offset << 2) | PLL_WR_EN); /* write addr byte */ - eieio(); - aty_st_8(CLOCK_CNTL + 2, val); /* write the register value */ - eieio(); - aty_st_8(CLOCK_CNTL + 1, (offset << 2) & ~PLL_WR_EN); -} - -#if 0 // unused -static char -aty_ld_pll(int offset) -{ - aty_WaitQueue(2); - aty_st_8(CLOCK_CNTL + 1, offset << 2); - eieio(); - return aty_ld_8(CLOCK_CNTL + 2); -} -#endif - -unsigned char -aty_ld_514(int offset) -{ -/* do the same thing as aty_st_514, just read the DAC_MASK instead of writing */ - char val; - - aty_WaitQueue(5); - aty_st_8(DAC_CNTL, 1); - aty_st_8(DAC_W_INDEX, offset & 0xff); /* right addr byte */ - aty_st_8(DAC_DATA, (offset >> 8) & 0xff); /* left addr byte */ - val = aty_ld_8(DAC_MASK); - eieio(); - aty_st_8(DAC_CNTL, 0); - return val; -} - -void -aty_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - int i, scale; - - aty_WaitQueue(2); - - i = aty_ld_8(DAC_CNTL) & 0xfc; - if (chip_type == MACH64_GT_ID) - i |= 0x2; /*DAC_CNTL|0x2 turns off the extra brightness for gt*/ - aty_st_8(DAC_CNTL, i); - aty_st_8(DAC_REGS + DAC_MASK, 0xff); - eieio(); - scale = (chip_type != MACH64_GX_ID) - ? ((color_mode == CMODE_16) ? 3 : 0) : 0; - - for (i = 0; i < ncolors; ++i) { - aty_WaitQueue(4); - aty_cmap_regs->windex = (index + i) << scale; eieio(); - aty_cmap_regs->lut = red[i]; eieio(); - aty_cmap_regs->lut = green[i]; eieio(); - aty_cmap_regs->lut = blue[i]; eieio(); - } -} - -static aty_regvals -*get_aty_struct() -{ - int v = video_mode - 1; - - switch (chip_type) { - case MACH64_GT_ID: - return aty_gt_reg_init[v]; - break; - case MACH64_VT_ID: - return aty_vt_reg_init[v]; - break; - default: /* default to MACH64_GX_ID */ - return aty_gx_reg_init[v]; - break; - } -} - -static int -read_aty_sense(void) -{ - int sense, i; - - aty_st_le32(MON_SENSE, 0x31003100); /* drive outputs high */ - __delay(200); - aty_st_le32(MON_SENSE, 0); /* turn off outputs */ - __delay(2000); - i = aty_ld_le32(MON_SENSE); /* get primary sense value */ - sense = ((i & 0x3000) >> 3) | (i & 0x100); - - /* drive each sense line low in turn and collect the other 2 */ - aty_st_le32(MON_SENSE, 0x20000000); /* drive A low */ - __delay(2000); - i = aty_ld_le32(MON_SENSE); - sense |= ((i & 0x1000) >> 7) | ((i & 0x100) >> 4); - aty_st_le32(MON_SENSE, 0x20002000); /* drive A high again */ - __delay(200); - - aty_st_le32(MON_SENSE, 0x10000000); /* drive B low */ - __delay(2000); - i = aty_ld_le32(MON_SENSE); - sense |= ((i & 0x2000) >> 10) | ((i & 0x100) >> 6); - aty_st_le32(MON_SENSE, 0x10001000); /* drive B high again */ - __delay(200); - - aty_st_le32(MON_SENSE, 0x01000000); /* drive C low */ - __delay(2000); - sense |= (aty_ld_le32(MON_SENSE) & 0x3000) >> 12; - aty_st_le32(MON_SENSE, 0); /* turn off outputs */ - - return sense; -} - -void -map_aty_display(struct device_node *dp) -{ - struct aty_regvals *init; - int i, sense; - unsigned long addr; - unsigned char bus, devfn; - unsigned short cmd; - - if (dp->next != 0) - printk("Warning: only using first ATI card detected\n"); - if (dp->n_addrs != 1 && dp->n_addrs != 3) - printk("Warning: expecting 1 or 3 addresses for ATY (got %d)", - dp->n_addrs); - - ati_regbase_phys = 0x7ffc00 + dp->addrs[0].address; - ati_regbase = (int) ioremap(ati_regbase_phys, 0x1000); - aty_cmap_regs = (struct aty_cmap_regs *) (ati_regbase + 0xC0); - - /* enable memory-space accesses using config-space command register */ - if (pci_device_loc(dp, &bus, &devfn) == 0) { - pcibios_read_config_word(bus, devfn, PCI_COMMAND, &cmd); - if (cmd != 0xffff) { - cmd |= PCI_COMMAND_MEMORY; - pcibios_write_config_word(bus, devfn, PCI_COMMAND, cmd); - } - } - chip_type = (aty_ld_le32(CONFIG_CHIP_ID) & CFG_CHIP_TYPE); - - i = aty_ld_le32(MEM_CNTL); - if (chip_type != MACH64_GT_ID) - switch (i & MEM_SIZE_ALIAS) { - case MEM_SIZE_512K: - total_vram = 0x80000; - break; - case MEM_SIZE_1M: - total_vram = 0x100000; - break; - case MEM_SIZE_2M: - total_vram = 0x200000; - break; - case MEM_SIZE_4M: - total_vram = 0x400000; - break; - case MEM_SIZE_6M: - total_vram = 0x600000; - break; - case MEM_SIZE_8M: - total_vram = 0x800000; - break; - default: - total_vram = 0x80000; - } - else - switch (i & 0xF) { /* 0xF used instead of MEM_SIZE_ALIAS */ - case MEM_SIZE_512K: - total_vram = 0x80000; - break; - case MEM_SIZE_1M: - total_vram = 0x100000; - break; - case MEM_SIZE_2M_GTB: - total_vram = 0x200000; - break; - case MEM_SIZE_4M_GTB: - total_vram = 0x400000; - break; - case MEM_SIZE_6M_GTB: - total_vram = 0x600000; - break; - case MEM_SIZE_8M_GTB: - total_vram = 0x800000; - break; - default: - total_vram = 0x80000; - } - -#if 0 - printk("aty_display_init: node = %p, addrs = ", dp->node); - printk(" %x(%x)", dp->addrs[0].address, dp->addrs[0].size); - printk(", intrs ="); - for (i = 0; i < dp->n_intrs; ++i) - printk(" %x", dp->intrs[i].line); - printk("\nregbase: %x pci loc: %x:%x total_vram: %x cregs: %x\n", (int) ati_regbase, - bus, devfn, total_vram, (int) aty_cmap_regs); -#endif - /* Map in frame buffer */ - addr = dp->addrs[0].address; - - /* use the big-endian aperture (??) */ - addr += 0x800000; - frame_buffer_phys = addr; - frame_buffer = __ioremap(addr, 0x800000, _PAGE_WRITETHRU); - - sense = read_aty_sense(); - printk(KERN_INFO "monitor sense = %x\n", sense); - if (video_mode == VMODE_NVRAM) { - video_mode = nvram_read_byte(NV_VMODE); - init = get_aty_struct(); - if (video_mode <= 0 || video_mode > VMODE_MAX || init == 0) - video_mode = VMODE_CHOOSE; - } - if (video_mode == VMODE_CHOOSE) - video_mode = map_monitor_sense(sense); - - init = get_aty_struct(); - if (!init) - video_mode = VMODE_640_480_60; - - /* - * Reduce the pixel size if we don't have enough VRAM. - */ - - if (color_mode == CMODE_NVRAM) - color_mode = nvram_read_byte(NV_CMODE); - if (color_mode < CMODE_8 || color_mode > CMODE_32) - color_mode = CMODE_8; - - while (aty_vram_reqd(video_mode, color_mode) > total_vram) { - while (color_mode > CMODE_8 - && aty_vram_reqd(video_mode, color_mode) > total_vram) - --color_mode; - /* - * adjust the video mode smaller if there still is not enough VRAM - */ - if (aty_vram_reqd(video_mode, color_mode) > total_vram) { - do { - video_mode--; - init = get_aty_struct(); - } while ((init == 0) && (video_mode > VMODE_640_480_60)); - } - } - - if (chip_type == MACH64_GT_ID && (aty_ld_le32(CONFIG_STAT0) & 7) == 5 - && init->crtc_gen_cntl[1] == 0) { - video_mode = 6; color_mode = 0; - } - return; -} - -void -RGB514_Program(int cmode) -{ - typedef struct { - char pixel_dly; - char misc2_cntl; - char pixel_rep; - char pixel_cntl_index; - char pixel_cntl_v1; - } RGB514_DAC_Table; - - static RGB514_DAC_Table RGB514DAC_Tab[8] = { - {0, 0x41, 0x03, 0x71, 0x45}, // 8bpp - {0, 0x45, 0x04, 0x0c, 0x01}, // 555 - {0, 0x45, 0x06, 0x0e, 0x00}, // XRGB - }; - RGB514_DAC_Table *pDacProgTab; - - pDacProgTab = &RGB514DAC_Tab[cmode]; - - aty_st_514(0x90, 0x00); - aty_st_514(0x04, pDacProgTab->pixel_dly); - aty_st_514(0x05, 0x00); - - aty_st_514(0x2, 0x1); - aty_st_514(0x71, pDacProgTab->misc2_cntl); - aty_st_514(0x0a, pDacProgTab->pixel_rep); - - aty_st_514(pDacProgTab->pixel_cntl_index, pDacProgTab->pixel_cntl_v1); -} - -void -aty_init() -{ - int i, hres; - struct aty_regvals *init = get_aty_struct(); - int vram_type = aty_ld_le32(CONFIG_STAT0) & 7; - - if (init == 0) /* paranoia, shouldn't get here */ - panic("aty: display mode %d not supported", video_mode); - - n_scanlines = vmode_attrs[video_mode - 1].vres; - hres = vmode_attrs[video_mode - 1].hres; - pixel_size = 1 << color_mode; - line_pitch = vmode_attrs[video_mode - 1].hres << color_mode; - row_pitch = line_pitch * 16; - - /* clear FIFO errors */ - aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL) | BUS_HOST_ERR_ACK - | BUS_FIFO_ERR_ACK); - - /* Reset engine */ - i = aty_ld_le32(GEN_TEST_CNTL); - aty_st_le32(GEN_TEST_CNTL, i & ~GUI_ENGINE_ENABLE); - eieio(); - aty_WaitIdleEmpty(); - aty_st_le32(GEN_TEST_CNTL, i | GUI_ENGINE_ENABLE); - aty_WaitIdleEmpty(); - - if ( chip_type != MACH64_GT_ID ) { - i = aty_ld_le32(CRTC_GEN_CNTL); - aty_st_le32(CRTC_GEN_CNTL, i | CRTC_EXT_DISP_EN); - } - - if ( chip_type == MACH64_GX_ID ) { - i = aty_ld_le32(GEN_TEST_CNTL); - aty_st_le32(GEN_TEST_CNTL, i | GEN_OVR_OUTPUT_EN ); - } - - switch (chip_type) { - case MACH64_VT_ID: - aty_st_pll(PLL_MACRO_CNTL, 0xb5); - aty_st_pll(PLL_REF_DIV, 0x2d); - aty_st_pll(PLL_GEN_CNTL, 0x14); - aty_st_pll(MCLK_FB_DIV, 0xbd); - aty_st_pll(PLL_VCLK_CNTL, 0x0b); - aty_st_pll(VCLK_POST_DIV, init->clock_val[0]); - aty_st_pll(VCLK0_FB_DIV, init->clock_val[1]); - aty_st_pll(VCLK1_FB_DIV, 0xd6); - aty_st_pll(VCLK2_FB_DIV, 0xee); - aty_st_pll(VCLK3_FB_DIV, 0xf8); - aty_st_pll(PLL_XCLK_CNTL, 0x0); - aty_st_pll(PLL_TEST_CTRL, 0x0); - aty_st_pll(PLL_TEST_COUNT, 0x0); - break; - case MACH64_GT_ID: - if (vram_type == 5) { - aty_st_pll(0, 0xcd); - aty_st_pll(PLL_MACRO_CNTL, - video_mode >= VMODE_1024_768_60? 0xd3: 0xd5); - aty_st_pll(PLL_REF_DIV, 0x21); - aty_st_pll(PLL_GEN_CNTL, 0x44); - aty_st_pll(MCLK_FB_DIV, 0xe8); - aty_st_pll(PLL_VCLK_CNTL, 0x03); - aty_st_pll(VCLK_POST_DIV, init->offset[0]); - aty_st_pll(VCLK0_FB_DIV, init->offset[1]); - aty_st_pll(VCLK1_FB_DIV, 0x8e); - aty_st_pll(VCLK2_FB_DIV, 0x9e); - aty_st_pll(VCLK3_FB_DIV, 0xc6); - aty_st_pll(PLL_XCLK_CNTL, init->offset[2]); - aty_st_pll(12, 0xa6); - aty_st_pll(13, 0x1b); - } else { - aty_st_pll(PLL_MACRO_CNTL, 0xd5); - aty_st_pll(PLL_REF_DIV, 0x21); - aty_st_pll(PLL_GEN_CNTL, 0xc4); - aty_st_pll(MCLK_FB_DIV, 0xda); - aty_st_pll(PLL_VCLK_CNTL, 0x03); - /* offset actually holds clock values */ - aty_st_pll(VCLK_POST_DIV, init->offset[0]); - aty_st_pll(VCLK0_FB_DIV, init->offset[1]); - aty_st_pll(VCLK1_FB_DIV, 0x8e); - aty_st_pll(VCLK2_FB_DIV, 0x9e); - aty_st_pll(VCLK3_FB_DIV, 0xc6); - aty_st_pll(PLL_TEST_CTRL, 0x0); - aty_st_pll(PLL_XCLK_CNTL, init->offset[2]); - aty_st_pll(12, 0xa0); - aty_st_pll(13, 0x1b); - } - break; - default: - RGB514_Program(color_mode); - aty_WaitIdleEmpty(); - aty_st_514(0x06, 0x02); - aty_st_514(0x10, 0x01); - aty_st_514(0x70, 0x01); - aty_st_514(0x8f, 0x1f); - aty_st_514(0x03, 0x00); - aty_st_514(0x05, 0x00); - aty_st_514(0x20, init->clock_val[0]); - aty_st_514(0x21, init->clock_val[1]); - break; - } - - aty_ld_8(DAC_REGS); /* clear counter */ - aty_WaitIdleEmpty(); - - aty_st_le32(CRTC_H_TOTAL_DISP, init->crtc_h_tot_disp); - aty_st_le32(CRTC_H_SYNC_STRT_WID, init->crtc_h_sync_strt_wid[color_mode]); - aty_st_le32(CRTC_V_TOTAL_DISP, init->crtc_v_tot_disp); - aty_st_le32(CRTC_V_SYNC_STRT_WID, init->crtc_v_sync_strt_wid); - - aty_st_8(CLOCK_CNTL, 0); - aty_st_8(CLOCK_CNTL, CLOCK_STROBE); - - aty_st_le32(CRTC_VLINE_CRNT_VLINE, 0); - - if (chip_type == MACH64_GT_ID) { - aty_st_le32(BUS_CNTL, 0x7b23a040); - - /* we calculate this so we can use a scrollback buffer. - * this should theoretically work with other ati's - * OFF_PITCH == (((hres + 7) & 0xfff8) >> 3) << 22 - */ - ati_set_origin(0); - - /* need to set DSP values !! assume sdram */ - i = init->crtc_gen_cntl[0] - (0x100000 * color_mode); - if ( vram_type == 5 ) - i = init->crtc_gen_cntl[1] - (0x100000 * color_mode); - aty_st_le32(DSP_CONFIG, i); - - i = aty_ld_le32(MEM_CNTL) & MEM_SIZE_ALIAS; - if ( vram_type == 5 ) { - i |= ((1 * color_mode) << 26) | 0x4215b0; - aty_st_le32(DSP_ON_OFF,sgram_dsp[video_mode-1][color_mode]); - - //aty_st_le32(CLOCK_CNTL,8192); - } else { - i |= ((1 * color_mode) << 26) | 0x300090; - aty_st_le32(DSP_ON_OFF, init->mem_cntl[color_mode]); - } - - aty_st_le32(MEM_CNTL, i); - aty_st_le32(EXT_MEM_CNTL, 0x5000001); - - /* if (total_vram > 0x400000) - i |= 0x538; this not been verified on > 4Megs!! */ - } else { - aty_st_le32(CRTC_OFF_PITCH, init->crtc_off_pitch); - -/* The magic constant below translates into: - * 5 = No RDY delay, 1 wait st for mem write, increment during burst transfer - * 9 = DAC access delayed, 1 wait state for DAC - * 0 = Disables interupts for FIFO errors - * e = Allows FIFO to generate 14 wait states before generating error - * 1 = DAC snooping disabled, ROM disabled - * 0 = ROM page at 0 (disabled so doesn't matter) - * f = 15 ROM wait states (disabled so doesn't matter) - * f = 15 BUS wait states (I'm not sure this applies to PCI bus types) - * at some point it would be good to experiment with bench marks to see if - * we can gain some speed by fooling with the wait states etc. - */ - if (chip_type == MACH64_VT_ID) - aty_st_le32(BUS_CNTL, 0x680000f9); - else - aty_st_le32(BUS_CNTL, 0x590e10ff); - - switch (total_vram) { - case 0x00100000: - aty_st_le32(MEM_CNTL, vt_mem_cntl[0][color_mode]); - break; - case 0x00200000: - aty_st_le32(MEM_CNTL, vt_mem_cntl[1][color_mode]); - break; - case 0x00400000: - aty_st_le32(MEM_CNTL, vt_mem_cntl[2][color_mode]); - break; - default: - i = aty_ld_le32(MEM_CNTL) & 0x000F; - aty_st_le32(MEM_CNTL, (init->mem_cntl[color_mode] & 0xFFFFFFF0) | i); - } - } -/* These magic constants are harder to figure out - * on the vt chipset bit 2 set makes the screen brighter - * and bit 15 makes the screen black! But nothing else - * seems to matter for the vt DAC_CNTL - */ - switch (chip_type) { - case MACH64_GT_ID: - i = 0x86010102; - break; - case MACH64_VT_ID: - i = 0x87010184; - break; - default: - i = 0x47012100; - break; - } - - aty_st_le32(DAC_CNTL, i); - aty_st_8(DAC_MASK, 0xff); - - switch (color_mode) { - case CMODE_16: - i = CRTC_PIX_WIDTH_15BPP; break; - /*case CMODE_24: */ - case CMODE_32: - i = CRTC_PIX_WIDTH_32BPP; break; - case CMODE_8: - default: - i = CRTC_PIX_WIDTH_8BPP; break; - } - - if (chip_type != MACH64_GT_ID) { - aty_st_le32(CRTC_INT_CNTL, 0x00000002); - aty_st_le32(GEN_TEST_CNTL, GUI_ENGINE_ENABLE | BLOCK_WRITE_ENABLE); /* gui_en block_en */ - i |= init->crtc_gen_cntl[color_mode]; - } - /* Gentlemen, start your crtc engine */ - aty_st_le32(CRTC_GEN_CNTL, CRTC_EXT_DISP_EN | CRTC_EXT_EN | i); - pmac_init_palette(); /* Initialize colormap */ - - /* clear screen */ - fb_start = frame_buffer + ((chip_type == MACH64_GX_ID) ? - init->offset[color_mode] : 0); - memsetw((unsigned short *) fb_start, 0, total_vram); - - display_info.height = n_scanlines; - display_info.width = hres; - display_info.depth = pixel_size << 3; - display_info.pitch = line_pitch; - display_info.mode = video_mode; - strncpy(display_info.name, "ATY Mach64", sizeof(display_info.name)); - switch ( chip_type ) { - case MACH64_GX_ID: strcat(display_info.name,"GX"); - break; - case MACH64_VT_ID: strcat(display_info.name,"VT"); - break; - case MACH64_GT_ID: strcat(display_info.name,"GT"); - break; - default: strcat(display_info.name,"unknown"); - break; - } - display_info.fb_address = (chip_type != MACH64_GT_ID) ? - frame_buffer_phys + init->offset[color_mode] : - frame_buffer_phys; - display_info.cmap_adr_address = ati_regbase_phys + 0xc0; - display_info.cmap_data_address = ati_regbase_phys + 0xc1; - display_info.disp_reg_address = ati_regbase_phys; -} - -int -aty_setmode(struct vc_mode *mode, int doit) -{ - int cmode,old_vmode=video_mode; - struct aty_regvals *init; - -#if 1 - if (mode->mode == 21) { - printk("hace: about to set 0x%x to 0x%x\n", mode->depth, mode->pitch & 0xff); - aty_st_8(mode->depth, mode->pitch & 0xff); - return 0; - } - if (mode->mode == 0) { - printk("hace: 0x%x contains 0x%x\n", mode->depth, aty_ld_8(mode->depth)); - return 0; - } -#endif - - if (mode->mode <= 0 || mode->mode > VMODE_MAX ) - return -EINVAL; - - switch (mode->depth) { - case 24: - case 32: - cmode = CMODE_32; - break; - case 16: - cmode = CMODE_16; - break; - case 8: - case 0: /* (default) */ - cmode = CMODE_8; - break; - default: - return -EINVAL; - } - if (aty_vram_reqd(mode->mode, cmode) > total_vram) - return -EINVAL; - - video_mode = mode->mode; - init = get_aty_struct(); - - /* Check if we know about the wanted video mode */ - if ( init == 0 || init->crtc_h_sync_strt_wid[cmode] == 0 - || (chip_type != MACH64_GT_ID && init->crtc_gen_cntl[cmode] == 0) - || (chip_type == MACH64_GT_ID && (aty_ld_le32(CONFIG_STAT0) & 7) == 5 - && init->crtc_gen_cntl[1] == 0)) { - video_mode = old_vmode; - return -EINVAL; - } - - if (doit) { - video_mode = mode->mode; - color_mode = cmode; - hide_cursor(); - aty_init(); - } - return 0; -} - -void -aty_set_blanking(int blank_mode) -{ - char gen_cntl; - - gen_cntl = aty_ld_8(CRTC_GEN_CNTL); - if (blank_mode & VESA_VSYNC_SUSPEND) - gen_cntl |= 0x8; - if (blank_mode & VESA_HSYNC_SUSPEND) - gen_cntl |= 0x4; - if ((blank_mode & VESA_POWERDOWN) == VESA_POWERDOWN) - gen_cntl |= 0x40; - if (blank_mode == VESA_NO_BLANKING) - gen_cntl &= ~(0x4c); - aty_st_8(CRTC_GEN_CNTL, gen_cntl); -} - -/* handle video scrollback; offset is in # of characters */ -void -ati_set_origin(unsigned short offset) -{ - register int x = (vmode_attrs[video_mode - 1].hres + 7) & 0xfff8, - lines = offset / video_num_columns, reg; - - reg = ((x >> 3) << 22) | /* calculate pitch */ - ((lines * video_font_height * x * (1<> 3); /*offset*/ - - aty_st_le32(CRTC_OFF_PITCH, reg); - aty_st_le32(DST_OFF_PITCH, reg); - aty_st_le32(SRC_OFF_PITCH, reg); - -#if 0 - fb_start = display_info.fb_address = - (unsigned long) frame_buffer + ((lines-2) * - vmode_attrs[video_mode-1].hres) << (4 + color_mode); -#endif -} - -int -ati_vram(void) -{ - return total_vram; -} - diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/aty.h linux/drivers/macintosh/aty.h --- v2.1.114/linux/drivers/macintosh/aty.h Mon Jan 12 15:18:13 1998 +++ linux/drivers/macintosh/aty.h Wed Dec 31 16:00:00 1969 @@ -1,632 +0,0 @@ -/* - * Exported procedures for the ATI/mach64 display driver on PowerMacs. - * - * Copyright (C) 1997 Michael AK Tesch - * written with much help from Jon Howell - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -extern void map_aty_display(struct device_node *); -extern void aty_init(void); -extern int aty_setmode(struct vc_mode *mode, int doit); -extern void aty_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); -extern void aty_set_blanking(int blank_mode); - -extern void ati_set_origin(unsigned short offset); -extern int ati_vram(void); - -/* - * most of the rest of this file comes from ATI sample code - */ -#ifndef REGMACH64_H -#define REGMACH64_H - -/* NON-GUI MEMORY MAPPED Registers - expressed in BYTE offsets */ - -#define CRTC_H_TOTAL_DISP 0x0000 /* Dword offset 00 */ -#define CRTC_H_SYNC_STRT_WID 0x0004 /* Dword offset 01 */ -#define CRTC_H_SYNC_STRT 0x0004 -#define CRTC_H_SYNC_DLY 0x0005 -#define CRTC_H_SYNC_WID 0x0006 - -#define CRTC_V_TOTAL_DISP 0x0008 /* Dword offset 02 */ -#define CRTC_V_TOTAL 0x0008 -#define CRTC_V_DISP 0x000a -#define CRTC_V_SYNC_STRT_WID 0x000C /* Dword offset 03 */ -#define CRTC_V_SYNC_STRT 0x000c -#define CRTC_V_SYNC_WID 0x000e - -#define CRTC_VLINE_CRNT_VLINE 0x0010 /* Dword offset 04 */ -#define CRTC_OFF_PITCH 0x0014 /* Dword offset 05 */ -#define CRTC_OFFSET 0x0014 -#define CRTC_PITCH 0x0016 - -#define CRTC_INT_CNTL 0x0018 /* Dword offset 06 */ -#define CRTC_GEN_CNTL 0x001C /* Dword offset 07 */ -#define CRTC_PIX_WIDTH 0x001d -#define CRTC_FIFO 0x001e -#define CRTC_EXT_DISP 0x001f - -#define DSP_CONFIG 0x0020 /* Dword offset 08 */ -#define DSP_ON_OFF 0x0024 /* Dword offset 09 */ - -#define OVR_CLR 0x0040 /* Dword offset 10 */ -#define OVR_WID_LEFT_RIGHT 0x0044 /* Dword offset 11 */ -#define OVR_WID_TOP_BOTTOM 0x0048 /* Dword offset 12 */ - -#define CUR_CLR0 0x0060 /* Dword offset 18 */ -#define CUR_CLR1 0x0064 /* Dword offset 19 */ -#define CUR_OFFSET 0x0068 /* Dword offset 1A */ -#define CUR_HORZ_VERT_POSN 0x006C /* Dword offset 1B */ -#define CUR_HORZ_VERT_OFF 0x0070 /* Dword offset 1C */ - -#define MON_SENSE 0x0078 - -#define SCRATCH_REG0 0x0080 /* Dword offset 20 */ -#define SCRATCH_REG1 0x0084 /* Dword offset 21 */ - -#define CLOCK_CNTL 0x0090 /* Dword offset 24 */ -#define CLOCK_SEL_CNTL 0x0090 // Dword offset 24 - -#define BUS_CNTL 0x00A0 /* Dword offset 28 */ - -#define EXT_MEM_CNTL 0x00AC /* Dword offset 2B */ -#define MEM_CNTL 0x00B0 /* Dword offset 2C */ - -#define MEM_VGA_WP_SEL 0x00B4 /* Dword offset 2D */ -#define MEM_VGA_RP_SEL 0x00B8 /* Dword offset 2E */ - -#define DAC_REGS 0x00C0 /* Dword offset 30 */ -#define DAC_W_INDEX 0x00C0 /* Dword offset 30 */ -#define DAC_DATA 0x00C1 /* Dword offset 30 */ -#define DAC_MASK 0x00C2 /* Dword offset 30 */ -#define DAC_R_INDEX 0x00C3 /* Dword offset 30 */ -#define DAC_CNTL 0x00C4 /* Dword offset 31 */ - -#define GEN_TEST_CNTL 0x00D0 /* Dword offset 34 */ - -#define CONFIG_CNTL 0x00DC /* Dword offset 37 (CT, ET, VT) */ -#define CONFIG_CHIP_ID 0x00E0 /* Dword offset 38 */ -#define CONFIG_STAT0 0x00E4 /* Dword offset 39 */ -#define CONFIG_STAT1 0x00E8 /* Dword offset 3A */ - - -/* GUI MEMORY MAPPED Registers */ - -#define DST_OFF_PITCH 0x0100 /* Dword offset 40 */ -#define DST_X 0x0104 /* Dword offset 41 */ -#define DST_Y 0x0108 /* Dword offset 42 */ -#define DST_Y_X 0x010C /* Dword offset 43 */ -#define DST_WIDTH 0x0110 /* Dword offset 44 */ -#define DST_HEIGHT 0x0114 /* Dword offset 45 */ -#define DST_HEIGHT_WIDTH 0x0118 /* Dword offset 46 */ -#define DST_X_WIDTH 0x011C /* Dword offset 47 */ -#define DST_BRES_LNTH 0x0120 /* Dword offset 48 */ -#define DST_BRES_ERR 0x0124 /* Dword offset 49 */ -#define DST_BRES_INC 0x0128 /* Dword offset 4A */ -#define DST_BRES_DEC 0x012C /* Dword offset 4B */ -#define DST_CNTL 0x0130 /* Dword offset 4C */ - -#define SRC_OFF_PITCH 0x0180 /* Dword offset 60 */ -#define SRC_X 0x0184 /* Dword offset 61 */ -#define SRC_Y 0x0188 /* Dword offset 62 */ -#define SRC_Y_X 0x018C /* Dword offset 63 */ -#define SRC_WIDTH1 0x0190 /* Dword offset 64 */ -#define SRC_HEIGHT1 0x0194 /* Dword offset 65 */ -#define SRC_HEIGHT1_WIDTH1 0x0198 /* Dword offset 66 */ -#define SRC_X_START 0x019C /* Dword offset 67 */ -#define SRC_Y_START 0x01A0 /* Dword offset 68 */ -#define SRC_Y_X_START 0x01A4 /* Dword offset 69 */ -#define SRC_WIDTH2 0x01A8 /* Dword offset 6A */ -#define SRC_HEIGHT2 0x01AC /* Dword offset 6B */ -#define SRC_HEIGHT2_WIDTH2 0x01B0 /* Dword offset 6C */ -#define SRC_CNTL 0x01B4 /* Dword offset 6D */ - -#define HOST_DATA0 0x0200 /* Dword offset 80 */ -#define HOST_DATA1 0x0204 /* Dword offset 81 */ -#define HOST_DATA2 0x0208 /* Dword offset 82 */ -#define HOST_DATA3 0x020C /* Dword offset 83 */ -#define HOST_DATA4 0x0210 /* Dword offset 84 */ -#define HOST_DATA5 0x0214 /* Dword offset 85 */ -#define HOST_DATA6 0x0218 /* Dword offset 86 */ -#define HOST_DATA7 0x021C /* Dword offset 87 */ -#define HOST_DATA8 0x0220 /* Dword offset 88 */ -#define HOST_DATA9 0x0224 /* Dword offset 89 */ -#define HOST_DATAA 0x0228 /* Dword offset 8A */ -#define HOST_DATAB 0x022C /* Dword offset 8B */ -#define HOST_DATAC 0x0230 /* Dword offset 8C */ -#define HOST_DATAD 0x0234 /* Dword offset 8D */ -#define HOST_DATAE 0x0238 /* Dword offset 8E */ -#define HOST_DATAF 0x023C /* Dword offset 8F */ -#define HOST_CNTL 0x0240 /* Dword offset 90 */ - -#define PAT_REG0 0x0280 /* Dword offset A0 */ -#define PAT_REG1 0x0284 /* Dword offset A1 */ -#define PAT_CNTL 0x0288 /* Dword offset A2 */ - -#define SC_LEFT 0x02A0 /* Dword offset A8 */ -#define SC_RIGHT 0x02A4 /* Dword offset A9 */ -#define SC_LEFT_RIGHT 0x02A8 /* Dword offset AA */ -#define SC_TOP 0x02AC /* Dword offset AB */ -#define SC_BOTTOM 0x02B0 /* Dword offset AC */ -#define SC_TOP_BOTTOM 0x02B4 /* Dword offset AD */ - -#define DP_BKGD_CLR 0x02C0 /* Dword offset B0 */ -#define DP_FRGD_CLR 0x02C4 /* Dword offset B1 */ -#define DP_WRITE_MASK 0x02C8 /* Dword offset B2 */ -#define DP_CHAIN_MASK 0x02CC /* Dword offset B3 */ -#define DP_PIX_WIDTH 0x02D0 /* Dword offset B4 */ -#define DP_MIX 0x02D4 /* Dword offset B5 */ -#define DP_SRC 0x02D8 /* Dword offset B6 */ - -#define CLR_CMP_CLR 0x0300 /* Dword offset C0 */ -#define CLR_CMP_MASK 0x0304 /* Dword offset C1 */ -#define CLR_CMP_CNTL 0x0308 /* Dword offset C2 */ - -#define FIFO_STAT 0x0310 /* Dword offset C4 */ - -#define CONTEXT_MASK 0x0320 /* Dword offset C8 */ -#define CONTEXT_LOAD_CNTL 0x032C /* Dword offset CB */ - -#define GUI_TRAJ_CNTL 0x0330 /* Dword offset CC */ -#define GUI_STAT 0x0338 /* Dword offset CE */ - - -/* CRTC control values (mostly CRTC_GEN_CNTL) */ - -#define CRTC_H_SYNC_NEG 0x00200000 -#define CRTC_V_SYNC_NEG 0x00200000 - -#define CRTC_DBL_SCAN_EN 0x00000001 -#define CRTC_INTERLACE_EN 0x00000002 -#define CRTC_HSYNC_DIS 0x00000004 -#define CRTC_VSYNC_DIS 0x00000008 -#define CRTC_CSYNC_EN 0x00000010 -#define CRTC_PIX_BY_2_EN 0x00000020 -#define CRTC_BLANK 0x00000040 - -#define CRTC_PIX_WIDTH_MASK 0x00000700 -#define CRTC_PIX_WIDTH_4BPP 0x00000100 -#define CRTC_PIX_WIDTH_8BPP 0x00000200 -#define CRTC_PIX_WIDTH_15BPP 0x00000300 -#define CRTC_PIX_WIDTH_16BPP 0x00000400 -#define CRTC_PIX_WIDTH_24BPP 0x00000500 -#define CRTC_PIX_WIDTH_32BPP 0x00000600 - -#define CRTC_BYTE_PIX_ORDER 0x00000800 -#define CRTC_PIX_ORDER_MSN_LSN 0x00000000 -#define CRTC_PIX_ORDER_LSN_MSN 0x00000800 - -#define CRTC_FIFO_LWM 0x000f0000 -#define CRTC_EXT_DISP_EN 0x01000000 -#define CRTC_EXT_EN 0x02000000 - -#define CRTC_CRNT_VLINE 0x07f00000 -#define CRTC_VBLANK 0x00000001 - -/* DAC control values */ - -#define DAC_EXT_SEL_RS2 0x01 -#define DAC_EXT_SEL_RS3 0x02 -#define DAC_8BIT_EN 0x00000100 -#define DAC_PIX_DLY_MASK 0x00000600 -#define DAC_PIX_DLY_0NS 0x00000000 -#define DAC_PIX_DLY_2NS 0x00000200 -#define DAC_PIX_DLY_4NS 0x00000400 -#define DAC_BLANK_ADJ_MASK 0x00001800 -#define DAC_BLANK_ADJ_0 0x00000000 -#define DAC_BLANK_ADJ_1 0x00000800 -#define DAC_BLANK_ADJ_2 0x00001000 - - -/* Mix control values */ - -#define MIX_NOT_DST 0x0000 -#define MIX_0 0x0001 -#define MIX_1 0x0002 -#define MIX_DST 0x0003 -#define MIX_NOT_SRC 0x0004 -#define MIX_XOR 0x0005 -#define MIX_XNOR 0x0006 -#define MIX_SRC 0x0007 -#define MIX_NAND 0x0008 -#define MIX_NOT_SRC_OR_DST 0x0009 -#define MIX_SRC_OR_NOT_DST 0x000a -#define MIX_OR 0x000b -#define MIX_AND 0x000c -#define MIX_SRC_AND_NOT_DST 0x000d -#define MIX_NOT_SRC_AND_DST 0x000e -#define MIX_NOR 0x000f - -/* Maximum engine dimensions */ -#define ENGINE_MIN_X 0 -#define ENGINE_MIN_Y 0 -#define ENGINE_MAX_X 4095 -#define ENGINE_MAX_Y 16383 - -/* Mach64 engine bit constants - these are typically ORed together */ - -/* BUS_CNTL register constants */ -#define BUS_FIFO_ERR_ACK 0x00200000 -#define BUS_HOST_ERR_ACK 0x00800000 - -/* GEN_TEST_CNTL register constants */ -#define GEN_OVR_OUTPUT_EN 0x20 -#define HWCURSOR_ENABLE 0x80 -#define GUI_ENGINE_ENABLE 0x100 -#define BLOCK_WRITE_ENABLE 0x200 - -/* DSP_CONFIG register constants */ -#define DSP_XCLKS_PER_QW 0x00003fff -#define DSP_LOOP_LATENCY 0x000f0000 -#define DSP_PRECISION 0x00700000 - -/* DSP_ON_OFF register constants */ -#define DSP_OFF 0x000007ff -#define DSP_ON 0x07ff0000 - -/* CLOCK_CNTL register constants */ -#define CLOCK_SEL 0x0f -#define CLOCK_DIV 0x30 -#define CLOCK_DIV1 0x00 -#define CLOCK_DIV2 0x10 -#define CLOCK_DIV4 0x20 -#define CLOCK_STROBE 0x40 -#define PLL_WR_EN 0x02 - -/* PLL registers */ -#define PLL_MACRO_CNTL 0x01 -#define PLL_REF_DIV 0x02 -#define PLL_GEN_CNTL 0x03 -#define MCLK_FB_DIV 0x04 -#define PLL_VCLK_CNTL 0x05 -#define VCLK_POST_DIV 0x06 -#define VCLK0_FB_DIV 0x07 -#define VCLK1_FB_DIV 0x08 -#define VCLK2_FB_DIV 0x09 -#define VCLK3_FB_DIV 0x0A -#define PLL_XCLK_CNTL 0x0B -#define PLL_TEST_CTRL 0x0E -#define PLL_TEST_COUNT 0x0F - -/* Fields in PLL registers */ -#define PLL_PC_GAIN 0x07 -#define PLL_VC_GAIN 0x18 -#define PLL_DUTY_CYC 0xE0 -#define PLL_OVERRIDE 0x01 -#define PLL_MCLK_RST 0x02 -#define OSC_EN 0x04 -#define EXT_CLK_EN 0x08 -#define MCLK_SRC_SEL 0x70 -#define EXT_CLK_CNTL 0x80 -#define VCLK_SRC_SEL 0x03 -#define PLL_VCLK_RST 0x04 -#define VCLK_INVERT 0x08 -#define VCLK0_POST 0x03 -#define VCLK1_POST 0x0C -#define VCLK2_POST 0x30 -#define VCLK3_POST 0xC0 - -/* CONFIG_CNTL register constants */ -#define APERTURE_4M_ENABLE 1 -#define APERTURE_8M_ENABLE 2 -#define VGA_APERTURE_ENABLE 4 - -/* CONFIG_STAT0 register constants (GX, CX) */ -#define CFG_BUS_TYPE 0x00000007 -#define CFG_MEM_TYPE 0x00000038 -#define CFG_INIT_DAC_TYPE 0x00000e00 - -/* CONFIG_STAT0 register constants (CT, ET, VT) */ -#define CFG_MEM_TYPE_xT 0x00000007 - -#define ISA 0 -#define EISA 1 -#define LOCAL_BUS 6 -#define PCI 7 - -/* Memory types for GX, CX */ -#define DRAMx4 0 -#define VRAMx16 1 -#define VRAMx16ssr 2 -#define DRAMx16 3 -#define GraphicsDRAMx16 4 -#define EnhancedVRAMx16 5 -#define EnhancedVRAMx16ssr 6 - -/* Memory types for CT, ET, VT, GT */ -#define DRAM 0 -#define EDO_DRAM 1 -#define PSEUDO_EDO 2 -#define SDRAM 3 - -#define DAC_INTERNAL 0x00 -#define DAC_IBMRGB514 0x01 -#define DAC_ATI68875 0x02 -#define DAC_TVP3026_A 0x72 -#define DAC_BT476 0x03 -#define DAC_BT481 0x04 -#define DAC_ATT20C491 0x14 -#define DAC_SC15026 0x24 -#define DAC_MU9C1880 0x34 -#define DAC_IMSG174 0x44 -#define DAC_ATI68860_B 0x05 -#define DAC_ATI68860_C 0x15 -#define DAC_TVP3026_B 0x75 -#define DAC_STG1700 0x06 -#define DAC_ATT498 0x16 -#define DAC_STG1702 0x07 -#define DAC_SC15021 0x17 -#define DAC_ATT21C498 0x27 -#define DAC_STG1703 0x37 -#define DAC_CH8398 0x47 -#define DAC_ATT20C408 0x57 - -#define CLK_ATI18818_0 0 -#define CLK_ATI18818_1 1 -#define CLK_STG1703 2 -#define CLK_CH8398 3 -#define CLK_INTERNAL 4 -#define CLK_ATT20C408 5 -#define CLK_IBMRGB514 6 - -/* MEM_CNTL register constants */ -#define MEM_SIZE_ALIAS 0x00000007 -#define MEM_SIZE_512K 0x00000000 -#define MEM_SIZE_1M 0x00000001 -#define MEM_SIZE_2M 0x00000002 -#define MEM_SIZE_4M 0x00000003 -#define MEM_SIZE_6M 0x00000004 -#define MEM_SIZE_8M 0x00000005 -#define MEM_SIZE_ALIAS_GTB 0x0000000F -#define MEM_SIZE_2M_GTB 0x00000003 -#define MEM_SIZE_4M_GTB 0x00000007 -#define MEM_SIZE_6M_GTB 0x00000009 -#define MEM_SIZE_8M_GTB 0x0000000B -#define MEM_BNDRY 0x00030000 -#define MEM_BNDRY_0K 0x00000000 -#define MEM_BNDRY_256K 0x00010000 -#define MEM_BNDRY_512K 0x00020000 -#define MEM_BNDRY_1M 0x00030000 -#define MEM_BNDRY_EN 0x00040000 - -/* ATI PCI constants */ -#define PCI_ATI_VENDOR_ID 0x1002 -#define PCI_MACH64_GX 0x4758 -#define PCI_MACH64_CX 0x4358 -#define PCI_MACH64_CT 0x4354 -#define PCI_MACH64_ET 0x4554 -#define PCI_MACH64_VT 0x5654 -#define PCI_MACH64_GT 0x4754 - -/* CONFIG_CHIP_ID register constants */ -#define CFG_CHIP_TYPE 0x0000FFFF -#define CFG_CHIP_CLASS 0x00FF0000 -#define CFG_CHIP_REV 0xFF000000 -#define CFG_CHIP_VERSION 0x07000000 -#define CFG_CHIP_FOUNDRY 0x38000000 -#define CFG_CHIP_REVISION 0xC0000000 - -/* Chip IDs read from CONFIG_CHIP_ID */ -#define MACH64_GX_ID 0xD7 -#define MACH64_CX_ID 0x57 -#define MACH64_CT_ID 0x4354 -#define MACH64_ET_ID 0x4554 -#define MACH64_VT_ID 0x5654 -#define MACH64_GT_ID 0x4754 - -/* Mach64 chip types */ -#define MACH64_UNKNOWN 0 -#define MACH64_GX 1 -#define MACH64_CX 2 -#define MACH64_CT 3 -#define MACH64_ET 4 -#define MACH64_VT 5 -#define MACH64_GT 6 - -/* DST_CNTL register constants */ -#define DST_X_RIGHT_TO_LEFT 0 -#define DST_X_LEFT_TO_RIGHT 1 -#define DST_Y_BOTTOM_TO_TOP 0 -#define DST_Y_TOP_TO_BOTTOM 2 -#define DST_X_MAJOR 0 -#define DST_Y_MAJOR 4 -#define DST_X_TILE 8 -#define DST_Y_TILE 0x10 -#define DST_LAST_PEL 0x20 -#define DST_POLYGON_ENABLE 0x40 -#define DST_24_ROTATION_ENABLE 0x80 - -/* SRC_CNTL register constants */ -#define SRC_PATTERN_ENABLE 1 -#define SRC_ROTATION_ENABLE 2 -#define SRC_LINEAR_ENABLE 4 -#define SRC_BYTE_ALIGN 8 -#define SRC_LINE_X_RIGHT_TO_LEFT 0 -#define SRC_LINE_X_LEFT_TO_RIGHT 0x10 - -/* HOST_CNTL register constants */ -#define HOST_BYTE_ALIGN 1 - -/* GUI_TRAJ_CNTL register constants */ -#define PAT_MONO_8x8_ENABLE 0x01000000 -#define PAT_CLR_4x2_ENABLE 0x02000000 -#define PAT_CLR_8x1_ENABLE 0x04000000 - -/* DP_CHAIN_MASK register constants */ -#define DP_CHAIN_4BPP 0x8888 -#define DP_CHAIN_7BPP 0xD2D2 -#define DP_CHAIN_8BPP 0x8080 -#define DP_CHAIN_8BPP_RGB 0x9292 -#define DP_CHAIN_15BPP 0x4210 -#define DP_CHAIN_16BPP 0x8410 -#define DP_CHAIN_24BPP 0x8080 -#define DP_CHAIN_32BPP 0x8080 - -/* DP_PIX_WIDTH register constants */ -#define DST_1BPP 0 -#define DST_4BPP 1 -#define DST_8BPP 2 -#define DST_15BPP 3 -#define DST_16BPP 4 -#define DST_32BPP 6 -#define SRC_1BPP 0 -#define SRC_4BPP 0x100 -#define SRC_8BPP 0x200 -#define SRC_15BPP 0x300 -#define SRC_16BPP 0x400 -#define SRC_32BPP 0x600 -#define HOST_1BPP 0 -#define HOST_4BPP 0x10000 -#define HOST_8BPP 0x20000 -#define HOST_15BPP 0x30000 -#define HOST_16BPP 0x40000 -#define HOST_32BPP 0x60000 -#define BYTE_ORDER_MSB_TO_LSB 0 -#define BYTE_ORDER_LSB_TO_MSB 0x1000000 - -/* DP_MIX register constants */ -#define BKGD_MIX_NOT_D 0 -#define BKGD_MIX_ZERO 1 -#define BKGD_MIX_ONE 2 -#define BKGD_MIX_D 3 -#define BKGD_MIX_NOT_S 4 -#define BKGD_MIX_D_XOR_S 5 -#define BKGD_MIX_NOT_D_XOR_S 6 -#define BKGD_MIX_S 7 -#define BKGD_MIX_NOT_D_OR_NOT_S 8 -#define BKGD_MIX_D_OR_NOT_S 9 -#define BKGD_MIX_NOT_D_OR_S 10 -#define BKGD_MIX_D_OR_S 11 -#define BKGD_MIX_D_AND_S 12 -#define BKGD_MIX_NOT_D_AND_S 13 -#define BKGD_MIX_D_AND_NOT_S 14 -#define BKGD_MIX_NOT_D_AND_NOT_S 15 -#define BKGD_MIX_D_PLUS_S_DIV2 0x17 -#define FRGD_MIX_NOT_D 0 -#define FRGD_MIX_ZERO 0x10000 -#define FRGD_MIX_ONE 0x20000 -#define FRGD_MIX_D 0x30000 -#define FRGD_MIX_NOT_S 0x40000 -#define FRGD_MIX_D_XOR_S 0x50000 -#define FRGD_MIX_NOT_D_XOR_S 0x60000 -#define FRGD_MIX_S 0x70000 -#define FRGD_MIX_NOT_D_OR_NOT_S 0x80000 -#define FRGD_MIX_D_OR_NOT_S 0x90000 -#define FRGD_MIX_NOT_D_OR_S 0xa0000 -#define FRGD_MIX_D_OR_S 0xb0000 -#define FRGD_MIX_D_AND_S 0xc0000 -#define FRGD_MIX_NOT_D_AND_S 0xd0000 -#define FRGD_MIX_D_AND_NOT_S 0xe0000 -#define FRGD_MIX_NOT_D_AND_NOT_S 0xf0000 -#define FRGD_MIX_D_PLUS_S_DIV2 0x170000 - -/* DP_SRC register constants */ -#define BKGD_SRC_BKGD_CLR 0 -#define BKGD_SRC_FRGD_CLR 1 -#define BKGD_SRC_HOST 2 -#define BKGD_SRC_BLIT 3 -#define BKGD_SRC_PATTERN 4 -#define FRGD_SRC_BKGD_CLR 0 -#define FRGD_SRC_FRGD_CLR 0x100 -#define FRGD_SRC_HOST 0x200 -#define FRGD_SRC_BLIT 0x300 -#define FRGD_SRC_PATTERN 0x400 -#define MONO_SRC_ONE 0 -#define MONO_SRC_PATTERN 0x10000 -#define MONO_SRC_HOST 0x20000 -#define MONO_SRC_BLIT 0x30000 - -/* CLR_CMP_CNTL register constants */ -#define COMPARE_FALSE 0 -#define COMPARE_TRUE 1 -#define COMPARE_NOT_EQUAL 4 -#define COMPARE_EQUAL 5 -#define COMPARE_DESTINATION 0 -#define COMPARE_SOURCE 0x1000000 - -/* FIFO_STAT register constants */ -#define FIFO_ERR 0x80000000 - -/* CONTEXT_LOAD_CNTL constants */ -#define CONTEXT_NO_LOAD 0 -#define CONTEXT_LOAD 0x10000 -#define CONTEXT_LOAD_AND_DO_FILL 0x20000 -#define CONTEXT_LOAD_AND_DO_LINE 0x30000 -#define CONTEXT_EXECUTE 0 -#define CONTEXT_CMD_DISABLE 0x80000000 - -/* GUI_STAT register constants */ -#define ENGINE_IDLE 0 -#define ENGINE_BUSY 1 -#define SCISSOR_LEFT_FLAG 0x10 -#define SCISSOR_RIGHT_FLAG 0x20 -#define SCISSOR_TOP_FLAG 0x40 -#define SCISSOR_BOTTOM_FLAG 0x80 - -/* ATI VGA Extended Regsiters */ -#define sioATIEXT 0x1ce -#define bioATIEXT 0x3ce - -#define ATI2E 0xae -#define ATI32 0xb2 -#define ATI36 0xb6 - -/* VGA Graphics Controller Registers */ -#define VGAGRA 0x3ce -#define GRA06 0x06 - -/* VGA Seququencer Registers */ -#define VGASEQ 0x3c4 -#define SEQ02 0x02 -#define SEQ04 0x04 - -#define MACH64_MAX_X ENGINE_MAX_X -#define MACH64_MAX_Y ENGINE_MAX_Y - -#define INC_X 0x0020 -#define INC_Y 0x0080 - -#define RGB16_555 0x0000 -#define RGB16_565 0x0040 -#define RGB16_655 0x0080 -#define RGB16_664 0x00c0 - -#define POLY_TEXT_TYPE 0x0001 -#define IMAGE_TEXT_TYPE 0x0002 -#define TEXT_TYPE_8_BIT 0x0004 -#define TEXT_TYPE_16_BIT 0x0008 -#define POLY_TEXT_TYPE_8 (POLY_TEXT_TYPE | TEXT_TYPE_8_BIT) -#define IMAGE_TEXT_TYPE_8 (IMAGE_TEXT_TYPE | TEXT_TYPE_8_BIT) -#define POLY_TEXT_TYPE_16 (POLY_TEXT_TYPE | TEXT_TYPE_16_BIT) -#define IMAGE_TEXT_TYPE_16 (IMAGE_TEXT_TYPE | TEXT_TYPE_16_BIT) - -#define MACH64_NUM_CLOCKS 16 -#define MACH64_NUM_FREQS 50 - -/* Wait until "v" queue entries are free */ -#define aty_WaitQueue(v) { while ((aty_ld_le32(FIFO_STAT) & 0xffff) > \ - ((unsigned short)(0x8000 >> (v)))); } - -/* Wait until GP is idle and queue is empty */ -#define aty_WaitIdleEmpty() { aty_WaitQueue(16); \ - while ((aty_ld_le32(GUI_STAT) & 1) != 0); } - -#define SKIP_2(_v) ((((_v)<<1)&0xfff8)|((_v)&0x3)|(((_v)&0x80)>>5)) - -#define MACH64_BIT_BLT(_srcx, _srcy, _dstx, _dsty, _w, _h, _dir) \ -{ \ - aty_WaitQueue(5); \ - aty_st_le32(SRC_Y_X, (((_srcx) << 16) | ((_srcy) & 0x0000ffff))); \ - aty_st_le32(SRC_WIDTH1, (_w)); \ - aty_st_le32(DST_CNTL, (_dir)); \ - aty_st_le32(DST_Y_X, (((_dstx) << 16) | ((_dsty) & 0x0000ffff))); \ - aty_st_le32(DST_HEIGHT_WIDTH, (((_w) << 16) | ((_h) & 0x0000ffff))); \ -} -#endif /* REGMACH64_H */ - diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/chips.c linux/drivers/macintosh/chips.c --- v2.1.114/linux/drivers/macintosh/chips.c Wed Jul 1 19:38:54 1998 +++ linux/drivers/macintosh/chips.c Wed Dec 31 16:00:00 1969 @@ -1,189 +0,0 @@ -/* - * chips.c: Console support for PowerBook 3400/2400 chips65550 display adaptor. - * - * Copyright (C) 1997 Fabio Riccardi. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pmac-cons.h" -#include "chips.h" -#include - - -static unsigned char *frame_buffer; -static unsigned char *blitter_regs; -static unsigned char *io_space; -static unsigned long chips_base_phys; -static unsigned long chips_io_phys; - -__openfirmware - -void -map_chips_display(struct device_node *dp) -{ - unsigned char bus, devfn; - unsigned short cmd; - unsigned long addr; - - addr = dp->addrs[0].address; - chips_base_phys = addr; - frame_buffer = __ioremap(addr + 0x800000, 0x100000, _PAGE_WRITETHRU); - blitter_regs = ioremap(addr + 0xC00000, 4096); - - printk("Mapped chips65550 frame buffer at %p, blitter at %p\n", - frame_buffer, blitter_regs); - - if (pci_device_loc(dp, &bus, &devfn) == 0) { - pcibios_read_config_word(bus, devfn, PCI_COMMAND, &cmd); - cmd |= 3; // enable memory and IO space - pcibios_write_config_word(bus, devfn, PCI_COMMAND, cmd); - io_space = (unsigned char *) pci_io_base(bus); - /* XXX really want the physical address here */ - chips_io_phys = (unsigned long) pci_io_base(bus); - printk("Chips65550 IO space at %p\n", io_space); - } - - video_mode = VMODE_800_600_60; - color_mode = CMODE_8; -} - -#define write_xr(num,val) { out_8(io_space + 0x3D6, num); out_8(io_space + 0x3D7, val); } -#define read_xr(num,var) { out_8(io_space + 0x3D6, num); var = in_8(io_space + 0x3D7); } -#define write_fr(num,val) { out_8(io_space + 0x3D0, num); out_8(io_space + 0x3D1, val); } -#define read_fr(num,var) { out_8(io_space + 0x3D0, num); var = in_8(io_space + 0x3D1); } -#define write_cr(num,val) { out_8(io_space + 0x3D4, num); out_8(io_space + 0x3D5, val); } -#define read_cr(num,var) { out_8(io_space + 0x3D4, num); var = in_8(io_space + 0x3D5); } - -void -chips_init() -{ - unsigned *p; - int i, hres; - - if (video_mode != VMODE_800_600_60) { - printk(KERN_ERR "chips65550: display mode %d not supported", video_mode); - video_mode = VMODE_800_600_60; - } - - if (color_mode != CMODE_8 && color_mode != CMODE_16) { - printk(KERN_ERR "chips65550: color mode %d not supported", color_mode); - color_mode = CMODE_8; - } - - n_scanlines = 600; - hres = 800; - pixel_size = 1 << color_mode; - line_pitch = hres * pixel_size; - row_pitch = line_pitch * 16; - - if (color_mode == CMODE_16) { - write_cr(0x13, 200); // 16 bit display width (decimal) - write_xr(0x81, 0x14); // 15 bit (TrueColor) color mode - write_xr(0x82, 0x00); // disable palettes - write_xr(0x20, 0x10); // 16 bit blitter mode - // write_xr(0x80, 0x00); // 6 bit DAC - // write_fr(0x11, 0X50); // No dither, 5 bits/color - } else if (color_mode == CMODE_8) { - write_cr(0x13, 100); // 8 bit display width (decimal) - write_xr(0x81, 0x12); // 8 bit color mode - write_xr(0x82, 0x08); // Graphics gamma enable - write_xr(0x20, 0x00); // 8 bit blitter mode - // write_xr(0x80, 0x82); // 8 bit DAC, CRT overscan - // write_fr(0x11, 0XE0); // Res Dither on, 6 bits/pixel - } - - pmac_init_palette(); /* Initialize colormap */ - - fb_start = frame_buffer; - - printk(KERN_INFO "hres = %d height = %d pitch = %d\n", - hres, n_scanlines, line_pitch); - - display_info.height = n_scanlines; - display_info.width = hres; - display_info.depth = pixel_size * 8; - display_info.pitch = line_pitch; - display_info.mode = video_mode; - strncpy(display_info.name, "chips65550", sizeof(display_info.name)); - display_info.fb_address = chips_base_phys + 0x800000; - display_info.cmap_adr_address = chips_io_phys + 0x3c8; - display_info.cmap_data_address = chips_io_phys + 0x3c9; - display_info.disp_reg_address = chips_base_phys + 0xC00000; - - /* Clear screen */ - p = (unsigned *) frame_buffer; - for (i = n_scanlines * line_pitch / sizeof(unsigned); i != 0; --i) - *p++ = 0; - - /* Turn on backlight */ - pmu_enable_backlight(1); -} - -int -chips_setmode(struct vc_mode *mode, int doit) -{ - int cmode; - - switch (mode->depth) { - case 16: - cmode = CMODE_16; - break; - case 8: - case 0: /* (default) */ - cmode = CMODE_8; - break; - default: - return -EINVAL; - } - - if (mode->mode != VMODE_800_600_60) - return -EINVAL; - - if (doit) { - video_mode = mode->mode; - color_mode = cmode; - chips_init(); - } - - return 0; -} - -void -chips_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - int i; - - for (i = 0; i < ncolors; ++i) { - out_8(&io_space[0x3C8], index + i); - udelay(1); - out_8(&io_space[0x3C9], red[i]); - out_8(&io_space[0x3C9], green[i]); - out_8(&io_space[0x3C9], blue[i]); - } -} - -void -chips_set_blanking(int blank_mode) -{ - pmu_enable_backlight(blank_mode == VESA_NO_BLANKING); -} diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/chips.h linux/drivers/macintosh/chips.h --- v2.1.114/linux/drivers/macintosh/chips.h Mon Jan 12 15:18:13 1998 +++ linux/drivers/macintosh/chips.h Wed Dec 31 16:00:00 1969 @@ -1,17 +0,0 @@ -/* - * Exported procedures for the chips65550 display driver on PowerBook 3400/2400 - * - * Copyright (C) 1997 Fabio Riccardi. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -extern void map_chips_display(struct device_node *); -extern void chips_init(void); -extern int chips_setmode(struct vc_mode *mode, int doit); -extern void chips_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); -extern void chips_set_blanking(int blank_mode); diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/control.c linux/drivers/macintosh/control.c --- v2.1.114/linux/drivers/macintosh/control.c Wed Jun 24 22:54:05 1998 +++ linux/drivers/macintosh/control.c Wed Dec 31 16:00:00 1969 @@ -1,533 +0,0 @@ -/* - * control.c: Console support for PowerMac "control" display adaptor. - * - * Copyright (C) 1996 Paul Mackerras. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pmac-cons.h" -#include "control.h" -#include - -/* - * Structure of the registers for the RADACAL colormap device. - */ -struct cmap_regs { - unsigned char addr; - char pad1[15]; - unsigned char d1; - char pad2[15]; - unsigned char d2; - char pad3[15]; - unsigned char lut; - char pad4[15]; -}; - -/* - * Structure of the registers for the "control" display adaptor". - */ -#define PAD(x) char x[12] - -struct preg { /* padded register */ - unsigned r; - char pad[12]; -}; - -struct control_regs { - struct preg vcount; /* vertical counter */ - /* Vertical parameters are in units of 1/2 scan line */ - struct preg vswin; /* between vsblank and vssync */ - struct preg vsblank; /* vert start blank */ - struct preg veblank; /* vert end blank (display start) */ - struct preg vewin; /* between vesync and veblank */ - struct preg vesync; /* vert end sync */ - struct preg vssync; /* vert start sync */ - struct preg vperiod; /* vert period */ - struct preg reg8; - /* Horizontal params are in units of 2 pixels */ - struct preg hperiod; /* horiz period - 2 */ - struct preg hsblank; /* horiz start blank */ - struct preg heblank; /* horiz end blank */ - struct preg hesync; /* horiz end sync */ - struct preg hssync; /* horiz start sync */ - struct preg rege; - struct preg regf; - struct preg reg10; - struct preg reg11; - struct preg ctrl; /* display control */ - struct preg start_addr; /* start address: 5 lsbs zero */ - struct preg pitch; /* addrs diff between scan lines */ - struct preg mon_sense; /* monitor sense bits */ - struct preg flags; - struct preg mode; - struct preg reg18; - struct preg reg19; - struct preg res[6]; -}; - -static void set_control_clock(unsigned char *params); -static int read_control_sense(void); -static int control_vram_reqd(int vmode, int cmode); - -static int total_vram; /* total amount of video memory, bytes */ -static unsigned char *frame_buffer; -static struct cmap_regs *cmap_regs; -static struct control_regs *disp_regs; -static int control_use_bank2; - -static unsigned long frame_buffer_phys; -static unsigned long disp_regs_phys; -static unsigned long cmap_regs_phys; - -/* - * Register initialization tables for the control display. - * - * Dot clock rate is - * 3.9064MHz * 2**clock_params[2] * clock_params[1] / clock_params[0]. - * - * The values for vertical frequency (V) in the comments below - * are the values measured using the modes under MacOS. - */ -struct control_regvals { - int pitch[3]; /* bytes/line, indexed by color_mode */ - int offset[3]; /* first pixel address */ - unsigned regs[16]; /* for vswin .. reg10 */ - unsigned char mode[3]; /* indexed by color_mode */ - unsigned char radacal_ctrl[3]; - unsigned char clock_params[3]; -}; - -/* Register values for 1280x1024, 75Hz mode (20) */ -static struct control_regvals control_reg_init_20 = { - { 1280, 2560, 0 }, - { 0x10, 0x20, 0 }, - { 2129, 2128, 80, 42, 4, 2130, 2132, 88, - 420, 411, 91, 35, 421, 18, 211, 386, }, - { 1, 1, 1}, - { 0x50, 0x64, 0x64 }, - { 13, 56, 3 } /* pixel clock = 134.61MHz for V=74.81Hz */ -}; - -/* Register values for 1280x960, 75Hz mode (19) */ -static struct control_regvals control_reg_init_19 = { - { 1280, 2560, 0 }, - { 0x10, 0x20, 0 }, - { 1997, 1996, 76, 40, 4, 1998, 2000, 86, - 418, 409, 89, 35, 419, 18, 210, 384, }, - { 1, 1, 1 }, - { 0x50, 0x64, 0x64 }, - { 31, 125, 3 } /* pixel clock = 126.01MHz for V=75.01 Hz */ -}; - -/* Register values for 1152x870, 75Hz mode (18) */ -static struct control_regvals control_reg_init_18 = { - { 1152, 2304, 4608 }, - { 0x10, 0x28, 0x50 }, - { 1825, 1822, 82, 43, 4, 1828, 1830, 120, - 726, 705, 129, 63, 727, 32, 364, 664 }, - { 2, 1, 1 }, - { 0x10, 0x14, 0x28 }, - { 19, 61, 3 } /* pixel clock = 100.33MHz for V=75.31Hz */ -}; - -/* Register values for 1024x768, 75Hz mode (17) */ -static struct control_regvals control_reg_init_17 = { - { 1024, 2048, 4096 }, - { 0x10, 0x28, 0x50 }, - { 1603, 1600, 64, 34, 4, 1606, 1608, 120, - 662, 641, 129, 47, 663, 24, 332, 616 }, - { 2, 1, 1 }, - { 0x10, 0x14, 0x28 }, - { 11, 28, 3 } /* pixel clock = 79.55MHz for V=74.50Hz */ -}; - -/* Register values for 1024x768, 72Hz mode (15) */ -static struct control_regvals control_reg_init_15 = { - { 1024, 2048, 4096 }, - { 0x10, 0x28, 0x50 }, - { 1607, 1604, 68, 39, 10, 1610, 1612, 132, - 670, 653, 141, 67, 671, 34, 336, 604, }, - { 2, 1, 1 }, - { 0x10, 0x14, 0x28 }, - { 12, 30, 3 } /* pixel clock = 78.12MHz for V=72.12Hz */ -}; - -/* Register values for 1024x768, 60Hz mode (14) */ -static struct control_regvals control_reg_init_14 = { - { 1024, 2048, 4096 }, - { 0x10, 0x28, 0x50 }, - { 1607, 1604, 68, 39, 10, 1610, 1612, 132, - 670, 653, 141, 67, 671, 34, 336, 604, }, - { 2, 1, 1 }, - { 0x10, 0x14, 0x28 }, - { 15, 31, 3 } /* pixel clock = 64.58MHz for V=59.62Hz */ -}; - -/* Register values for 832x624, 75Hz mode (13) */ -static struct control_regvals control_reg_init_13 = { - { 832, 1664, 3328 }, - { 0x10, 0x28, 0x50 }, - { 1331, 1330, 82, 43, 4, 1332, 1334, 128, - 574, 553, 137, 31, 575, 16, 288, 544 }, - { 2, 1, 0 }, { 0x10, 0x14, 0x18 }, - { 23, 42, 3 } /* pixel clock = 57.07MHz for V=74.27Hz */ -}; - -/* Register values for 800x600, 75Hz mode (12) */ -static struct control_regvals control_reg_init_12 = { - { 800, 1600, 3200 }, - { 0x10, 0x28, 0x50 }, - { 1247, 1246, 46, 25, 4, 1248, 1250, 104, - 526, 513, 113, 39, 527, 20, 264, 488, }, - { 2, 1, 0 }, { 0x10, 0x14, 0x18 }, - { 7, 11, 3 } /* pixel clock = 49.11MHz for V=74.40Hz */ -}; - -/* Register values for 800x600, 72Hz mode (11) */ -static struct control_regvals control_reg_init_11 = { - { 800, 1600, 3200 }, - { 0x10, 0x28, 0x50 }, - { 1293, 1256, 56, 33, 10, 1330, 1332, 76, - 518, 485, 85, 59, 519, 30, 260, 460, }, - { 2, 1, 0 }, { 0x10, 0x14, 0x18 }, - { 17, 27, 3 } /* pixel clock = 49.63MHz for V=71.66Hz */ -}; - -/* Register values for 800x600, 60Hz mode (10) */ -static struct control_regvals control_reg_init_10 = { - { 800, 1600, 3200 }, - { 0x10, 0x28, 0x50 }, - { 1293, 1256, 56, 33, 10, 1330, 1332, 76, - 518, 485, 85, 59, 519, 30, 260, 460, }, - { 2, 1, 0 }, { 0x10, 0x14, 0x18 }, - { 20, 53, 2 } /* pixel clock = 41.41MHz for V=59.78Hz */ -}; - -/* Register values for 640x870, 75Hz Full Page Display (7) */ -static struct control_regvals control_reg_init_7 = { - { 640, 1280, 2560 }, - { 0x10, 0x30, 0x68 }, - { 0x727, 0x724, 0x58, 0x2e, 0x4, 0x72a, 0x72c, 0x40, - 0x19e, 0x18c, 0x4c, 0x27, 0x19f, 0x14, 0xd0, 0x178 }, - { 2, 1, 0 }, { 0x10, 0x14, 0x18 }, - { 9, 33, 2 } /* pixel clock = 57.29MHz for V=75.01Hz */ -}; - -/* Register values for 640x480, 67Hz mode (6) */ -static struct control_regvals control_reg_init_6 = { - { 640, 1280, 2560 }, - { 0, 8, 0x10 }, - { 1045, 1042, 82, 43, 4, 1048, 1050, 72, - 430, 393, 73, 31, 431, 16, 216, 400 }, - { 2, 1, 0 }, { 0x10, 0x14, 0x18 }, - { 14, 27, 2 } /* pixel clock = 30.13MHz for V=66.43Hz */ -}; - -/* Register values for 640x480, 60Hz mode (5) */ -static struct control_regvals control_reg_init_5 = { - { 640, 1280, 2560 }, - { 0x10, 0x28, 0x50 }, - { 1037, 1026, 66, 34, 2, 1048, 1050, 56, - 398, 385, 65, 47, 399, 24, 200, 352, }, - { 2, 1, 0 }, { 0x10, 0x14, 0x18 }, - { 23, 37, 2 } /* pixel clock = 25.14MHz for V=59.85Hz */ -}; - -static struct control_regvals *control_reg_init[20] = { - NULL, NULL, NULL, NULL, - &control_reg_init_5, - &control_reg_init_6, - &control_reg_init_7, - NULL, NULL, - &control_reg_init_10, - &control_reg_init_11, - &control_reg_init_12, - &control_reg_init_13, - &control_reg_init_14, - &control_reg_init_15, - NULL, - &control_reg_init_17, - &control_reg_init_18, - &control_reg_init_19, - &control_reg_init_20 -}; - -__openfirmware - -/* - * Get the monitor sense value. - * Note that this can be called before calibrate_delay, - * so we can't use udelay. - */ -static int -read_control_sense() -{ - int sense; - - out_le32(&disp_regs->mon_sense.r, 7); /* drive all lines high */ - __delay(200); - out_le32(&disp_regs->mon_sense.r, 077); /* turn off drivers */ - __delay(2000); - sense = (in_le32(&disp_regs->mon_sense.r) & 0x1c0) << 2; - - /* drive each sense line low in turn and collect the other 2 */ - out_le32(&disp_regs->mon_sense.r, 033); /* drive A low */ - __delay(2000); - sense |= (in_le32(&disp_regs->mon_sense.r) & 0xc0) >> 2; - out_le32(&disp_regs->mon_sense.r, 055); /* drive B low */ - __delay(2000); - sense |= ((in_le32(&disp_regs->mon_sense.r) & 0x100) >> 5) - | ((in_le32(&disp_regs->mon_sense.r) & 0x40) >> 4); - out_le32(&disp_regs->mon_sense.r, 066); /* drive C low */ - __delay(2000); - sense |= (in_le32(&disp_regs->mon_sense.r) & 0x180) >> 7; - - out_le32(&disp_regs->mon_sense.r, 077); /* turn off drivers */ - return sense; -} - -static inline int control_vram_reqd(int vmode, int cmode) -{ - return vmode_attrs[vmode-1].vres - * control_reg_init[vmode-1]->pitch[cmode]; -} - -void -map_control_display(struct device_node *dp) -{ - int i, sense; - unsigned long addr, size; - int bank1, bank2; - - if (dp->next != 0) - printk("Warning: only using first control display device\n"); - if (dp->n_addrs != 2) - panic("expecting 2 addresses for control (got %d)", dp->n_addrs); - -#if 0 - printk("pmac_display_init: node = %p, addrs =", dp->node); - for (i = 0; i < dp->n_addrs; ++i) - printk(" %x(%x)", dp->addrs[i].address, dp->addrs[i].size); - printk(", intrs ="); - for (i = 0; i < dp->n_intrs; ++i) - printk(" %x", dp->intrs[i].line); - printk("\n"); -#endif - - /* Map in frame buffer and registers */ - for (i = 0; i < dp->n_addrs; ++i) { - addr = dp->addrs[i].address; - size = dp->addrs[i].size; - if (size >= 0x800000) { - /* use the big-endian aperture (??) */ - addr += 0x800000; - /* map at most 8MB for the frame buffer */ - frame_buffer_phys = addr; - frame_buffer = __ioremap(addr, 0x800000, _PAGE_WRITETHRU); - } else { - disp_regs_phys = addr; - disp_regs = ioremap(addr, size); - } - } - cmap_regs_phys = 0xf301b000; /* XXX not in prom? */ - cmap_regs = ioremap(cmap_regs_phys, 0x1000); - - /* Work out which banks of VRAM we have installed. */ - frame_buffer[0] = 0x5a; - frame_buffer[1] = 0xc7; - bank1 = frame_buffer[0] == 0x5a && frame_buffer[1] == 0xc7; - frame_buffer[0x600000] = 0xa5; - frame_buffer[0x600001] = 0x38; - bank2 = frame_buffer[0x600000] == 0xa5 && frame_buffer[0x600001] == 0x38; - total_vram = (bank1 + bank2) * 0x200000; - /* If we don't have bank 1 installed, we hope we have bank 2 :-) */ - control_use_bank2 = !bank1; - if (control_use_bank2) - frame_buffer += 0x600000; - - sense = read_control_sense(); - if (video_mode == VMODE_NVRAM) { - video_mode = nvram_read_byte(NV_VMODE); - if (video_mode <= 0 || video_mode > VMODE_MAX - || control_reg_init[video_mode-1] == 0) - video_mode = VMODE_CHOOSE; - } - if (video_mode == VMODE_CHOOSE) - video_mode = map_monitor_sense(sense); - if (control_reg_init[video_mode-1] == 0) - video_mode = VMODE_640_480_60; - - /* - * Reduce the pixel size if we don't have enough VRAM. - */ - if (color_mode == CMODE_NVRAM) - color_mode = nvram_read_byte(NV_CMODE); - if (color_mode < CMODE_8 || color_mode > CMODE_32) - color_mode = CMODE_8; - while (color_mode > CMODE_8 - && control_vram_reqd(video_mode, color_mode) > total_vram) - --color_mode; - - printk("Monitor sense value = 0x%x, ", sense); -} - -static void -set_control_clock(unsigned char *params) -{ - struct adb_request req; - int i; - - for (i = 0; i < 3; ++i) { - cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC, - 0x50, i + 1, params[i]); - while (!req.complete) - cuda_poll(); - } -} - -void -control_init() -{ - struct preg *rp; - int i, yoff, hres; - int ctrl, flags; - unsigned *p; - struct control_regvals *init; - - if (video_mode <= 0 || video_mode > VMODE_MAX - || (init = control_reg_init[video_mode-1]) == 0) - panic("control: display mode %d not supported", video_mode); - n_scanlines = vmode_attrs[video_mode-1].vres; - hres = vmode_attrs[video_mode-1].hres; - pixel_size = 1 << color_mode; - line_pitch = init->pitch[color_mode]; - row_pitch = line_pitch * 16; - - if (control_vram_reqd(video_mode, color_mode) > 0x200000) - flags = 0x51; - else if (control_use_bank2) - flags = 0x39; - else - flags = 0x31; - if (video_mode >= VMODE_1280_960_75 && color_mode >= CMODE_16) - ctrl = 0x7f; - else - ctrl = 0x3b; - - /* Initialize display timing registers */ - out_le32(&disp_regs->ctrl.r, 0x43b); - set_control_clock(init->clock_params); - cmap_regs->addr = 0x20; cmap_regs->d2 = init->radacal_ctrl[color_mode]; - cmap_regs->addr = 0x21; cmap_regs->d2 = control_use_bank2? 0: 1; - cmap_regs->addr = 0x10; cmap_regs->d2 = 0; - cmap_regs->addr = 0x11; cmap_regs->d2 = 0; - rp = &disp_regs->vswin; - for (i = 0; i < 16; ++i, ++rp) - out_le32(&rp->r, init->regs[i]); - out_le32(&disp_regs->pitch.r, line_pitch); - out_le32(&disp_regs->mode.r, init->mode[color_mode]); - out_le32(&disp_regs->flags.r, flags); - out_le32(&disp_regs->start_addr.r, 0); - out_le32(&disp_regs->reg18.r, 0x1e5); - out_le32(&disp_regs->reg19.r, 0); - - pmac_init_palette(); /* Initialize colormap */ - - /* Turn on display */ - out_le32(&disp_regs->ctrl.r, ctrl); - - yoff = (n_scanlines % 16) / 2; - fb_start = frame_buffer + yoff * line_pitch + init->offset[color_mode]; - - /* Clear screen */ - p = (unsigned *) (frame_buffer + init->offset[color_mode]); - for (i = n_scanlines * line_pitch / sizeof(unsigned); i != 0; --i) - *p++ = 0; - - display_info.height = n_scanlines; - display_info.width = hres; - display_info.depth = pixel_size * 8; - display_info.pitch = line_pitch; - display_info.mode = video_mode; - strncpy(display_info.name, "control", sizeof(display_info.name)); - display_info.fb_address = frame_buffer_phys + init->offset[color_mode]; - display_info.cmap_adr_address = cmap_regs_phys; - display_info.cmap_data_address = cmap_regs_phys + 0x30; - display_info.disp_reg_address = disp_regs_phys; -} - -int -control_setmode(struct vc_mode *mode, int doit) -{ - int cmode; - - if (mode->mode <= 0 || mode->mode > VMODE_MAX - || control_reg_init[mode->mode-1] == 0) - return -EINVAL; - switch (mode->depth) { - case 24: - case 32: - cmode = CMODE_32; - break; - case 16: - cmode = CMODE_16; - break; - case 8: - case 0: /* (default) */ - cmode = CMODE_8; - break; - default: - return -EINVAL; - } - if (control_vram_reqd(mode->mode, cmode) > total_vram) - return -EINVAL; - if (doit) { - video_mode = mode->mode; - color_mode = cmode; - control_init(); - } - return 0; -} - -void -control_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - int i; - - for (i = 0; i < ncolors; ++i) { - cmap_regs->addr = index + i; eieio(); - cmap_regs->lut = red[i]; eieio(); - cmap_regs->lut = green[i]; eieio(); - cmap_regs->lut = blue[i]; eieio(); - } -} - -void -control_set_blanking(int blank_mode) -{ - int ctrl; - - ctrl = ld_le32(&disp_regs->ctrl.r) | 0x33; - if (blank_mode & VESA_VSYNC_SUSPEND) - ctrl &= ~3; - if (blank_mode & VESA_HSYNC_SUSPEND) - ctrl &= ~0x30; - out_le32(&disp_regs->ctrl.r, ctrl); -} diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/control.h linux/drivers/macintosh/control.h --- v2.1.114/linux/drivers/macintosh/control.h Sat Aug 16 09:53:08 1997 +++ linux/drivers/macintosh/control.h Wed Dec 31 16:00:00 1969 @@ -1,17 +0,0 @@ -/* - * Exported procedures for the "control" display driver on PowerMacs. - * - * Copyright (C) 1997 Paul Mackerras. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -extern void map_control_display(struct device_node *); -extern void control_init(void); -extern int control_setmode(struct vc_mode *mode, int doit); -extern void control_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); -extern void control_set_blanking(int blank_mode); diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/imstt.c linux/drivers/macintosh/imstt.c --- v2.1.114/linux/drivers/macintosh/imstt.c Wed Jun 24 22:54:05 1998 +++ linux/drivers/macintosh/imstt.c Wed Dec 31 16:00:00 1969 @@ -1,950 +0,0 @@ -/* - * imstt.c: Console support for PowerMac "imstt" display adaptor. - * - * Copyright (C) 1997 Sigurdur Asgeirsson - * Modified by Danilo Beuche 1997 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pmac-cons.h" -#include "imstt.h" -#include - - -enum { - IBMRAMDAC = 0x00, - TVPRAMDAC = 0x01 -}; - - -// IMS TWIN TURBO -enum -{ - S1SA = 0, /* 0x00 */ - S2SA = 1, /* 0x04 */ - SP = 2, /* 0x08 */ - DSA = 3, /* 0x0C */ - CNT = 4, /* 0x10 */ - DP_OCTRL = 5, /* 0x14 */ - BLTCTL = 10, /* 0x28 */ - - // Scan Timing Generator Registers - HES = 12, /* 0x30 */ - HEB = 13, /* 0x34 */ - HSB = 14, /* 0x38 */ - HT = 15, /* 0x3C */ - VES = 16, /* 0x40 */ - VEB = 17, /* 0x44 */ - VSB = 18, /* 0x48 */ - VT = 19, /* 0x4C */ - HCIV = 20, /* 0x50 */ - VCIV = 21, /* 0x54 */ - TCDR = 22, /* 0x58 */ - VIL = 23, /* 0x5C */ - STGCTL = 24, /* 0x60 */ - - // Screen Refresh Generator Registers - SSR = 25, /* 0x64 */ - HRIR = 26, /* 0x68 */ - SPR = 27, /* 0x6C */ - CMR = 28, /* 0x70 */ - SRGCTL = 29, /* 0x74 */ - - // RAM Refresh Generator Registers - RRCIV = 30, /* 0x78 */ - RRSC = 31, /* 0x7C */ - RRCR = 34, /* 0x88 */ - - // System Registers - GIOE = 32, /* 0x80 */ - GIO = 33, /* 0x84 */ - SCR = 35, /* 0x8C */ - SSTATUS = 36, /* 0x90 */ - PRC = 37, /* 0x94 */ - -#if 0 - // PCI Registers - DVID = 0x00000000L, - SC = 0x00000004L, - CCR = 0x00000008L, - OG = 0x0000000CL, - BARM = 0x00000010L, - BARER = 0x00000030L, -#endif -}; - - -// IBM RAMDAC -enum -{ - PADDRW = 0x00, - PDATA = 0x04, - PPMASK = 0x08, - PADDRR = 0x0C, - PIDXLO = 0x10, - PIDXHI = 0x14, - PIDXDATA = 0x18, - PIDXCTL = 0x1C, - - PPIXREP = 0x0A, - PM0 = 0x20, - PN0 = 0x21, - PP0 = 0x22, - PC0 = 0x23 -}; - -// TI TVP 3030 RAMDAC Direct Registers -enum -{ - TVPADDRW = 0x00, // 0 Palette/Cursor RAM Write Adress/Index - TVPPDATA = 0x04, // 1 Palette Data RAM Data - TVPPMASK = 0x08, // 2 Pixel Read-Mask - TVPPADRR = 0x0c, // 3 Palette/Cursor RAM Read Adress - TVPCADRW = 0x10, // 4 Cursor/Overscan Color Write Address - TVPCDATA = 0x14, // 5 Cursor/Overscan Color Data - // 6 reserved - TVPCADRR = 0x1c, // 7 Cursor/Overscan Color Read Address - // 8 reserved - TVPDCCTL = 0x24, // 9 Direct Cursor Control - TVPIDATA = 0x28, // 10 Index Data - TVPCRDAT = 0x2c, // 11 Cursor RAM Data - TVPCXPOL = 0x30, // 12 Cursor-Position X LSB - TVPCXPOH = 0x34, // 13 Cursor-Position X MSB - TVPCYPOL = 0x38, // 14 Cursor-Position Y LSB - TVPCYPOH = 0x3c, // 15 Cursor-Position Y MSB -}; - -// TI TVP 3030 RAMDAC Indirect Registers -enum -{ - TVPIRREV = 0x01, // Silicon Revision [RO] - TVPIRICC = 0x06, // Indirect Cursor Control (0x00) - TVPIRBRC = 0x07, // Byte Router Control (0xe4) - TVPIRLAC = 0x0f, // Latch Control (0x06) - TVPIRTCC = 0x18, // True Color Control (0x80) - TVPIRMXC = 0x19, // Multiplex Control (0x98) - TVPIRCLS = 0x1a, // Clock Selection (0x07) - TVPIRPPG = 0x1c, // Palette Page (0x00) - TVPIRGEC = 0x1d, // General Control (0x00) - TVPIRMIC = 0x1e, // Miscellaneous Control (0x00) - TVPIRPLA = 0x2c, // PLL Address - TVPIRPPD = 0x2d, // Pixel Clock PLL Data - TVPIRMPD = 0x2e, // Memory Clock PLL Data - TVPIRLPD = 0x2f, // Loop Clock PLL Data - TVPIRCKL = 0x30, // Color-Key Overlay Low - TVPIRCKH = 0x31, // Color-Key Overlay High - TVPIRCRL = 0x32, // Color-Key Red Low - TVPIRCRH = 0x33, // Color-Key Red High - TVPIRCGL = 0x34, // Color-Key Green Low - TVPIRCGH = 0x35, // Color-Key Green High - TVPIRCBL = 0x36, // Color-Key Blue Low - TVPIRCBH = 0x37, // Color-Key Blue High - TVPIRCKC = 0x38, // Color-Key Control (0x00) - TVPIRMLC = 0x39, // MCLK/Loop Clock Control (0x18) - TVPIRSEN = 0x3a, // Sense Test (0x00) - TVPIRTMD = 0x3b, // Test Mode Data - TVPIRRML = 0x3c, // CRC Remainder LSB [RO] - TVPIRRMM = 0x3d, // CRC Remainder MSB [RO] - TVPIRRMS = 0x3e, // CRC Bit Select [WO] - TVPIRDID = 0x3f, // Device ID [RO] (0x30) - TVPIRRES = 0xff, // Software Reset [WO] - -}; - -struct initvalues -{ - unsigned char addr, value; -}; - - - -// Values which only depend on resolution not on color mode -struct tt_single_rmodevals -{ - unsigned short hes; - unsigned short heb; - unsigned short hsb; - unsigned short ht; - unsigned short ves; - unsigned short veb; - unsigned short vsb; - unsigned short vt; -}; - -struct tvp_single_rmodevals -{ - unsigned char pclk_n; - unsigned char pclk_m; - unsigned char pclk_p; -}; - -struct ibm_single_rmodevals -{ - unsigned char pclk_m; - unsigned char pclk_n; - unsigned char pclk_p; - unsigned char pclk_c; -}; - -// Values which only depend on color mode not on resolution -struct tvp_single_cmodevals -{ - unsigned char tcc; // True Color control - unsigned char mxc; // Multiplexer control - unsigned char lckl_n; // N value of LCKL PLL -}; - -struct ibm_single_cmodevals -{ - unsigned char pformat; // pixel format -}; - -// Values of the tvp which change depending on colormode x resolution -struct tvp_single_crmodevals -{ - unsigned char mlc; // Memory Loop Config 0x39 - unsigned char lckl_p; // P value of LCKL PLL -}; - -struct ibm_single_crmodevals -{ - // oh nothing changes -}; - -// complete configuration for a resolution in all depths -// 0 = 8 Bit, 15/16 bit = 1 , 32 Bit = 2 -struct ims_crmodevals -{ - int pitch; - struct tt_single_rmodevals tt[2]; // for each RAMDAC separate tt config - - struct tvp_single_rmodevals tvp_clock; // for each RAMDAC separate clock config - struct tvp_single_crmodevals tvp[3]; // for each colormode - - struct ibm_single_rmodevals ibm_clock; // for each RAMDAC separate clock config -// struct ibm_single_crmodevals ibm[3]; // for each color mode -}; - -struct ims_modevals -{ - int dac; // which dac do we have - int total_vram; // how much vram is on board - int sense; // what monitor - unsigned char* fb; // frame buffer address - unsigned char* fb_phys; // frame buffer address - unsigned char* cmap; // dac address - unsigned char* cmap_phys; // dac address - unsigned int* dc; // tt address - unsigned int* dc_phys; // tt address - - struct initvalues* init[2]; // initial register settings for each ramdac - - struct ims_crmodevals* mode[20]; // for each possible mode - - struct tvp_single_cmodevals tvp[3]; // for each color mode - - struct ibm_single_cmodevals ibm[3]; // for each color mode -}; - - -struct ims_crmodevals imsmode_6 = -{ - 640, - { - { 0x08, 0x12, 0x62, 0x6C, 0x0003, 0x002A, 0x020A, 0x020C }, - { 0x04, 0x0009, 0x0031, 0x0036, 0x0003, 0x002a, 0x020a, 0x020d }, - }, - { 0xef, 0x2e, 0xb2 }, - { - { 0x39, 0xf3 }, - { 0x39, 0xf3 }, - { 0x38, 0xf3 } - }, - // IBM CLOCK - { 0x78, 0x13, 0x02, 0x02 }, -}; - -struct ims_crmodevals imsmode_13 = -{ - 832, - { - { 0x05, 0x20, 0x88, 0x90, 0x0003, 0x0028, 0x0298, 0x029B }, - { 0x04, 0x0011, 0x0045, 0x0048, 0x0003, 0x002a, 0x029a, 0x029b}, - }, - { 0xfe, 0x3e, 0xf1 }, - { - { 0x39, 0xf3 }, - { 0x38, 0xf3 }, - { 0x38, 0xf2 } - }, - { 0x3E, 0x0A, 0x01, 0x02 } -}; -struct ims_crmodevals imsmode_17 = -{ - 1024, - { - { 0x0A, 0x1C, 0x9C, 0xA6, 0x0003, 0x0020, 0x0320, 0x0323 } , - { 0x06, 0x0210, 0x0250, 0x0053, 0x1003, 0x0021, 0x0321, 0x0324 }, - }, - { 0xfc, 0x3a, 0xf1 }, - { - { 0x39, 0xf3 }, - { 0x38, 0xf3 }, - { 0x38, 0xf2 } - }, - { 0x07, 0x00, 0x01, 0x02 } -}; -struct ims_crmodevals imsmode_18 = -{ - 1152, - { - { 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0x09, 0x0011, 0x059, 0x5b, 0x0003, 0x0031, 0x0397, 0x039a }, - }, - { 0xfd, 0x3a, 0xf1 }, - { - { 0x39, 0xf3 }, - { 0x38, 0xf3 }, - { 0x38, 0xf2 } - }, - { 0, 0, 0, 0 } -}; -struct ims_crmodevals imsmode_19 = -{ - 1280, - { - { 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0x09, 0x0016, 0x0066, 0x0069, 0x0003, 0x0027, 0x03e7, 0x03e8 }, - }, - { 0xf7, 0x36, 0xf0 }, - { - { 0x38, 0xf3 }, - { 0x38, 0xf2 }, - { 0x38, 0xf1 } - }, - { 0, 0, 0, 0 } -}; -struct ims_crmodevals imsmode_20 = -{ - 1280, - { - { 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0x09, 0x0018, 0x0068, 0x006a, 0x0003, 0x0029, 0x0429, 0x042a }, - }, - { 0xf0, 0x2d, 0xf0 }, - { - { 0x38, 0xf3 }, - { 0x38, 0xf2 }, - { 0x38, 0xf1 } - }, - { 0, 0, 0, 0 } -}; - -// IBM RAMDAC initial register values - -static struct initvalues ibm_initregs[] = -{ - { 0x02, 0x21 }, /* (0x01) Miscellaneous Clock Control */ - { 0x03, 0x00 }, /* (0x00) Sync Control */ - { 0x04, 0x00 }, /* (0x00) Horizontal Sync Position */ - { 0x05, 0x00 }, /* (0x00) Power Management */ - { 0x06, 0x0B }, /* (0x02) DAC Operation */ - { 0x07, 0x00 }, /* (0x00) Palette Control */ - { 0x08, 0x01 }, /* (0x01) System Clock Control */ - { 0x0B, 0x00 }, /* (U) 8 BPP Control */ - { 0x0C, 0xC4 }, /* (U) 16 BPP Control */ - { 0x0D, 0x00 }, /* (U) 24 BPP Packed Control */ - { 0x0E, 0x03 }, /* (U) 32 BPP Control */ - { 0x10, 0x05 }, /* (0x00) Pixel PLL Control 1 */ - { 0x11, 0x00 }, /* (0x00) Pixel PLL Control 2 */ - { 0x15, 0x08 }, /* (0x08) SYSCLK N (System PLL Reference Divider) */ - { 0x16, 0x57 }, /* (0x41) SYSCLK M (System PLL VCO Divider) */ - { 0x17, 0x00 }, /* (U) SYSCLK P */ - { 0x18, 0x00 }, /* (U) SYSCLK C */ - { 0x30, 0x00 }, /* (0x00) Cursor Control */ - { 0x60, 0xFF }, /* (U) Border Color Red */ - { 0x61, 0xFF }, /* (U) Border Color Green */ - { 0x62, 0xFF }, /* (U) Border Color Blue */ - { 0x70, 0x01 }, /* (0x00) Miscellaneous Control 1 */ - { 0x71, 0x45 }, /* (0x00) Miscellaneous Control 2 */ - { 0x72, 0x00 }, /* (0x00) Miscellaneous Control 3 */ - { 0x78, 0x00 }, /* (0x00) Key Control/DB Operation */ - { 0x00, 0x00 } -}; - - -static struct initvalues tvp_initregs[] = -{ -{ 0x6, 0x00}, -{ 0x7, 0xe4}, -{ 0xf, 0x06}, -{ 0x18, 0x80}, -{ 0x19, 0x4d}, -{ 0x1a, 0x05}, -{ 0x1c, 0x00}, -{ 0x1d, 0x00}, -{ 0x1e, 0x08}, -{ 0x30, 0xff}, -{ 0x31, 0xff}, -{ 0x32, 0xff}, -{ 0x33, 0xff}, -{ 0x34, 0xff}, -{ 0x35, 0xff}, -{ 0x36, 0xff}, -{ 0x37, 0xff}, -{ 0x38, 0x00}, -{ TVPIRPLA, 0x00 }, -{ TVPIRPPD, 0xc0 }, -{ TVPIRPPD, 0xd5 }, -{ TVPIRPPD, 0xea }, -{ TVPIRPLA, 0x00 }, -{ TVPIRMPD, 0xb9 }, -{ TVPIRMPD, 0x3a }, -{ TVPIRMPD, 0xb1 }, -{ TVPIRPLA, 0x00 }, -{ TVPIRLPD, 0xc1 }, -{ TVPIRLPD, 0x3d }, -{ TVPIRLPD, 0xf3 }, -{ 0x00, 0x00 } -}; - - -static struct ims_modevals ims_info = -{ - -1, // DAC - -1, // VRAM - -1, // Monitor; - 0, // Framebuffer - 0, // Framebuffer_phys - 0, // colormap - 0, // colormap_phys - 0, // dc - 0, // dc_phys - { ibm_initregs, tvp_initregs}, - { - NULL, - NULL, - NULL, - NULL, - &imsmode_6, - &imsmode_6, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - &imsmode_13, - NULL, - NULL, - NULL, - &imsmode_17, - &imsmode_18, - &imsmode_19, - &imsmode_20 - }, - { - { 0x80, 0x4d, 0xc1 }, - { 0x44, 0x55, 0xe1 }, - { 0x46, 0x5d, 0xf1 } - }, - { - { 0x03 }, - { 0x04 }, - { 0x06 } - } -}; - - - - -// static void set_imstt_clock(unsigned char *params); -static void map_imstt_display(struct device_node *, int); -static int read_imstt_sense(void); -static int imstt_vram_reqd(int vmode, int cmode); - - -__openfirmware - -#if 0 -static int get_tvp_ireg(int iaddr) -{ - ims_info.cmap[0] = iaddr & 0xff; eieio(); - return ims_info.cmap[40]; -} -#endif - -static void set_tvp_ireg(int iaddr,unsigned char value) -{ - ims_info.cmap[0] = iaddr & 0xff; eieio(); - ims_info.cmap[40] = value; eieio(); -} -/* - * Get the monitor sense value. - * Note that this can be called before calibrate_delay, - * so we can't use udelay. - */ -static int -read_imstt_sense() -{ -#if 0 - int sense; - unsigned gio, gioe; - - gio = ld_le32(ims_info.dc + GIO) & ~0x0038; - gioe = ld_le32(dc_ - - out_le32(ims_info.dc + GIOE, reg); /* drive all lines high */ - __delay(200); - out_le32(ims_info.dc + GIOE, 077); /* turn off drivers */ - __delay(2000); - sense = (in_le32(ims_info.dc + GIOE) & 0x1c0) << 2; - - /* drive each sense line low in turn and collect the other 2 */ - out_le32(ims_info.dc + GIOE, 033); /* drive A low */ - __delay(2000); - sense |= (in_le32(ims_info.dc + GIOE) & 0xc0) >> 2; - out_le32(ims_info.dc + GIOE, 055); /* drive B low */ - __delay(2000); - sense |= ((in_le32(ims_info.dc + GIOE) & 0x100) >> 5) - | ((in_le32(ims_info.dc + GIOE) & 0x40) >> 4); - out_le32(ims_info.dc + GIOE, 066); /* drive C low */ - __delay(2000); - sense |= (in_le32(ims_info.dc + GIOE) & 0x180) >> 7; - - out_le32(ims_info.dc + GIOE, 077); /* turn off drivers */ - return sense; -#else - return 0; -#endif -} - -static inline int imstt_vram_reqd(int vmode, int cmode) -{ - return vmode_attrs[vmode-1].vres * - (ims_info.mode[vmode-1])->pitch * ( 1 << cmode); -} - -void -map_imstt_display_tvp(struct device_node *dp) -{ - map_imstt_display(dp,1); -} - -void -map_imstt_display_ibm(struct device_node *dp) -{ - map_imstt_display(dp,0); -} - -static void -map_imstt_display(struct device_node *dp, int which) -{ - int i, sense; - unsigned long addr, size, tmp; - unsigned char bus, devfn; - unsigned short cmd; - - if (dp->next != 0) - printk("Warning: only using first imstt display device\n"); - -#if 0 - printk("pmac_display_init: node = %p, addrs =", dp->node); - for (i = 0; i < dp->n_addrs; ++i) - printk(" %x(%x)", dp->addrs[i].address, dp->addrs[i].size); - printk(", intrs ="); - for (i = 0; i < dp->n_intrs; ++i) - printk(" %x", dp->intrs[i]); - printk("\n"); -#endif - - /* Map in frame buffer and registers */ - for (i = 0; i < dp->n_addrs; ++i) { - addr = dp->addrs[i].address; - size = dp->addrs[i].size; - if (size >= 0x02000000) { - ims_info.fb = __ioremap(addr, size, _PAGE_NO_CACHE); - ims_info.fb_phys = (unsigned char*)addr; - ims_info.dc = (unsigned*)(ims_info.fb + 0x00800000); - ims_info.dc_phys = (unsigned*)(ims_info.fb_phys + 0x00800000); - ims_info.cmap = (unsigned char*)(ims_info.fb + 0x00840000); - ims_info.cmap_phys = (unsigned char*)(ims_info.fb_phys + 0x00840000); - printk("mapped ims_info.fb=%x(%x)", (unsigned)ims_info.fb, (unsigned)size); - printk(" ims_info.dc=%x, ims_info.cmap=%x\n", (unsigned)ims_info.dc, (unsigned)ims_info.cmap); - } - } - - /* enable memory-space accesses using config-space command register */ - if (pci_device_loc(dp, &bus, &devfn) == 0) { - pcibios_read_config_word(bus, devfn, PCI_COMMAND, &cmd); - - printk("command word 0x%04X\n", cmd); - - if (cmd != 0xffff) { - cmd |= PCI_COMMAND_MEMORY; - pcibios_write_config_word(bus, devfn, PCI_COMMAND, cmd); - } - } - else - printk("unable to find pci device\n"); - - tmp = in_le32(ims_info.dc + SSTATUS); - printk("chip version %ld, ", (tmp & 0x0F00) >> 8); - - tmp = in_le32(ims_info.dc + PRC); - - if (0 == which ) - ims_info.total_vram = (tmp & 0x0004) ? 0x000400000L : 0x000200000L; - else - ims_info.total_vram = 0x000800000L; - - printk("VRAM size %ldM\n", ims_info.total_vram / 0x000100000L); - - if (ims_info.total_vram == 0x000800000L) - { - ims_info.dac = TVPRAMDAC; - printk("Selecting TVP 3030 RAMDAC\n"); - } - else - { - ims_info.dac = IBMRAMDAC; - printk("Selecting IBM RAMDAC\n"); - } - - sense = read_imstt_sense(); - printk("Monitor sense value = 0x%x, ", sense); -#if 0 - if (video_mode == VMODE_NVRAM) { - video_mode = nvram_read_byte(NV_VMODE); - if (video_mode <= 0 || video_mode > VMODE_MAX - || imstt_reg_init[video_mode-1] == 0) - video_mode = VMODE_CHOOSE; - } - if (video_mode == VMODE_CHOOSE) - video_mode = map_monitor_sense(sense); - if (imstt_reg_init[video_mode-1] == 0) - video_mode = VMODE_640_480_67; - - /* - * Reduce the pixel size if we don't have enough VRAM. - */ - if (color_mode == CMODE_NVRAM) - color_mode = nvram_read_byte(NV_CMODE); - if (color_mode < CMODE_8 || color_mode > CMODE_32) - color_mode = CMODE_8; - while (color_mode > CMODE_8 - && imstt_vram_reqd(video_mode, color_mode) > ims_info.total_vram) - --color_mode; - -#endif - // Hack Hack Hack !!! - video_mode = VMODE_640_480_67; - color_mode = CMODE_8; -} - -/* - * We don't need it ( all is done in ims_init ) -static void -set_imstt_clock_tvp(char* tvprv) -{ - int j; - for (j=0;j<3;j++) - { - set_tvp_ireg(TVPIRPLA,(j << 4) | (j << 2) | j); // Select same value for all plls - set_tvp_ireg(TVPIRPPD,tvprv[j]); - set_tvp_ireg(TVPIRMPD,tvprv[3+j]); - set_tvp_ireg(TVPIRLPD,tvprv[6+j]); - } -} - -static void -set_imstt_clock_ibm(unsigned char *params) -{ - ims_info.cmap[PIDXHI] = 0; eieio(); - ims_info.cmap[PIDXLO] = PM0; eieio(); - ims_info.cmap[PIDXDATA] = params[0]; eieio(); - - ims_info.cmap[PIDXLO] = PN0; eieio(); - ims_info.cmap[PIDXDATA] = params[1]; eieio(); - - ims_info.cmap[PIDXLO] = PP0; eieio(); - ims_info.cmap[PIDXDATA] = params[2]; eieio(); - - ims_info.cmap[PIDXLO] = PC0; eieio(); - ims_info.cmap[PIDXDATA] = params[3]; eieio(); -} -*/ - -void -imstt_init() -{ - int i, yoff, hres; - unsigned long ctl, pitch, tmp, scrCmode; - struct ims_crmodevals *init; - - if (video_mode <= 0 || video_mode > VMODE_MAX ) panic("imstt: display mode %d not supported(not in valid range)", video_mode); - if ((init = ims_info.mode[video_mode-1]) == 0) panic("imstt: display mode %d not supported(no mode definition)", video_mode); - if (init->tt[ims_info.dac].vt == 0) panic("imstt: display mode %d not supported (no timing definition)", video_mode); - - - n_scanlines = vmode_attrs[video_mode-1].vres; - hres = vmode_attrs[video_mode-1].hres; - pixel_size = 1 << color_mode; - line_pitch = init->pitch * pixel_size; - row_pitch = line_pitch * 16; - - /* initialize the card */ - tmp = in_le32(ims_info.dc + STGCTL); - out_le32(ims_info.dc + STGCTL, tmp & ~0x1); -#if 0 - out_le32(ims_info.dc + SCR, 0); -#endif - - switch(ims_info.dac) - { - case IBMRAMDAC: - ims_info.cmap[PPMASK] = 0xFF; eieio(); - ims_info.cmap[PIDXHI] = 0x00; eieio(); - for (i = 0; ims_info.init[IBMRAMDAC][i].addr != 0 && ims_info.init[IBMRAMDAC][i].value != 0 ;i++) - { - ims_info.cmap[PIDXLO] = ims_info.init[IBMRAMDAC][i].addr; eieio(); - ims_info.cmap[PIDXDATA] = ims_info.init[IBMRAMDAC][i].value; eieio(); - } - - ims_info.cmap[PIDXHI] = 0; eieio(); - ims_info.cmap[PIDXLO] = PM0; eieio(); - ims_info.cmap[PIDXDATA] = init->ibm_clock.pclk_m; eieio(); - - ims_info.cmap[PIDXLO] = PN0; eieio(); - ims_info.cmap[PIDXDATA] = init->ibm_clock.pclk_n; eieio(); - - ims_info.cmap[PIDXLO] = PP0; eieio(); - ims_info.cmap[PIDXDATA] = init->ibm_clock.pclk_p; eieio(); - - ims_info.cmap[PIDXLO] = PC0; eieio(); - ims_info.cmap[PIDXDATA] = init->ibm_clock.pclk_c; eieio(); - - ims_info.cmap[PIDXLO] = PPIXREP; eieio(); - ims_info.cmap[PIDXDATA] = ims_info.ibm[color_mode].pformat; eieio(); - - break; - case TVPRAMDAC: - for (i = 0; ims_info.init[TVPRAMDAC][i].addr != 0 && ims_info.init[TVPRAMDAC][i].value != 0 ;i++) - { - set_tvp_ireg(ims_info.init[TVPRAMDAC][i].addr,ims_info.init[TVPRAMDAC][i].value); - } - set_tvp_ireg(TVPIRPLA,0x00); - set_tvp_ireg(TVPIRPPD,init->tvp_clock.pclk_n); - set_tvp_ireg(TVPIRPPD,init->tvp_clock.pclk_m); - set_tvp_ireg(TVPIRPPD,init->tvp_clock.pclk_p); - - set_tvp_ireg(TVPIRTCC,ims_info.tvp[color_mode].tcc); - set_tvp_ireg(TVPIRMXC,ims_info.tvp[color_mode].mxc); - - set_tvp_ireg(TVPIRPLA,0x00); - set_tvp_ireg(TVPIRLPD,ims_info.tvp[color_mode].lckl_n); - - set_tvp_ireg(TVPIRPLA,0x15); - set_tvp_ireg(TVPIRMLC,(init->tvp[color_mode]).mlc); - - set_tvp_ireg(TVPIRPLA,0x2a); - set_tvp_ireg(TVPIRLPD,init->tvp[color_mode].lckl_p); - break; - } - - - switch(color_mode) { - case CMODE_32: - ctl = 0x1785; - pitch = init->pitch; - scrCmode = 0x300; - break; - case CMODE_16: - ctl = 0x1783; - pitch = init->pitch / 2; - scrCmode = 0x100; - break; - case CMODE_8: - default: - ctl = 0x1781; - pitch = init->pitch / 4; - scrCmode = 0x000; - break; - } - - out_le32(&ims_info.dc[HES], init->tt[ims_info.dac].hes); - out_le32(&ims_info.dc[HEB], init->tt[ims_info.dac].heb); - out_le32(&ims_info.dc[HSB], init->tt[ims_info.dac].hsb); - out_le32(&ims_info.dc[HT], init->tt[ims_info.dac].ht); - out_le32(&ims_info.dc[VES], init->tt[ims_info.dac].ves); - out_le32(&ims_info.dc[VEB], init->tt[ims_info.dac].veb); - out_le32(&ims_info.dc[VSB], init->tt[ims_info.dac].vsb); - out_le32(&ims_info.dc[VT], init->tt[ims_info.dac].vt); - out_le32(&ims_info.dc[HCIV], 1); - out_le32(&ims_info.dc[VCIV], 1); - out_le32(&ims_info.dc[TCDR], 4); - out_le32(&ims_info.dc[VIL], 0); - - out_le32(&ims_info.dc[SSR], 0); - out_le32(&ims_info.dc[HRIR], 0x0200); - out_le32(&ims_info.dc[CMR], 0x01FF); - out_le32(&ims_info.dc[SRGCTL], 0x0003); - switch(ims_info.total_vram) - { - case 0x000200000: - out_le32(&ims_info.dc[SCR], 0x0059D| scrCmode); - break; - case 0x000400000: - pitch /= 2; - out_le32(&ims_info.dc[SCR], 0x00D0DC | scrCmode); - break; - case 0x000800000: - pitch /= 2; - out_le32(&ims_info.dc[SCR], 0x0150DD | scrCmode); - break; - } - - out_le32(&ims_info.dc[SPR], pitch); - - if (ims_info.dac == IBMRAMDAC) - { - - - } - - pmac_init_palette(); /* Initialize colormap */ - - out_le32(&ims_info.dc[STGCTL], ctl); - - yoff = (n_scanlines % 16) / 2; - fb_start = ims_info.fb + yoff * line_pitch; - - /* Clear screen */ - { - unsigned long *p; - p = (unsigned long*)ims_info.fb; - for (i = n_scanlines * line_pitch / sizeof(unsigned); i != 0; --i) - *p++ = 0; - } - - display_info.height = n_scanlines; - display_info.width = hres; - display_info.depth = pixel_size * 8; - display_info.pitch = line_pitch; - display_info.mode = video_mode; - - if (ims_info.dac == IBMRAMDAC ) - strncpy(display_info.name, "IMS,tt128mb2/4", sizeof(display_info.name)); - else - strncpy(display_info.name, "IMS,tt128mb8/8A", sizeof(display_info.name)); - - display_info.fb_address = (unsigned long) ims_info.fb_phys; - display_info.cmap_adr_address = (unsigned long) &ims_info.cmap_phys[PADDRW]; - display_info.cmap_data_address = (unsigned long) &ims_info.cmap_phys[PDATA]; - display_info.disp_reg_address = (unsigned long) NULL; -} - -int -imstt_setmode(struct vc_mode *mode, int doit) -{ - int cmode; - struct ims_crmodevals *init; - - if (video_mode <= 0 || video_mode > VMODE_MAX ) - return -EINVAL; - if ((init = ims_info.mode[video_mode-1]) == 0) - return -EINVAL; - if (init->tt[ims_info.dac].vt == 0) - return -EINVAL; - - if (mode->mode <= 0 || mode->mode > VMODE_MAX - || (ims_info.mode[mode->mode-1] == 0)) - return -EINVAL; - switch (mode->depth) { - case 24: - case 32: - cmode = CMODE_32; - break; - case 16: - cmode = CMODE_16; - break; - case 8: - case 0: /* (default) */ - cmode = CMODE_8; - break; - default: - return -EINVAL; - } - if (imstt_vram_reqd(mode->mode, cmode) > ims_info.total_vram) - return -EINVAL; - if (doit) { - video_mode = mode->mode; - color_mode = cmode; - imstt_init(); - } - return 0; -} - -// set palette for TI TVP3030 ramdac (used on 8MB version) -void -imstt_set_palette_tvp(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - int i; - for (i = 0; i < ncolors; ++i) { - ims_info.cmap[TVPADDRW] = index + i; eieio(); - ims_info.cmap[TVPPDATA] = red[i]; eieio(); - ims_info.cmap[TVPPDATA] = green[i]; eieio(); - ims_info.cmap[TVPPDATA] = blue[i]; eieio(); - } -} - -// set palette for IBM ramdac (used on 2MB/4MB version) -void -imstt_set_palette_ibm(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - int i; - - for (i = 0; i < ncolors; ++i) { - ims_info.cmap[PADDRW] = index + i; eieio(); - ims_info.cmap[PDATA] = red[i]; eieio(); - ims_info.cmap[PDATA] = green[i]; eieio(); - ims_info.cmap[PDATA] = blue[i]; eieio(); - } -} - -void -imstt_set_blanking(int blank_mode) -{ - long ctrl; - - ctrl = ld_le32(ims_info.dc + STGCTL) | 0x0030; - if (blank_mode & VESA_VSYNC_SUSPEND) - ctrl &= ~0x0020; - if (blank_mode & VESA_HSYNC_SUSPEND) - ctrl &= ~0x0010; - out_le32(ims_info.dc + STGCTL, ctrl); -} - - diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/imstt.h linux/drivers/macintosh/imstt.h --- v2.1.114/linux/drivers/macintosh/imstt.h Thu Apr 23 20:21:33 1998 +++ linux/drivers/macintosh/imstt.h Wed Dec 31 16:00:00 1969 @@ -1,21 +0,0 @@ -/* - * Exported procedures for the "control" display driver on PowerMacs. - * - * Copyright (C) 1997 Paul Mackerras. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -extern void map_imstt_display_ibm(struct device_node *); -extern void map_imstt_display_tvp(struct device_node *); -extern void imstt_init(void); -extern int imstt_setmode(struct vc_mode *mode, int doit); -extern void imstt_set_palette_ibm(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); -extern void imstt_set_palette_tvp(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); -extern void imstt_set_blanking(int blank_mode); - diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/mac_keyb.c linux/drivers/macintosh/mac_keyb.c --- v2.1.114/linux/drivers/macintosh/mac_keyb.c Fri May 8 23:14:47 1998 +++ linux/drivers/macintosh/mac_keyb.c Tue Aug 4 16:08:05 1998 @@ -460,7 +460,7 @@ /* Only send mouse codes when keyboard is in raw mode. */ if (kbd->kbdmode == VC_RAW) { - static unsigned char uch_ButtonStateSecond = 0; + static unsigned char uch_ButtonStateSecond = 0x80; unsigned char uchButtonSecond; /* Send first button, second button and movement. */ @@ -480,8 +480,8 @@ } /* Macintosh 3-button mouse (handler 4). */ - if ((nb == 6) && autopoll /*?*/) { - static unsigned char uch_ButtonStateThird = 0; + if ((nb == 4) && autopoll /*?*/) { + static unsigned char uch_ButtonStateThird = 0x80; unsigned char uchButtonThird; /* Store the button state for speed. */ @@ -563,13 +563,13 @@ return; /* setup key map */ - memcpy(plain_map, macplain_map, sizeof(plain_map)); - memcpy(shift_map, macshift_map, sizeof(shift_map)); - memcpy(altgr_map, macaltgr_map, sizeof(altgr_map)); - memcpy(ctrl_map, macctrl_map, sizeof(ctrl_map)); - memcpy(shift_ctrl_map, macshift_ctrl_map, sizeof(shift_ctrl_map)); - memcpy(alt_map, macalt_map, sizeof(alt_map)); - memcpy(ctrl_alt_map, macctrl_alt_map, sizeof(ctrl_alt_map)); + memcpy(key_maps[0], macplain_map, sizeof(plain_map)); + memcpy(key_maps[1], macshift_map, sizeof(plain_map)); + memcpy(key_maps[2], macaltgr_map, sizeof(plain_map)); + memcpy(key_maps[4], macctrl_map, sizeof(plain_map)); + memcpy(key_maps[5], macshift_ctrl_map, sizeof(plain_map)); + memcpy(key_maps[8], macalt_map, sizeof(plain_map)); + memcpy(key_maps[12], macctrl_alt_map, sizeof(plain_map)); /* initialize mouse interrupt hook */ adb_mouse_interrupt_hook = NULL; diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/macserial.c linux/drivers/macintosh/macserial.c --- v2.1.114/linux/drivers/macintosh/macserial.c Fri May 8 23:14:47 1998 +++ linux/drivers/macintosh/macserial.c Tue Aug 4 16:08:05 1998 @@ -302,6 +302,8 @@ if (info->kgdb_channel) { if (ch == 0x03 || ch == '$') breakpoint(); + if (stat & (Rx_OVR|FRM_ERR|PAR_ERR)) + write_zsreg(info->zs_channel, 0, ERR_RES); return; } #endif @@ -322,17 +324,15 @@ } if (stat & Rx_OVR) { flag = TTY_OVERRUN; - /* reset the error indication */ - write_zsreg(info->zs_channel, 0, ERR_RES); } else if (stat & FRM_ERR) { - /* this error is not sticky */ flag = TTY_FRAME; } else if (stat & PAR_ERR) { flag = TTY_PARITY; - /* reset the error indication */ - write_zsreg(info->zs_channel, 0, ERR_RES); } else flag = 0; + if (flag) + /* reset the error indication */ + write_zsreg(info->zs_channel, 0, ERR_RES); *tty->flip.flag_buf_ptr++ = flag; *tty->flip.char_buf_ptr++ = ch; } @@ -1582,10 +1582,6 @@ + ch->addrs[0].size / 2; zs_soft[n].zs_channel = &zs_channels[n]; zs_soft[n].irq = ch->intrs[0].line; - if (request_irq(ch->intrs[0].line, rs_interrupt, 0, - "SCC", &zs_soft[n])) - printk(KERN_ERR "macserial: can't get irq %d\n", - ch->intrs[0].line); /* XXX this assumes the prom puts chan A before B */ if (n & 1) zs_soft[n].zs_chan_a = &zs_channels[n-1]; @@ -1617,6 +1613,14 @@ if (zs_chain == 0) probe_sccs(); + /* Register the interrupt handler for each one */ + for (i = 0; i < zs_channels_found; ++i) { + if (request_irq(zs_soft[i].irq, rs_interrupt, 0, + "SCC", &zs_soft[i])) + printk(KERN_ERR "macserial: can't get irq %d\n", + zs_soft[i].irq); + } + show_serial_version(); /* Initialize the tty_driver structure */ @@ -1676,6 +1680,7 @@ for (channel = 0; channel < zs_channels_found; ++channel) { #ifdef CONFIG_KGDB if (zs_soft[channel].kgdb_channel) { + kgdb_interruptible(1); continue; } #endif @@ -1874,6 +1879,7 @@ register_console(&sercons); } #endif /* ifdef CONFIG_SERIAL_CONSOLE */ + #ifdef CONFIG_KGDB /* These are for receiving and sending characters under the kgdb * source level kernel debugger. @@ -1885,6 +1891,7 @@ udelay(5); write_zsdata(chan, kgdb_char); } + char getDebugChar(void) { struct mac_zschannel *chan = zs_kgdbchan; @@ -1892,6 +1899,7 @@ eieio(); /*barrier();*/ return read_zsdata(chan); } + void kgdb_interruptible(int yes) { struct mac_zschannel *chan = zs_kgdbchan; @@ -1909,6 +1917,7 @@ write_zsreg(chan, 1, one); write_zsreg(chan, 9, nine); } + /* This sets up the serial port we're using, and turns on * interrupts for that channel, so kgdb is usable once we're done. */ @@ -1927,23 +1936,26 @@ i++; } } + /* This is called at boot time to prime the kgdb serial debugging * serial line. The 'tty_num' argument is 0 for /dev/ttya and 1 * for /dev/ttyb which is determined in setup_arch() from the * boot command line flags. + * XXX at the moment probably only channel A will work */ __initfunc(void zs_kgdb_hook(int tty_num)) { /* Find out how many Z8530 SCCs we have */ if (zs_chain == 0) probe_sccs(); - zs_soft[tty_num].zs_channel = &zs_channels[tty_num]; + zs_kgdbchan = zs_soft[tty_num].zs_channel; zs_soft[tty_num].change_needed = 0; zs_soft[tty_num].clk_divisor = 16; zs_soft[tty_num].zs_baud = 38400; zs_soft[tty_num].kgdb_channel = 1; /* This runs kgdb */ zs_soft[tty_num ^ 1].kgdb_channel = 0; /* This does not */ + /* Turn on transmitter/receiver at 8-bits/char */ kgdb_chaninit(zs_soft[tty_num].zs_channel, 1, 38400); printk("KGDB: on channel %d initialized\n", tty_num); diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/platinum.c linux/drivers/macintosh/platinum.c --- v2.1.114/linux/drivers/macintosh/platinum.c Wed Jun 24 22:54:05 1998 +++ linux/drivers/macintosh/platinum.c Wed Dec 31 16:00:00 1969 @@ -1,635 +0,0 @@ -/* - * platinum.c: Console support for PowerMac "platinum" display adaptor. - * - * Copyright (C) 1996 Paul Mackerras and Mark Abene. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pmac-cons.h" -#include "platinum.h" -#include - -/* - * Structure of the registers for the DACula colormap device. - */ -struct cmap_regs { - unsigned char addr; - char pad1[15]; - unsigned char d1; - char pad2[15]; - unsigned char d2; - char pad3[15]; - unsigned char lut; - char pad4[15]; -}; - -/* - * Structure of the registers for the "platinum" display adaptor. - */ -#define PAD(x) char x[12] - -struct preg { /* padded register */ - unsigned r; - char pad[12]; -}; - -struct platinum_regs { - struct preg reg[128]; -}; - -static void set_platinum_clock(unsigned char *clksel); -static int read_platinum_sense(void); -static int platinum_vram_reqd(int vmode, int cmode); - -static int total_vram; /* total amount of video memory, bytes */ -static unsigned char *frame_buffer; -static unsigned char *base_frame_buffer; -static struct cmap_regs *cmap_regs; -static volatile struct platinum_regs *plat_regs; - -static unsigned long frame_buffer_phys; -static unsigned long cmap_regs_phys; -static unsigned long plat_regs_phys; - -/* - * Register initialization tables for the platinum display. - * - * It seems that there are two different types of platinum display - * out there. Older ones use the values in clocksel[1], for which - * the formula for the clock frequency seems to be - * F = 14.3MHz * c0 / (c1 & 0x1f) / (1 << (c1 >> 5)) - * Newer ones use the values in clocksel[0], for which the formula - * seems to be - * F = 15MHz * c0 / ((c1 & 0x1f) + 2) / (1 << (c1 >> 5)) - */ -struct plat_regvals { - int fb_offset; - int pitch[3]; - unsigned regs[26]; - unsigned char plat_offset[3]; - unsigned char mode[3]; - unsigned char dacula_ctrl[3]; - unsigned char clocksel[2][2]; -}; - -#define DIV2 0x20 -#define DIV4 0x40 -#define DIV8 0x60 -#define DIV16 0x80 - -/* 1280x1024, 75Hz (20) */ -static struct plat_regvals platinum_reg_init_20 = { - 0x5c00, - { 1312, 2592, 2592 }, - { 0xffc, 4, 0, 0, 0, 0, 0x428, 0, - 0, 0xb3, 0xd3, 0x12, 0x1a5, 0x23, 0x28, 0x2d, - 0x5e, 0x19e, 0x1a4, 0x854, 0x852, 4, 9, 0x50, - 0x850, 0x851 }, { 0x58, 0x5d, 0x5d }, - { 0, 0xff, 0xff }, { 0x51, 0x55, 0x55 }, - {{ 45, 3 }, { 66, 7 }} -}; - -/* 1280x960, 75Hz (19) */ -static struct plat_regvals platinum_reg_init_19 = { - 0x5c00, - { 1312, 2592, 2592 }, - { 0xffc, 4, 0, 0, 0, 0, 0x428, 0, - 0, 0xb2, 0xd2, 0x12, 0x1a3, 0x23, 0x28, 0x2d, - 0x5c, 0x19c, 0x1a2, 0x7d0, 0x7ce, 4, 9, 0x4c, - 0x7cc, 0x7cd }, { 0x56, 0x5b, 0x5b }, - { 0, 0xff, 0xff }, { 0x51, 0x55, 0x55 }, - {{ 42, 3 }, { 44, 5 }} -}; - -/* 1152x870, 75Hz (18) */ -static struct plat_regvals platinum_reg_init_18 = { - 0x11b0, - { 1184, 2336, 4640 }, - { 0xff0, 4, 0, 0, 0, 0, 0x38f, 0, - 0, 0x294, 0x16c, 0x20, 0x2d7, 0x3f, 0x49, 0x53, - 0x82, 0x2c2, 0x2d6, 0x726, 0x724, 4, 9, 0x52, - 0x71e, 0x722 }, { 0x74, 0x7c, 0x81 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 26, 0 + DIV2 }, { 42, 6 }} -}; - -/* 1024x768, 75Hz (17) */ -static struct plat_regvals platinum_reg_init_17 = { - 0x10b0, - { 1056, 2080, 4128 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x254, 0x14b, 0x18, 0x295, 0x2f, 0x32, 0x3b, - 0x80, 0x280, 0x296, 0x648, 0x646, 4, 9, 0x40, - 0x640, 0x644 }, { 0x72, 0x7a, 0x7f }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 54, 3 + DIV2 }, { 67, 12 }} -}; - -/* 1024x768, 75Hz (16) */ -static struct plat_regvals platinum_reg_init_16 = { - 0x10b0, - { 1056, 2080, 4128 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x250, 0x147, 0x17, 0x28f, 0x2f, 0x35, 0x47, - 0x82, 0x282, 0x28e, 0x640, 0x63e, 4, 9, 0x3c, - 0x63c, 0x63d }, { 0x74, 0x7c, 0x81 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 20, 0 + DIV2 }, { 11, 2 }} -}; - -/* 1024x768, 70Hz (15) */ -static struct plat_regvals platinum_reg_init_15 = { - 0x10b0, - { 1056, 2080, 4128 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x254, 0x14b, 0x22, 0x297, 0x43, 0x49, 0x5b, - 0x86, 0x286, 0x296, 0x64c, 0x64a, 0xa, 0xf, 0x44, - 0x644, 0x646 }, { 0x78, 0x80, 0x85 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 19, 0 + DIV2 }, { 110, 21 }} -}; - -/* 1024x768, 60Hz (14) */ -static struct plat_regvals platinum_reg_init_14 = { - 0x10b0, - { 1056, 2080, 4128 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x25a, 0x14f, 0x22, 0x29f, 0x43, 0x49, 0x5b, - 0x8e, 0x28e, 0x29e, 0x64c, 0x64a, 0xa, 0xf, 0x44, - 0x644, 0x646 }, { 0x80, 0x88, 0x8d }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 71, 6 + DIV2 }, { 118, 13 + DIV2 }} -}; - -/* 832x624, 75Hz (13) */ -static struct plat_regvals platinum_reg_init_13 = { - 0x70, - { 864, 1680, 3360 }, /* MacOS does 1680 instead of 1696 to fit 16bpp in 1MB */ - { 0xff0, 4, 0, 0, 0, 0, 0x299, 0, - 0, 0x21e, 0x120, 0x10, 0x23f, 0x1f, 0x25, 0x37, - 0x8a, 0x22a, 0x23e, 0x536, 0x534, 4, 9, 0x52, - 0x532, 0x533 }, { 0x7c, 0x84, 0x89 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 30, 0 + DIV4 }, { 56, 7 + DIV2 }} -}; - -/* 800x600, 75Hz (12) */ -static struct plat_regvals platinum_reg_init_12 = { - 0x1010, - { 832, 1632, 3232 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x1ce, 0x108, 0x14, 0x20f, 0x27, 0x30, 0x39, - 0x72, 0x202, 0x20e, 0x4e2, 0x4e0, 4, 9, 0x2e, - 0x4de, 0x4df }, { 0x64, 0x6c, 0x71 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 122, 7 + DIV4 }, { 62, 9 + DIV2 }} -}; - -/* 800x600, 72Hz (11) */ -static struct plat_regvals platinum_reg_init_11 = { - 0x1010, - { 832, 1632, 3232 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x1ca, 0x104, 0x1e, 0x207, 0x3b, 0x44, 0x4d, - 0x56, 0x1e6, 0x206, 0x534, 0x532, 0xa, 0xe, 0x38, - 0x4e8, 0x4ec }, { 0x48, 0x50, 0x55 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 26, 0 + DIV4 }, { 42, 6 + DIV2 }} -}; - -/* 800x600, 60Hz (10) */ -static struct plat_regvals platinum_reg_init_10 = { - 0x1010, - { 832, 1632, 3232 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x1ce, 0x108, 0x20, 0x20f, 0x3f, 0x45, 0x5d, - 0x66, 0x1f6, 0x20e, 0x4e8, 0x4e6, 6, 0xa, 0x34, - 0x4e4, 0x4e5 }, { 0x58, 0x60, 0x65 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 54, 3 + DIV4 }, { 95, 1 + DIV8 }} -}; - -/* 800x600, 56Hz (9) --unsupported? copy of mode 10 for now... */ -static struct plat_regvals platinum_reg_init_9 = { - 0x1010, - { 832, 1632, 3232 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x1ce, 0x108, 0x20, 0x20f, 0x3f, 0x45, 0x5d, - 0x66, 0x1f6, 0x20e, 0x4e8, 0x4e6, 6, 0xa, 0x34, - 0x4e4, 0x4e5 }, { 0x58, 0x60, 0x65 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 54, 3 + DIV4 }, { 88, 1 + DIV8 }} -}; - -/* 768x576, 50Hz Interlaced-PAL (8) */ -static struct plat_regvals platinum_reg_init_8 = { - 0x1010, - { 800, 1568, 3104 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0xc8, 0xec, 0x11, 0x1d7, 0x22, 0x25, 0x36, - 0x47, 0x1c7, 0x1d6, 0x271, 0x270, 4, 9, 0x27, - 0x267, 0x26b }, { 0x39, 0x41, 0x46 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 31, 0 + DIV16 }, { 74, 9 + DIV8 }} -}; - -/* 640x870, 75Hz Portrait (7) */ -static struct plat_regvals platinum_reg_init_7 = { - 0xb10, - { 672, 1312, 2592 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x176, 0xd0, 0x14, 0x19f, 0x27, 0x2d, 0x3f, - 0x4a, 0x18a, 0x19e, 0x72c, 0x72a, 4, 9, 0x58, - 0x724, 0x72a }, { 0x3c, 0x44, 0x49 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 30, 0 + DIV4 }, { 56, 7 + DIV2 }} -}; - -/* 640x480, 67Hz (6) */ -static struct plat_regvals platinum_reg_init_6 = { - 0x1010, - { 672, 1312, 2592 }, - { 0xff0, 4, 0, 0, 0, 0, 0x209, 0, - 0, 0x18e, 0xd8, 0x10, 0x1af, 0x1f, 0x25, 0x37, - 0x4a, 0x18a, 0x1ae, 0x41a, 0x418, 4, 9, 0x52, - 0x412, 0x416 }, { 0x3c, 0x44, 0x49 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 99, 4 + DIV8 }, { 42, 5 + DIV4 }} -}; - -/* 640x480, 60Hz (5) */ -static struct plat_regvals platinum_reg_init_5 = { - 0x1010, - { 672, 1312, 2592 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x15e, 0xc8, 0x18, 0x18f, 0x2f, 0x35, 0x3e, - 0x42, 0x182, 0x18e, 0x41a, 0x418, 2, 7, 0x44, - 0x404, 0x408 }, { 0x34, 0x3c, 0x41 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 26, 0 + DIV8 }, { 14, 2 + DIV4 }} -}; - -/* 640x480, 60Hz Interlaced-NTSC (4) */ -static struct plat_regvals platinum_reg_init_4 = { - 0x1010, - { 672, 1312, 2592 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0xa5, 0xc3, 0xe, 0x185, 0x1c, 0x1f, 0x30, - 0x37, 0x177, 0x184, 0x20d, 0x20c, 5, 0xb, 0x23, - 0x203, 0x206 }, { 0x29, 0x31, 0x36 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 94, 5 + DIV16 }, { 48, 7 + DIV8 }} -}; - -/* 640x480, 50Hz Interlaced-PAL (3) */ -static struct plat_regvals platinum_reg_init_3 = { - 0x1010, - { 672, 1312, 2592 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0xc8, 0xec, 0x11, 0x1d7, 0x22, 0x25, 0x36, - 0x67, 0x1a7, 0x1d6, 0x271, 0x270, 4, 9, 0x57, - 0x237, 0x26b }, { 0x59, 0x61, 0x66 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 31, 0 + DIV16 }, { 74, 9 + DIV8 }} -}; - -/* 512x384, 60Hz (2) */ -static struct plat_regvals platinum_reg_init_2 = { - 0x1010, - { 544, 1056, 2080 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0x25c, 0x140, 0x10, 0x27f, 0x1f, 0x2b, 0x4f, - 0x68, 0x268, 0x27e, 0x32e, 0x32c, 4, 9, 0x2a, - 0x32a, 0x32b }, { 0x5a, 0x62, 0x67 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 33, 2 + DIV8 }, { 79, 9 + DIV8 }} -}; - -/* 512x384, 60Hz Interlaced-NTSC (1) */ -static struct plat_regvals platinum_reg_init_1 = { - 0x1010, - { 544, 1056, 2080 }, - { 0xff0, 4, 0, 0, 0, 0, 0x320, 0, - 0, 0xa5, 0xc3, 0xe, 0x185, 0x1c, 0x1f, 0x30, - 0x57, 0x157, 0x184, 0x20d, 0x20c, 5, 0xb, 0x53, - 0x1d3, 0x206 }, { 0x49, 0x51, 0x56 }, - { 2, 0, 0xff }, { 0x11, 0x15, 0x19 }, - {{ 94, 5 + DIV16 }, { 48, 7 + DIV8 }} -}; - -static struct plat_regvals *platinum_reg_init[VMODE_MAX] = { - &platinum_reg_init_1, - &platinum_reg_init_2, - &platinum_reg_init_3, - &platinum_reg_init_4, - &platinum_reg_init_5, - &platinum_reg_init_6, - &platinum_reg_init_7, - &platinum_reg_init_8, - &platinum_reg_init_9, - &platinum_reg_init_10, - &platinum_reg_init_11, - &platinum_reg_init_12, - &platinum_reg_init_13, - &platinum_reg_init_14, - &platinum_reg_init_15, - &platinum_reg_init_16, - &platinum_reg_init_17, - &platinum_reg_init_18, - &platinum_reg_init_19, - &platinum_reg_init_20 -}; - -__openfirmware - -/* - * Get the monitor sense value. - */ -static int -read_platinum_sense() -{ - int sense; - - plat_regs->reg[23].r = 7; /* turn off drivers */ - eieio(); __delay(2000); - sense = (~plat_regs->reg[23].r & 7) << 8; - - /* drive each sense line low in turn and collect the other 2 */ - plat_regs->reg[23].r = 3; /* drive A low */ - eieio(); __delay(2000); - sense |= (~plat_regs->reg[23].r & 3) << 4; - eieio(); - plat_regs->reg[23].r = 5; /* drive B low */ - eieio(); __delay(2000); - sense |= (~plat_regs->reg[23].r & 4) << 1; - sense |= (~plat_regs->reg[23].r & 1) << 2; - eieio(); - plat_regs->reg[23].r = 6; /* drive C low */ - eieio(); __delay(2000); - sense |= (~plat_regs->reg[23].r & 6) >> 1; - eieio(); - - plat_regs->reg[23].r = 7; /* turn off drivers */ - return sense; -} - -static inline int platinum_vram_reqd(int vmode, int cmode) -{ - return vmode_attrs[vmode-1].vres - * platinum_reg_init[vmode-1]->pitch[cmode]; -} - -void -map_platinum(struct device_node *dp) -{ - int i, sense; - unsigned long addr, size; - int bank0, bank1, bank2, bank3; - - if (dp->next != 0) - printk("Warning: only using first platinum display device\n"); - if (dp->n_addrs != 2) - panic("expecting 2 addresses for platinum (got %d)", - dp->n_addrs); - - /* Map in frame buffer and registers */ - for (i = 0; i < dp->n_addrs; ++i) { - addr = dp->addrs[i].address; - size = dp->addrs[i].size; - if (size >= 0x400000) { - /* frame buffer - map only 4MB */ - frame_buffer_phys = addr; - frame_buffer = __ioremap(addr, 0x400000, _PAGE_WRITETHRU); - base_frame_buffer = frame_buffer; - } else { - /* registers */ - plat_regs_phys = addr; - plat_regs = ioremap(addr, size); - } - } - cmap_regs_phys = 0xf301b000; /* XXX not in prom? */ - cmap_regs = ioremap(cmap_regs_phys, 0x1000); - - /* Grok total video ram */ - plat_regs->reg[16].r = (unsigned)frame_buffer_phys; - plat_regs->reg[20].r = 0x1011; /* select max vram */ - plat_regs->reg[24].r = 0; /* switch in vram */ - eieio(); - frame_buffer[0x100000] = 0x34; - frame_buffer[0x200000] = 0x56; - frame_buffer[0x300000] = 0x78; - eieio(); - bank0 = 1; /* builtin 1MB vram, always there */ - bank1 = frame_buffer[0x100000] == 0x34; - bank2 = frame_buffer[0x200000] == 0x56; - bank3 = frame_buffer[0x300000] == 0x78; - total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000; - printk("Total VRAM = %dMB\n", total_vram / 1024 / 1024); - - sense = read_platinum_sense(); - if (video_mode == VMODE_NVRAM) { - video_mode = nvram_read_byte(NV_VMODE); - if (video_mode <= 0 || video_mode > VMODE_MAX - || platinum_reg_init[video_mode-1] == 0) - video_mode = VMODE_CHOOSE; - } - if (video_mode == VMODE_CHOOSE) - video_mode = map_monitor_sense(sense); - if (platinum_reg_init[video_mode-1] == 0) - video_mode = VMODE_640_480_60; - printk("Monitor sense value = 0x%x, ", sense); - - if (color_mode == CMODE_NVRAM) - color_mode = nvram_read_byte(NV_CMODE); - if (color_mode < CMODE_8 || color_mode > CMODE_32) - color_mode = CMODE_8; - /* - * Reduce the pixel size if we don't have enough VRAM. - */ - while (color_mode > CMODE_8 - && platinum_vram_reqd(video_mode, color_mode) > total_vram) - --color_mode; - /* - * Reduce the video mode if we don't have enough VRAM. - */ - while (platinum_vram_reqd(video_mode, color_mode) > total_vram) - --video_mode; -} - -#define STORE_D2(a, v) { \ - out_8(&cmap_regs->addr, (a+32)); \ - out_8(&cmap_regs->d2, (v)); \ -} - -static void -set_platinum_clock(unsigned char *clksel) -{ - STORE_D2(6, 0xc6); - out_8(&cmap_regs->addr, 3+32); - if (cmap_regs->d2 == 2) { - STORE_D2(7, clksel[0]); - STORE_D2(8, clksel[1]); - STORE_D2(3, 3); - } else { - STORE_D2(4, clksel[0]); - STORE_D2(5, clksel[1]); - STORE_D2(3, 2); - } - __delay(5000); - STORE_D2(9, 0xa6); -} - -void -platinum_init() -{ - int i, yoff, width, clkmode, dtype; - struct plat_regvals *init; - unsigned *p; - int one_mb = 0; - - if (total_vram == 0x100000) one_mb=1; - - if (video_mode <= 0 || video_mode > VMODE_MAX - || (init = platinum_reg_init[video_mode-1]) == 0) - panic("platinum: video mode %d not supported", video_mode); - - frame_buffer = base_frame_buffer + init->fb_offset; - /* printk("Frame buffer start address is %p\n", frame_buffer); */ - - pixel_size = 1 << color_mode; - line_pitch = init->pitch[color_mode]; - width = vmode_attrs[video_mode-1].hres; - n_scanlines = vmode_attrs[video_mode-1].vres; - row_pitch = line_pitch * 16; - - /* Initialize display timing registers */ - out_be32(&plat_regs->reg[24].r, 7); /* turn display off */ - - for (i = 0; i < 26; ++i) - plat_regs->reg[i+32].r = init->regs[i]; - plat_regs->reg[26+32].r = (one_mb ? init->plat_offset[color_mode] + 4 - color_mode : init->plat_offset[color_mode]); - plat_regs->reg[16].r = (unsigned) frame_buffer_phys + init->fb_offset; - plat_regs->reg[18].r = line_pitch; - plat_regs->reg[19].r = (one_mb ? init->mode[color_mode+1] : init->mode[color_mode]); - plat_regs->reg[20].r = (one_mb ? 0x11 : 0x1011); - plat_regs->reg[21].r = 0x100; - plat_regs->reg[22].r = 1; - plat_regs->reg[23].r = 1; - plat_regs->reg[26].r = 0xc00; - plat_regs->reg[27].r = 0x235; - /* plat_regs->reg[27].r = 0x2aa; */ - - STORE_D2(0, (one_mb ? init->dacula_ctrl[color_mode] & 0xf : init->dacula_ctrl[color_mode])); - STORE_D2(1, 4); - STORE_D2(2, 0); - /* - * Try to determine whether we have an old or a new DACula. - */ - out_8(&cmap_regs->addr, 0x40); - dtype = cmap_regs->d2; - switch (dtype) { - case 0x3c: - clkmode = 1; - break; - case 0x84: - clkmode = 0; - break; - default: - clkmode = 0; - printk("Unknown DACula type: %x\n", cmap_regs->d2); - } - set_platinum_clock(init->clocksel[clkmode]); - - out_be32(&plat_regs->reg[24].r, 0); /* turn display on */ - - pmac_init_palette(); - - yoff = (n_scanlines % 16) / 2; - fb_start = frame_buffer + yoff * line_pitch + 0x10; - - /* Clear screen */ - p = (unsigned *) (frame_buffer + 0x10); - for (i = n_scanlines * line_pitch / sizeof(unsigned); i != 0; --i) - *p++ = 0; - - display_info.height = n_scanlines; - display_info.width = width; - display_info.depth = 8 * pixel_size; - display_info.pitch = line_pitch; - display_info.mode = video_mode; - strncpy(display_info.name, "platinum", sizeof(display_info.name)); - display_info.fb_address = frame_buffer_phys + init->fb_offset + 0x10; - display_info.cmap_adr_address = cmap_regs_phys; - display_info.cmap_data_address = cmap_regs_phys + 0x30; - display_info.disp_reg_address = plat_regs_phys; -} - -int -platinum_setmode(struct vc_mode *mode, int doit) -{ - int cmode; - - if (mode->mode <= 0 || mode->mode > VMODE_MAX - || platinum_reg_init[mode->mode-1] == 0) - return -EINVAL; - if (mode->depth != 8 && mode->depth != 16 && mode->depth != 24 && mode->depth != 32) - return -EINVAL; - - switch (mode->depth) { - case 24: - case 32: - cmode = CMODE_32; - break; - case 16: - cmode = CMODE_16; - break; - case 8: - cmode = CMODE_8; - break; - default: - return -EINVAL; - } - - if (platinum_vram_reqd(mode->mode, cmode) > total_vram) - return -EINVAL; - - if (doit) { - video_mode = mode->mode; - color_mode = cmode; - platinum_init(); - } - return 0; -} - -void -platinum_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - int i; - - for (i = 0; i < ncolors; ++i) { - cmap_regs->addr = index + i; eieio(); - cmap_regs->lut = red[i]; eieio(); - cmap_regs->lut = green[i]; eieio(); - cmap_regs->lut = blue[i]; eieio(); - } -} - -void -platinum_set_blanking(int blank_mode) -{ -} diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/platinum.h linux/drivers/macintosh/platinum.h --- v2.1.114/linux/drivers/macintosh/platinum.h Sat Aug 16 09:53:08 1997 +++ linux/drivers/macintosh/platinum.h Wed Dec 31 16:00:00 1969 @@ -1,17 +0,0 @@ -/* - * Exported procedures for the PowerMac "platinum" display adaptor. - * - * Copyright (C) 1996 Paul Mackerras and Mark Abene. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -extern void map_platinum(struct device_node *); -extern void platinum_init(void); -extern int platinum_setmode(struct vc_mode *mode, int doit); -extern void platinum_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); -extern void platinum_set_blanking(int blank_mode); diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/pmac-cons.c linux/drivers/macintosh/pmac-cons.c --- v2.1.114/linux/drivers/macintosh/pmac-cons.c Wed Jun 24 22:54:05 1998 +++ linux/drivers/macintosh/pmac-cons.c Wed Dec 31 16:00:00 1969 @@ -1,1389 +0,0 @@ -/* - * pmac-cons.c: Console support for PowerMac (PCI-based). - * - * Copyright (C) 1996 Paul Mackerras. - * 7200/Platinum code hacked by Mark Abene. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define INCLUDE_LINUX_LOGO_DATA -#include -#include -#include -#include -#include -#include "../char/console_macros.h" -#include "pmac-cons.h" -#include "control.h" -#include "platinum.h" -#include "valkyrie.h" -#include "chips.h" -#ifdef CONFIG_ATY_VIDEO -#include "aty.h" -#endif -#ifdef CONFIG_IMSTT_VIDEO -#include "imstt.h" -#endif -#include - -int video_mode = VMODE_NVRAM; -int color_mode = CMODE_NVRAM; - -/* - * The format of "screen_info" is strange, and due to early - * i386-setup code. This is just enough to make the console - * code think we're on a EGA+ colour display. - */ -struct screen_info screen_info = { - 0, 0, /* orig-x, orig-y */ - {0, 0}, /* unused1 */ - 0, /* orig-video-page */ - 0, /* orig-video-mode */ - 80, /* orig-video-cols */ - 0, /* unused [short] */ - 0, /* ega_bx */ - 0, /* unused [short] */ - 25, /* orig-video-lines */ - 0, /* isVGA */ - 16 /* video points */ -}; - -/* - * We allocate enough character+attribute memory for the largest - * screen resolution supported. - */ -#define MAX_TEXT_COLS (1280/8) -#define MAX_TEXT_ROWS (1024/16) - -/* - * We get a sense value from the monitor and use it to choose - * what resolution to use. This structure maps sense values - * to display mode values (which determine the resolution and - * frequencies). - */ -struct mon_map { - int sense; - int vmode; -} monitor_map [] = { - {0x000, VMODE_1280_1024_75}, /* 21" RGB */ - {0x114, VMODE_640_870_75P}, /* Portrait Monochrome */ - {0x221, VMODE_512_384_60}, /* 12" RGB*/ - {0x331, VMODE_1280_1024_75}, /* 21" RGB (Radius) */ - {0x334, VMODE_1280_1024_75}, /* 21" mono (Radius) */ - {0x335, VMODE_1280_1024_75}, /* 21" mono */ - {0x40A, VMODE_640_480_60I}, /* NTSC */ - {0x51E, VMODE_640_870_75P}, /* Portrait RGB */ - {0x603, VMODE_832_624_75}, /* 12"-16" multiscan */ - {0x60b, VMODE_1024_768_70}, /* 13"-19" multiscan */ - {0x623, VMODE_1152_870_75}, /* 13"-21" multiscan */ - {0x62b, VMODE_640_480_67}, /* 13"/14" RGB */ - {0x700, VMODE_640_480_50I}, /* PAL */ - {0x714, VMODE_640_480_60I}, /* NTSC */ - {0x717, VMODE_800_600_75}, /* VGA */ - {0x72d, VMODE_832_624_75}, /* 16" RGB (Goldfish) */ - {0x730, VMODE_768_576_50I}, /* PAL (Alternate) */ - {0x73a, VMODE_1152_870_75}, /* 3rd party 19" */ - {0x73f, VMODE_640_480_67}, /* no sense lines connected at all */ - {-1, VMODE_640_480_60}, /* catch-all, must be last */ -}; - -int -map_monitor_sense(int sense) -{ - struct mon_map *map; - - for (map = monitor_map; map->sense >= 0; ++map) - if (map->sense == sense) - break; - return map->vmode; -} - -/* - * Horizontal and vertical resolution for each mode. - */ -struct vmode_attr vmode_attrs[VMODE_MAX] = { - {512, 384, 60, 1}, - {512, 384, 60}, - {640, 480, 50, 1}, - {640, 480, 60, 1}, - {640, 480, 60}, - {640, 480, 67}, - {640, 870, 75}, - {768, 576, 50, 1}, - {800, 600, 56}, - {800, 600, 60}, - {800, 600, 72}, - {800, 600, 75}, - {832, 624, 75}, - {1024, 768, 60}, - {1024, 768, 72}, - {1024, 768, 75}, - {1024, 768, 75}, - {1152, 870, 75}, - {1280, 960, 75}, - {1280, 1024, 75} -}; - -static void invert_cursor(int); -static int map_unknown(struct device_node *); -static void unknown_init(void); -static void unknown_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); - -struct display_interface { - char *name; - void (*map_interface)(struct device_node *); - void (*init_interface)(void); - int (*setmode)(struct vc_mode *, int); - void (*set_palette)(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); - void (*set_blanking)(int blank_mode); -} displays[] = { -#ifdef CONFIG_CONTROL_VIDEO - { "control", map_control_display, control_init, - control_setmode, control_set_palette, control_set_blanking }, -#endif -#ifdef CONFIG_PLATINUM_VIDEO - { "platinum", map_platinum, platinum_init, - platinum_setmode, platinum_set_palette, platinum_set_blanking }, -#endif -#ifdef CONFIG_VALKYRIE_VIDEO - { "valkyrie", map_valkyrie_display, valkyrie_init, - valkyrie_setmode, valkyrie_set_palette, valkyrie_set_blanking }, -#endif -#ifdef CONFIG_CHIPS_VIDEO - { "chips65550", map_chips_display, chips_init, - chips_setmode, chips_set_palette, chips_set_blanking }, -#endif -#ifdef CONFIG_ATY_VIDEO - { "ATY,mach64", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,XCLAIM", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,264VT", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,mach64ii", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,264GT-B", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,mach64_3D_pcc", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,XCLAIM3D", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,XCLAIMVR", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, -#if 0 /* problematic */ - { "ATY,RAGEII_M", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, -#endif - { "ATY,XCLAIMVRPro", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,mach64_3DU", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, - { "ATY,XCLAIM3DPro", map_aty_display, aty_init, - aty_setmode, aty_set_palette, aty_set_blanking }, -#endif -#ifdef CONFIG_IMSTT_VIDEO - { "IMS,tt128mb", map_imstt_display_ibm, imstt_init, - imstt_setmode, imstt_set_palette_ibm, imstt_set_blanking }, - { "IMS,tt128mb8", map_imstt_display_tvp, imstt_init, - imstt_setmode, imstt_set_palette_tvp, imstt_set_blanking }, - { "IMS,tt128mb8A", map_imstt_display_tvp, imstt_init, - imstt_setmode, imstt_set_palette_tvp, imstt_set_blanking }, -#endif - { NULL } -}; - -struct display_interface unknown_display = { - "unknown", NULL, unknown_init, NULL, unknown_set_palette, NULL -}; - -static struct display_interface *current_display; - -static int cursor_pos = -1; -static unsigned *cursor_fb; /* address of cursor pos in frame buffer */ -static unsigned cursor_bits; /* bits changed to turn cursor on */ - -int pixel_size; /* in bytes */ -int n_scanlines; /* # of scan lines */ -int line_pitch; /* # bytes in 1 scan line */ -int row_pitch; /* # bytes in 1 row of characters */ -unsigned char *fb_start; /* addr of top left pixel of top left char */ -struct vc_mode display_info; - -#define cmapsz (16*256) -extern unsigned char vga_font[cmapsz]; - -__openfirmware - -static inline unsigned pixel32(int currcons, int cidx) -{ - cidx *= 3; - return (palette[cidx] << 16) | (palette[cidx + 1] << 8) - | palette[cidx + 2]; -} - -static inline unsigned pixel16(int currcons, int cidx) -{ - unsigned p; - - p = ((cidx << 10) & 0x7c00) + ((cidx << 5) & 0x03e0) - + (cidx & 0x1f); - return (p << 16) | p; -} - -void -__set_origin(unsigned short offset) -{ -} - -static void -invert_cursor(int cpos) -{ - int row, col; - int l, c, nw; - unsigned *fb, mask; - int currcons = fg_console; /* for `color', which is a macro */ - - if (cpos == -1) { - /* turning cursor off */ - fb = cursor_fb; - mask = cursor_bits; - } else { - row = cpos / video_num_columns; - col = cpos - row * video_num_columns; - fb = (unsigned *) (fb_start + row * row_pitch - + col * pixel_size * 8); - switch (color_mode) { - case CMODE_16: - mask = pixel16(currcons, foreground) - ^ pixel16(currcons, background >> 4); - break; - default: - mask = (color ^ (color >> 4)) & 0xf; - mask |= mask << 8; - mask |= mask << 16; - break; - } - cursor_fb = fb; - cursor_bits = mask; - } - nw = pixel_size * 2; /* pixel_size * 8 (char width) / 4 */ - for (l = 0; l < 16; ++l) { - for (c = 0; c < nw; ++c) - fb[c] ^= mask; - fb = (unsigned *) ((char *)fb + line_pitch); - } -} - -void -hide_cursor() -{ - unsigned long flags; - - save_flags(flags); - cli(); - if (cursor_pos != -1) { - invert_cursor(-1); - cursor_pos = -1; - } - restore_flags(flags); -} - -void -set_cursor(int currcons) -{ - unsigned long flags; - int old_cursor; - - if (currcons != fg_console || console_blanked) - return; - - save_flags(flags); - cli(); - if (!deccm) { - hide_cursor(); - } else { - old_cursor = cursor_pos; - cursor_pos = (pos - video_mem_start) >> 1; - if (old_cursor != -1) - invert_cursor(-1); - invert_cursor(cursor_pos); - } - restore_flags(flags); -} - -/* - * NOTE: get_scrmem() and set_scrmem() are here only because - * the VGA version of set_scrmem() has some direct VGA references. - */ -void -get_scrmem(int currcons) -{ - memcpyw((unsigned short *)vc_scrbuf[currcons], - (unsigned short *)origin, video_screen_size); - origin = video_mem_start = (unsigned long)vc_scrbuf[currcons]; - scr_end = video_mem_end = video_mem_start + video_screen_size; - pos = origin + y*video_size_row + (x<<1); -} - -void -set_scrmem(int currcons, long offset) -{ - if (video_mem_term - video_mem_base < offset + video_screen_size) - offset = 0; - memcpyw((unsigned short *)(video_mem_base + offset), - (unsigned short *) origin, video_screen_size); - video_mem_start = video_mem_base; - video_mem_end = video_mem_term; - origin = video_mem_base + offset; - scr_end = origin + video_screen_size; - pos = origin + y*video_size_row + (x<<1); -} - -int -set_get_cmap(unsigned char *p, int set) -{ - int i, j, err; - - err = verify_area(set? VERIFY_READ: VERIFY_WRITE, p, 48); - if (err) - return err; - - for (i = 0; i < 16; ++i) { - if (set) { - get_user(default_red[i], p++); - get_user(default_grn[i], p++); - get_user(default_blu[i], p++); - } else { - put_user(default_red[i], p++); - put_user(default_grn[i], p++); - put_user(default_blu[i], p++); - } - } - - if (set) { - for (j = 0; j < MAX_NR_CONSOLES; ++j) { - if (!vc_cons_allocated(j)) - continue; - for (i = 0; i < 16; ++i) { - vc_cons[j].d->vc_palette[3*i+0] = default_red[i]; - vc_cons[j].d->vc_palette[3*i+1] = default_grn[i]; - vc_cons[j].d->vc_palette[3*i+2] = default_blu[i]; - } - } - set_palette(); - } - - return 0; -} - -int -set_get_font(unsigned char *p, int set, int ch512) -{ - return 0; -} - -void -set_palette() -{ - int i, j, n; - unsigned char red[16], green[16], blue[16]; - - if (console_blanked || current_display == NULL - || current_display->set_palette == NULL - || vt_cons[fg_console]->vc_mode == KD_GRAPHICS) - return; - - for (i = j = 0; i < 16; ++i) { - n = color_table[i] & 0xf; - red[n] = vc_cons[fg_console].d->vc_palette[j++]; - green[n] = vc_cons[fg_console].d->vc_palette[j++]; - blue[n] = vc_cons[fg_console].d->vc_palette[j++]; - } - (*current_display->set_palette)(red, green, blue, 0, 16); -} - -void -pmac_init_palette() -{ - int i, n; - unsigned char red[16], green[16], blue[16]; - - for (i = 0; i < 16; ++i) { - n = color_table[i] & 0xf; - red[n] = default_red[i]; - green[n] = default_grn[i]; - blue[n] = default_blu[i]; - } - (*current_display->set_palette)(red, green, blue, 0, 16); -} - -static int vesa_blanking_mode; -static int vesa_blanked; - -void -vesa_blank() -{ - if (vesa_blanking_mode == 0 || vesa_blanked - || current_display == NULL - || current_display->set_blanking == NULL) - return; - (*current_display->set_blanking)(vesa_blanking_mode); - vesa_blanked = vesa_blanking_mode; -} - -void -vesa_unblank() -{ - if (vesa_blanked == 0 - || current_display == NULL - || current_display->set_blanking == NULL) - return; - (*current_display->set_blanking)(VESA_NO_BLANKING); - vesa_blanked = VESA_NO_BLANKING; -} - -void -set_vesa_blanking(const unsigned long arg) -{ - unsigned char *argp = (unsigned char *)(arg + 1); - unsigned int mode; - - if (verify_area(VERIFY_READ, argp, 1)) - return; - - get_user(mode, argp); - vesa_blanking_mode = (mode <= VESA_POWERDOWN)? mode: \ - DEFAULT_VESA_BLANKING_MODE; -} - -void -vesa_powerdown() -{ - if (vesa_blanked == 0 || vesa_blanked == VESA_POWERDOWN - || current_display == NULL - || current_display->set_blanking == NULL) - return; - (*current_display->set_blanking)(VESA_POWERDOWN); - vesa_blanked = VESA_POWERDOWN; -} - -void -memsetw(unsigned short *p, unsigned short c, unsigned count) -{ - count /= 2; - if ((unsigned long)(p + count) > video_mem_base - && (unsigned long)p < video_mem_term) { - for (; p < (unsigned short *) video_mem_base && count != 0; --count) - *p++ = c; - for (; p < (unsigned short *) video_mem_term && count != 0; --count) { - if (*p != c) { - *p = c; - pmac_blitc(c, (unsigned long)p); - } - ++p; - } - } - for (; count != 0; --count) - *p++ = c; -} - -void -memcpyw(unsigned short *to, unsigned short *from, unsigned count) -{ - unsigned short c; - - count /= 2; - if ((unsigned long)(to + count) > video_mem_base - && (unsigned long)to < video_mem_term) { - for (; to < (unsigned short *) video_mem_base && count != 0; --count) - *to++ = *from++; - for (; to < (unsigned short *) video_mem_term && count != 0; --count) { - c = *from++; - if (*to != c) { - *to = c; - pmac_blitc(c, (unsigned long)to); - } - ++to; - } - } - for (; count != 0; --count) - *to++ = *from++; -} - -void -pmac_find_display() -{ - struct display_interface *disp; - struct device_node *dp; - struct vmode_attr *ap; - - current_display = NULL; - for (disp = displays; disp->name != NULL; ++disp) { - dp = find_devices(disp->name); - if (dp == 0) - continue; - current_display = disp; - disp->map_interface(dp); - break; - } - - if (current_display == NULL) { - /* - * We haven't found a display that we know about, - * but if there is a display with sufficient prom support, - * we may be able to use it in a limited fashion. - * If there is, it has already been opened in prom_init(). - */ - int i; - for (i = 0; i < prom_num_displays; ++i) { - dp = find_path_device(prom_display_paths[i]); - if (dp != 0 && map_unknown(dp)) { - current_display = &unknown_display; - break; - } else { - printk(KERN_INFO "Can't use %s for display\n", - prom_display_paths[i]); - } - } - } - - if (current_display == NULL - || video_mode <= 0 || video_mode > VMODE_MAX) { - printk(KERN_INFO "No usable display device found\n"); - current_display = NULL; - return; - } - ap = &vmode_attrs[video_mode - 1]; - screen_info.orig_video_cols = ap->hres / 8; - screen_info.orig_video_lines = ap->vres / 16; - printk("using video mode %d (%dx%d at %dHz%s), %d bits/pixel\n", - video_mode, ap->hres, ap->vres, ap->vfreq, - ap->interlaced? " interlaced": "", - (color_mode + 1) * 8); -} - -int -pmac_display_supported(const char *name) -{ - struct display_interface *disp; - - for (disp = displays; disp->name != NULL; ++disp) - if (strcmp(name, disp->name) == 0) - return 1; - return 0; -} - -int -console_getmode(struct vc_mode *mode) -{ - *mode = display_info; - return 0; -} - -int -console_setmode(struct vc_mode *mode, int doit) -{ - int err; - - if (current_display == NULL || current_display->setmode == NULL) - return -EINVAL; - err = (*current_display->setmode)(mode, doit); - if (doit && err == 0) - memset((void *)video_mem_base, 0, video_screen_size); - return err; -} - -int -console_setcmap(int n_entries, unsigned char *red, - unsigned char *green, unsigned char *blue) -{ - if (current_display == NULL || current_display->set_palette == NULL) - return -EOPNOTSUPP; - (*current_display->set_palette)(red, green, blue, 0, n_entries); - return 0; -} - -int -console_powermode(int mode) -{ - if (mode == VC_POWERMODE_INQUIRY) - return vesa_blanked; - if (mode < VESA_NO_BLANKING || mode > VESA_POWERDOWN) - return -EINVAL; - if (current_display == NULL || current_display->set_blanking == NULL) - return mode == VESA_NO_BLANKING? 0: -ENXIO; - (*current_display->set_blanking)(mode); - vesa_blanked = mode; - return 0; -} - -void -pmac_vmode_setup(char *str, int *ints) -{ - if (ints[0] >= 1) - video_mode = ints[1]; - if (ints[0] >= 2) - color_mode = ints[2]; -} - -void -con_type_init(const char **type_p) -{ - unsigned long nb = MAX_TEXT_COLS * MAX_TEXT_ROWS * 2; - - if (current_display == NULL) - return; - current_display->init_interface(); - can_do_color = 1; - video_type = VIDEO_TYPE_PMAC; - *type_p = display_info.name; - video_mem_base = (unsigned long) kmalloc(nb, GFP_ATOMIC); - video_mem_term = video_mem_base + nb; - memset((char *) video_mem_base, 0, video_screen_size); -} - -int -con_is_present(void) -{ - return current_display != NULL; -} - -static __inline__ void -draw_logo_8(void) -{ - unsigned char *fb = fb_start; - unsigned char *p = linux_logo; - int yy; - - (*current_display->set_palette) - (linux_logo_red, linux_logo_green, linux_logo_blue, - 32, LINUX_LOGO_COLORS); - - for (yy = 0; yy < LINUX_LOGO_HEIGHT; ++yy) { - memcpy(fb, p, LINUX_LOGO_WIDTH); - fb += line_pitch; - p += LINUX_LOGO_WIDTH; - } -} - -static __inline__ void -draw_logo_15(void) -{ - unsigned short *fb; - unsigned char *row = fb_start; - unsigned char *p = linux_logo; - int i, xx, yy; - unsigned char grey[16]; - - /* - * For 15-bit mode, treat the screen as a 4/4/4 TrueColor. - */ - for (i = 0; i < 16; ++i) - grey[i] = i << 4; - (*current_display->set_palette)(grey, grey, grey, 16, 16); - - for (yy = 0; yy < LINUX_LOGO_HEIGHT; ++yy) { - fb = (unsigned short *) row; - for (xx = 0; xx < LINUX_LOGO_WIDTH; ++xx) { - i = *p++ - 32; - *fb++ = 0x4210 - + ((linux_logo_red[i] & 0xf0) << 6) - + ((linux_logo_green[i] & 0xf0) << 1) - + (linux_logo_blue[i] >> 4); - } - row += line_pitch; - } -} - -static __inline__ void -draw_logo_24(void) -{ - unsigned long *fb; - unsigned char *row = fb_start; - unsigned char *p = linux_logo; - int xx, yy, v; - - (*current_display->set_palette) - (linux_logo_red, linux_logo_green, linux_logo_blue, - 32, LINUX_LOGO_COLORS); - - for (yy = 0; yy < LINUX_LOGO_HEIGHT; ++yy) { - fb = (unsigned long *) row; - for (xx = 0; xx < LINUX_LOGO_WIDTH; ++xx) { - v = *p++; - v |= v << 8; - v |= v << 16; - *fb++ = v; - } - row += line_pitch; - } -} - -void -con_type_init_finish(void) -{ - char *p; - int c; - unsigned short *addr; - char xy[2]; - int currcons = 0; /* for `attr', which is a macro */ - - if (current_display == NULL - || current_display->set_palette == NULL) - return; - - switch (color_mode) { - case CMODE_8: - draw_logo_8(); - break; - - case CMODE_16: - draw_logo_15(); - break; - - case CMODE_32: - draw_logo_24(); - break; - } - xy[0] = 0; - xy[1] = (LINUX_LOGO_HEIGHT + 16) / 16; - putconsxy(0, xy); - - switch (_machine) { - case _MACH_Pmac: - p = "PowerMac/Linux " UTS_RELEASE; - break; - default: - p = "Linux/PPC " UTS_RELEASE; - break; - } - addr = (unsigned short *) video_mem_base + 2 * video_num_columns - + LINUX_LOGO_WIDTH / 8 + 8; - for (; *p; ++p) { - c = (attr << 8) + *p; - scr_writew(c, addr); - ++addr; - } -} - -int -con_adjust_height(unsigned long height) -{ - return -EINVAL; -} - -static unsigned long expand_bits_8[16] = { - 0x00000000, - 0x000000ff, - 0x0000ff00, - 0x0000ffff, - 0x00ff0000, - 0x00ff00ff, - 0x00ffff00, - 0x00ffffff, - 0xff000000, - 0xff0000ff, - 0xff00ff00, - 0xff00ffff, - 0xffff0000, - 0xffff00ff, - 0xffffff00, - 0xffffffff -}; - -static unsigned long expand_bits_16[4] = { - 0x00000000, - 0x0000ffff, - 0xffff0000, - 0xffffffff -}; - -void -pmac_blitc(unsigned charattr, unsigned long addr) -{ - int col, row, fg, bg, l, bits; - unsigned char *fp; - unsigned long *fb; - static int cached_row_start, cached_row_end = -1; - static unsigned char *cached_fb; - static int cached_attr = -1; - static unsigned long cached_fg, cached_bg; - - col = (addr - video_mem_base) / 2; - if (cursor_pos == col) - cursor_pos = -1; - if (!(col >= cached_row_start && col < cached_row_end)) { - row = col / video_num_columns; - cached_row_start = row * video_num_columns; - cached_row_end = cached_row_start + video_num_columns; - cached_fb = fb_start + row * row_pitch; - } - fb = (unsigned long *) - (cached_fb + (col - cached_row_start) * pixel_size * 8); - - if ((charattr & 0xff00) != cached_attr) { - fg = (charattr >> 8) & 0xf; - bg = (charattr >> 12) & 0xf; - switch (color_mode) { - case CMODE_16: - fg = pixel16(fg_console, fg); - bg = pixel16(fg_console, bg); - break; - default: - fg += fg << 8; - fg += fg << 16; - bg += bg << 8; - bg += bg << 16; - } - fg ^= bg; - cached_fg = fg; - cached_bg = bg; - } else { - fg = cached_fg; - bg = cached_bg; - } - - fp = &vga_font[(charattr & 0xff) * 16]; - switch (color_mode) { - case CMODE_32: - for (l = 0; l < 16; ++l) { - bits = *fp++; - fb[0] = (-(bits >> 7) & fg) ^ bg; - fb[1] = (-((bits >> 6) & 1) & fg) ^ bg; - fb[2] = (-((bits >> 5) & 1) & fg) ^ bg; - fb[3] = (-((bits >> 4) & 1) & fg) ^ bg; - fb[4] = (-((bits >> 3) & 1) & fg) ^ bg; - fb[5] = (-((bits >> 2) & 1) & fg) ^ bg; - fb[6] = (-((bits >> 1) & 1) & fg) ^ bg; - fb[7] = (-(bits & 1) & fg) ^ bg; - fb = (unsigned long *) ((char *)fb + line_pitch); - } - break; - case CMODE_16: - for (l = 0; l < 16; ++l) { - bits = *fp++; - fb[0] = (expand_bits_16[bits >> 6] & fg) ^ bg; - fb[1] = (expand_bits_16[(bits >> 4) & 3] & fg) ^ bg; - fb[2] = (expand_bits_16[(bits >> 2) & 3] & fg) ^ bg; - fb[3] = (expand_bits_16[bits & 3] & fg) ^ bg; - fb = (unsigned long *) ((char *)fb + line_pitch); - } - break; - default: - for (l = 0; l < 16; ++l) { - bits = *fp++; - fb[0] = (expand_bits_8[bits >> 4] & fg) ^ bg; - fb[1] = (expand_bits_8[bits & 0xf] & fg) ^ bg; - fb = (unsigned long *) ((char *)fb + line_pitch); - } - } -} - - -/* - * The following provides a very basic screen driver for displays - * that we basically don't know anything about, but which we can - * initialize by using their Open Firmware "open" method. - */ - -static int unknown_modes[] = { - VMODE_512_384_60, - VMODE_640_480_60, - VMODE_800_600_60, - VMODE_832_624_75, - VMODE_1024_768_60, - VMODE_1152_870_75, - VMODE_1280_960_75, - VMODE_1280_1024_75, - 0 -}; - -static unsigned char *frame_buffer; -static unsigned char *unknown_cmap_adr; -static volatile unsigned char *unknown_cmap_data; -static unsigned long frame_buffer_phys; - -static int map_unknown(struct device_node *dp) -{ - int i, mode; - int width; - int *pp, len; - unsigned *up, address; - - printk("map_unknown(%p), name = %s\n", dp, dp->full_name); - - /* check the depth */ - if ((pp = (int *) get_property(dp, "depth", &len)) != NULL - && len == sizeof(int) && *pp != 8) { - printk("%s: can't use depth = %d\n", dp->full_name, *pp); - return 0; - } - - width = 640; /* default values */ - n_scanlines = 480; - if ((pp = (int *) get_property(dp, "width", &len)) != NULL - && len == sizeof(int)) - width = *pp; - if ((pp = (int *) get_property(dp, "height", &len)) != NULL - && len == sizeof(int)) - n_scanlines = *pp; - line_pitch = width; - if ((pp = (int *) get_property(dp, "linebytes", &len)) != NULL - && len == sizeof(int)) - line_pitch = *pp; - printk(KERN_INFO "width=%d height=%d pitch=%d\n", - width, n_scanlines, line_pitch); - - len = n_scanlines * line_pitch; - if ((up = (unsigned *) get_property(dp, "address", &len)) != NULL - && len == sizeof(unsigned)) { - address = *up; - } else { - for (i = 0; i < dp->n_addrs; ++i) - if (dp->addrs[i].size >= len) - break; - if (i >= dp->n_addrs) { - printk("no framebuffer address found for %s\n", - dp->full_name); - return 0; - } - address = dp->addrs[i].address; - } - printk(KERN_INFO "%s: using address %x\n", dp->full_name, address); - frame_buffer_phys = address; - frame_buffer = __ioremap(frame_buffer_phys, len, _PAGE_WRITETHRU); - - video_mode = 0; - color_mode = CMODE_8; - pixel_size = 1; - - for (i = 0; (mode = unknown_modes[i]) != 0; ++i) { - if (vmode_attrs[mode-1].hres <= width - && vmode_attrs[mode-1].vres <= n_scanlines) - video_mode = mode; - } - if (video_mode == 0) { - printk(KERN_INFO "%s: no mode found for %d x %d\n", - dp->full_name, width, n_scanlines); - return 0; - } - - display_info.height = n_scanlines; - display_info.width = width; - display_info.depth = 8; - display_info.pitch = line_pitch; - display_info.mode = video_mode; - strncpy(display_info.name, dp->name, sizeof(display_info.name)); - display_info.fb_address = frame_buffer_phys; - display_info.cmap_adr_address = 0; - display_info.cmap_data_address = 0; - unknown_cmap_adr = 0; - /* XXX kludge for ati */ - if (strncmp(dp->name, "ATY,", 4) == 0) { - display_info.disp_reg_address = frame_buffer_phys + 0x7ffc00; - display_info.cmap_adr_address = frame_buffer_phys + 0x7ffcc0; - display_info.cmap_data_address = frame_buffer_phys + 0x7ffcc1; - unknown_cmap_adr = ioremap(address + 0x7ff000, 0x1000) + 0xcc0; - unknown_cmap_data = unknown_cmap_adr + 1; - } - - return 1; -} - -static void -unknown_init() -{ - unsigned *p; - int i; - - row_pitch = line_pitch * 16; - fb_start = frame_buffer; - - /* Clear screen */ - p = (unsigned *) frame_buffer; - for (i = n_scanlines * line_pitch / sizeof(unsigned); i != 0; --i) - *p++ = 0; -} - -static void -unknown_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - volatile unsigned char *a, *d; - int i; - - if (unknown_cmap_adr == 0) - return; - a = unknown_cmap_adr; - d = unknown_cmap_data; - for (i = 0; i < ncolors; ++i) { - *a = index + i; eieio(); - *d = red[i]; eieio(); - *d = green[i]; eieio(); - *d = blue[i]; eieio(); - } -} - - -unsigned char vga_font[cmapsz] = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, -0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff, -0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, -0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, -0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, -0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, -0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, -0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, -0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e, -0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, -0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, -0x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, -0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e, -0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, -0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb, -0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, -0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, -0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, -0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, -0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, -0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, -0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, -0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, -0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, -0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, -0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, -0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, -0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, -0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, -0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, -0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, -0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, -0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, -0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, -0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, -0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, -0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde, -0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, -0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, -0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c, -0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, -0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, -0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, -0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, -0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7, -0xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, -0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, -0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, -0x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, -0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, -0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, -0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, -0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, -0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, -0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, -0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, -0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, -0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, -0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60, -0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, -0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, -0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60, -0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, -0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60, -0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb, -0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, -0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, -0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, -0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, -0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, -0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, -0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18, -0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, -0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, -0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, -0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, -0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, -0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, -0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, -0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, -0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, -0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06, -0x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, -0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, -0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, -0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, -0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, -0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, -0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, -0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, -0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, -0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c, -0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00, -0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, -0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, -0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, -0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, -0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, -0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, -0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, -0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, -0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, -0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18, -0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, -0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00, -0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, -0xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, -0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, -0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, -0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, -0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, -0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, -0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, -0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, -0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06, -0x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, -0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, -0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, -0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44, -0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, -0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, -0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, -0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, -0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, -0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, -0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, -0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, -0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, -0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, -0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, -0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, -0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, -0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, -0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, -0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, -0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, -0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, -0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, -0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, -0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, -0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, -0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, -0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, -0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, -0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -}; diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/pmac-cons.h linux/drivers/macintosh/pmac-cons.h --- v2.1.114/linux/drivers/macintosh/pmac-cons.h Mon Jan 12 15:18:14 1998 +++ linux/drivers/macintosh/pmac-cons.h Wed Dec 31 16:00:00 1969 @@ -1,88 +0,0 @@ -/* - * Definitions for display drivers for console use on PowerMacs. - * - * Copyright (C) 1997 Paul Mackerras. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -/* - * Video mode values. - * These are supposed to be the same as the values that - * Apple uses in MacOS. - */ -#define VMODE_NVRAM 0 /* use value stored in nvram */ -#define VMODE_512_384_60I 1 /* 512x384, 60Hz interlaced (NTSC) */ -#define VMODE_512_384_60 2 /* 512x384, 60Hz */ -#define VMODE_640_480_50I 3 /* 640x480, 50Hz interlaced (PAL) */ -#define VMODE_640_480_60I 4 /* 640x480, 60Hz interlaced (NTSC) */ -#define VMODE_640_480_60 5 /* 640x480, 60Hz (VGA) */ -#define VMODE_640_480_67 6 /* 640x480, 67Hz */ -#define VMODE_640_870_75P 7 /* 640x870, 75Hz (portrait) */ -#define VMODE_768_576_50I 8 /* 768x576, 50Hz (PAL full frame) */ -#define VMODE_800_600_56 9 /* 800x600, 56Hz */ -#define VMODE_800_600_60 10 /* 800x600, 60Hz */ -#define VMODE_800_600_72 11 /* 800x600, 72Hz */ -#define VMODE_800_600_75 12 /* 800x600, 75Hz */ -#define VMODE_832_624_75 13 /* 832x624, 75Hz */ -#define VMODE_1024_768_60 14 /* 1024x768, 60Hz */ -#define VMODE_1024_768_70 15 /* 1024x768, 70Hz (or 72Hz?) */ -#define VMODE_1024_768_75V 16 /* 1024x768, 75Hz (VESA) */ -#define VMODE_1024_768_75 17 /* 1024x768, 75Hz */ -#define VMODE_1152_870_75 18 /* 1152x870, 75Hz */ -#define VMODE_1280_960_75 19 /* 1280x960, 75Hz */ -#define VMODE_1280_1024_75 20 /* 1280x1024, 75Hz */ -#define VMODE_MAX 20 -#define VMODE_CHOOSE 99 /* choose based on monitor sense */ - -/* - * Color mode values, used to select number of bits/pixel. - */ -#define CMODE_NVRAM -1 /* use value stored in nvram */ -#define CMODE_8 0 /* 8 bits/pixel */ -#define CMODE_16 1 /* 16 (actually 15) bits/pixel */ -#define CMODE_32 2 /* 32 (actually 24) bits/pixel */ - -extern int video_mode; -extern int color_mode; - -/* - * Addresses in NVRAM where video mode and pixel size are stored. - */ -#define NV_VMODE 0x140f -#define NV_CMODE 0x1410 - -/* - * Horizontal and vertical resolution information. - */ -extern struct vmode_attr { - int hres; - int vres; - int vfreq; - int interlaced; -} vmode_attrs[VMODE_MAX]; - -extern struct vc_mode display_info; - -#define DEFAULT_VESA_BLANKING_MODE VESA_NO_BLANKING - -extern int pixel_size; /* in bytes */ -extern int n_scanlines; /* # of scan lines */ -extern int line_pitch; /* # bytes in 1 scan line */ -extern int row_pitch; /* # bytes in 1 row of characters */ -extern unsigned char *fb_start; /* addr of top left pixel of top left char */ - -/* map monitor sense value to video mode */ -extern int map_monitor_sense(int sense); - -void set_palette(void); -void pmac_find_display(void); -void vesa_blank(void); -void vesa_unblank(void); -void set_vesa_blanking(const unsigned long); -void vesa_powerdown(void); -void hide_cursor(void); -void pmac_init_palette(void); diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/valkyrie.c linux/drivers/macintosh/valkyrie.c --- v2.1.114/linux/drivers/macintosh/valkyrie.c Wed Jun 24 22:54:05 1998 +++ linux/drivers/macintosh/valkyrie.c Wed Dec 31 16:00:00 1969 @@ -1,334 +0,0 @@ -/* - * valkyrie.c: Console support for PowerMac "valkyrie" display adaptor. - * - * Copyright (C) 1997 Paul Mackerras. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pmac-cons.h" -#include "valkyrie.h" -#include - -/* - * Structure of the registers for the Valkyrie colormap registers. - */ -struct cmap_regs { - unsigned char addr; - char pad1[7]; - unsigned char lut; -}; - -/* - * Structure of the registers for the "valkyrie" display adaptor. - */ -#define PAD(x) char x[7] - -struct valkyrie_regs { - unsigned char mode; - PAD(pad0); - unsigned char depth; - PAD(pad1); - unsigned char status; - PAD(pad2); - unsigned char reg3; - PAD(pad3); - unsigned char intr; - PAD(pad4); - unsigned char reg5; - PAD(pad5); - unsigned char intr_enb; - PAD(pad6); - unsigned char msense; - PAD(pad7); -}; - -static void set_valkyrie_clock(unsigned char *params); -static int read_valkyrie_sense(void); - -static unsigned char *frame_buffer; -static struct cmap_regs *cmap_regs; -static struct valkyrie_regs *disp_regs; - -static unsigned long frame_buffer_phys; -static unsigned long disp_regs_phys; -static unsigned long cmap_regs_phys; - -/* - * Register initialization tables for the valkyrie display. - * - * Dot clock rate is - * 3.9064MHz * 2**clock_params[2] * clock_params[1] / clock_params[0]. - */ -struct valkyrie_regvals { - unsigned char mode; - unsigned char clock_params[3]; - int pitch[2]; /* bytes/line, indexed by color_mode */ -}; - -/* Register values for 1024x768, 72Hz mode (15) */ -static struct valkyrie_regvals valkyrie_reg_init_15 = { - 15, - { 12, 30, 3 }, /* pixel clock = 78.12MHz for V=72.12Hz */ - { 1024, 0 } -}; - -/* Register values for 1024x768, 60Hz mode (14) */ -static struct valkyrie_regvals valkyrie_reg_init_14 = { - 14, - { 15, 31, 3 }, /* pixel clock = 64.58MHz for V=59.62Hz */ - { 1024, 0 } -}; - -/* Register values for 832x624, 75Hz mode (13) */ -static struct valkyrie_regvals valkyrie_reg_init_13 = { - 9, - { 23, 42, 3 }, /* pixel clock = 57.07MHz for V=74.27Hz */ - { 832, 0 } -}; - -/* Register values for 800x600, 72Hz mode (11) */ -static struct valkyrie_regvals valkyrie_reg_init_11 = { - 13, - { 17, 27, 3 }, /* pixel clock = 49.63MHz for V=71.66Hz */ - { 800, 0 } -}; - -/* Register values for 800x600, 60Hz mode (10) */ -static struct valkyrie_regvals valkyrie_reg_init_10 = { - 12, - { 20, 53, 2 }, /* pixel clock = 41.41MHz for V=59.78Hz */ - { 800, 0 } -}; - -/* Register values for 640x480, 67Hz mode (6) */ -static struct valkyrie_regvals valkyrie_reg_init_6 = { - 6, - { 14, 27, 2 }, /* pixel clock = 30.13MHz for V=66.43Hz */ - { 640, 1280 } -}; - -/* Register values for 640x480, 60Hz mode (5) */ -static struct valkyrie_regvals valkyrie_reg_init_5 = { - 11, - { 23, 37, 2 }, /* pixel clock = 25.14MHz for V=59.85Hz */ - { 640, 1280 } -}; - -static struct valkyrie_regvals *valkyrie_reg_init[20] = { - NULL, NULL, NULL, NULL, - &valkyrie_reg_init_5, - &valkyrie_reg_init_6, - NULL, NULL, NULL, - &valkyrie_reg_init_10, - &valkyrie_reg_init_11, - NULL, - &valkyrie_reg_init_13, - &valkyrie_reg_init_14, - &valkyrie_reg_init_15, - NULL, NULL, NULL, NULL, NULL -}; - -__openfirmware - -/* - * Get the monitor sense value. - */ -static int -read_valkyrie_sense() -{ - int sense; - - out_8(&disp_regs->msense, 0); /* release all lines */ - __delay(20000); - sense = (in_8(&disp_regs->msense) & 0x70) << 4; - - /* drive each sense line low in turn and collect the other 2 */ - out_8(&disp_regs->msense, 4); /* drive A low */ - __delay(20000); - sense |= in_8(&disp_regs->msense) & 0x30; - out_8(&disp_regs->msense, 2); /* drive B low */ - __delay(20000); - sense |= ((in_8(&disp_regs->msense) & 0x40) >> 3) - | ((in_8(&disp_regs->msense) & 0x10) >> 2); - out_8(&disp_regs->msense, 1); /* drive C low */ - __delay(20000); - sense |= (in_8(&disp_regs->msense) & 0x60) >> 5; - - out_8(&disp_regs->msense, 0); - return sense; -} - -void -map_valkyrie_display(struct device_node *dp) -{ - int sense; - unsigned long addr; - - if (dp->next != 0) - printk("Warning: only using first valkyrie display device\n"); - if (dp->n_addrs != 1) - panic("expecting 1 address for valkyrie (got %d)", dp->n_addrs); - - /* Map in frame buffer and registers */ - addr = dp->addrs[0].address; - frame_buffer_phys = addr; - frame_buffer = __ioremap(addr, 0x100000, _PAGE_WRITETHRU); - disp_regs_phys = addr + 0x30a000; - disp_regs = ioremap(disp_regs_phys, 4096); - cmap_regs_phys = addr + 0x304000; - cmap_regs = ioremap(cmap_regs_phys, 4096); - - /* Read the monitor sense value and choose the video mode */ - sense = read_valkyrie_sense(); - if (video_mode == VMODE_NVRAM) { - video_mode = nvram_read_byte(NV_VMODE); - if (video_mode <= 0 || video_mode > VMODE_MAX - || valkyrie_reg_init[video_mode-1] == 0) - video_mode = VMODE_CHOOSE; - } - if (video_mode == VMODE_CHOOSE) - video_mode = map_monitor_sense(sense); - if (valkyrie_reg_init[video_mode-1] == 0) - video_mode = VMODE_640_480_60; - - /* - * Reduce the pixel size if we don't have enough VRAM. - */ - if (color_mode == CMODE_NVRAM) - color_mode = nvram_read_byte(NV_CMODE); - if (color_mode < CMODE_8 || color_mode > CMODE_16 - || valkyrie_reg_init[video_mode-1]->pitch[color_mode] == 0) - color_mode = CMODE_8; - - printk("Monitor sense value = 0x%x, ", sense); -} - -static void -set_valkyrie_clock(unsigned char *params) -{ - struct adb_request req; - int i; - - for (i = 0; i < 3; ++i) { - cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC, - 0x50, i + 1, params[i]); - while (!req.complete) - cuda_poll(); - } -} - -void -valkyrie_init() -{ - int i, yoff, hres; - unsigned *p; - struct valkyrie_regvals *init; - - if (video_mode <= 0 || video_mode > VMODE_MAX - || (init = valkyrie_reg_init[video_mode-1]) == 0) - panic("valkyrie: display mode %d not supported", video_mode); - n_scanlines = vmode_attrs[video_mode-1].vres; - hres = vmode_attrs[video_mode-1].hres; - pixel_size = 1 << color_mode; - line_pitch = init->pitch[color_mode]; - row_pitch = line_pitch * 16; - - /* Reset the valkyrie */ - out_8(&disp_regs->status, 0); - udelay(100); - - /* Initialize display timing registers */ - out_8(&disp_regs->mode, init->mode | 0x80); - out_8(&disp_regs->depth, color_mode + 3); - set_valkyrie_clock(init->clock_params); - udelay(100); - - pmac_init_palette(); /* Initialize colormap */ - - /* Turn on display */ - out_8(&disp_regs->mode, init->mode); - - yoff = (n_scanlines % 16) / 2; - fb_start = frame_buffer + yoff * line_pitch + 0x1000; - - /* Clear screen */ - p = (unsigned *) (frame_buffer + 0x1000); - for (i = n_scanlines * line_pitch / sizeof(unsigned); i != 0; --i) - *p++ = 0; - - display_info.height = n_scanlines; - display_info.width = hres; - display_info.depth = pixel_size * 8; - display_info.pitch = line_pitch; - display_info.mode = video_mode; - strncpy(display_info.name, "valkyrie", sizeof(display_info.name)); - display_info.fb_address = frame_buffer_phys + 0x1000; - display_info.cmap_adr_address = cmap_regs_phys; - display_info.cmap_data_address = cmap_regs_phys + 8; - display_info.disp_reg_address = disp_regs_phys; -} - -int -valkyrie_setmode(struct vc_mode *mode, int doit) -{ - int cmode; - - switch (mode->depth) { - case 16: - cmode = CMODE_16; - break; - case 8: - case 0: /* (default) */ - cmode = CMODE_8; - break; - default: - return -EINVAL; - } - if (mode->mode <= 0 || mode->mode > VMODE_MAX - || valkyrie_reg_init[mode->mode-1] == 0 - || valkyrie_reg_init[mode->mode-1]->pitch[cmode] == 0) - return -EINVAL; - if (doit) { - video_mode = mode->mode; - color_mode = cmode; - valkyrie_init(); - } - return 0; -} - -void -valkyrie_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors) -{ - int i; - - for (i = 0; i < ncolors; ++i) { - out_8(&cmap_regs->addr, index + i); - udelay(1); - out_8(&cmap_regs->lut, red[i]); - out_8(&cmap_regs->lut, green[i]); - out_8(&cmap_regs->lut, blue[i]); - } -} - -void -valkyrie_set_blanking(int blank_mode) -{ - /* don't know how to do this yet */ -} diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/valkyrie.h linux/drivers/macintosh/valkyrie.h --- v2.1.114/linux/drivers/macintosh/valkyrie.h Sat Aug 16 09:53:08 1997 +++ linux/drivers/macintosh/valkyrie.h Wed Dec 31 16:00:00 1969 @@ -1,17 +0,0 @@ -/* - * Exported procedures for the "valkyrie" display driver on PowerMacs. - * - * Copyright (C) 1997 Paul Mackerras. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -extern void map_valkyrie_display(struct device_node *); -extern void valkyrie_init(void); -extern int valkyrie_setmode(struct vc_mode *mode, int doit); -extern void valkyrie_set_palette(unsigned char red[], unsigned char green[], - unsigned char blue[], int index, int ncolors); -extern void valkyrie_set_blanking(int blank_mode); diff -u --recursive --new-file v2.1.114/linux/drivers/macintosh/via-pmu.c linux/drivers/macintosh/via-pmu.c --- v2.1.114/linux/drivers/macintosh/via-pmu.c Fri May 8 23:14:47 1998 +++ linux/drivers/macintosh/via-pmu.c Tue Aug 4 23:57:51 1998 @@ -11,11 +11,16 @@ * Copyright (C) 1998 Paul Mackerras and Fabio Riccardi. */ #include +#include #include #include #include #include #include +#include +#include +#include +#include #include #include #include @@ -24,6 +29,10 @@ #include #include #include +#include + +/* Misc minor number allocated for /dev/pmu */ +#define PMU_MINOR 154 static volatile unsigned char *via; @@ -82,6 +91,9 @@ static struct adb_request bright_req_1, bright_req_2; static struct device_node *vias; +int asleep; +struct notifier_block *sleep_notifier_list; + static int init_pmu(void); static int pmu_queue_request(struct adb_request *req); static void pmu_start(void); @@ -593,6 +605,7 @@ { static int show_pmu_ints = 1; + asleep = 0; if (len < 1) { adb_int_pending = 0; return; @@ -663,17 +676,243 @@ set_brightness(int level) { backlight_bright = LEVEL_TO_BRIGHT(level); + if (!backlight_enabled) + return; if (bright_req_1.complete) pmu_request(&bright_req_1, NULL, 2, PMU_BACKLIGHT_BRIGHT, backlight_bright); - if (bright_req_2.complete) { - backlight_enabled = backlight_bright < 0x7f; + if (bright_req_2.complete) pmu_request(&bright_req_2, NULL, 2, PMU_BACKLIGHT_CTRL, - backlight_enabled? 0x81: 1); - } + backlight_bright < 0x7f? 0x81: 1); } static void set_volume(int level) { } + +#ifdef CONFIG_PMAC_PBOOK + +/* + * This struct is used to store config register values for + * PCI devices which may get powered off when we sleep. + */ +static struct pci_save { + u16 command; + u16 cache_lat; + u16 intr; +} *pbook_pci_saves; +static int n_pbook_pci_saves; + +static inline void +pbook_pci_save(void) +{ + int npci; + struct pci_dev *pd; + struct pci_save *ps; + + npci = 0; + for (pd = pci_devices; pd != NULL; pd = pd->next) + ++npci; + n_pbook_pci_saves = npci; + if (npci == 0) + return; + ps = (struct pci_save *) kmalloc(npci * sizeof(*ps), GFP_KERNEL); + pbook_pci_saves = ps; + if (ps == NULL) + return; + + for (pd = pci_devices; pd != NULL && npci != 0; pd = pd->next) { + pci_read_config_word(pd, PCI_COMMAND, &ps->command); + pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat); + pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr); + ++ps; + --npci; + } +} + +static inline void +pbook_pci_restore(void) +{ + u16 cmd; + struct pci_save *ps = pbook_pci_saves; + struct pci_dev *pd; + int j; + + for (pd = pci_devices; pd != NULL; pd = pd->next, ++ps) { + if (ps->command == 0) + continue; + pci_read_config_word(pd, PCI_COMMAND, &cmd); + if ((ps->command & ~cmd) == 0) + continue; + switch (pd->hdr_type) { + case PCI_HEADER_TYPE_NORMAL: + for (j = 0; j < 6; ++j) + pci_write_config_dword(pd, + PCI_BASE_ADDRESS_0 + j*4, + pd->base_address[j]); + pci_write_config_dword(pd, PCI_ROM_ADDRESS, + pd->rom_address); + pci_write_config_word(pd, PCI_CACHE_LINE_SIZE, + ps->cache_lat); + pci_write_config_word(pd, PCI_INTERRUPT_LINE, + ps->intr); + pci_write_config_word(pd, PCI_COMMAND, ps->command); + break; + /* other header types not restored at present */ + } + } +} + +/* + * Put the powerbook to sleep. + */ +#define IRQ_ENABLE ((unsigned int *)0xf3000024) +#define MEM_CTRL ((unsigned int *)0xf8000070) + +int powerbook_sleep(void) +{ + int ret, i, x; + static int save_backlight; + static unsigned int save_irqen; + unsigned long msr; + unsigned int hid0; + unsigned long p, wait; + struct adb_request sleep_req; + + /* Notify device drivers */ + ret = notifier_call_chain(&sleep_notifier_list, PBOOK_SLEEP, NULL); + if (ret & NOTIFY_STOP_MASK) + return -EBUSY; + + /* Sync the disks. */ + /* XXX It would be nice to have some way to ensure that + * nobody is dirtying any new buffers while we wait. */ + fsync_dev(0); + + /* Turn off the display backlight */ + save_backlight = backlight_enabled; + if (save_backlight) + pmu_enable_backlight(0); + + /* Give the disks a little time to actually finish writing */ + for (wait = jiffies + (HZ/4); jiffies < wait; ) + mb(); + + /* Disable all interrupts except pmu */ + save_irqen = in_le32(IRQ_ENABLE); + for (i = 0; i < 32; ++i) + if (i != vias->intrs[0].line && (save_irqen & (1 << i))) + disable_irq(i); + asm volatile("mtdec %0" : : "r" (0x7fffffff)); + + /* Save the state of PCI config space for some slots */ + pbook_pci_save(); + + /* Set the memory controller to keep the memory refreshed + while we're asleep */ + for (i = 0x403f; i >= 0x4000; --i) { + out_be32(MEM_CTRL, i); + do { + x = (in_be32(MEM_CTRL) >> 16) & 0x3ff; + } while (x == 0); + if (x >= 0x100) + break; + } + + /* Ask the PMU to put us to sleep */ + pmu_request(&sleep_req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T'); + while (!sleep_req.complete) + mb(); + /* displacement-flush the L2 cache - necessary? */ + for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000) + i = *(volatile int *)p; + asleep = 1; + + /* Put the CPU into sleep mode */ + asm volatile("mfspr %0,1008" : "=r" (hid0) :); + hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP; + asm volatile("mtspr 1008,%0" : : "r" (hid0)); + save_flags(msr); + msr |= MSR_POW | MSR_EE; + restore_flags(msr); + udelay(10); + + /* OK, we're awake again, start restoring things */ + out_be32(MEM_CTRL, 0x3f); + pbook_pci_restore(); + + /* wait for the PMU interrupt sequence to complete */ + while (asleep) + mb(); + + /* reenable interrupts */ + for (i = 0; i < 32; ++i) + if (i != vias->intrs[0].line && (save_irqen & (1 << i))) + enable_irq(i); + + /* Notify drivers */ + notifier_call_chain(&sleep_notifier_list, PBOOK_WAKE, NULL); + + /* reenable ADB autopoll */ + pmu_adb_autopoll(1); + + /* Turn on the screen backlight, if it was on before */ + if (save_backlight) + pmu_enable_backlight(1); + + return 0; +} + +/* + * Support for /dev/pmu device + */ +static int pmu_open(struct inode *inode, struct file *file) +{ + return 0; +} + +static ssize_t pmu_read(struct file *file, char *buf, + size_t count, loff_t *ppos) +{ + return 0; +} + +static ssize_t pmu_write(struct file *file, const char *buf, + size_t count, loff_t *ppos) +{ + return 0; +} + +static int pmu_ioctl(struct inode * inode, struct file *filp, + u_int cmd, u_long arg) +{ + switch (cmd) { + case PMU_IOC_SLEEP: + return powerbook_sleep(); + } + return -EINVAL; +} + +static struct file_operations pmu_device_fops = { + NULL, /* no seek */ + pmu_read, + pmu_write, + NULL, /* no readdir */ + NULL, /* no poll yet */ + pmu_ioctl, + NULL, /* no mmap */ + pmu_open, + NULL /* no release */ +}; + +static struct miscdevice pmu_device = { + PMU_MINOR, "pmu", &pmu_device_fops +}; + +void pmu_device_init(void) +{ + if (via) + misc_register(&pmu_device); +} +#endif /* CONFIG_PMAC_PBOOK */ diff -u --recursive --new-file v2.1.114/linux/drivers/misc/parport_ax.c linux/drivers/misc/parport_ax.c --- v2.1.114/linux/drivers/misc/parport_ax.c Tue Jul 21 00:15:31 1998 +++ linux/drivers/misc/parport_ax.c Tue Aug 4 16:49:19 1998 @@ -1,4 +1,4 @@ -/* $Id: parport_ax.c,v 1.5 1998/01/10 18:28:39 ecd Exp $ +/* $Id: parport_ax.c,v 1.12 1998/07/26 03:03:31 davem Exp $ * Parallel-port routines for Sun Ultra/AX architecture * * Author: Eddie C. Dost @@ -27,6 +27,7 @@ #include #include #include +#include /* @@ -79,6 +80,8 @@ return inb(p->base + EPPADDR); } +int parport_ax_epp_clear_timeout(struct parport *pb); + int parport_ax_check_epp_timeout(struct parport *p) { @@ -364,6 +367,26 @@ * MODE detection section: */ +/* + * Clear TIMEOUT BIT in EPP MODE + */ +int parport_ax_epp_clear_timeout(struct parport *pb) +{ + unsigned char r; + + if (!(parport_ax_read_status(pb) & 0x01)) + return 1; + + /* To clear timeout some chips require double read */ + parport_ax_read_status(pb); + r = parport_ax_read_status(pb); + parport_ax_write_status(pb, r | 0x01); /* Some reset by writing 1 */ + parport_ax_write_status(pb, r & 0xfe); /* Others by writing 0 */ + r = parport_ax_read_status(pb); + + return !(r & 0x01); +} + /* Check for ECP * * Old style XT ports alias io ports every 0x400, hence accessing ECONTROL @@ -553,7 +576,7 @@ printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base); if (p->irq != PARPORT_IRQ_NONE) - printk(", irq %x", (unsigned int)p->irq); + printk(", irq %s", __irq_itoa(p->irq)); if (p->dma != PARPORT_DMA_NONE) printk(", dma %d", p->dma); printk(" ["); @@ -589,9 +612,12 @@ struct linux_ebus_device *edev; int count = 0; - for_all_ebusdev(edev, ebus) - if (!strcmp(edev->prom_name, "ecpp")) - count += init_one_port(edev); + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if (!strcmp(edev->prom_name, "ecpp")) + count += init_one_port(edev); + } + } return count ? 0 : -ENODEV; } diff -u --recursive --new-file v2.1.114/linux/drivers/misc/parport_procfs.c linux/drivers/misc/parport_procfs.c --- v2.1.114/linux/drivers/misc/parport_procfs.c Tue Jul 28 14:21:08 1998 +++ linux/drivers/misc/parport_procfs.c Tue Aug 4 16:49:19 1998 @@ -105,10 +105,15 @@ struct parport *pp = (struct parport *)data; int len; - if (pp->irq == PARPORT_IRQ_NONE) + if (pp->irq == PARPORT_IRQ_NONE) { len = sprintf(page, "none\n"); - else + } else { +#ifdef __sparc__ + len = sprintf(page, "%s\n", __irq_itoa(pp->irq)); +#else len = sprintf(page, "%d\n", pp->irq); +#endif + } *start = 0; *eof = 1; @@ -146,10 +151,15 @@ len += sprintf(page+len, "base:\t0x%lx\n",pp->base); - if (pp->irq == PARPORT_IRQ_NONE) + if (pp->irq == PARPORT_IRQ_NONE) { len += sprintf(page+len, "irq:\tnone\n"); - else + } else { +#ifdef __sparc__ + len += sprintf(page+len, "irq:\t%s\n",__irq_itoa(pp->irq)); +#else len += sprintf(page+len, "irq:\t%d\n",pp->irq); +#endif + } if (pp->dma == PARPORT_DMA_NONE) len += sprintf(page+len, "dma:\tnone\n"); diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/audio/amd7930.c linux/drivers/sbus/audio/amd7930.c --- v2.1.114/linux/drivers/sbus/audio/amd7930.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/audio/amd7930.c Tue Aug 4 16:08:31 1998 @@ -1340,6 +1340,8 @@ info->Bc.output_count = info->Bc.input_count = 0; info->ints_on = 1; /* force disable below */ + drv->dev = sdev; + /* Map the registers into memory. */ prom_getproperty(node, "reg", (char *)®s, sizeof(regs)); if (sbus && sdev) diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/audio/audio.c linux/drivers/sbus/audio/audio.c --- v2.1.114/linux/drivers/sbus/audio/audio.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/audio/audio.c Tue Aug 4 16:08:31 1998 @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -53,11 +54,11 @@ /* Setup the circular queues of output and input buffers * * Each buffer is a single page, but output buffers might - * be partially filled (by a write with count < PAGE_SIZE), + * be partially filled (by a write with count < 4096), * so each output buffer also has a paired output size. * * Input buffers, on the other hand, always fill completely, - * so we don't need input counts - each contains PAGE_SIZE + * so we don't need input counts - each contains 4096 * bytes of audio data. * * TODO: Make number of input/output buffers tunable parameters @@ -187,7 +188,8 @@ wake_up_interruptible(&drv->output_write_wait); drv->ops->start_output(drv, drv->output_buffers[drv->output_front], - drv->output_sizes[drv->output_front]); + drv->output_sizes[drv->output_front]); + } void sparcaudio_input_done(struct sparcaudio_driver * drv) @@ -204,7 +206,7 @@ } else { /* Otherwise, give the driver the next buffer. */ drv->ops->start_input(drv, drv->input_buffers[drv->input_front], - PAGE_SIZE); + 4096); } /* Wake up any tasks that are waiting. */ @@ -236,7 +238,7 @@ return -EINTR; } - bytes_to_copy = PAGE_SIZE - driver->input_offset; + bytes_to_copy = 4096 - driver->input_offset; if (bytes_to_copy > count) bytes_to_copy = count; @@ -244,7 +246,7 @@ bytes_to_copy, -EFAULT); driver->input_offset += bytes_to_copy; - if (driver->input_offset >= PAGE_SIZE) { + if (driver->input_offset >= 4096) { driver->input_rear = (driver->input_rear + 1) % driver->num_input_buffers; driver->input_count--; driver->input_offset = 0; @@ -266,10 +268,10 @@ /* If the low-level driver is not active, activate it. */ save_and_cli(flags); if ((!driver->output_active) && (driver->output_count > 0)) { - driver->ops->start_output(driver, - driver->output_buffers[driver->output_front], - driver->output_sizes[driver->output_front]); - driver->output_active = 1; + driver->ops->start_output(driver, + driver->output_buffers[driver->output_front], + driver->output_sizes[driver->output_front]); + driver->output_active = 1; } restore_flags(flags); } @@ -306,8 +308,8 @@ /* Determine how much we can copy in this iteration. */ bytes_to_copy = count; - if (bytes_to_copy > PAGE_SIZE) - bytes_to_copy = PAGE_SIZE; + if (bytes_to_copy > 4096) + bytes_to_copy = 4096; copy_from_user_ret(driver->output_buffers[driver->output_rear], buf, bytes_to_copy, -EFAULT); @@ -490,7 +492,7 @@ !(driver->flags & SDF_OPEN_READ)) { driver->ops->start_input(driver, driver->input_buffers[driver->input_front], - PAGE_SIZE); + 4096); driver->input_active = 1; } if ((file->f_mode & FMODE_WRITE) && @@ -510,18 +512,17 @@ } else retval = -EINVAL; - printk(KERN_INFO "sparcaudio_ioctl: AUDIO_GETDEV\n"); break; case AUDIO_GETDEV_SUNOS: if (driver->ops->sunaudio_getdev_sunos) { int tmp=driver->ops->sunaudio_getdev_sunos(driver); - copy_to_user_ret((int *)arg, &tmp, sizeof(tmp), -EFAULT); + if (put_user(tmp, (int *)arg)) + retval = -EFAULT; } else retval = -EINVAL; - printk(KERN_INFO "sparcaudio_ioctl: AUDIO_GETDEV_SUNOS\n"); break; case AUDIO_GETINFO: @@ -549,7 +550,7 @@ if (driver->ops->get_input_ports) ainfo.record.avail_ports = driver->ops->get_input_ports(driver); - ainfo.record.buffer_size = PAGE_SIZE; + ainfo.record.buffer_size = 4096; ainfo.record.samples = 0; ainfo.record.eof = 0; ainfo.record.pause = 0; @@ -583,7 +584,8 @@ if (driver->ops->get_output_ports) ainfo.play.avail_ports = driver->ops->get_output_ports(driver); - ainfo.play.buffer_size = PAGE_SIZE; + /* This is not defined in the play context in Solaris */ + ainfo.play.buffer_size = 0; ainfo.play.samples = 0; ainfo.play.eof = 0; ainfo.play.pause = 0; @@ -591,7 +593,7 @@ ainfo.play.waiting = waitqueue_active(&driver->open_wait); if (driver->ops->get_output_balance) ainfo.play.balance = - driver->ops->get_output_balance(driver); + (unsigned char)driver->ops->get_output_balance(driver); ainfo.play.minordev = 4; ainfo.play.open = 1; ainfo.play.active = driver->output_active; @@ -602,9 +604,7 @@ if (driver->ops->get_output_muted) ainfo.output_muted = - driver->ops->get_output_muted(driver); - - printk("sparcaudio_ioctl: AUDIO_GETINFO\n"); + (unsigned char)driver->ops->get_output_muted(driver); copy_to_user_ret((struct audio_info *)arg, &ainfo, sizeof(ainfo), -EFAULT); @@ -613,7 +613,7 @@ case AUDIO_SETINFO: { - audio_info_t curinfo; + audio_info_t curinfo, newinfo; copy_from_user_ret(&ainfo, (audio_info_t *) arg, sizeof(audio_info_t), -EFAULT); @@ -692,61 +692,56 @@ break; } - curinfo.record.encoding = (Modify(ainfo.record.encoding) ? - ainfo.record.encoding : - driver->ops->get_input_encoding(driver)); - curinfo.record.sample_rate = (Modify(ainfo.record.sample_rate) ? - ainfo.record.sample_rate : - driver->ops->get_input_rate(driver)); - curinfo.record.precision = (Modify(ainfo.record.precision) ? - ainfo.record.precision : - driver->ops->get_input_precision(driver)); - curinfo.record.channels = (Modify(ainfo.record.channels) ? - ainfo.record.channels : - driver->ops->get_input_channels(driver)); - switch (curinfo.record.encoding) { + curinfo.record.encoding = driver->ops->get_input_encoding(driver); + curinfo.record.sample_rate = driver->ops->get_input_rate(driver); + curinfo.record.precision = driver->ops->get_input_precision(driver); + curinfo.record.channels = driver->ops->get_input_channels(driver); + newinfo.record.encoding = Modify(ainfo.record.encoding) ? + ainfo.record.encoding : curinfo.record.encoding; + newinfo.record.sample_rate = Modify(ainfo.record.sample_rate)? + ainfo.record.sample_rate : curinfo.record.sample_rate; + newinfo.record.precision = Modify(ainfo.record.precision) ? + ainfo.record.precision : curinfo.record.precision; + newinfo.record.channels = Modify(ainfo.record.channels) ? + ainfo.record.channels : curinfo.record.channels; + + switch (newinfo.record.encoding) { case AUDIO_ENCODING_ALAW: case AUDIO_ENCODING_ULAW: - if (Modify(ainfo.record.precision) && - ainfo.record.precision != 8) { - retval = -EINVAL; - break; - } - if (Modify(ainfo.record.channels) && - ainfo.record.channels != 1) { - retval = -EINVAL; - break; - } - break; - case AUDIO_ENCODING_LINEAR: - case AUDIO_ENCODING_LINEARLE: - if (Modify(ainfo.record.precision) && - ainfo.record.precision != 16) { - retval = -EINVAL; - break; - } - if (Modify(ainfo.record.channels) && - (ainfo.record.channels != 1 && - ainfo.record.channels != 2)) - { - retval = -EINVAL; - break; - } - break; - case AUDIO_ENCODING_LINEAR8: - if (Modify(ainfo.record.precision) && - ainfo.record.precision != 8) { - retval = -EINVAL; - break; - } - if (Modify(ainfo.record.channels) && - (ainfo.record.channels != 1 && - ainfo.record.channels != 2)) - { - retval = -EINVAL; - break; - } - } + if (newinfo.record.precision != 8) { + retval = -EINVAL; + break; + } + if (newinfo.record.channels != 1) { + retval = -EINVAL; + break; + } + break; + case AUDIO_ENCODING_LINEAR: + case AUDIO_ENCODING_LINEARLE: + if (newinfo.record.precision != 16) { + retval = -EINVAL; + break; + } + if (newinfo.record.channels != 1 && + newinfo.record.channels != 2) + { + retval = -EINVAL; + break; + } + break; + case AUDIO_ENCODING_LINEAR8: + if (newinfo.record.precision != 8) { + retval = -EINVAL; + break; + } + if (newinfo.record.channels != 1 && + newinfo.record.channels != 2) + { + retval = -EINVAL; + break; + } + } if (retval < 0) break; @@ -765,61 +760,56 @@ break; } - curinfo.play.encoding = (Modify(ainfo.play.encoding) ? - ainfo.play.encoding : - driver->ops->get_output_encoding(driver)); - curinfo.play.sample_rate = (Modify(ainfo.play.sample_rate) ? - ainfo.play.sample_rate : - driver->ops->get_output_rate(driver)); - curinfo.play.precision = (Modify(ainfo.play.precision) ? - ainfo.play.precision : - driver->ops->get_output_precision(driver)); - curinfo.play.channels = (Modify(ainfo.play.channels) ? - ainfo.play.channels : - driver->ops->get_output_channels(driver)); - switch (curinfo.play.encoding) { + curinfo.play.encoding = driver->ops->get_output_encoding(driver); + curinfo.play.sample_rate = driver->ops->get_output_rate(driver); + curinfo.play.precision = driver->ops->get_output_precision(driver); + curinfo.play.channels = driver->ops->get_output_channels(driver); + newinfo.play.encoding = Modify(ainfo.play.encoding) ? + ainfo.play.encoding : curinfo.play.encoding; + newinfo.play.sample_rate = Modify(ainfo.play.sample_rate) ? + ainfo.play.sample_rate : curinfo.play.sample_rate; + newinfo.play.precision = Modify(ainfo.play.precision) ? + ainfo.play.precision : curinfo.play.precision; + newinfo.play.channels = Modify(ainfo.play.channels) ? + ainfo.play.channels : curinfo.play.channels; + + switch (newinfo.play.encoding) { case AUDIO_ENCODING_ALAW: case AUDIO_ENCODING_ULAW: - if (Modify(ainfo.play.precision) && - ainfo.play.precision != 8) { - retval = -EINVAL; - break; - } - if (Modify(ainfo.play.channels) && - ainfo.play.channels != 1) { - retval = -EINVAL; - break; - } - break; - case AUDIO_ENCODING_LINEAR: - case AUDIO_ENCODING_LINEARLE: - if (Modify(ainfo.play.precision) && - ainfo.play.precision != 16) { - retval = -EINVAL; - break; - } - if (Modify(ainfo.play.channels) && - (ainfo.play.channels != 1 && - ainfo.play.channels != 2)) - { - retval = -EINVAL; - break; - } - break; - case AUDIO_ENCODING_LINEAR8: - if (Modify(ainfo.play.precision) && - ainfo.play.precision != 8) { - retval = -EINVAL; - break; - } - if (Modify(ainfo.play.channels) && - (ainfo.play.channels != 1 && - ainfo.play.channels != 2)) - { - retval = -EINVAL; - break; - } - } + if (newinfo.play.precision != 8) { + retval = -EINVAL; + break; + } + if (newinfo.play.channels != 1) { + retval = -EINVAL; + break; + } + break; + case AUDIO_ENCODING_LINEAR: + case AUDIO_ENCODING_LINEARLE: + if (newinfo.play.precision != 16) { + retval = -EINVAL; + break; + } + if (newinfo.play.channels != 1 && + newinfo.play.channels != 2) + { + retval = -EINVAL; + break; + } + break; + case AUDIO_ENCODING_LINEAR8: + if (newinfo.play.precision != 8) { + retval = -EINVAL; + break; + } + if (newinfo.play.channels != 1 && + newinfo.play.channels != 2) + { + retval = -EINVAL; + break; + } + } if (retval < 0) break; @@ -857,11 +847,10 @@ IF_SET_DO(driver->ops->set_input_port, ainfo.record.port); IF_SET_DO(driver->ops->set_output_port, ainfo.play.port); IF_SET_DO(driver->ops->set_monitor_volume, ainfo.monitor_gain); - IF_SET_DO(driver->ops->set_output_muted, ainfo.output_muted); + IF_SETC_DO(driver->ops->set_output_muted, (int)ainfo.output_muted); #undef IF_SET_DO #undef IF_SETC_DO - printk("sparcaudio_ioctl: AUDIO_SETINFO\n"); break; } @@ -870,8 +859,6 @@ retval = driver->ops->ioctl(inode,file,cmd,arg,driver); else { retval = -EINVAL; - - printk("sparcaudio_ioctl: 0x%x\n", cmd); } } @@ -950,7 +937,7 @@ driver->input_count = 0; driver->recording_count = 0; driver->ops->start_input(driver, driver->input_buffers[driver->input_front], - PAGE_SIZE); + 4096); driver->input_active = 1; driver->flags |= SDF_OPEN_READ; } diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/audio/cs4231.c linux/drivers/sbus/audio/cs4231.c --- v2.1.114/linux/drivers/sbus/audio/cs4231.c Sun Jun 7 11:16:33 1998 +++ linux/drivers/sbus/audio/cs4231.c Tue Aug 4 16:08:31 1998 @@ -1,5 +1,5 @@ /* - * Drivers/sbus/audio/cs4231.c + * drivers/sbus/audio/cs4231.c * * Copyright (C) 1996, 1997 Derrick J Brashear (shadow@andrew.cmu.edu) * @@ -27,19 +27,12 @@ #include #include #include +#include #include #include #include "cs4231.h" -/* Stolen for now from compat.h */ -#ifndef MAX /* Usually found in . */ -#define MAX(_a,_b) ((_a)<(_b)?(_b):(_a)) -#endif -#ifndef MIN /* Usually found in . */ -#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) -#endif - #undef __CS4231_DEBUG #undef __CS4231_TRACE #undef __CS4231_ERROR @@ -63,15 +56,19 @@ static struct sparcaudio_driver drivers[MAX_DRIVERS]; static int num_drivers; -static int cs4231_record_gain(struct sparcaudio_driver *drv, int value, unsigned char balance); -static int cs4231_play_gain(struct sparcaudio_driver *drv, int value, unsigned char balance); +static int cs4231_record_gain(struct sparcaudio_driver *drv, int value, + unsigned char balance); +static int cs4231_play_gain(struct sparcaudio_driver *drv, int value, + unsigned char balance); static void cs4231_ready(struct sparcaudio_driver *drv); static void cs4231_playintr(struct sparcaudio_driver *drv); static int cs4231_recintr(struct sparcaudio_driver *drv); static int cs4231_output_muted(struct sparcaudio_driver *drv, int value); static void cs4231_pollinput(struct sparcaudio_driver *drv); -static int cs4231_length_to_samplecount(struct audio_prinfo *thisdir, unsigned int length); -static void cs4231_getsamplecount(struct sparcaudio_driver *drv, unsigned int length, unsigned int value); +static int cs4231_length_to_samplecount(struct audio_prinfo *thisdir, + unsigned int length); +static void cs4231_getsamplecount(struct sparcaudio_driver *drv, + unsigned int length, unsigned int value); #define CHIP_READY udelay(100); cs4231_ready(drv); mdelay(1); @@ -520,6 +517,8 @@ static int cs4231_get_input_ports(struct sparcaudio_driver *drv) { struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; + + /* This apparently applies only to APC ultras, not ebus ultras */ if (cs4231_chip->status & CS_STATUS_IS_ULTRA) return (AUDIO_LINE_IN | AUDIO_MICROPHONE | AUDIO_ANALOG_LOOPBACK); else @@ -586,6 +585,7 @@ */ /* Ultra systems do not support AUDIO_INTERNAL_CD_IN */ + /* This apparently applies only to APC ultras, not ebus ultras */ if (!cs4231_chip->status & CS_STATUS_IS_ULTRA) { if (value & AUDIO_INTERNAL_CD_IN) { cs4231_chip->regs->iar = 0x1; @@ -637,7 +637,8 @@ /* This interpolation really sucks. The question is, be compatible * with ScumOS/Sloaris or not? */ - a = CS4231_MON_MAX_ATEN - (value * (CS4231_MON_MAX_ATEN + 1) / (AUDIO_MAX_GAIN + 1)); + a = CS4231_MON_MAX_ATEN - (value * (CS4231_MON_MAX_ATEN + 1) / + (AUDIO_MAX_GAIN + 1)); cs4231_chip->regs->iar = 0x0d; if (a >= CS4231_MON_MAX_ATEN) @@ -648,7 +649,9 @@ if (value == AUDIO_MAX_GAIN) cs4231_chip->perchip_info.monitor_gain = AUDIO_MAX_GAIN; else - cs4231_chip->perchip_info.monitor_gain = ((CS4231_MAX_DEV_ATEN - a) * (AUDIO_MAX_GAIN + 1) / (CS4231_MAX_DEV_ATEN + 1)); + cs4231_chip->perchip_info.monitor_gain = ((CS4231_MAX_DEV_ATEN - a) * + (AUDIO_MAX_GAIN + 1) / + (CS4231_MAX_DEV_ATEN + 1)); return 0; } @@ -666,7 +669,8 @@ { struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; - cs4231_record_gain(drv, value, cs4231_chip->perchip_info.record.balance); + cs4231_record_gain(drv, value, + cs4231_chip->perchip_info.record.balance); return 0; } @@ -700,7 +704,8 @@ struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; cs4231_chip->perchip_info.record.balance = value; - cs4231_record_gain(drv, cs4231_chip->perchip_info.record.gain, cs4231_chip->perchip_info.record.balance); + cs4231_record_gain(drv, cs4231_chip->perchip_info.record.gain, + cs4231_chip->perchip_info.record.balance); return 0; } @@ -717,7 +722,8 @@ struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; cs4231_chip->perchip_info.play.balance = value; - cs4231_play_gain(drv, cs4231_chip->perchip_info.play.gain, cs4231_chip->perchip_info.play.balance); + cs4231_play_gain(drv, cs4231_chip->perchip_info.play.gain, + cs4231_chip->perchip_info.play.balance); return 0; } @@ -739,9 +745,13 @@ r = l = value; if (balance < AUDIO_MID_BALANCE) { - r = MAX(0, (int)(value - ((AUDIO_MID_BALANCE - balance) << AUDIO_BALANCE_SHIFT))); + r = (int)(value - ((AUDIO_MID_BALANCE - balance) + << AUDIO_BALANCE_SHIFT)); + if (r < 0) r = 0; } else if (balance > AUDIO_MID_BALANCE) { - l = MAX(0, (int)(value - ((balance - AUDIO_MID_BALANCE) << AUDIO_BALANCE_SHIFT))); + l = (int)(value - ((balance - AUDIO_MID_BALANCE) + << AUDIO_BALANCE_SHIFT)); + if (l < 0) l = 0; } l_adj = l * (CS4231_MAX_GAIN + 1) / (AUDIO_MAX_GAIN + 1); @@ -755,9 +765,11 @@ cs4231_chip->regs->idr = RECGAIN_SET(old_gain, r_adj); if (l == value) { - (l == 0) ? (tmp = 0) : (tmp = ((l_adj + 1) * AUDIO_MAX_GAIN) / (CS4231_MAX_GAIN + 1)); + (l == 0) ? (tmp = 0) : (tmp = ((l_adj + 1) * AUDIO_MAX_GAIN) / + (CS4231_MAX_GAIN + 1)); } else if (r == value) { - (r == 0) ? (tmp = 0) : (tmp = ((r_adj + 1) * AUDIO_MAX_GAIN) / (CS4231_MAX_GAIN + 1)); + (r == 0) ? (tmp = 0) : (tmp = ((r_adj + 1) * AUDIO_MAX_GAIN) / + (CS4231_MAX_GAIN + 1)); } cs4231_chip->perchip_info.record.gain = tmp; return 0; @@ -773,13 +785,21 @@ tprintk(("in play_gain: %d %c\n", value, balance)); r = l = value; if (balance < AUDIO_MID_BALANCE) { - r = MAX(0, (int)(value - ((AUDIO_MID_BALANCE - balance) << AUDIO_BALANCE_SHIFT))); + r = (int)(value - ((AUDIO_MID_BALANCE - balance) + << AUDIO_BALANCE_SHIFT)); + if (r < 0) r = 0; } else if (balance > AUDIO_MID_BALANCE) { - l = MAX(0, (int)(value - ((balance - AUDIO_MID_BALANCE) << AUDIO_BALANCE_SHIFT))); + l = (int)(value - ((balance - AUDIO_MID_BALANCE) + << AUDIO_BALANCE_SHIFT)); + if (l < 0) l = 0; } - (l == 0) ? (l_adj = CS4231_MAX_DEV_ATEN) : (l_adj = CS4231_MAX_ATEN - (l * (CS4231_MAX_ATEN + 1) / (AUDIO_MAX_GAIN + 1))); - (r == 0) ? (r_adj = CS4231_MAX_DEV_ATEN) : (r_adj = CS4231_MAX_ATEN - (r * (CS4231_MAX_ATEN + 1) / (AUDIO_MAX_GAIN + 1))); + (l == 0) ? (l_adj = CS4231_MAX_DEV_ATEN) : (l_adj = CS4231_MAX_ATEN - + (l * (CS4231_MAX_ATEN + 1) / + (AUDIO_MAX_GAIN + 1))); + (r == 0) ? (r_adj = CS4231_MAX_DEV_ATEN) : (r_adj = CS4231_MAX_ATEN - + (r * (CS4231_MAX_ATEN + 1) / + (AUDIO_MAX_GAIN + 1))); cs4231_chip->regs->iar = 0x6; old_gain = cs4231_chip->regs->idr; @@ -791,11 +811,12 @@ if ((value == 0) || (value == AUDIO_MAX_GAIN)) { tmp = value; } else { - if (l == value) { - tmp = ((CS4231_MAX_ATEN - l_adj) * (AUDIO_MAX_GAIN + 1) / (CS4231_MAX_ATEN + 1)); - } else if (r == value) { - tmp = ((CS4231_MAX_ATEN - r_adj) * (AUDIO_MAX_GAIN + 1) / (CS4231_MAX_ATEN + 1)); - } + if (value == l) + tmp = ((CS4231_MAX_ATEN - l_adj) * (AUDIO_MAX_GAIN + 1) / + (CS4231_MAX_ATEN + 1)); + else if (r == value) + tmp = ((CS4231_MAX_ATEN - r_adj) * (AUDIO_MAX_GAIN + 1) / + (CS4231_MAX_ATEN + 1)); } cs4231_chip->perchip_info.play.gain = tmp; @@ -969,7 +990,9 @@ if (file->f_mode & FMODE_WRITE) cs4231_chip->perchip_info.play.open = 0; - if (!cs4231_chip->perchip_info.play.open && !cs4231_chip->perchip_info.record.open && (cs4231_chip->status & CS_STATUS_INIT_ON_CLOSE)) { + if (!cs4231_chip->perchip_info.play.open && + !cs4231_chip->perchip_info.record.open && + (cs4231_chip->status & CS_STATUS_INIT_ON_CLOSE)) { cs4231_chip_reset(drv); cs4231_chip->status &= ~CS_STATUS_INIT_ON_CLOSE; } @@ -984,12 +1007,25 @@ if (cs4231_chip->playlen == 0) cs4231_chip->playlen = cs4231_chip->output_size; + if (cs4231_chip->output_dma_handle) { + mmu_release_scsi_one((char *)cs4231_chip->output_dma_handle, + 4096, drv->dev->my_bus); + cs4231_chip->output_dma_handle = 0; + } + if (cs4231_chip->output_next_dma_handle) { + cs4231_chip->output_dma_handle = cs4231_chip->output_next_dma_handle; + cs4231_chip->output_next_dma_handle = 0; + } + if (cs4231_chip->output_ptr && cs4231_chip->output_size > 0) { - cs4231_chip->regs->dmapnva = (__u32) cs4231_chip->output_ptr; - cs4231_chip->regs->dmapnc = cs4231_chip->output_size; - cs4231_chip->output_size = 0; - cs4231_chip->output_ptr = NULL; - cs4231_chip->playing_count++; + cs4231_chip->output_next_dma_handle = + mmu_get_scsi_one((char *) cs4231_chip->output_ptr, 4096, + drv->dev->my_bus); + cs4231_chip->regs->dmapnva = cs4231_chip->output_next_dma_handle; + cs4231_chip->regs->dmapnc = cs4231_chip->output_size; + cs4231_chip->output_size = 0; + cs4231_chip->output_ptr = NULL; + cs4231_chip->playing_count++; } /* Get two buffers into the pipe, then chain... */ @@ -1037,14 +1073,16 @@ return 1; } -static void cs4231_start_output(struct sparcaudio_driver *drv, __u8 * buffer, unsigned long count) +static void cs4231_start_output(struct sparcaudio_driver *drv, __u8 * buffer, + unsigned long count) { struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; cs4231_chip->output_ptr = buffer; cs4231_chip->output_size = count; - if (cs4231_chip->perchip_info.play.active || (cs4231_chip->perchip_info.play.pause)) + if (cs4231_chip->perchip_info.play.active || + (cs4231_chip->perchip_info.play.pause)) return; cs4231_ready(drv); @@ -1058,7 +1096,7 @@ cs4231_playintr(drv); cs4231_enable_play(drv); cs4231_chip->regs->dmacsr |= CS_PLAY_SETUP; - cs4231_output_muted(drv, 0); + cs4231_ready(drv); } @@ -1069,6 +1107,16 @@ tprintk(("in cs4231_stop_output\n")); cs4231_chip->output_ptr = NULL; cs4231_chip->output_size = 0; + if (cs4231_chip->output_dma_handle) { + mmu_release_scsi_one((char *)cs4231_chip->output_dma_handle, + 4096, drv->dev->my_bus); + cs4231_chip->output_dma_handle = 0; + } + if (cs4231_chip->output_next_dma_handle) { + mmu_release_scsi_one((char *)cs4231_chip->output_next_dma_handle, + 4096, drv->dev->my_bus); + cs4231_chip->output_next_dma_handle = 0; + } cs4231_chip->perchip_info.play.active = 0; cs4231_chip->regs->dmacsr |= (CS_PPAUSE); } @@ -1084,11 +1132,13 @@ cs4231_chip->regs->dmacsr |= CS_XINT_CEMP; } -static void cs4231_start_input(struct sparcaudio_driver *drv, __u8 * buffer, unsigned long count) +static void cs4231_start_input(struct sparcaudio_driver *drv, __u8 * buffer, + unsigned long count) { struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; - if (cs4231_chip->perchip_info.record.active || (cs4231_chip->perchip_info.record.pause)) + if (cs4231_chip->perchip_info.record.active || + (cs4231_chip->perchip_info.record.pause)) return; cs4231_ready(drv); @@ -1124,6 +1174,7 @@ strncpy(audinfo->name, "SUNW,CS4231", sizeof(audinfo->name) - 1); /* versions: SPARCstation 4/5=a, Ultra=b */ + /* apparently Ultra 1, Ultra 2 don't have internal CD input */ if (cs4231_chip->status & CS_STATUS_IS_ULTRA) strncpy(audinfo->version, "b", sizeof(audinfo->version) - 1); else @@ -1189,6 +1240,7 @@ cs4231_chip->playlen); cs4231_playintr(drv); } + /* Any other conditions we need worry about? */ } if (dummy & CS_CAPT_INT) { @@ -1198,16 +1250,18 @@ cs4231_chip->reclen); cs4231_recintr(drv); } + /* Any other conditions we need worry about? */ } + if ((dummy & CS_XINT_CEMP) && (cs4231_chip->perchip_info.record.active == 0)) { - cs4231_chip->perchip_info.record.active = 0; + /* Fix me */ + cs4231_chip->perchip_info.record.active = 0; } if ((dummy & CS_XINT_EMPT) && (cs4231_chip->perchip_info.play.active == 0)) { cs4231_chip->regs->dmacsr |= (CS_PPAUSE); cs4231_disable_play(drv); - cs4231_output_muted(drv, 1); cs4231_getsamplecount(drv, cs4231_chip->playlen, 0); } @@ -1272,9 +1326,6 @@ struct cs4231_chip *cs4231_chip; int err; struct linux_sbus *sbus = sdev->my_bus; -#ifdef __sparc_v9__ - struct devid_cookie dcookie; -#endif /* Allocate our private information structure. */ drv->private = kmalloc(sizeof(struct cs4231_chip), GFP_KERNEL); @@ -1288,6 +1339,8 @@ cs4231_chip->input_size = cs4231_chip->output_size = 0; cs4231_chip->status = 0; + drv->dev = sdev; + /* Map the registers into memory. */ prom_apply_sbus_ranges(sbus, sdev->reg_addrs, 1, sdev); cs4231_chip->regs_size = sdev->reg_addrs[0].reg_size; @@ -1303,18 +1356,9 @@ } /* Attach the interrupt handler to the audio interrupt. */ - cs4231_chip->irq = sdev->irqs[0].pri; + cs4231_chip->irq = sdev->irqs[0]; -#ifndef __sparc_v9__ request_irq(cs4231_chip->irq, cs4231_interrupt, SA_SHIRQ, "cs4231", drv); -#else - dcookie.real_dev_id = drv; - dcookie.imap = dcookie.iclr = 0; - dcookie.pil = -1; - dcookie.bus_cookie = sdev->my_bus; - request_irq (cs4231_chip->irq, cs4231_interrupt, (SA_SHIRQ | SA_SBUS | SA_DCOOKIE), "cs4231", &dcookie); - cs4231_chip->irq = dcookie.ret_ino; -#endif enable_irq(cs4231_chip->irq); cs4231_enable_interrupts(drv); diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/audio/cs4231.h linux/drivers/sbus/audio/cs4231.h --- v2.1.114/linux/drivers/sbus/audio/cs4231.h Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/audio/cs4231.h Tue Aug 4 16:08:31 1998 @@ -48,6 +48,7 @@ /* Current buffer that the driver is playing. */ volatile __u8 * output_ptr; volatile unsigned long output_size; + volatile __u32 * output_dma_handle, output_next_dma_handle; /* Current record buffer. */ volatile __u8 * input_ptr; diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/Config.in linux/drivers/sbus/char/Config.in --- v2.1.114/linux/drivers/sbus/char/Config.in Thu Jul 16 18:09:26 1998 +++ linux/drivers/sbus/char/Config.in Tue Aug 4 16:08:31 1998 @@ -1,47 +1,3 @@ -comment 'SBUS Frame Buffer support' - -if [ "$CONFIG_FB" != "y" ]; then - bool 'Sun FB drivers appear in PROCFS' SUN_FBS_IN_PROCFS - bool 'Load All Supported Drivers' CONFIG_SUN_FB_DISPLAY - - if [ "$CONFIG_SUN_FB_DISPLAY" = "n" ]; then - bool 'cgsix support' SUN_FB_CGSIX - bool 'tcx support' SUN_FB_TCX - bool 'cgthree support' SUN_FB_CGTHREE - bool 'cgfourteen support' SUN_FB_CGFOURTEEN - bool 'bwtwo support' SUN_FB_BWTWO - bool 'leo/zx support' SUN_FB_LEO - bool 'weitek P9X00 support' TADPOLE_FB_WEITEK - bool 'creator support' SUN_FB_CREATOR - if [ "$TADPOLE_FB_WEITEK" = "n" ]; then - fbs=$SUN_FB_CGSIX - fbs=$fbs$SUN_FB_TCX - fbs=$fbs$SUN_FB_CGTHREE - fbs=$fbs$SUN_FB_BWTWO - fbs=$fbs$SUN_FB_CGFOURTEEN - fbs=$fbs$SUN_FB_LEO - fbs=$fbs$TADPOLE_FB_WEITEK - fbs=$fbs$SUN_FB_CREATOR - if [ "$fbs" = "nnnnnnnn" ]; then - echo "Warning: You have excluded ALL FB Support" - echo "Notice: Enabling Generic AutoResolution" - define_bool SUN_FB_GENERIC y - fi - else - define_bool SUN_FB_GENERIC y - fi - else - define_bool SUN_FB_CGSIX y - define_bool SUN_FB_TCX y - define_bool SUN_FB_CGTHREE y - define_bool SUN_FB_CGFOURTEEN y - define_bool SUN_FB_BWTWO y - define_bool SUN_FB_LEO y - define_bool TADPOLE_FB_WEITEK y - define_bool SUN_FB_CREATOR y - fi -fi - comment 'Misc Linux/SPARC drivers' tristate '/dev/openprom device support' CONFIG_SUN_OPENPROMIO tristate 'Mostek real time clock support' CONFIG_SUN_MOSTEK_RTC diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/Makefile linux/drivers/sbus/char/Makefile --- v2.1.114/linux/drivers/sbus/char/Makefile Thu Jul 16 18:09:26 1998 +++ linux/drivers/sbus/char/Makefile Tue Aug 4 16:08:31 1998 @@ -10,49 +10,8 @@ # Dave Redman Frame Buffer tuning support. # OK this is kind of ugly but it does allow drivers to be added fairly # easily. and you can even choose what sort of support you want. -ifdef SUN_FB_CGSIX - FB_OBJS += cgsix.o -endif -ifdef SUN_FB_CGTHREE - FB_OBJS += cgthree.o -endif -ifdef SUN_FB_TCX - FB_OBJS += tcx.o -endif -ifdef SUN_FB_BWTWO - FB_OBJS += bwtwo.o -endif -ifdef SUN_FB_LEO - FB_OBJS += leo.o -endif -ifdef SUN_FB_CGFOURTEEN - FB_OBJS += cgfourteen.o -endif -ifdef TADPOLE_FB_WEITEK - FB_OBJS += weitek.o -endif -ifdef SUN_FB_CREATOR - ifeq ($(ARCH),sparc64) - FB_OBJS += creator.o - endif -endif -#ifdef SUN_FB_FAST_ONE -# FB_OBJS += sun_8bit_fast1.o -#endif -#ifdef SUN_FB_FAST_TWO -# FB_OBJS += sun_8bit_fast2.o -#endif -#ifdef SUN_FB_FAST_MONO -# FB_OBJS += sun_mono_fast1.o -#endif -#ifdef SUN_FB_GENERIC -# FB_OBJS += sun_8bit_generic.o -#endif O_TARGET := sunchar.o -ifneq ($(CONFIG_FB),y) -O_OBJ := ${FB_OBJS} suncons.o sbuscons.o pcicons.o sunfb.o -endif O_OBJS := ${O_OBJ} sunkbd.o sunkbdmap.o sunmouse.o sunserial.o zs.o M_OBJS := @@ -120,14 +79,6 @@ ifeq ($(CONFIG_SUN_VIDEOPIX),m) M_OBJS += vfc.o endif -endif - -# Add PCI console/fb drivers here. -# -ifneq ($(CONFIG_FB),y) -ifeq ($(CONFIG_PCI),y) -O_OBJS += mach64.o -endif endif include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/bpp.c linux/drivers/sbus/char/bpp.c --- v2.1.114/linux/drivers/sbus/char/bpp.c Wed Jun 24 22:54:07 1998 +++ linux/drivers/sbus/char/bpp.c Tue Aug 4 16:08:31 1998 @@ -957,7 +957,7 @@ areg = dev->reg_addrs[0]; printk("bpp%d.map_bpp: 0x%x.%p[0x%x] i=%d\n", idx, areg.which_io, areg.phys_addr, areg.reg_size, - dev->irqs[0].pri); + dev->irqs[0]); /* IPC Zebra 1.fa200000[1c] i=2 */ /** prom_apply_sbus_ranges (&areg, 1); **/ diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/bwtwo.c linux/drivers/sbus/char/bwtwo.c --- v2.1.114/linux/drivers/sbus/char/bwtwo.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/bwtwo.c Wed Dec 31 16:00:00 1969 @@ -1,220 +0,0 @@ -/* $Id: bwtwo.c,v 1.21 1998/04/24 12:29:53 davem Exp $ - * bwtwo.c: bwtwo console driver - * - * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) - * Copyright (C) 1998 Pavel Machek (pavel@ucw.cz) - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include - -#include "fb.h" -#include "cg_common.h" - -/* OBio addresses for the bwtwo registers */ -#define BWTWO_REGISTER_OFFSET 0x400000 - -struct bwtwo_regs { - __volatile__ struct bt_regs bt; - __volatile__ __u8 control; - __volatile__ __u8 status; - __volatile__ __u8 cursor_start; - __volatile__ __u8 cursor_end; - __volatile__ __u8 h_blank_start; - __volatile__ __u8 h_blank_end; - __volatile__ __u8 h_sync_start; - __volatile__ __u8 h_sync_end; - __volatile__ __u8 comp_sync_end; - __volatile__ __u8 v_blank_start_high; - __volatile__ __u8 v_blank_start_low; - __volatile__ __u8 v_blank_end; - __volatile__ __u8 v_sync_start; - __volatile__ __u8 v_sync_end; - __volatile__ __u8 xfer_holdoff_start; - __volatile__ __u8 xfer_holdoff_end; -}; - -/* Status Register Constants */ -#define BWTWO_SR_RES_MASK 0x70 -#define BWTWO_SR_1600_1280 0x50 -#define BWTWO_SR_1152_900_76_A 0x40 -#define BWTWO_SR_1152_900_76_B 0x60 -#define BWTWO_SR_ID_MASK 0x0f -#define BWTWO_SR_ID_MONO 0x02 -#define BWTWO_SR_ID_MONO_ECL 0x03 -#define BWTWO_SR_ID_MSYNC 0x04 - -/* Control Register Constants */ -#define BWTWO_CTL_ENABLE_INTS 0x80 -#define BWTWO_CTL_ENABLE_VIDEO 0x40 -#define BWTWO_CTL_ENABLE_TIMING 0x20 -#define BWTWO_CTL_ENABLE_CURCMP 0x10 -#define BWTWO_CTL_XTAL_MASK 0x0C -#define BWTWO_CTL_DIVISOR_MASK 0x03 - -/* Status Register Constants */ -#define BWTWO_STAT_PENDING_INT 0x80 -#define BWTWO_STAT_MSENSE_MASK 0x70 -#define BWTWO_STAT_ID_MASK 0x0f - - -static int -bwtwo_mmap (struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - uint size, r; - unsigned long map_offset; - int map_size; - - map_size = size = vma->vm_end - vma->vm_start; - - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* This routine should also map the register if asked for, - * but we don't do that yet. - */ - map_offset = get_phys ((unsigned long) fb->base); - r = io_remap_page_range (vma->vm_start, map_offset, map_size, - vma->vm_page_prot, fb->space); - if (r) - return -EAGAIN; - - vma->vm_file = file; - file->f_count++; - return 0; -} - -static void -bwtwo_blank (fbinfo_t *fb) -{ - fb->info.bwtwo.regs->control &= ~BWTWO_CTL_ENABLE_VIDEO; -} - -static void -bwtwo_unblank (fbinfo_t *fb) -{ - fb->info.bwtwo.regs->control |= BWTWO_CTL_ENABLE_VIDEO; -} - - -static u8 bw2regs_1600[] __initdata = { - 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, - 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, - 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x21, 0 -}; - -static u8 bw2regs_ecl[] __initdata = { - 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, - 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, - 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x20, 0 -}; - -static u8 bw2regs_analog[] __initdata = { - 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, - 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, - 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x20, 0 -}; - -static u8 bw2regs_76hz[] __initdata = { - 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, - 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, - 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x24, 0 -}; - -static u8 bw2regs_66hz[] __initdata = { - 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, - 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, - 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x20, 0 -}; - -__initfunc(void bwtwo_setup (fbinfo_t *fb, int slot, u32 bwtwo, int bw2_io, - struct linux_sbus_device *sbdp)) -{ - printk ("bwtwo%d at 0x%8.8x\n", slot, bwtwo); - fb->type.fb_cmsize = 0; - fb->mmap = bwtwo_mmap; - fb->loadcmap = 0; - fb->ioctl = 0; - fb->reset = 0; -#ifndef CONFIG_SUN4 - fb->blank = bwtwo_blank; - fb->unblank = bwtwo_unblank; -#endif - - fb->info.bwtwo.regs = - sparc_alloc_io (bwtwo + BWTWO_REGISTER_OFFSET, - 0, sizeof (struct bwtwo_regs), - "bwtwo_regs", bw2_io, 0); - - if (sbdp && !prom_getbool(sbdp->prom_node, "width")) { - /* Ugh, broken PROM didn't initialize us. - * Let's deal with this ourselves. - */ - u8 status, mon; - u8 *p; - - status = fb->info.bwtwo.regs->status; - mon = status & BWTWO_SR_RES_MASK; - switch (status & BWTWO_SR_ID_MASK) { - case BWTWO_SR_ID_MONO_ECL: - if (mon == BWTWO_SR_1600_1280) { - p = bw2regs_1600; - fb->type.fb_width = 1600; - fb->type.fb_height = 1280; - } else { - p = bw2regs_ecl; - } - break; - case BWTWO_SR_ID_MONO: - p = bw2regs_analog; - break; - case BWTWO_SR_ID_MSYNC: - if (mon == BWTWO_SR_1152_900_76_A || - mon == BWTWO_SR_1152_900_76_B) { - p = bw2regs_76hz; - } else { - p = bw2regs_66hz; - } - break; - default: - prom_printf("bwtwo: can't handle SR %02x\n", - status); - prom_halt(); - return; /* fool gcc. */ - } - for ( ; *p; p += 2) - ((u8 *)fb->info.bwtwo.regs)[p[0]] = p[1]; - } - - if(!fb->base) - fb->base = (unsigned long) sparc_alloc_io(bwtwo, 0, - ((fb->type.fb_depth*fb->type.fb_height*fb->type.fb_width)/8), - "bwtwo_fbase", bw2_io, 0); - - if (slot && sun_prom_console_id != slot) - bwtwo_blank (fb); -} - diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/cg_common.h linux/drivers/sbus/char/cg_common.h --- v2.1.114/linux/drivers/sbus/char/cg_common.h Fri Dec 13 01:37:32 1996 +++ linux/drivers/sbus/char/cg_common.h Wed Dec 31 16:00:00 1969 @@ -1,28 +0,0 @@ -/* sun_cg_common.h - * contains the definitions of the structures that various sun - * frame buffer can use to do console driver stuff. - * - * This is not in sun_framebuffer.h because you may not want cgXX - * support so you wont require this. - * - */ - -#define BT_D4M3(x) ((((x) >> 2) << 1) + ((x) >> 2)) /* (x / 4) * 3 */ -#define BT_D4M4(x) ((x) & ~3) /* (x / 4) * 4 */ - -#define D4M3(x) ((((x)>>2)<<1) + ((x)>>2)) /* (x/4)*3 */ -#define D4M4(x) ((x)&~0x3) /* (x/4)*4 */ - -struct bt_regs { - volatile unsigned int addr; /* address register */ - volatile unsigned int color_map; /* color map */ - volatile unsigned int control; /* control register */ - volatile unsigned int cursor; /* cursor map register */ -}; - -/* The cg3 driver, obio space addresses for mapping the cg3 stuff */ -/* We put these constants here, because the cg14 driver initially will emulate a cg3 */ -#define CG3_REGS 0x400000 -#define CG3_RAM 0x800000 - - diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/cgfourteen.c linux/drivers/sbus/char/cgfourteen.c --- v2.1.114/linux/drivers/sbus/char/cgfourteen.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/cgfourteen.c Wed Dec 31 16:00:00 1969 @@ -1,475 +0,0 @@ -/* $Id: cgfourteen.c,v 1.26 1998/03/10 20:18:23 jj Exp $ - * cgfourteen.c: Sun SparcStation console support. - * - * Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - * - * TODO: - * - * Add the ioctls for CLUT manipulation. - * Map only the amount requested, not a constant amount. - * XBGR mapping. - * Add the interrupt handler. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include -#include "fb.h" - -#define CG14_MCR_INTENABLE_SHIFT 7 -#define CG14_MCR_INTENABLE_MASK 0x80 -#define CG14_MCR_VIDENABLE_SHIFT 6 -#define CG14_MCR_VIDENABLE_MASK 0x40 -#define CG14_MCR_PIXMODE_SHIFT 4 -#define CG14_MCR_PIXMODE_MASK 0x30 -#define CG14_MCR_TMR_SHIFT 2 -#define CG14_MCR_TMR_MASK 0x0c -#define CG14_MCR_TMENABLE_SHIFT 1 -#define CG14_MCR_TMENABLE_MASK 0x02 -#define CG14_MCR_RESET_SHIFT 0 -#define CG14_MCR_RESET_MASK 0x01 -#define CG14_REV_REVISION_SHIFT 4 -#define CG14_REV_REVISION_MASK 0xf0 -#define CG14_REV_IMPL_SHIFT 0 -#define CG14_REV_IMPL_MASK 0x0f -#define CG14_VBR_FRAMEBASE_SHIFT 12 -#define CG14_VBR_FRAMEBASE_MASK 0x00fff000 -#define CG14_VMCR1_SETUP_SHIFT 0 -#define CG14_VMCR1_SETUP_MASK 0x000001ff -#define CG14_VMCR1_VCONFIG_SHIFT 9 -#define CG14_VMCR1_VCONFIG_MASK 0x00000e00 -#define CG14_VMCR2_REFRESH_SHIFT 0 -#define CG14_VMCR2_REFRESH_MASK 0x00000001 -#define CG14_VMCR2_TESTROWCNT_SHIFT 1 -#define CG14_VMCR2_TESTROWCNT_MASK 0x00000002 -#define CG14_VMCR2_FBCONFIG_SHIFT 2 -#define CG14_VMCR2_FBCONFIG_MASK 0x0000000c -#define CG14_VCR_REFRESHREQ_SHIFT 0 -#define CG14_VCR_REFRESHREQ_MASK 0x000003ff -#define CG14_VCR1_REFRESHENA_SHIFT 10 -#define CG14_VCR1_REFRESHENA_MASK 0x00000400 -#define CG14_VCA_CAD_SHIFT 0 -#define CG14_VCA_CAD_MASK 0x000003ff -#define CG14_VCA_VERS_SHIFT 10 -#define CG14_VCA_VERS_MASK 0x00000c00 -#define CG14_VCA_RAMSPEED_SHIFT 12 -#define CG14_VCA_RAMSPEED_MASK 0x00001000 -#define CG14_VCA_8MB_SHIFT 13 -#define CG14_VCA_8MB_MASK 0x00002000 - -#define CG14_MCR_PIXMODE_8 0 -#define CG14_MCR_PIXMODE_16 2 -#define CG14_MCR_PIXMODE_32 3 - -struct cg14_regs{ - volatile u8 mcr; /* Master Control Reg */ - volatile u8 ppr; /* Packed Pixel Reg */ - volatile u8 tms[2]; /* Test Mode Status Regs */ - volatile u8 msr; /* Master Status Reg */ - volatile u8 fsr; /* Fault Status Reg */ - volatile u8 rev; /* Revision & Impl */ - volatile u8 ccr; /* Clock Control Reg */ - volatile u32 tmr; /* Test Mode Read Back */ - volatile u8 mod; /* Monitor Operation Data Reg */ - volatile u8 acr; /* Aux Control */ - u8 xxx0[6]; - volatile u16 hct; /* Hor Counter */ - volatile u16 vct; /* Vert Counter */ - volatile u16 hbs; /* Hor Blank Start */ - volatile u16 hbc; /* Hor Blank Clear */ - volatile u16 hss; /* Hor Sync Start */ - volatile u16 hsc; /* Hor Sync Clear */ - volatile u16 csc; /* Composite Sync Clear */ - volatile u16 vbs; /* Vert Blank Start */ - volatile u16 vbc; /* Vert Blank Clear */ - volatile u16 vss; /* Vert Sync Start */ - volatile u16 vsc; /* Vert Sync Clear */ - volatile u16 xcs; - volatile u16 xcc; - volatile u16 fsa; /* Fault Status Address */ - volatile u16 adr; /* Address Registers */ - u8 xxx1[0xce]; - volatile u8 pcg[0x100]; /* Pixel Clock Generator */ - volatile u32 vbr; /* Frame Base Row */ - volatile u32 vmcr; /* VBC Master Control */ - volatile u32 vcr; /* VBC refresh */ - volatile u32 vca; /* VBC Config */ -}; - -#define CG14_CCR_ENABLE 0x04 -#define CG14_CCR_SELECT 0x02 /* HW/Full screen */ - -struct cg14_cursor { - volatile u32 cpl0[32]; /* Enable plane 0 */ - volatile u32 cpl1[32]; /* Color selection plane */ - volatile u8 ccr; /* Cursor Control Reg */ - u8 xxx0[3]; - volatile u16 cursx; /* Cursor x,y position */ - volatile u16 cursy; /* Cursor x,y position */ - volatile u32 color0; - volatile u32 color1; - u32 xxx1[0x1bc]; - volatile u32 cpl0i[32]; /* Enable plane 0 autoinc */ - volatile u32 cpl1i[32]; /* Color selection autoinc */ -}; - -struct cg14_dac { - volatile u8 addr; /* Address Register */ - u8 xxx0[255]; - volatile u8 glut; /* Gamma table */ - u8 xxx1[255]; - volatile u8 select; /* Register Select */ - u8 xxx2[255]; - volatile u8 mode; /* Mode Register */ -}; - -struct cg14_xlut{ - volatile u8 x_xlut [256]; - volatile u8 x_xlutd [256]; - u8 xxx0[0x600]; - volatile u8 x_xlut_inc [256]; - volatile u8 x_xlutd_inc [256]; -}; - -/* Color look up table (clut) */ -/* Each one of these arrays hold the color lookup table (for 256 - * colors) for each MDI page (I assume then there should be 4 MDI - * pages, I still wonder what they are. I have seen NeXTStep split - * the screen in four parts, while operating in 24 bits mode. Each - * integer holds 4 values: alpha value (transparency channel, thanks - * go to John Stone (johns@umr.edu) from OpenBSD), red, green and blue - * - * I currently use the clut instead of the Xlut - */ -struct cg14_clut { - unsigned int c_clut [256]; - unsigned int c_clutd [256]; /* i wonder what the 'd' is for */ - unsigned int c_clut_inc [256]; - unsigned int c_clutd_inc [256]; -}; - -static int -cg14_mmap (struct inode *inode, struct file *file, - struct vm_area_struct *vma, long base, fbinfo_t *fb) -{ - uint size, page, r, map_size; - unsigned long map_offset = 0; - uint ram_size = fb->info.cg14.ramsize; - - printk ("RAMSIZE=%d\n", ram_size); - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* Each page, see which map applies */ - for (page = 0; page < size; ){ - switch (vma->vm_offset+page){ - case CG3_MMAP_OFFSET-0x7000: - printk ("Wee! They are mapping the register, report this to miguel@gnu.ai.mit.edu\n"); - printk ("Mapping fb->info.regs!\n"); - map_size = 0x7000; - map_offset = get_phys ((unsigned long) fb->info.cg14.regs); - break; - - case CG3_MMAP_OFFSET: - map_size = size-page; - map_offset = get_phys ((unsigned long) fb->base); - break; - - case MDI_PLANAR_X16_MAP: - map_size = ram_size/2; - map_offset = get_phys ((unsigned long) fb->base) | 0x2000000; - break; - - case MDI_PLANAR_C16_MAP: - map_size = ram_size/2; - map_offset = get_phys ((unsigned long) fb->base) | 0x2800000; - break; - - case MDI_CHUNKY_XBGR_MAP: - map_size = 0; - printk ("Woo Woo: XBGR not there yet\n"); - break; - - case MDI_CHUNKY_BGR_MAP: - map_size = ram_size; - map_offset = get_phys ((unsigned long) fb->base) | 0x1000000; - break; - - case MDI_PLANAR_X32_MAP: - map_size = ram_size/4; - map_offset = get_phys ((unsigned long) fb->base) | 0x3000000; - break; - case MDI_PLANAR_B32_MAP: - map_size = ram_size/4; - map_offset = get_phys ((unsigned long) fb->base) | 0x3400000; - break; - case MDI_PLANAR_G32_MAP: - map_size = ram_size/4; - map_offset = get_phys ((unsigned long) fb->base) | 0x3800000; - break; - case MDI_PLANAR_R32_MAP: - map_size = ram_size/4; - map_offset = get_phys ((unsigned long) fb->base) | 0x3c00000; - break; - - case MDI_CURSOR_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long) fb->info.cg14.cursor_regs); - break; - - case CG14_REGS: - printk ("Wee! They are mapping the register, report this to miguel@gnu.ai.mit.edu\n"); - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long) fb->info.cg14.regs); - break; - - case CG14_XLUT: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long) fb->info.cg14.regs+0x3000); - break; - - case CG14_CLUT1: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long) fb->info.cg14.regs+0x4000); - break; - - case CG14_CLUT2: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long) fb->info.cg14.regs+0x5000); - break; - - default: - map_size = 0; - break; - } - if (!map_size){ - page += PAGE_SIZE; - continue; - } - if (page + map_size > size) - map_size = size - page; - r = io_remap_page_range (vma->vm_start+page, - map_offset, - map_size, vma->vm_page_prot, - fb->space); - if (r) - return -EAGAIN; - page += map_size; - } - - vma->vm_file = file; - file->f_count++; - return 0; -} - -static void -cg14_cmap (fbinfo_t *fb, int index, int count) -{ - struct cg14_clut *clut = fb->info.cg14.clut; - int i; - - for (i = index; count--; i++){ - clut->c_clut [i] = - (fb->color_map CM(i,2) << 16) | - (fb->color_map CM(i,1) << 8) | - (fb->color_map CM(i,0)); - } -} - -static void -cg14_setcursormap (fbinfo_t *fb, unsigned char *red, - unsigned char *green, - unsigned char *blue) -{ - struct cg14_cursor *cur = fb->info.cg14.cursor_regs; - - cur->color0 = ((red[0]) | (green[0] << 8) | (blue[0] << 16)); - cur->color1 = ((red[1]) | (green[1] << 8) | (blue[1] << 16)); -} - -/* Load cursor information */ -static void -cg14_setcursor (fbinfo_t *fb) -{ - struct cg_cursor *c = &fb->cursor; - struct cg14_cursor *cur = fb->info.cg14.cursor_regs; - - if (c->enable) - cur->ccr |= CG14_CCR_ENABLE; - cur->cursx = ((c->cpos.fbx - c->chot.fbx) & 0xfff); - cur->cursy = ((c->cpos.fby - c->chot.fby) & 0xfff); -} - -/* Set cursor shape */ -static void -cg14_setcurshape (fbinfo_t *fb) -{ - struct cg14_cursor *cur = fb->info.cg14.cursor_regs; - int i; - - for (i = 0; i < 32; i++){ - cur->cpl0 [i] = fb->cursor.bits[0][i]; - cur->cpl1 [i] = fb->cursor.bits[1][i]; - } -} - -/* These ones are for putting the video card on 16/32 bpp */ -static int -cg14_ioctl (struct inode *inode, struct file *file, unsigned cmd, unsigned long arg, fbinfo_t *fb) -{ - switch (cmd){ - case MDI_RESET: { - volatile unsigned char *control = &(fb->info.cg14.regs->mcr); - *control = (*control & ~CG14_MCR_PIXMODE_MASK); - } - break; - - case MDI_GET_CFGINFO: { - int error; - struct mdi_cfginfo *mdii; - - error = verify_area (VERIFY_WRITE, (void *) arg, - sizeof (struct mdi_cfginfo)); - if (error) - return error; - - mdii = (struct mdi_cfginfo *) arg; -#if 0 - __put_user_ret(2, &mdii->mdi_ncluts, -EFAULT); - switch (fb->info.cg14.regs->rev & CG14_REV_IMPL_MASK){ - case 0: - case 2: - break; - - case 1: - case 3: - __put_user_ret(3, &mdii->mdi_ncluts, -EFAULT); - break; - default: - printk ("Unknown implementation number\n"); - } -#endif - __put_user_ret(FBTYPE_MDICOLOR, &mdii->mdi_type, -EFAULT); - __put_user_ret(fb->type.fb_height, &mdii->mdi_height, -EFAULT); - __put_user_ret(fb->type.fb_width, &mdii->mdi_width, -EFAULT); - __put_user_ret(fb->info.cg14.video_mode, &mdii->mdi_mode, -EFAULT); - __put_user_ret(72, &mdii->mdi_pixfreq, -EFAULT); /* FIXME */ - __put_user_ret(fb->info.cg14.ramsize, &mdii->mdi_size, -EFAULT); - } - break; - - case MDI_SET_PIXELMODE: { - int newmode; - volatile u8 *control; - - get_user_ret(newmode, (int *)arg, -EFAULT); - control = &(fb->info.cg14.regs->mcr); - switch (newmode){ - case MDI_32_PIX: - *control = (*control & ~CG14_MCR_PIXMODE_MASK) | - (CG14_MCR_PIXMODE_32 << CG14_MCR_PIXMODE_SHIFT); - break; - case MDI_16_PIX: - *control = (*control & ~CG14_MCR_PIXMODE_MASK) | 0x20; - break; - case MDI_8_PIX: - *control = (*control & ~CG14_MCR_PIXMODE_MASK); - break; - - default: - return -ENOSYS; - } - fb->info.cg14.video_mode = newmode; - } - break; - - } /* switch */ - return 0; -} - -static void -cg14_switch_from_graph (void) -{ - fbinfo_t *fb = &(fbinfo [0]); - struct cg14_info *cg14info = (struct cg14_info *) &fb->info.cg14; - - /* Set the 8-bpp mode */ - if (fb->open && fb->mmaped){ - volatile char *mcr = (char *)(&cg14info->regs->mcr); - - fb->info.cg14.video_mode = 8; - *mcr = (*mcr & ~(CG14_MCR_PIXMODE_MASK)); - } -} - -void -cg14_reset (fbinfo_t *fb) -{ - volatile char *mcr = &(fb->info.cg14.regs->mcr); - - *mcr = (*mcr & ~(CG14_MCR_PIXMODE_MASK)); -} - -__initfunc(void cg14_setup (fbinfo_t *fb, int slot, int con_node, u32 cg14, int cg14_io)) -{ - struct cg14_info *cg14info; - uint bases [2]; - unsigned long cg14regs = 0; - struct cg14_regs *regs = 0; - - if (!cg14) { - prom_getproperty (con_node, "address", (char *) &bases[0], 8); - cg14 = bases[1]; - cg14regs = bases[0]; - fb->base = cg14; - fb->info.cg14.regs = (struct cg14_regs *) cg14regs; - regs = (struct cg14_regs *) cg14regs; - } - - if (!cg14regs){ - printk ("The PROM does not have mapped the frame buffer or the registers\n" - "Mr. Penguin can't use that"); - prom_halt (); - } - - fb->type.fb_cmsize = 256; - fb->mmap = cg14_mmap; - fb->loadcmap = cg14_cmap; - fb->setcursor = cg14_setcursor; - fb->setcursormap = cg14_setcursormap; - fb->setcurshape = cg14_setcurshape; - fb->ioctl = cg14_ioctl; - fb->switch_from_graph = cg14_switch_from_graph; - fb->postsetup = cg_postsetup; - fb->reset = cg14_reset; - fb->blank = 0; - fb->unblank = 0; - fb->info.cg14.video_mode = 8; - fb->emulations [1] = FBTYPE_SUN3COLOR; - fb->type.fb_depth = 24; - cg14info = (struct cg14_info *) &fb->info.cg14; - cg14info->clut = (void *) (cg14regs + CG14_CLUT1); - cg14info->cursor_regs = (void *) (cg14regs + CG14_CURSORREGS); - - /* If the bit is turned on, the card has 8 mb of ram, otherwise just 4 */ - cg14info->ramsize = (regs->vca & CG14_VCA_8MB_MASK ? 8 : 4) * 1024 * 1024; - printk ("cgfourteen%d at 0x%8.8x with %d megs of RAM rev=%d, impl=%d\n", - slot, cg14, cg14info->ramsize/(1024*1024), regs->rev >> 4, regs->rev & 0xf); -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/cgsix.c linux/drivers/sbus/char/cgsix.c --- v2.1.114/linux/drivers/sbus/char/cgsix.c Sun Jun 7 11:16:33 1998 +++ linux/drivers/sbus/char/cgsix.c Wed Dec 31 16:00:00 1969 @@ -1,688 +0,0 @@ -/* $Id: cgsix.c,v 1.39 1998/03/10 20:18:25 jj Exp $ - * cgsix.c: cgsix frame buffer driver - * - * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) - */ -#include -#include -#include -#include - -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include -#include "fb.h" -#include "cg_common.h" - -/* Offset of interesting structures in the OBIO space */ -/* - * Brooktree is the video dac and is funny to program on the cg6. - * (it's even funnier on the cg3) - * The FBC could be the frame buffer control - * The FHC could is the frame buffer hardware control. - */ -#define CG6_ROM_OFFSET 0x0 -#define CG6_BROOKTREE_OFFSET 0x200000 -#define CG6_DHC_OFFSET 0x240000 -#define CG6_ALT_OFFSET 0x280000 -#define CG6_FHC_OFFSET 0x300000 -#define CG6_THC_OFFSET 0x301000 -#define CG6_FBC_OFFSET 0x700000 -#define CG6_TEC_OFFSET 0x701000 -#define CG6_RAM_OFFSET 0x800000 - -/* FHC definitions */ -#define CG6_FHC_FBID_SHIFT 24 -#define CG6_FHC_FBID_MASK 255 -#define CG6_FHC_REV_SHIFT 20 -#define CG6_FHC_REV_MASK 15 -#define CG6_FHC_FROP_DISABLE (1 << 19) -#define CG6_FHC_ROW_DISABLE (1 << 18) -#define CG6_FHC_SRC_DISABLE (1 << 17) -#define CG6_FHC_DST_DISABLE (1 << 16) -#define CG6_FHC_RESET (1 << 15) -#define CG6_FHC_LITTLE_ENDIAN (1 << 13) -#define CG6_FHC_RES_MASK (3 << 11) -#define CG6_FHC_1024 (0 << 11) -#define CG6_FHC_1152 (1 << 11) -#define CG6_FHC_1280 (2 << 11) -#define CG6_FHC_1600 (3 << 11) -#define CG6_FHC_CPU_MASK (3 << 9) -#define CG6_FHC_CPU_SPARC (0 << 9) -#define CG6_FHC_CPU_68020 (1 << 9) -#define CG6_FHC_CPU_386 (2 << 9) -#define CG6_FHC_TEST (1 << 8) -#define CG6_FHC_TEST_X_SHIFT 4 -#define CG6_FHC_TEST_X_MASK 15 -#define CG6_FHC_TEST_Y_SHIFT 0 -#define CG6_FHC_TEST_Y_MASK 15 - -/* FBC mode definitions */ -#define CG6_FBC_BLIT_IGNORE 0x00000000 -#define CG6_FBC_BLIT_NOSRC 0x00100000 -#define CG6_FBC_BLIT_SRC 0x00200000 -#define CG6_FBC_BLIT_ILLEGAL 0x00300000 -#define CG6_FBC_BLIT_MASK 0x00300000 - -#define CG6_FBC_VBLANK 0x00080000 - -#define CG6_FBC_MODE_IGNORE 0x00000000 -#define CG6_FBC_MODE_COLOR8 0x00020000 -#define CG6_FBC_MODE_COLOR1 0x00040000 -#define CG6_FBC_MODE_HRMONO 0x00060000 -#define CG6_FBC_MODE_MASK 0x00060000 - -#define CG6_FBC_DRAW_IGNORE 0x00000000 -#define CG6_FBC_DRAW_RENDER 0x00008000 -#define CG6_FBC_DRAW_PICK 0x00010000 -#define CG6_FBC_DRAW_ILLEGAL 0x00018000 -#define CG6_FBC_DRAW_MASK 0x00018000 - -#define CG6_FBC_BWRITE0_IGNORE 0x00000000 -#define CG6_FBC_BWRITE0_ENABLE 0x00002000 -#define CG6_FBC_BWRITE0_DISABLE 0x00004000 -#define CG6_FBC_BWRITE0_ILLEGAL 0x00006000 -#define CG6_FBC_BWRITE0_MASK 0x00006000 - -#define CG6_FBC_BWRITE1_IGNORE 0x00000000 -#define CG6_FBC_BWRITE1_ENABLE 0x00000800 -#define CG6_FBC_BWRITE1_DISABLE 0x00001000 -#define CG6_FBC_BWRITE1_ILLEGAL 0x00001800 -#define CG6_FBC_BWRITE1_MASK 0x00001800 - -#define CG6_FBC_BREAD_IGNORE 0x00000000 -#define CG6_FBC_BREAD_0 0x00000200 -#define CG6_FBC_BREAD_1 0x00000400 -#define CG6_FBC_BREAD_ILLEGAL 0x00000600 -#define CG6_FBC_BREAD_MASK 0x00000600 - -#define CG6_FBC_BDISP_IGNORE 0x00000000 -#define CG6_FBC_BDISP_0 0x00000080 -#define CG6_FBC_BDISP_1 0x00000100 -#define CG6_FBC_BDISP_ILLEGAL 0x00000180 -#define CG6_FBC_BDISP_MASK 0x00000180 - -#define CG6_FBC_INDEX_MOD 0x00000040 -#define CG6_FBC_INDEX_MASK 0x00000030 - -/* THC definitions */ -#define CG6_THC_MISC_REV_SHIFT 16 -#define CG6_THC_MISC_REV_MASK 15 -#define CG6_THC_MISC_RESET (1 << 12) -#define CG6_THC_MISC_VIDEO (1 << 10) -#define CG6_THC_MISC_SYNC (1 << 9) -#define CG6_THC_MISC_VSYNC (1 << 8) -#define CG6_THC_MISC_SYNC_ENAB (1 << 7) -#define CG6_THC_MISC_CURS_RES (1 << 6) -#define CG6_THC_MISC_INT_ENAB (1 << 5) -#define CG6_THC_MISC_INT (1 << 4) -#define CG6_THC_MISC_INIT 0x9f - -/* The contents are unknown */ -struct cg6_tec { - volatile int tec_matrix; - volatile int tec_clip; - volatile int tec_vdc; -}; - -struct cg6_thc { - uint thc_pad0[512]; - volatile uint thc_hs; /* hsync timing */ - volatile uint thc_hsdvs; - volatile uint thc_hd; - volatile uint thc_vs; /* vsync timing */ - volatile uint thc_vd; - volatile uint thc_refresh; - volatile uint thc_misc; - uint thc_pad1[56]; - volatile uint thc_cursxy; /* cursor x,y position (16 bits each) */ - volatile uint thc_cursmask[32]; /* cursor mask bits */ - volatile uint thc_cursbits[32]; /* what to show where mask enabled */ -}; - -struct cg6_fbc { - u32 xxx0[1]; - volatile u32 mode; - volatile u32 clip; - u32 xxx1[1]; - volatile u32 s; - volatile u32 draw; - volatile u32 blit; - volatile u32 font; - u32 xxx2[24]; - volatile u32 x0, y0, z0, color0; - volatile u32 x1, y1, z1, color1; - volatile u32 x2, y2, z2, color2; - volatile u32 x3, y3, z3, color3; - volatile u32 offx, offy; - u32 xxx3[2]; - volatile u32 incx, incy; - u32 xxx4[2]; - volatile u32 clipminx, clipminy; - u32 xxx5[2]; - volatile u32 clipmaxx, clipmaxy; - u32 xxx6[2]; - volatile u32 fg; - volatile u32 bg; - volatile u32 alu; - volatile u32 pm; - volatile u32 pixelm; - u32 xxx7[2]; - volatile u32 patalign; - volatile u32 pattern[8]; - u32 xxx8[432]; - volatile u32 apointx, apointy, apointz; - u32 xxx9[1]; - volatile u32 rpointx, rpointy, rpointz; - u32 xxx10[5]; - volatile u32 pointr, pointg, pointb, pointa; - volatile u32 alinex, aliney, alinez; - u32 xxx11[1]; - volatile u32 rlinex, rliney, rlinez; - u32 xxx12[5]; - volatile u32 liner, lineg, lineb, linea; - volatile u32 atrix, atriy, atriz; - u32 xxx13[1]; - volatile u32 rtrix, rtriy, rtriz; - u32 xxx14[5]; - volatile u32 trir, trig, trib, tria; - volatile u32 aquadx, aquady, aquadz; - u32 xxx15[1]; - volatile u32 rquadx, rquady, rquadz; - u32 xxx16[5]; - volatile u32 quadr, quadg, quadb, quada; - volatile u32 arectx, arecty, arectz; - u32 xxx17[1]; - volatile u32 rrectx, rrecty, rrectz; - u32 xxx18[5]; - volatile u32 rectr, rectg, rectb, recta; -}; - -static void -cg6_restore_palette (fbinfo_t *fbinfo) -{ - volatile struct bt_regs *bt; - - bt = fbinfo->info.cg6.bt; - bt->addr = 0; - bt->color_map = 0xffffffff; - bt->color_map = 0xffffffff; - bt->color_map = 0xffffffff; -} - -static void cg6_blitc(unsigned short, int, int); -static void cg6_setw(int, int, unsigned short, int); -static void cg6_cpyw(int, int, unsigned short *, int); - -#if 0 -static void cg6_fill(int, int, int *); -#endif - -/* Ugh: X wants to mmap a bunch of cute stuff at the same time :-( */ -/* So, we just mmap the things that are being asked for */ -static int -cg6_mmap (struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - uint size, page, r, map_size; - unsigned long map_offset = 0; - - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - -#ifdef __sparc_v9__ - /* Try to align RAM */ -#define ALIGNMENT 0x80000 - map_offset = vma->vm_offset + size; - if (vma->vm_offset <= CG6_RAM && map_offset >= CG6_RAM + fb->type.fb_size) { - struct vm_area_struct *vmm = find_vma(current->mm, vma->vm_start); - int alignment = ALIGNMENT - ((vma->vm_start + CG6_RAM - vma->vm_offset) & (ALIGNMENT - 1)); - int sz = 0, fbsz; - - if (alignment == ALIGNMENT) alignment = 0; - fbsz = ((fb->type.fb_size + ALIGNMENT - 1) & ~(ALIGNMENT - 1)); - if (map_offset < CG6_RAM + fbsz) - sz = fbsz - map_offset + CG6_RAM; - if ((sz || alignment) && (!vmm || vmm->vm_start >= vma->vm_end + sz + alignment)) { - vma->vm_start += alignment; - vma->vm_end += alignment + sz; - } - } -#undef ALIGNMENT -#endif - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* Each page, see which map applies */ - for (page = 0; page < size; ){ - switch (vma->vm_offset+page){ - case CG6_TEC: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.cg6.tec) & PAGE_MASK; - break; - case CG6_FBC: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.cg6.fbc); - break; - case CG6_FHC: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.cg6.fhc); - break; - case CG6_THC: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.cg6.thc) & PAGE_MASK; - break; - case CG6_BTREGS: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.cg6.bt); - break; - - /* For Ultra, make sure the following two are right. - * The above two happen to work out (for example FBC and - * TEC will get mapped by one I/O page mapping because - * of the 8192 byte page size, same for FHC/THC. -DaveM - */ - - case CG6_DHC: - map_size = /* PAGE_SIZE * 40 */ (4096 * 40); - map_offset = get_phys ((unsigned long)fb->info.cg6.dhc); - break; - case CG6_ROM: - map_size = /* PAGE_SIZE * 16 */ (4096 * 16); - map_offset = get_phys ((unsigned long)fb->info.cg6.rom); - break; - case CG6_RAM: - map_size = size-page; - map_offset = get_phys ((unsigned long) fb->base); - if (map_size < fb->type.fb_size) - map_size = fb->type.fb_size; - break; - default: - map_size = 0; - break; - } - if (!map_size){ - page += PAGE_SIZE; - continue; - } - if (page + map_size > size) - map_size = size - page; - r = io_remap_page_range (vma->vm_start+page, - map_offset, - map_size, vma->vm_page_prot, - fb->space); - if (r) - return -EAGAIN; - page += map_size; - } - - vma->vm_file = file; - file->f_count++; - return 0; -} - -static void -cg6_loadcmap (fbinfo_t *fb, int index, int count) -{ - struct bt_regs *bt = fb->info.cg6.bt; - int i; - - bt->addr = index << 24; - for (i = index; count--; i++){ - bt->color_map = fb->color_map CM(i,0) << 24; - bt->color_map = fb->color_map CM(i,1) << 24; - bt->color_map = fb->color_map CM(i,2) << 24; - } -} - -static void -cg6_setcursormap (fbinfo_t *fb, unsigned char *red, - unsigned char *green, - unsigned char *blue) -{ - struct bt_regs *bt = fb->info.cg6.bt; - - bt->addr = 1 << 24; - bt->cursor = red[0] << 24; - bt->cursor = green[0] << 24; - bt->cursor = blue[0] << 24; - bt->addr = 3 << 24; - bt->cursor = red[1] << 24; - bt->cursor = green[1] << 24; - bt->cursor = blue[1] << 24; -} - -/* Load cursor information */ -static void -cg6_setcursor (fbinfo_t *fb) -{ - uint v; - struct cg_cursor *c = &fb->cursor; - - if (c->enable){ - v = ((c->cpos.fbx - c->chot.fbx) << 16) - |((c->cpos.fby - c->chot.fby) & 0xffff); - } else { - /* Magic constant to turn off the cursor */ - v = ((65536-32) << 16) | (65536-32); - } - fb->info.cg6.thc->thc_cursxy = v; -} - -/* Set cursor shape */ -static void -cg6_setcurshape (fbinfo_t *fb) -{ - struct cg6_thc *thc = fb->info.cg6.thc; - int i; - - for (i = 0; i < 32; i++){ - thc->thc_cursmask [i] = fb->cursor.bits[0][i]; - thc->thc_cursbits [i] = fb->cursor.bits[1][i]; - } -} - -static void -cg6_blank (fbinfo_t *fb) -{ - fb->info.cg6.thc->thc_misc &= ~CG6_THC_MISC_VIDEO; - /* This should put us in power-save */ - fb->info.cg6.thc->thc_misc &= ~CG6_THC_MISC_SYNC_ENAB; -} - -static void -cg6_unblank (fbinfo_t *fb) -{ - fb->info.cg6.thc->thc_misc |= CG6_THC_MISC_SYNC_ENAB; - fb->info.cg6.thc->thc_misc |= CG6_THC_MISC_VIDEO; -} - -void -cg6_reset (fbinfo_t *fb) -{ - struct cg6_info *cg6 = &(fb->info.cg6); - unsigned int rev, conf; - - if (fb == &fbinfo[0]) - sbus_hw_hide_cursor (); - /* Turn off stuff in the Transform Engine. */ - cg6->tec->tec_matrix = 0; - cg6->tec->tec_clip = 0; - cg6->tec->tec_vdc = 0; - - /* Take care of bugs in old revisions. */ - rev = (*(cg6->fhc) >> CG6_FHC_REV_SHIFT) & CG6_FHC_REV_MASK; - if (rev < 5) { - conf = (*(cg6->fhc) & CG6_FHC_RES_MASK) | - CG6_FHC_CPU_68020 | CG6_FHC_TEST | - (11 << CG6_FHC_TEST_X_SHIFT) | - (11 << CG6_FHC_TEST_Y_SHIFT); - if (rev < 2) - conf |= CG6_FHC_DST_DISABLE; - *(cg6->fhc) = conf; - } - - /* Set things in the FBC. */ - cg6->fbc->mode &= ~(CG6_FBC_BLIT_MASK | CG6_FBC_MODE_MASK | - CG6_FBC_DRAW_MASK | CG6_FBC_BWRITE0_MASK | - CG6_FBC_BWRITE1_MASK | CG6_FBC_BREAD_MASK | - CG6_FBC_BDISP_MASK); - cg6->fbc->mode |= (CG6_FBC_BLIT_SRC | CG6_FBC_MODE_COLOR8 | - CG6_FBC_DRAW_RENDER | CG6_FBC_BWRITE0_ENABLE | - CG6_FBC_BWRITE1_DISABLE | CG6_FBC_BREAD_0 | - CG6_FBC_BDISP_0); - cg6->fbc->clip = 0; - cg6->fbc->offx = 0; - cg6->fbc->offy = 0; - cg6->fbc->clipminx = 0; - cg6->fbc->clipminy = 0; - cg6->fbc->clipmaxx = fb->type.fb_width - 1; - cg6->fbc->clipmaxy = fb->type.fb_height - 1; - /* Enable cursor in Brooktree DAC. */ - cg6->bt->addr = 0x06 << 24; - cg6->bt->control |= 0x03 << 24; -} - -__initfunc(void cg6_setup (fbinfo_t *fb, int slot, u32 cg6, int cg6_io)) -{ - struct cg6_info *cg6info; - unsigned int rev, cpu, conf; - - printk ("cgsix%d at 0x%8.8x ", slot, cg6); - - /* Fill in parameters we left out */ - fb->type.fb_cmsize = 256; - fb->mmap = cg6_mmap; - fb->loadcmap = cg6_loadcmap; - fb->reset = cg6_reset; - fb->blank = cg6_blank; - fb->unblank = cg6_unblank; - fb->setcursor = cg6_setcursor; - fb->setcursormap = cg6_setcursormap; - fb->setcurshape = cg6_setcurshape; - fb->postsetup = cg_postsetup; - fb->blitc = cg6_blitc; - fb->setw = cg6_setw; - fb->cpyw = cg6_cpyw; - - cg6info = (struct cg6_info *) &fb->info.cg6; - - /* Map the hardware registers */ - cg6info->bt = sparc_alloc_io (cg6+CG6_BROOKTREE_OFFSET, 0, - sizeof (struct bt_regs), "cgsix_dac", cg6_io, 0); - cg6info->fhc = sparc_alloc_io (cg6+CG6_FHC_OFFSET, 0, - sizeof (int), "cgsix_fhc", cg6_io, 0); -#if PAGE_SHIFT <= 12 - cg6info->thc = sparc_alloc_io (cg6+CG6_THC_OFFSET, 0, - sizeof (struct cg6_thc), "cgsix_thc", cg6_io, 0); -#else - cg6info->thc = (struct cg6_thc *)(((char *)cg6info->fhc)+0x1000); -#endif - cg6info->fbc = sparc_alloc_io (cg6+CG6_FBC_OFFSET, 0, - 0x1000, "cgsix_fbc", cg6_io, 0); -#if PAGE_SHIFT <= 12 - cg6info->tec = sparc_alloc_io (cg6+CG6_TEC_OFFSET, 0, - sizeof (struct cg6_tec), "cgsix_tec", cg6_io, 0); -#else - cg6info->tec = (struct cg6_tec *)(((char *)cg6info->fbc)+0x1000); -#endif - cg6info->dhc = sparc_alloc_io (cg6+CG6_DHC_OFFSET, 0, - 0x40000, "cgsix_dhc", cg6_io, 0); - cg6info->rom = sparc_alloc_io (cg6+CG6_ROM_OFFSET, 0, - 0x10000, "cgsix_rom", cg6_io, 0); - if (!fb->base) { - fb->base = (unsigned long) - sparc_alloc_io (cg6+CG6_RAM_OFFSET, 0, - fb->type.fb_size, "cgsix_ram", cg6_io, 0); - } - if (slot == sun_prom_console_id) - fb_restore_palette = cg6_restore_palette; - - /* Initialize Brooktree DAC */ - cg6info->bt->addr = 0x04 << 24; /* color planes */ - cg6info->bt->control = 0xff << 24; - cg6info->bt->addr = 0x05 << 24; - cg6info->bt->control = 0x00 << 24; - cg6info->bt->addr = 0x06 << 24; /* overlay plane */ - cg6info->bt->control = 0x73 << 24; - cg6info->bt->addr = 0x07 << 24; - cg6info->bt->control = 0x00 << 24; - -#ifdef __sparc_v9__ - printk("VA %016lx ", fb->base); -#endif - - printk("TEC Rev %x ", - (cg6info->thc->thc_misc >> CG6_THC_MISC_REV_SHIFT) & - CG6_THC_MISC_REV_MASK); - - /* Get FHC Revision */ - conf = *(cg6info->fhc); - - cpu = conf & CG6_FHC_CPU_MASK; - printk("CPU "); - if (cpu == CG6_FHC_CPU_SPARC) - printk("sparc "); - else if (cpu == CG6_FHC_CPU_68020) - printk("68020 "); - else - printk("386 "); - - rev = conf >> CG6_FHC_REV_SHIFT & CG6_FHC_REV_MASK; - printk("Rev %x\n", rev); - - if (slot && sun_prom_console_id == slot) - return; - - /* Reset the cg6 */ - cg6_reset(fb); - - if (!slot) { - /* Enable Video */ - cg6_unblank(fb); - } else { - cg6_blank(fb); - } -} - -extern unsigned char vga_font[]; - -#define GX_BLITC_START(attr) \ - { \ - register struct cg6_fbc *gx = fbinfo[0].info.cg6.fbc; \ - register uint i; \ - do { \ - i = gx->s; \ - } while (i & 0x10000000); \ - gx->fg = attr & 0xf; \ - gx->bg = (attr>>4); \ - gx->mode = 0x140000; \ - gx->alu = 0xe880fc30; \ - gx->pixelm = ~(0); \ - gx->s = 0; \ - gx->clip = 0; \ - gx->pm = 0xff; -#define GX_BLITC_BODY4(count,x,y,start,action) \ - while (count >= 4) { \ - count -= 4; \ - gx->incx = 0; \ - gx->incy = 1; \ - gx->x0 = x; \ - gx->x1 = (x += 32) - 1; \ - gx->y0 = y; \ - start; \ - for (i = 0; i < CHAR_HEIGHT; i++) { \ - action; \ - } \ - } -#define GX_BLITC_BODY1(x,y,action) \ - gx->incx = 0; \ - gx->incy = 1; \ - gx->x0 = x; \ - gx->x1 = (x += 8) - 1; \ - gx->y0 = y; \ - for (i = 0; i < CHAR_HEIGHT; i++) { \ - action; \ - } -#define GX_BLITC_END \ - } - -static void cg6_blitc(unsigned short charattr, int xoff, int yoff) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(charattr); - unsigned char *p = &vga_font[((unsigned char)charattr) << 4]; - GX_BLITC_START(attrib) - GX_BLITC_BODY1(xoff, yoff, gx->font=((*p++) << 24)) - GX_BLITC_END -} - -static void cg6_setw(int xoff, int yoff, unsigned short c, int count) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(c); - unsigned char *p = &vga_font[((unsigned char)c) << 4]; - register unsigned char *q; - register uint l; - GX_BLITC_START(attrib) - if (count >= 4) { - GX_BLITC_BODY4(count, xoff, yoff, q = p, - l = *q++; - l |= l << 8; - l |= l << 16; - gx->font=l) - } - while (count) { - count--; - q = p; - GX_BLITC_BODY1(xoff, yoff, gx->font=((*q++) << 24)); - } - GX_BLITC_END -} - -static void cg6_cpyw(int xoff, int yoff, unsigned short *p, int count) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(*p); - unsigned char *p1, *p2, *p3, *p4; - GX_BLITC_START(attrib) - if (count >= 4) { - GX_BLITC_BODY4(count, xoff, yoff, - p1 = &vga_font[((unsigned char)*p++) << 4]; - p2 = &vga_font[((unsigned char)*p++) << 4]; - p3 = &vga_font[((unsigned char)*p++) << 4]; - p4 = &vga_font[((unsigned char)*p++) << 4], - gx->font=((uint)*p4++) | ((((uint)*p3++) | ((((uint)*p2++) | (((uint)*p1++) << 8)) << 8)) << 8)) - } - while (count) { - count--; - p1 = &vga_font[((unsigned char)*p++) << 4]; - GX_BLITC_BODY1(xoff, yoff, gx->font=((*p1++) << 24)); - } - GX_BLITC_END -} - -#define GX_FILL_START(attr) \ - { \ - register struct cg6_fbc *gx = fbinfo[0].info.cg6.fbc; \ - register uint i; \ - do { \ - i = gx->s; \ - } while (i & 0x10000000); \ - gx->fg = attr & 0xf; \ - gx->bg = 0; \ - gx->pixelm = ~(0); \ - gx->s = 0; \ - gx->alu = 0xea80ff00; \ - gx->pm = ~(0); \ - gx->clip = 0; -#define GX_FILL_END \ - } - -#if 0 -static void cg6_fill(int attrib, int count, int *boxes) -{ - register int r; - - attrib = 5; - GX_FILL_START(attrib) - while (count-- > 0) { - gx->arecty = boxes[1]; - gx->arectx = boxes[0]; - gx->arecty = boxes[3]; - gx->arecty = boxes[2]; - boxes += 4; - do { - r = gx->draw; - } while (r < 0 && (r & 0x20000000) ); - } - GX_FILL_END -} -#endif diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/cgthree.c linux/drivers/sbus/char/cgthree.c --- v2.1.114/linux/drivers/sbus/char/cgthree.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/cgthree.c Wed Dec 31 16:00:00 1969 @@ -1,268 +0,0 @@ -/* $Id: cgthree.c,v 1.25 1998/03/10 20:18:27 jj Exp $ - * cgtree.c: cg3 frame buffer driver - * - * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) - * - * Support for cgRDI added, Nov/96, jj. - */ - -#include -#include -#include -#include - -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include -#include "fb.h" -#include "cg_common.h" - - -/* Control Register Constants */ -#define CG3_CR_ENABLE_INTS 0x80 -#define CG3_CR_ENABLE_VIDEO 0x40 -#define CG3_CR_ENABLE_TIMING 0x20 -#define CG3_CR_ENABLE_CURCMP 0x10 -#define CG3_CR_XTAL_MASK 0x0c -#define CG3_CR_DIVISOR_MASK 0x03 - -/* Status Register Constants */ -#define CG3_SR_PENDING_INT 0x80 -#define CG3_SR_RES_MASK 0x70 -#define CG3_SR_1152_900_76_A 0x40 -#define CG3_SR_1152_900_76_B 0x60 -#define CG3_SR_ID_MASK 0x0f -#define CG3_SR_ID_COLOR 0x01 -#define CG3_SR_ID_MONO 0x02 -#define CG3_SR_ID_MONO_ECL 0x03 - - -enum cg3_type { - CG3_AT_66HZ = 0, - CG3_AT_76HZ, - CG3_RDI -}; - - -struct cg3_regs { - struct bt_regs cmap; - volatile u8 control; - volatile u8 status; - volatile u8 cursor_start; - volatile u8 cursor_end; - volatile u8 h_blank_start; - volatile u8 h_blank_end; - volatile u8 h_sync_start; - volatile u8 h_sync_end; - volatile u8 comp_sync_end; - volatile u8 v_blank_start_high; - volatile u8 v_blank_start_low; - volatile u8 v_blank_end; - volatile u8 v_sync_start; - volatile u8 v_sync_end; - volatile u8 xfer_holdoff_start; - volatile u8 xfer_holdoff_end; -}; - -/* The cg3 palette is loaded with 4 color values at each time */ -/* so you end up with: (rgb)(r), (gb)(rg), (b)(rgb), and so on */ -static void -cg3_loadcmap (fbinfo_t *fb, int index, int count) -{ - struct bt_regs *bt = &fb->info.cg3.regs->cmap; - int *i, steps; - - i = (((int *)fb->color_map) + D4M3(index)); - steps = D4M3(index+count-1) - D4M3(index)+3; - - *(volatile u8 *)&bt->addr = (u8)D4M4(index); - while (steps--) - bt->color_map = *i++; -} - -/* The cg3 is presumed to emulate a cg4, I guess older programs will want that - * addresses above 0x4000000 are for cg3, below that it's cg4 emulation. - */ -static int -cg3_mmap (struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - uint size, page, r, map_size; - unsigned long map_offset = 0; - - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* Each page, see which map applies */ - for (page = 0; page < size; ){ - switch (vma->vm_offset+page){ - case CG3_MMAP_OFFSET: - map_size = size-page; - map_offset = get_phys ((unsigned long) fb->base); - if (map_size > fb->type.fb_size) - map_size = fb->type.fb_size; - break; - default: - map_size = 0; - break; - } - if (!map_size){ - page += PAGE_SIZE; - continue; - } - if (page + map_size > size) - map_size = size - page; - r = io_remap_page_range (vma->vm_start+page, - map_offset, - map_size, vma->vm_page_prot, - fb->space); - if (r) - return -EAGAIN; - page += map_size; - } - - vma->vm_file = file; - file->f_count++; - return 0; -} - -static void -cg3_blank (fbinfo_t *fb) -{ - fb->info.cg3.regs->control &= ~CG3_CR_ENABLE_VIDEO; -} - -static void -cg3_unblank (fbinfo_t *fb) -{ - fb->info.cg3.regs->control |= CG3_CR_ENABLE_VIDEO; -} - - -static u8 cg3regvals_66hz[] __initdata = { /* 1152 x 900, 66 Hz */ - 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, - 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, - 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x20, 0 -}; - -static u8 cg3regvals_76hz[] __initdata = { /* 1152 x 900, 76 Hz */ - 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, - 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, - 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x24, 0 -}; - -static u8 cg3regvals_rdi[] __initdata = { /* 640 x 480, cgRDI */ - 0x14, 0x70, 0x15, 0x20, 0x16, 0x08, 0x17, 0x10, - 0x18, 0x06, 0x19, 0x02, 0x1a, 0x31, 0x1b, 0x51, - 0x1c, 0x06, 0x1d, 0x0c, 0x1e, 0xff, 0x1f, 0x01, - 0x10, 0x22, 0 -}; - -static u8 *cg3_regvals[] __initdata = { - cg3regvals_66hz, cg3regvals_76hz, cg3regvals_rdi -}; - -static u_char cg3_dacvals[] __initdata = { - 4, 0xff, 5, 0x00, 6, 0x70, 7, 0x00, 0 -}; - - -__initfunc(void cg3_setup (fbinfo_t *fb, int slot, u32 cg3, int cg3_io, - struct linux_sbus_device *sbdp)) -{ - struct cg3_info *cg3info = (struct cg3_info *) &fb->info.cg3; - - if (strstr (sbdp->prom_name, "cgRDI")) { - char buffer[40]; - char *p; - int w, h; - - prom_getstring (sbdp->prom_node, "params", - buffer, sizeof(buffer)); - if (*buffer) { - w = simple_strtoul (buffer, &p, 10); - if (w && *p == 'x') { - h = simple_strtoul (p + 1, &p, 10); - if (h && *p == '-') { - fb->type.fb_width = w; - fb->type.fb_height = h; - } - } - } - printk ("cgRDI%d at 0x%8.8x\n", slot, cg3); - cg3info->cgrdi = 1; - } else { - printk ("cgthree%d at 0x%8.8x\n", slot, cg3); - cg3info->cgrdi = 0; - } - - /* Fill in parameters we left out */ - fb->type.fb_cmsize = 256; - fb->mmap = cg3_mmap; - fb->loadcmap = cg3_loadcmap; - fb->postsetup = cg_postsetup; - fb->ioctl = 0; /* no special ioctls */ - fb->reset = 0; - fb->blank = cg3_blank; - fb->unblank = cg3_unblank; - - /* Map the card registers */ - cg3info->regs = sparc_alloc_io (cg3+CG3_REGS, 0, - sizeof (struct cg3_regs),"cg3_regs", cg3_io, 0); - - if (!prom_getbool(sbdp->prom_node, "width")) { - /* Ugh, broken PROM didn't initialize us. - * Let's deal with this ourselves. - */ - u8 status, mon; - enum cg3_type type; - u8 *p; - - if (cg3info->cgrdi) { - type = CG3_RDI; - } else { - status = cg3info->regs->status; - if ((status & CG3_SR_ID_MASK) == CG3_SR_ID_COLOR) { - mon = status & CG3_SR_RES_MASK; - if (mon == CG3_SR_1152_900_76_A || - mon == CG3_SR_1152_900_76_B) - type = CG3_AT_76HZ; - else - type = CG3_AT_66HZ; - } else { - prom_printf("cgthree: can't handle SR %02x\n", - status); - prom_halt(); - return; /* fool gcc. */ - } - } - - for (p = cg3_regvals[type]; *p; p += 2) - ((u8 *)cg3info->regs)[p[0]] = p[1]; - - for (p = cg3_dacvals; *p; p += 2) { - *(volatile u8 *)&cg3info->regs->cmap.addr = p[0]; - *(volatile u8 *)&cg3info->regs->cmap.control = p[1]; - } - } - - if (!fb->base){ - fb->base=(unsigned long) sparc_alloc_io (cg3+CG3_RAM, 0, - fb->type.fb_size, "cg3_ram", cg3_io, 0); - } -} - diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/creator.c linux/drivers/sbus/char/creator.c --- v2.1.114/linux/drivers/sbus/char/creator.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/creator.c Wed Dec 31 16:00:00 1969 @@ -1,733 +0,0 @@ -/* $Id: creator.c,v 1.15 1998/04/13 07:26:55 davem Exp $ - * creator.c: Creator/Creator3D frame buffer driver - * - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include -#include "fb.h" -#include "cg_common.h" - -#define FFB_SFB8R_VOFF 0x00000000 -#define FFB_SFB8G_VOFF 0x00400000 -#define FFB_SFB8B_VOFF 0x00800000 -#define FFB_SFB8X_VOFF 0x00c00000 -#define FFB_SFB32_VOFF 0x01000000 -#define FFB_SFB64_VOFF 0x02000000 -#define FFB_FBC_REGS_VOFF 0x04000000 -#define FFB_BM_FBC_REGS_VOFF 0x04002000 -#define FFB_DFB8R_VOFF 0x04004000 -#define FFB_DFB8G_VOFF 0x04404000 -#define FFB_DFB8B_VOFF 0x04804000 -#define FFB_DFB8X_VOFF 0x04c04000 -#define FFB_DFB24_VOFF 0x05004000 -#define FFB_DFB32_VOFF 0x06004000 -#define FFB_DFB422A_VOFF 0x07004000 /* DFB 422 mode write to A */ -#define FFB_DFB422AD_VOFF 0x07804000 /* DFB 422 mode with line doubling */ -#define FFB_DFB24B_VOFF 0x08004000 /* DFB 24bit mode write to B */ -#define FFB_DFB422B_VOFF 0x09004000 /* DFB 422 mode write to B */ -#define FFB_DFB422BD_VOFF 0x09804000 /* DFB 422 mode with line doubling */ -#define FFB_SFB16Z_VOFF 0x0a004000 /* 16bit mode Z planes */ -#define FFB_SFB8Z_VOFF 0x0a404000 /* 8bit mode Z planes */ -#define FFB_SFB422_VOFF 0x0ac04000 /* SFB 422 mode write to A/B */ -#define FFB_SFB422D_VOFF 0x0b404000 /* SFB 422 mode with line doubling */ -#define FFB_FBC_KREGS_VOFF 0x0bc04000 -#define FFB_DAC_VOFF 0x0bc06000 -#define FFB_PROM_VOFF 0x0bc08000 -#define FFB_EXP_VOFF 0x0bc18000 - -#define FFB_SFB8R_POFF 0x04000000 -#define FFB_SFB8G_POFF 0x04400000 -#define FFB_SFB8B_POFF 0x04800000 -#define FFB_SFB8X_POFF 0x04c00000 -#define FFB_SFB32_POFF 0x05000000 -#define FFB_SFB64_POFF 0x06000000 -#define FFB_FBC_REGS_POFF 0x00600000 -#define FFB_BM_FBC_REGS_POFF 0x00600000 -#define FFB_DFB8R_POFF 0x01000000 -#define FFB_DFB8G_POFF 0x01400000 -#define FFB_DFB8B_POFF 0x01800000 -#define FFB_DFB8X_POFF 0x01c00000 -#define FFB_DFB24_POFF 0x02000000 -#define FFB_DFB32_POFF 0x03000000 -#define FFB_FBC_KREGS_POFF 0x00610000 -#define FFB_DAC_POFF 0x00400000 -#define FFB_PROM_POFF 0x00000000 -#define FFB_EXP_POFF 0x00200000 - -#define FFB_Y_BYTE_ADDR_SHIFT 11 -#define FFB_Y_ADDR_SHIFT 13 - -#define FFB_PPC_ACE_DISABLE 1 -#define FFB_PPC_ACE_AUX_ADD 3 -#define FFB_PPC_ACE_SHIFT 18 -#define FFB_PPC_DCE_DISABLE 2 -#define FFB_PPC_DCE_SHIFT 16 -#define FFB_PPC_ABE_DISABLE 2 -#define FFB_PPC_ABE_SHIFT 14 -#define FFB_PPC_VCE_DISABLE 1 -#define FFB_PPC_VCE_2D 2 -#define FFB_PPC_VCE_SHIFT 12 -#define FFB_PPC_APE_DISABLE 2 -#define FFB_PPC_APE_SHIFT 10 -#define FFB_PPC_CS_VARIABLE 2 -#define FFB_PPC_CS_SHIFT 0 - -#define FFB_FBC_WB_A 1 -#define FFB_FBC_WB_SHIFT 29 -#define FFB_FBC_PGE_MASK 3 -#define FFB_FBC_BE_SHIFT 4 -#define FFB_FBC_GE_SHIFT 2 -#define FFB_FBC_RE_SHIFT 0 - -#define FFB_ROP_NEW 0x83 -#define FFB_ROP_RGB_SHIFT 0 - -#define FFB_UCSR_FIFO_MASK 0x00000fff -#define FFB_UCSR_RP_BUSY 0x02000000 - -struct ffb_fbc { - u8 xxx1[0x60]; - volatile u32 by; - volatile u32 bx; - u32 xxx2; - u32 xxx3; - volatile u32 bh; - volatile u32 bw; - u8 xxx4[0x188]; - volatile u32 ppc; - u32 xxx5; - volatile u32 fg; - volatile u32 bg; - u8 xxx6[0x44]; - volatile u32 fbc; - volatile u32 rop; - u8 xxx7[0x34]; - volatile u32 pmask; - u8 xxx8[12]; - volatile u32 clip0min; - volatile u32 clip0max; - volatile u32 clip1min; - volatile u32 clip1max; - volatile u32 clip2min; - volatile u32 clip2max; - volatile u32 clip3min; - volatile u32 clip3max; - u8 xxx9[0x3c]; - volatile u32 unk1; - volatile u32 unk2; - u8 xxx10[0x10]; - volatile u32 fontxy; - volatile u32 fontw; - volatile u32 fontinc; - volatile u32 font; - u8 xxx11[0x4dc]; - volatile u32 unk3; - u8 xxx12[0xfc]; - volatile u32 ucsr; -}; - -struct ffb_dac { - volatile u32 type; - volatile u32 value; - volatile u32 type2; - volatile u32 value2; -}; - -static void -ffb_restore_palette (fbinfo_t *fbinfo) -{ -} - -static void ffb_blitc(unsigned short, int, int); -static void ffb_setw(int, int, unsigned short, int); -static void ffb_cpyw(int, int, unsigned short *, int); -static void ffb_fill(int, int, int *); -static void ffb_penguin(int,int,int); - -static struct { - unsigned long voff; - unsigned long poff; - unsigned long size; -} ffbmmap [] = { - { FFB_SFB8R_VOFF, FFB_SFB8R_POFF, 0x0400000 }, - { FFB_SFB8G_VOFF, FFB_SFB8G_POFF, 0x0400000 }, - { FFB_SFB8B_VOFF, FFB_SFB8B_POFF, 0x0400000 }, - { FFB_SFB8X_VOFF, FFB_SFB8X_POFF, 0x0400000 }, - { FFB_SFB32_VOFF, FFB_SFB32_POFF, 0x1000000 }, - { FFB_SFB64_VOFF, FFB_SFB64_POFF, 0x2000000 }, - { FFB_FBC_REGS_VOFF, FFB_FBC_REGS_POFF, 0x0002000 }, - { FFB_BM_FBC_REGS_VOFF, FFB_BM_FBC_REGS_POFF, 0x0002000 }, - { FFB_DFB8R_VOFF, FFB_DFB8R_POFF, 0x0400000 }, - { FFB_DFB8G_VOFF, FFB_DFB8G_POFF, 0x0400000 }, - { FFB_DFB8B_VOFF, FFB_DFB8B_POFF, 0x0400000 }, - { FFB_DFB8X_VOFF, FFB_DFB8X_POFF, 0x0400000 }, - { FFB_DFB24_VOFF, FFB_DFB24_POFF, 0x1000000 }, - { FFB_DFB32_VOFF, FFB_DFB32_POFF, 0x1000000 }, - { FFB_FBC_KREGS_VOFF, FFB_FBC_KREGS_POFF, 0x0002000 }, - { FFB_DAC_VOFF, FFB_DAC_POFF, 0x0002000 }, - { FFB_PROM_VOFF, FFB_PROM_POFF, 0x0010000 }, - { FFB_EXP_VOFF, FFB_EXP_POFF, 0x0002000 } -}; - -/* Ugh: X wants to mmap a bunch of cute stuff at the same time :-( */ -/* So, we just mmap the things that are being asked for */ -static int -ffb_mmap (struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - uint size, page, r, map_size; - unsigned long map_offset = 0; - int i; - int alignment; - struct vm_area_struct *vmm = NULL; - - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - /* Try to align RAM */ -#define ALIGNMENT 0x400000 - map_offset = vma->vm_offset + size; - alignment = 0; - if (vma->vm_offset < FFB_FBC_REGS_VOFF) { - vmm = find_vma(current->mm, vma->vm_start); - alignment = ALIGNMENT - ((vma->vm_start - vma->vm_offset) & (ALIGNMENT - 1)); - } else if (vma->vm_offset >= FFB_DFB8R_VOFF && (vma->vm_offset & (ALIGNMENT - 1)) == 0x4000) { - vmm = find_vma(current->mm, vma->vm_start); - alignment = ALIGNMENT - (vma->vm_start & (ALIGNMENT - 1)); - } - if (alignment == ALIGNMENT) alignment = 0; - if (alignment && (!vmm || vmm->vm_start >= vma->vm_end + alignment)) { - vma->vm_start += alignment; - vma->vm_end += alignment; - } -#undef ALIGNMENT - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* Each page, see which map applies */ - for (page = 0; page < size; ){ - map_size = 0; - for (i = 0; i < sizeof (ffbmmap) / sizeof (ffbmmap[0]); i++) - if (ffbmmap[i].voff == vma->vm_offset+page) { - map_size = ffbmmap[i].size; - map_offset = (fb->info.ffb.physbase + ffbmmap[i].poff) & _PAGE_PADDR; - } - - if (!map_size){ - page += PAGE_SIZE; - continue; - } - if (page + map_size > size) - map_size = size - page; - r = io_remap_page_range (vma->vm_start+page, - map_offset, - map_size, vma->vm_page_prot, 0); - if (r) - return -EAGAIN; - page += map_size; - } - - vma->vm_file = file; - file->f_count++; - return 0; -} - -/* XXX write body of these two... */ -static inline int -ffb_wid_get (fbinfo_t *fb, struct fb_wid_list *wl) -{ - struct fb_wid_item *wi; - struct fb_wid_list wlt; - struct fb_wid_item wit[30]; - char *km = NULL; - int i, j; - int err; - -#ifdef CONFIG_SPARC32_COMPAT - if (current->tss.flags & SPARC_FLAG_32BIT) { - if (copy_from_user (&wlt, wl, 2 * sizeof (__u32)) || - __get_user ((long)wlt.wl_list, (((__u32 *)wl)+2))) - return -EFAULT; - } else -#endif - if (copy_from_user (&wlt, wl, sizeof (wlt))) - return -EFAULT; - if (wlt.wl_count <= 30) { - if (copy_from_user (wit, wlt.wl_list, wlt.wl_count * sizeof(*wi))) - return -EFAULT; - wi = wit; - } else if (wlt.wl_count > 120) - return -EINVAL; - else { - wi = (struct fb_wid_item *) km = kmalloc (wlt.wl_count * sizeof (*wi), GFP_KERNEL); - if (!wi) return -ENOMEM; - if (copy_from_user (wi, wlt.wl_list, wlt.wl_count * sizeof(*wi))) { - kfree (wi); - return -EFAULT; - } - } - for (i = 0; i < wlt.wl_count; i++, wi++) { - switch (wi->wi_type) { - case FB_WID_DBL_8: j = (wi->wi_index & 0xf) + 0x40; break; - case FB_WID_DBL_24: j = wi->wi_index & 0x3f; break; - default: return -EINVAL; - } - wi->wi_attrs = 0xffff; - for (j = 0; j < 32; j++) - wi->wi_values [j] = 0; - } - err = 0; - if (copy_to_user (wlt.wl_list, km ? km : (char *)wit, wlt.wl_count * sizeof (*wi))) - err = -EFAULT; - if (km) - kfree (km); - return err; -} - -static inline int -ffb_wid_put (fbinfo_t *fb, struct fb_wid_list *wl) -{ - struct fb_wid_item *wi; - struct fb_wid_list wlt; - struct fb_wid_item wit[30]; - char *km = NULL; - int i, j; - -#ifdef CONFIG_SPARC32_COMPAT - if (current->tss.flags & SPARC_FLAG_32BIT) { - if (copy_from_user (&wlt, wl, 2 * sizeof (__u32)) || - __get_user ((long)wlt.wl_list, (((__u32 *)wl)+2))) - return -EFAULT; - } else -#endif - if (copy_from_user (&wlt, wl, sizeof (wlt))) - return -EFAULT; - if (wlt.wl_count <= 30) { - if (copy_from_user (wit, wlt.wl_list, wlt.wl_count * sizeof(*wi))) - return -EFAULT; - wi = wit; - } else if (wlt.wl_count > 120) - return -EINVAL; - else { - wi = (struct fb_wid_item *) km = kmalloc (wlt.wl_count * sizeof (*wi), GFP_KERNEL); - if (!wi) return -ENOMEM; - if (copy_from_user (wi, wlt.wl_list, wlt.wl_count * sizeof(*wi))) { - kfree (wi); - return -EFAULT; - } - } - for (i = 0; i < wlt.wl_count; i++, wi++) { - switch (wi->wi_type) { - case FB_WID_DBL_8: j = (wi->wi_index & 0xf) + 0x40; break; - case FB_WID_DBL_24: j = wi->wi_index & 0x3f; break; - default: return -EINVAL; - } - /* x = wi->wi_values [j] */; - } - if (km) - kfree (km); - return 0; -} - -static inline void -ffb_curs_enable (fbinfo_t *fb, int enable) -{ - struct ffb_dac *dac = fb->info.ffb.dac; - - dac->type2 = 0x100; - if (fb->info.ffb.dac_rev <= 2) - dac->value2 = enable ? 3 : 0; - else - dac->value2 = enable ? 0 : 3; -} - -static void -ffb_setcursormap (fbinfo_t *fb, unsigned char *red, - unsigned char *green, - unsigned char *blue) -{ - struct ffb_dac *dac = fb->info.ffb.dac; - - ffb_curs_enable (fb, 0); - dac->type2 = 0x102; - dac->value2 = (red[0] | (green[0]<<8) | (blue[0]<<16)); - dac->value2 = (red[1] | (green[1]<<8) | (blue[1]<<16)); -} - -/* Set cursor shape */ -static void -ffb_setcurshape (fbinfo_t *fb) -{ - struct ffb_dac *dac = fb->info.ffb.dac; - int i, j; - - ffb_curs_enable (fb, 0); - for (j = 0; j < 2; j++) { - dac->type2 = j ? 0 : 0x80; - for (i = 0; i < 0x40; i++) { - if (fb->cursor.size.fbx <= 32) { - dac->value2 = fb->cursor.bits [j][i]; - dac->value2 = 0; - } else { - dac->value2 = fb->cursor.bits [j][2*i]; - dac->value2 = fb->cursor.bits [j][2*i+1]; - } - } - } -} - -/* Load cursor information */ -static void -ffb_setcursor (fbinfo_t *fb) -{ - struct ffb_dac *dac = fb->info.ffb.dac; - struct cg_cursor *c = &fb->cursor; - - dac->type2 = 0x104; -/* Should this be just 0x7ff?? Should I do some margin handling and setcurshape - in that case? */ - dac->value2 = (((c->cpos.fby - c->chot.fby) & 0xffff) << 16) - |((c->cpos.fbx - c->chot.fbx) & 0xffff); - ffb_curs_enable (fb, fb->cursor.enable); -} - -static void -ffb_blank (fbinfo_t *fb) -{ -/* XXX Write this */ -} - -static void -ffb_unblank (fbinfo_t *fb) -{ -/* XXX Write this */ -} - -static int ffb_clutstore (fbinfo_t *fb, int offset, int count) -{ - int i; - u32 *clut = fb->info.ffb.clut + offset; - struct ffb_dac *dac = fb->info.ffb.dac; - - dac->type = 0x2000 | offset; - for (i = 0; i < count; i++) - dac->value = *clut++; /* Feed the colors in :)) */ - return 0; -} - -static int ffb_clutpost (fbinfo_t *fb, struct fb_clut *fc) -{ - int i; - u32 *clut; - struct fb_clut fct; - u8 red[256], green[256], blue[256]; - -#ifdef CONFIG_SPARC32_COMPAT - if (current->tss.flags & SPARC_FLAG_32BIT) { - if (copy_from_user (&fct, fc, 3 * sizeof (__u32)) || - __get_user ((long)fct.red, &(((struct fb_clut32 *)fc)->red)) || - __get_user ((long)fct.green, &(((struct fb_clut32 *)fc)->green)) || - __get_user ((long)fct.blue, &(((struct fb_clut32 *)fc)->blue))) - return -EFAULT; - } else -#endif - if (copy_from_user (&fct, fc, sizeof (struct fb_clut))) - return -EFAULT; - i = fct.offset + fct.count; - if (fct.clutid || i <= 0 || i > 256) return -EINVAL; - if (copy_from_user (red, fct.red, fct.count) || - copy_from_user (green, fct.green, fct.count) || - copy_from_user (blue, fct.blue, fct.count)) - return -EFAULT; - clut = fb->info.ffb.clut + fct.offset; - for (i = 0; i < fct.count; i++) - *clut++ = ((red[i])|(green[i]<<8)|(blue[i]<<16)); - return ffb_clutstore (fb, fct.offset, fct.count); -} - -static int ffb_clutread (fbinfo_t *fb, struct fb_clut *fc) -{ -/* XXX write this */ - return 0; -} - -static void -ffb_loadcmap (fbinfo_t *fb, int index, int count) -{ - u32 *clut = fb->info.ffb.clut + index; - int i, j = count; - - for (i = index; j--; i++) - *clut++ = ((fb->color_map CM(i,0))) | - ((fb->color_map CM(i,1)) << 8) | - ((fb->color_map CM(i,2)) << 16); - ffb_clutstore (fb, index, count); -} - -/* Handle ffb-specific ioctls */ -static int -ffb_ioctl (struct inode *inode, struct file *file, unsigned cmd, unsigned long arg, fbinfo_t *fb) -{ - switch (cmd) { - case FBIO_WID_GET: - return ffb_wid_get (fb, (struct fb_wid_list *)arg); - case FBIO_WID_PUT: - return ffb_wid_put (fb, (struct fb_wid_list *)arg); - case FFB_CLUTPOST: - return ffb_clutpost (fb, (struct fb_clut *)arg); - case FFB_CLUTREAD: - return ffb_clutread (fb, (struct fb_clut *)arg); - - default: - return -ENOSYS; - } -} - -void -ffb_reset (fbinfo_t *fb) -{ - if (fb == &fbinfo[0]) - sbus_hw_hide_cursor (); -} - -__initfunc(static void ffb_postsetup (fbinfo_t *fb)) -{ - fb->info.ffb.clut = kmalloc(256 * 4, GFP_ATOMIC); - fb->color_map = kmalloc(256 * 3, GFP_ATOMIC); -} - -__initfunc(void creator_setup (fbinfo_t *fb, int slot, int ffb_node, unsigned long ffb, int ffb_io)) -{ - struct ffb_info *ffbinfo; - struct linux_prom64_registers regs[2*PROMREG_MAX]; - int type; - - if (prom_getproperty(ffb_node, "reg", (void *) regs, sizeof(regs)) <= 0) - return; - ffb = (long)__va(regs[0].phys_addr); - printk ("creator%d at 0x%016lx ", slot, ffb); - - fb->base = ffb; /* ??? */ - - /* Fill in parameters we left out */ - fb->type.fb_cmsize = 256; - fb->mmap = ffb_mmap; - fb->loadcmap = ffb_loadcmap; - fb->reset = ffb_reset; - fb->blank = ffb_blank; - fb->unblank = ffb_unblank; - fb->setcursor = ffb_setcursor; - fb->setcursormap = ffb_setcursormap; - fb->setcurshape = ffb_setcurshape; - fb->postsetup = ffb_postsetup; - fb->blitc = ffb_blitc; - fb->setw = ffb_setw; - fb->cpyw = ffb_cpyw; - fb->fill = ffb_fill; - fb->draw_penguin = ffb_penguin; - fb->ioctl = ffb_ioctl; - fb->cursor.hwsize.fbx = 64; - fb->cursor.hwsize.fby = 64; - fb->type.fb_depth = 24; - - ffbinfo = (struct ffb_info *) &fb->info.ffb; - - ffbinfo->physbase = ffb; - - ffbinfo->fbc = (struct ffb_fbc *)(ffb + FFB_FBC_REGS_POFF); - ffbinfo->dac = (struct ffb_dac *)(ffb + FFB_DAC_POFF); - - ffbinfo->dac->type = 0x8000; - ffbinfo->dac_rev = (ffbinfo->dac->value >> 0x1c); - - if (slot == sun_prom_console_id) - fb_restore_palette = ffb_restore_palette; - - type = prom_getintdefault (ffb_node, "board_type", 8); - - /* Initialize Brooktree DAC */ - - printk("TYPE %d DAC %d\n", type, ffbinfo->dac_rev); - - if (slot && sun_prom_console_id == slot) - return; - - /* Reset the ffb */ - ffb_reset(fb); - - if (!slot) { - /* Enable Video */ - ffb_unblank(fb); - } else { - ffb_blank(fb); - } -} - -extern unsigned char vga_font[]; - -#define FFB_BLITC_START(attr) \ - { \ - register struct ffb_fbc *ffb = fbinfo[0].info.ffb.fbc; \ - register u32 *clut = fbinfo[0].info.ffb.clut; \ - int i; \ - ffb->ppc = 0x203; \ - ffb->fg = clut[attr & 0xf]; \ - ffb->fbc = 0x2000707f; \ - ffb->rop = 0x83; \ - ffb->pmask = 0xffffffff; \ - ffb->bg = clut[attr>>4]; -#define FFB_BLITC_BODY4(count,x,y,start,action) \ - while (count >= 4) { \ - count -= 4; \ - ffb->fontw = 32; \ - ffb->fontinc = 0x10000; \ - ffb->fontxy = (y << 16) + x; \ - x += 32; \ - start; \ - for (i = 0; i < CHAR_HEIGHT; i++) { \ - action; \ - } \ - } -#define FFB_BLITC_BODY1(x,y,action) \ - ffb->fontw = 8; \ - ffb->fontinc = 0x10000; \ - ffb->fontxy = (y << 16) + x; \ - x += 8; \ - for (i = 0; i < CHAR_HEIGHT; i++) { \ - action; \ - } -#define FFB_BLITC_END \ - } - -static void ffb_blitc(unsigned short charattr, int xoff, int yoff) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(charattr); - unsigned char *p = &vga_font[((unsigned char)charattr) << 4]; - FFB_BLITC_START(attrib) - FFB_BLITC_BODY1(xoff, yoff, ffb->font=((*p++) << 24)) - FFB_BLITC_END -} - -static void ffb_setw(int xoff, int yoff, unsigned short c, int count) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(c); - unsigned char *p = &vga_font[((unsigned char)c) << 4]; - register unsigned char *q; - register uint l; - FFB_BLITC_START(attrib) - if (count >= 4) { - FFB_BLITC_BODY4(count, xoff, yoff, q = p, - l = *q++; - l |= l << 8; - l |= l << 16; - ffb->font=l) - } - while (count) { - count--; - q = p; - FFB_BLITC_BODY1(xoff, yoff, ffb->font=((*q++) << 24)); - } - FFB_BLITC_END -} - -static void ffb_cpyw(int xoff, int yoff, unsigned short *p, int count) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(*p); - unsigned char *p1, *p2, *p3, *p4; - FFB_BLITC_START(attrib) - if (count >= 4) { - FFB_BLITC_BODY4(count, xoff, yoff, - p1 = &vga_font[((unsigned char)*p++) << 4]; - p2 = &vga_font[((unsigned char)*p++) << 4]; - p3 = &vga_font[((unsigned char)*p++) << 4]; - p4 = &vga_font[((unsigned char)*p++) << 4], - ffb->font=((uint)*p4++) | ((((uint)*p3++) | ((((uint)*p2++) | (((uint)*p1++) << 8)) << 8)) << 8)) - } - while (count) { - count--; - p1 = &vga_font[((unsigned char)*p++) << 4]; - FFB_BLITC_BODY1(xoff, yoff, ffb->font=((*p1++) << 24)); - } - FFB_BLITC_END -} - -#if 0 -#define FFB_FILL_START(attr) \ - { \ - register struct ffb_fbc *ffb = fbinfo[0].info.ffb.fbc; \ - register u32 *clut = fbinfo[0].info.ffb.clut; \ - ffb->ppc =0x1803; \ - ffb->fg = clut[attr & 0xf]; \ - ffb->fbc = 0x2000707f; \ - ffb->rop = 0x83; \ - ffb->pmask = 0xffffffff; \ - ffb->unk2 = 8; -#define FFB_FILL_END \ - } -#else -#define FFB_FILL_START(attr) \ - { \ - register struct ffb_fbc *ffb = fbinfo[0].info.ffb.fbc; \ - ffb->ppc = 0x1803; \ - ffb->fg = 0; \ - ffb->fbc = 0x2000707f; \ - ffb->rop = 0x83; \ - ffb->pmask = 0xffffffff; \ - ffb->unk2 = 8; -#define FFB_FILL_END \ - } -#endif - -static void ffb_fill(int attrib, int count, int *boxes) -{ - attrib = 5; - FFB_FILL_START(attrib) - while (count-- > 0) { - ffb->by = boxes[1]; - ffb->bx = boxes[0]; - ffb->bh = boxes[3]; - ffb->bw = boxes[2]; - boxes += 4; - } - FFB_FILL_END -} - -__initfunc(void ffb_penguin(int x_margin, int y_margin, int ncpus)) -{ - int i, j, k; - u32 *p, *q; - unsigned char *r; - unsigned char c; - - p = (u32 *)(fbinfo[0].info.ffb.physbase + FFB_DFB24_POFF + y_margin*8192 + x_margin*4); - for (i = 0; i < 80; i++, p += 2048) { - q = p; - for (j = 0; j < ncpus; j++) { - r = linux_logo + 80 * i; - for (k = 0; k < 80; k++, r++) { - c = *r - 32; - *q++ = (linux_logo_red[c]) | - (linux_logo_green[c]<<8) | - (linux_logo_blue[c]<<16); - } - q += 8; - } - } -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/envctrl.c linux/drivers/sbus/char/envctrl.c --- v2.1.114/linux/drivers/sbus/char/envctrl.c Sun Jun 7 11:16:33 1998 +++ linux/drivers/sbus/char/envctrl.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: envctrl.c,v 1.3 1998/04/10 08:42:24 jj Exp $ +/* $Id: envctrl.c,v 1.7 1998/06/10 07:25:28 davem Exp $ * envctrl.c: Temperature and Fan monitoring on Machines providing it. * * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) @@ -11,8 +11,17 @@ #include #include #include +#include #include +#include +#include + +#define ENVCTRL_MINOR 162 + + +#undef DEBUG_BUS_SCAN + #define PCF8584_ADDRESS 0x55 @@ -61,6 +70,7 @@ static struct pcf8584_reg *i2c; +#ifdef DEBUG_BUS_SCAN struct i2c_addr_map { unsigned char addr; unsigned char mask; @@ -73,9 +83,34 @@ { 0x48, 0x78, "PCF8591" }, }; #define NR_DEVMAP (sizeof(devmap) / sizeof(devmap[0])) +#endif + +static __inline__ int +PUT_DATA(__volatile__ unsigned char *data, char *buffer, int user) +{ + if (user) { + if (put_user(*data, buffer)) + return -EFAULT; + } else { + *buffer = *data; + } + return 0; +} + +static __inline__ int +GET_DATA(__volatile__ unsigned char *data, const char *buffer, int user) +{ + if (user) { + if (get_user(*data, buffer)) + return -EFAULT; + } else { + *data = *buffer; + } + return 0; +} static int -envctrl_read(unsigned char dev, char *buffer, int len) +i2c_read(unsigned char dev, char *buffer, int len, int user) { unsigned char dummy; unsigned char stat; @@ -103,16 +138,18 @@ if (count == (len - 2)) goto final; - if (++count > 0) - *buffer++ = i2c->data; - else + if (++count > 0) { + error = PUT_DATA(&i2c->data, buffer++, user); + if (error) + goto final; + } else dummy = i2c->data; } while (1); final: i2c->csr = CONTROL_ES0; - if (++count > 0) - *buffer++ = i2c->data; + if (!error && (++count > 0)) + error = PUT_DATA(&i2c->data, buffer++, user); else dummy = i2c->data; @@ -122,8 +159,8 @@ stop: i2c->csr = CONTROL_PIN | CONTROL_ES0 | CONTROL_STO | CONTROL_ACK; - if (++count > 0) - *buffer++ = i2c->data; + if (!error && (++count > 0)) + error = PUT_DATA(&i2c->data, buffer++, user); else dummy = i2c->data; @@ -133,7 +170,7 @@ } static int -envctrl_write(unsigned char dev, char *buffer, int len) +i2c_write(unsigned char dev, const char *buffer, int len, int user) { int error = -ENODEV; int count = 0; @@ -157,7 +194,10 @@ if (count == len) goto stop; - i2c->data = *buffer++; + error = GET_DATA(&i2c->data, buffer++, user); + if (error) + goto stop; + count++; } while (1); @@ -166,31 +206,107 @@ return error; } -__initfunc(static int scan_bus(void)) +__initfunc(static int i2c_scan_bus(void)) { unsigned char dev; int count = 0; - int i; - /* scan */ - for (dev = 1; dev < 128; dev++) - if (envctrl_write(dev, 0, 0) == 0) { + for (dev = 1; dev < 128; dev++) { + if (i2c_write(dev, 0, 0, 0) == 0) { +#ifdef DEBUG_BUS_SCAN + int i; for (i = 0; i < NR_DEVMAP; i++) if ((dev & devmap[i].mask) == devmap[i].addr) break; printk("envctrl: i2c device at %02x: %s\n", dev, i < NR_DEVMAP ? devmap[i].name : "unknown"); -{ - unsigned char buf[4]; - if (envctrl_read(dev, buf, 4) == 4) - printk("envctrl: read %02x %02x %02x %02x\n", - buf[0], buf[1], buf[2], buf[3]); -} +#endif count++; } + } return count ? 0 : -ENODEV; } +static loff_t +envctrl_llseek(struct file *file, loff_t offset, int type) +{ + return -ESPIPE; +} + +static ssize_t +envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos) +{ + unsigned long addr = (unsigned long)file->private_data; + + return i2c_read(addr, buf, count, 1); +} + +static ssize_t +envctrl_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +{ + unsigned long addr = (unsigned long)file->private_data; + + return i2c_write(addr, buf, count, 1); +} + +static int +envctrl_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + unsigned long data; + int addr; + + switch (cmd) { + case I2CIOCSADR: + if (get_user(addr, (int *)arg)) + return -EFAULT; + data = addr & 0x7f; + file->private_data = (void *)data; + break; + case I2CIOCGADR: + addr = (unsigned long)file->private_data; + if (put_user(addr, (int *)arg)) + return -EFAULT; + break; + default: + return -EINVAL; + } + return 0; +} + +static int +envctrl_open(struct inode *inode, struct file *file) +{ + file->private_data = 0; + MOD_INC_USE_COUNT; + return 0; +} + +static int +envctrl_release(struct inode *inode, struct file *file) +{ + MOD_DEC_USE_COUNT; + return 0; +} + +static struct file_operations envctrl_fops = { + envctrl_llseek, + envctrl_read, + envctrl_write, + NULL, /* readdir */ + NULL, /* poll */ + envctrl_ioctl, + NULL, /* mmap */ + envctrl_open, + envctrl_release +}; + +static struct miscdevice envctrl_dev = { + ENVCTRL_MINOR, + "envctrl", + &envctrl_fops +}; + #ifdef MODULE int init_module(void) #else @@ -199,27 +315,30 @@ { #ifdef CONFIG_PCI struct linux_ebus *ebus; - struct linux_ebus_device *edev; - - for_all_ebusdev(edev, ebus) - if (!strcmp(edev->prom_name, "SUNW,envctrl")) - break; + struct linux_ebus_device *edev = 0; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if (!strcmp(edev->prom_name, "SUNW,envctrl")) + goto ebus_done; + if (!strcmp(edev->prom_name, "SUNW,rasctrl")) + goto ebus_done; + } + } +ebus_done: if (!edev) return -ENODEV; if (check_region(edev->base_address[0], sizeof(*i2c))) { - prom_printf("%s: Can't get region %lx, %d\n", - __FUNCTION__, edev->base_address[0], - sizeof(*i2c)); - prom_halt(); + printk("%s: Can't get region %lx, %d\n", + __FUNCTION__, edev->base_address[0], (int)sizeof(*i2c)); + return -ENODEV; } - request_region(edev->base_address[0], - sizeof(*i2c), "i2c"); - i2c = (struct pcf8584_reg *)edev->base_address[0]; + request_region((unsigned long)i2c, sizeof(*i2c), "i2c"); + i2c->csr = CONTROL_PIN; i2c->data = PCF8584_ADDRESS; i2c->csr = CONTROL_PIN | CONTROL_ES1; @@ -227,7 +346,13 @@ i2c->csr = CONTROL_PIN | CONTROL_ES0 | CONTROL_ACK; mdelay(10); - return scan_bus(); + if (misc_register(&envctrl_dev)) { + printk("%s: unable to get misc minor %d\n", + __FUNCTION__, envctrl_dev.minor); + release_region((unsigned long)i2c, sizeof(*i2c)); + } + + return i2c_scan_bus(); #else return -ENODEV; #endif @@ -237,5 +362,7 @@ #ifdef MODULE void cleanup_module(void) { + misc_deregister(&envctrl_dev); + release_region((unsigned long)i2c, sizeof(*i2c)); } #endif diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/fb.h linux/drivers/sbus/char/fb.h --- v2.1.114/linux/drivers/sbus/char/fb.h Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/fb.h Wed Dec 31 16:00:00 1969 @@ -1,233 +0,0 @@ -/* $Id: fb.h,v 1.34 1998/04/13 07:26:55 davem Exp $ - * fb.h: contains the definitions of the structures that various sun - * frame buffer can use to do console driver stuff. - * - * (C) 1996 Dave Redman (djhr@tadpole.co.uk) - * (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * (C) 1996 David Miller (davem@rutgers.edu) - * (C) 1996 Peter Zaitcev (zaitcev@lab.ipmce.su) - * (C) 1996 Eddie C. Dost (ecd@skynet.be) - * (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -#ifndef __SPARC_FB_H_ -#define __SPARC_FB_H_ - -#include - -#define FRAME_BUFFERS 8 -#define CHAR_WIDTH 8 -#define CHAR_HEIGHT 16 - -/* Change this if we run into problems if the kernel want's to free or - * use our frame buffer pages, never seen it though. - */ -#define FB_MMAP_VM_FLAGS (VM_SHM| VM_LOCKED) - -#undef color - -/* cursor status, kernel tracked copy */ -struct cg_cursor { - short enable; /* cursor is enabled */ - struct fbcurpos cpos; /* position */ - struct fbcurpos chot; /* hot-spot */ - struct fbcurpos size; /* size of mask & image fields */ - struct fbcurpos hwsize; /* hw max size */ - int bits[2][128]; /* space for mask & image bits */ - char color [6]; /* cursor colors */ -}; - -struct cg6_info { - struct bt_regs *bt; /* color control */ - struct cg6_fbc *fbc; - unsigned int *fhc; - struct cg6_tec *tec; - struct cg6_thc *thc; - void *dhc; - unsigned char *rom; -}; - -struct tcx_info { - struct bt_regs *bt; /* color control */ - struct tcx_tec *tec; - struct tcx_thc *thc; - void *tcx_cplane; - int tcx_sizes[13]; - long tcx_offsets[13]; - int lowdepth; -}; - -struct ffb_info { - unsigned long physbase; - struct ffb_fbc *fbc; - struct ffb_dac *dac; - int dac_rev; - u32 *clut; -}; - -struct leo_info { - struct leo_cursor *cursor; - struct leo_lc_ss0_krn *lc_ss0_krn; - struct leo_lc_ss0_usr *lc_ss0_usr; - struct leo_lc_ss1_krn *lc_ss1_krn; - struct leo_lc_ss1_usr *lc_ss1_usr; - struct leo_ld_ss0 *ld_ss0; - struct leo_ld_ss1 *ld_ss1; - struct leo_ld_gbl *ld_gbl; - struct leo_lx_krn *lx_krn; - u32 *cluts[3]; - u8 *xlut; - unsigned long offset; -}; - -struct bwtwo_info { - struct bwtwo_regs *regs; -}; - -struct cg3_info { - struct cg3_regs *regs; /* brooktree (color) registers, and more */ - int cgrdi; /* 1 if this is a cgRDI */ -}; - -struct cg14_info { - struct cg14_regs *regs; - struct cg14_cursor *cursor_regs; - struct cg14_dac *dac; - struct cg14_xlut *xlut; - struct cg14_clut *clut; - int ramsize; - int video_mode; -}; - -typedef union -{ - unsigned int bt[8]; - unsigned char ibm[8]; -} dacptr; - -struct weitek_info -{ - int p9000; /* p9000? or p9100 */ - dacptr *dac; /* dac structures */ - unsigned int fbsize; /* size of frame buffer */ -}; - -/* Array holding the information for the frame buffers */ -typedef struct fbinfo { - union { - struct bwtwo_info bwtwo; - struct cg3_info cg3; - struct cg6_info cg6; - struct cg14_info cg14; - struct tcx_info tcx; - struct leo_info leo; - struct ffb_info ffb; - void *private; - } info; /* per frame information */ - int space; /* I/O space this card resides in */ - int blanked; /* true if video blanked */ - int open; /* is this fb open? */ - int mmaped; /* has this fb been mmapped? */ - int vtconsole; /* virtual console where it is opened */ - long base; /* frame buffer base */ - struct fbtype type; /* frame buffer type */ - int real_type; /* real frame buffer FBTYPE* */ - int emulations[4]; /* possible emulations (-1 N/A) */ - int prom_node; /* node of the device in prom tree */ - int base_depth; /* depth of fb->base piece */ - int linebytes; /* number of bytes in a row */ - struct cg_cursor cursor; /* kernel state of hw cursor */ - int (*mmap)(struct inode *, struct file *, struct vm_area_struct *, - long fb_base, struct fbinfo *); - void (*loadcmap)(struct fbinfo *fb, int index, int count); - void (*blank)(struct fbinfo *fb); - void (*unblank)(struct fbinfo *fb); - int (*ioctl)(struct inode *, struct file *, uint, unsigned long, - struct fbinfo *); - void (*reset)(struct fbinfo *fb); - void (*switch_from_graph)(void); - void (*setcursor)(struct fbinfo *); - void (*setcurshape)(struct fbinfo *); - void (*setcursormap)(struct fbinfo *, unsigned char *, - unsigned char *, unsigned char *); - void (*postsetup)(struct fbinfo *); - void (*clear_fb)(int); - void (*set_other_palette)(int); - void (*blitc)(unsigned short, int, int); - void (*setw)(int, int, unsigned short, int); - void (*cpyw)(int, int, unsigned short *, int); - void (*fill)(int, int, int *); - void (*draw_penguin)(int,int,int); - unsigned char *color_map; - struct openpromfs_dev proc_entry; -} fbinfo_t; - -#define CM(i, j) [3*(i)+(j)] - -extern unsigned char sparc_color_table[]; -extern unsigned char reverse_color_table[]; - -#define CHARATTR_TO_SUNCOLOR(attr) \ - ((reverse_color_table[(attr) >> 12] << 4) | \ - reverse_color_table[((attr) >> 8) & 0x0f]) - -extern fbinfo_t *fbinfo; -extern int fbinfos; - -struct { - char *name; /* prom name */ - int width, height; /* prefered w,h match */ - void (*fbtype)(fbinfo_t *); /* generic device type */ - /* device specific init routine */ - unsigned long (*fbinit)(fbinfo_t *fbinfo, unsigned int addr); -} fb_entry; - -extern int fb_init(void); - -extern void (*fb_restore_palette)(fbinfo_t *fbinfo); -extern void (*fb_hide_cursor)(int cursor_pos); -extern void (*fb_set_cursor)(int oldpos, int idx); -extern void (*fb_clear_screen)( void ); -extern void (*fb_blitc)(unsigned char *, int, unsigned int *, unsigned int); -extern void (*fb_font_init)(unsigned char *font); -/* All framebuffers are likely to require this info */ - -/* Screen dimensions and color depth. */ -extern int con_depth, con_width; -extern int con_height, con_linebytes; -extern int ints_per_line; - -/* used in the mmap routines */ -extern unsigned long get_phys (unsigned long addr); -extern int get_iospace (unsigned long addr); -extern void render_screen(void); - -extern void sbus_hw_hide_cursor(void); -extern void sbus_hw_set_cursor(int, int); -extern int sbus_hw_scursor(struct fbcursor *,fbinfo_t *); -extern int sbus_hw_cursor_shown; -extern int sun_prom_console_id; - -extern void cg_postsetup(fbinfo_t *); - -#define FB_DEV(x) (MINOR(x) / 32) - -extern void cg3_setup (fbinfo_t *, int, u32, int, struct linux_sbus_device *); -extern void cg6_setup (fbinfo_t *, int, u32, int); -extern void cg14_setup (fbinfo_t *, int, int, u32, int); -extern void bwtwo_setup (fbinfo_t *, int, u32, int, - struct linux_sbus_device *); -extern void leo_setup (fbinfo_t *, int, u32, int); -extern void tcx_setup (fbinfo_t *, int, int, u32, struct linux_sbus_device *); -extern void creator_setup (fbinfo_t *, int, int, unsigned long, int); -extern int io_remap_page_range(unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space); - -extern unsigned char linux_logo_red[]; -extern unsigned char linux_logo_green[]; -extern unsigned char linux_logo_blue[]; -extern unsigned char linux_logo[]; -extern unsigned char linux_logo_bw[]; -extern unsigned int linux_logo_colors; -extern char logo_banner[]; - -#endif __SPARC_FB_H_ diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/flash.c linux/drivers/sbus/char/flash.c --- v2.1.114/linux/drivers/sbus/char/flash.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/flash.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: flash.c,v 1.7 1998/03/10 20:19:05 jj Exp $ +/* $Id: flash.c,v 1.9 1998/05/17 06:33:39 ecd Exp $ * flash.c: Allow mmap access to the OBP Flash, for OBP updates. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -161,7 +161,7 @@ struct linux_ebus *ebus; struct linux_ebus_device *edev = 0; struct linux_prom_registers regs[2]; - int len, err; + int len, err, nregs; for_all_sbusdev(sdev, sbus) { if (!strcmp(sdev->prom_name, "flashprom")) { @@ -190,22 +190,38 @@ } if (!sdev) { #ifdef CONFIG_PCI - for_all_ebusdev(edev, ebus) - if (!strcmp(edev->prom_name, "flashprom")) - break; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if (!strcmp(edev->prom_name, "flashprom")) + goto ebus_done; + } + } + ebus_done: if (!edev) return -ENODEV; len = prom_getproperty(edev->prom_node, "reg", (void *)regs, sizeof(regs)); - if (len != sizeof(regs)) { + if ((len % sizeof(regs[0])) != 0) { printk("flash: Strange reg property size %d\n", len); return -ENODEV; } + nregs = len / sizeof(regs[0]); + flash.read_base = edev->base_address[0]; flash.read_size = regs[0].reg_size; - flash.write_base = edev->base_address[1]; - flash.write_size = regs[1].reg_size; + + if (nregs == 1) { + flash.write_base = edev->base_address[0]; + flash.write_size = regs[0].reg_size; + } else if (nregs == 2) { + flash.write_base = edev->base_address[1]; + flash.write_size = regs[1].reg_size; + } else { + printk("flash: Strange number of regs %d\n", nregs); + return -ENODEV; + } + flash.busy = 0; #else diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/leo.c linux/drivers/sbus/char/leo.c --- v2.1.114/linux/drivers/sbus/char/leo.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/leo.c Wed Dec 31 16:00:00 1969 @@ -1,702 +0,0 @@ -/* $Id: leo.c,v 1.27 1998/04/13 07:26:57 davem Exp $ - * leo.c: SUNW,leo 24/8bit frame buffer driver - * - * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - * Copyright (C) 1997 Michal Rehacek (Michal.Rehacek@st.mff.cuni.cz) - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include -#include "fb.h" -#include "cg_common.h" - -#define LEO_OFF_LC_SS0_KRN 0x00200000 -#define LEO_OFF_LC_SS0_USR 0x00201000 -#define LEO_OFF_LC_SS1_KRN 0x01200000 -#define LEO_OFF_LC_SS1_USR 0x01201000 -#define LEO_OFF_LD_SS0 0x00400000 -#define LEO_OFF_LD_SS1 0x01400000 -#define LEO_OFF_LD_GBL 0x00401000 -#define LEO_OFF_LX_KRN 0x00600000 -#define LEO_OFF_LX_CURSOR 0x00601000 -#define LEO_OFF_SS0 0x00800000 -#define LEO_OFF_SS1 0x01800000 -#define LEO_OFF_UNK 0x00602000 -#define LEO_OFF_UNK2 0x00000000 - -#define LEO_CUR_ENABLE 0x00000080 -#define LEO_CUR_UPDATE 0x00000030 -#define LEO_CUR_PROGRESS 0x00000006 -#define LEO_CUR_UPDATECMAP 0x00000003 - -#define LEO_CUR_TYPE_MASK 0x00000000 -#define LEO_CUR_TYPE_IMAGE 0x00000020 -#define LEO_CUR_TYPE_CMAP 0x00000050 - -struct leo_cursor { - u8 xxx0[16]; - volatile u32 cur_type; - volatile u32 cur_misc; - volatile u32 cur_cursxy; - volatile u32 cur_data; -}; - -#define LEO_KRN_TYPE_CLUT0 0x00001000 -#define LEO_KRN_TYPE_CLUT1 0x00001001 -#define LEO_KRN_TYPE_CLUT2 0x00001002 -#define LEO_KRN_TYPE_WID 0x00001003 -#define LEO_KRN_TYPE_UNK 0x00001006 -#define LEO_KRN_TYPE_VIDEO 0x00002003 -#define LEO_KRN_TYPE_CLUTDATA 0x00004000 -#define LEO_KRN_CSR_ENABLE 0x00000008 -#define LEO_KRN_CSR_PROGRESS 0x00000004 -#define LEO_KRN_CSR_UNK 0x00000002 -#define LEO_KRN_CSR_UNK2 0x00000001 - -struct leo_lx_krn { - volatile u32 krn_type; - volatile u32 krn_csr; - volatile u32 krn_value; -}; - -struct leo_lc_ss0_krn { - volatile u32 misc; - u8 xxx0[0x800-4]; - volatile u32 rev; -}; - -struct leo_lc_ss0_usr { - volatile u32 csr; - volatile u32 attrs; - volatile u32 fontc; - volatile u32 fontc2; - volatile u32 extent; - volatile u32 src; - u32 xxx1[1]; - volatile u32 copy; - volatile u32 fill; -}; - -struct leo_lc_ss1_krn { - u8 unknown; -}; - -struct leo_lc_ss1_usr { - u8 unknown; -}; - -struct leo_ld_ss0 { - u8 xxx0[0xe00]; - u32 xxx1[2]; - volatile u32 unk; - u32 xxx2[1]; - volatile u32 unk2; - volatile u32 unk3; - u32 xxx3[2]; - volatile u32 fg; - volatile u32 bg; - u8 xxx4[0x05c]; - volatile u32 planemask; - volatile u32 rop; -}; - -#define LEO_SS1_MISC_ENABLE 0x00000001 -#define LEO_SS1_MISC_STEREO 0x00000002 -struct leo_ld_ss1 { - u8 xxx0[0xef4]; - volatile u32 ss1_misc; -}; - -struct leo_ld_gbl { - u8 unknown; -}; - -static void leo_blitc(unsigned short, int, int); -static void leo_setw(int, int, unsigned short, int); -static void leo_cpyw(int, int, unsigned short *, int); -static void leo_fill(int, int, int *); -static void leo_penguin(int,int,int); - -static void -leo_restore_palette (fbinfo_t *fb) -{ - fb->info.leo.ld_ss1->ss1_misc &= ~(LEO_SS1_MISC_ENABLE); -} - -/* Ugh: X wants to mmap a bunch of cute stuff at the same time :-( */ -/* So, we just mmap the things that are being asked for */ -static int -leo_mmap (struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - uint size, page, r, map_size = 0; - unsigned long map_offset = 0; - - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* Each page, see which map applies */ - for (page = 0; page < size; ){ - switch (vma->vm_offset+page){ - case LEO_SS0_MAP: - map_size = 0x800000; - map_offset = get_phys ((unsigned long)fb->base); - break; - case LEO_LC_SS0_USR_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.lc_ss0_usr); - break; - case LEO_LD_SS0_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.ld_ss0); - break; - case LEO_LX_CURSOR_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.cursor); - break; - case LEO_SS1_MAP: - map_size = 0x800000; - map_offset = fb->info.leo.offset + LEO_OFF_SS1; - break; - case LEO_LC_SS1_USR_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.lc_ss1_usr); - break; - case LEO_LD_SS1_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.ld_ss1); - break; - case LEO_UNK_MAP: - map_size = PAGE_SIZE; - map_offset = fb->info.leo.offset + LEO_OFF_UNK; - break; - case LEO_LX_KRN_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.lx_krn); - break; - case LEO_LC_SS0_KRN_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.lc_ss0_krn); - break; - case LEO_LC_SS1_KRN_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.lc_ss1_krn); - break; - case LEO_LD_GBL_MAP: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.leo.ld_gbl); - break; - case LEO_UNK2_MAP: - map_size = 0x100000; - map_offset = fb->info.leo.offset + LEO_OFF_UNK2; - break; - } - if (!map_size){ - page += PAGE_SIZE; - continue; - } - if (page + map_size > size) - map_size = size - page; - r = io_remap_page_range (vma->vm_start+page, - map_offset, - map_size, vma->vm_page_prot, - fb->space); - if (r) - return -EAGAIN; - page += map_size; - } - - vma->vm_file = file; - file->f_count++; - return 0; -} - -static void -leo_setcursormap (fbinfo_t *fb, unsigned char *red, - unsigned char *green, - unsigned char *blue) -{ - struct leo_cursor *l = fb->info.leo.cursor; - int i; - - for (i = 0; (l->cur_misc & LEO_CUR_PROGRESS) && i < 300000; i++) - udelay (1); /* Busy wait at most 0.3 sec */ - if (i == 300000) return; /* Timed out - should we print some message? */ - l->cur_type = LEO_CUR_TYPE_CMAP; - l->cur_data = (red[0] | (green[0]<<8) | (blue[0]<<16)); - l->cur_data = (red[1] | (green[1]<<8) | (blue[1]<<16)); - l->cur_misc = LEO_CUR_UPDATECMAP; -} - -/* Load cursor information */ -static void -leo_setcursor (fbinfo_t *fb) -{ - struct cg_cursor *c = &fb->cursor; - struct leo_cursor *l = fb->info.leo.cursor; - - l->cur_misc &= ~LEO_CUR_ENABLE; - l->cur_cursxy = ((c->cpos.fbx - c->chot.fbx) & 0x7ff) - |(((c->cpos.fby - c->chot.fby) & 0x7ff) << 11); - l->cur_misc |= LEO_CUR_UPDATE; - if (c->enable) - l->cur_misc |= LEO_CUR_ENABLE; -} - -/* Set cursor shape */ -static void -leo_setcurshape (fbinfo_t *fb) -{ - int i, j, k; - u32 m, n, mask; - struct leo_cursor *l = fb->info.leo.cursor; - - l->cur_misc &= ~LEO_CUR_ENABLE; - for (k = 0; k < 2; k ++) { - l->cur_type = (k * LEO_CUR_TYPE_IMAGE); /* LEO_CUR_TYPE_MASK is 0 */ - for (i = 0; i < 32; i++) { - mask = 0; - m = fb->cursor.bits[k][i]; - /* mask = m with reversed bit order */ - for (j = 0, n = 1; j < 32; j++, n <<= 1) - if (m & n) - mask |= (0x80000000 >> j); - l->cur_data = mask; - } - } - l->cur_misc |= LEO_CUR_ENABLE; -} - -static void -leo_blank (fbinfo_t *fb) -{ - fb->info.leo.lx_krn->krn_type = LEO_KRN_TYPE_VIDEO; - fb->info.leo.lx_krn->krn_csr &= ~LEO_KRN_CSR_ENABLE; -} - -static void -leo_unblank (fbinfo_t *fb) -{ - fb->info.leo.lx_krn->krn_type = LEO_KRN_TYPE_VIDEO; - if (!(fb->info.leo.lx_krn->krn_csr & LEO_KRN_CSR_ENABLE)) - fb->info.leo.lx_krn->krn_csr |= LEO_KRN_CSR_ENABLE; -} - -static int leo_wait (struct leo_lx_krn *lx_krn) -{ - int i; - for (i = 0; (lx_krn->krn_csr & LEO_KRN_CSR_PROGRESS) && i < 300000; i++) - udelay (1); /* Busy wait at most 0.3 sec */ - if (i == 300000) return -EFAULT; /* Timed out - should we print some message? */ - return 0; -} - -static int -leo_wid_get (fbinfo_t *fb, struct fb_wid_list *wl) -{ - struct leo_lx_krn *lx_krn = fb->info.leo.lx_krn; - struct fb_wid_item *wi; - int i, j; - u32 l; - - lx_krn->krn_type = LEO_KRN_TYPE_WID; - i = leo_wait (lx_krn); - if (i) return i; - lx_krn->krn_csr &= ~LEO_KRN_CSR_UNK2; - lx_krn->krn_csr |= LEO_KRN_CSR_UNK; - lx_krn->krn_type = LEO_KRN_TYPE_WID; - i = leo_wait (lx_krn); - if (i) return i; - for (i = 0, wi = wl->wl_list; i < wl->wl_count; i++, wi++) { - switch (wi->wi_type) { - case FB_WID_DBL_8: j = (wi->wi_index & 0xf) + 0x40; break; - case FB_WID_DBL_24: j = wi->wi_index & 0x3f; break; - default: return -EINVAL; - } - wi->wi_attrs = 0xffff; - lx_krn->krn_type = 0x5800 + j; - l = lx_krn->krn_value; - for (j = 0; j < 32; j++) - wi->wi_values [j] = l; - } - return 0; -} - -static int -leo_wid_put (fbinfo_t *fb, struct fb_wid_list *wl) -{ - struct leo_lx_krn *lx_krn = fb->info.leo.lx_krn; - struct fb_wid_item *wi; - int i, j; - - lx_krn->krn_type = LEO_KRN_TYPE_WID; - i = leo_wait (lx_krn); - if (i) return i; - for (i = 0, wi = wl->wl_list; i < wl->wl_count; i++, wi++) { - switch (wi->wi_type) { - case FB_WID_DBL_8: j = (wi->wi_index & 0xf) + 0x40; break; - case FB_WID_DBL_24: j = wi->wi_index & 0x3f; break; - default: return -EINVAL; - } - lx_krn->krn_type = 0x5800 + j; - lx_krn->krn_value = wi->wi_values[0]; - } - return 0; -} - -static int leo_clutstore (fbinfo_t *fb, int clutid) -{ - int i; - u32 *clut = fb->info.leo.cluts [clutid]; - struct leo_lx_krn *lx_krn = fb->info.leo.lx_krn; - - lx_krn->krn_type = LEO_KRN_TYPE_CLUT0 + clutid; - i = leo_wait (lx_krn); - if (i) return i; - lx_krn->krn_type = LEO_KRN_TYPE_CLUTDATA; - for (i = 0; i < 256; i++) - lx_krn->krn_value = *clut++; /* Throw colors there :)) */ - lx_krn->krn_type = LEO_KRN_TYPE_CLUT0 + clutid; - lx_krn->krn_csr |= (LEO_KRN_CSR_UNK|LEO_KRN_CSR_UNK2); - return 0; -} - -static int leo_clutpost (fbinfo_t *fb, struct fb_clut *lc) -{ - int xlate = 0, i; - u32 *clut; - u8 *xlut = fb->info.leo.xlut; - - switch (lc->clutid) { - case 0: - case 1: - case 2: break; - case 3: return -EINVAL; /* gamma clut - not yet implemented */ - case 4: return -EINVAL; /* degamma clut - not yet implemented */ - default: return -EINVAL; - } - clut = fb->info.leo.cluts [lc->clutid] + lc->offset; - for (i = 0; i < lc->count; i++) - *clut++ = xlate ? - ((xlut[(u8)(lc->red[i])])|(xlut[(u8)(lc->green[i])]<<8)|(xlut[(u8)(lc->blue[i])]<<16)) : - (((u8)(lc->red[i]))|(((u8)(lc->green[i]))<<8)|(((u8)(lc->blue[i]))<<16)); - return leo_clutstore (fb, lc->clutid); -} - -static int leo_clutread (fbinfo_t *fb, struct fb_clut *lc) -{ - int i; - u32 u; - struct leo_lx_krn *lx_krn = fb->info.leo.lx_krn; - - if (lc->clutid >= 3) return -EINVAL; - lx_krn->krn_type = LEO_KRN_TYPE_CLUT0 + lc->clutid; - i = leo_wait (lx_krn); - if (i) return i; - lx_krn->krn_csr &= ~LEO_KRN_CSR_UNK2; - lx_krn->krn_csr |= LEO_KRN_CSR_UNK; - i = leo_wait (lx_krn); - if (i) return i; - lx_krn->krn_type = LEO_KRN_TYPE_CLUTDATA; - for (i = 0; i < lc->offset; i++) - u = lx_krn->krn_value; - for (i = 0; i < lc->count; i++) { - u = lx_krn->krn_value; - lc->red [i] = u; - lc->green [i] = (u >> 8); - lc->blue [i] = (u >> 16); - } - return 0; -} - -static void -leo_loadcmap (fbinfo_t *fb, int index, int count) -{ - u32 *clut = ((u32 *)fb->info.leo.cluts [0]) + index; - int i; - - for (i = index; count--; i++) - *clut++ = ((fb->color_map CM(i,0))) | - ((fb->color_map CM(i,1)) << 8) | - ((fb->color_map CM(i,2)) << 16); - leo_clutstore (fb, 0); -} - -/* Handle leo-specific ioctls */ -static int -leo_ioctl (struct inode *inode, struct file *file, unsigned cmd, unsigned long arg, fbinfo_t *fb) -{ - int i; - - switch (cmd) { - case FBIO_WID_GET: - i = verify_area (VERIFY_READ, (void *)arg, sizeof (struct fb_wid_list)); - if (i) return i; - if (((struct fb_wid_list *)arg)->wl_count != 1 || - !((struct fb_wid_list *)arg)->wl_list) return -EINVAL; - i = verify_area (VERIFY_WRITE, (void *)(((struct fb_wid_list *)arg)->wl_list), - ((struct fb_wid_list *)arg)->wl_count * sizeof (struct fb_wid_item)); - if (i) return i; - return leo_wid_get (fb, (struct fb_wid_list *)arg); - case FBIO_WID_PUT: - i = verify_area (VERIFY_READ, (void *)arg, sizeof (struct fb_wid_list)); - if (i) return i; - if (((struct fb_wid_list *)arg)->wl_count != 1 || - !((struct fb_wid_list *)arg)->wl_list) return -EINVAL; - i = verify_area (VERIFY_WRITE, (void *)(((struct fb_wid_list *)arg)->wl_list), - ((struct fb_wid_list *)arg)->wl_count * sizeof (struct fb_wid_item)); - if (i) return i; - return leo_wid_put (fb, (struct fb_wid_list *)arg); - case LEO_CLUTPOST: - i = verify_area (VERIFY_READ, (void *)arg, sizeof (struct fb_clut)); - if (i) return i; - i = ((struct fb_clut *)arg)->offset + ((struct fb_clut *)arg)->count; - if (i <= 0 || i > 256) return -EINVAL; - i = verify_area (VERIFY_READ, ((struct fb_clut *)arg)->red, ((struct fb_clut *)arg)->count); - if (i) return i; - i = verify_area (VERIFY_READ, ((struct fb_clut *)arg)->green, ((struct fb_clut *)arg)->count); - if (i) return i; - i = verify_area (VERIFY_READ, ((struct fb_clut *)arg)->blue, ((struct fb_clut *)arg)->count); - if (i) return i; - return leo_clutpost (fb, (struct fb_clut *)arg); - case LEO_CLUTREAD: - i = verify_area (VERIFY_READ, (void *)arg, sizeof (struct fb_clut)); - if (i) return i; - i = ((struct fb_clut *)arg)->offset + ((struct fb_clut *)arg)->count; - if (i <= 0 || i > 256) return -EINVAL; - i = verify_area (VERIFY_WRITE, ((struct fb_clut *)arg)->red, ((struct fb_clut *)arg)->count); - if (i) return i; - i = verify_area (VERIFY_WRITE, ((struct fb_clut *)arg)->green, ((struct fb_clut *)arg)->count); - if (i) return i; - i = verify_area (VERIFY_WRITE, ((struct fb_clut *)arg)->blue, ((struct fb_clut *)arg)->count); - if (i) return i; - return leo_clutread (fb, (struct fb_clut *)arg); - - default: - return -ENOSYS; - } -} - -static void -leo_reset (fbinfo_t *fb) -{ - if (fb == &fbinfo[0]) - sbus_hw_hide_cursor (); -} - - -__initfunc(static void leo_postsetup (fbinfo_t *fb)) -{ - fb->info.leo.cluts[0] = kmalloc(256 * 4, GFP_ATOMIC); - fb->info.leo.cluts[1] = kmalloc(256 * 4, GFP_ATOMIC); - fb->info.leo.cluts[2] = kmalloc(256 * 4, GFP_ATOMIC); - fb->info.leo.xlut = kmalloc(256, GFP_ATOMIC); - fb->color_map = kmalloc(256 * 3, GFP_ATOMIC); -} - -__initfunc(void leo_setup (fbinfo_t *fb, int slot, u32 leo, int leo_io)) -{ - struct leo_info *leoinfo; - int i; - struct fb_wid_item wi; - struct fb_wid_list wl; - - printk ("leo%d at 0x%8.8x ", slot, leo); - - /* Fill in parameters we left out */ - fb->type.fb_size = 0x800000; /* 8MB */ - fb->type.fb_cmsize = 256; - fb->mmap = leo_mmap; - fb->loadcmap = leo_loadcmap; - fb->postsetup = leo_postsetup; - fb->ioctl = (void *)leo_ioctl; - fb->reset = leo_reset; - fb->blank = leo_blank; - fb->unblank = leo_unblank; - fb->setcursor = leo_setcursor; - fb->setcursormap = leo_setcursormap; - fb->setcurshape = leo_setcurshape; - fb->blitc = leo_blitc; - fb->setw = leo_setw; - fb->cpyw = leo_cpyw; - fb->fill = leo_fill; - fb->draw_penguin = leo_penguin; - fb->base_depth = 0; - - leoinfo = (struct leo_info *) &fb->info.leo; - - memset (leoinfo, 0, sizeof(struct leo_info)); - - leoinfo->offset = leo; - /* Map the hardware registers */ - leoinfo->lc_ss0_krn = sparc_alloc_io(leo + LEO_OFF_LC_SS0_KRN, 0, - PAGE_SIZE,"leo_lc_ss0_krn", fb->space, 0); - leoinfo->lc_ss0_usr = sparc_alloc_io(leo + LEO_OFF_LC_SS0_USR, 0, - PAGE_SIZE,"leo_lc_ss0_usr", fb->space, 0); - leoinfo->lc_ss1_krn = sparc_alloc_io(leo + LEO_OFF_LC_SS1_KRN, 0, - PAGE_SIZE,"leo_lc_ss1_krn", fb->space, 0); - leoinfo->lc_ss1_usr = sparc_alloc_io(leo + LEO_OFF_LC_SS1_USR, 0, - PAGE_SIZE,"leo_lc_ss1_usr", fb->space, 0); - leoinfo->ld_ss0 = sparc_alloc_io(leo + LEO_OFF_LD_SS0, 0, - PAGE_SIZE,"leo_ld_ss0", fb->space, 0); - leoinfo->ld_ss1 = sparc_alloc_io(leo + LEO_OFF_LD_SS1, 0, - PAGE_SIZE,"leo_ld_ss1", fb->space, 0); - leoinfo->ld_gbl = sparc_alloc_io(leo + LEO_OFF_LD_GBL, 0, - PAGE_SIZE,"leo_ld_gbl", fb->space, 0); - leoinfo->lx_krn = sparc_alloc_io(leo + LEO_OFF_LX_KRN, 0, - PAGE_SIZE,"leo_lx_krn", fb->space, 0); - leoinfo->cursor = sparc_alloc_io(leo + LEO_OFF_LX_CURSOR, 0, - sizeof(struct leo_cursor),"leo_lx_crsr", fb->space, 0); - fb->base = (long)sparc_alloc_io(leo + LEO_OFF_SS0, 0, - 0x800000,"leo_ss0", fb->space, 0); - - leoinfo->ld_ss0->unk = 0xffff; - leoinfo->ld_ss0->unk2 = 0; - leoinfo->ld_ss0->unk3 = (fb->type.fb_width - 1) | ((fb->type.fb_height - 1) << 16); - wl.wl_count = 1; - wl.wl_list = &wi; - wi.wi_type = FB_WID_DBL_8; - wi.wi_index = 0; - wi.wi_values [0] = 0x2c0; - leo_wid_put (fb, &wl); - wi.wi_index = 1; - wi.wi_values [0] = 0x30; - leo_wid_put (fb, &wl); - wi.wi_index = 2; - wi.wi_values [0] = 0x20; - leo_wid_put (fb, &wl); - - leoinfo->ld_ss1->ss1_misc |= LEO_SS1_MISC_ENABLE; - - leoinfo->ld_ss0->fg = 0x30703; - leoinfo->ld_ss0->planemask = 0xff000000; - leoinfo->ld_ss0->rop = 0xd0840; - leoinfo->lc_ss0_usr->extent = (fb->type.fb_width-1) | ((fb->type.fb_height-1) << 11); - i = leoinfo->lc_ss0_usr->attrs; - leoinfo->lc_ss0_usr->fill = (0) | ((0) << 11) | ((i & 3) << 29) | ((i & 8) ? 0x80000000 : 0); - do { - i = leoinfo->lc_ss0_usr->csr; - } while (i & 0x20000000); - - if (slot == sun_prom_console_id) - fb_restore_palette = leo_restore_palette; - - printk("Cmd Rev %d\n", - (leoinfo->lc_ss0_krn->rev >> 28)); - - /* Reset the leo */ - leo_reset(fb); - - if (!slot) - /* Enable Video */ - leo_unblank (fb); - else if (slot != sun_prom_console_id) - leo_blank (fb); -} - -extern unsigned char vga_font []; - -#define GX_BLITC_START(attr,x,y,count) \ - { \ - register struct leo_lc_ss0_usr *us = fbinfo[0].info.leo.lc_ss0_usr; \ - register struct leo_ld_ss0 *ss = fbinfo[0].info.leo.ld_ss0; \ - register u32 i; \ - do { \ - i = us->csr; \ - } while (i & 0x20000000); \ - ss->fg = (attr & 0xf) << 24; \ - ss->bg = (attr >> 4) << 24; \ - ss->rop = 0x310040; \ - ss->planemask = 0xff000000; \ - us->fontc2 = 0xFFFFFFFE; \ - us->attrs = 4; \ - us->fontc = 0xFF000000; -#define GX_BLITC_END \ - } - -static void leo_blitc(unsigned short charattr, int xoff, int yoff) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(charattr); - unsigned char *p = &vga_font[((unsigned char)charattr) << 4]; - u32 *u = ((u32 *)fbinfo[0].base) + (yoff << 11) + xoff; - GX_BLITC_START(attrib, xoff, yoff, 1) - for (i = 0; i < CHAR_HEIGHT; i++, u += 2048) - *u = (*p++) << 24; - GX_BLITC_END -} - -static void leo_setw(int xoff, int yoff, unsigned short c, int count) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(c); - unsigned char *p = &vga_font[((unsigned char)c) << 4]; - register unsigned char *q; - u32 *u = ((u32 *)fbinfo[0].base) + (yoff << 11) + xoff; - GX_BLITC_START(attrib, xoff, yoff, count) - while (count-- > 0) { - q = p; - for (i = 0; i < CHAR_HEIGHT; i++, u += 2048) - *u = (*q++) << 24; - u += 8 - (CHAR_HEIGHT * 2048); - } - GX_BLITC_END -} - -static void leo_cpyw(int xoff, int yoff, unsigned short *p, int count) -{ - unsigned char attrib = CHARATTR_TO_SUNCOLOR(*p); - register unsigned char *q; - u32 *u = ((u32 *)fbinfo[0].base) + (yoff << 11) + xoff; - GX_BLITC_START(attrib, xoff, yoff, count) - while (count-- > 0) { - q = &vga_font[((unsigned char)*p++) << 4]; - for (i = 0; i < CHAR_HEIGHT; i++, u += 2048) - *u = (*q++) << 24; - u += 8 - (CHAR_HEIGHT * 2048); - } - GX_BLITC_END -} - -static void leo_fill(int attrib, int count, int *boxes) -{ - register struct leo_lc_ss0_usr *us = fbinfo[0].info.leo.lc_ss0_usr; - register struct leo_ld_ss0 *ss = fbinfo[0].info.leo.ld_ss0; - register u32 i; - do { - i = us->csr; - } while (i & 0x20000000); - ss->unk = 0xffff; - ss->unk2 = 0; - ss->unk3 = (fbinfo[0].type.fb_width - 1) | ((fbinfo[0].type.fb_height - 1) << 16); - ss->fg = ((attrib & 0xf)<<24) | 0x030703; - ss->planemask = 0xff000000; - ss->rop = 0xd0840; - while (count-- > 0) { - us->extent = ((boxes[2] - boxes[0] - 1) & 0x7ff) | (((boxes[3] - boxes[1] - 1) & 0x7ff) << 11); - i = us->attrs; - us->fill = (boxes[0] & 0x7ff) | ((boxes[1] & 0x7ff) << 11) | ((i & 3) << 29) | ((i & 8) ? 0x80000000 : 0); - } -} - -__initfunc(void leo_penguin(int x_margin, int y_margin, int ncpus)) -{ - suncons_ops.clear_screen(); - /* FIXME: Write this */ -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/mach64.c linux/drivers/sbus/char/mach64.c --- v2.1.114/linux/drivers/sbus/char/mach64.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/mach64.c Wed Dec 31 16:00:00 1969 @@ -1,331 +0,0 @@ -/* $Id: mach64.c,v 1.18 1998/05/03 21:56:07 davem Exp $ - * mach64.c: Ultra/PCI Mach64 console driver. - * - * Just about all of this is from the PPC/mac driver, see that for - * author info. I'm only responsible for grafting it into working - * on PCI Ultra's. The two drivers should be merged. - * - * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - */ - -#include /* for CONFIG_CHIP_ID */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "pcicons.h" -#include "mach64.h" -#include "fb.h" - -static unsigned int mach64_pci_membase, mach64_pci_membase2; -static unsigned int mach64_pci_iobase; - -#define MACH64_LE_FBOFF 0x000000 -#define MACH64_REGOFF 0x7ffc00 -#define MACH64_BE_FBOFF 0x800000 - -static inline void mach64_waitq(int entries) -{ - unsigned short base = (0x8000 >> entries); - - while((pcivga_readl(MACH64_REGOFF + FIFO_STAT) & 0xffff) > base) - barrier(); -} - -static inline void mach64_idle(void) -{ - mach64_waitq(16); - while(pcivga_readl(MACH64_REGOFF + GUI_STAT) & 1) - barrier(); -} - -#if 0 /* not used yet */ -static void mach64_st_514(int offset, char val) -{ - mach64_waitq(5); - pcivga_writeb(1, MACH64_REGOFF + DAC_CNTL); - pcivga_writeb((offset & 0xff), MACH64_REGOFF + DAC_W_INDEX); - pcivga_writeb(((offset>>8)&0xff), MACH64_REGOFF + DAC_DATA); - pcivga_writeb(val, MACH64_REGOFF + DAC_MASK); - pcivga_writeb(0, MACH64_REGOFF + DAC_CNTL); -} - -static void mach64_st_pll(int offset, char val) -{ - mach64_waitq(3); - pcivga_writeb(((offset<<2)|PLL_WR_EN), MACH64_REGOFF + CLOCK_CNTL + 1); - pcivga_writeb(val, MACH64_REGOFF + CLOCK_CNTL + 2); - pcivga_writeb(((offset<<2)&~PLL_WR_EN), MACH64_REGOFF + CLOCK_CNTL + 1); -} -#endif - -static int -mach64_mmap(struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - unsigned long addr, size; - - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - if (vma->vm_offset == (mach64_pci_iobase & PAGE_MASK)) { - addr = __pa((pcivga_iobase & PAGE_MASK)); - size = PAGE_SIZE; - } else if(mach64_pci_membase2 && - (vma->vm_offset == (mach64_pci_membase2 & PAGE_MASK))) { - addr = __pa((pcivga_membase2 & PAGE_MASK)); - } else if (vma->vm_offset >= (mach64_pci_membase + 0x800000)) { - addr = __pa(pcivga_membase) - mach64_pci_membase - + vma->vm_offset; - pgprot_val(vma->vm_page_prot) |= _PAGE_IE; - } else if (vma->vm_offset >= mach64_pci_membase) { - addr = __pa(pcivga_membase) - mach64_pci_membase - + vma->vm_offset; - } else { - return -EINVAL; - } - - pgprot_val(vma->vm_page_prot) &= ~(_PAGE_CACHE); - pgprot_val(vma->vm_page_prot) |= _PAGE_E; - vma->vm_flags |= (VM_SHM | VM_LOCKED); - - if (remap_page_range(vma->vm_start, addr, size, vma->vm_page_prot)) - return -EAGAIN; - - vma->vm_file = file; - file->f_count++; - return 0; -} - -static void -mach64_loadcmap(fbinfo_t *fb, int index, int count) -{ - unsigned char tmp; - int i; - - mach64_waitq(2); - tmp = pcivga_readb(MACH64_REGOFF + DAC_CNTL); - pcivga_writeb(tmp & 0xfc, MACH64_REGOFF + DAC_CNTL); - pcivga_writeb(0xff, MACH64_REGOFF + DAC_MASK); - for(i = index; count--; i++) { - mach64_waitq(4); - pcivga_writeb(i, MACH64_REGOFF + DAC_W_INDEX); - pcivga_writeb(fb->color_map CM(i, 0), MACH64_REGOFF + DAC_DATA); - pcivga_writeb(fb->color_map CM(i, 1), MACH64_REGOFF + DAC_DATA); - pcivga_writeb(fb->color_map CM(i, 2), MACH64_REGOFF + DAC_DATA); - } - mach64_idle(); -} - -static void -mach64_blank(fbinfo_t *fb) -{ - unsigned char gen_cntl; - - gen_cntl = pcivga_readb(MACH64_REGOFF + CRTC_GEN_CNTL); - gen_cntl |= 0x40; - pcivga_writeb(gen_cntl, MACH64_REGOFF + CRTC_GEN_CNTL); -} - -static void -mach64_unblank(fbinfo_t *fb) -{ - unsigned char gen_cntl; - - gen_cntl = pcivga_readb(MACH64_REGOFF + CRTC_GEN_CNTL); - gen_cntl &= ~(0x4c); - pcivga_writeb(gen_cntl, MACH64_REGOFF + CRTC_GEN_CNTL); -} - -static struct mach64_info mach64; - -void mach64_test(fbinfo_t *fb) -{ - unsigned int x; - int i; - - for (i = 0; i < mach64.total_vram; i += 4) - writel(i, pcivga_membase + i); - - for (i = 0; i < mach64.total_vram; i += 4) - if ((x = readl(pcivga_membase + i)) != i) { - printk("vga mem read error @ %08x: exp %x, rd %x\n", - i, i, x); - i = (i & ~(0xffff)) + 0x10000; - } -} - -int mach64_init(fbinfo_t *fb) -{ - struct pci_dev *pdev; - struct pcidev_cookie *cookie; - struct linux_pbm_info *pbm; - unsigned long addr; - unsigned int tmp; - - memset(&mach64, 0, sizeof(mach64)); - - pdev = pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_264VT, 0); - if(!pdev) - pdev = pci_find_device(PCI_VENDOR_ID_ATI, - PCI_DEVICE_ID_ATI_215GT, 0); - if(!pdev) - return -1; - - addr = pdev->base_address[0]; - pcivga_iobase = pcivga_membase = 0; - if((addr & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) - pcivga_iobase = addr & PCI_BASE_ADDRESS_IO_MASK; - else - pcivga_membase = addr & PCI_BASE_ADDRESS_MEM_MASK; - - addr = pdev->base_address[1]; - if((addr & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) - pcivga_iobase = addr & PCI_BASE_ADDRESS_IO_MASK; - else - pcivga_membase = addr & PCI_BASE_ADDRESS_MEM_MASK; - - pcivga_membase2 = (pdev->base_address[2] & - PCI_BASE_ADDRESS_MEM_MASK); - - if(!pcivga_iobase || !pcivga_membase) { - prom_printf("mach64_init: I/O or MEM baseaddr is missing\n"); - prom_printf("mach64_init: ba[0]=%016lx ba[1]=%016lx\n", - pdev->base_address[0], pdev->base_address[1]); - prom_halt(); - } - - pcibios_read_config_dword(pdev->bus->number, pdev->devfn, - PCI_BASE_ADDRESS_0, &mach64_pci_membase); - mach64_pci_membase &= PCI_BASE_ADDRESS_MEM_MASK; - - pcibios_read_config_dword(pdev->bus->number, pdev->devfn, - PCI_BASE_ADDRESS_1, &mach64_pci_iobase); - mach64_pci_iobase &= PCI_BASE_ADDRESS_IO_MASK; - - pcibios_read_config_dword(pdev->bus->number, pdev->devfn, - PCI_BASE_ADDRESS_2, &mach64_pci_membase2); - mach64_pci_membase2 &= PCI_BASE_ADDRESS_MEM_MASK; - - printk("mach64_init: IOBASE[%016lx] M1[%016lx] M2[%016lx]\n", - pcivga_iobase, pcivga_membase, pcivga_membase2); - - cookie = pdev->sysdata; - pbm = cookie->pbm; - - fb->prom_node = cookie->prom_node; - fb->proc_entry.node = pbm->prom_node; - - fb->type.fb_type = FBTYPE_PCI_MACH64; - fb->type.fb_cmsize = 256; - fb->info.private = (void *)&mach64; - fb->base = pcivga_membase + MACH64_BE_FBOFF; - - mach64.chip_type = pcivga_readl(MACH64_REGOFF + CONFIG_CHIP_ID) - & CFG_CHIP_TYPE; - - if (mach64.chip_type == MACH64_VT_ID) { - /* - * Fix the PROM's idea of MEM_CNTL settings... - */ - tmp = pcivga_readl(MACH64_REGOFF + MEM_CNTL); - switch (tmp & 0xf) { - case 3: - tmp = (tmp & ~(0xf)) | 2; - break; - case 7: - tmp = (tmp & ~(0xf)) | 3; - break; - case 9: - tmp = (tmp & ~(0xf)) | 4; - break; - case 11: - tmp = (tmp & ~(0xf)) | 5; - break; - default: - break; - } - tmp &= ~(0x00f00000); - pcivga_writel(tmp, MACH64_REGOFF + MEM_CNTL); - } - - tmp = pcivga_readl(MACH64_REGOFF + MEM_CNTL); - if (mach64.chip_type != MACH64_GT_ID) { - switch(tmp & MEM_SIZE_ALIAS) { - case MEM_SIZE_512K: - mach64.total_vram = 0x80000; - break; - case MEM_SIZE_1M: - mach64.total_vram = 0x100000; - break; - case MEM_SIZE_2M: - mach64.total_vram = 0x200000; - break; - case MEM_SIZE_4M: - mach64.total_vram = 0x400000; - break; - case MEM_SIZE_6M: - mach64.total_vram = 0x600000; - break; - case MEM_SIZE_8M: - mach64.total_vram = 0x800000; - break; - default: - mach64.total_vram = 0x80000; - break; - } - } else { - switch(tmp & MEM_SIZE_ALIAS_GTB) { - case MEM_SIZE_512K_GTB: - mach64.total_vram = 0x80000; - break; - case MEM_SIZE_1M_GTB: - mach64.total_vram = 0x100000; - break; - case MEM_SIZE_2M_GTB: - mach64.total_vram = 0x200000; - break; - case MEM_SIZE_4M_GTB: - mach64.total_vram = 0x400000; - break; - case MEM_SIZE_6M_GTB: - mach64.total_vram = 0x600000; - break; - case MEM_SIZE_8M_GTB: - mach64.total_vram = 0x800000; - break; - default: - mach64.total_vram = 0x80000; - break; - } - } - - printk("mach64_init: chip_type[%04x], total_vram[%08x]\n", - mach64.chip_type, mach64.total_vram); - -#if 0 - mach64_test(fb); -#endif - - fb->mmap = mach64_mmap; - fb->loadcmap = mach64_loadcmap; - fb->ioctl = 0; - fb->reset = 0; - fb->blank = mach64_blank; - fb->unblank = mach64_unblank; - fb->setcursor = 0; - - return 0; -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/mach64.h linux/drivers/sbus/char/mach64.h --- v2.1.114/linux/drivers/sbus/char/mach64.h Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/mach64.h Wed Dec 31 16:00:00 1969 @@ -1,582 +0,0 @@ -/* $Id: mach64.h,v 1.5 1998/04/01 05:52:58 ecd Exp $ - * mach64.h: Ultra/PCI mach64 driver constants etc. - * - * Copyright 1997 David S. Miller (davem@caip.rutgers.edu) - */ - -#ifndef _MACH64_H -#define _MACH64_H 1 - -struct mach64_info { - unsigned int color_mode; - unsigned int chip_type; - unsigned int total_vram; -}; - - -/* NON-GUI MEMORY MAPPED Registers - expressed in BYTE offsets */ - -#define CRTC_H_TOTAL_DISP 0x0000 /* Dword offset 00 */ -#define CRTC_H_SYNC_STRT_WID 0x0004 /* Dword offset 01 */ -#define CRTC_H_SYNC_STRT 0x0004 -#define CRTC_H_SYNC_DLY 0x0005 -#define CRTC_H_SYNC_WID 0x0006 - -#define CRTC_V_TOTAL_DISP 0x0008 /* Dword offset 02 */ -#define CRTC_V_TOTAL 0x0008 -#define CRTC_V_DISP 0x000a -#define CRTC_V_SYNC_STRT_WID 0x000C /* Dword offset 03 */ -#define CRTC_V_SYNC_STRT 0x000c -#define CRTC_V_SYNC_WID 0x000e - -#define CRTC_VLINE_CRNT_VLINE 0x0010 /* Dword offset 04 */ -#define CRTC_OFF_PITCH 0x0014 /* Dword offset 05 */ -#define CRTC_OFFSET 0x0014 -#define CRTC_PITCH 0x0016 - -#define CRTC_INT_CNTL 0x0018 /* Dword offset 06 */ -#define CRTC_GEN_CNTL 0x001C /* Dword offset 07 */ -#define CRTC_PIX_WIDTH 0x001d -#define CRTC_FIFO 0x001e -#define CRTC_EXT_DISP 0x001f - -#define SHARED_CNTL 0x0030 /* Dword offset 0C */ -#define SHARED_MEM_CONFIG 0x0034 /* Dword offset 0D */ - -#define OVR_CLR 0x0040 /* Dword offset 10 */ -#define OVR_WID_LEFT_RIGHT 0x0044 /* Dword offset 11 */ -#define OVR_WID_TOP_BOTTOM 0x0048 /* Dword offset 12 */ - -#define CUR_CLR0 0x0060 /* Dword offset 18 */ -#define CUR_CLR1 0x0064 /* Dword offset 19 */ -#define CUR_OFFSET 0x0068 /* Dword offset 1A */ -#define CUR_HORZ_VERT_POSN 0x006C /* Dword offset 1B */ -#define CUR_HORZ_VERT_OFF 0x0070 /* Dword offset 1C */ - -#define SCRATCH_REG0 0x0080 /* Dword offset 20 */ -#define SCRATCH_REG1 0x0084 /* Dword offset 21 */ - -#define CLOCK_CNTL 0x0090 /* Dword offset 24 */ -#define CLOCK_SEL_CNTL 0x0090 // Dword offset 24 - -#define BUS_CNTL 0x00A0 /* Dword offset 28 */ - -#define EXT_MEM_CNTL 0x00AC /* Dword offset 2B */ -#define MEM_CNTL 0x00B0 /* Dword offset 2C */ - -#define MEM_VGA_WP_SEL 0x00B4 /* Dword offset 2D */ -#define MEM_VGA_RP_SEL 0x00B8 /* Dword offset 2E */ - -#define DAC_REGS 0x00C0 /* Dword offset 30 */ -#define DAC_W_INDEX 0x00C0 /* Dword offset 30 */ -#define DAC_DATA 0x00C1 /* Dword offset 30 */ -#define DAC_MASK 0x00C2 /* Dword offset 30 */ -#define DAC_R_INDEX 0x00C3 /* Dword offset 30 */ -#define DAC_CNTL 0x00C4 /* Dword offset 31 */ - -#define GEN_TEST_CNTL 0x00D0 /* Dword offset 34 */ - -#define CONFIG_CNTL 0x00DC /* Dword offset 37 (CT, ET, VT) */ -#define CONFIG_CHIP_ID 0x00E0 /* Dword offset 38 */ -#define CONFIG_STAT0 0x00E4 /* Dword offset 39 */ -#define CONFIG_STAT1 0x00E8 /* Dword offset 3A */ - - -/* GUI MEMORY MAPPED Registers */ - -#define DST_OFF_PITCH 0x0100 /* Dword offset 40 */ -#define DST_X 0x0104 /* Dword offset 41 */ -#define DST_Y 0x0108 /* Dword offset 42 */ -#define DST_Y_X 0x010C /* Dword offset 43 */ -#define DST_WIDTH 0x0110 /* Dword offset 44 */ -#define DST_HEIGHT 0x0114 /* Dword offset 45 */ -#define DST_HEIGHT_WIDTH 0x0118 /* Dword offset 46 */ -#define DST_X_WIDTH 0x011C /* Dword offset 47 */ -#define DST_BRES_LNTH 0x0120 /* Dword offset 48 */ -#define DST_BRES_ERR 0x0124 /* Dword offset 49 */ -#define DST_BRES_INC 0x0128 /* Dword offset 4A */ -#define DST_BRES_DEC 0x012C /* Dword offset 4B */ -#define DST_CNTL 0x0130 /* Dword offset 4C */ - -#define SRC_OFF_PITCH 0x0180 /* Dword offset 60 */ -#define SRC_X 0x0184 /* Dword offset 61 */ -#define SRC_Y 0x0188 /* Dword offset 62 */ -#define SRC_Y_X 0x018C /* Dword offset 63 */ -#define SRC_WIDTH1 0x0190 /* Dword offset 64 */ -#define SRC_HEIGHT1 0x0194 /* Dword offset 65 */ -#define SRC_HEIGHT1_WIDTH1 0x0198 /* Dword offset 66 */ -#define SRC_X_START 0x019C /* Dword offset 67 */ -#define SRC_Y_START 0x01A0 /* Dword offset 68 */ -#define SRC_Y_X_START 0x01A4 /* Dword offset 69 */ -#define SRC_WIDTH2 0x01A8 /* Dword offset 6A */ -#define SRC_HEIGHT2 0x01AC /* Dword offset 6B */ -#define SRC_HEIGHT2_WIDTH2 0x01B0 /* Dword offset 6C */ -#define SRC_CNTL 0x01B4 /* Dword offset 6D */ - -#define HOST_DATA0 0x0200 /* Dword offset 80 */ -#define HOST_DATA1 0x0204 /* Dword offset 81 */ -#define HOST_DATA2 0x0208 /* Dword offset 82 */ -#define HOST_DATA3 0x020C /* Dword offset 83 */ -#define HOST_DATA4 0x0210 /* Dword offset 84 */ -#define HOST_DATA5 0x0214 /* Dword offset 85 */ -#define HOST_DATA6 0x0218 /* Dword offset 86 */ -#define HOST_DATA7 0x021C /* Dword offset 87 */ -#define HOST_DATA8 0x0220 /* Dword offset 88 */ -#define HOST_DATA9 0x0224 /* Dword offset 89 */ -#define HOST_DATAA 0x0228 /* Dword offset 8A */ -#define HOST_DATAB 0x022C /* Dword offset 8B */ -#define HOST_DATAC 0x0230 /* Dword offset 8C */ -#define HOST_DATAD 0x0234 /* Dword offset 8D */ -#define HOST_DATAE 0x0238 /* Dword offset 8E */ -#define HOST_DATAF 0x023C /* Dword offset 8F */ -#define HOST_CNTL 0x0240 /* Dword offset 90 */ - -#define PAT_REG0 0x0280 /* Dword offset A0 */ -#define PAT_REG1 0x0284 /* Dword offset A1 */ -#define PAT_CNTL 0x0288 /* Dword offset A2 */ - -#define SC_LEFT 0x02A0 /* Dword offset A8 */ -#define SC_RIGHT 0x02A4 /* Dword offset A9 */ -#define SC_LEFT_RIGHT 0x02A8 /* Dword offset AA */ -#define SC_TOP 0x02AC /* Dword offset AB */ -#define SC_BOTTOM 0x02B0 /* Dword offset AC */ -#define SC_TOP_BOTTOM 0x02B4 /* Dword offset AD */ - -#define DP_BKGD_CLR 0x02C0 /* Dword offset B0 */ -#define DP_FRGD_CLR 0x02C4 /* Dword offset B1 */ -#define DP_WRITE_MASK 0x02C8 /* Dword offset B2 */ -#define DP_CHAIN_MASK 0x02CC /* Dword offset B3 */ -#define DP_PIX_WIDTH 0x02D0 /* Dword offset B4 */ -#define DP_MIX 0x02D4 /* Dword offset B5 */ -#define DP_SRC 0x02D8 /* Dword offset B6 */ - -#define CLR_CMP_CLR 0x0300 /* Dword offset C0 */ -#define CLR_CMP_MASK 0x0304 /* Dword offset C1 */ -#define CLR_CMP_CNTL 0x0308 /* Dword offset C2 */ - -#define FIFO_STAT 0x0310 /* Dword offset C4 */ - -#define CONTEXT_MASK 0x0320 /* Dword offset C8 */ -#define CONTEXT_LOAD_CNTL 0x032C /* Dword offset CB */ - -#define GUI_TRAJ_CNTL 0x0330 /* Dword offset CC */ -#define GUI_STAT 0x0338 /* Dword offset CE */ - - -/* CRTC control values (mostly CRTC_GEN_CNTL) */ - -#define CRTC_H_SYNC_NEG 0x00200000 -#define CRTC_V_SYNC_NEG 0x00200000 - -#define CRTC_DBL_SCAN_EN 0x00000001 -#define CRTC_INTERLACE_EN 0x00000002 -#define CRTC_HSYNC_DIS 0x00000004 -#define CRTC_VSYNC_DIS 0x00000008 -#define CRTC_CSYNC_EN 0x00000010 -#define CRTC_PIX_BY_2_EN 0x00000020 -#define CRTC_BLANK 0x00000040 - -#define CRTC_PIX_WIDTH_MASK 0x00000700 -#define CRTC_PIX_WIDTH_4BPP 0x00000100 -#define CRTC_PIX_WIDTH_8BPP 0x00000200 -#define CRTC_PIX_WIDTH_15BPP 0x00000300 -#define CRTC_PIX_WIDTH_16BPP 0x00000400 -#define CRTC_PIX_WIDTH_24BPP 0x00000500 -#define CRTC_PIX_WIDTH_32BPP 0x00000600 - -#define CRTC_BYTE_PIX_ORDER 0x00000800 -#define CRTC_PIX_ORDER_MSN_LSN 0x00000000 -#define CRTC_PIX_ORDER_LSN_MSN 0x00000800 - -#define CRTC_FIFO_LWM 0x000f0000 -#define CRTC_EXT_DISP_EN 0x01000000 -#define CRTC_EXT_EN 0x02000000 - -#define CRTC_CRNT_VLINE 0x07f00000 -#define CRTC_VBLANK 0x00000001 - -/* DAC control values */ - -#define DAC_EXT_SEL_RS2 0x01 -#define DAC_EXT_SEL_RS3 0x02 -#define DAC_8BIT_EN 0x00000100 -#define DAC_PIX_DLY_MASK 0x00000600 -#define DAC_PIX_DLY_0NS 0x00000000 -#define DAC_PIX_DLY_2NS 0x00000200 -#define DAC_PIX_DLY_4NS 0x00000400 -#define DAC_BLANK_ADJ_MASK 0x00001800 -#define DAC_BLANK_ADJ_0 0x00000000 -#define DAC_BLANK_ADJ_1 0x00000800 -#define DAC_BLANK_ADJ_2 0x00001000 - - -/* Mix control values */ - -#define MIX_NOT_DST 0x0000 -#define MIX_0 0x0001 -#define MIX_1 0x0002 -#define MIX_DST 0x0003 -#define MIX_NOT_SRC 0x0004 -#define MIX_XOR 0x0005 -#define MIX_XNOR 0x0006 -#define MIX_SRC 0x0007 -#define MIX_NAND 0x0008 -#define MIX_NOT_SRC_OR_DST 0x0009 -#define MIX_SRC_OR_NOT_DST 0x000a -#define MIX_OR 0x000b -#define MIX_AND 0x000c -#define MIX_SRC_AND_NOT_DST 0x000d -#define MIX_NOT_SRC_AND_DST 0x000e -#define MIX_NOR 0x000f - -/* Maximum engine dimensions */ -#define ENGINE_MIN_X 0 -#define ENGINE_MIN_Y 0 -#define ENGINE_MAX_X 4095 -#define ENGINE_MAX_Y 16383 - -/* Mach64 engine bit constants - these are typically ORed together */ - -/* BUS_CNTL register constants */ -#define BUS_FIFO_ERR_ACK 0x00200000 -#define BUS_HOST_ERR_ACK 0x00800000 - -/* GEN_TEST_CNTL register constants */ -#define GEN_OVR_OUTPUT_EN 0x20 -#define HWCURSOR_ENABLE 0x80 -#define GUI_ENGINE_ENABLE 0x100 -#define BLOCK_WRITE_ENABLE 0x200 - -/* CLOCK_CNTL register constants */ -#define CLOCK_SEL 0x0f -#define CLOCK_DIV 0x30 -#define CLOCK_DIV1 0x00 -#define CLOCK_DIV2 0x10 -#define CLOCK_DIV4 0x20 -#define CLOCK_STROBE 0x40 -#define PLL_WR_EN 0x02 - -/* PLL registers */ -#define PLL_MACRO_CNTL 0x01 -#define PLL_REF_DIV 0x02 -#define PLL_GEN_CNTL 0x03 -#define MCLK_FB_DIV 0x04 -#define PLL_VCLK_CNTL 0x05 -#define VCLK_POST_DIV 0x06 -#define VCLK0_FB_DIV 0x07 -#define VCLK1_FB_DIV 0x08 -#define VCLK2_FB_DIV 0x09 -#define VCLK3_FB_DIV 0x0A -#define PLL_XCLK_CNTL 0x0B -#define PLL_TEST_CTRL 0x0E -#define PLL_TEST_COUNT 0x0F - -/* Fields in PLL registers */ -#define PLL_PC_GAIN 0x07 -#define PLL_VC_GAIN 0x18 -#define PLL_DUTY_CYC 0xE0 -#define PLL_OVERRIDE 0x01 -#define PLL_MCLK_RST 0x02 -#define OSC_EN 0x04 -#define EXT_CLK_EN 0x08 -#define MCLK_SRC_SEL 0x70 -#define EXT_CLK_CNTL 0x80 -#define VCLK_SRC_SEL 0x03 -#define PLL_VCLK_RST 0x04 -#define VCLK_INVERT 0x08 -#define VCLK0_POST 0x03 -#define VCLK1_POST 0x0C -#define VCLK2_POST 0x30 -#define VCLK3_POST 0xC0 - -/* CONFIG_CNTL register constants */ -#define APERTURE_4M_ENABLE 1 -#define APERTURE_8M_ENABLE 2 -#define VGA_APERTURE_ENABLE 4 - -/* CONFIG_STAT0 register constants (GX, CX) */ -#define CFG_BUS_TYPE 0x00000007 -#define CFG_MEM_TYPE 0x00000038 -#define CFG_INIT_DAC_TYPE 0x00000e00 - -/* CONFIG_STAT0 register constants (CT, ET, VT) */ -#define CFG_MEM_TYPE_xT 0x00000007 - -#define ISA 0 -#define EISA 1 -#define LOCAL_BUS 6 -#define PCI 7 - -/* Memory types for GX, CX */ -#define DRAMx4 0 -#define VRAMx16 1 -#define VRAMx16ssr 2 -#define DRAMx16 3 -#define GraphicsDRAMx16 4 -#define EnhancedVRAMx16 5 -#define EnhancedVRAMx16ssr 6 - -/* Memory types for CT, ET, VT, GT */ -#define DRAM 0 -#define EDO_DRAM 1 -#define PSEUDO_EDO 2 -#define SDRAM 3 - -#define DAC_INTERNAL 0x00 -#define DAC_IBMRGB514 0x01 -#define DAC_ATI68875 0x02 -#define DAC_TVP3026_A 0x72 -#define DAC_BT476 0x03 -#define DAC_BT481 0x04 -#define DAC_ATT20C491 0x14 -#define DAC_SC15026 0x24 -#define DAC_MU9C1880 0x34 -#define DAC_IMSG174 0x44 -#define DAC_ATI68860_B 0x05 -#define DAC_ATI68860_C 0x15 -#define DAC_TVP3026_B 0x75 -#define DAC_STG1700 0x06 -#define DAC_ATT498 0x16 -#define DAC_STG1702 0x07 -#define DAC_SC15021 0x17 -#define DAC_ATT21C498 0x27 -#define DAC_STG1703 0x37 -#define DAC_CH8398 0x47 -#define DAC_ATT20C408 0x57 - -#define CLK_ATI18818_0 0 -#define CLK_ATI18818_1 1 -#define CLK_STG1703 2 -#define CLK_CH8398 3 -#define CLK_INTERNAL 4 -#define CLK_ATT20C408 5 -#define CLK_IBMRGB514 6 - -/* MEM_CNTL register constants */ -#define MEM_SIZE_ALIAS 0x00000007 -#define MEM_SIZE_512K 0x00000000 -#define MEM_SIZE_1M 0x00000001 -#define MEM_SIZE_2M 0x00000002 -#define MEM_SIZE_4M 0x00000003 -#define MEM_SIZE_6M 0x00000004 -#define MEM_SIZE_8M 0x00000005 -#define MEM_SIZE_ALIAS_GTB 0x0000000F -#define MEM_SIZE_512K_GTB 0x00000000 -#define MEM_SIZE_1M_GTB 0x00000001 -#define MEM_SIZE_2M_GTB 0x00000003 -#define MEM_SIZE_4M_GTB 0x00000007 -#define MEM_SIZE_6M_GTB 0x00000009 -#define MEM_SIZE_8M_GTB 0x0000000B -#define MEM_BNDRY 0x00030000 -#define MEM_BNDRY_0K 0x00000000 -#define MEM_BNDRY_256K 0x00010000 -#define MEM_BNDRY_512K 0x00020000 -#define MEM_BNDRY_1M 0x00030000 -#define MEM_BNDRY_EN 0x00040000 - -/* CONFIG_CHIP_ID register constants */ -#define CFG_CHIP_TYPE 0x0000FFFF -#define CFG_CHIP_CLASS 0x00FF0000 -#define CFG_CHIP_REV 0xFF000000 -#define CFG_CHIP_VERSION 0x07000000 -#define CFG_CHIP_FOUNDRY 0x38000000 -#define CFG_CHIP_REVISION 0xC0000000 - -/* Chip IDs read from CONFIG_CHIP_ID */ -#define MACH64_GX_ID 0xD7 -#define MACH64_CX_ID 0x57 -#define MACH64_CT_ID 0x4354 -#define MACH64_ET_ID 0x4554 -#define MACH64_VT_ID 0x5654 -#define MACH64_GT_ID 0x4754 - -/* Mach64 chip types */ -#define MACH64_UNKNOWN 0 -#define MACH64_GX 1 -#define MACH64_CX 2 -#define MACH64_CT 3 -#define MACH64_ET 4 -#define MACH64_VT 5 -#define MACH64_GT 6 - -/* DST_CNTL register constants */ -#define DST_X_RIGHT_TO_LEFT 0 -#define DST_X_LEFT_TO_RIGHT 1 -#define DST_Y_BOTTOM_TO_TOP 0 -#define DST_Y_TOP_TO_BOTTOM 2 -#define DST_X_MAJOR 0 -#define DST_Y_MAJOR 4 -#define DST_X_TILE 8 -#define DST_Y_TILE 0x10 -#define DST_LAST_PEL 0x20 -#define DST_POLYGON_ENABLE 0x40 -#define DST_24_ROTATION_ENABLE 0x80 - -/* SRC_CNTL register constants */ -#define SRC_PATTERN_ENABLE 1 -#define SRC_ROTATION_ENABLE 2 -#define SRC_LINEAR_ENABLE 4 -#define SRC_BYTE_ALIGN 8 -#define SRC_LINE_X_RIGHT_TO_LEFT 0 -#define SRC_LINE_X_LEFT_TO_RIGHT 0x10 - -/* HOST_CNTL register constants */ -#define HOST_BYTE_ALIGN 1 - -/* GUI_TRAJ_CNTL register constants */ -#define PAT_MONO_8x8_ENABLE 0x01000000 -#define PAT_CLR_4x2_ENABLE 0x02000000 -#define PAT_CLR_8x1_ENABLE 0x04000000 - -/* DP_CHAIN_MASK register constants */ -#define DP_CHAIN_4BPP 0x8888 -#define DP_CHAIN_7BPP 0xD2D2 -#define DP_CHAIN_8BPP 0x8080 -#define DP_CHAIN_8BPP_RGB 0x9292 -#define DP_CHAIN_15BPP 0x4210 -#define DP_CHAIN_16BPP 0x8410 -#define DP_CHAIN_24BPP 0x8080 -#define DP_CHAIN_32BPP 0x8080 - -/* DP_PIX_WIDTH register constants */ -#define DST_1BPP 0 -#define DST_4BPP 1 -#define DST_8BPP 2 -#define DST_15BPP 3 -#define DST_16BPP 4 -#define DST_32BPP 6 -#define SRC_1BPP 0 -#define SRC_4BPP 0x100 -#define SRC_8BPP 0x200 -#define SRC_15BPP 0x300 -#define SRC_16BPP 0x400 -#define SRC_32BPP 0x600 -#define HOST_1BPP 0 -#define HOST_4BPP 0x10000 -#define HOST_8BPP 0x20000 -#define HOST_15BPP 0x30000 -#define HOST_16BPP 0x40000 -#define HOST_32BPP 0x60000 -#define BYTE_ORDER_MSB_TO_LSB 0 -#define BYTE_ORDER_LSB_TO_MSB 0x1000000 - -/* DP_MIX register constants */ -#define BKGD_MIX_NOT_D 0 -#define BKGD_MIX_ZERO 1 -#define BKGD_MIX_ONE 2 -#define BKGD_MIX_D 3 -#define BKGD_MIX_NOT_S 4 -#define BKGD_MIX_D_XOR_S 5 -#define BKGD_MIX_NOT_D_XOR_S 6 -#define BKGD_MIX_S 7 -#define BKGD_MIX_NOT_D_OR_NOT_S 8 -#define BKGD_MIX_D_OR_NOT_S 9 -#define BKGD_MIX_NOT_D_OR_S 10 -#define BKGD_MIX_D_OR_S 11 -#define BKGD_MIX_D_AND_S 12 -#define BKGD_MIX_NOT_D_AND_S 13 -#define BKGD_MIX_D_AND_NOT_S 14 -#define BKGD_MIX_NOT_D_AND_NOT_S 15 -#define BKGD_MIX_D_PLUS_S_DIV2 0x17 -#define FRGD_MIX_NOT_D 0 -#define FRGD_MIX_ZERO 0x10000 -#define FRGD_MIX_ONE 0x20000 -#define FRGD_MIX_D 0x30000 -#define FRGD_MIX_NOT_S 0x40000 -#define FRGD_MIX_D_XOR_S 0x50000 -#define FRGD_MIX_NOT_D_XOR_S 0x60000 -#define FRGD_MIX_S 0x70000 -#define FRGD_MIX_NOT_D_OR_NOT_S 0x80000 -#define FRGD_MIX_D_OR_NOT_S 0x90000 -#define FRGD_MIX_NOT_D_OR_S 0xa0000 -#define FRGD_MIX_D_OR_S 0xb0000 -#define FRGD_MIX_D_AND_S 0xc0000 -#define FRGD_MIX_NOT_D_AND_S 0xd0000 -#define FRGD_MIX_D_AND_NOT_S 0xe0000 -#define FRGD_MIX_NOT_D_AND_NOT_S 0xf0000 -#define FRGD_MIX_D_PLUS_S_DIV2 0x170000 - -/* DP_SRC register constants */ -#define BKGD_SRC_BKGD_CLR 0 -#define BKGD_SRC_FRGD_CLR 1 -#define BKGD_SRC_HOST 2 -#define BKGD_SRC_BLIT 3 -#define BKGD_SRC_PATTERN 4 -#define FRGD_SRC_BKGD_CLR 0 -#define FRGD_SRC_FRGD_CLR 0x100 -#define FRGD_SRC_HOST 0x200 -#define FRGD_SRC_BLIT 0x300 -#define FRGD_SRC_PATTERN 0x400 -#define MONO_SRC_ONE 0 -#define MONO_SRC_PATTERN 0x10000 -#define MONO_SRC_HOST 0x20000 -#define MONO_SRC_BLIT 0x30000 - -/* CLR_CMP_CNTL register constants */ -#define COMPARE_FALSE 0 -#define COMPARE_TRUE 1 -#define COMPARE_NOT_EQUAL 4 -#define COMPARE_EQUAL 5 -#define COMPARE_DESTINATION 0 -#define COMPARE_SOURCE 0x1000000 - -/* FIFO_STAT register constants */ -#define FIFO_ERR 0x80000000 - -/* CONTEXT_LOAD_CNTL constants */ -#define CONTEXT_NO_LOAD 0 -#define CONTEXT_LOAD 0x10000 -#define CONTEXT_LOAD_AND_DO_FILL 0x20000 -#define CONTEXT_LOAD_AND_DO_LINE 0x30000 -#define CONTEXT_EXECUTE 0 -#define CONTEXT_CMD_DISABLE 0x80000000 - -/* GUI_STAT register constants */ -#define ENGINE_IDLE 0 -#define ENGINE_BUSY 1 -#define SCISSOR_LEFT_FLAG 0x10 -#define SCISSOR_RIGHT_FLAG 0x20 -#define SCISSOR_TOP_FLAG 0x40 -#define SCISSOR_BOTTOM_FLAG 0x80 - -/* ATI VGA Extended Regsiters */ -#define sioATIEXT 0x1ce -#define bioATIEXT 0x3ce - -#define ATI2E 0xae -#define ATI32 0xb2 -#define ATI36 0xb6 - -/* VGA Graphics Controller Registers */ -#define VGAGRA 0x3ce -#define GRA06 0x06 - -/* VGA Seququencer Registers */ -#define VGASEQ 0x3c4 -#define SEQ02 0x02 -#define SEQ04 0x04 - -#define MACH64_MAX_X ENGINE_MAX_X -#define MACH64_MAX_Y ENGINE_MAX_Y - -#define INC_X 0x0020 -#define INC_Y 0x0080 - -#define RGB16_555 0x0000 -#define RGB16_565 0x0040 -#define RGB16_655 0x0080 -#define RGB16_664 0x00c0 - -#define POLY_TEXT_TYPE 0x0001 -#define IMAGE_TEXT_TYPE 0x0002 -#define TEXT_TYPE_8_BIT 0x0004 -#define TEXT_TYPE_16_BIT 0x0008 -#define POLY_TEXT_TYPE_8 (POLY_TEXT_TYPE | TEXT_TYPE_8_BIT) -#define IMAGE_TEXT_TYPE_8 (IMAGE_TEXT_TYPE | TEXT_TYPE_8_BIT) -#define POLY_TEXT_TYPE_16 (POLY_TEXT_TYPE | TEXT_TYPE_16_BIT) -#define IMAGE_TEXT_TYPE_16 (IMAGE_TEXT_TYPE | TEXT_TYPE_16_BIT) - -#define MACH64_NUM_CLOCKS 16 -#define MACH64_NUM_FREQS 50 - -#endif /* !(_MACH64_H) */ diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/pcicons.c linux/drivers/sbus/char/pcicons.c --- v2.1.114/linux/drivers/sbus/char/pcicons.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/pcicons.c Wed Dec 31 16:00:00 1969 @@ -1,778 +0,0 @@ -/* $Id: pcicons.c,v 1.17 1998/05/03 21:56:10 davem Exp $ - * pcicons.c: PCI specific probing and console operations layer. - * - * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - */ - -#include - -#ifdef CONFIG_PCI - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "pcicons.h" -#include "fb.h" - -static int x_margin = 0; -static int y_margin = 0; -static int skip_bytes; - -static __u64 *cursor_screen_pos; -static __u64 cursor_bits[2]; -static int cursor_pos = -1; - -extern int serial_console; -extern struct console vt_console_driver; - -static void pci_install_consops(void); -static int (*fbuf_offset)(int); - -static int color_fbuf_offset_1280_144 (int cindex) -{ - register int i = (cindex/144); - /* (1280 * CHAR_HEIGHT) == 101.0000.0000.0000 */ - return skip_bytes + (i << 14) + (i << 12) + ((cindex % 144) << 3); -} - -static int color_fbuf_offset_1152_128(int cindex) -{ - register int i = (cindex >> 7); - /* (1152 * CHAR_HEIGHT) == 100.1000.0000.0000 */ - return skip_bytes + (i << 14) + (i << 11) + ((cindex & 127) << 3); -} - -static int color_fbuf_offset_1024_128(int cindex) -{ - register int i = (cindex >> 7); - /* (1024 * CHAR_HEIGHT) == 100.0000.0000.0000 */ - return skip_bytes + (i << 14) + ((cindex & 127) << 3); -} - -static int color_fbuf_offset_800_96 (int cindex) -{ - register int i = (cindex / 96); - /* (800 * CHAR_HEIGHT) == 11.0010.0000.0000 */ - return skip_bytes + (i<<13) + (i<<12) + (i<<9) + ((cindex % 96)<<3); -} - -static int color_fbuf_offset_640_80 (int cindex) -{ - register int i = (cindex/80); - /* (640 * CHAR_HEIGHT) == 10.1000.0000.0000 */ - return skip_bytes + (i << 13) + (i << 11) + ((cindex % 80) << 3); -} - -static int color_fbuf_offset_generic (int cindex) -{ -#if 0 - /* XXX Implement me -DaveM */ - return skip_bytes + (cindex / video_num_columns) * bytes_per_row + ((cindex % video_num_columns) << 3); -#else - return 0; -#endif -} - -static __u32 expand_bits_8[16] = { - 0x00000000, - 0x000000ff, - 0x0000ff00, - 0x0000ffff, - 0x00ff0000, - 0x00ff00ff, - 0x00ffff00, - 0x00ffffff, - 0xff000000, - 0xff0000ff, - 0xff00ff00, - 0xff00ffff, - 0xffff0000, - 0xffff00ff, - 0xffffff00, - 0xffffffff -}; - -static void pci_blitc(unsigned int charattr, unsigned long addr) -{ - static int cached_attr = -1; - static __u32 fg, bg; - fbinfo_t *fb = &fbinfo[0]; - __u32 *screen; - unsigned char attrib; - unsigned char *fp; - unsigned long flags; - int i, idx; - - if ((charattr & 0xff00) != cached_attr) { - cached_attr = charattr; - attrib = CHARATTR_TO_SUNCOLOR(charattr); - fg = attrib & 0x0f; - fg |= fg << 8; - fg |= fg << 16; - bg = attrib >> 4; - bg |= bg << 8; - bg |= bg << 16; - fg ^= bg; - } - - idx = (addr - video_mem_base) >> 1; - save_flags(flags); cli(); - if (cursor_pos == idx) - cursor_pos = -1; - restore_flags(flags); - - screen = (__u32 *)(fb->base + fbuf_offset(idx)); - fp = &vga_font[(charattr & 0xff) << 4]; - - for(i = 0; i < 16; i++) { - int bits = *fp++; - - screen[0] = (expand_bits_8[bits >> 4] & fg) ^ bg; - screen[1] = (expand_bits_8[bits & 0x0f] & fg) ^ bg; - screen = (__u32 *) (((unsigned long)screen) + fb->linebytes); - } -} - - -static void pci_memsetw(void *s, unsigned short c, unsigned int count) -{ - unsigned short *p = (unsigned short *)s; - - count >>= 1; - if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) { - while (count) { - --count; - *p++ = c; - } - return; - } - if ((unsigned long)(p + count) > video_mem_base && - (unsigned long)p < video_mem_term) { - for (; p < (unsigned short *)video_mem_base && count; count--) - *p++ = c; - for (; p < (unsigned short *)video_mem_term && count; count--) { - if (*p != c) { - *p = c; - pci_blitc(c, (unsigned long)p); - } - ++p; - } - } - for (; count; count--) - *p++ = c; -} - -static void pci_memcpyw(unsigned short *dst, unsigned short *src, - unsigned int count) -{ - unsigned short c; - - count >>= 1; - if ((unsigned long)(dst + count) > video_mem_base && - (unsigned long)dst < video_mem_term) { - for (; dst < (unsigned short *)video_mem_base && count; count--) - *dst++ = *src++; - for (; dst < (unsigned short *)video_mem_term && count; - count--) { - c = *src++; - if (*dst != c) { - *dst = c; - pci_blitc(c, (unsigned long)dst); - } - ++dst; - } - } - for (; count; count--) - *dst++ = *src++; -} - -static void pci_scr_writew(unsigned short val, unsigned short *addr) -{ - if (*addr != val) { - *addr = val; - if ((unsigned long)addr < video_mem_term && - (unsigned long)addr >= video_mem_base && - vt_cons[fg_console]->vc_mode == KD_TEXT) - pci_blitc(val, (unsigned long) addr); - } -} - -static unsigned short pci_scr_readw(unsigned short *addr) -{ - return *addr; -} - -static void pci_get_scrmem(int currcons) -{ - struct vc_data *vcd = vc_cons[currcons].d; - - memcpyw((unsigned short *)vc_scrbuf[currcons], - (unsigned short *)vcd->vc_origin, video_screen_size); - vcd->vc_origin = vcd->vc_video_mem_start = - (unsigned long)vc_scrbuf[currcons]; - vcd->vc_scr_end = vcd->vc_video_mem_end = - vcd->vc_video_mem_start + video_screen_size; - vcd->vc_pos = - vcd->vc_origin + vcd->vc_y * video_size_row + (vcd->vc_x << 1); -} - -static void pci_set_scrmem(int currcons, long offset) -{ - struct vc_data *vcd = vc_cons[currcons].d; - - if (video_mem_term - video_mem_base < offset + video_screen_size) - offset = 0; - memcpyw((unsigned short *)(video_mem_base + offset), - (unsigned short *) vcd->vc_origin, video_screen_size); - vcd->vc_video_mem_start = video_mem_base; - vcd->vc_video_mem_end = video_mem_term; - vcd->vc_origin = video_mem_base + offset; - vcd->vc_scr_end = vcd->vc_origin + video_screen_size; - vcd->vc_pos = - vcd->vc_origin + vcd->vc_y * video_size_row + (vcd->vc_x << 1); -} - -static void pci_invert_cursor(int cpos) -{ - fbinfo_t *fb = &fbinfo[0]; - __u64 *screen; - - if (cpos == -1) { - screen = cursor_screen_pos; - *screen = cursor_bits[0]; - screen = (__u64 *)((unsigned long)screen + fb->linebytes); - *screen = cursor_bits[1]; - return; - } - - screen = (__u64 *)(fb->base + fbuf_offset(cpos) + 14 * fb->linebytes); - cursor_screen_pos = screen; - - cursor_bits[0] = *screen; - *screen = 0x0000000000000000; - screen = (__u64 *)((unsigned long)screen + fb->linebytes); - cursor_bits[1] = *screen; - *screen = 0x0000000000000000; -} - -static void pci_hide_cursor(void) -{ - unsigned long flags; - - if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) - return; - - save_flags(flags); cli(); - if (cursor_pos != -1) - pci_invert_cursor(-1); - restore_flags(flags); -} - -static void pci_set_cursor(int currcons) -{ - unsigned long flags; - int old_cursor; - - if (currcons != fg_console || console_blanked || - vt_cons[currcons]->vc_mode == KD_GRAPHICS) - return; - - save_flags(flags); cli(); - if (!vc_cons[currcons].d->vc_deccm) { - pci_hide_cursor(); - } else { - old_cursor = cursor_pos; - cursor_pos = - (vc_cons[currcons].d->vc_pos - video_mem_base) >> 1; - if (old_cursor != -1) - pci_invert_cursor(-1); - pci_invert_cursor(cursor_pos); - } - restore_flags(flags); -} - -static void pci_set_palette(void) -{ - fbinfo_t *fb = &fbinfo[0]; - - if (console_blanked || vt_cons[fg_console]->vc_mode == KD_GRAPHICS) - return; - - if (fb->loadcmap) { - int i, j; - - for (i = 0; i < 16; i++) { - j = sparc_color_table[i]; - fb->color_map CM(i, 0) = default_red[j]; - fb->color_map CM(i, 1) = default_grn[j]; - fb->color_map CM(i, 2) = default_blu[j]; - } - fb->loadcmap(fb, 0, 16); - } -} - -static void pci_set_other_palette(int n) -{ - fbinfo_t *fb = &fbinfo[n]; - - if (!n) { - pci_set_palette(); - return; - } - - if (fb->loadcmap) { - fb->color_map CM(0, 0) = 0; - fb->color_map CM(0, 1) = 0; - fb->color_map CM(0, 2) = 0; - fb->loadcmap(fb, 0, 1); - } -} - -static void pci_restore_palette(void) -{ - if (fb_restore_palette) - fb_restore_palette(&fbinfo[0]); -} - -static int pci_set_get_font(char *arg, int set, int ch512) -{ - int i, line; - - if (!arg) - return -EINVAL; - - if (!set) { - if (clear_user(arg, sizeof(vga_font))) - return -EFAULT; - for (i = 0; i < 256; i++) { - for (line = 0; line < CHAR_HEIGHT; line++) { - unsigned char value; - - value = vga_font[i * CHAR_HEIGHT + line]; - __put_user_ret(value, (arg + (i * 32 + line)), - -EFAULT); - } - } - return 0; - } - - if (verify_area(VERIFY_READ, arg, 256 * CHAR_HEIGHT)) - return -EFAULT; - for (i = 0; i < 256; i++) { - for (line = 0; line < CHAR_HEIGHT; line++) { - unsigned char value; - __get_user_ret(value, (arg + (i * 32 + line)), -EFAULT); - vga_font[i * CHAR_HEIGHT + line] = value; - } - } - return 0; -} - -static int pci_con_adjust_height(unsigned long fontheight) -{ - return -EINVAL; -} - -static int pci_set_get_cmap(unsigned char *arg, int set) -{ - int i; - - if (set) - i = VERIFY_READ; - else - i = VERIFY_WRITE; - - if (verify_area(i, arg, (16 * 3 * sizeof(unsigned char)))) - return -EFAULT; - - for (i = 0; i < 16; i++) { - if (set) { - __get_user_ret(default_red[i], (arg + 0), -EFAULT); - __get_user_ret(default_grn[i], (arg + 1), -EFAULT); - __get_user_ret(default_blu[i], (arg + 2), -EFAULT); - } else { - __put_user_ret(default_red[i], (arg + 0), -EFAULT); - __put_user_ret(default_grn[i], (arg + 1), -EFAULT); - __put_user_ret(default_blu[i], (arg + 2), -EFAULT); - } - arg += 3; - } - - if (set) { - for (i = 0; i < MAX_NR_CONSOLES; i++) { - if (vc_cons_allocated(i)) { - int j, k; - - for (j = k = 0; j < 16; j++) { - vc_cons[i].d->vc_palette[k++] = - default_red[i]; - vc_cons[i].d->vc_palette[k++] = - default_grn[i]; - vc_cons[i].d->vc_palette[k++] = - default_blu[i]; - } - } - } - pci_set_palette(); - } - return -EINVAL; -} - -static void pci_clear_screen(void) -{ - fbinfo_t *fb = &fbinfo[0]; - - if (fb->base) - memset((void *)fb->base, - (fb->type.fb_depth == 1) ? - ~(0) : reverse_color_table[0], - (fb->type.fb_depth * fb->type.fb_height - * fb->type.fb_width) / 8); - memset((char *)video_mem_base, 0, (video_mem_term - video_mem_base)); -} - -static void pci_clear_fb(int n) -{ - fbinfo_t *fb = &fbinfo[n]; - -#if 0 - if (!n) { - pci_clear_screen(); - } else -#endif - if (fb->base) { - memset((void *)fb->base, - (fb->type.fb_depth == 1) ? - ~(0) : reverse_color_table[0], - (fb->type.fb_depth * fb->type.fb_height - * fb->type.fb_width) / 8); - } -} - -static void pci_render_screen(void) -{ - int count; - unsigned short *p; - - count = video_num_columns * video_num_lines; - p = (unsigned short *)video_mem_base; - - for (; count--; p++) - pci_blitc(*p, (unsigned long)p); -} - -static void pci_clear_margin(void) -{ - fbinfo_t *fb = &fbinfo[0]; - unsigned long p; - int h, he; - - memset((void *)fb->base, - (fb->type.fb_depth == 1) ? ~(0) : reverse_color_table[0], - skip_bytes - (x_margin << 1)); - memset((void *)(fb->base + fb->linebytes * fb->type.fb_height - - skip_bytes + (x_margin << 1)), - (fb->type.fb_depth == 1) ? ~(0) : reverse_color_table[0], - skip_bytes - (x_margin << 1)); - he = fb->type.fb_height - 2 * y_margin; - if (fb->type.fb_depth == 1) { - for (p = fb->base + skip_bytes - (x_margin << 1), h = 0; - h < he; p += fb->linebytes, h++) - memset((void *)p, ~(0), (x_margin << 1)); - } else { - for (p = fb->base + skip_bytes - (x_margin << 1), h = 0; - h < he; p += fb->linebytes, h++) - memset((void *)p, reverse_color_table[0], - (x_margin << 1)); - } - - if (fb->switch_from_graph) - fb->switch_from_graph(); -} - -static void pci_postsetup(fbinfo_t *fb) -{ - fb->color_map = kmalloc(fb->type.fb_cmsize * 3, GFP_ATOMIC); - pci_set_palette(); -} - -__initfunc(static void pci_con_type_init(const char **display_desc)) -{ - can_do_color = 1; - - video_type = VIDEO_TYPE_SUNPCI; - *display_desc = "SUNPCI"; - - if(!serial_console) { - /* If we fall back to PROM then our output - * have to remain readable. - */ - prom_putchar('\033'); - prom_putchar('['); - prom_putchar('H'); - - /* - * Fake the screen memory with some CPU memory - */ - video_mem_base = (unsigned long)kmalloc(video_screen_size, GFP_ATOMIC); - video_mem_term = (video_mem_base + video_screen_size); - } -} - -__initfunc(static void pci_con_type_init_finish(void)) -{ - fbinfo_t *fb = &fbinfo[0]; - unsigned char *p = (unsigned char *)fb->base + skip_bytes; - char q[2] = { 0, 5 }; - unsigned short *ush; - int currcons = 0; - int cpu, ncpus; - int i; - - if (serial_console) - return; - - ncpus = linux_num_cpus; - if (ncpus > 4) - ncpus = 4; - -#if 0 - if (fb->draw_penguin) - fb->draw_penguin(x_margin, y_margin, ncpus); - else -#endif - if (fb->type.fb_depth == 8 && fb->loadcmap) { - for (i = 0; i < linux_logo_colors; i++) { - fb->color_map CM(i + 32, 0) = linux_logo_red[i]; - fb->color_map CM(i + 32, 1) = linux_logo_green[i]; - fb->color_map CM(i + 32, 2) = linux_logo_blue[i]; - } - fb->loadcmap(fb, 32, linux_logo_colors); - for (i = 0; i < 80; i++, p += fb->linebytes) { - for (cpu = 0; cpu < ncpus; cpu++) - memcpy(p + (cpu * 88), linux_logo + 80 * i, 80); - } - } else if (fb->type.fb_depth == 1) { - for (i = 0; i < 80; i++, p += fb->linebytes) { - for (cpu = 0; cpu < ncpus; cpu++) - memcpy(p + (cpu * 11), - linux_logo_bw + 10 * i, 10); - } - } - putconsxy(0, q); - - ush = (unsigned short *)video_mem_base + video_num_columns * 2 + 20 - + 10 * (ncpus - 1); - - for (p = logo_banner; *p; p++, ush++) { - *ush = (vc_cons[currcons].d->vc_attr << 8) + *p; - pci_blitc(*ush, (unsigned long)ush); - } - - for (i = 0; i < 5; i++) { - ush = (unsigned short *)video_mem_base + i * video_num_columns; - memset(ush, 0xff, 20); - } - - register_console(&vt_console_driver); -} - -unsigned long pcivga_iobase = 0; -unsigned long pcivga_membase = 0; -unsigned long pcivga_membase2 = 0; - -static struct { - int depth; - int resx, resy; - int x_margin, y_margin; -} scr_def[] = { - { 8, 1280, 1024, 64, 80 }, - { 8, 1152, 1024, 64, 80 }, - { 8, 1152, 900, 64, 18 }, - { 8, 1024, 768, 0, 0 }, - { 8, 800, 600, 16, 12 }, - { 8, 640, 480, 0, 0 }, - { 0 } -}; - -extern int mach64_init(fbinfo_t *fb); - -__initfunc(int pci_console_probe(void)) -{ - fbinfo_t *fb = &fbinfo[0]; - char *p; - int i; - - if (1 -#if 1 - && mach64_init(fb) -#endif - && 1) { - return -ENODEV; - } - fbinfos++; - - fb->clear_fb = pci_clear_fb; - fb->set_other_palette = pci_set_other_palette; - fb->postsetup = pci_postsetup; - fb->blanked = 0; - - fb->type.fb_height = prom_getintdefault(fb->prom_node, "height", 900); - fb->type.fb_width = prom_getintdefault(fb->prom_node, "width", 1152); - fb->type.fb_depth = prom_getintdefault(fb->prom_node, "depth", 8); - fb->linebytes = prom_getintdefault(fb->prom_node, "linebytes", 1152); - fb->type.fb_size = PAGE_ALIGN(fb->linebytes * fb->type.fb_height); - - fb->proc_entry.rdev = MKDEV(GRAPHDEV_MAJOR, 0); - fb->proc_entry.mode = S_IFCHR | S_IRUSR | S_IWUSR; - prom_getname(fb->prom_node, fb->proc_entry.name, 32 - 3); - p = strchr(fb->proc_entry.name, 0); - sprintf(p, ":%d", 0); - - for (i = 0; scr_def[i].depth; i++) { - if ((scr_def[i].resx != fb->type.fb_width) || - (scr_def[i].resy != fb->type.fb_height) || - (scr_def[i].depth != fb->type.fb_depth)) - continue; - x_margin = scr_def[i].x_margin; - y_margin = scr_def[i].y_margin; - skip_bytes = y_margin * fb->linebytes + x_margin; - - /* XXX Check that ORIG_VIDEO_COLS match -DaveM */ - fbuf_offset = color_fbuf_offset_generic; - switch (fb->type.fb_width) { - case 1152: - fbuf_offset = color_fbuf_offset_1152_128; - break; - case 1024: - fbuf_offset = color_fbuf_offset_1024_128; - break; - case 1280: - fbuf_offset = color_fbuf_offset_1280_144; - break; - case 800: - fbuf_offset = color_fbuf_offset_800_96; - break; - case 640: - fbuf_offset = color_fbuf_offset_640_80; - break; - default: - prom_printf("can't handle console width %d\n", - fb->type.fb_width); - prom_halt(); - } - break; - } - if(scr_def[i].depth == 0) { - prom_printf("can't support console resolution %dX%d\n", - fb->type.fb_width, fb->type.fb_height); - prom_halt(); - } - - pci_install_consops(); - return fb_init(); -} - -__initfunc(void pci_console_inithook(void)) -{ - extern char *console_fb_path; - char prop[16]; - int node = 0; - int width, height, depth, linebytes; - int x_margin, y_margin; - int i, len; - - if (console_fb_path) { - char *p; - for (p = console_fb_path; *p && *p != ' '; p++) ; - *p = 0; - node = prom_pathtoinode(console_fb_path); - } - if (!node) { - node = prom_inst2pkg(prom_stdout); - if (!node) { - prom_printf("can't find output-device node\n"); - prom_halt(); - } - len = prom_getproperty(node, "device_type", prop, sizeof(prop)); - if (len < 0) { - prom_printf("output-device doesn't have" - " device_type property\n"); - prom_halt(); - } - if (len != sizeof("display") || - strncmp("display", prop, sizeof("display"))) { - prom_printf("output-device is %s" - " not \"display\"\n", prop); - prom_halt(); - } - } - - depth = prom_getintdefault(node, "depth", 8); - width = prom_getintdefault(node, "width", 1152); - height = prom_getintdefault(node, "height", 900); - linebytes = prom_getintdefault(node, "linebytes", 1152); - - for (i = 0; scr_def[i].depth; i++) { - if ((scr_def[i].resx != width) || - (scr_def[i].resy != height) || - (scr_def[i].depth != depth)) - continue; - x_margin = scr_def[i].x_margin; - y_margin = scr_def[i].y_margin; - - ORIG_VIDEO_COLS = width / 8 - 2 * x_margin / depth; - ORIG_VIDEO_LINES = (height - 2 * y_margin) / 16; - } - - suncons_ops.con_type_init = pci_con_type_init; -} - -__initfunc(static void pci_install_consops(void)) -{ - suncons_ops.memsetw = pci_memsetw; - suncons_ops.memcpyw = pci_memcpyw; - suncons_ops.scr_writew = pci_scr_writew; - suncons_ops.scr_readw = pci_scr_readw; - - suncons_ops.get_scrmem = pci_get_scrmem; - suncons_ops.set_scrmem = pci_set_scrmem; - - suncons_ops.hide_cursor = pci_hide_cursor; - suncons_ops.set_cursor = pci_set_cursor; - suncons_ops.set_get_font = pci_set_get_font; - suncons_ops.con_adjust_height = pci_con_adjust_height; - suncons_ops.set_get_cmap = pci_set_get_cmap; - suncons_ops.set_palette = pci_set_palette; - suncons_ops.set_other_palette = pci_set_other_palette; - suncons_ops.console_restore_palette = pci_restore_palette; - - suncons_ops.con_type_init = pci_con_type_init; - suncons_ops.con_type_init_finish = pci_con_type_init_finish; - - suncons_ops.clear_screen = pci_clear_screen; - suncons_ops.render_screen = pci_render_screen; - suncons_ops.clear_margin = pci_clear_margin; -} - -#endif /* CONFIG_PCI */ diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/pcicons.h linux/drivers/sbus/char/pcicons.h --- v2.1.114/linux/drivers/sbus/char/pcicons.h Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/pcicons.h Wed Dec 31 16:00:00 1969 @@ -1,80 +0,0 @@ -/* $Id: pcicons.h,v 1.3 1998/05/03 21:56:12 davem Exp $ - * pcicons.h: Stuff which is generic across all PCI console drivers. - * - * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - */ - -#ifndef PCICONS_H -#define PCICONS_H - -#include -#include -#include - -extern unsigned long pcivga_iobase; -extern unsigned long pcivga_membase; -extern unsigned long pcivga_membase2; - -extern unsigned char vga_font[8192]; - -extern __inline__ unsigned int pcivga_inb(unsigned long off) -{ - return inb(pcivga_iobase + off); -} - -extern __inline__ unsigned int pcivga_inw(unsigned long off) -{ - return inw(pcivga_iobase + off); -} - -extern __inline__ unsigned int pcivga_inl(unsigned long off) -{ - return inl(pcivga_iobase + off); -} - -extern __inline__ void pcivga_outb(unsigned char val, unsigned long off) -{ - outb(val, pcivga_iobase + off); -} - -extern __inline__ void pcivga_outw(unsigned short val, unsigned long off) -{ - outw(val, pcivga_iobase + off); -} - -extern __inline__ void pcivga_outl(unsigned int val, unsigned long off) -{ - outl(val, pcivga_iobase + off); -} - -extern __inline__ unsigned int pcivga_readb(unsigned long off) -{ - return readb(pcivga_membase + off); -} - -extern __inline__ unsigned int pcivga_readw(unsigned long off) -{ - return readw(pcivga_membase + off); -} - -extern __inline__ unsigned int pcivga_readl(unsigned long off) -{ - return readl(pcivga_membase + off); -} - -extern __inline__ void pcivga_writeb(unsigned char val, unsigned long off) -{ - writeb(val, pcivga_membase + off); -} - -extern __inline__ void pcivga_writew(unsigned short val, unsigned long off) -{ - writew(val, pcivga_membase + off); -} - -extern __inline__ void pcivga_writel(unsigned int val, unsigned long off) -{ - writel(val, pcivga_membase + off); -} - -#endif /* PCICONS_H */ diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/pcikbd.c linux/drivers/sbus/char/pcikbd.c --- v2.1.114/linux/drivers/sbus/char/pcikbd.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/pcikbd.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: pcikbd.c,v 1.16 1998/04/01 04:12:40 davem Exp $ +/* $Id: pcikbd.c,v 1.18 1998/05/29 06:00:23 ecd Exp $ * pcikbd.c: Ultra/AX PC keyboard support. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -458,11 +458,13 @@ struct linux_ebus_child *child; char *msg; - for_all_ebusdev(edev, ebus) { - if(!strcmp(edev->prom_name, "8042")) { - for_each_edevchild(edev, child) { - if (!strcmp(child->prom_name, "kb_ps2")) - goto found; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if(!strcmp(edev->prom_name, "8042")) { + for_each_edevchild(edev, child) { + if (!strcmp(child->prom_name, "kb_ps2")) + goto found; + } } } } @@ -481,17 +483,23 @@ pcikbd_irq = child->irqs[0]; if (request_irq(pcikbd_irq, &pcikbd_interrupt, SA_SHIRQ, "keyboard", (void *)pcikbd_iobase)) { - printk("8042: cannot register IRQ %x\n", pcikbd_irq); + printk("8042: cannot register IRQ %s\n", + __irq_itoa(pcikbd_irq)); return; } - printk("8042(kbd): iobase[%016lx] irq[%x]\n", pcikbd_iobase, pcikbd_irq); + printk("8042(kbd) at 0x%lx (irq %s)\n", pcikbd_iobase, + __irq_itoa(pcikbd_irq)); kd_mksound = nop_kd_mksound; - for_all_ebusdev(edev, ebus) { - if(!strcmp(edev->prom_name, "beeper")) - break; + edev = 0; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if(!strcmp(edev->prom_name, "beeper")) + goto ebus_done; + } } +ebus_done: /* * XXX: my 3.1.3 PROM does not give me the beeper node for the audio @@ -876,11 +884,13 @@ struct linux_ebus_device *edev; struct linux_ebus_child *child; - for_all_ebusdev(edev, ebus) { - if(!strcmp(edev->prom_name, "8042")) { - for_each_edevchild(edev, child) { - if (!strcmp(child->prom_name, "kdmouse")) - goto found; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if(!strcmp(edev->prom_name, "8042")) { + for_each_edevchild(edev, child) { + if (!strcmp(child->prom_name,"kdmouse")) + goto found; + } } } } @@ -899,12 +909,13 @@ pcimouse_irq = child->irqs[0]; if (request_irq(pcimouse_irq, &pcimouse_interrupt, SA_SHIRQ, "mouse", (void *)pcimouse_iobase)) { - printk("8042: Cannot register IRQ %x\n", pcimouse_irq); + printk("8042: Cannot register IRQ %s\n", + __irq_itoa(pcimouse_irq)); return -ENODEV; } - printk("8042(mouse): iobase[%016lx] irq[%x]\n", - pcimouse_iobase, pcimouse_irq); + printk("8042(mouse) at %lx (irq %s)\n", pcimouse_iobase, + __irq_itoa(pcimouse_irq)); printk("8042: PS/2 auxiliary pointing device detected.\n"); aux_present = 1; diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/rtc.c linux/drivers/sbus/char/rtc.c --- v2.1.114/linux/drivers/sbus/char/rtc.c Thu May 7 22:51:50 1998 +++ linux/drivers/sbus/char/rtc.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: rtc.c,v 1.11 1997/09/20 20:47:26 davem Exp $ +/* $Id: rtc.c,v 1.12 1998/05/08 21:04:35 davem Exp $ * * Linux/SPARC Real Time Clock Driver * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/sab82532.c linux/drivers/sbus/char/sab82532.c --- v2.1.114/linux/drivers/sbus/char/sab82532.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/sab82532.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: sab82532.c,v 1.17 1998/04/01 06:55:12 ecd Exp $ +/* $Id: sab82532.c,v 1.20 1998/05/29 06:00:24 ecd Exp $ * sab82532.c: ASYNC Driver for the SIEMENS SAB82532 DUSCC. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -30,6 +30,7 @@ #include #include #include +#include #include "sunserial.h" @@ -2046,7 +2047,7 @@ int i, len = 0; off_t begin = 0; - len += sprintf(page, "serinfo:1.0 driver:%s\n", "$Revision: 1.17 $"); + len += sprintf(page, "serinfo:1.0 driver:%s\n", "$Revision: 1.20 $"); for (i = 0; i < NR_PORTS && len < 4000; i++) { len += line_info(page + len, sab82532_table[i]); if (len+begin > off+count) @@ -2074,14 +2075,18 @@ __initfunc(static int get_sab82532(unsigned long *memory_start)) { struct linux_ebus *ebus; - struct linux_ebus_device *edev; + struct linux_ebus_device *edev = 0; struct sab82532 *sab; unsigned long regs, offset; int i; - for_all_ebusdev(edev, ebus) - if (!strcmp(edev->prom_name, "se")) - break; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if (!strcmp(edev->prom_name, "se")) + goto ebus_done; + } + } +ebus_done: if (!edev) return -ENODEV; @@ -2137,7 +2142,7 @@ __initfunc(static inline void show_serial_version(void)) { - char *revision = "$Revision: 1.17 $"; + char *revision = "$Revision: 1.20 $"; char *version, *p; version = strchr(revision, ' '); @@ -2264,9 +2269,10 @@ } } - printk(KERN_INFO "ttyS%02d at 0x%lx (irq = %x) is a SAB82532 %s\n", - info->line, (unsigned long)info->regs, info->irq, - sab82532_version[info->type]); + printk(KERN_INFO + "ttyS%02d at 0x%lx (irq = %s) is a SAB82532 %s\n", + info->line, (unsigned long)info->regs, + __irq_itoa(info->irq), sab82532_version[info->type]); } return 0; } diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/sbuscons.c linux/drivers/sbus/char/sbuscons.c --- v2.1.114/linux/drivers/sbus/char/sbuscons.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/sbuscons.c Wed Dec 31 16:00:00 1969 @@ -1,1686 +0,0 @@ -/* $Id: sbuscons.c,v 1.17 1998/04/24 12:29:54 davem Exp $ - * sbuscons.c: Routines specific to SBUS frame buffer consoles. - * - * Copyright (C) 1995 Peter Zaitcev (zaitcev@lab.ipmce.su) - * Copyright (C) 1995,1996,1997 David S. Miller (davem@caip.rutgers.edu) - * Copyright (C) 1995, 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk) - * Copyright (C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) - * - * Added font loading Nov/21, Miguel de Icaza (miguel@nuclecu.unam.mx) - * Added render_screen and faster scrolling Nov/27, miguel - * Added console palette code for cg6 Dec/13/95, miguel - * Added generic frame buffer support Dec/14/95, miguel - * Added cgsix and bwtwo drivers Jan/96, miguel - * Added 4m, and cg3 driver Feb/96, miguel - * Fixed the cursor on color displays Feb/96, miguel. - * Cleaned up the detection code, generic 8bit depth display - * code, Mar/96 miguel - * Hacked support for cg14 video cards -- Apr/96, miguel. - * Color support for cg14 video cards -- May/96, miguel. - * Code split, Dave Redman, May/96 - * Be more VT change friendly, May/96, miguel. - * Support for hw cursor and graphics acceleration, Jun/96, jj. - * Added TurboGX+ detection (cgthree+), Aug/96, Iain Lea (iain@sbs.de) - * Added TCX support (8/24bit), Aug/96, jj. - * Support for multiple framebuffers, Sep/96, jj. - * Fix bwtwo inversion and handle inverse monochrome cells in - * sun_blitc, Nov/96, ecd. - * Fix sun_blitc and screen size on displays other than 1152x900, - * 128x54 chars, Nov/96, jj. - * Fix cursor spots left on some non-accelerated fbs, changed - * software cursor to be like the hw one, Nov/96, jj. - * - * Much of this driver is derived from the DEC TGA driver by - * Jay Estabrook who has done a nice job with the console - * driver abstraction btw. - * - * We try to make everything a power of two if possible to - * speed up the bit blit. Doing multiplies, divides, and - * remainder routines end up calling software library routines - * since not all Sparcs have the hardware to do it. - * - * TODO: - * do not blank the screen when frame buffer is mapped. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef __sparc_v9__ -#include -#endif - -#include -#include -#include -#include -#include - -#include "fb.h" - -#define cmapsz 8192 - -#include "suncons_font.h" - -#define ASM_BLITC - -int sbus_hw_cursor_shown = 0; - -void sbus_hw_hide_cursor(void); -void sbus_hw_set_cursor(int,int); - -static int sbus_blitc(uint, unsigned long); - -static void sbus_install_consops(void); - -extern void console_print(const char *); -extern void putconsxy(int, char *); -extern unsigned char vga_font[]; -extern int serial_console; -extern char *console_fb_path; - -/* The following variables describe a Sparc console. */ - -/* Screen dimensions and color depth. */ -static int con_depth, con_width, con_height, con_type; - -/* Base address of first line. */ -static unsigned char *con_fb_base; - -/* Screen parameters: we compute those at startup to make the code faster */ -static int chars_per_line; /* number of bytes per line */ -static int ints_per_line; /* number of ints per line */ -static int ints_per_cursor; /* 14 * ints_per_line */ -static int skip_bytes; /* number of bytes we skip for the y margin + x_margin */ -static int x_margin, y_margin; /* the x and y margins */ -static int bytes_per_row; /* bytes used by one screen line (of 16 scan lines) */ -int sun_prom_console_id = 0; - -/* Functions used by the SPARC dependent console code - * to perform the fb_restore_palette function. - */ -extern void (*fb_restore_palette)(fbinfo_t *fbinfo); -static void sbus_set_palette (void); - - /* Our screen looks like at 1152 X 900: - * - * 0,0 - * ------------------------------------------------------------------ - * | ^^^^^^^^^^^ | - * | 18 y-pixels | - * | ^^^^^^^^^^^ | - * 13 | <-64 pixels->| <-- 128 8x16 characters --> | <-64 pixels-> | - * .... - * 54 chars from top to bottom - * .... - * 888 | <-64 pixels->| <-- 128 8x16 characters --> | <-64 pixels-> | - * | ^^^^^^^^^^^ | - * | 18 y-pixels | - * | ^^^^^^^^^^^ | - * ------------------------------------------------------------------ - */ -/* First for MONO displays. */ -#define SCREEN_WIDTH 1152 /* Screen width in pixels */ -#define SCREEN_HEIGHT 900 /* Screen height in pixels */ -#define CHARS_PER_LINE 144 /* Make this empirical for speed */ -#define NICE_Y_MARGIN 18 /* We skip 18 y-pixels at top/bottom */ -#define NICE_X_MARGIN 8 /* We skip 64 x-pixels at left/right */ -#define FBUF_TOP_SKIP 2592 /* Empirical, (CHARS_PER_LINE * NICE_Y_MARGIN) */ -#define CHAR_HEIGHT 16 -#define ONE_ROW 2304 /* CHARS_PER_LINE * CHAR_HEIGHT */ - -/* Now we have this, to compute the base frame buffer position - * for a new character to be rendered. 1 and 8 bit depth. - */ -#define FBUF_OFFSET(cindex) \ - (((FBUF_TOP_SKIP) + (((cindex)>>7) * ONE_ROW)) + \ - ((NICE_X_MARGIN) + (((cindex)&127)))) - - -#define COLOR_FBUF_OFFSET(cindex) (*color_fbuf_offset)(cindex) - -/* These four routines are optimizations for the _generic routine for - * the most common cases. - * I guess doing twice sll is much faster than doing .mul, sra faster - * than doing .div, and the disadvantage that someone has to call it - * (it cannot be inline) runs away, 'cause otherwise it would have to - * call .mul anyway. - * The shifting + addition only routines won't eat any stack frame :)) - * Names come from width, screen_num_columns. - */ -static int color_fbuf_offset_1280_144 (int cindex) -{ - register int i = (cindex/144); - /* (1280 * CHAR_HEIGHT) == 101.0000.0000.0000 */ - return skip_bytes + (i << 14) + (i << 12) + ((cindex % 144) << 3); -} - -static int color_fbuf_offset_1152_128 (int cindex) -{ - register int i = (cindex>>7); - /* (1152 * CHAR_HEIGHT) == 100.1000.0000.0000 */ - return skip_bytes + (i << 14) + (i << 11) + ((cindex & 127) << 3); -} - -static int color_fbuf_offset_1024_128 (int cindex) -{ - register int i = (cindex>>7); - /* (1024 * CHAR_HEIGHT) == 100.0000.0000.0000 */ - return skip_bytes + (i << 14) + ((cindex & 127) << 3); -} - -static int color_fbuf_offset_800_96 (int cindex) -{ - register int i = (cindex / 96); - /* (800 * CHAR_HEIGHT) == 11.0010.0000.0000 */ - return skip_bytes + (i<<13) + (i<<12) + (i<<9) + ((cindex % 96)<<3); -} - -static int color_fbuf_offset_640_80 (int cindex) -{ - register int i = (cindex/80); - /* (640 * CHAR_HEIGHT) == 10.1000.0000.0000 */ - return skip_bytes + (i << 13) + (i << 11) + ((cindex % 80) << 3); -} - -static int color_fbuf_offset_generic (int cindex) -{ - return skip_bytes + (cindex / video_num_columns) * bytes_per_row + ((cindex % video_num_columns) << 3); -} - -static int (*color_fbuf_offset)(int) = color_fbuf_offset_generic; - -static int do_accel = 0; - -/* For the cursor, we just invert the 8x16 block at the cursor - * location. Easy enough... - * - * Hide the cursor from view, during blanking, usually... - */ -static int cursor_pos = -1; - -static unsigned int under_cursor[4]; - -static void sbus_hide_cursor(void) -{ - unsigned long flags; - int j; - - if (fbinfo[0].setcursor) { - sbus_hw_hide_cursor(); - return; - } - - if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) - return; /* Don't paint anything on fb which is not ours, - but turn off the hw cursor in such case */ - - __save_and_cli(flags); - - if(cursor_pos == -1) { - __restore_flags (flags); - return; - } - switch (con_depth){ - case 1: { - unsigned char *dst; - dst = (unsigned char *)((unsigned long)con_fb_base + - FBUF_OFFSET(cursor_pos)); - for(j = 0; j < CHAR_HEIGHT; j++, dst += CHARS_PER_LINE) - *dst = ~(*dst); - break; - } - case 8: { - unsigned int *dst; - - dst = (unsigned int *)((unsigned long)con_fb_base + - COLOR_FBUF_OFFSET(cursor_pos)) + ints_per_cursor; - dst[0] = under_cursor[0]; - dst[1] = under_cursor[1]; - dst[ints_per_line] = under_cursor[2]; - dst[ints_per_line+1] = under_cursor[3]; - break; - } - default: - break; - } - cursor_pos = -1; - __restore_flags(flags); -} - -static void sbus_set_cursor(int currcons) -{ - int j, idx, oldpos; - unsigned long flags; - - if (currcons != fg_console || console_blanked || - vt_cons[currcons]->vc_mode == KD_GRAPHICS) - return; - - if (fbinfo[0].setcursor) { - if (!vc_cons[currcons].d->vc_deccm) - sbus_hide_cursor(); - else { - idx = (vc_cons[currcons].d->vc_pos - video_mem_base) >> 1; - - sbus_hw_set_cursor(x_margin + ((idx % video_num_columns) << 3), y_margin + ((idx / video_num_columns) * CHAR_HEIGHT)); - } - return; - } - - __save_and_cli(flags); - - idx = (vc_cons[currcons].d->vc_pos - video_mem_base) >> 1; - oldpos = cursor_pos; - if (!vc_cons[currcons].d->vc_deccm) { - sbus_hide_cursor (); - __restore_flags (flags); - return; - } - cursor_pos = idx; - switch (con_depth){ - case 1: { - unsigned char *dst, *opos; - - dst = (unsigned char *)((unsigned long)con_fb_base + FBUF_OFFSET(idx)); - opos = (unsigned char *)((unsigned long)con_fb_base + FBUF_OFFSET(oldpos)); - if(oldpos != -1) { - /* Restore what was at the old position */ - for(j=0; j < CHAR_HEIGHT; j++, opos += CHARS_PER_LINE) { - *opos = ~*opos; - } - } - for(j=0; j < 16; j++, dst+=CHARS_PER_LINE) { - *dst = ~*dst; - } - break; - } - case 8: { - unsigned int *dst, *opos; - dst = (unsigned int *)((unsigned long)con_fb_base + COLOR_FBUF_OFFSET(idx)) + ints_per_cursor; - - if(oldpos != -1) { - opos = (unsigned int *)((unsigned long)con_fb_base + COLOR_FBUF_OFFSET(oldpos)) + ints_per_cursor; - opos[0] = under_cursor[0]; - opos[1] = under_cursor[1]; - opos[ints_per_line] = under_cursor[2]; - opos[ints_per_line+1] = under_cursor[3]; - } - under_cursor[0] = dst[0]; - under_cursor[1] = dst[1]; - under_cursor[2] = dst[ints_per_line]; - under_cursor[3] = dst[ints_per_line+1]; - dst[0] = 0x00000000; - dst[1] = 0x00000000; - dst[ints_per_line] = 0x00000000; - dst[ints_per_line+1] = 0x00000000; - break; - } - default: - } - __restore_flags(flags); -} - -/* - * Render the current screen - * Only used at startup and when switching from KD_GRAPHICS to KD_TEXT - * to avoid the caching that is being done in selection.h - */ - -static void sbus_render_screen(void) -{ - int count; - unsigned short *contents; - - count = video_num_columns * video_num_lines; - contents = (unsigned short *) video_mem_base; - - for (;count--; contents++) - sbus_blitc (*contents, (unsigned long) contents); -} - -__initfunc(static void sbus_con_type_init(const char **display_desc)) -{ - can_do_color = (con_type != FBTYPE_SUN2BW); - - video_type = VIDEO_TYPE_SUN; - *display_desc = "SUN"; - - if (!serial_console) { - /* If we fall back to PROM then our output have to remain readable. */ - prom_putchar('\033'); prom_putchar('['); prom_putchar('H'); - - /* - * fake the screen memory with some CPU memory - */ - video_mem_base = (unsigned long)kmalloc(video_screen_size, GFP_ATOMIC); - video_mem_term = (video_mem_base + video_screen_size); - } -} - -__initfunc(static void sbus_con_type_init_finish(void)) -{ - int i, cpu; - char *p = con_fb_base + skip_bytes; - char q[2] = {0,5}; - int currcons = 0; - unsigned short *ush; - int ncpus; - - if (serial_console) - return; - ncpus = linux_num_cpus; - if (ncpus > 4) ncpus = 4; - if (fbinfo[0].draw_penguin) { - (*fbinfo[0].draw_penguin)(x_margin, y_margin, ncpus); - } else if (con_depth == 8 && fbinfo[0].loadcmap) { - for (i = 0; i < linux_logo_colors; i++) { - fbinfo[0].color_map CM(i+32,0) = linux_logo_red [i]; - fbinfo[0].color_map CM(i+32,1) = linux_logo_green [i]; - fbinfo[0].color_map CM(i+32,2) = linux_logo_blue [i]; - } - (*fbinfo [0].loadcmap)(&fbinfo [0], 0, linux_logo_colors + 32); - for (i = 0; i < 80; i++, p += chars_per_line){ - for (cpu = 0; cpu < ncpus; cpu++){ - memcpy (p + (cpu * 88), linux_logo + 80 * i, 80); - } - } - } else if (con_depth == 1) { - for (i = 0; i < 80; i++, p += chars_per_line) - memcpy (p, linux_logo_bw + 10 * i, 10); - } - putconsxy(0, q); - ush = (unsigned short *) video_mem_base + video_num_columns * 2 + 20 + 11 * (ncpus - 1); - - p = logo_banner; - for (; *p; p++, ush++) { - *ush = (vc_cons[currcons].d->vc_attr << 8) + *p; - sbus_blitc (*ush, (unsigned long) ush); - } - for (i = 0; i < 5; i++) { - ush = (unsigned short *) video_mem_base + i * video_num_columns; - memset (ush, 0, 20); - } -} - -/* - * NOTE: get_scrmem() and set_scrmem() are here only because - * the VGA version of set_scrmem() has some direct VGA references. - */ -static void sbus_get_scrmem(int currcons) -{ - struct vc_data *vcd = vc_cons[currcons].d; - - memcpyw((unsigned short *)vc_scrbuf[currcons], - (unsigned short *)vcd->vc_origin, - video_screen_size); - vcd->vc_origin = vcd->vc_video_mem_start = - (unsigned long)vc_scrbuf[currcons]; - vcd->vc_scr_end = vcd->vc_video_mem_end = - vcd->vc_video_mem_start + video_screen_size; - vcd->vc_pos = - vcd->vc_origin + vcd->vc_y*video_size_row + (vcd->vc_x<<1); -} - -static void sbus_set_scrmem(int currcons, long offset) -{ - struct vc_data *vcd = vc_cons[currcons].d; - - if (video_mem_term - video_mem_base < offset + video_screen_size) - offset = 0; - memcpyw((unsigned short *)(video_mem_base + offset), - (unsigned short *) vcd->vc_origin, - video_screen_size); - vcd->vc_video_mem_start = video_mem_base; - vcd->vc_video_mem_end = video_mem_term; - vcd->vc_origin = video_mem_base + offset; - vcd->vc_scr_end = vcd->vc_origin + video_screen_size; - vcd->vc_pos = - vcd->vc_origin + vcd->vc_y*video_size_row + (vcd->vc_x<<1); -} - -/* - * PIO_FONT support. - */ -static int sbus_set_get_font(char * arg, int set, int ch512) -{ - int i, line; - - if (!arg) - return -EINVAL; - - /* download the current font */ - if (!set){ - if(clear_user(arg, cmapsz)) - return -EFAULT; - for (i = 0; i < 256; i++) { - for (line = 0; line < CHAR_HEIGHT; line++) { - unsigned char value = vga_font[i]; - - /* Access checked by the above clear_user */ - __put_user_ret (value, (arg + (i * 32 + line)), - -EFAULT); - } - } - return 0; - } - - /* set the font */ - - if (verify_area (VERIFY_READ, arg, 256 * CHAR_HEIGHT)) return -EFAULT; - for (i = 0; i < 256; i++) { - for (line = 0; line < CHAR_HEIGHT; line++){ - unsigned char value; - __get_user_ret(value, (arg + (i * 32 + line)),-EFAULT); - vga_font [i*CHAR_HEIGHT + line] = value; - } - } - return 0; -} - -/* - * Adjust the screen to fit a font of a certain height - * - * Returns < 0 for error, 0 if nothing changed, and the number - * of lines on the adjusted console if changed. - * - * for now, we only support the built-in font... - */ -static int sbus_con_adjust_height(unsigned long fontheight) -{ - return -EINVAL; -} - -static int sbus_set_get_cmap(unsigned char * arg, int set) -{ - int i; - - if(set) - i = VERIFY_READ; - else - i = VERIFY_WRITE; - if(verify_area(i, arg, (16 * 3 * sizeof(unsigned char)))) - return -EFAULT; - for (i=0; i<16; i++) { - if (set) { - __get_user_ret(default_red[i], (arg+0),-EFAULT); - __get_user_ret(default_grn[i], (arg+1),-EFAULT); - __get_user_ret(default_blu[i], (arg+2),-EFAULT); - } else { - __put_user_ret(default_red[i], (arg+0),-EFAULT); - __put_user_ret(default_grn[i], (arg+1),-EFAULT); - __put_user_ret(default_blu[i], (arg+2),-EFAULT); - } - arg += 3; - } - if (set) { - for (i=0; ivc_palette[k++] = default_red[j]; - vc_cons[i].d->vc_palette[k++] = default_grn[j]; - vc_cons[i].d->vc_palette[k++] = default_blu[j]; - } - } - sbus_set_palette(); - } - - return 0; -} - -#ifdef CONFIG_SUN4 -extern __inline__ void memset_screen(void *s, unsigned c, size_t n) -{ - unsigned *p = (unsigned *)s; - int i; - - for (i = n / 4; i > 0; i--) - *p++ = c; -} -#else -#define memset_screen memset -#endif - -void sbus_clear_screen(void) -{ - if (fbinfo[0].fill) { - int rects [4]; - - rects [0] = 0; - rects [1] = 0; - rects [2] = con_width; - rects [3] = con_height; - (*fbinfo[0].fill)(reverse_color_table[0], 1, rects); - } else if (fbinfo[0].base && fbinfo[0].base_depth) - memset_screen(con_fb_base, - (con_depth == 1) ? ~(0) : reverse_color_table[0], - (con_depth * con_height * con_width) / 8); - /* also clear out the "shadow" screen memory */ - memset((char *)video_mem_base, 0, (video_mem_term - video_mem_base)); - cursor_pos = -1; -} - -static void sbus_clear_fb(int n) -{ - if (!n) { - sbus_clear_screen (); - } else if (fbinfo[n].base && fbinfo[n].base_depth) { - memset((void *)fbinfo[n].base, - (fbinfo[n].base_depth == 1) ? - ~(0) : reverse_color_table[0], - (fbinfo[n].base_depth * fbinfo[n].type.fb_height - * fbinfo[n].type.fb_width) / 8); - } -} - -static void sbus_clear_margin(void) -{ - int h, he, i; - unsigned char *p; - - if (fbinfo[0].fill) { - int rects [16]; - - rects [0] = 0; - rects [1] = 0; - rects [2] = con_width; - rects [3] = y_margin; - rects [4] = 0; - rects [5] = y_margin; - rects [6] = x_margin; - rects [7] = con_height; - rects [8] = con_width - x_margin; - rects [9] = y_margin; - rects [10] = con_width; - rects [11] = con_height; - rects [12] = x_margin; - rects [13] = con_height - y_margin; - rects [14] = con_width - x_margin; - rects [15] = con_height; - (*fbinfo[0].fill)(reverse_color_table[0], 4, rects); - } else { - memset (con_fb_base, - (con_depth == 1) ? ~(0) : reverse_color_table[0], - skip_bytes - (x_margin<<1)); - memset (con_fb_base + chars_per_line * con_height - - skip_bytes + (x_margin<<1), - (con_depth == 1) ? ~(0) : reverse_color_table[0], - skip_bytes - (x_margin<<1)); - he = con_height - 2 * y_margin; - i = 2 * x_margin; - if (con_depth == 1) { - for (p = con_fb_base+skip_bytes-(x_margin<<1), h = 0; - h <= he; p += chars_per_line, h++) - memset (p, ~(0), i); - } else { - for (p = con_fb_base+skip_bytes-(x_margin<<1), h = 0; - h <= he; p += chars_per_line, h++) - memset (p, reverse_color_table[0], i); - } - } - if (fbinfo [0].switch_from_graph) - (*fbinfo [0].switch_from_graph)(); -} - -/* Call the frame buffer routine for setting the palette */ -static void sbus_set_palette (void) -{ - if (console_blanked || vt_cons [fg_console]->vc_mode == KD_GRAPHICS) - return; - - if (fbinfo [0].loadcmap){ - int i, j; - - /* First keep color_map with the palette colors */ - for (i = 0; i < 16; i++){ - j = sparc_color_table [i]; - fbinfo[0].color_map CM(i,0) = default_red [j]; - fbinfo[0].color_map CM(i,1) = default_grn [j]; - fbinfo[0].color_map CM(i,2) = default_blu [j]; - } - (*fbinfo [0].loadcmap)(&fbinfo [0], 0, 16); - } -} - -static void sbus_set_other_palette (int n) -{ - if (!n) { - sbus_set_palette (); - return; - } - if (fbinfo [n].loadcmap){ - fbinfo[n].color_map CM(0,0) = 0; - fbinfo[n].color_map CM(0,1) = 0; - fbinfo[n].color_map CM(0,2) = 0; - (*fbinfo [n].loadcmap)(&fbinfo [n], 0, 1); - } -} - -/* Called when returning to prom */ -static void sbus_console_restore_palette (void) -{ - if (fb_restore_palette) - (*fb_restore_palette) (&fbinfo[0]); -} - -__initfunc(void cg_postsetup(fbinfo_t *fb)) -{ - fb->color_map = kmalloc(256 * 3, GFP_ATOMIC); -} - -static char *known_cards [] __initdata = { - "cgsix", "cgthree", "cgRDI", "cgthree+", "bwtwo", "SUNW,tcx", - "cgfourteen", "SUNW,leo", "SUNW,ffb", 0 -}; -static char *v0_known_cards [] __initdata = { - "cgsix", "cgthree", "cgRDI", "cgthree+", "bwtwo", 0 -}; - -__initfunc(static int known_card (char *name, char **known_cards)) -{ - int i; - - for (i = 0; known_cards [i]; i++) - if (strcmp (name, known_cards [i]) == 0) - return 1; - return 0; -} - -static struct { - int depth; - int resx, resy; - int x_margin, y_margin; -} scr_def [] = { - { 8, 1280, 1024, 64, 80 }, - { 8, 1152, 1024, 64, 80 }, - { 8, 1152, 900, 64, 18 }, - { 8, 1024, 768, 0, 0 }, - { 8, 800, 600, 16, 12 }, - { 8, 640, 480, 0, 0 }, - { 1, 1152, 900, 8, 18 }, - { 0 }, -}; - -__initfunc(static int cg14_present(void)) -{ - int root, n; - - root = prom_getchild (prom_root_node); - if ((n = prom_searchsiblings (root, "obio")) == 0) - return 0; - - n = prom_getchild (n); - if ((n = prom_searchsiblings (n, "cgfourteen")) == 0) - return 0; - return n; -} - -__initfunc(static int creator_present (void)) -{ -#ifdef __sparc_v9__ - int root, n; - - root = prom_getchild (prom_root_node); - if ((n = prom_searchsiblings (root, "SUNW,ffb")) == 0) - return 0; - return n; -#else - return 0; -#endif -} - -__initfunc(static void - sparc_framebuffer_setup(int primary, int con_node, - int type, struct linux_sbus_device *sbdp, - uint base, unsigned long con_base, int prom_fb, - int parent_node)) -{ - static int frame_buffers = 1; - int n, i; - int linebytes; - uint io = 0; - char *p; - - if (primary) - n = 0; - else { - if (frame_buffers == FRAME_BUFFERS) - return; /* Silently ignore */ - n = frame_buffers++; - } - - if (prom_fb) sun_prom_console_id = n; - - if (sbdp) - io = sbdp->reg_addrs [0].which_io; - - /* Fill in common fb information */ - fbinfo [n].clear_fb = sbus_clear_fb; - fbinfo [n].set_other_palette = sbus_set_other_palette; - fbinfo [n].type.fb_type = type; - fbinfo [n].real_type = type; - fbinfo [n].prom_node = con_node; - memset (&(fbinfo [n].emulations), 0xff, sizeof (fbinfo [n].emulations)); - fbinfo [n].type.fb_height = prom_getintdefault(con_node, "height", 900); - fbinfo [n].type.fb_width = prom_getintdefault(con_node, "width", 1152); - fbinfo [n].type.fb_depth = (type == FBTYPE_SUN2BW) ? 1 : 8; - linebytes = prom_getintdefault(con_node, "linebytes", fbinfo[n].type.fb_width * fbinfo[n].type.fb_depth / 8); - fbinfo [n].type.fb_size = PAGE_ALIGN((linebytes) * (fbinfo [n].type.fb_height)); - fbinfo [n].space = io; - fbinfo [n].blanked = 0; - if (con_base >= PAGE_OFFSET) - fbinfo [n].base = con_base; - else - fbinfo [n].base = 0; - fbinfo [n].cursor.hwsize.fbx = 32; - fbinfo [n].cursor.hwsize.fby = 32; - fbinfo [n].proc_entry.node = parent_node; - fbinfo [n].proc_entry.rdev = MKDEV(GRAPHDEV_MAJOR, n); - fbinfo [n].proc_entry.mode = S_IFCHR | S_IRUSR | S_IWUSR; - prom_getname (con_node, fbinfo [n].proc_entry.name, 32 - 3); - p = strchr (fbinfo [n].proc_entry.name, 0); - sprintf (p, ":%d", n); - - /* Should be filled in for supported video cards */ - fbinfo [n].mmap = 0; - fbinfo [n].loadcmap = 0; - fbinfo [n].ioctl = 0; - fbinfo [n].reset = 0; - fbinfo [n].blank = 0; - fbinfo [n].unblank = 0; - fbinfo [n].setcursor = 0; - fbinfo [n].base_depth = fbinfo [n].type.fb_depth; - - /* Per card setup */ - switch (fbinfo [n].type.fb_type){ -#ifdef SUN_FB_CGTHREE - case FBTYPE_SUN3COLOR: - cg3_setup (&fbinfo [n], n, base, io, sbdp); - break; -#endif -#ifdef SUN_FB_TCX - case FBTYPE_TCXCOLOR: - tcx_setup (&fbinfo [n], n, con_node, base, sbdp); - break; -#endif -#ifdef SUN_FB_CGSIX - case FBTYPE_SUNFAST_COLOR: - cg6_setup (&fbinfo [n], n, base, io); - break; -#endif -#ifdef SUN_FB_BWTWO - case FBTYPE_SUN2BW: - bwtwo_setup (&fbinfo [n], n, base, io, sbdp); - break; -#endif -#ifdef SUN_FB_CGFOURTEEN - case FBTYPE_MDICOLOR: - cg14_setup (&fbinfo [n], n, con_node, base, io); - break; -#endif -#ifdef SUN_FB_LEO - case FBTYPE_SUNLEO: - leo_setup (&fbinfo [n], n, base, io); - break; -#endif -#if defined(SUN_FB_CREATOR) && defined(__sparc_v9__) - case FBTYPE_CREATOR: - creator_setup (&fbinfo [n], n, con_node, base, io); - break; -#endif - default: - fbinfo [n].type.fb_type = FBTYPE_NOTYPE; - return; - } - - if (n) - return; - - /* Code below here is just executed for the first frame buffer */ - con_type = type; - con_height = fbinfo [n].type.fb_height; - con_width = fbinfo [n].type.fb_width; - con_depth = (type == FBTYPE_SUN2BW) ? 1 : 8; - for (i = 0; scr_def [i].depth; i++){ - if ((scr_def [i].resx != con_width) || - (scr_def [i].resy != con_height)) - continue; - if (scr_def [i].depth != con_depth) - continue; - x_margin = scr_def [i].x_margin; - y_margin = scr_def [i].y_margin; - chars_per_line = (con_width * con_depth) / 8; - skip_bytes = chars_per_line * y_margin + x_margin; - ints_per_line = chars_per_line / 4; - ints_per_cursor = 14 * ints_per_line; - bytes_per_row = CHAR_HEIGHT * chars_per_line; - ORIG_VIDEO_COLS = con_width / 8 - - 2 * x_margin / con_depth; - ORIG_VIDEO_LINES = (con_height - 2 * y_margin) / 16; - switch (chars_per_line) { - case 1280: - if (ORIG_VIDEO_COLS == 144) - color_fbuf_offset = - color_fbuf_offset_1280_144; - break; - case 1152: - if (ORIG_VIDEO_COLS == 128) - color_fbuf_offset = - color_fbuf_offset_1152_128; - break; - case 1024: - if (ORIG_VIDEO_COLS == 128) - color_fbuf_offset = - color_fbuf_offset_1024_128; - break; - case 800: - if (ORIG_VIDEO_COLS == 96) - color_fbuf_offset = - color_fbuf_offset_800_96; - break; - case 640: - if (ORIG_VIDEO_COLS == 80) - color_fbuf_offset = - color_fbuf_offset_640_80; - break; - } - break; - } - - if (!scr_def [i].depth){ - x_margin = y_margin = 0; - prom_printf ("console: unknown video resolution %dx%d," - " depth %d\n", - con_width, con_height, con_depth); - prom_halt (); - } - - /* P3: I fear this strips 15inch 1024/768 PC-like - * monitors out. */ - if ((linebytes*8) / con_depth != con_width) { - prom_printf("console: unusual video, linebytes=%d, " - "width=%d, height=%d depth=%d\n", - linebytes, con_width, con_height, - con_depth); - prom_halt (); - } -} - -__initfunc(int sbus_console_probe(void)) -{ - int propl, con_node, default_node = 0; - char prop[16]; - struct linux_sbus_device *sbdp, *sbdprom; - struct linux_sbus *sbus; - int creator = 0, cg14 = 0; - char prom_name[40]; - int type, card_found = 0; - unsigned long con_base; - u32 tmp; - u32 prom_console_node = 0; - - if(SBus_chain == 0) { -#ifdef CONFIG_SUN4 - sparc_framebuffer_setup (1,0,FBTYPE_SUN2BW,NULL,SUN4_300_BWTWO_PHYSADDR,0,0,0); -#else - creator = creator_present(); - if (!creator) - return -1; - sparc_framebuffer_setup (1, creator, FBTYPE_CREATOR, - 0, 0, 0, 0, prom_root_node); -#endif - } else { - sbdprom = 0; - - switch(prom_vers) { - - case PROM_V0: - /* V0 proms are at sun4c only. Can skip many checks. */ - con_type = FBTYPE_NOTYPE; - for_each_sbusdev(sbdp, SBus_chain) { - /* If no "address" than it is not the PROM console. */ - if(sbdp->num_vaddrs) { - if(known_card(sbdp->prom_name, v0_known_cards)) { - sbdprom = sbdp; - strncpy(prom_name, sbdp->prom_name, sizeof (prom_name)); - break; - } - } - } - if(!sbdprom) return -1; - for_each_sbusdev(sbdp, SBus_chain) { - con_node = sbdp->prom_node; - - if(!strncmp(sbdp->prom_name, "cgsix", 5) || - !strncmp(sbdp->prom_name, "cgthree+", 8)) { - type = FBTYPE_SUNFAST_COLOR; - } else if(!strncmp(sbdp->prom_name, "cgthree", 7) || - !strncmp(sbdp->prom_name, "cgRDI", 5)) { - type = FBTYPE_SUN3COLOR; - } else if (!strncmp(sbdp->prom_name, "bwtwo", 5)) { - type = FBTYPE_SUN2BW; - } else - continue; - sparc_framebuffer_setup (sbdprom == sbdp, con_node, type, sbdp, - (uint)sbdp->reg_addrs [0].phys_addr, sbdp->sbus_vaddrs[0], 0, - sbdp->my_bus->prom_node); - /* XXX HACK */ - if (sbdprom == sbdp && !strncmp(sbdp->prom_name, "cgRDI", 5)) - break; - } - break; - - case PROM_V2: - case PROM_V3: - case PROM_P1275: - if (console_fb_path) { - char *q, c; - - for (q = console_fb_path; *q && *q != ' '; q++); - c = *q; - *q = 0; - default_node = prom_pathtoinode(console_fb_path); - if (default_node) { - prom_printf ("Using %s for console\n", console_fb_path); - prom_console_node = prom_inst2pkg(prom_stdout); - if (prom_console_node == default_node) - prom_console_node = 0; - } - } - if (!default_node) - default_node = prom_inst2pkg(prom_stdout); - propl = prom_getproperty(default_node, "device_type", - prop, sizeof (prop)); - if (propl < 0) { - prom_printf ("output-device doesn't have device_type property\n"); - prom_halt (); - } else if (propl != sizeof("display") || strncmp("display", prop, sizeof("display"))) { - prop [propl] = 0; - prom_printf ("console_probe: output-device is %s" - " (not \"display\")\n", prop); - prom_halt (); - } - for_all_sbusdev(sbdp, sbus) { - if ((sbdp->prom_node == default_node) - && known_card (sbdp->prom_name, known_cards)) { - sbdprom = sbdp; - break; - } - } - if (sbdprom) - card_found = 1; - if (!card_found) - card_found = cg14 = cg14_present (); - if (!card_found){ - card_found = creator = creator_present (); - } - if (!card_found){ - prom_printf ("Could not find a known video card on this machine\n"); - prom_halt (); - } - - for_all_sbusdev(sbdp, sbus) { - if (!known_card (sbdp->prom_name, known_cards)) - continue; - con_node = sbdp->prom_node; - prom_apply_sbus_ranges (sbdp->my_bus, &sbdp->reg_addrs [0], - sbdp->num_registers, sbdp); - - propl = prom_getproperty(con_node, "address", (char *) &tmp, 4); - con_base = tmp; - if (propl != 4) con_base = 0; - propl = prom_getproperty(con_node, "emulation", prom_name, sizeof (prom_name)); - if (propl < 0 || propl >= sizeof (prom_name)) { - /* Early cg3s had no "emulation". */ - propl = prom_getproperty(con_node, "name", prom_name, sizeof (prom_name)); - if (propl < 0) { - prom_printf("console: no device name!!\n"); - return -1; - } - } - prom_name [sizeof (prom_name) - 1] = 0; - if(!strcmp(prom_name, "cgsix") || - !strcmp(prom_name, "cgthree+")) { - type = FBTYPE_SUNFAST_COLOR; - } else if(!strcmp(prom_name, "cgthree") || - !strcmp(prom_name, "cgRDI")) { - type = FBTYPE_SUN3COLOR; - } else if(!strcmp(prom_name, "cgfourteen")) { - type = FBTYPE_MDICOLOR; - } else if(!strcmp(prom_name, "SUNW,leo")) { - type = FBTYPE_SUNLEO; - } else if(!strcmp(prom_name, "bwtwo")) { - type = FBTYPE_SUN2BW; - } else if(!strcmp(prom_name,"SUNW,tcx")){ - sparc_framebuffer_setup (sbdprom == sbdp, con_node, FBTYPE_TCXCOLOR, sbdp, - (uint)sbdp->reg_addrs [10].phys_addr, con_base, - prom_console_node == con_node, sbdp->my_bus->prom_node); - continue; - } else { - prom_printf("console: \"%s\" is unsupported\n", prom_name); - continue; - } - sparc_framebuffer_setup (sbdprom == sbdp, con_node, type, sbdp, - (uint)sbdp->reg_addrs [0].phys_addr, con_base, - prom_console_node == con_node, sbdp->my_bus->prom_node); - /* XXX HACK */ - if (sbdprom == sbdp && !strncmp(sbdp->prom_name, "cgRDI", 5)) - break; - } - if (cg14) { - sparc_framebuffer_setup (!sbdprom, cg14, FBTYPE_MDICOLOR, - 0, 0, 0, prom_console_node == cg14, - prom_searchsiblings (prom_getchild (prom_root_node), "obio")); - } - if (creator){ - sparc_framebuffer_setup (!sbdprom, creator, FBTYPE_CREATOR, - 0, 0, 0, prom_console_node == creator, - prom_root_node); - } - break; - - default: - return -1; - } - } - - if (fbinfo [0].type.fb_type == FBTYPE_NOTYPE) { - prom_printf ("Couldn't setup your primary frame buffer.\n"); - prom_halt (); - } - - if (fbinfo [0].blitc) - do_accel = 1; - - con_fb_base = (unsigned char *)fbinfo[0].base; - if (!con_fb_base){ - prom_printf ("PROM does not have an 'address' property for this\n" - "frame buffer and the Linux drivers do not know how\n" - "to map the video of this device\n"); - prom_halt (); - } - sbus_install_consops(); - return fb_init (); -} - -/* - * sbus_blitc - * - * Displays an ASCII character at a specified character cell - * position. - * - * Called from scr_writew() when the destination is - * the "shadow" screen - */ -static uint -fontmask_bits[16] = { - 0x00000000, - 0x000000ff, - 0x0000ff00, - 0x0000ffff, - 0x00ff0000, - 0x00ff00ff, - 0x00ffff00, - 0x00ffffff, - 0xff000000, - 0xff0000ff, - 0xff00ff00, - 0xff00ffff, - 0xffff0000, - 0xffff00ff, - 0xffffff00, - 0xffffffff -}; - -static int sbus_blitc(uint charattr, unsigned long addr) -{ - unsigned int fgmask, bgmask; - unsigned char attrib; - int j, idx; - unsigned char *font_row; - - if (do_accel) { - (*fbinfo[0].blitc)(charattr, - x_margin + (((addr - video_mem_base) % video_size_row)<<2), - y_margin + CHAR_HEIGHT * ((addr - video_mem_base) / video_size_row)); - return 0; - } - - /* Invalidate the cursor position if necessary. */ - idx = (addr - video_mem_base) >> 1; - - attrib = CHARATTR_TO_SUNCOLOR(charattr); - font_row = &vga_font[(j = (charattr & 0xff)) << 4]; - - switch (con_depth){ - case 1: { - register unsigned char *dst; - unsigned long flags; - - dst = (unsigned char *)(((unsigned long)con_fb_base) + FBUF_OFFSET(idx)); - - __save_and_cli(flags); - if ((!(charattr & 0xf000)) ^ (idx == cursor_pos)) { - for(j = 0; j < CHAR_HEIGHT; j++, font_row++, dst+=CHARS_PER_LINE) - *dst = ~(*font_row); - } else { - for(j = 0; j < CHAR_HEIGHT; j++, font_row++, dst+=CHARS_PER_LINE) - *dst = *font_row; - } - __restore_flags(flags); - break; - } - case 8: { -#ifdef ASM_BLITC - const int cpl = chars_per_line; - /* The register assignment is important here, do not modify without touching the assembly code as well */ - register unsigned int x1 __asm__("g4"), x2 __asm__("g5"), x3 __asm__("g2"), x4 __asm__("g3"), flags __asm__("g7"); - register unsigned int *dst; -#else - const int ipl = ints_per_line; - unsigned int data2, data3, data4; - unsigned int data, rowbits; - register unsigned int *dst; - unsigned long flags; -#endif - const uint *fontm_bits = fontmask_bits; - - dst = (unsigned int *)(((unsigned long)con_fb_base) + COLOR_FBUF_OFFSET(idx)); - if (j == ' ') /* space is quite common, so we optimize a bit */ { -#ifdef ASM_BLITC -#define BLITC_SPACE \ - "\n\t std %3, [%0]" \ - "\n\t std %3, [%0 + %1]" \ - "\n\t add %0, %2, %0" -#define BLITC_SPC \ - "\n\t std %0, [%1]" \ - "\n\t std %0, [%1 + %2]" - - x1 = attrib >> 4; - x1 |= x1 << 8; - x1 |= x1 << 16; - x3 = cpl << 1; - - __asm__ __volatile__ ( - "\n\t mov %3, %4" - BLITC_SPACE - BLITC_SPACE - BLITC_SPACE - BLITC_SPACE - BLITC_SPACE - BLITC_SPACE - BLITC_SPACE - : "=r" (dst) - : "r" (cpl), "r" (x3), "r" (x1), "r" (x2)); - __save_and_cli (flags); - if (idx != cursor_pos) - __asm__ __volatile__ ( - BLITC_SPC - : /* no outputs */ - : "r" (x1), "r" (dst), "r" (cpl)); - else - __asm__ __volatile__ (BLITC_SPC - : /* no outputs */ - : "r" (x1), "r" (under_cursor), - "i" (8)); - __restore_flags (flags); -#else - bgmask = attrib >> 4; - bgmask |= bgmask << 8; - bgmask |= bgmask << 16; - - for(j = 0; j < CHAR_HEIGHT - 2; j++, font_row++, dst += ipl) { - *dst = bgmask; - *(dst+1) = bgmask; - } - /* Prevent cursor spots left on the screen */ - __save_and_cli(flags); - if (idx != cursor_pos) { - *dst = bgmask; - *(dst+1) = bgmask; - dst += ipl; - *dst = bgmask; - *(dst+1) = bgmask; - } else { - under_cursor [0] = bgmask; - under_cursor [1] = bgmask; - under_cursor [2] = bgmask; - under_cursor [3] = bgmask; - } - __restore_flags(flags); -#endif - } else /* non-space */ { - fgmask = attrib & 0x0f; - bgmask = attrib >> 4; - fgmask |= fgmask << 8; - fgmask |= fgmask << 16; - bgmask |= bgmask << 8; - bgmask |= bgmask << 16; - -#ifdef ASM_BLITC -#define BLITC_INIT \ - "\n\t ld [%0], %%g2" -#define BLITC_BODY(ST1,SC1,ST2,SC2) \ - "\n\t " #ST1 " %%g2, " #SC1 ", %%g7" \ - "\n\t " #ST2 " %%g2, " #SC2 ", %7" \ - "\n\t and %%g7, 0x3c, %%g7" \ - "\n\t and %7, 0x3c, %7" \ - "\n\t ld [%1 + %%g7], %6" \ - "\n\t and %6, %2, %%g7" \ - "\n\t andn %3, %6, %6" \ - "\n\t or %%g7, %6, %6" \ - "\n\t ld [%1 + %7], %7" \ - "\n\t and %7, %2, %%g7" \ - "\n\t andn %3, %7, %7" \ - "\n\t or %%g7, %7, %7" -#define BLITC_BODYEND \ - "\n\t sll %3, 2, %%g7" \ - "\n\t srl %3, 2, %3" \ - "\n\t and %%g7, 0x3c, %%g7" \ - "\n\t and %3, 0x3c, %3" \ - "\n\t ld [%0 + %%g7], %4" \ - "\n\t and %4, %1, %%g7" \ - "\n\t andn %2, %4, %4" \ - "\n\t or %%g7, %4, %4" \ - "\n\t ld [%0 + %3], %3" \ - "\n\t and %3, %1, %%g7" \ - "\n\t andn %2, %3, %3" \ - "\n\t or %%g7, %3, %3" -#define BLITC_STOREIT \ - "\n\t std %6, [%5]" \ - "\n\t add %5, %4, %5" \ - "\n\t" -#define BLITC_STORE \ - "\n\t std %%g4, [%0]" \ - "\n\t std %%g2, [%0 + %1]" - - for (j = 0; j < 3; j++, font_row+=4) { - __asm__ __volatile__ (BLITC_INIT - BLITC_BODY(srl, 26, srl, 22) - BLITC_STOREIT - BLITC_BODY(srl, 18, srl, 14) - BLITC_STOREIT - BLITC_BODY(srl, 10, srl, 6) - BLITC_STOREIT - BLITC_BODY(srl, 2, sll, 2) - BLITC_STOREIT - : : "r" (font_row), "r" (fontm_bits), "r" (fgmask), "r" (bgmask), "r" (cpl), "r" (dst), - "r" (x1), "r" (x2)); - } - __asm__ __volatile__ (BLITC_INIT - BLITC_BODY(srl, 26, srl, 22) - BLITC_STOREIT - BLITC_BODY(srl, 18, srl, 14) - BLITC_STOREIT - /* Now prepare date for the 15th line, but don't put it anywhere yet (leave it in g4,g5) */ - BLITC_BODY(srl, 10, srl, 6) - : : "r" (font_row), "r" (fontm_bits), "r" (fgmask), "r" (bgmask), "r" (cpl), "r" (dst), - "r" (x1), "r" (x2)); - /* Prepare the data the bottom line (and put it into g2,g3) */ - __asm__ __volatile__ (BLITC_BODYEND : : "r" (fontm_bits), "r" (fgmask), "r" (bgmask), - "r" (x3), "r" (x4)); - __save_and_cli(flags); - if (idx != cursor_pos) - __asm__ __volatile__ (BLITC_STORE : : "r" (dst), "r" (cpl)); - else - __asm__ __volatile__ (BLITC_STORE : : "r" (under_cursor), "i" (8)); - __restore_flags (flags); -#else - for(j = 0; j < CHAR_HEIGHT - 2; j++, font_row++, dst += ipl) { - rowbits = *font_row; - data = fontm_bits[(rowbits>>4)&0xf]; - data = (data & fgmask) | (~data & bgmask); - *dst = data; - data = fontm_bits[rowbits&0xf]; - data = (data & fgmask) | (~data & bgmask); - *(dst+1) = data; - } - rowbits = *font_row; - data = fontm_bits[(rowbits>>4)&0xf]; - data = (data & fgmask) | (~data & bgmask); - data2 = fontm_bits[rowbits&0xf]; - data2 = (data2 & fgmask) | (~data2 & bgmask); - rowbits = font_row[1]; - data3 = fontm_bits[(rowbits>>4)&0xf]; - data3 = (data3 & fgmask) | (~data3 & bgmask); - data4 = fontm_bits[rowbits&0xf]; - data4 = (data4 & fgmask) | (~data4 & bgmask); - - /* Prevent cursor spots left on the screen */ - __save_and_cli(flags); - - if (idx != cursor_pos) { - *dst = data; - *(dst+1) = data2; - dst += ipl; - *dst = data3; - *(dst+1) = data4; - } else { - under_cursor [0] = data; - under_cursor [1] = data2; - under_cursor [2] = data3; - under_cursor [3] = data4; - } - - __restore_flags(flags); -#endif - } - break; - } /* case */ - } /* switch */ - return (0); -} - -static void sbus_scr_writew(unsigned short val, unsigned short * addr) -{ - /* - * always deposit the char/attr, then see if it was to "screen" mem. - * if so, then render the char/attr onto the real screen. - */ - if (*addr != val) { - *addr = val; - if ((unsigned long)addr < video_mem_term && - (unsigned long)addr >= video_mem_base && - vt_cons [fg_console]->vc_mode == KD_TEXT) - sbus_blitc(val, (unsigned long) addr); - } -} - -static unsigned short sbus_scr_readw(unsigned short * addr) -{ - return *addr; -} - -static void sbus_memsetw(void * s, unsigned short c, unsigned int count) -{ - unsigned short * addr = (unsigned short *) s; - - count >>= 1; - if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) { - while (count) { - count--; - *addr++ = c; - } - return; - } - if ((unsigned long) addr + count > video_mem_term || - (unsigned long) addr < video_mem_base) { - if ((unsigned long) addr + count <= video_mem_term || - (unsigned long) addr > video_mem_base) { - while (count) { - count--; - *addr++ = c; - } - return; - } else { - while (count) { - count--; - scr_writew(c, addr++); - } - } -#define GX_SETW (*fbinfo[0].setw)(x_margin + ((xoff - (addr - last)) << 3), y_margin + CHAR_HEIGHT * yoff, c, addr - last); - } else if (do_accel) { - int yoff = (((long)addr - (long)video_mem_base) >> 1) / video_num_columns; - int xoff = (((long)addr - (long)video_mem_base) >> 1) % video_num_columns; - unsigned short * last = addr; - - while (count) { - count--; - if (*addr != c) { - if (xoff == video_num_columns) { - if (last != addr) - GX_SETW - xoff = 0; - yoff++; - last = addr; - } - *addr++ = c; - xoff++; - } else { - if (last != addr) - GX_SETW - if (xoff == video_num_columns) { - xoff = 0; - yoff++; - } - addr++; - xoff++; - last = addr; - } - } - if (last != addr) - GX_SETW - } else { - while (count) { - count--; - if (*addr != c) { - sbus_blitc(c, (unsigned long)addr); - *addr++ = c; - } else - addr++; - } - } -} - -static void sbus_memcpyw(unsigned short *to, unsigned short *from, unsigned int count) -{ - if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS) { - memcpy(to, from, count); - return; - } - if ((unsigned long) to + count > video_mem_term || - (unsigned long) to < video_mem_base) { - if ((unsigned long) to + count <= video_mem_term || - (unsigned long) to > video_mem_base) - memcpy(to, from, count); - else { - count >>= 1; - while (count) { - count--; - scr_writew(scr_readw(from++), to++); - } - } -#define GX_CPYW (*fbinfo[0].cpyw)(x_margin + ((xoff - (to - last)) << 3), y_margin + CHAR_HEIGHT * yoff, last, to - last); - } else if (do_accel) { - int yoff = (((long)to - (long)video_mem_base) >> 1) / video_num_columns; - int xoff = (((long)to - (long)video_mem_base) >> 1) % video_num_columns; - unsigned short * last = to; - - count >>=1; - while (count) { - count--; - if (*to != *from) { - if (xoff == video_num_columns) { - if (last != to) - GX_CPYW - xoff = 0; - yoff++; - last = to; - } else if (last != to && (*last & 0xff00) != (*from & 0xff00)) { - GX_CPYW - last = to; - } - *to++ = *from++; - xoff++; - } else { - if (last != to) - GX_CPYW - if (xoff == video_num_columns) { - xoff = 0; - yoff++; - } - to++; - xoff++; - last = to; - from++; - } - } - if (last != to) - GX_CPYW - } else { - count >>= 1; - while (count) { - count--; - if (*to != *from) { - sbus_blitc(*from, (unsigned long)to); - *to++ = *from++; - } else { - from++; - to++; - } - } - } -} - -#undef pos -int sbus_hw_scursor (struct fbcursor *cursor, fbinfo_t *fb) -{ - int op; - int i, bytes = 0; - struct fbcursor f; - char red[2], green[2], blue[2]; - - if (copy_from_user (&f, cursor, sizeof(struct fbcursor))) - return -EFAULT; - op = f.set; - if (op & FB_CUR_SETSHAPE){ - if ((uint) f.size.fbx > fb->cursor.hwsize.fbx) - return -EINVAL; - if ((uint) f.size.fby > fb->cursor.hwsize.fby) - return -EINVAL; - if (f.size.fbx > 32) - bytes = f.size.fby << 3; - else - bytes = f.size.fby << 2; - } - if (op & FB_CUR_SETCMAP){ - if (f.cmap.index || f.cmap.count != 2) - return -EINVAL; - if (copy_from_user (red, f.cmap.red, 2) || - copy_from_user (green, f.cmap.green, 2) || - copy_from_user (blue, f.cmap.blue, 2)) - return -EFAULT; - } - if (op & FB_CUR_SETCMAP) - (*fb->setcursormap) (fb, red, green, blue); - if (op & FB_CUR_SETSHAPE){ - uint u; - - fb->cursor.size = f.size; - memset ((void *)&fb->cursor.bits, 0, sizeof (fb->cursor.bits)); - if (copy_from_user (fb->cursor.bits [0], f.mask, bytes) || - copy_from_user (fb->cursor.bits [1], f.image, bytes)) - return -EFAULT; - if (f.size.fbx <= 32) { - u = ~(0xffffffff >> f.size.fbx); - for (i = fb->cursor.size.fby - 1; i >= 0; i--) { - fb->cursor.bits [0][i] &= u; - fb->cursor.bits [1][i] &= fb->cursor.bits [0][i]; - } - } else { - u = ~(0xffffffff >> (f.size.fbx - 32)); - for (i = fb->cursor.size.fby - 1; i >= 0; i--) { - fb->cursor.bits [0][2*i+1] &= u; - fb->cursor.bits [1][2*i] &= fb->cursor.bits [0][2*i]; - fb->cursor.bits [1][2*i+1] &= fb->cursor.bits [0][2*i+1]; - } - } - (*fb->setcurshape) (fb); - } - if (op & (FB_CUR_SETCUR | FB_CUR_SETPOS | FB_CUR_SETHOT)){ - if (op & FB_CUR_SETCUR) - fb->cursor.enable = f.enable; - if (op & FB_CUR_SETPOS) - fb->cursor.cpos = f.pos; - if (op & FB_CUR_SETHOT) - fb->cursor.chot = f.hot; - (*fb->setcursor) (fb); - } - return 0; -} - -static unsigned char hw_cursor_cmap[2] = { 0, 0xff }; - -void sbus_hw_hide_cursor (void) -{ - fbinfo[0].cursor.enable = 0; - (*fbinfo[0].setcursor)(&fbinfo[0]); - sbus_hw_cursor_shown = 0; -} - -void sbus_hw_set_cursor (int xoff, int yoff) -{ - if (!sbus_hw_cursor_shown) { - fbinfo[0].cursor.size.fbx = CHAR_WIDTH; - fbinfo[0].cursor.size.fby = CHAR_HEIGHT; - fbinfo[0].cursor.chot.fbx = 0; - fbinfo[0].cursor.chot.fby = 0; - fbinfo[0].cursor.enable = 1; - memset (fbinfo[0].cursor.bits, 0, sizeof (fbinfo[0].cursor.bits)); - fbinfo[0].cursor.bits[0][CHAR_HEIGHT - 2] = 0xff000000; - fbinfo[0].cursor.bits[1][CHAR_HEIGHT - 2] = 0xff000000; - fbinfo[0].cursor.bits[0][CHAR_HEIGHT - 1] = 0xff000000; - fbinfo[0].cursor.bits[1][CHAR_HEIGHT - 1] = 0xff000000; - (*fbinfo[0].setcursormap) (&fbinfo[0], hw_cursor_cmap, hw_cursor_cmap, hw_cursor_cmap); - (*fbinfo[0].setcurshape) (&fbinfo[0]); - sbus_hw_cursor_shown = 1; - } - fbinfo[0].cursor.cpos.fbx = xoff; - fbinfo[0].cursor.cpos.fby = yoff; - (*fbinfo[0].setcursor)(&fbinfo[0]); -} - -__initfunc(static void sbus_install_consops(void)) -{ - suncons_ops.memsetw = sbus_memsetw; - suncons_ops.memcpyw = sbus_memcpyw; - suncons_ops.scr_writew = sbus_scr_writew; - suncons_ops.scr_readw = sbus_scr_readw; - - suncons_ops.get_scrmem = sbus_get_scrmem; - suncons_ops.set_scrmem = sbus_set_scrmem; - - suncons_ops.hide_cursor = sbus_hide_cursor; - suncons_ops.set_cursor = sbus_set_cursor; - suncons_ops.set_get_font = sbus_set_get_font; - suncons_ops.con_adjust_height = sbus_con_adjust_height; - suncons_ops.set_get_cmap = sbus_set_get_cmap; - suncons_ops.set_palette = sbus_set_palette; - suncons_ops.set_other_palette = sbus_set_other_palette; - suncons_ops.console_restore_palette = sbus_console_restore_palette; - - suncons_ops.con_type_init = sbus_con_type_init; - suncons_ops.con_type_init_finish = sbus_con_type_init_finish; - - suncons_ops.clear_screen = sbus_clear_screen; - suncons_ops.render_screen = sbus_render_screen; - suncons_ops.clear_margin = sbus_clear_margin; -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/su.c linux/drivers/sbus/char/su.c --- v2.1.114/linux/drivers/sbus/char/su.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/su.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: su.c,v 1.8 1998/04/01 05:07:50 ecd Exp $ +/* $Id: su.c,v 1.10 1998/05/29 06:00:26 ecd Exp $ * su.c: Small serial driver for keyboard/mouse interface on Ultra/AX * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -21,6 +21,7 @@ #include #include #include +#include #include "sunserial.h" #include "sunkbd.h" @@ -151,7 +152,7 @@ unsigned char status; #ifdef SERIAL_DEBUG_INTR - printk("su_interrupt(%d)...", irq); + printk("su_interrupt(%s)...", __irq_itoa(irq)); #endif if (su_inb(info, UART_IIR) & UART_IIR_NO_INT) @@ -186,7 +187,8 @@ } #ifdef SERIAL_DEBUG_OPEN - printk("starting up su%d (irq %x)...", info->line, info->irq); + printk("starting up su%d (irq %s)...", info->line, + __irq_itoa(info->irq)); #endif if (info->type == PORT_16750) @@ -405,18 +407,21 @@ autoconfig(struct su_struct *info) { unsigned char status1, status2, scratch, scratch2; - struct linux_ebus_device *dev; + struct linux_ebus_device *dev = 0; struct linux_ebus *ebus; unsigned long flags; - for_all_ebusdev(dev, ebus) { - if (!strncmp(dev->prom_name, "su", 2)) { - if (dev->prom_node == info->kbd_node) - break; - if (dev->prom_node == info->ms_node) - break; + for_each_ebus(ebus) { + for_each_ebusdev(dev, ebus) { + if (!strncmp(dev->prom_name, "su", 2)) { + if (dev->prom_node == info->kbd_node) + goto ebus_done; + if (dev->prom_node == info->ms_node) + goto ebus_done; + } } } +ebus_done: if (!dev) return; @@ -427,8 +432,8 @@ info->irq = dev->irqs[0]; #ifdef DEBUG_SERIAL_OPEN - printk("Found 'su' at %016lx IRQ %08x\n", - dev->base_address[0], dev->irqs[0]); + printk("Found 'su' at %016lx IRQ %d,%x\n", dev->base_address[0], + __irq_itoa(dev->irqs[0])); #endif info->magic = SERIAL_MAGIC; @@ -564,8 +569,8 @@ if (info->type == PORT_UNKNOWN) continue; - printk(KERN_INFO "%s at %16lx (irq = %08x) is a %s\n", - info->name, info->port, info->irq, + printk(KERN_INFO "%s at %16lx (irq = %s) is a %s\n", + info->name, info->port, __irq_itoa(info->irq), uart_config[info->type].name); startup(info); diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/suncons.c linux/drivers/sbus/char/suncons.c --- v2.1.114/linux/drivers/sbus/char/suncons.c Fri May 8 23:14:48 1998 +++ linux/drivers/sbus/char/suncons.c Wed Dec 31 16:00:00 1969 @@ -1,378 +0,0 @@ -/* $Id: suncons.c,v 1.80 1998/04/13 07:27:01 davem Exp $ - * suncons.c: Sparc platform console generic layer. - * - * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "fb.h" - -#include - -fbinfo_t *fbinfo; -int fbinfos; -unsigned int linux_logo_colors __initdata = LINUX_LOGO_COLORS; -char logo_banner[] __initdata = linux_logo_banner; -#ifdef CONFIG_PCI -static int cons_type __initdata = 0; -#endif - -extern struct console vt_console_driver; - -/* Infrastructure. */ - -static void nop_memsetw(void *s, unsigned short c, unsigned int count) -{ -} - -static void nop_memcpyw(unsigned short *to, unsigned short *from, unsigned int count) -{ -} - -static void nop_scr_writew(unsigned short val, unsigned short *addr) -{ -} - -static unsigned short nop_scr_readw(unsigned short *addr) -{ - return 0; -} - -static void nop_get_scrmem(int a) -{ -} - -static void nop_set_scrmem(int a, long b) -{ -} - -static void nop_set_origin(unsigned short offset) -{ -} - -static void nop_hide_cursor(void) -{ -} - -static void nop_set_cursor(int c) -{ -} - -static int nop_set_get_font(char *a, int b, int c) -{ - return 0; -} - -static int nop_con_adjust_height(unsigned long arg) -{ - return -EINVAL; -} - -static int nop_set_get_cmap(unsigned char *arg, int a) -{ - return 0; -} - -static void nop_set_palette(void) -{ -} - -static void nop_set_other_palette(int a) -{ -} - -static void nop_console_restore_palette(void) -{ -} - -static void nop_con_type_init(const char **display_desc) -{ -} - -static void nop_con_type_init_finish(void) -{ -} - -static void nop_vesa_blank(void) -{ -} - -static void nop_vesa_unblank(void) -{ -} - -static void nop_set_vesa_blanking(const unsigned long arg) -{ -} - -static void nop_vesa_powerdown(void) -{ -} - -static void nop_clear_screen(void) -{ -} - -static void nop_render_screen(void) -{ -} - -static void nop_clear_margin(void) -{ -} - -struct suncons_operations suncons_ops = { - nop_memsetw, - nop_memcpyw, - nop_scr_writew, - nop_scr_readw, - nop_get_scrmem, - nop_set_scrmem, - nop_set_origin, - nop_hide_cursor, - nop_set_cursor, - nop_set_get_font, - nop_con_adjust_height, - nop_set_get_cmap, - nop_set_palette, - nop_set_other_palette, - nop_console_restore_palette, - nop_con_type_init, - nop_con_type_init_finish, - nop_vesa_blank, - nop_vesa_unblank, - nop_set_vesa_blanking, - nop_vesa_powerdown, - nop_clear_screen, - nop_render_screen, - nop_clear_margin -}; - -/* Entry points. */ - -void get_scrmem(int a) -{ - suncons_ops.get_scrmem(a); -} - -void set_scrmem(int a, long b) -{ - suncons_ops.set_scrmem(a, b); -} - -void __set_origin(unsigned short offset) -{ - suncons_ops.set_origin(offset); -} - -void hide_cursor(void) -{ - suncons_ops.hide_cursor(); -} - -void set_cursor(int currcons) -{ - suncons_ops.set_cursor(currcons); -} - -int set_get_font(char *arg, int set, int ch512) -{ - return suncons_ops.set_get_font(arg, set, ch512); -} - -int con_adjust_height(unsigned long fontheight) -{ - return suncons_ops.con_adjust_height(fontheight); -} - -int set_get_cmap(unsigned char *arg, int set) -{ - return suncons_ops.set_get_cmap(arg, set); -} - -void set_palette(void) -{ - suncons_ops.set_palette(); -} - -void set_other_palette(int n) -{ - suncons_ops.set_other_palette(n); -} - -void console_restore_palette(void) -{ - suncons_ops.console_restore_palette(); -} - -void con_type_init(const char **disp_desc) -{ - return suncons_ops.con_type_init(disp_desc); -} - -void con_type_init_finish(void) -{ - suncons_ops.con_type_init_finish(); -} - -void vesa_blank(void) -{ - suncons_ops.vesa_blank(); -} - -void vesa_unblank(void) -{ - suncons_ops.vesa_unblank(); -} - -void set_vesa_blanking(const unsigned long arg) -{ - suncons_ops.set_vesa_blanking(arg); -} - -void vesa_powerdown(void) -{ - suncons_ops.vesa_powerdown(); -} - -void render_screen(void) -{ - suncons_ops.render_screen(); -} - -/* - * We permutate the colors, so we match the PROM's idea of - * black and white. - */ -unsigned char reverse_color_table[] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 -}; - -unsigned char sparc_color_table[] = { - 15, 0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11 -}; - -/* Probing engine. */ - -char *console_fb_path = NULL; -void (*fb_restore_palette)(fbinfo_t *fbinfo) = NULL; - -unsigned long -get_phys (unsigned long addr) -{ - return __get_phys(addr); -} - -extern int sbus_console_probe(void); -extern int serial_console; - -__initfunc(static void finish_console_init(void)) -{ - static int confinish_has_run = 0; - int i, j; - - if(confinish_has_run != 0) { - printk("finish_console_init: Someone tries to run me twice.\n"); - return; - } - for(i = FRAME_BUFFERS; i > 1; i--) - if(fbinfo[i - 1].type.fb_type != FBTYPE_NOTYPE) - break; - fbinfos = i; - - for(j = 0; j < i; j++) - if (fbinfo[j].postsetup) - (*fbinfo[j].postsetup)(fbinfo+j); - - suncons_ops.clear_screen(); - - for(j = 1; j < i; j++) - if(fbinfo[j].type.fb_type != FBTYPE_NOTYPE) { - fbinfo[j].clear_fb(j); - fbinfo[j].set_other_palette(j); - } -#if defined(CONFIG_PROC_FS) && \ - ( defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE) ) - for (j = 0; j < i; j++) - if (fbinfo[j].type.fb_type != FBTYPE_NOTYPE) - proc_openprom_regdev (&fbinfo[j].proc_entry); -#endif - - confinish_has_run = 1; -} - -__initfunc(int con_is_present(void)) -{ - return serial_console ? 0 : 1; -} - -#ifdef CONFIG_PCI -extern int pci_console_probe(void); -extern void pci_console_inithook(void); - -__initfunc(void pci_console_init(void)) -{ - /* Nothing to do in this case. */ - if (!con_is_present()) - return; - - if (!cons_type) { - /* Some console was already found on SBUS or UPA */ - return; - } - - if(pci_console_probe()) { - prom_printf("Could not probe PCI console, bailing out...\n"); - prom_halt(); - } - - finish_console_init(); - - con_type_init_finish(); -} - -#endif /* CONFIG_PCI */ - -__initfunc(void sun_console_init(void)) -{ - int i; - - /* Nothing to do in this case. */ - if (!con_is_present()) - return; - - fbinfo = kmalloc(sizeof(fbinfo_t) * FRAME_BUFFERS, GFP_ATOMIC); - memset(fbinfo, 0, FRAME_BUFFERS * sizeof(fbinfo_t)); - fbinfos = 0; - - for (i = 0; i < FRAME_BUFFERS; i++) - fbinfo [i].type.fb_type = FBTYPE_NOTYPE; - - if(sbus_console_probe()) { -#ifdef CONFIG_PCI - cons_type = 1; - return pci_console_inithook(); -#else - /* XXX We need to write PROM console fallback driver... */ - prom_printf("Could not probe SBUS console, bailing out...\n"); - prom_halt(); -#endif - } - return finish_console_init(); -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/suncons_font.h linux/drivers/sbus/char/suncons_font.h --- v2.1.114/linux/drivers/sbus/char/suncons_font.h Fri Dec 13 01:37:32 1996 +++ linux/drivers/sbus/char/suncons_font.h Wed Dec 31 16:00:00 1969 @@ -1,258 +0,0 @@ -unsigned char vga_font[cmapsz] = { -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff, -/* */ 0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00, -/* */ 0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff, -/* */ 0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00, -/* */ 0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00, -/* */ 0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/*!*/ 0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, -/*"*/ 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/*#*/ 0x00,0x00,0x00,0x6c,0x6c,0xfe,0x6c,0x6c,0x6c,0xfe,0x6c,0x6c,0x00,0x00,0x00,0x00, -/*$*/ 0x18,0x18,0x7c,0xc6,0xc2,0xc0,0x7c,0x06,0x06,0x86,0xc6,0x7c,0x18,0x18,0x00,0x00, -/*%*/ 0x00,0x00,0x00,0x00,0xc2,0xc6,0x0c,0x18,0x30,0x60,0xc6,0x86,0x00,0x00,0x00,0x00, -/*&*/ 0x00,0x00,0x38,0x6c,0x6c,0x38,0x76,0xdc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/*'*/ 0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/*(*/ 0x00,0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00,0x00, -/*)*/ 0x00,0x00,0x30,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00,0x00, -/***/ 0x00,0x00,0x00,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00, -/*+*/ 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, -/*,*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, -/*-*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/*.*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,0x00,0x00, -/*0*/ 0x00,0x00,0x7c,0xc6,0xc6,0xce,0xde,0xf6,0xe6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*1*/ 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00, -/*2*/ 0x00,0x00,0x7c,0xc6,0x06,0x0c,0x18,0x30,0x60,0xc0,0xc6,0xfe,0x00,0x00,0x00,0x00, -/*3*/ 0x00,0x00,0x7c,0xc6,0x06,0x06,0x3c,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*4*/ 0x00,0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, -/*5*/ 0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xfc,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*6*/ 0x00,0x00,0x38,0x60,0xc0,0xc0,0xfc,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*7*/ 0x00,0x00,0xfe,0xc6,0x06,0x06,0x0c,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, -/*8*/ 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7c,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*9*/ 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x0c,0x78,0x00,0x00,0x00,0x00, -/*:*/ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, -/*;*/ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, -/*<*/ 0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00, -/*=*/ 0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/*>*/ 0x00,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00,0x00, -/*?*/ 0x00,0x00,0x7c,0xc6,0xc6,0x0c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, -/*@*/ 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x00,0x00, -/*A*/ 0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, -/*B*/ 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00, -/*C*/ 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00, -/*D*/ 0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,0x00,0x00, -/*E*/ 0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, -/*F*/ 0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, -/*G*/ 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xde,0xc6,0xc6,0x66,0x3a,0x00,0x00,0x00,0x00, -/*H*/ 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, -/*I*/ 0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/*J*/ 0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, -/*K*/ 0x00,0x00,0xe6,0x66,0x66,0x6c,0x78,0x78,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, -/*L*/ 0x00,0x00,0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, -/*M*/ 0x00,0x00,0xc3,0xe7,0xff,0xff,0xdb,0xc3,0xc3,0xc3,0xc3,0xc3,0x00,0x00,0x00,0x00, -/*N*/ 0x00,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, -/*O*/ 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*P*/ 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, -/*Q*/ 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xd6,0xde,0x7c,0x0c,0x0e,0x00,0x00, -/*R*/ 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, -/*S*/ 0x00,0x00,0x7c,0xc6,0xc6,0x60,0x38,0x0c,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*T*/ 0x00,0x00,0xff,0xdb,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/*U*/ 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*V*/ 0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00, -/*W*/ 0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x66,0x00,0x00,0x00,0x00, -/*X*/ 0x00,0x00,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x3c,0x66,0xc3,0xc3,0x00,0x00,0x00,0x00, -/*Y*/ 0x00,0x00,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/*Z*/ 0x00,0x00,0xff,0xc3,0x86,0x0c,0x18,0x30,0x60,0xc1,0xc3,0xff,0x00,0x00,0x00,0x00, -/*[*/ 0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00,0x00, -/*\*/ 0x00,0x00,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, -/*]*/ 0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00,0x00, -/*^*/ 0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/*_*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00, -/*`*/ 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/*a*/ 0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/*b*/ 0x00,0x00,0xe0,0x60,0x60,0x78,0x6c,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00, -/*c*/ 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*d*/ 0x00,0x00,0x1c,0x0c,0x0c,0x3c,0x6c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/*e*/ 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*f*/ 0x00,0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, -/*g*/ 0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0xcc,0x78,0x00, -/*h*/ 0x00,0x00,0xe0,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, -/*i*/ 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/*j*/ 0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00, -/*k*/ 0x00,0x00,0xe0,0x60,0x60,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00, -/*l*/ 0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/*m*/ 0x00,0x00,0x00,0x00,0x00,0xe6,0xff,0xdb,0xdb,0xdb,0xdb,0xdb,0x00,0x00,0x00,0x00, -/*n*/ 0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, -/*o*/ 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*p*/ 0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00, -/*q*/ 0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1e,0x00, -/*r*/ 0x00,0x00,0x00,0x00,0x00,0xdc,0x76,0x66,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, -/*s*/ 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x60,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,0x00, -/*t*/ 0x00,0x00,0x10,0x30,0x30,0xfc,0x30,0x30,0x30,0x30,0x36,0x1c,0x00,0x00,0x00,0x00, -/*u*/ 0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/*v*/ 0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00, -/*w*/ 0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x00,0x00,0x00,0x00, -/*x*/ 0x00,0x00,0x00,0x00,0x00,0xc3,0x66,0x3c,0x18,0x3c,0x66,0xc3,0x00,0x00,0x00,0x00, -/*y*/ 0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0xf8,0x00, -/*z*/ 0x00,0x00,0x00,0x00,0x00,0xfe,0xcc,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, -/*{*/ 0x00,0x00,0x0e,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0e,0x00,0x00,0x00,0x00, -/*|*/ 0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, -/*}*/ 0x00,0x00,0x70,0x18,0x18,0x18,0x0e,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, -/*~*/ 0x00,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x0c,0x06,0x7c,0x00,0x00, -/* */ 0x00,0x00,0xcc,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x0c,0x18,0x30,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x10,0x38,0x6c,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0xcc,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x60,0x30,0x18,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x38,0x6c,0x38,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x66,0x3c,0x0c,0x06,0x3c,0x00,0x00,0x00, -/* */ 0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x18,0x3c,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/* */ 0x00,0xc6,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, -/* */ 0x38,0x6c,0x38,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, -/* */ 0x18,0x30,0x60,0x00,0xfe,0x66,0x60,0x7c,0x60,0x60,0x66,0xfe,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x6e,0x3b,0x1b,0x7e,0xd8,0xdc,0x77,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x3e,0x6c,0xcc,0xcc,0xfe,0xcc,0xcc,0xcc,0xcc,0xce,0x00,0x00,0x00,0x00, -/* */ 0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x30,0x78,0xcc,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x60,0x30,0x18,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0xc6,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0x78,0x00, -/* */ 0x00,0xc6,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0xc6,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x18,0x18,0x7e,0xc3,0xc0,0xc0,0xc0,0xc3,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xe6,0xfc,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0xc3,0x66,0x3c,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0xfc,0x66,0x66,0x7c,0x62,0x66,0x6f,0x66,0x66,0x66,0xf3,0x00,0x00,0x00,0x00, -/* */ 0x00,0x0e,0x1b,0x18,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0x18,0xd8,0x70,0x00,0x00, -/* */ 0x00,0x18,0x30,0x60,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x0c,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x18,0x30,0x60,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x18,0x30,0x60,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x76,0xdc,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, -/* */ 0x76,0xdc,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, -/* */ 0x00,0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xc0,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x60,0xce,0x9b,0x06,0x0c,0x1f,0x00,0x00, -/* */ 0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x66,0xce,0x96,0x3e,0x06,0x06,0x00,0x00, -/* */ 0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3c,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x36,0x6c,0xd8,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0xd8,0x6c,0x36,0x6c,0xd8,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, -/* */ 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, -/* */ 0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x18,0x18,0x18,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, -/* */ 0x18,0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, -/* */ 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, -/* */ 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, -/* */ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0xd8,0xd8,0xd8,0xdc,0x76,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x78,0xcc,0xcc,0xcc,0xd8,0xcc,0xc6,0xc6,0xc6,0xcc,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0xfe,0xc6,0xc6,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0xfe,0xc6,0x60,0x30,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x7e,0xd8,0xd8,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xc0,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x7e,0x18,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0x6c,0x6c,0x6c,0x6c,0xee,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x1e,0x30,0x18,0x0c,0x3e,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x7e,0xdb,0xdb,0xdb,0x7e,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x03,0x06,0x7e,0xdb,0xdb,0xf3,0x7e,0x60,0xc0,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x60,0x60,0x60,0x30,0x1c,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0xff,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x7e,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x7e,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x0e,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -/* */ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7e,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x0f,0x0c,0x0c,0x0c,0x0c,0x0c,0xec,0x6c,0x6c,0x3c,0x1c,0x00,0x00,0x00,0x00, -/* */ 0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x70,0xd8,0x30,0x60,0xc8,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00,0x00, -/* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -}; diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/sunfb.c linux/drivers/sbus/char/sunfb.c --- v2.1.114/linux/drivers/sbus/char/sunfb.c Mon Jan 12 15:15:45 1998 +++ linux/drivers/sbus/char/sunfb.c Wed Dec 31 16:00:00 1969 @@ -1,319 +0,0 @@ -/* $Id: sunfb.c,v 1.29 1997/09/20 20:47:26 davem Exp $ - * sunfb.c: Sun generic frame buffer support. - * - * Copyright (C) 1995, 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) - * - * Added getcmap ioctl, may, 96 - * Support for multiple fbs, sep, 96 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "fb.h" - -extern void set_other_palette (int); -extern void set_cursor (int); - -#define FB_SETUP(err) \ - int minor = FB_DEV (file->f_dentry->d_inode->i_rdev); \ -\ - if (minor >= fbinfos || \ - fbinfo [minor].type.fb_type == FBTYPE_NOTYPE) \ - return -(err); - -static int -fb_open (struct inode * inode, struct file * file) -{ - FB_SETUP(EBADF) - if (fbinfo [minor].open) - return -EBUSY; - fbinfo [minor].mmaped = 0; - fbinfo [minor].open = 1; - return 0; -} - -static int -fb_ioctl (struct inode *inode, struct file *file, uint cmd, unsigned long arg) -{ - fbinfo_t *fb; - struct fbcmap *cmap; - int i; - FB_SETUP(EBADF) - - fb = &fbinfo [minor]; - - switch (cmd){ - case FBIOGTYPE: /* return frame buffer type */ - copy_to_user_ret((struct fbtype *)arg, &fb->type, sizeof(struct fbtype), -EFAULT); - break; - case FBIOGATTR:{ - struct fbgattr *fba = (struct fbgattr *) arg; - - i = verify_area (VERIFY_WRITE, (void *) arg, sizeof (struct fbgattr)); - if (i) return i; - __put_user_ret(fb->real_type, &fba->real_type, -EFAULT); - __put_user_ret(0, &fba->owner, -EFAULT); - __copy_to_user_ret(&fba->fbtype, &fb->type, - sizeof(struct fbtype), -EFAULT); - __put_user_ret(0, &fba->sattr.flags, -EFAULT); - __put_user_ret(fb->type.fb_type, &fba->sattr.emu_type, -EFAULT); - __put_user_ret(-1, &fba->sattr.dev_specific[0], -EFAULT); - __put_user_ret(fb->type.fb_type, &fba->emu_types[0], -EFAULT); - for (i = 1; i < 4; i++) - put_user_ret(fb->emulations[i], &fba->emu_types[i], -EFAULT); - break; - } - case FBIOSATTR: - i = verify_area (VERIFY_READ, (void *) arg, sizeof (struct fbsattr)); - if (i) return i; - return -EINVAL; - case FBIOSVIDEO: - if (fb == fbinfo && vt_cons[fg_console]->vc_mode == KD_TEXT) - break; - get_user_ret(i, (int *)arg, -EFAULT); - if (i){ - if (!fb->blanked || !fb->unblank) - break; - if (!minor || (fb->open && fb->mmaped)) - (*fb->unblank)(fb); - fb->blanked = 0; - } else { - if (fb->blanked || !fb->blank) - break; - (*fb->blank)(fb); - fb->blanked = 1; - } - break; - case FBIOGVIDEO: - put_user_ret(fb->blanked, (int *) arg, -EFAULT); - break; - case FBIOGETCMAP: { - char *rp, *gp, *bp; - int end, count, index; - - if (!fb->loadcmap) - return -EINVAL; - i = verify_area (VERIFY_READ, (void *) arg, sizeof (struct fbcmap)); - if (i) return i; - cmap = (struct fbcmap *) arg; - __get_user_ret(count, &cmap->count, -EFAULT); - __get_user_ret(index, &cmap->index, -EFAULT); - if ((index < 0) || (index > 255)) - return -EINVAL; - if (index + count > 256) - count = 256 - index; - __get_user_ret(rp, &cmap->red, -EFAULT); - __get_user_ret(gp, &cmap->green, -EFAULT); - __get_user_ret(bp, &cmap->blue, -EFAULT); - if(verify_area (VERIFY_WRITE, rp, count)) return -EFAULT; - if(verify_area (VERIFY_WRITE, gp, count)) return -EFAULT; - if(verify_area (VERIFY_WRITE, bp, count)) return -EFAULT; - end = index + count; - for (i = index; i < end; i++){ - __put_user_ret(fb->color_map CM(i,0), rp, -EFAULT); - __put_user_ret(fb->color_map CM(i,1), gp, -EFAULT); - __put_user_ret(fb->color_map CM(i,2), bp, -EFAULT); - rp++; gp++; bp++; - } - (*fb->loadcmap)(fb, index, count); - break; - - } - case FBIOPUTCMAP: { /* load color map entries */ - char *rp, *gp, *bp; - int end, count, index; - - if (!fb->loadcmap) - return -EINVAL; - i = verify_area (VERIFY_READ, (void *) arg, sizeof (struct fbcmap)); - if (i) return i; - cmap = (struct fbcmap *) arg; - __get_user_ret(count, &cmap->count, -EFAULT); - __get_user_ret(index, &cmap->index, -EFAULT); - if ((index < 0) || (index > 255)) - return -EINVAL; - if (index + count > 256) - count = 256 - index; - __get_user_ret(rp, &cmap->red, -EFAULT); - __get_user_ret(gp, &cmap->green, -EFAULT); - __get_user_ret(bp, &cmap->blue, -EFAULT); - if(verify_area (VERIFY_READ, rp, count)) return -EFAULT; - if(verify_area (VERIFY_READ, gp, count)) return -EFAULT; - if(verify_area (VERIFY_READ, bp, count)) return -EFAULT; - - end = index + count; - for (i = index; i < end; i++){ - __get_user_ret(fb->color_map CM(i,0), rp, -EFAULT); - __get_user_ret(fb->color_map CM(i,1), gp, -EFAULT); - __get_user_ret(fb->color_map CM(i,2), bp, -EFAULT); - rp++; gp++; bp++; - } - (*fb->loadcmap)(fb, index, count); - break; - } - - case FBIOGCURMAX: { - struct fbcurpos *p = (struct fbcurpos *) arg; - if (!fb->setcursor) return -EINVAL; - if(verify_area (VERIFY_WRITE, p, sizeof (struct fbcurpos))) - return -EFAULT; - __put_user_ret(fb->cursor.hwsize.fbx, &p->fbx, -EFAULT); - __put_user_ret(fb->cursor.hwsize.fby, &p->fby, -EFAULT); - break; - } - case FBIOSCURSOR: - if (!fb->setcursor) return -EINVAL; - if (fb == fbinfo) { - if (vt_cons[fg_console]->vc_mode == KD_TEXT) - return -EINVAL; /* Don't let graphics programs hide our nice text cursor */ - sbus_hw_cursor_shown = 0; /* Forget state of our text cursor */ - } - return sbus_hw_scursor ((struct fbcursor *) arg, fb); - - case FBIOSCURPOS: - if (!fb->setcursor) return -EINVAL; - /* Don't let graphics programs move our nice text cursor */ - if (fb == fbinfo) { - if (vt_cons[fg_console]->vc_mode == KD_TEXT) - return -EINVAL; /* Don't let graphics programs move our nice text cursor */ - } - i= verify_area (VERIFY_READ, (void *) arg, sizeof (struct fbcurpos)); - if (i) return i; - fb->cursor.cpos = *(struct fbcurpos *)arg; - (*fb->setcursor) (fb); - break; - - default: - if (fb->ioctl){ - i = fb->ioctl (inode, file, cmd, arg, fb); - if (i == -ENOSYS) { - printk ("[[FBIO: %8.8x]]\n", cmd); - return -EINVAL; - } - return i; - } - printk ("[[FBIO: %8.8x]]\n", cmd); - return -EINVAL; - } - return 0; -} - -static int -fb_close (struct inode * inode, struct file *file) -{ - fbinfo_t *fb; - struct fbcursor cursor; - FB_SETUP(EBADF) - - fb = &fbinfo[minor]; - - if (!minor) - vt_cons [fb->vtconsole]->vc_mode = KD_TEXT; - - /* Leaving graphics mode, turn off the cursor */ - if (fb->mmaped) { - fb->clear_fb (minor); - if (!minor && suncons_ops.clear_margin) - suncons_ops.clear_margin(); - } - cursor.set = FB_CUR_SETCUR; - cursor.enable = 0; - - /* Reset the driver */ - if (fb->reset) - fb->reset(fb); - - if (fb->open) - fb->open = 0; - fb_ioctl (inode, file, FBIOSCURPOS, (unsigned long) &cursor); - set_other_palette (minor); - if (!minor) { - render_screen (); - set_cursor (fg_console); - } else if (fb->blank) - (*fb->blank)(fb); - return 0; -} - -static int -fb_mmap (struct file *file, struct vm_area_struct *vma) -{ - fbinfo_t *fb; - FB_SETUP(ENXIO) - - fb = &fbinfo [minor]; - - if (fb->mmap){ - int v; - - v = (*fb->mmap)(file->f_dentry->d_inode, file, vma, fb->base, fb); - if (v) - return v; - vma->vm_flags |= VM_IO; - if (!fb->mmaped) { - fb->mmaped = 1; - if (!minor) { - fb->vtconsole = fg_console; - vt_cons [fg_console]->vc_mode = KD_GRAPHICS; - } else { - if (fb->unblank && !fb->blanked) - (*fb->unblank)(fb); - } - } - return 0; - } else - return -ENXIO; -} - -static struct file_operations graphdev_fops = -{ - NULL, /* lseek */ - NULL, /* read */ - NULL, /* write */ - NULL, /* readdir */ - NULL, /* poll */ - fb_ioctl, - fb_mmap, - fb_open, /* open */ - fb_close, /* close */ -}; - -__initfunc(int fb_init (void)) -{ - /* Register the frame buffer device */ - if (register_chrdev (GRAPHDEV_MAJOR, "graphics", &graphdev_fops)){ - printk ("Could not register graphics device\n"); - return -EIO; - } - return 0; /* success */ -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/sunkbd.c linux/drivers/sbus/char/sunkbd.c --- v2.1.114/linux/drivers/sbus/char/sunkbd.c Fri May 8 23:14:49 1998 +++ linux/drivers/sbus/char/sunkbd.c Tue Aug 4 16:08:31 1998 @@ -88,9 +88,10 @@ struct wait_queue * keypress_wait = NULL; #endif -void keyboard_wait_for_keypress(void) +int keyboard_wait_for_keypress(struct console *co) { sleep_on(&keypress_wait); + return 0; } /* @@ -1297,8 +1298,23 @@ /* There is data in the keyboard, fill the user buffer */ end = buffer+count; p = buffer; - for (; p < end && kbd_head != kbd_tail; p += sizeof (Firm_event)){ - copy_to_user_ret((Firm_event *)p, &kbd_queue [kbd_tail], sizeof(Firm_event), -EFAULT); + for (; p < end && kbd_head != kbd_tail;){ +#ifdef CONFIG_SPARC32_COMPAT + if (current->tss.flags & SPARC_FLAG_32BIT) { + copy_to_user_ret((Firm_event *)p, &kbd_queue [kbd_tail], + sizeof(Firm_event)-sizeof(struct timeval), -EFAULT); + p += sizeof(Firm_event)-sizeof(struct timeval); + __put_user_ret(kbd_queue[kbd_tail].time.tv_sec, (u32 *)p, -EFAULT); + p += sizeof(u32); + __put_user_ret(kbd_queue[kbd_tail].time.tv_usec, (u32 *)p, -EFAULT); + p += sizeof(u32); + } else +#endif + { + copy_to_user_ret((Firm_event *)p, &kbd_queue [kbd_tail], + sizeof(Firm_event), -EFAULT); + p += sizeof (Firm_event); + } #ifdef KBD_DEBUG printk ("[%s]", kbd_queue [kbd_tail].value == VKEY_UP ? "UP" : "DOWN"); #endif @@ -1495,14 +1511,16 @@ /* Test out the leds */ sunkbd_type = 255; + sunkbd_layout = 0; + send_cmd(SKBDCMD_RESET); send_cmd(SKBDCMD_RESET); - while((sunkbd_type==255) && timeout < 500000) { + while((sunkbd_type==255) && timeout++ < 25000) { udelay(100); - timeout += 20; + barrier(); } - if(timeout>=500000) { + if(timeout>=25000) { printk("keyboard: not present\n"); return; } @@ -1510,10 +1528,11 @@ if(sunkbd_type != SUNKBD_TYPE4) { printk("Sun TYPE %d keyboard detected ", sunkbd_type); } else { - udelay(200); timeout=0; - while(timeout++ < 500000) + while((sunkbd_layout==0) && timeout++ < 10000) { + udelay(100); barrier(); + } printk("Sun TYPE %d keyboard detected ", ((sunkbd_layout & SUNKBD_LOUT_TYP5_MASK) ? 5 : 4)); } diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/sunmouse.c linux/drivers/sbus/char/sunmouse.c --- v2.1.114/linux/drivers/sbus/char/sunmouse.c Tue Mar 10 10:03:32 1998 +++ linux/drivers/sbus/char/sunmouse.c Tue Aug 4 16:08:31 1998 @@ -457,7 +457,9 @@ break; default: +#ifdef DEBUG printk ("[MOUSE-ioctl: %8.8x]\n", cmd); +#endif return -1; } return 0; diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/sunserial.c linux/drivers/sbus/char/sunserial.c --- v2.1.114/linux/drivers/sbus/char/sunserial.c Fri May 8 23:14:49 1998 +++ linux/drivers/sbus/char/sunserial.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: sunserial.c,v 1.57 1998/04/13 07:27:02 davem Exp $ +/* $Id: sunserial.c,v 1.61 1998/07/28 13:59:52 jj Exp $ * serial.c: Serial port driver infrastructure for the Sparc. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -20,6 +20,11 @@ int serial_console; +__initfunc(int con_is_present(void)) +{ + return serial_console ? 0 : 1; +} + __initfunc(static void nop_rs_kgdb_hook(int channel)) { @@ -64,22 +69,8 @@ rs_ops.rs_kgdb_hook(channel); } -__initfunc(static void sun_serial_finish_init(void)) -{ - extern unsigned char *linux_serial_image; - extern int con_is_present(void); - char buffer[2048]; - - if (con_is_present()) - return; - - sprintf (buffer, linux_serial_image, UTS_RELEASE); - printk(buffer); -} - __initfunc(void serial_console_init(void)) { - sun_serial_finish_init(); } void rs_change_mouse_baud(int baud) diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/tcx.c linux/drivers/sbus/char/tcx.c --- v2.1.114/linux/drivers/sbus/char/tcx.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/tcx.c Wed Dec 31 16:00:00 1969 @@ -1,380 +0,0 @@ -/* $Id: tcx.c,v 1.22 1998/03/10 20:18:47 jj Exp $ - * tcx.c: SUNW,tcx 24/8bit frame buffer driver - * - * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) - * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) - */ - -#include -#include -#include -#include - -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include -#include "fb.h" -#include "cg_common.h" - -/* Offset of interesting structures in the tcx registers */ -#define TCX_RAM8BIT_OFFSET 0 -#define TCX_CONTROLPLANE_OFFSET 4 -#define TCX_BROOKTREE_OFFSET 8 -#define TCX_THC_OFFSET 9 -#define TCX_TEC_OFFSET 7 - -/* THC definitions */ -#define TCX_THC_MISC_REV_SHIFT 16 -#define TCX_THC_MISC_REV_MASK 15 -#define TCX_THC_MISC_VSYNC_DIS (1 << 25) -#define TCX_THC_MISC_HSYNC_DIS (1 << 24) -#define TCX_THC_MISC_RESET (1 << 12) -#define TCX_THC_MISC_VIDEO (1 << 10) -#define TCX_THC_MISC_SYNC (1 << 9) -#define TCX_THC_MISC_VSYNC (1 << 8) -#define TCX_THC_MISC_SYNC_ENAB (1 << 7) -#define TCX_THC_MISC_CURS_RES (1 << 6) -#define TCX_THC_MISC_INT_ENAB (1 << 5) -#define TCX_THC_MISC_INT (1 << 4) -#define TCX_THC_MISC_INIT 0x9f -#define TCX_THC_REV_REV_SHIFT 20 -#define TCX_THC_REV_REV_MASK 15 -#define TCX_THC_REV_MINREV_SHIFT 28 -#define TCX_THC_REV_MINREV_MASK 15 - -/* The contents are unknown */ -struct tcx_tec { - volatile int tec_matrix; - volatile int tec_clip; - volatile int tec_vdc; -}; - -struct tcx_thc { - volatile uint thc_rev; - uint thc_pad0[511]; - volatile uint thc_hs; /* hsync timing */ - volatile uint thc_hsdvs; - volatile uint thc_hd; - volatile uint thc_vs; /* vsync timing */ - volatile uint thc_vd; - volatile uint thc_refresh; - volatile uint thc_misc; - uint thc_pad1[56]; - volatile uint thc_cursxy; /* cursor x,y position (16 bits each) */ - volatile uint thc_cursmask[32]; /* cursor mask bits */ - volatile uint thc_cursbits[32]; /* what to show where mask enabled */ -}; - -static void -tcx_restore_palette (fbinfo_t *fbinfo) -{ - volatile struct bt_regs *bt; - - bt = fbinfo->info.tcx.bt; - bt->addr = 0; - bt->color_map = 0xffffffff; - bt->color_map = 0xffffffff; - bt->color_map = 0xffffffff; -} - -static void -tcx_set_control_plane (fbinfo_t *fb) -{ - register uint *p, *pend; - - p = fb->info.tcx.tcx_cplane; - if (!p) return; - for (pend = p + (fb->info.tcx.tcx_sizes [TCX_CONTROLPLANE_OFFSET] >> 2); p < pend; p++) - *p &= 0xffffff; -} - -static void -tcx_switch_from_graph (void) -{ - fbinfo_t *fb = &(fbinfo [0]); - - /* Reset control plane to 8bit mode if necessary */ - if (fb->open && fb->mmaped) - tcx_set_control_plane (fb); -} - -/* Ugh: X wants to mmap a bunch of cute stuff at the same time :-( */ -/* So, we just mmap the things that are being asked for */ -static int -tcx_mmap (struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - uint size, page, r, map_size; - unsigned long map_offset = 0; - uint i; - long offsets[13] = { -1, TCX_RAM24BIT, TCX_UNK3, TCX_UNK4, - -1, TCX_UNK6, TCX_UNK7, - -1, -1, -1, TCX_UNK2, TCX_DHC, TCX_ALT }; - - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* Each page, see which map applies */ - for (page = 0; page < size; ){ - switch (vma->vm_offset+page){ - case TCX_RAM8BIT: - map_size = fb->type.fb_size; - map_offset = get_phys ((unsigned long) fb->base); - break; - case TCX_TEC: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.tcx.tec); - break; - case TCX_BTREGS: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.tcx.bt); - break; - case TCX_THC: - map_size = PAGE_SIZE; - map_offset = get_phys ((unsigned long)fb->info.tcx.thc); - break; - case TCX_CONTROLPLANE: - if (fb->info.tcx.tcx_cplane) { - map_size = fb->info.tcx.tcx_sizes [TCX_CONTROLPLANE_OFFSET]; - map_offset = get_phys ((unsigned long)fb->info.tcx.tcx_cplane); - } else - map_size = 0; - break; - default: - map_size = 0; - for (i = 0; i < 13; i++) - if (offsets [i] == vma->vm_offset+page) { - if ((map_size = fb->info.tcx.tcx_sizes [i])) - map_offset = fb->info.tcx.tcx_offsets [i]; - break; - } - break; - } - if (!map_size){ - page += PAGE_SIZE; - continue; - } - if (page + map_size > size) - map_size = size - page; - r = io_remap_page_range (vma->vm_start+page, - map_offset, - map_size, vma->vm_page_prot, - fb->space); - if (r) - return -EAGAIN; - page += map_size; - } - - vma->vm_file = file; - file->f_count++; - return 0; -} - -static void -tcx_loadcmap (fbinfo_t *fb, int index, int count) -{ - struct bt_regs *bt = fb->info.tcx.bt; - int i; - - bt->addr = index << 24; - for (i = index; count--; i++){ - bt->color_map = fb->color_map CM(i,0) << 24; - bt->color_map = fb->color_map CM(i,1) << 24; - bt->color_map = fb->color_map CM(i,2) << 24; - } - bt->addr = 0; -} - -static void -tcx_setcursormap (fbinfo_t *fb, unsigned char *red, - unsigned char *green, - unsigned char *blue) -{ - struct bt_regs *bt = fb->info.tcx.bt; - - /* Note the 2 << 24 is different from cg6's 1 << 24 */ - bt->addr = 2 << 24; - bt->cursor = red[0] << 24; - bt->cursor = green[0] << 24; - bt->cursor = blue[0] << 24; - bt->addr = 3 << 24; - bt->cursor = red[1] << 24; - bt->cursor = green[1] << 24; - bt->cursor = blue[1] << 24; - bt->addr = 0; -} - -/* Load cursor information */ -static void -tcx_setcursor (fbinfo_t *fb) -{ - uint v; - struct cg_cursor *c = &fb->cursor; - - if (c->enable){ - v = ((c->cpos.fbx - c->chot.fbx) << 16) - |((c->cpos.fby - c->chot.fby) & 0xffff); - } else { - /* Magic constant to turn off the cursor */ - v = ((65536-32) << 16) | (65536-32); - } - fb->info.tcx.thc->thc_cursxy = v; -} - -/* Set cursor shape */ -static void -tcx_setcurshape (fbinfo_t *fb) -{ - struct tcx_thc *thc = fb->info.tcx.thc; - int i; - - for (i = 0; i < 32; i++){ - thc->thc_cursmask [i] = fb->cursor.bits[0][i]; - thc->thc_cursbits [i] = fb->cursor.bits[1][i]; - } -} - -static void -tcx_blank (fbinfo_t *fb) -{ - fb->info.tcx.thc->thc_misc &= ~TCX_THC_MISC_VIDEO; - /* This should put us in power-save */ - fb->info.tcx.thc->thc_misc |= TCX_THC_MISC_VSYNC_DIS; - fb->info.tcx.thc->thc_misc |= TCX_THC_MISC_HSYNC_DIS; -} - -static void -tcx_unblank (fbinfo_t *fb) -{ - fb->info.tcx.thc->thc_misc &= ~TCX_THC_MISC_VSYNC_DIS; - fb->info.tcx.thc->thc_misc &= ~TCX_THC_MISC_HSYNC_DIS; - fb->info.tcx.thc->thc_misc |= TCX_THC_MISC_VIDEO; -} - -void -tcx_reset (fbinfo_t *fb) -{ - struct tcx_info *tcx = &(fb->info.tcx); - - if (fb->setcursor && fb == &fbinfo[0]) - sbus_hw_hide_cursor (); - /* Reset control plane to 8bit mode if necessary */ - if (fb->open && fb->mmaped) - tcx_set_control_plane (fb); - - /* Turn off stuff in the Transform Engine. */ - tcx->tec->tec_matrix = 0; - tcx->tec->tec_clip = 0; - tcx->tec->tec_vdc = 0; - - /* Enable cursor in Brooktree DAC. */ - tcx->bt->addr = 0x06 << 24; - tcx->bt->control |= 0x03 << 24; -} - -__initfunc(void tcx_setup (fbinfo_t *fb, int slot, int node, u32 tcx, struct linux_sbus_device *sbdp)) -{ - struct tcx_info *tcxinfo; - int i; - - printk ("tcx%d at 0x%8.8x ", slot, tcx); - - /* Fill in parameters we left out */ - fb->type.fb_cmsize = 256; - fb->mmap = tcx_mmap; - fb->loadcmap = tcx_loadcmap; - fb->reset = tcx_reset; - fb->blank = tcx_blank; - fb->unblank = tcx_unblank; - fb->emulations [1] = FBTYPE_SUN3COLOR; - fb->emulations [2] = FBTYPE_MEMCOLOR; - fb->switch_from_graph = tcx_switch_from_graph; - fb->postsetup = cg_postsetup; - - tcxinfo = (struct tcx_info *) &fb->info.tcx; - - memset (tcxinfo, 0, sizeof(struct tcx_info)); - - for (i = 0; i < 13; i++) - tcxinfo->tcx_offsets [i] = (long)(sbdp->reg_addrs [i].phys_addr); - - /* Map the hardware registers */ - tcxinfo->bt = sparc_alloc_io((u32)tcxinfo->tcx_offsets [TCX_BROOKTREE_OFFSET], 0, - sizeof (struct bt_regs),"tcx_dac", fb->space, 0); - tcxinfo->thc = sparc_alloc_io((u32)tcxinfo->tcx_offsets [TCX_THC_OFFSET], 0, - sizeof (struct tcx_thc), "tcx_thc", fb->space, 0); - tcxinfo->tec = sparc_alloc_io((u32)tcxinfo->tcx_offsets [TCX_TEC_OFFSET], 0, - sizeof (struct tcx_tec), "tcx_tec", fb->space, 0); - if (!fb->base){ - fb->base = (uint) (unsigned long) - sparc_alloc_io((u32)tcxinfo->tcx_offsets [TCX_RAM8BIT_OFFSET], - 0, fb->type.fb_size, "tcx_ram", fb->space, 0); - } - - if (prom_getbool (node, "hw-cursor")) { - fb->setcursor = tcx_setcursor; - fb->setcursormap = tcx_setcursormap; - fb->setcurshape = tcx_setcurshape; - } - - if (!slot) { - fb_restore_palette = tcx_restore_palette; - } - - i = fb->type.fb_size; - tcxinfo->tcx_sizes[2] = i << 3; - tcxinfo->tcx_sizes[3] = i << 3; - tcxinfo->tcx_sizes[10] = 0x20000; - tcxinfo->tcx_sizes[11] = PAGE_SIZE; - tcxinfo->tcx_sizes[12] = PAGE_SIZE; - - if (prom_getbool (node, "tcx-8-bit")) - tcxinfo->lowdepth = 1; - - if (!tcxinfo->lowdepth) { - tcxinfo->tcx_sizes[1] = i << 2; - tcxinfo->tcx_sizes[4] = i << 2; - tcxinfo->tcx_sizes[5] = i << 3; - tcxinfo->tcx_sizes[6] = i << 3; - fb->type.fb_depth = 24; - tcxinfo->tcx_cplane = - sparc_alloc_io((u32)tcxinfo->tcx_offsets[TCX_CONTROLPLANE_OFFSET], 0, - tcxinfo->tcx_sizes [TCX_CONTROLPLANE_OFFSET], - "tcx_cplane", fb->space, 0); - } - - /* Initialize Brooktree DAC */ - tcxinfo->bt->addr = 0x04 << 24; /* color planes */ - tcxinfo->bt->control = 0xff << 24; - tcxinfo->bt->addr = 0x05 << 24; - tcxinfo->bt->control = 0x00 << 24; - tcxinfo->bt->addr = 0x06 << 24; /* overlay plane */ - tcxinfo->bt->control = 0x73 << 24; - tcxinfo->bt->addr = 0x07 << 24; - tcxinfo->bt->control = 0x00 << 24; - - printk("Rev %d.%d %s\n", - (tcxinfo->thc->thc_rev >> TCX_THC_REV_REV_SHIFT) & TCX_THC_REV_REV_MASK, - (tcxinfo->thc->thc_rev >> TCX_THC_REV_MINREV_SHIFT) & TCX_THC_REV_MINREV_MASK, - tcxinfo->lowdepth ? "8-bit only" : "24-bit depth"); - - /* Reset the tcx */ - tcx_reset(fb); - - if (!slot) - /* Enable Video */ - tcx_unblank (fb); - else - tcx_blank (fb); -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/weitek.c linux/drivers/sbus/char/weitek.c --- v2.1.114/linux/drivers/sbus/char/weitek.c Thu Apr 23 20:21:34 1998 +++ linux/drivers/sbus/char/weitek.c Wed Dec 31 16:00:00 1969 @@ -1,117 +0,0 @@ -/* $Id: weitek.c,v 1.16 1998/03/10 20:18:54 jj Exp $ - * weitek.c: Tadpole P9100/P9000 console driver - * - * Copyright (C) 1996 David Redman (djhr@tadpole.co.uk) - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* These must be included after asm/fbio.h */ -#include -#include -#include -#include "fb.h" -#include "cg_common.h" - -/* - * mmap info - */ -#define WEITEK_VRAM_OFFSET 0 -#define WEITEK_VRAM_SIZE (2*1024*1024) /* maximum */ -#define WEITEK_GX_REG_OFFSET WEITEK_VRAM_SIZE -#define WEITEK_GX_REG_SIZE 8192 -#define WEITEK_VID_REG_OFFSET (WEITEK_GX_REG_OFFSET+WEITEK_GX_REG_SIZE) -#define WEITEK_VID_REG_SIZE 0x1000 - -#define CONTROL_OFFSET 0 -#define RAMDAC_OFFSET (CONTROL_OFFSET+0x200) - -#if 0 -static int -weitek_mmap(struct inode *inode, struct file *file, struct vm_area_struct *vma, - long base, fbinfo_t *fb) -{ - unsigned int size, page, r, map_size; - unsigned long map_offset = 0; - - size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) - return -ENXIO; - - /* To stop the swapper from even considering these pages */ - vma->vm_flags |= FB_MMAP_VM_FLAGS; - - /* Each page, see which map applies */ - for (page = 0; page < size; ){ - switch (vma->vm_offset+page){ - case WEITEK_VRAM_OFFSET: - map_size = size-page; - map_offset = get_phys ((unsigned long) fb->base); - if (map_size > fb->type.fb_size) - map_size = fb->type.fb_size; - break; - case WEITEK_GX_REG_OFFSET: - map_size = size-page; - map_offset = get_phys ((unsigned long) fb->base); - if (map_size > fb->type.fb_size) - map_size = fb->type.fb_size; - break; - default: - map_size = 0; - break; - } - if (!map_size){ - page += PAGE_SIZE; - continue; - } - if (page + map_size > size) - map_size = size - page; - r = io_remap_page_range (vma->vm_start+page, - map_offset, - map_size, vma->vm_page_prot, - fb->space); - if (r) - return -EAGAIN; - page += map_size; - } - - vma->vm_file = file; - file->f_count++; - return 0; -} -#endif - -#if 0 -static void -weitek_loadcmap (void *fbinfo, int index, int count) -{ - printk("weitek_cmap: unimplemented!\n"); -} -#endif - -__initfunc(void weitek_setup(fbinfo_t *fb, int slot, u32 addr, int io)) -{ - printk ("weitek%d at 0x%8.8x\n", slot, addr); - - /* Fill in parameters we left out */ - fb->type.fb_type = FBTYPE_NOTSUN1; - fb->type.fb_cmsize = 256; - fb->mmap = 0; /* weitek_mmap; */ - fb->loadcmap = 0; /* unimplemented */ - fb->ioctl = 0; /* no special ioctls */ - fb->reset = 0; /* no special reset */ - - /* Map the card registers */ - if (!fb->base){ - prom_printf ("Missing mapping routine and no address found\n"); - } -} diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/char/zs.c linux/drivers/sbus/char/zs.c --- v2.1.114/linux/drivers/sbus/char/zs.c Thu May 7 22:51:50 1998 +++ linux/drivers/sbus/char/zs.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,4 @@ -/* $Id: zs.c,v 1.20 1998/02/25 23:51:57 ecd Exp $ +/* $Id: zs.c,v 1.26 1998/08/03 23:58:14 davem Exp $ * zs.c: Zilog serial port driver for the Sparc. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -413,10 +413,6 @@ extern void breakpoint(void); /* For the KGDB frame character */ #endif -#ifdef CONFIG_MAGIC_SYSRQ -static int serial_sysrq; -#endif - static _INLINE_ void receive_chars(struct sun_serial *info, struct pt_regs *regs) { struct tty_struct *tty = info->tty; @@ -455,27 +451,12 @@ return; } if(info->is_cons) { -#ifdef CONFIG_MAGIC_SYSRQ - if (!ch) { - serial_sysrq = 1; - return; - } else if (serial_sysrq) { - if (ch == 'a' || ch == 'A') - /* whee, break-A received */ - batten_down_hatches(); - else - handle_sysrq(ch, regs, NULL, NULL); - serial_sysrq = 0; - return; - } -#else if(ch==0) { /* whee, break received */ batten_down_hatches(); /* Continue execution... */ return; } -#endif /* It is a 'keyboard interrupt' ;-) */ wake_up(&keypress_wait); } @@ -573,13 +554,8 @@ * 'break asserted' status change interrupt, call * the boot prom. */ - if((status & BRK_ABRT) && info->break_abort) { -#ifdef CONFIG_MAGIC_SYSRQ - serial_sysrq = 1; -#else + if((status & BRK_ABRT) && info->break_abort) batten_down_hatches(); -#endif - } /* XXX Whee, put in a buffer somewhere, the status information * XXX whee whee whee... Where does the information go... @@ -1832,7 +1808,7 @@ static void show_serial_version(void) { - char *revision = "$Revision: 1.20 $"; + char *revision = "$Revision: 1.26 $"; char *version, *p; version = strchr(revision, ' '); @@ -1850,8 +1826,6 @@ * we have a special version for sun4u. */ #ifdef __sparc_v9__ -static struct devid_cookie zs_dcookie; -static unsigned long zs_irq_flags; __initfunc(static struct sun_zslayout * get_zs(int chip)) { @@ -1892,27 +1866,15 @@ (char *) &sun4u_ino, (sizeof(sun4u_ino))); if(!irq) { - irq = zilog_irq = sun4u_ino; - - /* Construct dcookie. */ - if(central_bus) { - zs_dcookie.imap = - ¢ral_bus->child->fhc_regs.uregs->fhc_uart_imap; - zs_dcookie.iclr = - ¢ral_bus->child->fhc_regs.uregs->fhc_uart_iclr; - zs_dcookie.pil = 12; - zs_dcookie.bus_cookie = NULL; - zs_irq_flags = - (SA_DCOOKIE|SA_INTERRUPT|SA_STATIC_ALLOC|SA_FHC); + if (central_bus) { + irq = zilog_irq = + build_irq(12, 0, + ¢ral_bus->child->fhc_regs.uregs->fhc_uart_iclr, + ¢ral_bus->child->fhc_regs.uregs->fhc_uart_imap); } else { - zs_dcookie.imap = zs_dcookie.iclr = NULL; - zs_dcookie.pil = -1; - zs_dcookie.bus_cookie = SBus_chain; - zs_irq_flags = - (SA_DCOOKIE|SA_INTERRUPT|SA_STATIC_ALLOC|SA_SBUS); + irq = zilog_irq = + sbus_build_irq(SBus_chain, sun4u_ino); } - } else if(irq != sun4u_ino) { - panic("zilog: bogon irqs"); } break; } @@ -2470,22 +2432,15 @@ info->normal_termios = serial_driver.init_termios; info->open_wait = 0; info->close_wait = 0; - printk("tty%02d at 0x%04x (irq = %d)", info->line, - info->port, info->irq); + printk("tty%02d at 0x%04x (irq = %s)", info->line, + info->port, __irq_itoa(info->irq)); printk(" is a Zilog8530\n"); } -#ifndef __sparc_v9__ if (request_irq(zilog_irq, zs_interrupt, (SA_INTERRUPT | SA_STATIC_ALLOC), "Zilog8530", zs_chain)) panic("Unable to attach zs intr\n"); -#else - zs_dcookie.real_dev_id = zs_chain; - if (request_irq(zilog_irq, zs_interrupt, - zs_irq_flags, "Zilog8530", &zs_dcookie)) - panic("Unable to attach zs intr\n"); -#endif restore_flags(flags); keyboard_zsinit(kbd_put_char); diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/dvma.c linux/drivers/sbus/dvma.c --- v2.1.114/linux/drivers/sbus/dvma.c Fri May 8 23:14:49 1998 +++ linux/drivers/sbus/dvma.c Tue Aug 4 16:08:31 1998 @@ -137,6 +137,7 @@ struct Linux_SBus_DMA *dma; struct Linux_SBus_DMA *dchain; + if(sun4_dma_physaddr) { dma = kmalloc(sizeof(struct Linux_SBus_DMA), GFP_ATOMIC); /* No SBUS */ @@ -146,13 +147,16 @@ dma_chain=dma; dma->regs = (struct sparc_dma_registers *) - sparc_alloc_io (SUN4_300_DMA_PHYSADDR, 0, + sparc_alloc_io (sun4_dma_physaddr, 0, PAGE_SIZE, "dma", 0x0, 0x0); /* No prom node */ dma->node = 0x0; init_one_dvma(dma, 0); + } else { + dma_chain=0x0; + } } #endif diff -u --recursive --new-file v2.1.114/linux/drivers/sbus/sbus.c linux/drivers/sbus/sbus.c --- v2.1.114/linux/drivers/sbus/sbus.c Fri May 8 23:14:49 1998 +++ linux/drivers/sbus/sbus.c Tue Aug 4 16:08:31 1998 @@ -1,4 +1,5 @@ -/* sbus.c: SBus support routines. +/* $Id: sbus.c,v 1.69 1998/07/28 16:53:11 jj Exp $ + * sbus.c: SBus support routines. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ @@ -14,12 +15,14 @@ #include #include #include +#include /* This file has been written to be more dynamic and a bit cleaner, * but it still needs some spring cleaning. */ struct linux_sbus *SBus_chain; +static struct linux_prom_irqs irqs[PROMINTR_MAX] __initdata = { { 0 } }; static char lbuf[128]; @@ -109,51 +112,60 @@ len=0; } sbus_dev->num_vaddrs = (len/4); - - if(sparc_cpu_model == sun4u) { - len = prom_getproperty(nd, "interrupts", (void *)&sbus_dev->irqs[0].pri, - sizeof(sbus_dev->irqs[0].pri)); - if((len == -1) || (len == 0)) { - sbus_dev->irqs[0].pri = 0; - sbus_dev->num_irqs = 0; - } else { - sbus_dev->num_irqs = 1; - if(sbus_dev->irqs[0].pri < 0x20) { - int old_irq = sbus_dev->irqs[0].pri; - - /* Need to do special SLOT fixups in this case. */ -#if 0 /* DEBUGGING */ - printk("SBUS[%x:%lx]: INO fixup from [%x] to [%x]\n", - sbus_dev->slot, sbus_dev->offset, - old_irq, old_irq + (sbus_dev->slot * 8)); -#endif - sbus_dev->irqs[0].pri = - (old_irq + (sbus_dev->slot * 8)); - } - } + +#ifdef __sparc_v9__ + len = prom_getproperty(nd, "interrupts", (void *)irqs, sizeof(irqs)); + if((len == -1) || (len == 0)) { + sbus_dev->irqs[0] = 0; + sbus_dev->num_irqs = 0; } else { - len = prom_getproperty(nd, "intr", (void *)sbus_dev->irqs, - sizeof(sbus_dev->irqs)); - if (len == -1) len=0; - if (len&7) { - prom_printf("Grrr, I didn't get a multiple of 8 proplen for " - "device %s got %d\n", sbus_dev->prom_name, len); - len=0; - } - sbus_dev->num_irqs=(len/8); - if(sbus_dev->num_irqs == 0) - sbus_dev->irqs[0].pri=0; + sbus_dev->num_irqs = 1; + if (irqs[0].pri < 0x20) + sbus_dev->irqs[0] = sbus_build_irq(sbus_dev->my_bus, + irqs[0].pri + (sbus_dev->slot * 8)); + else + sbus_dev->irqs[0] = sbus_build_irq(sbus_dev->my_bus, + irqs[0].pri); + } +#else + len = prom_getproperty(nd, "intr", (void *)irqs, sizeof(irqs)); + if (len == -1) len=0; + if (len&7) { + prom_printf("Grrr, I didn't get a multiple of 8 proplen for " + "device %s got %d\n", sbus_dev->prom_name, len); + len=0; } + if (len > 4 * 8) { + prom_printf("Device %s has more than 4 interrupts\n", sbus_dev->prom_name); + len = 4 * 8; + } + sbus_dev->num_irqs=(len/8); + if(sbus_dev->num_irqs == 0) + sbus_dev->irqs[0]=0; + else if (sparc_cpu_model != sun4d) + for (len = 0; len < sbus_dev->num_irqs; len++) + sbus_dev->irqs[len] = irqs[len].pri; + else { + extern unsigned int sun4d_build_irq(struct linux_sbus_device *sdev, int irq); + + for (len = 0; len < sbus_dev->num_irqs; len++) + sbus_dev->irqs[len] = sun4d_build_irq(sbus_dev, irqs[len].pri); + } +#endif + #ifdef DEBUG_FILL #ifdef __sparc_v9__ - prom_printf("Found %s at SBUS slot %x offset %016lx irq-level %d\n", - sbus_dev->prom_name, sbus_dev->slot, sbus_dev->offset, - sbus_dev->irqs[0].pri); + prom_printf("Found %s at SBUS slot %x offset %016lx ", + sbus_dev->prom_name, sbus_dev->slot, sbus_dev->offset); + if (sbus_dev->irqs[0]) + prom_printf("irq %s\n", __irq_itoa(sbus_dev->irqs[0])); + else + prom_printf("\n"); prom_printf("Base address %016lx\n", sbus_dev->sbus_addr); #else prom_printf("Found %s at SBUS slot %x offset %08lx irq-level %d\n", sbus_dev->prom_name, sbus_dev->slot, sbus_dev->offset, - sbus_dev->irqs[0].pri); + sbus_dev->irqs[0]); prom_printf("Base address %08lx\n", sbus_dev->sbus_addr); #endif prom_printf("REGISTERS: Probed %d register(s)\n", sbus_dev->num_registers); @@ -182,7 +194,6 @@ * devices. */ -extern void sun_console_init(void); extern void iommu_init(int iommu_node, struct linux_sbus *sbus); extern void iounit_init(int sbi_node, int iounit_node, struct linux_sbus *sbus); void sun4_init(void); @@ -210,14 +221,14 @@ this_dev = this_dev->next; this_dev->next = 0; - fill_sbus_device(this_node, this_dev); this_dev->my_bus = sbus; + fill_sbus_device(this_node, this_dev); if(prom_getchild(this_node)) { this_dev->child = kmalloc(sizeof(struct linux_sbus_device), GFP_ATOMIC); - fill_sbus_device(prom_getchild(this_node), this_dev->child); this_dev->child->my_bus = sbus; + fill_sbus_device(prom_getchild(this_node), this_dev->child); sbus_do_child_siblings(prom_getchild(this_node), this_dev->child, sbus); } else { @@ -246,8 +257,8 @@ nd = prom_searchsiblings(topnd, "sbus"); if(nd == 0) { #ifdef CONFIG_PCI - printk("SBUS: No SBUS's found.\n"); - return sun_console_init(); + /* printk("SBUS: No SBUS's found.\n"); */ + return; #else prom_printf("YEEE, UltraSparc sbus not found\n"); prom_halt(); @@ -315,8 +326,8 @@ this_dev = sbus->devices; this_dev->next = 0; - fill_sbus_device(sbus_devs, this_dev); this_dev->my_bus = sbus; + fill_sbus_device(sbus_devs, this_dev); /* Should we traverse for children? */ if(prom_getchild(sbus_devs)) { @@ -324,8 +335,8 @@ this_dev->child = kmalloc(sizeof(struct linux_sbus_device), GFP_ATOMIC); /* Fill it */ - fill_sbus_device(prom_getchild(sbus_devs), this_dev->child); this_dev->child->my_bus = sbus; + fill_sbus_device(prom_getchild(sbus_devs), this_dev->child); sbus_do_child_siblings(prom_getchild(sbus_devs), this_dev->child, sbus); } else { @@ -340,8 +351,8 @@ this_dev->next=0; /* Fill it */ - fill_sbus_device(sbus_devs, this_dev); this_dev->my_bus = sbus; + fill_sbus_device(sbus_devs, this_dev); /* Is there a child node hanging off of us? */ if(prom_getchild(sbus_devs)) { @@ -350,9 +361,9 @@ kmalloc(sizeof(struct linux_sbus_device), GFP_ATOMIC); /* Fill it */ + this_dev->child->my_bus = sbus; fill_sbus_device(prom_getchild(sbus_devs), this_dev->child); - this_dev->child->my_bus = sbus; sbus_do_child_siblings(prom_getchild(sbus_devs), this_dev->child, sbus); } else { @@ -392,7 +403,6 @@ sun4d_init_sbi_irq(); } - sun_console_init(); /* whee... */ #ifdef CONFIG_SUN_OPENPROMIO openprom_init(); #endif @@ -423,7 +433,6 @@ __initfunc(void sun4_init(void)) { - sun_console_init(); sun4_dvma_init(); } #endif diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/Config.in linux/drivers/scsi/Config.in --- v2.1.114/linux/drivers/scsi/Config.in Wed Jul 1 19:38:54 1998 +++ linux/drivers/scsi/Config.in Tue Aug 4 16:56:37 1998 @@ -134,4 +134,7 @@ if [ "$CONFIG_ARCH_ACORN" = "y" ]; then source drivers/acorn/scsi/Config.in fi +if [ "$CONFIG_MIPS_JAZZ" = "y" ]; then + bool 'MIPS JAZZ FAS216 SCSI support' CONFIG_JAZZ_ESP +fi endmenu diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/Makefile linux/drivers/scsi/Makefile --- v2.1.114/linux/drivers/scsi/Makefile Mon Aug 3 12:45:46 1998 +++ linux/drivers/scsi/Makefile Tue Aug 4 16:56:37 1998 @@ -23,7 +23,7 @@ ifeq (${CFLAGS},) CFLAGS = -D__KERNEL__=1 \ -DMODULE -Wall -Wstrict-prototypes -I. -I../../include \ - -O2 -fomit-frame-pointer -m486 + -O2 -fomit-frame-pointer include ../../.config @@ -524,6 +524,10 @@ ifeq ($(CONFIG_BLK_DEV_IDESCSI),m) M_OBJS += ide-scsi.o endif +endif + +ifeq ($(CONFIG_JAZZ_ESP),y) +L_OBJS += NCR53C9x.o jazz_esp.o endif include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/esp.c linux/drivers/scsi/esp.c --- v2.1.114/linux/drivers/scsi/esp.c Sun Jun 7 11:16:34 1998 +++ linux/drivers/scsi/esp.c Tue Aug 4 16:56:37 1998 @@ -398,9 +398,7 @@ static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC) { Scsi_Cmnd *end; - unsigned long flags; - save_flags(flags); cli(); new_SC->host_scribble = (unsigned char *) NULL; if(!*SC) *SC = new_SC; @@ -409,38 +407,27 @@ ; end->host_scribble = (unsigned char *) new_SC; } - restore_flags(flags); } static inline void prepend_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC) { - unsigned long flags; - - save_flags(flags); cli(); new_SC->host_scribble = (unsigned char *) *SC; *SC = new_SC; - restore_flags(flags); } static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd **SC) { Scsi_Cmnd *ptr; - unsigned long flags; - - save_flags(flags); cli(); ptr = *SC; if(ptr) *SC = (Scsi_Cmnd *) (*SC)->host_scribble; - restore_flags(flags); return ptr; } static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun) { Scsi_Cmnd *ptr, *prev; - unsigned long flags; - save_flags(flags); cli(); for(ptr = *SC, prev = NULL; ptr && ((ptr->target != target) || (ptr->lun != lun)); prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble) @@ -451,7 +438,6 @@ else *SC=(Scsi_Cmnd *)ptr->host_scribble; } - restore_flags(flags); return ptr; } @@ -647,7 +633,6 @@ (Scsi_Host_Template *tpnt, struct linux_sbus_device *esp_dev, struct linux_sbus_device *espdma, struct linux_sbus *sbus, int id, int hme)) { - struct devid_cookie dcookie; struct Sparc_ESP *esp, *elink; struct Scsi_Host *esp_host; struct Sparc_ESP_regs *eregs; @@ -757,7 +742,7 @@ esp->edev->reg_addrs[0].phys_addr; esp->ehost->n_io_port = (unsigned char) esp->edev->reg_addrs[0].reg_size; - esp->ehost->irq = esp->irq = esp->edev->irqs[0].pri; + esp->ehost->irq = esp->irq = esp->edev->irqs[0]; #ifndef __sparc_v9__ if (sparc_cpu_model != sun4d) { @@ -773,30 +758,20 @@ esp_irq_acquired: printk("esp%d: IRQ %d ", esp->esp_id, esp->ehost->irq); } else { - dcookie.real_dev_id = esp; - dcookie.bus_cookie = esp_dev; if (request_irq(esp->ehost->irq, esp_intr_4d, - (SA_SHIRQ | SA_DCOOKIE), - "Sparc ESP SCSI", &dcookie)) + SA_SHIRQ, "Sparc ESP SCSI", esp)) panic("Cannot acquire ESP irq line"); - printk("esp%d: INO[%x] IRQ %d ", esp->esp_id, dcookie.ret_ino, esp->ehost->irq); - esp->ehost->irq = esp->irq = dcookie.ret_ino; + printk("esp%d: IRQ %s ", esp->esp_id, __irq_itoa(esp->ehost->irq)); } #else /* On Ultra we must always call request_irq for each * esp, so that imap registers get setup etc. */ - dcookie.real_dev_id = esp; - dcookie.imap = dcookie.iclr = 0; - dcookie.pil = -1; - dcookie.bus_cookie = sbus; if(request_irq(esp->ehost->irq, esp_intr, - (SA_SHIRQ | SA_SBUS | SA_DCOOKIE), - "Sparc ESP SCSI", &dcookie)) + SA_SHIRQ, "Sparc ESP SCSI", esp)) panic("Cannot acquire ESP irq line"); - esp->ehost->irq = esp->irq = dcookie.ret_ino; - printk("esp%d: INO[%x] IRQ %d ", - esp->esp_id, esp->ehost->irq, dcookie.ret_pil); + printk("esp%d: IRQ %s ", + esp->esp_id, __irq_itoa(esp->ehost->irq)); #endif /* Figure out our scsi ID on the bus */ @@ -1004,14 +979,16 @@ espchain = 0; - memset (&esp_dev, 0, sizeof(esp_dev)); - esp_dev.reg_addrs[0].phys_addr = SUN4_300_ESP_PHYSADDR; - esp_dev.irqs[0].pri = 4; - - if (!detect_one_esp(tpnt, &esp_dev, NULL, NULL, 0, 0)) - esps_in_use++; - printk("ESP: Total of 1 ESP hosts found, %d actually in use.\n", esps_in_use); - esps_running = esps_in_use; + if(sun4_esp_physaddr) { + memset (&esp_dev, 0, sizeof(esp_dev)); + esp_dev.reg_addrs[0].phys_addr = sun4_esp_physaddr; + esp_dev.irqs[0] = 4; + + if (!detect_one_esp(tpnt, &esp_dev, NULL, NULL, 0, 0)) + esps_in_use++; + printk("ESP: Total of 1 ESP hosts found, %d actually in use.\n", esps_in_use); + esps_running = esps_in_use; + } return esps_in_use; } @@ -1588,7 +1565,6 @@ { struct Sparc_ESP *esp; struct sparc_dma_registers *dregs; - unsigned long flags; /* Set up func ptr and initial driver cmd-phase. */ SCpnt->scsi_done = done; @@ -1642,13 +1618,10 @@ append_SC(&esp->issue_SC, SCpnt); } - save_and_cli(flags); - /* Run it now if we can. */ if(!esp->current_SC && !esp->resetting_bus) esp_exec_cmd(esp); - restore_flags(flags); return 0; } @@ -1727,7 +1700,6 @@ struct Sparc_ESP *esp = (struct Sparc_ESP *) SCptr->host->hostdata; struct Sparc_ESP_regs *eregs = esp->eregs; struct sparc_dma_registers *dregs = esp->dregs; - unsigned long flags; int don; ESPLOG(("esp%d: Aborting command\n", esp->esp_id)); @@ -1739,16 +1711,13 @@ * in the driver and timeout because the eventual phase change * will cause the ESP to (eventually) give an interrupt. */ - save_and_cli(flags); if(esp->current_SC == SCptr) { esp->cur_msgout[0] = ABORT; esp->msgout_len = 1; esp->msgout_ctr = 0; esp_cmd(esp, eregs, ESP_CMD_SATN); - restore_flags(flags); return SCSI_ABORT_PENDING; } - restore_flags(flags); /* If it is still in the issue queue then we can safely * call the completion routine and report abort success. @@ -1814,8 +1783,6 @@ Scsi_Cmnd *done_SC; if(esp->current_SC) { - unsigned long flags; - done_SC = esp->current_SC; esp->current_SC = NULL; @@ -1840,13 +1807,9 @@ done_SC->result = error; done_SC->scsi_done(done_SC); - save_and_cli(flags); - /* Bus is free, issue any commands in the queue. */ if(esp->issue_SC && !esp->current_SC) esp_exec_cmd(esp); - - restore_flags(flags); } else { /* Panic is safe as current_SC is null so we may still * be able to accept more commands to sync disk buffers. @@ -2488,6 +2451,10 @@ ESPLOG(("esp%d: use_sg=%d ptr=%p this_residual=%d\n", esp->esp_id, SCptr->use_sg, SCptr->SCp.ptr, SCptr->SCp.this_residual)); + ESPLOG(("esp%d: Forcing async for target %d\n", esp->esp_id, + SCptr->target)); + SCptr->device->borken = 1; + SCptr->device->sync = 0; bytes_sent = 0; } @@ -3590,9 +3557,11 @@ dregs->st_addr = esp->esp_command_dvma; dregs->cond_reg = tmp; } else { + unsigned char tmp; esp_cmd(esp, eregs, ESP_CMD_FLUSH); - eregs->esp_fdata = *esp->esp_scmdp++; + tmp = *esp->esp_scmdp++; esp->esp_scmdleft--; + eregs->esp_fdata = tmp; esp_cmd(esp, eregs, ESP_CMD_TI); } return do_intr_end; diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/esp.h linux/drivers/scsi/esp.h --- v2.1.114/linux/drivers/scsi/esp.h Fri Jul 31 17:07:58 1998 +++ linux/drivers/scsi/esp.h Wed Aug 5 00:03:37 1998 @@ -409,7 +409,9 @@ this_id: 7, \ sg_tablesize: SG_ALL, \ cmd_per_lun: 1, \ - use_clustering: DISABLE_CLUSTERING, } + use_clustering: DISABLE_CLUSTERING, \ + use_new_eh_code: 0 \ +} /* For our interrupt engine. */ #define for_each_esp(esp) \ diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c --- v2.1.114/linux/drivers/scsi/hosts.c Mon Aug 3 12:45:46 1998 +++ linux/drivers/scsi/hosts.c Tue Aug 4 16:56:37 1998 @@ -269,6 +269,10 @@ #include "../acorn/scsi/powertec.h" #endif +#ifdef CONFIG_JAZZ_ESP +#include "jazz_esp.h" +#endif + /* static const char RCSid[] = "$Header: /vger/u4/cvs/linux/drivers/scsi/hosts.c,v 1.20 1996/12/12 19:18:32 davem Exp $"; */ 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/jazz_esp.c linux/drivers/scsi/jazz_esp.c --- v2.1.114/linux/drivers/scsi/jazz_esp.c Wed Dec 31 16:00:00 1969 +++ linux/drivers/scsi/jazz_esp.c Tue Aug 4 16:56:37 1998 @@ -0,0 +1,275 @@ +/* + * jazz_esp.c: Driver for SCSI chip on Mips Magnum Boards (JAZZ architecture) + * + * Copyright (C) 1997 Thomas Boegndoerfer (tsbogend@alpha.franken.de) + * + * jazz_esp is based on David S. Miller's ESP driver and cyber_esp + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "scsi.h" +#include "hosts.h" +#include "NCR53C9x.h" +#include "jazz_esp.h" + +#include +#include +#include +#include + +#include + +static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count); +static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp); +static void dma_dump_state(struct NCR_ESP *esp); +static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length); +static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length); +static void dma_ints_off(struct NCR_ESP *esp); +static void dma_ints_on(struct NCR_ESP *esp); +static int dma_irq_p(struct NCR_ESP *esp); +static int dma_ports_p(struct NCR_ESP *esp); +static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write); +static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp); +static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp); +static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp); +static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp); +static void dma_advance_sg (Scsi_Cmnd *sp); +static void dma_led_off(struct NCR_ESP *); +static void dma_led_on(struct NCR_ESP *); + + +volatile unsigned char cmd_buffer[16]; + /* This is where all commands are put + * before they are trasfered to the ESP chip + * via PIO. + */ + +/***************************************************************** Detection */ +int jazz_esp_detect(Scsi_Host_Template *tpnt) +{ + struct NCR_ESP *esp; + struct ConfigDev *esp_dev; + + /* + * first assumption it is there:-) + */ + if (1) { + esp_dev = 0; + esp = esp_allocate(tpnt, (void *) esp_dev); + + /* Do command transfer with programmed I/O */ + esp->do_pio_cmds = 1; + + /* Required functions */ + esp->dma_bytes_sent = &dma_bytes_sent; + esp->dma_can_transfer = &dma_can_transfer; + esp->dma_dump_state = &dma_dump_state; + esp->dma_init_read = &dma_init_read; + esp->dma_init_write = &dma_init_write; + esp->dma_ints_off = &dma_ints_off; + esp->dma_ints_on = &dma_ints_on; + esp->dma_irq_p = &dma_irq_p; + esp->dma_ports_p = &dma_ports_p; + esp->dma_setup = &dma_setup; + + /* Optional functions */ + esp->dma_barrier = 0; + esp->dma_drain = 0; + esp->dma_invalidate = 0; + esp->dma_irq_entry = 0; + esp->dma_irq_exit = 0; + esp->dma_poll = 0; + esp->dma_reset = 0; + esp->dma_led_off = &dma_led_off; + esp->dma_led_on = &dma_led_on; + + /* virtual DMA functions */ + esp->dma_mmu_get_scsi_one = &dma_mmu_get_scsi_one; + esp->dma_mmu_get_scsi_sgl = &dma_mmu_get_scsi_sgl; + esp->dma_mmu_release_scsi_one = &dma_mmu_release_scsi_one; + esp->dma_mmu_release_scsi_sgl = &dma_mmu_release_scsi_sgl; + esp->dma_advance_sg = &dma_advance_sg; + + + /* SCSI chip speed */ + esp->cfreq = 40000000; + + /* + * we don't give the address of DMA channel, but the number + * of DMA channel, so we can use the jazz DMA functions + * + */ + esp->dregs = JAZZ_SCSI_DMA; + + /* ESP register base */ + esp->eregs = (struct ESP_regs *)(JAZZ_SCSI_BASE); + + /* Set the command buffer */ + esp->esp_command = (volatile unsigned char *)cmd_buffer; + + /* get virtual dma address for command buffer */ + esp->esp_command_dvma = vdma_alloc(PHYSADDR(cmd_buffer), sizeof (cmd_buffer)); + + esp->irq = JAZZ_SCSI_IRQ; + request_irq(JAZZ_SCSI_IRQ, esp_intr, SA_INTERRUPT, "JAZZ SCSI", + NULL); + + /* + * FIXME, look if the scsi id is availabe from NVRAM + */ + esp->scsi_id = 7; + + /* Check for differential SCSI-bus */ + /* What is this stuff? */ + esp->diff = 0; + + esp_initialize(esp); + + printk("ESP: Total of %d ESP hosts found, %d actually in use.\n", nesps,esps_in_use); + esps_running = esps_in_use; + return esps_in_use; + } + return 0; +} + +/************************************************************* DMA Functions */ +static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count) +{ + return fifo_count; +} + +static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp) +{ + /* + * maximum DMA size is 1MB + */ + unsigned long sz = sp->SCp.this_residual; + if(sz > 0x100000) + sz = 0x100000; + return sz; +} + +static void dma_dump_state(struct NCR_ESP *esp) +{ + + ESPLOG(("esp%d: dma -- enable <%08x> residue <%08x\n", + esp->esp_id, vdma_get_enable((int)esp->dregs), vdma_get_resdiue((int)esp->dregs))); +} + +static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length) +{ + dma_cache_wback_inv ((unsigned long)phys_to_virt(vdma_log2phys(vaddress)), length); + vdma_disable ((int)esp->dregs); + vdma_set_mode ((int)esp->dregs, DMA_MODE_READ); + vdma_set_addr ((int)esp->dregs, vaddress); + vdma_set_count ((int)esp->dregs, length); + vdma_enable ((int)esp->dregs); +} + +static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length) +{ + dma_cache_wback_inv ((unsigned long)phys_to_virt(vdma_log2phys(vaddress)), length); + vdma_disable ((int)esp->dregs); + vdma_set_mode ((int)esp->dregs, DMA_MODE_WRITE); + vdma_set_addr ((int)esp->dregs, vaddress); + vdma_set_count ((int)esp->dregs, length); + vdma_enable ((int)esp->dregs); +} + +static void dma_ints_off(struct NCR_ESP *esp) +{ + disable_irq(esp->irq); +} + +static void dma_ints_on(struct NCR_ESP *esp) +{ + enable_irq(esp->irq); +} + +static int dma_irq_p(struct NCR_ESP *esp) +{ + return (esp->eregs->esp_status & ESP_STAT_INTR); +} + +static int dma_ports_p(struct NCR_ESP *esp) +{ + int enable = vdma_get_enable((int)esp->dregs); + + return (enable & R4030_CHNL_ENABLE); +} + +static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) +{ + /* + * On the Sparc, DMA_ST_WRITE means "move data from device to memory" + * so when (write) is true, it actually means READ! + */ + if(write){ + dma_init_read(esp, addr, count); + } else { + dma_init_write(esp, addr, count); + } +} + +static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp) +{ + sp->SCp.have_data_in = vdma_alloc(PHYSADDR(sp->SCp.buffer), sp->SCp.this_residual); + sp->SCp.ptr = (char *)((unsigned long)sp->SCp.have_data_in); +} + +static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp) +{ + int sz = sp->SCp.buffers_residual; + struct mmu_sglist *sg = (struct mmu_sglist *) sp->SCp.buffer; + + while (sz >= 0) { + sg[sz].dvma_addr = vdma_alloc(PHYSADDR(sg[sz].addr), sg[sz].len); + sz--; + } + sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dvma_address); +} + +static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp) +{ + vdma_free(sp->SCp.have_data_in); +} + +static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp) +{ + int sz = sp->use_sg - 1; + struct mmu_sglist *sg = (struct mmu_sglist *)sp->buffer; + + while(sz >= 0) { + vdma_free(sg[sz].dvma_addr); + sz--; + } +} + +static void dma_advance_sg (Scsi_Cmnd *sp) +{ + sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dvma_address); +} + +#define JAZZ_HDC_LED 0xe000d100 /* FIXME, find correct address */ + +static void dma_led_off(struct NCR_ESP *esp) +{ +#if 0 + *(unsigned char *)JAZZ_HDC_LED = 0; +#endif +} + +static void dma_led_on(struct NCR_ESP *esp) +{ +#if 0 + *(unsigned char *)JAZZ_HDC_LED = 1; +#endif +} diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/jazz_esp.h linux/drivers/scsi/jazz_esp.h --- v2.1.114/linux/drivers/scsi/jazz_esp.h Wed Dec 31 16:00:00 1969 +++ linux/drivers/scsi/jazz_esp.h Tue Aug 4 16:56:37 1998 @@ -0,0 +1,40 @@ +/* jazz_esp.h: Defines and structures for the JAZZ SCSI driver. + * + * Copyright (C) 1997 Thomas Bogendoerfer (tsbogend@alpha.franken.de) + */ + +#ifndef JAZZ_ESP_H +#define JAZZ_ESP_H + +#define EREGS_PAD(n) + +#include "NCR53C9x.h" + + +extern int jazz_esp_detect(struct SHT *); +extern const char *esp_info(struct Scsi_Host *); +extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); +extern int esp_command(Scsi_Cmnd *); +extern int esp_abort(Scsi_Cmnd *); +extern int esp_reset(Scsi_Cmnd *, unsigned int); +extern int esp_proc_info(char *buffer, char **start, off_t offset, int length, + int hostno, int inout); + +#define SCSI_JAZZ_ESP { \ + proc_dir: &proc_scsi_esp, \ + proc_info: &esp_proc_info, \ + name: "ESP 100/100a/200", \ + detect: jazz_esp_detect, \ + info: esp_info, \ + command: esp_command, \ + queuecommand: esp_queue, \ + abort: esp_abort, \ + reset: esp_reset, \ + can_queue: 7, \ + this_id: 7, \ + sg_tablesize: SG_ALL, \ + cmd_per_lun: 1, \ + use_clustering: DISABLE_CLUSTERING, } + +#endif /* JAZZ_ESP_H */ + diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/mesh.c linux/drivers/scsi/mesh.c --- v2.1.114/linux/drivers/scsi/mesh.c Fri May 8 23:14:49 1998 +++ linux/drivers/scsi/mesh.c Tue Aug 4 16:56:37 1998 @@ -55,6 +55,7 @@ int mesh_sync_targets = 0xff; /* targets to set synchronous (bitmap) */ int mesh_resel_targets = 0xff; /* targets that we let disconnect (bitmap) */ int mesh_debug_targets = 0; /* print debug for these targets */ +unsigned char use_active_neg = 0; /* bit mask for SEQ_ACTIVE_NEG if used */ #define ALLOW_SYNC(tgt) ((mesh_sync_targets >> (tgt)) & 1) #define ALLOW_RESEL(tgt) ((mesh_resel_targets >> (tgt)) & 1) @@ -66,7 +67,7 @@ S_IFDIR | S_IRUGO | S_IXUGO, 2 }; -#define MESH_DBG +#undef MESH_DBG #define N_DBG_LOG 50 #define N_DBG_SLOG 20 #define NUM_DBG_EVENTS 13 @@ -165,7 +166,6 @@ static void dlog(struct mesh_state *ms, char *fmt, int a); static void dumplog(struct mesh_state *ms, int tgt); static void dumpslog(struct mesh_state *ms); -#define MKWORD(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) #else static inline void dlog(struct mesh_state *ms, char *fmt, int a) @@ -176,6 +176,7 @@ {} #endif /* MESH_DBG */ +#define MKWORD(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) static struct mesh_state *all_meshes; @@ -301,8 +302,14 @@ ++nmeshes; } - if (_machine == _MACH_Pmac && nmeshes > 0) + if (_machine == _MACH_Pmac) { + use_active_neg = (find_devices("mac-io") ? 0 : SEQ_ACTIVE_NEG); + if (nmeshes > 0) register_reboot_notifier(&mesh_notifier); + } else { + /* CHRP mac-io */ + use_active_neg = SEQ_ACTIVE_NEG; + } return nmeshes; } @@ -361,6 +368,8 @@ (mr->bus_status1 << 8) + mr->bus_status0, mr->fifo_count, mr->exception, mr->error, mr->intr_mask, mr->interrupt, mr->sync_params); + while(in_8(&mr->fifo_count)) + printk(KERN_DEBUG " fifo data=%.2x\n",in_8(&mr->fifo)); printk(KERN_DEBUG " dma stat=%x cmdptr=%x\n", in_le32(&md->status), in_le32(&md->cmdptr)); printk(KERN_DEBUG " phase=%d msgphase=%d conn_tgt=%d data_ptr=%d\n", @@ -610,7 +619,7 @@ out_8(&mr->sequence, SEQ_ARBITRATE); - for (t = 30; t > 0; --t) { + for (t = 230; t > 0; --t) { if (in_8(&mr->interrupt) != 0) break; udelay(1); @@ -735,7 +744,7 @@ dlog(ms, "start_phase err/exc/fc/seq = %.8x", MKWORD(mr->error, mr->exception, mr->fifo_count, mr->sequence)); out_8(&mr->interrupt, INT_ERROR | INT_EXCEPTION | INT_CMDDONE); - seq = SEQ_ACTIVE_NEG + (ms->n_msgout? SEQ_ATN: 0); + seq = use_active_neg + (ms->n_msgout? SEQ_ATN: 0); switch (ms->msgphase) { case msg_none: break; @@ -777,11 +786,13 @@ * issue a SEQ_MSGOUT to get the mesh to drop ACK. */ if ((mr->bus_status0 & BS0_ATN) == 0) { + dlog(ms, "bus0 was %.2x explictly asserting ATN", mr->bus_status0); out_8(&mr->bus_status0, BS0_ATN); /* explicit ATN */ udelay(1); out_8(&mr->count_lo, 1); out_8(&mr->sequence, SEQ_MSGOUT + seq); out_8(&mr->bus_status0, 0); /* release explicit ATN */ + dlog(ms,"hace: after explicit ATN bus0=%.2x",mr->bus_status0); } if (ms->n_msgout == 1) { /* @@ -907,7 +918,7 @@ int seq, n, t; dlog(ms, "cmd_complete fc=%x", mr->fifo_count); - seq = SEQ_ACTIVE_NEG + (ms->n_msgout? SEQ_ATN: 0); + seq = use_active_neg + (ms->n_msgout? SEQ_ATN: 0); switch (ms->msgphase) { case msg_out_xxx: /* huh? we expected a phase mismatch */ @@ -933,7 +944,7 @@ out_8(&mr->sequence, SEQ_FLUSHFIFO); udelay(1); out_8(&mr->count_lo, 1); - out_8(&mr->sequence, SEQ_MSGIN + SEQ_ATN + SEQ_ACTIVE_NEG); + out_8(&mr->sequence, SEQ_MSGIN + SEQ_ATN + use_active_neg); break; case msg_out: @@ -949,7 +960,7 @@ * issue the SEQ_MSGOUT without ATN. */ out_8(&mr->count_lo, 1); - out_8(&mr->sequence, SEQ_MSGOUT + SEQ_ACTIVE_NEG + SEQ_ATN); + out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg + SEQ_ATN); t = 30; /* wait up to 30us */ while ((mr->bus_status0 & BS0_REQ) == 0 && --t >= 0) udelay(1); @@ -976,12 +987,12 @@ return; } if (mr->bus_status0 & BS0_REQ) { - out_8(&mr->sequence, SEQ_MSGOUT + SEQ_ACTIVE_NEG); + out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg); udelay(1); out_8(&mr->fifo, ms->msgout[ms->n_msgout-1]); ms->msgphase = msg_out_last; } else { - out_8(&mr->sequence, SEQ_MSGIN + SEQ_ACTIVE_NEG + SEQ_ATN); + out_8(&mr->sequence, SEQ_MSGIN + use_active_neg + SEQ_ATN); ms->msgphase = msg_out_xxx; } break; @@ -1000,6 +1011,7 @@ dumpslog(ms); return; case selecting: + dlog(ms, "Selecting phase at command completion",0); ms->msgout[0] = IDENTIFY(ALLOW_RESEL(ms->conn_tgt), (cmd? cmd->lun: 0)); ms->n_msgout = 1; @@ -1021,7 +1033,7 @@ * which will give us a phase mismatch interrupt * when REQ does come, and then we send the message. */ - t = 30; /* wait up to 30us */ + t = 230; /* wait up to 230us */ while ((mr->bus_status0 & BS0_REQ) == 0) { if (--t < 0) { ms->msgphase = msg_none; @@ -1087,7 +1099,7 @@ if (ms->msgphase == msg_out_xxx && phase == BP_MSGOUT) { /* output the last byte of the message, without ATN */ out_8(&mr->count_lo, 1); - out_8(&mr->sequence, SEQ_MSGOUT + SEQ_ACTIVE_NEG); + out_8(&mr->sequence, SEQ_MSGOUT + use_active_neg); udelay(1); out_8(&mr->fifo, ms->msgout[ms->n_msgout-1]); ms->msgphase = msg_out_last; @@ -1313,11 +1325,11 @@ static void do_mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) { - unsigned long flags; + /*unsigned long flags;*/ - spin_lock_irqsave(&io_request_lock, flags); + /*spin_lock_irqsave(&io_request_lock, flags);*/ mesh_interrupt(irq, dev_id, ptregs); - spin_unlock_irqrestore(&io_request_lock, flags); + /*spin_unlock_irqrestore(&io_request_lock, flags);*/ } static void handle_error(struct mesh_state *ms) diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/qlogicpti.c linux/drivers/scsi/qlogicpti.c --- v2.1.114/linux/drivers/scsi/qlogicpti.c Sun Jun 7 11:16:34 1998 +++ linux/drivers/scsi/qlogicpti.c Tue Aug 4 16:56:37 1998 @@ -568,9 +568,6 @@ /* Detect all PTI Qlogic ISP's in the machine. */ __initfunc(int qlogicpti_detect(Scsi_Host_Template *tpnt)) { -#ifdef __sparc_v9__ - struct devid_cookie dcookie; -#endif struct qlogicpti *qpti, *qlink; struct Scsi_Host *qpti_host; struct linux_sbus *sbus; @@ -584,13 +581,8 @@ tpnt->proc_dir = &proc_scsi_qlogicpti; qptichain = 0; - if(!SBus_chain) { -#ifdef __sparc_v9__ - return 0; /* Could be a PCI-only machine. */ -#else - panic("No SBUS in qlogicpti_detect()"); -#endif - } + if(!SBus_chain) + return 0; for_each_sbus(sbus) { for_each_sbusdev(sbdev_iter, sbus) { qpti_dev = sbdev_iter; @@ -601,6 +593,16 @@ strcmp(qpti_dev->prom_name, "QLGC,isp")) continue; + /* Sometimes Antares cards come up not completely + * setup, and we get a report of a zero IRQ. + * Skip over them in such cases so we survive. + */ + if(qpti_dev->irqs[0] == 0) { + printk("qpti%d: Adapter reports no interrupt, " + "skipping over this card.", nqptis); + continue; + } + /* Yep, register and allocate software state. */ qpti_host = scsi_register(tpnt, sizeof(struct qlogicpti)); if(!qpti_host) @@ -667,7 +669,7 @@ qpti_host->n_io_port = (unsigned char) qpti->qdev->reg_addrs[0].reg_size; - qpti_host->irq = qpti->irq = qpti->qdev->irqs[0].pri; + qpti_host->irq = qpti->irq = qpti->qdev->irqs[0]; #ifndef __sparc_v9__ /* Allocate the irq only if necessary. */ @@ -688,20 +690,14 @@ /* On Ultra we must always call request_irq for each * qpti, so that imap registers get setup etc. */ - dcookie.real_dev_id = qpti; - dcookie.imap = dcookie.iclr = 0; - dcookie.pil = -1; - dcookie.bus_cookie = sbus; if(request_irq(qpti->qhost->irq, do_qlogicpti_intr_handler, - (SA_SHIRQ | SA_SBUS | SA_DCOOKIE), - "PTI Qlogic/ISP SCSI", &dcookie)) { + SA_SHIRQ, "PTI Qlogic/ISP SCSI", qpti)) { printk("Cannot acquire PTI Qlogic/ISP irq line\n"); /* XXX Unmap regs, unregister scsi host, free things. */ continue; } - qpti->qhost->irq = qpti->irq = dcookie.ret_ino; - printk("qpti%d: INO[%x] IRQ %d ", - qpti->qpti_id, qpti->qhost->irq, dcookie.ret_pil); + printk("qpti%d: IRQ %s ", + qpti->qpti_id, __irq_itoa(qpti->qhost->irq)); #endif /* Figure out our scsi ID on the bus */ @@ -964,7 +960,14 @@ Cmnd->scsi_done = done; in_ptr = NEXT_REQ_PTR(in_ptr); if(in_ptr == out_ptr) { - printk(KERN_EMERG "qlogicpti%d: request queue overflow\n", qpti->qpti_id); + printk(KERN_EMERG "qlogicpti%d: request queue overflow\n",qpti->qpti_id); + + /* Unfortunately, unless you use the new EH code, which + * we don't, the midlayer will ignore the return value, + * which is insane. We pick up the pieces like this. + */ + Cmnd->result = DID_BUS_BUSY; + done(Cmnd); return 1; } if(qpti->send_marker) { @@ -973,15 +976,30 @@ if(NEXT_REQ_PTR(in_ptr) == out_ptr) { qregs->mbox4 = in_ptr; qpti->req_in_ptr = in_ptr; - printk(KERN_EMERG "qlogicpti%d: request queue overflow\n", qpti->qpti_id); + printk(KERN_EMERG "qlogicpti%d: request queue overflow\n", + qpti->qpti_id); + + /* Unfortunately, unless you use the new EH code, which + * we don't, the midlayer will ignore the return value, + * which is insane. We pick up the pieces like this. + */ + Cmnd->result = DID_BUS_BUSY; + done(Cmnd); return 1; } cmd = (struct Command_Entry *) &qpti->req_cpu[in_ptr]; in_ptr = NEXT_REQ_PTR(in_ptr); } cmd_frob(cmd, Cmnd, qpti); - if((in_ptr = load_cmd(Cmnd, cmd, qpti, qregs, in_ptr, out_ptr)) == -1) + if((in_ptr = load_cmd(Cmnd, cmd, qpti, qregs, in_ptr, out_ptr)) == -1) { + /* Unfortunately, unless you use the new EH code, which + * we don't, the midlayer will ignore the return value, + * which is insane. We pick up the pieces like this. + */ + Cmnd->result = DID_BUS_BUSY; + done(Cmnd); return 1; + } update_can_queue(host, in_ptr, out_ptr); return 0; } diff -u --recursive --new-file v2.1.114/linux/drivers/scsi/qlogicpti.h linux/drivers/scsi/qlogicpti.h --- v2.1.114/linux/drivers/scsi/qlogicpti.h Sun Dec 21 17:04:49 1997 +++ linux/drivers/scsi/qlogicpti.h Tue Aug 4 16:56:37 1998 @@ -729,7 +729,8 @@ this_id: 7, \ sg_tablesize: QLOGICISP_MAX_SG(QLOGICISP_REQ_QUEUE_LEN), \ cmd_per_lun: 1, \ - use_clustering: DISABLE_CLUSTERING \ + use_clustering: DISABLE_CLUSTERING, \ + use_new_eh_code: 0 \ } /* For our interrupt engine. */ 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/sound/Makefile linux/drivers/sound/Makefile --- v2.1.114/linux/drivers/sound/Makefile Mon Aug 3 12:45:46 1998 +++ linux/drivers/sound/Makefile Tue Aug 4 16:49:18 1998 @@ -40,13 +40,20 @@ # Each configuration option enables a list of files. +obj-$(CONFIG_SOUND) += soundcore.o + ifeq ($(ARCH),m68k) -obj-$(CONFIG_DMASOUND) += dmasound.o sound_core.o +obj-$(CONFIG_DMASOUND) += dmasound.o + +else + +ifeq ($(CONFIG_PMAC),y) + +obj-$(CONFIG_DMASOUND) += dmasound.o else -obj-$(CONFIG_SOUND) += soundcore.o obj-$(CONFIG_SOUND_OSS) += sound.o obj-$(CONFIG_SOUND_ADLIB) += adlib_card.o opl3.o obj-$(CONFIG_SOUND_CS4232) += cs4232.o ad1848.o @@ -83,7 +90,7 @@ obj-$(CONFIG_SOUND_SONICVIBES) += sonicvibes.o endif - +endif # Declare multi-part drivers. diff -u --recursive --new-file v2.1.114/linux/drivers/sound/dmasound.c linux/drivers/sound/dmasound.c --- v2.1.114/linux/drivers/sound/dmasound.c Mon Aug 3 12:45:46 1998 +++ linux/drivers/sound/dmasound.c Tue Aug 4 16:49:18 1998 @@ -173,6 +173,7 @@ static volatile struct awacs_regs *awacs; static volatile struct dbdma_regs *awacs_txdma, *awacs_rxdma; static int awacs_rate_index; +static int awacs_subframe; /* * Space for the DBDMA command blocks. @@ -1906,7 +1907,7 @@ ssize_t frameLeft) { ssize_t count, used; - short mask = (sound.soft.format == AFMT_U16_LE? 0x0080: 0x8000); + int mask = (sound.soft.format == AFMT_U16_LE? 0x0080: 0x8000); int stereo = sound.soft.stereo; short *fp = (short *) &frame[*frameUsed]; short *up = (short *) userPtr; @@ -1915,7 +1916,7 @@ userCount >>= (stereo? 2: 1); used = count = min(userCount, frameLeft); while (count > 0) { - short data; + int data; if (get_user(data, up++)) return -EFAULT; data ^= mask; @@ -4428,7 +4429,23 @@ #endif /* __mc68000__ */ #ifdef CONFIG_PMAC + awacs_subframe = 0; np = find_devices("awacs"); + if (np == 0) { + /* + * powermac G3 models have a node called "davbus" + * with a child called "sound". + */ + struct device_node *sound; + np = find_devices("davbus"); + sound = find_devices("sound"); + if (sound != 0 && sound->parent == np) { + int *sfprop; + sfprop = (int *) get_property(sound, "sub-frame", 0); + if (sfprop != 0 && *sfprop >= 0 && *sfprop < 16) + awacs_subframe = *sfprop; + } + } if (np != NULL && np->n_addrs >= 3 && np->n_intrs >= 3) { int vol; sound.mach = machPMac; @@ -4454,6 +4471,7 @@ vol = (~nvram_read_byte(0x1308) & 7) << 1; awacs_reg[2] = vol + (vol << 6); awacs_reg[4] = vol + (vol << 6); + out_le32(&awacs->control, 0x11); awacs_write(awacs_reg[0] + MASK_ADDR0); awacs_write(awacs_reg[1] + MASK_ADDR1); awacs_write(awacs_reg[2] + MASK_ADDR2); 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/nfsd/nfsfh.c linux/fs/nfsd/nfsfh.c --- v2.1.114/linux/fs/nfsd/nfsfh.c Sun Jul 26 11:57:18 1998 +++ linux/fs/nfsd/nfsfh.c Tue Aug 4 17:04:04 1998 @@ -21,7 +21,7 @@ #define NFSD_PARANOIA 1 /* #define NFSD_DEBUG_VERBOSE 1 */ -extern unsigned long num_physpages; +extern unsigned long max_mapnr; #define NFSD_FILE_CACHE 0 #define NFSD_DIR_CACHE 1 @@ -1197,7 +1197,7 @@ { unsigned long dent_addr = (unsigned long) dentry; unsigned long min_addr = PAGE_OFFSET; - unsigned long max_addr = min_addr + (num_physpages << PAGE_SHIFT); + unsigned long max_addr = min_addr + (max_mapnr << PAGE_SHIFT); unsigned long align_mask = 0x0F; unsigned int len; int valid = 0; @@ -1208,6 +1208,11 @@ goto bad_addr; if ((dent_addr & ~align_mask) != dent_addr) goto bad_align; + /* XXX: Should test here, whether the address doesn't belong to + a physical memory hole on sparc32/sparc64. Then it is not + safe to dereference it. On the other side, the previous + use of num_physpages instead of max_mapnr caused the same + to happen, plus some valid addresses could get rejected. -jj */ /* * Looks safe enough to dereference ... */ 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 17:04:04 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; @@ -599,5 +601,8 @@ #define module_map vmalloc #define module_unmap vfree + +/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ +#define PageSkip(page) (0) #endif /* _ALPHA_PGTABLE_H */ 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-arm/stat.h linux/include/asm-arm/stat.h --- v2.1.114/linux/include/asm-arm/stat.h Fri May 8 23:14:54 1998 +++ linux/include/asm-arm/stat.h Tue Aug 4 16:07:17 1998 @@ -38,41 +38,4 @@ unsigned long __unused5; }; -#if 0 -typedef struct { - unsigned int minor; - unsigned int major; -} __new_dev_t; - -struct stat64 { - __new_dev_t st_dev; - __u64 st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; - unsigned int st_gid; - __new_dev_t st_rdev; - __s64 st_size; - __u64 st_blocks; - unsigned long st_atime; - unsigned long __unused1; - unsigned long st_mtime; - unsigned long __unused2; - unsigned long st_ctime; - unsigned long __unused3; - unsigned long st_blksize; - unsigned long __unused4; -}; - -#define __XSTAT_VER_1 1 -#define __XSTAT_VER_2 2 -#define __XSTAT_VER_MASK 0xff - -#define __XSTAT_VER_XSTAT 0x000 -#define __XSTAT_VER_LXSTAT 0x100 -#define __XSTAT_VER_FXSTAT 0x200 -#define __XSTAT_VER_TYPEMASK 0xff00 - -#define __XMKNOD_VER_1 1 -#endif #endif diff -u --recursive --new-file v2.1.114/linux/include/asm-arm/xstat.h linux/include/asm-arm/xstat.h --- v2.1.114/linux/include/asm-arm/xstat.h Wed Apr 8 19:36:28 1998 +++ linux/include/asm-arm/xstat.h Wed Dec 31 16:00:00 1969 @@ -1,35 +0,0 @@ -/* $Id: xstat.h,v 1.1 1998/02/06 12:52:45 jj Exp $ - * xstat.h: sys_xstat/xmknod architecture dependent stuff. - * - * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -extern __inline__ int cp_xstat(struct inode *inode, struct stat64 *s, unsigned long blocks, int blksize) -{ - struct stat64 tmp; - - memset (&tmp, 0, sizeof(tmp)); - tmp.st_dev.major = MAJOR(inode->i_dev); - tmp.st_dev.minor = MINOR(inode->i_dev); - tmp.st_ino = inode->i_ino; - tmp.st_mode = inode->i_mode; - tmp.st_nlink = inode->i_nlink; - tmp.st_uid = inode->i_uid; - tmp.st_gid = inode->i_gid; - tmp.st_rdev.major = MAJOR(inode->i_rdev); - tmp.st_rdev.minor = MINOR(inode->i_rdev); - tmp.st_size = inode->i_size; - tmp.st_blksize = blksize; - tmp.st_blocks = blocks; - tmp.st_atime = inode->i_atime; - tmp.st_mtime = inode->i_mtime; - tmp.st_ctime = inode->i_ctime; - return copy_to_user(s,&tmp,sizeof(tmp)); -} - -extern __inline__ int get_user_new_dev_t(kdev_t *kdev, __new_dev_t *udev) { - __new_dev_t ndev; - if (copy_from_user (&ndev, udev, sizeof(__new_dev_t))) return -EFAULT; - *kdev = MKDEV(ndev.major, ndev.minor); - return 0; -} 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 Wed Aug 5 00:02: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; @@ -593,5 +595,8 @@ #define module_unmap vfree #endif /* !__ASSEMBLY__ */ + +/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ +#define PageSkip(page) (0) #endif /* _I386_PAGE_H */ 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/checksum.h linux/include/asm-mips/checksum.h --- v2.1.114/linux/include/asm-mips/checksum.h Tue Dec 16 12:46:01 1997 +++ linux/include/asm-mips/checksum.h Tue Aug 4 16:06:57 1998 @@ -1,11 +1,10 @@ -/* - * include/asm-mips/checksum.h +/* $Id: checksum.h,v 1.8 1998/05/07 00:39:59 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1995 by Ralf Baechle + * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle */ #ifndef __ASM_MIPS_CHECKSUM_H #define __ASM_MIPS_CHECKSUM_H @@ -25,13 +24,18 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); /* - * the same as csum_partial, but copies from src while it - * checksums - * - * here even more important to align src and dst on a 32-bit (or even - * better 64-bit) boundary + * this is a new version of the above that records errors it finds in *errp, + * but continues and zeros the rest of the buffer. */ -unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int sum); +unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, + unsigned int sum); + +/* + * this is a new version of the above that records errors it finds in *errp, + * but continues and zeros the rest of the buffer. + */ +unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, + unsigned int sum, int *errp); /* * the same as csum_partial, but copies from user space (but on MIPS @@ -40,14 +44,9 @@ * this is obsolete and will go away. */ #define csum_partial_copy_fromuser csum_partial_copy +unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int sum); /* - * this is a new version of the above that records errors it finds in *errp, - * but continues and zeros the rest of the buffer. - */ -unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, unsigned int sum, int *errp); - -/* * Fold a partial checksum without adding pseudo headers */ static inline unsigned short int csum_fold(unsigned int sum) @@ -126,11 +125,11 @@ * computes the checksum of the TCP/UDP pseudo-header * returns a 16-bit checksum, already complemented */ -static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, - unsigned long daddr, - unsigned short len, - unsigned short proto, - unsigned int sum) +static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) { __asm__(" .set noat @@ -156,7 +155,20 @@ "r"(sum) : "$1"); - return csum_fold(sum); + return sum; +} + +/* + * computes the checksum of the TCP/UDP pseudo-header + * returns a 16-bit checksum, already complemented + */ +static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, + unsigned long daddr, + unsigned short len, + unsigned short proto, + unsigned int sum) +{ + return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); } /* diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/ide.h linux/include/asm-mips/ide.h --- v2.1.114/linux/include/asm-mips/ide.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/ide.h Tue Aug 4 16:06:57 1998 @@ -1,4 +1,5 @@ -/* +/* $Id: ide.h,v 1.4 1998/05/08 21:05:26 davem Exp $ + * * linux/include/asm-mips/ide.h * * Copyright (C) 1994-1996 Linus Torvalds & authors @@ -16,7 +17,7 @@ typedef unsigned short ide_ioreg_t; #ifndef MAX_HWIFS -#define MAX_HWIFS 4 +#define MAX_HWIFS 6 #endif #define ide__sti() __sti() diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/irq.h linux/include/asm-mips/irq.h --- v2.1.114/linux/include/asm-mips/irq.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/irq.h Tue Aug 4 16:06:57 1998 @@ -19,6 +19,8 @@ #define TIMER_IRQ 0 +extern int (*irq_cannonicalize)(int irq); + struct irqaction; extern int setup_x86_irq(int irq, struct irqaction * new); extern void disable_irq(unsigned int); diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/keyboard.h linux/include/asm-mips/keyboard.h --- v2.1.114/linux/include/asm-mips/keyboard.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/keyboard.h Tue Aug 4 16:06:57 1998 @@ -5,7 +5,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * $Id: keyboard.h,v 1.7 1998/05/01 01:35:57 ralf Exp $ + * $Id: keyboard.h,v 1.8 1998/05/07 00:40:03 ralf Exp $ */ #ifndef __ASM_MIPS_KEYBOARD_H #define __ASM_MIPS_KEYBOARD_H @@ -37,8 +37,6 @@ #define kbd_sysrq_xlate pckbd_sysrq_xlate #define SYSRQ_KEY 0x54 - -#define INIT_KBD /* full initialization for the keyboard controller. */ /* Some stoneage hardware needs delays after some operations. */ #define kbd_pause() do { } while(0) diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/linux_logo.h linux/include/asm-mips/linux_logo.h --- v2.1.114/linux/include/asm-mips/linux_logo.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-mips/linux_logo.h Tue Aug 4 16:06:57 1998 @@ -0,0 +1,940 @@ +/* $Id: linux_logo.h,v 1.1 1998/07/30 16:30:31 jj Exp $ + * include/asm-mips/linux_logo.h: This is a linux logo + * to be displayed on boot. + * + * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu) + * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * + * You can put anything here, but: + * LINUX_LOGO_COLORS has to be less than 224 + * image size has to be 80x80 + * values have to start from 0x20 + * (i.e. RGB(linux_logo_red[0], + * linux_logo_green[0], + * linux_logo_blue[0]) is color 0x20) + * BW image has to be 80x80 as well, with MS bit + * on the left + * Serial_console ascii image can be any size, + * but should contain %s to display the version + */ + +#include +#include + +#define linux_logo_banner "Linux/MIPS version " UTS_RELEASE + +#define LINUX_LOGO_COLORS 212 + +#ifdef INCLUDE_LINUX_LOGO_DATA + +unsigned char linux_logo_red[] __initdata = { + 0x03, 0x82, 0xE9, 0xBF, 0x42, 0xC9, 0x7E, 0xC0, + 0xE9, 0xE3, 0xC2, 0x24, 0xA4, 0x65, 0xEC, 0xC4, + 0x82, 0x9F, 0xF3, 0x12, 0x5F, 0xA0, 0xC2, 0xED, + 0x3E, 0xD5, 0xDB, 0xA0, 0x1C, 0xF4, 0xEB, 0xA4, + 0xCD, 0x0A, 0x9A, 0x51, 0xCC, 0xBE, 0xC0, 0xBA, + 0x74, 0xDC, 0xAA, 0xF6, 0xD3, 0xC5, 0xE6, 0x26, + 0xC2, 0x83, 0x38, 0xEA, 0x49, 0xB0, 0xED, 0xE5, + 0xF4, 0x96, 0x96, 0x1B, 0xFA, 0xCC, 0xF2, 0x0F, + 0xCD, 0xE5, 0xF4, 0xD3, 0x50, 0x7A, 0xB5, 0xDE, + 0xD5, 0xB6, 0x60, 0x0A, 0x6A, 0xEA, 0xD4, 0xEB, + 0xC1, 0xCA, 0xEA, 0xEC, 0x2A, 0x96, 0x95, 0xDC, + 0xE4, 0xCE, 0xEC, 0x1E, 0xDC, 0x8A, 0xD1, 0xF6, + 0x3C, 0x5E, 0xC6, 0x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+ 0x17, 0x24, 0x0D, 0x13, 0x11, 0x07, 0x40, 0x22, + 0x0C, 0x0C, 0x11, 0x78, 0x06, 0xF4, 0x0B, 0x0A, + 0x47, 0x0B, 0x7C, 0x54, 0x6C, 0x0C, 0x0D, 0x9C, + 0x73, 0x54, 0x14, 0x0C, 0x0F, 0xC7, 0x94, 0x04, + 0x94, 0x17, 0x0A, 0x6C, 0x08, 0x0F, 0x14, 0x0B, + 0x12, 0x68, 0x28, 0x11, 0xFA, 0x0A, 0x34, 0x09, + 0x0A, 0x2F, 0x15, 0x19, 0x14, 0x3C, 0x06, 0xC4, + 0x0B, 0x84, 0x24, 0x08, 0x69, 0x38, 0xBC, 0x15, + 0x1F, 0xA0, 0x0A, 0xEC, 0x2A, 0x0C, 0x0C, 0x0C, + 0x2C, 0xA0, 0x15, 0x07, 0x0B, 0x8C, 0xD3, 0x10, + 0x3B, 0x5C, 0x0C, 0x04, 0x3C, 0xAC, 0x54, 0x1C, + 0x0B, 0x5B, 0xBB, 0x0A, 0xC1, 0xBB, 0x5C, 0x3C, + 0xBC, 0x4D, 0x74, 0x10, 0x8C, 0x8C, 0x14, 0x91, + 0x0C, 0x74, 0x17, 0x0C, 0x48, 0x9C, 0x3C, 0x4C, + 0x09, 0x7C, 0x05, 0xE4, 0x34, 0x38, 0x6C, 0x11, + 0x08, 0x7C, 0x18, 0x2C, 0x9C, 0x4C, 0x34, 0x9C, + 0x29, 0x54, 0x7C, 0x0C, 0x78, 0x18, 0x9C, 0x14, + 0xBA, 0x30, 0x27, 0x31, 0xC2, 0x97, 0x24, 0x09, + 0xB4, 0x04, 0x87, 0x0C, 0x14, 0x1F, 0x7C, 0x64, + 0xB0, 0x0F, 0x45, 0x10, 0x2C, 0xD4, 0x0A, 0x04, + 0x44, 0x1F, 0x2C, 0xCC, 0x7C, 0xD8, 0x84, 0x0C, + 0x8C, 0x94, 0xB4, 0x1D, 0x20, 0x5C, 0x18, 0xB4, + 0x04, 0x09, 0xBC, 0x14, 0xF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, 0x88, + 0x20, 0x33, 0xDA, 0x95, 0xD9, 0x2C, 0xDA, 0x85, + 0x2C, 0x7D, 0xB2, 0xD6, 0xD9, 0xAF, 0x85, 0x85, + 0x85, 0x85, 0xAF, 0xAC, 0xAC, 0xAF, 0xAF, 0xAC, + 0xAC, 0xD9, 0x95, 0x95, 0x7D, 0x95, 0x95, 0xD9, + 0x85, 0xD9, 0x2C, 0x85, 0xDA, 0xDA, 0xD9, 0x21, + 0xA1, 0xD9, 0xAF, 0x2C, 0x85, 0xDA, 0x85, 0xAF, + 0xD9, 0xD9, 0xAC, 0xAC, 0xAC, 0xD9, 0x7D, 0xD6, + 0xD6, 0x7D, 0x95, 0xD9, 0xD9, 0x85, 0xDB, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xDB, 0xE3, 0x6B, 0x20, 0x20, + 0x20, 0x20, 0xE9, 0xD9, 0x2C, 0x85, 0xDA, 0xDA, + 0xD9, 0x21, 0xA1, 0xD9, 0xAF, 0x2C, 0x85, 0xDA, + 0x85, 0xAF, 0xD9, 0xD9, 0xAC, 0xAC, 0xAC, 0xD9, + 0x7D, 0xD6, 0xD6, 0x7D, 0x95, 0xD9, 0xD9, 0xD9, + 0xDA, 0x2C, 0x85, 0xDA, 0xDA, 0x85, 0x95, 0x21, + 0x21, 0xD9, 0x85, 0x85, 0x85, 0x2C, 0x2C, 0xD9, + 0x95, 0x95, 0xD9, 0xD9, 0xD9, 0xD9, 0xD9, 0xD9, + 0xAC, 0xAC, 0x2C, 0xAF, 0x2C, 0x85, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x88, 0xDA, 0x85, 0xDA, 0xDA, 0x85, + 0x95, 0x21, 0x21, 0xD9, 0x85, 0x85, 0x85, 0x2C, + 0x2C, 0xD9, 0x95, 0x95, 0xD9, 0xD9, 0xD9, 0xD9, + 0xD9, 0xD9, 0xD9, 0xAF, 0x2C, 0x2C, 0x2C, 0x2C, + 0xDA, 0x2C, 0x85, 0x85, 0x2C, 0xD9, 0xD6, 0xB2, + 0x95, 0x2C, 0x85, 0x85, 0xAF, 0xAC, 0x95, 0x95, + 0x7D, 0xD9, 0xD9, 0xD9, 0xD9, 0xD9, 0x2C, 0x85, + 0x85, 0x85, 0x85, 0x85, 0x85, 0xAC, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xAC, 0x85, 0x85, 0x2C, 0xD9, + 0xD6, 0xB2, 0x95, 0x2C, 0x85, 0x85, 0xAF, 0xAC, + 0x95, 0x95, 0x7D, 0xD9, 0xD9, 0xD9, 0xD9, 0xD9, + 0x2C, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, + 0x85, 0x2C, 0x2C, 0x2C, 0xAC, 0x95, 0xD6, 0x7D, + 0xD9, 0x2C, 0x2C, 0xAF, 0x95, 0x7D, 0x7D, 0x95, + 0x95, 0xD9, 0xD9, 0x95, 0xD9, 0xD9, 0x2C, 0x85, + 0xDA, 0xDA, 0xDA, 0x85, 0x85, 0x21, 0x20, 0x20, + 0x6B, 0x41, 0xDB, 0x6B, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x41, 0xDB, 0xDB, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xE6, 0x2C, 0x2C, 0xAC, 0x95, + 0xD6, 0x7D, 0xD9, 0x2C, 0x2C, 0xAF, 0x95, 0x7D, + 0x7D, 0x95, 0x95, 0xD9, 0xD9, 0x95, 0xD9, 0xD9, + 0x2C, 0x85, 0xDA, 0xDA, 0xDA, 0x85, 0x2C, 0x2C, + 0x2C, 0xAF, 0xAC, 0xD9, 0x95, 0xD6, 0xD6, 0xD9, +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0x3E, 0x62, 0x3E, 0x4B, 0x4B, 0x4B, 0x4B, + 0x4B, 0x4B, 0x4B, 0x8B, 0x8B, 0x57, 0x60, 0x76, + 0x52, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x3C, 0xA0, 0x23, 0x7C, 0x2E, 0x4B, 0x4B, + 0x8B, 0x62, 0x4B, 0x4B, 0x3E, 0x7A, 0xF0, 0x29, + 0x36, 0x97, 0xBC, 0x8A, 0x8D, 0xDA, 0xD9, 0x48, + 0x81, 0x2D, 0x48, 0xD6, 0xD9, 0xAF, 0x2C, 0x2C, + 0xAC, 0xAF, 0xD9, 0x7D, 0x7D, 0x2C, 0x85, 0x85, + 0x85, 0xB4, 0x66, 0x23, 0x46, 0x2F, 0x60, 0x68, + 0x77, 0x29, 0x29, 0xF0, 0x2E, 0x2E, 0x62, 0x4B, + 0x4B, 0x4B, 0x4B, 0x4B, 0x32, 0x7C, 0x83, 0xB3, + 0x54, 0x6B, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x6B, 0x7B, 0xC3, 0xE7, 0x39, 0x72, 0x62, 0x62, + 0x62, 0x62, 0x62, 0x2E, 0x29, 0x77, 0xA7, 0x36, + 0xB8, 0x85, 0x85, 0x8D, 0x8D, 0x85, 0xB2, 0x2D, + 0x2D, 0xE9, 0xD6, 0xD9, 0xAF, 0x2C, 0x85, 0x85, + 0x2A, 0x85, 0xAC, 0x95, 0x95, 0xAF, 0x85, 0x85, + 0xAF, 0x8C, 0xDF, 0xC6, 0xB1, 0xD1, 0xE5, 0xE7, + 0x83, 0x23, 0x5D, 0x60, 0x39, 0x77, 0xEC, 0x2E, + 0x2E, 0x32, 0x32, 0x2E, 0x7C, 0x5D, 0x35, 0xA2, + 0x54, 0x6B, 0x6B, 0x20, 0x6B, 0x20, 0x20, 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0x2C, 0x2C, 0x2C, 0x2C, 0x2C, + 0x85, 0xAF, 0xAC, 0x2C, 0x2C, 0x2C, 0x2C, 0xAC, + 0xD9, 0xD9, 0xAF, 0x85, 0x85, 0x85, 0xDA, 0xDA, + 0x8A, 0x8A, 0x85, 0xAC, 0xD9, 0xD9, 0xAC, 0xD9, + 0xD6, 0xD6, 0x7D, 0x95, 0x7D, 0xD9, 0xAF, 0xAF, + 0xAF, 0x2C, 0x85, 0x85, 0xDA, 0x85, 0x2C, 0x85, + 0x85, 0x2C, 0xAF, 0xAC, 0xAF, 0xAF, 0x2C, 0x2C, + 0x2C, 0x2C, 0x2C, 0xAF, 0xAC, 0x2C, 0x2C, 0x2C, + 0x2C, 0xAF, 0xD9, 0xAC, 0xAF, 0x2C, 0x85, 0x85, + 0x85, 0xDA, 0x8D, 0x8A, 0x85, 0xAC, 0x95, 0xD9 +}; + +#define INCLUDE_LINUX_LOGOBW +#define INCLUDE_LINUX_LOGO16 +#include + +#else + +/* prototypes only */ +extern unsigned char linux_logo_red[]; +extern unsigned char linux_logo_green[]; +extern unsigned char linux_logo_blue[]; +extern unsigned char linux_logo[]; +extern unsigned char linux_logo_bw[]; +extern unsigned char linux_logo16_red[]; +extern unsigned char linux_logo16_green[]; +extern unsigned char linux_logo16_blue[]; +extern unsigned char linux_logo16[]; + +#endif diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/mipsregs.h linux/include/asm-mips/mipsregs.h --- v2.1.114/linux/include/asm-mips/mipsregs.h Wed May 20 19:10:41 1998 +++ linux/include/asm-mips/mipsregs.h Tue Aug 4 16:06:57 1998 @@ -8,7 +8,7 @@ * Copyright (C) 1994, 1995, 1996, 1997 by Ralf Baechle * Modified for further R[236]000 support by Paul M. Antoine, 1996. * - * $Id: mipsregs.h,v 1.6 1998/05/01 01:35:58 ralf Exp $ + * $Id: mipsregs.h,v 1.7 1998/05/21 07:37:31 davem Exp $ */ #ifndef __ASM_MIPS_MIPSREGS_H #define __ASM_MIPS_MIPSREGS_H diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/mmu_context.h linux/include/asm-mips/mmu_context.h --- v2.1.114/linux/include/asm-mips/mmu_context.h Thu May 7 22:51:54 1998 +++ linux/include/asm-mips/mmu_context.h Tue Aug 4 16:06:57 1998 @@ -1,11 +1,12 @@ -/* +/* $Id: mmu_context.h,v 1.4 1998/05/07 00:40:04 ralf Exp $ + * * Switch a MMU context. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1996 by Ralf Baechle + * Copyright (C) 1996, 1997, 1998 by Ralf Baechle */ #ifndef __ASM_MIPS_MMU_CONTEXT_H #define __ASM_MIPS_MMU_CONTEXT_H @@ -66,10 +67,10 @@ * After we have set current->mm to a new value, this activates * the context for the new mm so we see the new mappings. */ -extern inline activate_context(struct task_struct *tsk) +extern inline void activate_context(struct task_struct *tsk) { get_mmu_context(tsk); - /* XXX here we presumably need to set some cpu register - paulus. */ + set_entryhi(tsk->mm->context); } #endif /* __ASM_MIPS_MMU_CONTEXT_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/offset.h linux/include/asm-mips/offset.h --- v2.1.114/linux/include/asm-mips/offset.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/offset.h Tue Aug 4 16:06:57 1998 @@ -50,31 +50,31 @@ #define TASK_PRIORITY 56 #define TASK_FLAGS 4 #define TASK_SIGPENDING 8 -#define TASK_MM 928 +#define TASK_MM 936 /* MIPS specific thread_struct offsets. */ -#define THREAD_REG16 568 -#define THREAD_REG17 572 -#define THREAD_REG18 576 -#define THREAD_REG19 580 -#define THREAD_REG20 584 -#define THREAD_REG21 588 -#define THREAD_REG22 592 -#define THREAD_REG23 596 -#define THREAD_REG29 600 -#define THREAD_REG30 604 -#define THREAD_REG31 608 -#define THREAD_STATUS 612 -#define THREAD_FPU 616 -#define THREAD_BVADDR 880 -#define THREAD_BUADDR 884 -#define THREAD_ECODE 888 -#define THREAD_TRAPNO 892 -#define THREAD_PGDIR 896 -#define THREAD_MFLAGS 900 -#define THREAD_CURDS 904 -#define THREAD_TRAMP 908 -#define THREAD_OLDCTX 912 +#define THREAD_REG16 576 +#define THREAD_REG17 580 +#define THREAD_REG18 584 +#define THREAD_REG19 588 +#define THREAD_REG20 592 +#define THREAD_REG21 596 +#define THREAD_REG22 600 +#define THREAD_REG23 604 +#define THREAD_REG29 608 +#define THREAD_REG30 612 +#define THREAD_REG31 616 +#define THREAD_STATUS 620 +#define THREAD_FPU 624 +#define THREAD_BVADDR 888 +#define THREAD_BUADDR 892 +#define THREAD_ECODE 896 +#define THREAD_TRAPNO 900 +#define THREAD_PGDIR 904 +#define THREAD_MFLAGS 908 +#define THREAD_CURDS 912 +#define THREAD_TRAMP 916 +#define THREAD_OLDCTX 920 /* Linux mm_struct offsets. */ #define MM_COUNT 12 diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/pci.h linux/include/asm-mips/pci.h --- v2.1.114/linux/include/asm-mips/pci.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/pci.h Tue Aug 4 16:06:57 1998 @@ -1,18 +1,16 @@ -/* +/* $Id: pci.h,v 1.4 1998/05/08 01:44:30 ralf Exp $ + * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Declarations for the MIPS specific implementation of the PCI BIOS32 services. - * - * $Id: pci.h,v 1.3 1998/05/01 01:36:00 ralf Exp $ */ #ifndef __ASM_MIPS_PCI_H #define __ASM_MIPS_PCI_H struct pci_ops { - unsigned long (*pcibios_fixup) (unsigned long memory_start, - unsigned long memory_end); + unsigned long (*pcibios_fixup) (void); int (*pcibios_read_config_byte) (unsigned char bus, unsigned char dev_fn, unsigned char where, 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 16:06:57 1998 @@ -74,6 +74,7 @@ #define VMALLOC_START KSEG2 #define VMALLOC_VMADDR(x) ((unsigned long)(x)) +#error You need to define VMALLOC_END --DaveM /* Note that we shift the lower 32bits of each EntryLo[01] entry * 6 bits to the left. That way we can convert the PFN into the @@ -488,6 +489,8 @@ return (pgd_t *) page; } + +extern int do_check_pgt_cache(int, int); extern pgd_t swapper_pg_dir[1024]; diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/processor.h linux/include/asm-mips/processor.h --- v2.1.114/linux/include/asm-mips/processor.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/processor.h Tue Aug 4 16:06:57 1998 @@ -5,7 +5,7 @@ * written by Ralf Baechle * Modified further for R[236]000 compatibility by Paul M. Antoine * - * $Id: processor.h,v 1.20 1998/05/04 09:18:59 ralf Exp $ + * $Id: processor.h,v 1.22 1998/05/11 08:40:07 davem Exp $ */ #ifndef __ASM_MIPS_PROCESSOR_H #define __ASM_MIPS_PROCESSOR_H @@ -51,8 +51,7 @@ /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ -#define TASK_UNMAPPED_BASE(off) (TASK_SIZE / 3) -#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr) +#define TASK_UNMAPPED_BASE (TASK_SIZE / 3) /* * Size of io_bitmap in longwords: 32 is ports 0-0x3ff. @@ -152,6 +151,10 @@ /* Free all resources held by a thread. */ extern void release_thread(struct task_struct *); + +/* Copy and release all segment info associated with a VM */ +#define copy_segments(nr, p, mm) do { } while(0) +#define release_segments(mm) do { } while(0) /* * Return saved PC of a blocked thread. diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/serial.h linux/include/asm-mips/serial.h --- v2.1.114/linux/include/asm-mips/serial.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-mips/serial.h Tue Aug 4 16:06:57 1998 @@ -0,0 +1,144 @@ +/* $Id: serial.h,v 1.2 1998/05/08 01:44:31 ralf Exp $ + * + * include/asm-mips/serial.h + */ +#include +#include +#include + +/* + * This assumes you have a 1.8432 MHz clock for your UART. + * + * It'd be nice if someone built a serial card with a 24.576 MHz + * clock, since the 16550A is capable of handling a top speed of 1.5 + * megabits/second; but this requires the faster clock. + */ +#define BASE_BAUD ( 1843200 / 16 ) + +/* Some Jazz machines seem to have an 8MHz crystal clock but I don't know + exactly which ones ... XXX */ +#define JAZZ_BASE_BAUD ( 8000000 / 16 ) /* ( 3072000 / 16) */ + +/* Standard COM flags (except for COM4, because of the 8514 problem) */ +#ifdef CONFIG_SERIAL_DETECT_IRQ +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) +#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) +#else +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) +#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF +#endif + +#ifdef CONFIG_SERIAL_MANY_PORTS +#define FOURPORT_FLAGS ASYNC_FOURPORT +#define ACCENT_FLAGS 0 +#define BOCA_FLAGS 0 +#define HUB6_FLAGS 0 +#endif + +/* + * The following define the access methods for the HUB6 card. All + * access is through two ports for all 24 possible chips. The card is + * selected through the high 2 bits, the port on that card with the + * "middle" 3 bits, and the register on that port with the bottom + * 3 bits. + * + * While the access port and interrupt is configurable, the default + * port locations are 0x302 for the port control register, and 0x303 + * for the data read/write register. Normally, the interrupt is at irq3 + * but can be anything from 3 to 7 inclusive. Note that using 3 will + * require disabling com2. + */ + +#define C_P(card,port) (((card)<<6|(port)<<3) + 1) + +#ifdef CONFIG_MIPS_JAZZ +#define JAZZ_SERIAL_PORT_DEFNS \ + /* UART CLK PORT IRQ FLAGS */ \ + { 0, JAZZ_BASE_BAUD, JAZZ_SERIAL1_BASE, /* ttyS0 */ \ + JAZZ_SERIAL1_IRQ, STD_COM_FLAGS }, \ + { 0, JAZZ_BASE_BAUD, JAZZ_SERIAL2_BASE, /* ttyS1 */ \ + JAZZ_SERIAL2_IRQ, STD_COM_FLAGS }, +#else +#define JAZZ_SERIAL_PORT_DEFNS +#endif + +#define STD_SERIAL_PORT_DEFNS \ + /* UART CLK PORT IRQ FLAGS */ \ + { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ + { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ + { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ + { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ + + +#ifdef CONFIG_SERIAL_MANY_PORTS +#define EXTRA_SERIAL_PORT_DEFNS \ + { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \ + { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \ + { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \ + { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \ + { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \ + { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \ + { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \ + { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \ + { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \ + { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \ + { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \ + { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \ + { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \ + { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \ + { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \ + { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \ + { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \ + { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \ + { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \ + { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \ + { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \ + { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \ + { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \ + { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \ + { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \ + { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \ + { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \ + { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */ +#else +#define EXTRA_SERIAL_PORT_DEFNS +#endif + +/* You can have up to four HUB6's in the system, but I've only + * included two cards here for a total of twelve ports. + */ +#if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS)) +#define HUB6_SERIAL_PORT_DFNS \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS38 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS39 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS40 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS41 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS42 */ \ + { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS43 */ +#else +#define HUB6_SERIAL_PORT_DFNS +#endif + +#ifdef CONFIG_MCA +#define MCA_SERIAL_PORT_DFNS \ + { 0, BASE_BAUD, 0x3220, 3, STD_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x3228, 3, STD_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x4220, 3, STD_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x4228, 3, STD_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x5220, 3, STD_COM_FLAGS }, \ + { 0, BASE_BAUD, 0x5228, 3, STD_COM_FLAGS }, +#else +#define MCA_SERIAL_PORT_DFNS +#endif + +#define SERIAL_PORT_DFNS \ + JAZZ_SERIAL_PORT_DEFNS \ + STD_SERIAL_PORT_DEFNS \ + EXTRA_SERIAL_PORT_DEFNS \ + HUB6_SERIAL_PORT_DFNS diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/system.h linux/include/asm-mips/system.h --- v2.1.114/linux/include/asm-mips/system.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/system.h Tue Aug 4 16:06:57 1998 @@ -1,5 +1,4 @@ -/* - * include/asm-mips/system.h +/* $Id: system.h,v 1.8 1998/05/07 00:40:09 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -7,8 +6,6 @@ * * Copyright (C) 1994, 1995 by Ralf Baechle * Modified further for R[236]000 by Paul M. Antoine, 1996 - * - * $Id: system.h,v 1.7 1998/05/04 09:19:03 ralf Exp $ */ #ifndef __ASM_MIPS_SYSTEM_H #define __ASM_MIPS_SYSTEM_H @@ -114,6 +111,8 @@ __asm__ __volatile__( \ "# prevent instructions being moved around\n\t" \ ".set\tnoreorder\n\t" \ + "# 8 nops to fool the R4400 pipeline\n\t" \ + "nop;nop;nop;nop;nop;nop;nop;nop\n\t" \ ".set\treorder" \ : /* no output */ \ : /* no input */ \ diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/termios.h linux/include/asm-mips/termios.h --- v2.1.114/linux/include/asm-mips/termios.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/termios.h Tue Aug 4 16:06:57 1998 @@ -92,6 +92,7 @@ #define N_STRIP 4 #define N_AX25 5 #define N_X25 6 /* X.25 async */ +#define N_6PACK 7 #ifdef __KERNEL__ diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/unistd.h linux/include/asm-mips/unistd.h --- v2.1.114/linux/include/asm-mips/unistd.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/unistd.h Tue Aug 4 16:06:57 1998 @@ -1190,11 +1190,12 @@ #define __NR_pread (__NR_Linux + 200) #define __NR_pwrite (__NR_Linux + 201) #define __NR_chown (__NR_Linux + 202) +#define __NR_getcwd (__NR_Linux + 203) /* * Offset of the last Linux flavoured syscall */ -#define __NR_Linux_syscalls 202 +#define __NR_Linux_syscalls 203 #ifndef __LANGUAGE_ASSEMBLY__ @@ -1414,8 +1415,6 @@ */ #define __NR__exit __NR_exit static inline _syscall0(int,idle) -static inline _syscall0(int,fork) -static inline _syscall2(int,clone,unsigned long,flags,char *,esp) static inline _syscall0(int,pause) static inline _syscall1(int,setup,int,magic) static inline _syscall0(int,sync) diff -u --recursive --new-file v2.1.114/linux/include/asm-mips/xstat.h linux/include/asm-mips/xstat.h --- v2.1.114/linux/include/asm-mips/xstat.h Fri May 8 23:14:55 1998 +++ linux/include/asm-mips/xstat.h Wed Dec 31 16:00:00 1969 @@ -1,35 +0,0 @@ -/* $Id: xstat.h,v 1.1 1998/02/06 12:51:41 jj Exp $ - * xstat.h: sys_xstat/xmknod architecture dependent stuff. - * - * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -extern __inline__ int cp_xstat(struct inode *inode, struct stat64 *s, unsigned long blocks, int blksize) -{ - struct stat64 tmp; - memset (&tmp, 0, sizeof(tmp)); - tmp.st_dev = (((__u64)MAJOR(inode->i_dev)) << 32) | MINOR(inode->i_dev); - tmp.st_ino = inode->i_ino; - tmp.st_mode = inode->i_mode; - tmp.st_nlink = inode->i_nlink; - tmp.st_uid = inode->i_uid; - tmp.st_gid = inode->i_gid; - tmp.st_rdev = (((__u64)MAJOR(inode->i_rdev)) << 32) | MINOR(inode->i_rdev); - tmp.st_size = inode->i_size; - tmp.st_atim.tv_sec = inode->i_atime; - tmp.st_mtim.tv_sec = inode->i_mtime; - tmp.st_ctim.tv_sec = inode->i_ctime; - tmp.st_blksize = blksize; - tmp.st_blocks = blocks; - /* Should I check if all fs names are < 16? All in the kernel tree are */ - if (inode->i_sb) - strcpy(tmp.st_fstype, inode->i_sb->s_type->name); - return copy_to_user(s,&tmp,sizeof(tmp)); -} - -extern __inline__ int get_user_new_dev_t(kdev_t *kdev, __new_dev_t *udev) { - __new_dev_t ndev; - if (copy_from_user (&ndev, udev, sizeof(__new_dev_t))) return -EFAULT; - *kdev = MKDEV((ndev >> 32), (__u32)ndev); - return 0; -} diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/amigahw.h linux/include/asm-ppc/amigahw.h --- v2.1.114/linux/include/asm-ppc/amigahw.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/amigahw.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1 @@ +#include diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/amigaints.h linux/include/asm-ppc/amigaints.h --- v2.1.114/linux/include/asm-ppc/amigaints.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/amigaints.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1 @@ +#include diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/amigappc.h linux/include/asm-ppc/amigappc.h --- v2.1.114/linux/include/asm-ppc/amigappc.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/amigappc.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1,69 @@ +/* +** asm-m68k/amigappc.h -- This header defines some values and pointers for +** the Phase 5 PowerUp card. +** +** Copyright 1997, 1998 by Phase5, Germany. +** +** This file is subject to the terms and conditions of the GNU General Public +** License. See the file COPYING in the main directory of this archive +** for more details. +** +** Created: 7/22/97 by Jesper Skov +*/ + +#ifndef _M68K_AMIGAPPC_H +#define _M68K_AMIGAPPC_H + +/* Maybe add a [#ifdef WANT_ZTWOBASE] condition to amigahw.h? */ +#define zTwoBase (0x80000000) + +/* At CYBERBASEp we'll find the following sum: + * -KERNELBASE+CyberStormMemoryBase + */ +#define CYBERBASEp (0xfff00000) + +#define APUS_WRITE(a,v) (*((volatile unsigned char *)a) = v) +#define APUS_READ(a) (*((volatile unsigned char *)a)) + +#define APUS_IPL_BASE (zTwoBase + 0x00f60000) +#define APUS_REG_RESET (APUS_IPL_BASE + 0x00) +#define APUS_REG_WAITSTATE (APUS_IPL_BASE + 0x10) +#define APUS_REG_SHADOW (APUS_IPL_BASE + 0x18) +#define APUS_REG_LOCK (APUS_IPL_BASE + 0x20) +#define APUS_REG_INT (APUS_IPL_BASE + 0x28) +#define APUS_IPL_EMU (APUS_IPL_BASE + 0x30) + +#define REGSHADOW_SETRESET (0x80) +#define REGSHADOW_SELFRESET (0x40) + +#define REGLOCK_SETRESET (0x80) +#define REGLOCK_BLACKMAGICK1 (0x40) +#define REGLOCK_BLACKMAGICK2 (0x20) +#define REGLOCK_BLACKMAGICK3 (0x10) + +#define REGWAITSTATE_SETRESET (0x80) +#define REGWAITSTATE_PPCW (0x08) +#define REGWAITSTATE_PPCR (0x04) + +#define REGRESET_SETRESET (0x80) +#define REGRESET_PPCRESET (0x10) +#define REGRESET_M68KRESET (0x08) +#define REGRESET_AMIGARESET (0x04) +#define REGRESET_AUXRESET (0x02) +#define REGRESET_SCSIRESET (0x01) + +#define REGINT_SETRESET (0x80) +#define REGINT_ENABLEIPL (0x02) +#define REGINT_INTMASTER (0x01) + +#define IPLEMU_SETRESET (0x80) +#define IPLEMU_DISABLEINT (0x40) +#define IPLEMU_IPL2 (0x20) +#define IPLEMU_IPL1 (0x10) +#define IPLEMU_IPL0 (0x08) +#define IPLEMU_PPCIPL2 (0x04) +#define IPLEMU_PPCIPL1 (0x02) +#define IPLEMU_PPCIPL0 (0x01) +#define IPLEMU_IPLMASK (IPLEMU_PPCIPL2|IPLEMU_PPCIPL1|IPLEMU_PPCIPL0) + +#endif /* _M68k_AMIGAPPC_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/bitops.h linux/include/asm-ppc/bitops.h --- v2.1.114/linux/include/asm-ppc/bitops.h Tue Jul 21 00:15:33 1998 +++ linux/include/asm-ppc/bitops.h Tue Aug 4 16:06:36 1998 @@ -1,5 +1,5 @@ /* - * $Id: bitops.h,v 1.7 1997/08/03 00:12:07 paulus Exp $ + * $Id: bitops.h,v 1.9 1998/07/26 03:05:28 davem Exp $ * bitops.h: Bit string operations on the ppc */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/bootinfo.h linux/include/asm-ppc/bootinfo.h --- v2.1.114/linux/include/asm-ppc/bootinfo.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/bootinfo.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1,375 @@ +/* +** asm/bootinfo.h -- Definition of the Linux/m68k boot information structure +** +** Copyright 1992 by Greg Harp +** +** This file is subject to the terms and conditions of the GNU General Public +** License. See the file COPYING in the main directory of this archive +** for more details. +** +** Created 09/29/92 by Greg Harp +** +** 5/2/94 Roman Hodek: +** Added bi_atari part of the machine dependent union bi_un; for now it +** contains just a model field to distinguish between TT and Falcon. +** 26/7/96 Roman Zippel: +** Renamed to setup.h; added some useful macros to allow gcc some +** optimizations if possible. +** 5/10/96 Geert Uytterhoeven: +** Redesign of the boot information structure; renamed to bootinfo.h again +** 27/11/96 Geert Uytterhoeven: +** Backwards compatibility with bootinfo interface version 1.0 +*/ + +#ifndef _BOOTINFO_H +#define _BOOTINFO_H + + + /* + * Bootinfo definitions + * + * This is an easily parsable and extendable structure containing all + * information to be passed from the bootstrap to the kernel. + * + * This way I hope to keep all future changes back/forewards compatible. + * Thus, keep your fingers crossed... + * + * This structure is copied right after the kernel bss by the bootstrap + * routine. + */ + +#ifndef __ASSEMBLY__ + +struct bi_record { + unsigned short tag; /* tag ID */ + unsigned short size; /* size of record (in bytes) */ + unsigned long data[0]; /* data */ +}; + +#else /* __ASSEMBLY__ */ + +BIR_tag = 0 +BIR_size = BIR_tag+2 +BIR_data = BIR_size+2 + +#endif /* __ASSEMBLY__ */ + + + /* + * Tag Definitions + * + * Machine independent tags start counting from 0x0000 + * Machine dependent tags start counting from 0x8000 + */ + +#define BI_LAST 0x0000 /* last record (sentinel) */ +#define BI_MACHTYPE 0x0001 /* machine type (u_long) */ +#define BI_CPUTYPE 0x0002 /* cpu type (u_long) */ +#define BI_FPUTYPE 0x0003 /* fpu type (u_long) */ +#define BI_MMUTYPE 0x0004 /* mmu type (u_long) */ +#define BI_MEMCHUNK 0x0005 /* memory chunk address and size */ + /* (struct mem_info) */ +#define BI_RAMDISK 0x0006 /* ramdisk address and size */ + /* (struct mem_info) */ +#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */ + /* (string) */ + + /* + * Amiga-specific tags + */ + +#define BI_AMIGA_MODEL 0x8000 /* model (u_long) */ +#define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */ + /* (struct ConfigDev) */ +#define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */ +#define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */ +#define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */ +#define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */ +#define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */ +#define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */ + + /* + * Atari-specific tags + */ + +#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */ +#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */ + /* (values are ATARI_MACH_* defines */ + +/* mch_cookie values (upper word) */ +#define ATARI_MCH_ST 0 +#define ATARI_MCH_STE 1 +#define ATARI_MCH_TT 2 +#define ATARI_MCH_FALCON 3 + +/* mch_type values */ +#define ATARI_MACH_NORMAL 0 /* no special machine type */ +#define ATARI_MACH_MEDUSA 1 /* Medusa 040 */ +#define ATARI_MACH_HADES 2 /* Hades 040 or 060 */ +#define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */ + + /* + * Macintosh-specific tags (all u_long) + */ + +#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */ +#define BI_MAC_VADDR 0x8001 /* Mac video base address */ +#define BI_MAC_VDEPTH 0x8002 /* Mac video depth */ +#define BI_MAC_VROW 0x8003 /* Mac video rowbytes */ +#define BI_MAC_VDIM 0x8004 /* Mac video dimensions */ +#define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */ +#define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */ +#define BI_MAC_BTIME 0x8007 /* Mac boot time */ +#define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */ +#define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */ +#define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */ +#define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */ + + /* + * Macintosh hardware profile data - unused, see macintosh.h for + * resonable type values + */ + +#define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */ +#define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */ +#define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */ +#define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */ +#define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */ +#define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */ +#define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */ +#define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */ +#define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */ +#define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */ +#define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */ +#define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */ +#define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */ +#define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */ +#define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */ +#define BI_MAC_PMU 0x801f /* Mac power managment / poweroff hardware */ +#define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */ +#define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */ + + /* + * Mac: compatibility with old booter data format (temporarily) + * Fields unused with the new bootinfo can be deleted now; instead of + * adding new fields the struct might be splitted into a hardware address + * part and a hardware type part + */ + +#ifndef __ASSEMBLY__ + +struct mac_booter_data +{ + unsigned long videoaddr; + unsigned long videorow; + unsigned long videodepth; + unsigned long dimensions; + unsigned long args; + unsigned long boottime; + unsigned long gmtbias; + unsigned long bootver; + unsigned long videological; + unsigned long sccbase; + unsigned long id; + unsigned long memsize; + unsigned long serialmf; + unsigned long serialhsk; + unsigned long serialgpi; + unsigned long printmf; + unsigned long printhsk; + unsigned long printgpi; + unsigned long cpuid; + unsigned long rombase; + unsigned long adbdelay; + unsigned long timedbra; +}; + +extern struct mac_booter_data + mac_bi_data; + +#endif + + /* + * Stuff for bootinfo interface versioning + * + * At the start of kernel code, a 'struct bootversion' is located. + * bootstrap checks for a matching version of the interface before booting + * a kernel, to avoid user confusion if kernel and bootstrap don't work + * together :-) + * + * If incompatible changes are made to the bootinfo interface, the major + * number below should be stepped (and the minor reset to 0) for the + * appropriate machine. If a change is backward-compatible, the minor + * should be stepped. "Backwards-compatible" means that booting will work, + * but certain features may not. + */ + +#define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */ +#define MK_BI_VERSION(major,minor) (((major)<<16)+(minor)) +#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff) +#define BI_VERSION_MINOR(v) ((v) & 0xffff) + +#ifndef __ASSEMBLY__ + +struct bootversion { + unsigned short branch; + unsigned long magic; + struct { + unsigned long machtype; + unsigned long version; + } machversions[0]; +}; + +#endif /* __ASSEMBLY__ */ + +#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) +#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 ) +#define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) +#define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) +#define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) + + +#ifdef BOOTINFO_COMPAT_1_0 + + /* + * Backwards compatibility with bootinfo interface version 1.0 + */ + +#define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) +#define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) +#define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) + +#include + +#define COMPAT_NUM_AUTO 16 + +struct compat_bi_Amiga { + int model; + int num_autocon; + struct ConfigDev autocon[COMPAT_NUM_AUTO]; + unsigned long chip_size; + unsigned char vblank; + unsigned char psfreq; + unsigned long eclock; + unsigned long chipset; + unsigned long hw_present; +}; + +struct compat_bi_Atari { + unsigned long hw_present; + unsigned long mch_cookie; +}; + +#ifndef __ASSEMBLY__ + +#define MACHW_DECLARE(name) unsigned name : 1 +#define MACHW_SET(name) (boot_info.bi_mac.hw_present.name = 1) +#define MACHW_PRESENT(name) (boot_info.bi_mac.hw_present.name) + +struct compat_bi_Macintosh +{ + unsigned long videoaddr; + unsigned long videorow; + unsigned long videodepth; + unsigned long dimensions; + unsigned long args; + unsigned long boottime; + unsigned long gmtbias; + unsigned long bootver; + unsigned long videological; + unsigned long sccbase; + unsigned long id; + unsigned long memsize; + unsigned long serialmf; + unsigned long serialhsk; + unsigned long serialgpi; + unsigned long printmf; + unsigned long printhsk; + unsigned long printgpi; + unsigned long cpuid; + unsigned long rombase; + unsigned long adbdelay; + unsigned long timedbra; + struct { + /* video hardware */ + /* sound hardware */ + /* disk storage interfaces */ + MACHW_DECLARE(MAC_SCSI); /* Directly mapped NCR5380 */ + MACHW_DECLARE(IDE); /* IDE Interface */ + /* other I/O hardware */ + MACHW_DECLARE(SCC); /* Serial Communications Contr. */ + /* DMA */ + MACHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */ + /* real time clocks */ + MACHW_DECLARE(RTC_CLK); /* clock chip */ + /* supporting hardware */ + MACHW_DECLARE(VIA1); /* Versatile Interface Ad. 1 */ + MACHW_DECLARE(VIA2); /* Versatile Interface Ad. 2 */ + MACHW_DECLARE(RBV); /* Versatile Interface Ad. 2+ */ + /* NUBUS */ + MACHW_DECLARE(NUBUS); /* NUBUS */ + } hw_present; +}; +#else + +#define BI_videoaddr BI_un +#define BI_videorow BI_videoaddr+4 +#define BI_videodepth BI_videorow+4 +#define BI_dimensions BI_videodepth+4 +#define BI_args BI_dimensions+4 +#define BI_cpuid BI_args+56 + +#endif + +struct compat_mem_info { + unsigned long addr; + unsigned long size; +}; + +#define COMPAT_NUM_MEMINFO 4 + +#define COMPAT_CPUB_68020 0 +#define COMPAT_CPUB_68030 1 +#define COMPAT_CPUB_68040 2 +#define COMPAT_CPUB_68060 3 +#define COMPAT_FPUB_68881 5 +#define COMPAT_FPUB_68882 6 +#define COMPAT_FPUB_68040 7 +#define COMPAT_FPUB_68060 8 + +#define COMPAT_CPU_68020 (1< #ifdef __GNUC__ -extern inline unsigned ld_le16(volatile unsigned short *addr) +extern __inline__ unsigned ld_le16(volatile unsigned short *addr) { unsigned val; - asm volatile("lhbrx %0,0,%1" : "=r" (val) : "r" (addr)); + __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr)); return val; } -extern inline void st_le16(volatile unsigned short *addr, unsigned val) +extern __inline__ void st_le16(volatile unsigned short *addr, unsigned val) { - asm volatile("sthbrx %0,0,%1" : : "r" (val), "r" (addr) : "memory"); + __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); } -extern inline unsigned ld_le32(volatile unsigned *addr) +extern __inline__ unsigned ld_le32(volatile unsigned *addr) { unsigned val; - asm volatile("lwbrx %0,0,%1" : "=r" (val) : "r" (addr)); + __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr)); return val; } -extern inline void st_le32(volatile unsigned *addr, unsigned val) +extern __inline__ void st_le32(volatile unsigned *addr, unsigned val) { - asm volatile("stwbrx %0,0,%1" : : "r" (val), "r" (addr) : "memory"); + __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); } /* alas, egcs sounds like it has a bug in this code that doesn't use the @@ -43,7 +47,7 @@ { __u16 result; - asm("rlwimi %0,%1,8,16,23" + __asm__("rlwimi %0,%1,8,16,23" : "=r" (result) : "r" (value), "0" (value >> 8)); return result; @@ -53,7 +57,7 @@ { __u32 result; - asm("rlwimi %0,%1,24,16,23\n\t" + __asm__("rlwimi %0,%1,24,16,23\n\t" "rlwimi %0,%1,8,8,15\n\t" "rlwimi %0,%1,24,0,7" : "=r" (result) @@ -76,6 +80,9 @@ #endif /* __GNUC__ */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#define __BYTEORDER_HAS_U64__ +#endif #include #endif /* _PPC_BYTEORDER_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/cache.h linux/include/asm-ppc/cache.h --- v2.1.114/linux/include/asm-ppc/cache.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/cache.h Tue Aug 4 16:06:36 1998 @@ -46,7 +46,16 @@ } #endif /* __ASSEMBLY__ */ - + +/* prep registers for L2 */ +#define CACHECRBA 0x80000823 /* Cache configuration register address */ +#define L2CACHE_MASK 0x03 /* Mask for 2 L2 Cache bits */ +#define L2CACHE_512KB 0x00 /* 512KB */ +#define L2CACHE_256KB 0x01 /* 256KB */ +#define L2CACHE_1MB 0x02 /* 1MB */ +#define L2CACHE_NONE 0x03 /* NONE */ +#define L2CACHE_PARITY 0x08 /* Mask for L2 Cache Parity Protected bit */ + #ifdef CONFIG_8xx /* Cache control on the MPC8xx is provided through some additional * special purpose registers. diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/delay.h linux/include/asm-ppc/delay.h --- v2.1.114/linux/include/asm-ppc/delay.h Mon Jan 12 15:18:13 1998 +++ linux/include/asm-ppc/delay.h Tue Aug 4 16:06:36 1998 @@ -10,6 +10,8 @@ * 2 of the License, or (at your option) any later version. */ +extern unsigned long loops_per_sec; + extern __inline__ void __delay(unsigned int loops) { if (loops != 0) diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/dma.h linux/include/asm-ppc/dma.h --- v2.1.114/linux/include/asm-ppc/dma.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/dma.h Tue Aug 4 16:06:36 1998 @@ -374,6 +374,7 @@ } /* These are in kernel/dma.c: */ +extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */ extern void free_dma(unsigned int dmanr); /* release it again */ #endif /* _ASM_DMA_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/ide.h linux/include/asm-ppc/ide.h --- v2.1.114/linux/include/asm-ppc/ide.h Thu May 7 22:51:54 1998 +++ linux/include/asm-ppc/ide.h Tue Aug 4 16:06:36 1998 @@ -11,6 +11,31 @@ #ifndef __ASMPPC_IDE_H #define __ASMPPC_IDE_H +#include +#ifdef CONFIG_APUS +#include +#include +void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq); +void ide_insw(ide_ioreg_t port, void *buf, int ns); +void ide_outsw(ide_ioreg_t port, void *buf, int ns); +#undef insw +#define insw(port, buf, ns) do { \ + if ( _machine != _MACH_Pmac && _machine != _MACH_apus ) \ + /* this must be the same as insw in io.h!! */ \ + _insw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \ + else \ + ide_insw((port), (buf), (ns)); \ +} while (0) +#undef outsw +#define outsw(port, buf, ns) do { \ + if ( _machine != _MACH_Pmac && _machine != _MACH_apus ) \ + /* this must be the same as outsw in io.h!! */ \ + _outsw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \ + else \ + ide_outsw((port), (buf), (ns)); \ +} while (0) +#else /* CONFIG_APUS */ + #ifdef __KERNEL__ #include @@ -186,5 +211,6 @@ #define ide_get_lock(lock, hdlr, data) do {} while (0) #endif /* __KERNEL__ */ +#endif /* CONFIG_APUS */ #endif /* __ASMPPC_IDE_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/io.h linux/include/asm-ppc/io.h --- v2.1.114/linux/include/asm-ppc/io.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/io.h Tue Aug 4 16:06:36 1998 @@ -22,6 +22,9 @@ #define PMAC_ISA_MEM_BASE 0 #define PMAC_PCI_DRAM_OFFSET 0 +#define APUS_ISA_IO_BASE 0 +#define APUS_ISA_MEM_BASE 0 +#define APUS_PCI_DRAM_OFFSET 0 #define CHRP_ISA_IO_BASE 0xf8000000 #define CHRP_ISA_MEM_BASE 0xf7000000 #define CHRP_PCI_DRAM_OFFSET 0 @@ -30,47 +33,32 @@ /*#define PREP_ISA_MEM_BASE 0xc0000000*/ #define PREP_PCI_DRAM_OFFSET 0x80000000 -#if defined(CONFIG_MACH_SPECIFIC) -#ifdef CONFIG_PREP -#define _IO_BASE PREP_ISA_IO_BASE -#define _ISA_MEM_BASE PREP_ISA_MEM_BASE -#define PCI_DRAM_OFFSET PREP_PCI_DRAM_OFFSET -#endif /* CONFIG_PREP */ - -#ifdef CONFIG_CHRP -#define _IO_BASE CHRP_ISA_IO_BASE -#define _ISA_MEM_BASE CHRP_ISA_MEM_BASE -#define PCI_DRAM_OFFSET CHRP_PCI_DRAM_OFFSET -#endif /* CONFIG_CHRP */ - -#ifdef CONFIG_PMAC -extern unsigned long isa_io_base; -#define _IO_BASE isa_io_base /* well, PCI i/o base really */ -#define _ISA_MEM_BASE PMAC_ISA_MEM_BASE -#define PCI_DRAM_OFFSET PMAC_PCI_DRAM_OFFSET -#endif /* CONFIG_PMAC */ - #ifdef CONFIG_MBX #define _IO_BASE 0 #define _ISA_MEM_BASE 0 #define PCI_DRAM_OFFSET 0x80000000 -#endif /* CONFIG_MBX8xx */ - -#else /* CONFIG_MACH_SPECIFIC */ +#else /* CONFIG_MBX8xx */ extern unsigned long isa_io_base; -#define _IO_BASE isa_io_base extern unsigned long isa_mem_base; -#define _ISA_MEM_BASE isa_mem_base -#undef PCI_DRAM_OFFSET -#define PCI_DRAM_OFFSET pci_dram_offset extern unsigned long pci_dram_offset; -#endif /* CONFIG_MACH_SPECIFIC */ +#define _IO_BASE isa_io_base +#define _ISA_MEM_BASE isa_mem_base +#define PCI_DRAM_OFFSET pci_dram_offset +#endif /* CONFIG_MBX8xx */ + #define readb(addr) (*(volatile unsigned char *) (addr)) +#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b)) +#if defined(CONFIG_APUS) +#define readw(addr) (*(volatile unsigned short *) (addr)) +#define readl(addr) (*(volatile unsigned int *) (addr)) +#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b)) +#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b)) +#else #define readw(addr) ld_le16((volatile unsigned short *)(addr)) #define readl(addr) ld_le32((volatile unsigned *)addr) -#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b)) #define writew(b,addr) st_le16((volatile unsigned short *)(addr),(b)) #define writel(b,addr) st_le32((volatile unsigned *)(addr),(b)) +#endif #define insb(port, buf, ns) _insb((unsigned char *)((port)+_IO_BASE), (buf), (ns)) #define outsb(port, buf, ns) _outsb((unsigned char *)((port)+_IO_BASE), (buf), (ns)) @@ -81,10 +69,17 @@ #define inb(port) in_8((unsigned char *)((port)+_IO_BASE)) #define outb(val, port) out_8((unsigned char *)((port)+_IO_BASE), (val)) +#if defined(CONFIG_APUS) +#define inw(port) in_be16((unsigned short *)((port)+_IO_BASE)) +#define outw(val, port) out_be16((unsigned short *)((port)+_IO_BASE), (val)) +#define inl(port) in_be32((unsigned *)((port)+_IO_BASE)) +#define outl(val, port) out_be32((unsigned *)((port)+_IO_BASE), (val)) +#else #define inw(port) in_le16((unsigned short *)((port)+_IO_BASE)) #define outw(val, port) out_le16((unsigned short *)((port)+_IO_BASE), (val)) #define inl(port) in_le32((unsigned *)((port)+_IO_BASE)) #define outl(val, port) out_le32((unsigned *)((port)+_IO_BASE), (val)) +#endif #define inb_p(port) in_8((unsigned char *)((port)+_IO_BASE)) #define outb_p(val, port) out_8((unsigned char *)((port)+_IO_BASE), (val)) @@ -100,12 +95,38 @@ extern void _insl(volatile unsigned long *port, void *buf, int nl); extern void _outsl(volatile unsigned long *port, const void *buf, int nl); +/* + * The *_ns versions below don't do byte-swapping. + */ +#define insw_ns(port, buf, ns) _insw_ns((unsigned short *)((port)+_IO_BASE), (buf), (ns)) +#define outsw_ns(port, buf, ns) _outsw_ns((unsigned short *)((port)+_IO_BASE), (buf), (ns)) +#define insl_ns(port, buf, nl) _insl_ns((unsigned long *)((port)+_IO_BASE), (buf), (nl)) +#define outsl_ns(port, buf, nl) _outsl_ns((unsigned long *)((port)+_IO_BASE), (buf), (nl)) + +extern void _insw_ns(volatile unsigned short *port, void *buf, int ns); +extern void _outsw_ns(volatile unsigned short *port, const void *buf, int ns); +extern void _insl_ns(volatile unsigned long *port, void *buf, int nl); +extern void _outsl_ns(volatile unsigned long *port, const void *buf, int nl); + #define memset_io(a,b,c) memset((a),(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),(b),(c)) #define memcpy_toio(a,b,c) memcpy((a),(b),(c)) #ifdef __KERNEL__ /* + * Map in an area of physical address space, for accessing + * I/O devices etc. + */ +extern void *__ioremap(unsigned long address, unsigned long size, + unsigned long flags); +extern void *ioremap(unsigned long address, unsigned long size); +extern void iounmap(void *addr); +extern unsigned long iopa(unsigned long addr); +#ifdef CONFIG_APUS +extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); +#endif + +/* * The PCI bus is inherently Little-Endian. The PowerPC is being * run Big-Endian. Thus all values which cross the [PCI] barrier * must be endian-adjusted. Also, the local DRAM has a different @@ -114,40 +135,62 @@ */ extern inline unsigned long virt_to_bus(volatile void * address) { +#ifndef CONFIG_APUS if (address == (void *)0) return 0; return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET; +#else + return iopa ((unsigned long) address); +#endif } extern inline void * bus_to_virt(unsigned long address) { +#ifndef CONFIG_APUS if (address == 0) return 0; return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE); +#else + return (void*) mm_ptov (address); +#endif } /* - * Map in an area of physical address space, for accessing - * I/O devices etc. - */ -extern void *__ioremap(unsigned long address, unsigned long size, - unsigned long flags); -extern void *ioremap(unsigned long address, unsigned long size); -extern void iounmap(void *addr); -extern unsigned long iopa(unsigned long addr); - -/* * Change virtual addresses to physical addresses and vv, for * addresses in the area where the kernel has the RAM mapped. */ extern inline unsigned long virt_to_phys(volatile void * address) { +#ifndef CONFIG_APUS return (unsigned long) address - KERNELBASE; +#else + return iopa ((unsigned long) address); +#endif } extern inline void * phys_to_virt(unsigned long address) { +#ifndef CONFIG_APUS return (void *) (address + KERNELBASE); +#else + return (void*) mm_ptov (address); +#endif +} + +static inline int check_signature(unsigned long io_addr, + const unsigned char *signature, int length) +{ + int retval = 0; + do { + if (readb(io_addr) != *signature) + goto out; + io_addr++; + signature++; + length--; + } while (length); + retval = 1; +out: + return retval; } #endif /* __KERNEL__ */ @@ -159,7 +202,7 @@ */ extern inline void eieio(void) { - asm volatile ("eieio" : :); + __asm__ __volatile__ ("eieio" : : : "memory" ); } /* @@ -169,23 +212,26 @@ { int ret; + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); ret = *addr; - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); return ret; } extern inline void out_8(volatile unsigned char *addr, int val) { + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); *addr = val; - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); } extern inline int in_le16(volatile unsigned short *addr) { int ret; + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); ret = ld_le16(addr); - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); return ret; } @@ -193,29 +239,33 @@ { int ret; + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); ret = *addr; - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); return ret; } extern inline void out_le16(volatile unsigned short *addr, int val) { + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); st_le16(addr, val); - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); } extern inline void out_be16(volatile unsigned short *addr, int val) { + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); *addr = val; - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); } extern inline unsigned in_le32(volatile unsigned *addr) { unsigned ret; + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); ret = ld_le32(addr); - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); return ret; } @@ -223,21 +273,24 @@ { int ret; + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); ret = *addr; - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); return ret; } extern inline void out_le32(volatile unsigned *addr, int val) { + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); st_le32(addr, val); - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); } extern inline void out_be32(volatile unsigned *addr, int val) { + __asm__ __volatile__ ("" : "=m" (*addr) : "0" (*addr) ); *addr = val; - eieio(); + __asm__ __volatile__ ("eieio" : "=m" (*addr) : "0" (*addr) ); } #endif diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/irq.h linux/include/asm-ppc/irq.h --- v2.1.114/linux/include/asm-ppc/irq.h Fri May 8 23:14:56 1998 +++ linux/include/asm-ppc/irq.h Tue Aug 4 16:06:36 1998 @@ -6,12 +6,18 @@ #include /* for is_prep() */ #ifndef CONFIG_8xx + +#ifdef CONFIG_APUS +#include +#else /* CONFIG_APUS */ + /* * this is the # irq's for all ppc arch's (pmac/chrp/prep) - * so it is the max of them all - which happens to be chrp - * -- Cort + * so it is the max of them all - which happens to be powermac + * at present (G3 powermacs have 64). */ -#define NR_IRQS (NUM_8259_INTERRUPTS+NUM_OPENPIC_INTERRUPTS) +#define NR_IRQS 64 +#endif /* CONFIG_APUS */ #define NUM_8259_INTERRUPTS 16 #define NUM_OPENPIC_INTERRUPTS 20 @@ -23,6 +29,7 @@ extern void disable_irq(unsigned int); extern void enable_irq(unsigned int); +#ifndef CONFIG_APUS /* * This gets called from serial.c, which is now used on * powermacs as well as prep/chrp boxes. @@ -32,7 +39,7 @@ { return (((is_prep || is_chrp) && irq == 2) ? 9 : irq); } - +#endif #else /* CONFIG_8xx */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/keyboard.h linux/include/asm-ppc/keyboard.h --- v2.1.114/linux/include/asm-ppc/keyboard.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/keyboard.h Tue Aug 4 16:06:36 1998 @@ -18,6 +18,10 @@ #include #include +#ifdef CONFIG_APUS +#include +#else + #define KEYBOARD_IRQ 1 #define DISABLE_KBD_DURING_INTERRUPTS 0 #define INIT_KBD @@ -167,6 +171,8 @@ else mackbd_init_hw(); } + +#endif /* CONFIG_APUS */ #endif /* __KERNEL__ */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/linux_logo.h linux/include/asm-ppc/linux_logo.h --- v2.1.114/linux/include/asm-ppc/linux_logo.h Thu Jul 16 18:09:29 1998 +++ linux/include/asm-ppc/linux_logo.h Tue Aug 4 16:06:36 1998 @@ -17,10 +17,11 @@ #define LINUX_LOGO_HEIGHT 80 #define LINUX_LOGO_WIDTH 80 -#define LINUX_LOGO_COLORS 221 +#define LINUX_LOGO_COLORS 214 #ifdef INCLUDE_LINUX_LOGO_DATA +#define INCLUDE_LINUX_LOGOBW #define INCLUDE_LINUX_LOGO16 #include diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/machdep.h linux/include/asm-ppc/machdep.h --- v2.1.114/linux/include/asm-ppc/machdep.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/machdep.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1,12 @@ +#ifndef _PPC_MACHDEP_H +#define _PPC_MACHDEP_H + +#include + +#ifdef CONFIG_APUS +#include +#endif + +#endif /* _PPC_MACHDEP_H */ + + diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/page.h linux/include/asm-ppc/page.h --- v2.1.114/linux/include/asm-ppc/page.h Fri May 8 23:14:56 1998 +++ linux/include/asm-ppc/page.h Tue Aug 4 16:06:36 1998 @@ -64,8 +64,6 @@ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) -#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) -#define free_user_page(page, addr) free_page(addr) #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) /* map phys->virtual and virtual->phys for RAM pages */ @@ -82,8 +80,7 @@ #define MAP_NR(addr) (((unsigned long)addr-PAGE_OFFSET) >> PAGE_SHIFT) #define MAP_PAGE_RESERVED (1<<15) -extern unsigned long get_prezerod_page(void); - +extern unsigned long get_zero_page_fast(void); #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ #endif /* _PPC_PAGE_H */ 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 16:06:36 1998 @@ -7,6 +7,7 @@ #include #include /* For TASK_SIZE */ #include +#include extern void local_flush_tlb_all(void); extern void local_flush_tlb_mm(struct mm_struct *mm); @@ -14,17 +15,10 @@ extern void local_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end); -#ifndef __SMP__ -#define flush_tlb_all local_flush_tlb_all -#define flush_tlb_mm local_flush_tlb_mm -#define flush_tlb_page local_flush_tlb_page -#define flush_tlb_range local_flush_tlb_range -#else /* __SMP__ */ #define flush_tlb_all local_flush_tlb_all #define flush_tlb_mm local_flush_tlb_mm #define flush_tlb_page local_flush_tlb_page #define flush_tlb_range local_flush_tlb_range -#endif /* __SMP__ */ /* * No cache flushing is required when address mappings are @@ -110,6 +104,7 @@ #define VMALLOC_OFFSET (0x4000000) /* 64M */ #define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))) #define VMALLOC_VMADDR(x) ((unsigned long)(x)) +#define VMALLOC_END 0xf0000000 /* * Bits in a linux-style PTE. These match the bits in the @@ -370,36 +365,61 @@ /* - * Allocate and free page tables. The xxx_kernel() versions are - * used to allocate a kernel page table, but are actually identical - * to the xxx() versions. + * This is handled very differently on the PPC since out page tables + * are all 0's and I want to be able to use these zero'd pages elsewhere + * as well - it gives us quite a speedup. + * + * Note that the SMP/UP versions are the same since we don't need a + * per cpu list of zero pages since we do the zero-ing with the cache + * off and the access routines are lock-free but the pgt cache stuff + * _IS_ per-cpu since it isn't done with any lock-free access routines + * (although I think we need arch-specific routines so I can do lock-free). + * + * I need to generalize this so we can use it for other arch's as well. + * -- Cort */ -#ifdef __SMP__ -/* Sliiiicck */ -#define pgd_quicklist (cpu_data[smp_processor_id()].pgd_quick) -#define pmd_quicklist ((unsigned long *)0) -#define pte_quicklist (cpu_data[smp_processor_id()].pte_quick) -#define pgtable_cache_size (cpu_data[smp_processor_id()].pgtable_cache_sz) -#else extern struct pgtable_cache_struct { unsigned long *pgd_cache; unsigned long *pte_cache; unsigned long pgtable_cache_sz; + unsigned long *zero_cache; /* head linked list of pre-zero'd pages */ + unsigned long zero_sz; /* # currently pre-zero'd pages */ + unsigned long zeropage_hits; /* # zero'd pages request that we've done */ + unsigned long zeropage_calls; /* # zero'd pages request that've been made */ + unsigned long zerototal; /* # pages zero'd over time */ } quicklists; + +#ifdef __SMP__ +/*#warning Tell Cort to do the pgt cache for SMP*/ #define pgd_quicklist (quicklists.pgd_cache) #define pmd_quicklist ((unsigned long *)0) #define pte_quicklist (quicklists.pte_cache) #define pgtable_cache_size (quicklists.pgtable_cache_sz) -#endif +#else /* __SMP__ */ +#define pgd_quicklist (quicklists.pgd_cache) +#define pmd_quicklist ((unsigned long *)0) +#define pte_quicklist (quicklists.pte_cache) +#define pgtable_cache_size (quicklists.pgtable_cache_sz) +#endif /* __SMP__ */ +#define zero_quicklist (quicklists.zero_cache) +#define zero_cache_sz (quicklists.zero_sz) + +/* return a pre-zero'd page from the list, return NULL if none available -- Cort */ +extern unsigned long get_zero_page_fast(void); extern __inline__ pgd_t *get_pgd_slow(void) { - pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL), *init; + pgd_t *ret/* = (pgd_t *)__get_free_page(GFP_KERNEL)*/, *init; + if ( (ret = (pgd_t *)get_zero_page_fast()) == NULL ) + { + ret = (pgd_t *)__get_free_page(GFP_KERNEL); + memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); + } if (ret) { init = pgd_offset(&init_mm, 0); - memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); + /*memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));*/ memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); } @@ -441,7 +461,7 @@ pte_quicklist = (unsigned long *)(*ret); ret[0] = ret[1]; pgtable_cache_size--; - } + } return (pte_t *)ret; } @@ -513,6 +533,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; @@ -588,7 +610,31 @@ #define module_map vmalloc #define module_unmap vfree -#define module_shrink vshrink + +/* CONFIG_APUS */ +/* For virtual address to physical address conversion */ +extern void cache_clear(__u32 addr, int length); +extern void cache_push(__u32 addr, int length); +extern int mm_end_of_chunk (unsigned long addr, int len); +extern unsigned long iopa(unsigned long addr); +extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); +#define VTOP(addr) (iopa((unsigned long)(addr))) +#define PTOV(addr) (mm_ptov((unsigned long)(addr))) + +/* Values for nocacheflag and cmode */ +/* These are not used by the APUS kernel_map, but prevents + compilation errors. */ +#define KERNELMAP_FULL_CACHING 0 +#define KERNELMAP_NOCACHE_SER 1 +#define KERNELMAP_NOCACHE_NONSER 2 +#define KERNELMAP_NO_COPYBACK 3 + +/* + * Map some physical address range into the kernel address space. + */ +extern unsigned long kernel_map(unsigned long paddr, unsigned long size, + int nocacheflag, unsigned long *memavailp ); + /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define PageSkip(page) (0) diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/pmu.h linux/include/asm-ppc/pmu.h --- v2.1.114/linux/include/asm-ppc/pmu.h Fri May 8 23:14:56 1998 +++ linux/include/asm-ppc/pmu.h Tue Aug 4 16:06:36 1998 @@ -36,6 +36,14 @@ #define PMU_INT_ADB 0x10 /* ADB autopoll or reply data */ #define PMU_INT_TICK 0x80 /* 1-second tick interrupt */ + +/* + * Ioctl commands for the /dev/pmu device + */ +#include + +#define PMU_IOC_SLEEP _IO('B', 0) + #ifdef __KERNEL__ void find_via_pmu(void); void via_pmu_init(void); @@ -45,5 +53,16 @@ void pmu_poll(void); void pmu_enable_backlight(int on); + +/* + * Stuff for putting the powerbook to sleep and waking it again. + */ +#include + +extern struct notifier_block *sleep_notifier_list; + +/* code values for calling sleep/wakeup handlers */ +#define PBOOK_SLEEP 1 +#define PBOOK_WAKE 2 #endif /* __KERNEL */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/posix_types.h linux/include/asm-ppc/posix_types.h --- v2.1.114/linux/include/asm-ppc/posix_types.h Mon Dec 8 23:58:04 1997 +++ linux/include/asm-ppc/posix_types.h Tue Aug 4 16:06:36 1998 @@ -43,6 +43,7 @@ #else /* __GNUC__ */ +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) /* With GNU C, use inline functions instead so args are evaluated only once: */ #undef __FD_SET @@ -95,6 +96,6 @@ } } +#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ #endif /* __GNUC__ */ - #endif /* _PPC_POSIX_TYPES_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/processor.h linux/include/asm-ppc/processor.h --- v2.1.114/linux/include/asm-ppc/processor.h Fri May 8 23:14:56 1998 +++ linux/include/asm-ppc/processor.h Tue Aug 4 16:06:36 1998 @@ -71,6 +71,10 @@ #define _PREP_IBM 0x00 /* ibm prep */ #define _PREP_Bull 0x03 /* bull prep */ +/* these are arbitrary */ +#define _CHRP_Motorola 0x04 /* motorola chrp, the cobra */ +#define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ + #define _GLOBAL(n)\ .globl n;\ n: @@ -192,6 +196,8 @@ #ifdef CONFIG_APUS #define _machine (_MACH_apus) #define is_prep (0) +#define is_chrp (0) +#define have_of (0) #endif /* CONFIG_APUS */ #else /* CONFIG_MACH_SPECIFIC */ @@ -223,6 +229,9 @@ #define MCA_bus 0 #define MCA_bus__is_a_macro /* for versions in ksyms.c */ +/* Lazy FPU handling on uni-processor */ +extern struct task_struct *last_task_used_math; + /* * this is the minimum allowable io space due to the location * of the io areas on prep (first one at 0x80000000) but @@ -234,13 +243,7 @@ /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ -#define TASK_UNMAPPED_BASE(off) (TASK_SIZE / 8 * 3) -#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr) - -#define COPY_TASK_STRUCT(dst, src) \ -do { \ - *dst = *src; \ -} while (0) +#define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3) typedef struct { unsigned long seg; diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/residual.h linux/include/asm-ppc/residual.h --- v2.1.114/linux/include/asm-ppc/residual.h Thu Sep 4 12:54:49 1997 +++ linux/include/asm-ppc/residual.h Tue Aug 4 16:06:36 1998 @@ -314,8 +314,19 @@ } RESIDUAL; -extern RESIDUAL res; -void print_residual_device_info(void); +extern RESIDUAL *res; +extern void print_residual_device_info(void); +extern PPC_DEVICE *residual_find_device(unsigned long BusMask, + unsigned char * DevID, int BaseType, + int SubType, int Interface, int n); +extern PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, unsigned packet_tag, + int n); +extern PnP_TAG_PACKET *PnP_find_small_vendor_packet(unsigned char *p, + unsigned packet_type, + int n); +extern PnP_TAG_PACKET *PnP_find_large_vendor_packet(unsigned char *p, + unsigned packet_type, + int n); #endif /* __ASSEMBLY__ */ #endif /* ndef _RESIDUAL_ */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/serial.h linux/include/asm-ppc/serial.h --- v2.1.114/linux/include/asm-ppc/serial.h Thu May 14 19:47:43 1998 +++ linux/include/asm-ppc/serial.h Tue Aug 4 16:06:36 1998 @@ -4,6 +4,10 @@ #include +#ifdef CONFIG_APUS +#include +#else + /* * This assumes you have a 1.8432 MHz clock for your UART. * @@ -116,3 +120,4 @@ HUB6_SERIAL_PORT_DFNS \ MCA_SERIAL_PORT_DFNS +#endif /* CONFIG_APUS */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/setup.h linux/include/asm-ppc/setup.h --- v2.1.114/linux/include/asm-ppc/setup.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/setup.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1,9 @@ +#ifndef _PPC_SETUP_H +#define _PPC_SETUP_H + +#define m68k_num_memory num_memory +#define m68k_memory memory + +#include + +#endif /* _PPC_SETUP_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/signal.h linux/include/asm-ppc/signal.h --- v2.1.114/linux/include/asm-ppc/signal.h Mon Jan 12 15:18:13 1998 +++ linux/include/asm-ppc/signal.h Tue Aug 4 16:06:36 1998 @@ -88,6 +88,14 @@ #define SA_RESTORER 0x04000000 +/* + * sigaltstack controls + */ +#define SS_ONSTACK 1 +#define SS_DISABLE 2 + +#define MINSIGSTKSZ 2048 +#define SIGSTKSZ 8192 #ifdef __KERNEL__ /* diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/softirq.h linux/include/asm-ppc/softirq.h --- v2.1.114/linux/include/asm-ppc/softirq.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/softirq.h Tue Aug 4 16:06:36 1998 @@ -19,6 +19,8 @@ extern int __ppc_bh_counter; +#define synchronize_bh() do { } while (0) + #define clear_active_bhs(x) atomic_clear_mask((x),&bh_active) extern inline void init_bh(int nr, void (*routine)(void)) @@ -80,6 +82,8 @@ do { atomic_inc(&__ppc_bh_counter); synchronize_irq(); } while(0) #define end_bh_atomic() atomic_dec(&__ppc_bh_counter) + +#define synchronize_bh() do { } while (0) /* XXX implement SMP version --Cort */ #include diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/stat.h linux/include/asm-ppc/stat.h --- v2.1.114/linux/include/asm-ppc/stat.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/stat.h Tue Aug 4 16:06:36 1998 @@ -37,40 +37,4 @@ unsigned long __unused5; }; -typedef struct { - unsigned int major; - unsigned int minor; -} __new_dev_t; - -struct stat64 { - __new_dev_t st_dev; - __u64 st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; - unsigned int st_gid; - __new_dev_t st_rdev; - __s64 st_size; - __u64 st_blocks; - unsigned long st_atime; - unsigned long __unused1; - unsigned long st_mtime; - unsigned long __unused2; - unsigned long st_ctime; - unsigned long __unused3; - unsigned long st_blksize; - unsigned long __unused4; -}; - -#define __XSTAT_VER_1 1 -#define __XSTAT_VER_2 2 -#define __XSTAT_VER_MASK 0xff - -#define __XSTAT_VER_XSTAT 0x000 -#define __XSTAT_VER_LXSTAT 0x100 -#define __XSTAT_VER_FXSTAT 0x200 -#define __XSTAT_VER_TYPEMASK 0xff00 - -#define __XMKNOD_VER_1 1 - #endif diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/system.h linux/include/asm-ppc/system.h --- v2.1.114/linux/include/asm-ppc/system.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/system.h Tue Aug 4 16:06:36 1998 @@ -3,6 +3,7 @@ #include #include +#include #define mb() __asm__ __volatile__ ("sync" : : : "memory") @@ -28,10 +29,10 @@ extern __inline__ void __restore_flags(unsigned long flags) { - extern unsigned lost_interrupts; + extern atomic_t n_lost_interrupts; extern void do_lost_interrupts(unsigned long); - if ((flags & MSR_EE) && lost_interrupts != 0) { + if ((flags & MSR_EE) && atomic_read(&n_lost_interrupts) != 0) { do_lost_interrupts(flags); } else { __asm__ __volatile__ ("sync; mtmsr %0; isync" @@ -39,28 +40,6 @@ } } - -#if 0 -/* - * Gcc bug prevents us from using this inline func so for now - * it lives in misc.S - */ -void __inline__ __restore_flags(unsigned long flags) -{ - extern unsigned lost_interrupts; - __asm__ __volatile__ ( - "andi. 0,%0,%2 \n\t" - "beq 2f \n\t" - "cmpi 0,%1,0 \n\t" - "bne do_lost_interrupts \n\t" - "2: sync \n\t" - "mtmsr %0 \n\t" - "isync \n\t" - : - : "r" (flags), "r"(lost_interrupts), "i" (1<<15)/*MSR_EE*/ - : "0", "cc"); -} -#endif extern void __sti(void); extern void __cli(void); diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/traps.h linux/include/asm-ppc/traps.h --- v2.1.114/linux/include/asm-ppc/traps.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/traps.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1 @@ +#include diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/unistd.h linux/include/asm-ppc/unistd.h --- v2.1.114/linux/include/asm-ppc/unistd.h Fri May 8 23:14:56 1998 +++ linux/include/asm-ppc/unistd.h Tue Aug 4 16:06:36 1998 @@ -181,46 +181,185 @@ #define __NR_rt_sigaction 173 #define __NR_rt_sigprocmask 174 #define __NR_rt_sigpending 175 -#define __NR_rt_sigtimedwait 177 -#define __NR_rt_sigqueueinfo 178 -#define __NR_rt_sigsuspend 179 -#define __NR_pread 180 -#define __NR_pwrite 181 -#define __NR_chown 182 -#define __NR_getcwd 183 -#define __NR_xstat 184 -#define __NR_xmknod 185 +#define __NR_rt_sigtimedwait 176 +#define __NR_rt_sigqueueinfo 177 +#define __NR_rt_sigsuspend 178 +#define __NR_pread 179 +#define __NR_pwrite 180 +#define __NR_chown 181 +#define __NR_getcwd 182 #define __NR(n) #n -#define __do_syscall(n) \ - asm volatile ("li 0,%0\n\ - sc\n\ - bns 1f\n\ - mr 0,3\n\ - lis 3,errno@ha\n\ - stw 0,errno@l(3)\n\ - li 3,-1\n\ -1:" : : "i" (n) : "r0", "r3") - -#define _syscall0(type,name) \ -type name(void) \ -{ __do_syscall(__NR_##name); } -#define _syscall1(type,name,type1,arg1) \ -type name(type1 arg1) \ -{ __do_syscall(__NR_##name); } -#define _syscall2(type,name,type1,arg1,type2,arg2) \ -type name(type1 arg1,type2 arg2) \ -{ __do_syscall(__NR_##name); } -#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ -type name(type1 arg1,type2 arg2,type3 arg3) \ -{ __do_syscall(__NR_##name); } + + +#define __syscall_return(type) \ + return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0), \ + (type) __sc_ret + +#define __syscall_clobbers \ + "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" + +#define _syscall0(type,name) \ +type name(void) \ +{ \ + unsigned long __sc_ret, __sc_err; \ + { \ + register unsigned long __sc_0 __asm__ ("r0"); \ + register unsigned long __sc_3 __asm__ ("r3"); \ + \ + __sc_0 = __NR_##name; \ + __asm__ __volatile__ \ + ("sc \n\t" \ + "mfcr %1 " \ + : "=&r" (__sc_3), "=&r" (__sc_0) \ + : "0" (__sc_3), "1" (__sc_0) \ + : __syscall_clobbers); \ + __sc_ret = __sc_3; \ + __sc_err = __sc_0; \ + } \ + __syscall_return (type); \ +} + +#define _syscall1(type,name,type1,arg1) \ +type name(type1 arg1) \ +{ \ + unsigned long __sc_ret, __sc_err; \ + { \ + register unsigned long __sc_0 __asm__ ("r0"); \ + register unsigned long __sc_3 __asm__ ("r3"); \ + \ + __sc_3 = (unsigned long) (arg1); \ + __sc_0 = __NR_##name; \ + __asm__ __volatile__ \ + ("sc \n\t" \ + "mfcr %1 " \ + : "=&r" (__sc_3), "=&r" (__sc_0) \ + : "0" (__sc_3), "1" (__sc_0) \ + : __syscall_clobbers); \ + __sc_ret = __sc_3; \ + __sc_err = __sc_0; \ + } \ + __syscall_return (type); \ +} + +#define _syscall2(type,name,type1,arg1,type2,arg2) \ +type name(type1 arg1, type2 arg2) \ +{ \ + unsigned long __sc_ret, __sc_err; \ + { \ + register unsigned long __sc_0 __asm__ ("r0"); \ + register unsigned long __sc_3 __asm__ ("r3"); \ + register unsigned long __sc_4 __asm__ ("r4"); \ + \ + __sc_3 = (unsigned long) (arg1); \ + __sc_4 = (unsigned long) (arg2); \ + __sc_0 = __NR_##name; \ + __asm__ __volatile__ \ + ("sc \n\t" \ + "mfcr %1 " \ + : "=&r" (__sc_3), "=&r" (__sc_0) \ + : "0" (__sc_3), "1" (__sc_0), \ + "r" (__sc_4) \ + : __syscall_clobbers); \ + __sc_ret = __sc_3; \ + __sc_err = __sc_0; \ + } \ + __syscall_return (type); \ +} + +#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ +type name(type1 arg1, type2 arg2, type3 arg3) \ +{ \ + unsigned long __sc_ret, __sc_err; \ + { \ + register unsigned long __sc_0 __asm__ ("r0"); \ + register unsigned long __sc_3 __asm__ ("r3"); \ + register unsigned long __sc_4 __asm__ ("r4"); \ + register unsigned long __sc_5 __asm__ ("r5"); \ + \ + __sc_3 = (unsigned long) (arg1); \ + __sc_4 = (unsigned long) (arg2); \ + __sc_5 = (unsigned long) (arg3); \ + __sc_0 = __NR_##name; \ + __asm__ __volatile__ \ + ("sc \n\t" \ + "mfcr %1 " \ + : "=&r" (__sc_3), "=&r" (__sc_0) \ + : "0" (__sc_3), "1" (__sc_0), \ + "r" (__sc_4), \ + "r" (__sc_5) \ + : __syscall_clobbers); \ + __sc_ret = __sc_3; \ + __sc_err = __sc_0; \ + } \ + __syscall_return (type); \ +} + #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ -type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ -{ __do_syscall(__NR_##name); } -#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ - type5,arg5) \ -type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ -{ __do_syscall(__NR_##name); } +type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ +{ \ + unsigned long __sc_ret, __sc_err; \ + { \ + register unsigned long __sc_0 __asm__ ("r0"); \ + register unsigned long __sc_3 __asm__ ("r3"); \ + register unsigned long __sc_4 __asm__ ("r4"); \ + register unsigned long __sc_5 __asm__ ("r5"); \ + register unsigned long __sc_6 __asm__ ("r6"); \ + \ + __sc_3 = (unsigned long) (arg1); \ + __sc_4 = (unsigned long) (arg2); \ + __sc_5 = (unsigned long) (arg3); \ + __sc_6 = (unsigned long) (arg4); \ + __sc_0 = __NR_##name; \ + __asm__ __volatile__ \ + ("sc \n\t" \ + "mfcr %1 " \ + : "=&r" (__sc_3), "=&r" (__sc_0) \ + : "0" (__sc_3), "1" (__sc_0), \ + "r" (__sc_4), \ + "r" (__sc_5), \ + "r" (__sc_6) \ + : __syscall_clobbers); \ + __sc_ret = __sc_3; \ + __sc_err = __sc_0; \ + } \ + __syscall_return (type); \ +} + +#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ +type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ +{ \ + unsigned long __sc_ret, __sc_err; \ + { \ + register unsigned long __sc_0 __asm__ ("r0"); \ + register unsigned long __sc_3 __asm__ ("r3"); \ + register unsigned long __sc_4 __asm__ ("r4"); \ + register unsigned long __sc_5 __asm__ ("r5"); \ + register unsigned long __sc_6 __asm__ ("r6"); \ + register unsigned long __sc_7 __asm__ ("r7"); \ + \ + __sc_3 = (unsigned long) (arg1); \ + __sc_4 = (unsigned long) (arg2); \ + __sc_5 = (unsigned long) (arg3); \ + __sc_6 = (unsigned long) (arg4); \ + __sc_7 = (unsigned long) (arg5); \ + __sc_0 = __NR_##name; \ + __asm__ __volatile__ \ + ("sc \n\t" \ + "mfcr %1 " \ + : "=&r" (__sc_3), "=&r" (__sc_0) \ + : "0" (__sc_3), "1" (__sc_0), \ + "r" (__sc_4), \ + "r" (__sc_5), \ + "r" (__sc_6), \ + "r" (__sc_7) \ + : __syscall_clobbers); \ + __sc_ret = __sc_3; \ + __sc_err = __sc_0; \ + } \ + __syscall_return (type); \ +} + #ifdef __KERNEL_SYSCALLS__ @@ -245,19 +384,22 @@ /* * System call prototypes. */ -int idle(void); -int setup(int); -int sync(void); -pid_t setsid(void); -int write(int, const char *, off_t); -int dup(int); -int execve(const char *, char **, char **); -int open(const char *, int, int); -int close(int); -pid_t waitpid(pid_t, int *, int); -pid_t fork(void); -void _exit(int); -int delete_module(const char *); +#define __NR__exit __NR_exit +static inline _syscall0(int,idle) +static inline _syscall0(int,pause) +static inline _syscall1(int,setup,int,magic) +static inline _syscall0(int,sync) +static inline _syscall0(pid_t,setsid) +static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) +static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) +static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) +static inline _syscall1(int,dup,int,fd) +static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) +static inline _syscall3(int,open,const char *,file,int,flag,int,mode) +static inline _syscall1(int,close,int,fd) +static inline _syscall1(int,_exit,int,exitcode) +static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) +static inline _syscall1(int,delete_module,const char *,name) static inline pid_t wait(int * wait_stat) { diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/vc_ioctl.h linux/include/asm-ppc/vc_ioctl.h --- v2.1.114/linux/include/asm-ppc/vc_ioctl.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-ppc/vc_ioctl.h Tue Aug 4 16:06:36 1998 @@ -0,0 +1,43 @@ +#ifndef _LINUX_VC_IOCTL_H +#define _LINUX_VC_IOCTL_H + +struct vc_mode { + int height; + int width; + int depth; + int pitch; + int mode; + char name[32]; + unsigned long fb_address; + unsigned long cmap_adr_address; + unsigned long cmap_data_address; + unsigned long disp_reg_address; +}; + +#define VC_GETMODE 0x7667 +#define VC_SETMODE 0x7668 +#define VC_INQMODE 0x7669 + +#define VC_SETCMAP 0x766a +#define VC_GETCMAP 0x766b + +#define VC_POWERMODE 0x766c + +/* Values for the argument to the VC_POWERMODE ioctl */ +#define VC_POWERMODE_INQUIRY (-1) +#define VESA_NO_BLANKING 0 +#define VESA_VSYNC_SUSPEND 1 +#define VESA_HSYNC_SUSPEND 2 +#define VESA_POWERDOWN 3 + +#ifdef __KERNEL__ +extern int console_getmode(struct vc_mode *); +extern int console_setmode(struct vc_mode *, int); +extern int console_setcmap(int, unsigned char *, unsigned char *, + unsigned char *); +extern int console_powermode(int); +extern struct vc_mode display_info; +extern struct fb_info *console_fb_info; +#endif + +#endif /* _LINUX_VC_IOCTL_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-ppc/xstat.h linux/include/asm-ppc/xstat.h --- v2.1.114/linux/include/asm-ppc/xstat.h Thu Apr 23 20:21:37 1998 +++ linux/include/asm-ppc/xstat.h Wed Dec 31 16:00:00 1969 @@ -1,35 +0,0 @@ -/* $Id: xstat.h,v 1.1 1998/02/06 12:51:55 jj Exp $ - * xstat.h: sys_xstat/xmknod architecture dependent stuff. - * - * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -extern __inline__ int cp_xstat(struct inode *inode, struct stat64 *s, unsigned long blocks, int blksize) -{ - struct stat64 tmp; - - memset (&tmp, 0, sizeof(tmp)); - tmp.st_dev.major = MAJOR(inode->i_dev); - tmp.st_dev.minor = MINOR(inode->i_dev); - tmp.st_ino = inode->i_ino; - tmp.st_mode = inode->i_mode; - tmp.st_nlink = inode->i_nlink; - tmp.st_uid = inode->i_uid; - tmp.st_gid = inode->i_gid; - tmp.st_rdev.major = MAJOR(inode->i_rdev); - tmp.st_rdev.minor = MINOR(inode->i_rdev); - tmp.st_size = inode->i_size; - tmp.st_blksize = blksize; - tmp.st_blocks = blocks; - tmp.st_atime = inode->i_atime; - tmp.st_mtime = inode->i_mtime; - tmp.st_ctime = inode->i_ctime; - return copy_to_user(s,&tmp,sizeof(tmp)); -} - -extern __inline__ int get_user_new_dev_t(kdev_t *kdev, __new_dev_t *udev) { - __new_dev_t ndev; - if (copy_from_user (&ndev, udev, sizeof(__new_dev_t))) return -EFAULT; - *kdev = MKDEV(ndev.major, ndev.minor); - return 0; -} diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/ap1000/pgtapmmu.h linux/include/asm-sparc/ap1000/pgtapmmu.h --- v2.1.114/linux/include/asm-sparc/ap1000/pgtapmmu.h Sun Jan 26 02:07:47 1997 +++ linux/include/asm-sparc/ap1000/pgtapmmu.h Tue Aug 4 16:03:35 1998 @@ -38,6 +38,7 @@ #define APMMU_PGD_TABLE_SIZE 0x400 /* 256 entries, 4 bytes a piece */ #define APMMU_VMALLOC_START (0xfe300000) +#define APMMU_VMALLOC_END ~0x0UL /* Definition of the values in the ET field of PTD's and PTE's */ #define APMMU_ET_MASK 0x3 diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/asm_offsets.h linux/include/asm-sparc/asm_offsets.h --- v2.1.114/linux/include/asm-sparc/asm_offsets.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc/asm_offsets.h Tue Aug 4 16:03:35 1998 @@ -14,172 +14,176 @@ #define ASIZ_task_addr_limit 0x00000004 #define AOFF_task_exec_domain 0x00000010 #define ASIZ_task_exec_domain 0x00000004 -#define AOFF_task_debugreg 0x00000014 -#define ASIZ_task_debugreg 0x00000020 -#define AOFF_task_counter 0x00000034 +#define AOFF_task_need_resched 0x00000014 +#define ASIZ_task_need_resched 0x00000004 +#define AOFF_task_counter 0x00000018 #define ASIZ_task_counter 0x00000004 -#define AOFF_task_priority 0x00000038 +#define AOFF_task_priority 0x0000001c #define ASIZ_task_priority 0x00000004 -#define AOFF_task_binfmt 0x0000003c -#define ASIZ_task_binfmt 0x00000004 -#define AOFF_task_next_task 0x00000040 +#define AOFF_task_has_cpu 0x00000020 +#define ASIZ_task_has_cpu 0x00000004 +#define AOFF_task_processor 0x00000024 +#define ASIZ_task_processor 0x00000004 +#define AOFF_task_last_processor 0x00000028 +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_lock_depth 0x0000002c +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_next_task 0x00000030 #define ASIZ_task_next_task 0x00000004 -#define AOFF_task_prev_task 0x00000044 +#define AOFF_task_prev_task 0x00000034 #define ASIZ_task_prev_task 0x00000004 -#define AOFF_task_next_run 0x00000048 +#define AOFF_task_next_run 0x00000038 #define ASIZ_task_next_run 0x00000004 -#define AOFF_task_prev_run 0x0000004c +#define AOFF_task_prev_run 0x0000003c #define ASIZ_task_prev_run 0x00000004 -#define AOFF_task_exit_code 0x00000050 +#define AOFF_task_binfmt 0x00000040 +#define ASIZ_task_binfmt 0x00000004 +#define AOFF_task_exit_code 0x00000044 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x00000054 +#define AOFF_task_exit_signal 0x00000048 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000058 +#define AOFF_task_pdeath_signal 0x0000004c #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x0000005c +#define AOFF_task_personality 0x00000050 #define ASIZ_task_personality 0x00000004 -#define AOFF_task_pid 0x00000064 +#define AOFF_task_pid 0x00000058 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000068 +#define AOFF_task_pgrp 0x0000005c #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x0000006c +#define AOFF_task_tty_old_pgrp 0x00000060 #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x00000070 +#define AOFF_task_session 0x00000064 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x00000074 +#define AOFF_task_leader 0x00000068 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x00000078 +#define AOFF_task_p_opptr 0x0000006c #define ASIZ_task_p_opptr 0x00000004 -#define AOFF_task_p_pptr 0x0000007c +#define AOFF_task_p_pptr 0x00000070 #define ASIZ_task_p_pptr 0x00000004 -#define AOFF_task_p_cptr 0x00000080 +#define AOFF_task_p_cptr 0x00000074 #define ASIZ_task_p_cptr 0x00000004 -#define AOFF_task_p_ysptr 0x00000084 +#define AOFF_task_p_ysptr 0x00000078 #define ASIZ_task_p_ysptr 0x00000004 -#define AOFF_task_p_osptr 0x00000088 +#define AOFF_task_p_osptr 0x0000007c #define ASIZ_task_p_osptr 0x00000004 -#define AOFF_task_pidhash_next 0x0000008c +#define AOFF_task_pidhash_next 0x00000080 #define ASIZ_task_pidhash_next 0x00000004 -#define AOFF_task_pidhash_pprev 0x00000090 +#define AOFF_task_pidhash_pprev 0x00000084 #define ASIZ_task_pidhash_pprev 0x00000004 -#define AOFF_task_tarray_ptr 0x00000094 +#define AOFF_task_tarray_ptr 0x00000088 #define ASIZ_task_tarray_ptr 0x00000004 -#define AOFF_task_wait_chldexit 0x00000098 +#define AOFF_task_wait_chldexit 0x0000008c #define ASIZ_task_wait_chldexit 0x00000004 -#define AOFF_task_timeout 0x0000009c +#define AOFF_task_timeout 0x00000090 #define ASIZ_task_timeout 0x00000004 -#define AOFF_task_policy 0x000000a0 +#define AOFF_task_policy 0x00000094 #define ASIZ_task_policy 0x00000004 -#define AOFF_task_rt_priority 0x000000a4 +#define AOFF_task_rt_priority 0x00000098 #define ASIZ_task_rt_priority 0x00000004 -#define AOFF_task_it_real_value 0x000000a8 +#define AOFF_task_it_real_value 0x0000009c #define ASIZ_task_it_real_value 0x00000004 -#define AOFF_task_it_prof_value 0x000000ac +#define AOFF_task_it_prof_value 0x000000a0 #define ASIZ_task_it_prof_value 0x00000004 -#define AOFF_task_it_virt_value 0x000000b0 +#define AOFF_task_it_virt_value 0x000000a4 #define ASIZ_task_it_virt_value 0x00000004 -#define AOFF_task_it_real_incr 0x000000b4 +#define AOFF_task_it_real_incr 0x000000a8 #define ASIZ_task_it_real_incr 0x00000004 -#define AOFF_task_it_prof_incr 0x000000b8 +#define AOFF_task_it_prof_incr 0x000000ac #define ASIZ_task_it_prof_incr 0x00000004 -#define AOFF_task_it_virt_incr 0x000000bc +#define AOFF_task_it_virt_incr 0x000000b0 #define ASIZ_task_it_virt_incr 0x00000004 -#define AOFF_task_real_timer 0x000000c0 +#define AOFF_task_real_timer 0x000000b4 #define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000d4 +#define AOFF_task_times 0x000000c8 #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000e4 +#define AOFF_task_start_time 0x000000d8 #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000e8 +#define AOFF_task_per_cpu_utime 0x000000dc #define ASIZ_task_per_cpu_utime 0x00000004 -#define AOFF_task_min_flt 0x000000f0 +#define AOFF_task_min_flt 0x000000e4 #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000000f4 +#define AOFF_task_maj_flt 0x000000e8 #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x000000f8 +#define AOFF_task_nswap 0x000000ec #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x000000fc +#define AOFF_task_cmin_flt 0x000000f0 #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x00000100 +#define AOFF_task_cmaj_flt 0x000000f4 #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x00000104 +#define AOFF_task_cnswap 0x000000f8 #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_swap_address 0x0000010c +#define AOFF_task_swap_address 0x00000100 #define ASIZ_task_swap_address 0x00000004 -#define AOFF_task_old_maj_flt 0x00000110 +#define AOFF_task_old_maj_flt 0x00000104 #define ASIZ_task_old_maj_flt 0x00000004 -#define AOFF_task_dec_flt 0x00000114 +#define AOFF_task_dec_flt 0x00000108 #define ASIZ_task_dec_flt 0x00000004 -#define AOFF_task_swap_cnt 0x00000118 +#define AOFF_task_swap_cnt 0x0000010c #define ASIZ_task_swap_cnt 0x00000004 -#define AOFF_task_uid 0x0000011c +#define AOFF_task_uid 0x00000110 #define ASIZ_task_uid 0x00000002 -#define AOFF_task_euid 0x0000011e +#define AOFF_task_euid 0x00000112 #define ASIZ_task_euid 0x00000002 -#define AOFF_task_suid 0x00000120 +#define AOFF_task_suid 0x00000114 #define ASIZ_task_suid 0x00000002 -#define AOFF_task_fsuid 0x00000122 +#define AOFF_task_fsuid 0x00000116 #define ASIZ_task_fsuid 0x00000002 -#define AOFF_task_gid 0x00000124 +#define AOFF_task_gid 0x00000118 #define ASIZ_task_gid 0x00000002 -#define AOFF_task_egid 0x00000126 +#define AOFF_task_egid 0x0000011a #define ASIZ_task_egid 0x00000002 -#define AOFF_task_sgid 0x00000128 +#define AOFF_task_sgid 0x0000011c #define ASIZ_task_sgid 0x00000002 -#define AOFF_task_fsgid 0x0000012a +#define AOFF_task_fsgid 0x0000011e #define ASIZ_task_fsgid 0x00000002 -#define AOFF_task_ngroups 0x0000012c +#define AOFF_task_ngroups 0x00000120 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000130 +#define AOFF_task_groups 0x00000124 #define ASIZ_task_groups 0x00000040 -#define AOFF_task_cap_effective 0x00000170 +#define AOFF_task_cap_effective 0x00000164 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000174 +#define AOFF_task_cap_inheritable 0x00000168 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000178 +#define AOFF_task_cap_permitted 0x0000016c #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_rlim 0x0000017c +#define AOFF_task_rlim 0x00000170 #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x000001cc +#define AOFF_task_used_math 0x000001c0 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x000001ce +#define AOFF_task_comm 0x000001c2 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x000001e0 +#define AOFF_task_link_count 0x000001d4 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x000001e4 +#define AOFF_task_tty 0x000001d8 #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x000001e8 +#define AOFF_task_semundo 0x000001dc #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x000001ec +#define AOFF_task_semsleeping 0x000001e0 #define ASIZ_task_semsleeping 0x00000004 -#define AOFF_task_tss 0x000001f0 -#define ASIZ_task_tss 0x00000390 -#define AOFF_task_fs 0x00000580 +#define AOFF_task_tss 0x000001e8 +#define ASIZ_task_tss 0x00000388 +#define AOFF_task_fs 0x00000570 #define ASIZ_task_fs 0x00000004 -#define AOFF_task_files 0x00000584 +#define AOFF_task_files 0x00000574 #define ASIZ_task_files 0x00000004 -#define AOFF_task_mm 0x00000588 +#define AOFF_task_mm 0x00000578 #define ASIZ_task_mm 0x00000004 -#define AOFF_task_sig 0x0000058c +#define AOFF_task_sigmask_lock 0x0000057c +#define ASIZ_task_sigmask_lock 0x00000000 +#define AOFF_task_sig 0x0000057c #define ASIZ_task_sig 0x00000004 -#define AOFF_task_signal 0x00000590 +#define AOFF_task_signal 0x00000580 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x00000598 +#define AOFF_task_blocked 0x00000588 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x000005a0 +#define AOFF_task_sigqueue 0x00000590 #define ASIZ_task_sigqueue 0x00000004 -#define AOFF_task_sigqueue_tail 0x000005a4 +#define AOFF_task_sigqueue_tail 0x00000594 #define ASIZ_task_sigqueue_tail 0x00000004 -#define AOFF_task_has_cpu 0x000005a8 -#define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x000005ac -#define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x000005b0 -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x000005b4 -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_sigmask_lock 0x000005b8 -#define ASIZ_task_sigmask_lock 0x00000000 +#define AOFF_task_sas_ss_sp 0x00000598 +#define ASIZ_task_sas_ss_sp 0x00000004 +#define AOFF_task_sas_ss_size 0x0000059c +#define ASIZ_task_sas_ss_size 0x00000004 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000004 #define AOFF_mm_mmap_cache 0x00000004 @@ -262,15 +266,13 @@ #define ASIZ_thread_fpqdepth 0x00000004 #define AOFF_thread_fpqueue 0x000002d8 #define ASIZ_thread_fpqueue 0x00000080 -#define AOFF_thread_sstk_info 0x00000358 -#define ASIZ_thread_sstk_info 0x00000008 -#define AOFF_thread_flags 0x00000360 +#define AOFF_thread_flags 0x00000358 #define ASIZ_thread_flags 0x00000004 -#define AOFF_thread_current_ds 0x00000364 +#define AOFF_thread_current_ds 0x0000035c #define ASIZ_thread_current_ds 0x00000004 -#define AOFF_thread_core_exec 0x00000368 +#define AOFF_thread_core_exec 0x00000360 #define ASIZ_thread_core_exec 0x00000020 -#define AOFF_thread_new_signal 0x00000388 +#define AOFF_thread_new_signal 0x00000380 #define ASIZ_thread_new_signal 0x00000004 #else /* __SMP__ */ @@ -285,172 +287,176 @@ #define ASIZ_task_addr_limit 0x00000004 #define AOFF_task_exec_domain 0x00000010 #define ASIZ_task_exec_domain 0x00000004 -#define AOFF_task_debugreg 0x00000014 -#define ASIZ_task_debugreg 0x00000020 -#define AOFF_task_counter 0x00000034 +#define AOFF_task_need_resched 0x00000014 +#define ASIZ_task_need_resched 0x00000004 +#define AOFF_task_counter 0x00000018 #define ASIZ_task_counter 0x00000004 -#define AOFF_task_priority 0x00000038 +#define AOFF_task_priority 0x0000001c #define ASIZ_task_priority 0x00000004 -#define AOFF_task_binfmt 0x0000003c -#define ASIZ_task_binfmt 0x00000004 -#define AOFF_task_next_task 0x00000040 +#define AOFF_task_has_cpu 0x00000020 +#define ASIZ_task_has_cpu 0x00000004 +#define AOFF_task_processor 0x00000024 +#define ASIZ_task_processor 0x00000004 +#define AOFF_task_last_processor 0x00000028 +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_lock_depth 0x0000002c +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_next_task 0x00000030 #define ASIZ_task_next_task 0x00000004 -#define AOFF_task_prev_task 0x00000044 +#define AOFF_task_prev_task 0x00000034 #define ASIZ_task_prev_task 0x00000004 -#define AOFF_task_next_run 0x00000048 +#define AOFF_task_next_run 0x00000038 #define ASIZ_task_next_run 0x00000004 -#define AOFF_task_prev_run 0x0000004c +#define AOFF_task_prev_run 0x0000003c #define ASIZ_task_prev_run 0x00000004 -#define AOFF_task_exit_code 0x00000050 +#define AOFF_task_binfmt 0x00000040 +#define ASIZ_task_binfmt 0x00000004 +#define AOFF_task_exit_code 0x00000044 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x00000054 +#define AOFF_task_exit_signal 0x00000048 #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x00000058 +#define AOFF_task_pdeath_signal 0x0000004c #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x0000005c +#define AOFF_task_personality 0x00000050 #define ASIZ_task_personality 0x00000004 -#define AOFF_task_pid 0x00000064 +#define AOFF_task_pid 0x00000058 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x00000068 +#define AOFF_task_pgrp 0x0000005c #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x0000006c +#define AOFF_task_tty_old_pgrp 0x00000060 #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x00000070 +#define AOFF_task_session 0x00000064 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x00000074 +#define AOFF_task_leader 0x00000068 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x00000078 +#define AOFF_task_p_opptr 0x0000006c #define ASIZ_task_p_opptr 0x00000004 -#define AOFF_task_p_pptr 0x0000007c +#define AOFF_task_p_pptr 0x00000070 #define ASIZ_task_p_pptr 0x00000004 -#define AOFF_task_p_cptr 0x00000080 +#define AOFF_task_p_cptr 0x00000074 #define ASIZ_task_p_cptr 0x00000004 -#define AOFF_task_p_ysptr 0x00000084 +#define AOFF_task_p_ysptr 0x00000078 #define ASIZ_task_p_ysptr 0x00000004 -#define AOFF_task_p_osptr 0x00000088 +#define AOFF_task_p_osptr 0x0000007c #define ASIZ_task_p_osptr 0x00000004 -#define AOFF_task_pidhash_next 0x0000008c +#define AOFF_task_pidhash_next 0x00000080 #define ASIZ_task_pidhash_next 0x00000004 -#define AOFF_task_pidhash_pprev 0x00000090 +#define AOFF_task_pidhash_pprev 0x00000084 #define ASIZ_task_pidhash_pprev 0x00000004 -#define AOFF_task_tarray_ptr 0x00000094 +#define AOFF_task_tarray_ptr 0x00000088 #define ASIZ_task_tarray_ptr 0x00000004 -#define AOFF_task_wait_chldexit 0x00000098 +#define AOFF_task_wait_chldexit 0x0000008c #define ASIZ_task_wait_chldexit 0x00000004 -#define AOFF_task_timeout 0x0000009c +#define AOFF_task_timeout 0x00000090 #define ASIZ_task_timeout 0x00000004 -#define AOFF_task_policy 0x000000a0 +#define AOFF_task_policy 0x00000094 #define ASIZ_task_policy 0x00000004 -#define AOFF_task_rt_priority 0x000000a4 +#define AOFF_task_rt_priority 0x00000098 #define ASIZ_task_rt_priority 0x00000004 -#define AOFF_task_it_real_value 0x000000a8 +#define AOFF_task_it_real_value 0x0000009c #define ASIZ_task_it_real_value 0x00000004 -#define AOFF_task_it_prof_value 0x000000ac +#define AOFF_task_it_prof_value 0x000000a0 #define ASIZ_task_it_prof_value 0x00000004 -#define AOFF_task_it_virt_value 0x000000b0 +#define AOFF_task_it_virt_value 0x000000a4 #define ASIZ_task_it_virt_value 0x00000004 -#define AOFF_task_it_real_incr 0x000000b4 +#define AOFF_task_it_real_incr 0x000000a8 #define ASIZ_task_it_real_incr 0x00000004 -#define AOFF_task_it_prof_incr 0x000000b8 +#define AOFF_task_it_prof_incr 0x000000ac #define ASIZ_task_it_prof_incr 0x00000004 -#define AOFF_task_it_virt_incr 0x000000bc +#define AOFF_task_it_virt_incr 0x000000b0 #define ASIZ_task_it_virt_incr 0x00000004 -#define AOFF_task_real_timer 0x000000c0 +#define AOFF_task_real_timer 0x000000b4 #define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000d4 +#define AOFF_task_times 0x000000c8 #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000e4 +#define AOFF_task_start_time 0x000000d8 #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000e8 +#define AOFF_task_per_cpu_utime 0x000000dc #define ASIZ_task_per_cpu_utime 0x00000080 -#define AOFF_task_min_flt 0x000001e8 +#define AOFF_task_min_flt 0x000001dc #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000001ec +#define AOFF_task_maj_flt 0x000001e0 #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x000001f0 +#define AOFF_task_nswap 0x000001e4 #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x000001f4 +#define AOFF_task_cmin_flt 0x000001e8 #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x000001f8 +#define AOFF_task_cmaj_flt 0x000001ec #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x000001fc +#define AOFF_task_cnswap 0x000001f0 #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_swap_address 0x00000204 +#define AOFF_task_swap_address 0x000001f8 #define ASIZ_task_swap_address 0x00000004 -#define AOFF_task_old_maj_flt 0x00000208 +#define AOFF_task_old_maj_flt 0x000001fc #define ASIZ_task_old_maj_flt 0x00000004 -#define AOFF_task_dec_flt 0x0000020c +#define AOFF_task_dec_flt 0x00000200 #define ASIZ_task_dec_flt 0x00000004 -#define AOFF_task_swap_cnt 0x00000210 +#define AOFF_task_swap_cnt 0x00000204 #define ASIZ_task_swap_cnt 0x00000004 -#define AOFF_task_uid 0x00000214 +#define AOFF_task_uid 0x00000208 #define ASIZ_task_uid 0x00000002 -#define AOFF_task_euid 0x00000216 +#define AOFF_task_euid 0x0000020a #define ASIZ_task_euid 0x00000002 -#define AOFF_task_suid 0x00000218 +#define AOFF_task_suid 0x0000020c #define ASIZ_task_suid 0x00000002 -#define AOFF_task_fsuid 0x0000021a +#define AOFF_task_fsuid 0x0000020e #define ASIZ_task_fsuid 0x00000002 -#define AOFF_task_gid 0x0000021c +#define AOFF_task_gid 0x00000210 #define ASIZ_task_gid 0x00000002 -#define AOFF_task_egid 0x0000021e +#define AOFF_task_egid 0x00000212 #define ASIZ_task_egid 0x00000002 -#define AOFF_task_sgid 0x00000220 +#define AOFF_task_sgid 0x00000214 #define ASIZ_task_sgid 0x00000002 -#define AOFF_task_fsgid 0x00000222 +#define AOFF_task_fsgid 0x00000216 #define ASIZ_task_fsgid 0x00000002 -#define AOFF_task_ngroups 0x00000224 +#define AOFF_task_ngroups 0x00000218 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000228 +#define AOFF_task_groups 0x0000021c #define ASIZ_task_groups 0x00000040 -#define AOFF_task_cap_effective 0x00000268 +#define AOFF_task_cap_effective 0x0000025c #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x0000026c +#define AOFF_task_cap_inheritable 0x00000260 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000270 +#define AOFF_task_cap_permitted 0x00000264 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_rlim 0x00000274 +#define AOFF_task_rlim 0x00000268 #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x000002c4 +#define AOFF_task_used_math 0x000002b8 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x000002c6 +#define AOFF_task_comm 0x000002ba #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x000002d8 +#define AOFF_task_link_count 0x000002cc #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x000002dc +#define AOFF_task_tty 0x000002d0 #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x000002e0 +#define AOFF_task_semundo 0x000002d4 #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x000002e4 +#define AOFF_task_semsleeping 0x000002d8 #define ASIZ_task_semsleeping 0x00000004 -#define AOFF_task_tss 0x000002e8 -#define ASIZ_task_tss 0x00000390 -#define AOFF_task_fs 0x00000678 +#define AOFF_task_tss 0x000002e0 +#define ASIZ_task_tss 0x00000388 +#define AOFF_task_fs 0x00000668 #define ASIZ_task_fs 0x00000004 -#define AOFF_task_files 0x0000067c +#define AOFF_task_files 0x0000066c #define ASIZ_task_files 0x00000004 -#define AOFF_task_mm 0x00000680 +#define AOFF_task_mm 0x00000670 #define ASIZ_task_mm 0x00000004 -#define AOFF_task_sig 0x00000684 +#define AOFF_task_sigmask_lock 0x00000674 +#define ASIZ_task_sigmask_lock 0x00000001 +#define AOFF_task_sig 0x00000678 #define ASIZ_task_sig 0x00000004 -#define AOFF_task_signal 0x00000688 +#define AOFF_task_signal 0x0000067c #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x00000690 +#define AOFF_task_blocked 0x00000684 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x00000698 +#define AOFF_task_sigqueue 0x0000068c #define ASIZ_task_sigqueue 0x00000004 -#define AOFF_task_sigqueue_tail 0x0000069c +#define AOFF_task_sigqueue_tail 0x00000690 #define ASIZ_task_sigqueue_tail 0x00000004 -#define AOFF_task_has_cpu 0x000006a0 -#define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x000006a4 -#define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x000006a8 -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x000006ac -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_sigmask_lock 0x000006b0 -#define ASIZ_task_sigmask_lock 0x00000001 +#define AOFF_task_sas_ss_sp 0x00000694 +#define ASIZ_task_sas_ss_sp 0x00000004 +#define AOFF_task_sas_ss_size 0x00000698 +#define ASIZ_task_sas_ss_size 0x00000004 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000004 #define AOFF_mm_mmap_cache 0x00000004 @@ -533,15 +539,13 @@ #define ASIZ_thread_fpqdepth 0x00000004 #define AOFF_thread_fpqueue 0x000002d8 #define ASIZ_thread_fpqueue 0x00000080 -#define AOFF_thread_sstk_info 0x00000358 -#define ASIZ_thread_sstk_info 0x00000008 -#define AOFF_thread_flags 0x00000360 +#define AOFF_thread_flags 0x00000358 #define ASIZ_thread_flags 0x00000004 -#define AOFF_thread_current_ds 0x00000364 +#define AOFF_thread_current_ds 0x0000035c #define ASIZ_thread_current_ds 0x00000004 -#define AOFF_thread_core_exec 0x00000368 +#define AOFF_thread_core_exec 0x00000360 #define ASIZ_thread_core_exec 0x00000020 -#define AOFF_thread_new_signal 0x00000388 +#define AOFF_thread_new_signal 0x00000380 #define ASIZ_thread_new_signal 0x00000004 #endif /* __SMP__ */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/audioio.h linux/include/asm-sparc/audioio.h --- v2.1.114/linux/include/asm-sparc/audioio.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc/audioio.h Tue Aug 4 16:03:35 1998 @@ -12,9 +12,11 @@ * SunOS/Solaris /dev/audio interface */ +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #include #include #include +#endif /* * This structure contains state information for audio device IO streams. @@ -262,6 +264,9 @@ void *private; unsigned long flags; + /* This device */ + struct linux_sbus_device *dev; + /* Processes blocked on open() sit here. */ struct wait_queue *open_wait; @@ -286,12 +291,14 @@ struct sparcaudio_operations { int (*open)(struct inode *, struct file *, struct sparcaudio_driver *); - void (*release)(struct inode *, struct file *, struct sparcaudio_driver *); - int (*ioctl)(struct inode *, struct file *, unsigned int, unsigned long, - struct sparcaudio_driver *); + void (*release)(struct inode *, struct file *, struct + sparcaudio_driver *); + int (*ioctl)(struct inode *, struct file *, unsigned int, + unsigned long, struct sparcaudio_driver *); /* Ask driver to begin playing a buffer. */ - void (*start_output)(struct sparcaudio_driver *, __u8 *, unsigned long); + void (*start_output)(struct sparcaudio_driver *, __u8 *, + unsigned long); /* Ask driver to stop playing a buffer. */ void (*stop_output)(struct sparcaudio_driver *); diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/bitops.h linux/include/asm-sparc/bitops.h --- v2.1.114/linux/include/asm-sparc/bitops.h Tue Jul 21 00:15:33 1998 +++ linux/include/asm-sparc/bitops.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: bitops.h,v 1.49 1998/02/23 01:46:44 rth Exp $ +/* $Id: bitops.h,v 1.51 1998/07/26 03:05:37 davem Exp $ * bitops.h: Bit string operations on the Sparc. * * Copyright 1995 David S. Miller (davem@caip.rutgers.edu) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/elf.h linux/include/asm-sparc/elf.h --- v2.1.114/linux/include/asm-sparc/elf.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc/elf.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: elf.h,v 1.16 1998/05/01 16:28:47 davem Exp $ */ +/* $Id: elf.h,v 1.17 1998/05/11 08:40:10 davem Exp $ */ #ifndef __ASMSPARC_ELF_H #define __ASMSPARC_ELF_H @@ -42,7 +42,7 @@ the loader. We need to make sure that it is out of the way of the program that it will "exec", and that there is sufficient room for the brk. */ -#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE(0) + 0x1000000) +#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000) /* This yields a mask that user programs can use to figure out what instruction set this cpu supports. This can NOT be done in userspace diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/irq.h linux/include/asm-sparc/irq.h --- v2.1.114/linux/include/asm-sparc/irq.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc/irq.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: irq.h,v 1.22 1998/02/05 14:20:05 jj Exp $ +/* $Id: irq.h,v 1.25 1998/06/04 09:55:04 jj Exp $ * irq.h: IRQ registers on the Sparc. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -12,16 +12,10 @@ #include /* For NCPUS */ #include -/* This is used for sun4d */ -struct devid_cookie { - /* Caller specifies these. */ - void *real_dev_id; /* What dev_id would usually contain. */ - void *bus_cookie; /* linux_sbus_device *, etc. */ - /* Return values. */ - unsigned int ret_ino; -}; - -#define SA_DCOOKIE 0x10000 +#define __irq_ino(irq) irq +#define __irq_pil(irq) irq +BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int) +#define __irq_itoa(irq) BTFIXUP_CALL(__irq_itoa)(irq) #define NR_IRQS 15 diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/linux_logo.h linux/include/asm-sparc/linux_logo.h --- v2.1.114/linux/include/asm-sparc/linux_logo.h Sun Jul 26 11:57:19 1998 +++ linux/include/asm-sparc/linux_logo.h Tue Aug 4 16:03:35 1998 @@ -1,9 +1,9 @@ -/* $Id: linux_logo.h,v 1.4 1998/07/21 10:36:56 jj Exp $ +/* $Id: linux_logo.h,v 1.5 1998/07/30 16:30:40 jj Exp $ * include/asm-sparc/linux_logo.h: This is a linux logo * to be displayed on boot. * * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu) - * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * * You can put anything here, but: * LINUX_LOGO_COLORS has to be less than 224 @@ -23,11 +23,1008 @@ #define linux_logo_banner "Linux/SPARC version " UTS_RELEASE -#define LINUX_LOGO_COLORS 221 +#define LINUX_LOGO_CO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, 0x10, 0x0E, 0x14, 0x0E, 0x05, 0x94, 0x0E, + 0xCA, 0x0B, 0x46, 0xFB, 0xB4, 0x1C, 0x9B, 0x1A, + 0x21, 0x09, 0x14, 0x4D, 0xCB, 0x08, 0x11, 0x7C, + 0x20, 0x10, 0x24, 0x66, 0x79, 0x07, 0xEA, 0xC9, + 0x0C, 0x08, 0x38, 0xC4, 0xD8, 0x24, 0xBE, 0x6C, + 0x51, 0xBB, 0x8C, 0x36, 0x0A, 0x0F, 0x0C, 0x84, + 0x3C, 0x54, 0x44, 0x7C, 0x28, 0x0E, 0x28, 0x7F, + 0x8C, 0x0F, 0x54, 0x24, 0x3C, 0x18, 0x54, 0x17, + 0x7C, 0x9C, 0xDA, 0x9C, 0x7C, 0x6C, 0x4D, 0x2C, + 0x09, 0x0E, 0x8A, 0x50, 0x4C, 0x5B, 0x14, 0xAC, + 0x19, 0x3C, 0xAC, 0x5C, 0x64, 0x97, 0x94, 0x37, + 0x29, 0x3C, 0x44, 0x3C, 0x2C, 0x7C, 0x70, 0x07, + 0x04, 0x29, 0xB2, 0x64, 0x74, 0x07, 0x07, 0x2C, + 0x74, 0x2E, 0x6C, 0xA4, 0x29, 0x9E, 0x34, 0x27, + 0x2F, 0x98, 0x48, 0x5C, 0x0C, 0x5C, 0xE8, 0x04, + 0xC2, 0x0C, 0x0A, 0xB2, 0x74, 0xCB, 0x46, 0x78, + 0xB4, 0x5C, 0x18, 0x80, 0x8C, 0x24, 0xD9, 0xAC, + 0x87, 0x99, 0x1D, 0xE8, 0x14, 0x0D, 0x10, 0x17, + 0x0A, 0x67, 0x3C, 0x68, 0x3C, 0x69, 0x90, 0x22, + 0x6C, 0x0D, 0x17 +}; + +unsigned char linux_logo[] __initdata = { + 0xD8, 0xA3, 0x98, 0x98, 0xA3, 0xB2, 0x2F, 0x2F, + 0xA3, 0x66, 0x98, 0x98, 0x98, 0xA3, 0x2F, 0xA3, + 0x98, 0x55, 0xA0, 0xA3, 0xB2, 0x51, 0x51, 0x2F, + 0x98, 0x55, 0x8F, 0x2F, 0x89, 0x44, 0x89, 0x51, + 0xB2, 0x2F, 0x66, 0xA3, 0x2F, 0x2F, 0x66, 0x66, + 0xA3, 0xB2, 0xB2, 0xB2, 0x89, 0xD8, 0x44, 0x44, + 0xD8, 0x83, 0xD8, 0xA3, 0x98, 0x98, 0xA3, 0xB2, + 0x2F, 0x2F, 0xA3, 0x66, 0x98, 0x98, 0x98, 0xA3, + 0x2F, 0xA3, 0x98, 0x55, 0xA0, 0xA3, 0xB2, 0x51, + 0x51, 0x2F, 0x98, 0x55, 0x8F, 0x2F, 0x89, 0x44, + 0xA3, 0x55, 0x55, 0x98, 0x2F, 0x2F, 0x2F, 0xA3, + 0x66, 0x66, 0x98, 0x98, 0x66, 0x66, 0x66, 0x98, + 0x55, 0xA5, 0x8F, 0xA3, 0x51, 0x51, 0xB2, 0x2F, + 0x66, 0x66, 0xA3, 0x51, 0x89, 0x51, 0xB2, 0x2F, + 0x2F, 0xA3, 0x66, 0xA3, 0xA3, 0xA3, 0x2F, 0x2F, + 0xB2, 0xB2, 0x2F, 0x2F, 0xB2, 0x51, 0x51, 0x51, + 0x51, 0x51, 0xA3, 0x55, 0x55, 0x98, 0x2F, 0x2F, + 0x2F, 0xA3, 0x66, 0x66, 0x98, 0x98, 0x66, 0x66, + 0x66, 0x98, 0x55, 0xA5, 0x8F, 0xA3, 0x51, 0x51, + 0xB2, 0x2F, 0x66, 0x66, 0xA3, 0x51, 0x89, 0x51, + 0x98, 0xA5, 0x55, 0x8F, 0x2F, 0xB2, 0x2F, 0xA3, + 0x66, 0x66, 0x98, 0x8F, 0x66, 0x66, 0x66, 0x98, + 0xA0, 0x8F, 0xA3, 0xB2, 0x51, 0x51, 0xB2, 0x2F, + 0xA3, 0xA3, 0x2F, 0xB2, 0x51, 0xB2, 0x2F, 0x2F, + 0xA3, 0x66, 0x98, 0xA3, 0x51, 0xB2, 0x2F, 0xA3, + 0xB2, 0x51, 0x51, 0xB2, 0xB2, 0x51, 0xB2, 0xB2, + 0xB2, 0x2F, 0x98, 0xA5, 0x55, 0x8F, 0x2F, 0xB2, + 0x2F, 0xA3, 0x66, 0x66, 0x98, 0x8F, 0x66, 0x66, + 0x66, 0x98, 0xA0, 0x8F, 0xA3, 0xB2, 0x51, 0x51, + 0xB2, 0x2F, 0xA3, 0xA3, 0x2F, 0x51, 0x51, 0xB2, + 0xA0, 0xA5, 0x55, 0x66, 0xB2, 0x51, 0xB2, 0xA3, + 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, 0x98, 0x98, + 0x66, 0xA3, 0x2F, 0xB2, 0x51, 0x51, 0xB2, 0xA3, + 0xA3, 0xA3, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0xA3, + 0x66, 0x98, 0xB2, 0x4C, 0x54, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xCE, 0x2F, 0xB2, 0x2F, 0x2F, + 0xA3, 0x98, 0xA0, 0xA5, 0x55, 0x66, 0xB2, 0x51, + 0xB2, 0xA3, 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, + 0x98, 0x98, 0x66, 0xA3, 0x2F, 0xB2, 0x51, 0x51, + 0xB2, 0xA3, 0xA3, 0xA3, 0x2F, 0x2F, 0x2F, 0x2F, + 0xA0, 0xA0, 0x8F, 0xA3, 0xB2, 0x51, 0xB2, 0x2F, + 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, 0x66, 0x66, + 0xA3, 0x2F, 0x51, 0x51, 0x51, 0xB2, 0x2F, 0xA3, + 0x66, 0x66, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, + 0x2F, 0xA0, 0xDA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x9C, 0xB2, 0xA3, + 0x66, 0x98, 0xA0, 0xA0, 0x8F, 0xA3, 0xB2, 0x51, + 0xB2, 0x2F, 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, + 0x66, 0x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, + 0x98, 0x98, 0x98, 0x66, 0x66, 0xB2, 0x6D, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x6D, 0x3A, 0x20, 0x20, 0x20, + 0x20, 0x20, 0xA5, 0x66, 0x2F, 0xB2, 0x51, 0xB2, + 0xA3, 0xA0, 0xA0, 0x66, 0xA3, 0xB2, 0xB2, 0xB2, + 0xB2, 0xA3, 0x66, 0x66, 0x66, 0xA3, 0xA3, 0x66, + 0x98, 0x98, 0x8F, 0x98, 0x66, 0x66, 0x66, 0x66, + 0x51, 0x2F, 0xB2, 0x51, 0x51, 0x2F, 0x66, 0xA0, + 0x8F, 0xA3, 0x2F, 0xB2, 0xB2, 0x2F, 0x2F, 0x66, + 0x98, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x2F, 0xA3, 0x2F, 0x2F, 0x51, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0xDA, 0x51, 0xB2, 0x51, 0x51, 0x2F, + 0x66, 0xA0, 0x8F, 0xA3, 0x2F, 0xB2, 0xB2, 0x2F, + 0x2F, 0x66, 0x98, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0xA3, 0x2F, 0x2F, 0x2F, 0x2F, + 0x51, 0x2F, 0xB2, 0x51, 0x2F, 0xA3, 0x8F, 0x8F, + 0x98, 0xA3, 0xB2, 0xB2, 0x2F, 0xA3, 0x98, 0x66, + 0x98, 0x98, 0x66, 0x66, 0x66, 0x66, 0xA3, 0x2F, + 0xB2, 0xB2, 0x51, 0xB2, 0xB2, 0x66, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xA3, 0xB2, 0x51, 0x2F, 0xA3, + 0x8F, 0x8F, 0x98, 0xA3, 0xB2, 0xB2, 0x2F, 0xA3, + 0x98, 0x66, 0x98, 0x98, 0x66, 0x66, 0x66, 0x66, + 0xA3, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, + 0xB2, 0x2F, 0xA3, 0x2F, 0x66, 0x98, 0x8F, 0x98, + 0xA3, 0x2F, 0x2F, 0xA3, 0x98, 0x98, 0x98, 0x98, + 0x66, 0x98, 0x66, 0x98, 0x66, 0xA3, 0x2F, 0xB2, + 0x51, 0x51, 0x51, 0xB2, 0xB2, 0x8F, 0x20, 0x20, + 0x20, 0x54, 0x6D, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x54, 0x6D, 0x6D, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x4C, 0xA3, 0x2F, 0x66, 0x98, + 0x8F, 0x98, 0xA3, 0x2F, 0x2F, 0xA3, 0x98, 0x98, + 0x98, 0x98, 0x66, 0x98, 0x66, 0x98, 0x66, 0xA3, + 0x2F, 0xB2, 0x51, 0x51, 0x51, 0xB2, 0x2F, 0x2F, + 0x2F, 0xA3, 0xA3, 0x66, 0x98, 0x98, 0x8F, 0x98, + 0x2F, 0x2F, 0x2F, 0x66, 0x8F, 0x8F, 0x98, 0xA3, + 0x66, 0x66, 0x8F, 0x98, 0x98, 0x66, 0x2F, 0xB2, + 0x51, 0xB2, 0x2F, 0xA3, 0xA3, 0xA0, 0x20, 0x20, + 0xDA, 0x2E, 0x3A, 0xA7, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xCE, 0x2A, 0x2A, 0x2E, 0xA7, 0xDA, 0x20, + 0x20, 0x20, 0x20, 0x9C, 0xA3, 0x66, 0x98, 0x98, + 0x8F, 0x98, 0x2F, 0x2F, 0x2F, 0x66, 0x8F, 0x8F, + 0x98, 0xA3, 0x66, 0x66, 0x8F, 0x98, 0x98, 0x66, + 0x2F, 0xB2, 0x51, 0xB2, 0x2F, 0x2F, 0xA3, 0xA3, + 0xB2, 0xA3, 0x66, 0x98, 0x8F, 0x8F, 0x66, 0xA3, + 0x2F, 0x2F, 0x66, 0x98, 0x98, 0x66, 0x2F, 0x2F, + 0xA3, 0x98, 0x8F, 0x98, 0x66, 0x2F, 0xB2, 0xB2, + 0xB2, 0xA3, 0x66, 0x66, 0x66, 0x98, 0x20, 0x3A, + 0x98, 0x89, 0x8F, 0x6D, 0x20, 0x20, 0x20, 0x20, + 0x4C, 0x66, 0x51, 0x44, 0x51, 0x2E, 0x54, 0x20, + 0x20, 0x20, 0x20, 0xA7, 0x66, 0x98, 0x8F, 0x8F, + 0x66, 0xA3, 0x2F, 0x2F, 0x66, 0x98, 0x98, 0x66, + 0x2F, 0x2F, 0xA3, 0x98, 0x8F, 0x98, 0x66, 0x2F, + 0xB2, 0xB2, 0xB2, 0xA3, 0x66, 0x66, 0x66, 0xA3, + 0x2F, 0x66, 0x98, 0x8F, 0x8F, 0x98, 0x66, 0x2F, + 0x2F, 0xA3, 0x66, 0x98, 0x98, 0xA3, 0x2F, 0xB2, + 0xA3, 0x8F, 0x98, 0xA3, 0xB2, 0x51, 0x89, 0x89, + 0xB2, 0xA3, 0x66, 0x98, 0x66, 0x98, 0x20, 0xA6, + 0x44, 0x39, 0xE6, 0x98, 0x20, 0x20, 0x20, 0x9C, + 0x74, 0xD6, 0x7E, 0xD6, 0x39, 0x8F, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x2E, 0x98, 0x8F, 0x8F, 0x98, + 0x66, 0x2F, 0x2F, 0xA3, 0x66, 0x98, 0x98, 0xA3, + 0x2F, 0xB2, 0x66, 0x98, 0x8F, 0xA3, 0xB2, 0x51, + 0x89, 0x89, 0xB2, 0xA3, 0x66, 0x98, 0x66, 0x66, + 0x2F, 0x66, 0x8F, 0xA0, 0x8F, 0x98, 0xA3, 0xB2, + 0x2F, 0x66, 0x66, 0x66, 0xA3, 0x2F, 0x2F,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 0x8F, 0x66, 0xA3, 0x2F, 0xB2, 0xB2, 0xB2, + 0xDD, 0xA3, 0x66, 0x98, 0x66, 0x2F, 0xB2, 0xB2, + 0xA3, 0xA3, 0xB2, 0x51, 0xB2, 0x2F, 0xA3, 0x2F, + 0xB2, 0x89, 0xB2, 0x66, 0xA0, 0xA5, 0x8F, 0x98, + 0x66, 0x66, 0xB2, 0x51, 0x51, 0x51, 0x81, 0xFA, + 0x62, 0xEE, 0x30, 0x52, 0x22, 0x72, 0x82, 0x82, + 0x47, 0x47, 0xEA, 0x3F, 0x37, 0x6F, 0x26, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x2A, 0x98, 0x66, 0x2F, + 0x51, 0xB2, 0xA3, 0x66, 0xB2, 0x51, 0x51, 0xB2, + 0xA3, 0x2F, 0xB2, 0x89, 0xB2, 0x66, 0x55, 0x55, + 0x8F, 0x98, 0x66, 0xA3, 0xB2, 0x51, 0x51, 0xB2, + 0x74, 0xA0, 0x8F, 0x98, 0x66, 0xB2, 0xB2, 0xB2, + 0xA3, 0xA3, 0x2F, 0x51, 0x51, 0x2F, 0xA3, 0x2F, + 0xB2, 0x51, 0xA3, 0x98, 0xA0, 0x55, 0xA0, 0xA0, + 0x8F, 0x66, 0x2F, 0x51, 0xB2, 0x51, 0x54, 0xA9, + 0x62, 0xEF, 0x52, 0x22, 0x72, 0x29, 0xEA, 0xEA, + 0x29, 0x22, 0x37, 0x37, 0x8E, 0xCF, 0x49, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x6D, 0x2F, 0x66, 0x2F, + 0x51, 0xB2, 0xA3, 0x66, 0x2F, 0xB2, 0xB2, 0x2F, + 0xA3, 0x2F, 0xB2, 0x51, 0x2F, 0x98, 0xA0, 0x55, + 0xA0, 0xA0, 0x8F, 0x66, 0x2F, 0x51, 0xB2, 0xA3, + 0xA3, 0x2A, 0xA5, 0x98, 0xA3, 0x2F, 0xB2, 0x2F, + 0x66, 0x66, 0x2F, 0xB2, 0xB2, 0xB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7B, + 0x7B, 0xF5, 0xF6, 0xDB, 0x6B, 0x6B, 0x98, 0x20, + 0x20, 0x20, 0x2E, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x51, 0x66, 0xA0, 0xA0, 0x66, 0x2F, 0xB2, + 0xB2, 0x51, 0x2F, 0xA0, 0x55, 0xA3, 0x51, 0x89, + 0x44, 0xA3, 0x98, 0x98, 0x2F, 0x2F, 0x2F, 0xA3, + 0xA3, 0x66, 0x98, 0x98, 0x98, 0xA3, 0x2F, 0x2F, + 0x98, 0x8F, 0x20, 0x20, 0x3A, 0xA6, 0x20, 0xA0, + 0x6B, 0x6B, 0x6B, 0x6B, 0x7F, 0x7F, 0xC3, 0xC9, + 0xD0, 0xD0, 0x29, 0x59, 0x82, 0x73, 0x82, 0x73, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x58, 0xAF, 0xF5, + 0x8A, 0x68, 0xEB, 0x6B, 0x6B, 0x6B, 0x98, 0x20, + 0x20, 0x20, 0x6D, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x51, 0x98, 0x55, 0xA0, 0xA3, 0xB2, 0x51, + 0x51, 0x2F, 0x98, 0x55, 0x8F, 0xB2, 0x89, 0x44, + 0xA3, 0x55, 0x55, 0x98, 0xA3, 0xB2, 0x2F, 0xA3, + 0x66, 0x66, 0x98, 0x8F, 0x66, 0xA3, 0x66, 0x98, + 0x55, 0x4C, 0x20, 0x20, 0xDA, 0xAD, 0x20, 0x98, + 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x3D, 0x9A, 0xD0, + 0xF2, 0x8B, 0x8B, 0x8B, 0x73, 0x82, 0x5B, 0x82, + 0x82, 0x59, 0x59, 0x73, 0x73, 0x58, 0x3D, 0x3D, + 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x66, 0x20, + 0x20, 0x3A, 0x3A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x2F, 0x55, 0xA5, 0x8F, 0xA3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6E, 0x31, 0x33, + 0x7F, 0x7E, 0xA1, 0x6F, 0x52, 0x8D, 0xE5, 0xBF, + 0x20, 0x20, 0x20, 0x20, 0x81, 0xA8, 0x78, 0x52, + 0x52, 0xD2, 0xD8, 0xA3, 0xA3, 0x2F, 0x2F, 0xA3, + 0xA3, 0x66, 0x98, 0x98, 0x98, 0x98, 0x98, 0x66, + 0x51, 0x66, 0x2F, 0x51, 0x51, 0xB2, 0xA3, 0xA0, + 0xA0, 0x44, 0x78, 0xEF, 0x52, 0x30, 0x30, 0x30, + 0x3B, 0x70, 0x5D, 0x5D, 0x5D, 0x80, 0x5D, 0x5D, + 0x46, 0xC1, 0x71, 0x20, 0x81, 0xB1, 0xDD, 0x3D, + 0xA1, 0xE7, 0xDB, 0xCA, 0xD2, 0x6A, 0x6A, 0x6A, + 0xF3, 0xE9, 0xDB, 0x8A, 0x84, 0x3D, 0x84, 0xDC, + 0x25, 0x44, 0xB5, 0xEE, 0x30, 0xEF, 0xF0, 0x32, + 0x69, 0x5F, 0x4B, 0xA8, 0x99, 0x56, 0x67, 0x30, + 0x30, 0x34, 0xB2, 0x2F, 0xA3, 0xA3, 0x66, 0x66, + 0x98, 0x8F, 0x98, 0x98, 0x66, 0x66, 0x66, 0x66, + 0x51, 0x2F, 0xB2, 0x51, 0x51, 0x2F, 0x66, 0xA0, + 0x8F, 0xE0, 0xF9, 0x8D, 0x52, 0x5D, 0x46, 0x5D, + 0x80, 0x5D, 0x80, 0x5D, 0x5D, 0x5D, 0x5D, 0x5D, + 0x52, 0x52, 0x60, 0x81, 0x20, 0x20, 0x6D, 0xD1, + 0x48, 0xE7, 0x6B, 0x33, 0xF6, 0x7F, 0x7F, 0xDB, + 0x84, 0x6B, 0x6C, 0x6A, 0xF3, 0xEB, 0x6B, 0x3D, + 0x4F, 0xD8, 0xCD, 0x79, 0x30, 0x67, 0xF9, 0x24, + 0xED, 0xD9, 0x8C, 0xED, 0x37, 0x2B, 0x3B, 0x5D, + 0x80, 0x85,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67, 0x30, 0x5D, 0x5D, + 0x5D, 0x80, 0x5D, 0x5D, 0x5D, 0x5D, 0x3B, 0x80, + 0x8D, 0x79, 0x48, 0x2C, 0x39, 0x44, 0xB2, 0x66, + 0xA0, 0x2A, 0xA5, 0xA0, 0x8F, 0x66, 0xA3, 0xA3, + 0xA0, 0x8F, 0x8F, 0xA0, 0x8F, 0xA3, 0xB2, 0xB2, + 0xD8, 0xBC, 0x45, 0xEE, 0x67, 0x8D, 0x30, 0x30, + 0x52, 0x52, 0x80, 0x5D, 0x5D, 0x5D, 0x5D, 0x80, + 0x5D, 0x5D, 0x5D, 0x80, 0x3B, 0x67, 0xF9, 0x32, + 0x69, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xBF, 0xEC, 0xED, 0x2B, 0x30, 0x5D, 0x5D, + 0x80, 0x5D, 0x5D, 0x5D, 0x52, 0x30, 0x67, 0x2B, + 0xCF, 0xAA, 0xD8, 0x89, 0x89, 0x51, 0x66, 0x55, + 0x2A, 0x2A, 0xA5, 0x8F, 0x66, 0xA3, 0x2F, 0x2F, + 0xA3, 0xA3, 0x66, 0x98, 0x98, 0x2F, 0xB2, 0x2F, + 0xD1, 0x28, 0x56, 0xED, 0x62, 0x37, 0x5C, 0x79, + 0x8E, 0x2B, 0x2B, 0x30, 0x30, 0x30, 0x5D, 0x5D, + 0x5D, 0x5D, 0x5D, 0x80, 0x3B, 0xEE, 0x56, 0xA9, + 0x75, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x5F, 0x99, 0xD9, 0x45, 0x8D, 0x3B, 0x5D, + 0x5D, 0x3B, 0x5D, 0x8D, 0x2B, 0x79, 0x79, 0x41, + 0x83, 0xB2, 0xB2, 0x89, 0x89, 0x2F, 0xA0, 0x2A, + 0xAD, 0xA5, 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, 0xFF, 0xFF, + 0xFF, 0xF1, 0xE0, 0x00, 0x00, 0x00, 0xFF, 0xBF, + 0xFF, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x00, 0x00, + 0xFE, 0xBF, 0xFF, 0xFF, 0xFF, 0xE3, 0xC0, 0x00, + 0x00, 0x00, 0xFE, 0x3F, 0xFF, 0xFF, 0xFF, 0xC7, + 0xC0, 0x00, 0x00, 0x01, 0xFE, 0xBF, 0xFF, 0xFF, + 0xFF, 0xC7, 0x80, 0x00, 0x00, 0x01, 0xFE, 0x9F, + 0xFF, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x00, 0x01, + 0xFE, 0x07, 0xFF, 0xFF, 0xFF, 0x8F, 0x80, 0x00, + 0x00, 0x01, 0xFE, 0x87, 0xFF, 0xFF, 0xFF, 0x9F, + 0x80, 0x00, 0x00, 0x01, 0xFD, 0x33, 0xFF, 0xFF, + 0xFF, 0x9F, 0x80, 0x00, 0x00, 0x01, 0x80, 0xF3, + 0xFF, 0xFF, 0xFF, 0x9E, 0x80, 0x00, 0x00, 0x03, + 0x8B, 0xF9, 0xFF, 0xFF, 0xFF, 0x9F, 0x80, 0x00, + 0x00, 0x02, 0x27, 0xF8, 0xFF, 0xFF, 0xFF, 0x99, + 0x80, 0x00, 0x00, 0x00, 0x07, 0xF8, 0xFF, 0xFF, + 0xFF, 0x00, 0x80, 0x00, 0x00, 0x01, 0x8F, 0xF8, + 0xFF, 0xFF, 0xFE, 0x20, 0x60, 0x00, 0x00, 0x00, + 0xE3, 0xF8, 0xFF, 0xFF, 0xF8, 0x00, 0x30, 0x00, + 0x00, 0x00, 0xF8, 0x78, 0xFF, 0xFF, 0xC0, 0x40, + 0x38, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x7F, 0xFF, + 0x81, 0x00, 0x1C, 0x00, 0x00, 0x00, 0xFC, 0x20, + 0x7F, 0xFF, 0x90, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x78, 0x10, 0xFF, 0xFF, 0x80, 0x00, 0x0F, 0x80, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x80, 0x00, + 0x07, 0xC0, 0x00, 0x00, 0x00, 0x08, 0xFF, 0xFF, + 0xC0, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x04, + 0x7F, 0xFF, 0x80, 0x00, 0x03, 0xC0, 0x00, 0x10, + 0x00, 0x00, 0x1F, 0xFF, 0x80, 0x00, 0x01, 0x80, + 0x00, 0x30, 0x00, 0x00, 0x0F, 0xFF, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x01, 0x4F, 0xFF, + 0x80, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x0F, 0xFF, 0xC0, 0x00, 0x00, 0x80, 0x03, 0xF0, + 0x00, 0x00, 0x8F, 0xFF, 0x80, 0x00, 0x00, 0x40, + 0x0F, 0xF0, 0x00, 0x04, 0x1F, 0xFF, 0x80, 0x00, + 0x00, 0x7F, 0xFF, 0xF0, 0x00, 0x10, 0x1F, 0xFF, + 0xC0, 0x00, 0x00, 0x7F, 0xFF, 0xF0, 0x00, 0x40, + 0xFF, 0xFF, 0x98, 0x00, 0x00, 0xFF, 0xFF, 0xF0, + 0x00, 0x83, 0xFF, 0xFF, 0x81, 0xE0, 0x01, 0xFF, + 0xFF, 0xF8, 0x02, 0x07, 0xFF, 0xFF, 0x80, 0x3F, + 0x07, 0xE0, 0x00, 0x1C, 0x0C, 0x1F, 0xFF, 0xFF, + 0xF8, 0x03, 0xFF, 0x80, 0x00, 0x1F, 0x78, 0x1F, + 0xFF, 0xFF, 0xFF, 0x80, 0x7F, 0x00, 0x07, 0x0F, + 0xF0, 0x7F, 0xFF, 0xFF, 0xFF, 0xFE, 0x0C, 0x07, + 0xFF, 0x83, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x1F, 0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x07, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +}; unsigned char linux_logo16_red[0]; unsigned char linux_logo16_green[0]; diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/mostek.h linux/include/asm-sparc/mostek.h --- v2.1.114/linux/include/asm-sparc/mostek.h Sat Nov 9 00:29:44 1996 +++ linux/include/asm-sparc/mostek.h Tue Aug 4 23:57:51 1998 @@ -1,13 +1,15 @@ -/* $Id: mostek.h,v 1.8 1996/11/04 00:45:30 ecd Exp $ +/* $Id: mostek.h,v 1.9 1998/07/28 16:53:25 jj Exp $ * mostek.h: Describes the various Mostek time of day clock registers. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) + * Added intersil code 05/25/98 Chris Davis (cdavis@cois.on.ca) */ #ifndef _SPARC_MOSTEK_H #define _SPARC_MOSTEK_H +#include #include /* M48T02 Register Map (adapted from Sun NVRAM/Hostid FAQ) @@ -114,7 +116,46 @@ }; extern struct mostek48t08 *mstk48t08_regs; -enum sparc_clock_type { MSTK48T02, MSTK48T08, MSTK_INVALID }; extern enum sparc_clock_type sp_clock_typ; + +#ifdef CONFIG_SUN4 +enum sparc_clock_type { MSTK48T02, MSTK48T08, \ +INTERSIL, MSTK_INVALID }; +#else +enum sparc_clock_type { MSTK48T02, MSTK48T08, \ +MSTK_INVALID }; +#endif + +#ifdef CONFIG_SUN4 +/* intersil on a sun 4/260 code data from harris doc */ +struct intersil_dt { + volatile unsigned char int_csec; + volatile unsigned char int_hour; + volatile unsigned char int_min; + volatile unsigned char int_sec; + volatile unsigned char int_month; + volatile unsigned char int_day; + volatile unsigned char int_year; + volatile unsigned char int_dow; +}; + +struct intersil { + struct intersil_dt clk; + struct intersil_dt cmp; + volatile unsigned char int_intr_reg; + volatile unsigned char int_cmd_reg; +}; + +#define INTERSIL_STOP 0x0 +#define INTERSIL_START 0x8 +#define INTERSIL_INTR_DISABLE 0x0 +#define INTERSIL_INTR_ENABLE 0x10 +#define INTERSIL_32K 0x0 +#define INTERSIL_NORMAL 0x0 +#define INTERSIL_24H 0x4 +#define INTERSIL_INT_100HZ 0x2 + +/* end of intersil info */ +#endif #endif /* !(_SPARC_MOSTEK_H) */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/page.h linux/include/asm-sparc/page.h --- v2.1.114/linux/include/asm-sparc/page.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc/page.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.42 1998/05/01 13:55:21 mj Exp $ +/* $Id: page.h,v 1.43 1998/05/11 08:40:11 davem Exp $ * page.h: Various defines and such for MMU operations on the Sparc for * the Linux kernel. * @@ -28,8 +28,6 @@ #ifndef __ASSEMBLY__ -#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) -#define free_user_page(page, addr) free_page(addr) #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) @@ -270,8 +268,7 @@ BTFIXUPDEF_SETHI(sparc_unmapped_base) -#define TASK_UNMAPPED_BASE(off) BTFIXUP_SETHI(sparc_unmapped_base) -#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr) +#define TASK_UNMAPPED_BASE BTFIXUP_SETHI(sparc_unmapped_base) /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) 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 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.74 1998/03/11 04:08:37 tdyas Exp $ */ +/* $Id: pgtable.h,v 1.77 1998/08/04 20:51:19 davem Exp $ */ #ifndef _SPARC_PGTABLE_H #define _SPARC_PGTABLE_H @@ -91,6 +91,7 @@ #define VMALLOC_VMADDR(x) ((unsigned long)(x)) /* This is the same accross all platforms */ #define VMALLOC_START (0xfe300000) +#define VMALLOC_END ~0x0UL BTFIXUPDEF_INT(page_none) BTFIXUPDEF_INT(page_shared) @@ -354,6 +355,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 +368,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 @@ -571,7 +574,6 @@ #define module_map vmalloc #define module_unmap vfree -#define module_shrink vshrink /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define PageSkip(page) (test_bit(PG_skip, &(page)->flags)) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/pgtsrmmu.h linux/include/asm-sparc/pgtsrmmu.h --- v2.1.114/linux/include/asm-sparc/pgtsrmmu.h Thu Mar 27 14:40:09 1997 +++ linux/include/asm-sparc/pgtsrmmu.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: pgtsrmmu.h,v 1.28 1997/03/15 07:47:52 davem Exp $ +/* $Id: pgtsrmmu.h,v 1.29 1998/07/26 03:05:42 davem Exp $ * pgtsrmmu.h: SRMMU page table defines and code. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -30,6 +30,7 @@ #define SRMMU_PGD_TABLE_SIZE 0x400 /* 256 entries, 4 bytes a piece */ #define SRMMU_VMALLOC_START (0xfe300000) +#define SRMMU_VMALLOC_END ~0x0UL /* Definition of the values in the ET field of PTD's and PTE's */ #define SRMMU_ET_MASK 0x3 diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/pgtsun4.h linux/include/asm-sparc/pgtsun4.h --- v2.1.114/linux/include/asm-sparc/pgtsun4.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/pgtsun4.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: pgtsun4.h,v 1.3 1998/01/30 11:00:01 jj Exp $ +/* $Id: pgtsun4.h,v 1.4 1998/07/26 03:05:42 davem Exp $ * pgtsun4.h: Sun4 specific pgtable.h defines and code. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -48,6 +48,7 @@ * area, makes sense. This works out to the value below. */ #define SUN4C_VMALLOC_START (0xfe300000) +#define SUN4C_VMALLOC_END ~0x0UL /* * Sparc SUN4C pte fields. diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/pgtsun4c.h linux/include/asm-sparc/pgtsun4c.h --- v2.1.114/linux/include/asm-sparc/pgtsun4c.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/pgtsun4c.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: pgtsun4c.h,v 1.35 1998/01/30 11:00:05 jj Exp $ +/* $Id: pgtsun4c.h,v 1.36 1998/07/26 03:05:44 davem Exp $ * pgtsun4c.h: Sun4c specific pgtable.h defines and code. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -47,6 +47,7 @@ * area, makes sense. This works out to the value below. */ #define SUN4C_VMALLOC_START (0xfe300000) +#define SUN4C_VMALLOC_END ~0x0UL /* * Sparc SUN4C pte fields. diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/processor.h linux/include/asm-sparc/processor.h --- v2.1.114/linux/include/asm-sparc/processor.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc/processor.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.63 1998/04/23 08:26:22 davem Exp $ +/* $Id: processor.h,v 1.67 1998/07/31 20:03:23 zaitcev Exp $ * include/asm-sparc/processor.h * * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) @@ -37,11 +37,6 @@ */ #define TASK_SIZE PAGE_OFFSET -#define COPY_TASK_STRUCT(dst, src) \ -do { \ - *dst = *src; \ -} while (0) - struct fpq { unsigned long *insn_addr; unsigned long insn; @@ -83,7 +78,6 @@ unsigned long fsr; unsigned long fpqdepth; struct fpq fpqueue[16]; - struct sigstack sstk_info; unsigned long flags; mm_segment_t current_ds; struct exec core_exec; /* just what it says. */ @@ -111,8 +105,6 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \ /* FPU status, FPU qdepth, FPU queue */ \ 0, 0, { { 0, 0, }, }, \ -/* sstk_info */ \ -{ 0, 0, }, \ /* flags, current_ds, */ \ SPARC_FLAG_KTHREAD, KERNEL_DS, \ /* core_exec */ \ @@ -158,6 +150,8 @@ #define release_segments(mm) do { } while (0) #ifdef __KERNEL__ + +extern struct task_struct *last_task_used_math; /* Allocation and freeing of basic task resources. */ BTFIXUPDEF_CALL(struct task_struct *, alloc_task_struct, void) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/sbus.h linux/include/asm-sparc/sbus.h --- v2.1.114/linux/include/asm-sparc/sbus.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/sbus.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sbus.h,v 1.14 1998/03/09 14:04:56 jj Exp $ +/* $Id: sbus.h,v 1.15 1998/05/22 14:33:36 jj Exp $ * sbus.h: Defines for the Sun SBus. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -52,7 +52,7 @@ struct linux_prom_registers reg_addrs[PROMREG_MAX]; int num_registers, ranges_applied; - struct linux_prom_irqs irqs[PROMINTR_MAX]; + unsigned int irqs[4]; int num_irqs; unsigned long sbus_addr; /* Absolute base address for device. */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/siginfo.h linux/include/asm-sparc/siginfo.h --- v2.1.114/linux/include/asm-sparc/siginfo.h Tue Jul 28 14:21:09 1998 +++ linux/include/asm-sparc/siginfo.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: siginfo.h,v 1.1 1997/12/14 23:24:40 ecd Exp $ +/* $Id: siginfo.h,v 1.2 1998/07/30 11:31:49 davem Exp $ * siginfo.c: */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/signal.h linux/include/asm-sparc/signal.h --- v2.1.114/linux/include/asm-sparc/signal.h Mon Jan 12 15:15:54 1998 +++ linux/include/asm-sparc/signal.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: signal.h,v 1.31 1997/12/14 23:24:41 ecd Exp $ */ +/* $Id: signal.h,v 1.34 1998/07/29 16:32:38 jj Exp $ */ #ifndef _ASMSPARC_SIGNAL_H #define _ASMSPARC_SIGNAL_H @@ -75,6 +75,7 @@ #define SIGPROF 27 #define SIGWINCH 28 #define SIGLOST 29 +#define SIGPWR SIGLOST #define SIGUSR1 30 #define SIGUSR2 31 @@ -133,6 +134,7 @@ */ #define SA_NOCLDSTOP SV_IGNCHILD #define SA_STACK SV_SSTACK +#define SA_ONSTACK SV_SSTACK #define SA_RESTART SV_INTR #define SA_ONESHOT SV_RESET #define SA_INTERRUPT 0x10 @@ -144,6 +146,15 @@ #define SIG_BLOCK 0x01 /* for blocking signals */ #define SIG_UNBLOCK 0x02 /* for unblocking signals */ #define SIG_SETMASK 0x04 /* for setting the signal mask */ + +/* + * sigaltstack controls + */ +#define SS_ONSTACK 1 +#define SS_DISABLE 2 + +#define MINSIGSTKSZ 4096 +#define SIGSTKSZ 16384 #ifdef __KERNEL__ /* diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/smp.h linux/include/asm-sparc/smp.h --- v2.1.114/linux/include/asm-sparc/smp.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/smp.h Tue Aug 4 16:03:35 1998 @@ -43,16 +43,6 @@ extern struct cpuinfo_sparc cpu_data[NR_CPUS]; extern unsigned long cpu_offset[NR_CPUS]; -struct klock_info { - unsigned char kernel_flag; - unsigned char akp; -}; - -extern struct klock_info klock_info; - -#define KLOCK_HELD 0xff -#define KLOCK_CLEAR 0x00 - /* * Private routines/data */ @@ -108,6 +98,10 @@ extern __volatile__ int cpu_number_map[NR_CPUS]; extern __volatile__ int __cpu_logical_map[NR_CPUS]; extern unsigned long smp_proc_in_lock[NR_CPUS]; + +/* As idle task checks need_resched in a tight loop, it is not necessary to + wake it up. -jj */ +#define smp_send_reschedule(cpu) do {} while (0) extern __inline__ int cpu_logical_map(int cpu) { diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/socket.h linux/include/asm-sparc/socket.h --- v2.1.114/linux/include/asm-sparc/socket.h Mon Jan 12 15:15:54 1998 +++ linux/include/asm-sparc/socket.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: socket.h,v 1.11 1997/10/19 00:19:14 davem Exp $ */ +/* $Id: socket.h,v 1.12 1998/07/22 22:06:48 davem Exp $ */ #ifndef _ASM_SOCKET_H #define _ASM_SOCKET_H @@ -36,6 +36,9 @@ #define SO_PRIORITY 0x000c #define SO_BINDTODEVICE 0x000d + +#define SO_ATTACH_FILTER 0x001a +#define SO_DETACH_FILTER 0x001b /* Security levels - as per NRL IPv6 - don't actually do anything */ #define SO_SECURITY_AUTHENTICATION 0x5001 diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/softirq.h linux/include/asm-sparc/softirq.h --- v2.1.114/linux/include/asm-sparc/softirq.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/softirq.h Tue Aug 4 16:03:35 1998 @@ -99,6 +99,7 @@ #define softirq_trylock(cpu) (__sparc_bh_counter ? 0 : (__sparc_bh_counter=1)) #define softirq_endlock(cpu) (__sparc_bh_counter = 0) #define clear_active_bhs(x) (bh_active &= ~(x)) +#define synchronize_bh() do { } while (0) /* XXX implement SMP version -DaveM */ #define init_bh(nr, routine) \ do { int ent = nr; \ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/spinlock.h linux/include/asm-sparc/spinlock.h --- v2.1.114/linux/include/asm-sparc/spinlock.h Mon Jun 16 16:36:00 1997 +++ linux/include/asm-sparc/spinlock.h Tue Aug 4 16:03:35 1998 @@ -10,8 +10,13 @@ #ifndef __SMP__ -typedef struct { } spinlock_t; -#define SPIN_LOCK_UNLOCKED { } +#if (__GNUC__ > 2) || (__GNUC_MINOR__ >= 8) + typedef struct { } spinlock_t; + #define SPIN_LOCK_UNLOCKED { } +#else + typedef unsigned char spinlock_t; + #define SPIN_LOCK_UNLOCKED 0 +#endif #define spin_lock_init(lock) do { } while(0) #define spin_lock(lock) do { } while(0) @@ -67,7 +72,9 @@ #define SPIN_LOCK_UNLOCKED { 0, 0 } #define spin_lock_init(lp) do { (lp)->owner_pc = 0; (lp)->lock = 0; } while(0) -#define spin_unlock_wait(lp) do { barrier(); } while((lp)->lock) +#define spin_unlock_wait(lp) \ +do { barrier(); \ +} while(*(volatile unsigned char *)(&(lp)->lock)) extern void _spin_lock(spinlock_t *lock); extern int _spin_trylock(spinlock_t *lock); diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/stat.h linux/include/asm-sparc/stat.h --- v2.1.114/linux/include/asm-sparc/stat.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/stat.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: stat.h,v 1.8 1998/02/06 12:52:07 jj Exp $ */ +/* $Id: stat.h,v 1.9 1998/07/26 05:24:39 davem Exp $ */ #ifndef _SPARC_STAT_H #define _SPARC_STAT_H @@ -37,41 +37,5 @@ off_t st_blocks; unsigned long __unused4[2]; }; - -typedef struct { - __u32 major; - __u32 minor; -} __new_dev_t; - -struct stat64 { - __new_dev_t st_dev; - __u64 st_ino; - __u32 st_mode; - __u32 st_nlink; - __s32 st_uid; - __s32 st_gid; - __new_dev_t st_rdev; - __s64 st_size; - __u64 st_blocks; - __s32 st_atime; - __u32 __unused1; - __s32 st_mtime; - __u32 __unused2; - __s32 st_ctime; - __u32 __unused3; - __u32 st_blksize; - __u32 __unused4; -}; - -#define __XSTAT_VER_1 1 -#define __XSTAT_VER_2 2 -#define __XSTAT_VER_MASK 0xff - -#define __XSTAT_VER_XSTAT 0x000 -#define __XSTAT_VER_LXSTAT 0x100 -#define __XSTAT_VER_FXSTAT 0x200 -#define __XSTAT_VER_TYPEMASK 0xff00 - -#define __XMKNOD_VER_1 1 #endif diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/sun4paddr.h linux/include/asm-sparc/sun4paddr.h --- v2.1.114/linux/include/asm-sparc/sun4paddr.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/sun4paddr.h Tue Aug 4 16:03:35 1998 @@ -1,19 +1,56 @@ -/* $Id: sun4paddr.h,v 1.2 1998/02/09 13:26:41 jj Exp $ +/* $Id: sun4paddr.h,v 1.3 1998/07/28 16:53:27 jj Exp $ * sun4paddr.h: Various physical addresses on sun4 machines * * Copyright (C) 1997 Anton Blanchard (anton@progsoc.uts.edu.au) + * Copyright (C) 1998 Chris Davis (cdavis@cois.on.ca) + * + * Now supports more sun4's */ #ifndef _SPARC_SUN4PADDR_H #define _SPARC_SUN4PADDR_H -#define SUN4_MEMREG_PHYSADDR 0xf4000000 #define SUN4_IE_PHYSADDR 0xf5000000 -#define SUN4_300_MOSTEK_PHYSADDR 0xf2000000 +#define SUN4_UNUSED_PHYSADDR 0 + +/* these work for me */ +#define SUN4_200_MEMREG_PHYSADDR 0xf4000000 +#define SUN4_200_CLOCK_PHYSADDR 0xf3000000 +#define SUN4_200_BWTWO_PHYSADDR 0xfd000000 +#define SUN4_200_ETH_PHYSADDR 0xf6000000 +#define SUN4_200_SI_PHYSADDR 0xff200000 + +/* these were here before */ +#define SUN4_300_MEMREG_PHYSADDR 0xf4000000 +#define SUN4_300_CLOCK_PHYSADDR 0xf2000000 #define SUN4_300_TIMER_PHYSADDR 0xef000000 #define SUN4_300_ETH_PHYSADDR 0xf9000000 #define SUN4_300_BWTWO_PHYSADDR 0xfb400000 #define SUN4_300_DMA_PHYSADDR 0xfa001000 #define SUN4_300_ESP_PHYSADDR 0xfa000000 + +/* Are these right? */ +#define SUN4_400_MEMREG_PHYSADDR 0xf4000000 +#define SUN4_400_CLOCK_PHYSADDR 0xf2000000 +#define SUN4_400_TIMER_PHYSADDR 0xef000000 +#define SUN4_400_ETH_PHYSADDR 0xf9000000 +#define SUN4_400_BWTWO_PHYSADDR 0xfb400000 +#define SUN4_400_DMA_PHYSADDR 0xfa001000 +#define SUN4_400_ESP_PHYSADDR 0xfa000000 + +/* + these are the actual values set and used in the code. Unused items set + to SUN_UNUSED_PHYSADDR + */ + +extern int sun4_memreg_physaddr; /* memory register (ecc?) */ +extern int sun4_clock_physaddr; /* system clock */ +extern int sun4_timer_physaddr; /* timer, where applicable */ +extern int sun4_eth_physaddr; /* onboard ethernet (ie/le) */ +extern int sun4_si_physaddr; /* sun3 scsi adapter */ +extern int sun4_bwtwo_physaddr; /* onboard bw2 */ +extern int sun4_dma_physaddr; /* scsi dma */ +extern int sun4_esp_physaddr; /* esp scsi */ +extern int sun4_ie_physaddr; /* interrupt enable */ #endif /* !(_SPARC_SUN4PADDR_H) */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/svr4.h linux/include/asm-sparc/svr4.h --- v2.1.114/linux/include/asm-sparc/svr4.h Tue Mar 10 10:03:35 1998 +++ linux/include/asm-sparc/svr4.h Tue Aug 4 16:03:35 1998 @@ -80,7 +80,7 @@ /* flags for stack_t.flags */ enum svr4_stack_flags { - SS_ONSTACK, + SVR4_SS_ONSTACK, SVR4_SS_DISABLE, }; diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/unistd.h linux/include/asm-sparc/unistd.h --- v2.1.114/linux/include/asm-sparc/unistd.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc/unistd.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.40 1998/04/14 13:49:55 jj Exp $ */ +/* $Id: unistd.h,v 1.42 1998/07/28 13:08:35 jj Exp $ */ #ifndef _SPARC_UNISTD_H #define _SPARC_UNISTD_H @@ -29,22 +29,22 @@ #define __NR_unlink 10 /* Common */ #define __NR_execv 11 /* SunOS Specific */ #define __NR_chdir 12 /* Common */ -#define __NR_xstat 13 /* Linux Specific */ +/* #define __NR_ni_syscall 13 ENOSYS under SunOS */ #define __NR_mknod 14 /* Common */ #define __NR_chmod 15 /* Common */ #define __NR_chown 16 /* Common */ #define __NR_brk 17 /* Common */ -#define __NR_xmknod 18 /* Linux Specific */ +/* #define __NR_ni_syscall 18 ENOSYS under SunOS */ #define __NR_lseek 19 /* Common */ #define __NR_getpid 20 /* Common */ -/* #define __NR_ni_syscall 21 ENOSYS under SunOS */ -/* #define __NR_ni_syscall 22 ENOSYS under SunOS */ +#define __NR_capget 21 /* Linux Specific */ +#define __NR_capset 22 /* Linux Specific */ #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ #define __NR_getuid 24 /* Common */ /* #define __NR_ni_syscall 25 ENOSYS under SunOS */ #define __NR_ptrace 26 /* Common */ #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ -/* #define __NR_ni_syscall 28 ENOSYS under SunOS */ +#define __NR_sigaltstack 28 /* Common */ #define __NR_pause 29 /* Is sigblock(0)->sigpause() in SunOS */ #define __NR_utime 30 /* Implemented via utimes() under SunOS */ #define __NR_stty 31 /* Implemented via ioctl() under SunOS */ @@ -55,7 +55,7 @@ #define __NR_sync 36 /* Common */ #define __NR_kill 37 /* Common */ #define __NR_stat 38 /* Common */ -/* #define __NR_ni_syscall 39 ENOSYS under SunOS */ +#define __NR_sendfile 39 /* Linux Specific */ #define __NR_lstat 40 /* Common */ #define __NR_dup 41 /* Common */ #define __NR_pipe 42 /* Common */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc/xstat.h linux/include/asm-sparc/xstat.h --- v2.1.114/linux/include/asm-sparc/xstat.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc/xstat.h Wed Dec 31 16:00:00 1969 @@ -1,35 +0,0 @@ -/* $Id: xstat.h,v 1.1 1998/02/06 12:52:08 jj Exp $ - * xstat.h: sys_xstat/xmknod architecture dependent stuff. - * - * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -extern __inline__ int cp_xstat(struct inode *inode, struct stat64 *s, unsigned long blocks, int blksize) -{ - struct stat64 tmp; - - memset (&tmp, 0, sizeof(tmp)); - tmp.st_dev.major = MAJOR(inode->i_dev); - tmp.st_dev.minor = MINOR(inode->i_dev); - tmp.st_ino = inode->i_ino; - tmp.st_mode = inode->i_mode; - tmp.st_nlink = inode->i_nlink; - tmp.st_uid = inode->i_uid; - tmp.st_gid = inode->i_gid; - tmp.st_rdev.major = MAJOR(inode->i_rdev); - tmp.st_rdev.minor = MINOR(inode->i_rdev); - tmp.st_size = inode->i_size; - tmp.st_blksize = blksize; - tmp.st_blocks = blocks; - tmp.st_atime = inode->i_atime; - tmp.st_mtime = inode->i_mtime; - tmp.st_ctime = inode->i_ctime; - return copy_to_user(s,&tmp,sizeof(tmp)); -} - -extern __inline__ int get_user_new_dev_t(kdev_t *kdev, __new_dev_t *udev) { - __new_dev_t ndev; - if (copy_from_user (&ndev, udev, sizeof(__new_dev_t))) return -EFAULT; - *kdev = MKDEV(ndev.major, ndev.minor); - return 0; -} diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/asm_offsets.h linux/include/asm-sparc64/asm_offsets.h --- v2.1.114/linux/include/asm-sparc64/asm_offsets.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/asm_offsets.h Tue Aug 4 16:03:35 1998 @@ -14,172 +14,176 @@ #define ASIZ_task_addr_limit 0x00000008 #define AOFF_task_exec_domain 0x00000020 #define ASIZ_task_exec_domain 0x00000008 -#define AOFF_task_debugreg 0x00000028 -#define ASIZ_task_debugreg 0x00000040 -#define AOFF_task_counter 0x00000068 +#define AOFF_task_need_resched 0x00000028 +#define ASIZ_task_need_resched 0x00000008 +#define AOFF_task_counter 0x00000030 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000070 +#define AOFF_task_priority 0x00000038 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_binfmt 0x00000078 -#define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_next_task 0x00000080 +#define AOFF_task_has_cpu 0x00000040 +#define ASIZ_task_has_cpu 0x00000004 +#define AOFF_task_processor 0x00000044 +#define ASIZ_task_processor 0x00000004 +#define AOFF_task_last_processor 0x00000048 +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_lock_depth 0x0000004c +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_next_task 0x00000050 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000088 +#define AOFF_task_prev_task 0x00000058 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_next_run 0x00000090 +#define AOFF_task_next_run 0x00000060 #define ASIZ_task_next_run 0x00000008 -#define AOFF_task_prev_run 0x00000098 +#define AOFF_task_prev_run 0x00000068 #define ASIZ_task_prev_run 0x00000008 -#define AOFF_task_exit_code 0x000000a0 +#define AOFF_task_binfmt 0x00000070 +#define ASIZ_task_binfmt 0x00000008 +#define AOFF_task_exit_code 0x00000078 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x000000a4 +#define AOFF_task_exit_signal 0x0000007c #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x000000a8 +#define AOFF_task_pdeath_signal 0x00000080 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x000000b0 +#define AOFF_task_personality 0x00000088 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x000000bc +#define AOFF_task_pid 0x00000094 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x000000c0 +#define AOFF_task_pgrp 0x00000098 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x000000c4 +#define AOFF_task_tty_old_pgrp 0x0000009c #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000c8 +#define AOFF_task_session 0x000000a0 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000cc +#define AOFF_task_leader 0x000000a4 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000d0 +#define AOFF_task_p_opptr 0x000000a8 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000d8 +#define AOFF_task_p_pptr 0x000000b0 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000e0 +#define AOFF_task_p_cptr 0x000000b8 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000e8 +#define AOFF_task_p_ysptr 0x000000c0 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000f0 +#define AOFF_task_p_osptr 0x000000c8 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000f8 +#define AOFF_task_pidhash_next 0x000000d0 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x00000100 +#define AOFF_task_pidhash_pprev 0x000000d8 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_tarray_ptr 0x00000108 +#define AOFF_task_tarray_ptr 0x000000e0 #define ASIZ_task_tarray_ptr 0x00000008 -#define AOFF_task_wait_chldexit 0x00000110 +#define AOFF_task_wait_chldexit 0x000000e8 #define ASIZ_task_wait_chldexit 0x00000008 -#define AOFF_task_timeout 0x00000118 +#define AOFF_task_timeout 0x000000f0 #define ASIZ_task_timeout 0x00000008 -#define AOFF_task_policy 0x00000120 +#define AOFF_task_policy 0x000000f8 #define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000128 +#define AOFF_task_rt_priority 0x00000100 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000130 +#define AOFF_task_it_real_value 0x00000108 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000138 +#define AOFF_task_it_prof_value 0x00000110 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000140 +#define AOFF_task_it_virt_value 0x00000118 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000148 +#define AOFF_task_it_real_incr 0x00000120 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000150 +#define AOFF_task_it_prof_incr 0x00000128 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000158 +#define AOFF_task_it_virt_incr 0x00000130 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000160 +#define AOFF_task_real_timer 0x00000138 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000188 +#define AOFF_task_times 0x00000160 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x000001a8 +#define AOFF_task_start_time 0x00000180 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x000001b0 +#define AOFF_task_per_cpu_utime 0x00000188 #define ASIZ_task_per_cpu_utime 0x00000008 -#define AOFF_task_min_flt 0x000001c0 +#define AOFF_task_min_flt 0x00000198 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000001c8 +#define AOFF_task_maj_flt 0x000001a0 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000001d0 +#define AOFF_task_nswap 0x000001a8 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000001d8 +#define AOFF_task_cmin_flt 0x000001b0 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000001e0 +#define AOFF_task_cmaj_flt 0x000001b8 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000001e8 +#define AOFF_task_cnswap 0x000001c0 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_swap_address 0x000001f8 +#define AOFF_task_swap_address 0x000001d0 #define ASIZ_task_swap_address 0x00000008 -#define AOFF_task_old_maj_flt 0x00000200 +#define AOFF_task_old_maj_flt 0x000001d8 #define ASIZ_task_old_maj_flt 0x00000008 -#define AOFF_task_dec_flt 0x00000208 +#define AOFF_task_dec_flt 0x000001e0 #define ASIZ_task_dec_flt 0x00000008 -#define AOFF_task_swap_cnt 0x00000210 +#define AOFF_task_swap_cnt 0x000001e8 #define ASIZ_task_swap_cnt 0x00000008 -#define AOFF_task_uid 0x00000218 +#define AOFF_task_uid 0x000001f0 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x0000021c +#define AOFF_task_euid 0x000001f4 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x00000220 +#define AOFF_task_suid 0x000001f8 #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x00000224 +#define AOFF_task_fsuid 0x000001fc #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x00000228 +#define AOFF_task_gid 0x00000200 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x0000022c +#define AOFF_task_egid 0x00000204 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x00000230 +#define AOFF_task_sgid 0x00000208 #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x00000234 +#define AOFF_task_fsgid 0x0000020c #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x00000238 +#define AOFF_task_ngroups 0x00000210 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x0000023c +#define AOFF_task_groups 0x00000214 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x000002bc +#define AOFF_task_cap_effective 0x00000294 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x000002c0 +#define AOFF_task_cap_inheritable 0x00000298 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x000002c4 +#define AOFF_task_cap_permitted 0x0000029c #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_rlim 0x000002c8 +#define AOFF_task_rlim 0x000002a0 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000368 +#define AOFF_task_used_math 0x00000340 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000036a +#define AOFF_task_comm 0x00000342 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000037c +#define AOFF_task_link_count 0x00000354 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000380 +#define AOFF_task_tty 0x00000358 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000388 +#define AOFF_task_semundo 0x00000360 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000390 +#define AOFF_task_semsleeping 0x00000368 #define ASIZ_task_semsleeping 0x00000008 -#define AOFF_task_tss 0x000003a0 -#define ASIZ_task_tss 0x00000490 -#define AOFF_task_fs 0x00000830 +#define AOFF_task_tss 0x00000370 +#define ASIZ_task_tss 0x00000440 +#define AOFF_task_fs 0x000007b0 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x00000838 +#define AOFF_task_files 0x000007b8 #define ASIZ_task_files 0x00000008 -#define AOFF_task_mm 0x00000840 +#define AOFF_task_mm 0x000007c0 #define ASIZ_task_mm 0x00000008 -#define AOFF_task_sig 0x00000848 +#define AOFF_task_sigmask_lock 0x000007c8 +#define ASIZ_task_sigmask_lock 0x00000000 +#define AOFF_task_sig 0x000007c8 #define ASIZ_task_sig 0x00000008 -#define AOFF_task_signal 0x00000850 +#define AOFF_task_signal 0x000007d0 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x00000858 +#define AOFF_task_blocked 0x000007d8 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x00000860 +#define AOFF_task_sigqueue 0x000007e0 #define ASIZ_task_sigqueue 0x00000008 -#define AOFF_task_sigqueue_tail 0x00000868 +#define AOFF_task_sigqueue_tail 0x000007e8 #define ASIZ_task_sigqueue_tail 0x00000008 -#define AOFF_task_has_cpu 0x00000870 -#define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000874 -#define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000878 -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x0000087c -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_sigmask_lock 0x00000880 -#define ASIZ_task_sigmask_lock 0x00000000 +#define AOFF_task_sas_ss_sp 0x000007f0 +#define ASIZ_task_sas_ss_sp 0x00000008 +#define AOFF_task_sas_ss_size 0x000007f8 +#define ASIZ_task_sas_ss_size 0x00000008 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_cache 0x00000008 @@ -230,20 +234,20 @@ #define ASIZ_mm_segments 0x00000008 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 -#define AOFF_thread_kpc 0x00000008 -#define ASIZ_thread_kpc 0x00000004 -#define AOFF_thread_wstate 0x0000000c +#define AOFF_thread_wstate 0x00000008 #define ASIZ_thread_wstate 0x00000002 -#define AOFF_thread_cwp 0x0000000e +#define AOFF_thread_cwp 0x0000000a #define ASIZ_thread_cwp 0x00000002 -#define AOFF_thread_flags 0x00000010 +#define AOFF_thread_flags 0x0000000c #define ASIZ_thread_flags 0x00000002 -#define AOFF_thread_ctx 0x00000012 +#define AOFF_thread_ctx 0x0000000e #define ASIZ_thread_ctx 0x00000002 -#define AOFF_thread_w_saved 0x00000014 +#define AOFF_thread_w_saved 0x00000010 #define ASIZ_thread_w_saved 0x00000002 -#define AOFF_thread_new_signal 0x00000016 +#define AOFF_thread_new_signal 0x00000012 #define ASIZ_thread_new_signal 0x00000002 +#define AOFF_thread____pad 0x00000014 +#define ASIZ_thread____pad 0x00000004 #define AOFF_thread_current_ds 0x00000018 #define ASIZ_thread_current_ds 0x00000008 #define AOFF_thread_kregs 0x00000020 @@ -251,15 +255,21 @@ #define AOFF_thread_utraps 0x00000028 #define ASIZ_thread_utraps 0x00000008 #define AOFF_thread_reg_window 0x00000030 -#define ASIZ_thread_reg_window 0x00000400 -#define AOFF_thread_rwbuf_stkptrs 0x00000430 -#define ASIZ_thread_rwbuf_stkptrs 0x00000040 -#define AOFF_thread_sig_address 0x00000470 +#define ASIZ_thread_reg_window 0x00000380 +#define AOFF_thread_rwbuf_stkptrs 0x000003b0 +#define ASIZ_thread_rwbuf_stkptrs 0x00000038 +#define AOFF_thread_sig_address 0x000003e8 #define ASIZ_thread_sig_address 0x00000008 -#define AOFF_thread_sig_desc 0x00000478 +#define AOFF_thread_sig_desc 0x000003f0 #define ASIZ_thread_sig_desc 0x00000008 -#define AOFF_thread_sstk_info 0x00000480 -#define ASIZ_thread_sstk_info 0x00000010 +#define AOFF_thread_fpdepth 0x000003f8 +#define ASIZ_thread_fpdepth 0x00000001 +#define AOFF_thread_fpsaved 0x000003f9 +#define ASIZ_thread_fpsaved 0x00000007 +#define AOFF_thread_gsr 0x00000400 +#define ASIZ_thread_gsr 0x00000007 +#define AOFF_thread_xfsr 0x00000408 +#define ASIZ_thread_xfsr 0x00000038 #else /* __SMP__ */ @@ -273,172 +283,176 @@ #define ASIZ_task_addr_limit 0x00000008 #define AOFF_task_exec_domain 0x00000020 #define ASIZ_task_exec_domain 0x00000008 -#define AOFF_task_debugreg 0x00000028 -#define ASIZ_task_debugreg 0x00000040 -#define AOFF_task_counter 0x00000068 +#define AOFF_task_need_resched 0x00000028 +#define ASIZ_task_need_resched 0x00000008 +#define AOFF_task_counter 0x00000030 #define ASIZ_task_counter 0x00000008 -#define AOFF_task_priority 0x00000070 +#define AOFF_task_priority 0x00000038 #define ASIZ_task_priority 0x00000008 -#define AOFF_task_binfmt 0x00000078 -#define ASIZ_task_binfmt 0x00000008 -#define AOFF_task_next_task 0x00000080 +#define AOFF_task_has_cpu 0x00000040 +#define ASIZ_task_has_cpu 0x00000004 +#define AOFF_task_processor 0x00000044 +#define ASIZ_task_processor 0x00000004 +#define AOFF_task_last_processor 0x00000048 +#define ASIZ_task_last_processor 0x00000004 +#define AOFF_task_lock_depth 0x0000004c +#define ASIZ_task_lock_depth 0x00000004 +#define AOFF_task_next_task 0x00000050 #define ASIZ_task_next_task 0x00000008 -#define AOFF_task_prev_task 0x00000088 +#define AOFF_task_prev_task 0x00000058 #define ASIZ_task_prev_task 0x00000008 -#define AOFF_task_next_run 0x00000090 +#define AOFF_task_next_run 0x00000060 #define ASIZ_task_next_run 0x00000008 -#define AOFF_task_prev_run 0x00000098 +#define AOFF_task_prev_run 0x00000068 #define ASIZ_task_prev_run 0x00000008 -#define AOFF_task_exit_code 0x000000a0 +#define AOFF_task_binfmt 0x00000070 +#define ASIZ_task_binfmt 0x00000008 +#define AOFF_task_exit_code 0x00000078 #define ASIZ_task_exit_code 0x00000004 -#define AOFF_task_exit_signal 0x000000a4 +#define AOFF_task_exit_signal 0x0000007c #define ASIZ_task_exit_signal 0x00000004 -#define AOFF_task_pdeath_signal 0x000000a8 +#define AOFF_task_pdeath_signal 0x00000080 #define ASIZ_task_pdeath_signal 0x00000004 -#define AOFF_task_personality 0x000000b0 +#define AOFF_task_personality 0x00000088 #define ASIZ_task_personality 0x00000008 -#define AOFF_task_pid 0x000000bc +#define AOFF_task_pid 0x00000094 #define ASIZ_task_pid 0x00000004 -#define AOFF_task_pgrp 0x000000c0 +#define AOFF_task_pgrp 0x00000098 #define ASIZ_task_pgrp 0x00000004 -#define AOFF_task_tty_old_pgrp 0x000000c4 +#define AOFF_task_tty_old_pgrp 0x0000009c #define ASIZ_task_tty_old_pgrp 0x00000004 -#define AOFF_task_session 0x000000c8 +#define AOFF_task_session 0x000000a0 #define ASIZ_task_session 0x00000004 -#define AOFF_task_leader 0x000000cc +#define AOFF_task_leader 0x000000a4 #define ASIZ_task_leader 0x00000004 -#define AOFF_task_p_opptr 0x000000d0 +#define AOFF_task_p_opptr 0x000000a8 #define ASIZ_task_p_opptr 0x00000008 -#define AOFF_task_p_pptr 0x000000d8 +#define AOFF_task_p_pptr 0x000000b0 #define ASIZ_task_p_pptr 0x00000008 -#define AOFF_task_p_cptr 0x000000e0 +#define AOFF_task_p_cptr 0x000000b8 #define ASIZ_task_p_cptr 0x00000008 -#define AOFF_task_p_ysptr 0x000000e8 +#define AOFF_task_p_ysptr 0x000000c0 #define ASIZ_task_p_ysptr 0x00000008 -#define AOFF_task_p_osptr 0x000000f0 +#define AOFF_task_p_osptr 0x000000c8 #define ASIZ_task_p_osptr 0x00000008 -#define AOFF_task_pidhash_next 0x000000f8 +#define AOFF_task_pidhash_next 0x000000d0 #define ASIZ_task_pidhash_next 0x00000008 -#define AOFF_task_pidhash_pprev 0x00000100 +#define AOFF_task_pidhash_pprev 0x000000d8 #define ASIZ_task_pidhash_pprev 0x00000008 -#define AOFF_task_tarray_ptr 0x00000108 +#define AOFF_task_tarray_ptr 0x000000e0 #define ASIZ_task_tarray_ptr 0x00000008 -#define AOFF_task_wait_chldexit 0x00000110 +#define AOFF_task_wait_chldexit 0x000000e8 #define ASIZ_task_wait_chldexit 0x00000008 -#define AOFF_task_timeout 0x00000118 +#define AOFF_task_timeout 0x000000f0 #define ASIZ_task_timeout 0x00000008 -#define AOFF_task_policy 0x00000120 +#define AOFF_task_policy 0x000000f8 #define ASIZ_task_policy 0x00000008 -#define AOFF_task_rt_priority 0x00000128 +#define AOFF_task_rt_priority 0x00000100 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000130 +#define AOFF_task_it_real_value 0x00000108 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000138 +#define AOFF_task_it_prof_value 0x00000110 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000140 +#define AOFF_task_it_virt_value 0x00000118 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000148 +#define AOFF_task_it_real_incr 0x00000120 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000150 +#define AOFF_task_it_prof_incr 0x00000128 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000158 +#define AOFF_task_it_virt_incr 0x00000130 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000160 +#define AOFF_task_real_timer 0x00000138 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000188 +#define AOFF_task_times 0x00000160 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x000001a8 +#define AOFF_task_start_time 0x00000180 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x000001b0 +#define AOFF_task_per_cpu_utime 0x00000188 #define ASIZ_task_per_cpu_utime 0x00000100 -#define AOFF_task_min_flt 0x000003b0 +#define AOFF_task_min_flt 0x00000388 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000003b8 +#define AOFF_task_maj_flt 0x00000390 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000003c0 +#define AOFF_task_nswap 0x00000398 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000003c8 +#define AOFF_task_cmin_flt 0x000003a0 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000003d0 +#define AOFF_task_cmaj_flt 0x000003a8 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000003d8 +#define AOFF_task_cnswap 0x000003b0 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_swap_address 0x000003e8 +#define AOFF_task_swap_address 0x000003c0 #define ASIZ_task_swap_address 0x00000008 -#define AOFF_task_old_maj_flt 0x000003f0 +#define AOFF_task_old_maj_flt 0x000003c8 #define ASIZ_task_old_maj_flt 0x00000008 -#define AOFF_task_dec_flt 0x000003f8 +#define AOFF_task_dec_flt 0x000003d0 #define ASIZ_task_dec_flt 0x00000008 -#define AOFF_task_swap_cnt 0x00000400 +#define AOFF_task_swap_cnt 0x000003d8 #define ASIZ_task_swap_cnt 0x00000008 -#define AOFF_task_uid 0x00000408 +#define AOFF_task_uid 0x000003e0 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x0000040c +#define AOFF_task_euid 0x000003e4 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x00000410 +#define AOFF_task_suid 0x000003e8 #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x00000414 +#define AOFF_task_fsuid 0x000003ec #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x00000418 +#define AOFF_task_gid 0x000003f0 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x0000041c +#define AOFF_task_egid 0x000003f4 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x00000420 +#define AOFF_task_sgid 0x000003f8 #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x00000424 +#define AOFF_task_fsgid 0x000003fc #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x00000428 +#define AOFF_task_ngroups 0x00000400 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x0000042c +#define AOFF_task_groups 0x00000404 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x000004ac +#define AOFF_task_cap_effective 0x00000484 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x000004b0 +#define AOFF_task_cap_inheritable 0x00000488 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x000004b4 +#define AOFF_task_cap_permitted 0x0000048c #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_rlim 0x000004b8 +#define AOFF_task_rlim 0x00000490 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000558 +#define AOFF_task_used_math 0x00000530 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000055a +#define AOFF_task_comm 0x00000532 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000056c +#define AOFF_task_link_count 0x00000544 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000570 +#define AOFF_task_tty 0x00000548 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000578 +#define AOFF_task_semundo 0x00000550 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000580 +#define AOFF_task_semsleeping 0x00000558 #define ASIZ_task_semsleeping 0x00000008 -#define AOFF_task_tss 0x00000590 -#define ASIZ_task_tss 0x00000490 -#define AOFF_task_fs 0x00000a20 +#define AOFF_task_tss 0x00000560 +#define ASIZ_task_tss 0x00000440 +#define AOFF_task_fs 0x000009a0 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x00000a28 +#define AOFF_task_files 0x000009a8 #define ASIZ_task_files 0x00000008 -#define AOFF_task_mm 0x00000a30 +#define AOFF_task_mm 0x000009b0 #define ASIZ_task_mm 0x00000008 -#define AOFF_task_sig 0x00000a38 +#define AOFF_task_sigmask_lock 0x000009b8 +#define ASIZ_task_sigmask_lock 0x00000001 +#define AOFF_task_sig 0x000009c0 #define ASIZ_task_sig 0x00000008 -#define AOFF_task_signal 0x00000a40 +#define AOFF_task_signal 0x000009c8 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x00000a48 +#define AOFF_task_blocked 0x000009d0 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x00000a50 +#define AOFF_task_sigqueue 0x000009d8 #define ASIZ_task_sigqueue 0x00000008 -#define AOFF_task_sigqueue_tail 0x00000a58 +#define AOFF_task_sigqueue_tail 0x000009e0 #define ASIZ_task_sigqueue_tail 0x00000008 -#define AOFF_task_has_cpu 0x00000a60 -#define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x00000a64 -#define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x00000a68 -#define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x00000a6c -#define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_sigmask_lock 0x00000a70 -#define ASIZ_task_sigmask_lock 0x00000001 +#define AOFF_task_sas_ss_sp 0x000009e8 +#define ASIZ_task_sas_ss_sp 0x00000008 +#define AOFF_task_sas_ss_size 0x000009f0 +#define ASIZ_task_sas_ss_size 0x00000008 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_cache 0x00000008 @@ -489,20 +503,20 @@ #define ASIZ_mm_segments 0x00000008 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 -#define AOFF_thread_kpc 0x00000008 -#define ASIZ_thread_kpc 0x00000004 -#define AOFF_thread_wstate 0x0000000c +#define AOFF_thread_wstate 0x00000008 #define ASIZ_thread_wstate 0x00000002 -#define AOFF_thread_cwp 0x0000000e +#define AOFF_thread_cwp 0x0000000a #define ASIZ_thread_cwp 0x00000002 -#define AOFF_thread_flags 0x00000010 +#define AOFF_thread_flags 0x0000000c #define ASIZ_thread_flags 0x00000002 -#define AOFF_thread_ctx 0x00000012 +#define AOFF_thread_ctx 0x0000000e #define ASIZ_thread_ctx 0x00000002 -#define AOFF_thread_w_saved 0x00000014 +#define AOFF_thread_w_saved 0x00000010 #define ASIZ_thread_w_saved 0x00000002 -#define AOFF_thread_new_signal 0x00000016 +#define AOFF_thread_new_signal 0x00000012 #define ASIZ_thread_new_signal 0x00000002 +#define AOFF_thread____pad 0x00000014 +#define ASIZ_thread____pad 0x00000004 #define AOFF_thread_current_ds 0x00000018 #define ASIZ_thread_current_ds 0x00000008 #define AOFF_thread_kregs 0x00000020 @@ -510,15 +524,21 @@ #define AOFF_thread_utraps 0x00000028 #define ASIZ_thread_utraps 0x00000008 #define AOFF_thread_reg_window 0x00000030 -#define ASIZ_thread_reg_window 0x00000400 -#define AOFF_thread_rwbuf_stkptrs 0x00000430 -#define ASIZ_thread_rwbuf_stkptrs 0x00000040 -#define AOFF_thread_sig_address 0x00000470 +#define ASIZ_thread_reg_window 0x00000380 +#define AOFF_thread_rwbuf_stkptrs 0x000003b0 +#define ASIZ_thread_rwbuf_stkptrs 0x00000038 +#define AOFF_thread_sig_address 0x000003e8 #define ASIZ_thread_sig_address 0x00000008 -#define AOFF_thread_sig_desc 0x00000478 +#define AOFF_thread_sig_desc 0x000003f0 #define ASIZ_thread_sig_desc 0x00000008 -#define AOFF_thread_sstk_info 0x00000480 -#define ASIZ_thread_sstk_info 0x00000010 +#define AOFF_thread_fpdepth 0x000003f8 +#define ASIZ_thread_fpdepth 0x00000001 +#define AOFF_thread_fpsaved 0x000003f9 +#define ASIZ_thread_fpsaved 0x00000007 +#define AOFF_thread_gsr 0x00000400 +#define ASIZ_thread_gsr 0x00000007 +#define AOFF_thread_xfsr 0x00000408 +#define ASIZ_thread_xfsr 0x00000038 #endif /* __SMP__ */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/audioio.h linux/include/asm-sparc64/audioio.h --- v2.1.114/linux/include/asm-sparc64/audioio.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/audioio.h Tue Aug 4 16:03:35 1998 @@ -12,9 +12,11 @@ * SunOS/Solaris /dev/audio interface */ +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #include #include #include +#endif /* * This structure contains state information for audio device IO streams. @@ -262,6 +264,9 @@ void *private; unsigned long flags; + /* This device */ + struct linux_sbus_device *dev; + /* Processes blocked on open() sit here. */ struct wait_queue *open_wait; @@ -286,12 +291,14 @@ struct sparcaudio_operations { int (*open)(struct inode *, struct file *, struct sparcaudio_driver *); - void (*release)(struct inode *, struct file *, struct sparcaudio_driver *); - int (*ioctl)(struct inode *, struct file *, unsigned int, unsigned long, - struct sparcaudio_driver *); + void (*release)(struct inode *, struct file *, + struct sparcaudio_driver *); + int (*ioctl)(struct inode *, struct file *, unsigned int, + unsigned long, struct sparcaudio_driver *); /* Ask driver to begin playing a buffer. */ - void (*start_output)(struct sparcaudio_driver *, __u8 *, unsigned long); + void (*start_output)(struct sparcaudio_driver *, __u8 *, + unsigned long); /* Ask driver to stop playing a buffer. */ void (*stop_output)(struct sparcaudio_driver *); diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/bitops.h linux/include/asm-sparc64/bitops.h --- v2.1.114/linux/include/asm-sparc64/bitops.h Tue Jul 21 00:15:33 1998 +++ linux/include/asm-sparc64/bitops.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: bitops.h,v 1.23 1997/12/18 02:44:12 ecd Exp $ +/* $Id: bitops.h,v 1.25 1998/07/26 03:05:51 davem Exp $ * bitops.h: Bit string operations on the V9. * * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/ebus.h linux/include/asm-sparc64/ebus.h --- v2.1.114/linux/include/asm-sparc64/ebus.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/ebus.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: ebus.h,v 1.6 1998/04/13 07:27:07 davem Exp $ +/* $Id: ebus.h,v 1.8 1998/05/07 21:00:27 ecd Exp $ * ebus.h: PCI to Ebus pseudo driver software state. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) @@ -92,10 +92,5 @@ #define for_each_edevchild(dev, child) \ for((child) = (dev)->children; (child); (child) = (child)->next) - -#define for_all_ebusdev(dev, bus) \ - for ((bus) = ebus_chain, ((dev) = (bus) ? (bus)->devices : 0); \ - (bus); ((dev) = (dev)->next ? (dev)->next : \ - ((bus) = (bus)->next, (bus) ? (bus)->devices : 0))) #endif /* !(__SPARC64_EBUS_H) */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/envctrl.h linux/include/asm-sparc64/envctrl.h --- v2.1.114/linux/include/asm-sparc64/envctrl.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-sparc64/envctrl.h Tue Aug 4 16:03:35 1998 @@ -0,0 +1,17 @@ +/* $Id: envctrl.h,v 1.1 1998/05/16 17:26:07 ecd Exp $ + * + * envctrl.h: Definitions for access to the i2c environment + * monitoring on Ultrasparc systems. + * + * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) + */ + +#ifndef _SPARC64_ENVCTRL_H +#define _SPARC64_ENVCTRL_H 1 + +#include + +#define I2CIOCSADR _IOW('p', 0x40, int) +#define I2CIOCGADR _IOR('p', 0x41, int) + +#endif /* !(_SPARC64_ENVCTRL_H) */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/firehose.h linux/include/asm-sparc64/firehose.h --- v2.1.114/linux/include/asm-sparc64/firehose.h Sun Jun 7 11:16:39 1998 +++ linux/include/asm-sparc64/firehose.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: firehose.h,v 1.2 1997/08/08 04:26:31 davem Exp $ +/* $Id: firehose.h,v 1.3 1998/06/10 07:28:43 davem Exp $ * firehose.h: Defines for the Fire Hose Controller (FHC) found * on Sunfire/Starfire/Wildfire systems. * diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/floppy.h linux/include/asm-sparc64/floppy.h --- v2.1.114/linux/include/asm-sparc64/floppy.h Mon Jan 12 15:15:58 1998 +++ linux/include/asm-sparc64/floppy.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: floppy.h,v 1.7 1997/09/07 03:34:08 davem Exp $ +/* $Id: floppy.h,v 1.11 1998/05/22 14:33:39 jj Exp $ * asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -11,6 +11,7 @@ #define __ASM_SPARC64_FLOPPY_H #include +#include #include #include @@ -39,7 +40,7 @@ #define dcr_82077 dir_82077 /* Config Control reg. */ }; -/* You'll only ever find one controller on a SparcStation anyways. */ +/* You'll only ever find one controller on an Ultra anyways. */ static struct sun_flpy_controller *sun_fdc = NULL; volatile unsigned char *fdc_status; static struct linux_sbus_device *floppy_sdev = NULL; @@ -216,21 +217,10 @@ int error; if(!once) { - struct devid_cookie dcookie; - once = 1; - dcookie.real_dev_id = NULL; - dcookie.imap = dcookie.iclr = 0; - dcookie.pil = -1; - dcookie.bus_cookie = floppy_sdev->my_bus; - - error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, - (SA_INTERRUPT | SA_SBUS | SA_DCOOKIE), - "floppy", &dcookie); - - if(error == 0) - FLOPPY_IRQ = dcookie.ret_ino; + error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, + SA_INTERRUPT, "floppy", NULL); return ((error == 0) ? 0 : -1); } @@ -281,29 +271,45 @@ outb(val, port); } -static void sun_pci_fd_enable_dma(void) +static void sun_pci_fd_reset_dma(void) { unsigned int dcsr; - dcsr = readl((unsigned long)&sun_fd_ebus_dma->dcsr); - dcsr |= (EBUS_DCSR_EN_DMA | EBUS_DCSR_EN_CNT); + writel(EBUS_DCSR_RESET, &sun_fd_ebus_dma->dcsr); + + dcsr = EBUS_DCSR_BURST_SZ_16 | EBUS_DCSR_TCI_DIS | + EBUS_DCSR_EN_CNT | EBUS_DCSR_INT_EN; writel(dcsr, (unsigned long)&sun_fd_ebus_dma->dcsr); } +static void sun_pci_fd_enable_dma(void) +{ + unsigned int dcsr; + + dcsr = readl(&sun_fd_ebus_dma->dcsr); + dcsr |= EBUS_DCSR_EN_DMA; + writel(dcsr, &sun_fd_ebus_dma->dcsr); +} + static void sun_pci_fd_disable_dma(void) { unsigned int dcsr; - dcsr = readl((unsigned long)&sun_fd_ebus_dma->dcsr); - dcsr &= ~(EBUS_DCSR_EN_DMA | EBUS_DCSR_EN_CNT); - writel(dcsr, (unsigned long)&sun_fd_ebus_dma->dcsr); + dcsr = readl(&sun_fd_ebus_dma->dcsr); + while (dcsr & EBUS_DCSR_DRAIN) + dcsr = readl(&sun_fd_ebus_dma->dcsr); + dcsr &= ~(EBUS_DCSR_EN_DMA); + if (dcsr & EBUS_DCSR_ERR_PEND) + sun_pci_fd_reset_dma(); + writel(dcsr, &sun_fd_ebus_dma->dcsr); } static void sun_pci_fd_set_dma_mode(int mode) { unsigned int dcsr; - dcsr = readl((unsigned long)&sun_fd_ebus_dma->dcsr); + dcsr = readl(&sun_fd_ebus_dma->dcsr); + dcsr |= EBUS_DCSR_EN_CNT | EBUS_DCSR_TC; /* * For EBus WRITE means to system memory, which is * READ for us. @@ -312,61 +318,61 @@ dcsr &= ~(EBUS_DCSR_WRITE); else dcsr |= EBUS_DCSR_WRITE; - writel(dcsr, (unsigned long)&sun_fd_ebus_dma->dcsr); + writel(dcsr, &sun_fd_ebus_dma->dcsr); } static void sun_pci_fd_set_dma_count(int length) { - writel(length, (unsigned long)&sun_fd_ebus_dma->dbcr); + writel(length, &sun_fd_ebus_dma->dbcr); } static void sun_pci_fd_set_dma_addr(char *buffer) { - unsigned int addr; + unsigned int addr = virt_to_bus(buffer); + writel(addr, &sun_fd_ebus_dma->dacr); +} - addr = virt_to_bus(buffer); - writel(addr, (unsigned long)&sun_fd_ebus_dma->dacr); +static unsigned int sun_pci_get_dma_residue(void) +{ + return readl(&sun_fd_ebus_dma->dbcr); } static void sun_pci_fd_enable_irq(void) { unsigned int dcsr; - dcsr = readl((unsigned long)&sun_fd_ebus_dma->dcsr); + dcsr = readl(&sun_fd_ebus_dma->dcsr); dcsr |= EBUS_DCSR_INT_EN; - writel(dcsr, (unsigned long)&sun_fd_ebus_dma->dcsr); + writel(dcsr, &sun_fd_ebus_dma->dcsr); } static void sun_pci_fd_disable_irq(void) { unsigned int dcsr; - dcsr = readl((unsigned long)&sun_fd_ebus_dma->dcsr); + dcsr = readl(&sun_fd_ebus_dma->dcsr); dcsr &= ~(EBUS_DCSR_INT_EN); - writel(dcsr, (unsigned long)&sun_fd_ebus_dma->dcsr); + writel(dcsr, &sun_fd_ebus_dma->dcsr); } static int sun_pci_fd_request_irq(void) { - int error; + int err; - error = request_irq(FLOPPY_IRQ, floppy_interrupt, SA_SHIRQ, "floppy", sun_fdc); - return ((error == 0) ? 0 : -1); + err = request_irq(FLOPPY_IRQ, floppy_interrupt, SA_SHIRQ, + "floppy", sun_fdc); + if (err) + return -1; + sun_pci_fd_enable_irq(); + return 0; } static void sun_pci_fd_free_irq(void) { + sun_pci_fd_disable_irq(); free_irq(FLOPPY_IRQ, sun_fdc); } -static unsigned int sun_pci_get_dma_residue(void) -{ - unsigned int res; - - res = readl((unsigned long)&sun_fd_ebus_dma->dbcr); - return res; -} - static int sun_pci_fd_eject(int drive) { return -EINVAL; @@ -375,7 +381,7 @@ static struct linux_prom_registers fd_regs[2]; -static unsigned long sun_floppy_init(void) +__initfunc(static unsigned long sun_floppy_init(void)) { char state[128]; int fd_node, num_regs; @@ -388,19 +394,26 @@ } if(sdev) { floppy_sdev = sdev; - FLOPPY_IRQ = sdev->irqs[0].pri; + FLOPPY_IRQ = sdev->irqs[0]; } else { #ifdef CONFIG_PCI struct linux_ebus *ebus; - struct linux_ebus_device *edev; + struct linux_ebus_device *edev = 0; - for_all_ebusdev(edev, ebus) { - if (!strcmp(edev->prom_name, "fdthree")) - break; + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if (!strcmp(edev->prom_name, "fdthree")) + goto ebus_done; + } } + ebus_done: if (!edev) return -1; + prom_getproperty(edev->prom_node, "status", state, sizeof(state)); + if(!strncmp(state, "disabled", 8)) + return -1; + if (check_region(edev->base_address[1], sizeof(struct linux_ebus_dma))) { printk("sun_floppy_init: can't get region %016lx (%d)\n", edev->base_address[1], (int)sizeof(struct linux_ebus_dma)); @@ -412,7 +425,7 @@ FLOPPY_IRQ = edev->irqs[0]; sun_fd_ebus_dma = (struct linux_ebus_dma *)edev->base_address[1]; - writel(EBUS_DCSR_BURST_SZ_16, (unsigned long)&sun_fd_ebus_dma->dcsr); + sun_pci_fd_reset_dma(); sun_fdops.fd_inb = sun_pci_fd_inb; sun_fdops.fd_outb = sun_pci_fd_outb; @@ -447,12 +460,11 @@ num_regs = prom_getproperty(fd_node, "reg", (char *) fd_regs, sizeof(fd_regs)); num_regs = (num_regs / sizeof(fd_regs[0])); prom_apply_sbus_ranges(sdev->my_bus, fd_regs, num_regs, sdev); - sun_fdc = (struct sun_flpy_controller *) sparc_alloc_io(fd_regs[0].phys_addr, - 0x0, - fd_regs[0].reg_size, - "floppy", - fd_regs[0].which_io, - 0x0); + /* We cannot do sparc_alloc_io here: it does request_region, which is the generic + floppy driver trying to do once again */ + sun_fdc = (struct sun_flpy_controller *) (PAGE_OFFSET + fd_regs[0].phys_addr + + (((unsigned long)fd_regs[0].which_io) << 32)); + /* Last minute sanity check... */ if(sun_fdc->status1_82077 == 0xff) { sun_fdc = NULL; diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/fpumacro.h linux/include/asm-sparc64/fpumacro.h --- v2.1.114/linux/include/asm-sparc64/fpumacro.h Mon Jan 12 15:15:58 1998 +++ linux/include/asm-sparc64/fpumacro.h Tue Aug 4 16:03:35 1998 @@ -8,14 +8,13 @@ #define _SPARC64_FPUMACRO_H #include +#include struct fpustate { u32 regs[64]; - u64 fsr; - u64 gsr; }; -#define FPUSTATE (struct fpustate *)(((unsigned long)current) + (((PAGE_SIZE<<1)-((64*4)+(2*8))) & ~(64 - 1))) +#define FPUSTATE (struct fpustate *)(((unsigned long)current) + AOFF_task_fpregs) extern __inline__ unsigned long fprs_read(void) { diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/ide.h linux/include/asm-sparc64/ide.h --- v2.1.114/linux/include/asm-sparc64/ide.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/ide.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: ide.h,v 1.8 1998/04/23 05:04:14 davem Exp $ +/* $Id: ide.h,v 1.9 1998/05/08 21:05:28 davem Exp $ * ide.h: Ultra/PCI specific IDE glue. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/io.h linux/include/asm-sparc64/io.h --- v2.1.114/linux/include/asm-sparc64/io.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc64/io.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: io.h,v 1.16 1998/03/24 05:54:40 ecd Exp $ */ +/* $Id: io.h,v 1.18 1998/07/12 12:07:43 ecd Exp $ */ #ifndef __SPARC64_IO_H #define __SPARC64_IO_H @@ -13,26 +13,47 @@ #define __SLOW_DOWN_IO do { } while (0) #define SLOW_DOWN_IO do { } while (0) + +#define PCI_DVMA_HASHSZ 256 + extern unsigned long pci_dvma_offset; extern unsigned long pci_dvma_mask; +extern unsigned long pci_dvma_v2p_hash[PCI_DVMA_HASHSZ]; +extern unsigned long pci_dvma_p2v_hash[PCI_DVMA_HASHSZ]; + +#define pci_dvma_ahashfn(addr) (((addr) >> 24) & 0xff) + extern __inline__ unsigned long virt_to_phys(volatile void *addr) { unsigned long vaddr = (unsigned long)addr; + unsigned long off; /* Handle kernel variable pointers... */ if (vaddr < PAGE_OFFSET) vaddr += PAGE_OFFSET - (unsigned long)&empty_zero_page; - return ((vaddr - PAGE_OFFSET) | pci_dvma_offset); + + off = pci_dvma_v2p_hash[pci_dvma_ahashfn(vaddr - PAGE_OFFSET)]; + return vaddr + off; } extern __inline__ void *phys_to_virt(unsigned long addr) { - return ((void *)((addr & pci_dvma_mask) + PAGE_OFFSET)); + unsigned long paddr = addr & 0xffffffffUL; + unsigned long off; + + off = pci_dvma_p2v_hash[pci_dvma_ahashfn(paddr)]; + return (void *)(paddr + off); } #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt + +extern __inline__ unsigned long bus_dvma_to_mem(unsigned long vaddr) +{ + return vaddr & pci_dvma_mask; +} + extern __inline__ unsigned int inb(unsigned long addr) { diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/irq.h linux/include/asm-sparc64/irq.h --- v2.1.114/linux/include/asm-sparc64/irq.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/irq.h Tue Aug 4 16:03:35 1998 @@ -1,39 +1,39 @@ -/* $Id: irq.h,v 1.8 1998/03/15 17:23:51 ecd Exp $ +/* $Id: irq.h,v 1.10 1998/05/29 06:00:39 ecd Exp $ * irq.h: IRQ registers on the 64-bit Sparc. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) */ #ifndef _SPARC64_IRQ_H #define _SPARC64_IRQ_H #include - -/* Sparc64 extensions to the interrupt registry flags. Mostly this is - * for passing along what bus type the device is on and also the true - * format of the dev_id cookie, see below. - */ -#define SA_BUSMASK 0x0f000 -#define SA_SBUS 0x01000 -#define SA_PCI 0x02000 -#define SA_FHC 0x03000 -#define SA_EBUS 0x04000 -#define SA_BUS(mask) ((mask) & SA_BUSMASK) +#include struct devid_cookie { - /* Caller specifies these. */ - void *real_dev_id; /* What dev_id would usually contain. */ - unsigned int *imap; /* Anonymous IMAP register */ - unsigned int *iclr; /* Anonymous ICLR register */ - int pil; /* Anonymous PIL */ - void *bus_cookie; /* SYSIO regs, PSYCHO regs, etc. */ - - /* Return values. */ - unsigned int ret_ino; - unsigned int ret_pil; + int dummy; }; -#define SA_DCOOKIE 0x10000 +/* You should not mess with this directly. That's the job of irq.c. */ +struct ino_bucket { + unsigned short ino; + short imap_off; + unsigned short pil; + unsigned short flags; + unsigned int *iclr; +}; + +#define __irq_ino(irq) ((struct ino_bucket *)(unsigned long)(irq))->ino +#define __irq_pil(irq) ((struct ino_bucket *)(unsigned long)(irq))->pil + +static __inline__ char *__irq_itoa(unsigned int irq) +{ + static char buff[16]; + + sprintf(buff, "%d,%x", __irq_pil(irq), __irq_ino(irq)); + return buff; +} #define NR_IRQS 15 @@ -41,6 +41,9 @@ extern void enable_irq(unsigned int); extern void init_timers(void (*lvl10_irq)(int, void *, struct pt_regs *), unsigned long *); +extern unsigned int build_irq(int pil, int inofixup, unsigned int *iclr, unsigned int *imap); +extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); +extern unsigned int psycho_build_irq(void *psycho, int imap_off, int ino, int need_dma_sync); #ifdef __SMP__ extern void set_cpu_int(int, int); diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/linux_logo.h linux/include/asm-sparc64/linux_logo.h --- v2.1.114/linux/include/asm-sparc64/linux_logo.h Thu Jul 16 18:09:29 1998 +++ linux/include/asm-sparc64/linux_logo.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: linux_logo.h,v 1.4 1998/07/01 15:43:05 jj Exp $ +/* $Id: linux_logo.h,v 1.6 1998/07/30 16:30:48 jj Exp $ * include/asm-sparc64/linux_logo.h: This is a linux logo * to be displayed on boot. * @@ -23,901 +23,904 @@ #define linux_logo_banner "Linux/UltraSPARC version " UTS_RELEASE -#define LINUX_LOGO_COLORS 215 +#define LINUX_LOGO_COLORS 219 #ifdef INCLUDE_LINUX_LOGO_DATA unsigned char linux_logo_red[] __initdata = { - 0x99, 0x95, 0x92, 0x8E, 0x8A, 0x86, 0x02, 0x00, - 0xA5, 0xA9, 0xA2, 0x9E, 0xAD, 0x1B, 0x3B, 0x25, - 0x71, 0x65, 0x2C, 0x82, 0x5B, 0x33, 0x13, 0xB0, - 0x0C, 0xB1, 0x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 0x1E, + 0x7E, 0xAA, 0xC4, 0xF0, 0x96, 0x65, 0x9E, 0xC2, + 0xAA, 0xF5, 0xF2, 0xE9, 0xE6, 0xD1, 0x35, 0xC7, + 0xF6, 0xB6, 0xE8, 0x82, 0xBE, 0xC2, 0xF2, 0x9E, + 0xC7, 0xB4, 0x0F, 0xF7, 0xE8, 0xD8, 0xCC, 0x9C, + 0xD8, 0xD8, 0xA0, 0xEA, 0xC6, 0xA8, 0xE0, 0xEC, + 0xD1, 0xF7, 0xF4, 0xFC, 0x75, 0xBD, 0xDC, 0xDD, + 0xCC, 0xE1, 0xFA, 0xEE, 0xAA, 0xEC, 0xF2, 0xB8, + 0xE2, 0xCD, 0x87 }; unsigned char linux_logo_green[] __initdata = { - 0x99, 0x95, 0x92, 0x8E, 0x8A, 0x86, 0x02, 0x00, - 0xA5, 0xA9, 0xA2, 0x9E, 0xAD, 0x1B, 0x3B, 0x25, - 0x71, 0x65, 0x2C, 0x82, 0x5B, 0x33, 0x13, 0xAD, - 0x0C, 0xB1, 0x92, 0xAB, 0x03, 0x06, 0x16, 0xB6, - 0xCD, 0x88, 0x42, 0x46, 0x4B, 0x94, 0xBB, 0xCA, - 0xC5, 0x1C, 0xAB, 0xA0, 0xD4, 0xE6, 0xED, 0xF3, - 0xC2, 0x73, 0xCA, 0x91, 0x7E, 0x52, 0xF7, 0xE3, - 0x56, 0x5A, 0x49, 0x56, 0x6E, 0xFC, 0x6B, 0x3E, - 0x6B, 0x0D, 0x37, 0x79, 0x51, 0x44, 0x3F, 0x43, - 0x38, 0x3D, 0x48, 0xB9, 0x62, 0xA5, 0x47, 0x48, - 0x49, 0x4A, 0x97, 0x48, 0x81, 0x95, 0x8E, 0xE3, - 0x6D, 0x57, 0x51, 0x51, 0x47, 0xB2, 0x42, 0x46, - 0xDD, 0x5B, 0x87, 0xBE, 0xC7, 0xC8, 0x56, 0x75, - 0x5D, 0x4B, 0x4D, 0xBE, 0x85, 0xA6, 0xBC, 0xC7, - 0xCA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58, 0x8A, 0x03, 0x07, 0x16, 0xB6, - 0xCD, 0x5A, 0x42, 0x46, 0x4F, 0x6F, 0x77, 0xCA, - 0xC5, 0x1C, 0x6F, 0xA5, 0xD4, 0xE6, 0xF5, 0xF3, - 0xC2, 0x4D, 0xD1, 0x64, 0x7E, 0x52, 0xF7, 0xE3, - 0x56, 0x49, 0x3C, 0x47, 0x45, 0xFE, 0x3B, 0x41, - 0x6B, 0x09, 0x37, 0x79, 0x39, 0x39, 0x3F, 0x42, - 0x3A, 0x42, 0x5F, 0xB9, 0x62, 0x4C, 0x39, 0x44, - 0x3B, 0x3A, 0xA0, 0x3D, 0x08, 0x08, 0x09, 0xDE, - 0x6D, 0x48, 0x3B, 0x3F, 0x42, 0xF3, 0x36, 0x3C, - 0xDD, 0x06, 0x16, 0x08, 0x13, 0x0A, 0x4B, 0x71, - 0x5D, 0x44, 0x47, 0xBE, 0x08, 0x0C, 0x0D, 0x0C, - 0x19, 0x29, 0x36, 0x06, 0x43, 0x44, 0xBA, 0x45, - 0x50, 0x58, 0x07, 0x07, 0x0D, 0x0E, 0x10, 0x50, - 0x06, 0x42, 0x40, 0x44, 0x79, 0x06, 0x06, 0x0C, - 0x08, 0x08, 0x07, 0x36, 0x4C, 0xE5, 0x42, 0x55, - 0x03, 0x0F, 0x12, 0x06, 0x07, 0x3C, 0x4B, 0x3D, - 0x01, 0xF8, 0x08, 0x0E, 0x0A, 0x69, 0xAC, 0x0C, - 0x0A, 0x27, 0xBB, 0x36, 0x76, 0xC0, 0x04, 0x08, - 0x08, 0xED, 0xEE, 0x68, 0x5F, 0xB2, 0x3B, 0x52, - 0xAC, 0x4F, 0x6F, 0x2D, 0x16, 0x08, 0x59, 0x04, - 0x13, 0x0E, 0x14, 0x17, 0x16, 0x2E, 0x08, 0x0D, - 0x11, 0x14, 0x0D, 0x06, 0x04, 0x08, 0x25, 0x8E, - 0x0E, 0x14, 0x25, 0x9B, 0x1C, 0x16, 0x78, 0x06, - 0x04, 0x03, 0x79, 0x8C, 0x0B, 0xC8, 0x48 + 0x04, 0x28, 0x10, 0x8C, 0x0B, 0x84, 0x14, 0x1A, + 0x77, 0x1F, 0x64, 0x0E, 0x85, 0xD2, 0x24, 0xA4, + 0x0F, 0x54, 0x0C, 0x7C, 0x3F, 0x04, 0x20, 0x0D, + 0x54, 0xDF, 0x14, 0x0D, 0xD1, 0xE9, 0xB0, 0x11, + 0x0A, 0x40, 0x57, 0x14, 0xC3, 0x0C, 0x04, 0x12, + 0x50, 0x0C, 0x7D, 0x05, 0x55, 0xF2, 0xBA, 0xC7, + 0x09, 0xB4, 0x0E, 0x24, 0x0B, 0x74, 0x0C, 0xB6, + 0x80, 0x48, 0x10, 0x34, 0x0F, 0x0C, 0xA0, 0x04, + 0x19, 0x10, 0x0E, 0x14, 0x0E, 0x05, 0x94, 0x0E, + 0xCA, 0x0B, 0x46, 0xFB, 0xB4, 0x1C, 0x9B, 0x1A, + 0x21, 0x09, 0x14, 0x4D, 0xCB, 0x08, 0x11, 0x7C, + 0x20, 0x10, 0x24, 0x66, 0x79, 0x07, 0xEA, 0xC9, + 0x0C, 0x08, 0x38, 0xC4, 0xD8, 0x24, 0xBE, 0x6C, + 0x51, 0xBB, 0x8C, 0x36, 0x0A, 0x0F, 0x0C, 0x84, + 0x3C, 0x54, 0x44, 0x7C, 0x28, 0x0E, 0x28, 0x7F, + 0x8C, 0x0F, 0x54, 0x24, 0x3C, 0x18, 0x54, 0x17, + 0x7C, 0x9C, 0xDA, 0x9C, 0x7C, 0x6C, 0x4D, 0x2C, + 0x09, 0x0E, 0x8A, 0x50, 0x4C, 0x5B, 0x14, 0xAC, + 0x19, 0x3C, 0xAC, 0x5C, 0x64, 0x97, 0x94, 0x37, + 0x29, 0x3C, 0x44, 0x3C, 0x2C, 0x7C, 0x70, 0x07, + 0x04, 0x29, 0xB2, 0x64, 0x74, 0x07, 0x07, 0x2C, + 0x74, 0x2E, 0x6C, 0xA4, 0x29, 0x9E, 0x34, 0x27, + 0x2F, 0x98, 0x48, 0x5C, 0x0C, 0x5C, 0xE8, 0x04, + 0xC2, 0x0C, 0x0A, 0xB2, 0x74, 0xCB, 0x46, 0x78, + 0xB4, 0x5C, 0x18, 0x80, 0x8C, 0x24, 0xD9, 0xAC, + 0x87, 0x99, 0x1D, 0xE8, 0x14, 0x0D, 0x10, 0x17, + 0x0A, 0x67, 0x3C, 0x68, 0x3C, 0x69, 0x90, 0x22, + 0x6C, 0x0D, 0x17 }; unsigned char linux_logo[] __initdata = { - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x21, 0x21, 0x22, 0x23, 0x24, 0x24, - 0x25, 0x24, 0x24, 0x25, 0x25, 0x25, 0x25, 0x25, - 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x23, 0x23, - 0x23, 0x22, 0x22, 0x22, 0x22, 0x21, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x26, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x26, 0x28, - 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x28, 0x28, 0x28, 0x2A, 0x2A, 0x2B, 0x2B, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x2B, 0x2B, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x28, 0x28, 0x28, 0x29, 0x29, 0x29, 0x29, 0x29, - 0x29, 0x29, 0x29, 0x2C, 0x29, 0x29, 0x29, 0x28, - 0x28, 0x2A, 0x2B, 0x2B, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x2B, 0x2B, 0x2A, 0x2A, - 0x2A, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x2D, 0x2E, 0x2F, 0x27, - 0x27, 0x26, 0x2B, 0x2A, 0x2A, 0x2A, 0x2A, 0x28, - 0x28, 0x29, 0x29, 0x29, 0x29, 0x2C, 0x2C, 0x29, - 0x29, 0x29, 0x28, 0x28, 0x2A, 0x2B, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x2B, 0x2B, 0x2B, 0x2A, 0x2A, 0x2A, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x2F, 0x30, 0x31, 0x32, - 0x27, 0x27, 0x22, 0x22, 0x22, 0x22, 0x21, 0x20, - 0x20, 0x20, 0x2B, 0x2A, 0x28, 0x29, 0x29, 0x29, - 0x2C, 0x2C, 0x2C, 0x29, 0x29, 0x28, 0x2A, 0x2B, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x2B, 0x2B, 0x2A, 0x2A, 0x2A, 0x2A, 0x2B, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x32, 0x33, 0x34, 0x35, - 0x36, 0x27, 0x27, 0x33, 0x25, 0x25, 0x24, 0x24, - 0x24, 0x24, 0x23, 0x21, 0x20, 0x20, 0x2B, 0x2A, - 0x28, 0x29, 0x29, 0x37, 0x2C, 0x2C, 0x29, 0x28, - 0x2A, 0x2B, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2B, 0x2B, - 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2A, 0x2B, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x2F, 0x32, 0x36, 0x27, - 0x27, 0x27, 0x27, 0x33, 0x33, 0x33, 0x33, 0x33, - 0x33, 0x33, 0x33, 0x25, 0x25, 0x24, 0x23, 0x21, - 0x20, 0x2B, 0x2A, 0x29, 0x29, 0x2C, 0x2C, 0x2C, - 0x29, 0x28, 0x2A, 0x2B, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2B, 0x2B, - 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x20, 0x21, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x38, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x23, 0x23, 0x24, 0x24, - 0x25, 0x25, 0x33, 0x33, 0x33, 0x33, 0x33, 0x25, - 0x24, 0x22, 0x20, 0x20, 0x2A, 0x28, 0x29, 0x2C, - 0x2C, 0x2C, 0x29, 0x28, 0x2A, 0x2B, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x2B, 0x2B, 0x2B, 0x2B, - 0x2B, 0x2B, 0x2B, 0x20, 0x21, 0x22, 0x23, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x2A, 0x2A, 0x2B, 0x2B, - 0x20, 0x21, 0x22, 0x24, 0x20, 0x39, 0x39, 0x39, - 0x39, 0x39, 0x3A, 0x3B, 0x22, 0x20, 0x2A, 0x28, - 0x29, 0x2C, 0x2C, 0x2C, 0x29, 0x28, 0x2B, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, - 0x2B, 0x20, 0x21, 0x22, 0x22, 0x23, 0x24, 0x27, - 0x27, 0x27, 0x3C, 0x36, 0x3C, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x3D, 0x3E, 0x32, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x3D, 0x39, 0x3F, 0x3F, - 0x39, 0x2C, 0x20, 0x20, 0x39, 0x39, 0x39, 0x39, - 0x39, 0x39, 0x39, 0x40, 0x40, 0x41, 0x22, 0x20, - 0x2A, 0x28, 0x2C, 0x2C, 0x2C, 0x29, 0x29, 0x2A, - 0x2B, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x2B, 0x2B, 0x2B, 0x2B, 0x20, 0x20, - 0x21, 0x22, 0x22, 0x22, 0x23, 0x23, 0x22, 0x27, - 0x27, 0x3C, 0x3C, 0x3D, 0x42, 0x3C, 0x27, 0x27, - 0x3C, 0x27, 0x3C, 0x43, 0x44, 0x36, 0x42, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x3D, 0x28, 0x29, 0x2C, - 0x2C, 0x45, 0x20, 0x39, 0x39, 0x39, 0x39, 0x39, - 0x39, 0x46, 0x40, 0x47, 0x40, 0x47, 0x3A, 0x40, - 0x22, 0x20, 0x2A, 0x29, 0x2C, 0x2C, 0x2C, 0x29, - 0x28, 0x2B, 0x2B, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x2B, 0x2B, 0x2B, 0x2B, 0x20, 0x20, 0x22, - 0x22, 0x22, 0x23, 0x22, 0x22, 0x21, 0x20, 0x27, - 0x27, 0x44, 0x28, 0x24, 0x27, 0x2F, 0x3C, 0x27, - 0x27, 0x38, 0x24, 0x2C, 0x2C, 0x48, 0x49, 0x36, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x28, 0x29, 0x29, - 0x4A, 0x20, 0x3A, 0x40, 0x47, 0x40, 0x47, 0x40, - 0x40, 0x47, 0x40, 0x40, 0x39, 0x39, 0x39, 0x4A, - 0x25, 0x24, 0x22, 0x2B, 0x28, 0x29, 0x2C, 0x2C, - 0x29, 0x28, 0x2A, 0x2B, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x2B, 0x2B, 0x20, 0x20, 0x20, 0x21, 0x22, 0x22, - 0x22, 0x22, 0x22, 0x21, 0x20, 0x2B, 0x2A, 0x27, - 0x3D, 0x4B, 0x48, 0x4C, 0x2B, 0x3C, 0x27, 0x3C, - 0x3C, 0x23, 0x4D, 0x4E, 0x4F, 0x50, 0x33, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x39, 0x3F, 0x39, - 0x51, 0x20, 0x39, 0x39, 0x47, 0x40, 0x4D, 0x4D, - 0x40, 0x52, 0x4D, 0x40, 0x47, 0x40, 0x39, 0x39, - 0x53, 0x54, 0x25, 0x24, 0x20, 0x2A, 0x29, 0x2C, - 0x2C, 0x2C, 0x29, 0x2A, 0x2B, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, - 0x22, 0x21, 0x20, 0x2B, 0x28, 0x2A, 0x20, 0x27, - 0x36, 0x4F, 0x55, 0x48, 0x56, 0x3D, 0x3C, 0x3C, - 0x32, 0x57, 0x56, 0x58, 0x49, 0x56, 0x56, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x22, 0x20, 0x20, - 0x41, 0x39, 0x39, 0x3A, 0x59, 0x5A, 0x59, 0x5B, - 0x5C, 0x3A, 0x4D, 0x5D, 0x57, 0x39, 0x39, 0x4A, - 0x5E, 0x33, 0x54, 0x33, 0x24, 0x22, 0x2B, 0x28, - 0x2C, 0x2C, 0x2C, 0x29, 0x28, 0x2B, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x21, 0x21, 0x21, 0x22, 0x22, 0x21, - 0x20, 0x2B, 0x2A, 0x2A, 0x20, 0x22, 0x22, 0x27, - 0x5F, 0x2D, 0x3C, 0x60, 0x56, 0x54, 0x61, 0x49, - 0x35, 0x56, 0x34, 0x27, 0x62, 0x27, 0x56, 0x39, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x30, 0x63, 0x54, - 0x40, 0x64, 0x65, 0x66, 0x67, 0x67, 0x68, 0x5F, - 0x2E, 0x69, 0x6A, 0x67, 0x5F, 0x3A, 0x39, 0x2C, - 0x53, 0x23, 0x25, 0x54, 0x33, 0x25, 0x23, 0x20, - 0x2A, 0x29, 0x2C, 0x2C, 0x29, 0x28, 0x2B, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x21, 0x21, 0x21, 0x21, 0x21, 0x20, 0x20, - 0x2B, 0x2A, 0x20, 0x22, 0x22, 0x21, 0x2B, 0x27, - 0x62, 0x36, 0x27, 0x33, 0x6B, 0x54, 0x3D, 0x3C, - 0x49, 0x57, 0x27, 0x27, 0x27, 0x27, 0x56, 0x57, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x6C, 0x31, 0x6D, - 0x64, 0x51, 0x6E, 0x2E, 0x2E, 0x6F, 0x5A, 0x70, - 0x70, 0x71, 0x72, 0x67, 0x67, 0x69, 0x73, 0x46, - 0x4A, 0x2A, 0x21, 0x25, 0x33, 0x54, 0x33, 0x24, - 0x20, 0x2A, 0x29, 0x2C, 0x2C, 0x29, 0x28, 0x2B, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x21, 0x21, 0x21, 0x21, 0x20, 0x20, 0x2B, - 0x2B, 0x22, 0x22, 0x22, 0x2B, 0x28, 0x2A, 0x27, - 0x27, 0x39, 0x3C, 0x3D, 0x45, 0x74, 0x75, 0x76, - 0x76, 0x45, 0x27, 0x27, 0x27, 0x27, 0x56, 0x77, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x78, 0x78, 0x5E, - 0x79, 0x7A, 0x7B, 0x6E, 0x5A, 0x5A, 0x70, 0x7C, - 0x70, 0x5B, 0x7D, 0x5A, 0x66, 0x7E, 0x7F, 0x79, - 0x48, 0x6B, 0x2C, 0x20, 0x24, 0x33, 0x54, 0x33, - 0x24, 0x21, 0x2A, 0x29, 0x2C, 0x2C, 0x29, 0x28, - 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x21, 0x21, 0x21, 0x20, 0x20, 0x2B, 0x2B, 0x21, - 0x22, 0x22, 0x20, 0x28, 0x2B, 0x20, 0x22, 0x27, - 0x27, 0x80, 0x27, 0x81, 0x82, 0x83, 0x84, 0x85, - 0x74, 0x85, 0x84, 0x27, 0x3C, 0x4F, 0x4F, 0x66, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x22, 0x23, 0x5E, - 0x64, 0x86, 0x79, 0x73, 0x87, 0x88, 0x7C, 0x5A, - 0x5A, 0x71, 0x7D, 0x71, 0x89, 0x79, 0x8A, 0x8A, - 0x51, 0x8B, 0x48, 0x39, 0x2A, 0x22, 0x33, 0x54, - 0x33, 0x25, 0x22, 0x2B, 0x29, 0x2C, 0x2C, 0x29, - 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x21, 0x21, 0x20, 0x20, 0x2B, 0x2B, 0x22, 0x23, - 0x21, 0x2A, 0x2A, 0x20, 0x21, 0x23, 0x25, 0x27, - 0x27, 0x55, 0x8C, 0x8D, 0x8E, 0x83, 0x8F, 0x90, - 0x91, 0x92, 0x92, 0x85, 0x85, 0x93, 0x51, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x2A, 0x29, 0x51, - 0x79, 0x79, 0x94, 0x89, 0x89, 0x89, 0x5A, 0x95, - 0x64, 0x88, 0x96, 0x97, 0x7A, 0x73, 0x98, 0x98, - 0x99, 0x50, 0x50, 0x48, 0x6B, 0x28, 0x21, 0x25, - 0x54, 0x54, 0x25, 0x22, 0x2B, 0x29, 0x2C, 0x29, - 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x2B, 0x20, 0x22, 0x22, 0x20, - 0x2B, 0x2B, 0x20, 0x22, 0x24, 0x25, 0x33, 0x27, - 0x27, 0x9A, 0x9B, 0x9C, 0x9D, 0x83, 0x9E, 0x85, - 0x9F, 0x92, 0x85, 0x85, 0x85, 0x85, 0x92, 0xA0, - 0x27, 0x27, 0x27, 0x27, 0x27, 0xA1, 0x47, 0xA2, - 0xA2, 0x94, 0xA3, 0x94, 0x95, 0x95, 0x73, 0x73, - 0x95, 0x87, 0xA4, 0x5B, 0x97, 0x7B, 0x88, 0x98, - 0xA2, 0x50, 0x48, 0x48, 0x48, 0x8B, 0x29, 0x20, - 0x25, 0x54, 0x54, 0x25, 0x22, 0x2B, 0x29, 0x29, - 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x21, 0x22, 0x22, 0x2B, 0x2B, - 0x20, 0x21, 0x23, 0x24, 0x25, 0x25, 0x33, 0x27, - 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0x8F, 0x90, 0x90, - 0x9F, 0x90, 0x85, 0x90, 0x85, 0x74, 0xAA, 0x81, - 0x27, 0x27, 0x27, 0x27, 0x27, 0xAB, 0x40, 0xAC, - 0x79, 0xA3, 0x89, 0xAD, 0x95, 0x6F, 0xAE, 0xAE, - 0xAE, 0x5B, 0x59, 0x88, 0x7B, 0x89, 0x79, 0xAF, - 0xA2, 0x6B, 0x48, 0x48, 0x48, 0x48, 0x50, 0x2C, - 0x20, 0x24, 0x33, 0x54, 0x25, 0x22, 0x2A, 0x2A, - 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x21, 0x23, 0x22, 0x2B, 0x20, 0x20, - 0x22, 0x23, 0x24, 0x25, 0x24, 0x24, 0x22, 0x27, - 0xB0, 0x8C, 0xAA, 0xB1, 0xB2, 0x84, 0x85, 0x9F, - 0x85, 0x85, 0x85, 0xB3, 0xB4, 0xAA, 0xAA, 0xA0, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x2A, 0xB5, - 0xA3, 0xA3, 0xAC, 0x5D, 0xB6, 0xAE, 0xB7, 0x69, - 0x73, 0x5B, 0x88, 0x89, 0x95, 0x73, 0x99, 0x99, - 0x59, 0x2A, 0x39, 0x48, 0x48, 0x50, 0x48, 0x50, - 0x2C, 0x20, 0x24, 0x33, 0x54, 0x25, 0x21, 0x20, - 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x21, 0x23, 0x21, 0x2B, 0x20, 0x20, 0x22, - 0x22, 0x24, 0x24, 0x23, 0x22, 0x20, 0x2A, 0x27, - 0x27, 0xB0, 0x8C, 0xA9, 0xB2, 0x9E, 0x91, 0x85, - 0x85, 0x93, 0xB8, 0x75, 0xAA, 0xA7, 0x8C, 0x27, - 0x27, 0x27, 0x33, 0x3C, 0x27, 0x27, 0x2C, 0x7B, - 0x55, 0x79, 0xA3, 0x5D, 0xB9, 0x43, 0x7F, 0x7E, - 0x5F, 0x5A, 0x5A, 0x95, 0x64, 0x73, 0x58, 0x64, - 0x5C, 0x25, 0x2B, 0x3F, 0x48, 0x48, 0x8B, 0x48, - 0x48, 0x2C, 0x20, 0x25, 0x54, 0x33, 0x24, 0x22, - 0x2B, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x21, 0x23, 0x21, 0x20, 0x20, 0x20, 0x21, 0x22, - 0x24, 0x23, 0x22, 0x21, 0x2B, 0x20, 0x54, 0x27, - 0x27, 0x8B, 0x81, 0xA5, 0x93, 0x93, 0x74, 0xA5, - 0xBA, 0x75, 0xBB, 0xBC, 0xB4, 0x6D, 0x50, 0x6B, - 0x27, 0x27, 0x30, 0x33, 0x49, 0x27, 0x27, 0x5E, - 0x6F, 0x73, 0x94, 0xBD, 0x4E, 0x5D, 0x7F, 0x7F, - 0xB7, 0x68, 0x73, 0x6E, 0xB7, 0x7F, 0x95, 0x97, - 0x47, 0x63, 0x25, 0x20, 0x3F, 0x48, 0x8B, 0x8B, - 0x48, 0x48, 0x2C, 0x20, 0x25, 0x54, 0x33, 0x25, - 0x2B, 0x2B, 0x2B, 0x20, 0x20, 0x20, 0x21, 0x21, - 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, 0x24, 0x24, - 0x22, 0x21, 0x20, 0x2A, 0x33, 0x30, 0x30, 0x27, - 0x27, 0x50, 0xBE, 0xBF, 0x9A, 0xB3, 0x9B, 0xBB, - 0xBB, 0xC0, 0x8C, 0xC1, 0x8B, 0xC2, 0x47, 0x8B, - 0x27, 0x27, 0x38, 0x63, 0x63, 0x27, 0x27, 0xC3, - 0xB5, 0x95, 0x72, 0x95, 0x6F, 0x69, 0x7E, 0x66, - 0x7E, 0x7F, 0x6E, 0x7E, 0x95, 0x95, 0x73, 0x70, - 0x30, 0x30, 0x30, 0x33, 0x20, 0x3F, 0x48, 0x8B, - 0x6B, 0x48, 0x50, 0x29, 0x21, 0x33, 0x54, 0x33, - 0x2A, 0x2B, 0x2B, 0x20, 0x20, 0x21, 0x21, 0x23, - 0x21, 0x20, 0x20, 0x20, 0x20, 0x24, 0x24, 0x22, - 0x20, 0x2B, 0x21, 0xC4, 0x30, 0x60, 0x30, 0x27, - 0x27, 0xC5, 0x8B, 0x39, 0xC6, 0xC7, 0xA6, 0xA6, - 0xC8, 0x9A, 0x3B, 0x39, 0x50, 0x56, 0x56, 0x4F, - 0x33, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x48, - 0x59, 0x94, 0x73, 0xAE, 0xB7, 0xB7, 0x7E, 0x7E, - 0x7E, 0x7E, 0x7E, 0x5A, 0x70, 0x7C, 0x71, 0xC3, - 0x63, 0x30, 0x60, 0x78, 0x54, 0x20, 0x6B, 0x48, - 0x6B, 0x6B, 0x50, 0x50, 0x29, 0x22, 0x33, 0x33, - 0x2A, 0x2B, 0x20, 0x20, 0x21, 0x22, 0x22, 0x22, - 0x21, 0x20, 0x20, 0x20, 0x24, 0x24, 0x20, 0x20, - 0x2B, 0x24, 0x30, 0x60, 0x60, 0x30, 0xAB, 0x27, - 0x27, 0x40, 0x4C, 0x50, 0x39, 0x87, 0xC3, 0x53, - 0x37, 0x48, 0x37, 0x48, 0xC9, 0x56, 0xB9, 0x56, - 0xCA, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x3C, - 0x51, 0x5A, 0x6E, 0xB7, 0xB7, 0x7E, 0x7E, 0x7E, - 0x7E, 0x7E, 0x7F, 0xB7, 0x5A, 0x7C, 0x5B, 0x37, - 0x23, 0x63, 0x31, 0x6C, 0xCB, 0x63, 0x20, 0x6B, - 0x50, 0x3F, 0x39, 0x50, 0x8B, 0x28, 0x24, 0x24, - 0x2B, 0x2B, 0x20, 0x21, 0x22, 0x22, 0x22, 0x21, - 0x20, 0x20, 0x20, 0x23, 0x23, 0x20, 0x20, 0x2B, - 0x33, 0x78, 0xCB, 0x60, 0x30, 0x22, 0x3D, 0x27, - 0x2F, 0x56, 0x4E, 0x8B, 0x6B, 0x39, 0x48, 0x8B, - 0x6B, 0x8B, 0x80, 0xC9, 0xB9, 0xB9, 0x56, 0xB9, - 0x56, 0x34, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x48, 0xB5, 0xB7, 0xB7, 0x7E, 0x7E, 0x2E, 0x7E, - 0x7E, 0x7E, 0x7F, 0x7C, 0x65, 0x71, 0x3A, 0x48, - 0x2C, 0x24, 0x30, 0x6C, 0x34, 0x6C, 0xC4, 0x20, - 0x8B, 0x50, 0x39, 0x39, 0x48, 0x6B, 0x2B, 0x22, - 0x2B, 0x20, 0x21, 0x22, 0x23, 0x23, 0x22, 0x21, - 0x20, 0x2B, 0x23, 0x22, 0x20, 0x2B, 0x2B, 0x54, - 0x60, 0x31, 0xCB, 0x54, 0x20, 0x3D, 0x36, 0x27, - 0x4E, 0xB9, 0x56, 0x56, 0x8B, 0x6B, 0x50, 0x6B, - 0x40, 0x56, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, - 0x56, 0x56, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x7B, 0x6E, 0xB7, 0xB7, 0xB7, 0x7E, 0x7F, - 0xB7, 0xB7, 0x7F, 0x7E, 0x6F, 0x5B, 0x29, 0x2C, - 0x48, 0x39, 0x24, 0x60, 0x58, 0xAF, 0xCC, 0x63, - 0x20, 0x8B, 0x8B, 0x39, 0x39, 0x48, 0x3F, 0x28, - 0x20, 0x20, 0x22, 0x23, 0x23, 0x23, 0x22, 0x20, - 0x2B, 0x22, 0x22, 0x2B, 0x2B, 0x20, 0x54, 0xCB, - 0x31, 0xCB, 0x25, 0x20, 0x27, 0x27, 0x27, 0x48, - 0xB9, 0x56, 0xB9, 0x56, 0x4F, 0x48, 0x47, 0x57, - 0x56, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, - 0xB9, 0x56, 0x62, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x48, 0x6F, 0x69, 0xB7, 0xB7, 0xB7, 0x7F, - 0xB7, 0xB7, 0xB7, 0x73, 0x59, 0x50, 0x29, 0x2B, - 0x28, 0x8B, 0x39, 0x25, 0x31, 0x55, 0xB6, 0x34, - 0x63, 0x2B, 0x48, 0x6B, 0x2C, 0x39, 0x47, 0x6B, - 0x22, 0x22, 0x23, 0x24, 0x23, 0x22, 0x20, 0x2B, - 0x20, 0x22, 0x2A, 0x2B, 0x20, 0x33, 0xCB, 0x31, - 0x78, 0x24, 0x21, 0xCD, 0x27, 0x27, 0x27, 0x56, - 0x56, 0xB9, 0x56, 0xB9, 0x56, 0x56, 0x56, 0xB9, - 0x56, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, - 0xB9, 0x56, 0xC9, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x41, 0x64, 0xB7, 0xB7, 0xB7, 0x7F, - 0x68, 0xB7, 0xAE, 0xA3, 0x23, 0x39, 0x8B, 0x2A, - 0x20, 0x20, 0x39, 0x6B, 0x25, 0xCC, 0x43, 0x43, - 0x34, 0x63, 0x2A, 0x48, 0x3F, 0x39, 0x6B, 0x6B, - 0x24, 0x23, 0x24, 0x24, 0x23, 0x21, 0x2B, 0x2B, - 0x22, 0x2B, 0x2B, 0x20, 0x24, 0x78, 0x31, 0x30, - 0x23, 0x21, 0x21, 0x27, 0x27, 0x27, 0x80, 0x56, - 0x56, 0xB9, 0x56, 0xB9, 0x56, 0xB9, 0x56, 0xB9, - 0x56, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, - 0x56, 0xB9, 0x56, 0x3C, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0xCE, 0x8A, 0xAE, 0x6F, 0xB7, - 0x6F, 0x89, 0x71, 0x78, 0x63, 0x23, 0x39, 0x6B, - 0x2B, 0x20, 0x20, 0x2C, 0x6B, 0x25, 0x34, 0x42, - 0x42, 0x34, 0x54, 0x29, 0x48, 0x3F, 0x39, 0x3F, - 0x25, 0x24, 0x25, 0x24, 0x22, 0x20, 0x2A, 0x21, - 0x2B, 0x2A, 0x20, 0x22, 0x30, 0x60, 0x30, 0x22, - 0x21, 0x22, 0x27, 0x27, 0x27, 0x2D, 0x4C, 0x56, - 0x56, 0xB9, 0xB9, 0x56, 0xB9, 0xB9, 0x56, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0x56, 0x2E, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x40, 0x97, 0x95, 0x5A, 0x71, - 0x7C, 0xCE, 0x40, 0x60, 0x31, 0x30, 0x23, 0x3F, - 0x3F, 0x20, 0x20, 0x20, 0x29, 0x8B, 0x33, 0x58, - 0x66, 0x43, 0xCC, 0x25, 0x39, 0x50, 0x6B, 0x2C, - 0x33, 0x25, 0x25, 0x23, 0x20, 0x2A, 0x2B, 0x20, - 0x2A, 0x2B, 0x22, 0x54, 0x30, 0x30, 0x24, 0x22, - 0x21, 0x27, 0x27, 0x27, 0x27, 0xAF, 0x29, 0x4E, - 0x4F, 0xB9, 0x56, 0xB9, 0x4D, 0x4D, 0x77, 0xC9, - 0xB9, 0xB9, 0xB9, 0x56, 0xC9, 0x4D, 0x4D, 0x80, - 0x4C, 0x40, 0xC9, 0x4D, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0xCF, 0x97, 0x97, 0xCE, - 0x86, 0xD0, 0x54, 0x6C, 0x58, 0x34, 0x60, 0x23, - 0x6B, 0x39, 0x20, 0x20, 0x20, 0x28, 0x6B, 0x54, - 0xD1, 0x66, 0xB6, 0x60, 0x22, 0x6B, 0x8B, 0x2C, - 0x54, 0x33, 0x24, 0x22, 0x2B, 0x28, 0x20, 0x28, - 0x2B, 0x20, 0x25, 0xC4, 0x30, 0x25, 0x22, 0x21, - 0x26, 0x27, 0x27, 0x27, 0x27, 0x20, 0x4B, 0x52, - 0x80, 0x4F, 0xB9, 0x56, 0xB9, 0x80, 0x56, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0x4D, 0x80, 0x50, 0x48, - 0x50, 0x50, 0x50, 0x56, 0x3D, 0x27, 0x36, 0x27, - 0x27, 0x27, 0x27, 0x3C, 0x46, 0xC3, 0x86, 0x86, - 0xD0, 0x39, 0x24, 0x6C, 0xD1, 0x43, 0x43, 0x6C, - 0x24, 0x6B, 0x2C, 0x20, 0x20, 0x20, 0x29, 0x39, - 0x63, 0xD1, 0x42, 0x55, 0xC4, 0x2B, 0x8B, 0x39, - 0x54, 0x25, 0x24, 0x20, 0x2A, 0x2A, 0x28, 0x28, - 0x20, 0x22, 0x54, 0x63, 0x25, 0x24, 0x22, 0x22, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x28, 0x77, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0xC9, 0x56, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x4F, - 0x77, 0x47, 0x8B, 0x40, 0x56, 0x27, 0x27, 0x49, - 0x2D, 0x27, 0x27, 0x27, 0x39, 0x40, 0x39, 0x39, - 0x28, 0x3F, 0x39, 0x33, 0x58, 0x66, 0x35, 0x2E, - 0x58, 0x24, 0x8B, 0x29, 0x20, 0x20, 0x20, 0x39, - 0x29, 0x30, 0x55, 0xB6, 0xCC, 0x25, 0x29, 0x39, - 0x54, 0x25, 0x22, 0x2B, 0x29, 0x2A, 0x29, 0x2B, - 0x22, 0x24, 0x54, 0x33, 0x25, 0x22, 0x2B, 0x54, - 0x27, 0x27, 0x62, 0x27, 0x30, 0x80, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x4D, 0x8B, 0x77, 0x36, 0x27, 0x27, - 0x3C, 0x2F, 0x27, 0x27, 0x39, 0x39, 0x39, 0x47, - 0x20, 0x2B, 0x2C, 0x39, 0x33, 0xB6, 0x35, 0x35, - 0x35, 0xAF, 0x24, 0x48, 0x2A, 0x20, 0x20, 0x20, - 0x8B, 0x2B, 0x78, 0xAF, 0x58, 0x30, 0x21, 0x28, - 0x33, 0x25, 0x21, 0x28, 0x29, 0x29, 0x28, 0x20, - 0x24, 0x33, 0x54, 0x33, 0x23, 0x20, 0x24, 0xD2, - 0x27, 0x49, 0x27, 0x27, 0x56, 0xB9, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0xC9, 0x50, 0x56, 0x27, 0x27, - 0x3D, 0x38, 0x3D, 0x27, 0x27, 0x47, 0x39, 0x39, - 0x28, 0x20, 0x20, 0x2A, 0x39, 0x54, 0x43, 0x35, - 0x35, 0x35, 0xAF, 0x23, 0x48, 0x2B, 0x20, 0x20, - 0x2B, 0x48, 0x22, 0x60, 0x34, 0xCB, 0x25, 0x21, - 0x33, 0x24, 0x2B, 0x29, 0x29, 0x29, 0x2B, 0x22, - 0x25, 0x54, 0x54, 0x25, 0x22, 0x2B, 0x33, 0x27, - 0x27, 0x32, 0x27, 0x30, 0x56, 0xB9, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0x56, 0xC9, 0x4C, 0x36, 0x3C, - 0x62, 0x2F, 0x2E, 0x27, 0x27, 0x54, 0x47, 0x47, - 0x8B, 0x2B, 0x20, 0x20, 0x20, 0x3F, 0x54, 0x2E, - 0x35, 0x35, 0x35, 0x34, 0x21, 0x8B, 0x2A, 0x20, - 0x20, 0x2C, 0x6B, 0x25, 0x60, 0x60, 0x54, 0x23, - 0x25, 0x22, 0x2A, 0x2C, 0x29, 0x28, 0x20, 0x24, - 0x54, 0x63, 0x54, 0x24, 0x2B, 0x22, 0x24, 0x27, - 0x36, 0x27, 0x27, 0x56, 0x56, 0xB9, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, 0x4C, 0x36, - 0x66, 0xD3, 0x27, 0x2F, 0x27, 0x54, 0x54, 0x27, - 0x26, 0x6B, 0x20, 0x20, 0x20, 0x20, 0x6B, 0x63, - 0x35, 0x35, 0x35, 0x62, 0xCB, 0x2A, 0x3F, 0x28, - 0x2B, 0x2A, 0x50, 0x29, 0x33, 0x30, 0x54, 0x25, - 0x24, 0x20, 0x29, 0x2C, 0x2C, 0x2A, 0x21, 0x33, - 0xC4, 0xC4, 0x33, 0x21, 0x29, 0x22, 0x27, 0x27, - 0x99, 0x27, 0x31, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, 0x56, 0x3D, - 0x3D, 0x3C, 0x3C, 0x55, 0x54, 0x54, 0x54, 0x20, - 0x27, 0x2C, 0x39, 0x20, 0x20, 0x20, 0x20, 0x48, - 0x30, 0x62, 0x35, 0x35, 0x42, 0x54, 0x39, 0x39, - 0x2C, 0x28, 0x3F, 0x8B, 0x20, 0x33, 0x54, 0x24, - 0x22, 0x2B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x54, - 0x30, 0xC4, 0x25, 0x2B, 0x28, 0x2B, 0x27, 0x3D, - 0x27, 0x27, 0x56, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0x56, 0x4F, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0x56, 0x56, 0x27, - 0x20, 0x20, 0x20, 0x54, 0x54, 0x54, 0x54, 0x20, - 0x20, 0x2D, 0x2D, 0x29, 0x20, 0x20, 0x20, 0x20, - 0x48, 0x60, 0x66, 0x35, 0x62, 0x34, 0x22, 0x2C, - 0x2C, 0x3F, 0x6B, 0x48, 0x2C, 0x22, 0x23, 0x23, - 0x20, 0x2A, 0x2C, 0x29, 0x29, 0x20, 0x25, 0xC4, - 0x30, 0x54, 0x22, 0x29, 0x28, 0xD2, 0x27, 0x35, - 0x27, 0x49, 0x56, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0x4F, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0x56, 0x56, 0x40, 0x20, - 0x20, 0x54, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, - 0x2D, 0x2D, 0x2D, 0x49, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x6B, 0x6C, 0x42, 0x2E, 0xB6, 0x54, 0x28, - 0x29, 0x2C, 0x6B, 0x48, 0x3F, 0x2A, 0x20, 0x22, - 0x2B, 0x28, 0x2C, 0x28, 0x29, 0x20, 0x33, 0x30, - 0x30, 0x54, 0x20, 0x2C, 0x29, 0x27, 0x27, 0x3D, - 0x27, 0x40, 0x56, 0xB9, 0x56, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x4D, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0x56, 0x63, 0x56, 0x54, 0x54, - 0x54, 0x54, 0x20, 0xD3, 0x45, 0x51, 0x51, 0x49, - 0x7C, 0x2D, 0x2D, 0x49, 0x49, 0x20, 0x20, 0x20, - 0x20, 0x2A, 0x2A, 0xCC, 0xB6, 0x8A, 0x60, 0x22, - 0x28, 0x29, 0x3F, 0x6B, 0x39, 0x29, 0x2B, 0x20, - 0x28, 0x2C, 0x28, 0x2A, 0x2A, 0x24, 0xC4, 0x30, - 0xC4, 0x33, 0x2B, 0x39, 0xCD, 0x27, 0x3C, 0x27, - 0x27, 0x56, 0xB9, 0x56, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x4D, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0x63, 0x63, 0x49, 0x2D, 0x20, - 0x20, 0x2D, 0xD3, 0x49, 0x66, 0x2D, 0x49, 0x49, - 0x49, 0x49, 0x49, 0x49, 0x49, 0x8B, 0x2B, 0x20, - 0x20, 0x20, 0x39, 0x23, 0x6C, 0xAF, 0xCB, 0x23, - 0x28, 0x28, 0x29, 0x2A, 0x2A, 0x2A, 0x2A, 0x20, - 0x29, 0x39, 0x2B, 0x2B, 0x2B, 0x25, 0x78, 0xC4, - 0x63, 0x23, 0x29, 0x39, 0x27, 0x27, 0x3D, 0x27, - 0x27, 0x56, 0xB9, 0x56, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x80, 0x4F, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0xB9, 0x2D, 0x49, 0x2D, 0x49, - 0x49, 0x2D, 0x49, 0x2D, 0x49, 0x2D, 0x2D, 0x2D, - 0x49, 0x49, 0x35, 0x49, 0x2D, 0x2D, 0x39, 0x28, - 0x20, 0x20, 0x2A, 0x28, 0x33, 0x60, 0xC4, 0x22, - 0x2C, 0x2A, 0x2A, 0x22, 0x23, 0x22, 0x20, 0x21, - 0x2C, 0x29, 0x20, 0x2B, 0x2B, 0x54, 0x30, 0xC4, - 0x63, 0x22, 0x2C, 0x27, 0x27, 0x27, 0x3D, 0x27, - 0x27, 0x56, 0x56, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x80, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0xB9, 0x2D, 0x49, 0x2D, 0x49, - 0x61, 0x49, 0x2D, 0x49, 0x49, 0x2D, 0x2D, 0x49, - 0x49, 0x49, 0x2F, 0x49, 0x2D, 0x78, 0x29, 0x28, - 0x2C, 0x2A, 0x2B, 0x39, 0x2B, 0x25, 0x33, 0x20, - 0x2C, 0x20, 0x2A, 0x24, 0x54, 0x54, 0x23, 0x23, - 0x2C, 0x2A, 0x22, 0x2B, 0x20, 0x63, 0x30, 0x63, - 0xC4, 0x21, 0x39, 0x27, 0x27, 0x27, 0x35, 0x36, - 0x27, 0x56, 0x56, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0x80, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0x2D, 0x49, 0x49, 0x49, - 0x49, 0x27, 0x27, 0x2D, 0x38, 0x27, 0x36, 0x36, - 0x49, 0x27, 0x49, 0x2D, 0x2D, 0x44, 0x24, 0x2B, - 0x20, 0x2C, 0x3F, 0x6B, 0x2A, 0x20, 0x21, 0x28, - 0x2C, 0x20, 0x2B, 0x24, 0x30, 0xCB, 0x63, 0x54, - 0x28, 0x20, 0x24, 0x2B, 0x23, 0x78, 0xC4, 0x63, - 0x63, 0x2B, 0x3F, 0x27, 0x27, 0x27, 0x38, 0x33, - 0x3D, 0xB9, 0x56, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0x56, 0x80, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0x63, 0x49, 0x49, 0x49, - 0x49, 0x49, 0x3D, 0x3D, 0x27, 0x27, 0x27, 0x2D, - 0x49, 0x49, 0x49, 0x2D, 0x62, 0x5F, 0xC4, 0x20, - 0x22, 0x2A, 0x6B, 0x8B, 0x2C, 0x2B, 0x2A, 0x3F, - 0x3F, 0x2A, 0x21, 0x21, 0xCB, 0x58, 0x6C, 0x60, - 0x20, 0x23, 0x24, 0x2A, 0x25, 0x78, 0x63, 0x63, - 0x54, 0x2A, 0x28, 0x27, 0x27, 0x27, 0x27, 0x62, - 0x3C, 0xB9, 0x56, 0x56, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x80, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0x49, 0x2D, 0x2D, - 0x2D, 0x3D, 0x2F, 0x3C, 0x2D, 0x3C, 0x27, 0x38, - 0x2D, 0x49, 0x2D, 0x2D, 0xD1, 0x43, 0x30, 0x20, - 0x24, 0x21, 0x21, 0x21, 0x2B, 0x2A, 0x29, 0x8B, - 0x6B, 0x29, 0x2B, 0x2A, 0x30, 0x55, 0x55, 0x34, - 0x22, 0x23, 0x24, 0x29, 0x54, 0x30, 0x63, 0x63, - 0x25, 0x29, 0x22, 0x3C, 0xA5, 0xD4, 0xD5, 0x27, - 0x31, 0x56, 0x56, 0x56, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x80, 0xB9, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0x56, 0x2D, 0x2E, - 0x3E, 0x27, 0x27, 0x27, 0x27, 0x27, 0x36, 0x44, - 0x3C, 0x27, 0x2D, 0xC4, 0x78, 0xCC, 0x54, 0x2B, - 0x25, 0x24, 0x63, 0x60, 0x63, 0x24, 0x2A, 0x6B, - 0x3F, 0x39, 0x28, 0x21, 0x33, 0xB6, 0x44, 0x58, - 0x22, 0x23, 0x24, 0x2A, 0x30, 0x30, 0x63, 0x63, - 0x24, 0x39, 0x22, 0xBB, 0x9C, 0xB2, 0x9D, 0xA8, - 0x27, 0x8B, 0x56, 0x56, 0xB9, 0x56, 0xB9, 0xB9, - 0x56, 0xB9, 0x56, 0x80, 0xB9, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0x56, 0xD6, 0xD6, 0xD7, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x32, - 0x3D, 0x27, 0x39, 0x33, 0xC4, 0xC4, 0x22, 0x28, - 0x25, 0x54, 0x30, 0xD1, 0xD1, 0x60, 0x23, 0x6B, - 0x3F, 0x39, 0x2C, 0x2B, 0x20, 0x58, 0x8A, 0x58, - 0x22, 0x23, 0x23, 0x2B, 0x78, 0x30, 0xC4, 0xC4, - 0x23, 0x29, 0xBB, 0xBB, 0xD8, 0xB2, 0x9D, 0xA9, - 0xA9, 0x3C, 0x60, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, - 0x56, 0xB9, 0x56, 0x80, 0xB9, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0xB9, 0xB9, 0x56, 0xD9, 0x85, 0x85, 0x85, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x2D, - 0xA0, 0x83, 0x2C, 0x21, 0x30, 0x33, 0x29, 0x29, - 0x21, 0x33, 0x54, 0x42, 0x66, 0x55, 0xC4, 0x29, - 0x8B, 0x2C, 0x39, 0x28, 0x29, 0x31, 0x44, 0x58, - 0x23, 0x23, 0x21, 0x20, 0x30, 0xC4, 0xC4, 0x30, - 0x21, 0x20, 0xBB, 0xBC, 0xDA, 0xDB, 0xDC, 0xB2, - 0x83, 0xB4, 0x3C, 0x2F, 0xB9, 0x56, 0x56, 0xB9, - 0x56, 0xB9, 0x56, 0x80, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x56, 0xA7, 0xD4, 0x85, 0x82, - 0x3C, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x61, - 0x9E, 0x90, 0xDD, 0x21, 0x33, 0x25, 0x2C, 0x39, - 0x2A, 0x24, 0x24, 0x42, 0x62, 0x43, 0x34, 0x22, - 0x50, 0x39, 0x2C, 0x2C, 0x2A, 0x54, 0xD1, 0x58, - 0x22, 0x22, 0x2B, 0x22, 0x30, 0xC4, 0x30, 0x60, - 0x20, 0xDE, 0xBB, 0xD9, 0x84, 0x84, 0xDF, 0xA9, - 0xDB, 0xDB, 0x61, 0x27, 0x38, 0x4D, 0x56, 0x56, - 0x56, 0xB9, 0x56, 0xB9, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x56, 0x56, 0x8D, 0xD9, 0xD5, 0xA6, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0xBB, - 0x85, 0xDB, 0xDD, 0x21, 0x22, 0x22, 0x3F, 0x39, - 0x2C, 0x2B, 0x25, 0x34, 0x62, 0x66, 0xD1, 0xC4, - 0x6B, 0x39, 0x2C, 0x39, 0x29, 0x21, 0x58, 0xCC, - 0x22, 0x21, 0x29, 0x23, 0x30, 0x30, 0x30, 0x5E, - 0x82, 0xBB, 0xE0, 0xB1, 0xE1, 0x9C, 0xD4, 0xDC, - 0x9D, 0xA9, 0xE2, 0x27, 0x27, 0x27, 0x4D, 0x56, - 0x56, 0xB9, 0x56, 0xB9, 0x56, 0x56, 0xB9, 0xB9, - 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0x56, 0xB9, 0x56, - 0xB9, 0x56, 0x4C, 0x48, 0xA8, 0xA8, 0xE3, 0x8C, - 0xC6, 0x3C, 0x27, 0x27, 0x27, 0xE4, 0xA6, 0xE5, - 0x83, 0xA9, 0xE6, 0xAF, 0x54, 0x2B, 0x8B, 0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0x20, 0x25, - 0x22, 0x60, 0x34, 0x30, 0x20, 0x8B, 0x8B, 0x39, - 0x54, 0x24, 0x2B, 0xC0, 0xC0, 0xC0, 0xBB, 0x9B, - 0xBC, 0xAA, 0xAA, 0xE3, 0xE3, 0x9C, 0xB2, 0xD4, - 0x83, 0xD8, 0xE8, 0x83, 0x84, 0xE8, 0xE5, 0x75, - 0x9A, 0xF0, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0xF0, 0xB4, 0x9B, 0xE3, 0xA8, - 0xA9, 0xD8, 0x8E, 0xEA, 0xA8, 0x9C, 0xD9, 0xE0, - 0xC0, 0x5E, 0x2C, 0x20, 0x54, 0x60, 0x30, 0x66, - 0xB6, 0xCC, 0x63, 0x3F, 0x8B, 0x28, 0x22, 0x33, - 0x23, 0x31, 0xAF, 0x31, 0x22, 0x6B, 0x6B, 0x29, - 0x30, 0x54, 0x22, 0x89, 0xBA, 0xED, 0xA6, 0x8C, - 0xB4, 0xC0, 0xB4, 0x75, 0x75, 0x9B, 0x9B, 0xE5, - 0xA9, 0xD5, 0x8E, 0x8E, 0x9C, 0xE3, 0x75, 0x8C, - 0xC8, 0xF1, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0xF1, 0x9A, 0xB4, 0x9B, 0xE3, - 0xE3, 0xA8, 0xE3, 0xE5, 0xAA, 0xBC, 0xC0, 0x9A, - 0x26, 0x29, 0x20, 0x24, 0x63, 0x60, 0x54, 0x43, - 0x34, 0xCB, 0x30, 0x39, 0x2C, 0x20, 0x24, 0x54, - 0x22, 0x34, 0x34, 0x31, 0x24, 0x3F, 0x2C, 0x2B, - 0x31, 0x30, 0x25, 0x2A, 0x6B, 0x29, 0x20, 0xF2, - 0xBA, 0xBF, 0xC8, 0x9A, 0xA6, 0xA6, 0x8C, 0xB4, - 0x9B, 0xAA, 0xAA, 0xAA, 0x9B, 0x75, 0xDE, 0xBF, - 0x81, 0xEF, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, - 0x27, 0x27, 0x27, 0xEF, 0xBA, 0x9A, 0xB4, 0x75, - 0x9B, 0x9B, 0x9B, 0xC0, 0xB4, 0x9A, 0xA5, 0xC4, - 0x30, 0x28, 0x22, 0x33, 0x30, 0x30, 0x23, 0x34, - 0x31, 0x30, 0xC4, 0x2C, 0x2B, 0x22, 0x33, 0x63, - 0x21, 0x58, 0x6C, 0x60, 0x25, 0x39, 0x28, 0x2B, - 0xCC, 0x6C, 0x63, 0x20, 0x6B, 0x28, 0x2B, 0x20, - 0x63, 0x43, 0xF3, 0xEF, 0xF0, 0x81, 0xBA, 0xF4, - 0xF4, 0xA6, 0xDE, 0x8C, 0xA6, 0x9A, 0xBA, 0x81, - 0xB0, 0xE4, 0xA1, 0x20, 0x20, 0x23, 0x31, 0xC4, - 0x30, 0x24, 0x33, 0x31, 0x31, 0x60, 0x43, 0x35, - 0x35, 0x55, 0x6C, 0xEF, 0x81, 0xC8, 0x9A, 0xA6, - 0xB4, 0xB4, 0x8C, 0xA6, 0xBA, 0x68, 0x30, 0x30, - 0x30, 0x2B, 0x25, 0x54, 0xC4, 0x54, 0x24, 0x78, - 0x63, 0x63, 0x30, 0x29, 0x21, 0x24, 0x54, 0x63, - 0x23, 0x34, 0xCB, 0x30, 0x25, 0x39, 0x20, 0x20, - 0x58, 0x34, 0x60, 0x23, 0x6B, 0x29, 0x28, 0x20, - 0x22, 0xB6, 0x42, 0xB6, 0x58, 0x54, 0xF5, 0xD7, - 0xA5, 0xBA, 0xBA, 0xBA, 0xBA, 0x81, 0xA5, 0xF1, - 0xE4, 0x2A, 0x39, 0x20, 0x20, 0x20, 0x31, 0x60, - 0x54, 0x28, 0x2B, 0x22, 0x33, 0x30, 0x43, 0x35, - 0x66, 0xD1, 0x34, 0xE4, 0xEF, 0x81, 0xC8, 0x9A, - 0x9A, 0xC8, 0xC8, 0x81, 0xF6, 0x31, 0x63, 0x31, - 0x78, 0x2B, 0x54, 0x63, 0x54, 0x24, 0x23, 0x54, - 0x63, 0x54, 0x63, 0x2C, 0x23, 0x33, 0x63, 0x54, - 0x25, 0x31, 0x78, 0x30, 0x25, 0x3F, 0x20, 0x20, - 0xAF, 0x58, 0xCC, 0x33, 0x39, 0x29, 0x29, 0x2A, - 0x29, 0x58, 0x43, 0x42, 0xD1, 0xCB, 0x2C, 0x2C, - 0x37, 0xCD, 0xEF, 0xB0, 0xF0, 0xB0, 0xEF, 0xE4, - 0x63, 0x20, 0x20, 0x2C, 0x2C, 0x21, 0xCB, 0x78, - 0x54, 0x39, 0x39, 0x28, 0x2B, 0x28, 0x2B, 0xCB, - 0x55, 0xB6, 0xD1, 0x28, 0xE4, 0xD7, 0xB8, 0xF0, - 0xA5, 0xB0, 0xEF, 0x26, 0x23, 0x54, 0x31, 0x58, - 0xCB, 0x20, 0x63, 0x63, 0x25, 0x2B, 0x54, 0x78, - 0x30, 0x63, 0x54, 0x28, 0x33, 0x63, 0x63, 0x33, - 0x54, 0x78, 0xC4, 0x30, 0x24, 0x2C, 0x22, 0x22, - 0x55, 0x55, 0x34, 0x30, 0x28, 0x2C, 0x29, 0x29, - 0x28, 0x30, 0xB6, 0x42, 0x43, 0x55, 0x22, 0x29, - 0x2C, 0x2B, 0x2B, 0x3F, 0xE4, 0xE4, 0x43, 0x66, - 0x30, 0x23, 0x24, 0x2A, 0x28, 0x2B, 0x54, 0x63, - 0x33, 0x39, 0x28, 0x20, 0x20, 0x20, 0x2B, 0x31, - 0x30, 0xD1, 0x43, 0x30, 0x39, 0x28, 0xE4, 0xE4, - 0xD7, 0xF5, 0x2B, 0x6B, 0x20, 0x30, 0x34, 0xD1, - 0x60, 0x23, 0x63, 0x54, 0x22, 0x47, 0x60, 0xCB, - 0xC4, 0xC4, 0x25, 0x22, 0x54, 0xC4, 0x63, 0x23, - 0xC4, 0xC4, 0x63, 0xC4, 0x23, 0x2A, 0x24, 0x22, - 0x55, 0x55, 0xAF, 0x6C, 0x22, 0x39, 0x2C, 0x39, - 0x28, 0x23, 0xD1, 0x43, 0x42, 0x8A, 0x63, 0x39, - 0x39, 0x2A, 0x20, 0x6B, 0x33, 0xCC, 0xD1, 0xB6, - 0x30, 0x24, 0x54, 0x63, 0x31, 0xCC, 0xCC, 0xCB, - 0xC4, 0x2A, 0x39, 0x20, 0x20, 0x20, 0x39, 0x30, - 0x30, 0x6C, 0x43, 0x43, 0x6C, 0x63, 0x25, 0x24, - 0x63, 0x63, 0x63, 0x25, 0x63, 0xCC, 0xD1, 0x34, - 0x63, 0x25, 0x54, 0x25, 0x2A, 0x28, 0x31, 0xCB, - 0x63, 0x78, 0x24, 0x33, 0xC4, 0xC4, 0x33, 0x2C, - 0xC4, 0x54, 0x54, 0x30, 0x21, 0x22, 0x25, 0x23, - 0x55, 0x55, 0xD1, 0x58, 0x33, 0x6B, 0x2C, 0x39, - 0x39, 0x39, 0x34, 0x43, 0x42, 0x43, 0xCC, 0x2B, - 0x28, 0x29, 0x20, 0x28, 0x21, 0x30, 0xCC, 0xAF, - 0x54, 0x23, 0xC4, 0x54, 0x58, 0x2E, 0x35, 0x42, - 0x55, 0x54, 0x8B, 0x2A, 0x20, 0x20, 0x28, 0x22, - 0x78, 0x30, 0xD1, 0x43, 0x44, 0x6C, 0xC4, 0xC4, - 0x60, 0x31, 0x31, 0x63, 0x6C, 0xAF, 0xCC, 0xCB, - 0x24, 0x25, 0x33, 0x23, 0x2C, 0x24, 0x31, 0x30, - 0x63, 0xC4, 0x21, 0x54, 0x30, 0x63, 0x24, 0x2A, - 0x54, 0x63, 0x54, 0xC4, 0x2B, 0x24, 0x33, 0x24, - 0x34, 0x55, 0xD1, 0x55, 0x30, 0x28, 0x29, 0x39, - 0x39, 0x8B, 0x63, 0x55, 0x42, 0x66, 0xB6, 0x25, - 0x29, 0x29, 0x29, 0x28, 0x2A, 0x54, 0x78, 0x6C, - 0x23, 0x20, 0x25, 0x30, 0xCB, 0x62, 0x35, 0x35, - 0x35, 0x44, 0x24, 0x6B, 0x29, 0x20, 0x2A, 0x39, - 0x28, 0x63, 0x34, 0xB6, 0x34, 0xCB, 0x63, 0x30, - 0x31, 0x31, 0x30, 0x30, 0xCC, 0x60, 0x63, 0xC4, - 0x20, 0x33, 0x25, 0x20, 0x48, 0x33, 0x30, 0x54, - 0x78, 0x54, 0x2B, 0x63, 0x30, 0x63, 0x23, 0x22, - 0x63, 0x63, 0x63, 0x33, 0x28, 0x25, 0x54, 0x24, - 0x78, 0xAF, 0xD1, 0xD1, 0xCC, 0x22, 0x39, 0x39, - 0x2C, 0x3F, 0x2B, 0x34, 0xB6, 0x43, 0x43, 0xC4, - 0x2B, 0x28, 0x39, 0x50, 0x2C, 0x24, 0x63, 0x78, - 0x21, 0x2C, 0x2A, 0x23, 0x54, 0xD1, 0x35, 0x35, - 0x35, 0x35, 0x55, 0x22, 0x39, 0x2C, 0x2C, 0x2C, - 0x20, 0x30, 0xCC, 0x6C, 0xCB, 0x30, 0x54, 0x30, - 0x78, 0x63, 0x78, 0x30, 0x54, 0x78, 0x30, 0x23, - 0x2B, 0x33, 0x24, 0x28, 0x39, 0x24, 0x54, 0x30, - 0x78, 0x33, 0x25, 0xC4, 0xC4, 0x33, 0x39, 0x25, - 0xC4, 0x63, 0xC4, 0x24, 0x20, 0x54, 0x54, 0x25, - 0x63, 0xCC, 0xD1, 0xB6, 0x55, 0x54, 0x39, 0x29, - 0x39, 0x2C, 0x6B, 0x30, 0xAF, 0xB6, 0xB6, 0x60, - 0x22, 0x2A, 0x2C, 0x39, 0x2C, 0x21, 0x54, 0x63, - 0x21, 0x50, 0x2C, 0x2C, 0x2B, 0x25, 0x62, 0x35, - 0x35, 0x35, 0x35, 0xCC, 0x2B, 0x29, 0x2B, 0x20, - 0x23, 0x25, 0xC4, 0x30, 0xC4, 0x63, 0x63, 0x63, - 0x63, 0x33, 0x24, 0x31, 0x31, 0x31, 0x54, 0x28, - 0x24, 0x25, 0x22, 0x6B, 0x28, 0x24, 0xC4, 0x78, - 0x30, 0x24, 0x63, 0xC4, 0x54, 0x23, 0x29, 0x63, - 0xC4, 0x54, 0xC4, 0x21, 0x24, 0x54, 0x54, 0x25, - 0x30, 0xCB, 0xD1, 0xB6, 0x55, 0x63, 0x28, 0x29, - 0x39, 0x39, 0x48, 0x33, 0x58, 0x44, 0xB6, 0x60, - 0x24, 0x20, 0x2B, 0x28, 0x2A, 0x22, 0x54, 0x63, - 0x21, 0x48, 0x2A, 0x2B, 0x39, 0x21, 0xB6, 0x35, - 0x35, 0x35, 0x35, 0x42, 0x23, 0x29, 0x2A, 0x2B, - 0x23, 0x25, 0x54, 0x54, 0x54, 0x63, 0x63, 0x30, - 0x25, 0x2B, 0x31, 0x31, 0x31, 0x31, 0x21, 0x2C, - 0x33, 0x25, 0x21, 0x39, 0x20, 0x25, 0x30, 0x78, - 0xC4, 0x23, 0xC4, 0x30, 0x54, 0x20, 0x28, 0x63, - 0x63, 0x63, 0x63, 0x20, 0x25, 0x54, 0x54, 0x20, + 0xD8, 0xA3, 0x98, 0x98, 0xA3, 0xB2, 0x2F, 0x2F, + 0xA3, 0x66, 0x98, 0x98, 0x98, 0xA3, 0x2F, 0xA3, + 0x98, 0x55, 0xA0, 0xA3, 0xB2, 0x51, 0x51, 0x2F, + 0x98, 0x55, 0x8F, 0x2F, 0x89, 0x44, 0x89, 0x51, + 0xB2, 0x2F, 0x66, 0xA3, 0x2F, 0x2F, 0x66, 0x66, + 0xA3, 0xB2, 0xB2, 0xB2, 0x89, 0xD8, 0x44, 0x44, + 0xD8, 0x83, 0xD8, 0xA3, 0x98, 0x98, 0xA3, 0xB2, + 0x2F, 0x2F, 0xA3, 0x66, 0x98, 0x98, 0x98, 0xA3, + 0x2F, 0xA3, 0x98, 0x55, 0xA0, 0xA3, 0xB2, 0x51, + 0x51, 0x2F, 0x98, 0x55, 0x8F, 0x2F, 0x89, 0x44, + 0xA3, 0x55, 0x55, 0x98, 0x2F, 0x2F, 0x2F, 0xA3, + 0x66, 0x66, 0x98, 0x98, 0x66, 0x66, 0x66, 0x98, + 0x55, 0xA5, 0x8F, 0xA3, 0x51, 0x51, 0xB2, 0x2F, + 0x66, 0x66, 0xA3, 0x51, 0x89, 0x51, 0xB2, 0x2F, + 0x2F, 0xA3, 0x66, 0xA3, 0xA3, 0xA3, 0x2F, 0x2F, + 0xB2, 0xB2, 0x2F, 0x2F, 0xB2, 0x51, 0x51, 0x51, + 0x51, 0x51, 0xA3, 0x55, 0x55, 0x98, 0x2F, 0x2F, + 0x2F, 0xA3, 0x66, 0x66, 0x98, 0x98, 0x66, 0x66, + 0x66, 0x98, 0x55, 0xA5, 0x8F, 0xA3, 0x51, 0x51, + 0xB2, 0x2F, 0x66, 0x66, 0xA3, 0x51, 0x89, 0x51, + 0x98, 0xA5, 0x55, 0x8F, 0x2F, 0xB2, 0x2F, 0xA3, + 0x66, 0x66, 0x98, 0x8F, 0x66, 0x66, 0x66, 0x98, + 0xA0, 0x8F, 0xA3, 0xB2, 0x51, 0x51, 0xB2, 0x2F, + 0xA3, 0xA3, 0x2F, 0xB2, 0x51, 0xB2, 0x2F, 0x2F, + 0xA3, 0x66, 0x98, 0xA3, 0x51, 0xB2, 0x2F, 0xA3, + 0xB2, 0x51, 0x51, 0xB2, 0xB2, 0x51, 0xB2, 0xB2, + 0xB2, 0x2F, 0x98, 0xA5, 0x55, 0x8F, 0x2F, 0xB2, + 0x2F, 0xA3, 0x66, 0x66, 0x98, 0x8F, 0x66, 0x66, + 0x66, 0x98, 0xA0, 0x8F, 0xA3, 0xB2, 0x51, 0x51, + 0xB2, 0x2F, 0xA3, 0xA3, 0x2F, 0x51, 0x51, 0xB2, + 0xA0, 0xA5, 0x55, 0x66, 0xB2, 0x51, 0xB2, 0xA3, + 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, 0x98, 0x98, + 0x66, 0xA3, 0x2F, 0xB2, 0x51, 0x51, 0xB2, 0xA3, + 0xA3, 0xA3, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0xA3, + 0x66, 0x98, 0xB2, 0x4C, 0x54, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xCE, 0x2F, 0xB2, 0x2F, 0x2F, + 0xA3, 0x98, 0xA0, 0xA5, 0x55, 0x66, 0xB2, 0x51, + 0xB2, 0xA3, 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, + 0x98, 0x98, 0x66, 0xA3, 0x2F, 0xB2, 0x51, 0x51, + 0xB2, 0xA3, 0xA3, 0xA3, 0x2F, 0x2F, 0x2F, 0x2F, + 0xA0, 0xA0, 0x8F, 0xA3, 0xB2, 0x51, 0xB2, 0x2F, + 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, 0x66, 0x66, + 0xA3, 0x2F, 0x51, 0x51, 0x51, 0xB2, 0x2F, 0xA3, + 0x66, 0x66, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, + 0x2F, 0xA0, 0xDA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x9C, 0xB2, 0xA3, + 0x66, 0x98, 0xA0, 0xA0, 0x8F, 0xA3, 0xB2, 0x51, + 0xB2, 0x2F, 0x66, 0x66, 0x98, 0x66, 0x66, 0x66, + 0x66, 0x66, 0xA3, 0x2F, 0x51, 0x51, 0x51, 0xB2, + 0x2F, 0xA3, 0x66, 0x66, 0x66, 0xA3, 0xA3, 0xA3, + 0x8F, 0x8F, 0x66, 0x2F, 0x51, 0x51, 0xB2, 0xA3, + 0x66, 0x98, 0x98, 0x66, 0x66, 0x66, 0x2F, 0x2F, + 0xB2, 0x51, 0xB2, 0xB2, 0x2F, 0x2F, 0xA3, 0x66, + 0x66, 0x66, 0xA3, 0xA3, 0x2F, 0xA3, 0xA3, 0xB2, + 0x9C,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x98, 0x66, 0x2F, 0xB2, 0xB2, + 0x2F, 0x98, 0x8F, 0x8F, 0x98, 0x66, 0xA3, 0xB2, + 0xB2, 0xB2, 0x2F, 0x2F, 0x2F, 0x2F, 0xA3, 0x2F, + 0xA3, 0xA3, 0xA3, 0x2F, 0xA3, 0xA3, 0xA3, 0xA3, + 0xA3, 0x8F, 0x66, 0x2F, 0xB2, 0x51, 0x2F, 0x98, + 0xA0, 0x8F, 0x66, 0xA3, 0x2F, 0x51, 0x51, 0xB2, + 0xA3, 0xA3, 0xA3, 0x2F, 0xA3, 0xA3, 0x66, 0x66, + 0x98, 0x98, 0x98, 0x66, 0x98, 0x66, 0x55, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xCE, 0x4C, 0x9C, 0x2E, 0xDA, + 0x20, 0xDA, 0x51, 0x8F, 0x66, 0x2F, 0xB2, 0x51, + 0x2F, 0x98, 0xA0, 0x8F, 0x66, 0xA3, 0x2F, 0x51, + 0x51, 0xB2, 0xA3, 0xA3, 0xA3, 0x2F, 0xA3, 0xA3, + 0x66, 0x66, 0x98, 0x98, 0x98, 0x98, 0x98, 0x66, + 0x51, 0x66, 0x2F, 0xB2, 0x51, 0xB2, 0xA3, 0xA0, + 0xA0, 0x66, 0xA3, 0xB2, 0xB2, 0xB2, 0xB2, 0xA3, + 0x66, 0x66, 0x66, 0xA3, 0xA3, 0x66, 0x98, 0x98, + 0x98, 0x98, 0x98, 0x66, 0x66, 0xB2, 0x6D, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x6D, 0x3A, 0x20, 0x20, 0x20, + 0x20, 0x20, 0xA5, 0x66, 0x2F, 0xB2, 0x51, 0xB2, + 0xA3, 0xA0, 0xA0, 0x66, 0xA3, 0xB2, 0xB2, 0xB2, + 0xB2, 0xA3, 0x66, 0x66, 0x66, 0xA3, 0xA3, 0x66, + 0x98, 0x98, 0x8F, 0x98, 0x66, 0x66, 0x66, 0x66, + 0x51, 0x2F, 0xB2, 0x51, 0x51, 0x2F, 0x66, 0xA0, + 0x8F, 0xA3, 0x2F, 0xB2, 0xB2, 0x2F, 0x2F, 0x66, + 0x98, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x2F, 0xA3, 0x2F, 0x2F, 0x51, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0xDA, 0x51, 0xB2, 0x51, 0x51, 0x2F, + 0x66, 0xA0, 0x8F, 0xA3, 0x2F, 0xB2, 0xB2, 0x2F, + 0x2F, 0x66, 0x98, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0xA3, 0x2F, 0x2F, 0x2F, 0x2F, + 0x51, 0x2F, 0xB2, 0x51, 0x2F, 0xA3, 0x8F, 0x8F, + 0x98, 0xA3, 0xB2, 0xB2, 0x2F, 0xA3, 0x98, 0x66, + 0x98, 0x98, 0x66, 0x66, 0x66, 0x66, 0xA3, 0x2F, + 0xB2, 0xB2, 0x51, 0xB2, 0xB2, 0x66, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xA3, 0xB2, 0x51, 0x2F, 0xA3, + 0x8F, 0x8F, 0x98, 0xA3, 0xB2, 0xB2, 0x2F, 0xA3, + 0x98, 0x66, 0x98, 0x98, 0x66, 0x66, 0x66, 0x66, + 0xA3, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, + 0xB2, 0x2F, 0xA3, 0x2F, 0x66, 0x98, 0x8F, 0x98, + 0xA3, 0x2F, 0x2F, 0xA3, 0x98, 0x98, 0x98, 0x98, + 0x66, 0x98, 0x66, 0x98, 0x66, 0xA3, 0x2F, 0xB2, + 0x51, 0x51, 0x51, 0xB2, 0xB2, 0x8F, 0x20, 0x20, + 0x20, 0x54, 0x6D, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x54, 0x6D, 0x6D, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x4C, 0xA3, 0x2F, 0x66, 0x98, + 0x8F, 0x98, 0xA3, 0x2F, 0x2F, 0xA3, 0x98, 0x98, + 0x98, 0x98, 0x66, 0x98, 0x66, 0x98, 0x66, 0xA3, + 0x2F, 0xB2, 0x51, 0x51, 0x51, 0xB2, 0x2F, 0x2F, + 0x2F, 0xA3, 0xA3, 0x66, 0x98, 0x98, 0x8F, 0x98, + 0x2F, 0x2F, 0x2F, 0x66, 0x8F, 0x8F, 0x98, 0xA3, + 0x66, 0x66, 0x8F, 0x98, 0x98, 0x66, 0x2F, 0xB2, + 0x51, 0xB2, 0x2F, 0xA3, 0xA3, 0xA0, 0x20, 0x20, + 0xDA, 0x2E, 0x3A, 0xA7, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xCE, 0x2A, 0x2A, 0x2E, 0xA7, 0xDA, 0x20, + 0x20, 0x20, 0x20, 0x9C, 0xA3, 0x66, 0x98, 0x98, + 0x8F, 0x98, 0x2F, 0x2F, 0x2F, 0x66, 0x8F, 0x8F, + 0x98, 0xA3, 0x66, 0x66, 0x8F, 0x98, 0x98, 0x66, + 0x2F, 0xB2, 0x51, 0xB2, 0x2F, 0x2F, 0xA3, 0xA3, + 0xB2, 0xA3, 0x66, 0x98, 0x8F, 0x8F, 0x66, 0xA3, + 0x2F, 0x2F, 0x66, 0x98, 0x98, 0x66, 0x2F, 0x2F, + 0xA3, 0x98, 0x8F, 0x98, 0x66, 0x2F, 0xB2, 0xB2, + 0xB2, 0xA3, 0x66, 0x66, 0x66, 0x98, 0x20, 0x3A, + 0x98, 0x89, 0x8F, 0x6D, 0x20, 0x20, 0x20, 0x20, + 0x4C, 0x66, 0x51, 0x44, 0x51, 0x2E, 0x54, 0x20, + 0x20, 0x20, 0x20, 0xA7, 0x66, 0x98, 0x8F, 0x8F, + 0x66, 0xA3, 0x2F, 0x2F, 0x66, 0x98, 0x98, 0x66, + 0x2F, 0x2F, 0xA3, 0x98, 0x8F, 0x98, 0x66, 0x2F, + 0xB2, 0xB2, 0xB2, 0xA3, 0x66, 0x66, 0x66, 0xA3, + 0x2F, 0x66, 0x98, 0x8F, 0x8F, 0x98, 0x66, 0x2F, + 0x2F, 0xA3, 0x66, 0x98, 0x98, 0xA3, 0x2F, 0xB2, + 0xA3, 0x8F, 0x98, 0xA3, 0xB2, 0x51, 0x89, 0x89, + 0xB2, 0xA3, 0x66, 0x98, 0x66, 0x98, 0x20, 0xA6, + 0x44, 0x39, 0xE6, 0x98, 0x20, 0x20, 0x20, 0x9C, + 0x74, 0xD6, 0x7E, 0xD6, 0x39, 0x8F, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x2E, 0x98, 0x8F, 0x8F, 0x98, + 0x66, 0x2F, 0x2F, 0xA3, 0x66, 0x98, 0x98, 0xA3, + 0x2F, 0xB2, 0x66, 0x98, 0x8F, 0xA3, 0xB2, 0x51, + 0x89, 0x89, 0xB2, 0xA3, 0x66, 0x98, 0x66, 0x66, + 0x2F, 0x66, 0x8F, 0xA0, 0x8F, 0x98, 0xA3, 0xB2, + 0x2F, 0x66, 0x66, 0x66, 0xA3, 0x2F, 0x2F, 0x2F, + 0x66, 0x98, 0xA3, 0xB2, 0x89, 0x44, 0x89, 0x51, + 0x2F, 0x66, 0x98, 0x98, 0xA3, 0x66, 0x20, 0x2F, + 0x2F, 0xAD, 0x89, 0xD6, 0x3A, 0x20, 0x20, 0x55, + 0x6B, 0x51, 0x6D, 0x4C, 0xD8, 0xD6, 0x2E, 0x20, + 0x20, 0x20, 0x20, 0x54, 0x8F, 0xA0, 0x8F, 0x98, + 0xA3, 0xB2, 0x2F, 0x66, 0x66, 0x66, 0xA3, 0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 0x8F, 0x2A, 0x2A, 0xA5, + 0x8F, 0x66, 0xA3, 0xB2, 0x2F, 0x51, 0x20, 0x6D, + 0x77, 0xF7, 0xEE, 0x30, 0xB0, 0x72, 0x72, 0x5B, + 0x82, 0xEA, 0x72, 0xB0, 0x90, 0x96, 0x71, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x2F, 0x98, 0x98, 0x2F, + 0xB2, 0xB2, 0x66, 0xA3, 0x2F, 0x51, 0x51, 0xB2, + 0xB2, 0x2F, 0x51, 0x89, 0x89, 0x2F, 0x8F, 0x2A, + 0xAD, 0xA5, 0x98, 0x66, 0xA3, 0xB2, 0x2F, 0xB2, + 0xD8, 0xB2, 0xA3, 0x98, 0x98, 0x2F, 0xB2, 0xB2, + 0x66, 0xA3, 0xB2, 0x51, 0x51, 0xB2, 0x2F, 0xA3, + 0x51, 0x89, 0x89, 0xA3, 0xA0, 0x2A, 0xA5, 0x8F, + 0x66, 0xA3, 0x2F, 0xB2, 0xB2, 0x51, 0x20, 0x69, + 0x64, 0xF9, 0x3F, 0x52, 0x52, 0x72, 0x29, 0x82, + 0x47, 0x47, 0x47, 0x8B, 0x72, 0xB7, 0x60, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x2F, 0x98, 0x98, 0x2F, + 0xB2, 0xB2, 0xA3, 0xA3, 0xB2, 0x89, 0x51, 0x2F, + 0x2F, 0xA3, 0x51, 0x89, 0x89, 0xA3, 0xA0, 0x2A, + 0xA5, 0x8F, 0x66, 0xA3, 0x2F, 0xB2, 0xB2, 0xB2, + 0xDD, 0xA3, 0x66, 0x98, 0x66, 0x2F, 0xB2, 0xB2, + 0xA3, 0xA3, 0xB2, 0x51, 0xB2, 0x2F, 0xA3, 0x2F, + 0xB2, 0x89, 0xB2, 0x66, 0xA0, 0xA5, 0x8F, 0x98, + 0x66, 0x66, 0xB2, 0x51, 0x51, 0x51, 0x81, 0xFA, + 0x62, 0xEE, 0x30, 0x52, 0x22, 0x72, 0x82, 0x82, + 0x47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x92, 0x20, + 0x20, 0x20, 0x6D, 0x6D, 0x20, 0x20, 0x20, 0x20, + 0xA3, 0xA3, 0x66, 0x98, 0x98, 0x8F, 0x8F, 0x98, + 0x98, 0x98, 0x98, 0x66, 0x98, 0x66, 0x66, 0xA3, + 0xA3, 0x66, 0x66, 0x66, 0xA3, 0x2F, 0x2F, 0xA3, + 0xA3, 0xA3, 0x66, 0x66, 0xA3, 0xA3, 0xA3, 0x66, + 0x8F, 0x55, 0xA5, 0x98, 0x20, 0x2E, 0x54, 0x54, + 0x89, 0x6B, 0x6B, 0x6B, 0x6B, 0x84, 0xE3, 0x4A, + 0x58, 0x42, 0x5B, 0x8B, 0x82, 0x82, 0x82, 0x82, + 0x82, 0x59, 0x58, 0x57, 0x57, 0x59, 0x7B, 0x84, + 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0xAD, 0x20, + 0x20, 0x20, 0x3A, 0x3A, 0x20, 0x20, 0x20, 0x20, + 0x2A, 0x66, 0x8F, 0x55, 0xA5, 0xA5, 0xA0, 0x8F, + 0x66, 0xA3, 0xA3, 0x66, 0x98, 0x66, 0x66, 0x2F, + 0x2F, 0x2F, 0x2F, 0xA3, 0xA3, 0x2F, 0x2F, 0x2F, + 0xA3, 0x2F, 0xA3, 0xA3, 0x66, 0xA3, 0xA3, 0x66, + 0x8F, 0xA5, 0x8F, 0x2E, 0x20, 0x2E, 0x20, 0x3A, + 0x4D, 0x6B, 0xE6, 0x84, 0x3D, 0x6B, 0xEB, 0x4A, + 0xC9, 0x8B, 0x8B, 0x31, 0x59, 0x82, 0x59, 0x59, + 0x5B, 0x82, 0x59, 0x73, 0x7B, 0xDC, 0x57, 0x6B, + 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x55, 0x20, + 0x20, 0x20, 0x6D, 0xDA, 0x20, 0x20, 0x20, 0x20, + 0x9C, 0x66, 0x8F, 0xA5, 0xA5, 0x55, 0x8F, 0x66, + 0x2F, 0xB2, 0x2F, 0x66, 0x98, 0x98, 0x2F, 0x51, + 0x89, 0xB2, 0x2F, 0xA3, 0xA3, 0xB2, 0xB2, 0xB2, + 0x2F, 0x2F, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0x66, + 0x8F, 0xA5, 0x8F, 0x20, 0x20, 0xA7, 0x20, 0xA6, + 0x6B, 0x6B, 0xE4, 0x48, 0x2C, 0xDB, 0x4F, 0x9E, + 0xD0, 0xD0, 0x8B, 0x82, 0x82, 0x82, 0x82, 0x82, + 0x59, 0x82, 0x82, 0x73, 0x7B, 0x68, 0x6B, 0x3D, + 0x68, 0x68, 0x84, 0x3D, 0x6B, 0x6B, 0xA0, 0x20, + 0x20, 0x20, 0x6D, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x6D, 0x2F, 0xA0, 0xA5, 0x55, 0x98, 0x66, 0xA3, + 0xB2, 0x89, 0xB2, 0x98, 0x8F, 0x98, 0x2F, 0x51, + 0x74, 0xB2, 0xA3, 0xA3, 0x2F, 0x2F, 0xB2, 0x2F, + 0xA3, 0xA3, 0xA3, 0x66, 0x66, 0xA3, 0x2F, 0xA3, + 0x98, 0xA3, 0x6D, 0x20, 0x20, 0xCE, 0x20, 0x2A, + 0x6B, 0x6B, 0xEB, 0x2C, 0xE1, 0xF1, 0x7C, 0xD0, + 0x8B, 0x8B, 0x82, 0x82, 0x82, 0x82, 0x82, 0x59, + 0x82, 0x82, 0x42, 0x82, 0x31, 0x57, 0x4F, 0x7B, + 0x7B, 0xF5, 0xF6, 0xDB, 0x6B, 0x6B, 0x98, 0x20, + 0x20, 0x20, 0x2E, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x51, 0x66, 0xA0, 0xA0, 0x66, 0x2F, 0xB2, + 0xB2, 0x51, 0x2F, 0xA0, 0x55, 0xA3, 0x51, 0x89, + 0x44, 0xA3, 0x98, 0x98, 0x2F, 0x2F, 0x2F, 0xA3, + 0xA3, 0x66, 0x98, 0x98, 0x98, 0xA3, 0x2F, 0x2F, + 0x98, 0x8F, 0x20, 0x20, 0x3A, 0xA6, 0x20, 0xA0, + 0x6B, 0x6B, 0x6B, 0x6B, 0x7F, 0x7F, 0xC3, 0xC9, + 0xD0, 0xD0, 0x29, 0x59, 0x82, 0x73, 0x82, 0x73, + 0x59, 0x59, 0x59, 0x59, 0x59, 0x58, 0xAF, 0xF5, + 0x8A, 0x68, 0xEB, 0x6B, 0x6B, 0x6B, 0x98, 0x20, + 0x20, 0x20, 0x6D, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x51, 0x98, 0x55, 0xA0, 0xA3, 0xB2, 0x51, + 0x51, 0x2F, 0x98, 0x55, 0x8F, 0xB2, 0x89, 0x44, + 0xA3, 0x55, 0x55, 0x98, 0xA3, 0xB2, 0x2F, 0xA3, + 0x66, 0x66, 0x98, 0x8F, 0x66, 0xA3, 0x66, 0x98, + 0x55, 0x4C, 0x20, 0x20, 0xDA, 0xAD, 0x20, 0x98, + 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x3D, 0x9A, 0xD0, + 0xF2, 0x8B, 0x8B, 0x8B, 0x73, 0x82, 0x5B, 0x82, + 0x82, 0x59, 0x59, 0x73, 0x73, 0x58, 0x3D, 0x3D, + 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x6B, 0x66, 0x20, + 0x20, 0x3A, 0x3A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x2F, 0x55, 0xA5, 0x8F, 0xA3, 0x51, 0x51, + 0xB2, 0xA3, 0x66, 0x66, 0xA3, 0xB2, 0x89, 0x51, + 0x98, 0xA5, 0x55, 0x8F, 0x2F, 0xB2, 0xB2, 0xA3, + 0x66, 0x66, 0x98, 0x98, 0x98, 0x66, 0x66, 0x8F, + 0x8F, 0x92, 0x20, 0x20, 0x20, 0x6D, 0x6D, 0xA3, + 0x6B, 0x6B, 0xEB, 0x7F, 0x4F, 0xDB, 0xD2, 0xC9, + 0xC9, 0xD0, 0x8B, 0x8B, 0x73, 0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5D, 0x5D, 0x5D, 0x5D, 0x80, + 0x5D, 0x5D, 0x5D, 0x80, 0x3B, 0x67, 0xF9, 0x32, + 0x69, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xBF, 0xEC, 0xED, 0x2B, 0x30, 0x5D, 0x5D, + 0x80, 0x5D, 0x5D, 0x5D, 0x52, 0x30, 0x67, 0x2B, + 0xCF, 0xAA, 0xD8, 0x89, 0x89, 0x51, 0x66, 0x55, + 0x2A, 0x2A, 0xA5, 0x8F, 0x66, 0xA3, 0x2F, 0x2F, + 0xA3, 0xA3, 0x66, 0x98, 0x98, 0x2F, 0xB2, 0x2F, + 0xD1, 0x28, 0x56, 0xED, 0x62, 0x37, 0x5C, 0x79, + 0x8E, 0x2B, 0x2B, 0x30, 0x30, 0x30, 0x5D, 0x5D, + 0x5D, 0x5D, 0x5D, 0x80, 0x3B, 0xEE, 0x56, 0xA9, + 0x75, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x5F, 0x99, 0xD9, 0x45, 0x8D, 0x3B, 0x5D, + 0x5D, 0x3B, 0x5D, 0x8D, 0x2B, 0x79, 0x79, 0x41, + 0x83, 0xB2, 0xB2, 0x89, 0x89, 0x2F, 0xA0, 0x2A, + 0xAD, 0xA5, 0x98, 0x66, 0xA3, 0xB2, 0x2F, 0xB2, + 0xD8, 0xB2, 0xA3, 0x98, 0x98, 0x2F, 0x51, 0xB2, + 0xA3, 0x83, 0x3E, 0x25, 0xD5, 0xE5, 0x50, 0x8C, + 0xED, 0x24, 0x24, 0xF0, 0x45, 0x8E, 0x2B, 0x30, + 0x30, 0x5D, 0x3B, 0x30, 0xEE, 0xF0, 0xC6, 0x65, + 0x75, 0x71, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20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0x2F, 0x2F, 0x2F, 0xA3, + 0x66, 0xA3, 0x2F, 0xB2, 0xB2, 0xB2, 0x51, 0x51, + 0x89, 0x89, 0xB2, 0xA3, 0x98, 0x66, 0xA3, 0x66, + 0x98, 0x98, 0x98, 0x98, 0x98, 0x66, 0xA3, 0x2F, + 0xA3, 0x2F, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, + 0xB2, 0x2F, 0xA3, 0xA3, 0xA3, 0x2F, 0x2F, 0x2F, + 0x2F, 0xB2, 0xB2, 0xA3, 0xA3, 0x2F, 0x2F, 0x2F, + 0x2F, 0xA3, 0x66, 0xA3, 0x2F, 0xB2, 0xB2, 0xB2, + 0x51, 0x51, 0x89, 0x89, 0xB2, 0xA3, 0x98, 0x66 }; unsigned char linux_logo_bw[] __initdata = { diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/mmu_context.h linux/include/asm-sparc64/mmu_context.h --- v2.1.114/linux/include/asm-sparc64/mmu_context.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/mmu_context.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: mmu_context.h,v 1.24 1998/05/06 02:07:54 paulus Exp $ */ +/* $Id: mmu_context.h,v 1.26 1998/07/31 10:42:38 jj Exp $ */ #ifndef __SPARC64_MMU_CONTEXT_H #define __SPARC64_MMU_CONTEXT_H @@ -26,19 +26,21 @@ * instance. */ #define init_new_context(mm) ((mm)->context = NO_CONTEXT) -#define destroy_context(mm) do { \ - if ((mm)->context != NO_CONTEXT) { \ - spin_lock(&scheduler_lock); \ - if (!(((mm)->context ^ tlb_context_cache) & CTX_VERSION_MASK)) \ - clear_bit((mm)->context & ~(CTX_VERSION_MASK), mmu_context_bmap); \ - spin_unlock(&scheduler_lock); \ - (mm)->context = NO_CONTEXT; \ - } \ +#define destroy_context(mm) do { \ + if ((mm)->context != NO_CONTEXT) { \ + spin_lock(&scheduler_lock); \ + if (!(((mm)->context ^ tlb_context_cache) & CTX_VERSION_MASK)) \ + clear_bit((mm)->context & ~(CTX_VERSION_MASK), \ + mmu_context_bmap); \ + spin_unlock(&scheduler_lock); \ + (mm)->context = NO_CONTEXT; \ + } \ } while (0) extern __inline__ void get_mmu_context(struct task_struct *tsk) { register unsigned long paddr asm("o5"); + register unsigned long pgd_cache asm("o4"); struct mm_struct *mm = tsk->mm; flushw_user(); @@ -63,14 +65,21 @@ spitfire_set_secondary_context(tsk->tss.ctx); __asm__ __volatile__("flush %g6"); paddr = __pa(mm->pgd); + if(tsk->tss.flags & SPARC_FLAG_32BIT) + pgd_cache = (unsigned long) mm->pgd[0]; + else + pgd_cache = 0; __asm__ __volatile__(" - rdpr %%pstate, %%o4 - wrpr %%o4, %1, %%pstate + rdpr %%pstate, %%o3 + wrpr %%o3, %2, %%pstate + mov %4, %%g4 mov %0, %%g7 - wrpr %%o4, 0x0, %%pstate + stxa %1, [%%g4] %3 + wrpr %%o3, 0x0, %%pstate " : /* no outputs */ - : "r" (paddr), "i" (PSTATE_MG|PSTATE_IE) - : "o4"); + : "r" (paddr), "r" (pgd_cache), "i" (PSTATE_MG|PSTATE_IE), + "i" (ASI_DMMU), "i" (TSB_REG) + : "o3"); } /* diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/page.h linux/include/asm-sparc64/page.h --- v2.1.114/linux/include/asm-sparc64/page.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/page.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.18 1998/05/01 09:33:50 davem Exp $ */ +/* $Id: page.h,v 1.23 1998/06/12 14:54:33 jj Exp $ */ #ifndef _SPARC64_PAGE_H #define _SPARC64_PAGE_H @@ -18,59 +18,7 @@ #ifndef __ASSEMBLY__ -#define PAGE_ALIAS_BITS (PAGE_SIZE) /* 16K Dcache, 8K pages */ -#ifdef __SMP__ -#define ULOCK_DECLARE extern spinlock_t user_page_lock; -#else -#define ULOCK_DECLARE -#endif -struct upcache { - struct page *list; - unsigned long count; -}; -extern struct upcache user_page_cache[2]; -#define USER_PAGE_WATER 16 - -extern unsigned long get_user_page_slow(int which); -#define get_user_page(__vaddr) \ -({ \ - ULOCK_DECLARE \ - int which = ((__vaddr) & PAGE_ALIAS_BITS) ? 1 : 0; \ - struct upcache *up = &user_page_cache[which]; \ - struct page *p; \ - unsigned long ret; \ - spin_lock(&user_page_lock); \ - if((p = up->list) != NULL) { \ - up->list = p->next; \ - up->count--; \ - } \ - spin_unlock(&user_page_lock); \ - if(p != NULL) \ - ret = PAGE_OFFSET+PAGE_SIZE*p->map_nr; \ - else \ - ret = get_user_page_slow(which); \ - ret; \ -}) - -#define free_user_page(__page, __addr) \ -do { \ - ULOCK_DECLARE \ - int which = ((__addr) & PAGE_ALIAS_BITS) ? 1 : 0; \ - struct upcache *up = &user_page_cache[which]; \ - if(atomic_read(&(__page)->count) == 1 && \ - up->count < USER_PAGE_WATER) { \ - spin_lock(&user_page_lock); \ - (__page)->age = PAGE_INITIAL_AGE; \ - (__page)->next = up->list; \ - up->list = (__page); \ - up->count++; \ - spin_unlock(&user_page_lock); \ - } else \ - free_page(addr); \ -} while(0) - -#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) - +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) extern void copy_page(unsigned long to, unsigned long from); /* GROSS, defining this makes gcc pass these types as aggregates, @@ -133,15 +81,8 @@ #endif /* (STRICT_MM_TYPECHECKS) */ -#define TASK_UNMAPPED_BASE(__off) (((current->tss.flags & SPARC_FLAG_32BIT) ? \ - (0x0000000070000000UL) : \ - (0xfffff80000000000UL)) + \ - (__off & PAGE_SIZE)) - -/* On Ultra this aligns to the size of the L1 cache. */ -#define TASK_UNMAPPED_ALIGN(__addr, __off) \ - ((((__addr)+((PAGE_SIZE<<1UL)-1UL)) & ~((PAGE_SIZE << 1UL)-1UL)) + \ - (__off&PAGE_SIZE)) +#define TASK_UNMAPPED_BASE ((current->tss.flags & SPARC_FLAG_32BIT) ? \ + (0x0000000070000000UL) : (PAGE_OFFSET)) #endif /* !(__ASSEMBLY__) */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/pbm.h linux/include/asm-sparc64/pbm.h --- v2.1.114/linux/include/asm-sparc64/pbm.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/pbm.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: pbm.h,v 1.13 1998/04/20 07:15:11 ecd Exp $ +/* $Id: pbm.h,v 1.14 1998/05/29 06:00:40 ecd Exp $ * pbm.h: U2P PCI bus module pseudo driver software state. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -74,49 +74,9 @@ int prom_node; }; -extern struct linux_psycho *psycho_root; -extern struct linux_psycho **psycho_index_map; -extern int linux_num_psycho; - -static __inline__ struct linux_psycho * -psycho_by_index(int index) -{ - if (index >= linux_num_psycho) - return NULL; - return psycho_index_map[index]; -} - -/* Special PCI IRQ encoding, this just makes life easier for the generic - * irq registry layer, there is already enough crap in there due to sbus, - * fhc, and dcookies. - */ -#define PCI_IRQ_IDENT 0x80000000 /* This tells irq.c what we are */ -#define PCI_IRQ_IMAP_OFF 0x7ff00000 /* Offset from first PSYCHO imap */ -#define PCI_IRQ_IMAP_OFF_SHFT 20 -#define PCI_IRQ_BUSNO 0x000fc000 /* PSYCHO instance */ -#define PCI_IRQ_BUSNO_SHFT 14 -#define PCI_IRQ_DMA_SYNC 0x00001000 /* IRQ needs DMA sync for APB */ -#define PCI_IRQ_IGN 0x000007c0 /* PSYCHO "Int Group Number" */ -#define PCI_IRQ_INO 0x0000003f /* PSYCHO INO */ - -#define PCI_IRQ_P(__irq) (((__irq) & PCI_IRQ_IDENT) != 0) - -extern __inline__ unsigned int pci_irq_encode(unsigned long imap_off, - unsigned long psycho_instance, - unsigned long ign, - unsigned long ino, int dma_sync) -{ - unsigned int irq; - - irq = PCI_IRQ_IDENT; - irq |= ((imap_off << PCI_IRQ_IMAP_OFF_SHFT) & PCI_IRQ_IMAP_OFF); - irq |= ((psycho_instance << PCI_IRQ_BUSNO_SHFT) & PCI_IRQ_BUSNO); - irq |= ((ign << 6) & PCI_IRQ_IGN); - irq |= (ino & PCI_IRQ_INO); - irq |= dma_sync ? PCI_IRQ_DMA_SYNC : 0; - return irq; -} +#define PCI_IRQ_IGN 0x000007c0 /* PSYCHO "Int Group Number". */ +#define PCI_IRQ_INO 0x0000003f /* PSYCHO INO. */ /* Used by EBus */ extern unsigned int psycho_irq_build(struct linux_pbm_info *pbm, 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 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.67 1998/05/01 09:33:53 davem Exp $ +/* $Id: pgtable.h,v 1.85 1998/08/04 20:51:33 davem Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -41,10 +41,20 @@ /* Entries per page directory level. */ #define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3)) -#define PTRS_PER_PMD (1UL << (PAGE_SHIFT-2)) -/* We cannot use the top 16G because a half of mm/ would break, so why to check it */ + +/* We the first one in this file, what we export to the kernel + * is different so we can optimize correctly for 32-bit tasks. + */ +#define REAL_PTRS_PER_PMD (1UL << (PAGE_SHIFT-2)) +#define PTRS_PER_PMD ((const int)((current->tss.flags & SPARC_FLAG_32BIT) ? \ + (REAL_PTRS_PER_PMD >> 2) : (REAL_PTRS_PER_PMD))) + +/* We cannot use the top 16G because VPTE table lives there. */ #define PTRS_PER_PGD ((1UL << (PAGE_SHIFT-3))-1) -#define USER_PTRS_PER_PGD PTRS_PER_PGD /* Kernel has a separate 44bit address space */ + +/* Kernel has a separate 44bit address space. */ +#define USER_PTRS_PER_PGD ((const int)((current->tss.flags & SPARC_FLAG_32BIT) ? \ + (1) : (PTRS_PER_PGD))) #define PTE_TABLE_SIZE 0x2000 /* 1024 entries 8 bytes each */ #define PMD_TABLE_SIZE 0x2000 /* 2048 entries 4 bytes each */ @@ -54,8 +64,9 @@ #define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3)) /* NOTE: TLB miss handlers depend heavily upon where this is. */ -#define VMALLOC_START 0x0000000800000000UL +#define VMALLOC_START 0x0000000140000000UL #define VMALLOC_VMADDR(x) ((unsigned long)(x)) +#define VMALLOC_END 0x0000000200000000UL #endif /* !(__ASSEMBLY__) */ @@ -93,8 +104,7 @@ #define __ACCESS_BITS (_PAGE_ACCESSED | _PAGE_READ | _PAGE_R) #define __PRIV_BITS _PAGE_P -#define PAGE_NONE __pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \ - __PRIV_BITS | __ACCESS_BITS) +#define PAGE_NONE __pgprot (_PAGE_PRESENT | _PAGE_ACCESSED) #define PAGE_SHARED __pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \ __ACCESS_BITS | _PAGE_W | _PAGE_WRITE) @@ -137,11 +147,7 @@ #ifndef __ASSEMBLY__ extern pte_t __bad_page(void); -extern pmd_t *__bad_pmd(void); -extern pte_t *__bad_pte(void); -#define BAD_PMD __bad_pmd() -#define BAD_PTE __bad_pte() #define BAD_PAGE __bad_page() /* First physical page can be anywhere, the following is needed so that @@ -151,12 +157,9 @@ extern unsigned long phys_base; #define ZERO_PAGE ((unsigned long)__va(phys_base)) -/* This is for making TLB miss faster to process. */ -#define null_pmd_table (null_pte_table - PAGE_SIZE) -extern unsigned int null_pte_table; - /* Allocate a block of RAM which is aligned to its size. - This procedure can be used until the call to mem_init(). */ + * This procedure can be used until the call to mem_init(). + */ extern void *sparc_init_alloc(unsigned long *kbrk, unsigned long size); /* Cache and TLB flush operations. */ @@ -173,36 +176,38 @@ extern void __flush_cache_all(void); extern void __flush_tlb_all(void); -extern void __flush_tlb_mm(unsigned long context); +extern void __flush_tlb_mm(unsigned long context, unsigned long r); extern void __flush_tlb_range(unsigned long context, unsigned long start, - unsigned long end); -extern void __flush_tlb_page(unsigned long context, unsigned long page); + unsigned long r, unsigned long end, + unsigned long pgsz, unsigned long size); +extern void __flush_tlb_page(unsigned long context, unsigned long page, unsigned long r); #ifndef __SMP__ #define flush_cache_all() __flush_cache_all() #define flush_tlb_all() __flush_tlb_all() -extern __inline__ void flush_tlb_mm(struct mm_struct *mm) -{ - if(mm->context != NO_CONTEXT) - __flush_tlb_mm(mm->context & 0x3ff); -} - -extern __inline__ void flush_tlb_range(struct mm_struct *mm, unsigned long start, - unsigned long end) -{ - if(mm->context != NO_CONTEXT) - __flush_tlb_range(mm->context & 0x3ff, start, end); -} - -extern __inline__ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) -{ - struct mm_struct *mm = vma->vm_mm; - - if(mm->context != NO_CONTEXT) - __flush_tlb_page(mm->context & 0x3ff, page & PAGE_MASK); -} +#define flush_tlb_mm(mm) \ +do { if((mm)->context != NO_CONTEXT) \ + __flush_tlb_mm((mm)->context & 0x3ff, SECONDARY_CONTEXT); \ +} while(0) + +#define flush_tlb_range(mm, start, end) \ +do { if((mm)->context != NO_CONTEXT) { \ + unsigned long __start = (start)&PAGE_MASK; \ + unsigned long __end = (end)&PAGE_MASK; \ + __flush_tlb_range((mm)->context & 0x3ff, __start, \ + SECONDARY_CONTEXT, __end, PAGE_SIZE, \ + (__end - __start)); \ + } \ +} while(0) + +#define flush_tlb_page(vma, page) \ +do { struct mm_struct *__mm = (vma)->vm_mm; \ + if(__mm->context != NO_CONTEXT) \ + __flush_tlb_page(__mm->context & 0x3ff, (page)&PAGE_MASK, \ + SECONDARY_CONTEXT); \ +} while(0) #else /* __SMP__ */ @@ -239,105 +244,74 @@ #endif -extern inline pte_t mk_pte(unsigned long page, pgprot_t pgprot) -{ return __pte(__pa(page) | pgprot_val(pgprot)); } - -extern inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) -{ return __pte(physpage | pgprot_val(pgprot)); } - -extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) -{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } - -extern inline void pmd_set(pmd_t *pmdp, pte_t *ptep) -{ pmd_val(*pmdp) = __pa((unsigned long) ptep); } - -extern inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp) -{ pgd_val(*pgdp) = __pa((unsigned long) pmdp); } - -extern inline unsigned long pte_page(pte_t pte) -{ return (unsigned long) __va((pte_val(pte) & _PFN_MASK)); } - -extern inline unsigned long pmd_page(pmd_t pmd) -{ return (unsigned long) __va(pmd_val(pmd)); } - -extern inline unsigned long pgd_page(pgd_t pgd) -{ return (unsigned long) __va(pgd_val(pgd)); } - -#define PMD_NONE_MAGIC 0x40 -#define PGD_NONE_MAGIC 0x40 - -extern inline int pte_none(pte_t pte) { return !pte_val(pte); } -extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; } -extern inline void pte_clear(pte_t *pte) { pte_val(*pte) = 0; } - -extern inline int pmd_none(pmd_t pmd) { return pmd_val(pmd)&PMD_NONE_MAGIC; } -extern inline int pmd_bad(pmd_t pmd) { return 0; } -extern inline int pmd_present(pmd_t pmd) { return !(pmd_val(pmd)&PMD_NONE_MAGIC);} -extern inline void pmd_clear(pmd_t *pmdp) { pmd_val(*pmdp) = null_pte_table; } - -extern inline int pgd_none(pgd_t pgd) { return pgd_val(pgd) & PGD_NONE_MAGIC; } -extern inline int pgd_bad(pgd_t pgd) { return 0; } -extern inline int pgd_present(pgd_t pgd) { return !(pgd_val(pgd)&PGD_NONE_MAGIC);} -extern inline void pgd_clear(pgd_t *pgdp) { pgd_val(*pgdp) = null_pmd_table; } +#define mk_pte(page, pgprot) (__pte(__pa(page) | pgprot_val(pgprot))) +#define mk_pte_phys(physpage, pgprot) (__pte((physpage) | pgprot_val(pgprot))) +#define pte_modify(_pte, newprot) \ + (pte_val(_pte) = ((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))) +#define pmd_set(pmdp, ptep) (pmd_val(*(pmdp)) = __pa((unsigned long) (ptep))) +#define pgd_set(pgdp, pmdp) (pgd_val(*(pgdp)) = __pa((unsigned long) (pmdp))) +#define pte_page(pte) ((unsigned long) __va(((pte_val(pte)&~PAGE_OFFSET)&~(0xfffUL)))) +#define pmd_page(pmd) ((unsigned long) __va(pmd_val(pmd))) +#define pgd_page(pgd) ((unsigned long) __va(pgd_val(pgd))) +#define pte_none(pte) (!pte_val(pte)) +#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) +#define pte_clear(pte) (pte_val(*(pte)) = 0UL) +#define pmd_none(pmd) (!pmd_val(pmd)) +#define pmd_bad(pmd) (0) +#define pmd_present(pmd) (pmd_val(pmd) != 0UL) +#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0UL) +#define pgd_none(pgd) (!pgd_val(pgd)) +#define pgd_bad(pgd) (0) +#define pgd_present(pgd) (pgd_val(pgd) != 0UL) +#define pgd_clear(pgdp) (pgd_val(*(pgdp)) = 0UL) /* The following only work if pte_present() is true. * Undefined behaviour if not.. */ -extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; } -extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } -extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } -extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } - -extern inline pte_t pte_wrprotect(pte_t pte) -{ return __pte(pte_val(pte) & ~(_PAGE_WRITE|_PAGE_W)); } - -extern inline pte_t pte_rdprotect(pte_t pte) -{ return __pte(pte_val(pte) & ~(_PAGE_READ|_PAGE_R)); } - -extern inline pte_t pte_mkclean(pte_t pte) -{ return __pte(pte_val(pte) & ~(_PAGE_MODIFIED | _PAGE_W)); } - -extern inline pte_t pte_mkold(pte_t pte) -{ return __pte(pte_val(pte) & ~(_PAGE_ACCESSED | _PAGE_R)); } - -extern inline pte_t pte_mkwrite(pte_t pte) -{ - if(pte_val(pte) & _PAGE_MODIFIED) - return __pte(pte_val(pte) | (_PAGE_WRITE | _PAGE_W)); +#define pte_read(pte) (pte_val(pte) & _PAGE_READ) +#define pte_write(pte) (pte_val(pte) & _PAGE_WRITE) +#define pte_dirty(pte) (pte_val(pte) & _PAGE_MODIFIED) +#define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED) +#define pte_wrprotect(pte) (__pte(pte_val(pte) & ~(_PAGE_WRITE|_PAGE_W))) +#define pte_rdprotect(pte) (__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_READ)) +#define pte_mkclean(pte) (__pte(pte_val(pte) & ~(_PAGE_MODIFIED|_PAGE_W))) +#define pte_mkold(pte) (__pte(((pte_val(pte)<<1UL)>>1UL) & ~_PAGE_ACCESSED)) + +/* Be very careful when you change these three, they are delicate. */ +static __inline__ pte_t pte_mkyoung(pte_t _pte) +{ if(pte_val(_pte) & _PAGE_READ) + return __pte(pte_val(_pte)|(_PAGE_ACCESSED|_PAGE_R)); else - return __pte(pte_val(pte) | (_PAGE_WRITE)); + return __pte(pte_val(_pte)|(_PAGE_ACCESSED)); } -extern inline pte_t pte_mkdirty(pte_t pte) -{ - if(pte_val(pte) & _PAGE_WRITE) - return __pte(pte_val(pte) | (_PAGE_MODIFIED | _PAGE_W)); +static __inline__ pte_t pte_mkwrite(pte_t _pte) +{ if(pte_val(_pte) & _PAGE_MODIFIED) + return __pte(pte_val(_pte)|(_PAGE_WRITE|_PAGE_W)); else - return __pte(pte_val(pte) | (_PAGE_MODIFIED)); + return __pte(pte_val(_pte)|(_PAGE_WRITE)); } -extern inline pte_t pte_mkyoung(pte_t pte) -{ - if(pte_val(pte) & _PAGE_READ) - return __pte(pte_val(pte) | (_PAGE_ACCESSED | _PAGE_R)); +static __inline__ pte_t pte_mkdirty(pte_t _pte) +{ if(pte_val(_pte) & _PAGE_WRITE) + return __pte(pte_val(_pte)|(_PAGE_MODIFIED|_PAGE_W)); else - return __pte(pte_val(pte) | (_PAGE_ACCESSED)); + return __pte(pte_val(_pte)|(_PAGE_MODIFIED)); } /* to find an entry in a page-table-directory. */ -extern inline pgd_t *pgd_offset(struct mm_struct *mm, unsigned long address) -{ return mm->pgd + ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD)); } +#define pgd_offset(mm, address) ((mm)->pgd + ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD))) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) /* Find an entry in the second-level page table.. */ -extern inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address) -{ return (pmd_t *) pgd_page(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PMD - 1)); } +#define pmd_offset(dir, address) ((pmd_t *) pgd_page(*(dir)) + \ + ((address >> PMD_SHIFT) & (REAL_PTRS_PER_PMD-1))) /* Find an entry in the third-level page table.. */ -extern inline pte_t *pte_offset(pmd_t *dir, unsigned long address) -{ return (pte_t *) pmd_page(*dir) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)); } +#define pte_offset(dir, address) ((pte_t *) pmd_page(*(dir)) + \ + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) /* Very stupidly, we used to get new pgd's and pmd's, init their contents * to point to the NULL versions of the next level page table, later on @@ -352,26 +326,17 @@ #else extern struct pgtable_cache_struct { unsigned long *pgd_cache; - unsigned long *pmd_cache; unsigned long *pte_cache; unsigned long pgcache_size; unsigned long pgdcache_size; } pgt_quicklists; #endif #define pgd_quicklist (pgt_quicklists.pgd_cache) -#define pmd_quicklist (pgt_quicklists.pmd_cache) +#define pmd_quicklist ((unsigned long *)0) #define pte_quicklist (pgt_quicklists.pte_cache) #define pgtable_cache_size (pgt_quicklists.pgcache_size) #define pgd_cache_size (pgt_quicklists.pgdcache_size) -extern __inline__ void __init_pgd(pgd_t *pgdp) -{ - extern void __bfill64(void *, unsigned long *); - extern unsigned long two_null_pmd_table; - - __bfill64((void *)pgdp, &two_null_pmd_table); -} - #ifndef __SMP__ extern __inline__ void free_pgd_fast(pgd_t *pgd) @@ -382,7 +347,8 @@ (unsigned long *)page->next_hash = pgd_quicklist; pgd_quicklist = (unsigned long *)page; } - (unsigned long)page->pprev_hash |= (((unsigned long)pgd & (PAGE_SIZE / 2)) ? 2 : 1); + (unsigned long)page->pprev_hash |= + (((unsigned long)pgd & (PAGE_SIZE / 2)) ? 2 : 1); pgd_cache_size++; } @@ -410,7 +376,7 @@ if(ret) { struct page *page = mem_map + MAP_NR(ret); - __init_pgd((pgd_t *)ret); + clear_page(ret); (unsigned long)page->pprev_hash = 2; (unsigned long *)page->next_hash = pgd_quicklist; pgd_quicklist = (unsigned long *)page; @@ -435,31 +401,32 @@ if((ret = pgd_quicklist) != NULL) { pgd_quicklist = (unsigned long *)(*ret); - ret[0] = ret[1]; + ret[0] = 0; pgtable_cache_size--; } else { ret = (unsigned long *) __get_free_page(GFP_KERNEL); if(ret) - __init_pgd((pgd_t *)ret); + clear_page(ret); } return (pgd_t *)ret; } -#endif /* __SMP__ */ extern __inline__ void free_pgd_slow(pgd_t *pgd) { free_page((unsigned long)pgd); } +#endif /* __SMP__ */ + extern pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long address_premasked); extern __inline__ pmd_t *get_pmd_fast(void) { unsigned long *ret; - if((ret = (unsigned long *)pmd_quicklist) != NULL) { - pmd_quicklist = (unsigned long *)(*ret); - ret[0] = ret[1]; + if((ret = (unsigned long *)pte_quicklist) != NULL) { + pte_quicklist = (unsigned long *)(*ret); + ret[0] = 0; pgtable_cache_size--; } return (pmd_t *)ret; @@ -467,8 +434,8 @@ extern __inline__ void free_pmd_fast(pgd_t *pmd) { - *(unsigned long *)pmd = (unsigned long) pmd_quicklist; - pmd_quicklist = (unsigned long *) pmd; + *(unsigned long *)pmd = (unsigned long) pte_quicklist; + pte_quicklist = (unsigned long *) pmd; pgtable_cache_size++; } @@ -485,7 +452,7 @@ if((ret = (unsigned long *)pte_quicklist) != NULL) { pte_quicklist = (unsigned long *)(*ret); - ret[0] = ret[1]; + ret[0] = 0; pgtable_cache_size--; } return (pte_t *)ret; @@ -526,7 +493,7 @@ extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) { - address = (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); + address = (address >> PMD_SHIFT) & (REAL_PTRS_PER_PMD - 1); if (pgd_none(*pgd)) { pmd_t *page = get_pmd_fast(); @@ -541,12 +508,12 @@ #define pte_alloc_kernel(pmd, addr) pte_alloc(pmd, addr) #define pmd_alloc_kernel(pgd, addr) pmd_alloc(pgd, addr) -extern inline void set_pgdir(unsigned long address, pgd_t entry) -{ - /* Nothing to do on sparc64 :) */ -} +extern int do_check_pgt_cache(int, int); + +/* Nothing to do on sparc64 :) */ +#define set_pgdir(address, entry) do { } while(0) -extern pgd_t swapper_pg_dir[1024]; +extern pgd_t swapper_pg_dir[1]; extern inline void SET_PAGE_DIR(struct task_struct *tsk, pgd_t *pgdir) { @@ -588,35 +555,26 @@ #define mmu_lockarea(vaddr, len) (vaddr) #define mmu_unlockarea(vaddr, len) do { } while(0) -extern __inline__ void update_mmu_cache(struct vm_area_struct *vma, - unsigned long address, pte_t pte) -{ - struct mm_struct *mm = vma->vm_mm; - unsigned long ctx = mm->context & 0x3ff; - unsigned long tag_access; - - tag_access = address | ctx; - - __asm__ __volatile__(" - rdpr %%pstate, %%g1 - wrpr %%g1, %0, %%pstate - brz,pt %1, 1f - mov %2, %%g2 - stxa %3, [%%g2] %5 - b,pt %%xcc, 2f - stxa %4, [%%g0] %6 -1: - stxa %3, [%%g2] %7 - stxa %4, [%%g0] %8 -2: - wrpr %%g1, 0x0, %%pstate -" : /* no outputs */ - : "i" (PSTATE_IE), "r" (vma->vm_flags & VM_EXECUTABLE), - "i" (TLB_TAG_ACCESS), "r" (tag_access), "r" (pte_val(pte)), - "i" (ASI_IMMU), "i" (ASI_ITLB_DATA_IN), - "i" (ASI_DMMU), "i" (ASI_DTLB_DATA_IN) - : "g1", "g2"); -} +#define update_mmu_cache(__vma, __address, _pte) \ +__asm__ __volatile__( \ + "rdpr %%pstate, %%g1\n\t" \ + "wrpr %%g1, %0, %%pstate\n\t" \ + "brz,pt %1, 1f\n\t" \ + " mov %2, %%g2\n\t" \ + "stxa %3, [%%g2] %5\n\t" \ + "ba,pt %%xcc, 2f\n\t" \ + " stxa %4, [%%g0] %6\n\t" \ +"1: stxa %3, [%%g2] %7\n\t" \ +" stxa %4, [%%g0] %8\n\t" \ +"2: wrpr %%g1, 0x0, %%pstate\n" \ + : /* no outputs */ \ + : "i" (PSTATE_IE), \ + "r" (((__vma)->vm_flags&(VM_READ|VM_WRITE|VM_EXEC))==(VM_READ|VM_EXEC)), \ + "i" (TLB_TAG_ACCESS), \ + "r" ((__address) | ((__vma)->vm_mm->context & 0x3ff)), \ + "r" (pte_val(_pte)), "i" (ASI_IMMU), "i" (ASI_ITLB_DATA_IN), \ + "i" (ASI_DMMU), "i" (ASI_DTLB_DATA_IN) \ + : "g1", "g2") /* Make a non-present pseudo-TTE. */ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) @@ -658,7 +616,6 @@ extern void * module_map (unsigned long size); extern void module_unmap (void *addr); -extern void module_shrink (void *addr, unsigned long size); /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ #define PageSkip(page) (test_bit(PG_skip, &(page)->flags)) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/posix_types.h linux/include/asm-sparc64/posix_types.h --- v2.1.114/linux/include/asm-sparc64/posix_types.h Mon Jan 12 15:15:58 1998 +++ linux/include/asm-sparc64/posix_types.h Tue Aug 4 16:03:35 1998 @@ -7,7 +7,11 @@ * assume GCC is being used. */ +#if __GNUC_MINOR__ > 7 +typedef unsigned long int __kernel_size_t; +#else typedef unsigned long long __kernel_size_t; +#endif typedef long long __kernel_ssize_t; typedef long __kernel_ptrdiff_t; diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/processor.h linux/include/asm-sparc64/processor.h --- v2.1.114/linux/include/asm-sparc64/processor.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/processor.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.43 1998/04/23 08:26:30 davem Exp $ +/* $Id: processor.h,v 1.49 1998/07/31 10:42:40 jj Exp $ * include/asm-sparc64/processor.h * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -31,22 +31,9 @@ #define TASK_SIZE 0xfffffffc00000000 #endif -#define COPY_TASK_STRUCT(dst, src) \ -do { \ - if (src->tss.w_saved) \ - *dst = *src; \ - else { \ - memcpy (dst, src, ((const unsigned long)(&((struct task_struct *)0)->tss.reg_window))); \ - memcpy ((char *)dst + ((const unsigned long)(&((struct task_struct *)0)->tss.sig_address)), \ - (char *)src + ((const unsigned long)(&((struct task_struct *)0)->tss.sig_address)), \ - sizeof(struct task_struct) - \ - ((const unsigned long)(&((struct task_struct *)0)->tss.sig_address))); \ - } \ -} while (0) - #ifndef __ASSEMBLY__ -#define NSWINS 8 +#define NSWINS 7 typedef struct { unsigned long seg; @@ -55,14 +42,14 @@ /* The Sparc processor specific thread struct. */ struct thread_struct { /*DC1*/ unsigned long ksp __attribute__ ((aligned(16))); - unsigned int kpc; unsigned short wstate; unsigned short cwp; - -/*DC2*/ unsigned short flags; + unsigned short flags; unsigned short ctx; - unsigned short w_saved; + +/*DC2*/ unsigned short w_saved; unsigned short new_signal; + unsigned int ___pad; mm_segment_t current_ds; /*DC3*/ struct pt_regs *kregs; @@ -73,35 +60,39 @@ unsigned long sig_address __attribute__ ((aligned (8))); unsigned long sig_desc; - struct sigstack sstk_info; + + unsigned char fpdepth; + unsigned char fpsaved[7]; + unsigned char gsr[7]; + unsigned long xfsr[7]; }; #endif /* !(__ASSEMBLY__) */ -#define SPARC_FLAG_USEDFPUL 0x01 /* Used f0-f31 */ -#define SPARC_FLAG_USEDFPUU 0x02 /* Used f32-f62 */ -#define SPARC_FLAG_USEDFPU 0x04 /* If ever FEF bit was set while TSTATE_PEF */ -#define SPARC_FLAG_KTHREAD 0x10 /* task is a kernel thread */ -#define SPARC_FLAG_UNALIGNED 0x20 /* is allowed to do unaligned accesses */ -#define SPARC_FLAG_NEWSIGNALS 0x40 /* task wants new-style signals */ -#define SPARC_FLAG_32BIT 0x80 /* task is older 32-bit binary */ +#define SPARC_FLAG_KTHREAD 0x010 /* task is a kernel thread */ +#define SPARC_FLAG_UNALIGNED 0x020 /* is allowed to do unaligned accesses */ +#define SPARC_FLAG_NEWSIGNALS 0x040 /* task wants new-style signals */ +#define SPARC_FLAG_32BIT 0x080 /* task is older 32-bit binary */ +#define SPARC_FLAG_NEWCHILD 0x100 /* task is just-spawned child process */ #define INIT_MMAP { &init_mm, 0xfffff80000000000, 0xfffff80001000000, \ PAGE_SHARED , VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap } #define INIT_TSS { \ -/* ksp, kpc, wstate, cwp */ \ - 0, 0, 0, 0, \ -/* flags, ctx, w_saved, new_signal, current_ds, */ \ - SPARC_FLAG_KTHREAD, 0, 0, 0, KERNEL_DS, \ +/* ksp, wstate, cwp, flags, ctx, */ \ + 0, 0, 0, SPARC_FLAG_KTHREAD, 0, \ +/* w_saved, new_signal, padding, current_ds, */ \ + 0, 0, 0, KERNEL_DS, \ /* kregs, utraps, */ \ 0, 0, \ /* reg_window */ \ { { { 0, }, { 0, } }, }, \ /* rwbuf_stkptrs */ \ - { 0, 0, 0, 0, 0, 0, 0, 0, }, \ -/* sig_address, sig_desc, sstk_info */ \ - 0, 0, { 0, 0, }, \ + { 0, 0, 0, 0, 0, 0, 0, }, \ +/* sig_address, sig_desc */ \ + 0, 0, \ +/* fpdepth, fpsaved, gsr, xfsr */ \ + 0, { 0 }, { 0 }, { 0 }, \ } #ifndef __ASSEMBLY__ @@ -109,7 +100,10 @@ /* Return saved PC of a blocked thread. */ extern __inline__ unsigned long thread_saved_pc(struct thread_struct *t) { - return t->kpc; + unsigned long *sp = (unsigned long *)(t->ksp + STACK_BIAS); + unsigned long *fp = (unsigned long *)(sp[14] + STACK_BIAS); + + return fp[15]; } /* On Uniprocessor, even in RMO processes see TSO semantics */ @@ -160,8 +154,6 @@ #define start_thread32(regs, pc, sp) \ do { \ - register unsigned int zero asm("g1"); \ -\ pc &= 0x00000000ffffffffUL; \ sp &= 0x00000000ffffffffUL; \ \ @@ -178,8 +170,8 @@ (*(current->tss.utraps))--; \ current->tss.utraps = NULL; \ } \ - zero = 0; \ __asm__ __volatile__( \ + "stxa %3, [%4] %5\n\t" \ "stx %%g0, [%0 + %2 + 0x00]\n\t" \ "stx %%g0, [%0 + %2 + 0x08]\n\t" \ "stx %%g0, [%0 + %2 + 0x10]\n\t" \ @@ -200,7 +192,7 @@ : \ : "r" (regs), "r" (sp - REGWIN32_SZ), \ "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0])), \ - "r" (zero)); \ + "r" (current->mm->pgd[0]), "r" (TSB_REG), "i" (ASI_DMMU)); \ } while(0) /* Free all resources held by a thread. */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/sbus.h linux/include/asm-sparc64/sbus.h --- v2.1.114/linux/include/asm-sparc64/sbus.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc64/sbus.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: sbus.h,v 1.6 1998/03/09 14:05:03 jj Exp $ +/* $Id: sbus.h,v 1.7 1998/05/22 14:33:40 jj Exp $ * sbus.h: Defines for the Sun SBus. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -54,7 +54,7 @@ struct linux_prom_registers reg_addrs[PROMREG_MAX]; int num_registers, ranges_applied; - struct linux_prom_irqs irqs[PROMINTR_MAX]; + unsigned int irqs[4]; int num_irqs; unsigned long sbus_addr; /* Absolute base address for device. */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/signal.h linux/include/asm-sparc64/signal.h --- v2.1.114/linux/include/asm-sparc64/signal.h Mon Jan 12 15:15:58 1998 +++ linux/include/asm-sparc64/signal.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: signal.h,v 1.4 1997/12/11 15:16:06 jj Exp $ */ +/* $Id: signal.h,v 1.8 1998/07/29 16:32:39 jj Exp $ */ #ifndef _ASMSPARC64_SIGNAL_H #define _ASMSPARC64_SIGNAL_H @@ -75,6 +75,7 @@ #define SIGPROF 27 #define SIGWINCH 28 #define SIGLOST 29 +#define SIGPWR SIGLOST #define SIGUSR1 30 #define SIGUSR2 31 @@ -148,6 +149,7 @@ */ #define SA_NOCLDSTOP SV_IGNCHILD #define SA_STACK SV_SSTACK +#define SA_ONSTACK SV_SSTACK #define SA_RESTART SV_INTR #define SA_ONESHOT SV_RESET #define SA_INTERRUPT 0x10 @@ -161,6 +163,15 @@ #define SIG_UNBLOCK 0x02 /* for unblocking signals */ #define SIG_SETMASK 0x04 /* for setting the signal mask */ +/* + * sigaltstack controls + */ +#define SS_ONSTACK 1 +#define SS_DISABLE 2 + +#define MINSIGSTKSZ 4096 +#define SIGSTKSZ 16384 + #ifdef __KERNEL__ /* * These values of sa_flags are used only by the kernel as part of the @@ -232,6 +243,12 @@ int ss_flags; __kernel_size_t ss_size; } stack_t; + +typedef struct sigaltstack32 { + u32 ss_sp; + int ss_flags; + __kernel_size_t32 ss_size; +} stack_t32; #endif /* !(__ASSEMBLY__) */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/smp.h linux/include/asm-sparc64/smp.h --- v2.1.114/linux/include/asm-sparc64/smp.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/smp.h Tue Aug 4 16:03:35 1998 @@ -41,23 +41,13 @@ /* Dcache line 2 */ unsigned long *pgd_cache; - unsigned long *pmd_cache; unsigned long *pte_cache; unsigned long udelay_val; + unsigned long dummy; }; extern struct cpuinfo_sparc cpu_data[NR_CPUS]; -struct klock_info { - unsigned char kernel_flag; - unsigned char akp; -}; - -extern struct klock_info klock_info; - -#define KLOCK_HELD 0xff -#define KLOCK_CLEAR 0x00 - /* * Private routines/data */ @@ -94,6 +84,10 @@ #define smp_processor_id() (current->processor) extern void smp_message_pass(int target, int msg, unsigned long data, int wait); + +/* As idle task checks need_resched in a tight loop, it is not necessary to + wake it up. -jj */ +#define smp_send_reschedule(cpu) do {} while (0) #endif /* !(__ASSEMBLY__) */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/socket.h linux/include/asm-sparc64/socket.h --- v2.1.114/linux/include/asm-sparc64/socket.h Mon Jan 12 15:15:58 1998 +++ linux/include/asm-sparc64/socket.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: socket.h,v 1.4 1997/10/19 00:19:23 davem Exp $ */ +/* $Id: socket.h,v 1.5 1998/07/22 22:06:49 davem Exp $ */ #ifndef _ASM_SOCKET_H #define _ASM_SOCKET_H @@ -36,6 +36,9 @@ #define SO_PRIORITY 0x000c #define SO_BINDTODEVICE 0x000d + +#define SO_ATTACH_FILTER 0x001a +#define SO_DETACH_FILTER 0x001b /* Security levels - as per NRL IPv6 - don't actually do anything */ #define SO_SECURITY_AUTHENTICATION 0x5001 diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/softirq.h linux/include/asm-sparc64/softirq.h --- v2.1.114/linux/include/asm-sparc64/softirq.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc64/softirq.h Tue Aug 4 16:03:35 1998 @@ -23,6 +23,7 @@ #define softirq_trylock(cpu) (__sparc64_bh_counter ? 0 : (__sparc64_bh_counter=1)) #define softirq_endlock(cpu) (__sparc64_bh_counter = 0) #define clear_active_bhs(x) (bh_active &= ~(x)) +#define synchronize_bh() do { } while (0) /* XXX implement SMP version -DaveM */ #define init_bh(nr, routine) \ do { int ent = nr; \ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/spinlock.h linux/include/asm-sparc64/spinlock.h --- v2.1.114/linux/include/asm-sparc64/spinlock.h Sat Aug 16 09:51:10 1997 +++ linux/include/asm-sparc64/spinlock.h Tue Aug 4 16:03:35 1998 @@ -10,8 +10,13 @@ #ifndef __SMP__ -typedef struct { } spinlock_t; -#define SPIN_LOCK_UNLOCKED { } +#if (__GNUC__ > 2) || (__GNUC_MINOR__ >= 8) + typedef struct { } spinlock_t; + #define SPIN_LOCK_UNLOCKED { } +#else + typedef unsigned char 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-sparc64/stat.h linux/include/asm-sparc64/stat.h --- v2.1.114/linux/include/asm-sparc64/stat.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc64/stat.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: stat.h,v 1.4 1998/02/06 12:52:14 jj Exp $ */ +/* $Id: stat.h,v 1.5 1998/07/26 05:24:41 davem Exp $ */ #ifndef _SPARC64_STAT_H #define _SPARC64_STAT_H @@ -41,55 +41,5 @@ off_t st_blocks; unsigned long __unused4[2]; }; - -typedef __u64 __new_dev_t; - -struct stat64 { - __new_dev_t st_dev; - __u64 st_ino; - __u32 st_mode; - __u32 st_nlink; - __s32 st_uid; - __s32 st_gid; - __new_dev_t st_rdev; - __s64 st_size; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - int st_blksize; - long st_blocks; - char st_fstype[16]; -}; - -struct stat64_32 { - __new_dev_t st_dev; - __u64 st_ino; - __u32 st_mode; - __u32 st_nlink; - __s32 st_uid; - __s32 st_gid; - __new_dev_t st_rdev; - __s64 st_size; - __u64 st_blocks; - __s32 st_atime; - __u32 __unused1; - __s32 st_mtime; - __u32 __unused2; - __s32 st_ctime; - __u32 __unused3; - __u32 st_blksize; - __u32 __unused4; -}; - -#define __XSTAT_VER_1 1 -#define __XSTAT_VER_2 2 -#define __XSTAT_VER_MASK 0xff - -#define __XSTAT_VER_XSTAT 0x000 -#define __XSTAT_VER_LXSTAT 0x100 -#define __XSTAT_VER_FXSTAT 0x200 -#define __XSTAT_VER_TYPEMASK 0xff00 - -#define __XMKNOD_VER_1 1 #endif diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/string.h linux/include/asm-sparc64/string.h --- v2.1.114/linux/include/asm-sparc64/string.h Mon Jan 12 15:15:58 1998 +++ linux/include/asm-sparc64/string.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: string.h,v 1.8 1997/11/19 07:57:50 jj Exp $ +/* $Id: string.h,v 1.11 1998/06/12 14:54:35 jj Exp $ * string.h: External definitions for optimized assembly string * routines for the Linux Kernel. * @@ -67,8 +67,8 @@ extern inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size_t count) { - extern void *__bzero_1page(void *); extern __kernel_size_t __bzero(void *, __kernel_size_t); + extern void *__bzero_1page(void *); if(!c) { if (count == 8192) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/svr4.h linux/include/asm-sparc64/svr4.h --- v2.1.114/linux/include/asm-sparc64/svr4.h Tue Mar 10 10:03:35 1998 +++ linux/include/asm-sparc64/svr4.h Tue Aug 4 16:03:35 1998 @@ -81,7 +81,7 @@ /* flags for stack_t.flags */ enum svr4_stack_flags { - SS_ONSTACK, + SVR4_SS_ONSTACK, SVR4_SS_DISABLE, }; diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/system.h linux/include/asm-sparc64/system.h --- v2.1.114/linux/include/asm-sparc64/system.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/system.h Tue Aug 4 16:03:35 1998 @@ -1,10 +1,11 @@ -/* $Id: system.h,v 1.39 1998/05/01 09:33:55 davem Exp $ */ +/* $Id: system.h,v 1.42 1998/07/29 01:32:51 davem Exp $ */ #ifndef __SPARC64_SYSTEM_H #define __SPARC64_SYSTEM_H #include #include #include +#include #ifndef __ASSEMBLY__ /* @@ -28,8 +29,6 @@ #define ARCH_SUN4 0 extern unsigned long empty_bad_page; -extern unsigned long empty_bad_pmd_table; -extern unsigned long empty_bad_pte_table; extern unsigned long empty_zero_page; #endif @@ -126,12 +125,10 @@ #define flush_user_windows flushw_user /* See what happens when you design the chip correctly? - * NOTE NOTE NOTE this is extremely non-trivial what I - * am doing here. GCC needs only one register to stuff - * things into ('next' in particular) So I "claim" that - * I do not clobber it, when in fact I do. Please, - * when modifying this code inspect output of sched.s very - * carefully to make sure things still work. -DaveM + * + * XXX What we are doing here assumes a lot about gcc reload + * XXX internals, it heavily risks compiler aborts due to + * XXX forbidden registers being spilled. Rewrite me... -DaveM * * SMP NOTE: At first glance it looks like there is a tiny * race window here at the end. The possible problem @@ -144,48 +141,48 @@ * not reference %g6. */ #define switch_to(prev, next) \ -do { __label__ switch_continue; \ - register unsigned long task_pc asm("o7"); \ - (prev)->tss.kregs->tstate &= ~TSTATE_PEF; \ - task_pc = ((unsigned long) &&switch_continue) - 0x8; \ +do { save_and_clear_fpu(); \ (next)->mm->cpu_vm_mask |= (1UL << smp_processor_id()); \ __asm__ __volatile__( \ "rdpr %%pstate, %%g2\n\t" \ "wrpr %%g2, 0x3, %%pstate\n\t" \ "flushw\n\t" \ + "stx %%l0, [%%sp + 2047 + 0x60]\n\t" \ + "stx %%l1, [%%sp + 2047 + 0x68]\n\t" \ "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \ "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \ "rdpr %%wstate, %%o5\n\t" \ - "stx %%o6, [%%g6 + %3]\n\t" \ - "stw %%o7, [%%g6 + %4]\n\t" \ - "sth %%o5, [%%g6 + %2]\n\t" \ + "stx %%o6, [%%g6 + %2]\n\t" \ + "sth %%o5, [%%g6 + %1]\n\t" \ "rdpr %%cwp, %%o5\n\t" \ - "sth %%o5, [%%g6 + %5]\n\t" \ - "membar #Sync\n\t" \ + "sth %%o5, [%%g6 + %4]\n\t" \ "mov %0, %%g6\n\t" \ - "lduh [%0 + %5], %%g1\n\t" \ + "lduh [%0 + %4], %%g1\n\t" \ "wrpr %%g1, %%cwp\n\t" \ - "ldx [%%g6 + %3], %%o6\n\t" \ - "lduw [%%g6 + %4], %%o7\n\t" \ - "lduh [%%g6 + %2], %%o5\n\t" \ - "mov %%g6, %0\n\t" \ + "ldx [%%g6 + %2], %%o6\n\t" \ + "lduh [%%g6 + %1], %%o5\n\t" \ + "lduh [%%g6 + %3], %%o7\n\t" \ + "mov %%g6, %%l2\n\t" \ "wrpr %%o5, 0x0, %%wstate\n\t" \ + "ldx [%%sp + 2047 + 0x60], %%l0\n\t" \ + "ldx [%%sp + 2047 + 0x68], %%l1\n\t" \ "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ "wrpr %%g0, 0x96, %%pstate\n\t" \ - "jmpl %%o7 + 0x8, %%g0\n\t" \ - " mov %0, %%g6\n\t" \ - : /* No outputs */ \ - : "r" (next), "r" (task_pc), \ + "andcc %%o7, 0x100, %%g0\n\t" \ + "bne,pn %%icc, ret_from_syscall\n\t" \ + " mov %%l2, %%g6\n\t" \ + : \ + : "r" (next), \ "i" ((const unsigned long)(&((struct task_struct *)0)->tss.wstate)), \ "i" ((const unsigned long)(&((struct task_struct *)0)->tss.ksp)), \ - "i" ((const unsigned long)(&((struct task_struct *)0)->tss.kpc)), \ + "i" ((const unsigned long)(&((struct task_struct *)0)->tss.flags)), \ "i" ((const unsigned long)(&((struct task_struct *)0)->tss.cwp)) \ : "cc", "g1", "g2", "g3", "g5", "g7", \ - "l1", "l2", "l3", "l4", "l5", "l6", "l7", \ + "l2", "l3", "l4", "l5", "l6", "l7", \ "i0", "i1", "i2", "i3", "i4", "i5", \ - "o0", "o1", "o2", "o3", "o4", "o5"); \ -switch_continue: } while(0) + "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \ +} while(0) extern __inline__ unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val) { diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/ttable.h linux/include/asm-sparc64/ttable.h --- v2.1.114/linux/include/asm-sparc64/ttable.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc64/ttable.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: ttable.h,v 1.6 1998/03/15 17:23:54 ecd Exp $ */ +/* $Id: ttable.h,v 1.8 1998/06/12 14:54:32 jj Exp $ */ #ifndef _SPARC64_TTABLE_H #define _SPARC64_TTABLE_H @@ -66,7 +66,7 @@ #define SYSCALL_TRAP(routine, systbl) \ sethi %hi(109f), %g7; \ - ba,pt %xcc, etrap; \ + ba,pt %xcc, scetrap; \ 109: or %g7, %lo(109b), %g7; \ call routine; \ sethi %hi(systbl), %l7; \ @@ -132,6 +132,16 @@ mov level, %o0; \ call routine; \ add %sp, STACK_BIAS + REGWIN_SZ, %o1; \ + ba,a,pt %xcc, rtrap_clr_l6; + +#define TICK_SMP_IRQ \ + rdpr %pil, %g2; \ + wrpr %g0, 15, %pil; \ + sethi %hi(109f), %g7; \ + b,pt %xcc, etrap_irq; \ +109: or %g7, %lo(109b), %g7; \ + call smp_percpu_timer_interrupt; \ + add %sp, STACK_BIAS + REGWIN_SZ, %o0; \ ba,a,pt %xcc, rtrap_clr_l6; #define TRAP_IVEC TRAP_NOSAVE(do_ivec) diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/unistd.h linux/include/asm-sparc64/unistd.h --- v2.1.114/linux/include/asm-sparc64/unistd.h Fri May 8 23:14:56 1998 +++ linux/include/asm-sparc64/unistd.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.18 1998/04/14 13:50:01 jj Exp $ */ +/* $Id: unistd.h,v 1.20 1998/07/28 13:08:40 jj Exp $ */ #ifndef _SPARC64_UNISTD_H #define _SPARC64_UNISTD_H @@ -29,22 +29,22 @@ #define __NR_unlink 10 /* Common */ #define __NR_execv 11 /* SunOS Specific */ #define __NR_chdir 12 /* Common */ -#define __NR_xstat 13 /* Linux Specific */ +/* #define __NR_ni_syscall 13 ENOSYS under SunOS */ #define __NR_mknod 14 /* Common */ #define __NR_chmod 15 /* Common */ #define __NR_chown 16 /* Common */ #define __NR_brk 17 /* Common */ -#define __NR_xmknod 18 /* Linux Specific */ +/* #define __NR_ni_syscall 18 ENOSYS under SunOS */ #define __NR_lseek 19 /* Common */ #define __NR_getpid 20 /* Common */ -/* #define __NR_ni_syscall 21 ENOSYS under SunOS */ -/* #define __NR_ni_syscall 22 ENOSYS under SunOS */ +#define __NR_capget 21 /* Linux Specific */ +#define __NR_capset 22 /* Linux Specific */ #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ #define __NR_getuid 24 /* Common */ /* #define __NR_time alias 25 ENOSYS under SunOS */ #define __NR_ptrace 26 /* Common */ #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ -/* #define __NR_ni_syscall 28 ENOSYS under SunOS */ +#define __NR_sigaltstack 28 /* Common */ #define __NR_pause 29 /* Is sigblock(0)->sigpause() in SunOS */ #define __NR_utime 30 /* Implemented via utimes() under SunOS */ #define __NR_stty 31 /* Implemented via ioctl() under SunOS */ @@ -55,7 +55,7 @@ #define __NR_sync 36 /* Common */ #define __NR_kill 37 /* Common */ #define __NR_stat 38 /* Common */ -/* #define __NR_ni_syscall 39 ENOSYS under SunOS */ +#define __NR_sendfile 39 /* Linux Specific */ #define __NR_lstat 40 /* Common */ #define __NR_dup 41 /* Common */ #define __NR_pipe 42 /* Common */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/vaddrs.h linux/include/asm-sparc64/vaddrs.h --- v2.1.114/linux/include/asm-sparc64/vaddrs.h Mon Jul 7 08:18:56 1997 +++ linux/include/asm-sparc64/vaddrs.h Tue Aug 4 16:03:35 1998 @@ -1,4 +1,4 @@ -/* $Id: vaddrs.h,v 1.8 1997/06/27 14:55:13 jj Exp $ */ +/* $Id: vaddrs.h,v 1.10 1998/05/14 13:36:01 jj Exp $ */ #ifndef _SPARC64_VADDRS_H #define _SPARC64_VADDRS_H @@ -7,19 +7,13 @@ * For instance the timer register virtual address * is defined here. * - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1995,1998 David S. Miller (davem@caip.rutgers.edu) */ -/* I can see only one reason why we should have statically defined - * mappings for devices and is the speedup improvements of not loading - * a pointer and then the value in the assembly code - */ -#define IOBASE_VADDR 0x0000006000000000ULL /* Base for mapping pages */ -#define IOBASE_LEN 0x0000001000000000ULL /* Length of the IO area */ -#define IOBASE_END 0x0000007000000000ULL -#define DVMA_VADDR 0x0000007000000000ULL /* Base area of the DVMA on suns */ -#define DVMA_LEN 0x0000001000000000ULL /* Size of the DVMA address space */ -#define DVMA_END 0x0000008000000000ULL +/* Everything here must be in the first kernel PGD. */ +#define DVMA_VADDR 0x0000000100000000ULL /* Base area of the DVMA on suns */ +#define DVMA_LEN 0x0000000040000000ULL /* Size of the DVMA address space */ +#define DVMA_END 0x0000000140000000ULL #define MODULES_VADDR 0x0000000001000000ULL /* Where to map modules */ #define MODULES_LEN 0x000000007f000000ULL #define MODULES_END 0x0000000080000000ULL diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/visasm.h linux/include/asm-sparc64/visasm.h --- v2.1.114/linux/include/asm-sparc64/visasm.h Wed Dec 31 16:00:00 1969 +++ linux/include/asm-sparc64/visasm.h Tue Aug 4 16:03:36 1998 @@ -0,0 +1,62 @@ +/* $Id: visasm.h,v 1.2 1998/06/19 12:14:47 jj Exp $ */ +#ifndef _SPARC64_VISASM_H +#define _SPARC64_VISASM_H + +/* visasm.h: FPU saving macros for VIS routines + * + * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) + */ + +#include +#include + +#define AOFF_task_fpregs ((AOFF_task_sigmask_lock + 285)&~255) + +/* Clobbers %o5, %g1, %g2, %g3, %g7, %icc, %xcc */ + +#define VISEntry \ + rd %fprs, %o5; \ + andcc %o5, (FPRS_FEF|FPRS_DU), %g0; \ + be,pt %icc, 297f; \ + sethi %hi(297f), %g7; \ + ba,pt %xcc, VISenter; \ + or %g7, %lo(297f), %g7; \ +297: wr %g0, FPRS_FEF, %fprs; \ + +#define VISExit \ + wr %g0, 0, %fprs; + +/* Clobbers %o5, %g1, %g2, %g3, %g7, %icc, %xcc. + * Must preserve %o5 between VISEntryHalf and VISExitHalf */ + +#define VISEntryHalf \ + rd %fprs, %o5; \ + andcc %o5, FPRS_FEF, %g0; \ + be,pt %icc, 297f; \ + sethi %hi(298f), %g7; \ + ba,pt %xcc, VISenterhalf; \ + or %g7, %lo(298f), %g7; \ + clr %o5; \ +297: wr %o5, FPRS_FEF, %fprs; \ +298: + +#define VISExitHalf \ + wr %o5, 0, %fprs; + +#ifndef __ASSEMBLY__ +extern __inline__ void save_and_clear_fpu(void) { + __asm__ __volatile__ (" + rd %%fprs, %%o5 + andcc %%o5, %0, %%g0 + be,pt %%icc, 299f + sethi %%hi(298f), %%g7 + ba VISenter ! Note. This cannot be bp, as it may be too far from VISenter. + or %%g7, %%lo(298f), %%g7 + 298: wr %%g0, 0, %%fprs + 299: + " : : "i" (FPRS_FEF|FPRS_DU) : + "o5", "g1", "g2", "g3", "g7", "cc"); +} +#endif + +#endif /* _SPARC64_ASI_H */ diff -u --recursive --new-file v2.1.114/linux/include/asm-sparc64/xstat.h linux/include/asm-sparc64/xstat.h --- v2.1.114/linux/include/asm-sparc64/xstat.h Thu Apr 23 20:21:38 1998 +++ linux/include/asm-sparc64/xstat.h Wed Dec 31 16:00:00 1969 @@ -1,58 +0,0 @@ -/* $Id: xstat.h,v 1.1 1998/02/06 12:52:18 jj Exp $ - * xstat.h: sys_xstat/xmknod architecture dependent stuff. - * - * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -extern __inline__ int cp_xstat32(struct inode *inode, struct stat64_32 *s, unsigned long blocks, int blksize) -{ - struct stat64_32 tmp; - - memset (&tmp, 0, sizeof(tmp)); - tmp.st_dev = (((__u64)MAJOR(inode->i_dev)) << 32) | MINOR(inode->i_dev); - tmp.st_ino = inode->i_ino; - tmp.st_mode = inode->i_mode; - tmp.st_nlink = inode->i_nlink; - tmp.st_uid = inode->i_uid; - tmp.st_gid = inode->i_gid; - tmp.st_rdev = (((__u64)MAJOR(inode->i_rdev)) << 32) | MINOR(inode->i_rdev); - tmp.st_size = inode->i_size; - tmp.st_blocks = blocks; - tmp.st_atime = inode->i_atime; - tmp.st_mtime = inode->i_mtime; - tmp.st_ctime = inode->i_ctime; - tmp.st_blksize = blksize; - return copy_to_user(s,&tmp,sizeof(tmp)); -} - -extern __inline__ int cp_xstat(struct inode *inode, struct stat64 *s, unsigned long blocks, int blksize) -{ - struct stat64 tmp; - if (current->tss.flags & SPARC_FLAG_32BIT) - return cp_xstat32(inode, (struct stat64_32 *)s, blocks, blksize); - memset (&tmp, 0, sizeof(tmp)); - tmp.st_dev = (((__u64)MAJOR(inode->i_dev)) << 32) | MINOR(inode->i_dev); - tmp.st_ino = inode->i_ino; - tmp.st_mode = inode->i_mode; - tmp.st_nlink = inode->i_nlink; - tmp.st_uid = inode->i_uid; - tmp.st_gid = inode->i_gid; - tmp.st_rdev = (((__u64)MAJOR(inode->i_rdev)) << 32) | MINOR(inode->i_rdev); - tmp.st_size = inode->i_size; - tmp.st_atim.tv_sec = inode->i_atime; - tmp.st_mtim.tv_sec = inode->i_mtime; - tmp.st_ctim.tv_sec = inode->i_ctime; - tmp.st_blksize = blksize; - tmp.st_blocks = blocks; - /* Should I check if all fs names are < 16? All in the kernel tree are */ - if (inode->i_sb) - strcpy(tmp.st_fstype, inode->i_sb->s_type->name); - return copy_to_user(s,&tmp,sizeof(tmp)); -} - -extern __inline__ int get_user_new_dev_t(kdev_t *kdev, __new_dev_t *udev) { - __new_dev_t ndev; - if (copy_from_user (&ndev, udev, sizeof(__new_dev_t))) return -EFAULT; - *kdev = MKDEV((ndev >> 32), (__u32)ndev); - return 0; -} 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/cyclades.h linux/include/linux/cyclades.h --- v2.1.114/linux/include/linux/cyclades.h Sun Jun 7 11:16:39 1998 +++ linux/include/linux/cyclades.h Tue Aug 4 15:00:04 1998 @@ -1,4 +1,4 @@ -/* $Revision: 2.4 $$Date: 1998/06/01 12:09:53 $ +/* $Revision: 2.5 $$Date: 1998/08/03 16:57:01 $ * linux/include/linux/cyclades.h * * This file is maintained by Ivan Passos , @@ -7,6 +7,9 @@ * * This file contains the general definitions for the cyclades.c driver *$Log: cyclades.h,v $ + *Revision 2.5 1998/08/03 16:57:01 ivan + *added cyclades_idle_stats structure; + * *Revision 2.4 1998/06/01 12:09:53 ivan *removed closing_wait2 from cyclades_port structure; * @@ -60,6 +63,22 @@ unsigned long char_last; }; +/* + * These stats all reflect activity since the device was last initialized. + * (i.e., since the port was opened with no other processes already having it + * open) + */ +struct cyclades_idle_stats { + time_t in_use; /* Time device has been in use (secs) */ + time_t recv_idle; /* Time since last char received (secs) */ + time_t xmit_idle; /* Time since last char transmitted (secs) */ + unsigned long recv_bytes; /* Bytes received */ + unsigned long xmit_bytes; /* Bytes transmitted */ + unsigned long overruns; /* Input overruns */ + unsigned long frame_errs; /* Input framing errors */ + unsigned long parity_errs; /* Input parity errors */ +}; + #define CYCLADES_MAGIC 0x4359 #define CYGETMON 0x435901 @@ -75,11 +94,12 @@ #define CYGETRFLOW 0x43590b #define CYSETRTSDTR_INV 0x43590c #define CYGETRTSDTR_INV 0x43590d -#define CYZPOLLCYCLE 0x43590e -#define CYGETCD1400VER 0x43590f -#define CYGETCARDINFO 0x435910 -#define CYSETWAIT 0x435911 -#define CYGETWAIT 0x435912 +#define CYZSETPOLLCYCLE 0x43590e +#define CYZGETPOLLCYCLE 0x43590f +#define CYGETCD1400VER 0x435910 +#define CYGETCARDINFO 0x435911 +#define CYSETWAIT 0x435912 +#define CYGETWAIT 0x435913 /*************** CYCLOM-Z ADDITIONS ***************/ @@ -534,6 +554,7 @@ struct cyclades_monitor mon; unsigned long jiffies[3]; unsigned long rflush_count; + struct cyclades_idle_stats idle_stats; }; /* 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 Wed Aug 5 00:02:47 1998 @@ -137,6 +137,7 @@ #define PG_DMA 7 #define PG_Slab 8 #define PG_swap_cache 9 +#define PG_skip 10 #define PG_reserved 31 /* Make it prettier to test the above... */ @@ -277,8 +278,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/openpic.h linux/include/linux/openpic.h --- v2.1.114/linux/include/linux/openpic.h Sat Sep 6 10:04:16 1997 +++ linux/include/linux/openpic.h Tue Aug 4 16:51:32 1998 @@ -3,10 +3,6 @@ * * Copyright (C) 1997 Geert Uytterhoeven * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * * This file is based on the following documentation: * * The Open Programmable Interrupt Controller (PIC) @@ -51,6 +47,16 @@ /* + * Vector numbers + */ + +#define OPENPIC_VEC_SOURCE 0x10 /* and up */ +#define OPENPIC_VEC_TIMER 0x40 /* and up */ +#define OPENPIC_VEC_IPI 0x50 /* and up */ +#define OPENPIC_VEC_SPURIOUS 99 + + + /* * OpenPIC Registers are 32 bits and aligned on 128 bit boundaries */ @@ -198,6 +204,8 @@ }; extern volatile struct OpenPIC *OpenPIC; +extern u_int OpenPIC_NumInitSenses; +extern u_char *OpenPIC_InitSenses; /* diff -u --recursive --new-file v2.1.114/linux/include/linux/personality.h linux/include/linux/personality.h --- v2.1.114/linux/include/linux/personality.h Thu Feb 12 20:56:13 1998 +++ linux/include/linux/personality.h Tue Aug 4 16:49:19 1998 @@ -23,6 +23,7 @@ #define PER_ISCR4 (0x0005 | STICKY_TIMEOUTS) #define PER_BSD (0x0006) #define PER_XENIX (0x0007 | STICKY_TIMEOUTS) +#define PER_LINUX32 (0x0008) /* Prototype for an lcall7 syscall handler. */ typedef void (*lcall7_func)(struct pt_regs *); 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 Wed Aug 5 00:02:47 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/include/linux/sysctl.h linux/include/linux/sysctl.h --- v2.1.114/linux/include/linux/sysctl.h Tue Jun 23 10:01:29 1998 +++ linux/include/linux/sysctl.h Tue Aug 4 16:49:18 1998 @@ -65,6 +65,7 @@ KERN_NAMETRANS, /* Name translation */ KERN_PPC_HTABRECLAIM, /* turn htab reclaimation on/off on PPC */ KERN_PPC_ZEROPAGED, /* turn idle page zeroing on/off on PPC */ + KERN_PPC_POWERSAVE_NAP, /* use nap mode for power saving */ KERN_MODPROBE, KERN_SG_BIG_BUFF }; 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 Tue Aug 4 14:24:34 1998 @@ -359,19 +359,13 @@ return(cur); } -#ifdef CONFIG_PROFILE -__initfunc(static void profile_setup(char *str, int *ints)) +static void __init profile_setup(char *str, int *ints) { if (ints[0] > 0) prof_shift = (unsigned long) ints[1]; else -#ifdef CONFIG_PROFILE_SHIFT - prof_shift = CONFIG_PROFILE_SHIFT; -#else prof_shift = 2; -#endif } -#endif static struct dev_name_struct { @@ -518,9 +512,7 @@ #else { "reserve=", pnp_reserve_setup }, #endif -#ifdef CONFIG_PROFILE { "profile=", profile_setup }, -#endif #ifdef __SMP__ { "nosmp", smp_setup }, { "maxcpus=", smp_setup }, @@ -1082,7 +1074,6 @@ #ifdef CONFIG_MODULES init_modules(); #endif -#ifdef CONFIG_PROFILE if (prof_shift) { prof_buffer = (unsigned int *) memory_start; /* only text is profiled */ @@ -1091,7 +1082,6 @@ memory_start += prof_len * sizeof(unsigned int); memset(prof_buffer, 0, prof_len * sizeof(unsigned int)); } -#endif memory_start = kmem_cache_init(memory_start, memory_end); sti(); @@ -1123,11 +1113,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/ipc/shm.c linux/ipc/shm.c --- v2.1.114/linux/ipc/shm.c Tue Jun 23 10:01:30 1998 +++ linux/ipc/shm.c Tue Aug 4 16:49:19 1998 @@ -726,7 +726,7 @@ static unsigned long swap_id = 0; /* currently being swapped */ static unsigned long swap_idx = 0; /* next to swap */ -int shm_swap (int prio, int dma) +int shm_swap (int prio, int gfp_mask) { pte_t page; struct shmid_ds *shp; @@ -763,7 +763,7 @@ page = __pte(shp->shm_pages[idx]); if (!pte_present(page)) goto check_table; - if (dma && !PageDMA(&mem_map[MAP_NR(pte_page(page))])) + if ((gfp_mask & __GFP_DMA) && !PageDMA(&mem_map[MAP_NR(pte_page(page))])) goto check_table; swap_attempts++; diff -u --recursive --new-file v2.1.114/linux/ipc/util.c linux/ipc/util.c --- v2.1.114/linux/ipc/util.c Thu May 7 22:51:55 1998 +++ linux/ipc/util.c Tue Aug 4 16:49:19 1998 @@ -64,7 +64,7 @@ return; } -int shm_swap (int prio, unsigned long limit) +int shm_swap (int prio, int gfp_mask) { return 0; } diff -u --recursive --new-file v2.1.114/linux/kernel/ksyms.c linux/kernel/ksyms.c --- v2.1.114/linux/kernel/ksyms.c Sun Jul 26 11:57:19 1998 +++ linux/kernel/ksyms.c Tue Aug 4 17:04:04 1998 @@ -52,7 +52,7 @@ #include #include -extern unsigned char aux_device_present, kbd_read_mask; +extern unsigned char aux_device_present, pckbd_read_mask; #if defined(CONFIG_PROC_FS) #include @@ -121,7 +121,6 @@ EXPORT_SYMBOL(mem_map); EXPORT_SYMBOL(remap_page_range); EXPORT_SYMBOL(max_mapnr); -EXPORT_SYMBOL(num_physpages); EXPORT_SYMBOL(high_memory); EXPORT_SYMBOL(update_vm_cache); EXPORT_SYMBOL(vmtruncate); @@ -379,10 +378,12 @@ EXPORT_SYMBOL(add_mouse_randomness); EXPORT_SYMBOL(fasync_helper); +#ifdef CONFIG_PSMOUSE_MODULE /* psaux mouse */ EXPORT_SYMBOL(aux_device_present); #ifdef CONFIG_VT -EXPORT_SYMBOL(kbd_read_mask); +EXPORT_SYMBOL(pckbd_read_mask); +#endif #endif #ifdef CONFIG_BLK_DEV_MD diff -u --recursive --new-file v2.1.114/linux/kernel/sched.c linux/kernel/sched.c --- v2.1.114/linux/kernel/sched.c Mon Aug 3 17:48:29 1998 +++ linux/kernel/sched.c Tue Aug 4 22:55:15 1998 @@ -469,8 +469,11 @@ if (in_interrupt()) goto scheduling_in_interrupt; release_kernel_lock(prev, this_cpu); + + /* Do "administrative" work here while we don't hold any locks */ if (bh_active & bh_mask) do_bottom_half(); + run_task_queue(&tq_scheduler); spin_lock(&scheduler_lock); spin_lock_irq(&runqueue_lock); diff -u --recursive --new-file v2.1.114/linux/kernel/sysctl.c linux/kernel/sysctl.c --- v2.1.114/linux/kernel/sysctl.c Tue Jun 23 10:01:30 1998 +++ linux/kernel/sysctl.c Tue Aug 4 16:49:18 1998 @@ -52,7 +52,7 @@ extern char reboot_command []; #endif #ifdef __powerpc__ -extern unsigned long htab_reclaim_on, zero_paged_on; +extern unsigned long htab_reclaim_on, zero_paged_on, powersave_nap; #endif extern int pgt_cache_water[]; @@ -171,6 +171,8 @@ {KERN_PPC_HTABRECLAIM, "htab-reclaim", &htab_reclaim_on, sizeof(int), 0644, NULL, &proc_dointvec}, {KERN_PPC_ZEROPAGED, "zero-paged", &zero_paged_on, sizeof(int), + 0644, NULL, &proc_dointvec}, + {KERN_PPC_POWERSAVE_NAP, "powersave-nap", &powersave_nap, sizeof(int), 0644, NULL, &proc_dointvec}, #endif {KERN_CTLALTDEL, "ctrl-alt-del", &C_A_D, sizeof(int), diff -u --recursive --new-file v2.1.114/linux/mm/filemap.c linux/mm/filemap.c --- v2.1.114/linux/mm/filemap.c Mon Aug 3 12:45:48 1998 +++ linux/mm/filemap.c Tue Aug 4 17:04:04 1998 @@ -216,6 +216,12 @@ page = mem_map + clock; do { + if (PageSkip(page)) { + /* next_hash is overloaded for PageSkip */ + page = page->next_hash; + clock = page->map_nr; + } + if (shrink_one_page(page, gfp_mask)) return 1; count_max--; @@ -223,7 +229,7 @@ count_min--; page++; clock++; - if (clock >= limit) { + if (clock >= max_mapnr) { clock = 0; page = mem_map; } 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 16:09:14 1998 @@ -120,7 +120,19 @@ free_one_pmd(pmd+j); pmd_free(pmd); } - + +/* 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 }; + +/* Returns the number of pages freed */ +int check_pgt_cache(void) +{ + return do_check_pgt_cache(pgt_cache_water[0], pgt_cache_water[1]); +} + + /* * This function clears all user-level page tables of a process - this * is needed by execve(), so that old pages aren't in the way. @@ -945,24 +957,5 @@ while (addr < end) { handle_mm_fault(current, vma, addr, write); addr += PAGE_SIZE; - } -} - -/* 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) -{ - 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]); } }