diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-03-08 04:25:54 -0500 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-03-08 04:25:54 -0500 |
| commit | def7102a5bd2d60b1a96a58a39846150285d7c77 (patch) | |
| tree | df0e6726c593a7e1f820a3341c627835a1c0d5ce /include | |
| parent | a4bc8f1c791fa542a6f0f8043b670690894bd440 (diff) | |
| parent | 09aa3367ff6a0bbff7ce35eb770aab23bc9d4213 (diff) | |
Merge pobox.com:/garz/repo/linux-2.6
into pobox.com:/garz/repo/net-drivers-2.6
Diffstat (limited to 'include')
99 files changed, 1212 insertions, 1246 deletions
diff --git a/include/asm-alpha/resource.h b/include/asm-alpha/resource.h index f9fb6607d365..c10874ff5973 100644 --- a/include/asm-alpha/resource.h +++ b/include/asm-alpha/resource.h @@ -2,32 +2,20 @@ #define _ALPHA_RESOURCE_H /* - * Resource limits + * Alpha/Linux-specific ordering of these four resource limit IDs, + * the rest comes from the generic header: */ - -#define RLIMIT_CPU 0 /* CPU time in ms */ -#define RLIMIT_FSIZE 1 /* Maximum filesize */ -#define RLIMIT_DATA 2 /* max data size */ -#define RLIMIT_STACK 3 /* max stack size */ -#define RLIMIT_CORE 4 /* max core file size */ -#define RLIMIT_RSS 5 /* max resident set size */ -#define RLIMIT_NOFILE 6 /* max number of open files */ -#define RLIMIT_AS 7 /* address space limit(?) */ -#define RLIMIT_NPROC 8 /* max number of processes */ -#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ -#define RLIMIT_LOCKS 10 /* maximum file locks held */ -#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ -#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ - -#define RLIM_NLIMITS 13 -#define __ARCH_RLIMIT_ORDER +#define RLIMIT_NOFILE 6 /* max number of open files */ +#define RLIMIT_AS 7 /* address space limit */ +#define RLIMIT_NPROC 8 /* max number of processes */ +#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ /* * SuS says limits have to be unsigned. Fine, it's unsigned, but * we retain the old value for compatibility, especially with DU. * When you run into the 2^63 barrier, you call me. */ -#define RLIM_INFINITY 0x7ffffffffffffffful +#define RLIM_INFINITY 0x7ffffffffffffffful #include <asm-generic/resource.h> diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h index 7ba1bfc6254f..b1fcda9eac23 100644 --- a/include/asm-generic/resource.h +++ b/include/asm-generic/resource.h @@ -2,57 +2,85 @@ #define _ASM_GENERIC_RESOURCE_H /* - * Resource limits + * Resource limit IDs + * + * ( Compatibility detail: there are architectures that have + * a different rlimit ID order in the 5-9 range and want + * to keep that order for binary compatibility. The reasons + * are historic and all new rlimits are identical across all + * arches. If an arch has such special order for some rlimits + * then it defines them prior including asm-generic/resource.h. ) */ -/* Allow arch to control resource order */ -#ifndef __ARCH_RLIMIT_ORDER #define RLIMIT_CPU 0 /* CPU time in ms */ #define RLIMIT_FSIZE 1 /* Maximum filesize */ #define RLIMIT_DATA 2 /* max data size */ #define RLIMIT_STACK 3 /* max stack size */ #define RLIMIT_CORE 4 /* max core file size */ -#define RLIMIT_RSS 5 /* max resident set size */ -#define RLIMIT_NPROC 6 /* max number of processes */ -#define RLIMIT_NOFILE 7 /* max number of open files */ -#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ -#define RLIMIT_AS 9 /* address space limit */ + +#ifndef RLIMIT_RSS +# define RLIMIT_RSS 5 /* max resident set size */ +#endif + +#ifndef RLIMIT_NPROC +# define RLIMIT_NPROC 6 /* max number of processes */ +#endif + +#ifndef RLIMIT_NOFILE +# define RLIMIT_NOFILE 7 /* max number of open files */ +#endif + +#ifndef RLIMIT_MEMLOCK +# define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ +#endif + +#ifndef RLIMIT_AS +# define RLIMIT_AS 9 /* address space limit */ +#endif + #define RLIMIT_LOCKS 10 /* maximum file locks held */ #define RLIMIT_SIGPENDING 11 /* max number of pending signals */ #define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ #define RLIM_NLIMITS 13 -#endif /* * SuS says limits have to be unsigned. * Which makes a ton more sense anyway. + * + * Some architectures override this (for compatibility reasons): */ #ifndef RLIM_INFINITY -#define RLIM_INFINITY (~0UL) +# define RLIM_INFINITY (~0UL) #endif +/* + * RLIMIT_STACK default maximum - some architectures override it: + */ #ifndef _STK_LIM_MAX -#define _STK_LIM_MAX RLIM_INFINITY +# define _STK_LIM_MAX RLIM_INFINITY #endif #ifdef __KERNEL__ +/* + * boot-time rlimit defaults for the init task: + */ #define INIT_RLIMITS \ { \ - [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \ - [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \ - [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \ - [RLIMIT_STACK] = { _STK_LIM, _STK_LIM_MAX }, \ - [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ - [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ - [RLIMIT_NPROC] = { 0, 0 }, \ - [RLIMIT_NOFILE] = { INR_OPEN, INR_OPEN }, \ - [RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \ - [RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \ - [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ - [RLIMIT_SIGPENDING] = { MAX_SIGPENDING, MAX_SIGPENDING }, \ - [RLIMIT_MSGQUEUE] = { MQ_BYTES_MAX, MQ_BYTES_MAX }, \ + [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \ + [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \ + [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \ + [RLIMIT_STACK] = { _STK_LIM, _STK_LIM_MAX }, \ + [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ + [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ + [RLIMIT_NPROC] = { 0, 0 }, \ + [RLIMIT_NOFILE] = { INR_OPEN, INR_OPEN }, \ + [RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \ + [RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \ + [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ + [RLIMIT_SIGPENDING] = { 0, 0 }, \ + [RLIMIT_MSGQUEUE] = { MQ_BYTES_MAX, MQ_BYTES_MAX }, \ } #endif /* __KERNEL__ */ diff --git a/include/asm-i386/mach-default/mach_traps.h b/include/asm-i386/mach-default/mach_traps.h index c98c2880c5c9..625438b8a6eb 100644 --- a/include/asm-i386/mach-default/mach_traps.h +++ b/include/asm-i386/mach-default/mach_traps.h @@ -7,6 +7,8 @@ #ifndef _MACH_TRAPS_H #define _MACH_TRAPS_H +#include <asm/mc146818rtc.h> + static inline void clear_mem_error(unsigned char reason) { reason = (reason & 0xf) | 4; @@ -20,10 +22,20 @@ static inline unsigned char get_nmi_reason(void) static inline void reassert_nmi(void) { + int old_reg = -1; + + if (do_i_have_lock_cmos()) + old_reg = current_lock_cmos_reg(); + else + lock_cmos(0); /* register doesn't matter here */ outb(0x8f, 0x70); inb(0x71); /* dummy */ outb(0x0f, 0x70); inb(0x71); /* dummy */ + if (old_reg >= 0) + outb(old_reg, 0x70); + else + unlock_cmos(); } #endif /* !_MACH_TRAPS_H */ diff --git a/include/asm-i386/mc146818rtc.h b/include/asm-i386/mc146818rtc.h index d6e3009430c1..99a890047023 100644 --- a/include/asm-i386/mc146818rtc.h +++ b/include/asm-i386/mc146818rtc.h @@ -5,24 +5,89 @@ #define _ASM_MC146818RTC_H #include <asm/io.h> +#include <asm/system.h> +#include <linux/mc146818rtc.h> #ifndef RTC_PORT #define RTC_PORT(x) (0x70 + (x)) #define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */ #endif +#ifdef __HAVE_ARCH_CMPXCHG +/* + * This lock provides nmi access to the CMOS/RTC registers. It has some + * special properties. It is owned by a CPU and stores the index register + * currently being accessed (if owned). The idea here is that it works + * like a normal lock (normally). However, in an NMI, the NMI code will + * first check to see if its CPU owns the lock, meaning that the NMI + * interrupted during the read/write of the device. If it does, it goes ahead + * and performs the access and then restores the index register. If it does + * not, it locks normally. + * + * Note that since we are working with NMIs, we need this lock even in + * a non-SMP machine just to mark that the lock is owned. + * + * This only works with compare-and-swap. There is no other way to + * atomically claim the lock and set the owner. + */ +#include <linux/smp.h> +extern volatile unsigned long cmos_lock; + +/* + * All of these below must be called with interrupts off, preempt + * disabled, etc. + */ + +static inline void lock_cmos(unsigned char reg) +{ + unsigned long new; + new = ((smp_processor_id()+1) << 8) | reg; + for (;;) { + if (cmos_lock) + continue; + if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0) + return; + } +} + +static inline void unlock_cmos(void) +{ + cmos_lock = 0; +} +static inline int do_i_have_lock_cmos(void) +{ + return (cmos_lock >> 8) == (smp_processor_id()+1); +} +static inline unsigned char current_lock_cmos_reg(void) +{ + return cmos_lock & 0xff; +} +#define lock_cmos_prefix(reg) \ + do { \ + unsigned long cmos_flags; \ + local_irq_save(cmos_flags); \ + lock_cmos(reg) +#define lock_cmos_suffix(reg) \ + unlock_cmos(); \ + local_irq_restore(cmos_flags); \ + } while (0) +#else +#define lock_cmos_prefix(reg) do {} while (0) +#define lock_cmos_suffix(reg) do {} while (0) +#define lock_cmos(reg) +#define unlock_cmos() +#define do_i_have_lock_cmos() 0 +#define current_lock_cmos_reg() 0 +#endif + /* * The yet supported machines all access the RTC index register via * an ISA port access but the way to access the date register differs ... */ -#define CMOS_READ(addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -inb_p(RTC_PORT(1)); \ -}) -#define CMOS_WRITE(val, addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -outb_p((val),RTC_PORT(1)); \ -}) +#define CMOS_READ(addr) rtc_cmos_read(addr) +#define CMOS_WRITE(val, addr) rtc_cmos_write(val, addr) +unsigned char rtc_cmos_read(unsigned char addr); +void rtc_cmos_write(unsigned char val, unsigned char addr); #define RTC_IRQ 8 diff --git a/include/asm-i386/module.h b/include/asm-i386/module.h index 14cacba9ccbb..508865e26308 100644 --- a/include/asm-i386/module.h +++ b/include/asm-i386/module.h @@ -52,6 +52,8 @@ struct mod_arch_specific #define MODULE_PROC_FAMILY "CYRIXIII " #elif defined CONFIG_MVIAC3_2 #define MODULE_PROC_FAMILY "VIAC3-2 " +#elif CONFIG_MGEODE +#define MODULE_PROC_FAMILY "GEODE " #else #error unknown processor family #endif diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 70a48f509d24..e6984fdadefc 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -137,7 +137,7 @@ static inline void detect_ht(struct cpuinfo_x86 *c) {} * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx * resulting in stale register contents being returned. */ -static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) +static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { __asm__("cpuid" : "=a" (*eax), diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h index f63799f2d2f9..9d3f0f25d990 100644 --- a/include/asm-i386/suspend.h +++ b/include/asm-i386/suspend.h @@ -10,10 +10,12 @@ static inline int arch_prepare_suspend(void) { /* If you want to make non-PSE machine work, turn off paging - in do_magic. swsusp_pg_dir should have identity mapping, so + in swsusp_arch_suspend. swsusp_pg_dir should have identity mapping, so it could work... */ - if (!cpu_has_pse) + if (!cpu_has_pse) { + printk(KERN_ERR "PSE is required for swsusp.\n"); return -EPERM; + } return 0; } diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index de75216b624b..2cd57271801d 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h @@ -140,6 +140,7 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; #define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ #define TIF_IRET 5 /* return with iret */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ +#define TIF_SECCOMP 8 /* secure computing */ #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_MEMDIE 17 @@ -150,12 +151,14 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) #define _TIF_IRET (1<<TIF_IRET) #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) +#define _TIF_SECCOMP (1<<TIF_SECCOMP) #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) /* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \ - (0x0000FFFF & ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)) -#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ + (0x0000FFFF & ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP|_TIF_SECCOMP)) +/* work to do on any return to u-space */ +#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) /* * Thread-synchronous status. diff --git a/include/asm-m32r/bug.h b/include/asm-m32r/bug.h index a6d1efea1164..4cc0462c15b8 100644 --- a/include/asm-m32r/bug.h +++ b/include/asm-m32r/bug.h @@ -1,22 +1,4 @@ #ifndef _M32R_BUG_H #define _M32R_BUG_H - -#define BUG() do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ -} while (0) - -#define PAGE_BUG(page) do { BUG(); } while (0) - -#define BUG_ON(condition) \ - do { if (unlikely((condition)!=0)) BUG(); } while(0) - -#define WARN_ON(condition) do { \ - if (unlikely((condition)!=0)) { \ - printk("Badness in %s at %s:%d\n", __FUNCTION__, \ - __FILE__, __LINE__); \ - dump_stack(); \ - } \ -} while (0) - -#endif /* _M32R_BUG_H */ - +#include <asm-generic/bug.h> +#endif diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h index 9732bb4c4b12..fd3c6d17a5f6 100644 --- a/include/asm-mips/resource.h +++ b/include/asm-mips/resource.h @@ -9,36 +9,26 @@ #ifndef _ASM_RESOURCE_H #define _ASM_RESOURCE_H +#include <linux/config.h> + /* - * Resource limits + * These five resource limit IDs have a MIPS/Linux-specific ordering, + * the rest comes from the generic header: */ -#define RLIMIT_CPU 0 /* CPU time in ms */ -#define RLIMIT_FSIZE 1 /* Maximum filesize */ -#define RLIMIT_DATA 2 /* max data size */ -#define RLIMIT_STACK 3 /* max stack size */ -#define RLIMIT_CORE 4 /* max core file size */ -#define RLIMIT_NOFILE 5 /* max number of open files */ -#define RLIMIT_AS 6 /* mapped memory */ -#define RLIMIT_RSS 7 /* max resident set size */ -#define RLIMIT_NPROC 8 /* max number of processes */ -#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ -#define RLIMIT_LOCKS 10 /* maximum file locks held */ -#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ -#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ - -#define RLIM_NLIMITS 13 /* Number of limit flavors. */ -#define __ARCH_RLIMIT_ORDER +#define RLIMIT_NOFILE 5 /* max number of open files */ +#define RLIMIT_AS 6 /* address space limit */ +#define RLIMIT_RSS 7 /* max resident set size */ +#define RLIMIT_NPROC 8 /* max number of processes */ +#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ /* * SuS says limits have to be unsigned. - * Which makes a ton more sense anyway. + * Which makes a ton more sense anyway, + * but we keep the old value on MIPS32, + * for compatibility: */ -#include <linux/config.h> #ifdef CONFIG_MIPS32 -#define RLIM_INFINITY 0x7fffffffUL -#endif -#ifdef CONFIG_MIPS64 -#define RLIM_INFINITY (~0UL) +# define RLIM_INFINITY 0x7fffffffUL #endif #include <asm-generic/resource.h> diff --git a/include/asm-mips/vr41xx/siu.h b/include/asm-mips/vr41xx/siu.h new file mode 100644 index 000000000000..865cc07ddd7f --- /dev/null +++ b/include/asm-mips/vr41xx/siu.h @@ -0,0 +1,50 @@ +/* + * Include file for NEC VR4100 series Serial Interface Unit. + * + * Copyright (C) 2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> + * + * 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 + */ +#ifndef __NEC_VR41XX_SIU_H +#define __NEC_VR41XX_SIU_H + +typedef enum { + SIU_INTERFACE_RS232C, + SIU_INTERFACE_IRDA, +} siu_interface_t; + +extern void vr41xx_select_siu_interface(siu_interface_t interface); + +typedef enum { + SIU_USE_IRDA, + FIR_USE_IRDA, +} irda_use_t; + +extern void vr41xx_use_irda(irda_use_t use); + +typedef enum { + SHARP_IRDA, + TEMIC_IRDA, + HP_IRDA, +} irda_module_t; + +typedef enum { + IRDA_TX_1_5MBPS, + IRDA_TX_4MBPS, +} irda_speed_t; + +extern void vr41xx_select_irda_module(irda_module_t module, irda_speed_t speed); + +#endif /* __NEC_VR41XX_SIU_H */ diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h index 8ac8487e2790..caacaced3213 100644 --- a/include/asm-mips/vr41xx/vr41xx.h +++ b/include/asm-mips/vr41xx/vr41xx.h @@ -84,7 +84,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); #define INT2_CASCADE_IRQ MIPS_CPU_IRQ(4) #define INT3_CASCADE_IRQ MIPS_CPU_IRQ(5) #define INT4_CASCADE_IRQ MIPS_CPU_IRQ(6) -#define MIPS_COUNTER_IRQ MIPS_CPU_IRQ(7) +#define TIMER_IRQ MIPS_CPU_IRQ(7) /* SYINT1 Interrupt Numbers */ #define SYSINT1_IRQ_BASE 8 @@ -248,34 +248,6 @@ enum { }; /* - * Serial Interface Unit - */ -extern void vr41xx_siu_init(void); -extern int vr41xx_serial_ports; - -/* SIU interfaces */ -typedef enum { - SIU_RS232C, - SIU_IRDA -} siu_interface_t; - -/* IrDA interfaces */ -typedef enum { - IRDA_NONE, - IRDA_SHARP, - IRDA_TEMIC, - IRDA_HP -} irda_module_t; - -extern void vr41xx_select_siu_interface(siu_interface_t interface, - irda_module_t module); - -/* - * Debug Serial Interface Unit - */ -extern void vr41xx_dsiu_init(void); - -/* * PCI Control Unit */ #define PCI_MASTER_ADDRESS_MASK 0x7fffffffU diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h index deee992463ca..2746a9cdede4 100644 --- a/include/asm-ppc/serial.h +++ b/include/asm-ppc/serial.h @@ -36,6 +36,8 @@ #include <asm/mpc83xx.h> #elif defined(CONFIG_85xx) #include <asm/mpc85xx.h> +#elif defined(CONFIG_RADSTONE_PPC7D) +#include <platforms/radstone_ppc7d.h> #else /* diff --git a/include/asm-ppc64/kprobes.h b/include/asm-ppc64/kprobes.h index 097f0d63d1e2..19b468bed059 100644 --- a/include/asm-ppc64/kprobes.h +++ b/include/asm-ppc64/kprobes.h @@ -35,6 +35,11 @@ typedef unsigned int kprobe_opcode_t; #define BREAKPOINT_INSTRUCTION 0x7fe00008 /* trap */ #define MAX_INSN_SIZE 1 +#define IS_TW(instr) (((instr) & 0xfc0007fe) == 0x7c000008) +#define IS_TD(instr) (((instr) & 0xfc0007fe) == 0x7c000088) +#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) +#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) + #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) /* Architecture specific copy of original instruction */ diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h index 9b952e933fce..264f30dd1540 100644 --- a/include/asm-ppc64/prom.h +++ b/include/asm-ppc64/prom.h @@ -137,6 +137,7 @@ struct device_node { int devfn; /* for pci devices */ int eeh_mode; /* See eeh.h for possible EEH_MODEs */ int eeh_config_addr; + int pci_ext_config_space; /* for pci devices */ struct pci_controller *phb; /* for pci devices */ struct iommu_table *iommu_table; /* for phb's or bridges */ diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index b918318f86a2..1633cb75f057 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h @@ -752,11 +752,17 @@ extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66 * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23 */ +#ifndef __s390x__ +#define __SWP_OFFSET_MASK (~0UL >> 12) +#else +#define __SWP_OFFSET_MASK (~0UL >> 11) +#endif extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) { pte_t pte; + offset &= __SWP_OFFSET_MASK; pte_val(pte) = _PAGE_INVALID_SWAP | ((type & 0x1f) << 2) | - ((offset & 1) << 7) | ((offset & 0xffffe) << 11); + ((offset & 1UL) << 7) | ((offset & ~1UL) << 11); return pte; } diff --git a/include/asm-s390/posix_types.h b/include/asm-s390/posix_types.h index a6ac95dc9576..61788de3c0c3 100644 --- a/include/asm-s390/posix_types.h +++ b/include/asm-s390/posix_types.h @@ -83,16 +83,16 @@ typedef struct { #endif #undef __FD_SET -#define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp->fds_bits) +#define __FD_SET(fd,fdsetp) set_bit((fd),(fdsetp)->fds_bits) #undef __FD_CLR -#define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp->fds_bits) +#define __FD_CLR(fd,fdsetp) clear_bit((fd),(fdsetp)->fds_bits) #undef __FD_ISSET -#define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp->fds_bits) +#define __FD_ISSET(fd,fdsetp) test_bit((fd),(fdsetp)->fds_bits) #undef __FD_ZERO -#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) +#define __FD_ZERO(fdsetp) (memset ((fdsetp), 0, sizeof(*(fd_set *)(fdsetp)))) #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)*/ diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index e992bd6b59de..9473786387a3 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h @@ -18,6 +18,7 @@ #if defined(__KERNEL__) && defined(CONFIG_SMP) && !defined(__ASSEMBLY__) #include <asm/lowcore.h> +#include <asm/sigp.h> /* s390 specific smp.c headers @@ -59,6 +60,30 @@ extern __inline__ __u16 hard_smp_processor_id(void) return cpu_address; } +/* + * returns 1 if cpu is in stopped/check stopped state or not operational + * returns 0 otherwise + */ +static inline int +smp_cpu_not_running(int cpu) +{ + __u32 status; + + switch (signal_processor_ps(&status, 0, cpu, sigp_sense)) { + case sigp_order_code_accepted: + case sigp_status_stored: + /* Check for stopped and check stop state */ + if (status & 0x50) + return 1; + break; + case sigp_not_operational: + return 1; + default: + break; + } + return 0; +} + #define cpu_logical_map(cpu) (cpu) extern int __cpu_disable (void); diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 037b8d16e435..81514d76edcf 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h @@ -335,19 +335,23 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) __asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" ); #define __ctl_load(array, low, high) ({ \ + typedef struct { char _[sizeof(array)]; } addrtype; \ __asm__ __volatile__ ( \ " bras 1,0f\n" \ " lctlg 0,0,0(%0)\n" \ "0: ex %1,0(1)" \ - : : "a" (&array), "a" (((low)<<4)+(high)) : "1" ); \ + : : "a" (&array), "a" (((low)<<4)+(high)), \ + "m" (*(addrtype *)(array)) : "1" ); \ }) #define __ctl_store(array, low, high) ({ \ + typedef struct { char _[sizeof(array)]; } addrtype; \ __asm__ __volatile__ ( \ " bras 1,0f\n" \ " stctg 0,0,0(%1)\n" \ "0: ex %2,0(1)" \ - : "=m" (array) : "a" (&array), "a" (((low)<<4)+(high)) : "1" ); \ + : "=m" (*(addrtype *)(array)) \ + : "a" (&array), "a" (((low)<<4)+(high)) : "1" ); \ }) #define __ctl_set_bit(cr, bit) ({ \ @@ -390,19 +394,23 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) __asm__ __volatile__("lpsw 0(%0)" : : "a" (&psw) : "cc" ); #define __ctl_load(array, low, high) ({ \ + typedef struct { char _[sizeof(array)]; } addrtype; \ __asm__ __volatile__ ( \ " bras 1,0f\n" \ " lctl 0,0,0(%0)\n" \ "0: ex %1,0(1)" \ - : : "a" (&array), "a" (((low)<<4)+(high)) : "1" ); \ + : : "a" (&array), "a" (((low)<<4)+(high)), \ + "m" (*(addrtype *)(array)) : "1" ); \ }) #define __ctl_store(array, low, high) ({ \ + typedef struct { char _[sizeof(array)]; } addrtype; \ __asm__ __volatile__ ( \ " bras 1,0f\n" \ " stctl 0,0,0(%1)\n" \ "0: ex %2,0(1)" \ - : "=m" (array) : "a" (&array), "a" (((low)<<4)+(high)): "1" ); \ + : "=m" (*(addrtype *)(array)) \ + : "a" (&array), "a" (((low)<<4)+(high)): "1" ); \ }) #define __ctl_set_bit(cr, bit) ({ \ diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index 5eda2c334dc7..4eb72a825d7b 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h @@ -161,7 +161,7 @@ struct exception_table_entry __put_user_asm(__x, ptr, __pu_err); \ break; \ default: \ - __pu_err = __put_user_bad(); \ + __put_user_bad(); \ break; \ } \ __pu_err; \ @@ -182,7 +182,7 @@ struct exception_table_entry }) -extern int __put_user_bad(void); +extern int __put_user_bad(void) __attribute__((noreturn)); #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) #define __get_user_asm(x, ptr, err) \ @@ -225,8 +225,7 @@ extern int __put_user_bad(void); __get_user_asm(__x, ptr, __gu_err); \ break; \ default: \ - __x = 0; \ - __gu_err = __get_user_bad(); \ + __get_user_bad(); \ break; \ } \ (x) = __x; \ @@ -248,7 +247,7 @@ extern int __put_user_bad(void); __get_user(x, ptr); \ }) -extern int __get_user_bad(void); +extern int __get_user_bad(void) __attribute__((noreturn)); #define __put_user_unaligned __put_user #define __get_user_unaligned __get_user diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index ad3063446a64..9ea436e2440e 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h @@ -270,8 +270,11 @@ #define __NR_mq_notify 275 #define __NR_mq_getsetattr 276 /* Number 277 is reserved for new sys_kexec_load */ +#define __NR_add_key 278 +#define __NR_request_key 279 +#define __NR_keyctl 280 -#define NR_syscalls 278 +#define NR_syscalls 281 /* * There are some system calls that are not present on 64 bit, some diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h index 18055347bce8..5163d1ff2f1b 100644 --- a/include/asm-sh/bitops.h +++ b/include/asm-sh/bitops.h @@ -262,9 +262,9 @@ found_middle: #define find_first_bit(addr, size) \ find_next_bit((addr), (size), 0) -static __inline__ int find_next_zero_bit(void *addr, int size, int offset) +static __inline__ int find_next_zero_bit(const unsigned long *addr, int size, int offset) { - unsigned long *p = ((unsigned long *) addr) + (offset >> 5); + const unsigned long *p = ((unsigned long *) addr) + (offset >> 5); unsigned long result = offset & ~31UL; unsigned long tmp; @@ -325,7 +325,7 @@ found_middle: * bits is cleared. */ -static inline int sched_find_first_bit(unsigned long *b) +static inline int sched_find_first_bit(const unsigned long *b) { if (unlikely(b[0])) return __ffs(b[0]); diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h index ea41e17bb959..70172217140f 100644 --- a/include/asm-sh/bug.h +++ b/include/asm-sh/bug.h @@ -8,7 +8,7 @@ */ #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ - asm volatile("nop"); \ + *(volatile int *)0 = 0; \ } while (0) #define HAVE_ARCH_BUG diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h index 27b005af91d2..9dfb33edb008 100644 --- a/include/asm-sh/cacheflush.h +++ b/include/asm-sh/cacheflush.h @@ -1,5 +1,6 @@ #ifndef __ASM_SH_CACHEFLUSH_H #define __ASM_SH_CACHEFLUSH_H +#ifdef __KERNEL__ #include <asm/cpu/cacheflush.h> @@ -26,4 +27,5 @@ extern void __flush_invalidate_region(void *start, int size); memcpy(dst, src, len); \ } while (0) +#endif /* __KERNEL__ */ #endif /* __ASM_SH_CACHEFLUSH_H */ diff --git a/include/asm-sh/cpu-sh3/freq.h b/include/asm-sh/cpu-sh3/freq.h index ffe798e960cf..b61b6e331df0 100644 --- a/include/asm-sh/cpu-sh3/freq.h +++ b/include/asm-sh/cpu-sh3/freq.h @@ -10,7 +10,11 @@ #ifndef __ASM_CPU_SH3_FREQ_H #define __ASM_CPU_SH3_FREQ_H +#if defined(CONFIG_CPU_SUBTYPE_SH7300) +#define FRQCR 0xa415ff80 +#else #define FRQCR 0xffffff80 +#endif #define MIN_DIVISOR_NR 0 #define MAX_DIVISOR_NR 4 diff --git a/include/asm-sh/cpu-sh3/timer.h b/include/asm-sh/cpu-sh3/timer.h new file mode 100644 index 000000000000..3d8e95e8d10c --- /dev/null +++ b/include/asm-sh/cpu-sh3/timer.h @@ -0,0 +1,64 @@ +/* + * include/asm-sh/cpu-sh3/timer.h + * + * Copyright (C) 2004 Lineo Solutions, Inc. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#ifndef __ASM_CPU_SH3_TIMER_H +#define __ASM_CPU_SH3_TIMER_H + +/* + * --------------------------------------------------------------------------- + * TMU Common definitions for SH3 processors + * SH7706 + * SH7709S + * SH7727 + * SH7729R + * SH7710 + * SH7720 + * SH7300 + * --------------------------------------------------------------------------- + */ + +#if defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7710) +#define TMU_TSTR 0xa412fe92 /* Byte access */ + +#define TMU0_TCOR 0xa412fe94 /* Long access */ +#define TMU0_TCNT 0xa412fe98 /* Long access */ +#define TMU0_TCR 0xa412fe9c /* Word access */ + +#define TMU1_TCOR 0xa412fea0 /* Long access */ +#define TMU1_TCNT 0xa412fea4 /* Long access */ +#define TMU1_TCR 0xa412fea8 /* Word access */ + +#define TMU2_TCOR 0xa412feac /* Long access */ +#define TMU2_TCNT 0xa412feb0 /* Long access */ +#define TMU2_TCR 0xa412feb4 /* Word access */ + +#else +#if !defined(CONFIG_CPU_SUBTYPE_SH7727) +#define TMU_TOCR 0xfffffe90 /* Byte access */ +#endif +#define TMU_TSTR 0xfffffe92 /* Byte access */ + +#define TMU0_TCOR 0xfffffe94 /* Long access */ +#define TMU0_TCNT 0xfffffe98 /* Long access */ +#define TMU0_TCR 0xfffffe9c /* Word access */ + +#define TMU1_TCOR 0xfffffea0 /* Long access */ +#define TMU1_TCNT 0xfffffea4 /* Long access */ +#define TMU1_TCR 0xfffffea8 /* Word access */ + +#define TMU2_TCOR 0xfffffeac /* Long access */ +#define TMU2_TCNT 0xfffffeb0 /* Long access */ +#define TMU2_TCR 0xfffffeb4 /* Word access */ +#if !defined(CONFIG_CPU_SUBTYPE_SH7727) +#define TMU2_TCPR2 0xfffffeb8 /* Long access */ +#endif +#endif + +#endif /* __ASM_CPU_SH3_TIMER_H */ + diff --git a/include/asm-sh/cpu-sh4/timer.h b/include/asm-sh/cpu-sh4/timer.h new file mode 100644 index 000000000000..8a4af126c890 --- /dev/null +++ b/include/asm-sh/cpu-sh4/timer.h @@ -0,0 +1,51 @@ +/* + * include/asm-sh/cpu-sh4/timer.h + * + * Copyright (C) 2004 Lineo Solutions, Inc. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#ifndef __ASM_CPU_SH4_TIMER_H +#define __ASM_CPU_SH4_TIMER_H + +/* + * --------------------------------------------------------------------------- + * TMU Common definitions for SH4 processors + * SH7750S/SH7750R + * SH7751/SH7751R + * SH7760 + * --------------------------------------------------------------------------- + */ + +#if !defined(CONFIG_CPU_SUBTYPE_SH7760) +#define TMU_TOCR 0xffd80000 /* Byte access */ +#endif +#define TMU_TSTR 0xffd80004 /* Byte access */ + +#define TMU0_TCOR 0xffd80008 /* Long access */ +#define TMU0_TCNT 0xffd8000c /* Long access */ +#define TMU0_TCR 0xffd80010 /* Word access */ + +#define TMU1_TCOR 0xffd80014 /* Long access */ +#define TMU1_TCNT 0xffd80018 /* Long access */ +#define TMU1_TCR 0xffd8001c /* Word access */ + +#define TMU2_TCOR 0xffd80020 /* Long access */ +#define TMU2_TCNT 0xffd80024 /* Long access */ +#define TMU2_TCR 0xffd80028 /* Word access */ +#define TMU2_TCPR 0xffd8002c /* Long access */ + +#if !defined(CONFIG_CPU_SUBTYPE_SH7760) +#define TMU3_TCOR 0xfe100008 /* Long access */ +#define TMU3_TCNT 0xfe10000c /* Long access */ +#define TMU3_TCR 0xfe100010 /* Word access */ + +#define TMU4_TCOR 0xfe100014 /* Long access */ +#define TMU4_TCNT 0xfe100018 /* Long access */ +#define TMU4_TCR 0xfe10001c /* Word access */ +#endif + +#endif /* __ASM_CPU_SH4_TIMER_H */ + diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h index db78317df116..80d164c1529e 100644 --- a/include/asm-sh/dma-mapping.h +++ b/include/asm-sh/dma-mapping.h @@ -3,7 +3,6 @@ #include <linux/config.h> #include <linux/mm.h> -#include <linux/device.h> #include <asm/scatterlist.h> #include <asm/io.h> diff --git a/include/asm-sh/hardirq.h b/include/asm-sh/hardirq.h index ee010848c314..f2fdf0f760e5 100644 --- a/include/asm-sh/hardirq.h +++ b/include/asm-sh/hardirq.h @@ -12,15 +12,6 @@ typedef struct { #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ -#define HARDIRQ_BITS 8 - -/* - * The hardirq mask has to be large enough to have - * space for potentially all IRQ sources in the system - * nesting on a single CPU: - */ -#if (1 << HARDIRQ_BITS) < NR_IRQS -# error HARDIRQ_BITS is too low! -#endif +extern void ack_bad_irq(unsigned int irq); #endif /* __ASM_SH_HARDIRQ_H */ diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index 87d148105183..831e52ee45b5 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h @@ -17,7 +17,8 @@ #if defined(CONFIG_SH_HP600) || \ defined(CONFIG_SH_RTS7751R2D) || \ - defined(CONFIG_SH_HS7751RVOIP) + defined(CONFIG_SH_HS7751RVOIP) || \ + defined(CONFIG_SH_SH03) #include <asm/mach/ide.h> #endif diff --git a/include/asm-sh/mc146818rtc.h b/include/asm-sh/mc146818rtc.h index 4ec4f7370ba8..1707cfb2915d 100644 --- a/include/asm-sh/mc146818rtc.h +++ b/include/asm-sh/mc146818rtc.h @@ -16,6 +16,7 @@ /* FIXME:RTC Interrupt feature is not implemented yet. */ #undef RTC_IRQ +#define RTC_IRQ 0 #if defined(CONFIG_CPU_SH3) #define RTC_PORT(n) (R64CNT+(n)*2) diff --git a/include/asm-sh/sh03/ide.h b/include/asm-sh/sh03/ide.h new file mode 100644 index 000000000000..73ee92e5c79e --- /dev/null +++ b/include/asm-sh/sh03/ide.h @@ -0,0 +1,7 @@ +#ifndef __ASM_SH_SH03_IDE_H +#define __ASM_SH_SH03_IDE_H + +#define IRQ_CFCARD 8 +#define IRQ_PCMCIA 8 + +#endif /* __ASM_SH_SH03_IDE_H */ diff --git a/include/asm-sh64/bug.h b/include/asm-sh64/bug.h index 9a81b7232f14..3acd54d59566 100644 --- a/include/asm-sh64/bug.h +++ b/include/asm-sh64/bug.h @@ -1,7 +1,32 @@ #ifndef __ASM_SH64_BUG_H #define __ASM_SH64_BUG_H -#include <asm-sh/bug.h> +#include <linux/config.h> + +/* + * Tell the user there is some problem, then force a segfault (in process + * context) or a panic (interrupt context). + */ +#define BUG() do { \ + printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + *(volatile int *)0 = 0; \ +} while (0) + +#define BUG_ON(condition) do { \ + if (unlikely((condition)!=0)) \ + BUG(); \ +} while(0) + +#define PAGE_BUG(page) do { \ + BUG(); \ +} while (0) + +#define WARN_ON(condition) do { \ + if (unlikely((condition)!=0)) { \ + printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ + dump_stack(); \ + } \ +} while (0) #endif /* __ASM_SH64_BUG_H */ diff --git a/include/asm-sh64/elf.h b/include/asm-sh64/elf.h index bc483669d2f3..f994286e1998 100644 --- a/include/asm-sh64/elf.h +++ b/include/asm-sh64/elf.h @@ -53,6 +53,12 @@ typedef struct user_fpu_struct elf_fpregset_t; #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) +#define R_SH_DIR32 1 +#define R_SH_REL32 2 +#define R_SH_IMM_LOW16 246 +#define R_SH_IMM_LOW16_PCREL 247 +#define R_SH_IMM_MEDLOW16 248 +#define R_SH_IMM_MEDLOW16_PCREL 249 #define ELF_CORE_COPY_REGS(_dest,_regs) \ memcpy((char *) &_dest, (char *) _regs, \ diff --git a/include/asm-sh64/hardirq.h b/include/asm-sh64/hardirq.h index 75bb083e65f5..ad2330e41fd5 100644 --- a/include/asm-sh64/hardirq.h +++ b/include/asm-sh64/hardirq.h @@ -1,7 +1,19 @@ #ifndef __ASM_SH64_HARDIRQ_H #define __ASM_SH64_HARDIRQ_H -#include <asm-sh/hardirq.h> +#include <linux/config.h> +#include <linux/threads.h> +#include <linux/irq.h> + +/* entry.S is sensitive to the offsets of these fields */ +typedef struct { + unsigned int __softirq_pending; +} ____cacheline_aligned irq_cpustat_t; + +#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ + +/* arch/sh64/kernel/irq.c */ +extern void ack_bad_irq(unsigned int irq); #endif /* __ASM_SH64_HARDIRQ_H */ diff --git a/include/asm-sh64/hardware.h b/include/asm-sh64/hardware.h index a2e6112621d1..931c1ad80847 100644 --- a/include/asm-sh64/hardware.h +++ b/include/asm-sh64/hardware.h @@ -17,29 +17,6 @@ #define PHYS_PERIPHERAL_BLOCK 0x09000000 #define PHYS_DMAC_BLOCK 0x0e000000 #define PHYS_PCI_BLOCK 0x60000000 - -#ifndef __ASSEMBLY__ -#include <linux/types.h> -#include <asm/io.h> - -struct vcr_info { - u8 perr_flags; /* P-port Error flags */ - u8 merr_flags; /* Module Error flags */ - u16 mod_vers; /* Module Version */ - u16 mod_id; /* Module ID */ - u8 bot_mb; /* Bottom Memory block */ - u8 top_mb; /* Top Memory block */ -}; - -static inline struct vcr_info sh64_get_vcr_info(unsigned long base) -{ - unsigned long long tmp; - - tmp = sh64_in64(base); - - return *((struct vcr_info *)&tmp); -} - -#endif /* __ASSEMBLY__ */ +#define PHYS_EMI_BLOCK 0xff000000 #endif /* __ASM_SH64_HARDWARE_H */ diff --git a/include/asm-sh64/ide.h b/include/asm-sh64/ide.h index 900315ac4054..6fd514daa1ba 100644 --- a/include/asm-sh64/ide.h +++ b/include/asm-sh64/ide.h @@ -21,7 +21,12 @@ #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS #endif +/* Without this, the initialisation of PCI IDE cards end up calling + * ide_init_hwif_ports, which won't work. */ +#ifdef CONFIG_BLK_DEV_IDEPCI +#define IDE_ARCH_OBSOLETE_INIT 1 #define ide_default_io_ctl(base) (0) +#endif #include <asm-generic/ide_iops.h> diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h index 27032070c111..5652473b64eb 100644 --- a/include/asm-sh64/io.h +++ b/include/asm-sh64/io.h @@ -25,9 +25,11 @@ * onchip_remap(); */ +#include <linux/compiler.h> #include <asm/cache.h> #include <asm/system.h> #include <asm/page.h> +#include <asm-generic/iomap.h> #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt @@ -39,75 +41,90 @@ * with an implicit size. The traditional read{b,w,l}/write{b,w,l} * mess is wrapped to this, as are the SH-specific ctrl_in/out routines. */ -static inline unsigned char sh64_in8(unsigned long addr) +static inline unsigned char sh64_in8(const volatile void __iomem *addr) { - return *(volatile unsigned char *)addr; + return *(volatile unsigned char __force *)addr; } -static inline unsigned short sh64_in16(unsigned long addr) +static inline unsigned short sh64_in16(const volatile void __iomem *addr) { - return *(volatile unsigned short *)addr; + return *(volatile unsigned short __force *)addr; } -static inline unsigned long sh64_in32(unsigned long addr) +static inline unsigned int sh64_in32(const volatile void __iomem *addr) { - return *(volatile unsigned long *)addr; + return *(volatile unsigned int __force *)addr; } -static inline unsigned long long sh64_in64(unsigned long addr) +static inline unsigned long long sh64_in64(const volatile void __iomem *addr) { - return *(volatile unsigned long long *)addr; + return *(volatile unsigned long long __force *)addr; } -static inline void sh64_out8(unsigned char b, unsigned long addr) +static inline void sh64_out8(unsigned char b, volatile void __iomem *addr) { - *(volatile unsigned char *)addr = b; + *(volatile unsigned char __force *)addr = b; wmb(); } -static inline void sh64_out16(unsigned short b, unsigned long addr) +static inline void sh64_out16(unsigned short b, volatile void __iomem *addr) { - *(volatile unsigned short *)addr = b; + *(volatile unsigned short __force *)addr = b; wmb(); } -static inline void sh64_out32(unsigned long b, unsigned long addr) +static inline void sh64_out32(unsigned int b, volatile void __iomem *addr) { - *(volatile unsigned long *)addr = b; + *(volatile unsigned int __force *)addr = b; wmb(); } -static inline void sh64_out64(unsigned long long b, unsigned long addr) +static inline void sh64_out64(unsigned long long b, volatile void __iomem *addr) { - *(volatile unsigned long long *)addr = b; + *(volatile unsigned long long __force *)addr = b; wmb(); } #define readb(addr) sh64_in8(addr) #define readw(addr) sh64_in16(addr) #define readl(addr) sh64_in32(addr) -#define readb_relaxed(addr) sh64_in8(addr) -#define readw_relaxed(addr) sh64_in16(addr) -#define readl_relaxed(addr) sh64_in32(addr) +#define readb_relaxed(addr) sh64_in8(addr) +#define readw_relaxed(addr) sh64_in16(addr) +#define readl_relaxed(addr) sh64_in32(addr) #define writeb(b, addr) sh64_out8(b, addr) #define writew(b, addr) sh64_out16(b, addr) #define writel(b, addr) sh64_out32(b, addr) -#define ctrl_inb(addr) sh64_in8(addr) -#define ctrl_inw(addr) sh64_in16(addr) -#define ctrl_inl(addr) sh64_in32(addr) +#define ctrl_inb(addr) sh64_in8(ioport_map(addr, 1)) +#define ctrl_inw(addr) sh64_in16(ioport_map(addr, 2)) +#define ctrl_inl(addr) sh64_in32(ioport_map(addr, 4)) -#define ctrl_outb(b, addr) sh64_out8(b, addr) -#define ctrl_outw(b, addr) sh64_out16(b, addr) -#define ctrl_outl(b, addr) sh64_out32(b, addr) +#define ctrl_outb(b, addr) sh64_out8(b, ioport_map(addr, 1)) +#define ctrl_outw(b, addr) sh64_out16(b, ioport_map(addr, 2)) +#define ctrl_outl(b, addr) sh64_out32(b, ioport_map(addr, 4)) -unsigned long inb(unsigned long port); -unsigned long inw(unsigned long port); -unsigned long inl(unsigned long port); -void outb(unsigned long value, unsigned long port); -void outw(unsigned long value, unsigned long port); -void outl(unsigned long value, unsigned long port); +#define ioread8(addr) sh64_in8(addr) +#define ioread16(addr) sh64_in16(addr) +#define ioread32(addr) sh64_in32(addr) +#define iowrite8(b, addr) sh64_out8(b, addr) +#define iowrite16(b, addr) sh64_out16(b, addr) +#define iowrite32(b, addr) sh64_out32(b, addr) + +#define inb(addr) ctrl_inb(addr) +#define inw(addr) ctrl_inw(addr) +#define inl(addr) ctrl_inl(addr) +#define outb(b, addr) ctrl_outb(b, addr) +#define outw(b, addr) ctrl_outw(b, addr) +#define outl(b, addr) ctrl_outl(b, addr) + +void outsw(unsigned long port, const void *addr, unsigned long count); +void insw(unsigned long port, void *addr, unsigned long count); +void outsl(unsigned long port, const void *addr, unsigned long count); +void insl(unsigned long port, void *addr, unsigned long count); + +void memcpy_toio(void __iomem *to, const void *from, long count); +void memcpy_fromio(void *to, void __iomem *from, long count); #define mmiowb() @@ -154,7 +171,7 @@ extern void iounmap(void *addr); unsigned long onchip_remap(unsigned long addr, unsigned long size, const char* name); extern void onchip_unmap(unsigned long vaddr); -static __inline__ int check_signature(unsigned long io_addr, +static __inline__ int check_signature(volatile void __iomem *io_addr, const unsigned char *signature, int length) { int retval = 0; diff --git a/include/asm-sh64/ioctls.h b/include/asm-sh64/ioctls.h index e5d55629f206..08f3c1f2e419 100644 --- a/include/asm-sh64/ioctls.h +++ b/include/asm-sh64/ioctls.h @@ -9,103 +9,108 @@ * include/asm-sh64/ioctls.h * * Copyright (C) 2000, 2001 Paolo Alberelli + * Copyright (C) 2004 Richard Curnow * */ #include <asm/ioctl.h> -#define FIOCLEX _IO('f', 1) -#define FIONCLEX _IO('f', 2) -#define FIOASYNC _IOW('f', 125, int) -#define FIONBIO _IOW('f', 126, int) -#define FIONREAD _IOR('f', 127, int) +#define FIOCLEX 0x6601 /* _IO('f', 1) */ +#define FIONCLEX 0x6602 /* _IO('f', 2) */ +#define FIOASYNC 0x4004667d /* _IOW('f', 125, int) */ +#define FIONBIO 0x4004667e /* _IOW('f', 126, int) */ +#define FIONREAD 0x8004667f /* _IOW('f', 127, int) */ #define TIOCINQ FIONREAD -#define FIOQSIZE _IOR('f', 128, loff_t) +#define FIOQSIZE 0x80086680 /* _IOR('f', 128, loff_t) */ #define TCGETS 0x5401 #define TCSETS 0x5402 #define TCSETSW 0x5403 #define TCSETSF 0x5404 -#define TCGETA _IOR('t', 23, struct termio) -#define TCSETA _IOW('t', 24, struct termio) -#define TCSETAW _IOW('t', 25, struct termio) -#define TCSETAF _IOW('t', 28, struct termio) - -#define TCSBRK _IO('t', 29) -#define TCXONC _IO('t', 30) -#define TCFLSH _IO('t', 31) - -#define TIOCSWINSZ _IOW('t', 103, struct winsize) -#define TIOCGWINSZ _IOR('t', 104, struct winsize) -#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ -#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ -#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ - -#define TIOCSPGRP _IOW('t', 118, int) -#define TIOCGPGRP _IOR('t', 119, int) - -#define TIOCEXCL _IO('T', 12) /* 0x540C */ -#define TIOCNXCL _IO('T', 13) /* 0x540D */ -#define TIOCSCTTY _IO('T', 14) /* 0x540E */ - -#define TIOCSTI _IOW('T', 18, char) /* 0x5412 */ -#define TIOCMGET _IOR('T', 21, unsigned int) /* 0x5415 */ -#define TIOCMBIS _IOW('T', 22, unsigned int) /* 0x5416 */ -#define TIOCMBIC _IOW('T', 23, unsigned int) /* 0x5417 */ -#define TIOCMSET _IOW('T', 24, unsigned int) /* 0x5418 */ -# define TIOCM_LE 0x001 -# define TIOCM_DTR 0x002 -# define TIOCM_RTS 0x004 -# define TIOCM_ST 0x008 -# define TIOCM_SR 0x010 -# define TIOCM_CTS 0x020 -# define TIOCM_CAR 0x040 -# define TIOCM_RNG 0x080 -# define TIOCM_DSR 0x100 -# define TIOCM_CD TIOCM_CAR -# define TIOCM_RI TIOCM_RNG - -#define TIOCGSOFTCAR _IOR('T', 25, unsigned int) /* 0x5419 */ -#define TIOCSSOFTCAR _IOW('T', 26, unsigned int) /* 0x541A */ -#define TIOCLINUX _IOW('T', 28, char) /* 0x541C */ -#define TIOCCONS _IO('T', 29) /* 0x541D */ -#define TIOCGSERIAL _IOR('T', 30, struct serial_struct) /* 0x541E */ -#define TIOCSSERIAL _IOW('T', 31, struct serial_struct) /* 0x541F */ -#define TIOCPKT _IOW('T', 32, int) /* 0x5420 */ -# define TIOCPKT_DATA 0 -# define TIOCPKT_FLUSHREAD 1 -# define TIOCPKT_FLUSHWRITE 2 -# define TIOCPKT_STOP 4 -# define TIOCPKT_START 8 -# define TIOCPKT_NOSTOP 16 -# define TIOCPKT_DOSTOP 32 - - -#define TIOCNOTTY _IO('T', 34) /* 0x5422 */ -#define TIOCSETD _IOW('T', 35, int) /* 0x5423 */ -#define TIOCGETD _IOR('T', 36, int) /* 0x5424 */ -#define TCSBRKP _IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */ -#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* 0x5426 */ /* For debugging only */ -#define TIOCSBRK _IO('T', 39) /* 0x5427 */ /* BSD compatibility */ -#define TIOCCBRK _IO('T', 40) /* 0x5428 */ /* BSD compatibility */ -#define TIOCGSID _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */ -#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ -#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ - -#define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */ -#define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */ -#define TIOCSERSWILD _IOW('T', 85, int) /* 0x5455 */ +#define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */ +#define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */ +#define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */ +#define TCSETAF 0x4012741c /* _IOW('t', 28, struct termio) */ + +#define TCSBRK 0x741d /* _IO('t', 29) */ +#define TCXONC 0x741e /* _IO('t', 30) */ +#define TCFLSH 0x741f /* _IO('t', 31) */ + +#define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */ +#define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */ +#define TIOCSTART 0x746e /* _IO('t', 110) start output, like ^Q */ +#define TIOCSTOP 0x746f /* _IO('t', 111) stop output, like ^S */ +#define TIOCOUTQ 0x80047473 /* _IOR('t', 115, int) output queue size */ + +#define TIOCSPGRP 0x40047476 /* _IOW('t', 118, int) */ +#define TIOCGPGRP 0x80047477 /* _IOR('t', 119, int) */ + +#define TIOCEXCL 0x540c /* _IO('T', 12) */ +#define TIOCNXCL 0x540d /* _IO('T', 13) */ +#define TIOCSCTTY 0x540e /* _IO('T', 14) */ + +#define TIOCSTI 0x40015412 /* _IOW('T', 18, char) 0x5412 */ +#define TIOCMGET 0x80045415 /* _IOR('T', 21, unsigned int) 0x5415 */ +#define TIOCMBIS 0x40045416 /* _IOW('T', 22, unsigned int) 0x5416 */ +#define TIOCMBIC 0x40045417 /* _IOW('T', 23, unsigned int) 0x5417 */ +#define TIOCMSET 0x40045418 /* _IOW('T', 24, unsigned int) 0x5418 */ + +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG + +#define TIOCGSOFTCAR 0x80045419 /* _IOR('T', 25, unsigned int) 0x5419 */ +#define TIOCSSOFTCAR 0x4004541a /* _IOW('T', 26, unsigned int) 0x541A */ +#define TIOCLINUX 0x4004541c /* _IOW('T', 28, char) 0x541C */ +#define TIOCCONS 0x541d /* _IO('T', 29) */ +#define TIOCGSERIAL 0x803c541e /* _IOR('T', 30, struct serial_struct) 0x541E */ +#define TIOCSSERIAL 0x403c541f /* _IOW('T', 31, struct serial_struct) 0x541F */ +#define TIOCPKT 0x40045420 /* _IOW('T', 32, int) 0x5420 */ + +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 + + +#define TIOCNOTTY 0x5422 /* _IO('T', 34) */ +#define TIOCSETD 0x40045423 /* _IOW('T', 35, int) 0x5423 */ +#define TIOCGETD 0x80045424 /* _IOR('T', 36, int) 0x5424 */ +#define TCSBRKP 0x40045424 /* _IOW('T', 37, int) 0x5425 */ /* Needed for POSIX tcsendbreak() */ +#define TIOCTTYGSTRUCT 0x8c105426 /* _IOR('T', 38, struct tty_struct) 0x5426 */ /* For debugging only */ +#define TIOCSBRK 0x5427 /* _IO('T', 39) */ /* BSD compatibility */ +#define TIOCCBRK 0x5428 /* _IO('T', 40) */ /* BSD compatibility */ +#define TIOCGSID 0x80045429 /* _IOR('T', 41, pid_t) 0x5429 */ /* Return the session ID of FD */ +#define TIOCGPTN 0x80045430 /* _IOR('T',0x30, unsigned int) 0x5430 Get Pty Number (of pty-mux device) */ +#define TIOCSPTLCK 0x40045431 /* _IOW('T',0x31, int) Lock/unlock Pty */ + +#define TIOCSERCONFIG 0x5453 /* _IO('T', 83) */ +#define TIOCSERGWILD 0x80045454 /* _IOR('T', 84, int) 0x5454 */ +#define TIOCSERSWILD 0x40045455 /* _IOW('T', 85, int) 0x5455 */ #define TIOCGLCKTRMIOS 0x5456 #define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT _IOR('T', 88, struct async_struct) /* 0x5458 */ /* For debugging only */ -#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */ - /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ -#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* 0x545A */ /* Get multiport config */ -#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* 0x545B */ /* Set multiport config */ - -#define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */ -#define TIOCGICOUNT _IOR('T', 93, struct async_icount) /* 0x545D */ /* read serial port inline interrupt counts */ +#define TIOCSERGSTRUCT 0x80d85458 /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */ +#define TIOCSERGETLSR 0x80045459 /* _IOR('T', 89, unsigned int) 0x5459 */ /* Get line status register */ + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ + +#define TIOCSERGETMULTI 0x80a8545a /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */ +#define TIOCSERSETMULTI 0x40a8545b /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */ + +#define TIOCMIWAIT 0x545c /* _IO('T', 92) wait for a change on serial input line(s) */ +#define TIOCGICOUNT 0x802c545d /* _IOR('T', 93, struct async_icount) 0x545D */ /* read serial port inline interrupt counts */ #endif /* __ASM_SH64_IOCTLS_H */ diff --git a/include/asm-sh64/irq.h b/include/asm-sh64/irq.h index 95056a0181d0..f815b43df845 100644 --- a/include/asm-sh64/irq.h +++ b/include/asm-sh64/irq.h @@ -83,11 +83,12 @@ #define IRQ_P2INTC (START_EXT_IRQS + (3*8) + 2) #define IRQ_P2INTD (START_EXT_IRQS + (3*8) + 3) -#define START_EXT_IRQS 64 - #define I8042_KBD_IRQ (START_EXT_IRQS + 2) #define I8042_AUX_IRQ (START_EXT_IRQS + 6) +#define IRQ_CFCARD (START_EXT_IRQS + 7) +#define IRQ_PCMCIA (0) + #else #define NR_EXT_IRQS 0 #endif diff --git a/include/asm-sh64/module.h b/include/asm-sh64/module.h index bf382bccf3e8..c313650d3d93 100644 --- a/include/asm-sh64/module.h +++ b/include/asm-sh64/module.h @@ -4,6 +4,14 @@ * This file contains the SH architecture specific module code. */ +struct mod_arch_specific { + /* empty */ +}; + +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define Elf_Ehdr Elf32_Ehdr + #define module_map(x) vmalloc(x) #define module_unmap(x) vfree(x) #define module_arch_init(x) (0) diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h index 2e63fd5a64b9..8157a2a727cc 100644 --- a/include/asm-sh64/pgtable.h +++ b/include/asm-sh64/pgtable.h @@ -281,8 +281,6 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) /* Mask which drops software flags */ #define _PAGE_FLAGS_HARDWARE_MASK 0xfffffffffffff3dbLL -/* Flags default: 4KB, Read, Not write, Not execute, Not user */ -#define _PAGE_FLAGS_HARDWARE_DEFAULT 0x0000000000000040LL /* * HugeTLB support diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h index 8aaabc92f9fb..42510e496eb5 100644 --- a/include/asm-sh64/system.h +++ b/include/asm-sh64/system.h @@ -15,7 +15,6 @@ */ #include <linux/config.h> -#include <linux/kernel.h> #include <asm/registers.h> #include <asm/processor.h> diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h index 99e7c926f4bd..e65f394da472 100644 --- a/include/asm-sh64/thread_info.h +++ b/include/asm-sh64/thread_info.h @@ -61,13 +61,18 @@ static inline struct thread_info *current_thread_info(void) } /* thread information allocation */ -#define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,2)) + + + +#define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) #define get_thread_info(ti) get_task_struct((ti)->task) #define put_thread_info(ti) put_task_struct((ti)->task) #endif /* __ASSEMBLY__ */ +#define THREAD_SIZE 8192 + #define PREEMPT_ACTIVE 0x4000000 /* thread information flags */ @@ -76,7 +81,6 @@ static inline struct thread_info *current_thread_info(void) #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_MEMDIE 4 -#define THREAD_SIZE 16384 #endif /* __KERNEL__ */ diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h index 588065c6399f..22e5cdd58ed1 100644 --- a/include/asm-sh64/uaccess.h +++ b/include/asm-sh64/uaccess.h @@ -313,6 +313,12 @@ struct exception_table_entry sh64 at the moment). */ #define ARCH_KMALLOC_MINALIGN 8 +/* + * We want 8-byte alignment for the slab caches as well, otherwise we have + * the same BYTES_PER_WORD (sizeof(void *)) min align in kmem_cache_create(). + */ +#define ARCH_SLAB_MINALIGN 8 + /* Returns 0 if exception not found and fixup.unit otherwise. */ extern unsigned long search_exception_table(unsigned long addr); extern const struct exception_table_entry *search_exception_tables (unsigned long addr); diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index c7d9a52983e4..6a7da2a2ff33 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h @@ -333,8 +333,13 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) +#define __NR_sys_kexec_load 311 +#define __NR_waitid 312 +#define __NR_add_key 313 +#define __NR_request_key 314 +#define __NR_keyctl 315 -#define NR_syscalls 311 +#define NR_syscalls 316 /* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */ diff --git a/include/asm-sparc/resource.h b/include/asm-sparc/resource.h index 432731b3844d..0514c304e130 100644 --- a/include/asm-sparc/resource.h +++ b/include/asm-sparc/resource.h @@ -8,32 +8,18 @@ #define _SPARC_RESOURCE_H /* - * Resource limits + * These two resource limit IDs have a Sparc/Linux-specific ordering, + * the rest comes from the generic header: */ - -#define RLIMIT_CPU 0 /* CPU time in ms */ -#define RLIMIT_FSIZE 1 /* Maximum filesize */ -#define RLIMIT_DATA 2 /* max data size */ -#define RLIMIT_STACK 3 /* max stack size */ -#define RLIMIT_CORE 4 /* max core file size */ -#define RLIMIT_RSS 5 /* max resident set size */ -#define RLIMIT_NOFILE 6 /* max number of open files */ -#define RLIMIT_NPROC 7 /* max number of processes */ -#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ -#define RLIMIT_AS 9 /* address space limit */ -#define RLIMIT_LOCKS 10 /* maximum file locks held */ -#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ -#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ - -#define RLIM_NLIMITS 13 -#define __ARCH_RLIMIT_ORDER +#define RLIMIT_NOFILE 6 /* max number of open files */ +#define RLIMIT_NPROC 7 /* max number of processes */ /* * SuS says limits have to be unsigned. * We make this unsigned, but keep the - * old value. + * old value for compatibility: */ -#define RLIM_INFINITY 0x7fffffff +#define RLIM_INFINITY 0x7fffffff #include <asm-generic/resource.h> diff --git a/include/asm-sparc64/resource.h b/include/asm-sparc64/resource.h index 29d0e13c0eb7..aa469795a6b0 100644 --- a/include/asm-sparc64/resource.h +++ b/include/asm-sparc64/resource.h @@ -8,25 +8,11 @@ #define _SPARC64_RESOURCE_H /* - * Resource limits + * These two resource limit IDs have a Sparc/Linux-specific ordering, + * the rest comes from the generic header: */ - -#define RLIMIT_CPU 0 /* CPU time in ms */ -#define RLIMIT_FSIZE 1 /* Maximum filesize */ -#define RLIMIT_DATA 2 /* max data size */ -#define RLIMIT_STACK 3 /* max stack size */ -#define RLIMIT_CORE 4 /* max core file size */ -#define RLIMIT_RSS 5 /* max resident set size */ -#define RLIMIT_NOFILE 6 /* max number of open files */ -#define RLIMIT_NPROC 7 /* max number of processes */ -#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ -#define RLIMIT_AS 9 /* address space limit */ -#define RLIMIT_LOCKS 10 /* maximum file locks held */ -#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ -#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ - -#define RLIM_NLIMITS 13 -#define __ARCH_RLIMIT_ORDER +#define RLIMIT_NOFILE 6 /* max number of open files */ +#define RLIMIT_NPROC 7 /* max number of processes */ #include <asm-generic/resource.h> diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 262544f187ee..c0af27a62352 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -264,6 +264,8 @@ extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } +struct vm_area_struct; + static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { if (!pte_dirty(*ptep)) diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h index 255e7e66e897..f4b3b249639c 100644 --- a/include/asm-x86_64/thread_info.h +++ b/include/asm-x86_64/thread_info.h @@ -102,6 +102,7 @@ static inline struct thread_info *stack_thread_info(void) #define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ #define TIF_IRET 5 /* force IRET */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ +#define TIF_SECCOMP 8 /* secure computing */ #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_IA32 17 /* 32bit process */ #define TIF_FORK 18 /* ret_from_fork */ @@ -115,6 +116,7 @@ static inline struct thread_info *stack_thread_info(void) #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) #define _TIF_IRET (1<<TIF_IRET) #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) +#define _TIF_SECCOMP (1<<TIF_SECCOMP) #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) #define _TIF_IA32 (1<<TIF_IA32) #define _TIF_FORK (1<<TIF_FORK) @@ -122,9 +124,9 @@ static inline struct thread_info *stack_thread_info(void) /* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \ - (0x0000FFFF & ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)) + (0x0000FFFF & ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP|_TIF_SECCOMP)) /* work to do on any return to user space */ -#define _TIF_ALLWORK_MASK 0x0000FFFF +#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) #define PREEMPT_ACTIVE 0x10000000 diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index cc3752357004..953a73832983 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h @@ -73,6 +73,7 @@ struct exception_table_entry unsigned long insn, fixup; }; +#define ARCH_HAS_SEARCH_EXTABLE /* * These are the main single-value transfer routines. They automatically diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index c3970bb88c4d..c35833824e11 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h @@ -323,6 +323,7 @@ struct ac97_ops #define AC97_DELUDED_MODEM 1 /* Audio codec reports its a modem */ #define AC97_NO_PCM_VOLUME 2 /* Volume control is missing */ +#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ }; extern int ac97_read_proc (char *page_out, char **start, off_t off, diff --git a/include/linux/bio.h b/include/linux/bio.h index cd8d47bf34b4..06925a788519 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -59,6 +59,7 @@ struct bio_vec { unsigned int bv_offset; }; +struct bio_set; struct bio; typedef int (bio_end_io_t) (struct bio *, unsigned int, int); typedef void (bio_destructor_t) (struct bio *); @@ -109,6 +110,7 @@ struct bio { void *bi_private; bio_destructor_t *bi_destructor; /* destructor */ + struct bio_set *bi_set; /* memory pools set */ }; /* @@ -258,7 +260,11 @@ extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, extern mempool_t *bio_split_pool; extern void bio_pair_release(struct bio_pair *dbio); +extern struct bio_set *bioset_create(int, int, int); +extern void bioset_free(struct bio_set *); + extern struct bio *bio_alloc(int, int); +extern struct bio *bio_alloc_bioset(int, int, struct bio_set *); extern void bio_put(struct bio *); extern void bio_endio(struct bio *, unsigned int, int); @@ -280,6 +286,7 @@ extern void bio_set_pages_dirty(struct bio *bio); extern void bio_check_pages_dirty(struct bio *bio); extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); extern int bio_uncopy_user(struct bio *); +void zero_fill_bio(struct bio *bio); #ifdef CONFIG_HIGHMEM /* diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 48f87b979ca9..7d1f8b67c6bf 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -134,4 +134,26 @@ static inline unsigned long hweight_long(unsigned long w) return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w); } +/* + * rol32 - rotate a 32-bit value left + * + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u32 rol32(__u32 word, int shift) +{ + return (word << shift) | (word >> (32 - shift)); +} + +/* + * ror32 - rotate a 32-bit value right + * + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u32 ror32(__u32 word, int shift) +{ + return (word >> shift) | (word << (32 - shift)); +} + #endif diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5615a3c9e410..83eef4fde873 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -93,6 +93,9 @@ struct io_context *get_io_context(int gfp_flags); void copy_io_context(struct io_context **pdst, struct io_context **psrc); void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); +struct request; +typedef void (rq_end_io_fn)(struct request *); + struct request_list { int count[2]; int starved[2]; @@ -176,6 +179,12 @@ struct request { * For Power Management requests */ struct request_pm_state *pm; + + /* + * completion callback. end_io_data should be folded in with waiting + */ + rq_end_io_fn *end_io; + void *end_io_data; }; /* @@ -266,6 +275,8 @@ struct bio_vec; typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); typedef void (activity_fn) (void *data, int rw); typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); +typedef int (prepare_flush_fn) (request_queue_t *, struct request *); +typedef void (end_flush_fn) (request_queue_t *, struct request *); enum blk_queue_state { Queue_down, @@ -309,6 +320,8 @@ struct request_queue merge_bvec_fn *merge_bvec_fn; activity_fn *activity_fn; issue_flush_fn *issue_flush_fn; + prepare_flush_fn *prepare_flush_fn; + end_flush_fn *end_flush_fn; /* * Auto-unplugging state @@ -380,6 +393,18 @@ struct request_queue unsigned int sg_reserved_size; struct list_head drain_list; + + /* + * reserved for flush operations + */ + struct request *flush_rq; + unsigned char ordered; +}; + +enum { + QUEUE_ORDERED_NONE, + QUEUE_ORDERED_TAG, + QUEUE_ORDERED_FLUSH, }; #define RQ_INACTIVE (-1) @@ -396,12 +421,13 @@ struct request_queue #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ -#define QUEUE_FLAG_ORDERED 8 /* supports ordered writes */ -#define QUEUE_FLAG_DRAIN 9 /* draining queue for sched switch */ +#define QUEUE_FLAG_DRAIN 8 /* draining queue for sched switch */ +#define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) +#define blk_queue_flushing(q) test_bit(QUEUE_FLAG_FLUSH, &(q)->queue_flags) #define blk_fs_request(rq) ((rq)->flags & REQ_CMD) #define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC) @@ -509,10 +535,10 @@ extern void blk_unregister_queue(struct gendisk *disk); extern void register_disk(struct gendisk *dev); extern void generic_make_request(struct bio *bio); extern void blk_put_request(struct request *); +extern void blk_end_sync_rq(struct request *rq); extern void blk_attempt_remerge(request_queue_t *, struct request *); extern void __blk_attempt_remerge(request_queue_t *, struct request *); extern struct request *blk_get_request(request_queue_t *, int, int); -extern void blk_put_request(struct request *); extern void blk_insert_request(request_queue_t *, struct request *, int, void *, int); extern void blk_requeue_request(request_queue_t *, struct request *); extern void blk_plug_device(request_queue_t *); @@ -602,6 +628,9 @@ extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bd extern void blk_queue_ordered(request_queue_t *, int); extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); extern int blkdev_scsi_issue_flush_fn(request_queue_t *, struct gendisk *, sector_t *); +extern struct request *blk_start_pre_flush(request_queue_t *,struct request *); +extern int blk_complete_barrier_rq(request_queue_t *, struct request *, int); +extern int blk_complete_barrier_rq_locked(request_queue_t *, struct request *, int); extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *); extern void blk_dump_rq_flags(struct request *, char *); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index f388b513df75..e0d70070fabc 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -203,6 +203,9 @@ int file_fsync(struct file *, struct dentry *, int); int nobh_prepare_write(struct page*, unsigned, unsigned, get_block_t*); int nobh_commit_write(struct file *, struct page *, unsigned, unsigned); int nobh_truncate_page(struct address_space *, loff_t); +int nobh_writepage(struct page *page, get_block_t *get_block, + struct writeback_control *wbc); + /* * inline definitions diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 383275bf924e..56fa057bf0d7 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h @@ -16,6 +16,7 @@ COMPATIBLE_IOCTL(TCSETA) COMPATIBLE_IOCTL(TCSETAW) COMPATIBLE_IOCTL(TCSETAF) COMPATIBLE_IOCTL(TCSBRK) +ULONG_IOCTL(TCSBRKP) COMPATIBLE_IOCTL(TCXONC) COMPATIBLE_IOCTL(TCFLSH) COMPATIBLE_IOCTL(TCGETS) diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index eec2f88c4301..a6fa615afab5 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h @@ -10,7 +10,7 @@ #endif #if __GNUC_MINOR__ > 0 -# define __deprecated __attribute__((deprecated)) +# define __deprecated __attribute__((deprecated)) #endif #if __GNUC_MINOR__ >= 3 @@ -23,12 +23,10 @@ #define __attribute_const__ __attribute__((__const__)) #if __GNUC_MINOR__ >= 1 -#define noinline __attribute__((noinline)) +#define noinline __attribute__((noinline)) #endif + #if __GNUC_MINOR__ >= 4 -#define __must_check __attribute__((warn_unused_result)) +#define __must_check __attribute__((warn_unused_result)) #endif -#if __GNUC_MINOR__ >= 5 -#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) -#endif diff --git a/include/linux/compiler-gcc+.h b/include/linux/compiler-gcc4.h index 6b9308541dcd..53686c037a06 100644 --- a/include/linux/compiler-gcc+.h +++ b/include/linux/compiler-gcc4.h @@ -1,9 +1,6 @@ /* Never include this file directly. Include <linux/compiler.h> instead. */ -/* - * These definitions are for Ueber-GCC: always newer than the latest - * version and hence sporting everything plus a kitchen-sink. - */ +/* These definitions are for GCC v4.x. */ #include <linux/compiler-gcc.h> #define inline inline __attribute__((always_inline)) @@ -13,4 +10,7 @@ #define __attribute_used__ __attribute__((__used__)) #define __attribute_pure__ __attribute__((pure)) #define __attribute_const__ __attribute__((__const__)) +#define noinline __attribute__((noinline)) #define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) + diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 0fd06b029847..b475fd608115 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -34,8 +34,10 @@ extern void __chk_io_ptr(void __iomem *); #ifdef __KERNEL__ -#if __GNUC__ > 3 -# include <linux/compiler-gcc+.h> /* catch-all for GCC 4, 5, etc. */ +#if __GNUC__ > 4 +#error no compiler-gcc.h file for this gcc version +#elif __GNUC__ == 4 +# include <linux/compiler-gcc4.h> #elif __GNUC__ == 3 # include <linux/compiler-gcc3.h> #elif __GNUC__ == 2 diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 062049ca5c44..725be90ef55e 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -26,6 +26,7 @@ struct vc_data { const struct consw *vc_sw; unsigned short *vc_screenbuf; /* In-memory character/attribute buffer */ unsigned int vc_screenbuf_size; + unsigned char vc_mode; /* KD_TEXT, ... */ /* attributes for all characters on screen */ unsigned char vc_attr; /* Current attributes */ unsigned char vc_def_color; /* Default colors */ @@ -48,6 +49,11 @@ struct vc_data { unsigned int vc_state; /* Escape sequence parser state */ unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */ struct tty_struct *vc_tty; /* TTY we are attached to */ + /* data for manual vt switching */ + struct vt_mode vt_mode; + int vt_pid; + int vt_newvt; + wait_queue_head_t paste_wait; /* mode flags */ unsigned int vc_charset : 1; /* Character set G0 / G1 */ unsigned int vc_s_charset : 1; /* Saved character set */ @@ -89,7 +95,6 @@ struct vc_data { struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ unsigned long vc_uni_pagedir; unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ - struct vt_struct *vc_vt; /* additional information is in vt_kern.h */ }; diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h index dee4b654c589..65842efc1b70 100644 --- a/include/linux/consolemap.h +++ b/include/linux/consolemap.h @@ -11,5 +11,5 @@ struct vc_data; extern unsigned char inverse_translate(struct vc_data *conp, int glyph); -extern unsigned short *set_translate(int m,int currcons); +extern unsigned short *set_translate(int m, struct vc_data *vc); extern int conv_uni_to_pc(struct vc_data *conp, long ucs); diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h new file mode 100644 index 000000000000..c118b2ad9807 --- /dev/null +++ b/include/linux/cryptohash.h @@ -0,0 +1,12 @@ +#ifndef __CRYPTOHASH_H +#define __CRYPTOHASH_H + +#define SHA_DIGEST_WORDS 5 +#define SHA_WORKSPACE_WORDS 80 + +void sha_init(__u32 *buf); +void sha_transform(__u32 *digest, const char *data, __u32 *W); + +__u32 half_md4_transform(__u32 buf[4], __u32 const in[8]); + +#endif diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 2da76867183c..50be290d24d2 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -162,17 +162,16 @@ extern spinlock_t dcache_lock; * d_drop - drop a dentry * @dentry: dentry to drop * - * d_drop() unhashes the entry from the parent - * dentry hashes, so that it won't be found through - * a VFS lookup any more. Note that this is different - * from deleting the dentry - d_delete will try to - * mark the dentry negative if possible, giving a - * successful _negative_ lookup, while d_drop will + * d_drop() unhashes the entry from the parent dentry hashes, so that it won't + * be found through a VFS lookup any more. Note that this is different from + * deleting the dentry - d_delete will try to mark the dentry negative if + * possible, giving a successful _negative_ lookup, while d_drop will * just make the cache lookup fail. * - * d_drop() is used mainly for stuff that wants - * to invalidate a dentry for some reason (NFS - * timeouts or autofs deletes). + * d_drop() is used mainly for stuff that wants to invalidate a dentry for some + * reason (NFS timeouts or autofs deletes). + * + * __d_drop requires dentry->d_lock. */ static inline void __d_drop(struct dentry *dentry) @@ -186,7 +185,9 @@ static inline void __d_drop(struct dentry *dentry) static inline void d_drop(struct dentry *dentry) { spin_lock(&dcache_lock); + spin_lock(&dentry->d_lock); __d_drop(dentry); + spin_unlock(&dentry->d_lock); spin_unlock(&dcache_lock); } diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h index bf2d65765189..cb31719ee192 100644 --- a/include/linux/dqblk_xfs.h +++ b/include/linux/dqblk_xfs.h @@ -28,6 +28,12 @@ */ #define XQM_CMD(x) (('X'<<8)+(x)) /* note: forms first QCMD argument */ +#define XQM_COMMAND(x) (((x) & (0xff<<8)) == ('X'<<8)) /* test if for XFS */ + +#define XQM_USRQUOTA 0 /* system call user quota type */ +#define XQM_GRPQUOTA 1 /* system call group quota type */ +#define XQM_MAXQUOTAS 2 + #define Q_XQUOTAON XQM_CMD(1) /* enable accounting/enforcement */ #define Q_XQUOTAOFF XQM_CMD(2) /* disable accounting/enforcement */ #define Q_XGETQUOTA XQM_CMD(3) /* get disk limits and usage */ diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index 47445f93d4f7..e8292af9033b 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h @@ -111,9 +111,9 @@ void ext3_journal_abort_handle(const char *caller, const char *err_fn, static inline int __ext3_journal_get_undo_access(const char *where, handle_t *handle, - struct buffer_head *bh, int *credits) + struct buffer_head *bh) { - int err = journal_get_undo_access(handle, bh, credits); + int err = journal_get_undo_access(handle, bh); if (err) ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err); return err; @@ -121,19 +121,18 @@ __ext3_journal_get_undo_access(const char *where, handle_t *handle, static inline int __ext3_journal_get_write_access(const char *where, handle_t *handle, - struct buffer_head *bh, int *credits) + struct buffer_head *bh) { - int err = journal_get_write_access(handle, bh, credits); + int err = journal_get_write_access(handle, bh); if (err) ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err); return err; } static inline void -ext3_journal_release_buffer(handle_t *handle, struct buffer_head *bh, - int credits) +ext3_journal_release_buffer(handle_t *handle, struct buffer_head *bh) { - journal_release_buffer(handle, bh, credits); + journal_release_buffer(handle, bh); } static inline int @@ -176,12 +175,10 @@ __ext3_journal_dirty_metadata(const char *where, } -#define ext3_journal_get_undo_access(handle, bh, credits) \ - __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh), (credits)) +#define ext3_journal_get_undo_access(handle, bh) \ + __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh)) #define ext3_journal_get_write_access(handle, bh) \ - __ext3_journal_get_write_access(__FUNCTION__, (handle), (bh), NULL) -#define ext3_journal_get_write_access_credits(handle, bh, credits) \ - __ext3_journal_get_write_access(__FUNCTION__, (handle), (bh), (credits)) + __ext3_journal_get_write_access(__FUNCTION__, (handle), (bh)) #define ext3_journal_revoke(handle, blocknr, bh) \ __ext3_journal_revoke(__FUNCTION__, (handle), (blocknr), (bh)) #define ext3_journal_get_create_access(handle, bh) \ diff --git a/include/linux/fs.h b/include/linux/fs.h index c4081935da26..3ea266972f06 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -129,6 +129,7 @@ extern int dir_notify_enable; #define S_DIRSYNC 64 /* Directory modifications are synchronous */ #define S_NOCMTIME 128 /* Do not update file c/mtime */ #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ +#define S_PRIVATE 512 /* Inode is fs-internal */ /* * Note that nosuid etc flags are inode-specific: setting some file-system @@ -162,6 +163,7 @@ extern int dir_notify_enable; #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) +#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) /* the read-only stuff doesn't really belong here, but any other place is probably as bad and I don't want to create yet another include file. */ diff --git a/include/linux/ide.h b/include/linux/ide.h index 28f35bc8ba7e..9c25adc6c28d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -740,7 +740,6 @@ typedef struct ide_drive_s { u8 sect; /* "real" sectors per track */ u8 bios_head; /* BIOS/fdisk/LILO number of heads */ u8 bios_sect; /* BIOS/fdisk/LILO sectors per track */ - u8 doing_barrier; /* state, 1=currently doing flush */ unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ unsigned int cyl; /* "real" number of cyls */ @@ -1130,6 +1129,7 @@ extern ide_hwif_t ide_hwifs[]; /* master data repository */ extern int noautodma; extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); +extern int __ide_end_request (ide_drive_t *drive, struct request *rq, int uptodate, int nrsecs); /* * This is used on exit from the driver to designate the next irq handler diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 6498e9da9ce6..a6a8c1a38d5e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -51,6 +51,7 @@ .list = LIST_HEAD_INIT(sig.shared_pending.list), \ .signal = {{0}}}, \ .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ + .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ .rlim = INIT_RLIMITS, \ } @@ -89,9 +90,6 @@ extern struct group_info init_groups; .children = LIST_HEAD_INIT(tsk.children), \ .sibling = LIST_HEAD_INIT(tsk.sibling), \ .group_leader = &tsk, \ - .real_timer = { \ - .function = it_real_fn \ - }, \ .group_info = &init_groups, \ .cap_effective = CAP_INIT_EFF_SET, \ .cap_inheritable = CAP_INIT_INH_SET, \ @@ -112,8 +110,16 @@ extern struct group_info init_groups; .proc_lock = SPIN_LOCK_UNLOCKED, \ .switch_lock = SPIN_LOCK_UNLOCKED, \ .journal_info = NULL, \ + .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ } +#define INIT_CPU_TIMERS(cpu_timers) \ +{ \ + LIST_HEAD_INIT(cpu_timers[0]), \ + LIST_HEAD_INIT(cpu_timers[1]), \ + LIST_HEAD_INIT(cpu_timers[2]), \ +} + #endif diff --git a/include/linux/ioc4_common.h b/include/linux/ioc4_common.h new file mode 100644 index 000000000000..b03bcc46df55 --- /dev/null +++ b/include/linux/ioc4_common.h @@ -0,0 +1,21 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. + */ + +#ifndef _LINUX_IOC4_COMMON_H +#define _LINUX_IOC4_COMMON_H + +/* prototypes */ + +int ioc4_serial_init(void); + +int ioc4_serial_attach_one(struct pci_dev *pdev, const struct + pci_device_id *pci_id); +int ioc4_ide_attach_one(struct pci_dev *pdev, const struct + pci_device_id *pci_id); + +#endif /* _LINUX_IOC4_COMMON_H */ diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 88dd37439078..e36ee157ad67 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h @@ -104,13 +104,22 @@ struct ipmi_smi_handlers /* Called to poll for work to do. This is so upper layers can poll for operations during things like crash dumps. */ void (*poll)(void *send_info); + + /* Tell the handler that we are using it/not using it. The + message handler get the modules that this handler belongs + to; this function lets the SMI claim any modules that it + uses. These may be NULL if this is not required. */ + int (*inc_usecount)(void *send_info); + void (*dec_usecount)(void *send_info); }; -/* Add a low-level interface to the IPMI driver. */ +/* Add a low-level interface to the IPMI driver. Note that if the + interface doesn't know its slave address, it should pass in zero. */ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, void *send_info, unsigned char version_major, unsigned char version_minor, + unsigned char slave_addr, ipmi_smi_t *intf); /* diff --git a/include/linux/jbd.h b/include/linux/jbd.h index f857ff09921d..e28f8b23558f 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -789,6 +789,12 @@ struct journal_s struct jbd_revoke_table_s *j_revoke_table[2]; /* + * array of bhs for journal_commit_transaction + */ + struct buffer_head **j_wbuf; + int j_wbufsize; + + /* * An opaque pointer to fs-private information. ext3 puts its * superblock pointer here */ @@ -867,15 +873,12 @@ static inline handle_t *journal_current_handle(void) extern handle_t *journal_start(journal_t *, int nblocks); extern int journal_restart (handle_t *, int nblocks); extern int journal_extend (handle_t *, int nblocks); -extern int journal_get_write_access(handle_t *, struct buffer_head *, - int *credits); +extern int journal_get_write_access(handle_t *, struct buffer_head *); extern int journal_get_create_access (handle_t *, struct buffer_head *); -extern int journal_get_undo_access(handle_t *, struct buffer_head *, - int *credits); +extern int journal_get_undo_access(handle_t *, struct buffer_head *); extern int journal_dirty_data (handle_t *, struct buffer_head *); extern int journal_dirty_metadata (handle_t *, struct buffer_head *); -extern void journal_release_buffer (handle_t *, struct buffer_head *, - int credits); +extern void journal_release_buffer (handle_t *, struct buffer_head *); extern int journal_forget (handle_t *, struct buffer_head *); extern void journal_sync_buffer (struct buffer_head *); extern int journal_invalidatepage(journal_t *, diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index 8751663d04cc..8a62d1e84b9b 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h @@ -32,6 +32,13 @@ struct journal_head { unsigned b_jlist; /* + * This flag signals the buffer has been modified by + * the currently running transaction + * [jbd_lock_bh_state()] + */ + unsigned b_modified; + + /* * Copy of the buffer data frozen for writing to the log. * [jbd_lock_bh_state()] */ diff --git a/include/linux/loop.h b/include/linux/loop.h index 652124463a24..8220d9c9da00 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h @@ -71,7 +71,10 @@ struct loop_device { /* * Loop flags */ -#define LO_FLAGS_READ_ONLY 1 +enum { + LO_FLAGS_READ_ONLY = 1, + LO_FLAGS_USE_AOPS = 2, +}; #include <asm/posix_types.h> /* for __kernel_old_dev_t */ #include <asm/types.h> /* for __u64 */ diff --git a/include/linux/major.h b/include/linux/major.h index 8585730af484..4b62c42b842c 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -25,7 +25,6 @@ #define MISC_MAJOR 10 #define SCSI_CDROM_MAJOR 11 #define MUX_MAJOR 11 /* PA-RISC only */ -#define QIC02_TAPE_MAJOR 12 #define XT_DISK_MAJOR 13 #define INPUT_MAJOR 13 #define SOUND_MAJOR 14 diff --git a/include/linux/mpage.h b/include/linux/mpage.h index 86aa7b676274..3ca880463c47 100644 --- a/include/linux/mpage.h +++ b/include/linux/mpage.h @@ -11,12 +11,15 @@ */ struct writeback_control; +typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); int mpage_readpages(struct address_space *mapping, struct list_head *pages, unsigned nr_pages, get_block_t get_block); int mpage_readpage(struct page *page, get_block_t get_block); int mpage_writepages(struct address_space *mapping, struct writeback_control *wbc, get_block_t get_block); +int mpage_writepage(struct page *page, get_block_t *get_block, + struct writeback_control *wbc); static inline int generic_writepages(struct address_space *mapping, struct writeback_control *wbc) diff --git a/include/linux/mtio.h b/include/linux/mtio.h index 4f2daa83d3ad..8c66151821e3 100644 --- a/include/linux/mtio.h +++ b/include/linux/mtio.h @@ -150,34 +150,6 @@ struct mtpos { }; -/* structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended - * as an interim solution for QIC-02 until DDI is fully implemented. - */ -struct mtconfiginfo { - long mt_type; /* drive type */ - long ifc_type; /* interface card type */ - unsigned short irqnr; /* IRQ number to use */ - unsigned short dmanr; /* DMA channel to use */ - unsigned short port; /* IO port base address */ - - unsigned long debug; /* debugging flags */ - - unsigned have_dens:1; - unsigned have_bsf:1; - unsigned have_fsr:1; - unsigned have_bsr:1; - unsigned have_eod:1; - unsigned have_seek:1; - unsigned have_tell:1; - unsigned have_ras1:1; - unsigned have_ras2:1; - unsigned have_ras3:1; - unsigned have_qfa:1; - - unsigned pad1:5; - char reserved[10]; -}; - /* structure for MTIOCVOLINFO, query information about the volume * currently positioned at (zftape) */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 45c638b9fdef..b65f84ec1118 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -397,6 +397,8 @@ #define PCI_DEVICE_ID_NS_SCx200_VIDEO 0x0504 #define PCI_DEVICE_ID_NS_SCx200_XBUS 0x0505 #define PCI_DEVICE_ID_NS_SC1100_BRIDGE 0x0510 +#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511 +#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515 #define PCI_DEVICE_ID_NS_87410 0xd001 #define PCI_VENDOR_ID_TSENG 0x100c diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 006f3e9af475..f942e2bad8e3 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -3,6 +3,36 @@ #include <linux/spinlock.h> #include <linux/list.h> +#include <linux/sched.h> + +union cpu_time_count { + cputime_t cpu; + unsigned long long sched; +}; + +struct cpu_timer_list { + struct list_head entry; + union cpu_time_count expires, incr; + struct task_struct *task; + int firing; +}; + +#define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3)) +#define CPUCLOCK_PERTHREAD(clock) \ + (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0) +#define CPUCLOCK_PID_MASK 7 +#define CPUCLOCK_PERTHREAD_MASK 4 +#define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK) +#define CPUCLOCK_CLOCK_MASK 3 +#define CPUCLOCK_PROF 0 +#define CPUCLOCK_VIRT 1 +#define CPUCLOCK_SCHED 2 +#define CPUCLOCK_MAX 3 + +#define MAKE_PROCESS_CPUCLOCK(pid, clock) \ + ((~(clockid_t) (pid) << 3) | (clockid_t) (clock)) +#define MAKE_THREAD_CPUCLOCK(tid, clock) \ + MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK) /* POSIX.1b interval timer structure. */ struct k_itimer { @@ -13,15 +43,27 @@ struct k_itimer { int it_overrun; /* overrun on pending signal */ int it_overrun_last; /* overrun on last delivered signal */ int it_requeue_pending; /* waiting to requeue this timer */ +#define REQUEUE_PENDING 1 int it_sigev_notify; /* notify word of sigevent struct */ int it_sigev_signo; /* signo word of sigevent struct */ sigval_t it_sigev_value; /* value word of sigevent struct */ - unsigned long it_incr; /* interval specified in jiffies */ struct task_struct *it_process; /* process to send signal to */ - struct timer_list it_timer; struct sigqueue *sigq; /* signal queue entry. */ - struct list_head abs_timer_entry; /* clock abs_timer_list */ - struct timespec wall_to_prev; /* wall_to_monotonic used when set */ + union { + struct { + struct timer_list timer; + struct list_head abs_timer_entry; /* clock abs_timer_list */ + struct timespec wall_to_prev; /* wall_to_monotonic used when set */ + unsigned long incr; /* interval in jiffies */ + } real; + struct cpu_timer_list cpu; + struct { + unsigned int clock; + unsigned int node; + unsigned long incr; + unsigned long expires; + } mmtimer; + } it; }; struct k_clock_abs { @@ -30,26 +72,27 @@ struct k_clock_abs { }; struct k_clock { int res; /* in nano seconds */ + int (*clock_getres) (clockid_t which_clock, struct timespec *tp); struct k_clock_abs *abs_struct; - int (*clock_set) (struct timespec * tp); - int (*clock_get) (struct timespec * tp); + int (*clock_set) (clockid_t which_clock, struct timespec * tp); + int (*clock_get) (clockid_t which_clock, struct timespec * tp); int (*timer_create) (struct k_itimer *timer); - int (*nsleep) (int which_clock, int flags, - struct timespec * t); + int (*nsleep) (clockid_t which_clock, int flags, struct timespec *); int (*timer_set) (struct k_itimer * timr, int flags, struct itimerspec * new_setting, struct itimerspec * old_setting); int (*timer_del) (struct k_itimer * timr); +#define TIMER_RETRY 1 void (*timer_get) (struct k_itimer * timr, struct itimerspec * cur_setting); }; -void register_posix_clock(int clock_id, struct k_clock *new_clock); +void register_posix_clock(clockid_t clock_id, struct k_clock *new_clock); /* Error handlers for timer_create, nanosleep and settime */ int do_posix_clock_notimer_create(struct k_itimer *timer); -int do_posix_clock_nonanosleep(int which_clock, int flags, struct timespec * t); -int do_posix_clock_nosettime(struct timespec *tp); +int do_posix_clock_nonanosleep(clockid_t, int flags, struct timespec *); +int do_posix_clock_nosettime(clockid_t, struct timespec *tp); /* function to call to trigger timer event */ int posix_timer_event(struct k_itimer *timr, int si_private); @@ -65,12 +108,32 @@ struct now_struct { #define posix_bump_timer(timr, now) \ do { \ long delta, orun; \ - delta = now.jiffies - (timr)->it_timer.expires; \ + delta = now.jiffies - (timr)->it.real.timer.expires; \ if (delta >= 0) { \ - orun = 1 + (delta / (timr)->it_incr); \ - (timr)->it_timer.expires += orun * (timr)->it_incr; \ + orun = 1 + (delta / (timr)->it.real.incr); \ + (timr)->it.real.timer.expires += \ + orun * (timr)->it.real.incr; \ (timr)->it_overrun += orun; \ } \ }while (0) -#endif +int posix_cpu_clock_getres(clockid_t which_clock, struct timespec *); +int posix_cpu_clock_get(clockid_t which_clock, struct timespec *); +int posix_cpu_clock_set(clockid_t which_clock, const struct timespec *tp); +int posix_cpu_timer_create(struct k_itimer *); +int posix_cpu_nsleep(clockid_t, int, struct timespec *); +int posix_cpu_timer_set(struct k_itimer *, int, + struct itimerspec *, struct itimerspec *); +int posix_cpu_timer_del(struct k_itimer *); +void posix_cpu_timer_get(struct k_itimer *, struct itimerspec *); + +void posix_cpu_timer_schedule(struct k_itimer *); + +void run_posix_cpu_timers(struct task_struct *); +void posix_cpu_timers_exit(struct task_struct *); +void posix_cpu_timers_exit_group(struct task_struct *); + +void set_process_cpu_timer(struct task_struct *, unsigned int, + cputime_t *, cputime_t *); + +#endif diff --git a/include/linux/random.h b/include/linux/random.h index cccb11199d88..cc6703449916 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -57,14 +57,6 @@ extern u32 secure_tcpv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, __u16 dport); extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, __u16 sport, __u16 dport); -extern __u32 secure_tcp_syn_cookie(__u32 saddr, __u32 daddr, - __u16 sport, __u16 dport, - __u32 sseq, __u32 count, - __u32 data); -extern __u32 check_tcp_syn_cookie(__u32 cookie, __u32 saddr, - __u32 daddr, __u16 sport, - __u16 dport, __u32 sseq, - __u32 count, __u32 maxdiff); extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, __u16 sport, __u16 dport); diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index e08142a75f03..e321eb050d65 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h @@ -23,9 +23,8 @@ typedef enum { space on crash with some files open, but unlinked. */ i_link_saved_unlink_mask = 0x0010, i_link_saved_truncate_mask = 0x0020, - i_priv_object = 0x0080, - i_has_xattr_dir = 0x0100, - i_data_log = 0x0200, + i_has_xattr_dir = 0x0040, + i_data_log = 0x0080, } reiserfs_inode_flags; diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 9c40c4e9ba03..1eaa48eca811 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h @@ -31,7 +31,7 @@ struct reiserfs_xattr_handler { #ifdef CONFIG_REISERFS_FS_XATTR -#define is_reiserfs_priv_object(inode) (REISERFS_I(inode)->i_flags & i_priv_object) +#define is_reiserfs_priv_object(inode) IS_PRIVATE(inode) #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) ssize_t reiserfs_getxattr (struct dentry *dentry, const char *name, void *buffer, size_t size); @@ -103,9 +103,16 @@ reiserfs_read_unlock_xattr_i(struct inode *inode) up_read (&REISERFS_I(inode)->xattr_sem); } +static inline void +reiserfs_mark_inode_private(struct inode *inode) +{ + inode->i_flags |= S_PRIVATE; +} + #else #define is_reiserfs_priv_object(inode) 0 +#define reiserfs_mark_inode_private(inode) #define reiserfs_getxattr NULL #define reiserfs_setxattr NULL #define reiserfs_listxattr NULL diff --git a/include/linux/sched.h b/include/linux/sched.h index 2f249f8015e5..cf90d1ed1a1f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -32,6 +32,7 @@ #include <linux/pid.h> #include <linux/percpu.h> #include <linux/topology.h> +#include <linux/seccomp.h> struct exec_domain; @@ -300,6 +301,14 @@ struct signal_struct { /* POSIX.1b Interval Timers */ struct list_head posix_timers; + /* ITIMER_REAL timer for the process */ + struct timer_list real_timer; + unsigned long it_real_value, it_real_incr; + + /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ + cputime_t it_prof_expires, it_virt_expires; + cputime_t it_prof_incr, it_virt_incr; + /* job control IDs */ pid_t pgrp; pid_t tty_old_pgrp; @@ -320,6 +329,14 @@ struct signal_struct { unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; /* + * Cumulative ns of scheduled CPU time for dead threads in the + * group, not including a zombie group leader. (This only differs + * from jiffies_to_ns(utime + stime) if sched_clock uses something + * other than jiffies.) + */ + unsigned long long sched_time; + + /* * We don't bother to synchronize most readers of this at all, * because there is no reader checking a limit that actually needs * to get both rlim_cur and rlim_max atomically, and either one @@ -329,6 +346,8 @@ struct signal_struct { * have no need to disable irqs. */ struct rlimit rlim[RLIM_NLIMITS]; + + struct list_head cpu_timers[3]; }; /* @@ -540,6 +559,7 @@ struct task_struct { unsigned long sleep_avg; unsigned long long timestamp, last_ran; + unsigned long long sched_time; /* sched_clock time spent running */ int activated; unsigned long policy; @@ -593,15 +613,16 @@ struct task_struct { int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ unsigned long rt_priority; - unsigned long it_real_value, it_real_incr; - cputime_t it_virt_value, it_virt_incr; - cputime_t it_prof_value, it_prof_incr; - struct timer_list real_timer; cputime_t utime, stime; unsigned long nvcsw, nivcsw; /* context switch counts */ struct timespec start_time; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt; + + cputime_t it_prof_expires, it_virt_expires; + unsigned long long it_sched_expires; + struct list_head cpu_timers[3]; + /* process credentials */ uid_t uid,euid,suid,fsuid; gid_t gid,egid,sgid,fsgid; @@ -643,6 +664,7 @@ struct task_struct { void *security; struct audit_context *audit_context; + seccomp_t seccomp; /* Thread group tracking */ u32 parent_exec_id; @@ -774,6 +796,7 @@ static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) #endif extern unsigned long long sched_clock(void); +extern unsigned long long current_sched_time(const task_t *current_task); /* sched_exec is called by processes performing an exec */ #ifdef CONFIG_SMP diff --git a/include/linux/scx200.h b/include/linux/scx200.h index af7d53acad99..a22f9e173ad2 100644 --- a/include/linux/scx200.h +++ b/include/linux/scx200.h @@ -7,6 +7,10 @@ /* Interesting stuff for the National Semiconductor SCx200 CPU */ +extern unsigned scx200_cb_base; + +#define scx200_cb_present() (scx200_cb_base!=0) + /* F0 PCI Header/Bridge Configuration Registers */ #define SCx200_DOCCS_BASE 0x78 /* DOCCS Base Address Register */ #define SCx200_DOCCS_CTRL 0x7c /* DOCCS Control Register */ @@ -15,7 +19,7 @@ #define SCx200_GPIO_SIZE 0x2c /* Size of GPIO register block */ /* General Configuration Block */ -#define SCx200_CB_BASE 0x9000 /* Base fixed at 0x9000 according to errata */ +#define SCx200_CB_BASE_FIXED 0x9000 /* Base fixed at 0x9000 according to errata? */ /* Watchdog Timer */ #define SCx200_WDT_OFFSET 0x00 /* offset within configuration block */ @@ -44,9 +48,7 @@ #define SCx200_IID 0x3c /* IA On a Chip Identification Number Reg */ #define SCx200_REV 0x3d /* Revision Register */ #define SCx200_CBA 0x3e /* Configuration Base Address Register */ - -/* Verify that the configuration block really is there */ -#define scx200_cb_probe(base) (inw((base) + SCx200_CBA) == (base)) +#define SCx200_CBA_SCRATCH 0x64 /* Configuration Base Address Scratchpad */ /* Local variables: diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h new file mode 100644 index 000000000000..ee989b6ee22a --- /dev/null +++ b/include/linux/seccomp.h @@ -0,0 +1,33 @@ +#ifndef _LINUX_SECCOMP_H +#define _LINUX_SECCOMP_H + +#include <linux/config.h> + +#ifdef CONFIG_SECCOMP + +#define NR_SECCOMP_MODES 1 + +#include <linux/thread_info.h> + +typedef struct { int mode; } seccomp_t; + +extern void __secure_computing(int); +static inline void secure_computing(int this_syscall) +{ + if (unlikely(test_thread_flag(TIF_SECCOMP))) + __secure_computing(this_syscall); +} + +#else /* CONFIG_SECCOMP */ + +#if (__GNUC__ > 2) + typedef struct { } seccomp_t; +#else + typedef struct { int gcc_is_buggy; } seccomp_t; +#endif + +#define secure_computing(x) do { } while (0) + +#endif /* CONFIG_SECCOMP */ + +#endif /* _LINUX_SECCOMP_H */ diff --git a/include/linux/security.h b/include/linux/security.h index 2b048ec62e9c..78d91972c4dc 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1426,11 +1426,15 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd, static inline int security_inode_alloc (struct inode *inode) { + if (unlikely (IS_PRIVATE (inode))) + return 0; return security_ops->inode_alloc_security (inode); } static inline void security_inode_free (struct inode *inode) { + if (unlikely (IS_PRIVATE (inode))) + return; security_ops->inode_free_security (inode); } @@ -1438,6 +1442,8 @@ static inline int security_inode_create (struct inode *dir, struct dentry *dentry, int mode) { + if (unlikely (IS_PRIVATE (dir))) + return 0; return security_ops->inode_create (dir, dentry, mode); } @@ -1445,6 +1451,8 @@ static inline void security_inode_post_create (struct inode *dir, struct dentry *dentry, int mode) { + if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) + return; security_ops->inode_post_create (dir, dentry, mode); } @@ -1452,6 +1460,8 @@ static inline int security_inode_link (struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry) { + if (unlikely (IS_PRIVATE (old_dentry->d_inode))) + return 0; return security_ops->inode_link (old_dentry, dir, new_dentry); } @@ -1459,12 +1469,16 @@ static inline void security_inode_post_link (struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry) { + if (new_dentry->d_inode && unlikely (IS_PRIVATE (new_dentry->d_inode))) + return; security_ops->inode_post_link (old_dentry, dir, new_dentry); } static inline int security_inode_unlink (struct inode *dir, struct dentry *dentry) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_unlink (dir, dentry); } @@ -1472,6 +1486,8 @@ static inline int security_inode_symlink (struct inode *dir, struct dentry *dentry, const char *old_name) { + if (unlikely (IS_PRIVATE (dir))) + return 0; return security_ops->inode_symlink (dir, dentry, old_name); } @@ -1479,6 +1495,8 @@ static inline void security_inode_post_symlink (struct inode *dir, struct dentry *dentry, const char *old_name) { + if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) + return; security_ops->inode_post_symlink (dir, dentry, old_name); } @@ -1486,6 +1504,8 @@ static inline int security_inode_mkdir (struct inode *dir, struct dentry *dentry, int mode) { + if (unlikely (IS_PRIVATE (dir))) + return 0; return security_ops->inode_mkdir (dir, dentry, mode); } @@ -1493,12 +1513,16 @@ static inline void security_inode_post_mkdir (struct inode *dir, struct dentry *dentry, int mode) { + if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) + return; security_ops->inode_post_mkdir (dir, dentry, mode); } static inline int security_inode_rmdir (struct inode *dir, struct dentry *dentry) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_rmdir (dir, dentry); } @@ -1506,6 +1530,8 @@ static inline int security_inode_mknod (struct inode *dir, struct dentry *dentry, int mode, dev_t dev) { + if (unlikely (IS_PRIVATE (dir))) + return 0; return security_ops->inode_mknod (dir, dentry, mode, dev); } @@ -1513,6 +1539,8 @@ static inline void security_inode_post_mknod (struct inode *dir, struct dentry *dentry, int mode, dev_t dev) { + if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) + return; security_ops->inode_post_mknod (dir, dentry, mode, dev); } @@ -1521,6 +1549,9 @@ static inline int security_inode_rename (struct inode *old_dir, struct inode *new_dir, struct dentry *new_dentry) { + if (unlikely (IS_PRIVATE (old_dentry->d_inode) || + (new_dentry->d_inode && IS_PRIVATE (new_dentry->d_inode)))) + return 0; return security_ops->inode_rename (old_dir, old_dentry, new_dir, new_dentry); } @@ -1530,83 +1561,114 @@ static inline void security_inode_post_rename (struct inode *old_dir, struct inode *new_dir, struct dentry *new_dentry) { + if (unlikely (IS_PRIVATE (old_dentry->d_inode) || + (new_dentry->d_inode && IS_PRIVATE (new_dentry->d_inode)))) + return; security_ops->inode_post_rename (old_dir, old_dentry, new_dir, new_dentry); } static inline int security_inode_readlink (struct dentry *dentry) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_readlink (dentry); } static inline int security_inode_follow_link (struct dentry *dentry, struct nameidata *nd) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_follow_link (dentry, nd); } static inline int security_inode_permission (struct inode *inode, int mask, struct nameidata *nd) { + if (unlikely (IS_PRIVATE (inode))) + return 0; return security_ops->inode_permission (inode, mask, nd); } static inline int security_inode_setattr (struct dentry *dentry, struct iattr *attr) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_setattr (dentry, attr); } static inline int security_inode_getattr (struct vfsmount *mnt, struct dentry *dentry) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_getattr (mnt, dentry); } static inline void security_inode_delete (struct inode *inode) { + if (unlikely (IS_PRIVATE (inode))) + return; security_ops->inode_delete (inode); } static inline int security_inode_setxattr (struct dentry *dentry, char *name, void *value, size_t size, int flags) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_setxattr (dentry, name, value, size, flags); } static inline void security_inode_post_setxattr (struct dentry *dentry, char *name, void *value, size_t size, int flags) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return; security_ops->inode_post_setxattr (dentry, name, value, size, flags); } static inline int security_inode_getxattr (struct dentry *dentry, char *name) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_getxattr (dentry, name); } static inline int security_inode_listxattr (struct dentry *dentry) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_listxattr (dentry); } static inline int security_inode_removexattr (struct dentry *dentry, char *name) { + if (unlikely (IS_PRIVATE (dentry->d_inode))) + return 0; return security_ops->inode_removexattr (dentry, name); } static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size) { + if (unlikely (IS_PRIVATE (inode))) + return 0; return security_ops->inode_getsecurity(inode, name, buffer, size); } static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) { + if (unlikely (IS_PRIVATE (inode))) + return 0; return security_ops->inode_setsecurity(inode, name, value, size, flags); } static inline int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size) { + if (unlikely (IS_PRIVATE (inode))) + return 0; return security_ops->inode_listsecurity(inode, buffer, buffer_size); } @@ -1883,6 +1945,8 @@ static inline int security_sem_semop (struct sem_array * sma, static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode) { + if (unlikely (inode && IS_PRIVATE (inode))) + return; security_ops->d_instantiate (dentry, inode); } diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 28141af6a19a..850a974ee505 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -18,6 +18,7 @@ struct seq_file { size_t from; size_t count; loff_t index; + loff_t version; struct semaphore sem; struct seq_operations *op; void *private; diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index c45598d0a846..b5c7b44da087 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -106,6 +106,10 @@ /* TXX9 type number */ #define PORT_TXX9 64 +/* NEC VR4100 series SIU/DSIU */ +#define PORT_VR41XX_SIU 65 +#define PORT_VR41XX_DSIU 66 + #ifdef __KERNEL__ #include <linux/config.h> diff --git a/include/linux/signal.h b/include/linux/signal.h index e5f3d83ab215..99c97ad026c8 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -8,8 +8,6 @@ #ifdef __KERNEL__ -#define MAX_SIGPENDING 1024 - /* * Real Time signals may be queued. */ @@ -212,6 +210,7 @@ static inline void init_sigpending(struct sigpending *sig) } extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); +extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); extern long do_sigpending(void __user *, unsigned long); extern int sigprocmask(int, sigset_t *, sigset_t *); diff --git a/include/linux/sort.h b/include/linux/sort.h new file mode 100644 index 000000000000..d534da2b5575 --- /dev/null +++ b/include/linux/sort.h @@ -0,0 +1,10 @@ +#ifndef _LINUX_SORT_H +#define _LINUX_SORT_H + +#include <linux/types.h> + +void sort(void *base, size_t num, size_t size, + int (*cmp)(const void *, const void *), + void (*swap)(void *, void *, int)); + +#endif diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 6f43cb53f21b..151a803ed0ed 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h @@ -8,7 +8,7 @@ #include <linux/cpu.h> #include <asm/system.h> -#ifdef CONFIG_SMP +#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) /** * stop_machine_run: freeze the machine on all CPUs and run this function * @fn: the function to run diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 138f5b178f39..4b6993558ee2 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -15,11 +15,22 @@ typedef struct pbe { unsigned long address; /* address of the copy */ unsigned long orig_address; /* original address of page */ swp_entry_t swap_address; - swp_entry_t dummy; /* we need scratch space at - * end of page (see link, diskpage) - */ + + struct pbe *next; /* also used as scratch space at + * end of page (see link, diskpage) + */ } suspend_pagedir_t; +#define for_each_pbe(pbe, pblist) \ + for (pbe = pblist ; pbe ; pbe = pbe->next) + +#define PBES_PER_PAGE (PAGE_SIZE/sizeof(struct pbe)) +#define PB_PAGE_SKIP (PBES_PER_PAGE-1) + +#define for_each_pb_page(pbe, pblist) \ + for (pbe = pblist ; pbe ; pbe = (pbe+PB_PAGE_SKIP)->next) + + #define SWAP_FILENAME_MAXLENGTH 32 diff --git a/include/linux/threads.h b/include/linux/threads.h index 4243c55cce87..b59738ac6197 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h @@ -7,7 +7,7 @@ * The default limit for the nr of threads is now in * /proc/sys/kernel/threads-max. */ - + /* * Maximum supported processors that can run under SMP. This value is * set via configure setting. The maximum is equal to the size of the @@ -25,11 +25,12 @@ /* * This controls the default maximum pid allocated to a process */ -#define PID_MAX_DEFAULT 0x8000 +#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) /* * A maximum of 4 million PIDs should be enough for a while: */ -#define PID_MAX_LIMIT (sizeof(long) > 4 ? 4*1024*1024 : PID_MAX_DEFAULT) +#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ + (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) #endif diff --git a/include/linux/tpqic02.h b/include/linux/tpqic02.h deleted file mode 100644 index f0dfcfa56273..000000000000 --- a/include/linux/tpqic02.h +++ /dev/null @@ -1,738 +0,0 @@ -/* $Id: tpqic02.h,v 1.5 1996/12/14 23:01:38 root Exp root $ - * - * Include file for QIC-02 driver for Linux. - * - * Copyright (c) 1992--1995 by H. H. Bergman. All rights reserved. - * - * ******* USER CONFIG SECTION BELOW (Near line 70) ******* - */ - -#ifndef _LINUX_TPQIC02_H -#define _LINUX_TPQIC02_H - -#include <linux/config.h> - -#if defined(CONFIG_QIC02_TAPE) || defined(CONFIG_QIC02_TAPE_MODULE) - -/* need to have QIC02_TAPE_DRIVE and QIC02_TAPE_IFC expand to something */ -#include <linux/mtio.h> - - -/* Make QIC02_TAPE_IFC expand to something. - * - * The only difference between WANGTEK and EVEREX is in the - * handling of the DMA channel 3. - * Note that the driver maps EVEREX to WANGTEK internally for speed - * reasons. Externally WANGTEK==1, EVEREX==2, ARCHIVE==3. - * These must correspond to the values used in qic02config(1). - * - * Support for Mountain controllers was added by Erik Jacobson - * and severely hacked by me. -- hhb - * - * Support for Emerald controllers by Alan Bain <afrb2@chiark.chu.cam.ac.uk> - * with more hacks by me. -- hhb - */ -#define WANGTEK 1 /* don't know about Wangtek QIC-36 */ -#define EVEREX (WANGTEK+1) /* I heard *some* of these are identical */ -#define EVEREX_811V EVEREX /* With TEAC MT 2ST 45D */ -#define EVEREX_831V EVEREX -#define ARCHIVE 3 -#define ARCHIVE_SC400 ARCHIVE /* rumoured to be from the pre-SMD-age */ -#define ARCHIVE_SC402 ARCHIVE /* don't know much about SC400 */ -#define ARCHIVE_SC499 ARCHIVE /* SC402 and SC499R should be identical */ - -#define MOUNTAIN 5 /* Mountain Computer Interface */ -#define EMERALD 6 /* Emerald Interface card */ - - - -#define QIC02_TAPE_PORT_RANGE 8 /* number of IO locations to reserve */ - - -/*********** START OF USER CONFIGURABLE SECTION ************/ - -/* Tape configuration: Select DRIVE, IFC, PORT, IRQ and DMA below. - * Runtime (re)configuration is not supported yet. - * - * Tape drive configuration: (MT_IS* constants are defined in mtio.h) - * - * QIC02_TAPE_DRIVE = MT_ISWT5150 - * - Wangtek 5150, format: up to QIC-150. - * QIC02_TAPE_DRIVE = MT_ISQIC02_ALL_FEATURES - * - Enables some optional QIC02 commands that some drives may lack. - * It is provided so you can check which are supported by your drive. - * Refer to tpqic02.h for others. - * - * Supported interface cards: QIC02_TAPE_IFC = - * WANGTEK, - * ARCHIVE_SC402, ARCHIVE_SC499. (both same programming interface) - * - * Make sure you have the I/O ports/DMA channels - * and IRQ stuff configured properly! - * NOTE: There may be other device drivers using the same major - * number. This must be avoided. Check for timer.h conflicts too. - * - * If you have an EVEREX EV-831 card and you are using DMA channel 3, - * you will probably have to ``#define QIC02_TAPE_DMA3_FIX'' below. - */ - -/* CONFIG_QIC02_DYNCONF can be defined in autoconf.h, by `make config' */ - -/*** #undef CONFIG_QIC02_DYNCONF ***/ - -#ifndef CONFIG_QIC02_DYNCONF - -#define QIC02_TAPE_DRIVE MT_ISQIC02_ALL_FEATURES /* drive type */ -/* #define QIC02_TAPE_DRIVE MT_ISWT5150 */ -/* #define QIC02_TAPE_DRIVE MT_ISARCHIVE_5945L2 */ -/* #define QIC02_TAPE_DRIVE MT_ISTEAC_MT2ST */ -/* #define QIC02_TAPE_DRIVE MT_ISARCHIVE_2150L */ -/* #define QIC02_TAPE_DRIVE MT_ISARCHIVESC499 */ - -/* Either WANGTEK, ARCHIVE or MOUNTAIN. Not EVEREX. - * If you have an EVEREX, use WANGTEK and try the DMA3_FIX below. - */ -#define QIC02_TAPE_IFC WANGTEK /* interface card type */ -/* #define QIC02_TAPE_IFC ARCHIVE */ -/* #define QIC02_TAPE_IFC MOUNTAIN */ - -#define QIC02_TAPE_PORT 0x300 /* controller port address */ -#define QIC02_TAPE_IRQ 5 /* For IRQ2, use 9 here, others normal. */ -#define QIC02_TAPE_DMA 1 /* either 1 or 3, because 2 is used by the floppy */ - -/* If DMA3 doesn't work, but DMA1 does, and you have a - * Wangtek/Everex card, you can try #define-ing the flag - * below. Note that you should also change the DACK jumper - * for Wangtek/Everex cards when changing the DMA channel. - */ -#undef QIC02_TAPE_DMA3_FIX - -/************ END OF USER CONFIGURABLE SECTION *************/ - -/* I put the stuff above in config.in, but a few recompiles, to - * verify different configurations, and several days later I decided - * to change it back again. - */ - - - -/* NOTE: TP_HAVE_DENS should distinguish between available densities (?) - * NOTE: Drive select is not implemented -- I have only one tape streamer, - * so I'm unable and unmotivated to test and implement that. ;-) ;-) - */ -#if QIC02_TAPE_DRIVE == MT_ISWT5150 -#define TP_HAVE_DENS 1 -#define TP_HAVE_BSF 0 /* nope */ -#define TP_HAVE_FSR 0 /* nope */ -#define TP_HAVE_BSR 0 /* nope */ -#define TP_HAVE_EOD 0 /* most of the time */ -#define TP_HAVE_SEEK 0 -#define TP_HAVE_TELL 0 -#define TP_HAVE_RAS1 1 -#define TP_HAVE_RAS2 1 - -#elif QIC02_TAPE_DRIVE == MT_ISARCHIVESC499 /* Archive SC-499 QIC-36 controller */ -#define TP_HAVE_DENS 1 /* can do set density (QIC-11 / QIC-24) */ -#define TP_HAVE_BSF 0 -#define TP_HAVE_FSR 1 /* can skip one block forwards */ -#define TP_HAVE_BSR 1 /* can skip one block backwards */ -#define TP_HAVE_EOD 1 /* can seek to end of recorded data */ -#define TP_HAVE_SEEK 0 -#define TP_HAVE_TELL 0 -#define TP_HAVE_RAS1 1 /* can run selftest 1 */ -#define TP_HAVE_RAS2 1 /* can run selftest 2 */ -/* These last two selftests shouldn't be used yet! */ - -#elif (QIC02_TAPE_DRIVE == MT_ISARCHIVE_2060L) || (QIC02_TAPE_DRIVE == MT_ISARCHIVE_2150L) -#define TP_HAVE_DENS 1 /* can do set density (QIC-24 / QIC-120 / QIC-150) */ -#define TP_HAVE_BSF 0 -#define TP_HAVE_FSR 1 /* can skip one block forwards */ -#define TP_HAVE_BSR 1 /* can skip one block backwards */ -#define TP_HAVE_EOD 1 /* can seek to end of recorded data */ -#define TP_HAVE_TELL 1 /* can read current block address */ -#define TP_HAVE_SEEK 1 /* can seek to block */ -#define TP_HAVE_RAS1 1 /* can run selftest 1 */ -#define TP_HAVE_RAS2 1 /* can run selftest 2 */ -/* These last two selftests shouldn't be used yet! */ - -#elif QIC02_TAPE_DRIVE == MT_ISARCHIVE_5945L2 -/* can anyone verify this entry?? */ -#define TP_HAVE_DENS 1 /* can do set density?? (QIC-24??) */ -#define TP_HAVE_BSF 0 -#define TP_HAVE_FSR 1 /* can skip one block forwards */ -#define TP_HAVE_BSR 1 /* can skip one block backwards */ -#define TP_HAVE_EOD 1 /* can seek to end of recorded data */ -#define TP_HAVE_TELL 1 /* can read current block address */ -#define TP_HAVE_SEEK 1 /* can seek to block */ -#define TP_HAVE_RAS1 1 /* can run selftest 1 */ -#define TP_HAVE_RAS2 1 /* can run selftest 2 */ -/* These last two selftests shouldn't be used yet! */ - -#elif QIC02_TAPE_DRIVE == MT_ISTEAC_MT2ST -/* can anyone verify this entry?? */ -#define TP_HAVE_DENS 0 /* cannot do set density?? (QIC-150?) */ -#define TP_HAVE_BSF 0 -#define TP_HAVE_FSR 1 /* can skip one block forwards */ -#define TP_HAVE_BSR 1 /* can skip one block backwards */ -#define TP_HAVE_EOD 1 /* can seek to end of recorded data */ -#define TP_HAVE_SEEK 1 /* can seek to block */ -#define TP_HAVE_TELL 1 /* can read current block address */ -#define TP_HAVE_RAS1 1 /* can run selftest 1 */ -#define TP_HAVE_RAS2 1 /* can run selftest 2 */ -/* These last two selftests shouldn't be used yet! */ - -#elif QIC02_TAPE_DRIVE == MT_ISQIC02_ALL_FEATURES -#define TP_HAVE_DENS 1 /* can do set density */ -#define TP_HAVE_BSF 1 /* can search filemark backwards */ -#define TP_HAVE_FSR 1 /* can skip one block forwards */ -#define TP_HAVE_BSR 1 /* can skip one block backwards */ -#define TP_HAVE_EOD 1 /* can seek to end of recorded data */ -#define TP_HAVE_SEEK 1 /* seek to block address */ -#define TP_HAVE_TELL 1 /* tell current block address */ -#define TP_HAVE_RAS1 1 /* can run selftest 1 */ -#define TP_HAVE_RAS2 1 /* can run selftest 2 */ -/* These last two selftests shouldn't be used yet! */ - - -#else -#error No QIC-02 tape drive type defined! -/* If your drive is not listed above, first try the 'ALL_FEATURES', - * to see what commands are supported, then create your own entry in - * the list above. You may want to mail it to me, so that I can include - * it in the next release. - */ -#endif - -#endif /* !CONFIG_QIC02_DYNCONF */ - - -/* WANGTEK interface card specifics */ -#define WT_QIC02_STAT_PORT (QIC02_TAPE_PORT) -#define WT_QIC02_CTL_PORT (QIC02_TAPE_PORT) -#define WT_QIC02_CMD_PORT (QIC02_TAPE_PORT+1) -#define WT_QIC02_DATA_PORT (QIC02_TAPE_PORT+1) - -/* status register bits (Active LOW!) */ -#define WT_QIC02_STAT_POLARITY 0 -#define WT_QIC02_STAT_READY 0x01 -#define WT_QIC02_STAT_EXCEPTION 0x02 -#define WT_QIC02_STAT_MASK (WT_QIC02_STAT_READY|WT_QIC02_STAT_EXCEPTION) - -#define WT_QIC02_STAT_RESETMASK 0x07 -#define WT_QIC02_STAT_RESETVAL (WT_QIC02_STAT_RESETMASK & ~WT_QIC02_STAT_EXCEPTION) - -/* controller register (QIC02_CTL_PORT) bits */ -#define WT_QIC02_CTL_RESET 0x02 -#define WT_QIC02_CTL_REQUEST 0x04 -#define WT_CTL_ONLINE 0x01 -#define WT_CTL_CMDOFF 0xC0 - -#define WT_CTL_DMA3 0x10 /* enable dma chan3 */ -#define WT_CTL_DMA1 0x08 /* enable dma chan1 or chan2 */ - -/* EMERALD interface card specifics - * Much like Wangtek, only different polarity and bit locations - */ -#define EMR_QIC02_STAT_PORT (QIC02_TAPE_PORT) -#define EMR_QIC02_CTL_PORT (QIC02_TAPE_PORT) -#define EMR_QIC02_CMD_PORT (QIC02_TAPE_PORT+1) -#define EMR_QIC02_DATA_PORT (QIC02_TAPE_PORT+1) - -/* status register bits (Active High!) */ -#define EMR_QIC02_STAT_POLARITY 1 -#define EMR_QIC02_STAT_READY 0x01 -#define EMR_QIC02_STAT_EXCEPTION 0x02 -#define EMR_QIC02_STAT_MASK (EMR_QIC02_STAT_READY|EMR_QIC02_STAT_EXCEPTION) - -#define EMR_QIC02_STAT_RESETMASK 0x07 -#define EMR_QIC02_STAT_RESETVAL (EMR_QIC02_STAT_RESETMASK & ~EMR_QIC02_STAT_EXCEPTION) - -/* controller register (QIC02_CTL_PORT) bits */ -#define EMR_QIC02_CTL_RESET 0x02 -#define EMR_QIC02_CTL_REQUEST 0x04 -#define EMR_CTL_ONLINE 0x01 -#define EMR_CTL_CMDOFF 0xC0 - -#define EMR_CTL_DMA3 0x10 /* enable dma chan3 */ -#define EMR_CTL_DMA1 0x08 /* enable dma chan1 or chan2 */ - - - -/* ARCHIVE interface card specifics */ -#define AR_QIC02_STAT_PORT (QIC02_TAPE_PORT+1) -#define AR_QIC02_CTL_PORT (QIC02_TAPE_PORT+1) -#define AR_QIC02_CMD_PORT (QIC02_TAPE_PORT) -#define AR_QIC02_DATA_PORT (QIC02_TAPE_PORT) - -#define AR_START_DMA_PORT (QIC02_TAPE_PORT+2) -#define AR_RESET_DMA_PORT (QIC02_TAPE_PORT+3) - -/* STAT port bits */ -#define AR_QIC02_STAT_POLARITY 0 -#define AR_STAT_IRQF 0x80 /* active high, interrupt request flag */ -#define AR_QIC02_STAT_READY 0x40 /* active low */ -#define AR_QIC02_STAT_EXCEPTION 0x20 /* active low */ -#define AR_QIC02_STAT_MASK (AR_QIC02_STAT_READY|AR_QIC02_STAT_EXCEPTION) -#define AR_STAT_DMADONE 0x10 /* active high, DMA done */ -#define AR_STAT_DIRC 0x08 /* active high, direction */ - -#define AR_QIC02_STAT_RESETMASK 0x70 /* check RDY,EXC,DMADONE */ -#define AR_QIC02_STAT_RESETVAL ((AR_QIC02_STAT_RESETMASK & ~AR_STAT_IRQF & ~AR_QIC02_STAT_EXCEPTION) | AR_STAT_DMADONE) - -/* CTL port bits */ -#define AR_QIC02_CTL_RESET 0x80 /* drive reset */ -#define AR_QIC02_CTL_REQUEST 0x40 /* notify of new command */ -#define AR_CTL_IEN 0x20 /* interrupt enable */ -#define AR_CTL_DNIEN 0x10 /* done-interrupt enable */ - /* Note: All of these bits are cleared automatically when writing to - * AR_RESET_DMA_PORT. So AR_CTL_IEN and AR_CTL_DNIEN must be - * reprogrammed before the write to AR_START_DMA_PORT. - */ - - -/* MOUNTAIN interface specifics */ -#define MTN_QIC02_STAT_PORT (QIC02_TAPE_PORT+1) -#define MTN_QIC02_CTL_PORT (QIC02_TAPE_PORT+1) -#define MTN_QIC02_CMD_PORT (QIC02_TAPE_PORT) -#define MTN_QIC02_DATA_PORT (QIC02_TAPE_PORT) - -#define MTN_W_SELECT_DMA_PORT (QIC02_TAPE_PORT+2) -#define MTN_R_DESELECT_DMA_PORT (QIC02_TAPE_PORT+2) -#define MTN_W_DMA_WRITE_PORT (QIC02_TAPE_PORT+3) - -/* STAT port bits */ -#define MTN_QIC02_STAT_POLARITY 0 -#define MTN_QIC02_STAT_READY 0x02 /* active low */ -#define MTN_QIC02_STAT_EXCEPTION 0x04 /* active low */ -#define MTN_QIC02_STAT_MASK (MTN_QIC02_STAT_READY|MTN_QIC02_STAT_EXCEPTION) -#define MTN_STAT_DMADONE 0x01 /* active high, DMA done */ - -#define MTN_QIC02_STAT_RESETMASK 0x07 /* check RDY,EXC,DMADONE */ -#define MTN_QIC02_STAT_RESETVAL ((MTN_QIC02_STAT_RESETMASK & ~MTN_QIC02_STAT_EXCEPTION) | MTN_STAT_DMADONE) - -/* CTL port bits */ -#define MTN_QIC02_CTL_RESET_NOT 0x80 /* drive reset, active low */ -#define MTN_QIC02_CTL_RESET 0x80 /* Fodder #definition to keep gcc happy */ - -#define MTN_QIC02_CTL_ONLINE 0x40 /* Put drive on line */ -#define MTN_QIC02_CTL_REQUEST 0x20 /* notify of new command */ -#define MTN_QIC02_CTL_IRQ_DRIVER 0x10 /* Enable IRQ tristate driver */ -#define MTN_QIC02_CTL_DMA_DRIVER 0x08 /* Enable DMA tristate driver */ -#define MTN_CTL_EXC_IEN 0x04 /* Exception interrupt enable */ -#define MTN_CTL_RDY_IEN 0x02 /* Ready interrupt enable */ -#define MTN_CTL_DNIEN 0x01 /* done-interrupt enable */ - -#define MTN_CTL_ONLINE (MTN_QIC02_CTL_RESET_NOT | MTN_QIC02_CTL_IRQ_DRIVER | MTN_QIC02_CTL_DMA_DRIVER) - - -#ifndef CONFIG_QIC02_DYNCONF - -# define QIC02_TAPE_DEBUG (qic02_tape_debug) - -# if QIC02_TAPE_IFC == WANGTEK -# define QIC02_STAT_POLARITY WT_QIC02_STAT_POLARITY -# define QIC02_STAT_PORT WT_QIC02_STAT_PORT -# define QIC02_CTL_PORT WT_QIC02_CTL_PORT -# define QIC02_CMD_PORT WT_QIC02_CMD_PORT -# define QIC02_DATA_PORT WT_QIC02_DATA_PORT - -# define QIC02_STAT_READY WT_QIC02_STAT_READY -# define QIC02_STAT_EXCEPTION WT_QIC02_STAT_EXCEPTION -# define QIC02_STAT_MASK WT_QIC02_STAT_MASK -# define QIC02_STAT_RESETMASK WT_QIC02_STAT_RESETMASK -# define QIC02_STAT_RESETVAL WT_QIC02_STAT_RESETVAL - -# define QIC02_CTL_RESET WT_QIC02_CTL_RESET -# define QIC02_CTL_REQUEST WT_QIC02_CTL_REQUEST - -# if QIC02_TAPE_DMA == 3 -# ifdef QIC02_TAPE_DMA3_FIX -# define WT_CTL_DMA WT_CTL_DMA1 -# else -# define WT_CTL_DMA WT_CTL_DMA3 -# endif -# elif QIC02_TAPE_DMA == 1 -# define WT_CTL_DMA WT_CTL_DMA1 -# else -# error Unsupported or incorrect DMA configuration. -# endif - -# elif QIC02_TAPE_IFC == EMERALD -# define QIC02_STAT_POLARITY EMR_QIC02_STAT_POLARITY -# define QIC02_STAT_PORT EMR_QIC02_STAT_PORT -# define QIC02_CTL_PORT EMR_QIC02_CTL_PORT -# define QIC02_CMD_PORT EMR_QIC02_CMD_PORT -# define QIC02_DATA_PORT EMR_QIC02_DATA_PORT - -# define QIC02_STAT_READY EMR_QIC02_STAT_READY -# define QIC02_STAT_EXCEPTION EMR_QIC02_STAT_EXCEPTION -# define QIC02_STAT_MASK EMR_QIC02_STAT_MASK -# define QIC02_STAT_RESETMASK EMR_QIC02_STAT_RESETMASK -# define QIC02_STAT_RESETVAL EMR_QIC02_STAT_RESETVAL - -# define QIC02_CTL_RESET EMR_QIC02_CTL_RESET -# define QIC02_CTL_REQUEST EMR_QIC02_CTL_REQUEST - -# if QIC02_TAPE_DMA == 3 -# ifdef QIC02_TAPE_DMA3_FIX -# define EMR_CTL_DMA EMR_CTL_DMA1 -# else -# define EMR_CTL_DMA EMR_CTL_DMA3 -# endif -# elif QIC02_TAPE_DMA == 1 -# define EMR_CTL_DMA EMR_CTL_DMA1 -# else -# error Unsupported or incorrect DMA configuration. -# endif - -# elif QIC02_TAPE_IFC == ARCHIVE -# define QIC02_STAT_POLARITY AR_QIC02_STAT_POLARITY -# define QIC02_STAT_PORT AR_QIC02_STAT_PORT -# define QIC02_CTL_PORT AR_QIC02_CTL_PORT -# define QIC02_CMD_PORT AR_QIC02_CMD_PORT -# define QIC02_DATA_PORT AR_QIC02_DATA_PORT - -# define QIC02_STAT_READY AR_QIC02_STAT_READY -# define QIC02_STAT_EXCEPTION AR_QIC02_STAT_EXCEPTION -# define QIC02_STAT_MASK AR_QIC02_STAT_MASK -# define QIC02_STAT_RESETMASK AR_QIC02_STAT_RESETMASK -# define QIC02_STAT_RESETVAL AR_QIC02_STAT_RESETVAL - -# define QIC02_CTL_RESET AR_QIC02_CTL_RESET -# define QIC02_CTL_REQUEST AR_QIC02_CTL_REQUEST - -# if QIC02_TAPE_DMA > 3 /* channel 2 is used by the floppy driver */ -# error DMA channels other than 1 and 3 are not supported. -# endif - -# elif QIC02_TAPE_IFC == MOUNTAIN -# define QIC02_STAT_POLARITY MTN_QIC02_STAT_POLARITY -# define QIC02_STAT_PORT MTN_QIC02_STAT_PORT -# define QIC02_CTL_PORT MTN_QIC02_CTL_PORT -# define QIC02_CMD_PORT MTN_QIC02_CMD_PORT -# define QIC02_DATA_PORT MTN_QIC02_DATA_PORT - -# define QIC02_STAT_READY MTN_QIC02_STAT_READY -# define QIC02_STAT_EXCEPTION MTN_QIC02_STAT_EXCEPTION -# define QIC02_STAT_MASK MTN_QIC02_STAT_MASK -# define QIC02_STAT_RESETMASK MTN_QIC02_STAT_RESETMASK -# define QIC02_STAT_RESETVAL MTN_QIC02_STAT_RESETVAL - -# define QIC02_CTL_RESET MTN_QIC02_CTL_RESET -# define QIC02_CTL_REQUEST MTN_QIC02_CTL_REQUEST - -# if QIC02_TAPE_DMA > 3 /* channel 2 is used by the floppy driver */ -# error DMA channels other than 1 and 3 are not supported. -# endif - -# else -# error No valid interface card specified! -# endif /* QIC02_TAPE_IFC */ - - - /* An ugly hack to make sure WT_CTL_DMA is defined even for the - * static, non-Wangtek case. The alternative was even worse. - */ -# ifndef WT_CTL_DMA -# define WT_CTL_DMA WT_CTL_DMA1 -# endif - -/*******************/ - -#else /* !CONFIG_QIC02_DYNCONF */ - -/* Now the runtime config version, using variables instead of constants. - * - * qic02_tape_dynconf is R/O for the kernel, set from userspace. - * qic02_tape_ccb is private to the driver, R/W. - */ - -# define QIC02_TAPE_DRIVE (qic02_tape_dynconf.mt_type) -# define QIC02_TAPE_IFC (qic02_tape_ccb.ifc_type) -# define QIC02_TAPE_IRQ (qic02_tape_dynconf.irqnr) -# define QIC02_TAPE_DMA (qic02_tape_dynconf.dmanr) -# define QIC02_TAPE_PORT (qic02_tape_dynconf.port) -# define WT_CTL_DMA (qic02_tape_ccb.dma_enable_value) -# define QIC02_TAPE_DEBUG (qic02_tape_dynconf.debug) - -# define QIC02_STAT_PORT (qic02_tape_ccb.port_stat) -# define QIC02_CTL_PORT (qic02_tape_ccb.port_ctl) -# define QIC02_CMD_PORT (qic02_tape_ccb.port_cmd) -# define QIC02_DATA_PORT (qic02_tape_ccb.port_data) - -# define QIC02_STAT_POLARITY (qic02_tape_ccb.stat_polarity) -# define QIC02_STAT_READY (qic02_tape_ccb.stat_ready) -# define QIC02_STAT_EXCEPTION (qic02_tape_ccb.stat_exception) -# define QIC02_STAT_MASK (qic02_tape_ccb.stat_mask) - -# define QIC02_STAT_RESETMASK (qic02_tape_ccb.stat_resetmask) -# define QIC02_STAT_RESETVAL (qic02_tape_ccb.stat_resetval) - -# define QIC02_CTL_RESET (qic02_tape_ccb.ctl_reset) -# define QIC02_CTL_REQUEST (qic02_tape_ccb.ctl_request) - -# define TP_HAVE_DENS (qic02_tape_dynconf.have_dens) -# define TP_HAVE_BSF (qic02_tape_dynconf.have_bsf) -# define TP_HAVE_FSR (qic02_tape_dynconf.have_fsr) -# define TP_HAVE_BSR (qic02_tape_dynconf.have_bsr) -# define TP_HAVE_EOD (qic02_tape_dynconf.have_eod) -# define TP_HAVE_SEEK (qic02_tape_dynconf.have_seek) -# define TP_HAVE_TELL (qic02_tape_dynconf.have_tell) -# define TP_HAVE_RAS1 (qic02_tape_dynconf.have_ras1) -# define TP_HAVE_RAS2 (qic02_tape_dynconf.have_ras2) - -#endif /* CONFIG_QIC02_DYNCONF */ - - -/* "Vendor Unique" codes */ -/* Archive seek & tell stuff */ -#define AR_QCMDV_TELL_BLK 0xAE /* read current block address */ -#define AR_QCMDV_SEEK_BLK 0xAD /* seek to specific block */ -#define AR_SEEK_BUF_SIZE 3 /* address is 3 bytes */ - - - -/* - * Misc common stuff - */ - -/* Standard QIC-02 commands -- rev F. All QIC-02 drives must support these */ -#define QCMD_SEL_1 0x01 /* select drive 1 */ -#define QCMD_SEL_2 0x02 /* select drive 2 */ -#define QCMD_SEL_3 0x04 /* select drive 3 */ -#define QCMD_SEL_4 0x08 /* select drive 4 */ -#define QCMD_REWIND 0x21 /* rewind tape */ -#define QCMD_ERASE 0x22 /* erase tape */ -#define QCMD_RETEN 0x24 /* retension tape */ -#define QCMD_WRT_DATA 0x40 /* write data */ -#define QCMD_WRT_FM 0x60 /* write file mark */ -#define QCMD_RD_DATA 0x80 /* read data */ -#define QCMD_RD_FM 0xA0 /* read file mark (forward direction) */ -#define QCMD_RD_STAT 0xC0 /* read status */ - -/* Other (optional/vendor unique) commands */ - /* Density commands are only valid when TP_BOM is set! */ -#define QCMD_DENS_11 0x26 /* QIC-11 */ -#define QCMD_DENS_24 0x27 /* QIC-24: 9 track 60MB */ -#define QCMD_DENS_120 0x28 /* QIC-120: 15 track 120MB */ -#define QCMD_DENS_150 0x29 /* QIC-150: 18 track 150MB */ -#define QCMD_DENS_300 0x2A /* QIC-300/QIC-2100 */ -#define QCMD_DENS_600 0x2B /* QIC-600/QIC-2200 */ -/* don't know about QIC-1000 and QIC-1350 */ - -#define QCMD_WRTNU_DATA 0x40 /* write data, no underruns, insert filler. */ -#define QCMD_SPACE_FWD 0x81 /* skip next block */ -#define QCMD_SPACE_BCK 0x89 /* move tape head one block back -- very useful! */ -#define QCMD_RD_FM_BCK 0xA8 /* read filemark (backwards) */ -#define QCMD_SEEK_EOD 0xA3 /* skip to EOD */ -#define QCMD_RD_STAT_X1 0xC1 /* read extended status 1 */ -#define QCMD_RD_STAT_X2 0xC4 /* read extended status 2 */ -#define QCMD_RD_STAT_X3 0xE0 /* read extended status 3 */ -#define QCMD_SELF_TST1 0xC2 /* run self test 1 (nondestructive) */ -#define QCMD_SELF_TST2 0xCA /* run self test 2 (destructive) */ - - - -/* Optional, QFA (Quick File Access) commands. - * Not all drives support this, but those that do could use these commands - * to implement semi-non-sequential access. `mt fsf` would benefit from this. - * QFA divides the tape into 2 partitions, a data and a directory partition, - * causing some incompatibility problems wrt std QIC-02 data exchange. - * It would be useful to cache the directory info, but that might be tricky - * to do in kernel-space. [Size constraints.] - * Refer to the QIC-02 specs, appendix A for more information. - * I have no idea how other *nix variants implement QFA. - * I have no idea which drives support QFA and which don't. - */ -#define QFA_ENABLE 0x2D /* enter QFA mode, give @ BOT only */ -#define QFA_DATA 0x20 /* select data partition */ -#define QFA_DIR 0x23 /* select directory partition */ -#define QFA_RD_POS 0xCF /* read position+status bytes */ -#define QFA_SEEK_EOD 0xA1 /* seek EOD within current partition */ -#define QFA_SEEK_BLK 0xAF /* seek to a block within current partition */ - - - - -/* - * Debugging flags - */ -#define TPQD_SENSE_TEXT 0x0001 -#define TPQD_SENSE_CNTS 0x0002 -#define TPQD_REWIND 0x0004 -#define TPQD_TERM_CYCLE 0x0008 -#define TPQD_IOCTLS 0x0010 -#define TPQD_DMAX 0x0020 -#define TPQD_BLKSZ 0x0040 -#define TPQD_MISC 0x0080 - -#define TPQD_DEBUG 0x0100 - -#define TPQD_DIAGS 0x1000 - -#define TPQD_ALWAYS 0x8000 - -#define TPQD_DEFAULT_FLAGS 0x00fc - - -#define TPQDBG(f) ((QIC02_TAPE_DEBUG) & (TPQD_##f)) - - -/* Minor device codes for tapes: - * |7|6|5|4|3|2|1|0| - * | \ | / \ | / |_____ 1=rewind on close, 0=no rewind on close - * | \|/ |_________ Density: 000=none, 001=QIC-11, 010=24, 011=120, - * | | 100=QIC-150, 101..111 reserved. - * | |_______________ Reserved for unit numbers. - * |___________________ Reserved for diagnostics during debugging. - */ - -#define TP_REWCLOSE(d) ((d)&1) /* rewind bit */ - /* rewind is only done if data has been transferred */ -#define TP_DENS(d) (((d) >> 1) & 0x07) /* tape density */ -#define TP_UNIT(d) (((d) >> 4) & 0x07) /* unit number */ - -/* print excessive diagnostics */ -#define TP_DIAGS(dev) (QIC02_TAPE_DEBUG & TPQD_DIAGS) - -/* status codes returned by a WTS_RDSTAT call */ -struct tpstatus { /* sizeof(short)==2), LSB first */ - unsigned short exs; /* Drive exception flags */ - unsigned short dec; /* data error count: nr of blocks rewritten/soft read errors */ - unsigned short urc; /* underrun count: nr of times streaming was interrupted */ -}; -#define TPSTATSIZE sizeof(struct tpstatus) - - -/* defines for tpstatus.exs -- taken from 386BSD wt driver */ -#define TP_POR 0x100 /* Power on or reset occurred */ -#define TP_EOR 0x200 /* REServed for end of RECORDED media */ -#define TP_PAR 0x400 /* REServed for bus parity */ -#define TP_BOM 0x800 /* Beginning of media */ -#define TP_MBD 0x1000 /* Marginal block detected */ -#define TP_NDT 0x2000 /* No data detected */ -#define TP_ILL 0x4000 /* Illegal command */ -#define TP_ST1 0x8000 /* Status byte 1 flag */ -#define TP_FIL 0x01 /* File mark detected */ -#define TP_BNL 0x02 /* Bad block not located */ -#define TP_UDA 0x04 /* Unrecoverable data error */ -#define TP_EOM 0x08 /* End of media */ -#define TP_WRP 0x10 /* Write protected cartridge */ -#define TP_USL 0x20 /* Unselected drive */ -#define TP_CNI 0x40 /* Cartridge not in place */ -#define TP_ST0 0x80 /* Status byte 0 flag */ - -#define REPORT_ERR0 (TP_CNI|TP_USL|TP_WRP|TP_EOM|TP_UDA|TP_BNL|TP_FIL) -#define REPORT_ERR1 (TP_ILL|TP_NDT|TP_MBD|TP_PAR) - - -/* exception numbers */ -#define EXC_UNKNOWN 0 /* (extra) Unknown exception code */ -#define EXC_NDRV 1 /* No drive */ -#define EXC_NCART 2 /* No cartridge */ -#define EXC_WP 3 /* Write protected */ -#define EXC_EOM 4 /* EOM */ -#define EXC_RWA 5 /* read/write abort */ -#define EXC_XBAD 6 /* read error, bad block transferred */ -#define EXC_XFILLER 7 /* read error, filler block transferred */ -#define EXC_NDT 8 /* read error, no data */ -#define EXC_NDTEOM 9 /* read error, no data & EOM */ -#define EXC_NDTBOM 10 /* read error, no data & BOM */ -#define EXC_FM 11 /* Read a filemark */ -#define EXC_ILL 12 /* Illegal command */ -#define EXC_POR 13 /* Power on/reset */ -#define EXC_MARGINAL 14 /* Marginal block detected */ -#define EXC_EOR 15 /* (extra, for SEEKEOD) End Of Recorded data reached */ -#define EXC_BOM 16 /* (extra) BOM reached */ - - -#define TAPE_NOTIFY_TIMEOUT 1000000 - -/* internal function return codes */ -#define TE_OK 0 /* everything is fine */ -#define TE_EX 1 /* exception detected */ -#define TE_ERR 2 /* some error */ -#define TE_NS 3 /* can't read status */ -#define TE_TIM 4 /* timed out */ -#define TE_DEAD 5 /* tape drive doesn't respond */ -#define TE_END 6 /******** Archive hack *****/ - -/* timeout timer values -- check these! */ -#define TIM_S (4*HZ) /* 4 seconds (normal cmds) */ -#define TIM_M (30*HZ) /* 30 seconds (write FM) */ -#define TIM_R (8*60*HZ) /* 8 minutes (retensioning) */ -#define TIM_F (2*3600*HZ) /* est. 1.2hr for full tape read/write+2 retens */ - -#define TIMERON(t) mod_timer(&tp_timer, jiffies + (t)) -#define TIMEROFF del_timer_sync(&tp_timer); -#define TIMERCONT add_timer(&tp_timer); - - -typedef char flag; -#define NO 0 /* NO must be 0 */ -#define YES 1 /* YES must be != 0 */ - - -#ifdef TDEBUG -# define TPQDEB(s) s -# define TPQPUTS(s) tpqputs(s) -#else -# define TPQDEB(s) -# define TPQPUTS(s) -#endif - - -/* NR_BLK_BUF is a `tuneable parameter'. If you're really low on - * kernel space, you could decrease it to 1, or if you got a very - * slow machine, you could increase it up to 127 blocks. Less kernel - * buffer blocks result in more context-switching. - */ -#define NR_BLK_BUF 20 /* max 127 blocks */ -#define TAPE_BLKSIZE 512 /* streamer tape block size (fixed) */ -#define TPQBUF_SIZE (TAPE_BLKSIZE*NR_BLK_BUF) /* buffer size */ - - -#define BLOCKS_BEYOND_EW 2 /* nr of blocks after Early Warning hole */ -#define BOGUS_IRQ 32009 - - -/* This is internal data, filled in based on the ifc_type field given - * by the user. Everex is mapped to Wangtek with a different - * `dma_enable_value', if dmanr==3. - */ -struct qic02_ccb { - long ifc_type; - - unsigned short port_stat; /* Status port address */ - unsigned short port_ctl; /* Control port address */ - unsigned short port_cmd; /* Command port address */ - unsigned short port_data; /* Data port address */ - - /* status register bits */ - unsigned short stat_polarity; /* invert status bits or not */ - unsigned short stat_ready; /* drive ready */ - unsigned short stat_exception; /* drive signals exception */ - unsigned short stat_mask; - unsigned short stat_resetmask; - unsigned short stat_resetval; - - /* control register bits */ - unsigned short ctl_reset; /* reset drive */ - unsigned short ctl_request; /* latch command */ - - /* This is used to change the DMA3 behaviour */ - unsigned short dma_enable_value; -}; - -#if MODULE -static int qic02_tape_init(void); -#else -extern int qic02_tape_init(void); /* for mem.c */ -#endif - - - -#endif /* CONFIG_QIC02_TAPE */ - -#endif /* _LINUX_TPQIC02_H */ - diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 6dbef2f8445a..dc392a1b58eb 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h @@ -25,15 +25,6 @@ #define BROKEN_GRAPHICS_PROGRAMS 1 #endif -extern struct vt_struct { - int vc_num; /* The console number */ - unsigned char vc_mode; /* KD_TEXT, ... */ - struct vt_mode vt_mode; - int vt_pid; - int vt_newvt; - wait_queue_head_t paste_wait; -} *vt_cons[MAX_NR_CONSOLES]; - extern void kd_mksound(unsigned int hz, unsigned int ticks); extern int kbd_rate(struct kbd_repeat *rep); @@ -41,25 +32,25 @@ extern int kbd_rate(struct kbd_repeat *rep); int vc_allocate(unsigned int console); int vc_cons_allocated(unsigned int console); -int vc_resize(int currcons, unsigned int cols, unsigned int lines); +int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); void vc_disallocate(unsigned int console); -void reset_palette(int currcons); -void set_palette(int currcons); +void reset_palette(struct vc_data *vc); +void set_palette(struct vc_data *vc); void do_blank_screen(int entering_gfx); void do_unblank_screen(int leaving_gfx); void unblank_screen(void); void poke_blanked_console(void); -int con_font_op(int currcons, struct console_font_op *op); -int con_font_set(int currcons, struct console_font_op *op); -int con_font_get(int currcons, struct console_font_op *op); -int con_font_default(int currcons, struct console_font_op *op); -int con_font_copy(int currcons, struct console_font_op *op); +int con_font_op(struct vc_data *vc, struct console_font_op *op); +int con_font_set(struct vc_data *vc, struct console_font_op *op); +int con_font_get(struct vc_data *vc, struct console_font_op *op); +int con_font_default(struct vc_data *vc, struct console_font_op *op); +int con_font_copy(struct vc_data *vc, struct console_font_op *op); int con_set_cmap(unsigned char __user *cmap); int con_get_cmap(unsigned char __user *cmap); -void scrollback(int); -void scrollfront(int); -void update_region(int currcons, unsigned long start, int count); -void redraw_screen(int new_console, int is_switch); +void scrollback(struct vc_data *vc, int lines); +void scrollfront(struct vc_data *vc, int lines); +void update_region(struct vc_data *vc, unsigned long start, int count); +void redraw_screen(struct vc_data *vc, int is_switch); #define update_screen(x) redraw_screen(x, 0) #define switch_screen(x) redraw_screen(x, 1) @@ -75,25 +66,26 @@ int con_set_trans_old(unsigned char __user * table); int con_get_trans_old(unsigned char __user * table); int con_set_trans_new(unsigned short __user * table); int con_get_trans_new(unsigned short __user * table); -int con_clear_unimap(int currcons, struct unimapinit *ui); -int con_set_unimap(int currcons, ushort ct, struct unipair __user *list); -int con_get_unimap(int currcons, ushort ct, ushort __user *uct, struct unipair __user *list); -int con_set_default_unimap(int currcons); -void con_free_unimap(int currcons); -void con_protect_unimap(int currcons, int rdonly); -int con_copy_unimap(int dstcons, int srccons); +int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui); +int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list); +int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, struct unipair __user *list); +int con_set_default_unimap(struct vc_data *vc); +void con_free_unimap(struct vc_data *vc); +void con_protect_unimap(struct vc_data *vc, int rdonly); +int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); /* vt.c */ -void complete_change_console(unsigned int new_console); +void complete_change_console(struct vc_data *vc); int vt_waitactive(int vt); -void change_console(unsigned int); -void reset_vc(unsigned int new_console); +void change_console(struct vc_data *new_vc); +void reset_vc(struct vc_data *vc); /* * vc_screen.c shares this temporary buffer with the console write code so that * we can easily avoid touching user space while holding the console spinlock. */ -#define CON_BUF_SIZE PAGE_SIZE + +#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) extern char con_buf[CON_BUF_SIZE]; extern struct semaphore con_buf_sem; diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 4ab519ad9f55..1262cb43c3ab 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -86,6 +86,7 @@ static inline void wait_on_inode(struct inode *inode) int wakeup_bdflush(long nr_pages); void laptop_io_completion(void); void laptop_sync_completion(void); +void throttle_vm_writeout(void); /* These are exported to sysctl. */ extern int dirty_background_ratio; diff --git a/include/media/tuner.h b/include/media/tuner.h index 3e9bac43d9b2..74378a280075 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -29,55 +29,70 @@ #define TUNER_PHILIPS_PAL_I 1 #define TUNER_PHILIPS_NTSC 2 #define TUNER_PHILIPS_SECAM 3 /* you must actively select B/G, L, L` */ + #define TUNER_ABSENT 4 #define TUNER_PHILIPS_PAL 5 #define TUNER_TEMIC_NTSC 6 /* 4032 FY5 (3X 7004, 9498, 9789) */ #define TUNER_TEMIC_PAL_I 7 /* 4062 FY5 (3X 8501, 9957) */ + #define TUNER_TEMIC_4036FY5_NTSC 8 /* 4036 FY5 (3X 1223, 1981, 7686) */ #define TUNER_ALPS_TSBH1_NTSC 9 #define TUNER_ALPS_TSBE1_PAL 10 #define TUNER_ALPS_TSBB5_PAL_I 11 + #define TUNER_ALPS_TSBE5_PAL 12 #define TUNER_ALPS_TSBC5_PAL 13 #define TUNER_TEMIC_4006FH5_PAL 14 /* 4006 FH5 (3X 9500, 9501, 7291) */ #define TUNER_ALPS_TSHC6_NTSC 15 + #define TUNER_TEMIC_PAL_DK 16 /* 4016 FY5 (3X 1392, 1393) */ #define TUNER_PHILIPS_NTSC_M 17 #define TUNER_TEMIC_4066FY5_PAL_I 18 /* 4066 FY5 (3X 7032, 7035) */ #define TUNER_TEMIC_4006FN5_MULTI_PAL 19 /* B/G, I and D/K autodetected (3X 7595, 7606, 7657)*/ + #define TUNER_TEMIC_4009FR5_PAL 20 /* incl. FM radio (3X 7607, 7488, 7711)*/ #define TUNER_TEMIC_4039FR5_NTSC 21 /* incl. FM radio (3X 7246, 7578, 7732)*/ #define TUNER_TEMIC_4046FM5 22 /* you must actively select B/G, D/K, I, L, L` ! (3X 7804, 7806, 8103, 8104)*/ #define TUNER_PHILIPS_PAL_DK 23 + #define TUNER_PHILIPS_FQ1216ME 24 /* you must actively select B/G/D/K, I, L, L` */ #define TUNER_LG_PAL_I_FM 25 #define TUNER_LG_PAL_I 26 #define TUNER_LG_NTSC_FM 27 + #define TUNER_LG_PAL_FM 28 #define TUNER_LG_PAL 29 #define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30 /* B/G, I and D/K autodetected (3X 8155, 8160, 8163)*/ #define TUNER_SHARP_2U5JF5540_NTSC 31 + #define TUNER_Samsung_PAL_TCPM9091PD27 32 #define TUNER_MT2032 33 #define TUNER_TEMIC_4106FH5 34 /* 4106 FH5 (3X 7808, 7865)*/ #define TUNER_TEMIC_4012FY5 35 /* 4012 FY5 (3X 0971, 1099)*/ + #define TUNER_TEMIC_4136FY5 36 /* 4136 FY5 (3X 7708, 7746)*/ #define TUNER_LG_PAL_NEW_TAPC 37 #define TUNER_PHILIPS_FM1216ME_MK3 38 #define TUNER_LG_NTSC_NEW_TAPC 39 + #define TUNER_HITACHI_NTSC 40 #define TUNER_PHILIPS_PAL_MK 41 #define TUNER_PHILIPS_ATSC 42 #define TUNER_PHILIPS_FM1236_MK3 43 + #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ /* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ #define TUNER_MICROTUNE_4049FM5 45 #define TUNER_LG_NTSC_TAPE 47 + #define TUNER_TNF_8831BGFF 48 #define TUNER_MICROTUNE_4042FI5 49 /* FusionHDTV 3 Gold - 4042 FI5 (3X 8147) */ #define TUNER_TCL_2002N 50 #define TUNER_PHILIPS_FM1256_IH3 51 + #define TUNER_THOMSON_DTT7610 52 +#define TUNER_PHILIPS_FQ1286 53 +#define TUNER_PHILIPS_TDA8290 54 #define NOTUNER 0 #define PAL 1 /* PAL_BG */ @@ -102,10 +117,6 @@ #define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */ #define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */ -#if 0 /* obsolete */ -# define TUNER_SET_RADIOFREQ _IOW('t',3,int) /* set radio freq */ -# define TUNER_SET_MODE _IOW('t',4,int) /* set tuner mode */ -#endif #define TDA9887_SET_CONFIG _IOW('t',5,int) /* tv card specific */ @@ -123,4 +134,62 @@ # define TDA9887_DEEMPHASIS_75 (3<<16) # define TDA9887_AUTOMUTE (1<<18) +#ifdef __KERNEL__ + +#define I2C_ADDR_TDA8290 0x4b +#define I2C_ADDR_TDA8275 0x61 + +struct tuner { + /* device */ + struct i2c_client i2c; + + /* state + config */ + unsigned int initialized; + unsigned int type; /* chip type */ + unsigned int freq; /* keep track of the current settings */ + v4l2_std_id std; + int using_v4l2; + + enum v4l2_tuner_type mode; + unsigned int input; + + /* used by MT2032 */ + unsigned int xogc; + unsigned int radio_if2; + + /* used by tda8290 */ + unsigned char i2c_easy_mode[2]; + unsigned char i2c_set_freq[8]; + + /* function ptrs */ + void (*tv_freq)(struct i2c_client *c, unsigned int freq); + void (*radio_freq)(struct i2c_client *c, unsigned int freq); + int (*has_signal)(struct i2c_client *c); + int (*is_stereo)(struct i2c_client *c); +}; + +extern unsigned int tuner_debug; +extern unsigned const int tuner_count; + +extern int microtune_init(struct i2c_client *c); +extern int tda8290_init(struct i2c_client *c); +extern int default_tuner_init(struct i2c_client *c); + +#define tuner_warn(fmt, arg...) \ + dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg) +#define tuner_info(fmt, arg...) \ + dev_printk(KERN_INFO , &t->i2c.dev , fmt , ## arg) +#define tuner_dbg(fmt, arg...) \ + if (tuner_debug) dev_printk(KERN_DEBUG , &t->i2c.dev , fmt , ## arg) + +#endif /* __KERNEL__ */ + #endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * --------------------------------------------------------------------------- + * Local variables: + * c-basic-offset: 8 + * End: + */ diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h index 98c2e33f6159..850dfa877fda 100644 --- a/include/scsi/scsi_driver.h +++ b/include/scsi/scsi_driver.h @@ -14,6 +14,8 @@ struct scsi_driver { int (*init_command)(struct scsi_cmnd *); void (*rescan)(struct device *); int (*issue_flush)(struct device *, sector_t *); + int (*prepare_flush)(struct request_queue *, struct request *); + void (*end_flush)(struct request_queue *, struct request *); }; #define to_scsi_driver(drv) \ container_of((drv), struct scsi_driver, gendrv) diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 191b8fced8ac..1d3e91542fa9 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -363,6 +363,12 @@ struct scsi_host_template { unsigned skip_settle_delay:1; /* + * ordered write support + */ + unsigned ordered_flush:1; + unsigned ordered_tag:1; + + /* * Countdown for host blocking with no commands outstanding */ unsigned int max_host_blocked; @@ -502,6 +508,12 @@ struct Scsi_Host { unsigned reverse_ordering:1; /* + * ordered write support + */ + unsigned ordered_flush:1; + unsigned ordered_tag:1; + + /* * Host has rejected a command because it was busy. */ unsigned int host_blocked; |
