diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-09-28 22:25:29 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-09-28 22:25:29 +0000 |
commit | 0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch) | |
tree | 5085c389f09da78182b899d19fe1068b619a69dd /include | |
parent | 273767781288c35c9d679e908672b9996cda4c34 (diff) |
Merge with 2.3.10.
Diffstat (limited to 'include')
58 files changed, 1087 insertions, 953 deletions
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 2ceaa977d..046fd5278 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h @@ -356,22 +356,6 @@ __initfunc(static void check_cyrix_cpu(void)) __initfunc(static void check_cyrix_coma(void)) { - if (boot_cpu_data.coma_bug) { - unsigned char ccr3, tmp; - cli(); - ccr3 = getCx86(CX86_CCR3); - setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ - tmp = getCx86(0x31); - setCx86(0x31, tmp | 0xf8); - tmp = getCx86(0x32); - setCx86(0x32, tmp | 0x7f); - setCx86(0x33, 0); - tmp = getCx86(0x3c); - setCx86(0x3c, tmp | 0x87); - setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ - sti(); - printk("Cyrix processor with \"coma bug\" found, workaround enabled\n"); - } } /* diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h new file mode 100644 index 000000000..fc1244493 --- /dev/null +++ b/include/asm-i386/setup.h @@ -0,0 +1,4 @@ +/* + * Just a place holder. We don't want to have to test x86 before + * we include stuff + */ diff --git a/include/asm-mips/current.h b/include/asm-mips/current.h index 0311d92e1..3015ce4bd 100644 --- a/include/asm-mips/current.h +++ b/include/asm-mips/current.h @@ -1,13 +1,14 @@ -/* $Id: current.h,v 1.4 1998/08/25 09:21:55 ralf Exp $ +/* $Id: current.h,v 1.5 1999/07/26 19:42:43 harald Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1998 Ralf Baechle + * Copyright (C) 1999 Silicon Graphics, Inc. */ -#ifndef __ASM_MIPS_CURRENT_H -#define __ASM_MIPS_CURRENT_H +#ifndef _ASM_CURRENT_H +#define _ASM_CURRENT_H #ifdef _LANGUAGE_C @@ -32,4 +33,4 @@ register struct task_struct *current asm("$28"); #endif -#endif /* __ASM_MIPS_CURRENT_H */ +#endif /* _ASM_CURRENT_H */ diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h index a8fb34260..0763d0e99 100644 --- a/include/asm-mips/errno.h +++ b/include/asm-mips/errno.h @@ -5,10 +5,10 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1995 by Ralf Baechle + * Copyright (C) 1995, 1999 by Ralf Baechle */ -#ifndef __ASM_MIPS_ERRNO_H -#define __ASM_MIPS_ERRNO_H +#ifndef _ASM_ERRNO_H +#define _ASM_ERRNO_H /* * These error numbers are intended to be MIPS ABI compatible @@ -144,19 +144,13 @@ #define ENOMEDIUM 159 /* No medium found */ #define EMEDIUMTYPE 160 /* Wrong medium type */ -/* - * IRIX 5 error number start from 1000. - * Stupid enough; ECANCELED gets redefined with a different value ... -#define ECANCELED 1000 - */ +#define EDQUOT 1133 /* Quota exceeded */ -/* - * IRIX 4 compatibility error numbers. - */ -#define EDQUOT 1133 /* Quota exceeded */ -#define ENFSREMOTE 1134 /* ??? */ +#ifdef __KERNEL__ /* The biggest error number defined here or in <linux/errno.h>. */ -#define EMAXERRNO 1134 +#define EMAXERRNO 1133 + +#endif /* __KERNEL__ */ -#endif /* __ASM_MIPS_ERRNO_H */ +#endif /* _ASM_ERRNO_H */ diff --git a/include/asm-mips/offset.h b/include/asm-mips/offset.h index 6ed304016..c07690bd7 100644 --- a/include/asm-mips/offset.h +++ b/include/asm-mips/offset.h @@ -84,19 +84,16 @@ #define MM_CONTEXT 52 /* Linux sigcontext offsets. */ -#define SC_REGMASK 0 -#define SC_STATUS 4 -#define SC_PC 8 #define SC_REGS 16 #define SC_FPREGS 272 +#define SC_MDHI 544 +#define SC_MDLO 552 +#define SC_PC 8 +#define SC_STATUS 4 #define SC_OWNEDFP 528 #define SC_FPC_CSR 532 #define SC_FPC_EIR 536 -#define SC_SSFLAGS 540 -#define SC_MDHI 544 -#define SC_MDLO 552 #define SC_CAUSE 560 #define SC_BADVADDR 564 -#define SC_SIGSET 568 #endif /* !(_MIPS_OFFSET_H) */ diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 3a06bea80..080f30c33 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.17 1999/08/09 19:43:17 harald Exp $ +/* $Id: processor.h,v 1.18 1999/08/18 23:37:49 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -6,10 +6,11 @@ * * Copyright (C) 1994 Waldorf GMBH * Copyright (C) 1995, 1996, 1997, 1998 Ralf Baechle - * Modified further for R[236]000 compatibility by Paul M. Antoine + * Copyright (C) 1996 Paul M. Antoine + * Copyright (C) 1999 Silicon Graphics, Inc. */ -#ifndef __ASM_MIPS_PROCESSOR_H -#define __ASM_MIPS_PROCESSOR_H +#ifndef _ASM_PROCESSOR_H +#define _ASM_PROCESSOR_H /* * Default implementation of macro that returns current @@ -179,7 +180,8 @@ struct thread_struct { #if !defined (_LANGUAGE_ASSEMBLY) /* Free all resources held by a thread. */ -extern void release_thread(struct task_struct *); +#define release_thread(thread) do { } while(0) + extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); /* Copy and release all segment info associated with a VM */ @@ -201,12 +203,16 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t) return ((unsigned long*)t->reg29)[17]; } -struct pt_regs; - /* * Do necessary setup to start up a newly executed thread. */ -extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp); +#define start_thread(regs, new_pc, new_sp) do { \ + /* New thread looses kernel privileges. */ \ + regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KSU_USER;\ + regs->cp0_epc = new_pc; \ + regs->regs[29] = new_sp; \ + current->tss.current_ds = USER_DS; \ +} while (0) /* Allocation and freeing of basic task resources. */ /* @@ -246,4 +252,4 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long #define return_address() NULL #endif -#endif /* __ASM_MIPS_PROCESSOR_H */ +#endif /* _ASM_PROCESSOR_H */ diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index 2531fb863..f1f9ce269 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h @@ -1,4 +1,4 @@ -/* $Id: ptrace.h,v 1.4 1999/01/04 16:09:25 ralf Exp $ +/* $Id: ptrace.h,v 1.6 1999/08/09 19:43:17 harald Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -60,7 +60,7 @@ struct pt_regs { /* * Does the process account for user or for system time? */ -#define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) +#define user_mode(regs) ((regs)->cp0_status & 0x10) #define instruction_pointer(regs) ((regs)->cp0_epc) diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h index 3571a30de..59a30e987 100644 --- a/include/asm-mips/signal.h +++ b/include/asm-mips/signal.h @@ -1,13 +1,14 @@ -/* $Id: signal.h,v 1.5 1998/08/25 09:22:01 ralf Exp $ +/* $Id: signal.h,v 1.6 1999/08/18 23:37:49 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle + * Copyright (C) 1995, 1996, 1997, 1998, 1999 by Ralf Baechle + * Copyright (C) 1999 Silicon Graphics, Inc. */ -#ifndef __ASM_MIPS_SIGNAL_H -#define __ASM_MIPS_SIGNAL_H +#ifndef _ASM_SIGNAL_H +#define _ASM_SIGNAL_H #include <linux/types.h> @@ -74,16 +75,19 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single * Unix names RESETHAND and NODEFER respectively. */ -#define SA_STACK 0x00000001 -#define SA_RESETHAND 0x00000002 -#define SA_RESTART 0x00000004 +#define SA_ONSTACK 0x08000000 +#define SA_RESETHAND 0x80000000 +#define SA_RESTART 0x10000000 #define SA_SIGINFO 0x00000008 -#define SA_NODEFER 0x00000010 +#define SA_NODEFER 0x40000000 #define SA_NOCLDWAIT 0x00010000 /* Not supported yet */ -#define SA_NOCLDSTOP 0x00020000 +#define SA_NOCLDSTOP 0x00000001 #define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND +#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ + +#define SA_RESTORER 0x04000000 /* * sigaltstack controls @@ -95,18 +99,18 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ #define SIGSTKSZ 8192 #ifdef __KERNEL__ + /* * These values of sa_flags are used only by the kernel as part of the * irq handling routines. * - * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the - * SA_RESTART flag to get restarting signals (which were the default long ago) + * SA_INTERRUPT is also used by the irq handling routines. * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. */ -#define SA_INTERRUPT 0x01000000 /* interrupt handling */ -#define SA_SHIRQ 0x08000000 #define SA_PROBE SA_ONESHOT #define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x02000000 + #endif /* __KERNEL__ */ #define SIG_BLOCK 1 /* for blocking signals */ @@ -127,13 +131,12 @@ struct sigaction { unsigned int sa_flags; __sighandler_t sa_handler; sigset_t sa_mask; - int sa_resv[2]; /* reserved */ + void (*sa_restorer)(void); + int sa_resv[1]; /* reserved */ }; -/* XXX use sa_rev for storing ka_restorer */ struct k_sigaction { struct sigaction sa; - void (*ka_restorer)(void); }; /* IRIX compatible stack_t */ @@ -145,9 +148,7 @@ typedef struct sigaltstack { #ifdef __KERNEL__ #include <asm/sigcontext.h> -#endif -#if defined (__KERNEL__) || defined (__USE_MISC) /* * The following break codes are or were in use for specific purposes in * other MIPS operating systems. Linux/MIPS doesn't use all of them. The @@ -167,6 +168,7 @@ typedef struct sigaltstack { #define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */ #define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ #define BRK_MULOVF 1023 /* Multiply overflow */ -#endif /* defined (__KERNEL__) || defined (__USE_MISC) */ -#endif /* !defined (__ASM_MIPS_SIGNAL_H) */ +#endif /* defined (__KERNEL__) */ + +#endif /* _ASM_SIGNAL_H */ diff --git a/include/asm-mips/ucontext.h b/include/asm-mips/ucontext.h index 56a5805fb..db501bef0 100644 --- a/include/asm-mips/ucontext.h +++ b/include/asm-mips/ucontext.h @@ -1,5 +1,15 @@ -#ifndef __ASM_MIPS_UCONTEXT_H -#define __ASM_MIPS_UCONTEXT_H +/* $Id: ucontext.h,v 1.2 1999/09/27 16:01:40 ralf Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Low level exception handling + * + * Copyright (C) 1998, 1999 by Ralf Baechle + */ +#ifndef _ASM_UCONTEXT_H +#define _ASM_UCONTEXT_H struct ucontext { unsigned long uc_flags; @@ -9,4 +19,4 @@ struct ucontext { sigset_t uc_sigmask; /* mask last for extensibility */ }; -#endif /* __ASM_MIPS_UCONTEXT_H */ +#endif /* _ASM_UCONTEXT_H */ diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index cd179fe50..e003fa7b4 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.13 1999/01/04 16:09:27 ralf Exp $ +/* $Id: unistd.h,v 1.14 1999/04/01 23:24:00 ulfc Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -1015,7 +1015,7 @@ #define __NR_ptrace (__NR_Linux + 26) #define __NR_alarm (__NR_Linux + 27) #define __NR_oldfstat (__NR_Linux + 28) -#define __NR_pause (__NR_Linux + 29) +#define __NR_unused29 (__NR_Linux + 29) #define __NR_utime (__NR_Linux + 30) #define __NR_stty (__NR_Linux + 31) #define __NR_gtty (__NR_Linux + 32) @@ -1420,7 +1420,6 @@ return -1; \ */ #define __NR__exit __NR_exit static inline _syscall0(int,idle) -static inline _syscall0(int,pause) static inline _syscall0(int,sync) static inline _syscall0(pid_t,setsid) static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) diff --git a/include/asm-mips64/current.h b/include/asm-mips64/current.h index 75d282059..0293e6ad8 100644 --- a/include/asm-mips64/current.h +++ b/include/asm-mips64/current.h @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: current.h,v 1.1 1999/08/18 21:46:54 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/include/asm-mips64/errno.h b/include/asm-mips64/errno.h index c4f47ee4a..b2f507f4f 100644 --- a/include/asm-mips64/errno.h +++ b/include/asm-mips64/errno.h @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: errno.h,v 1.1 1999/08/18 23:37:51 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -143,19 +143,13 @@ #define ENOMEDIUM 159 /* No medium found */ #define EMEDIUMTYPE 160 /* Wrong medium type */ -/* - * IRIX 5 error number start from 1000. - * Stupid enough; ECANCELED gets redefined with a different value ... -#define ECANCELED 1000 - */ +#define EDQUOT 1133 /* Quota exceeded */ -/* - * IRIX 4 compatibility error numbers. - */ -#define EDQUOT 1133 /* Quota exceeded */ -#define ENFSREMOTE 1134 /* ??? */ +#ifdef __KERNEL__ /* The biggest error number defined here or in <linux/errno.h>. */ -#define EMAXERRNO 1134 +#define EMAXERRNO 1133 + +#endif /* __KERNEL__ */ #endif /* _ASM_ERRNO_H */ diff --git a/include/asm-mips64/offset.h b/include/asm-mips64/offset.h index 488206f1d..e37b353aa 100644 --- a/include/asm-mips64/offset.h +++ b/include/asm-mips64/offset.h @@ -84,19 +84,16 @@ #define MM_CONTEXT 88 /* Linux sigcontext offsets. */ -#define SC_REGMASK 0 -#define SC_STATUS 4 -#define SC_PC 8 -#define SC_REGS 16 -#define SC_FPREGS 272 -#define SC_OWNEDFP 528 -#define SC_FPC_CSR 532 -#define SC_FPC_EIR 536 -#define SC_SSFLAGS 540 -#define SC_MDHI 544 -#define SC_MDLO 552 -#define SC_CAUSE 560 -#define SC_BADVADDR 564 -#define SC_SIGSET 568 +#define SC_REGS 0 +#define SC_FPREGS 256 +#define SC_MDHI 512 +#define SC_MDLO 520 +#define SC_PC 528 +#define SC_STATUS 536 +#define SC_OWNEDFP 540 +#define SC_FPC_CSR 544 +#define SC_FPC_EIR 548 +#define SC_CAUSE 552 +#define SC_BADVADDR 556 #endif /* !(_MIPS_OFFSET_H) */ diff --git a/include/asm-mips64/processor.h b/include/asm-mips64/processor.h index 989f37de6..d4251affc 100644 --- a/include/asm-mips64/processor.h +++ b/include/asm-mips64/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.1 1999/08/18 23:37:51 ralf Exp $ +/* $Id: processor.h,v 1.3 1999/09/27 20:56:47 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -209,7 +209,13 @@ extern int (*user_mode)(struct pt_regs *); /* * Do necessary setup to start up a newly executed thread. */ -extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp); +#define start_thread(regs, new_pc, new_sp) do { \ + /* New thread looses kernel privileges. */ \ + regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KSU_USER;\ + regs->cp0_epc = new_pc; \ + regs->regs[29] = new_sp; \ + current->tss.current_ds = USER_DS; \ +} while (0) /* Allocation and freeing of basic task resources. */ /* diff --git a/include/asm-mips64/ptrace.h b/include/asm-mips64/ptrace.h index 22d3f909e..23c76b6b3 100644 --- a/include/asm-mips64/ptrace.h +++ b/include/asm-mips64/ptrace.h @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: ptrace.h,v 1.1 1999/08/18 21:46:55 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/include/asm-mips64/sigcontext.h b/include/asm-mips64/sigcontext.h index 23cdb5cd6..215d56124 100644 --- a/include/asm-mips64/sigcontext.h +++ b/include/asm-mips64/sigcontext.h @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: sigcontext.h,v 1.2 1999/09/27 16:01:40 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -15,22 +15,18 @@ * in arch/mips/tools/offset.c */ struct sigcontext { - unsigned int sc_regmask; /* Unused */ - unsigned int sc_status; - unsigned long long sc_pc; unsigned long long sc_regs[32]; - unsigned long long sc_fpregs[32]; /* Unused */ - unsigned int sc_ownedfp; - unsigned int sc_fpc_csr; /* Unused */ - unsigned int sc_fpc_eir; /* Unused */ - unsigned int sc_ssflags; /* Unused */ + unsigned long long sc_fpregs[32]; unsigned long long sc_mdhi; unsigned long long sc_mdlo; + unsigned long long sc_pc; + unsigned int sc_status; + unsigned int sc_ownedfp; + unsigned int sc_fpc_csr; + unsigned int sc_fpc_eir; - unsigned int sc_cause; /* Unused */ - unsigned int sc_badvaddr; /* Unused */ - - unsigned int sc_sigset[4]; /* kernel's sigset_t */ + unsigned int sc_cause; + unsigned int sc_badvaddr; }; #endif /* _ASM_SIGCONTEXT_H */ diff --git a/include/asm-mips64/signal.h b/include/asm-mips64/signal.h index 1f9291794..a5fa8ce6b 100644 --- a/include/asm-mips64/signal.h +++ b/include/asm-mips64/signal.h @@ -1,10 +1,11 @@ -/* $Id$ +/* $Id: signal.h,v 1.2 1999/09/27 16:01:40 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1995 - 1999 by Ralf Baechle + * Copyright (C) 1999 Silicon Graphics, Inc. */ #ifndef _ASM_SIGNAL_H #define _ASM_SIGNAL_H @@ -12,11 +13,11 @@ #include <linux/types.h> #define _NSIG 128 -#define _NSIG_BPW 32 +#define _NSIG_BPW 64 #define _NSIG_WORDS (_NSIG / _NSIG_BPW) typedef struct { - __u32 sig[_NSIG_WORDS]; + long sig[_NSIG_WORDS]; } sigset_t; typedef unsigned long old_sigset_t; /* at least 32 bits */ @@ -74,16 +75,19 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single * Unix names RESETHAND and NODEFER respectively. */ -#define SA_STACK 0x00000001 -#define SA_RESETHAND 0x00000002 -#define SA_RESTART 0x00000004 +#define SA_ONSTACK 0x08000000 +#define SA_RESETHAND 0x80000000 +#define SA_RESTART 0x10000000 #define SA_SIGINFO 0x00000008 -#define SA_NODEFER 0x00000010 +#define SA_NODEFER 0x40000000 #define SA_NOCLDWAIT 0x00010000 /* Not supported yet */ -#define SA_NOCLDSTOP 0x00020000 +#define SA_NOCLDSTOP 0x00000001 #define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND +#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ + +#define SA_RESTORER 0x04000000 /* * sigaltstack controls @@ -95,18 +99,18 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ #define SIGSTKSZ 8192 #ifdef __KERNEL__ + /* * These values of sa_flags are used only by the kernel as part of the * irq handling routines. * - * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the - * SA_RESTART flag to get restarting signals (which were the default long ago) + * SA_INTERRUPT is also used by the irq handling routines. * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. */ -#define SA_INTERRUPT 0x01000000 /* interrupt handling */ -#define SA_SHIRQ 0x08000000 #define SA_PROBE SA_ONESHOT #define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x02000000 + #endif /* __KERNEL__ */ #define SIG_BLOCK 1 /* for blocking signals */ @@ -127,13 +131,12 @@ struct sigaction { unsigned int sa_flags; __sighandler_t sa_handler; sigset_t sa_mask; - int sa_resv[2]; /* reserved */ + void (*sa_restorer)(void); + int sa_resv[1]; /* reserved */ }; -/* XXX use sa_rev for storing ka_restorer */ struct k_sigaction { struct sigaction sa; - void (*ka_restorer)(void); }; /* IRIX compatible stack_t */ @@ -145,9 +148,7 @@ typedef struct sigaltstack { #ifdef __KERNEL__ #include <asm/sigcontext.h> -#endif -#if defined (__KERNEL__) || defined (__USE_MISC) /* * The following break codes are or were in use for specific purposes in * other MIPS operating systems. Linux/MIPS doesn't use all of them. The diff --git a/include/asm-mips64/ucontext.h b/include/asm-mips64/ucontext.h new file mode 100644 index 000000000..3667acde1 --- /dev/null +++ b/include/asm-mips64/ucontext.h @@ -0,0 +1,22 @@ +/* $Id: ucontext.h,v 1.1 1999/09/27 16:01:40 ralf Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Low level exception handling + * + * Copyright (C) 1998, 1999 by Ralf Baechle + */ +#ifndef _ASM_UCONTEXT_H +#define _ASM_UCONTEXT_H + +struct ucontext { + unsigned long uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + struct sigcontext uc_mcontext; + sigset_t uc_sigmask; /* mask last for extensibility */ +}; + +#endif /* _ASM_UCONTEXT_H */ diff --git a/include/asm-mips64/unistd.h b/include/asm-mips64/unistd.h index 7e906b1ba..0441ffc51 100644 --- a/include/asm-mips64/unistd.h +++ b/include/asm-mips64/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.1 1999/08/18 23:37:53 ralf Exp $ +/* $Id: unistd.h,v 1.3 1999/09/27 16:01:41 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -1016,7 +1016,7 @@ #define __NR_ptrace (__NR_Linux + 26) #define __NR_alarm (__NR_Linux + 27) #define __NR_oldfstat (__NR_Linux + 28) -#define __NR_pause (__NR_Linux + 29) +#define __NR_unused29 (__NR_Linux + 29) #define __NR_utime (__NR_Linux + 30) #define __NR_stty (__NR_Linux + 31) #define __NR_gtty (__NR_Linux + 32) @@ -1515,7 +1515,6 @@ return -1; \ */ #define __NR__exit __NR_exit static inline _syscall0(int,idle) -static inline _syscall0(int,pause) static inline _syscall0(int,sync) static inline _syscall0(pid_t,setsid) static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) diff --git a/include/asm-mips64/watch.h b/include/asm-mips64/watch.h new file mode 100644 index 000000000..b9c744ce8 --- /dev/null +++ b/include/asm-mips64/watch.h @@ -0,0 +1,38 @@ +/* $Id: watch.h,v 1.1 1999/09/27 16:01:41 ralf Exp $ + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1996, 1997, 1998, 1999 by Ralf Baechle + */ +#ifndef _ASM_WATCH_H +#define _ASM_WATCH_H + +#include <linux/linkage.h> + +/* + * Types of reference for watch_set() + */ +enum wref_type { + wr_save = 1, + wr_load = 2 +}; + +extern char watch_available; + +extern asmlinkage void __watch_set(unsigned long addr, enum wref_type ref); +extern asmlinkage void __watch_clear(void); +extern asmlinkage void __watch_reenable(void); + +#define watch_set(addr, ref) \ + if (watch_available) \ + __watch_set(addr, ref) +#define watch_clear() \ + if (watch_available) \ + __watch_clear() +#define watch_reenable() \ + if (watch_available) \ + __watch_reenable() + +#endif _ASM_WATCH_H diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h index f8ffd64a2..dc35d5481 100644 --- a/include/asm-sparc/asm_offsets.h +++ b/include/asm-sparc/asm_offsets.h @@ -196,45 +196,47 @@ #define ASIZ_mm_map_count 0x00000004 #define AOFF_mm_mmap_sem 0x00000018 #define ASIZ_mm_mmap_sem 0x00000020 -#define AOFF_mm_context 0x00000038 +#define AOFF_mm_page_table_lock 0x00000038 +#define ASIZ_mm_page_table_lock 0x00000001 +#define AOFF_mm_context 0x0000003c #define ASIZ_mm_context 0x00000004 -#define AOFF_mm_start_code 0x0000003c +#define AOFF_mm_start_code 0x00000040 #define ASIZ_mm_start_code 0x00000004 -#define AOFF_mm_end_code 0x00000040 +#define AOFF_mm_end_code 0x00000044 #define ASIZ_mm_end_code 0x00000004 -#define AOFF_mm_start_data 0x00000044 +#define AOFF_mm_start_data 0x00000048 #define ASIZ_mm_start_data 0x00000004 -#define AOFF_mm_end_data 0x00000048 +#define AOFF_mm_end_data 0x0000004c #define ASIZ_mm_end_data 0x00000004 -#define AOFF_mm_start_brk 0x0000004c +#define AOFF_mm_start_brk 0x00000050 #define ASIZ_mm_start_brk 0x00000004 -#define AOFF_mm_brk 0x00000050 +#define AOFF_mm_brk 0x00000054 #define ASIZ_mm_brk 0x00000004 -#define AOFF_mm_start_stack 0x00000054 +#define AOFF_mm_start_stack 0x00000058 #define ASIZ_mm_start_stack 0x00000004 -#define AOFF_mm_arg_start 0x00000058 +#define AOFF_mm_arg_start 0x0000005c #define ASIZ_mm_arg_start 0x00000004 -#define AOFF_mm_arg_end 0x0000005c +#define AOFF_mm_arg_end 0x00000060 #define ASIZ_mm_arg_end 0x00000004 -#define AOFF_mm_env_start 0x00000060 +#define AOFF_mm_env_start 0x00000064 #define ASIZ_mm_env_start 0x00000004 -#define AOFF_mm_env_end 0x00000064 +#define AOFF_mm_env_end 0x00000068 #define ASIZ_mm_env_end 0x00000004 -#define AOFF_mm_rss 0x00000068 +#define AOFF_mm_rss 0x0000006c #define ASIZ_mm_rss 0x00000004 -#define AOFF_mm_total_vm 0x0000006c +#define AOFF_mm_total_vm 0x00000070 #define ASIZ_mm_total_vm 0x00000004 -#define AOFF_mm_locked_vm 0x00000070 +#define AOFF_mm_locked_vm 0x00000074 #define ASIZ_mm_locked_vm 0x00000004 -#define AOFF_mm_def_flags 0x00000074 +#define AOFF_mm_def_flags 0x00000078 #define ASIZ_mm_def_flags 0x00000004 -#define AOFF_mm_cpu_vm_mask 0x00000078 +#define AOFF_mm_cpu_vm_mask 0x0000007c #define ASIZ_mm_cpu_vm_mask 0x00000004 -#define AOFF_mm_swap_cnt 0x0000007c +#define AOFF_mm_swap_cnt 0x00000080 #define ASIZ_mm_swap_cnt 0x00000004 -#define AOFF_mm_swap_address 0x00000080 +#define AOFF_mm_swap_address 0x00000084 #define ASIZ_mm_swap_address 0x00000004 -#define AOFF_mm_segments 0x00000084 +#define AOFF_mm_segments 0x00000088 #define ASIZ_mm_segments 0x00000004 #define AOFF_thread_uwinmask 0x00000000 #define ASIZ_thread_uwinmask 0x00000004 @@ -471,45 +473,47 @@ #define ASIZ_mm_map_count 0x00000004 #define AOFF_mm_mmap_sem 0x00000018 #define ASIZ_mm_mmap_sem 0x00000024 -#define AOFF_mm_context 0x0000003c +#define AOFF_mm_page_table_lock 0x0000003c +#define ASIZ_mm_page_table_lock 0x00000008 +#define AOFF_mm_context 0x00000044 #define ASIZ_mm_context 0x00000004 -#define AOFF_mm_start_code 0x00000040 +#define AOFF_mm_start_code 0x00000048 #define ASIZ_mm_start_code 0x00000004 -#define AOFF_mm_end_code 0x00000044 +#define AOFF_mm_end_code 0x0000004c #define ASIZ_mm_end_code 0x00000004 -#define AOFF_mm_start_data 0x00000048 +#define AOFF_mm_start_data 0x00000050 #define ASIZ_mm_start_data 0x00000004 -#define AOFF_mm_end_data 0x0000004c +#define AOFF_mm_end_data 0x00000054 #define ASIZ_mm_end_data 0x00000004 -#define AOFF_mm_start_brk 0x00000050 +#define AOFF_mm_start_brk 0x00000058 #define ASIZ_mm_start_brk 0x00000004 -#define AOFF_mm_brk 0x00000054 +#define AOFF_mm_brk 0x0000005c #define ASIZ_mm_brk 0x00000004 -#define AOFF_mm_start_stack 0x00000058 +#define AOFF_mm_start_stack 0x00000060 #define ASIZ_mm_start_stack 0x00000004 -#define AOFF_mm_arg_start 0x0000005c +#define AOFF_mm_arg_start 0x00000064 #define ASIZ_mm_arg_start 0x00000004 -#define AOFF_mm_arg_end 0x00000060 +#define AOFF_mm_arg_end 0x00000068 #define ASIZ_mm_arg_end 0x00000004 -#define AOFF_mm_env_start 0x00000064 +#define AOFF_mm_env_start 0x0000006c #define ASIZ_mm_env_start 0x00000004 -#define AOFF_mm_env_end 0x00000068 +#define AOFF_mm_env_end 0x00000070 #define ASIZ_mm_env_end 0x00000004 -#define AOFF_mm_rss 0x0000006c +#define AOFF_mm_rss 0x00000074 #define ASIZ_mm_rss 0x00000004 -#define AOFF_mm_total_vm 0x00000070 +#define AOFF_mm_total_vm 0x00000078 #define ASIZ_mm_total_vm 0x00000004 -#define AOFF_mm_locked_vm 0x00000074 +#define AOFF_mm_locked_vm 0x0000007c #define ASIZ_mm_locked_vm 0x00000004 -#define AOFF_mm_def_flags 0x00000078 +#define AOFF_mm_def_flags 0x00000080 #define ASIZ_mm_def_flags 0x00000004 -#define AOFF_mm_cpu_vm_mask 0x0000007c +#define AOFF_mm_cpu_vm_mask 0x00000084 #define ASIZ_mm_cpu_vm_mask 0x00000004 -#define AOFF_mm_swap_cnt 0x00000080 +#define AOFF_mm_swap_cnt 0x00000088 #define ASIZ_mm_swap_cnt 0x00000004 -#define AOFF_mm_swap_address 0x00000084 +#define AOFF_mm_swap_address 0x0000008c #define ASIZ_mm_swap_address 0x00000004 -#define AOFF_mm_segments 0x00000088 +#define AOFF_mm_segments 0x00000090 #define ASIZ_mm_segments 0x00000004 #define AOFF_thread_uwinmask 0x00000000 #define ASIZ_thread_uwinmask 0x00000004 diff --git a/include/asm-sparc/audioio.h b/include/asm-sparc/audioio.h index 27543806b..01bebaf73 100644 --- a/include/asm-sparc/audioio.h +++ b/include/asm-sparc/audioio.h @@ -237,7 +237,6 @@ typedef struct audio_device { #ifdef __KERNEL__ -#include <linux/types.h> #include <linux/fs.h> #include <linux/tqueue.h> #include <linux/wait.h> diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h index b014e1739..7ea969e04 100644 --- a/include/asm-sparc/page.h +++ b/include/asm-sparc/page.h @@ -19,7 +19,6 @@ #ifdef __KERNEL__ -#include <linux/config.h> #include <asm/head.h> /* for KERNBASE */ #include <asm/btfixup.h> diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h index 6f5cb96d9..b1f87cc58 100644 --- a/include/asm-sparc64/asm_offsets.h +++ b/include/asm-sparc64/asm_offsets.h @@ -197,47 +197,49 @@ #define ASIZ_mm_map_count 0x00000004 #define AOFF_mm_mmap_sem 0x00000028 #define ASIZ_mm_mmap_sem 0x00000038 -#define AOFF_mm_context 0x00000060 +#define AOFF_mm_page_table_lock 0x00000060 +#define ASIZ_mm_page_table_lock 0x00000001 +#define AOFF_mm_context 0x00000068 #define ASIZ_mm_context 0x00000008 -#define AOFF_mm_start_code 0x00000068 +#define AOFF_mm_start_code 0x00000070 #define ASIZ_mm_start_code 0x00000008 -#define AOFF_mm_end_code 0x00000070 +#define AOFF_mm_end_code 0x00000078 #define ASIZ_mm_end_code 0x00000008 -#define AOFF_mm_start_data 0x00000078 +#define AOFF_mm_start_data 0x00000080 #define ASIZ_mm_start_data 0x00000008 -#define AOFF_mm_end_data 0x00000080 +#define AOFF_mm_end_data 0x00000088 #define ASIZ_mm_end_data 0x00000008 -#define AOFF_mm_start_brk 0x00000088 +#define AOFF_mm_start_brk 0x00000090 #define ASIZ_mm_start_brk 0x00000008 -#define AOFF_mm_brk 0x00000090 +#define AOFF_mm_brk 0x00000098 #define ASIZ_mm_brk 0x00000008 -#define AOFF_mm_start_stack 0x00000098 +#define AOFF_mm_start_stack 0x000000a0 #define ASIZ_mm_start_stack 0x00000008 -#define AOFF_mm_arg_start 0x000000a0 +#define AOFF_mm_arg_start 0x000000a8 #define ASIZ_mm_arg_start 0x00000008 -#define AOFF_mm_arg_end 0x000000a8 +#define AOFF_mm_arg_end 0x000000b0 #define ASIZ_mm_arg_end 0x00000008 -#define AOFF_mm_env_start 0x000000b0 +#define AOFF_mm_env_start 0x000000b8 #define ASIZ_mm_env_start 0x00000008 -#define AOFF_mm_env_end 0x000000b8 +#define AOFF_mm_env_end 0x000000c0 #define ASIZ_mm_env_end 0x00000008 -#define AOFF_mm_rss 0x000000c0 +#define AOFF_mm_rss 0x000000c8 #define ASIZ_mm_rss 0x00000008 -#define AOFF_mm_total_vm 0x000000c8 +#define AOFF_mm_total_vm 0x000000d0 #define ASIZ_mm_total_vm 0x00000008 -#define AOFF_mm_locked_vm 0x000000d0 +#define AOFF_mm_locked_vm 0x000000d8 #define ASIZ_mm_locked_vm 0x00000008 -#define AOFF_mm_def_flags 0x000000d8 +#define AOFF_mm_def_flags 0x000000e0 #define ASIZ_mm_def_flags 0x00000008 -#define AOFF_mm_cpu_vm_mask 0x000000e0 +#define AOFF_mm_cpu_vm_mask 0x000000e8 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_mm_swap_cnt 0x000000e8 +#define AOFF_mm_swap_cnt 0x000000f0 #define ASIZ_mm_swap_cnt 0x00000008 -#define AOFF_mm_swap_address 0x000000f0 +#define AOFF_mm_swap_address 0x000000f8 #define ASIZ_mm_swap_address 0x00000008 -#define AOFF_mm_segments 0x000000f8 +#define AOFF_mm_segments 0x00000100 #define ASIZ_mm_segments 0x00000008 -#define ASIZ_mm 0x00000100 +#define ASIZ_mm 0x00000108 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 #define AOFF_thread_wstate 0x00000008 @@ -481,47 +483,49 @@ #define ASIZ_mm_map_count 0x00000004 #define AOFF_mm_mmap_sem 0x00000028 #define ASIZ_mm_mmap_sem 0x00000038 -#define AOFF_mm_context 0x00000060 +#define AOFF_mm_page_table_lock 0x00000060 +#define ASIZ_mm_page_table_lock 0x00000001 +#define AOFF_mm_context 0x00000068 #define ASIZ_mm_context 0x00000008 -#define AOFF_mm_start_code 0x00000068 +#define AOFF_mm_start_code 0x00000070 #define ASIZ_mm_start_code 0x00000008 -#define AOFF_mm_end_code 0x00000070 +#define AOFF_mm_end_code 0x00000078 #define ASIZ_mm_end_code 0x00000008 -#define AOFF_mm_start_data 0x00000078 +#define AOFF_mm_start_data 0x00000080 #define ASIZ_mm_start_data 0x00000008 -#define AOFF_mm_end_data 0x00000080 +#define AOFF_mm_end_data 0x00000088 #define ASIZ_mm_end_data 0x00000008 -#define AOFF_mm_start_brk 0x00000088 +#define AOFF_mm_start_brk 0x00000090 #define ASIZ_mm_start_brk 0x00000008 -#define AOFF_mm_brk 0x00000090 +#define AOFF_mm_brk 0x00000098 #define ASIZ_mm_brk 0x00000008 -#define AOFF_mm_start_stack 0x00000098 +#define AOFF_mm_start_stack 0x000000a0 #define ASIZ_mm_start_stack 0x00000008 -#define AOFF_mm_arg_start 0x000000a0 +#define AOFF_mm_arg_start 0x000000a8 #define ASIZ_mm_arg_start 0x00000008 -#define AOFF_mm_arg_end 0x000000a8 +#define AOFF_mm_arg_end 0x000000b0 #define ASIZ_mm_arg_end 0x00000008 -#define AOFF_mm_env_start 0x000000b0 +#define AOFF_mm_env_start 0x000000b8 #define ASIZ_mm_env_start 0x00000008 -#define AOFF_mm_env_end 0x000000b8 +#define AOFF_mm_env_end 0x000000c0 #define ASIZ_mm_env_end 0x00000008 -#define AOFF_mm_rss 0x000000c0 +#define AOFF_mm_rss 0x000000c8 #define ASIZ_mm_rss 0x00000008 -#define AOFF_mm_total_vm 0x000000c8 +#define AOFF_mm_total_vm 0x000000d0 #define ASIZ_mm_total_vm 0x00000008 -#define AOFF_mm_locked_vm 0x000000d0 +#define AOFF_mm_locked_vm 0x000000d8 #define ASIZ_mm_locked_vm 0x00000008 -#define AOFF_mm_def_flags 0x000000d8 +#define AOFF_mm_def_flags 0x000000e0 #define ASIZ_mm_def_flags 0x00000008 -#define AOFF_mm_cpu_vm_mask 0x000000e0 +#define AOFF_mm_cpu_vm_mask 0x000000e8 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_mm_swap_cnt 0x000000e8 +#define AOFF_mm_swap_cnt 0x000000f0 #define ASIZ_mm_swap_cnt 0x00000008 -#define AOFF_mm_swap_address 0x000000f0 +#define AOFF_mm_swap_address 0x000000f8 #define ASIZ_mm_swap_address 0x00000008 -#define AOFF_mm_segments 0x000000f8 +#define AOFF_mm_segments 0x00000100 #define ASIZ_mm_segments 0x00000008 -#define ASIZ_mm 0x00000100 +#define ASIZ_mm 0x00000108 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 #define AOFF_thread_wstate 0x00000008 @@ -763,47 +767,49 @@ #define ASIZ_mm_map_count 0x00000004 #define AOFF_mm_mmap_sem 0x00000028 #define ASIZ_mm_mmap_sem 0x00000040 -#define AOFF_mm_context 0x00000068 +#define AOFF_mm_page_table_lock 0x00000068 +#define ASIZ_mm_page_table_lock 0x0000000c +#define AOFF_mm_context 0x00000078 #define ASIZ_mm_context 0x00000008 -#define AOFF_mm_start_code 0x00000070 +#define AOFF_mm_start_code 0x00000080 #define ASIZ_mm_start_code 0x00000008 -#define AOFF_mm_end_code 0x00000078 +#define AOFF_mm_end_code 0x00000088 #define ASIZ_mm_end_code 0x00000008 -#define AOFF_mm_start_data 0x00000080 +#define AOFF_mm_start_data 0x00000090 #define ASIZ_mm_start_data 0x00000008 -#define AOFF_mm_end_data 0x00000088 +#define AOFF_mm_end_data 0x00000098 #define ASIZ_mm_end_data 0x00000008 -#define AOFF_mm_start_brk 0x00000090 +#define AOFF_mm_start_brk 0x000000a0 #define ASIZ_mm_start_brk 0x00000008 -#define AOFF_mm_brk 0x00000098 +#define AOFF_mm_brk 0x000000a8 #define ASIZ_mm_brk 0x00000008 -#define AOFF_mm_start_stack 0x000000a0 +#define AOFF_mm_start_stack 0x000000b0 #define ASIZ_mm_start_stack 0x00000008 -#define AOFF_mm_arg_start 0x000000a8 +#define AOFF_mm_arg_start 0x000000b8 #define ASIZ_mm_arg_start 0x00000008 -#define AOFF_mm_arg_end 0x000000b0 +#define AOFF_mm_arg_end 0x000000c0 #define ASIZ_mm_arg_end 0x00000008 -#define AOFF_mm_env_start 0x000000b8 +#define AOFF_mm_env_start 0x000000c8 #define ASIZ_mm_env_start 0x00000008 -#define AOFF_mm_env_end 0x000000c0 +#define AOFF_mm_env_end 0x000000d0 #define ASIZ_mm_env_end 0x00000008 -#define AOFF_mm_rss 0x000000c8 +#define AOFF_mm_rss 0x000000d8 #define ASIZ_mm_rss 0x00000008 -#define AOFF_mm_total_vm 0x000000d0 +#define AOFF_mm_total_vm 0x000000e0 #define ASIZ_mm_total_vm 0x00000008 -#define AOFF_mm_locked_vm 0x000000d8 +#define AOFF_mm_locked_vm 0x000000e8 #define ASIZ_mm_locked_vm 0x00000008 -#define AOFF_mm_def_flags 0x000000e0 +#define AOFF_mm_def_flags 0x000000f0 #define ASIZ_mm_def_flags 0x00000008 -#define AOFF_mm_cpu_vm_mask 0x000000e8 +#define AOFF_mm_cpu_vm_mask 0x000000f8 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_mm_swap_cnt 0x000000f0 +#define AOFF_mm_swap_cnt 0x00000100 #define ASIZ_mm_swap_cnt 0x00000008 -#define AOFF_mm_swap_address 0x000000f8 +#define AOFF_mm_swap_address 0x00000108 #define ASIZ_mm_swap_address 0x00000008 -#define AOFF_mm_segments 0x00000100 +#define AOFF_mm_segments 0x00000110 #define ASIZ_mm_segments 0x00000008 -#define ASIZ_mm 0x00000108 +#define ASIZ_mm 0x00000118 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 #define AOFF_thread_wstate 0x00000008 diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h index 33341d399..96ef1a585 100644 --- a/include/asm-sparc64/atomic.h +++ b/include/asm-sparc64/atomic.h @@ -1,4 +1,4 @@ -/* $Id: atomic.h,v 1.18 1997/08/07 03:38:31 davem Exp $ +/* $Id: atomic.h,v 1.19 1999/07/03 22:11:17 davem Exp $ * atomic.h: Thankfully the V9 is at least reasonable for this * stuff. * @@ -20,66 +20,34 @@ typedef struct { int counter; } atomic_t; #define atomic_read(v) ((v)->counter) #define atomic_set(v, i) (((v)->counter) = i) -extern __inline__ void atomic_add(int i, atomic_t *v) -{ - __asm__ __volatile__(" -1: lduw [%1], %%g5 - add %%g5, %0, %%g7 - cas [%1], %%g5, %%g7 - sub %%g5, %%g7, %%g5 - brnz,pn %%g5, 1b - nop" - : /* No outputs */ - : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "g5", "g7", "memory"); -} - -extern __inline__ void atomic_sub(int i, atomic_t *v) -{ - __asm__ __volatile__(" -1: lduw [%1], %%g5 - sub %%g5, %0, %%g7 - cas [%1], %%g5, %%g7 - sub %%g5, %%g7, %%g5 - brnz,pn %%g5, 1b - nop" - : /* No outputs */ - : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "g5", "g7", "memory"); -} - -/* Same as above, but return the result value. */ -extern __inline__ int atomic_add_return(int i, atomic_t *v) -{ - unsigned long oldval; - __asm__ __volatile__(" -1: lduw [%2], %%g5 - add %%g5, %1, %%g7 - cas [%2], %%g5, %%g7 - sub %%g5, %%g7, %%g5 - brnz,pn %%g5, 1b - add %%g7, %1, %0" - : "=&r" (oldval) - : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "g5", "g7", "memory"); - return (int)oldval; -} - -extern __inline__ int atomic_sub_return(int i, atomic_t *v) -{ - unsigned long oldval; - __asm__ __volatile__(" -1: lduw [%2], %%g5 - sub %%g5, %1, %%g7 - cas [%2], %%g5, %%g7 - sub %%g5, %%g7, %%g5 - brnz,pn %%g5, 1b - sub %%g7, %1, %0" - : "=&r" (oldval) - : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "g5", "g7", "memory"); - return (int)oldval; -} +#define atomic_add_return(__i, __v) \ +({ register atomic_t *__V asm("g1"); \ + register int __I asm("g2"); \ + __V = (__v); __I = (__i); \ + __asm__ __volatile__("sethi %%hi(__atomic_add), %%g3\n\t" \ + "jmpl %%g3 + %%lo(__atomic_add), %%g3\n\t" \ + " nop\n1:" \ + : "=&r" (__I) \ + : "0" (__I), "r" (__V) \ + : "g3", "g5", "g7", "cc", "memory"); \ + __I; \ +}) + +#define atomic_sub_return(__i, __v) \ +({ register atomic_t *__V asm("g1"); \ + register int __I asm("g2"); \ + __V = (__v); __I = (__i); \ + __asm__ __volatile__("sethi %%hi(__atomic_sub), %%g3\n\t" \ + "jmpl %%g3 + %%lo(__atomic_sub), %%g3\n\t" \ + " nop\n1:" \ + : "=&r" (__I) \ + : "0" (__I), "r" (__V) \ + : "g3", "g5", "g7", "cc", "memory"); \ + __I; \ +}) + +#define atomic_add(i, v) atomic_add_return(i, v) +#define atomic_sub(i, v) atomic_sub_return(i, v) #define atomic_dec_return(v) atomic_sub_return(1,(v)) #define atomic_inc_return(v) atomic_add_return(1,(v)) diff --git a/include/asm-sparc64/audioio.h b/include/asm-sparc64/audioio.h index 27543806b..01bebaf73 100644 --- a/include/asm-sparc64/audioio.h +++ b/include/asm-sparc64/audioio.h @@ -237,7 +237,6 @@ typedef struct audio_device { #ifdef __KERNEL__ -#include <linux/types.h> #include <linux/fs.h> #include <linux/tqueue.h> #include <linux/wait.h> diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index b3311df9d..e8d68eca3 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -42,7 +42,7 @@ do { barrier(); \ * irq-safe write-lock, but readers can get non-irqsafe * read-locks. */ -typedef unsigned long rwlock_t; +typedef unsigned int rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } #define read_lock(lock) do { } while(0) @@ -255,90 +255,44 @@ extern int _spin_trylock (spinlock_t *lock); #ifndef SPIN_LOCK_DEBUG -typedef unsigned long rwlock_t; +typedef unsigned int rwlock_t; #define RW_LOCK_UNLOCKED 0 -extern __inline__ void read_lock(rwlock_t *rw) -{ - __asm__ __volatile__(" -1: ldx [%0], %%g5 - brlz,pn %%g5, 2f -4: add %%g5, 1, %%g7 - casx [%0], %%g5, %%g7 - cmp %%g5, %%g7 - bne,pn %%xcc, 1b - membar #StoreLoad | #StoreStore - .subsection 2 -2: ldx [%0], %%g5 - brlz,pt %%g5, 2b - membar #LoadLoad - b,a,pt %%xcc, 4b - .previous -" : /* no outputs */ - : "r" (rw) - : "g5", "g7", "cc", "memory"); -} +#define read_lock(__rw_lck) \ +do { register rwlock_t *__X asm("g1"); \ + __asm__ __volatile__("sethi %%hi(__read_lock), %%g3\n\t" \ + "jmpl %%g3 + %%lo(__read_lock), %%g3\n\t" \ + " nop\n1:" \ + : : "r" (__X = (__rw_lck)) \ + : "g3", "g5", "g7", "cc", "memory"); \ +} while(0) -extern __inline__ void read_unlock(rwlock_t *rw) -{ - __asm__ __volatile__(" -1: ldx [%0], %%g5 - sub %%g5, 1, %%g7 - casx [%0], %%g5, %%g7 - cmp %%g5, %%g7 - bne,pn %%xcc, 1b - membar #StoreLoad | #StoreStore -" : /* no outputs */ - : "r" (rw) - : "g5", "g7", "cc", "memory"); -} +#define read_unlock(__rw_lck) \ +do { register rwlock_t *__X asm("g1"); \ + __asm__ __volatile__("sethi %%hi(__read_unlock), %%g3\n\t" \ + "jmpl %%g3 + %%lo(__read_unlock), %%g3\n\t" \ + " nop\n1:" \ + : : "r" (__X = (__rw_lck)) \ + : "g3", "g5", "g7", "cc", "memory"); \ +} while(0) -extern __inline__ void write_lock(rwlock_t *rw) -{ - __asm__ __volatile__(" - sethi %%uhi(0x8000000000000000), %%g3 - sllx %%g3, 32, %%g3 -1: ldx [%0], %%g5 - brlz,pn %%g5, 5f -4: or %%g5, %%g3, %%g7 - casx [%0], %%g5, %%g7 - cmp %%g5, %%g7 - bne,pn %%xcc, 1b - andncc %%g7, %%g3, %%g0 - bne,pn %%xcc, 7f - membar #StoreLoad | #StoreStore - .subsection 2 -7: ldx [%0], %%g5 - andn %%g5, %%g3, %%g7 - casx [%0], %%g5, %%g7 - cmp %%g5, %%g7 - bne,pn %%xcc, 7b - membar #StoreLoad | #StoreStore -5: ldx [%0], %%g5 - brnz,pt %%g5, 5b - membar #LoadLoad - b,a,pt %%xcc, 4b - .previous -" : /* no outputs */ - : "r" (rw) - : "g3", "g5", "g7", "memory", "cc"); -} +#define write_lock(__rw_lck) \ +do { register rwlock_t *__X asm("g1"); \ + __asm__ __volatile__("sethi %%hi(__write_lock), %%g3\n\t" \ + "jmpl %%g3 + %%lo(__write_lock), %%g3\n\t" \ + " nop\n1:" \ + : : "r" (__X = (__rw_lck)) \ + : "g2", "g3", "g5", "g7", "cc", "memory"); \ +} while(0) -extern __inline__ void write_unlock(rwlock_t *rw) -{ - __asm__ __volatile__(" - sethi %%uhi(0x8000000000000000), %%g3 - sllx %%g3, 32, %%g3 -1: ldx [%0], %%g5 - andn %%g5, %%g3, %%g7 - casx [%0], %%g5, %%g7 - cmp %%g5, %%g7 - bne,pn %%xcc, 1b - membar #StoreLoad | #StoreStore -" : /* no outputs */ - : "r" (rw) - : "g3", "g5", "g7", "memory", "cc"); -} +#define write_unlock(__rw_lck) \ +do { register rwlock_t *__X asm("g1"); \ + __asm__ __volatile__("sethi %%hi(__write_unlock), %%g3\n\t" \ + "jmpl %%g3 + %%lo(__write_unlock), %%g3\n\t" \ + " nop\n1:" \ + : : "r" (__X = (__rw_lck)) \ + : "g2", "g3", "g5", "g7", "cc", "memory"); \ +} while(0) #define read_lock_irq(lock) do { __cli(); read_lock(lock); } while (0) #define read_unlock_irq(lock) do { read_unlock(lock); __sti(); } while (0) diff --git a/include/linux/blk.h b/include/linux/blk.h index dcb407c61..fa4272075 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -359,6 +359,24 @@ static void floppy_off(unsigned int nr); #define DEVICE_ON(device) #define DEVICE_OFF(device) +#elif (MAJOR_NR == I2O_MAJOR) + +#define DEVICE_NAME "I2O block" +#define DEVICE_REQUEST do_i2ob_request +#define DEVICE_NR(device) (MINOR(device)>>4) +#define DEVICE_ON(device) +#define DEVICE_OFF(device) + +#elif (MAJOR_NR == COMPAQ_SMART2_MAJOR) + +#define DEVICE_NAME "ida" +#define DEVICE_INTR do_ida +#define TIMEOUT_VALUE (25*HZ) +#define DEVICE_REQUEST do_ida_request0 +#define DEVICE_NR(device) (MINOR(device) >> 4) +#define DEVICE_ON(device) +#define DEVICE_OFF(device) + #endif /* MAJOR_NR == whatever */ #if (MAJOR_NR != SCSI_TAPE_MAJOR) @@ -435,7 +453,7 @@ void end_that_request_last(struct request *req); #ifndef LOCAL_END_REQUEST /* If we have our own end_request, we do not want to include this mess */ -#if ! SCSI_BLK_MAJOR(MAJOR_NR) +#if ! SCSI_BLK_MAJOR(MAJOR_NR) && (MAJOR_NR != COMPAQ_SMART2_MAJOR) static void end_request(int uptodate) { struct request *req = CURRENT; diff --git a/include/linux/coda.h b/include/linux/coda.h index ac3301c8a..8cb3ff46b 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -100,22 +100,35 @@ typedef unsigned long long u_quad_t; #if defined(__linux__) #define cdev_t u_quad_t +#ifndef __KERNEL__ #if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2) #define _UQUAD_T_ 1 typedef unsigned long long u_quad_t; #endif +#else /*__KERNEL__ */ +typedef unsigned long long u_quad_t; +#endif /* __KERNEL__ */ #else #define cdev_t dev_t #endif #ifdef __CYGWIN32__ -typedef unsigned char u_int8_t; struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; #endif +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ +typedef signed char int8_t; +typedef unsigned char u_int8_t; +typedef short int16_t; +typedef unsigned short u_int16_t; +typedef int int32_t; +typedef unsigned int u_int32_t; +#endif + /* * Cfs constants @@ -151,8 +164,8 @@ struct timespec { struct venus_dirent { unsigned long d_fileno; /* file number of entry */ unsigned short d_reclen; /* length of this record */ - char d_type; /* file type, see below */ - char d_namlen; /* length of string in d_name */ + unsigned char d_type; /* file type, see below */ + unsigned char d_namlen; /* length of string in d_name */ char d_name[CODA_MAXNAMLEN + 1];/* name must be no longer than this */ }; #undef DIRSIZ @@ -215,11 +228,6 @@ static __inline__ ino_t coda_f2i(struct ViceFid *fid) #endif -#ifndef __BIT_TYPES_DEFINED__ -#define u_int32_t unsigned int -#endif - - #ifndef _VUID_T_ #define _VUID_T_ typedef u_int32_t vuid_t; @@ -229,12 +237,8 @@ typedef u_int32_t vgid_t; #ifndef _CODACRED_T_ #define _CODACRED_T_ struct coda_cred { - vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; - vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; -#if defined(CODA_SUPPORTS_SUPPLEMENTARY_GROUPS) - int cr_nsupgps; - vgid_t cr_supgps[NGROUPS]; -#endif /* defined(CODA_SUPPORTS_SUPPLEMENTARY_GROUPS) */ + vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/ + vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ }; #endif @@ -246,7 +250,7 @@ struct coda_cred { enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; struct coda_vattr { - int va_type; /* vnode type (for create) */ + long va_type; /* vnode type (for create) */ u_short va_mode; /* files access mode and type */ short va_nlink; /* number of references to file */ vuid_t va_uid; /* owner user id */ @@ -266,6 +270,15 @@ struct coda_vattr { #endif +/* structure used by CODA_STATFS for getting cache information from venus */ +struct coda_statfs { + int32_t f_blocks; + int32_t f_bfree; + int32_t f_bavail; + int32_t f_files; + int32_t f_ffree; +}; + /* * Kernel <--> Venus communications. */ @@ -301,7 +314,8 @@ struct coda_vattr { #define CODA_OPEN_BY_PATH 31 #define CODA_RESOLVE 32 #define CODA_REINTEGRATE 33 -#define CODA_NCALLS 34 +#define CODA_STATFS 34 +#define CODA_NCALLS 35 #define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) @@ -675,6 +689,16 @@ struct coda_open_by_path_out { int path; }; +/* coda_statfs: NO_IN */ +struct coda_statfs_in { + struct coda_in_hdr in; +}; + +struct coda_statfs_out { + struct coda_out_hdr oh; + struct coda_statfs stat; +}; + /* * Occasionally, we don't cache the fid returned by CODA_LOOKUP. * For instance, if the fid is inconsistent. @@ -704,7 +728,8 @@ union inputArgs { struct coda_inactive_in coda_inactive; struct coda_vget_in coda_vget; struct coda_rdwr_in coda_rdwr; - struct coda_open_by_path_in coda_open_by_path; + struct coda_open_by_path_in coda_open_by_path; + struct coda_statfs_in coda_statfs; }; union outputArgs { @@ -726,7 +751,8 @@ union outputArgs { struct coda_purgefid_out coda_purgefid; struct coda_rdwr_out coda_rdwr; struct coda_replace_out coda_replace; - struct coda_open_by_path_out coda_open_by_path; + struct coda_open_by_path_out coda_open_by_path; + struct coda_statfs_out coda_statfs; }; union coda_downcalls { @@ -752,20 +778,11 @@ struct ViceIoctl { short out_size; /* Maximum size of output buffer, <= 2K */ }; -#if defined(__CYGWIN32__) || defined(DJGPP) struct PioctlData { - unsigned long cmd; const char *path; int follow; struct ViceIoctl vi; }; -#else -struct PioctlData { - const char *path; - int follow; - struct ViceIoctl vi; -}; -#endif #define CODA_CONTROL ".CONTROL" #define CODA_CONTROLLEN 8 diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h index c86a588ed..7c4ca8a04 100644 --- a/include/linux/coda_proc.h +++ b/include/linux/coda_proc.h @@ -98,6 +98,7 @@ struct coda_cache_inv_stats extern struct coda_vfs_stats coda_vfs_stat; extern struct coda_permission_stats coda_permission_stat; extern struct coda_cache_inv_stats coda_cache_inv_stat; +extern int coda_upcall_timestamping; /* reset statistics to 0 */ void reset_coda_vfs_stats( void ); diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 77d2c4ebe..f23a8e9b9 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -80,6 +80,7 @@ int venus_pioctl(struct super_block *sb, struct ViceFid *fid, unsigned int cmd, struct PioctlData *data); int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); int venus_fsync(struct super_block *sb, struct ViceFid *fid); +int venus_statfs(struct super_block *sb, struct statfs *sfs); /* messages between coda filesystem in kernel and Venus */ diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 2c127526c..c1c79c96e 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -517,7 +517,7 @@ struct cyclades_card { int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ int first_line; /* minor number of first channel on card */ int bus_index; /* address shift - 0 for ISA, 1 for PCI */ - int inact_ctrl; /* FW Inactivity control - 0 disabled, 1 enabled */ + int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ }; struct cyclades_chip { diff --git a/include/linux/file.h b/include/linux/file.h index 5efa99296..1bdd56a0c 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -5,7 +5,8 @@ #ifndef __LINUX_FILE_H #define __LINUX_FILE_H -extern void __fput(struct file *); +extern void __fput(struct file *); /* goner? */ +extern void _fput(struct file *); /* * Check whether the specified task has the fd open. Since the task @@ -15,7 +16,7 @@ extern inline struct file * fcheck_task(struct task_struct *p, unsigned int fd) { struct file * file = NULL; - if (p->files && fd < p->files->max_fds) + if (fd < p->files->max_fds) file = p->files->fd[fd]; return file; } @@ -28,10 +29,17 @@ extern inline struct file * fcheck(unsigned int fd) struct file * file = NULL; struct files_struct *files = current->files; - read_lock(&files->file_lock); if (fd < files->max_fds) file = files->fd[fd]; - read_unlock(&files->file_lock); + return file; +} + +extern inline struct file * frip(unsigned int fd) +{ + struct file * file = NULL; + + if (fd < current->files->max_fds) + file = xchg(¤t->files->fd[fd], NULL); return file; } @@ -41,11 +49,9 @@ extern inline struct file * fget(unsigned int fd) struct files_struct *files = current->files; read_lock(&files->file_lock); - if (fd < files->max_fds) { - file = files->fd[fd]; - if (file) - atomic_inc(&file->f_count); - } + file = fcheck(fd); + if (file) + get_file(file); read_unlock(&files->file_lock); return file; } @@ -78,7 +84,11 @@ extern inline void fd_install(unsigned int fd, struct file * file) * I suspect there are many other similar "optimizations" across the * kernel... */ -extern void fput(struct file *); +extern inline void fput(struct file * file) +{ + if (atomic_dec_and_test(&file->f_count)) + _fput(file); +} extern void put_filp(struct file *); #endif /* __LINUX_FILE_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index fd26410eb..07efcad85 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -346,6 +346,7 @@ struct inode { struct file_lock *i_flock; struct vm_area_struct *i_mmap; struct page *i_pages; + spinlock_t i_shared_lock; struct dquot *i_dquot[MAXQUOTAS]; struct pipe_inode_info *i_pipe; @@ -354,7 +355,7 @@ struct inode { unsigned int i_flags; unsigned char i_sock; - int i_writecount; + atomic_t i_writecount; unsigned int i_attr_flags; __u32 i_generation; union { @@ -400,7 +401,7 @@ struct fown_struct { }; struct file { - struct file *f_next, **f_pprev; + struct list_head f_list; struct dentry *f_dentry; struct file_operations *f_op; atomic_t f_count; @@ -417,6 +418,12 @@ struct file { /* needed for tty driver, and maybe others */ void *private_data; }; +extern spinlock_t files_lock; +#define file_list_lock() spin_lock(&files_lock); +#define file_list_unlock() spin_unlock(&files_lock); + +#define get_file(x) atomic_inc(&(x)->f_count) +#define file_count(x) atomic_read(&(x)->f_count) extern int init_private_file(struct file *, struct dentry *, int); @@ -524,6 +531,7 @@ struct super_block { short int s_ibasket_count; short int s_ibasket_max; struct list_head s_dirty; /* dirty inodes */ + struct list_head s_files; union { struct minix_sb_info minix_sb; @@ -657,6 +665,10 @@ struct file_system_type { extern int register_filesystem(struct file_system_type *); extern int unregister_filesystem(struct file_system_type *); +/* Return value for VFS lock functions - tells locks.c to lock conventionally + * REALLY kosha for root NFS and nfs_lock + */ +#define LOCK_USE_CLNT 1 #define FLOCK_VERIFY_READ 1 #define FLOCK_VERIFY_WRITE 2 @@ -664,29 +676,27 @@ extern int unregister_filesystem(struct file_system_type *); extern int locks_mandatory_locked(struct inode *); extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); -extern inline int locks_verify_locked(struct inode *inode) +/* + * Candidates for mandatory locking have the setgid bit set + * but no group execute bit - an otherwise meaningless combination. + */ +#define MANDATORY_LOCK(inode) \ + (IS_MANDLOCK(inode) && ((inode)->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) + +static inline int locks_verify_locked(struct inode *inode) { - /* Candidates for mandatory locking have the setgid bit set - * but no group execute bit - an otherwise meaningless combination. - */ - if (IS_MANDLOCK(inode) && - (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) - return (locks_mandatory_locked(inode)); - return (0); + if (MANDATORY_LOCK(inode)) + return locks_mandatory_locked(inode); + return 0; } extern inline int locks_verify_area(int read_write, struct inode *inode, struct file *filp, loff_t offset, size_t count) { - /* Candidates for mandatory locking have the setgid bit set - * but no group execute bit - an otherwise meaningless combination. - */ - if (IS_MANDLOCK(inode) && - (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) - return (locks_mandatory_area(read_write, inode, filp, offset, - count)); - return (0); + if (inode->i_flock && MANDATORY_LOCK(inode)) + return locks_mandatory_area(read_write, inode, filp, offset, count); + return 0; } @@ -744,8 +754,6 @@ extern struct file_system_type *get_fs_type(const char *); extern int fs_may_remount_ro(struct super_block *); extern int fs_may_mount(kdev_t); -extern struct file *inuse_filps; - extern int try_to_free_buffers(struct page *); extern void refile_buffer(struct buffer_head * buf); @@ -854,6 +862,8 @@ extern struct inode * get_empty_inode(void); extern void insert_inode_hash(struct inode *); extern void remove_inode_hash(struct inode *); extern struct file * get_empty_filp(void); +extern void file_move(struct file *f, struct list_head *list); +extern void file_moveto(struct file *new, struct file *old); extern struct buffer_head * get_hash_table(kdev_t, int, int); extern struct buffer_head * getblk(kdev_t, int, int); extern void ll_rw_block(int, int, struct buffer_head * bh[]); @@ -917,10 +927,6 @@ extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start, un extern int inode_change_ok(struct inode *, struct iattr *); extern void inode_setattr(struct inode *, struct iattr *); -/* kludge to get SCSI modules working */ -#include <linux/minix_fs.h> -#include <linux/minix_fs_sb.h> - #endif /* __KERNEL__ */ #endif /* _LINUX_FS_H */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 29e9766ea..feb877ed0 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -32,13 +32,15 @@ struct i2c_bus; struct i2c_driver; struct i2c_device; -#define I2C_DRIVERID_MSP3400 1 -#define I2C_DRIVERID_TUNER 2 -#define I2C_DRIVERID_VIDEOTEXT 3 +#define I2C_DRIVERID_MSP3400 1 +#define I2C_DRIVERID_TUNER 2 +#define I2C_DRIVERID_VIDEOTEXT 3 +#define I2C_DRIVERID_VIDEODECODER 4 +#define I2C_DRIVERID_VIDEOENCODER 5 #define I2C_BUSID_BT848 1 /* I2C bus on a BT848 */ #define I2C_BUSID_PARPORT 2 /* Bit banging on a parallel port */ - +#define I2C_BUSID_BUZ 3 /* * struct for a driver for a i2c chip (tuner, soundprocessor, * videotext, ... ). diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 04079577e..03118dd5f 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h @@ -24,9 +24,6 @@ * message structures */ -#define TID_SZ 12 -#define FUNCTION_SZ 8 - struct i2o_message { u32 version_size; @@ -35,6 +32,110 @@ struct i2o_message /* List follows */ }; +/************************************************************************** + * HRT related constants and structures + **************************************************************************/ +#define I2O_BUS_LOCAL 0 +#define I2O_BUS_ISA 1 +#define I2O_BUS_EISA 2 +#define I2O_BUS_MCA 3 +#define I2O_BUS_PCI 4 +#define I2O_BUS_PCMCIA 5 +#define I2O_BUS_NUBUS 6 +#define I2O_BUS_CARDBUS 7 +#define I2O_BUS_UNKNOWN 0x80 + +typedef struct _i2o_pci_bus { + u8 PciFunctionNumber; + u8 PciDeviceNumber; + u8 PciBusNumber; + u8 reserved; + u16 PciVendorID; + u16 PciDeviceID; +} i2o_pci_bus, *pi2o_pci_bus; + +typedef struct _i2o_local_bus { + u16 LbBaseIOPort; + u16 reserved; + u32 LbBaseMemoryAddress; +} i2o_local_bus, *pi2o_local_bus; + +typedef struct _i2o_isa_bus { + u16 IsaBaseIOPort; + u8 CSN; + u8 reserved; + u32 IsaBaseMemoryAddress; +} i2o_isa_bus, *pi2o_isa_bus; + +typedef struct _i2o_eisa_bus_info { + u16 EisaBaseIOPort; + u8 reserved; + u8 EisaSlotNumber; + u32 EisaBaseMemoryAddress; +} i2o_eisa_bus, *pi2o_eisa_bus; + +typedef struct _i2o_mca_bus { + u16 McaBaseIOPort; + u8 reserved; + u8 McaSlotNumber; + u32 McaBaseMemoryAddress; +} i2o_mca_bus, *pi2o_mca_bus; + +typedef struct _i2o_other_bus { + u16 BaseIOPort; + u16 reserved; + u32 BaseMemoryAddress; +} i2o_other_bus, *pi2o_other_bus; + + +typedef struct _i2o_hrt_entry { + u32 adapter_id; + u32 parent_tid:12; + u32 state:4; + u32 bus_num:8; + u32 bus_type:8; + union { + i2o_pci_bus pci_bus; + i2o_local_bus local_bus; + i2o_isa_bus isa_bus; + i2o_eisa_bus eisa_bus; + i2o_mca_bus mca_bus; + i2o_other_bus other_bus; + } bus; +} i2o_hrt_entry, *pi2o_hrt_entry; + +typedef struct _i2o_hrt { + u16 num_entries; + u8 entry_len; + u8 hrt_version; + u32 change_ind; + i2o_hrt_entry hrt_entry[1]; +} i2o_hrt, *pi2o_hrt; + +typedef struct _i2o_lct_entry { + u32 entry_size:16; + u32 tid:12; + u32 reserved:4; + u32 change_ind; + u32 device_flags; + u32 class_id; + u32 sub_class; + u32 user_tid:12; + u32 parent_tid:12; + u32 bios_info:8; + u8 identity_tag[8]; + u32 event_capabilities; +} i2o_lct_entry, *pi2o_lct_entry; + +typedef struct _i2o_lct { + u32 table_size:16; + u32 boot_tid:12; + u32 lct_ver:4; + u32 iop_flags; + u32 current_change_ind; + i2o_lct_entry lct_entry[1]; +} i2o_lct, *pi2o_lct; + /* * Each I2O device entity has one or more of these. There is one @@ -85,6 +186,8 @@ struct i2o_controller volatile u32 *post_port; /* Messaging ports */ volatile u32 *reply_port; volatile u32 *irq_mask; /* Interrupt port */ + u32 *lct; + u32 *hrt; u32 mem_offset; /* MFA offset */ u32 mem_phys; /* MFA physical */ u32 priv_mem; @@ -185,18 +288,22 @@ extern int i2o_release_device(struct i2o_device *); extern int i2o_post_this(struct i2o_controller *, int, u32 *, int); extern int i2o_post_wait(struct i2o_controller *, int, u32 *, int, int *, int); extern int i2o_issue_claim(struct i2o_controller *, int, int, int, int *); -extern int i2o_query_scalar(struct i2o_controller *, int, int, int, int, void *, - int, int *); -extern int i2o_params_set(struct i2o_controller *c, int, int, int, int, void *, - int, int *); -extern void i2o_run_queue(struct i2o_controller *); +extern int i2o_query_scalar(struct i2o_controller *, int, int, int, int, + void *, int, int *); +extern int i2o_set_scalar(struct i2o_controller *, int, int, int, int, + void *, int, int *); -extern void i2o_report_status(const char *, const char *, u8, u8, u16); -extern void report_common_status(u8); -extern void report_lan_dsc(u16); +extern int i2o_query_table(int, struct i2o_controller *, int, int, int, int, + void *, int, void *, int, int *); +extern int i2o_clear_table(struct i2o_controller *, int, int, int, int *); +extern int i2o_row_add_table(struct i2o_controller *, int, int, int, int, + void *, int, int *); +extern int i2o_row_delete_table(struct i2o_controller *, int, int, int, int, + void *, int, int *); -extern u32 i2o_wait_message(struct i2o_controller *, char *); +extern void i2o_run_queue(struct i2o_controller *); +extern void i2o_report_status(const char *, const char *, u32 *); extern const char *i2o_get_class_name(int); @@ -278,28 +385,12 @@ extern const char *i2o_get_class_name(int); #define I2O_SNFORMAT_IEEE_REG128 9 #define I2O_SNFORMAT_UNKNOWN2 0xff - -/* - * "Special" TID assignments - */ -#define I2O_IOP_TID 0 -#define I2O_HOST_TID 1 - - /* Transaction Reply Lists (TRL) Control Word structure */ #define TRL_SINGLE_FIXED_LENGTH 0x00 #define TRL_SINGLE_VARIABLE_LENGTH 0x40 #define TRL_MULTIPLE_FIXED_LENGTH 0x80 -/* LAN Class specific functions */ - -#define LAN_PACKET_SEND 0x3B -#define LAN_SDU_SEND 0x3D -#define LAN_RECEIVE_POST 0x3E -#define LAN_RESET 0x35 -#define LAN_SUSPEND 0x37 - /* * Messaging API values */ @@ -468,7 +559,7 @@ extern const char *i2o_get_class_name(int); #define I2O_DSC_UNSUPPORTED_VERSION 0x001A #define I2O_DSC_DEVICE_BUSY 0x001B #define I2O_DSC_DEVICE_NOT_AVAILABLE 0x001C - + /* Message header defines for VersionOffset */ #define I2OVER15 0x0001 #define I2OVER20 0x0002 @@ -478,7 +569,9 @@ extern const char *i2o_get_class_name(int); #define SGL_OFFSET_4 (0x0040 | I2OVERSION) #define SGL_OFFSET_5 (0x0050 | I2OVERSION) #define SGL_OFFSET_6 (0x0060 | I2OVERSION) +#define SGL_OFFSET_7 (0x0070 | I2OVERSION) #define SGL_OFFSET_8 (0x0080 | I2OVERSION) +#define SGL_OFFSET_9 (0x0090 | I2OVERSION) #define SGL_OFFSET_10 (0x00A0 | I2OVERSION) #define TRL_OFFSET_5 (0x0050 | I2OVERSION) @@ -492,9 +585,6 @@ extern const char *i2o_get_class_name(int); #define MSG_LAST 0x4000 #define MSG_REPLY 0x8000 - /* normal LAN request message MsgFlags and VersionOffset (0x1041) */ -#define LAN_MSG_REQST (MSG_MULTI_TRANS | SGL_OFFSET_4) - /* minimum size msg */ #define THREE_WORD_MSG_SIZE 0x00030000 #define FOUR_WORD_MSG_SIZE 0x00040000 @@ -518,7 +608,7 @@ extern const char *i2o_get_class_name(int); #define MSG_POOL_SIZE 16384 #define I2O_POST_WAIT_OK 1 -#define I2O_POST_WAIT_TIMEOUT -1 +#define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT #endif /* __KERNEL__ */ diff --git a/include/linux/ide.h b/include/linux/ide.h index 0ef994528..5156d0d75 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -265,6 +265,7 @@ typedef struct ide_drive_s { #if FAKE_FDISK_FOR_EZDRIVE unsigned remap_0_to_1 : 1; /* flag: partitioned with ezdrive */ #endif /* FAKE_FDISK_FOR_EZDRIVE */ + unsigned ata_flash : 1; /* 1=present, 0=default */ byte media; /* disk, cdrom, tape, floppy, ... */ select_t select; /* basic drive/head select reg value */ byte ctl; /* "normal" value for IDE_CONTROL_REG */ @@ -388,6 +389,7 @@ typedef struct hwif_s { unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ unsigned reset : 1; /* reset after probe */ unsigned autodma : 1; /* automatically try to enable DMA at boot */ + unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ byte channel; /* for dual-port chips: 0=primary, 1=secondary */ struct pci_dev *pci_dev; /* for pci chipsets */ ide_pci_devid_t pci_devid; /* for pci chipsets: {VID,DID} */ @@ -696,6 +698,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err); int ide_wait_cmd (ide_drive_t *drive, int cmd, int nsect, int feature, int sectors, byte *buf); void ide_delay_50ms (void); +int ide_config_drive_speed (ide_drive_t *drive, byte speed); /* * ide_system_bus_speed() returns what we think is the system VESA/PCI diff --git a/include/linux/isdn.h b/include/linux/isdn.h index c0a3ba309..52e501eea 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -398,9 +398,6 @@ typedef struct { #ifdef __KERNEL__ -#ifndef STANDALONE -#include <linux/config.h> -#endif #include <linux/errno.h> #include <linux/fs.h> #include <linux/major.h> diff --git a/include/linux/isdn_timru.h b/include/linux/isdn_timru.h deleted file mode 100644 index 361dbbea1..000000000 --- a/include/linux/isdn_timru.h +++ /dev/null @@ -1,119 +0,0 @@ -/* isdn_timru.h - * - * Linux ISDN subsystem, timeout-rules for network interfaces. - * - * Copyright 1997 by Christian Lademann <cal@zls.de> - * - * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* -02.06.97:cal:ISDN_TIMRU_PACKET_NONE def., ISDN_TIMRU_PACKET_* inkr. -*/ - -#ifndef __isdn_timru_h__ -#define __isdn_timru_h__ - -#define ISDN_TIMRU_PACKET_NONE 0 -#define ISDN_TIMRU_PACKET_SKB 1 -#define ISDN_TIMRU_PACKET_PPP 2 -#define ISDN_TIMRU_PACKET_PPP_NO_HEADER 3 - -#define ISDN_TIMRU_BRINGUP 0 -#define ISDN_TIMRU_KEEPUP_IN 1 -#define ISDN_TIMRU_KEEPUP_OUT 2 -#define ISDN_TIMRU_BRINGDOWN 3 -#define ISDN_TIMRU_NUM_CHECK 4 - -#define ISDN_TIMRU_PROTFAM_WILDCARD 0 -#define ISDN_TIMRU_PROTFAM_IP 1 -#define ISDN_TIMRU_PROTFAM_PPP 2 -#define ISDN_TIMRU_PROTFAM_IPX 3 -#define ISDN_TIMRU_NUM_PROTFAM 4 - -#define ISDN_TIMRU_IP_WILDCARD 0 -#define ISDN_TIMRU_IP_ICMP 1 -#define ISDN_TIMRU_IP_TCP 2 -#define ISDN_TIMRU_IP_UDP 3 - -#define ISDN_TIMRU_PPP_WILDCARD 0 -#define ISDN_TIMRU_PPP_IPCP 1 -#define ISDN_TIMRU_PPP_IPXCP 2 -#define ISDN_TIMRU_PPP_CCP 3 -#define ISDN_TIMRU_PPP_LCP 4 -#define ISDN_TIMRU_PPP_PAP 5 -#define ISDN_TIMRU_PPP_LQR 6 -#define ISDN_TIMRU_PPP_CHAP 7 - -typedef struct { - struct in_addr saddr, /* Source Address */ - smask, /* Source Subnetmask */ - daddr, /* Dest. Address */ - dmask; /* Dest. Subnetmask */ - ushort protocol; /* TCP, UDP, ... */ - union { - struct { - __u16 s_from, /* Source Port */ - s_to, - d_from, - d_to; - } port; - struct { - __u8 from, /* ICMP-Type */ - to; - } type; - } pt; -} isdn_timeout_rule_ip; - - -typedef struct { - ushort protocol; /* IPCP, LCP, ... */ -} isdn_timeout_rule_ppp; - - -typedef struct isdn_timeout_rule_s { - struct isdn_timeout_rule_s *next, /* Pointer to next rule */ - *prev; /* Pointer to previous rule */ - ushort type, /* BRINGUP, KEEPUP_*, ... */ - neg; - int timeout; /* Timeout value */ - ushort protfam; /* IP, IPX, PPP, ... */ - union { - isdn_timeout_rule_ip ip; /* IP-Rule */ - isdn_timeout_rule_ppp ppp; /* PPP-Rule */ - } rule; /* Prot.-specific rule */ -} isdn_timeout_rule; - - -typedef struct { - char name [9]; /* Interface */ - int where, /* 0/1: add to start/end of list, -1: handle default */ - type, - protfam, - index, - defval; - isdn_timeout_rule rule; /* Rule */ -} isdn_ioctl_timeout_rule; - -#ifdef __KERNEL__ -extern int isdn_net_recalc_timeout(int, int, struct device *, void *, ulong); -extern int isdn_timru_alloc_timeout_rules(struct device *); -extern int isdn_timru_ioctl_add_rule(isdn_ioctl_timeout_rule *); -extern int isdn_timru_ioctl_del_rule(isdn_ioctl_timeout_rule *); -extern int isdn_timru_ioctl_get_rule(isdn_ioctl_timeout_rule *); -#endif /* __KERNEL__ */ - -#endif /* __isdn_timru_h__ */ diff --git a/include/linux/lp.h b/include/linux/lp.h index 83e4d7739..bd03fdc8d 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -21,7 +21,12 @@ #define LP_ABORT 0x0040 #define LP_CAREFUL 0x0080 /* obsoleted -arca */ #define LP_ABORTOPEN 0x0100 -#define LP_TRUST_IRQ 0x0200 + +#define LP_TRUST_IRQ_ 0x0200 /* obsolete */ +#define LP_NO_REVERSE 0x0400 /* No reverse mode available. */ +#define LP_DATA_AVAIL 0x0800 /* Data is available. */ +#define LP_HAVE_PORT_BIT 12 /* (0x1000) Port is claimed. */ +#define LP_PORT_BUSY (1<<13) /* Reading or writing. */ /* timeout for each character. This is relative to bus cycles -- it * is the count in a busy loop. THIS IS THE VALUE TO CHANGE if you @@ -72,7 +77,6 @@ #define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */ #endif #define LPGETFLAGS 0x060e /* get status flags */ -#define LPTRUSTIRQ 0x060f /* set/unset the LP_TRUST_IRQ flag */ /* timeout for printk'ing a timeout, in jiffies (100ths of a second). This is also used for re-checking error conditions if LP_ABORT is @@ -98,7 +102,7 @@ #ifdef LP_STATS #define LP_STAT(minor) lp_table[(minor)].stats /* statistics area */ #endif -#define LP_BUFFER_SIZE 256 +#define LP_BUFFER_SIZE PAGE_SIZE #define LP_BASE(x) lp_table[(x)].dev->port->base @@ -125,10 +129,10 @@ struct lp_struct { unsigned int runchars; struct lp_stats stats; #endif - wait_queue_head_t wait_q; + wait_queue_head_t waitq; unsigned int last_error; - volatile unsigned int irq_detected:1; - volatile unsigned int irq_missed:1; + struct semaphore port_mutex; + wait_queue_head_t dataq; }; /* @@ -174,9 +178,6 @@ struct lp_struct { */ #define LP_DELAY 50 -#define LP_POLLED(minor) (lp_table[(minor)].dev->port->irq == PARPORT_IRQ_NONE) -#define LP_PREEMPTED(minor) (lp_table[(minor)].dev->port->waithead != NULL) - /* * function prototypes */ diff --git a/include/linux/major.h b/include/linux/major.h index e98dc9903..f65e8e7dd 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -92,9 +92,22 @@ #define SCSI_DISK7_MAJOR 71 +#define LVM_BLK_MAJOR 58 /* Logical Volume Manager */ + +#define COMPAQ_SMART2_MAJOR 72 +#define COMPAQ_SMART2_MAJOR1 73 +#define COMPAQ_SMART2_MAJOR2 74 +#define COMPAQ_SMART2_MAJOR3 75 +#define COMPAQ_SMART2_MAJOR4 76 +#define COMPAQ_SMART2_MAJOR5 77 +#define COMPAQ_SMART2_MAJOR6 78 +#define COMPAQ_SMART2_MAJOR7 79 + #define SPECIALIX_NORMAL_MAJOR 75 #define SPECIALIX_CALLOUT_MAJOR 76 +#define LVM_CHAR_MAJOR 109 /* Logical Volume Manager */ + #define I2O_MAJOR 80 /* 80->87 */ #define IDE6_MAJOR 88 diff --git a/include/linux/mm.h b/include/linux/mm.h index f41fc2743..76c3ca553 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -106,7 +106,6 @@ struct vm_operations_struct { unsigned long (*wppage)(struct vm_area_struct * area, unsigned long address, unsigned long page); int (*swapout)(struct vm_area_struct *, struct page *); - pte_t (*swapin)(struct vm_area_struct *, unsigned long, unsigned long); }; /* @@ -316,7 +315,10 @@ extern int zeromap_page_range(unsigned long from, unsigned long size, pgprot_t p extern int vmap_page_range (unsigned long from, unsigned long size, unsigned long vaddr); extern void vmtruncate(struct inode * inode, unsigned long offset); extern int handle_mm_fault(struct task_struct *tsk,struct vm_area_struct *vma, unsigned long address, int write_access); -extern void make_pages_present(unsigned long addr, unsigned long end); +extern int make_pages_present(unsigned long addr, unsigned long end); +extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); +extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len); +extern int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int len); extern int pgt_cache_water[2]; extern int check_pgt_cache(void); diff --git a/include/linux/mount.h b/include/linux/mount.h index 7e7ccb266..423119f09 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -21,7 +21,7 @@ struct quota_mount_options struct file *files[MAXQUOTAS]; /* fp's to quotafiles */ time_t inode_expire[MAXQUOTAS]; /* expiretime for inode-quota */ time_t block_expire[MAXQUOTAS]; /* expiretime for block-quota */ - char rsquash[MAXQUOTAS]; /* for quotas threath root as any other user */ + char rsquash[MAXQUOTAS]; /* for quotas treat root as any other user */ }; struct vfsmount diff --git a/include/linux/parport.h b/include/linux/parport.h index d95c5a856..0d65afa67 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -20,8 +20,6 @@ #define PARPORT_CONTROL_AUTOFD 0x2 #define PARPORT_CONTROL_INIT 0x4 #define PARPORT_CONTROL_SELECT 0x8 -#define PARPORT_CONTROL_INTEN 0x10 -#define PARPORT_CONTROL_DIRECTION 0x20 #define PARPORT_STATUS_ERROR 0x8 #define PARPORT_STATUS_SELECT 0x10 @@ -43,28 +41,43 @@ typedef enum { PARPORT_CLASS_SCANNER, PARPORT_CLASS_DIGCAM, PARPORT_CLASS_OTHER, /* Anything else */ - PARPORT_CLASS_UNSPEC /* No CLS field in ID */ + PARPORT_CLASS_UNSPEC, /* No CLS field in ID */ + PARPORT_CLASS_SCSIADAPTER } parport_device_class; -/* The "modes" entry in parport is a bit field representing the following - * modes. - * Note that PARPORT_MODE_PCECPEPP is for the SMC EPP+ECP mode which is NOT - * 100% compatible with EPP. - */ -#define PARPORT_MODE_PCSPP 0x0001 -#define PARPORT_MODE_PCPS2 0x0002 -#define PARPORT_MODE_PCEPP 0x0004 -#define PARPORT_MODE_PCECP 0x0008 -#define PARPORT_MODE_PCECPEPP 0x0010 -#define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */ -#define PARPORT_MODE_PCECPPS2 0x0040 +/* The "modes" entry in parport is a bit field representing the + capabilities of the hardware. */ +#define PARPORT_MODE_PCSPP (1<<0) /* IBM PC registers available. */ +#define PARPORT_MODE_TRISTATE (1<<1) /* Can tristate. */ +#define PARPORT_MODE_EPP (1<<2) /* Hardware EPP. */ +#define PARPORT_MODE_ECP (1<<3) /* Hardware ECP. */ +#define PARPORT_MODE_COMPAT (1<<4) /* Hardware 'printer protocol'. */ +#define PARPORT_MODE_DMA (1<<5) /* Hardware can DMA. */ + +/* IEEE1284 modes: + Nibble mode, byte mode, ECP, ECPRLE and EPP are their own + 'extensibility request' values. Others are special. + 'Real' ECP modes must have the IEEE1284_MODE_ECP bit set. */ +#define IEEE1284_MODE_NIBBLE 0 +#define IEEE1284_MODE_BYTE (1<<0) +#define IEEE1284_MODE_COMPAT (1<<8) +#define IEEE1284_MODE_BECP (1<<9) /* Bounded ECP mode */ +#define IEEE1284_MODE_ECP (1<<4) +#define IEEE1284_MODE_ECPRLE (IEEE1284_MODE_ECP | (1<<5)) +#define IEEE1284_MODE_ECPSWE (1<<10) /* Software-emulated */ +#define IEEE1284_MODE_EPP (1<<6) +#define IEEE1284_MODE_EPPSL (1<<11) /* EPP 1.7 */ +#define IEEE1284_MODE_EPPSWE (1<<12) /* Software-emulated */ +#define IEEE1284_DEVICEID (1<<2) /* This is a flag */ /* The rest is for the kernel only */ #ifdef __KERNEL__ +#include <linux/wait.h> #include <asm/system.h> #include <asm/ptrace.h> #include <asm/spinlock.h> +#include <asm/semaphore.h> #include <linux/proc_fs.h> #include <linux/config.h> @@ -72,59 +85,92 @@ typedef enum { /* Define this later. */ struct parport; +struct pardevice; struct pc_parport_state { unsigned int ctr; unsigned int ecr; }; +struct ax_parport_state { + unsigned int ctr; + unsigned int ecr; + unsigned int dcsr; +}; + +/* used by both parport_amiga and parport_mfc3 */ +struct amiga_parport_state { + unsigned char data; /* ciaa.prb */ + unsigned char datadir; /* ciaa.ddrb */ + unsigned char status; /* ciab.pra & 7 */ + unsigned char statusdir;/* ciab.ddrb & 7 */ +}; + struct parport_state { union { struct pc_parport_state pc; /* ARC has no state. */ - /* AX uses same state information as PC */ + struct ax_parport_state ax; + struct amiga_parport_state amiga; + /* Atari has not state. */ void *misc; } u; }; struct parport_operations { + /* IBM PC-style virtual registers. */ void (*write_data)(struct parport *, unsigned char); unsigned char (*read_data)(struct parport *); + void (*write_control)(struct parport *, unsigned char); unsigned char (*read_control)(struct parport *); - unsigned char (*frob_control)(struct parport *, unsigned char mask, unsigned char val); - void (*write_econtrol)(struct parport *, unsigned char); - unsigned char (*read_econtrol)(struct parport *); - unsigned char (*frob_econtrol)(struct parport *, unsigned char mask, unsigned char val); - void (*write_status)(struct parport *, unsigned char); + unsigned char (*frob_control)(struct parport *, unsigned char mask, + unsigned char val); + unsigned char (*read_status)(struct parport *); - void (*write_fifo)(struct parport *, unsigned char); - unsigned char (*read_fifo)(struct parport *); - void (*change_mode)(struct parport *, int); + /* IRQs. */ + void (*enable_irq)(struct parport *); + void (*disable_irq)(struct parport *); - void (*epp_write_data)(struct parport *, unsigned char); - unsigned char (*epp_read_data)(struct parport *); - void (*epp_write_addr)(struct parport *, unsigned char); - unsigned char (*epp_read_addr)(struct parport *); - int (*epp_check_timeout)(struct parport *); - size_t (*epp_write_block)(struct parport *, void *, size_t); - size_t (*epp_read_block)(struct parport *, void *, size_t); + /* Data direction. */ + void (*data_forward) (struct parport *); + void (*data_reverse) (struct parport *); - int (*ecp_write_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *); - int (*ecp_read_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *); + /* For core parport code. */ + void (*interrupt)(int, void *, struct pt_regs *); /* ? */ - void (*init_state)(struct parport_state *); + void (*init_state)(struct pardevice *, struct parport_state *); void (*save_state)(struct parport *, struct parport_state *); void (*restore_state)(struct parport *, struct parport_state *); - void (*enable_irq)(struct parport *); - void (*disable_irq)(struct parport *); - void (*interrupt)(int, void *, struct pt_regs *); - void (*inc_use_count)(void); void (*dec_use_count)(void); - void (*fill_inode)(struct inode *inode, int fill); + void (*fill_inode)(struct inode *inode, int fill); /* ? */ + + /* Block read/write */ + size_t (*epp_write_data) (struct parport *port, const void *buf, + size_t len, int flags); + size_t (*epp_read_data) (struct parport *port, void *buf, size_t len, + int flags); + size_t (*epp_write_addr) (struct parport *port, const void *buf, + size_t len, int flags); + size_t (*epp_read_addr) (struct parport *port, void *buf, size_t len, + int flags); + + size_t (*ecp_write_data) (struct parport *port, const void *buf, + size_t len, int flags); + size_t (*ecp_read_data) (struct parport *port, void *buf, size_t len, + int flags); + size_t (*ecp_write_addr) (struct parport *port, const void *buf, + size_t len, int flags); + + size_t (*compat_write_data) (struct parport *port, const void *buf, + size_t len, int flags); + size_t (*nibble_read_data) (struct parport *port, void *buf, + size_t len, int flags); + size_t (*byte_read_data) (struct parport *port, void *buf, + size_t len, int flags); }; struct parport_device_info { @@ -152,6 +198,7 @@ struct parport_device_info { struct pardevice { const char *name; struct parport *port; + int daisy; int (*preempt)(void *); void (*wakeup)(void *); void *private; @@ -163,34 +210,66 @@ struct pardevice { wait_queue_head_t wait_q; unsigned long int time; unsigned long int timeslice; + volatile long int timeout; unsigned int waiting; struct pardevice *waitprev; struct pardevice *waitnext; - void * sysctl_table; + void * sysctl_table; }; -/* Directory information for the /proc interface */ -struct parport_dir { - struct proc_dir_entry *entry; /* Directory /proc/parport/X */ - struct proc_dir_entry *irq; /* .../irq */ - struct proc_dir_entry *devices; /* .../devices */ - struct proc_dir_entry *hardware; /* .../hardware */ - struct proc_dir_entry *probe; /* .../autoprobe */ - char name[4]; +/* IEEE1284 information */ + +/* IEEE1284 phases */ +enum ieee1284_phase { + IEEE1284_PH_FWD_DATA, + IEEE1284_PH_FWD_IDLE, + IEEE1284_PH_TERMINATE, + IEEE1284_PH_NEGOTIATION, + IEEE1284_PH_HBUSY_DNA, + IEEE1284_PH_REV_IDLE, + IEEE1284_PH_HBUSY_DAVAIL, + IEEE1284_PH_REV_DATA, + IEEE1284_PH_ECP_SETUP, + IEEE1284_PH_ECP_FWD_TO_REV, + IEEE1284_PH_ECP_REV_TO_FWD +}; +struct ieee1284_info { + int mode; + volatile enum ieee1284_phase phase; + struct semaphore irq; }; /* A parallel port */ struct parport { unsigned long base; /* base address */ - unsigned long base_hi; /* base address (ECR) */ + unsigned long base_hi; /* base address (hi - ECR) */ unsigned int size; /* IO extent */ const char *name; + unsigned int modes; int irq; /* interrupt (or -1 for none) */ int dma; - unsigned int modes; + int muxport; /* which muxport (if any) this is */ + int portnum; /* which physical parallel port (not mux) */ + + struct parport *physport; + /* If this is a non-default mux + parport, i.e. we're a clone of a real + physical port, this is a pointer to that + port. The locking is only done in the + real port. For a clone port, the + following structure members are + meaningless: devices, cad, muxsel, + waithead, waittail, flags, pdir, + ieee1284, *_lock. + + It this is a default mux parport, or + there is no mux involved, this points to + ourself. */ struct pardevice *devices; struct pardevice *cad; /* port owner */ + int daisy; /* currently selected daisy addr */ + int muxsel; /* currently selected mux port */ struct pardevice *waithead; struct pardevice *waittail; @@ -198,8 +277,9 @@ struct parport { struct parport *next; unsigned int flags; - struct parport_dir pdir; - struct parport_device_info probe_info; + void *sysctl_table; + struct parport_device_info probe_info[5]; /* 0-3 + non-IEEE1284.3 */ + struct ieee1284_info ieee1284; struct parport_operations *ops; void *private_data; /* for lowlevel driver */ @@ -208,9 +288,12 @@ struct parport { spinlock_t pardevice_lock; spinlock_t waitlist_lock; rwlock_t cad_lock; - void * sysctl_table; + + int spintime; }; +#define DEFAULT_SPIN_TIME 500 /* us */ + struct parport_driver { const char *name; void (*attach) (struct parport *); @@ -218,11 +301,10 @@ struct parport_driver { struct parport_driver *next; }; -/* parport_register_port registers a new parallel port at the given address (if - * one does not already exist) and returns a pointer to it. This entails - * claiming the I/O region, IRQ and DMA. - * NULL is returned if initialisation fails. - */ +/* parport_register_port registers a new parallel port at the given + address (if one does not already exist) and returns a pointer to it. + This entails claiming the I/O region, IRQ and DMA. NULL is returned + if initialisation fails. */ struct parport *parport_register_port(unsigned long base, int irq, int dma, struct parport_operations *ops); @@ -236,12 +318,12 @@ void parport_announce_port (struct parport *port); /* Unregister a port. */ extern void parport_unregister_port(struct parport *port); -/* parport_in_use returns nonzero if there are devices attached to a port. */ +/* parport_in_use returns nonzero if there are devices attached to a + port. */ #define parport_in_use(x) ((x)->devices != NULL) -/* parport_enumerate returns a pointer to the linked list of all the ports - * in this machine. - */ +/* parport_enumerate returns a pointer to the linked list of all the + ports in this machine. */ struct parport *parport_enumerate(void); /* Register a new high-level driver. */ @@ -250,13 +332,12 @@ extern int parport_register_driver (struct parport_driver *); /* Unregister a high-level driver. */ extern void parport_unregister_driver (struct parport_driver *); -/* parport_register_device declares that a device is connected to a port, and - * tells the kernel all it needs to know. - * pf is the preemption function (may be NULL for no callback) - * kf is the wake-up function (may be NULL for no callback) - * irq_func is the interrupt handler (may be NULL for no interrupts) - * handle is a user pointer that gets handed to callback functions. - */ +/* parport_register_device declares that a device is connected to a + port, and tells the kernel all it needs to know. pf is the + preemption function (may be NULL for no callback) kf is the wake-up + function (may be NULL for no callback) irq_func is the interrupt + handler (may be NULL for no interrupts) handle is a user pointer + that gets handed to callback functions. */ struct pardevice *parport_register_device(struct parport *port, const char *name, int (*pf)(void *), void (*kf)(void *), @@ -266,30 +347,29 @@ struct pardevice *parport_register_device(struct parport *port, /* parport_unregister unlinks a device from the chain. */ extern void parport_unregister_device(struct pardevice *dev); -/* parport_claim tries to gain ownership of the port for a particular driver. - * This may fail (return non-zero) if another driver is busy. If this - * driver has registered an interrupt handler, it will be enabled. - */ +/* parport_claim tries to gain ownership of the port for a particular + driver. This may fail (return non-zero) if another driver is busy. + If this driver has registered an interrupt handler, it will be + enabled. */ extern int parport_claim(struct pardevice *dev); -/* parport_claim_or_block is the same, but sleeps if the port cannot be - claimed. Return value is 1 if it slept, 0 normally and -errno on error. */ +/* parport_claim_or_block is the same, but sleeps if the port cannot + be claimed. Return value is 1 if it slept, 0 normally and -errno + on error. */ extern int parport_claim_or_block(struct pardevice *dev); -/* parport_release reverses a previous parport_claim. This can never fail, - * though the effects are undefined (except that they are bad) if you didn't - * previously own the port. Once you have released the port you should make - * sure that neither your code nor the hardware on the port tries to initiate - * any communication without first re-claiming the port. - * If you mess with the port state (enabling ECP for example) you should - * clean up before releasing the port. - */ +/* parport_release reverses a previous parport_claim. This can never + fail, though the effects are undefined (except that they are bad) + if you didn't previously own the port. Once you have released the + port you should make sure that neither your code nor the hardware + on the port tries to initiate any communication without first + re-claiming the port. If you mess with the port state (enabling + ECP for example) you should clean up before releasing the port. */ extern void parport_release(struct pardevice *dev); /* parport_yield relinquishes the port if it would be helpful to other - * drivers. The return value is the same as for parport_claim. - */ + drivers. The return value is the same as for parport_claim. */ extern __inline__ int parport_yield(struct pardevice *dev) { unsigned long int timeslip = (jiffies - dev->time); @@ -300,8 +380,7 @@ extern __inline__ int parport_yield(struct pardevice *dev) } /* parport_yield_blocking is the same but uses parport_claim_or_block - * instead of parport_claim. - */ + instead of parport_claim. */ extern __inline__ int parport_yield_blocking(struct pardevice *dev) { unsigned long int timeslip = (jiffies - dev->time); @@ -311,37 +390,87 @@ extern __inline__ int parport_yield_blocking(struct pardevice *dev) return parport_claim_or_block(dev); } -/* - * Lowlevel drivers _can_ call this support function to handle irqs. - */ -extern __inline__ void parport_generic_irq(int irq, struct parport *port, - struct pt_regs *regs) -{ - read_lock(&port->cad_lock); - if (!port->cad) - goto out_unlock; - if (port->cad->irq_func) - port->cad->irq_func(irq, port->cad->private, regs); - else - printk(KERN_ERR "%s: irq%d happened with irq_func NULL " - "with %s as cad!\n", port->name, irq, port->cad->name); - out_unlock: - read_unlock(&port->cad_lock); -} - /* Flags used to identify what a device does. */ #define PARPORT_DEV_TRAN 0 /* WARNING !! DEPRECATED !! */ #define PARPORT_DEV_LURK (1<<0) /* WARNING !! DEPRECATED !! */ #define PARPORT_DEV_EXCL (1<<1) /* Need exclusive access. */ -#define PARPORT_FLAG_COMA_ (1<<0) /* No longer used. */ #define PARPORT_FLAG_EXCL (1<<1) /* EXCL driver registered. */ extern int parport_parse_irqs(int, const char *[], int irqval[]); -extern int parport_parse_dmas(int, const char *[], int irqval[]); -extern int parport_ieee1284_nibble_mode_ok(struct parport *, unsigned char); -extern int parport_wait_peripheral(struct parport *, unsigned char, unsigned - char); +extern int parport_parse_dmas(int, const char *[], int dmaval[]); + +/* IEEE1284 functions */ +extern void parport_ieee1284_interrupt (int, void *, struct pt_regs *); +extern int parport_negotiate (struct parport *, int mode); +extern ssize_t parport_write (struct parport *, const void *buf, size_t len); +extern ssize_t parport_read (struct parport *, void *buf, size_t len); +extern long parport_set_timeout (struct pardevice *, long inactivity); +extern int parport_wait_event (struct parport *, long timeout); +extern int parport_wait_peripheral (struct parport *port, + unsigned char mask, + unsigned char val); + +/* For architectural drivers */ +extern void parport_ieee1284_wakeup (struct parport *port); +extern size_t parport_ieee1284_write_compat (struct parport *, + const void *, size_t, int); +extern size_t parport_ieee1284_read_nibble (struct parport *, + void *, size_t, int); +extern size_t parport_ieee1284_read_byte (struct parport *, + void *, size_t, int); +extern size_t parport_ieee1284_ecp_read_data (struct parport *, + void *, size_t, int); +extern size_t parport_ieee1284_ecp_write_data (struct parport *, + const void *, size_t, int); +extern size_t parport_ieee1284_ecp_write_addr (struct parport *, + const void *, size_t, int); +extern size_t parport_ieee1284_epp_write_data (struct parport *, + const void *, size_t, int); +extern size_t parport_ieee1284_epp_read_data (struct parport *, + void *, size_t, int); +extern size_t parport_ieee1284_epp_write_addr (struct parport *, + const void *, size_t, int); +extern size_t parport_ieee1284_epp_read_addr (struct parport *, + void *, size_t, int); + +/* IEEE1284.3 functions */ +extern int parport_daisy_init (struct parport *port); +extern void parport_daisy_fini (struct parport *port); +extern struct pardevice *parport_open (int devnum, const char *name, + int (*pf) (void *), + void (*kf) (void *), + void (*irqf) (int, void *, + struct pt_regs *), + int flags, void *handle); +extern void parport_close (struct pardevice *dev); +extern ssize_t parport_device_id (int devnum, char *buffer, size_t len); +extern int parport_device_num (int parport, int mux, int daisy); +extern int parport_device_coords (int devnum, int *parport, int *mux, + int *daisy); +extern void parport_daisy_deselect_all (struct parport *port); +extern int parport_daisy_select (struct parport *port, int daisy, int mode); + +/* For finding devices based on their device ID. Example usage: + int devnum = -1; + while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) { + struct pardevice *dev = parport_open (devnum, ...); + ... + } +*/ +extern int parport_find_device (const char *mfg, const char *mdl, int from); +extern int parport_find_class (parport_device_class cls, int from); + +/* Lowlevel drivers _can_ call this support function to handle irqs. */ +extern __inline__ void parport_generic_irq(int irq, struct parport *port, + struct pt_regs *regs) +{ + parport_ieee1284_interrupt (irq, port, regs); + read_lock(&port->cad_lock); + if (port->cad && port->cad->irq_func) + port->cad->irq_func(irq, port->cad->private, regs); + read_unlock(&port->cad_lock); +} /* Prototypes from parport_procfs */ extern int parport_proc_register(struct parport *pp); @@ -354,12 +483,8 @@ extern int parport_default_proc_unregister(void); extern void dec_parport_count(void); extern void inc_parport_count(void); -extern int parport_probe(struct parport *port, char *buffer, int len); -extern void parport_probe_one(struct parport *port); -extern void (*parport_probe_hook)(struct parport *port); - /* If PC hardware is the only type supported, we can optimise a bit. */ -#if (defined(CONFIG_PARPORT_PC) || defined(CONFIG_PARPORT_PC_MODULE)) && !(defined(CONFIG_PARPORT_AX) || defined(CONFIG_PARPORT_AX_MODULE)) && !(defined(CONFIG_PARPORT_ARC) || defined(CONFIG_PARPORT_ARC_MODULE)) && !defined(CONFIG_PARPORT_OTHER) +#if (defined(CONFIG_PARPORT_PC) || defined(CONFIG_PARPORT_PC_MODULE)) && !(defined(CONFIG_PARPORT_AX) || defined(CONFIG_PARPORT_AX_MODULE)) && !(defined(CONFIG_PARPORT_ARC) || defined(CONFIG_PARPORT_ARC_MODULE)) && !(defined(CONFIG_PARPORT_AMIGA) || defined(CONFIG_PARPORT_AMIGA_MODULE)) && !(defined(CONFIG_PARPORT_MFC3) || defined(CONFIG_PARPORT_MFC3_MODULE)) && !(defined(CONFIG_PARPORT_ATARI) || defined(CONFIG_PARPORT_ATARI_MODULE)) && !defined(CONFIG_PARPORT_OTHER) #undef PARPORT_NEED_GENERIC_OPS #include <linux/parport_pc.h> #define parport_write_data(p,x) parport_pc_write_data(p,x) @@ -367,21 +492,11 @@ extern void (*parport_probe_hook)(struct parport *port); #define parport_write_control(p,x) parport_pc_write_control(p,x) #define parport_read_control(p) parport_pc_read_control(p) #define parport_frob_control(p,m,v) parport_pc_frob_control(p,m,v) -#define parport_write_econtrol(p,x) parport_pc_write_econtrol(p,x) -#define parport_read_econtrol(p) parport_pc_read_econtrol(p) -#define parport_frob_econtrol(p,m,v) parport_pc_frob_econtrol(p,m,v) -#define parport_write_status(p,v) parport_pc_write_status(p,v) #define parport_read_status(p) parport_pc_read_status(p) -#define parport_write_fifo(p,v) parport_pc_write_fifo(p,v) -#define parport_read_fifo(p) parport_pc_read_fifo(p) -#define parport_change_mode(p,m) parport_pc_change_mode(p,m) -#define parport_release_resources(p) parport_pc_release_resources(p) -#define parport_claim_resources(p) parport_pc_claim_resources(p) -#define parport_epp_write_data(p,x) parport_pc_write_epp(p,x) -#define parport_epp_read_data(p) parport_pc_read_epp(p) -#define parport_epp_write_addr(p,x) parport_pc_write_epp_addr(p,x) -#define parport_epp_read_addr(p) parport_pc_read_epp_addr(p) -#define parport_epp_check_timeout(p) parport_pc_check_epp_timeout(p) +#define parport_enable_irq(p) parport_pc_enable_irq(p) +#define parport_disable_irq(p) parport_pc_disable_irq(p) +#define parport_data_forward(p) parport_pc_data_forward(p) +#define parport_data_reverse(p) parport_pc_data_reverse(p) #endif #ifdef PARPORT_NEED_GENERIC_OPS @@ -391,21 +506,11 @@ extern void (*parport_probe_hook)(struct parport *port); #define parport_write_control(p,x) (p)->ops->write_control(p,x) #define parport_read_control(p) (p)->ops->read_control(p) #define parport_frob_control(p,m,v) (p)->ops->frob_control(p,m,v) -#define parport_write_econtrol(p,x) (p)->ops->write_econtrol(p,x) -#define parport_read_econtrol(p) (p)->ops->read_econtrol(p) -#define parport_frob_econtrol(p,m,v) (p)->ops->frob_econtrol(p,m,v) -#define parport_write_status(p,v) (p)->ops->write_status(p,v) #define parport_read_status(p) (p)->ops->read_status(p) -#define parport_write_fifo(p,v) (p)->ops->write_fifo(p,v) -#define parport_read_fifo(p) (p)->ops->read_fifo(p) -#define parport_change_mode(p,m) (p)->ops->change_mode(p,m) -#define parport_release_resources(p) (p)->ops->release_resources(p) -#define parport_claim_resources(p) (p)->ops->claim_resources(p) -#define parport_epp_write_data(p,x) (p)->ops->epp_write_data(p,x) -#define parport_epp_read_data(p) (p)->ops->epp_read_data(p) -#define parport_epp_write_addr(p,x) (p)->ops->epp_write_addr(p,x) -#define parport_epp_read_addr(p) (p)->ops->epp_read_addr(p) -#define parport_epp_check_timeout(p) (p)->ops->epp_check_timeout(p) +#define parport_enable_irq(p) (p)->ops->enable_irq(p) +#define parport_disable_irq(p) (p)->ops->disable_irq(p) +#define parport_data_forward(p) (p)->ops->data_forward(p) +#define parport_data_reverse(p) (p)->ops->data_reverse(p) #endif #endif /* __KERNEL__ */ diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h index cf93bb008..955e685ad 100644 --- a/include/linux/parport_pc.h +++ b/include/linux/parport_pc.h @@ -5,93 +5,112 @@ /* --- register definitions ------------------------------- */ -#define ECONTROL(p) ((p)->base_hi + 0x02) -#define CONFIGB(p) ((p)->base_hi + 0x01) -#define CONFIGA(p) ((p)->base_hi + 0x00) -#define EPPDATA(p) ((p)->base + 0x04) -#define EPPADDR(p) ((p)->base + 0x03) -#define CONTROL(p) ((p)->base + 0x02) -#define STATUS(p) ((p)->base + 0x01) -#define DATA(p) ((p)->base + 0x00) - -/* Private data for PC low-level driver. */ +#define ECONTROL(p) ((p)->base_hi + 0x2) +#define CONFIGB(p) ((p)->base_hi + 0x1) +#define CONFIGA(p) ((p)->base_hi + 0x0) +#define FIFO(p) ((p)->base_hi + 0x0) +#define EPPDATA(p) ((p)->base + 0x4) +#define EPPADDR(p) ((p)->base + 0x3) +#define CONTROL(p) ((p)->base + 0x2) +#define STATUS(p) ((p)->base + 0x1) +#define DATA(p) ((p)->base + 0x0) + struct parport_pc_private { /* Contents of CTR. */ unsigned char ctr; -}; -extern int parport_pc_epp_clear_timeout(struct parport *pb); + /* Bitmask of writable CTR bits. */ + unsigned char ctr_writable; -extern volatile unsigned char parport_pc_ctr; + /* Whether or not there's an ECR. */ + int ecr; -extern __inline__ void parport_pc_write_epp(struct parport *p, unsigned char d) -{ - outb(d, EPPDATA(p)); -} + /* Number of PWords that FIFO will hold. */ + int fifo_depth; -extern __inline__ unsigned char parport_pc_read_epp(struct parport *p) -{ - return inb(EPPDATA(p)); -} + /* Number of bytes per portword. */ + int pword; -extern __inline__ void parport_pc_write_epp_addr(struct parport *p, unsigned char d) -{ - outb(d, EPPADDR(p)); -} + /* Not used yet. */ + int readIntrThreshold; + int writeIntrThreshold; -extern __inline__ unsigned char parport_pc_read_epp_addr(struct parport *p) -{ - return inb(EPPADDR(p)); -} + /* buffer suitable for DMA, if DMA enabled */ + char *dma_buf; +}; -extern __inline__ int parport_pc_check_epp_timeout(struct parport *p) +extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) { - if (!(inb(STATUS(p)) & 1)) - return 0; - parport_pc_epp_clear_timeout(p); - return 1; + outb(d, DATA(p)); } -extern __inline__ unsigned char parport_pc_read_configb(struct parport *p) +extern __inline__ unsigned char parport_pc_read_data(struct parport *p) { - return inb(CONFIGB(p)); + return inb(DATA(p)); } -extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) +extern __inline__ unsigned char __frob_control (struct parport *p, + unsigned char mask, + unsigned char val) { - outb(d, DATA(p)); + struct parport_pc_private *priv = p->physport->private_data; + unsigned char ctr = priv->ctr; + ctr = (ctr & ~mask) ^ val; + ctr &= priv->ctr_writable; /* only write writable bits. */ + outb (ctr, CONTROL (p)); + return priv->ctr = ctr; /* update soft copy */ } -extern __inline__ unsigned char parport_pc_read_data(struct parport *p) +extern __inline__ void parport_pc_data_reverse (struct parport *p) { - return inb(DATA(p)); + __frob_control (p, 0x20, 0x20); } -extern __inline__ void parport_pc_write_control(struct parport *p, unsigned char d) +extern __inline__ void parport_pc_write_control (struct parport *p, + unsigned char d) { - struct parport_pc_private *priv = p->private_data; - priv->ctr = d;/* update soft copy */ - outb(d, CONTROL(p)); + const unsigned char wm = (PARPORT_CONTROL_STROBE | + PARPORT_CONTROL_AUTOFD | + PARPORT_CONTROL_INIT | + PARPORT_CONTROL_SELECT); + + /* Take this out when drivers have adapted to newer interface. */ + if (d & 0x20) { + printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n", + p->name, p->cad->name); + parport_pc_data_reverse (p); + } + + __frob_control (p, wm, d & wm); } extern __inline__ unsigned char parport_pc_read_control(struct parport *p) { - struct parport_pc_private *priv = p->private_data; - return priv->ctr; + const struct parport_pc_private *priv = p->physport->private_data; + return priv->ctr; /* Use soft copy */ } -extern __inline__ unsigned char parport_pc_frob_control(struct parport *p, unsigned char mask, unsigned char val) +extern __inline__ unsigned char parport_pc_frob_control (struct parport *p, + unsigned char mask, + unsigned char val) { - struct parport_pc_private *priv = p->private_data; - unsigned char ctr = priv->ctr; - ctr = (ctr & ~mask) ^ val; - outb (ctr, CONTROL(p)); - return priv->ctr = ctr; /* update soft copy */ -} + const unsigned char wm = (PARPORT_CONTROL_STROBE | + PARPORT_CONTROL_AUTOFD | + PARPORT_CONTROL_INIT | + PARPORT_CONTROL_SELECT); -extern __inline__ void parport_pc_write_status(struct parport *p, unsigned char d) -{ - outb(d, STATUS(p)); + /* Take this out when drivers have adapted to newer interface. */ + if (mask & 0x20) { + printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n", + p->name, p->cad->name); + parport_pc_data_reverse (p); + } + + /* Restrict mask and val to control lines. */ + mask &= wm; + val &= wm; + + return __frob_control (p, mask, val); } extern __inline__ unsigned char parport_pc_read_status(struct parport *p) @@ -99,51 +118,31 @@ extern __inline__ unsigned char parport_pc_read_status(struct parport *p) return inb(STATUS(p)); } -extern __inline__ void parport_pc_write_econtrol(struct parport *p, unsigned char d) +extern __inline__ void parport_pc_data_forward (struct parport *p) { - outb(d, ECONTROL(p)); + __frob_control (p, 0x20, 0x00); } -extern __inline__ unsigned char parport_pc_read_econtrol(struct parport *p) +extern __inline__ void parport_pc_disable_irq(struct parport *p) { - return inb(ECONTROL(p)); + __frob_control (p, 0x10, 0x00); } -extern __inline__ unsigned char parport_pc_frob_econtrol(struct parport *p, unsigned char mask, unsigned char val) +extern __inline__ void parport_pc_enable_irq(struct parport *p) { - unsigned char old = inb(ECONTROL(p)); - outb(((old & ~mask) ^ val), ECONTROL(p)); - return old; + __frob_control (p, 0x10, 0x10); } -extern void parport_pc_change_mode(struct parport *p, int m); - -extern void parport_pc_write_fifo(struct parport *p, unsigned char v); - -extern unsigned char parport_pc_read_fifo(struct parport *p); - -extern void parport_pc_disable_irq(struct parport *p); - -extern void parport_pc_enable_irq(struct parport *p); - extern void parport_pc_release_resources(struct parport *p); extern int parport_pc_claim_resources(struct parport *p); -extern void parport_pc_init_state(struct parport_state *s); +extern void parport_pc_init_state(struct pardevice *, struct parport_state *s); extern void parport_pc_save_state(struct parport *p, struct parport_state *s); extern void parport_pc_restore_state(struct parport *p, struct parport_state *s); -extern size_t parport_pc_epp_read_block(struct parport *p, void *buf, size_t length); - -extern size_t parport_pc_epp_write_block(struct parport *p, void *buf, size_t length); - -extern int parport_pc_ecp_read_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle); - -extern int parport_pc_ecp_write_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle); - extern void parport_pc_inc_use_count(void); extern void parport_pc_dec_use_count(void); diff --git a/include/linux/pci.h b/include/linux/pci.h index c64d9eb2e..22bae0020 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -273,6 +273,9 @@ #define PCI_CLASS_SERIAL_USB 0x0c03 #define PCI_CLASS_SERIAL_FIBER 0x0c04 +#define PCI_BASE_CLASS_INTELLIGENT 0x0e +#define PCI_CLASS_INTELLIGENT_I2O 0x0e00 + #define PCI_CLASS_HOT_SWAP_CONTROLLER 0xff00 #define PCI_CLASS_OTHERS 0xff @@ -305,6 +308,7 @@ #define PCI_DEVICE_ID_NCR_53C895 0x000c #define PCI_DEVICE_ID_NCR_53C885 0x000d #define PCI_DEVICE_ID_NCR_53C875 0x000f +#define PCI_DEVICE_ID_NCR_53C1510 0x0010 #define PCI_DEVICE_ID_NCR_53C875J 0x008f #define PCI_VENDOR_ID_ATI 0x1002 @@ -368,6 +372,7 @@ #define PCI_DEVICE_ID_DEC_21152 0x0024 #define PCI_DEVICE_ID_DEC_21153 0x0025 #define PCI_DEVICE_ID_DEC_21154 0x0026 +#define PCI_DEVICE_ID_COMPAQ_42XX 0x0046 #define PCI_VENDOR_ID_CIRRUS 0x1013 #define PCI_DEVICE_ID_CIRRUS_7548 0x0038 @@ -403,6 +408,7 @@ #define PCI_VENDOR_ID_AMD 0x1022 #define PCI_DEVICE_ID_AMD_LANCE 0x2000 +#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 #define PCI_DEVICE_ID_AMD_SCSI 0x2020 #define PCI_VENDOR_ID_TRIDENT 0x1023 @@ -619,6 +625,9 @@ #define PCI_VENDOR_ID_SGI 0x10a9 #define PCI_DEVICE_ID_SGI_IOC3 0x0003 +#define PCI_VENDOR_ID_SGI 0x10a9 +#define PCI_DEVICE_ID_SGI_IOC3 0x0003 + #define PCI_VENDOR_ID_ACC 0x10aa #define PCI_DEVICE_ID_ACC_2056 0x0000 @@ -689,6 +698,8 @@ #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2160 0x0004 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICMEDIA_256AV 0x0005 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZVPLUS 0x0083 #define PCI_VENDOR_ID_ASP 0x10cd #define PCI_DEVICE_ID_ASP_ABP940 0x1200 @@ -871,6 +882,9 @@ #define PCI_VENDOR_ID_GALILEO 0x11ab #define PCI_DEVICE_ID_GALILEO_GT64011 0x4146 +#define PCI_VENDOR_ID_GALILEO 0x11ab +#define PCI_DEVICE_ID_GALILEO_GT64011 0x4146 + #define PCI_VENDOR_ID_LITEON 0x11ad #define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002 @@ -969,6 +983,7 @@ #define PCI_VENDOR_ID_ENSONIQ 0x1274 #define PCI_DEVICE_ID_ENSONIQ_AUDIOPCI 0x5000 +#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371 #define PCI_VENDOR_ID_ALTEON 0x12ae #define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001 @@ -1035,6 +1050,7 @@ #define PCI_DEVICE_ID_GENROCO_HFP832 0x0003 #define PCI_VENDOR_ID_INTEL 0x8086 +#define PCI_DEVICE_ID_INTEL_21145 0x0039 #define PCI_DEVICE_ID_INTEL_82375 0x0482 #define PCI_DEVICE_ID_INTEL_82424 0x0483 #define PCI_DEVICE_ID_INTEL_82378 0x0484 @@ -1078,6 +1094,7 @@ #define PCI_VENDOR_ID_ADAPTEC 0x9004 #define PCI_DEVICE_ID_ADAPTEC_7810 0x1078 #define PCI_DEVICE_ID_ADAPTEC_7821 0x2178 +#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860 #define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 #define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 #define PCI_DEVICE_ID_ADAPTEC_5800 0x5800 diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index be5c2c666..bbe90c229 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -375,6 +375,7 @@ static inline int proc_scsi_unregister(struct proc_dir_entry *driver, int x) } } +extern struct super_block *proc_super_blocks; extern struct dentry_operations proc_dentry_operations; extern struct super_block *proc_read_super(struct super_block *,void *,int); extern int init_proc_fs(void); @@ -456,12 +457,12 @@ extern void proc_device_tree_init(void); #else -extern inline int proc_register(struct proc_dir_entry *a, struct proc_dir_entry *b) {}; -extern inline int proc_unregister(struct proc_dir_entry *a, int b) {}; -extern inline int proc_net_register(struct proc_dir_entry *a) {}; -extern inline int proc_net_unregister(int x) {}; -extern inline int proc_scsi_register(struct proc_dir_entry *b, struct proc_dir_entry *c) {}; -extern inline int proc_scsi_unregister(struct proc_dir_entry *a, int x); +extern inline int proc_register(struct proc_dir_entry *a, struct proc_dir_entry *b) { return 0; } +extern inline int proc_unregister(struct proc_dir_entry *a, int b) { return 0; } +extern inline int proc_net_register(struct proc_dir_entry *a) { return 0; } +extern inline int proc_net_unregister(int x) { return 0; } +extern inline int proc_scsi_register(struct proc_dir_entry *b, struct proc_dir_entry *c) { return 0; } +extern inline int proc_scsi_unregister(struct proc_dir_entry *a, int x) { return 0; } extern inline struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) diff --git a/include/linux/sched.h b/include/linux/sched.h index cc49b927c..cd1cc2c46 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -172,6 +172,7 @@ struct mm_struct { atomic_t count; int map_count; /* number of VMAs */ struct semaphore mmap_sem; + spinlock_t page_table_lock; unsigned long context; unsigned long start_code, end_code, start_data, end_data; unsigned long start_brk, brk, start_stack; @@ -193,6 +194,7 @@ struct mm_struct { swapper_pg_dir, \ ATOMIC_INIT(1), 1, \ __MUTEX_INITIALIZER(name.mmap_sem), \ + SPIN_LOCK_UNLOCKED, \ 0, \ 0, 0, 0, 0, \ 0, 0, 0, \ @@ -343,7 +345,7 @@ struct task_struct { */ #define _STK_LIM (8*1024*1024) -#define DEF_PRIORITY (20*HZ/100) /* 210 ms time slices */ +#define DEF_PRIORITY (20*HZ/100) /* 200 ms time slices */ /* * INIT_TASK is used to set up the first task table, touch at diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h index 52ff06b5f..2d5128dc4 100644 --- a/include/linux/soundcard.h +++ b/include/linux/soundcard.h @@ -891,6 +891,12 @@ typedef unsigned char mixer_record[128]; #define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record) /* + * Two ioctls for special souncard function + */ +#define SOUND_MIXER_AGC _SIOWR('M', 103, int) +#define SOUND_MIXER_3DSE _SIOWR('M', 104, int) + +/* * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers. * These features can be used when accessing device specific features. */ diff --git a/include/linux/swap.h b/include/linux/swap.h index fa4177914..da5665a5b 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -90,9 +90,6 @@ extern void rw_swap_page_nolock(int, unsigned long, char *, int); extern void swap_after_unlock_page (unsigned long entry); /* linux/mm/page_alloc.c */ -extern void swap_in(struct task_struct *, struct vm_area_struct *, - pte_t *, unsigned long, int); - /* linux/mm/swap_state.c */ extern void show_swap_cache_info(void); diff --git a/include/linux/tty.h b/include/linux/tty.h index 58fb7abfa..fb10cd6c9 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -282,6 +282,7 @@ struct tty_struct { struct tq_struct tq_hangup; void *disc_data; void *driver_data; + struct list_head tty_files; #define N_TTY_BUF_SIZE 4096 diff --git a/include/linux/video_decoder.h b/include/linux/video_decoder.h new file mode 100644 index 000000000..1302c7f44 --- /dev/null +++ b/include/linux/video_decoder.h @@ -0,0 +1,37 @@ +#ifndef _LINUX_VIDEO_DECODER_H +#define _LINUX_VIDEO_DECODER_H + +struct video_decoder_capability { /* this name is too long */ + __u32 flags; +#define VIDEO_DECODER_PAL 1 /* can decode PAL signal */ +#define VIDEO_DECODER_NTSC 2 /* can decode NTSC */ +#define VIDEO_DECODER_SECAM 4 /* can decode SECAM */ +#define VIDEO_DECODER_AUTO 8 /* can autosense norm */ +#define VIDEO_DECODER_CCIR 16 /* CCIR-601 pixel rate (720 pixels per line) instead of square pixel rate */ + int inputs; /* number of inputs */ + int outputs; /* number of outputs */ +}; + +/* +DECODER_GET_STATUS returns the following flags. The only one you need is +DECODER_STATUS_GOOD, the others are just nice things to know. +*/ +#define DECODER_STATUS_GOOD 1 /* receiving acceptable input */ +#define DECODER_STATUS_COLOR 2 /* receiving color information */ +#define DECODER_STATUS_PAL 4 /* auto detected */ +#define DECODER_STATUS_NTSC 8 /* auto detected */ +#define DECODER_STATUS_SECAM 16 /* auto detected */ + + +#define DECODER_GET_CAPABILITIES _IOR('d', 1, struct video_decoder_capability) +#define DECODER_GET_STATUS _IOR('d', 2, int) +#define DECODER_SET_NORM _IOW('d', 3, int) +#define DECODER_SET_INPUT _IOW('d', 4, int) /* 0 <= input < #inputs */ +#define DECODER_SET_OUTPUT _IOW('d', 5, int) /* 0 <= output < #outputs */ +#define DECODER_ENABLE_OUTPUT _IOW('d', 6, int) /* boolean output enable control */ +#define DECODER_SET_PICTURE _IOW('d', 7, struct video_picture) + +#define DECODER_DUMP _IO('d', 192) /* debug hook */ + + +#endif diff --git a/include/linux/video_encoder.h b/include/linux/video_encoder.h new file mode 100644 index 000000000..4b0e6907a --- /dev/null +++ b/include/linux/video_encoder.h @@ -0,0 +1,21 @@ +#ifndef _LINUX_VIDEO_ENCODER_H +#define _LINUX_VIDEO_ENCODER_H + +struct video_encoder_capability { /* this name is too long */ + __u32 flags; +#define VIDEO_ENCODER_PAL 1 /* can encode PAL signal */ +#define VIDEO_ENCODER_NTSC 2 /* can encode NTSC */ +#define VIDEO_ENCODER_SECAM 4 /* can encode SECAM */ +#define VIDEO_ENCODER_CCIR 16 /* CCIR-601 pixel rate (720 pixels per line) instead of square pixel rate */ + int inputs; /* number of inputs */ + int outputs; /* number of outputs */ +}; + +#define ENCODER_GET_CAPABILITIES _IOR('e', 1, struct video_encoder_capability) +#define ENCODER_SET_NORM _IOW('e', 2, int) +#define ENCODER_SET_INPUT _IOW('e', 3, int) /* 0 <= input < #inputs */ +#define ENCODER_SET_OUTPUT _IOW('e', 4, int) /* 0 <= output < #outputs */ +#define ENCODER_ENABLE_OUTPUT _IOW('e', 5, int) /* boolean output enable control */ + + +#endif diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 52c1e0f31..590d4b10f 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -279,6 +279,7 @@ struct video_unit #define VID_HARDWARE_VINO 20 /* Reserved for SGI Indy Vino */ #define VID_HARDWARE_CADET 21 /* Cadet radio */ #define VID_HARDWARE_CPIA 22 +#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */ /* * Initialiser list diff --git a/include/net/irda/irmod.h b/include/net/irda/irmod.h index 9612a5572..ba551b7d4 100644 --- a/include/net/irda/irmod.h +++ b/include/net/irda/irmod.h @@ -90,7 +90,7 @@ struct irda_todo { */ struct irda_cb { struct miscdevice dev; - wait_queue_head_t *wait_queue; + wait_queue_head_t wait_queue; int in_use; diff --git a/include/net/sock.h b/include/net/sock.h index 73ef988a7..af6bf7679 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -371,10 +371,6 @@ do { spin_lock_init(&((__sk)->lock.slock)); \ } while(0); struct sock { - /* This must be first. */ - struct sock *sklist_next; - struct sock *sklist_prev; - /* Local port binding hash linkage. */ struct sock *bind_next; struct sock **bind_pprev; @@ -579,10 +575,6 @@ do { if((__sk)->backlog.tail == NULL) { \ * transport -> network interface is defined by struct inet_proto */ struct proto { - /* These must be first. */ - struct sock *sklist_next; - struct sock *sklist_prev; - void (*close)(struct sock *sk, long timeout); int (*connect)(struct sock *sk, @@ -621,9 +613,7 @@ struct proto { /* Keeping track of sk's, looking them up, and port selection methods. */ void (*hash)(struct sock *sk); void (*unhash)(struct sock *sk); - void (*rehash)(struct sock *sk); - unsigned short (*good_socknum)(void); - int (*verify_bind)(struct sock *sk, unsigned short snum); + int (*get_port)(struct sock *sk, unsigned short snum); unsigned short max_header; unsigned long retransmits; @@ -667,40 +657,6 @@ extern rwlock_t sockhash_lock; #define SOCKHASH_LOCK_WRITE_BH() write_lock(&sockhash_lock) #define SOCKHASH_UNLOCK_WRITE_BH() write_unlock(&sockhash_lock) -/* Some things in the kernel just want to get at a protocols - * entire socket list commensurate, thus... - */ -static __inline__ void add_to_prot_sklist(struct sock *sk) -{ - SOCKHASH_LOCK_WRITE(); - if(!sk->sklist_next) { - struct proto *p = sk->prot; - - sk->sklist_prev = (struct sock *) p; - sk->sklist_next = p->sklist_next; - p->sklist_next->sklist_prev = sk; - p->sklist_next = sk; - - /* Charge the protocol. */ - sk->prot->inuse += 1; - if(sk->prot->highestinuse < sk->prot->inuse) - sk->prot->highestinuse = sk->prot->inuse; - } - SOCKHASH_UNLOCK_WRITE(); -} - -static __inline__ void del_from_prot_sklist(struct sock *sk) -{ - SOCKHASH_LOCK_WRITE(); - if(sk->sklist_next) { - sk->sklist_next->sklist_prev = sk->sklist_prev; - sk->sklist_prev->sklist_next = sk->sklist_next; - sk->sklist_next = NULL; - sk->prot->inuse--; - } - SOCKHASH_UNLOCK_WRITE(); -} - /* Used by processes to "lock" a socket state, so that * interrupts and bottom half handlers won't change it * from under us. It essentially blocks any incoming diff --git a/include/net/tcp.h b/include/net/tcp.h index 28fc52125..9127795c2 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -72,11 +72,7 @@ extern struct sock *tcp_listening_hash[TCP_LHTABLE_SIZE]; */ struct tcp_bind_bucket { unsigned short port; - unsigned short flags; -#define TCPB_FLAG_LOCKED 0x0001 -#define TCPB_FLAG_FASTREUSE 0x0002 -#define TCPB_FLAG_GOODSOCKNUM 0x0004 - + unsigned short fastreuse; struct tcp_bind_bucket *next; struct sock *owners; struct tcp_bind_bucket **pprev; @@ -115,32 +111,6 @@ static __inline__ int tcp_bhashfn(__u16 lport) return (lport & (tcp_bhash_size - 1)); } -static __inline__ void tcp_sk_bindify(struct sock *sk) -{ - struct tcp_bind_bucket *tb; - unsigned short snum = sk->num; - - for(tb = tcp_bhash[tcp_bhashfn(snum)]; tb->port != snum; tb = tb->next) - ; - /* Update bucket flags. */ - if(tb->owners == NULL) { - /* We're the first. */ - if(sk->reuse && sk->state != TCP_LISTEN) - tb->flags = TCPB_FLAG_FASTREUSE; - else - tb->flags = 0; - } else { - if((tb->flags & TCPB_FLAG_FASTREUSE) && - ((sk->reuse == 0) || (sk->state == TCP_LISTEN))) - tb->flags &= ~TCPB_FLAG_FASTREUSE; - } - if((sk->bind_next = tb->owners) != NULL) - tb->owners->bind_pprev = &sk->bind_next; - tb->owners = sk; - sk->bind_pprev = &tb->owners; - sk->prev = (struct sock *) tb; -} - /* This is a TIME_WAIT bucket. It works around the memory consumption * problems of sockets in such a state on heavily loaded servers, but * without violating the protocol specification. @@ -150,8 +120,6 @@ struct tcp_tw_bucket { * XXX Yes I know this is gross, but I'd have to edit every single * XXX networking file if I created a "struct sock_header". -DaveM */ - struct sock *sklist_next; - struct sock *sklist_prev; struct sock *bind_next; struct sock **bind_pprev; __u32 daddr; @@ -477,7 +445,9 @@ extern __inline int between(__u32 seq1, __u32 seq2, __u32 seq3) extern struct proto tcp_prot; extern struct tcp_mib tcp_statistics; -extern unsigned short tcp_good_socknum(void); +extern void tcp_put_port(struct sock *sk); +extern void __tcp_put_port(struct sock *sk); +extern void tcp_inherit_port(struct sock *sk, struct sock *child); extern void tcp_v4_err(struct sk_buff *skb, unsigned char *, int); @@ -630,8 +600,7 @@ struct tcp_sl_timer { #define TCP_SLT_SYNACK 0 #define TCP_SLT_KEEPALIVE 1 #define TCP_SLT_TWKILL 2 -#define TCP_SLT_BUCKETGC 3 -#define TCP_SLT_MAX 4 +#define TCP_SLT_MAX 3 extern struct tcp_sl_timer tcp_slt_array[TCP_SLT_MAX]; @@ -1069,17 +1038,6 @@ extern __inline__ void tcp_dec_slow_timer(int timer) atomic_dec(&slt->count); } -/* This needs to use a slow timer, so it is here. */ -static __inline__ void tcp_sk_unbindify(struct sock *sk) -{ - struct tcp_bind_bucket *tb = (struct tcp_bind_bucket *) sk->prev; - if(sk->bind_next) - sk->bind_next->bind_pprev = sk->bind_pprev; - *sk->bind_pprev = sk->bind_next; - if(tb->owners == NULL) - tcp_inc_slow_timer(TCP_SLT_BUCKETGC); -} - extern const char timer_bug_msg[]; static inline void tcp_clear_xmit_timer(struct sock *sk, int what) diff --git a/include/net/udp.h b/include/net/udp.h index 30a59b3f0..dcc2fd093 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -23,6 +23,7 @@ #define _UDP_H #include <linux/udp.h> +#include <net/sock.h> #define UDP_HTABLE_SIZE 128 @@ -32,7 +33,18 @@ */ extern struct sock *udp_hash[UDP_HTABLE_SIZE]; -extern unsigned short udp_good_socknum(void); +extern int udp_port_rover; + +static inline int udp_lport_inuse(u16 num) +{ + struct sock *sk = udp_hash[num & (UDP_HTABLE_SIZE - 1)]; + + for(; sk != NULL; sk = sk->next) { + if(sk->num == num) + return 1; + } + return 0; +} /* Note: this must match 'valbool' in sock_setsockopt */ #define UDP_CSUM_NOXMIT 1 |