diff options
Diffstat (limited to 'include')
75 files changed, 1213 insertions, 681 deletions
diff --git a/include/asm-alpha/cache.h b/include/asm-alpha/cache.h index 5e46073a8..d9483efb1 100644 --- a/include/asm-alpha/cache.h +++ b/include/asm-alpha/cache.h @@ -4,9 +4,18 @@ #ifndef __ARCH_ALPHA_CACHE_H #define __ARCH_ALPHA_CACHE_H -/* Bytes per L1 (data) cache line. Both EV4 and EV5 are write-through, - read-allocate, direct-mapped, physical. */ -#define L1_CACHE_BYTES 32 +#include <linux/config.h> + +/* Bytes per L1 (data) cache line. */ +#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EV6) +# define L1_CACHE_BYTES 32 /* should be 64, but networking dies */ +#else +/* Both EV4 and EV5 are write-through, read-allocate, + direct-mapped, physical. +*/ +# define L1_CACHE_BYTES 32 +#endif + #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) #define SMP_CACHE_BYTES L1_CACHE_BYTES diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index 27e06783a..a74290f55 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h @@ -56,6 +56,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* IOMMU controls. */ /* Allocate and map kernel buffer using consistant mode DMA for PCI diff --git a/include/asm-alpha/string.h b/include/asm-alpha/string.h index a7cf9557d..2b9cf9438 100644 --- a/include/asm-alpha/string.h +++ b/include/asm-alpha/string.h @@ -18,7 +18,7 @@ extern void * memmove(void *, const void *, size_t); /* For backward compatibility with modules. Unused otherwise. */ extern void * __memcpy(void *, const void *, size_t); -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 #define memcpy __builtin_memcpy #endif @@ -27,7 +27,7 @@ extern void * __constant_c_memset(void *, unsigned long, size_t); extern void * __memset(void *, int, size_t); extern void * memset(void *, int, size_t); -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 #define memset(s, c, n) \ (__builtin_constant_p(c) \ ? (__builtin_constant_p(n) && (c) == 0 \ diff --git a/include/asm-alpha/unaligned.h b/include/asm-alpha/unaligned.h index cd268017e..8017f6bfa 100644 --- a/include/asm-alpha/unaligned.h +++ b/include/asm-alpha/unaligned.h @@ -31,7 +31,7 @@ struct __una_u16 { __u16 x __attribute__((packed)); }; extern inline unsigned long __uldq(const unsigned long * r11) { -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 const struct __una_u64 *ptr = (const struct __una_u64 *) r11; return ptr->x; #else @@ -50,7 +50,7 @@ extern inline unsigned long __uldq(const unsigned long * r11) extern inline unsigned long __uldl(const unsigned int * r11) { -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 const struct __una_u32 *ptr = (const struct __una_u32 *) r11; return ptr->x; #else @@ -69,7 +69,7 @@ extern inline unsigned long __uldl(const unsigned int * r11) extern inline unsigned long __uldw(const unsigned short * r11) { -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 const struct __una_u16 *ptr = (const struct __una_u16 *) r11; return ptr->x; #else @@ -92,7 +92,7 @@ extern inline unsigned long __uldw(const unsigned short * r11) extern inline void __ustq(unsigned long r5, unsigned long * r11) { -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 struct __una_u64 *ptr = (struct __una_u64 *) r11; ptr->x = r5; #else @@ -117,7 +117,7 @@ extern inline void __ustq(unsigned long r5, unsigned long * r11) extern inline void __ustl(unsigned long r5, unsigned int * r11) { -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 struct __una_u32 *ptr = (struct __una_u32 *) r11; ptr->x = r5; #else @@ -142,7 +142,7 @@ extern inline void __ustl(unsigned long r5, unsigned int * r11) extern inline void __ustw(unsigned long r5, unsigned short * r11) { -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91) +#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 struct __una_u16 *ptr = (struct __una_u16 *) r11; ptr->x = r5; #else diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index 8ed8ebf3c..2a2fcc947 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h @@ -13,6 +13,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + #include <asm/scatterlist.h> #include <asm/io.h> diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 80ba0d2e4..23460fcb6 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h @@ -22,6 +22,7 @@ #include <linux/config.h> #include <asm/processor.h> +#include <asm/i387.h> #include <asm/msr.h> static int __init no_halt(char *s) @@ -49,7 +50,7 @@ static int __init no_387(char *s) __setup("no387", no_387); -static char fpu_error __initdata = 0; +static char __initdata fpu_error = 0; static void __init copro_timeout(void) { @@ -62,12 +63,12 @@ static void __init copro_timeout(void) outb_p(0,0xf0); } -static double x __initdata = 4195835.0; -static double y __initdata = 3145727.0; +static double __initdata x = 4195835.0; +static double __initdata y = 3145727.0; #ifdef CONFIG_X86_XMM -static float zero[4] __initdata = { 0.0, 0.0, 0.0, 0.0 }; -static float one[4] __initdata = { 1.0, 1.0, 1.0, 1.0 }; +static float __initdata zero[4] = { 0.0, 0.0, 0.0, 0.0 }; +static float __initdata one[4] = { 1.0, 1.0, 1.0, 1.0 }; #endif static void __init check_fpu(void) @@ -148,11 +149,11 @@ static void __init check_fpu(void) else printk("Hmm, FPU using exception 16 error reporting with FDIV bug.\n"); -#ifdef CONFIG_X86_FXSR +#if defined(CONFIG_X86_FXSR) || defined(CONFIG_X86_RUNTIME_FXSR) /* * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned. */ - if (offsetof(struct task_struct, thread.i387.hard.fxsr_space[0]) & 15) + if (offsetof(struct task_struct, thread.i387.fxsave) & 15) panic("Kernel compiled for PII/PIII+ with FXSR, data not 16-byte aligned!"); if (cpu_has_fxsr) { @@ -168,14 +169,14 @@ static void __init check_fpu(void) printk("done.\n"); /* Check if exception 19 works okay. */ - set_fpu_mxcsr(XMM_UNMASKED_MXCSR); + load_mxcsr(0x0000); printk(KERN_INFO "Checking SIMD FPU exceptions... "); __asm__("movups %0,%%xmm0\n\t" "movups %1,%%xmm1\n\t" "divps %%xmm0,%%xmm1\n\t" : : "m" (*&zero), "m" (*&one)); printk("OK, SIMD FPU using exception 19 error reporting.\n"); - set_fpu_mxcsr(XMM_DEFAULT_MXCSR); + load_mxcsr(0x1f80); } #endif } diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 0083b3f20..5bf5ec1c8 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h @@ -14,6 +14,7 @@ typedef unsigned long elf_greg_t; typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef struct user_i387_struct elf_fpregset_t; +typedef struct user_fxsr_struct elf_fpxregset_t; /* * This is used to ensure we don't load something for the wrong architecture. diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h new file mode 100644 index 000000000..ec7650841 --- /dev/null +++ b/include/asm-i386/i387.h @@ -0,0 +1,85 @@ +/* + * include/asm-i386/i387.h + * + * Copyright (C) 1994 Linus Torvalds + * + * Pentium III FXSR, SSE support + * General FPU state handling cleanups + * Gareth Hughes <gareth@valinux.com>, May 2000 + */ + +#ifndef __ASM_I386_I387_H +#define __ASM_I386_I387_H + +#include <linux/sched.h> +#include <asm/processor.h> +#include <asm/sigcontext.h> +#include <asm/user.h> + +/* + * FPU lazy state save handling... + */ +extern void save_fpu( struct task_struct *tsk ); +extern void save_init_fpu( struct task_struct *tsk ); +extern void restore_fpu( struct task_struct *tsk ); + +#define unlazy_fpu( tsk ) do { \ + if ( tsk->flags & PF_USEDFPU ) \ + save_fpu( tsk ); \ +} while (0) + +#define clear_fpu( tsk ) do { \ + if ( tsk->flags & PF_USEDFPU ) { \ + tsk->flags &= ~PF_USEDFPU; \ + stts(); \ + } \ +} while (0) + +/* + * FPU state interaction... + */ +extern unsigned short get_fpu_cwd( struct task_struct *tsk ); +extern unsigned short get_fpu_swd( struct task_struct *tsk ); +extern unsigned short get_fpu_twd( struct task_struct *tsk ); +extern unsigned short get_fpu_mxcsr( struct task_struct *tsk ); + +extern void set_fpu_cwd( struct task_struct *tsk, unsigned short cwd ); +extern void set_fpu_swd( struct task_struct *tsk, unsigned short swd ); +extern void set_fpu_twd( struct task_struct *tsk, unsigned short twd ); +extern void set_fpu_mxcsr( struct task_struct *tsk, unsigned short mxcsr ); + +#define load_mxcsr( val ) do { \ + if ( cpu_has_xmm ) { \ + unsigned long __mxcsr = ((unsigned long)(val) & 0xffff); \ + asm volatile( "ldmxcsr %0" : : "m" (__mxcsr) ); \ + } \ +} while (0) + +/* + * Signal frame handlers... + */ +extern int save_i387( struct _fpstate *buf ); +extern int restore_i387( struct _fpstate *buf ); + +/* + * ptrace request handers... + */ +extern int get_fpregs( struct user_i387_struct *buf, + struct task_struct *tsk ); +extern int set_fpregs( struct task_struct *tsk, + struct user_i387_struct *buf ); + +extern int get_fpxregs( struct user_fxsr_struct *buf, + struct task_struct *tsk ); +extern int set_fpxregs( struct task_struct *tsk, + struct user_fxsr_struct *buf ); + +/* + * FPU state for core dumps... + */ +extern int dump_fpu( struct pt_regs *regs, + struct user_i387_struct *fpu ); +extern int dump_extended_fpu( struct pt_regs *regs, + struct user_fxsr_struct *fpu ); + +#endif /* __ASM_I386_I387_H */ diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h index 2068753df..9ac8df6ec 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-i386/io_apic.h @@ -1,6 +1,7 @@ #ifndef __ASM_IO_APIC_H #define __ASM_IO_APIC_H +#include <linux/config.h> #include <asm/types.h> /* @@ -9,6 +10,8 @@ * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar */ +#ifdef CONFIG_X86_IO_APIC + #define IO_APIC_BASE(idx) \ ((volatile int *)__fix_to_virt(FIX_IO_APIC_BASE_0 + idx)) @@ -130,5 +133,14 @@ extern int nmi_watchdog; extern int skip_ioapic_setup; extern void IO_APIC_init_uniprocessor (void); +/* + * If we use the IO-APIC for IRQ routing, disable automatic + * assignment of PCI IRQ's. + */ +#define io_apic_assign_pci_irqs (mp_irq_entries != 0) + +#else /* !CONFIG_X86_IO_APIC */ +#define io_apic_assign_pci_irqs 0 #endif +#endif diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h index d6d0311b7..074957886 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-i386/pci.h @@ -13,6 +13,7 @@ #define PCIBIOS_MIN_MEM 0x10000000 void pcibios_set_master(struct pci_dev *dev); +void pcibios_penalize_isa_irq(int irq); /* Dynamic DMA mapping stuff. * i386 has everything mapped statically. diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 76fd66fd8..80aeb3201 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -2,9 +2,6 @@ * include/asm-i386/processor.h * * Copyright (C) 1994 Linus Torvalds - * - * Pentium III FXSR, SSE support - * Gareth Hughes <gareth@valinux.com>, May 2000 */ #ifndef __ASM_I386_PROCESSOR_H @@ -86,7 +83,7 @@ struct cpuinfo_x86 { #define X86_FEATURE_PGE 0x00002000 /* Page Global Enable */ #define X86_FEATURE_MCA 0x00004000 /* Machine Check Architecture */ #define X86_FEATURE_CMOV 0x00008000 /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */ -#define X86_FEATURE_PAT 0x00010000 /* Page Attribute Table */ +#define X86_FEATURE_PAT 0x00010000 /* Page Attribute Table */ #define X86_FEATURE_PSE36 0x00020000 /* 36-bit PSEs */ #define X86_FEATURE_18 0x00040000 #define X86_FEATURE_19 0x00080000 @@ -95,7 +92,7 @@ struct cpuinfo_x86 { #define X86_FEATURE_22 0x00400000 #define X86_FEATURE_MMX 0x00800000 /* Multimedia Extensions */ #define X86_FEATURE_FXSR 0x01000000 /* FXSAVE and FXRSTOR instructions (fast save and restore of FPU context), and CR4.OSFXSR (OS uses these instructions) available */ -#define X86_FEATURE_XMM 0x02000000 /* Streaming SIMD Extensions */ +#define X86_FEATURE_XMM 0x02000000 /* Streaming SIMD Extensions */ #define X86_FEATURE_26 0x04000000 #define X86_FEATURE_27 0x08000000 #define X86_FEATURE_28 0x10000000 @@ -147,7 +144,8 @@ extern inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) "=b" (*ebx), "=c" (*ecx), "=d" (*edx) - : "a" (op)); + : "a" (op) + : "cc"); } @@ -250,9 +248,7 @@ extern unsigned int mca_pentium_flag; #define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) #define INVALID_IO_BITMAP_OFFSET 0x8000 -#ifndef CONFIG_X86_FXSR - -struct i387_hard_struct { +struct i387_fsave_struct { long cwd; long swd; long twd; @@ -264,22 +260,15 @@ struct i387_hard_struct { long status; /* software status information */ }; -#else - -/* It doesn't matter if the CPU writes only part of this struct; it gets - * copied by do_fork, so the unimplemented area never changes from what - * init_task.i387 is initialized to (all zeroes). */ - -struct i387_hard_struct { - long cwd; - long swd; - long twd; +struct i387_fxsave_struct { + unsigned short cwd; + unsigned short swd; + unsigned short twd; + unsigned short fop; long fip; long fcs; long foo; long fos; - long status; /* software status information */ - long fxsr_space[6]; /* FXSR FPU environment must not be used */ long mxcsr; long reserved; long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ @@ -287,10 +276,6 @@ struct i387_hard_struct { long padding[56]; } __attribute__ ((aligned (16))); -#define X86_FXSR_MAGIC 0x0000 -#define X86_FXSR_SIZE 512 -#endif - struct i387_soft_struct { long cwd; long swd; @@ -306,7 +291,8 @@ struct i387_soft_struct { }; union i387_union { - struct i387_hard_struct hard; + struct i387_fsave_struct fsave; + struct i387_fxsave_struct fxsave; struct i387_soft_struct soft; }; @@ -423,75 +409,6 @@ extern void release_segments(struct mm_struct * mm); extern void forget_segments(void); /* - * FPU lazy state save handling.. - */ -#ifndef CONFIG_X86_FXSR - -#define save_fpu(tsk) do { \ - asm volatile("fnsave %0 ; fwait" \ - : "=m" (tsk->thread.i387.hard)); \ - tsk->flags &= ~PF_USEDFPU; \ - stts(); \ -} while (0) - -#define save_init_fpu(tsk) save_fpu(tsk) - -#define restore_fpu(tsk) do { \ - asm volatile("frstor %0" \ - : : "m" (tsk->thread.i387.hard)); \ -} while (0) - -#else /* CONFIG_X86_FXSR */ - -#define save_fpu(tsk) do { \ - asm volatile("fnstenv %0 ; fxsave %1 ; fwait" \ - : "=m" (tsk->thread.i387.hard), \ - "=m" (tsk->thread.i387.hard.fxsr_space[0])); \ - tsk->flags &= ~PF_USEDFPU; \ - stts(); \ -} while (0) - -#define save_init_fpu(tsk) do { \ - asm volatile("fnstenv %0 ; fxsave %1 ; fnclex" \ - : "=m" (tsk->thread.i387.hard), \ - "=m" (tsk->thread.i387.hard.fxsr_space[0])); \ - tsk->flags &= ~PF_USEDFPU; \ - stts(); \ -} while (0) - -#define restore_fpu(tsk) do { \ - asm volatile("fxrstor %0 ; fldenv %1" \ - : : "m" (tsk->thread.i387.hard.fxsr_space[0]), \ - "m" (tsk->thread.i387.hard)); \ -} while (0) - -#endif /* CONFIG_X86_FXSR */ - -#define unlazy_fpu(tsk) do { \ - if (tsk->flags & PF_USEDFPU) \ - save_fpu(tsk); \ -} while (0) - -#define clear_fpu(tsk) do { \ - if (tsk->flags & PF_USEDFPU) { \ - tsk->flags &= ~PF_USEDFPU; \ - stts(); \ - } \ -} while (0) - -#ifdef CONFIG_X86_XMM -#define XMM_DEFAULT_MXCSR 0x1f80 -#define XMM_UNMASKED_MXCSR 0x0000 - -#define set_fpu_mxcsr(val) do { \ - if (cpu_has_xmm) { \ - unsigned long __mxcsr = ((unsigned long)(val) & 0xffff); \ - asm volatile("ldmxcsr %0" : : "m" (__mxcsr)); \ - } \ -} while (0) -#endif - -/* * Return saved PC of a blocked thread. */ extern inline unsigned long thread_saved_pc(struct thread_struct *t) diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h index 05189f6f3..6a52f4e76 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-i386/ptrace.h @@ -46,8 +46,8 @@ struct pt_regs { #define PTRACE_SETREGS 13 #define PTRACE_GETFPREGS 14 #define PTRACE_SETFPREGS 15 -#define PTRACE_GETXFPREGS 25 -#define PTRACE_SETXFPREGS 26 +#define PTRACE_GETFPXREGS 18 +#define PTRACE_SETFPXREGS 19 #ifdef __KERNEL__ #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs)) diff --git a/include/asm-i386/sigcontext.h b/include/asm-i386/sigcontext.h index 77ef66680..b51145936 100644 --- a/include/asm-i386/sigcontext.h +++ b/include/asm-i386/sigcontext.h @@ -52,6 +52,8 @@ struct _fpstate { unsigned long padding[56]; }; +#define X86_FXSR_MAGIC 0x0000 + struct sigcontext { unsigned short gs, __gsh; unsigned short fs, __fsh; diff --git a/include/asm-i386/user.h b/include/asm-i386/user.h index e034118f3..dcd555159 100644 --- a/include/asm-i386/user.h +++ b/include/asm-i386/user.h @@ -34,12 +34,12 @@ * Pentium III FXSR, SSE support * Gareth Hughes <gareth@valinux.com>, May 2000 * - * Provide support for the GDB 5.0 PTRACE_*XFPREGS requests for interacting - * with the FXSR-format floating point environment. Floating point data - * can be accessed in the regular FSAVE format in the usual manner, and the - * XMM register/control data can be accessed via the new ptrace requests. - * Note that the floating point environment contained in the FXSR format - * is ignored and any changes to these fields will be lost. + * Provide support for the GDB 5.0+ PTRACE_{GET|SET}FPXREGS requests for + * interacting with the FXSR-format floating point environment. Floating + * point data can be accessed in the regular format in the usual manner, + * and both the standard and SIMD floating point data can be accessed via + * the new ptrace requests. In either case, changes to the FPU environment + * will be reflected in the task's state as expected. */ struct user_i387_struct { @@ -48,26 +48,25 @@ struct user_i387_struct { long twd; long fip; long fcs; - long foo; - long fos; + long fdp; + long fds; long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ }; -struct user_xfpregs_struct { - long cwd; - long swd; - long twd; +struct user_fxsr_struct { + unsigned short cwd; + unsigned short swd; + unsigned short twd; + unsigned short fop; long fip; long fcs; long foo; long fos; - long __reserved_00; - long fxsr_space[6]; /* FXSR FPU environment must not be used */ long mxcsr; - long __reserved_01; + long reserved; long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ - long __reserved_02[56]; + long padding[56]; }; /* diff --git a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h new file mode 100644 index 000000000..4991bb26e --- /dev/null +++ b/include/asm-ia64/asmmacro.h @@ -0,0 +1,48 @@ +#ifndef _ASM_IA64_ASMMACRO_H +#define _ASM_IA64_ASMMACRO_H + +/* + * Copyright (C) 2000 Hewlett-Packard Co + * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com> + */ + +#if 1 + +/* + * This is a hack that's necessary as long as we support old versions + * of gas, that have no unwind support. + */ +#include <linux/config.h> + +#ifdef CONFIG_IA64_NEW_UNWIND +# define UNW(args...) args +#else +# define UNW(args...) +#endif + +#endif + +#define ENTRY(name) \ + .align 16; \ + .proc name; \ +name: + +#define GLOBAL_ENTRY(name) \ + .global name; \ + ENTRY(name) + +#define END(name) \ + .endp name + +/* + * Helper macros to make unwind directives more readable: + */ + +/* prologue_gr: */ +#define ASM_UNW_PRLG_RP 0x8 +#define ASM_UNW_PRLG_PFS 0x4 +#define ASM_UNW_PRLG_PSP 0x2 +#define ASM_UNW_PRLG_PR 0x1 +#define ASM_UNW_PRLG_GRSAVE(ninputs) (32+(ninputs)) + +#endif /* _ASM_IA64_ASMMACRO_H */ diff --git a/include/asm-ia64/dma.h b/include/asm-ia64/dma.h index 4e9b30a91..1d9eb2a41 100644 --- a/include/asm-ia64/dma.h +++ b/include/asm-ia64/dma.h @@ -21,7 +21,7 @@ #define dma_inb inb #define MAX_DMA_CHANNELS 8 -#define MAX_DMA_ADDRESS (~0UL) /* no limits on DMAing, for now */ +#define MAX_DMA_ADDRESS 0xffffffffUL extern spinlock_t dma_spin_lock; diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h index 00219b00d..884f1314a 100644 --- a/include/asm-ia64/ia32.h +++ b/include/asm-ia64/ia32.h @@ -112,10 +112,16 @@ struct sigaction32 { sigset32_t sa_mask; /* A 32 bit mask */ }; +typedef struct sigaltstack_ia32 { + unsigned int ss_sp; + int ss_flags; + unsigned int ss_size; +} stack_ia32_t; + struct ucontext_ia32 { - unsigned long uc_flags; - struct ucontext_ia32 *uc_link; - stack_t uc_stack; + unsigned int uc_flags; + unsigned int uc_link; + stack_ia32_t uc_stack; struct sigcontext_ia32 uc_mcontext; sigset_t uc_sigmask; /* mask last for extensibility */ }; @@ -276,7 +282,8 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; #define ELF_PLATFORM 0 #ifdef __KERNEL__ -#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) +# define SET_PERSONALITY(EX,IBCS2) \ + (current->personality = (IBCS2) ? PER_SVR4 : PER_LINUX) #endif #define IA32_EFLAG 0x200 @@ -342,8 +349,8 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; * IA32 floating point control registers starting values */ -#define IA32_FSR_DEFAULT 0x55550000 /* set all tag bits */ -#define IA32_FCR_DEFAULT 0x33f /* single precision, all masks */ +#define IA32_FSR_DEFAULT 0x55550000 /* set all tag bits */ +#define IA32_FCR_DEFAULT 0x17800000037fULL /* extended precision, all masks */ #define IA32_PTRACE_GETREGS 12 #define IA32_PTRACE_SETREGS 13 diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index 95934da1e..995c948ba 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h @@ -92,7 +92,7 @@ extern struct intr_routing_entry intr_routing[]; * } */ extern unsigned int iosapic_version(unsigned long); -extern void iosapic_init(unsigned long); +extern void iosapic_init(unsigned long, int); struct iosapic_vector { unsigned long iosapic_base; /* IOSAPIC Base address */ diff --git a/include/asm-ia64/offsets.h b/include/asm-ia64/offsets.h index de309ee56..25cf32c44 100644 --- a/include/asm-ia64/offsets.h +++ b/include/asm-ia64/offsets.h @@ -25,11 +25,95 @@ #define IA64_TASK_PID_OFFSET 188 /* 0xbc */ #define IA64_TASK_MM_OFFSET 88 /* 0x58 */ #define IA64_PT_REGS_CR_IPSR_OFFSET 0 /* 0x0 */ +#define IA64_PT_REGS_CR_IIP_OFFSET 8 /* 0x8 */ +#define IA64_PT_REGS_CR_IFS_OFFSET 16 /* 0x10 */ +#define IA64_PT_REGS_AR_UNAT_OFFSET 24 /* 0x18 */ +#define IA64_PT_REGS_AR_PFS_OFFSET 32 /* 0x20 */ +#define IA64_PT_REGS_AR_RSC_OFFSET 40 /* 0x28 */ +#define IA64_PT_REGS_AR_RNAT_OFFSET 48 /* 0x30 */ +#define IA64_PT_REGS_AR_BSPSTORE_OFFSET 56 /* 0x38 */ +#define IA64_PT_REGS_PR_OFFSET 64 /* 0x40 */ +#define IA64_PT_REGS_B6_OFFSET 72 /* 0x48 */ +#define IA64_PT_REGS_LOADRS_OFFSET 80 /* 0x50 */ +#define IA64_PT_REGS_R1_OFFSET 88 /* 0x58 */ +#define IA64_PT_REGS_R2_OFFSET 96 /* 0x60 */ +#define IA64_PT_REGS_R3_OFFSET 104 /* 0x68 */ #define IA64_PT_REGS_R12_OFFSET 112 /* 0x70 */ +#define IA64_PT_REGS_R13_OFFSET 120 /* 0x78 */ +#define IA64_PT_REGS_R14_OFFSET 128 /* 0x80 */ +#define IA64_PT_REGS_R15_OFFSET 136 /* 0x88 */ #define IA64_PT_REGS_R8_OFFSET 144 /* 0x90 */ +#define IA64_PT_REGS_R9_OFFSET 152 /* 0x98 */ +#define IA64_PT_REGS_R10_OFFSET 160 /* 0xa0 */ +#define IA64_PT_REGS_R11_OFFSET 168 /* 0xa8 */ #define IA64_PT_REGS_R16_OFFSET 176 /* 0xb0 */ -#define IA64_SWITCH_STACK_B0_OFFSET 464 /* 0x1d0 */ +#define IA64_PT_REGS_R17_OFFSET 184 /* 0xb8 */ +#define IA64_PT_REGS_R18_OFFSET 192 /* 0xc0 */ +#define IA64_PT_REGS_R19_OFFSET 200 /* 0xc8 */ +#define IA64_PT_REGS_R20_OFFSET 208 /* 0xd0 */ +#define IA64_PT_REGS_R21_OFFSET 216 /* 0xd8 */ +#define IA64_PT_REGS_R22_OFFSET 224 /* 0xe0 */ +#define IA64_PT_REGS_R23_OFFSET 232 /* 0xe8 */ +#define IA64_PT_REGS_R24_OFFSET 240 /* 0xf0 */ +#define IA64_PT_REGS_R25_OFFSET 248 /* 0xf8 */ +#define IA64_PT_REGS_R26_OFFSET 256 /* 0x100 */ +#define IA64_PT_REGS_R27_OFFSET 264 /* 0x108 */ +#define IA64_PT_REGS_R28_OFFSET 272 /* 0x110 */ +#define IA64_PT_REGS_R29_OFFSET 280 /* 0x118 */ +#define IA64_PT_REGS_R30_OFFSET 288 /* 0x120 */ +#define IA64_PT_REGS_R31_OFFSET 296 /* 0x128 */ +#define IA64_PT_REGS_AR_CCV_OFFSET 304 /* 0x130 */ +#define IA64_PT_REGS_AR_FPSR_OFFSET 312 /* 0x138 */ +#define IA64_PT_REGS_B0_OFFSET 320 /* 0x140 */ +#define IA64_PT_REGS_B7_OFFSET 328 /* 0x148 */ +#define IA64_PT_REGS_F6_OFFSET 336 /* 0x150 */ +#define IA64_PT_REGS_F7_OFFSET 352 /* 0x160 */ +#define IA64_PT_REGS_F8_OFFSET 368 /* 0x170 */ +#define IA64_PT_REGS_F9_OFFSET 384 /* 0x180 */ #define IA64_SWITCH_STACK_CALLER_UNAT_OFFSET 0 /* 0x0 */ +#define IA64_SWITCH_STACK_AR_FPSR_OFFSET 8 /* 0x8 */ +#define IA64_SWITCH_STACK_F2_OFFSET 16 /* 0x10 */ +#define IA64_SWITCH_STACK_F3_OFFSET 32 /* 0x20 */ +#define IA64_SWITCH_STACK_F4_OFFSET 48 /* 0x30 */ +#define IA64_SWITCH_STACK_F5_OFFSET 64 /* 0x40 */ +#define IA64_SWITCH_STACK_F10_OFFSET 80 /* 0x50 */ +#define IA64_SWITCH_STACK_F11_OFFSET 96 /* 0x60 */ +#define IA64_SWITCH_STACK_F12_OFFSET 112 /* 0x70 */ +#define IA64_SWITCH_STACK_F13_OFFSET 128 /* 0x80 */ +#define IA64_SWITCH_STACK_F14_OFFSET 144 /* 0x90 */ +#define IA64_SWITCH_STACK_F15_OFFSET 160 /* 0xa0 */ +#define IA64_SWITCH_STACK_F16_OFFSET 176 /* 0xb0 */ +#define IA64_SWITCH_STACK_F17_OFFSET 192 /* 0xc0 */ +#define IA64_SWITCH_STACK_F18_OFFSET 208 /* 0xd0 */ +#define IA64_SWITCH_STACK_F19_OFFSET 224 /* 0xe0 */ +#define IA64_SWITCH_STACK_F20_OFFSET 240 /* 0xf0 */ +#define IA64_SWITCH_STACK_F21_OFFSET 256 /* 0x100 */ +#define IA64_SWITCH_STACK_F22_OFFSET 272 /* 0x110 */ +#define IA64_SWITCH_STACK_F23_OFFSET 288 /* 0x120 */ +#define IA64_SWITCH_STACK_F24_OFFSET 304 /* 0x130 */ +#define IA64_SWITCH_STACK_F25_OFFSET 320 /* 0x140 */ +#define IA64_SWITCH_STACK_F26_OFFSET 336 /* 0x150 */ +#define IA64_SWITCH_STACK_F27_OFFSET 352 /* 0x160 */ +#define IA64_SWITCH_STACK_F28_OFFSET 368 /* 0x170 */ +#define IA64_SWITCH_STACK_F29_OFFSET 384 /* 0x180 */ +#define IA64_SWITCH_STACK_F30_OFFSET 400 /* 0x190 */ +#define IA64_SWITCH_STACK_F31_OFFSET 416 /* 0x1a0 */ +#define IA64_SWITCH_STACK_R4_OFFSET 432 /* 0x1b0 */ +#define IA64_SWITCH_STACK_R5_OFFSET 440 /* 0x1b8 */ +#define IA64_SWITCH_STACK_R6_OFFSET 448 /* 0x1c0 */ +#define IA64_SWITCH_STACK_R7_OFFSET 456 /* 0x1c8 */ +#define IA64_SWITCH_STACK_B0_OFFSET 464 /* 0x1d0 */ +#define IA64_SWITCH_STACK_B1_OFFSET 472 /* 0x1d8 */ +#define IA64_SWITCH_STACK_B2_OFFSET 480 /* 0x1e0 */ +#define IA64_SWITCH_STACK_B3_OFFSET 488 /* 0x1e8 */ +#define IA64_SWITCH_STACK_B4_OFFSET 496 /* 0x1f0 */ +#define IA64_SWITCH_STACK_B5_OFFSET 504 /* 0x1f8 */ +#define IA64_SWITCH_STACK_AR_PFS_OFFSET 512 /* 0x200 */ +#define IA64_SWITCH_STACK_AR_LC_OFFSET 520 /* 0x208 */ +#define IA64_SWITCH_STACK_AR_UNAT_OFFSET 528 /* 0x210 */ +#define IA64_SWITCH_STACK_AR_RNAT_OFFSET 536 /* 0x218 */ +#define IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET 544 /* 0x220 */ +#define IA64_SWITCH_STACK_PR_OFFSET 464 /* 0x1d0 */ #define IA64_SIGCONTEXT_AR_BSP_OFFSET 72 /* 0x48 */ #define IA64_SIGCONTEXT_AR_RNAT_OFFSET 80 /* 0x50 */ #define IA64_SIGCONTEXT_FLAGS_OFFSET 0 /* 0x0 */ diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 648ff8a12..445e42376 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h @@ -127,6 +127,12 @@ typedef union ia64_va { #define __pa(x) ({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;}) #define __va(x) ({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;}) +#define REGION_NUMBER(x) ({ia64_va _v; _v.l = (long) (x); _v.f.reg;}) +#define REGION_OFFSET(x) ({ia64_va _v; _v.l = (long) (x); _v.f.off;}) + +#define REGION_SIZE REGION_NUMBER(1) +#define REGION_KERNEL 7 + #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0) #define PAGE_BUG(page) do { BUG(); } while (0) diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index afae33050..5169b3f82 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h @@ -4,11 +4,12 @@ /* * Processor Abstraction Layer definitions. * - * This is based on version 2.4 of the manual "Enhanced Mode Processor - * Abstraction Layer". + * This is based on Intel IA-64 Architecture Software Developer's Manual rev 1.0 + * chapter 11 IA-64 Processor Abstraction Layer * * Copyright (C) 1998-2000 Hewlett-Packard Co * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com> + * Copyright (C) 2000 Stephane Eranian <eranian@hpl.hp.com> * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com> @@ -16,6 +17,8 @@ * 99/10/01 davidm Make sure we pass zero for reserved parameters. * 00/03/07 davidm Updated pal_cache_flush() to be in sync with PAL v2.6. * 00/03/23 cfleck Modified processor min-state save area to match updated PAL & SAL info + * 00/05/24 eranian Updated to latest PAL spec, fix structures bugs, added + * 00/05/25 eranian Support for stack calls, and statis physical calls */ /* @@ -127,8 +130,8 @@ typedef struct pal_freq_ratio { typedef union pal_cache_config_info_1_s { struct { u64 u : 1, /* 0 Unified cache ? */ - reserved : 5, /* 7-3 Reserved */ at : 2, /* 2-1 Cache mem attr*/ + reserved : 5, /* 7-3 Reserved */ associativity : 8, /* 16-8 Associativity*/ line_size : 8, /* 23-17 Line size */ stride : 8, /* 31-24 Stride */ @@ -164,8 +167,8 @@ typedef struct pal_cache_config_info_s { u64 pcci_reserved; } pal_cache_config_info_t; -#define pcci_ld_hint pcci_info_1.pcci1.load_hints -#define pcci_st_hint pcci_info_1.pcci1_bits.store_hints +#define pcci_ld_hints pcci_info_1.pcci1_bits.load_hints +#define pcci_st_hints pcci_info_1.pcci1_bits.store_hints #define pcci_ld_latency pcci_info_1.pcci1_bits.load_latency #define pcci_st_latency pcci_info_1.pcci1_bits.store_latency #define pcci_stride pcci_info_1.pcci1_bits.stride @@ -640,23 +643,13 @@ struct ia64_pal_retval { * (generally 0) MUST be passed. Reserved parameters are not optional * parameters. */ -#ifdef __GCC_MULTIREG_RETVALS__ - extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64); - /* - * If multi-register return values are returned according to the - * ia-64 calling convention, we can call ia64_pal_call_static - * directly. - */ -# define PAL_CALL(iprv,a0,a1,a2,a3) iprv = ia64_pal_call_static(a0,a1, a2, a3) -#else - extern void ia64_pal_call_static (struct ia64_pal_retval *, u64, u64, u64, u64); - /* - * If multi-register return values are returned through an aggregate - * allocated in the caller, we need to use the stub implemented in - * sal-stub.S. - */ -# define PAL_CALL(iprv,a0,a1,a2,a3) ia64_pal_call_static(&iprv, a0, a1, a2, a3) -#endif +extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64); +extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64); +extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64); + +#define PAL_CALL(iprv,a0,a1,a2,a3) iprv = ia64_pal_call_static(a0, a1, a2, a3) +#define PAL_CALL_STK(iprv,a0,a1,a2,a3) iprv = ia64_pal_call_stacked(a0, a1, a2, a3) +#define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) iprv = ia64_pal_call_phys_static(a0, a1, a2, a3) typedef int (*ia64_pal_handler) (u64, ...); extern ia64_pal_handler ia64_pal; @@ -716,7 +709,7 @@ ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail, pal_bus_features_u_t *features_control) { struct ia64_pal_retval iprv; - PAL_CALL(iprv, PAL_BUS_GET_FEATURES, 0, 0, 0); + PAL_CALL_PHYS(iprv, PAL_BUS_GET_FEATURES, 0, 0, 0); if (features_avail) features_avail->pal_bus_features_val = iprv.v0; if (features_status) @@ -725,15 +718,54 @@ ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail, features_control->pal_bus_features_val = iprv.v2; return iprv.status; } + /* Enables/disables specific processor bus features */ extern inline s64 ia64_pal_bus_set_features (pal_bus_features_u_t feature_select) { struct ia64_pal_retval iprv; - PAL_CALL(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0); + PAL_CALL_PHYS(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0); return iprv.status; } +/* Get detailed cache information */ +extern inline s64 +ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_info_t *conf) +{ + struct ia64_pal_retval iprv; + + PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0); + + if (iprv.status == 0) { + conf->pcci_status = iprv.status; + conf->pcci_info_1.pcci1_data = iprv.v0; + conf->pcci_info_2.pcci2_data = iprv.v1; + conf->pcci_reserved = iprv.v2; + } + return iprv.status; + +} + +/* Get detailed cche protection information */ +extern inline s64 +ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_info_t *prot) +{ + struct ia64_pal_retval iprv; + + PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0); + + if (iprv.status == 0) { + prot->pcpi_status = iprv.status; + prot->pcp_info[0].pcpi_data = iprv.v0 & 0xffffffff; + prot->pcp_info[1].pcpi_data = iprv.v0 >> 32; + prot->pcp_info[2].pcpi_data = iprv.v1 & 0xffffffff; + prot->pcp_info[3].pcpi_data = iprv.v1 >> 32; + prot->pcp_info[4].pcpi_data = iprv.v2 & 0xffffffff; + prot->pcp_info[5].pcpi_data = iprv.v2 >> 32; + } + return iprv.status; +} + /* * Flush the processor instruction or data caches. *PROGRESS must be * initialized to zero before calling this for the first time.. @@ -909,16 +941,19 @@ typedef union pal_power_mgmt_info_u { struct { u64 exit_latency : 16, entry_latency : 16, - power_consumption : 32; + power_consumption : 28, + im : 1, + co : 1, + reserved : 2; } pal_power_mgmt_info_s; } pal_power_mgmt_info_u_t; /* Return information about processor's optional power management capabilities. */ extern inline s64 ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf) -{ +{ struct ia64_pal_retval iprv; - PAL_CALL(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0); + PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0); return iprv.status; } @@ -1027,7 +1062,7 @@ ia64_pal_mem_attrib (u64 *mem_attrib) struct ia64_pal_retval iprv; PAL_CALL(iprv, PAL_MEM_ATTRIB, 0, 0, 0); if (mem_attrib) - *mem_attrib = iprv.v0; + *mem_attrib = iprv.v0 & 0xff; return iprv.status; } @@ -1090,28 +1125,32 @@ ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr) return iprv.status; } -#ifdef TBD struct pal_features_s; /* Provide information about configurable processor features */ extern inline s64 -ia64_pal_proc_get_features (struct pal_features_s *features_avail, - struct pal_features_s *features_status, - struct pal_features_s *features_control) +ia64_pal_proc_get_features (u64 *features_avail, + u64 *features_status, + u64 *features_control) { struct ia64_pal_retval iprv; - PAL_CALL(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0); + PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0); + if (iprv.status == 0) { + *features_avail = iprv.v0; + *features_status = iprv.v1; + *features_control = iprv.v2; + } return iprv.status; } + /* Enable/disable processor dependent features */ extern inline s64 -ia64_pal_proc_set_features (feature_select) +ia64_pal_proc_set_features (u64 feature_select) { struct ia64_pal_retval iprv; - PAL_CALL(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0); + PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0); return iprv.status; } -#endif /* * Put everything in a struct so we avoid the global offset table whenever * possible. @@ -1220,12 +1259,16 @@ typedef union pal_version_u { /* Return PAL version information */ extern inline s64 -ia64_pal_version (pal_version_u_t *pal_version) +ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version) { struct ia64_pal_retval iprv; PAL_CALL(iprv, PAL_VERSION, 0, 0, 0); - if (pal_version) - pal_version->pal_version_val = iprv.v0; + if (pal_min_version) + pal_min_version->pal_version_val = iprv.v0; + + if (pal_cur_version) + pal_cur_version->pal_version_val = iprv.v1; + return iprv.status; } @@ -1242,7 +1285,14 @@ typedef union pal_tc_info_u { } pal_tc_info_s; } pal_tc_info_u_t; - +#define tc_reduce_tr pal_tc_info_s.reduce_tr +#define tc_unified pal_tc_info_s.unified +#define tc_pf pal_tc_info_s.pf +#define tc_num_entries pal_tc_info_s.num_entries +#define tc_associativity pal_tc_info_s.associativity +#define tc_num_sets pal_tc_info_s.num_sets + + /* Return information about the virtual memory characteristics of the processor * implementation. */ @@ -1278,7 +1328,7 @@ typedef union pal_vm_info_1_u { struct { u64 vw : 1, phys_add_size : 7, - key_size : 16, + key_size : 8, max_pkr : 8, hash_tag_id : 8, max_dtr_entry : 8, diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index bbabe63e8..0c40b0e6b 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h @@ -16,6 +16,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* * Dynamic DMA mapping API. * IA-64 has everything mapped statically. diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index a7f5ceb56..ce0dea3fe 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h @@ -12,27 +12,18 @@ * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com> */ -#include <linux/config.h> - #include <asm/mman.h> #include <asm/page.h> +#include <asm/processor.h> #include <asm/types.h> -/* Size of virtuaql and physical address spaces: */ -#ifdef CONFIG_ITANIUM -# define IA64_IMPL_VA_MSB 50 -# define IA64_PHYS_BITS 44 /* Itanium PRM defines 44 bits of ppn */ -#else -# define IA64_IMPL_VA_MSB 60 /* maximum value (bits 61-63 are region bits) */ -# define IA64_PHYS_BITS 50 /* EAS2.6 allows up to 50 bits of ppn */ -#endif -#define IA64_PHYS_SIZE (__IA64_UL(1) << IA64_PHYS_BITS) +#define IA64_MAX_PHYS_BITS 50 /* max. number of physical address bits (architected) */ /* Is ADDR a valid kernel address? */ #define kern_addr_valid(addr) ((addr) >= TASK_SIZE) /* Is ADDR a valid physical address? */ -#define phys_addr_valid(addr) ((addr) < IA64_PHYS_SIZE) +#define phys_addr_valid(addr) (((addr) & my_cpu_data.unimpl_pa_mask) == 0) /* * First, define the various bits in a PTE. Note that the PTE format @@ -63,7 +54,7 @@ #define _PAGE_AR_SHIFT 9 #define _PAGE_A (1 << 5) /* page accessed bit */ #define _PAGE_D (1 << 6) /* page dirty bit */ -#define _PAGE_PPN_MASK ((IA64_PHYS_SIZE - 1) & ~0xfffUL) +#define _PAGE_PPN_MASK (((__IA64_UL(1) << IA64_MAX_PHYS_BITS) - 1) & ~0xfffUL) #define _PAGE_ED (__IA64_UL(1) << 52) /* exception deferral */ #define _PAGE_PROTNONE (__IA64_UL(1) << 63) @@ -120,7 +111,6 @@ #include <asm/bitops.h> #include <asm/mmu_context.h> -#include <asm/processor.h> #include <asm/system.h> /* @@ -133,7 +123,7 @@ #define PAGE_READONLY __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_R) #define PAGE_COPY __pgprot(__ACCESS_BITS | _PAGE_PL_3 | _PAGE_AR_RX) #define PAGE_GATE __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_X_RX) -#define PAGE_KERNEL __pgprot(__DIRTY_BITS | _PAGE_PL_0 | _PAGE_AR_RW) +#define PAGE_KERNEL __pgprot(__DIRTY_BITS | _PAGE_PL_0 | _PAGE_AR_RWX) /* * Next come the mappings that determine how mmap() protection bits diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index d702b7f0c..fa3721bde 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h @@ -10,6 +10,7 @@ * * 11/24/98 S.Eranian added ia64_set_iva() * 12/03/99 D. Mosberger implement thread_saved_pc() via kernel unwind API + * 06/16/00 A. Mallick added csd/ssd/tssd for ia32 support */ #include <linux/config.h> @@ -237,6 +238,8 @@ struct cpuinfo_ia64 { __u64 proc_freq; /* frequency of processor */ __u64 cyc_per_usec; /* itc_freq/1000000 */ __u64 usec_per_cyc; /* 2^IA64_USEC_PER_CYC_SHIFT*1000000/itc_freq */ + __u64 unimpl_va_mask; /* mask of unimplemented virtual address bits (from PAL) */ + __u64 unimpl_pa_mask; /* mask of unimplemented physical address bits (from PAL) */ #ifdef CONFIG_SMP __u64 loops_per_sec; __u64 ipi_count; @@ -264,7 +267,8 @@ typedef struct { #define SET_UNALIGN_CTL(task,value) \ ({ \ - (task)->thread.flags |= ((value) << IA64_THREAD_UAC_SHIFT) & IA64_THREAD_UAC_MASK; \ + (task)->thread.flags = (((task)->thread.flags & ~IA64_THREAD_UAC_MASK) \ + | (((value) << IA64_THREAD_UAC_SHIFT) & IA64_THREAD_UAC_MASK)); \ 0; \ }) #define GET_UNALIGN_CTL(task,addr) \ @@ -288,10 +292,13 @@ struct thread_struct { __u64 fcr; /* IA32 floating pt control reg */ __u64 fir; /* IA32 fp except. instr. reg */ __u64 fdr; /* IA32 fp except. data reg */ + __u64 csd; /* IA32 code selector descriptor */ + __u64 ssd; /* IA32 stack selector descriptor */ + __u64 tssd; /* IA32 TSS descriptor */ union { __u64 sigmask; /* aligned mask for sigsuspend scall */ } un; -# define INIT_THREAD_IA32 , 0, 0, 0, 0, 0, {0} +# define INIT_THREAD_IA32 , 0, 0, 0x17800000037fULL, 0, 0, 0, 0, 0, {0} #else # define INIT_THREAD_IA32 #endif /* CONFIG_IA32_SUPPORT */ @@ -318,6 +325,7 @@ struct thread_struct { set_fs(USER_DS); \ ia64_psr(regs)->cpl = 3; /* set user mode */ \ ia64_psr(regs)->ri = 0; /* clear return slot number */ \ + ia64_psr(regs)->is = 0; /* IA-64 instruction set */ \ regs->cr_iip = new_ip; \ regs->ar_rsc = 0xf; /* eager mode, privilege level 3 */ \ regs->r12 = new_sp - 16; /* allocate 16 byte scratch area */ \ @@ -436,6 +444,14 @@ ia64_srlz_d (void) __asm__ __volatile__ (";; srlz.d" ::: "memory"); } +extern inline __u64 +ia64_get_rr (__u64 reg_bits) +{ + __u64 r; + __asm__ __volatile__ ("mov %0=rr[%1]" : "=r"(r) : "r"(reg_bits) : "memory"); + return r; +} + extern inline void ia64_set_rr (__u64 reg_bits, __u64 rr_val) { @@ -645,14 +661,17 @@ ia64_set_unat (__u64 *unat, void *spill_addr, unsigned long nat) extern inline unsigned long thread_saved_pc (struct thread_struct *t) { - struct ia64_frame_info info; + struct unw_frame_info info; + unsigned long ip; + /* XXX ouch: Linus, please pass the task pointer to thread_saved_pc() instead! */ struct task_struct *p = (void *) ((unsigned long) t - IA64_TASK_THREAD_OFFSET); - ia64_unwind_init_from_blocked_task(&info, p); - if (ia64_unwind_to_previous_frame(&info) < 0) + unw_init_from_blocked_task(&info, p); + if (unw_unwind(&info) < 0) return 0; - return ia64_unwind_get_ip(&info); + unw_get_ip(&info, &ip); + return ip; } /* diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index caae43a3d..b71acee5f 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h @@ -136,8 +136,8 @@ struct pt_regs { unsigned long r30; /* scratch */ unsigned long r31; /* scratch */ - unsigned long ar_ccv; /* compare/exchange value */ - unsigned long ar_fpsr; /* floating point status*/ + unsigned long ar_ccv; /* compare/exchange value (scratch) */ + unsigned long ar_fpsr; /* floating point status (preserved) */ unsigned long b0; /* return pointer (bp) */ unsigned long b7; /* scratch */ @@ -219,11 +219,19 @@ struct switch_stack { extern void show_regs (struct pt_regs *); extern long ia64_peek (struct pt_regs *, struct task_struct *, unsigned long addr, long *val); extern long ia64_poke (struct pt_regs *, struct task_struct *, unsigned long addr, long val); + extern void ia64_sync_fph (struct task_struct *t); +#ifdef CONFIG_IA64_NEW_UNWIND + /* get nat bits for scratch registers such that bit N==1 iff scratch register rN is a NaT */ + extern unsigned long ia64_get_scratch_nat_bits (struct pt_regs *pt, unsigned long scratch_unat); + /* put nat bits for scratch registers such that scratch register rN is a NaT iff bit N==1 */ + extern unsigned long ia64_put_scratch_nat_bits (struct pt_regs *pt, unsigned long nat); +#else /* get nat bits for r1-r31 such that bit N==1 iff rN is a NaT */ extern long ia64_get_nat_bits (struct pt_regs *pt, struct switch_stack *sw); /* put nat bits for r1-r31 such that rN is a NaT iff bit N==1 */ extern void ia64_put_nat_bits (struct pt_regs *pt, struct switch_stack *sw, unsigned long nat); +#endif extern void ia64_increment_ip (struct pt_regs *pt); extern void ia64_decrement_ip (struct pt_regs *pt); diff --git a/include/asm-ia64/ptrace_offsets.h b/include/asm-ia64/ptrace_offsets.h index fbbe9bff4..b32b6c89d 100644 --- a/include/asm-ia64/ptrace_offsets.h +++ b/include/asm-ia64/ptrace_offsets.h @@ -118,8 +118,8 @@ #define PT_F126 0x05e0 #define PT_F127 0x05f0 /* switch stack: */ -#define PT_CALLER_UNAT 0x0600 -#define PT_KERNEL_FPSR 0x0608 +#define PT_NAT_BITS 0x0600 + #define PT_F2 0x0610 #define PT_F3 0x0620 #define PT_F4 0x0630 @@ -150,23 +150,19 @@ #define PT_R5 0x07b8 #define PT_R6 0x07c0 #define PT_R7 0x07c8 -#define PT_K_B0 0x07d0 + #define PT_B1 0x07d8 #define PT_B2 0x07e0 #define PT_B3 0x07e8 #define PT_B4 0x07f0 #define PT_B5 0x07f8 -#define PT_K_AR_PFS 0x0800 + #define PT_AR_LC 0x0808 -#define PT_K_AR_UNAT 0x0810 -#define PT_K_AR_RNAT 0x0818 -#define PT_K_AR_BSPSTORE 0x0820 -#define PT_K_PR 0x0828 + /* pt_regs */ #define PT_CR_IPSR 0x0830 #define PT_CR_IIP 0x0838 #define PT_CFM 0x0840 -#define PT_CR_IFS PT_CFM /* Use of PT_CR_IFS is deprecated */ #define PT_AR_UNAT 0x0848 #define PT_AR_PFS 0x0850 #define PT_AR_RSC 0x0858 diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h index 5fadec55f..06096644b 100644 --- a/include/asm-ia64/sal.h +++ b/include/asm-ia64/sal.h @@ -23,17 +23,7 @@ extern spinlock_t sal_lock; -#ifdef __GCC_MULTIREG_RETVALS__ - /* If multi-register return values are returned according to the - ia-64 calling convention, we can call ia64_sal directly. */ -# define __SAL_CALL(result,args...) result = (*ia64_sal)(args) -#else - /* If multi-register return values are returned through an aggregate - allocated in the caller, we need to use the stub implemented in - sal-stub.S. */ - extern struct ia64_sal_retval ia64_sal_stub (u64 index, ...); -# define __SAL_CALL(result,args...) result = ia64_sal_stub(args) -#endif +#define __SAL_CALL(result,args...) result = (*ia64_sal)(args) #ifdef CONFIG_SMP # define SAL_CALL(result,args...) do { \ @@ -494,7 +484,19 @@ extern inline s64 ia64_sal_pci_config_read (u64 pci_config_addr, u64 size, u64 *value) { struct ia64_sal_retval isrv; +#ifdef CONFIG_ITANIUM_A1_SPECIFIC + extern spinlock_t ivr_read_lock; + unsigned long flags; + + /* + * Avoid PCI configuration read/write overwrite -- A0 Interrupt loss workaround + */ + spin_lock_irqsave(&ivr_read_lock, flags); +#endif SAL_CALL(isrv, SAL_PCI_CONFIG_READ, pci_config_addr, size); +#ifdef CONFIG_ITANIUM_A1_SPECIFIC + spin_unlock_irqrestore(&ivr_read_lock, flags); +#endif if (value) *value = isrv.v0; return isrv.status; @@ -505,7 +507,7 @@ extern inline s64 ia64_sal_pci_config_write (u64 pci_config_addr, u64 size, u64 value) { struct ia64_sal_retval isrv; -#if defined(CONFIG_ITANIUM_ASTEP_SPECIFIC) && !defined(SAPIC_FIXED) +#ifdef CONFIG_ITANIUM_A1_SPECIFIC extern spinlock_t ivr_read_lock; unsigned long flags; @@ -515,7 +517,7 @@ ia64_sal_pci_config_write (u64 pci_config_addr, u64 size, u64 value) spin_lock_irqsave(&ivr_read_lock, flags); #endif SAL_CALL(isrv, SAL_PCI_CONFIG_WRITE, pci_config_addr, size, value); -#if defined(CONFIG_ITANIUM_ASTEP_SPECIFIC) && !defined(SAPIC_FIXED) +#ifdef CONFIG_ITANIUM_A1_SPECIFIC spin_unlock_irqrestore(&ivr_read_lock, flags); #endif return isrv.status; diff --git a/include/asm-ia64/siginfo.h b/include/asm-ia64/siginfo.h index f997b468d..7222fb285 100644 --- a/include/asm-ia64/siginfo.h +++ b/include/asm-ia64/siginfo.h @@ -56,6 +56,8 @@ typedef struct siginfo { struct { void *_addr; /* faulting insn/memory ref. */ int _imm; /* immediate value for "break" */ + int _pad0; + unsigned long _isr; /* isr */ } _sigfault; /* SIGPOLL */ @@ -79,6 +81,7 @@ typedef struct siginfo { #define si_ptr _sifields._rt._sigval.sival_ptr #define si_addr _sifields._sigfault._addr #define si_imm _sifields._sigfault._imm /* as per UNIX SysV ABI spec */ +#define si_isr _sifields._sigfault._isr /* valid if si_code==FPE_FLTxxx */ #define si_band _sifields._sigpoll._band #define si_fd _sifields._sigpoll._fd diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h index 97a9511e8..fedd8f8c6 100644 --- a/include/asm-ia64/spinlock.h +++ b/include/asm-ia64/spinlock.h @@ -9,6 +9,8 @@ * This file is used for SMP configurations only. */ +#include <linux/kernel.h> + #include <asm/system.h> #include <asm/bitops.h> #include <asm/atomic.h> @@ -40,7 +42,7 @@ typedef struct { "cmp4.eq p0,p7 = r0, r2\n" \ "(p7) br.cond.spnt.few 1b\n" \ ";;\n" \ - :: "m" __atomic_fool_gcc((x)) : "r2", "r29") + :: "m" __atomic_fool_gcc((x)) : "r2", "r29", "memory") #else #define spin_lock(x) \ @@ -55,22 +57,12 @@ typedef struct { #define spin_is_locked(x) ((x)->lock != 0) -#define spin_unlock(x) (((spinlock_t *) x)->lock = 0) +#define spin_unlock(x) ({((spinlock_t *) x)->lock = 0; barrier();}) /* Streamlined !test_and_set_bit(0, (x)) */ -#define spin_trylock(x) \ -({ \ - spinlock_t *__x = (x); \ - __u32 old; \ - \ - do { \ - old = __x->lock; \ - } while (cmpxchg_acq(&__x->lock, old, 1) != old); \ - old == 0; \ -}) - -#define spin_unlock_wait(x) \ - ({ do { barrier(); } while(((volatile spinlock_t *)x)->lock); }) +#define spin_trylock(x) (cmpxchg_acq(&(x)->lock, 0, 1) == 0) + +#define spin_unlock_wait(x) ({ do { barrier(); } while ((x)->lock); }) typedef struct { volatile int read_counter:31; @@ -78,45 +70,49 @@ typedef struct { } rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0 } -#define read_lock(rw) \ -do { \ - int tmp = 0; \ - __asm__ __volatile__ ("1:\tfetchadd4.acq %0 = %1, 1\n" \ - ";;\n" \ - "tbit.nz p6,p0 = %0, 31\n" \ - "(p6) br.cond.sptk.few 2f\n" \ - ".section .text.lock,\"ax\"\n" \ - "2:\tfetchadd4.rel %0 = %1, -1\n" \ - ";;\n" \ - "3:\tld4.acq %0 = %1\n" \ - ";;\n" \ - "tbit.nz p6,p0 = %0, 31\n" \ - "(p6) br.cond.sptk.few 3b\n" \ - "br.cond.sptk.few 1b\n" \ - ";;\n" \ - ".previous\n": "=r" (tmp), "=m" (__atomic_fool_gcc(rw))); \ +#define read_lock(rw) \ +do { \ + int tmp = 0; \ + __asm__ __volatile__ ("1:\tfetchadd4.acq %0 = %1, 1\n" \ + ";;\n" \ + "tbit.nz p6,p0 = %0, 31\n" \ + "(p6) br.cond.sptk.few 2f\n" \ + ".section .text.lock,\"ax\"\n" \ + "2:\tfetchadd4.rel %0 = %1, -1\n" \ + ";;\n" \ + "3:\tld4.acq %0 = %1\n" \ + ";;\n" \ + "tbit.nz p6,p0 = %0, 31\n" \ + "(p6) br.cond.sptk.few 3b\n" \ + "br.cond.sptk.few 1b\n" \ + ";;\n" \ + ".previous\n" \ + : "=r" (tmp), "=m" (__atomic_fool_gcc(rw)) \ + :: "memory"); \ } while(0) -#define read_unlock(rw) \ -do { \ - int tmp = 0; \ - __asm__ __volatile__ ("fetchadd4.rel %0 = %1, -1\n" \ - : "=r" (tmp) : "m" (__atomic_fool_gcc(rw))); \ +#define read_unlock(rw) \ +do { \ + int tmp = 0; \ + __asm__ __volatile__ ("fetchadd4.rel %0 = %1, -1\n" \ + : "=r" (tmp) \ + : "m" (__atomic_fool_gcc(rw)) \ + : "memory"); \ } while(0) #define write_lock(rw) \ -while(1) { \ +do { \ do { \ - } while (!test_and_set_bit(31, (rw))); \ - if ((rw)->read_counter) { \ - clear_bit(31, (rw)); \ - while ((rw)->read_counter) \ - ; \ - } else { \ - break; \ - } \ -} + while ((rw)->write_lock); \ + } while (test_and_set_bit(31, (rw))); \ + while ((rw)->read_counter); \ + barrier(); \ +} while (0) -#define write_unlock(x) (clear_bit(31, (x))) +/* + * clear_bit() has "acq" semantics; we're really need "rel" semantics, + * but for simplicity, we simply do a fence for now... + */ +#define write_unlock(x) ({clear_bit(31, (x)); mb();}) #endif /* _ASM_IA64_SPINLOCK_H */ diff --git a/include/asm-ia64/stat.h b/include/asm-ia64/stat.h index c261a337e..b9dd64bd5 100644 --- a/include/asm-ia64/stat.h +++ b/include/asm-ia64/stat.h @@ -7,6 +7,27 @@ */ struct stat { + unsigned long st_dev; + unsigned long st_ino; + unsigned long st_nlink; + unsigned int st_mode; + unsigned int st_uid; + unsigned int st_gid; + unsigned int __pad0; + unsigned long st_rdev; + unsigned long st_size; + unsigned long st_atime; + unsigned long __reserved0; /* reserved for atime.nanoseconds */ + unsigned long st_mtime; + unsigned long __reserved1; /* reserved for mtime.nanoseconds */ + unsigned long st_ctime; + unsigned long __reserved2; /* reserved for ctime.nanoseconds */ + unsigned long st_blksize; + long st_blocks; + unsigned long __unused[3]; +}; + +struct ia64_oldstat { unsigned int st_dev; unsigned int st_ino; unsigned int st_mode; diff --git a/include/asm-ia64/string.h b/include/asm-ia64/string.h index 09a99daf4..2b7292067 100644 --- a/include/asm-ia64/string.h +++ b/include/asm-ia64/string.h @@ -12,4 +12,7 @@ #define __HAVE_ARCH_STRLEN 1 /* see arch/ia64/lib/strlen.S */ #define __HAVE_ARCH_MEMSET 1 /* see arch/ia64/lib/memset.S */ +extern __kernel_size_t strlen (const char *); +extern void *memset (void *,int,__kernel_size_t); + #endif /* _ASM_IA64_STRING_H */ diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index a7ba6daf7..689be6df6 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h @@ -33,9 +33,9 @@ struct pci_vector_struct { __u16 bus; /* PCI Bus number */ - __u32 pci_id; /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */ - __u8 pin; /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */ - __u8 irq; /* IRQ assigned */ + __u32 pci_id; /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */ + __u8 pin; /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */ + __u8 irq; /* IRQ assigned */ }; extern struct ia64_boot_param { @@ -54,6 +54,8 @@ extern struct ia64_boot_param { __u16 num_pci_vectors; /* number of ACPI derived PCI IRQ's*/ __u64 pci_vectors; /* physical address of PCI data (pci_vector_struct)*/ __u64 fpswa; /* physical address of the the fpswa interface */ + __u64 initrd_start; + __u64 initrd_size; } ia64_boot_param; extern inline void @@ -135,7 +137,7 @@ do { \ do { \ unsigned long ip, old_psr, psr = (x); \ \ - __asm__ __volatile__ ("mov %0=psr; mov psr.l=%1;; srlz.d" \ + __asm__ __volatile__ (";;mov %0=psr; mov psr.l=%1;; srlz.d" \ : "=&r" (old_psr) : "r" (psr) : "memory"); \ if ((old_psr & (1UL << 14)) && !(psr & (1UL << 14))) { \ __asm__ ("mov %0=ip" : "=r"(ip)); \ @@ -149,7 +151,7 @@ do { \ : "=r" (x) :: "memory") # define local_irq_disable() __asm__ __volatile__ (";; rsm psr.i;;" ::: "memory") /* (potentially) setting psr.i requires data serialization: */ -# define local_irq_restore(x) __asm__ __volatile__ ("mov psr.l=%0;; srlz.d" \ +# define local_irq_restore(x) __asm__ __volatile__ (";; mov psr.l=%0;; srlz.d" \ :: "r" (x) : "memory") #endif /* !CONFIG_IA64_DEBUG_IRQ */ @@ -394,32 +396,13 @@ struct __xchg_dummy { unsigned long a[100]; }; #ifdef __KERNEL__ -extern void ia64_save_debug_regs (unsigned long *save_area); -extern void ia64_load_debug_regs (unsigned long *save_area); - #define prepare_to_switch() do { } while(0) #ifdef CONFIG_IA32_SUPPORT # define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0) -# define IA32_STATE(prev,next) \ - if (IS_IA32_PROCESS(ia64_task_regs(prev))) { \ - __asm__ __volatile__("mov %0=ar.eflag":"=r"((prev)->thread.eflag)); \ - __asm__ __volatile__("mov %0=ar.fsr":"=r"((prev)->thread.fsr)); \ - __asm__ __volatile__("mov %0=ar.fcr":"=r"((prev)->thread.fcr)); \ - __asm__ __volatile__("mov %0=ar.fir":"=r"((prev)->thread.fir)); \ - __asm__ __volatile__("mov %0=ar.fdr":"=r"((prev)->thread.fdr)); \ - } \ - if (IS_IA32_PROCESS(ia64_task_regs(next))) { \ - __asm__ __volatile__("mov ar.eflag=%0"::"r"((next)->thread.eflag)); \ - __asm__ __volatile__("mov ar.fsr=%0"::"r"((next)->thread.fsr)); \ - __asm__ __volatile__("mov ar.fcr=%0"::"r"((next)->thread.fcr)); \ - __asm__ __volatile__("mov ar.fir=%0"::"r"((next)->thread.fir)); \ - __asm__ __volatile__("mov ar.fdr=%0"::"r"((next)->thread.fdr)); \ - } -#else /* !CONFIG_IA32_SUPPORT */ -# define IA32_STATE(prev,next) +#else # define IS_IA32_PROCESS(regs) 0 -#endif /* CONFIG_IA32_SUPPORT */ +#endif /* * Context switch from one thread to another. If the two threads have @@ -432,15 +415,18 @@ extern void ia64_load_debug_regs (unsigned long *save_area); * ia64_ret_from_syscall_clear_r8. */ extern struct task_struct *ia64_switch_to (void *next_task); + +extern void ia64_save_extra (struct task_struct *task); +extern void ia64_load_extra (struct task_struct *task); + #define __switch_to(prev,next,last) do { \ + if (((prev)->thread.flags & IA64_THREAD_DBG_VALID) \ + || IS_IA32_PROCESS(ia64_task_regs(prev))) \ + ia64_save_extra(prev); \ + if (((next)->thread.flags & IA64_THREAD_DBG_VALID) \ + || IS_IA32_PROCESS(ia64_task_regs(next))) \ + ia64_load_extra(next); \ ia64_psr(ia64_task_regs(next))->dfh = (ia64_get_fpu_owner() != (next)); \ - if ((prev)->thread.flags & IA64_THREAD_DBG_VALID) { \ - ia64_save_debug_regs(&(prev)->thread.dbr[0]); \ - } \ - if ((next)->thread.flags & IA64_THREAD_DBG_VALID) { \ - ia64_load_debug_regs(&(next)->thread.dbr[0]); \ - } \ - IA32_STATE(prev,next); \ (last) = ia64_switch_to((next)); \ } while (0) diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 5be533112..41ffaaf2d 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h @@ -109,9 +109,9 @@ #define __NR_syslog 1117 #define __NR_setitimer 1118 #define __NR_getitimer 1119 -#define __NR_stat 1120 -#define __NR_lstat 1121 -#define __NR_fstat 1122 +#define __NR_old_stat 1120 +#define __NR_old_lstat 1121 +#define __NR_old_fstat 1122 #define __NR_vhangup 1123 #define __NR_lchown 1124 #define __NR_vm86 1125 @@ -199,6 +199,9 @@ #define __NR_sys_pivot_root 1207 #define __NR_mincore 1208 #define __NR_madvise 1209 +#define __NR_stat 1210 +#define __NR_lstat 1211 +#define __NR_fstat 1212 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) @@ -269,7 +272,7 @@ type \ name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ { \ return __ia64_syscall((long) arg1, (long) arg2, (long) arg3, \ - (long) arg4, (long), __NR_##name); \ + (long) arg4, (long) arg5, __NR_##name); \ } #ifdef __KERNEL_SYSCALLS__ diff --git a/include/asm-ia64/unwind.h b/include/asm-ia64/unwind.h index 038edb798..60bb46cf9 100644 --- a/include/asm-ia64/unwind.h +++ b/include/asm-ia64/unwind.h @@ -2,8 +2,8 @@ #define _ASM_IA64_UNWIND_H /* - * Copyright (C) 1999 Hewlett-Packard Co - * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com> + * Copyright (C) 1999-2000 Hewlett-Packard Co + * Copyright (C) 1999-2000 David Mosberger-Tang <davidm@hpl.hp.com> * * A simple API for unwinding kernel stacks. This is used for * debugging and error reporting purposes. The kernel doesn't need @@ -16,27 +16,72 @@ struct task_struct; /* forward declaration */ struct switch_stack; /* forward declaration */ +enum unw_application_register { + UNW_AR_BSP, + UNW_AR_BSPSTORE, + UNW_AR_PFS, + UNW_AR_RNAT, + UNW_AR_UNAT, + UNW_AR_LC, + UNW_AR_EC, + UNW_AR_FPSR, + UNW_AR_RSC, + UNW_AR_CCV +}; + /* * The following declarations are private to the unwind * implementation: */ -struct ia64_stack { - unsigned long *limit; - unsigned long *top; +struct unw_stack { + unsigned long limit; + unsigned long top; }; +#define UNW_FLAG_INTERRUPT_FRAME (1UL << 0) + /* * No user of this module should every access this structure directly * as it is subject to change. It is declared here solely so we can * use automatic variables. */ -struct ia64_frame_info { - struct ia64_stack regstk; - unsigned long *bsp; - unsigned long top_rnat; /* RSE NaT collection at top of backing store */ - unsigned long cfm; +struct unw_frame_info { + struct unw_stack regstk; + struct unw_stack memstk; + unsigned int flags; + short hint; + short prev_script; + unsigned long bsp; + unsigned long sp; /* stack pointer */ + unsigned long psp; /* previous sp */ unsigned long ip; /* instruction pointer */ + unsigned long pr_val; /* current predicates */ + unsigned long *cfm; + + struct task_struct *task; + struct switch_stack *sw; + + /* preserved state: */ + unsigned long *pbsp; /* previous bsp */ + unsigned long *bspstore; + unsigned long *pfs; + unsigned long *rnat; + unsigned long *rp; + unsigned long *pri_unat; + unsigned long *unat; + unsigned long *pr; + unsigned long *lc; + unsigned long *fpsr; + struct unw_ireg { + unsigned long *loc; + struct unw_ireg_nat { + int type : 3; /* enum unw_nat_type */ + signed int off; /* NaT word is at loc+nat.off */ + } nat; + } r4, r5, r6, r7; + unsigned long *b1, *b2, *b3, *b4, *b5; + struct ia64_fpreg *f2, *f3, *f4, *f5, *fr[16]; }; /* @@ -44,10 +89,22 @@ struct ia64_frame_info { */ /* + * Initialize unwind support. + */ +extern void unw_init (void); + +extern void *unw_add_unwind_table (const char *name, unsigned long segment_base, unsigned long gp, + void *table_start, void *table_end); + +extern void unw_remove_unwind_table (void *handle); + +/* * Prepare to unwind blocked task t. */ -extern void ia64_unwind_init_from_blocked_task (struct ia64_frame_info *info, - struct task_struct *t); +extern void unw_init_from_blocked_task (struct unw_frame_info *info, struct task_struct *t); + +extern void unw_init_frame_info (struct unw_frame_info *info, struct task_struct *t, + struct switch_stack *sw); /* * Prepare to unwind the current task. For this to work, the kernel @@ -63,15 +120,82 @@ extern void ia64_unwind_init_from_blocked_task (struct ia64_frame_info *info, * | struct switch_stack | * +---------------------+ */ -extern void ia64_unwind_init_from_current (struct ia64_frame_info *info, struct pt_regs *regs); +extern void unw_init_from_current (struct unw_frame_info *info, struct pt_regs *regs); + +/* + * Prepare to unwind the currently running thread. + */ +extern void unw_init_running (void (*callback)(struct unw_frame_info *info, void *arg), void *arg); /* * Unwind to previous to frame. Returns 0 if successful, negative * number in case of an error. */ -extern int ia64_unwind_to_previous_frame (struct ia64_frame_info *info); +extern int unw_unwind (struct unw_frame_info *info); + +/* + * Unwind until the return pointer is in user-land (or until an error + * occurs). Returns 0 if successful, negative number in case of + * error. + */ +extern int unw_unwind_to_user (struct unw_frame_info *info); + +#define unw_get_ip(info,vp) ({*(vp) = (info)->ip; 0;}) +#define unw_get_sp(info,vp) ({*(vp) = (unsigned long) (info)->sp; 0;}) +#define unw_get_psp(info,vp) ({*(vp) = (unsigned long) (info)->psp; 0;}) +#define unw_get_bsp(info,vp) ({*(vp) = (unsigned long) (info)->bsp; 0;}) +#define unw_get_cfm(info,vp) ({*(vp) = *(info)->cfm; 0;}) +#define unw_set_cfm(info,val) ({*(info)->cfm = (val); 0;}) + +static inline int +unw_get_rp (struct unw_frame_info *info, unsigned long *val) +{ + if (!info->rp) + return -1; + *val = *info->rp; + return 0; +} + +extern int unw_access_gr (struct unw_frame_info *, int, unsigned long *, char *, int); +extern int unw_access_br (struct unw_frame_info *, int, unsigned long *, int); +extern int unw_access_fr (struct unw_frame_info *, int, struct ia64_fpreg *, int); +extern int unw_access_ar (struct unw_frame_info *, int, unsigned long *, int); +extern int unw_access_pr (struct unw_frame_info *, unsigned long *, int); + +static inline int +unw_set_gr (struct unw_frame_info *i, int n, unsigned long v, char nat) +{ + return unw_access_gr(i, n, &v, &nat, 1); +} + +static inline int +unw_set_br (struct unw_frame_info *i, int n, unsigned long v) +{ + return unw_access_br(i, n, &v, 1); +} + +static inline int +unw_set_fr (struct unw_frame_info *i, int n, struct ia64_fpreg v) +{ + return unw_access_fr(i, n, &v, 1); +} + +static inline int +unw_set_ar (struct unw_frame_info *i, int n, unsigned long v) +{ + return unw_access_ar(i, n, &v, 1); +} + +static inline int +unw_set_pr (struct unw_frame_info *i, unsigned long v) +{ + return unw_access_pr(i, &v, 1); +} -#define ia64_unwind_get_ip(info) ((info)->ip) -#define ia64_unwind_get_bsp(info) ((unsigned long) (info)->bsp) +#define unw_get_gr(i,n,v,nat) unw_access_gr(i,n,v,nat,0) +#define unw_get_br(i,n,v) unw_access_br(i,n,v,0) +#define unw_get_fr(i,n,v) unw_access_fr(i,n,v,0) +#define unw_get_ar(i,n,v) unw_access_ar(i,n,v,0) +#define unw_get_pr(i,v) unw_access_pr(i,v,0) -#endif /* _ASM_IA64_UNWIND_H */ +#endif /* _ASM_UNWIND_H */ diff --git a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h index efbaf41b5..2e767ed59 100644 --- a/include/asm-m68k/pci.h +++ b/include/asm-m68k/pci.h @@ -40,4 +40,9 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + #endif /* _ASM_M68K_PCI_H */ diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 14126235c..77c99d347 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -23,6 +23,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* * Dynamic DMA mapping stuff. * MIPS has everything mapped statically. diff --git a/include/asm-mips64/pci.h b/include/asm-mips64/pci.h index 7769fef70..b530f89a2 100644 --- a/include/asm-mips64/pci.h +++ b/include/asm-mips64/pci.h @@ -23,6 +23,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* * Dynamic DMA mapping stuff. * MIPS has everything mapped statically. diff --git a/include/asm-ppc/byteorder.h b/include/asm-ppc/byteorder.h index c45dba13b..0fdd67844 100644 --- a/include/asm-ppc/byteorder.h +++ b/include/asm-ppc/byteorder.h @@ -38,7 +38,7 @@ extern __inline__ void st_le32(volatile unsigned *addr, const unsigned val) /* alas, egcs sounds like it has a bug in this code that doesn't use the inline asm correctly, and can cause file corruption. Until I hear that it's fixed, I can live without the extra speed. I hope. */ -#if !((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 90)) +#if !(__GNUC__ >= 2 && __GNUC_MINOR__ >= 90) #if 0 # define __arch_swab16(x) ld_le16(&x) # define __arch_swab32(x) ld_le32(&x) diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 479f8ba2c..26fe498dc 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -15,6 +15,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* Dynamic DMA Mapping stuff * ++ajoshi */ diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h index bf8fe93f5..34398480a 100644 --- a/include/asm-sh/pci.h +++ b/include/asm-sh/pci.h @@ -14,6 +14,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* Dynamic DMA mapping stuff. * SuperH has everything mapped statically like x86. */ diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h index f96225e2a..bbc55d013 100644 --- a/include/asm-sparc/pci.h +++ b/include/asm-sparc/pci.h @@ -17,6 +17,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* Dynamic DMA mapping stuff. */ diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 1fd24a47f..9f0c24175 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -17,6 +17,11 @@ extern inline void pcibios_set_master(struct pci_dev *dev) /* No special bus mastering setup handling */ } +extern inline void pcibios_penalize_isa_irq(int irq) +{ + /* We don't do dynamic PCI IRQ allocation */ +} + /* Dynamic DMA mapping stuff. */ diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h index 8a09cd72d..60af0d40c 100644 --- a/include/linux/affs_fs.h +++ b/include/linux/affs_fs.h @@ -84,7 +84,7 @@ extern int affs_add_entry(struct inode *dir, struct inode *link, extern void affs_put_inode(struct inode *inode); extern void affs_delete_inode(struct inode *inode); extern void affs_read_inode(struct inode *inode); -extern void affs_write_inode(struct inode *inode, int); +extern void affs_write_inode(struct inode *inode); /* super.c */ diff --git a/include/linux/blk.h b/include/linux/blk.h index 777469870..e8b5e5a85 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -14,13 +14,6 @@ extern spinlock_t io_request_lock; /* - * NR_REQUEST is the number of entries in the request-queue. - * NOTE that writes may use only the low 2/3 of these: reads - * take precedence. - */ -#define NR_REQUEST 256 - -/* * Initialization functions. */ extern int isp16_init(void); @@ -94,12 +87,9 @@ void initrd_init(void); extern inline void blkdev_dequeue_request(struct request * req) { - if (req->q) - { - if (req->cmd == READ) - req->q->elevator.read_pendings--; - req->q->elevator.nr_segments -= req->nr_segments; - req->q = NULL; + if (req->e) { + req->e->dequeue_fn(req); + req->e = NULL; } list_del(&req->queue); } diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 371069369..5b62f88ad 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -9,6 +9,8 @@ struct request_queue; typedef struct request_queue request_queue_t; +struct elevator_s; +typedef struct elevator_s elevator_t; /* * Ok, this is an expanded form so that we can use the same @@ -19,7 +21,11 @@ typedef struct request_queue request_queue_t; struct request { struct list_head queue; int elevator_sequence; + struct list_head table; + /* + * queue free list belongs to + */ volatile int rq_status; /* should split this into a few status bits */ #define RQ_INACTIVE (-1) #define RQ_ACTIVE 1 @@ -41,7 +47,8 @@ struct request { struct semaphore * sem; struct buffer_head * bh; struct buffer_head * bhtail; - request_queue_t * q; + request_queue_t *q; + elevator_t *e; }; #include <linux/elevator.h> @@ -60,11 +67,25 @@ typedef int (make_request_fn) (request_queue_t *q, int rw, struct buffer_head *b typedef void (plug_device_fn) (request_queue_t *q, kdev_t device); typedef void (unplug_device_fn) (void *q); +/* + * Default nr free requests per queue + */ +#define QUEUE_NR_REQUESTS 512 +#define QUEUE_WRITES_MAX ((2 * QUEUE_NR_REQUESTS) / 3) + struct request_queue { - struct list_head queue_head; - /* together with queue_head for cacheline sharing */ - elevator_t elevator; + /* + * the queue request freelist, one for reads and one for writes + */ + struct list_head request_freelist; + int queue_requests; + + /* + * Together with queue_head for cacheline sharing + */ + struct list_head queue_head; + elevator_t elevator; request_fn_proc * request_fn; merge_request_fn * back_merge_fn; @@ -76,22 +97,34 @@ struct request_queue * The queue owner gets to use this for whatever they like. * ll_rw_blk doesn't touch it. */ - void * queuedata; + void * queuedata; /* * This is used to remove the plug when tq_disk runs. */ - struct tq_struct plug_tq; + struct tq_struct plug_tq; + /* * Boolean that indicates whether this queue is plugged or not. */ - char plugged; + char plugged; /* * Boolean that indicates whether current_request is active or * not. */ - char head_active; + char head_active; + + /* + * Is meant to protect the queue in the future instead of + * io_request_lock + */ + spinlock_t request_lock; + + /* + * Tasks wait here for free request + */ + wait_queue_head_t wait_for_request; }; struct blk_dev_struct { @@ -118,13 +151,13 @@ struct sec_size { extern struct sec_size * blk_sec[MAX_BLKDEV]; extern struct blk_dev_struct blk_dev[MAX_BLKDEV]; -extern wait_queue_head_t wait_for_request; extern void grok_partitions(struct gendisk *dev, int drive, unsigned minors, long size); extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size); -extern void generic_unplug_device(void * data); +extern void generic_unplug_device(void *data); extern int generic_make_request(request_queue_t *q, int rw, struct buffer_head * bh); -extern request_queue_t * blk_get_queue(kdev_t dev); +extern request_queue_t *blk_get_queue(kdev_t dev); +extern void blkdev_release_request(struct request *); /* * Access functions for manipulating queue properties diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h index b35fbe6e1..8173779f3 100644 --- a/include/linux/devfs_fs_kernel.h +++ b/include/linux/devfs_fs_kernel.h @@ -35,6 +35,7 @@ #define DEVFS_FL_REMOVABLE 0x020 /* This is a removable media device */ #define DEVFS_FL_WAIT 0x040 /* Wait for devfsd to finish */ #define DEVFS_FL_NO_PERSISTENCE 0x080 /* Forget changes after unregister */ +#define DEVFS_FL_CURRENT_OWNER 0x100 /* Set initial ownership to current */ #define DEVFS_FL_DEFAULT DEVFS_FL_NONE @@ -52,12 +53,10 @@ typedef struct devfs_entry * devfs_handle_t; #ifdef CONFIG_DEVFS_FS -extern devfs_handle_t devfs_register (devfs_handle_t dir, - const char *name, unsigned int namelen, +extern devfs_handle_t devfs_register (devfs_handle_t dir, const char *name, unsigned int flags, unsigned int major, unsigned int minor, - umode_t mode, uid_t uid, gid_t gid, - void *ops, void *info); + umode_t mode, void *ops, void *info); extern void devfs_unregister (devfs_handle_t de); extern int devfs_mk_symlink (devfs_handle_t dir, const char *name, unsigned int namelen, @@ -98,8 +97,7 @@ extern void devfs_register_series (devfs_handle_t dir, const char *format, unsigned int num_entries, unsigned int flags, unsigned int major, unsigned int minor_start, - umode_t mode, uid_t uid, gid_t gid, - void *ops, void *info); + umode_t mode, void *ops, void *info); extern int init_devfs_fs (void); extern void mount_devfs_fs (void); @@ -107,12 +105,10 @@ extern void devfs_make_root (const char *name); #else /* CONFIG_DEVFS_FS */ static inline devfs_handle_t devfs_register (devfs_handle_t dir, const char *name, - unsigned int namelen, unsigned int flags, unsigned int major, unsigned int minor, umode_t mode, - uid_t uid, gid_t gid, void *ops, void *info) { return NULL; @@ -239,8 +235,7 @@ static inline void devfs_register_series (devfs_handle_t dir, unsigned int flags, unsigned int major, unsigned int minor_start, - umode_t mode, uid_t uid, gid_t gid, - void *ops, void *info) + umode_t mode, void *ops, void *info) { return; } diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 988862534..b1f56316b 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -3,13 +3,15 @@ #define ELEVATOR_DEBUG -struct elevator_s; -typedef struct elevator_s elevator_t; - typedef void (elevator_fn) (struct request *, elevator_t *, struct list_head *, struct list_head *, int); +typedef int (elevator_merge_fn) (request_queue_t *, struct request **, + struct buffer_head *, int, int *, int *); + +typedef void (elevator_dequeue_fn) (struct request *); + struct elevator_s { int sequence; @@ -22,24 +24,20 @@ struct elevator_s int read_pendings; elevator_fn * elevator_fn; + elevator_merge_fn *elevator_merge_fn; + elevator_dequeue_fn *dequeue_fn; unsigned int queue_ID; }; -#define ELEVATOR_DEFAULTS \ -((elevator_t) { \ - 0, /* sequence */ \ - \ - 128, /* read_latency */ \ - 8192, /* write_latency */ \ - 32, /* max_bomb_segments */ \ - \ - 0, /* nr_segments */ \ - 0, /* read_pendings */ \ - \ - elevator_default, /* elevator_fn */ \ - }) - +void elevator_default(struct request *, elevator_t *, struct list_head *, struct list_head *, int); +int elevator_default_merge(request_queue_t *, struct request **, struct buffer_head *, int, int *, int *); +void elevator_default_dequeue(struct request *); +void elevator_noop(struct request *, elevator_t *, struct list_head *, struct list_head *, int); +int elevator_noop_merge(request_queue_t *, struct request **, struct buffer_head *, int, int *, int *); +void elevator_noop_dequeue(struct request *); +void elevator_linus(struct request *, elevator_t *, struct list_head *, struct list_head *, int); +int elevator_linus_merge(request_queue_t *, struct request **, struct buffer_head *, int, int *, int *); typedef struct blkelv_ioctl_arg_s { int queue_ID; @@ -54,13 +52,12 @@ typedef struct blkelv_ioctl_arg_s { extern int blkelvget_ioctl(elevator_t *, blkelv_ioctl_arg_t *); extern int blkelvset_ioctl(elevator_t *, const blkelv_ioctl_arg_t *); - -extern void elevator_init(elevator_t *); +extern void elevator_init(elevator_t *, elevator_t); #ifdef ELEVATOR_DEBUG -extern void elevator_debug(request_queue_t *, kdev_t); +extern void elevator_default_debug(request_queue_t *, kdev_t); #else -#define elevator_debug(a,b) do { } while(0) +#define elevator_default_debug(a,b) do { } while(0) #endif #define elevator_sequence_after(a,b) ((int)((b)-(a)) < 0) @@ -69,6 +66,13 @@ extern void elevator_debug(request_queue_t *, kdev_t); #define elevator_sequence_before_eq(a,b) elevator_sequence_after_eq(b,a) /* + * Return values from elevator merger + */ +#define ELEVATOR_NO_MERGE 0 +#define ELEVATOR_FRONT_MERGE 1 +#define ELEVATOR_BACK_MERGE 2 + +/* * This is used in the elevator algorithm. We don't prioritise reads * over writes any more --- although reads are more time-critical than * writes, by treating them equally we increase filesystem throughput. @@ -79,12 +83,12 @@ extern void elevator_debug(request_queue_t *, kdev_t); (s1)->sector < (s2)->sector)) || \ (s1)->rq_dev < (s2)->rq_dev) -static inline void elevator_merge_requests(elevator_t * e, struct request * req, struct request * next) +static inline void elevator_merge_requests(struct request * req, struct request * next) { if (elevator_sequence_before(next->elevator_sequence, req->elevator_sequence)) req->elevator_sequence = next->elevator_sequence; if (req->cmd == READ) - e->read_pendings--; + req->e->read_pendings--; } @@ -93,23 +97,23 @@ static inline int elevator_sequence(elevator_t * e, int latency) return latency + e->sequence; } -#define elevator_merge_before(q, req, lat) __elevator_merge((q), (req), (lat), 0) -#define elevator_merge_after(q, req, lat) __elevator_merge((q), (req), (lat), 1) -static inline void __elevator_merge(elevator_t * elevator, struct request * req, int latency, int after) +#define elevator_merge_before(req, lat) __elevator_merge((req), (lat), 0) +#define elevator_merge_after(req, lat) __elevator_merge((req), (lat), 1) +static inline void __elevator_merge(struct request * req, int latency, int after) { - int sequence = elevator_sequence(elevator, latency); + int sequence = elevator_sequence(req->e, latency); if (after) sequence -= req->nr_segments; if (elevator_sequence_before(sequence, req->elevator_sequence)) req->elevator_sequence = sequence; } -static inline void elevator_account_request(elevator_t * elevator, struct request * req) +static inline void elevator_account_request(struct request * req) { - elevator->sequence++; + req->e->sequence++; if (req->cmd == READ) - elevator->read_pendings++; - elevator->nr_segments++; + req->e->read_pendings++; + req->e->nr_segments++; } static inline int elevator_request_latency(elevator_t * elevator, int rw) @@ -123,4 +127,52 @@ static inline int elevator_request_latency(elevator_t * elevator, int rw) return latency; } +#define ELEVATOR_DEFAULT \ +((elevator_t) { \ + 0, /* sequence */ \ + \ + 100000, /* read_latency */ \ + 100000, /* write_latency */ \ + 128, /* max_bomb_segments */ \ + \ + 0, /* nr_segments */ \ + 0, /* read_pendings */ \ + \ + elevator_default, /* elevator_fn */ \ + elevator_default_merge, /* elevator_merge_fn */ \ + elevator_default_dequeue, /* dequeue_fn */ \ + }) + +#define ELEVATOR_NOOP \ +((elevator_t) { \ + 0, /* sequence */ \ + \ + 0, /* read_latency */ \ + 0, /* write_latency */ \ + 0, /* max_bomb_segments */ \ + \ + 0, /* nr_segments */ \ + 0, /* read_pendings */ \ + \ + elevator_noop, /* elevator_fn */ \ + elevator_noop_merge, /* elevator_merge_fn */ \ + elevator_noop_dequeue, /* dequeue_fn */ \ + }) + +#define ELEVATOR_LINUS \ +((elevator_t) { \ + 0, /* not used */ \ + \ + 1000000, /* read passovers */ \ + 2000000, /* write passovers */ \ + 0, /* max_bomb_segments */ \ + \ + 0, /* not used */ \ + 0, /* not used */ \ + \ + elevator_linus, /* elevator_fn */ \ + elevator_linus_merge, /* elevator_merge_fn */ \ + elevator_noop_dequeue, /* dequeue_fn */ \ + }) + #endif diff --git a/include/linux/elf.h b/include/linux/elf.h index 6f70727ab..f22e7387e 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -565,6 +565,7 @@ typedef struct elf64_shdr { #define NT_PRFPREG 2 #define NT_PRPSINFO 3 #define NT_TASKSTRUCT 4 +#define NT_PRFPXREG 20 /* Note header in a PT_NOTE section */ typedef struct elf32_note { diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 6dd1a31b2..3129abe82 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -20,6 +20,7 @@ struct elf_siginfo typedef elf_greg_t greg_t; typedef elf_gregset_t gregset_t; typedef elf_fpregset_t fpregset_t; +typedef elf_fpxregset_t fpxregset_t; #define NGREG ELF_NGREG #endif diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 4bd6a5d72..25178b66b 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -548,9 +548,7 @@ extern int ext2_read (struct inode *, struct file *, char *, int); extern int ext2_write (struct inode *, struct file *, char *, int); /* fsync.c */ -extern int ext2_fsync_file (struct file *, struct dentry *, int); -extern int ext2_fsync_inode (struct inode *, int); -extern int ext2_osync_inode (struct inode *, int); +extern int ext2_sync_file (struct file *, struct dentry *); /* ialloc.c */ extern struct inode * ext2_new_inode (const struct inode *, int, int *); @@ -564,7 +562,7 @@ extern struct buffer_head * ext2_getblk (struct inode *, long, int, int *); extern struct buffer_head * ext2_bread (struct inode *, int, int, int *); extern void ext2_read_inode (struct inode *); -extern void ext2_write_inode (struct inode *, int); +extern void ext2_write_inode (struct inode *); extern void ext2_put_inode (struct inode *); extern void ext2_delete_inode (struct inode *); extern int ext2_sync_inode (struct inode *); diff --git a/include/linux/fb.h b/include/linux/fb.h index 4147f05ad..896dadef5 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -27,6 +27,8 @@ #define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank) #define FBIO_ALLOC 0x4613 #define FBIO_FREE 0x4614 +#define FBIOGET_GLYPH 0x4615 +#define FBIOGET_HWCINFO 0x4616 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 3eafb9a55..8a1f8e9b6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -47,12 +47,7 @@ struct poll_table_struct; #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) /* And dynamically-tunable limits and defaults: */ -struct files_stat_struct { - int nr_files; /* read only */ - int nr_free_files; /* read only */ - int max_files; /* tunable */ -}; -extern struct files_stat_struct files_stat; +extern int max_files, nr_files, nr_free_files; extern int max_super_blocks, nr_super_blocks; #define NR_FILE 8192 /* this can well be larger on a larger system */ @@ -241,9 +236,6 @@ struct buffer_head { unsigned long b_rsector; /* Real buffer location on disk */ wait_queue_head_t b_wait; struct kiobuf * b_kiobuf; /* kiobuf which owns this IO */ - - struct inode * b_inode; - struct list_head b_inode_buffers; /* doubly linked list of inode dirty buffers */ }; typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); @@ -383,8 +375,6 @@ struct inode { struct list_head i_list; struct list_head i_dentry; - struct list_head i_dirty_buffers; - unsigned long i_ino; atomic_t i_count; kdev_t i_dev; @@ -451,24 +441,16 @@ struct inode { }; /* Inode state bits.. */ -#define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */ -#define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */ -#define I_LOCK 4 -#define I_FREEING 8 -#define I_CLEAR 16 +#define I_DIRTY 1 +#define I_LOCK 2 +#define I_FREEING 4 +#define I_CLEAR 8 -#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC) - -extern void __mark_inode_dirty(struct inode *, int); +extern void __mark_inode_dirty(struct inode *); static inline void mark_inode_dirty(struct inode *inode) { - if ((inode->i_state & I_DIRTY) != I_DIRTY) - __mark_inode_dirty(inode, I_DIRTY); -} -static inline void mark_inode_dirty_sync(struct inode *inode) -{ - if (!(inode->i_state & I_DIRTY_SYNC)) - __mark_inode_dirty(inode, I_DIRTY_SYNC); + if (!(inode->i_state & I_DIRTY)) + __mark_inode_dirty(inode); } struct fown_struct { @@ -522,8 +504,10 @@ typedef struct files_struct *fl_owner_t; struct file_lock { struct file_lock *fl_next; /* singly linked list for this inode */ - struct list_head fl_link; /* doubly linked list of all locks */ - struct list_head fl_block; /* circular list of blocked processes */ + struct file_lock *fl_nextlink; /* doubly linked list of all locks */ + struct file_lock *fl_prevlink; /* used to simplify lock removal */ + struct file_lock *fl_nextblock; /* circular list of blocked processes */ + struct file_lock *fl_prevblock; fl_owner_t fl_owner; unsigned int fl_pid; wait_queue_head_t fl_wait; @@ -548,7 +532,7 @@ struct file_lock { #define OFFSET_MAX INT_LIMIT(loff_t) #endif -extern struct list_head file_lock_list; +extern struct file_lock *file_lock_table; #include <linux/fcntl.h> @@ -737,7 +721,7 @@ struct file_operations { int (*open) (struct inode *, struct file *); int (*flush) (struct file *); int (*release) (struct inode *, struct file *); - int (*fsync) (struct file *, struct dentry *, int datasync); + int (*fsync) (struct file *, struct dentry *); int (*fasync) (int, struct file *, int); int (*lock) (struct file *, int, struct file_lock *); ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); @@ -770,7 +754,7 @@ struct inode_operations { */ struct super_operations { void (*read_inode) (struct inode *); - void (*write_inode) (struct inode *, int); + void (*write_inode) (struct inode *); void (*put_inode) (struct inode *); void (*delete_inode) (struct inode *); void (*put_super) (struct super_block *); @@ -875,8 +859,8 @@ static inline int locks_verify_truncate(struct inode *inode, return locks_mandatory_area( FLOCK_VERIFY_WRITE, inode, filp, size < inode->i_size ? size : inode->i_size, - size < inode->i_size ? inode->i_size - size - : size - inode->i_size); + abs(inode->i_size - size) + ); return 0; } @@ -997,44 +981,23 @@ static inline void buffer_IO_error(struct buffer_head * bh) bh->b_end_io(bh, 0); } -extern void buffer_insert_inode_queue(struct buffer_head *, struct inode *); -static inline void mark_buffer_dirty_inode(struct buffer_head *bh, int flag, struct inode *inode) -{ - mark_buffer_dirty(bh, flag); - buffer_insert_inode_queue(bh, inode); -} - extern void balance_dirty(kdev_t); extern int check_disk_change(kdev_t); extern int invalidate_inodes(struct super_block *); extern void invalidate_inode_pages(struct inode *); -extern void invalidate_inode_buffers(struct inode *); #define invalidate_buffers(dev) __invalidate_buffers((dev), 0) #define destroy_buffers(dev) __invalidate_buffers((dev), 1) extern void __invalidate_buffers(kdev_t dev, int); extern void sync_inodes(kdev_t); -extern void write_inode_now(struct inode *, int); +extern void write_inode_now(struct inode *); extern void sync_dev(kdev_t); extern int fsync_dev(kdev_t); -extern int fsync_inode_buffers(struct inode *); -extern int osync_inode_buffers(struct inode *); -extern int generic_osync_inode(struct inode *, int); -extern int inode_has_buffers(struct inode *); extern void sync_supers(kdev_t); extern int bmap(struct inode *, int); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int); extern int get_write_access(struct inode *); -extern int deny_write_access(struct file *); -static inline void put_write_access(struct inode * inode) -{ - atomic_dec(&inode->i_writecount); -} -static inline void allow_write_access(struct file *file) -{ - if (file) - atomic_inc(&file->f_dentry->d_inode->i_writecount); -} +extern void put_write_access(struct inode *); extern int do_pipe(int *); extern int open_namei(const char *, int, int, struct nameidata *); @@ -1156,7 +1119,6 @@ typedef int (get_block_t)(struct inode*,long,struct buffer_head*,int); /* Generic buffer handling for block filesystems.. */ extern int block_flushpage(struct page *, unsigned long); -extern void block_destroy_buffers(struct page *); extern int block_symlink(struct inode *, const char *, int); extern int block_write_full_page(struct page*, get_block_t*); extern int block_read_full_page(struct page*, get_block_t*); @@ -1210,7 +1172,7 @@ extern int read_ahead[]; extern ssize_t char_write(struct file *, const char *, size_t, loff_t *); extern ssize_t block_write(struct file *, const char *, size_t, loff_t *); -extern int file_fsync(struct file *, struct dentry *, int); +extern int file_fsync(struct file *, struct dentry *); extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start_idx, unsigned long end_idx); extern int inode_change_ok(struct inode *, struct iattr *); @@ -1224,6 +1186,20 @@ extern void inode_setattr(struct inode *, struct iattr *); */ /* + * We need to do a check-parent every time + * after we have locked the parent - to verify + * that the parent is still our parent and + * that we are still hashed onto it.. + * + * This is required in case two processes race + * on removing (or moving) the same entry: the + * parent lock will serialize them, but the + * other process will be too late.. + */ +#define check_parent(dir, dentry) \ + ((dir) == (dentry)->d_parent && !d_unhashed(dentry)) + +/* * Locking the parent is needed to: * - serialize directory operations * - make sure the parent doesn't change from diff --git a/include/linux/gameport.h b/include/linux/gameport.h new file mode 100644 index 000000000..972dd0bfb --- /dev/null +++ b/include/linux/gameport.h @@ -0,0 +1,142 @@ +#ifndef _GAMEPORT_H +#define _GAMEPORT_H + +/* + * $Id: gameport.h,v 1.8 2000/06/03 20:18:52 vojtech Exp $ + * + * Copyright (c) 1999-2000 Vojtech Pavlik + * + * Sponsored by SuSE + */ + +/* + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Should you need to contact me, the author, you can do so either by + * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: + * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic + */ + +#include <asm/io.h> + +struct gameport; + +struct gameport { + + void *private; + void *driver; + + int number; + + int io; + int size; + int speed; + int fuzz; + int type; + struct pci_dev *pci; + + void (*trigger)(struct gameport *); + unsigned char (*read)(struct gameport *); + int (*cooked_read)(struct gameport *, int *, int *); + int (*calibrate)(struct gameport *, int *, int *); + int (*open)(struct gameport *, int); + void (*close)(struct gameport *); + + struct gameport_dev *dev; + + struct gameport *next; +}; + +struct gameport_dev { + + void *private; + + void (*connect)(struct gameport *, struct gameport_dev *dev); + void (*disconnect)(struct gameport *); + + struct gameport_dev *next; +}; + +int gameport_open(struct gameport *gameport, struct gameport_dev *dev, int mode); +void gameport_close(struct gameport *gameport); +void gameport_rescan(struct gameport *gameport); + +void gameport_register_port(struct gameport *gameport); +void gameport_unregister_port(struct gameport *gameport); +void gameport_register_device(struct gameport_dev *dev); +void gameport_unregister_device(struct gameport_dev *dev); + +#define GAMEPORT_MODE_DISABLED 0 +#define GAMEPORT_MODE_RAW 1 +#define GAMEPORT_MODE_COOKED 2 + +#define GAMEPORT_ISA 0 +#define GAMEPORT_PNP 1 +#define GAMEPORT_EXT 2 + +#define GAMEPORT_ID_VENDOR_ANALOG 0x0001 +#define GAMEPORT_ID_VENDOR_MADCATZ 0x0002 +#define GAMEPORT_ID_VENDOR_LOGITECH 0x0003 +#define GAMEPORT_ID_VENDOR_CREATIVE 0x0004 +#define GAMEPORT_ID_VENDOR_GENIUS 0x0005 +#define GAMEPORT_ID_VENDOR_INTERACT 0x0006 +#define GAMEPORT_ID_VENDOR_MICROSOFT 0x0007 +#define GAMEPORT_ID_VENDOR_THRUSTMASTER 0x0008 +#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009 + +static __inline__ void gameport_trigger(struct gameport *gameport) +{ + if (gameport->trigger) + gameport->trigger(gameport); + else + outb(0xff, gameport->io); +} + +static __inline__ unsigned char gameport_read(struct gameport *gameport) +{ + if (gameport->read) + return gameport->read(gameport); + else + return inb(gameport->io); +} + +static __inline__ int gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons) +{ + if (gameport->cooked_read) + return gameport->cooked_read(gameport, axes, buttons); + else + return -1; +} + +static __inline__ int gameport_calibrate(struct gameport *gameport, int *axes, int *max) +{ + if (gameport->calibrate) + return gameport->calibrate(gameport, axes, max); + else + return -1; +} + +static __inline__ int gameport_time(struct gameport *gameport, int time) +{ + return (time * gameport->speed) / 1000; +} + +static __inline__ void wait_ms(unsigned int ms) +{ + current->state = TASK_UNINTERRUPTIBLE; + schedule_timeout(1 + ms * HZ / 1000); +} + +#endif diff --git a/include/linux/input.h b/include/linux/input.h index 6d19fc2a9..a44e6f8e1 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -2,7 +2,7 @@ #define _INPUT_H /* - * $Id: input.h,v 1.13 2000/05/29 10:54:53 vojtech Exp $ + * $Id: input.h,v 1.14 2000/06/03 20:18:52 vojtech Exp $ * * Copyright (c) 1999-2000 Vojtech Pavlik * @@ -359,8 +359,9 @@ struct input_event { #define ABS_RZ 0x05 #define ABS_THROTTLE 0x06 #define ABS_RUDDER 0x07 -#define ABS_TL 0x08 -#define ABS_TR 0x09 +#define ABS_WHEEL 0x08 +#define ABS_GAS 0x09 +#define ABS_BRAKE 0x0a #define ABS_HAT0X 0x10 #define ABS_HAT0Y 0x11 #define ABS_HAT1X 0x12 diff --git a/include/linux/irq.h b/include/linux/irq.h index 69040207e..de2476503 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -18,6 +18,7 @@ #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ #define IRQ_LEVEL 64 /* IRQ level triggered */ #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ +#define IRQ_PER_CPU 256 /* IRQ is per CPU */ /* * Interrupt controller descriptor. This is all we need diff --git a/include/linux/joystick.h b/include/linux/joystick.h index c0e148171..1836aa95a 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h @@ -2,11 +2,11 @@ #define _LINUX_JOYSTICK_H /* - * /usr/include/linux/joystick.h Version 1.2 + * $Id: joystick.h,v 1.2 2000/05/29 10:54:53 vojtech Exp $ * - * Copyright (C) 1996-1999 Vojtech Pavlik + * Copyright (C) 1996-2000 Vojtech Pavlik * - * Sponsored by SuSE + * Sponsored by SuSE */ /* @@ -30,13 +30,12 @@ */ #include <asm/types.h> -#include <linux/module.h> /* * Version */ -#define JS_VERSION 0x01020f +#define JS_VERSION 0x020000 /* * Types and constants for reading from /dev/js @@ -120,164 +119,4 @@ struct JS_DATA_SAVE_TYPE { struct JS_DATA_TYPE JS_CORR; }; -/* - * Internal definitions - */ - -#ifdef __KERNEL__ - -#define JS_BUFF_SIZE 64 /* output buffer size */ - -#include <linux/version.h> -#include <linux/devfs_fs_kernel.h> - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) -#error "You need to use at least v2.2 Linux kernel." -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) -#include <asm/spinlock.h> -typedef struct wait_queue *wait_queue_head_t; -#define __setup(a,b) -#define BASE_ADDRESS(x,i) ((x)->base_address[i]) -#define DECLARE_WAITQUEUE(x,y) struct wait_queue x = { y, NULL } -#define init_waitqueue_head(x) do { *(x) = NULL; } while (0) -#define __set_current_state(x) current->state = x -#define SETUP_PARAM char *str, int *ints -#define SETUP_PARSE(x) do {} while (0) -#else -#include <linux/spinlock.h> -#define BASE_ADDRESS(x,i) ((x)->resource[i].start) -#define SETUP_PARAM char *str -#define SETUP_PARSE(x) int ints[x]; get_options(str, x, ints) -#endif - -#define PCI_VENDOR_ID_AUREAL 0x12eb - -/* - * Parport stuff - */ - -#include <linux/parport.h> - -#define JS_PAR_STATUS_INVERT (0x80) -#define JS_PAR_CTRL_INVERT (0x04) -#define JS_PAR_DATA_IN(y) parport_read_data(y->port) -#define JS_PAR_DATA_OUT(x,y) parport_write_data(y->port, x) -#define JS_PAR_STATUS(y) parport_read_status(y->port) - -#ifndef PARPORT_NEED_GENERIC_OPS -#define JS_PAR_CTRL_IN(y) parport_read_control(y->port) -#else -#define JS_PAR_CTRL_IN(y) inb(y->port->base+2) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) -#define JS_PAR_CTRL_OUT(x,y) parport_write_control(y->port, x) -#define JS_PAR_ECTRL_OUT(x,y) parport_write_econtrol(y->port, x) -#else -#define JS_PAR_CTRL_OUT(x,y) \ - do { \ - if ((x) & 0x20) parport_data_reverse(y->port); \ - else parport_data_forward(y->port); \ - parport_write_control(y->port, (x) & ~0x20); \ - } while (0) -#define JS_PAR_ECTRL_OUT(x,y) /*parport sets PS/2 mode on ECR chips */ -#define PARPORT_MODE_PCPS2 PARPORT_MODE_TRISTATE -#define PARPORT_MODE_PCECPPS2 PARPORT_MODE_TRISTATE -#endif - -/* - * Internal types - */ - -struct js_dev; - -typedef int (*js_read_func)(void *info, int **axes, int **buttons); -typedef int (*js_ops_func)(struct js_dev *dev); - -struct js_data { - int *axes; - int *buttons; -}; - -struct js_dev { - struct js_dev *next; - struct js_list *list; - struct js_port *port; - wait_queue_head_t wait; - struct js_data cur; - struct js_data new; - struct js_corr *corr; - struct js_event buff[JS_BUFF_SIZE]; - js_ops_func open; - js_ops_func close; - int ahead; - int bhead; - int tail; - int num_axes; - int num_buttons; - char *name; - devfs_handle_t devfs_handle; - struct module *owner; -}; - -struct js_list { - struct js_list *next; - struct js_dev *dev; - int tail; - int startup; -}; - -struct js_port { - struct js_port *next; - struct js_port *prev; - js_read_func read; - struct js_dev **devs; - int **axes; - int **buttons; - struct js_corr **corr; - void *info; - int ndevs; - int fail; - int total; -}; - -/* - * Sub-module interface - */ - -extern struct js_port *js_register_port(struct js_port *port, void *info, - int devs, int infos, js_read_func read); -extern struct js_port *js_unregister_port(struct js_port *port); - -extern int js_register_device(struct js_port *port, int number, int axes, - int buttons, char *name, struct module *owner, js_ops_func open, js_ops_func close); -extern void js_unregister_device(struct js_dev *dev); - -/* - * Kernel interface - */ - -extern int js_init(void); -extern int js_am_init(void); -extern int js_an_init(void); -extern int js_as_init(void); -extern int js_console_init(void); -extern int js_cr_init(void); -extern int js_db9_init(void); -extern int js_gr_init(void); -extern int js_l4_init(void); -extern int js_lt_init(void); -extern int js_mag_init(void); -extern int js_pci_init(void); -extern int js_sw_init(void); -extern int js_sball_init(void); -extern int js_orb_init(void); -extern int js_tm_init(void); -extern int js_tg_init(void); -extern int js_war_init(void); - -#endif /* __KERNEL__ */ - #endif /* _LINUX_JOYSTICK_H */ diff --git a/include/linux/linkage.h b/include/linux/linkage.h index d1f1c2861..aaf6edf02 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -9,7 +9,7 @@ #define CPP_ASMLINKAGE #endif -#if defined __i386__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 7) +#if defined __i386__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 7) #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) #elif defined __ia64__ #define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage)) diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 99cd63717..1eca767b4 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h @@ -101,7 +101,7 @@ extern struct buffer_head * minix_bread(struct inode *, int, int); extern void minix_truncate(struct inode *); extern int minix_sync_inode(struct inode *); -extern int minix_sync_file(struct file *, struct dentry *, int); +extern int minix_sync_file(struct file *, struct dentry *); extern struct address_space_operations minix_aops; extern struct inode_operations minix_file_inode_operations; diff --git a/include/linux/mm.h b/include/linux/mm.h index 5875fa8bf..37cb9664e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -153,7 +153,6 @@ typedef struct page { struct buffer_head * buffers; unsigned long virtual; /* nonzero if kmapped */ struct zone_struct *zone; - unsigned int age; } mem_map_t; #define get_page(p) atomic_inc(&(p)->count) @@ -170,7 +169,7 @@ typedef struct page { #define PG_dirty 4 #define PG_decr_after 5 #define PG_unused_01 6 -#define PG_active 7 +#define PG__unused_02 7 #define PG_slab 8 #define PG_swap_cache 9 #define PG_skip 10 @@ -186,7 +185,6 @@ typedef struct page { #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) #define PageDirty(page) test_bit(PG_dirty, &(page)->flags) #define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags) -#define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags) #define PageLocked(page) test_bit(PG_locked, &(page)->flags) #define LockPage(page) set_bit(PG_locked, &(page)->flags) #define TryLockPage(page) test_and_set_bit(PG_locked, &(page)->flags) @@ -194,15 +192,11 @@ typedef struct page { clear_bit(PG_locked, &(page)->flags); \ wake_up(&page->wait); \ } while (0) -#define PageActive(page) test_bit(PG_active, &(page)->flags) -#define SetPageActive(page) set_bit(PG_active, &(page)->flags) -#define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) #define PageError(page) test_bit(PG_error, &(page)->flags) #define SetPageError(page) set_bit(PG_error, &(page)->flags) #define ClearPageError(page) clear_bit(PG_error, &(page)->flags) #define PageReferenced(page) test_bit(PG_referenced, &(page)->flags) #define SetPageReferenced(page) set_bit(PG_referenced, &(page)->flags) -#define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags) #define PageTestandClearReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) #define PageDecrAfter(page) test_bit(PG_decr_after, &(page)->flags) #define SetPageDecrAfter(page) set_bit(PG_decr_after, &(page)->flags) @@ -463,7 +457,6 @@ extern void remove_inode_page(struct page *); extern unsigned long page_unuse(struct page *); extern int shrink_mmap(int, int); extern void truncate_inode_pages(struct address_space *, loff_t); -extern void truncate_all_inode_pages(struct address_space *); /* generic vm_area_ops exported for stackable file systems */ extern int filemap_swapout(struct page * page, struct file *file); diff --git a/include/linux/mount.h b/include/linux/mount.h index adb571de2..61ab19b1f 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -26,6 +26,7 @@ struct vfsmount atomic_t mnt_count; char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ + char *mnt_dirname; /* Name of directory mounted on */ struct list_head mnt_list; uid_t mnt_owner; }; diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index cbbf78528..4897f2ec9 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -248,7 +248,7 @@ extern struct inode *fat_build_inode(struct super_block*,struct msdos_dir_entry* extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent, struct inode_operations *dir_ops); extern void msdos_put_super(struct super_block *sb); extern int fat_statfs(struct super_block *sb,struct statfs *buf); -extern void fat_write_inode(struct inode *inode, int); +extern void fat_write_inode(struct inode *inode); /* dir.c */ extern struct file_operations fat_dir_operations; diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h index ffdf49f4c..96728bcdd 100644 --- a/include/linux/ncp_fs_i.h +++ b/include/linux/ncp_fs_i.h @@ -19,8 +19,7 @@ struct ncp_inode_info { __u32 DosDirNum __attribute__((packed)); __u32 volNumber __attribute__((packed)); __u32 nwattr; - struct semaphore open_sem; - atomic_t opened; + int opened; int access; __u32 server_file_handle __attribute__((packed)); __u8 open_create_action __attribute__((packed)); diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h index 4f20ad01f..e98c9fa8a 100644 --- a/include/linux/nfsd/syscall.h +++ b/include/linux/nfsd/syscall.h @@ -133,7 +133,7 @@ union nfsctl_res { * Kernel syscall implementation. */ #if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE) -extern asmlinkage int sys_nfsservctl(int, void *, void *); +extern asmlinkage long sys_nfsservctl(int, void *, void *); #else #define sys_nfsservctl sys_ni_syscall #endif diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 42a85261f..5512d2a51 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -330,11 +330,12 @@ #define PCI_DEVICE_ID_SI_6205 0x0205 #define PCI_DEVICE_ID_SI_501 0x0406 #define PCI_DEVICE_ID_SI_496 0x0496 +#define PCI_DEVICE_ID_SI_300 0x0300 #define PCI_DEVICE_ID_SI_530 0x0530 -#define PCI_DEVICE_ID_SI_540 0x0540 +#define PCI_DEVICE_ID_SI_540 0x5300 #define PCI_DEVICE_ID_SI_601 0x0601 #define PCI_DEVICE_ID_SI_620 0x0620 -#define PCI_DEVICE_ID_SI_630 0x0630 +#define PCI_DEVICE_ID_SI_630 0x6300 #define PCI_DEVICE_ID_SI_5107 0x5107 #define PCI_DEVICE_ID_SI_5511 0x5511 #define PCI_DEVICE_ID_SI_5513 0x5513 @@ -1201,7 +1202,6 @@ #define PCI_DEVICE_ID_INTEL_82443BX_0 0x7190 #define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191 #define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 -#define PCI_DEVICE_ID_INTEL_82440MX_1 0x7194 #define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198 #define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199 #define PCI_DEVICE_ID_INTEL_82443MX_2 0x719a @@ -1286,8 +1286,3 @@ #define PCI_DEVICE_ID_ARK_STING 0xa091 #define PCI_DEVICE_ID_ARK_STINGARK 0xa099 #define PCI_DEVICE_ID_ARK_2000MT 0xa0a1 - -#define PCI_VENDOR_ID_SIS 0x1039 -#define PCI_DEVICE_ID_SIS_300 0x0300 -#define PCI_DEVICE_ID_SIS_540 0x5300 -#define PCI_DEVICE_ID_SIS_630 0x6300 diff --git a/include/linux/poll.h b/include/linux/poll.h index b83e62d74..b56cdcf4c 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h @@ -20,7 +20,6 @@ struct poll_table_entry { typedef struct poll_table_struct { struct poll_table_struct * next; unsigned int nr; - int err; struct poll_table_entry * entry; } poll_table; diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index dd9b7cb6e..ad5ca5543 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h @@ -116,7 +116,7 @@ extern void qnx4_truncate(struct inode *inode); extern void qnx4_free_inode(struct inode *inode); extern int qnx4_unlink(struct inode *dir, struct dentry *dentry); extern int qnx4_rmdir(struct inode *dir, struct dentry *dentry); -extern int qnx4_sync_file(struct file *file, struct dentry *dentry, int); +extern int qnx4_sync_file(struct file *file, struct dentry *dentry); extern int qnx4_sync_inode(struct inode *inode); extern int qnx4_get_block(struct inode *inode, long iblock, struct buffer_head *bh, int create); diff --git a/include/linux/serio.h b/include/linux/serio.h new file mode 100644 index 000000000..9cb8bb525 --- /dev/null +++ b/include/linux/serio.h @@ -0,0 +1,110 @@ +#ifndef _SERIO_H +#define _SERIO_H + +/* + * $Id: serio.h,v 1.7 2000/06/01 11:39:46 vojtech Exp $ + * + * Copyright (C) 1999 Vojtech Pavlik + * + * Sponsored by SuSE + */ + +/* + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Should you need to contact me, the author, you can do so either by + * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: + * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic + */ + +/* + * The serial port set type ioctl. + */ + +#include <linux/ioctl.h> +#define SPIOCSTYPE _IOW('q', 0x01, unsigned long) + +struct serio; + +struct serio { + + void *private; + void *driver; + + unsigned long type; + int number; + + int (*write)(struct serio *, unsigned char); + int (*open)(struct serio *); + void (*close)(struct serio *); + + struct serio_dev *dev; + + struct serio *next; +}; + +struct serio_dev { + + void *private; + + void (*interrupt)(struct serio *, unsigned char, unsigned int); + void (*connect)(struct serio *, struct serio_dev *dev); + void (*disconnect)(struct serio *); + + struct serio_dev *next; +}; + +int serio_open(struct serio *serio, struct serio_dev *dev); +void serio_close(struct serio *serio); +void serio_rescan(struct serio *serio); + +void serio_register_port(struct serio *serio); +void serio_unregister_port(struct serio *serio); +void serio_register_device(struct serio_dev *dev); +void serio_unregister_device(struct serio_dev *dev); + +static __inline__ int serio_write(struct serio *serio, unsigned char data) +{ + return serio->write(serio, data); +} + +#define SERIO_TIMEOUT 1 +#define SERIO_PARITY 2 + +#define SERIO_TYPE 0xff000000UL +#define SERIO_XT 0x00000000UL +#define SERIO_8042 0x01000000UL +#define SERIO_RS232 0x02000000UL + +#define SERIO_PROTO 0xFFUL +#define SERIO_MSC 0x01 +#define SERIO_SUN 0x02 +#define SERIO_MS 0x03 +#define SERIO_MP 0x04 +#define SERIO_MZ 0x05 +#define SERIO_MZP 0x06 +#define SERIO_MZPP 0x07 +#define SERIO_SUNKBD 0x10 +#define SERIO_WARRIOR 0x18 +#define SERIO_SPACEORB 0x19 +#define SERIO_MAGELLAN 0x1a +#define SERIO_SPACEBALL 0x1b +#define SERIO_GUNZE 0x1c +#define SERIO_IFORCE 0x1d + +#define SERIO_ID 0xff00UL +#define SERIO_EXTRA 0xff0000UL + +#endif diff --git a/include/linux/swap.h b/include/linux/swap.h index 5ee3b7b77..9226ce0a5 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -161,16 +161,6 @@ static inline int is_page_shared(struct page *page) extern spinlock_t pagemap_lru_lock; /* - * Magic constants for page aging. If the system is programmed - * right, tweaking these should have almost no effect... - * The 2.4 code, however, is mostly simple and stable ;) - */ -#define PG_AGE_MAX 64 -#define PG_AGE_START 2 -#define PG_AGE_ADV 3 -#define PG_AGE_DECL 1 - -/* * Helper macros for lru_pages handling. */ #define lru_cache_add(page) \ @@ -178,16 +168,12 @@ do { \ spin_lock(&pagemap_lru_lock); \ list_add(&(page)->lru, &lru_cache); \ nr_lru_pages++; \ - page->age = PG_AGE_START; \ - ClearPageReferenced(page); \ - SetPageActive(page); \ spin_unlock(&pagemap_lru_lock); \ } while (0) #define __lru_cache_del(page) \ do { \ list_del(&(page)->lru); \ - ClearPageActive(page); \ nr_lru_pages--; \ } while (0) diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h index 4cff4260c..d9c2557e5 100644 --- a/include/linux/sysv_fs.h +++ b/include/linux/sysv_fs.h @@ -377,9 +377,9 @@ extern unsigned long sysv_count_free_blocks(struct super_block *sb); extern struct buffer_head * sysv_file_bread(struct inode *, int, int); extern void sysv_truncate(struct inode *); -extern void sysv_write_inode(struct inode *, int); +extern void sysv_write_inode(struct inode *); extern int sysv_sync_inode(struct inode *); -extern int sysv_sync_file(struct file *, struct dentry *, int); +extern int sysv_sync_file(struct file *, struct dentry *); extern int sysv_notify_change(struct dentry *, struct iattr *); extern struct inode_operations sysv_file_inode_operations; diff --git a/include/linux/timer.h b/include/linux/timer.h index 45887372a..2de8050ea 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -1,8 +1,6 @@ #ifndef _LINUX_TIMER_H #define _LINUX_TIMER_H -#ifdef __KERNEL__ - #include <linux/config.h> #include <linux/list.h> @@ -93,11 +91,9 @@ extern int del_timer_sync(struct timer_list * timer); #define timer_set_running(t) (void)(t) #define timer_is_running(t) (0) #define timer_synchronize(t) do { (void)(t); barrier(); } while(0) -#define del_timer_sync del_timer +#define del_timer_sync(t) del_timer(t) #endif -#define del_timer_async del_timer - /* * These inlines deal with timer wrapping correctly. You are * strongly encouraged to use them @@ -116,4 +112,3 @@ extern int del_timer_sync(struct timer_list * timer); #define time_before_eq(a,b) time_after_eq(b,a) #endif -#endif diff --git a/include/linux/types.h b/include/linux/types.h index df4808fcd..196c5f4e0 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -1,10 +1,7 @@ #ifndef _LINUX_TYPES_H #define _LINUX_TYPES_H -#ifdef __KERNEL__ #include <linux/config.h> -#endif - #include <linux/posix_types.h> #include <asm/types.h> diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 3c8f1d415..96cb38e67 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -560,8 +560,9 @@ extern struct inode * ufs_new_inode (const struct inode *, int, int *); extern int ufs_frag_map (struct inode *, int); extern void ufs_read_inode (struct inode *); extern void ufs_put_inode (struct inode *); -extern void ufs_write_inode (struct inode *, int); +extern void ufs_write_inode (struct inode *); extern int ufs_sync_inode (struct inode *); +extern void ufs_write_inode (struct inode *); extern void ufs_delete_inode (struct inode *); extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *); extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); diff --git a/include/linux/umsdos_fs.p b/include/linux/umsdos_fs.p index 677bee22e..76436a479 100644 --- a/include/linux/umsdos_fs.p +++ b/include/linux/umsdos_fs.p @@ -48,7 +48,7 @@ int umsdos_isempty (struct dentry *); /* inode.c 12/06/95 09.49.40 */ void fill_new_filp (struct file *filp, struct dentry *dentry); void UMSDOS_read_inode (struct inode *); -void UMSDOS_write_inode (struct inode *, int); +void UMSDOS_write_inode (struct inode *); int UMSDOS_notify_change (struct dentry *, struct iattr *attr); int umsdos_notify_change_locked(struct dentry *, struct iattr *attr); void UMSDOS_put_inode (struct inode *); diff --git a/include/net/dn.h b/include/net/dn.h index c1d4854de..52c6ba44d 100644 --- a/include/net/dn.h +++ b/include/net/dn.h @@ -6,8 +6,8 @@ typedef unsigned short dn_address; -#define dn_ntohs(x) le16_to_cpu(x) -#define dn_htons(x) cpu_to_le16(x) +#define dn_ntohs(x) le16_to_cpu((unsigned short)(x)) +#define dn_htons(x) cpu_to_le16((unsigned short)(x)) struct dn_scp /* Session Control Port */ { diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index d816d4fac..2ea636834 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h @@ -64,7 +64,9 @@ struct ifmcaddr6 struct ifmcaddr6 *next; struct timer_list mca_timer; unsigned mca_flags; - atomic_t mca_users; + int mca_users; + atomic_t mca_refcnt; + spinlock_t mca_lock; }; #define IFA_HOST IPV6_ADDR_LOOPBACK |