diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
commit | e308faf24f68e262d92d294a01ddca7a17e76762 (patch) | |
tree | 22c47cb315811834861f013067878ff664e95abd /include | |
parent | 30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff) |
Sync with Linux 2.1.46.
Diffstat (limited to 'include')
105 files changed, 1897 insertions, 1286 deletions
diff --git a/include/asm-alpha/ioctls.h b/include/asm-alpha/ioctls.h index bb4f71de8..0337b92b3 100644 --- a/include/asm-alpha/ioctls.h +++ b/include/asm-alpha/ioctls.h @@ -83,6 +83,8 @@ #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ +#define TIOCSBRK 0x5427 /* BSD compatibility */ +#define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index 2f40ad673..7d80c32f8 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h @@ -517,4 +517,7 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) #define SWP_OFFSET(entry) ((entry) >> 40) #define SWP_ENTRY(type,offset) pte_val(mk_swap_pte((type),(offset))) +#define module_map vmalloc +#define module_unmap vfree + #endif /* _ALPHA_PGTABLE_H */ diff --git a/include/asm-i386/ioctls.h b/include/asm-i386/ioctls.h index 60e0806e5..ae04e1a55 100644 --- a/include/asm-i386/ioctls.h +++ b/include/asm-i386/ioctls.h @@ -44,6 +44,9 @@ #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ +#define TIOCSBRK 0x5427 /* BSD compatibility */ +#define TIOCCBRK 0x5428 /* BSD compatibility */ + #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 #define FIOASYNC 0x5452 diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 7d973530c..347611f1b 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -491,4 +491,7 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #define SWP_OFFSET(entry) ((entry) >> 8) #define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8)) +#define module_map vmalloc +#define module_unmap vfree + #endif /* _I386_PAGE_H */ diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index 069c7a1a8..66efafee9 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -175,6 +175,8 @@ #define __NR_query_module 167 #define __NR_poll 168 #define __NR_nfsservctl 169 +#define __NR_setresgid 170 +#define __NR_getresgid 171 /* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */ diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h index 512e0b054..ab3ca802e 100644 --- a/include/asm-m68k/hardirq.h +++ b/include/asm-m68k/hardirq.h @@ -12,4 +12,6 @@ extern unsigned int local_irq_count[NR_CPUS]; #define hardirq_enter(cpu) (local_irq_count[cpu]++) #define hardirq_exit(cpu) (local_irq_count[cpu]--) +#define synchronize_irq() do { } while (0) + #endif diff --git a/include/asm-m68k/ioctls.h b/include/asm-m68k/ioctls.h index 77ad866b8..b4a95af61 100644 --- a/include/asm-m68k/ioctls.h +++ b/include/asm-m68k/ioctls.h @@ -44,6 +44,9 @@ #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ +#define TIOCSBRK 0x5427 /* BSD compatibility */ +#define TIOCCBRK 0x5428 /* BSD compatibility */ + #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 #define FIOASYNC 0x5452 diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h index 9463700a3..589dfe956 100644 --- a/include/asm-m68k/pgtable.h +++ b/include/asm-m68k/pgtable.h @@ -95,38 +95,23 @@ extern void cache_push_v (unsigned long vaddr, int len); extern inline void flush_cache_mm(struct mm_struct *mm) { -#if FLUSH_VIRTUAL_CACHE_040 - if (mm == current->mm) __flush_cache_all(); -#else - if (mm == current->mm) __flush_cache_030(); -#endif + if (mm == current->mm) + __flush_cache_030(); } extern inline void flush_cache_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - if (mm == current->mm){ -#if FLUSH_VIRTUAL_CACHE_040 - if (CPU_IS_040_OR_060) - cache_push_v(start, end-start); - else -#endif + if (mm == current->mm) __flush_cache_030(); - } } extern inline void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr) { - if (vma->vm_mm == current->mm){ -#if FLUSH_VIRTUAL_CACHE_040 - if (CPU_IS_040_OR_060) - cache_push_v(vmaddr, PAGE_SIZE); - else -#endif + if (vma->vm_mm == current->mm) __flush_cache_030(); - } } /* Push the page at kernel virtual address and clear the icache */ @@ -783,4 +768,7 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #endif /* __ASSEMBLY__ */ +#define module_map vmalloc +#define module_unmap vfree + #endif /* _M68K_PGTABLE_H */ diff --git a/include/asm-mips/ioctls.h b/include/asm-mips/ioctls.h index 9ec2c0215..5648eae7f 100644 --- a/include/asm-mips/ioctls.h +++ b/include/asm-mips/ioctls.h @@ -96,6 +96,8 @@ #define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */ #define TIOCTTYGSTRUCT 0x5487 /* For debugging only */ +#define TIOCSBRK 0x5427 /* BSD compatibility */ +#define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCSERCONFIG 0x5488 #define TIOCSERGWILD 0x5489 diff --git a/include/asm-mips/namei.h b/include/asm-mips/namei.h index 0ff96ac00..b9c0aea15 100644 --- a/include/asm-mips/namei.h +++ b/include/asm-mips/namei.h @@ -13,6 +13,8 @@ /* Only one at this time. */ #define IRIX32_EMUL "usr/gnemul/irix/" +#if 0 /* XXX FIXME */ + extern int __namei(int, const char *, struct inode *, char *, struct inode **, struct inode **, struct qstr *, struct dentry **, int *); @@ -44,6 +46,8 @@ __prefix_namei(int retrieve_mode, const char * name, struct inode * base, return 0; } +#endif /* XXX FIXME */ + #else /* !defined(CONFIG_BINFMT_IRIX) */ #define __prefix_namei(retrieve_mode, name, base, buf, res_dir, res_inode, \ diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index ebeb6e67c..4f3876cdb 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -491,6 +491,9 @@ extern void (*update_mmu_cache)(struct vm_area_struct *vma, #define SWP_OFFSET(entry) ((entry) >> 15) #define SWP_ENTRY(type,offset) (((type) << 8) | ((offset) << 15)) +#define module_map vmalloc +#define module_unmap vfree + /* TLB operations. */ extern inline void tlb_probe(void) { diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index daf477459..2c752a0c0 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h @@ -108,13 +108,13 @@ __restore_flags(int flags) #define save_and_cli(x) __save_and_cli(x) #define restore_flags(x) __restore_flags(x) -#define sync_mem() \ -__asm__ __volatile__( \ - ".set\tnoreorder\n\t" \ - "sync\n\t" \ - ".set\treorder" \ - : /* no output */ \ - : /* no input */ \ +#define mb() \ +__asm__ __volatile__( \ + "# prevent instructions being moved around\n\t" \ + ".set\tnoreorder\n\t" \ + ".set\treorder" \ + : /* no output */ \ + : /* no input */ \ : "memory") #if !defined (__LANGUAGE_ASSEMBLY__) diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 4cf30a110..4517106ca 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -1177,11 +1177,13 @@ #define __NR_query_module (__NR_Linux + 187) #define __NR_poll (__NR_Linux + 188) #define __NR_nfsservctl (__NR_Linux + 189) +#define __NR_setresgid (__NR_Linux + 190) +#define __NR_getresgid (__NR_Linux + 191) /* * Offset of the last Linux flavoured syscall */ -#define __NR_Linux_syscalls 189 +#define __NR_Linux_syscalls 191 #ifndef __LANGUAGE_ASSEMBLY__ diff --git a/include/asm-ppc/ioctls.h b/include/asm-ppc/ioctls.h index 52a3d45bd..f56e53db7 100644 --- a/include/asm-ppc/ioctls.h +++ b/include/asm-ppc/ioctls.h @@ -83,6 +83,8 @@ #define TIOCGETD 0x5424 #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ #define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ +#define TIOCSBRK 0x5427 /* BSD compatibility */ +#define TIOCCBRK 0x5428 /* BSD compatibility */ #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 243a0b115..e9c400345 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -361,4 +361,7 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #define SWP_OFFSET(entry) ((entry) >> 8) #define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8)) +#define module_map vmalloc +#define module_unmap vfree + #endif /* _PPC_PAGE_H */ diff --git a/include/asm-sparc/asi.h b/include/asm-sparc/asi.h index f81ab33b9..59fcd4337 100644 --- a/include/asm-sparc/asi.h +++ b/include/asm-sparc/asi.h @@ -1,4 +1,4 @@ -/* $Id: asi.h,v 1.16 1996/04/25 06:12:43 davem Exp $ */ +/* $Id: asi.h,v 1.17 1997/06/24 15:48:10 jj Exp $ */ #ifndef _SPARC_ASI_H #define _SPARC_ASI_H @@ -69,7 +69,7 @@ /* Block-copy operations are available only on certain V8 cpus. */ #define ASI_M_BCOPY 0x17 /* Block copy */ -/* These affect only the ICACHE and are Ross HyperSparc specific. */ +/* These affect only the ICACHE and are Ross HyperSparc and TurboSparc specific. */ #define ASI_M_IFLUSH_PAGE 0x18 /* Flush I Cache Line (page); wo, ss */ #define ASI_M_IFLUSH_SEG 0x19 /* Flush I Cache Line (seg); wo, ss */ #define ASI_M_IFLUSH_REGION 0x1A /* Flush I Cache Line (region); wo, ss */ @@ -97,7 +97,7 @@ /* This is ROSS HyperSparc only. */ #define ASI_M_FLUSH_IWHOLE 0x31 /* Flush entire ICACHE; wo, ss */ -/* Tsunami/Viking i/d cache flash clear. */ +/* Tsunami/Viking/TurboSparc i/d cache flash clear. */ #define ASI_M_IC_FLCLEAR 0x36 #define ASI_M_DC_FLCLEAR 0x37 diff --git a/include/asm-sparc/ioctls.h b/include/asm-sparc/ioctls.h index 80eff02ea..ccc5e7fce 100644 --- a/include/asm-sparc/ioctls.h +++ b/include/asm-sparc/ioctls.h @@ -63,8 +63,8 @@ /* 119 is the non-posix getpgrp tty ioctl */ #define __TIOCCDTR _IO('t', 120) /* SunOS Specific */ #define __TIOCSDTR _IO('t', 121) /* SunOS Specific */ -#define __TIOCCBRK _IO('t', 122) /* SunOS Specific */ -#define __TIOCSBRK _IO('t', 123) /* SunOS Specific */ +#define TIOCCBRK _IO('t', 122) +#define TIOCSBRK _IO('t', 123) #define __TIOCLGET _IOW('t', 124, int) /* SunOS Specific */ #define __TIOCLSET _IOW('t', 125, int) /* SunOS Specific */ #define __TIOCLBIC _IOW('t', 126, int) /* SunOS Specific */ diff --git a/include/asm-sparc/mbus.h b/include/asm-sparc/mbus.h index e5e5a18c8..5f2749015 100644 --- a/include/asm-sparc/mbus.h +++ b/include/asm-sparc/mbus.h @@ -1,4 +1,4 @@ -/* $Id: mbus.h,v 1.8 1996/08/29 09:48:21 davem Exp $ +/* $Id: mbus.h,v 1.9 1997/06/24 15:48:12 jj Exp $ * mbus.h: Various defines for MBUS modules. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -25,7 +25,8 @@ enum mbus_module { Viking_30 = 10, Viking_35 = 11, Viking_new = 12, - SRMMU_INVAL_MOD = 13, + TurboSparc = 13, + SRMMU_INVAL_MOD = 14, }; extern enum mbus_module srmmu_modtype; @@ -71,6 +72,7 @@ extern unsigned int hwbug_bitmask; /* Fujitsu */ #define FMI_AURORA 0x4 /* MB8690x, a Swift module... */ +#define FMI_TURBO 0x5 /* MB86907, a TurboSparc module... */ /* For multiprocessor support we need to be able to obtain the CPU id and * the MBUS Module id. diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h index e74a76bce..8ce53ae35 100644 --- a/include/asm-sparc/namei.h +++ b/include/asm-sparc/namei.h @@ -1,4 +1,4 @@ -/* $Id: namei.h,v 1.5 1997/06/07 08:32:54 ecd Exp $ +/* $Id: namei.h,v 1.6 1997/07/17 02:24:25 davem Exp $ * linux/include/asm-sparc/namei.h * * Routines to handle famous /usr/gnemul/s*. @@ -11,6 +11,8 @@ #define SPARC_BSD_EMUL "usr/gnemul/sunos/" #define SPARC_SOL_EMUL "usr/gnemul/solaris/" +#if 0 /* XXX FIXME */ + extern int __namei(int, const char *, struct inode *, char *, struct inode **, struct inode **, struct qstr *, struct dentry **, int *); @@ -44,4 +46,6 @@ __prefix_namei(int retrieve_mode, const char * name, struct inode * base, return 0; } +#endif /* XXX FIXME */ + #endif /* __SPARC_NAMEI_H */ diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h index 40c6de10b..bb404745f 100644 --- a/include/asm-sparc/oplib.h +++ b/include/asm-sparc/oplib.h @@ -1,4 +1,4 @@ -/* $Id: oplib.h,v 1.15 1997/03/18 18:00:18 jj Exp $ +/* $Id: oplib.h,v 1.16 1997/06/27 14:55:04 jj Exp $ * oplib.h: Describes the interface and available routines in the * Linux Prom library. * @@ -272,12 +272,12 @@ extern int prom_searchsiblings(int node_start, char *name); /* Return the first property type, as a string, for the given node. * Returns a null string on error. */ -extern char *prom_firstprop(int node); +extern char *prom_firstprop(int node, char *buffer); /* Returns the next property after the passed property for the given * node. Returns null string on failure. */ -extern char *prom_nextprop(int node, char *prev_property); +extern char *prom_nextprop(int node, char *prev_property, char *buffer); /* Returns 1 if the specified node has given property. */ extern int prom_node_has_property(int node, char *property); diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 8b84e1dce..de8ce5687 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.60 1997/04/14 17:05:16 jj Exp $ */ +/* $Id: pgtable.h,v 1.62 1997/06/27 14:55:00 jj Exp $ */ #ifndef _SPARC_PGTABLE_H #define _SPARC_PGTABLE_H @@ -368,7 +368,7 @@ extern __inline__ void add_to_ctx_list(struct ctx_list *head, struct ctx_list *e #define add_to_free_ctxlist(entry) add_to_ctx_list(&ctx_free, entry) #define add_to_used_ctxlist(entry) add_to_ctx_list(&ctx_used, entry) -extern __inline__ unsigned int +extern __inline__ unsigned long __get_phys (unsigned long addr) { switch (sparc_cpu_model){ @@ -394,4 +394,7 @@ __get_iospace (unsigned long addr) } } +#define module_map vmalloc +#define module_unmap vfree + #endif /* !(_SPARC_PGTABLE_H) */ diff --git a/include/asm-sparc/turbosparc.h b/include/asm-sparc/turbosparc.h new file mode 100644 index 000000000..b3cdc7d78 --- /dev/null +++ b/include/asm-sparc/turbosparc.h @@ -0,0 +1,114 @@ +/* $Id: turbosparc.h,v 1.1 1997/07/18 06:29:12 ralf Exp $ + * turbosparc.h: Defines specific to the TurboSparc module. + * This is SRMMU stuff. + * + * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + */ +#ifndef _SPARC_TURBOSPARC_H +#define _SPARC_TURBOSPARC_H + +#include <asm/asi.h> +#include <asm/pgtsrmmu.h> + +/* Bits in the SRMMU control register for TurboSparc modules. + * + * ------------------------------------------------------------------- + * |impl-vers| RSV| PMC |PE|PC| RSV |BM| RFR |IC|DC|PSO|RSV|ICS|NF|ME| + * ------------------------------------------------------------------- + * 31 24 23-21 20-19 18 17 16-15 14 13-10 9 8 7 6-3 2 1 0 + * + * BM: Boot Mode -- 0 = not in boot mode, 1 = in boot mode + * + * This indicates whether the TurboSparc is in boot-mode or not. + * + * IC: Instruction Cache -- 0 = off, 1 = on + * DC: Data Cache -- 0 = off, 1 = 0n + * + * These bits enable the on-cpu TurboSparc split I/D caches. + * + * ICS: ICache Snooping -- 0 = disable, 1 = enable snooping of icache + * NF: No Fault -- 0 = faults generate traps, 1 = faults don't trap + * ME: MMU enable -- 0 = mmu not translating, 1 = mmu translating + * + */ + +#define TURBOSPARC_MMUENABLE 0x00000001 +#define TURBOSPARC_NOFAULT 0x00000002 +#define TURBOSPARC_ICSNOOP 0x00000004 +#define TURBOSPARC_PSO 0x00000080 +#define TURBOSPARC_DCENABLE 0x00000100 /* Enable data cache */ +#define TURBOSPARC_ICENABLE 0x00000200 /* Enable instruction cache */ +#define TURBOSPARC_BMODE 0x00004000 +#define TURBOSPARC_PARITYODD 0x00020000 /* Parity odd, if enabled */ +#define TURBOSPARC_PCENABLE 0x00040000 /* Enable parity checking */ + +/* Bits in the CPU configuration register for TurboSparc modules. + * + * ------------------------------------------------------- + * |IOClk|SNP|AXClk| RAH | WS | RSV |SBC|WT|uS2|SE|SCC| + * ------------------------------------------------------- + * 31 30 29-28 27-26 25-23 22-8 7-6 5 4 3 2-0 + * + */ + +#define TURBOSPARC_SCENABLE 0x00000008 /* Secondary cache enable */ +#define TURBOSPARC_uS2 0x00000010 /* Swift compatibility mode */ +#define TURBOSPARC_WTENABLE 0x00000020 /* Write thru for dcache */ +#define TURBOSPARC_SNENABLE 0x40000000 /* DVMA snoop enable */ + +#ifndef __ASSEMBLY__ + +/* Bits [13:5] select one of 512 instruction cache tags */ +extern __inline__ void turbosparc_inv_insn_tag(unsigned long addr) +{ + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : + "r" (addr), "i" (ASI_M_TXTC_TAG)); +} + +/* Bits [13:5] select one of 512 data cache tags */ +extern __inline__ void turbosparc_inv_data_tag(unsigned long addr) +{ + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : + "r" (addr), "i" (ASI_M_DATAC_TAG)); +} + +extern __inline__ void turbosparc_flush_icache(void) +{ + __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : + "i" (ASI_M_IC_FLCLEAR)); +} + +extern __inline__ void turbosparc_flush_dcache(void) +{ + unsigned long addr; + + for(addr = 0; addr < 0x4000; addr += 0x20) + turbosparc_inv_data_tag(addr); +} + +extern __inline__ void turbosparc_idflash_clear(void) +{ + turbosparc_flush_icache(); turbosparc_flush_dcache(); +} + +extern __inline__ void turbosparc_set_ccreg(unsigned long regval) +{ + __asm__ __volatile__("sta %0, [%1] %2\n\t" : : + "r" (regval), "r" (0x600), + "i" (ASI_M_MMUREGS)); +} + +extern __inline__ unsigned long turbosparc_get_ccreg(void) +{ + unsigned long regval; + + __asm__ __volatile__("lda [%1] %2, %0\n\t" : + "=r" (regval) : + "r" (0x600), + "i" (ASI_M_MMUREGS)); + return regval; +} + +#endif /* !__ASSEMBLY__ */ + +#endif /* !(_SPARC_TURBOSPARC_H) */ diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h index 70e6c37a4..18cf7c541 100644 --- a/include/asm-sparc64/asm_offsets.h +++ b/include/asm-sparc64/asm_offsets.h @@ -104,14 +104,8 @@ #define ASIZ_task_it_virt_incr 0x00000008 #define AOFF_task_real_timer 0x000001f8 #define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_utime 0x00000220 -#define ASIZ_task_utime 0x00000008 -#define AOFF_task_stime 0x00000228 -#define ASIZ_task_stime 0x00000008 -#define AOFF_task_cutime 0x00000230 -#define ASIZ_task_cutime 0x00000008 -#define AOFF_task_cstime 0x00000238 -#define ASIZ_task_cstime 0x00000008 +#define AOFF_task_times 0x00000220 +#define ASIZ_task_times 0x00000020 #define AOFF_task_start_time 0x00000240 #define ASIZ_task_start_time 0x00000008 #define AOFF_task_min_flt 0x00000248 @@ -151,24 +145,24 @@ #define AOFF_task_ldt 0x00000370 #define ASIZ_task_ldt 0x00000008 #define AOFF_task_tss 0x00000380 -#define ASIZ_task_tss 0x00000600 -#define AOFF_task_fs 0x00000980 +#define ASIZ_task_tss 0x000004c0 +#define AOFF_task_fs 0x00000840 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x00000988 +#define AOFF_task_files 0x00000848 #define ASIZ_task_files 0x00000008 -#define AOFF_task_mm 0x00000990 +#define AOFF_task_mm 0x00000850 #define ASIZ_task_mm 0x00000008 -#define AOFF_task_sig 0x00000998 +#define AOFF_task_sig 0x00000858 #define ASIZ_task_sig 0x00000008 -#define AOFF_task_has_cpu 0x000009a0 +#define AOFF_task_has_cpu 0x00000860 #define ASIZ_task_has_cpu 0x00000004 -#define AOFF_task_processor 0x000009a4 +#define AOFF_task_processor 0x00000864 #define ASIZ_task_processor 0x00000004 -#define AOFF_task_last_processor 0x000009a8 +#define AOFF_task_last_processor 0x00000868 #define ASIZ_task_last_processor 0x00000004 -#define AOFF_task_lock_depth 0x000009ac +#define AOFF_task_lock_depth 0x0000086c #define ASIZ_task_lock_depth 0x00000004 -#define AOFF_task_sigmask_lock 0x000009b0 +#define AOFF_task_sigmask_lock 0x00000870 #define ASIZ_task_sigmask_lock 0x00000000 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 @@ -216,41 +210,37 @@ #define ASIZ_mm_def_flags 0x00000008 #define AOFF_mm_cpu_vm_mask 0x000000b8 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_thread_float_regs 0x00000000 -#define ASIZ_thread_float_regs 0x00000100 -#define AOFF_thread_fsr 0x00000100 -#define ASIZ_thread_fsr 0x00000008 -#define AOFF_thread_ksp 0x00000108 +#define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 -#define AOFF_thread_kpc 0x00000110 +#define AOFF_thread_kpc 0x00000008 #define ASIZ_thread_kpc 0x00000008 -#define AOFF_thread_wstate 0x00000118 +#define AOFF_thread_wstate 0x00000010 #define ASIZ_thread_wstate 0x00000008 -#define AOFF_thread_cwp 0x00000120 -#define ASIZ_thread_cwp 0x00000008 -#define AOFF_thread_ctx 0x00000128 -#define ASIZ_thread_ctx 0x00000008 -#define AOFF_thread_reg_window 0x00000130 +#define AOFF_thread_cwp 0x00000018 +#define ASIZ_thread_cwp 0x00000004 +#define AOFF_thread_ctx 0x0000001c +#define ASIZ_thread_ctx 0x00000004 +#define AOFF_thread_flags 0x00000020 +#define ASIZ_thread_flags 0x00000004 +#define AOFF_thread_new_signal 0x00000024 +#define ASIZ_thread_new_signal 0x00000004 +#define AOFF_thread_current_ds 0x00000028 +#define ASIZ_thread_current_ds 0x00000008 +#define AOFF_thread_w_saved 0x00000030 +#define ASIZ_thread_w_saved 0x00000008 +#define AOFF_thread_kregs 0x00000038 +#define ASIZ_thread_kregs 0x00000008 +#define AOFF_thread_reg_window 0x00000040 #define ASIZ_thread_reg_window 0x00000400 -#define AOFF_thread_rwbuf_stkptrs 0x00000530 +#define AOFF_thread_rwbuf_stkptrs 0x00000440 #define ASIZ_thread_rwbuf_stkptrs 0x00000040 -#define AOFF_thread_w_saved 0x00000570 -#define ASIZ_thread_w_saved 0x00000008 -#define AOFF_thread_flags 0x00000578 -#define ASIZ_thread_flags 0x00000008 -#define AOFF_thread_sig_address 0x00000580 +#define AOFF_thread_sig_address 0x00000480 #define ASIZ_thread_sig_address 0x00000008 -#define AOFF_thread_sig_desc 0x00000588 +#define AOFF_thread_sig_desc 0x00000488 #define ASIZ_thread_sig_desc 0x00000008 -#define AOFF_thread_sstk_info 0x00000590 +#define AOFF_thread_sstk_info 0x00000490 #define ASIZ_thread_sstk_info 0x00000010 -#define AOFF_thread_current_ds 0x000005a0 -#define ASIZ_thread_current_ds 0x00000004 -#define AOFF_thread_new_signal 0x000005a4 -#define ASIZ_thread_new_signal 0x00000004 -#define AOFF_thread_kregs 0x000005a8 -#define ASIZ_thread_kregs 0x00000008 -#define AOFF_thread_core_exec 0x000005b0 +#define AOFF_thread_core_exec 0x000004a0 #define ASIZ_thread_core_exec 0x00000020 #endif /* __ASM_OFFSETS_H__ */ diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h index ec496fa17..12baf0222 100644 --- a/include/asm-sparc64/atomic.h +++ b/include/asm-sparc64/atomic.h @@ -1,8 +1,8 @@ -/* $Id: atomic.h,v 1.14 1997/04/16 05:57:06 davem Exp $ +/* $Id: atomic.h,v 1.15 1997/07/03 09:18:09 davem Exp $ * atomic.h: Thankfully the V9 is at least reasonable for this * stuff. * - * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) */ #ifndef __ARCH_SPARC64_ATOMIC__ @@ -22,73 +22,63 @@ typedef struct { int counter; } atomic_t; extern __inline__ void atomic_add(int i, atomic_t *v) { - unsigned long temp0, temp1; __asm__ __volatile__(" - lduw [%3], %0 -1: - add %0, %2, %1 - cas [%3], %0, %1 - cmp %0, %1 - bne,a,pn %%icc, 1b - lduw [%3], %0 -2: -" : "=&r" (temp0), "=&r" (temp1) +1: lduw [%1], %%g1 + add %%g1, %0, %%g2 + cas [%1], %%g1, %%g2 + sub %%g1, %%g2, %%g1 + brnz,pn %%g1, 1b + nop" + : /* No outputs */ : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "cc"); + : "g1", "g2"); } extern __inline__ void atomic_sub(int i, atomic_t *v) { - unsigned long temp0, temp1; __asm__ __volatile__(" - lduw [%3], %0 -1: - sub %0, %2, %1 - cas [%3], %0, %1 - cmp %0, %1 - bne,a,pn %%icc, 1b - lduw [%3], %0 -2: -" : "=&r" (temp0), "=&r" (temp1) +1: lduw [%1], %%g1 + sub %%g1, %0, %%g2 + cas [%1], %%g1, %%g2 + sub %%g1, %%g2, %%g1 + brnz,pn %%g1, 1b + nop" + : /* No outputs */ : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "cc"); + : "g1", "g2"); } /* Same as above, but return the result value. */ extern __inline__ int atomic_add_return(int i, atomic_t *v) { - unsigned long temp0, oldval; + unsigned long oldval; __asm__ __volatile__(" - lduw [%3], %0 -1: - add %0, %2, %1 - cas [%3], %0, %1 - cmp %0, %1 - bne,a,pn %%icc, 1b - lduw [%3], %0 -2: -" : "=&r" (temp0), "=&r" (oldval) +1: lduw [%2], %%g1 + add %%g1, %1, %%g2 + cas [%2], %%g1, %%g2 + sub %%g1, %%g2, %%g1 + brnz,pn %%g1, 1b + add %%g2, %1, %0" + : "=&r" (oldval) : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "cc"); - return (((int)oldval) + 1); + : "g1", "g2"); + return (int)oldval; } extern __inline__ int atomic_sub_return(int i, atomic_t *v) { - unsigned long temp0, oldval; + unsigned long oldval; __asm__ __volatile__(" - lduw [%3], %0 -1: - sub %0, %2, %1 - cas [%3], %0, %1 - cmp %0, %1 - bne,a,pn %%icc, 1b - lduw [%3], %0 -2: -" : "=&r" (temp0), "=&r" (oldval) +1: lduw [%2], %%g1 + sub %%g1, %1, %%g2 + cas [%2], %%g1, %%g2 + sub %%g1, %%g2, %%g1 + brnz,pn %%g1, 1b + sub %%g2, %1, %0" + : "=&r" (oldval) : "HIr" (i), "r" (__atomic_fool_gcc(v)) - : "cc"); - return (((int)oldval) - 1); + : "g1", "g2"); + return (int)oldval; } #define atomic_dec_return(v) atomic_sub_return(1,(v)) diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h index 5060d88ae..f0d11e6ef 100644 --- a/include/asm-sparc64/bitops.h +++ b/include/asm-sparc64/bitops.h @@ -1,4 +1,4 @@ -/* $Id: bitops.h,v 1.16 1997/05/28 13:48:56 jj Exp $ +/* $Id: bitops.h,v 1.19 1997/07/08 10:17:37 davem Exp $ * bitops.h: Bit string operations on the V9. * * Copyright 1996 David S. Miller (davem@caip.rutgers.edu) @@ -23,21 +23,21 @@ extern __inline__ unsigned long test_and_set_bit(unsigned long nr, void *addr) { unsigned long oldbit; unsigned long temp0, temp1; - unsigned int * m = ((unsigned int *) addr) + (nr >> 5); + unsigned long * m = ((unsigned long *) addr) + (nr >> 6); __asm__ __volatile__(" - lduw [%4], %0 + ldx [%4], %0 1: andcc %0, %3, %2 - bne,pn %%icc, 2f + bne,pn %%xcc, 2f xor %0, %3, %1 - cas [%4], %0, %1 + casx [%4], %0, %1 cmp %0, %1 - bne,a,pn %%icc, 1b - lduw [%4], %0 + bne,a,pn %%xcc, 1b + ldx [%4], %0 2: " : "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit) - : "HIr" (1UL << (nr & 31)), "r" (m) + : "HIr" (1UL << (nr & 63)), "r" (m) : "cc"); return oldbit != 0; } @@ -51,21 +51,21 @@ extern __inline__ unsigned long test_and_clear_bit(unsigned long nr, void *addr) { unsigned long oldbit; unsigned long temp0, temp1; - unsigned int * m = ((unsigned int *) addr) + (nr >> 5); + unsigned long * m = ((unsigned long *) addr) + (nr >> 6); __asm__ __volatile__(" - lduw [%4], %0 + ldx [%4], %0 1: andcc %0, %3, %2 - be,pn %%icc, 2f + be,pn %%xcc, 2f xor %0, %3, %1 - cas [%4], %0, %1 + casx [%4], %0, %1 cmp %0, %1 - bne,a,pn %%icc, 1b - lduw [%4], %0 + bne,a,pn %%xcc, 1b + ldx [%4], %0 2: " : "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit) - : "HIr" (1UL << (nr & 31)), "r" (m) + : "HIr" (1UL << (nr & 63)), "r" (m) : "cc"); return oldbit != 0; } @@ -79,19 +79,19 @@ extern __inline__ unsigned long test_and_change_bit(unsigned long nr, void *addr { unsigned long oldbit; unsigned long temp0, temp1; - unsigned int * m = ((unsigned int *) addr) + (nr >> 5); + unsigned long * m = ((unsigned long *) addr) + (nr >> 6); __asm__ __volatile__(" - lduw [%4], %0 + ldx [%4], %0 1: and %0, %3, %2 xor %0, %3, %1 - cas [%4], %0, %1 + casx [%4], %0, %1 cmp %0, %1 - bne,a,pn %%icc, 1b - lduw [%4], %0 + bne,a,pn %%xcc, 1b + ldx [%4], %0 " : "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit) - : "HIr" (1UL << (nr & 31)), "r" (m) + : "HIr" (1UL << (nr & 63)), "r" (m) : "cc"); return oldbit != 0; } @@ -103,7 +103,7 @@ extern __inline__ void change_bit(unsigned long nr, void *addr) extern __inline__ unsigned long test_bit(int nr, __const__ void *addr) { - return 1UL & (((__const__ int *) addr)[nr >> 5] >> (nr & 31)); + return 1UL & (((__const__ long *) addr)[nr >> 6] >> (nr & 63)); } /* The easy/cheese version for now. */ @@ -121,7 +121,7 @@ extern __inline__ unsigned long ffz(unsigned long word) : "0" (word) : "g1", "g2"); #else -#ifdef EASY_CHEESE_VERSION +#if 1 /* def EASY_CHEESE_VERSION */ result = 0; while(word & 1) { result++; @@ -177,13 +177,11 @@ extern __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long siz size -= 64; result += 64; } - offset = size >> 6; - size &= 63UL; - while (offset) { + while (size & ~63UL) { if (~(tmp = *(p++))) goto found_middle; result += 64; - offset--; + size -= 64; } if (!size) return result; @@ -260,22 +258,12 @@ extern __inline__ int test_le_bit(int nr, __const__ void * addr) #define find_first_zero_le_bit(addr, size) \ find_next_zero_le_bit((addr), (size), 0) -extern __inline__ unsigned long __swab64(unsigned long value) -{ - return (((value>>56) & 0x00000000000000ff) | - ((value>>40) & 0x000000000000ff00) | - ((value>>24) & 0x0000000000ff0000) | - ((value>>8) & 0x00000000ff000000) | - ((value<<8) & 0x000000ff00000000) | - ((value<<24) & 0x0000ff0000000000) | - ((value<<40) & 0x00ff000000000000) | - ((value<<56) & 0xff00000000000000)); -} - extern __inline__ unsigned long __swab64p(unsigned long *addr) { unsigned long ret; - __asm__ __volatile__ ("ldxa [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL)); + __asm__ __volatile__ ("ldxa [%1] %2, %0" + : "=r" (ret) + : "r" (addr), "i" (ASI_PL)); return ret; } @@ -299,13 +287,11 @@ extern __inline__ unsigned long find_next_zero_le_bit(void *addr, unsigned long size -= 64; result += 64; } - offset = size >> 6; - size &= 63UL; - while(offset) { + while(size & ~63) { if(~(tmp = __swab64p(p++))) goto found_middle; result += 64; - offset--; + size -= 64; } if(!size) return result; diff --git a/include/asm-sparc64/byteorder.h b/include/asm-sparc64/byteorder.h index 2325ef29c..dce2db246 100644 --- a/include/asm-sparc64/byteorder.h +++ b/include/asm-sparc64/byteorder.h @@ -1,4 +1,4 @@ -/* $Id: byteorder.h,v 1.5 1997/05/28 11:35:41 jj Exp $ */ +/* $Id: byteorder.h,v 1.6 1997/06/14 17:35:07 davem Exp $ */ #ifndef _SPARC64_BYTEORDER_H #define _SPARC64_BYTEORDER_H @@ -56,21 +56,27 @@ extern __inline__ __u64 cpu_to_le64(__u64 value) extern __inline__ __u16 cpu_to_le16p(__u16 *addr) { __u16 ret; - __asm__ __volatile__ ("lduha [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL)); + __asm__ __volatile__ ("lduha [%1] %2, %0" + : "=r" (ret) + : "r" (addr), "i" (ASI_PL)); return ret; } extern __inline__ __u32 cpu_to_le32p(__u32 *addr) { __u32 ret; - __asm__ __volatile__ ("lduwa [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL)); + __asm__ __volatile__ ("lduwa [%1] %2, %0" + : "=r" (ret) + : "r" (addr), "i" (ASI_PL)); return ret; } extern __inline__ __u64 cpu_to_le64p(__u64 *addr) { __u64 ret; - __asm__ __volatile__ ("ldxa [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL)); + __asm__ __volatile__ ("ldxa [%1] %2, %0" + : "=r" (ret) + : "r" (addr), "i" (ASI_PL)); return ret; } extern __inline__ __u16 cpu_to_be16p(__u16 *addr) { return *addr; } diff --git a/include/asm-sparc64/checksum.h b/include/asm-sparc64/checksum.h index d04abac7e..b1ff474c3 100644 --- a/include/asm-sparc64/checksum.h +++ b/include/asm-sparc64/checksum.h @@ -1,4 +1,4 @@ -/* $Id: checksum.h,v 1.8 1997/05/29 12:45:03 jj Exp $ */ +/* $Id: checksum.h,v 1.9 1997/06/26 04:05:17 davem Exp $ */ #ifndef __SPARC64_CHECKSUM_H #define __SPARC64_CHECKSUM_H @@ -108,31 +108,30 @@ extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph, * both operands. */ __asm__ __volatile__(" - sub %2, 4, %%g7 - lduw [%1 + 0x00], %0 - lduw [%1 + 0x04], %%g2 - lduw [%1 + 0x08], %%g3 - addcc %%g2, %0, %0 - addccc %%g3, %0, %0 - lduw [%1 + 0x0c], %%g2 - lduw [%1 + 0x10], %%g3 - addccc %%g2, %0, %0 - addc %0, %%g0, %0 -1: - addcc %%g3, %0, %0 - add %1, 4, %1 - addccc %0, %%g0, %0 - subcc %%g7, 1, %%g7 - be,a,pt %%icc, 2f - sll %0, 16, %%g2 - ba,pt %%xcc, 1b - lduw [%1 + 0x10], %%g3 -2: - addcc %0, %%g2, %%g2 - srl %%g2, 16, %0 - addc %0, %%g0, %0 - xnor %%g0, %0, %0 - srl %0, 0, %0 + sub %2, 4, %%g7 ! IEU0 + lduw [%1 + 0x00], %0 ! Load Group + lduw [%1 + 0x04], %%g2 ! Load Group + lduw [%1 + 0x08], %%g3 ! Load Group + addcc %%g2, %0, %0 ! IEU1 1 Load Bubble + Group + lduw [%1 + 0x0c], %%g2 ! Load + addccc %%g3, %0, %0 ! Sngle Group no Bubble + lduw [%1 + 0x10], %%g3 ! Load Group + addccc %%g2, %0, %0 ! Sngle Group no Bubble + addc %0, %%g0, %0 ! Sngle Group +1: addcc %%g3, %0, %0 ! IEU1 Group no Bubble + add %1, 4, %1 ! IEU0 + addccc %0, %%g0, %0 ! Sngle Group no Bubble + subcc %%g7, 1, %%g7 ! IEU1 Group + be,a,pt %%icc, 2f ! CTI + sll %0, 16, %%g2 ! IEU0 + lduw [%1 + 0x10], %%g3 ! Load Group + ba,pt %%xcc, 1b ! CTI + nop ! IEU0 +2: addcc %0, %%g2, %%g2 ! IEU1 Group + srl %%g2, 16, %0 ! IEU0 Group regdep XXX Scheisse! + addc %0, %%g0, %0 ! Sngle Group + xnor %%g0, %0, %0 ! IEU0 Group + srl %0, 0, %0 ! IEU0 Group XXX Scheisse! " : "=r" (sum), "=&r" (iph) : "r" (ihl), "1" (iph) : "g2", "g3", "g7", "cc"); diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h index 7923b5014..f70d99b68 100644 --- a/include/asm-sparc64/delay.h +++ b/include/asm-sparc64/delay.h @@ -1,4 +1,4 @@ -/* $Id: delay.h,v 1.4 1997/04/10 23:32:44 davem Exp $ +/* $Id: delay.h,v 1.5 1997/06/18 12:36:23 jj Exp $ * delay.h: Linux delay routines on the V9. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu). @@ -12,7 +12,9 @@ extern unsigned long loops_per_sec; extern __inline__ void __delay(unsigned long loops) { __asm__ __volatile__(" - cmp %0, 0 + b,pt %%xcc, 1f + cmp %0, 0 + .align 32 1: bne,pt %%xcc, 1b subcc %0, 1, %0 diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h index 9a43b6c3f..1cef89ff1 100644 --- a/include/asm-sparc64/elf.h +++ b/include/asm-sparc64/elf.h @@ -1,4 +1,4 @@ -/* $Id: elf.h,v 1.6 1997/05/17 11:51:27 davem Exp $ */ +/* $Id: elf.h,v 1.7 1997/06/14 21:28:07 davem Exp $ */ #ifndef __ASM_SPARC64_ELF_H #define __ASM_SPARC64_ELF_H @@ -32,7 +32,9 @@ typedef unsigned long elf_fpregset_t; /* * This is used to ensure we don't load something for the wrong architecture. */ +#ifndef elf_check_arch #define elf_check_arch(x) ((x) == ELF_ARCH) /* Might be EM_SPARC64 or EM_SPARC */ +#endif #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 8192 diff --git a/include/asm-sparc64/fbio.h b/include/asm-sparc64/fbio.h index 3d8713468..6d2f1e730 100644 --- a/include/asm-sparc64/fbio.h +++ b/include/asm-sparc64/fbio.h @@ -48,10 +48,6 @@ struct fbtype { }; #define FBIOGTYPE _IOR('F', 0, struct fbtype) -/* Used by FBIOPUTCMAP - * - * XXX 32-bit binary compatability item... -DaveM - */ struct fbcmap { int index; /* first element (0 origin) */ int count; @@ -104,7 +100,6 @@ struct fbcurpos { #define FB_CUR_SETSHAPE 0x10 /* set shape */ #define FB_CUR_SETALL 0x1F /* all of the above */ -/* XXX 32-bit binary compatability item... -DaveM */ struct fbcursor { short set; /* what to set, choose from the list above */ short enable; /* cursor on/off */ @@ -143,7 +138,6 @@ struct fb_wid_item { __u32 wi_attrs; __u32 wi_values[32]; }; -/* XXX 32-bit binary compatability item... -DaveM */ struct fb_wid_list { __u32 wl_flags; __u32 wl_count; @@ -155,6 +149,21 @@ struct fb_wid_list { #define FBIO_WID_PUT _IOW('F', 32, struct fb_wid_list) #define FBIO_WID_GET _IOWR('F', 33, struct fb_wid_list) +/* Creator ioctls */ +#define FFB_IOCTL ('F'<<8) +#define FFB_SYS_INFO (FFB_IOCTL|80) +#define FFB_CLUTREAD (FFB_IOCTL|81) +#define FFB_CLUTPOST (FFB_IOCTL|82) +#define FFB_SETDIAGMODE (FFB_IOCTL|83) +#define FFB_GETMONITORID (FFB_IOCTL|84) +#define FFB_GETVIDEOMODE (FFB_IOCTL|85) +#define FFB_SETVIDEOMODE (FFB_IOCTL|86) +#define FFB_SETSERVER (FFB_IOCTL|87) +#define FFB_SETOVCTL (FFB_IOCTL|88) +#define FFB_GETOVCTL (FFB_IOCTL|89) +#define FFB_GETSAXNUM (FFB_IOCTL|90) +#define FFB_FBDEBUG (FFB_IOCTL|91) + /* Cg14 ioctls */ #define MDI_IOCTL ('M'<<8) #define MDI_RESET (MDI_IOCTL|1) @@ -179,16 +188,15 @@ struct mdi_cfginfo { */ #define MDI_CLEAR_XLUT (MDI_IOCTL|9) -/* leo ioctls */ -struct leo_clut_alloc { +/* leo & ffb ioctls */ +struct fb_clut_alloc { __u32 clutid; /* Set on return */ __u32 flag; __u32 index; }; -/* XXX 32-bit binary compatability item... -DaveM */ -struct leo_clut { -#define LEO_CLUT_WAIT 0x00000001 /* Not yet implemented */ +struct fb_clut { +#define FB_CLUT_WAIT 0x00000001 /* Not yet implemented */ __u32 flag; __u32 clutid; __u32 offset; @@ -197,10 +205,21 @@ struct leo_clut { char * green; char * blue; }; -#define LEO_CLUTALLOC _IOWR('L', 53, struct leo_clut_alloc) -#define LEO_CLUTFREE _IOW('L', 54, struct leo_clut_alloc) -#define LEO_CLUTREAD _IOW('L', 55, struct leo_clut) -#define LEO_CLUTPOST _IOW('L', 56, struct leo_clut) + +struct fb_clut32 { + __u32 flag; + __u32 clutid; + __u32 offset; + __u32 count; + __u32 red; + __u32 green; + __u32 blue; +}; + +#define LEO_CLUTALLOC _IOWR('L', 53, struct fb_clut_alloc) +#define LEO_CLUTFREE _IOW('L', 54, struct fb_clut_alloc) +#define LEO_CLUTREAD _IOW('L', 55, struct fb_clut) +#define LEO_CLUTPOST _IOW('L', 56, struct fb_clut) #define LEO_SETGAMMA _IOW('L', 68, int) /* Not yet implemented */ #define LEO_GETGAMMA _IOR('L', 69, int) /* Not yet implemented */ diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index c7aa7cc81..bbef85483 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -1,4 +1,4 @@ -/* $Id: floppy.h,v 1.2 1997/03/14 21:05:25 jj Exp $ +/* $Id: floppy.h,v 1.3 1997/07/11 03:03:22 davem Exp $ * asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -315,7 +315,7 @@ static int sun_floppy_init(void) /* printk("DOR @0x%p\n", &sun_fdc->dor_82077); */ /* P3 */ /* Success... */ - return (int) sun_fdc; + return (int) ((unsigned long)sun_fdc); } static int sparc_eject(void) diff --git a/include/asm-sparc64/fpumacro.h b/include/asm-sparc64/fpumacro.h index f6323254d..dab134472 100644 --- a/include/asm-sparc64/fpumacro.h +++ b/include/asm-sparc64/fpumacro.h @@ -21,68 +21,44 @@ extern __inline__ void fprs_write(unsigned long val) __asm__ __volatile__("wr %0, 0x0, %%fprs" : : "r" (val)); } -extern __inline__ void fpsave32(unsigned int *fpregs, unsigned long *fsr) +extern __inline__ void fpsave(unsigned long *fpregs, + unsigned long *fsr, + unsigned long *gsr) { __asm__ __volatile__ (" - wr %%g0, %2, %%asi - stx %%fsr, [%1] - stda %%f0, [%0] %%asi - stda %%f16, [%0 + 64] %%asi - " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P)); -} - -extern __inline__ void fpload32(unsigned int *fpregs, unsigned long *fsr) -{ - __asm__ __volatile__ (" - wr %%g0, %2, %%asi - ldda [%0] %%asi, %%f0 - ldda [%0 + 64] %%asi, %%f16 - ldx [%1], %%fsr - " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P)); -} - -extern __inline__ void fpsave64hi(unsigned int *fpregs, unsigned long *fsr) -{ - __asm__ __volatile__ (" - wr %%g0, %2, %%asi - stx %%fsr, [%1] - stda %%f32, [%0 + 128] %%asi - stda %%f48, [%0 + 192] %%asi - " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P)); -} - -extern __inline__ void fpload64hi(unsigned int *fpregs, unsigned long *fsr) -{ - __asm__ __volatile__ (" - wr %%g0, %2, %%asi - ldda [%0 + 128] %%asi, %%f32 - ldda [%0 + 192] %%asi, %%f48 - ldx [%1], %%fsr - " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P)); -} - -extern __inline__ void fpsave(unsigned int *fpregs, unsigned long *fsr) -{ - __asm__ __volatile__ (" - wr %%g0, %2, %%asi + wr %%g0, %3, %%asi + rd %%gsr, %%g1 + membar #LoadStore | #StoreStore stx %%fsr, [%1] + stx %%g1, [%2] stda %%f0, [%0] %%asi stda %%f16, [%0 + 64] %%asi stda %%f32, [%0 + 128] %%asi stda %%f48, [%0 + 192] %%asi - " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P)); + membar #Sync +" : /* No outputs */ + : "r" (fpregs), "r" (fsr), "r" (gsr), "i" (ASI_BLK_P) + : "g1"); } -extern __inline__ void fpload(unsigned int *fpregs, unsigned long *fsr) +extern __inline__ void fpload(unsigned long *fpregs, + unsigned long *fsr, + unsigned long *gsr) { __asm__ __volatile__ (" - wr %%g0, %2, %%asi + wr %%g0, %3, %%asi + membar #StoreLoad | #LoadLoad ldda [%0] %%asi, %%f0 ldda [%0 + 64] %%asi, %%f16 ldda [%0 + 128] %%asi, %%f32 ldda [%0 + 192] %%asi, %%f48 ldx [%1], %%fsr - " : : "r" (fpregs), "r" (fsr), "i" (ASI_BLK_P)); + ldx [%2], %%g1 + wr %%g1, 0, %%gsr + membar #Sync +" : /* No outputs */ + : "r" (fpregs), "r" (fsr), "r" (gsr), "i" (ASI_BLK_P) + : "g1"); } #endif /* !(_SPARC64_FPUMACRO_H) */ diff --git a/include/asm-sparc64/fs_mount.h b/include/asm-sparc64/fs_mount.h deleted file mode 100644 index 3ad7ad698..000000000 --- a/include/asm-sparc64/fs_mount.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id: fs_mount.h,v 1.2 1997/04/18 14:34:46 jj Exp $ - * fs_mount.h: Definitions for mount structure conversions. - * - * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) - */ - -#ifndef __ASM_FS_MOUNT_H -#define __ASM_FS_MOUNT_H - -#if defined(CONFIG_SPARC32_COMPAT) || defined(CONFIG_SPARC32_COMPAT_MODULE) - -#include <linux/sched.h> - -/* We need this to convert 32bit mount structures to 64bit */ - -extern void *do_ncp_super_data_conv(void *raw_data); -extern void *do_smb_super_data_conv(void *raw_data); - -extern __inline__ void *ncp_super_data_conv(void *raw_data) -{ - if (current->tss.flags & SPARC_FLAG_32BIT) - return do_ncp_super_data_conv(raw_data); - else - return raw_data; -} - -extern __inline__ void *smb_super_data_conv(void *raw_data) -{ - if (current->tss.flags & SPARC_FLAG_32BIT) - return do_smb_super_data_conv(raw_data); - else - return raw_data; -} - -#else /* CONFIG_SPARC32_COMPAT* */ - -#define ncp_super_data_conv(__x) __x -#define smb_super_data_conv(__x) __x - -#endif /* CONFIG_SPARC32_COMPAT* */ - -#define nfs_super_data_conv(__x) __x - -#endif /* __ASM_FS_MOUNT_H */ diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h index 4680a4095..03ee543b1 100644 --- a/include/asm-sparc64/hardirq.h +++ b/include/asm-sparc64/hardirq.h @@ -13,8 +13,8 @@ extern unsigned int local_irq_count[NR_CPUS]; #ifndef __SMP__ -#define hardirq_trylock(cpu) (++local_irq_count[cpu], (cpu)==0) -#define hardirq_endlock(cpu) (--local_irq_count[cpu]) +#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) +#define hardirq_endlock(cpu) do { } while(0) #define hardirq_enter(cpu) (local_irq_count[cpu]++) #define hardirq_exit(cpu) (local_irq_count[cpu]--) diff --git a/include/asm-sparc64/head.h b/include/asm-sparc64/head.h index 62fe9a08f..e3ff51686 100644 --- a/include/asm-sparc64/head.h +++ b/include/asm-sparc64/head.h @@ -1,10 +1,10 @@ -/* $Id: head.h,v 1.22 1997/06/02 06:33:40 davem Exp $ */ +/* $Id: head.h,v 1.27 1997/07/13 17:30:43 davem Exp $ */ #ifndef _SPARC64_HEAD_H #define _SPARC64_HEAD_H #include <asm/pstate.h> -#define KERNBASE 0xFFFFF80000000000 +#define KERNBASE 0x400000 #define BOOT_KERNEL b sparc64_boot; nop; nop; nop; nop; nop; nop; nop; /* We need a "cleaned" instruction... */ @@ -43,17 +43,6 @@ nop; \ nop; -/* Just for testing */ -#define PROM_TRAP \ - rd %pc, %g1; \ - sethi %uhi(KERNBASE), %g4; \ - sethi %hi(0xf0000000-0x8000), %g2; \ - sllx %g4, 32, %g4; \ - add %g1, %g2, %g1; \ - sub %g1, %g4, %g1; \ - jmpl %g1 + %g0, %g0; \ - nop; - #define TRAP_ARG(routine, arg) \ ba,pt %xcc, etrap; \ rd %pc, %g7; \ @@ -105,12 +94,12 @@ #define SUNOS_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sunos_sys_table) #define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table32) #define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64) +#define GETCC_TRAP TRAP(getcc) +#define SETCC_TRAP TRAP(setcc) /* FIXME: Write these actually */ #define NETBSD_SYSCALL_TRAP TRAP(netbsd_syscall) #define SOLARIS_SYSCALL_TRAP TRAP(solaris_syscall) #define BREAKPOINT_TRAP TRAP(breakpoint_trap) -#define GETCC_TRAP TRAP(getcc) -#define SETCC_TRAP TRAP(setcc) #define INDIRECT_SOLARIS_SYSCALL(tlvl) TRAP_ARG(indirect_syscall, tlvl) #define TRAP_IRQ(routine, level) \ @@ -126,7 +115,7 @@ /* On UP this is ok, and worth the effort, for SMP we need * a different mechanism and thus cannot do it all in trap table. -DaveM */ -#if 0 /* ndef __SMP__ */ +#ifndef __SMP__ #define TRAP_IVEC \ ldxa [%g2] ASI_UDB_INTR_R, %g3; \ and %g3, 0x7ff, %g3; \ @@ -207,16 +196,23 @@ #define SPILL_2_GENERIC(xxx) \ wr %g0, xxx, %asi; \ srl %sp, 0, %sp; \ - stda %l0, [%sp + 0x00] %asi; \ - stda %l2, [%sp + 0x08] %asi; \ - stda %l4, [%sp + 0x10] %asi; \ - stda %l6, [%sp + 0x18] %asi; \ - stda %i0, [%sp + 0x20] %asi; \ - stda %i2, [%sp + 0x28] %asi; \ - stda %i4, [%sp + 0x30] %asi; \ - stda %i6, [%sp + 0x38] %asi; \ + stwa %l0, [%sp + 0x00] %asi; \ + stwa %l1, [%sp + 0x04] %asi; \ + stwa %l2, [%sp + 0x08] %asi; \ + stwa %l3, [%sp + 0x0c] %asi; \ + stwa %l4, [%sp + 0x10] %asi; \ + stwa %l5, [%sp + 0x14] %asi; \ + stwa %l6, [%sp + 0x18] %asi; \ + stwa %l7, [%sp + 0x1c] %asi; \ + stwa %i0, [%sp + 0x20] %asi; \ + stwa %i1, [%sp + 0x24] %asi; \ + stwa %i2, [%sp + 0x28] %asi; \ + stwa %i3, [%sp + 0x2c] %asi; \ + stwa %i4, [%sp + 0x30] %asi; \ + stwa %i5, [%sp + 0x34] %asi; \ + stwa %i6, [%sp + 0x38] %asi; \ + stwa %i7, [%sp + 0x3c] %asi; \ saved; retry; nop; nop; nop; nop; \ - nop; nop; nop; nop; nop; nop; nop; nop; \ nop; nop; nop; nop; nop; nop; \ b,a,pt %xcc, spill_fixup_mna; \ b,a,pt %xcc, spill_fixup; @@ -287,16 +283,23 @@ #define FILL_2_GENERIC(xxx) \ wr %g0, xxx, %asi; \ srl %sp, 0, %sp; \ - ldda [%sp + 0x00] %asi, %l0; \ - ldda [%sp + 0x08] %asi, %l2; \ - ldda [%sp + 0x10] %asi, %l4; \ - ldda [%sp + 0x18] %asi, %l6; \ - ldda [%sp + 0x20] %asi, %i0; \ - ldda [%sp + 0x28] %asi, %i2; \ - ldda [%sp + 0x30] %asi, %i4; \ - ldda [%sp + 0x38] %asi, %i6; \ + lduwa [%sp + 0x00] %asi, %l0; \ + lduwa [%sp + 0x04] %asi, %l1; \ + lduwa [%sp + 0x08] %asi, %l2; \ + lduwa [%sp + 0x0c] %asi, %l3; \ + lduwa [%sp + 0x10] %asi, %l4; \ + lduwa [%sp + 0x14] %asi, %l5; \ + lduwa [%sp + 0x18] %asi, %l6; \ + lduwa [%sp + 0x1c] %asi, %l7; \ + lduwa [%sp + 0x20] %asi, %i0; \ + lduwa [%sp + 0x24] %asi, %i1; \ + lduwa [%sp + 0x28] %asi, %i2; \ + lduwa [%sp + 0x2c] %asi, %i3; \ + lduwa [%sp + 0x30] %asi, %i4; \ + lduwa [%sp + 0x34] %asi, %i5; \ + lduwa [%sp + 0x38] %asi, %i6; \ + lduwa [%sp + 0x3c] %asi, %i7; \ restored; retry; nop; nop; nop; nop; \ - nop; nop; nop; nop; nop; nop; nop; nop; \ nop; nop; nop; nop; nop; nop; \ b,a,pt %xcc, fill_fixup_mna; \ b,a,pt %xcc, fill_fixup; diff --git a/include/asm-sparc64/ioctls.h b/include/asm-sparc64/ioctls.h index 0432cb46f..1d6c1cace 100644 --- a/include/asm-sparc64/ioctls.h +++ b/include/asm-sparc64/ioctls.h @@ -1,14 +1,9 @@ -/* $Id: ioctls.h,v 1.2 1997/04/04 00:50:18 davem Exp $ */ +/* $Id: ioctls.h,v 1.4 1997/06/23 07:26:03 davem Exp $ */ #ifndef _ASM_SPARC64_IOCTLS_H #define _ASM_SPARC64_IOCTLS_H #include <asm/ioctl.h> -/* XXX 32-bit binary compatability issues, I am sure that - * XXX only IOCTL's which reference structures will be of - * XXX concern and these are easily fabricated using wrappers. - */ - /* Big T */ #define TCGETA _IOR('T', 1, struct termio) #define TCSETA _IOW('T', 2, struct termio) @@ -24,7 +19,7 @@ /* Note that all the ioctls that are not available in Linux have a * double underscore on the front to: a) avoid some programs to - * thing we support some ioctls under Linux (autoconfiguration stuff) + * think we support some ioctls under Linux (autoconfiguration stuff) */ /* Little t */ #define TIOCGETD _IOR('t', 0, int) @@ -69,8 +64,8 @@ /* 119 is the non-posix getpgrp tty ioctl */ #define __TIOCCDTR _IO('t', 120) /* SunOS Specific */ #define __TIOCSDTR _IO('t', 121) /* SunOS Specific */ -#define __TIOCCBRK _IO('t', 122) /* SunOS Specific */ -#define __TIOCSBRK _IO('t', 123) /* SunOS Specific */ +#define TIOCCBRK _IO('t', 122) +#define TIOCSBRK _IO('t', 123) #define __TIOCLGET _IOW('t', 124, int) /* SunOS Specific */ #define __TIOCLSET _IOW('t', 125, int) /* SunOS Specific */ #define __TIOCLBIC _IOW('t', 126, int) /* SunOS Specific */ diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index 9a5b10458..7e7aa0433 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h @@ -1,4 +1,4 @@ -/* $Id: mmu_context.h,v 1.10 1997/05/23 09:35:55 jj Exp $ */ +/* $Id: mmu_context.h,v 1.17 1997/07/13 19:13:39 davem Exp $ */ #ifndef __SPARC64_MMU_CONTEXT_H #define __SPARC64_MMU_CONTEXT_H @@ -11,11 +11,6 @@ #ifndef __ASSEMBLY__ -/* Initialize the context related info for a new mm_struct - * instance. - */ -#define init_new_context(mm) ((mm)->context = NO_CONTEXT) - #define destroy_context(mm) do { } while(0) extern unsigned long tlb_context_cache; @@ -24,61 +19,41 @@ extern unsigned long tlb_context_cache; #define CTX_VERSION_MASK ((~0UL) << CTX_VERSION_SHIFT) #define CTX_FIRST_VERSION ((1UL << CTX_VERSION_SHIFT) + 1UL) -extern __inline__ void get_new_mmu_context(struct mm_struct *mm, - unsigned long ctx) -{ - if((ctx & ~(CTX_VERSION_MASK)) == 0) { - unsigned long flags; - int entry; - - save_and_cli(flags); - __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" - "stxa %%g0, [%0] %2" - : /* No outputs */ - : "r" (TLB_TAG_ACCESS), "i" (ASI_IMMU), - "i" (ASI_DMMU)); - for(entry = 0; entry < 62; entry++) { - spitfire_put_dtlb_data(entry, 0x0UL); - spitfire_put_itlb_data(entry, 0x0UL); - } - membar("#Sync"); - flushi(PAGE_OFFSET); - restore_flags(flags); +extern void get_new_mmu_context(struct mm_struct *mm, unsigned long ctx); - ctx = (ctx & CTX_VERSION_MASK) + CTX_FIRST_VERSION; - if(!ctx) - ctx = CTX_FIRST_VERSION; - } - tlb_context_cache = ctx + 1; - mm->context = ctx; -} +/* Initialize the context related info for a new mm_struct + * instance. + */ +#define init_new_context(mm) get_new_mmu_context((mm), tlb_context_cache) extern __inline__ void get_mmu_context(struct task_struct *tsk) { + register unsigned long paddr asm("o5"); struct mm_struct *mm = tsk->mm; - if(mm && - !(tsk->tss.flags & SPARC_FLAG_KTHREAD) && + flushw_user(); + if(!(tsk->tss.flags & SPARC_FLAG_KTHREAD) && !(tsk->flags & PF_EXITING)) { unsigned long ctx = tlb_context_cache; - register unsigned long paddr asm("o5"); - - flushw_user(); if((mm->context ^ ctx) & CTX_VERSION_MASK) get_new_mmu_context(mm, ctx); - tsk->tss.ctx = (mm->context & 0x1fff); - spitfire_set_secondary_context(tsk->tss.current_ds ? - mm->context : 0); - paddr = __pa(mm->pgd); - __asm__ __volatile__(" - rdpr %%pstate, %%o4 - wrpr %%o4, %1, %%pstate - mov %0, %%g7 - wrpr %%o4, 0x0, %%pstate - " : /* no outputs */ - : "r" (paddr), "i" (PSTATE_MG|PSTATE_IE) - : "o4"); - } + + /* Don't worry, set_fs() will restore it... */ + tsk->tss.ctx = (tsk->tss.current_ds ? + (mm->context & 0x1fff) : 0); + } else + tsk->tss.ctx = 0; + spitfire_set_secondary_context(tsk->tss.ctx); + __asm__ __volatile__("flush %g6"); + paddr = __pa(mm->pgd); + __asm__ __volatile__(" + rdpr %%pstate, %%o4 + wrpr %%o4, %1, %%pstate + mov %0, %%g7 + wrpr %%o4, 0x0, %%pstate + " : /* no outputs */ + : "r" (paddr), "i" (PSTATE_MG|PSTATE_IE) + : "o4"); } #endif /* !(__ASSEMBLY__) */ diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h index af5afb721..e80c11979 100644 --- a/include/asm-sparc64/namei.h +++ b/include/asm-sparc64/namei.h @@ -1,4 +1,4 @@ -/* $Id: namei.h,v 1.4 1997/06/07 08:32:56 ecd Exp $ +/* $Id: namei.h,v 1.5 1997/07/17 02:24:28 davem Exp $ * linux/include/asm-sparc64/namei.h * * Routines to handle famous /usr/gnemul/s*. @@ -11,6 +11,7 @@ #define SPARC_BSD_EMUL "usr/gnemul/sunos/" #define SPARC_SOL_EMUL "usr/gnemul/solaris/" +#if 0 /* XXX FIXME */ extern int __namei(int, const char *, struct inode *, char *, struct inode **, struct inode **, struct qstr *, struct dentry **, int *); @@ -44,4 +45,6 @@ __prefix_namei(int retrieve_mode, const char * name, struct inode * base, return 0; } +#endif /* XXX FIXME */ + #endif /* __SPARC64_NAMEI_H */ diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 71679e351..d39d3d494 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.8 1997/03/26 12:24:21 davem Exp $ */ +/* $Id: page.h,v 1.14 1997/06/26 22:32:03 davem Exp $ */ #ifndef _SPARC64_PAGE_H #define _SPARC64_PAGE_H @@ -18,10 +18,15 @@ #ifndef __ASSEMBLY__ -#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) -#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) -#define STRICT_MM_TYPECHECKS +extern void copy_page(unsigned long to, unsigned long from); + +/* GROSS, defining this makes gcc pass these types as aggregates, + * and thus on the stack, turn this crap off... -DaveM + */ + +/* #define STRICT_MM_TYPECHECKS */ #ifdef STRICT_MM_TYPECHECKS /* These are used to make use of C type-checking.. */ @@ -89,7 +94,9 @@ typedef unsigned long iopgprot_t; #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) #ifndef __ASSEMBLY__ -#define PAGE_OFFSET 0xFFFFF80000000000UL +/* Do prdele, look what happens to be in %g4... */ +register unsigned long page_offset asm("g4"); +#define PAGE_OFFSET page_offset #else #define PAGE_OFFSET 0xFFFFF80000000000 #endif diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index e56a4024d..5cbd9a3c5 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.34 1997/06/02 06:33:41 davem Exp $ +/* $Id: pgtable.h,v 1.49 1997/06/30 09:24:12 jj Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -51,7 +51,7 @@ #define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3)) /* NOTE: TLB miss handlers depend heavily upon where this is. */ -#define VMALLOC_START 0xFFFFFc0000000000UL +#define VMALLOC_START 0x0000000800000000UL #define VMALLOC_VMADDR(x) ((unsigned long)(x)) #endif /* !(__ASSEMBLY__) */ @@ -78,18 +78,17 @@ #define _PAGE_G 0x0000000000000001 /* Global */ /* Here are the SpitFire software bits we use in the TTE's. */ -#define _PAGE_PRESENT 0x0000000000001000 /* Present Page (ie. not swapped out) */ #define _PAGE_MODIFIED 0x0000000000000800 /* Modified Page (ie. dirty) */ #define _PAGE_ACCESSED 0x0000000000000400 /* Accessed Page (ie. referenced) */ #define _PAGE_READ 0x0000000000000200 /* Readable SW Bit */ #define _PAGE_WRITE 0x0000000000000100 /* Writable SW Bit */ -#define _PAGE_PRIV 0x0000000000000080 /* Software privilege bit */ +#define _PAGE_PRESENT 0x0000000000000080 /* Present Page (ie. not swapped out) */ #define _PAGE_CACHE (_PAGE_CP | _PAGE_CV) #define __DIRTY_BITS (_PAGE_MODIFIED | _PAGE_WRITE | _PAGE_W) #define __ACCESS_BITS (_PAGE_ACCESSED | _PAGE_READ | _PAGE_R) -#define __PRIV_BITS (_PAGE_P | _PAGE_PRIV) +#define __PRIV_BITS _PAGE_P #define PAGE_NONE __pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \ __PRIV_BITS | __ACCESS_BITS) @@ -112,7 +111,7 @@ #define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_MODIFIED | _PAGE_ACCESSED | _PAGE_PRESENT) -#define pg_iobits (_PAGE_VALID | __PRIV_BITS | __ACCESS_BITS | _PAGE_E) +#define pg_iobits (_PAGE_VALID | _PAGE_PRESENT | __DIRTY_BITS | __ACCESS_BITS | _PAGE_E) #define __P000 PAGE_NONE #define __P001 PAGE_READONLY @@ -147,8 +146,7 @@ extern pte_t *__bad_pte(void); * hit for all __pa()/__va() operations. */ extern unsigned long phys_base; - -#define ZERO_PAGE (PAGE_OFFSET + phys_base) +#define ZERO_PAGE ((unsigned long)__va(phys_base)) /* This is for making TLB miss faster to process. */ extern unsigned long null_pmd_table; @@ -160,156 +158,47 @@ extern void *sparc_init_alloc(unsigned long *kbrk, unsigned long size); /* Cache and TLB flush operations. */ -extern __inline__ void flush_cache_all(void) -{ - unsigned long addr; - - flushw_all(); - for(addr = 0; addr < (PAGE_SIZE << 1); addr += 32) - spitfire_put_icache_tag(addr, 0x0UL); -} - -extern __inline__ void flush_cache_mm(struct mm_struct *mm) -{ - if(mm->context != NO_CONTEXT) { - unsigned long addr; - - flushw_user(); - for(addr = 0; addr < (PAGE_SIZE << 1); addr += 32) - spitfire_put_icache_tag(addr, 0x0UL); - } -} - -extern __inline__ void flush_cache_range(struct mm_struct *mm, unsigned long start, - unsigned long end) -{ - if(mm->context != NO_CONTEXT) { - unsigned long addr; +#define flush_cache_all() \ +do { unsigned long va; \ + flushw_all(); \ + for(va = 0; \ + va<(PAGE_SIZE<<1); \ + va += 32) \ +spitfire_put_icache_tag(va,0x0);\ +} while(0) - flushw_user(); - for(addr = 0; addr < (PAGE_SIZE << 1); addr += 32) - spitfire_put_icache_tag(addr, 0x0UL); - } -} - -extern __inline__ void flush_cache_page(struct vm_area_struct *vma, unsigned long page) -{ - struct mm_struct *mm = vma->vm_mm; - - if(mm->context != NO_CONTEXT) { - unsigned long addr; - - flushw_user(); - for(addr = 0; addr < (PAGE_SIZE << 1); addr += 32) - spitfire_put_icache_tag(addr, 0x0UL); - } -} +#define flush_cache_mm(mm) do { } while(0) +#define flush_cache_range(mm, start, end) do { } while(0) +#define flush_cache_page(vma, page) do { } while(0) /* This operation in unnecessary on the SpitFire since D-CACHE is write-through. */ #define flush_page_to_ram(page) do { } while (0) -extern __inline__ void flush_tlb_all(void) -{ - unsigned long flags; - int entry; - - /* Invalidate all non-locked TTE's in both the dtlb and itlb. */ - save_and_cli(flags); - __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" - "stxa %%g0, [%0] %2" - : /* No outputs */ - : "r" (TLB_TAG_ACCESS), "i" (ASI_IMMU), "i" (ASI_DMMU)); - for(entry = 0; entry < 62; entry++) { - spitfire_put_dtlb_data(entry, 0x0UL); - spitfire_put_itlb_data(entry, 0x0UL); - } - membar("#Sync"); - flushi(PAGE_OFFSET); - restore_flags(flags); -} +extern void flush_tlb_all(void); +extern void __flush_tlb_mm(unsigned long context); extern __inline__ void flush_tlb_mm(struct mm_struct *mm) { - if(mm->context != NO_CONTEXT) { - __asm__ __volatile__(" - /* flush_tlb_mm() */ - rdpr %%pil, %%g1 - mov %1, %%g7 - wrpr %%g0, 15, %%pil - ldxa [%%g7] %2, %%g2 - cmp %%g2, %0 - be,pt %%icc, 1f - mov 0x50, %%g3 - stxa %0, [%%g7] %2 -1: - stxa %%g0, [%%g3] %3 - stxa %%g0, [%%g3] %4 - be,a,pt %%icc, 1f - nop - stxa %%g2, [%%g7] %2 -1: - flush %%g4 - wrpr %%g1, 0x0, %%pil -" : /* no outputs */ - : "r" (mm->context & 0x1fff), "i" (SECONDARY_CONTEXT), "i" (ASI_DMMU), - "i" (ASI_DMMU_DEMAP), "i" (ASI_IMMU_DEMAP) - : "g1", "g2", "g3", "g7", "cc"); - } + if(mm->context != NO_CONTEXT) + __flush_tlb_mm(mm->context & 0x1fff); } +extern void __flush_tlb_range(unsigned long context, unsigned long start, + unsigned long end); extern __inline__ void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - if(mm->context != NO_CONTEXT) { - unsigned long old_ctx = spitfire_get_secondary_context(); - unsigned long new_ctx = (mm->context & 0x1fff); - unsigned long flags; - - start &= PAGE_MASK; - save_and_cli(flags); - if(new_ctx != old_ctx) - spitfire_set_secondary_context(mm->context); - while(start < end) { - spitfire_flush_dtlb_secondary_page(start); - spitfire_flush_itlb_secondary_page(start); - start += PAGE_SIZE; - } - if(new_ctx != old_ctx) - spitfire_set_secondary_context(old_ctx); - __asm__ __volatile__("flush %g4"); - restore_flags(flags); - } + if(mm->context != NO_CONTEXT) + __flush_tlb_range(mm->context & 0x1fff, start, end); } +extern void __flush_tlb_page(unsigned long context, unsigned long page); extern __inline__ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) { struct mm_struct *mm = vma->vm_mm; - if(mm->context != NO_CONTEXT) { - __asm__ __volatile__(" - /* flush_tlb_page() */ - rdpr %%pil, %%g1 - mov %1, %%g7 - wrpr %%g0, 15, %%pil - ldxa [%%g7] %2, %%g2 - cmp %%g2, %0 - be,pt %%icc, 1f - or %5, 0x10, %%g3 - stxa %0, [%%g7] %2 -1: - stxa %%g0, [%%g3] %3 - stxa %%g0, [%%g3] %4 - be,a,pt %%icc, 1f - nop - stxa %%g2, [%%g7] %2 -1: - flush %%g4 - wrpr %%g1, 0x0, %%pil -" : /* no outputs */ - : "r" (mm->context & 0x1fff), "i" (SECONDARY_CONTEXT), "i" (ASI_DMMU), - "i" (ASI_DMMU_DEMAP), "i" (ASI_IMMU_DEMAP), "r" (page & PAGE_MASK) - : "g1", "g2", "g3", "g7", "cc"); - } + if(mm->context != NO_CONTEXT) + __flush_tlb_page(mm->context & 0x1fff, page & PAGE_MASK); } extern inline pte_t mk_pte(unsigned long page, pgprot_t pgprot) @@ -394,24 +283,6 @@ extern inline pte_t pte_mkyoung(pte_t pte) return __pte(pte_val(pte) | (_PAGE_ACCESSED)); } -extern inline void SET_PAGE_DIR(struct task_struct *tsk, pgd_t *pgdir) -{ - register unsigned long paddr asm("o5"); - - paddr = __pa(pgdir); - - if(tsk == current) { - __asm__ __volatile__ (" - rdpr %%pstate, %%o4 - wrpr %%o4, %1, %%pstate - mov %0, %%g7 - wrpr %%o4, 0x0, %%pstate - " : /* No outputs */ - : "r" (paddr), "i" (PSTATE_MG|PSTATE_IE) - : "o4"); - } -} - /* to find an entry in a page-table-directory. */ extern inline pgd_t *pgd_offset(struct mm_struct *mm, unsigned long address) { return mm->pgd + ((address >> PGDIR_SHIFT) & (PTRS_PER_PAGE - 1)); } @@ -429,11 +300,16 @@ extern inline pte_t *pte_offset(pmd_t *dir, unsigned long address) extern __inline__ void __init_pmd(pmd_t *pmdp) { - extern void __bfill64(void *, unsigned long); + extern void __bfill64(void *, unsigned long *); - __bfill64((void *)pmdp, null_pte_table); + __bfill64((void *)pmdp, &null_pte_table); } +/* Turning this off makes things much faster, but eliminates some + * sanity checking as well. + */ +/* #define PGTABLE_SANITY_CHECKS */ + /* Allocate and free page tables. The xxx_kernel() versions are * used to allocate a kernel page table - this turns on supervisor * bits if any. @@ -456,11 +332,13 @@ extern inline pte_t * pte_alloc_kernel(pmd_t *pmd, unsigned long address) } free_page((unsigned long) page); } +#ifdef PGTABLE_SANITY_CHECKS if (pmd_bad(*pmd)) { printk("Bad pmd in pte_alloc_kernel: %08lx\n", pmd_val(*pmd)); pmd_set(pmd, BAD_PTE); return NULL; } +#endif return (pte_t *) pmd_page(*pmd) + address; } @@ -483,11 +361,13 @@ extern inline pmd_t * pmd_alloc_kernel(pgd_t *pgd, unsigned long address) } free_page((unsigned long) page); } +#ifdef PGTABLE_SANITY_CHECKS if (pgd_bad(*pgd)) { printk("Bad pgd in pmd_alloc_kernel: %08lx\n", pgd_val(*pgd)); pgd_set(pgd, BAD_PMD); return NULL; } +#endif return (pmd_t *) pgd_page(*pgd) + address; } @@ -509,11 +389,13 @@ extern inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address) } free_page((unsigned long) page); } +#ifdef PGTABLE_SANITY_CHECKS if (pmd_bad(*pmd)) { printk("Bad pmd in pte_alloc: %08lx\n", pmd_val(*pmd)); pmd_set(pmd, BAD_PTE); return NULL; } +#endif return (pte_t *) pmd_page(*pmd) + address; } @@ -536,11 +418,13 @@ extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address) } free_page((unsigned long) page); } +#ifdef PGTABLE_SANITY_CHECKS if (pgd_bad(*pgd)) { printk("Bad pgd in pmd_alloc: %08lx\n", pgd_val(*pgd)); pgd_set(pgd, BAD_PMD); return NULL; } +#endif return (pmd_t *) pgd_page(*pgd) + address; } @@ -549,16 +433,33 @@ extern inline void pgd_free(pgd_t * pgd) extern inline pgd_t * pgd_alloc(void) { - extern void __bfill64(void *, unsigned long); + extern void __bfill64(void *, unsigned long *); pgd_t *pgd = (pgd_t *) __get_free_page(GFP_KERNEL); if (pgd) - __bfill64((void *)pgd, null_pmd_table); + __bfill64((void *)pgd, &null_pmd_table); return pgd; } extern pgd_t swapper_pg_dir[1024]; +extern inline void SET_PAGE_DIR(struct task_struct *tsk, pgd_t *pgdir) +{ + if(pgdir != swapper_pg_dir && tsk == current) { + register unsigned long paddr asm("o5"); + + paddr = __pa(pgdir); + __asm__ __volatile__ (" + rdpr %%pstate, %%o4 + wrpr %%o4, %1, %%pstate + mov %0, %%g7 + wrpr %%o4, 0x0, %%pstate + " : /* No outputs */ + : "r" (paddr), "i" (PSTATE_MG|PSTATE_IE) + : "o4"); + } +} + /* Routines for getting a dvma scsi buffer. */ struct mmu_sglist { char *addr; @@ -576,61 +477,15 @@ extern void mmu_get_scsi_sgl(struct mmu_sglist *, int, struct linux_sbus *sbus) #define mmu_lockarea(vaddr, len) (vaddr) #define mmu_unlockarea(vaddr, len) do { } while(0) +extern void fixup_dcache_alias(struct vm_area_struct *vma, unsigned long address, + pte_t pte); + extern inline void update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte) { /* Find and fix bad virutal cache aliases. */ - if((vma->vm_flags & (VM_WRITE|VM_SHARED)) == (VM_WRITE|VM_SHARED)) { - struct vm_area_struct *vmaring; - struct inode *inode; - unsigned long vaddr, offset, start; - pgd_t *pgdp; - pmd_t *pmdp; - pte_t *ptep; - int alias_found = 0; - - inode = vma->vm_inode; - if(!inode) - return; - - offset = (address & PAGE_MASK) - vma->vm_start; - vmaring = inode->i_mmap; - do { - vaddr = vmaring->vm_start + offset; - - /* This conditional is misleading... */ - if((vaddr ^ address) & PAGE_SIZE) { - alias_found++; - start = vmaring->vm_start; - while(start < vmaring->vm_end) { - pgdp = pgd_offset(vmaring->vm_mm, start); - if(!pgdp) goto next; - pmdp = pmd_offset(pgdp, start); - if(!pmdp) goto next; - ptep = pte_offset(pmdp, start); - if(!ptep) goto next; - - if(pte_val(*ptep) & _PAGE_PRESENT) { - flush_cache_page(vmaring, start); - *ptep = __pte(pte_val(*ptep) & - ~(_PAGE_CV)); - flush_tlb_page(vmaring, start); - } - next: - start += PAGE_SIZE; - } - } - } while((vmaring = vmaring->vm_next_share) != NULL); - - if(alias_found && (pte_val(pte) & _PAGE_CV)) { - pgdp = pgd_offset(vma->vm_mm, address); - pmdp = pmd_offset(pgdp, address); - ptep = pte_offset(pmdp, address); - flush_cache_page(vma, address); - *ptep = __pte(pte_val(*ptep) & ~(_PAGE_CV)); - flush_tlb_page(vma, address); - } - } + if((vma->vm_flags & (VM_WRITE|VM_SHARED)) == (VM_WRITE|VM_SHARED)) + fixup_dcache_alias(vma, address, pte); } /* Make a non-present pseudo-TTE. */ @@ -638,7 +493,7 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) { pte_t pte; pte_val(pte) = (type<<PAGE_SHIFT)|(offset<<(PAGE_SHIFT+8)); return pte; } extern inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space) -{ pte_t pte; pte_val(pte) = (page) | pgprot_val(prot); return pte; } +{ pte_t pte; pte_val(pte) = ((page) | pgprot_val(prot) | _PAGE_E) & ~(unsigned long)_PAGE_CACHE; return pte; } #define SWP_TYPE(entry) (((entry>>PAGE_SHIFT) & 0xff)) #define SWP_OFFSET(entry) ((entry) >> (PAGE_SHIFT+8)) @@ -650,17 +505,19 @@ sun4u_get_pte (unsigned long addr) pgd_t *pgdp; pmd_t *pmdp; pte_t *ptep; - - pgdp = pgd_offset (current->mm, addr); + + if (addr >= PAGE_OFFSET) + return addr & _PAGE_PADDR; + pgdp = pgd_offset_k (addr); pmdp = pmd_offset (pgdp, addr); ptep = pte_offset (pmdp, addr); return pte_val (*ptep) & _PAGE_PADDR; } -extern __inline__ unsigned int +extern __inline__ unsigned long __get_phys (unsigned long addr) { - return (sun4u_get_pte (addr) & 0x0fffffff); + return sun4u_get_pte (addr); } extern __inline__ int @@ -669,6 +526,9 @@ __get_iospace (unsigned long addr) return ((sun4u_get_pte (addr) & 0xf0000000) >> 28); } +extern void * module_map (unsigned long size); +extern void module_unmap (void *addr); + #endif /* !(__ASSEMBLY__) */ #endif /* !(_SPARC64_PGTABLE_H) */ diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index f58c9da70..019bbf600 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.27 1997/05/23 09:35:52 jj Exp $ +/* $Id: processor.h,v 1.32 1997/07/01 21:59:38 davem Exp $ * include/asm-sparc64/processor.h * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -32,34 +32,24 @@ /* The Sparc processor specific thread struct. */ struct thread_struct { - /* Floating point regs */ - /* Please check asm_offsets, so that not to much precious space - is wasted by this alignment and move the float_regs wherever - is better in this structure. Remember every byte of alignment - is multiplied by 512 to get the amount of wasted kernel memory. */ - unsigned int float_regs[64] __attribute__ ((aligned (64))); - unsigned long fsr; - - /* Context switch saved kernel state. */ - unsigned long ksp, kpc, wstate, cwp, ctx; +/*DC1*/ unsigned long ksp __attribute__ ((aligned(16))); + unsigned long kpc; +/*DC2*/ unsigned long wstate; + unsigned int cwp; + unsigned int ctx; + +/*DC3*/ unsigned int flags; + unsigned int new_signal; + unsigned long current_ds; +/*DC4*/ unsigned long w_saved; + struct pt_regs *kregs; - /* Storage for windows when user stack is bogus. */ struct reg_window reg_window[NSWINS] __attribute__ ((aligned (16))); unsigned long rwbuf_stkptrs[NSWINS] __attribute__ ((aligned (8))); - unsigned long w_saved; - /* Arch-specific task state flags, see below. */ - unsigned long flags; - - /* For signal handling */ unsigned long sig_address __attribute__ ((aligned (8))); unsigned long sig_desc; - struct sigstack sstk_info; - int current_ds, new_signal; - - struct pt_regs *kregs; - struct exec core_exec; /* just what it says. */ }; @@ -74,30 +64,18 @@ struct thread_struct { PAGE_SHARED , VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap } #define INIT_TSS { \ -/* FPU regs */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \ -/* FPU status */ \ - 0, \ /* ksp, kpc, wstate, cwp, secctx */ \ 0, 0, 0, 0, 0, \ +/* flags, new_signal, current_ds, */ \ + SPARC_FLAG_KTHREAD, 0, USER_DS, \ +/* w_saved, kregs, */ \ + 0, 0, \ /* reg_window */ \ -{ { { 0, }, { 0, } }, }, \ + { { { 0, }, { 0, } }, }, \ /* rwbuf_stkptrs */ \ -{ 0, 0, 0, 0, 0, 0, 0, 0, }, \ -/* w_saved */ \ - 0, \ -/* flags */ \ - SPARC_FLAG_KTHREAD, \ -/* sig_address, sig_desc */ \ - 0, 0, \ -/* ex, sstk_info, current_ds, */ \ - { 0, 0, }, USER_DS, \ -/* new_signal, kregs */ \ - 0, 0, \ -/* core_exec */ \ -{ 0, }, \ + { 0, 0, 0, 0, 0, 0, 0, 0, }, \ +/* sig_address, sig_desc, sstk_info, core_exec */ \ + 0, 0, { 0, 0, }, { 0, }, \ } #ifndef __ASSEMBLY__ @@ -111,11 +89,12 @@ extern __inline__ unsigned long thread_saved_pc(struct thread_struct *t) /* Do necessary setup to start up a newly executed thread. */ #define start_thread(regs, pc, sp) \ do { \ - regs->tstate = (regs->tstate & (TSTATE_CWP)) | TSTATE_IE; \ + regs->tstate = (regs->tstate & (TSTATE_CWP)) | (TSTATE_IE|TSTATE_PEF); \ regs->tpc = ((pc & (~3)) - 4); \ regs->tnpc = regs->tpc + 4; \ regs->y = 0; \ current->tss.flags &= ~SPARC_FLAG_32BIT; \ + current->tss.wstate = (1 << 3); \ __asm__ __volatile__( \ "stx %%g0, [%0 + %2 + 0x00]\n\t" \ "stx %%g0, [%0 + %2 + 0x08]\n\t" \ @@ -135,7 +114,7 @@ do { \ "stx %%g0, [%0 + %2 + 0x78]\n\t" \ "wrpr %%g0, (1 << 3), %%wstate\n\t" \ : \ - : "r" (regs), "r" (sp - REGWIN_SZ), \ + : "r" (regs), "r" (sp - REGWIN_SZ - STACK_BIAS), \ "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \ } while(0) @@ -146,11 +125,12 @@ do { \ pc &= 0x00000000ffffffffUL; \ sp &= 0x00000000ffffffffUL; \ \ - regs->tstate = (regs->tstate & (TSTATE_CWP)) | (TSTATE_IE | TSTATE_AM); \ + regs->tstate = (regs->tstate & (TSTATE_CWP))|(TSTATE_IE|TSTATE_AM|TSTATE_PEF); \ regs->tpc = ((pc & (~3)) - 4); \ regs->tnpc = regs->tpc + 4; \ regs->y = 0; \ current->tss.flags |= SPARC_FLAG_32BIT; \ + current->tss.wstate = (2 << 3); \ zero = 0; \ __asm__ __volatile__( \ "stx %%g0, [%0 + %2 + 0x00]\n\t" \ diff --git a/include/asm-sparc64/psrcompat.h b/include/asm-sparc64/psrcompat.h index b971514d6..22e9da3d6 100644 --- a/include/asm-sparc64/psrcompat.h +++ b/include/asm-sparc64/psrcompat.h @@ -1,4 +1,4 @@ -/* $Id: psrcompat.h,v 1.3 1997/06/05 06:22:54 davem Exp $ */ +/* $Id: psrcompat.h,v 1.4 1997/06/20 11:54:39 davem Exp $ */ #ifndef _SPARC64_PSRCOMPAT_H #define _SPARC64_PSRCOMPAT_H @@ -23,33 +23,19 @@ extern inline unsigned int tstate_to_psr(unsigned long tstate) { - unsigned int psr; unsigned long vers; - /* These fields are in the same place. */ - psr = (tstate & (TSTATE_CWP | TSTATE_PEF)); - - /* This is what the user would have always seen. */ - psr |= PSR_S; - - /* Slam in the 32-bit condition codes. */ - psr |= ((tstate & TSTATE_ICC) >> 12); - - /* This is completely arbitrary. */ __asm__ __volatile__("rdpr %%ver, %0" : "=r" (vers)); - psr |= ((vers << 8) >> 32) & PSR_IMPL; - psr |= ((vers << 24) >> 36) & PSR_VERS; - - return psr; + return ((tstate & TSTATE_CWP) | + PSR_S | + ((tstate & TSTATE_ICC) >> 12) | + (((vers << 8) >> 32) & PSR_IMPL) | + (((vers << 24) >> 36) & PSR_VERS)); } extern inline unsigned long psr_to_tstate_icc(unsigned int psr) { - unsigned long tstate; - - tstate = ((unsigned long)(psr & PSR_ICC)) << 12; - - return tstate; + return ((unsigned long)(psr & PSR_ICC)) << 12; } #endif /* !(_SPARC64_PSRCOMPAT_H) */ diff --git a/include/asm-sparc64/pstate.h b/include/asm-sparc64/pstate.h index 2233ee7f0..a1e1414d6 100644 --- a/include/asm-sparc64/pstate.h +++ b/include/asm-sparc64/pstate.h @@ -1,4 +1,4 @@ -/* $Id: pstate.h,v 1.4 1997/05/29 12:45:02 jj Exp $ */ +/* $Id: pstate.h,v 1.6 1997/06/25 07:39:45 jj Exp $ */ #ifndef _SPARC64_PSTATE_H #define _SPARC64_PSTATE_H @@ -14,6 +14,9 @@ #define PSTATE_CLE 0x0000000000000200 /* Current Little Endian. */ #define PSTATE_TLE 0x0000000000000100 /* Trap Little Endian. */ #define PSTATE_MM 0x00000000000000c0 /* Memory Model. */ +#define PSTATE_TSO 0x0000000000000000 /* MM: Total Store Order */ +#define PSTATE_PSO 0x0000000000000040 /* MM: Partial Store Order */ +#define PSTATE_RMO 0x0000000000000080 /* MM: Relaxed Memory Order */ #define PSTATE_RED 0x0000000000000020 /* Reset Error Debug State. */ #define PSTATE_PEF 0x0000000000000010 /* Floating Point Enable. */ #define PSTATE_AM 0x0000000000000008 /* Address Mask. */ @@ -47,6 +50,9 @@ #define TSTATE_CLE 0x0000000000020000 /* Current Little Endian. */ #define TSTATE_TLE 0x0000000000010000 /* Trap Little Endian. */ #define TSTATE_MM 0x000000000000c000 /* Memory Model. */ +#define TSTATE_TSO 0x0000000000000000 /* MM: Total Store Order */ +#define TSTATE_PSO 0x0000000000004000 /* MM: Partial Store Order */ +#define TSTATE_RMO 0x0000000000008000 /* MM: Relaxed Memory Order */ #define TSTATE_RED 0x0000000000002000 /* Reset Error Debug State. */ #define TSTATE_PEF 0x0000000000001000 /* Floating Point Enable. */ #define TSTATE_AM 0x0000000000000800 /* Address Mask. */ diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h index 5da6f6dd1..a4784d41e 100644 --- a/include/asm-sparc64/ptrace.h +++ b/include/asm-sparc64/ptrace.h @@ -1,4 +1,4 @@ -/* $Id: ptrace.h,v 1.8 1997/05/27 19:30:27 jj Exp $ */ +/* $Id: ptrace.h,v 1.12 1997/06/24 16:30:35 davem Exp $ */ #ifndef _SPARC64_PTRACE_H #define _SPARC64_PTRACE_H @@ -15,7 +15,8 @@ struct pt_regs { unsigned long tstate; unsigned long tpc; unsigned long tnpc; - unsigned long y; + unsigned int y; + unsigned int fprs; }; struct pt_regs32 { @@ -137,6 +138,7 @@ extern void show_regs(struct pt_regs *); #define PT_V9_TPC 0x88 #define PT_V9_TNPC 0x90 #define PT_V9_Y 0x98 +#define PT_V9_FPRS 0x9c #define PT_TSTATE PT_V9_TSTATE #define PT_TPC PT_V9_TPC #define PT_TNPC PT_V9_TNPC @@ -265,6 +267,28 @@ extern void show_regs(struct pt_regs *); #define PTRACE_GETFPAREGS 20 #define PTRACE_SETFPAREGS 21 +/* There are for debugging 64-bit processes, either from a 32 or 64 bit + * parent. Thus their compliments are for debugging 32-bit processes only. + */ + +#define PTRACE_GETREGS64 22 +#define PTRACE_SETREGS64 23 +/* PTRACE_SYSCALL is 24 */ +#define PTRACE_GETFPREGS64 25 +#define PTRACE_SETFPREGS64 26 + #define PTRACE_GETUCODE 29 /* stupid bsd-ism */ +/* These are for 32-bit processes debugging 64-bit ones. + * Here addr and addr2 are passed in %g2 and %g3 respectively. + */ +#define PTRACE_PEEKTEXT64 (30 + PTRACE_PEEKTEXT) +#define PTRACE_POKETEXT64 (30 + PTRACE_POKETEXT) +#define PTRACE_PEEKDATA64 (30 + PTRACE_PEEKDATA) +#define PTRACE_POKEDATA64 (30 + PTRACE_POKEDATA) +#define PTRACE_READDATA64 (30 + PTRACE_READDATA) +#define PTRACE_WRITEDATA64 (30 + PTRACE_WRITEDATA) +#define PTRACE_READTEXT64 (30 + PTRACE_READTEXT) +#define PTRACE_WRITETEXT64 (30 + PTRACE_WRITETEXT) + #endif /* !(_SPARC64_PTRACE_H) */ diff --git a/include/asm-sparc64/reg.h b/include/asm-sparc64/reg.h index 716b8f8c6..ea3fc6e9c 100644 --- a/include/asm-sparc64/reg.h +++ b/include/asm-sparc64/reg.h @@ -1,4 +1,4 @@ -/* $Id: reg.h,v 1.1 1996/12/26 14:22:34 davem Exp $ +/* $Id: reg.h,v 1.2 1997/06/24 23:19:55 davem Exp $ * linux/asm-sparc64/reg.h * Layout of the registers as expected by gdb on the Sparc * we should replace the user.h definitions with those in @@ -76,4 +76,33 @@ struct fpu { struct fp_status f_fpstatus; }; +struct regs64 { + unsigned long r_g1; + unsigned long r_g2; + unsigned long r_g3; + unsigned long r_g4; + unsigned long r_g5; + unsigned long r_g6; + unsigned long r_g7; + unsigned long r_o0; + unsigned long r_o1; + unsigned long r_o2; + unsigned long r_o3; + unsigned long r_o4; + unsigned long r_o5; + unsigned long r_o6; + unsigned long r_o7; + unsigned long tstate; + unsigned long tpc; + unsigned long tnpc; + unsigned int y; + unsigned int fprs; +}; + +struct fp_status64 { + unsigned long regs[32]; + unsigned long fsr; +}; + + #endif /* __SPARC64_REG_H */ diff --git a/include/asm-sparc64/resource.h b/include/asm-sparc64/resource.h index 5e7a7f8c1..b3aedd4ee 100644 --- a/include/asm-sparc64/resource.h +++ b/include/asm-sparc64/resource.h @@ -1,4 +1,4 @@ -/* $Id: resource.h,v 1.2 1997/04/04 00:50:27 davem Exp $ +/* $Id: resource.h,v 1.3 1997/06/14 17:35:09 davem Exp $ * resource.h: Resource definitions. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -25,7 +25,6 @@ #define RLIM_NLIMITS 10 #ifdef __KERNEL__ -/* XXX 32-bit binary compatability... */ #define INIT_RLIMITS \ { \ {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX}, \ diff --git a/include/asm-sparc64/sigcontext.h b/include/asm-sparc64/sigcontext.h index 9d35493d9..3fba2f834 100644 --- a/include/asm-sparc64/sigcontext.h +++ b/include/asm-sparc64/sigcontext.h @@ -1,14 +1,9 @@ -/* $Id: sigcontext.h,v 1.4 1997/04/04 00:50:28 davem Exp $ */ +/* $Id: sigcontext.h,v 1.8 1997/06/20 11:54:41 davem Exp $ */ #ifndef __SPARC64_SIGCONTEXT_H #define __SPARC64_SIGCONTEXT_H #include <asm/ptrace.h> -/* XXX This gets exported to userland as well as kernel, it is probably - * XXX riddled with many hard to find 32-bit binary compatability issues. - * XXX Signals and this file need to be investigated heavily. -DaveM - */ - #define SUNOS_MAXWIN 31 #ifndef __ASSEMBLY__ @@ -47,12 +42,12 @@ struct sigcontext32 { struct sigcontext { int sigc_onstack; /* state to restore */ int sigc_mask; /* sigmask to restore */ - int sigc_sp; /* stack pointer */ - int sigc_pc; /* program counter */ - int sigc_npc; /* next program counter */ - int sigc_psr; /* for condition codes etc */ - int sigc_g1; /* User uses these two registers */ - int sigc_o0; /* within the trampoline code. */ + unsigned long sigc_sp; /* stack pointer */ + unsigned long sigc_pc; /* program counter */ + unsigned long sigc_npc; /* next program counter */ + unsigned long sigc_psr; /* for condition codes etc */ + unsigned long sigc_g1; /* User uses these two registers */ + unsigned long sigc_o0; /* within the trampoline code. */ /* Now comes information regarding the users window set * at the time of the signal. @@ -72,17 +67,6 @@ typedef struct { } __siginfo32_t; typedef struct { - unsigned int si_float_regs [32]; - unsigned int si_fsr; - unsigned int si_fpqdepth; - struct { - unsigned int *insn_addr; - unsigned int insn; - } si_fpqueue [16]; -} __siginfo_fpu32_t; - - -typedef struct { struct pt_regs si_regs; int si_mask; } __siginfo_t; @@ -90,6 +74,7 @@ typedef struct { typedef struct { unsigned int si_float_regs [64]; unsigned long si_fsr; + unsigned long si_gsr; unsigned int si_fpqdepth; struct { unsigned int *insn_addr; diff --git a/include/asm-sparc64/softirq.h b/include/asm-sparc64/softirq.h index fa32f67e5..8386e4a15 100644 --- a/include/asm-sparc64/softirq.h +++ b/include/asm-sparc64/softirq.h @@ -43,10 +43,12 @@ do { int ent = nr; \ do { int ent = nr; \ bh_mask &= ~(1 << ent); \ bh_mask_count[ent]++; \ + barrier(); \ } while(0) #define enable_bh(nr) \ do { int ent = nr; \ + barrier(); \ if (!--bh_mask_count[ent]) \ bh_mask |= 1 << ent; \ } while(0) diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index ec1ad2ea0..cefd43309 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -53,6 +53,11 @@ typedef struct { } rwlock_t; #else /* !(__SMP__) */ +/* All of these locking primitives are expected to work properly + * even in an RMO memory model, which currently is what the kernel + * runs in. + */ + typedef unsigned char spinlock_t; #define SPIN_LOCK_UNLOCKED 0 #define spin_lock_init(lock) (*(lock) = 0) @@ -64,6 +69,7 @@ extern __inline__ void spin_lock(spinlock_t *lock) 1: ldstub [%0], %%g2 brnz,a,pn %%g2, 2f ldub [%0], %%g2 + membar #LoadLoad | #LoadStore .text 2 2: brnz,a,pt 2b ldub [%0], %%g2 @@ -77,7 +83,8 @@ extern __inline__ void spin_lock(spinlock_t *lock) extern __inline__ int spin_trylock(spinlock_t *lock) { unsigned int result; - __asm__ __volatile__("ldstub [%1], %0" + __asm__ __volatile__("ldstub [%1], %0\n\t" + "membar #LoadLoad | #LoadStore" : "=r" (result) : "r" (lock) : "memory"); @@ -86,7 +93,11 @@ extern __inline__ int spin_trylock(spinlock_t *lock) extern __inline__ void spin_unlock(spinlock_t *lock) { - __asm__ __volatile__("stb %%g0, [%0]" : : "r" (lock) : "memory"); + __asm__ __volatile__("membar #StoreStore | #LoadStore\n\t" + "stb %%g0, [%0]" + : /* No outputs */ + : "r" (lock) + : "memory"); } extern __inline__ void spin_lock_irq(spinlock_t *lock) @@ -96,6 +107,7 @@ extern __inline__ void spin_lock_irq(spinlock_t *lock) ldstub [%0], %%g2 brnz,a,pn %%g2, 2f ldub [%0], %%g2 + membar #LoadLoad | #LoadStore .text 2 2: brnz,a,pt 2b ldub [%0], %%g2 @@ -109,6 +121,7 @@ extern __inline__ void spin_lock_irq(spinlock_t *lock) extern __inline__ void spin_unlock_irq(spinlock_t *lock) { __asm__ __volatile__(" + membar #StoreStore | #LoadStore stb %%g0, [%0] wrpr %%g0, 0x0, %%pil " : /* no outputs */ @@ -116,28 +129,30 @@ extern __inline__ void spin_unlock_irq(spinlock_t *lock) : "memory"); } -#define spin_lock_irqsave(lock, flags) \ -do { register spinlock_t *lp asm("g1"); \ - lp = lock; \ - __asm__ __volatile__( \ - " rdpr %%pil, %0\n\t" \ - " wrpr %%g0, 15, %%pil\n\t" \ - "1: ldstub [%1], %%g2\n\t" \ - " brnz,a,pnt %%g2, 2f\n\t" \ - " ldub [%1], %%g2\n\t" \ - " .text 2\n\t" \ - "2: brnz,a,pt %%g2, 2b\n\t" \ - " ldub [%1], %%g2\n\t" \ - " b,a,pt %%xcc, 1b\n\t" \ - " .previous\n" \ - : "=r" (flags) \ - : "r" (lp) \ - : "g2", "memory"); \ +#define spin_lock_irqsave(lock, flags) \ +do { register spinlock_t *lp asm("g1"); \ + lp = lock; \ + __asm__ __volatile__( \ + " rdpr %%pil, %0\n\t" \ + " wrpr %%g0, 15, %%pil\n\t" \ + "1: ldstub [%1], %%g2\n\t" \ + " brnz,a,pnt %%g2, 2f\n\t" \ + " ldub [%1], %%g2\n\t" \ + " membar #LoadLoad | #LoadStore\n\t" \ + " .text 2\n\t" \ + "2: brnz,a,pt %%g2, 2b\n\t" \ + " ldub [%1], %%g2\n\t" \ + " b,a,pt %%xcc, 1b\n\t" \ + " .previous\n" \ + : "=r" (flags) \ + : "r" (lp) \ + : "g2", "memory"); \ } while(0) extern __inline__ void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) { __asm__ __volatile__(" + membar #StoreStore | #LoadStore stb %%g0, [%0] wrpr %1, 0x0, %%pil " : /* no outputs */ @@ -161,6 +176,7 @@ extern __inline__ void read_lock(rwlock_t *rw) cmp %%g2, %%g3 bne,a,pn %%xcc, 1b ldx [%0],%%g2 + membar #LoadLoad | #LoadStore .text 2 2: ldx [%0], %%g2 3: brlz,pt %%g2, 3b @@ -169,12 +185,13 @@ extern __inline__ void read_lock(rwlock_t *rw) .previous " : /* no outputs */ : "r" (rw) - : "g2", "g3", "memory"); + : "g2", "g3", "cc", "memory"); } extern __inline__ void read_unlock(rwlock_t *rw) { __asm__ __volatile__(" + membar #StoreStore | #LoadStore ldx [%0], %%g2 1: sub %%g2, 1, %%g3 @@ -184,7 +201,7 @@ extern __inline__ void read_unlock(rwlock_t *rw) ldx [%0], %%g2 " : /* no outputs */ : "r" (rw) - : "g2", "g3", "memory"); + : "g2", "g3", "cc", "memory"); } extern __inline__ void write_lock(rwlock_t *rw) @@ -203,6 +220,7 @@ extern __inline__ void write_lock(rwlock_t *rw) andncc %%g3, %%g5, %%g0 bne,a,pn %%xcc, 3f ldx [%0], %%g2 + membar #LoadLoad | #LoadStore .text 2 3: andn %%g2, %%g5, %%g3 @@ -210,6 +228,7 @@ extern __inline__ void write_lock(rwlock_t *rw) cmp %%g2, %%g3 bne,a,pn %%xcc, 3b ldx [%0], %%g2 + membar #LoadLoad | #LoadStore 5: ldx [%0], %%g2 6: brlz,pt %%g2, 6b ldx [%0], %%g2 @@ -222,6 +241,7 @@ extern __inline__ void write_lock(rwlock_t *rw) extern __inline__ void write_unlock(rwlock_t *rw) { __asm__ __volatile__(" + membar #StoreStore | #LoadStore sethi %%uhi(0x8000000000000000), %%g5 ldx [%0], %%g2 sllx %%g5, 32, %%g5 diff --git a/include/asm-sparc64/string.h b/include/asm-sparc64/string.h index b420d80bb..45b166c91 100644 --- a/include/asm-sparc64/string.h +++ b/include/asm-sparc64/string.h @@ -1,4 +1,4 @@ -/* $Id: string.h,v 1.5 1997/05/18 04:16:57 davem Exp $ +/* $Id: string.h,v 1.7 1997/07/13 18:23:44 davem Exp $ * string.h: External definitions for optimized assembly string * routines for the Linux Kernel. * @@ -13,8 +13,14 @@ #ifdef __KERNEL__ +#include <asm/asi.h> + extern void __memmove(void *,const void *,__kernel_size_t); extern __kernel_size_t __memcpy(void *,const void *,__kernel_size_t); +extern __kernel_size_t __memcpy_short(void *,const void *,__kernel_size_t,long,long); +extern __kernel_size_t __memcpy_entry(void *,const void *,__kernel_size_t,long,long); +extern __kernel_size_t __memcpy_16plus(void *,const void *,__kernel_size_t,long,long); +extern __kernel_size_t __memcpy_384plus(void *,const void *,__kernel_size_t,long,long); extern __kernel_size_t __memset(void *,int,__kernel_size_t); #ifndef EXPORT_SYMTAB @@ -35,24 +41,11 @@ extern __kernel_size_t __memset(void *,int,__kernel_size_t); extern inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n) { - extern void __copy_1page(void *, const void *); - if(n) { if(n <= 32) { __builtin_memcpy(to, from, n); } else { -#if 0 - switch(n) { - case 8192: - __copy_1page(to, from); - break; - default: -#endif - __memcpy(to, from, n); -#if 0 - break; - } -#endif + __memcpy(to, from, n); } } return to; @@ -74,15 +67,13 @@ extern inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_si extern inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size_t count) { - extern void *bzero_1page(void *); + extern void *__bzero_1page(void *); extern __kernel_size_t __bzero(void *, __kernel_size_t); if(!c) { -#if 0 - if(count == 8192) - bzero_1page(s); + if (count == 8192) + __bzero_1page(s); else -#endif __bzero(s, count); } else { __memset(s, c, count); diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index d0d88fa5c..6e7c42e55 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h @@ -1,4 +1,4 @@ -/* $Id: system.h,v 1.22 1997/06/01 10:27:28 davem Exp $ */ +/* $Id: system.h,v 1.26 1997/06/28 10:04:03 davem Exp $ */ #ifndef __SPARC64_SYSTEM_H #define __SPARC64_SYSTEM_H @@ -95,45 +95,15 @@ extern __inline__ void flushw_user(void) { __asm__ __volatile__(" rdpr %%otherwin, %%g1 - brz,pt %%g1, 2f + brz,pt %%g1, 1f + mov %%o7, %%g3 + call __flushw_user clr %%g2 -1: - save %%sp, %0, %%sp - rdpr %%otherwin, %%g1 - brnz,pt %%g1, 1b - add %%g2, 1, %%g2 -1: - subcc %%g2, 1, %%g2 - bne,pt %%xcc, 1b - restore %%g0, %%g0, %%g0 -2: - " : : "i" (-REGWIN_SZ) - : "g1", "g2", "cc"); +1:" : : : "g1", "g2", "g3"); } #define flush_user_windows flushw_user -#ifdef __SMP__ - -#include <asm/fpumacro.h> - -#define SWITCH_ENTER(prev) \ - if((prev)->flags & PF_USEDFPU) { \ - fprs_write(FPRS_FEF); \ - fpsave((unsigned long *) &(prev)->tss.float_regs[0], \ - &(prev)->tss.fsr); \ - (prev)->flags &= ~PF_USEDFPU; \ - (prev)->tss.kregs->tstate &= ~TSTATE_PEF; \ - } - -#define SWITCH_DO_LAZY_FPU(next) -#else -#define SWITCH_ENTER(prev) -#define SWITCH_DO_LAZY_FPU(next) \ - if(last_task_used_math != (next)) \ - (next)->tss.kregs->tstate &= ~TSTATE_PEF -#endif - /* See what happens when you design the chip correctly? * NOTE NOTE NOTE this is extremely non-trivial what I * am doing here. GCC needs only one register to stuff @@ -146,13 +116,13 @@ extern __inline__ void flushw_user(void) do { \ __label__ switch_continue; \ register unsigned long task_pc asm("o7"); \ - SWITCH_ENTER(prev) \ - SWITCH_DO_LAZY_FPU(next); \ + (prev)->tss.kregs->fprs = 0; \ task_pc = ((unsigned long) &&switch_continue) - 0x8; \ __asm__ __volatile__( \ "rdpr %%pstate, %%g2\n\t" \ - "wrpr %%g2, 0x2, %%pstate\n\t" \ + "wrpr %%g2, 0x3, %%pstate\n\t" \ "flushw\n\t" \ +/*XXX*/ "wr %%g0, 0, %%fprs\n\t" \ "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \ "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \ "rdpr %%wstate, %%o5\n\t" \ @@ -160,19 +130,20 @@ do { \ "stx %%o5, [%%g6 + %2]\n\t" \ "rdpr %%cwp, %%o5\n\t" \ "stx %%o7, [%%g6 + %4]\n\t" \ - "stx %%o5, [%%g6 + %5]\n\t" \ + "st %%o5, [%%g6 + %5]\n\t" \ "mov %0, %%g6\n\t" \ - "ldx [%0 + %5], %%g1\n\t" \ - "wr %0, 0x0, %%pic\n\t" \ + "ld [%0 + %5], %%g1\n\t" \ "wrpr %%g1, %%cwp\n\t" \ "ldx [%%g6 + %2], %%o5\n\t" \ "ldx [%%g6 + %3], %%o6\n\t" \ "ldx [%%g6 + %4], %%o7\n\t" \ + "mov %%g6, %0\n\t" \ "wrpr %%o5, 0x0, %%wstate\n\t" \ "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ + "wrpr %%g0, 0x96, %%pstate\n\t" \ "jmpl %%o7 + 0x8, %%g0\n\t" \ - " wrpr %%g2, 0x0, %%pstate\n\t" \ + " mov %0, %%g6\n\t" \ : /* No outputs */ \ : "r" (next), "r" (task_pc), \ "i" ((const unsigned long)(&((struct task_struct *)0)->tss.wstate)), \ @@ -200,15 +171,15 @@ extern __inline__ unsigned long xchg_u64(__volatile__ unsigned long *m, { unsigned long temp; __asm__ __volatile__(" - ldx [%3], %1 -1: + mov %0, %%g1 +1: ldx [%3], %1 casx [%3], %1, %0 cmp %1, %0 bne,a,pn %%xcc, 1b - ldx [%3], %1 + mov %%g1, %0 " : "=&r" (val), "=&r" (temp) : "0" (val), "r" (m) - : "cc"); + : "g1", "cc"); return val; } diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index 40ad3ee21..c0668e3f2 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h @@ -1,4 +1,4 @@ -/* $Id: uaccess.h,v 1.13 1997/05/29 12:45:04 jj Exp $ */ +/* $Id: uaccess.h,v 1.20 1997/07/13 18:23:45 davem Exp $ */ #ifndef _ASM_UACCESS_H #define _ASM_UACCESS_H @@ -22,26 +22,26 @@ * * "For historical reasons, these macros are grossly misnamed." -Linus */ -#define KERNEL_DS 0 -#define USER_DS -1 +#define KERNEL_DS 0x00 +#define USER_DS 0x2B /* har har har */ #define VERIFY_READ 0 #define VERIFY_WRITE 1 #define get_fs() (current->tss.current_ds) #define get_ds() (KERNEL_DS) -extern __inline__ void set_fs(int val) -{ - if (val != current->tss.current_ds) { - if (val == KERNEL_DS) { - flushw_user (); - spitfire_set_secondary_context (0); - } else { - spitfire_set_secondary_context (current->mm->context); - } - current->tss.current_ds = val; - } -} +#define set_fs(val) \ +do { \ + current->tss.current_ds = (val); \ + if ((val) == KERNEL_DS) { \ + flushw_user (); \ + current->tss.ctx = 0; \ + } else { \ + current->tss.ctx = (current->mm->context & 0x1fff); \ + } \ + spitfire_set_secondary_context(current->tss.ctx); \ + __asm__ __volatile__("flush %g6"); \ +} while(0) #define __user_ok(addr,size) 1 #define __kernel_ok (get_fs() == KERNEL_DS) @@ -255,8 +255,44 @@ __asm__ __volatile__( \ extern int __get_user_bad(void); -extern __kernel_size_t __copy_to_user(void *to, void *from, __kernel_size_t size); -extern __kernel_size_t __copy_from_user(void *to, void *from, __kernel_size_t size); +extern __kernel_size_t __memcpy_short(void *to, const void *from, + __kernel_size_t size, + long asi_src, long asi_dst); + +extern __kernel_size_t __memcpy_entry(void *to, const void *from, + __kernel_size_t size, + long asi_src, long asi_dst); + +extern __kernel_size_t __memcpy_16plus(void *to, const void *from, + __kernel_size_t size, + long asi_src, long asi_dst); + +extern __kernel_size_t __memcpy_386plus(void *to, const void *from, + __kernel_size_t size, + long asi_src, long asi_dst); + +extern __kernel_size_t __copy_from_user(void *to, const void *from, + __kernel_size_t size); + +extern __kernel_size_t __copy_to_user(void *to, const void *from, + __kernel_size_t size); + +extern __kernel_size_t __copy_in_user(void *to, const void *from, + __kernel_size_t size); + +#define copy_from_user(to,from,n) \ + __copy_from_user((void *)(to), \ + (void *)(from), (__kernel_size_t)(n)) + +#define copy_from_user_ret(to,from,n,retval) ({ \ +if (copy_from_user(to,from,n)) \ + return retval; \ +}) + +#define __copy_from_user_ret(to,from,n,retval) ({ \ +if (__copy_from_user(to,from,n)) \ + return retval; \ +}) #define copy_to_user(to,from,n) \ __copy_to_user((void *)(to), \ @@ -272,37 +308,27 @@ if (__copy_to_user(to,from,n)) \ return retval; \ }) -#define copy_from_user(to,from,n) \ - __copy_from_user((void *)(to), \ - (void *)(from), (__kernel_size_t)(n)) +#define copy_in_user(to,from,n) \ + __copy_in_user((void *)(to), \ + (void *) (from), (__kernel_size_t)(n)) -#define copy_from_user_ret(to,from,n,retval) ({ \ -if (copy_from_user(to,from,n)) \ +#define copy_in_user_ret(to,from,n,retval) ({ \ +if (copy_in_user(to,from,n)) \ return retval; \ }) -#define __copy_from_user_ret(to,from,n,retval) ({ \ -if (__copy_from_user(to,from,n)) \ +#define __copy_in_user_ret(to,from,n,retval) ({ \ +if (__copy_in_user(to,from,n)) \ return retval; \ }) extern __inline__ __kernel_size_t __clear_user(void *addr, __kernel_size_t size) { - __kernel_size_t ret; - __asm__ __volatile__ (" - .section __ex_table,#alloc - .align 8 - .xword 1f,3 - .previous -1: - wr %%g0, %3, %%asi - mov %2, %%o1 - call __bzero_noasi - mov %1, %%o0 - mov %%o0, %0 - " : "=r" (ret) : "r" (addr), "r" (size), "i" (ASI_S) : - "cc", "o0", "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g5", "g7"); - return ret; + extern __kernel_size_t __bzero_noasi(void *addr, __kernel_size_t size); + + + __asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "i" (ASI_S)); + return __bzero_noasi(addr, size); } #define clear_user(addr,n) \ diff --git a/include/asm-sparc64/uctx.h b/include/asm-sparc64/uctx.h new file mode 100644 index 000000000..1899ff971 --- /dev/null +++ b/include/asm-sparc64/uctx.h @@ -0,0 +1,71 @@ +/* $Id: uctx.h,v 1.1 1997/07/18 06:29:24 ralf Exp $ + * uctx.h: Sparc64 {set,get}context() register state layouts. + * + * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) + */ + +#ifndef __SPARC64_UCTX_H +#define __SPARC64_UCTX_H + +#define MC_TSTATE 0 +#define MC_PC 1 +#define MC_NPC 2 +#define MC_Y 3 +#define MC_G1 4 +#define MC_G2 5 +#define MC_G3 6 +#define MC_G4 7 +#define MC_G5 8 +#define MC_G6 9 +#define MC_G7 10 +#define MC_O0 11 +#define MC_O1 12 +#define MC_O2 13 +#define MC_O3 14 +#define MC_O4 15 +#define MC_O5 16 +#define MC_O6 17 +#define MC_O7 18 +#define MC_NGREG 19 + +typedef unsigned long mc_greg_t; +typedef mc_greg_t mc_gregset_t[MC_NGREG]; + +#define MC_MAXFPQ 16 +struct mc_fq { + unsigned long *mcfq_addr; + unsigned int mcfq_insn; +}; + +struct mc_fpu { + union { + unsigned int sregs[32]; + unsigned long dregs[32]; + long double qregs[16]; + } mcfpu_fregs; + unsigned long mcfpu_fsr; + unsigned long mcfpu_fprs; + unsigned long mcfpu_gsr; + struct mc_fq *mcfpu_fq; + unsigned char mcfpu_qcnt; + unsigned char mcfpu_qentsz; + unsigned char mcfpu_enab; +}; +typedef struct mc_fpu mc_fpu_t; + +typedef struct { + mc_gregset_t mc_gregs; + mc_greg_t mc_fp; + mc_greg_t mc_i7; + mc_fpu_t mc_fpregs; +} mcontext_t; + +struct ucontext { + struct ucontext *uc_link; + unsigned long uc_flags; + sigset_t uc_sigmask; + mcontext_t uc_mcontext; +}; +typedef struct ucontext ucontext_t; + +#endif /* __SPARC64_UCTX_H */ diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index cb17f1888..27afe645e 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -1,4 +1,4 @@ -/* $Id: unistd.h,v 1.5 1997/05/21 10:21:57 jj Exp $ */ +/* $Id: unistd.h,v 1.7 1997/06/16 05:37:44 davem Exp $ */ #ifndef _SPARC64_UNISTD_H #define _SPARC64_UNISTD_H @@ -113,35 +113,35 @@ #define __NR_setdopt 94 /* SunOS Specific */ #define __NR_fsync 95 /* Common */ #define __NR_setpriority 96 /* Common */ -#define __NR_socket 97 /* SunOS Specific */ -#define __NR_connect 98 /* SunOS Specific */ -#define __NR_accept 99 /* SunOS Specific */ +#define __NR_socket 97 /* Common */ +#define __NR_connect 98 /* Common */ +#define __NR_accept 99 /* Common */ #define __NR_getpriority 100 /* Common */ -#define __NR_send 101 /* SunOS Specific */ -#define __NR_recv 102 /* SunOS Specific */ +#define __NR_send 101 /* Common */ +#define __NR_recv 102 /* Common */ /* #define __NR_ni_syscall 103 ENOSYS under SunOS */ -#define __NR_bind 104 /* SunOS Specific */ -#define __NR_setsockopt 105 /* SunOS Specific */ -#define __NR_listen 106 /* SunOS Specific */ +#define __NR_bind 104 /* Common */ +#define __NR_setsockopt 105 /* Common */ +#define __NR_listen 106 /* Common */ /* #define __NR_ni_syscall 107 ENOSYS under SunOS */ #define __NR_sigvec 108 /* SunOS Specific */ #define __NR_sigblock 109 /* SunOS Specific */ #define __NR_sigsetmask 110 /* SunOS Specific */ #define __NR_sigpause 111 /* SunOS Specific */ #define __NR_sigstack 112 /* SunOS Specific */ -#define __NR_recvmsg 113 /* SunOS Specific */ -#define __NR_sendmsg 114 /* SunOS Specific */ +#define __NR_recvmsg 113 /* Common */ +#define __NR_sendmsg 114 /* Common */ #define __NR_vtrace 115 /* SunOS Specific */ #define __NR_gettimeofday 116 /* Common */ #define __NR_getrusage 117 /* Common */ -#define __NR_getsockopt 118 /* SunOS Specific */ +#define __NR_getsockopt 118 /* Common */ /* #define __NR_ni_syscall 119 ENOSYS under SunOS */ #define __NR_readv 120 /* Common */ #define __NR_writev 121 /* Common */ #define __NR_settimeofday 122 /* Common */ #define __NR_fchown 123 /* Common */ #define __NR_fchmod 124 /* Common */ -#define __NR_recvfrom 125 /* SunOS Specific */ +#define __NR_recvfrom 125 /* Common */ #define __NR_setreuid 126 /* Common */ #define __NR_setregid 127 /* Common */ #define __NR_rename 128 /* Common */ @@ -149,15 +149,15 @@ #define __NR_ftruncate 130 /* Common */ #define __NR_flock 131 /* Common */ /* #define __NR_ni_syscall 132 ENOSYS under SunOS */ -#define __NR_sendto 133 /* SunOS Specific */ -#define __NR_shutdown 134 /* SunOS Specific */ -#define __NR_socketpair 135 /* SunOS Specific */ +#define __NR_sendto 133 /* Common */ +#define __NR_shutdown 134 /* Common */ +#define __NR_socketpair 135 /* Common */ #define __NR_mkdir 136 /* Common */ #define __NR_rmdir 137 /* Common */ #define __NR_utimes 138 /* SunOS Specific */ /* #define __NR_ni_syscall 139 ENOSYS under SunOS */ #define __NR_adjtime 140 /* SunOS Specific */ -#define __NR_getpeername 141 /* SunOS Specific */ +#define __NR_getpeername 141 /* Common */ #define __NR_gethostid 142 /* SunOS Specific */ /* #define __NR_ni_syscall 143 ENOSYS under SunOS */ #define __NR_getrlimit 144 /* Common */ @@ -166,7 +166,7 @@ /* #define __NR_ni_syscall 147 ENOSYS under SunOS */ /* #define __NR_ni_syscall 148 ENOSYS under SunOS */ /* #define __NR_ni_syscall 149 ENOSYS under SunOS */ -#define __NR_getsockname 150 /* SunOS Specific */ +#define __NR_getsockname 150 /* Common */ #define __NR_getmsg 151 /* SunOS Specific */ #define __NR_putmsg 152 /* SunOS Specific */ #define __NR_poll 153 /* SunOS Specific */ @@ -467,6 +467,7 @@ static __inline__ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned lo #endif /* __KERNEL_SYSCALLS__ */ +#ifdef __KERNEL__ /* sysconf options, for SunOS compatibility */ #define _SC_ARG_MAX 1 #define _SC_CHILD_MAX 2 @@ -476,5 +477,6 @@ static __inline__ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned lo #define _SC_JOB_CONTROL 6 #define _SC_SAVED_IDS 7 #define _SC_VERSION 8 +#endif #endif /* _SPARC64_UNISTD_H */ diff --git a/include/asm-sparc64/vaddrs.h b/include/asm-sparc64/vaddrs.h index cd82abb06..b88085668 100644 --- a/include/asm-sparc64/vaddrs.h +++ b/include/asm-sparc64/vaddrs.h @@ -1,4 +1,4 @@ -/* $Id: vaddrs.h,v 1.6 1997/04/04 00:50:31 davem Exp $ */ +/* $Id: vaddrs.h,v 1.8 1997/06/27 14:55:13 jj Exp $ */ #ifndef _SPARC64_VADDRS_H #define _SPARC64_VADDRS_H @@ -14,12 +14,15 @@ * mappings for devices and is the speedup improvements of not loading * a pointer and then the value in the assembly code */ -#define IOBASE_VADDR 0xfffffd0000000000ULL /* Base for mapping pages */ -#define IOBASE_LEN 0x0000008000000000ULL /* Length of the IO area */ -#define IOBASE_END 0xfffffd8000000000ULL -#define DVMA_VADDR 0xfffffd8000000000ULL /* Base area of the DVMA on suns */ -#define DVMA_LEN 0x0000004000000000ULL /* Size of the DVMA address space */ -#define DVMA_END 0xfffffdc000000000ULL +#define IOBASE_VADDR 0x0000006000000000ULL /* Base for mapping pages */ +#define IOBASE_LEN 0x0000001000000000ULL /* Length of the IO area */ +#define IOBASE_END 0x0000007000000000ULL +#define DVMA_VADDR 0x0000007000000000ULL /* Base area of the DVMA on suns */ +#define DVMA_LEN 0x0000001000000000ULL /* Size of the DVMA address space */ +#define DVMA_END 0x0000008000000000ULL +#define MODULES_VADDR 0x0000000001000000ULL /* Where to map modules */ +#define MODULES_LEN 0x000000007f000000ULL +#define MODULES_END 0x0000000080000000ULL #endif /* !(_SPARC_VADDRS_H) */ diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index eb91dd0fa..adf4278e6 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -19,12 +19,11 @@ struct linux_binprm{ unsigned long p; int sh_bang; int java; /* Java binary, prevent recursive invocation */ - struct inode * inode; + struct dentry * dentry; int e_uid, e_gid; int argc, envc; char * filename; /* Name of binary */ unsigned long loader, exec; - int dont_iput; /* binfmt handler has put inode */ }; /* @@ -42,15 +41,16 @@ struct linux_binfmt { extern int register_binfmt(struct linux_binfmt *); extern int unregister_binfmt(struct linux_binfmt *); -extern int read_exec(struct inode *inode, unsigned long offset, +extern int read_exec(struct dentry *, unsigned long offset, char * addr, unsigned long count, int to_kmem); -extern int open_inode(struct inode * inode, int mode); +extern int open_dentry(struct dentry *, int mode); extern int init_elf_binfmt(void); extern int init_elf32_binfmt(void); extern int init_irix_binfmt(void); extern int init_aout_binfmt(void); +extern int init_aout32_binfmt(void); extern int init_script_binfmt(void); extern int init_java_binfmt(void); extern int init_em86_binfmt(void); diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index e9ef418f7..99ed0e347 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -4,6 +4,8 @@ * Data structure and defines shared between console.c, vga.c and tga.c */ +#include <linux/config.h> + #define NPAR 16 struct vc_data { @@ -17,12 +19,17 @@ struct vc_data { unsigned char vc_halfcolor; /* Colour for half intensity mode */ unsigned long vc_origin; /* Used for EGA/VGA fast scroll */ unsigned long vc_scr_end; /* Used for EGA/VGA fast scroll */ - unsigned long vc_pos; unsigned long vc_x,vc_y; unsigned long vc_top,vc_bottom; unsigned long vc_state; unsigned long vc_npar,vc_par[NPAR]; +#ifdef CONFIG_FB_CONSOLE + unsigned short *vc_video_mem_start; /* Start of video RAM */ + unsigned short *vc_pos; +#else + unsigned long vc_pos; unsigned long vc_video_mem_start; /* Start of video RAM */ +#endif unsigned long vc_video_mem_end; /* End of video RAM (sort of) */ unsigned long vc_saved_x; unsigned long vc_saved_y; diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 9386c17f0..0b22c2e30 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -1,4 +1,4 @@ -/* $Revision: 1.7 $$Date: 1997/03/26 10:30:00 $ +/* $Revision: 2.0 $$Date: 1997/06/30 10:30:00 $ * linux/include/linux/cyclades.h * * This file is maintained by Marcio Saito <marcio@cyclades.com> and @@ -6,6 +6,9 @@ * * This file contains the general definitions for the cyclades.c driver *$Log: cyclades.h,v $ + *Revision 1.1.1.1 1997/06/01 03:17:04 ralf + *Initial import of Linux/MIPS pre-2.1.40. + * *Revision 1.7 1997/03/26 10:30:00 daniel *new entries at the end of cyclades_port struct to reallocate *variables illegally allocated within card memory. @@ -86,6 +89,8 @@ typedef unsigned char ucchar; /* 8 bits, unsigned */ */ #define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */ +#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and + 8Zo V.2 */ #define CTRL_WINDOW_SIZE (0x00000100) /* runtime regs 256 bytes */ /* @@ -183,6 +188,7 @@ struct RUNTIME_9060 { #define ID_ADDRESS 0x00000180L /* signature/pointer address */ #define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */ +#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */ struct FIRM_ID { uclong signature; /* ZFIRM/U signature */ uclong zfwctrl_addr; /* pointer to ZFW_CTRL structure */ @@ -238,7 +244,10 @@ struct FIRM_ID { #define C_IN_RXBRK 0x00001000 /* Break received */ #define C_IN_PR_ERROR 0x00002000 /* parity error */ #define C_IN_FR_ERROR 0x00004000 /* frame error */ - +#define C_IN_OVR_ERROR 0x00008000 /* overrun error */ +#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */ +#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */ + /* flow control */ #define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */ @@ -294,6 +303,8 @@ struct FIRM_ID { #define C_CM_RXBRK 0x84 /* Break received */ #define C_CM_PR_ERROR 0x85 /* Parity error */ #define C_CM_FR_ERROR 0x86 /* Frame error */ +#define C_CM_OVR_ERROR 0x87 /* Overrun error */ +#define C_CM_RXOFL 0x88 /* RX buffer overflow */ #define C_CM_CMDERROR 0x90 /* command error */ #define C_CM_FATAL 0x91 /* fatal error */ #define C_CM_HW_RESET 0x92 /* reset board */ @@ -468,9 +479,10 @@ struct cyclades_port { #define CyMaxChipsPerCard 8 -#define CyPCI_Ywin 0x4000 -#define CyPCI_Zctl 0x100 -#define CyPCI_Zwin 0x80000 +#define CyPCI_Ywin 0x4000 +#define CyPCI_Zctl 0x100 +#define CyPCI_Zwin 0x80000 +#define CyPCI_Ze_win (2 * CyPCI_Zwin) /**** CD1400 registers ****/ diff --git a/include/linux/dcache.h b/include/linux/dcache.h new file mode 100644 index 000000000..1ca8af0d7 --- /dev/null +++ b/include/linux/dcache.h @@ -0,0 +1,122 @@ +#ifndef __LINUX_DCACHE_H +#define __LINUX_DCACHE_H + +/* + * linux/include/linux/dcache.h + * + * Directory cache data structures + */ + +#define D_MAXLEN 1024 + +#define IS_ROOT(x) ((x) == (x)->d_parent) + +/* + * "quick string" -- eases parameter passing, but more importantly + * saves "metadata" about the string (ie length and the hash). + */ +struct qstr { + const unsigned char * name; + unsigned int len, hash; +}; + +/* Name hashing routines. Initial hash value */ +#define init_name_hash() 0 + +/* partial hash update function. Assume roughly 4 bits per character */ +static inline unsigned long partial_name_hash(unsigned char c, unsigned long prevhash) +{ + prevhash = (prevhash << 4) | (prevhash >> (8*sizeof(unsigned long)-4)); + return prevhash ^ c; +} + +/* Finally: cut down the number of bits to a int value (and try to avoid losing bits) */ +static inline unsigned long end_name_hash(unsigned long hash) +{ + if (sizeof(hash) > sizeof(unsigned int)) + hash += hash >> 4*sizeof(hash); + return (unsigned int) hash; +} + +struct dentry { + int d_count; + unsigned int d_flags; + struct inode * d_inode; /* Where the name belongs to - NULL is negative */ + struct dentry * d_parent; /* parent directory */ + struct dentry * d_mounts; /* mount information */ + struct dentry * d_covers; + struct list_head d_hash; /* lookup hash list */ + struct list_head d_alias; /* inode alias list */ + struct list_head d_lru; /* d_count = 0 LRU list */ + struct qstr d_name; + struct dentry * (*d_revalidate)(struct dentry *); +}; + +/* + * d_drop() unhashes the entry from the parent + * dentry hashes, so that it won't be found through + * a VFS lookup any more. Note that this is different + * from deleting the dentry - d_delete will try to + * mark the dentry negative if possible, giving a + * successful _negative_ lookup, while d_drop will + * just make the cache lookup fail. + * + * d_drop() is used mainly for stuff that wants + * to invalidate a dentry for some reason (NFS + * timeouts or autofs deletes). + */ +static inline void d_drop(struct dentry * dentry) +{ + list_del(&dentry->d_hash); + INIT_LIST_HEAD(&dentry->d_hash); +} + +/* + * These are the low-level FS interfaces to the dcache.. + */ +extern void d_instantiate(struct dentry *, struct inode *); +extern void d_delete(struct dentry *); + + +/* allocate/de-allocate */ +extern void d_free(struct dentry *); +extern struct dentry * d_alloc(struct dentry * parent, const struct qstr *name); +extern void shrink_dcache(void); + +/* only used at mount-time */ +extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root); + +/* + * This adds the entry to the hash queues and initializes "d_inode". + * The entry was actually filled in earlier during "d_alloc()" + */ +extern void d_add(struct dentry * entry, struct inode * inode); + +/* used for rename() and baskets */ +extern void d_move(struct dentry * entry, struct dentry * newparent, struct qstr * newname); + +/* appendix may either be NULL or be used for transname suffixes */ +extern struct dentry * d_lookup(struct dentry * dir, struct qstr * name); + +/* write full pathname into buffer and return length */ +extern int d_path(struct dentry * entry, struct dentry * chroot, char * buf); + +/* Allocation counts.. */ +static inline struct dentry * dget(struct dentry *dentry) +{ + if (dentry) + dentry->d_count++; + return dentry; +} + +extern void dput(struct dentry *); + +/* + * This is ugly. The inode:dentry relationship is a 1:n + * relationship, so we have to return one (random) dentry + * from the alias list. We select the first one.. + */ +#define i_dentry(inode) \ + list_entry((inode)->i_dentry.next, struct dentry, d_alias) + +#endif /* __LINUX_DCACHE_H */ diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 9c66cfc29..2831b1850 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -483,6 +483,7 @@ extern int ext2_getcluster (struct inode * inode, long block); extern void ext2_read_inode (struct inode *); extern void ext2_write_inode (struct inode *); extern void ext2_put_inode (struct inode *); +extern void ext2_delete_inode (struct inode *); extern int ext2_sync_inode (struct inode *); extern void ext2_discard_prealloc (struct inode *); @@ -492,17 +493,15 @@ extern int ext2_ioctl (struct inode *, struct file *, unsigned int, /* namei.c */ extern void ext2_release (struct inode *, struct file *); -extern int ext2_lookup (struct inode *,const char *, int, struct inode **); -extern int ext2_create (struct inode *,const char *, int, int, - struct inode **); -extern int ext2_mkdir (struct inode *, const char *, int, int); -extern int ext2_rmdir (struct inode *, const char *, int); -extern int ext2_unlink (struct inode *, const char *, int); -extern int ext2_symlink (struct inode *, const char *, int, const char *); -extern int ext2_link (struct inode *, struct inode *, const char *, int); -extern int ext2_mknod (struct inode *, const char *, int, int, int); -extern int ext2_rename (struct inode *, const char *, int, - struct inode *, const char *, int); +extern int ext2_lookup (struct inode *, struct dentry *); +extern int ext2_create (struct inode *,struct dentry *,int); +extern int ext2_mkdir (struct inode *,struct dentry *,int); +extern int ext2_rmdir (struct inode *,struct dentry *); +extern int ext2_unlink (struct inode *,struct dentry *); +extern int ext2_symlink (struct inode *,struct dentry *,const char *); +extern int ext2_link (struct inode *, struct inode *, struct dentry *); +extern int ext2_mknod (struct inode *, struct dentry *, int, int); +extern int ext2_rename (struct inode *, struct dentry *,struct inode *, struct dentry *); /* super.c */ extern void ext2_error (struct super_block *, const char *, const char *, ...) @@ -517,7 +516,7 @@ extern void ext2_write_super (struct super_block *); extern int ext2_remount (struct super_block *, int *, char *); extern struct super_block * ext2_read_super (struct super_block *,void *,int); extern int init_ext2_fs(void); -extern void ext2_statfs (struct super_block *, struct statfs *, int); +extern int ext2_statfs (struct super_block *, struct statfs *, int); /* truncate.c */ extern void ext2_truncate (struct inode *); diff --git a/include/linux/file.h b/include/linux/file.h index 0cb531c0c..b8cc01f0a 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -12,7 +12,7 @@ extern inline struct file * fget(unsigned long fd) return file; } -extern int __fput(struct file *, struct inode *); +extern int __fput(struct file *); extern void insert_file_free(struct file *file); /* It does not matter which list it is on. */ @@ -23,13 +23,13 @@ extern inline void remove_filp(struct file *file) *file->f_pprev = file->f_next; } -extern inline int fput(struct file *file, struct inode *inode) +extern inline int fput(struct file *file) { int count = file->f_count-1; int error = 0; if (!count) { - error = __fput(file, inode); + error = __fput(file); file->f_count = 0; remove_filp(file); insert_file_free(file); diff --git a/include/linux/fs.h b/include/linux/fs.h index 76fa53a7e..b459e966c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -15,12 +15,13 @@ #include <linux/net.h> #include <linux/kdev_t.h> #include <linux/ioctl.h> +#include <linux/list.h> +#include <linux/dcache.h> + #include <asm/atomic.h> +#include <asm/bitops.h> + -/* Prefixes for routines (having no effect), but indicate what - * the routine may do. This can greatly ease reasoning about routines... - */ -#define blocking /*routine may schedule()*/ /* * It's silly to have NR_OPEN bigger than NR_FILE, but I'll fix @@ -74,9 +75,6 @@ extern int max_files, nr_files; */ #define FS_IBASKET 8 /* FS does callback to free_ibasket() if space gets low. */ -/* public flags for i_status */ -#define ST_MODIFIED 1024 - /* * These are the fs-independent mount-flags: up to 16 flags are supported */ @@ -104,13 +102,6 @@ extern int max_files, nr_files; #define MS_MGC_MSK 0xffff0000 /* magic flag number mask */ /* - * Public flags for namei() - */ -#define NAM_PLAIN 0 /* Retrieve last component of pathname as is. */ -#define NAM_FOLLOW_LINK 2 /* If last component of path is a symlink, follow it */ -#define NAM_FOLLOW_TRAILSLASH 4 /* Follow last symlink only if trailed by slash. */ - -/* * Note that read-only etc flags are inode-specific: setting some file-system * flags just means all the inodes inherit those flags by default. It might be * possible to override it selectively if you really wanted to with some @@ -129,7 +120,12 @@ extern int max_files, nr_files; #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) #define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME) -#define DO_UPDATE_ATIME(inode) (!IS_NOATIME(inode) && !IS_RDONLY(inode)) + +#define UPDATE_ATIME(inode) \ + if (!IS_NOATIME(inode) && !IS_RDONLY(inode)) { \ + inode->i_atime = CURRENT_TIME; \ + mark_inode_dirty(inode); \ + } /* the read-only stuff doesn't really belong here, but any other place is probably as bad and I don't want to create yet another include file. */ @@ -155,7 +151,7 @@ extern int max_files, nr_files; extern void buffer_init(void); extern void inode_init(void); extern void file_table_init(void); -extern unsigned long name_cache_init(unsigned long start, unsigned long end); +extern void dcache_init(void); typedef char buffer_block[BLOCK_SIZE]; @@ -183,18 +179,16 @@ typedef char buffer_block[BLOCK_SIZE]; */ struct buffer_head { /* First cache line: */ + struct buffer_head * b_next; /* Hash queue list */ unsigned long b_blocknr; /* block number */ + unsigned long b_size; /* block size */ kdev_t b_dev; /* device (B_FREE = free) */ kdev_t b_rdev; /* Real device */ unsigned long b_rsector; /* Real buffer location on disk */ - struct buffer_head * b_next; /* Hash queue list */ struct buffer_head * b_this_page; /* circular list of buffers in one page */ - - /* Second cache line: */ unsigned long b_state; /* buffer state bitmap (see above) */ struct buffer_head * b_next_free; unsigned int b_count; /* users using this block */ - unsigned long b_size; /* block size */ /* Non-performance-critical data follows. */ char * b_data; /* pointer to data block (1024 bytes) */ @@ -305,14 +299,12 @@ struct iattr { #include <linux/quota.h> struct inode { - struct inode *i_hash_next; - struct inode *i_hash_prev; - struct inode *i_next; - struct inode *i_prev; + struct list_head i_hash; + struct list_head i_list; unsigned long i_ino; kdev_t i_dev; - atomic_t i_count; + unsigned short i_count; umode_t i_mode; nlink_t i_nlink; uid_t i_uid; @@ -335,28 +327,14 @@ struct inode { struct page *i_pages; struct dquot *i_dquot[MAXQUOTAS]; - struct inode *i_lru_next; - struct inode *i_lru_prev; + struct list_head i_dentry; - struct inode *i_basket_next; - struct inode *i_basket_prev; - struct dentry *i_dentry; + unsigned long i_state; - short i_ddir_count; - short i_dent_count; - unsigned short i_status; - unsigned short i_reuse_count; - - struct inode *i_mount; unsigned int i_flags; - unsigned char i_lock; - unsigned char i_dirt; unsigned char i_pipe; unsigned char i_sock; - unsigned char i_level; - unsigned short i_fill; - int i_writecount; unsigned int i_attr_flags; union { @@ -377,9 +355,21 @@ struct inode { } u; }; +/* Inode state bits.. */ +#define I_DIRTY 0 +#define I_LOCK 1 +#define I_FREEING 2 + +extern void __mark_inode_dirty(struct inode *); +static inline void mark_inode_dirty(struct inode *inode) +{ + if (!test_and_set_bit(I_DIRTY, &inode->i_state)) + __mark_inode_dirty(inode); +} + struct file { struct file *f_next, **f_pprev; - struct inode *f_inode; + struct dentry *f_dentry; struct file_operations *f_op; mode_t f_mode; loff_t f_pos; @@ -395,6 +385,8 @@ struct file { void *private_data; }; +extern int init_private_file(struct file *, struct dentry *, int); + #define FL_POSIX 1 #define FL_FLOCK 2 #define FL_BROKEN 4 /* broken flock() emulation */ @@ -503,8 +495,7 @@ struct super_block { unsigned long s_flags; unsigned long s_magic; unsigned long s_time; - struct inode *s_covered; - struct inode *s_mounted; + struct dentry *s_root; struct wait_queue *s_wait; struct inode *s_ibasket; @@ -553,16 +544,17 @@ struct file_operations { struct inode_operations { struct file_operations * default_file_ops; - int (*create) (struct inode *,const char *,int,int,struct inode **); - int (*lookup) (struct inode *,const char *,int,struct inode **); - int (*link) (struct inode *,struct inode *,const char *,int); - int (*unlink) (struct inode *,const char *,int); - int (*symlink) (struct inode *,const char *,int,const char *); - int (*mkdir) (struct inode *,const char *,int,int); - int (*rmdir) (struct inode *,const char *,int); - int (*mknod) (struct inode *,const char *,int,int,int); - int (*rename) (struct inode *,const char *,int,struct inode *,const char *,int); + int (*create) (struct inode *,struct dentry *,int); + int (*lookup) (struct inode *,struct dentry *); + int (*link) (struct inode *,struct inode *,struct dentry *); + int (*unlink) (struct inode *,struct dentry *); + int (*symlink) (struct inode *,struct dentry *,const char *); + int (*mkdir) (struct inode *,struct dentry *,int); + int (*rmdir) (struct inode *,struct dentry *); + int (*mknod) (struct inode *,struct dentry *,int,int); + int (*rename) (struct inode *,struct dentry *,struct inode *,struct dentry *); int (*readlink) (struct inode *,char *,int); + struct dentry * (*follow_link) (struct inode *, struct dentry *); int (*readpage) (struct inode *, struct page *); int (*writepage) (struct inode *, struct page *); int (*bmap) (struct inode *,int); @@ -576,12 +568,13 @@ struct inode_operations { struct super_operations { void (*read_inode) (struct inode *); - int (*notify_change) (struct inode *, struct iattr *); void (*write_inode) (struct inode *); void (*put_inode) (struct inode *); + void (*delete_inode) (struct inode *); + int (*notify_change) (struct inode *, struct iattr *); void (*put_super) (struct super_block *); void (*write_super) (struct super_block *); - void (*statfs) (struct super_block *, struct statfs *, int); + int (*statfs) (struct super_block *, struct statfs *, int); int (*remount_fs) (struct super_block *, int *, char *); }; @@ -610,7 +603,7 @@ asmlinkage int sys_close(unsigned int); /* yes, it's really unsigned */ extern void kill_fasync(struct fasync_struct *fa, int sig); -extern int getname(const char * filename, char **result); +extern char * getname(const char * filename); extern void putname(char * name); extern int do_truncate(struct inode *, unsigned long); extern int register_blkdev(unsigned int, const char *, struct file_operations *); @@ -640,8 +633,8 @@ extern struct file_operations rdwr_pipe_fops; extern struct file_system_type *get_fs_type(const char *name); extern int fs_may_mount(kdev_t dev); -extern int fs_may_umount(kdev_t dev, struct inode * mount_root); -extern int fs_may_remount_ro(kdev_t dev); +extern int fs_may_umount(struct super_block *, struct dentry * root); +extern int fs_may_remount_ro(struct super_block *); extern struct file *inuse_filps; extern struct super_block super_blocks[NR_SUPER]; @@ -689,15 +682,31 @@ extern int fsync_dev(kdev_t dev); extern void sync_supers(kdev_t dev); extern int bmap(struct inode * inode,int block); extern int notify_change(struct inode *, struct iattr *); -extern int namei(int retr_mode, const char *pathname, struct inode **res_inode); extern int permission(struct inode * inode,int mask); extern int get_write_access(struct inode *inode); extern void put_write_access(struct inode *inode); -extern int open_namei(const char * pathname, int flag, int mode, - struct inode ** res_inode, struct inode * base); -extern int do_mknod(const char * filename, int mode, dev_t dev); +extern struct dentry * open_namei(const char * pathname, int flag, int mode); +extern struct dentry * do_mknod(const char * filename, int mode, dev_t dev); extern int do_pipe(int *); +/* + * Kernel pointers have redundant information, so we can use a + * scheme where we can return either an error code or a dentry + * pointer with the same return value. + * + * This should be a per-architecture thing, to allow different + * error and pointer decisions. + */ +#define ERR_PTR(err) ((void *)((long)(err))) +#define PTR_ERR(ptr) ((long)(ptr)) +#define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000)) + +extern struct dentry * lookup_dentry(const char *, struct dentry *, int); +extern struct dentry * __namei(const char *, int); + +#define namei(pathname) __namei(pathname, 1) +#define lnamei(pathname) __namei(pathname, 0) + #include <asm/semaphore.h> /* Intended for short locks of the global data structures in inode.c. @@ -726,87 +735,19 @@ extern inline void vfs_unlock(void) /* Not to be used by ordinary vfs users */ extern void _get_inode(struct inode * inode); -extern blocking void __iput(struct inode * inode); - -/* This must not be called if the inode is not in use (i.e. given - * back with iput(). The atomic inc assumes that the inode is - * already in use, and just has to be incremented higher. - * Please do not directly manipulate i_count any more. - * Use iget, iinc and iput. - * You may test i_count for zero if you are aware that it - * might change under you. - */ -extern inline void iinc(struct inode * inode) -{ - atomic_inc(&inode->i_count); -} - -/* The same, but the inode may not be in use. This must be called - * with vfslock() held, and be asure that the inode argument is - * valid (i.e. not out of cache). So the vfs_lock() must span the - * retrieval method of the inode. - */ -extern inline void iinc_zero(struct inode * inode) -{ - if(!atomic_read(&inode->i_count)) { - atomic_inc(&inode->i_count); - _get_inode(inode); - } else - atomic_inc(&inode->i_count); -} - -extern blocking void _iput(struct inode * inode); -extern inline blocking void iput(struct inode * inode) -{ - if(inode) { - extern void wake_up_interruptible(struct wait_queue **q); +extern void iput(struct inode * inode); - if(inode->i_pipe) - wake_up_interruptible(&inode->u.pipe_i.wait); +extern struct inode * iget(struct super_block * sb, unsigned long nr); +extern void clear_inode(struct inode * inode); +extern struct inode * get_empty_inode(void); - /* It does not matter if somebody re-increments it in between, - * only the _last_ user needs to call _iput(). - */ - if(atomic_dec_and_test(&inode->i_count) && inode->i_ddir_count <= 0) - _iput(inode); - } -} - -extern blocking struct inode * __iget(struct super_block * sb, unsigned long nr, int crsmnt); -extern blocking void _clear_inode(struct inode * inode, int external, int verbose); -extern blocking inline void clear_inode(struct inode * inode) -{ - vfs_lock(); - _clear_inode(inode, 1, 1); - vfs_unlock(); -} -extern blocking struct inode * _get_empty_inode(void); -extern inline blocking struct inode * get_empty_inode(void) -{ - struct inode * inode; - vfs_lock(); - inode = _get_empty_inode(); - vfs_unlock(); - return inode; -} /* Please prefer to use this function in future, instead of using * a get_empty_inode()/insert_inode_hash() combination. * It allows for better checking and less race conditions. */ -blocking struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino); - -extern inline blocking int free_ibasket(struct super_block * sb) -{ - extern blocking int _free_ibasket(struct super_block * sb); - int res; - vfs_lock(); - res = _free_ibasket(sb); - vfs_unlock(); - return res; -} +extern struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino); extern void insert_inode_hash(struct inode *); -extern blocking struct inode * get_pipe_inode(void); extern int get_unused_fd(void); extern void put_unused_fd(int); extern struct file * get_empty_filp(void); @@ -872,12 +813,6 @@ extern int dcache_lookup(struct inode *, const char *, int, unsigned long *); extern int inode_change_ok(struct inode *, struct iattr *); extern void inode_setattr(struct inode *, struct iattr *); -extern inline blocking -struct inode * iget(struct super_block * sb, unsigned long nr) -{ - return __iget(sb, nr, 1); -} - /* kludge to get SCSI modules working */ #include <linux/minix_fs.h> #include <linux/minix_fs_sb.h> diff --git a/include/linux/ghash.h b/include/linux/ghash.h new file mode 100644 index 000000000..278f6c2f6 --- /dev/null +++ b/include/linux/ghash.h @@ -0,0 +1,218 @@ +/* + * include/linux/ghash.h -- generic hashing with fuzzy retrieval + * + * (C) 1997 Thomas Schoebel-Theuer + * + * The algorithms implemented here seem to be a completely new invention, + * and I'll publish the fundamentals in a paper. + */ + +#ifndef _GHASH_H +#define _GHASH_H +/* HASHSIZE _must_ be a power of two!!! */ + + +#define DEF_HASH_FUZZY_STRUCTS(NAME,HASHSIZE,TYPE) \ +\ +struct NAME##_table {\ + TYPE * hashtable[HASHSIZE];\ + TYPE * sorted_list;\ + int nr_entries;\ +};\ +\ +struct NAME##_ptrs {\ + TYPE * next_hash;\ + TYPE * prev_hash;\ + TYPE * next_sorted;\ + TYPE * prev_sorted;\ +}; + +#define DEF_HASH_FUZZY(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ +\ +LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + int ix = HASHFN(elem->KEY);\ + TYPE ** base = &tbl->hashtable[ix];\ + TYPE * ptr = *base;\ + TYPE * prev = NULL;\ +\ + tbl->nr_entries++;\ + while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ + base = &ptr->PTRS.next_hash;\ + prev = ptr;\ + ptr = *base;\ + }\ + elem->PTRS.next_hash = ptr;\ + elem->PTRS.prev_hash = prev;\ + if(ptr) {\ + ptr->PTRS.prev_hash = elem;\ + }\ + *base = elem;\ +\ + ptr = prev;\ + if(!ptr) {\ + ptr = tbl->sorted_list;\ + prev = NULL;\ + } else {\ + prev = ptr->PTRS.prev_sorted;\ + }\ + while(ptr) {\ + TYPE * next = ptr->PTRS.next_hash;\ + if(next && KEYCMP(next->KEY, elem->KEY)) {\ + prev = ptr;\ + ptr = next;\ + } else if(KEYCMP(ptr->KEY, elem->KEY)) {\ + prev = ptr;\ + ptr = ptr->PTRS.next_sorted;\ + } else\ + break;\ + }\ + elem->PTRS.next_sorted = ptr;\ + elem->PTRS.prev_sorted = prev;\ + if(ptr) {\ + ptr->PTRS.prev_sorted = elem;\ + }\ + if(prev) {\ + prev->PTRS.next_sorted = elem;\ + } else {\ + tbl->sorted_list = elem;\ + }\ +}\ +\ +LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + TYPE * next = elem->PTRS.next_hash;\ + TYPE * prev = elem->PTRS.prev_hash;\ +\ + tbl->nr_entries--;\ + if(next)\ + next->PTRS.prev_hash = prev;\ + if(prev)\ + prev->PTRS.next_hash = next;\ + else {\ + int ix = HASHFN(elem->KEY);\ + tbl->hashtable[ix] = next;\ + }\ +\ + next = elem->PTRS.next_sorted;\ + prev = elem->PTRS.prev_sorted;\ + if(next)\ + next->PTRS.prev_sorted = prev;\ + if(prev)\ + prev->PTRS.next_sorted = next;\ + else\ + tbl->sorted_list = next;\ +}\ +\ +LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ +{\ + int ix = hashfn(pos);\ + TYPE * ptr = tbl->hashtable[ix];\ + while(ptr && KEYCMP(ptr->KEY, pos))\ + ptr = ptr->PTRS.next_hash;\ + if(ptr && !KEYEQ(ptr->KEY, pos))\ + ptr = NULL;\ + return ptr;\ +}\ +\ +LINKAGE TYPE * find_##NAME##_hash_fuzzy(struct NAME##_table * tbl, KEYTYPE pos)\ +{\ + int ix;\ + int offset;\ + TYPE * ptr;\ + TYPE * next;\ +\ + ptr = tbl->sorted_list;\ + if(!ptr || KEYCMP(pos, ptr->KEY))\ + return NULL;\ + ix = HASHFN(pos);\ + offset = HASHSIZE;\ + do {\ + offset >>= 1;\ + next = tbl->hashtable[(ix+offset) & ((HASHSIZE)-1)];\ + if(next && (KEYCMP(next->KEY, pos) || KEYEQ(next->KEY, pos))\ + && KEYCMP(ptr->KEY, next->KEY))\ + ptr = next;\ + } while(offset);\ +\ + for(;;) {\ + next = ptr->PTRS.next_hash;\ + if(next) {\ + if(KEYCMP(next->KEY, pos)) {\ + ptr = next;\ + continue;\ + }\ + }\ + next = ptr->PTRS.next_sorted;\ + if(next && KEYCMP(next->KEY, pos)) {\ + ptr = next;\ + continue;\ + }\ + return ptr;\ + }\ + return NULL;\ +} + +#define DEF_HASH_STRUCTS(NAME,HASHSIZE,TYPE) \ +\ +struct NAME##_table {\ + TYPE * hashtable[HASHSIZE];\ + int nr_entries;\ +};\ +\ +struct NAME##_ptrs {\ + TYPE * next_hash;\ + TYPE * prev_hash;\ +}; + +#define DEF_HASH(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ +\ +LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + int ix = HASHFN(elem->KEY);\ + TYPE ** base = &tbl->hashtable[ix];\ + TYPE * ptr = *base;\ + TYPE * prev = NULL;\ +\ + tbl->nr_entries++;\ + while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ + base = &ptr->PTRS.next_hash;\ + prev = ptr;\ + ptr = *base;\ + }\ + elem->PTRS.next_hash = ptr;\ + elem->PTRS.prev_hash = prev;\ + if(ptr) {\ + ptr->PTRS.prev_hash = elem;\ + }\ + *base = elem;\ +}\ +\ +LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + TYPE * next = elem->PTRS.next_hash;\ + TYPE * prev = elem->PTRS.prev_hash;\ +\ + tbl->nr_entries--;\ + if(next)\ + next->PTRS.prev_hash = prev;\ + if(prev)\ + prev->PTRS.next_hash = next;\ + else {\ + int ix = HASHFN(elem->KEY);\ + tbl->hashtable[ix] = next;\ + }\ +}\ +\ +LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ +{\ + int ix = hashfn(pos);\ + TYPE * ptr = tbl->hashtable[ix];\ + while(ptr && KEYCMP(ptr->KEY, pos))\ + ptr = ptr->PTRS.next_hash;\ + if(ptr && !KEYEQ(ptr->KEY, pos))\ + ptr = NULL;\ + return ptr;\ +} + +#endif diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 5f18a049a..c93764cb7 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -47,6 +47,8 @@ #define ARPHRD_ROSE 270 #define ARPHRD_X25 271 /* CCITT X.25 */ #define ARPHRD_PPP 512 +#define ARPHRD_HDLC 513 /* (Cisco) HDLC */ +#define ARPHRD_LAPB 516 /* LAPB */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel */ #define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */ diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h new file mode 100644 index 000000000..abb6198af --- /dev/null +++ b/include/linux/if_shaper.h @@ -0,0 +1,61 @@ +#ifndef __LINUX_SHAPER_H +#define __LINUX_SHAPER_H + +#ifdef __KERNEL__ + +#define SHAPER_QLEN 10 +/* + * This is a bit speed dependant (read it shouldnt be a constant!) + * + * 5 is about right for 28.8 upwards. Below that double for every + * halving of speed or so. - ie about 20 for 9600 baud. + */ +#define SHAPER_LATENCY (5*HZ) +#define SHAPER_MAXSLIP 2 +#define SHAPER_BURST (HZ/50) /* Good for >128K then */ + +struct shaper +{ + struct sk_buff_head sendq; + __u32 bytespertick; + __u32 shapelatency; + __u32 shapeclock; + __u32 recovery; /* Time we can next clock a packet out on + an empty queue */ + char locked; + struct device *dev; + int (*hard_start_xmit) (struct sk_buff *skb, + struct device *dev); + int (*hard_header) (struct sk_buff *skb, + struct device *dev, + unsigned short type, + void *daddr, + void *saddr, + unsigned len); + int (*rebuild_header)(struct sk_buff *skb); + int (*hard_header_cache)(struct dst_entry *dst, struct neighbour *neigh, + struct hh_cache *hh); + void (*header_cache_update)(struct hh_cache *hh, struct device *dev, unsigned char * haddr); + struct net_device_stats* (*get_stats)(struct device *dev); + struct wait_queue *wait_queue; + struct timer_list timer; +}; + +#endif + +#define SHAPER_SET_DEV 0x0001 +#define SHAPER_SET_SPEED 0x0002 + +struct shaperconf +{ + __u16 ss_cmd; + union + { + char ssu_name[14]; + __u32 ssu_speed; + } ss_u; +#define ss_speed ss_u.ssu_speed +#define ss_name ss_u.ssu_name +}; + +#endif diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 03239cfc3..011edfe6f 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -152,8 +152,7 @@ extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inod extern int isofs_open(struct inode * inode, struct file * filp); extern void isofs_release(struct inode * inode, struct file * filp); -extern int isofs_lookup(struct inode * dir,const char * name, int len, - struct inode ** result); +extern int isofs_lookup(struct inode * dir, struct dentry *); extern unsigned long isofs_count_free_inodes(struct super_block *sb); extern int isofs_new_block(int dev); extern int isofs_free_block(int dev, int block); @@ -164,7 +163,7 @@ extern struct super_block *isofs_read_super(struct super_block *,void *,int); extern int init_iso9660_fs(void); extern void isofs_read_inode(struct inode *); extern void isofs_put_inode(struct inode *); -extern void isofs_statfs(struct super_block *, struct statfs *, int); +extern int isofs_statfs(struct super_block *, struct statfs *, int); extern int isofs_lseek(struct inode *, struct file *, off_t, int); extern int isofs_read(struct inode *, struct file *, char *, int); diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h index d8065500f..a1343a636 100644 --- a/include/linux/iso_fs_i.h +++ b/include/linux/iso_fs_i.h @@ -6,7 +6,6 @@ */ struct iso_inode_info { unsigned int i_first_extent; - unsigned int i_backlink; unsigned char i_file_format; }; diff --git a/include/linux/joystick.h b/include/linux/joystick.h new file mode 100644 index 000000000..a9a56273d --- /dev/null +++ b/include/linux/joystick.h @@ -0,0 +1,61 @@ +#ifndef _LINUX_JOYSTICK_H +#define _LINUX_JOYSTICK_H + +#define JS_RETURN sizeof(struct js_status) /*number of bytes returned by js_read*/ +#define JS_TRUE 1 +#define JS_FALSE 0 +#define JS_PORT 0x201 /*io port for joystick operations*/ +#define JS_DEF_TIMEOUT 0x1300 /*default timeout value for js_read()*/ +#define JS_DEF_CORR 0 /*default correction factor*/ +#define JS_DEF_TIMELIMIT 10L /*default data valid time =10 jiffies == 100ms*/ +#define JS_X_0 0x01 /*bit mask for x-axis js0*/ +#define JS_Y_0 0x02 /*bit mask for y-axis js0*/ +#define JS_X_1 0x04 /*bit mask for x-axis js1*/ +#define JS_Y_1 0x08 /*bit mask for y-axis js1*/ +#define JS_MAX 2 /*Max number of joysticks*/ +#define PIT_MODE 0x43 /*io port for timer 0*/ +#define PIT_COUNTER_0 0x40 /*io port for timer 0*/ +#define JSIOCSCAL 0x01 /*ioctl cmd to set joystick correction factor*/ +#define JSIOCGCAL 0x02 /*ioctl cmd to get joystick correction factor*/ +#define JSIOCSTIMEOUT 0x03 /*ioctl cmd to set maximum number of iterations + to wait for a timeout*/ +#define JSIOCGTIMEOUT 0x04 /*as above, to get*/ +#define JSIOCSTIMELIMIT 0x05 /*set data retention time*/ +#define JSIOCGTIMELIMIT 0x06 /*get data retention time*/ +#define JSIOCGCONFIG 0x07 /*get the whole js_data[minor] struct*/ +#define JSIOCSCONFIG 0x08 /*set the whole js_data[minor] struct + except js_busy!*/ + +/* + * This union is used for the ioctl to set the scaling factor and to + * return the current values for a joystick. 'buttons' is ignored on + * the ioctl call + */ + +struct js_status +{ + int buttons; + int x; + int y; +}; + +/* + * This struct is used for misc data about the joystick + */ + +struct js_config +{ + int js_timeout; /*timeout*/ + int busy; /*joystick is in use*/ + long js_expiretime; /*Time when stick after which stick must be re-read*/ + long js_timelimit; /*Max time before data is invalid*/ + struct js_status js_save; /*last read data*/ + struct js_status js_corr; /*correction factor*/ +}; + +#define LATCH (1193180L/HZ) /*initial timer 0 value*/ +#define DELTA_TIME(X,Y) ((X)-(Y)+(((X)>=(Y))?0:LATCH)) + +extern int joystick_init(void); + +#endif /* _LINUX_JOYSTICK_H */ diff --git a/include/linux/list.h b/include/linux/list.h new file mode 100644 index 000000000..84a0ecef6 --- /dev/null +++ b/include/linux/list.h @@ -0,0 +1,63 @@ +#ifndef _LINUX_LIST_H +#define _LINUX_LIST_H + +/* + * Simple doubly linked list implementation. + */ +struct list_head { + struct list_head *next, *prev; +}; + +#define LIST_HEAD(name) \ + struct list_head name = { &name, &name } + +#define INIT_LIST_HEAD(ptr) do { \ + (ptr)->next = (ptr); (ptr)->prev = (ptr); \ +} while (0) + +static inline void list_add(struct list_head *new, struct list_head *head) +{ + struct list_head *next = head->next; + next->prev = new; + new->next = next; + new->prev = head; + head->next = new; +} + +static inline void list_del(struct list_head *entry) +{ + struct list_head *next, *prev; + next = entry->next; + prev = entry->prev; + next->prev = prev; + prev->next = next; +} + +static inline int list_empty(struct list_head *head) +{ + return head->next == head; +} + +/* + * Splice in "list" into "head" + */ +static inline void list_splice(struct list_head *list, struct list_head *head) +{ + struct list_head *first = list->next; + + if (first != list) { + struct list_head *last = list->prev; + struct list_head *at = head->next; + + first->prev = head; + head->next = first; + + last->next = at; + at->prev = last; + } +} + +#define list_entry(ptr, type, member) \ + ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) + +#endif diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 72035cc5c..5c1d0e4cc 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -166,7 +166,7 @@ void nlmsvc_free_host_resources(struct nlm_host *); extern __inline__ struct inode * nlmsvc_file_inode(struct nlm_file *file) { - return file->f_file.f_inode; + return file->f_file.f_dentry->d_inode; } /* diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 069686fff..8c75cc3c5 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h @@ -88,19 +88,17 @@ struct minix_dir_entry { #ifdef __KERNEL__ -extern int minix_lookup(struct inode * dir,const char * name, int len, - struct inode ** result); -extern int minix_create(struct inode * dir,const char * name, int len, int mode, - struct inode ** result); -extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode); -extern int minix_rmdir(struct inode * dir, const char * name, int len); -extern int minix_unlink(struct inode * dir, const char * name, int len); -extern int minix_symlink(struct inode * inode, const char * name, int len, +extern int minix_lookup(struct inode * dir, struct dentry *dentry); +extern int minix_create(struct inode * dir, struct dentry *dentry, int mode); +extern int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode); +extern int minix_rmdir(struct inode * dir, struct dentry *dentry); +extern int minix_unlink(struct inode * dir, struct dentry *dentry); +extern int minix_symlink(struct inode * inode, struct dentry *dentry, const char * symname); -extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len); -extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev); -extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len, - struct inode * new_dir, const char * new_name, int new_len); +extern int minix_link(struct inode * oldinode, struct inode * dir, struct dentry *dentry); +extern int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev); +extern int minix_rename(struct inode * old_dir, struct dentry *old_dentry, + struct inode * new_dir, struct dentry *new_dentry); extern struct inode * minix_new_inode(const struct inode * dir); extern void minix_free_inode(struct inode * inode); extern unsigned long minix_count_free_inodes(struct super_block *sb); @@ -121,8 +119,7 @@ extern void minix_write_super(struct super_block *); extern int minix_remount (struct super_block * sb, int * flags, char * data); extern void minix_read_inode(struct inode *); extern void minix_write_inode(struct inode *); -extern void minix_put_inode(struct inode *); -extern void minix_statfs(struct super_block *, struct statfs *, int); +extern int minix_statfs(struct super_block *, struct statfs *, int); extern int minix_sync_inode(struct inode *); extern int minix_sync_file(struct inode *, struct file *); diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 471caa0b7..8f4bde9ab 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -8,6 +8,7 @@ #define AMIGAMOUSE_MINOR 4 #define ATARIMOUSE_MINOR 5 #define SUN_MOUSE_MINOR 6 +#define PC110PAD_MINOR 9 #define RTC_MINOR 135 #define SUN_OPENPROM_MINOR 139 #define MISC_DYNAMIC_MINOR 255 diff --git a/include/linux/mm.h b/include/linux/mm.h index c8b9046a7..bfde668c7 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -48,7 +48,7 @@ struct vm_area_struct { struct vm_operations_struct * vm_ops; unsigned long vm_offset; - struct inode * vm_inode; + struct dentry * vm_dentry; unsigned long vm_pte; /* shared mem */ }; @@ -118,7 +118,7 @@ typedef struct page { unsigned long offset; struct page *next_hash; atomic_t count; - unsigned flags; /* atomic flags, some possibly updated asynchronously */ + unsigned long flags; /* atomic flags, some possibly updated asynchronously */ unsigned dirty:16, age:8; struct wait_queue *wait; diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 36ed2a890..0badd9ebe 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -215,7 +215,7 @@ extern void fat_put_super(struct super_block *sb); extern void fat_read_inode(struct inode *inode, struct inode_operations *dir_ops); extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent); extern void msdos_put_super(struct super_block *sb); -extern void fat_statfs(struct super_block *sb,struct statfs *buf, int); +extern int fat_statfs(struct super_block *sb,struct statfs *buf, int); extern void fat_write_inode(struct inode *inode); /* dir.c */ diff --git a/include/linux/net.h b/include/linux/net.h index bd30d7804..82a4b7570 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -136,5 +136,8 @@ extern int sock_sendmsg(struct socket *, struct msghdr *m, int len); extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags); extern int sock_readv_writev(int type, struct inode * inode, struct file * file, const struct iovec * iov, long count, long size); + +int net_ratelimit(void); + #endif /* __KERNEL__ */ #endif /* _LINUX_NET_H */ diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 489762a36..75c2c91b2 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h @@ -57,7 +57,7 @@ struct knfs_fh { typedef struct svc_fh { struct knfs_fh fh_handle; /* FH data */ struct svc_export * fh_export; /* export pointer */ - struct inode * fh_inode; /* inode */ + struct dentry * fh_dentry; /* file */ size_t fh_pre_size; /* size before operation */ time_t fh_pre_mtime; /* mtime before oper */ time_t fh_pre_ctime; /* ctime before oper */ @@ -98,7 +98,7 @@ fh_init(struct svc_fh *fhp) static inline void fh_lock(struct svc_fh *fhp) { - struct inode *inode = fhp->fh_inode; + struct inode *inode = fhp->fh_dentry->d_inode; /* dfprintk(FILEOP, "nfsd: fh_lock(%x/%ld) locked = %d\n", @@ -118,7 +118,7 @@ fh_lock(struct svc_fh *fhp) static inline void fh_unlock(struct svc_fh *fhp) { - struct inode *inode = fhp->fh_inode; + struct inode *inode = fhp->fh_dentry->d_inode; if (fhp->fh_locked) { if (!fhp->fh_post_version) @@ -135,9 +135,9 @@ fh_unlock(struct svc_fh *fhp) static inline void fh_put(struct svc_fh *fhp) { - if (fhp->fh_inode) { + if (fhp->fh_dentry) { fh_unlock(fhp); - iput(fhp->fh_inode); + dput(fhp->fh_dentry); } } #else @@ -146,19 +146,19 @@ fh_put(struct svc_fh *fhp) static inline void __fh_put(struct svc_fh *fhp, char *file, int line) { - struct inode *inode; + struct dentry *dentry; - if (!(inode = fhp->fh_inode)) + if (!(dentry = fhp->fh_dentry)) return; - if (!atomic_read(&inode->i_count)) { - printk("nfsd: trying to free free inode in %s:%d\n" - " dev %04x ino %ld, mode %07o\n", - file, line, inode->i_dev, - inode->i_ino, inode->i_mode); + if (!dentry->d_count) { + printk("nfsd: trying to free free dentry in %s:%d\n" + " file %s/%s\n", + file, line, + dentry->d_parent->d_name.name, dentry->d_name.name); } else { fh_unlock(fhp); - iput(inode); + dput(dentry); } } #endif diff --git a/include/linux/omirr.h b/include/linux/omirr.h deleted file mode 100644 index 379867423..000000000 --- a/include/linux/omirr.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * fs/proc/omirr.c - online mirror support - * - * (C) 1997 Thomas Schoebel-Theuer - */ - -#ifndef OMIRR_H -#define OMIRR_H -#include <linux/fs.h> -#include <linux/dalloc.h> - -extern int omirr_print(struct dentry * ent1, struct dentry * ent2, - struct qstr * suffix, const char * fmt, ...); - -extern int omirr_printall(struct inode * inode, const char * fmt, ...); - -#endif diff --git a/include/linux/pci.h b/include/linux/pci.h index b13929d6a..138e67bfe 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -497,7 +497,7 @@ #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 #define PCI_DEVICE_ID_VIA_82C576 0x0576 #define PCI_DEVICE_ID_VIA_82C585 0x0585 -#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 +#define PCI_DEVICE_ID_VIA_82C586 0x0586 #define PCI_DEVICE_ID_VIA_82C416 0x1571 #define PCI_VENDOR_ID_VORTEX 0x1119 diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 21b39d628..3a847d72c 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -5,7 +5,6 @@ struct pipe_inode_info { struct wait_queue * wait; char * base; unsigned int start; - unsigned int len; unsigned int lock; unsigned int rd_openers; unsigned int wr_openers; @@ -16,7 +15,7 @@ struct pipe_inode_info { #define PIPE_WAIT(inode) ((inode).u.pipe_i.wait) #define PIPE_BASE(inode) ((inode).u.pipe_i.base) #define PIPE_START(inode) ((inode).u.pipe_i.start) -#define PIPE_LEN(inode) ((inode).u.pipe_i.len) +#define PIPE_LEN(inode) ((inode).i_size) #define PIPE_RD_OPENERS(inode) ((inode).u.pipe_i.rd_openers) #define PIPE_WR_OPENERS(inode) ((inode).u.pipe_i.wr_openers) #define PIPE_READERS(inode) ((inode).u.pipe_i.readers) diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index b0e33a0c6..80cdf71a7 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -310,10 +310,11 @@ static inline int proc_scsi_unregister(struct proc_dir_entry *driver, int x) extern struct super_block *proc_read_super(struct super_block *,void *,int); extern int init_proc_fs(void); extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *); -extern void proc_statfs(struct super_block *, struct statfs *, int); +extern int proc_statfs(struct super_block *, struct statfs *, int); extern void proc_read_inode(struct inode *); extern void proc_write_inode(struct inode *); -extern int proc_match(int, const char *, struct proc_dir_entry *); + +extern int proc_match(int, const char *,struct proc_dir_entry *); /* * These are generic /proc routines that use the internal @@ -323,7 +324,7 @@ extern int proc_match(int, const char *, struct proc_dir_entry *); * of the /proc/<pid> subdirectories. */ extern int proc_readdir(struct inode *, struct file *, void *, filldir_t); -extern int proc_lookup(struct inode *, const char *, int, struct inode **); +extern int proc_lookup(struct inode *, struct dentry *); struct openpromfs_dev { struct openpromfs_dev *next; @@ -335,7 +336,7 @@ struct openpromfs_dev { }; extern struct inode_operations * proc_openprom_register(int (*readdir)(struct inode *, struct file *, void *, filldir_t), - int (*lookup)(struct inode *, const char *, int, struct inode **), + int (*lookup)(struct inode *, struct qstr *, struct inode **), void (*use)(struct inode *, int), struct openpromfs_dev ***); extern void proc_openprom_deregister(void); @@ -363,9 +364,6 @@ extern struct inode_operations proc_ringbuf_inode_operations; #endif extern struct inode_operations proc_omirr_inode_operations; -/* Not sure whether this belongs here */ -int proc_arbitrary_lookup(struct inode * dir, const char * name, - int len, struct inode ** result); #endif /* diff --git a/include/linux/random.h b/include/linux/random.h index b2706ce03..7be5e9898 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -55,6 +55,8 @@ extern void get_random_bytes(void *buf, int nbytes); extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, __u16 sport, __u16 dport); +extern __u32 secure_tcp_syn_cookie(__u32 saddr, __u32 daddr, + __u16 sport, __u16 dport, __u32 sseq, __u32 count); #ifndef MODULE extern struct file_operations random_fops, urandom_fops; diff --git a/include/linux/rose.h b/include/linux/rose.h index 2ca68dbaa..cd82c95c3 100644 --- a/include/linux/rose.h +++ b/include/linux/rose.h @@ -8,8 +8,9 @@ #define ROSE_KERNEL_H #define PF_ROSE AF_ROSE -#define ROSE_MTU 128 +#define ROSE_MTU 251 +#define ROSE_DEFER 1 #define ROSE_T1 2 #define ROSE_T2 3 #define ROSE_T3 4 @@ -17,7 +18,22 @@ #define ROSE_QBITINCL 6 #define ROSE_HOLDBACK 7 +#define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0) +#define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1) #define SIOCRSL2CALL (SIOCPROTOPRIVATE+2) +#define SIOCRSACCEPT (SIOCPROTOPRIVATE+3) +#define SIOCRSCLRRT (SIOCPROTOPRIVATE+4) + +#define ROSE_DTE_ORIGINATED 0x00 +#define ROSE_NUMBER_BUSY 0x01 +#define ROSE_INVALID_FACILITY 0x03 +#define ROSE_NETWORK_CONGESTION 0x05 +#define ROSE_OUT_OF_ORDER 0x09 +#define ROSE_ACCESS_BARRED 0x0B +#define ROSE_NOT_OBTAINABLE 0x0D +#define ROSE_REMOTE_PROCEDURE 0x11 +#define ROSE_LOCAL_PROCEDURE 0x13 +#define ROSE_SHIP_ABSENT 0x39 typedef struct { char rose_addr[5]; @@ -40,4 +56,9 @@ struct rose_route_struct { ax25_address digipeaters[AX25_MAX_DIGIS]; }; +struct rose_cause_struct { + unsigned char cause; + unsigned char diagnostic; +}; + #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index 189194a49..361498ead 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -130,7 +130,7 @@ struct files_struct { struct fs_struct { int count; int umask; - struct inode * root, * pwd; + struct dentry * root, * pwd; }; #define INIT_FS { \ @@ -519,12 +519,10 @@ extern inline void __remove_wait_queue(struct wait_queue ** p, struct wait_queue { struct wait_queue * next = wait->next; struct wait_queue * head = next; + struct wait_queue * tmp; - for (;;) { - struct wait_queue * nextlist = head->next; - if (nextlist == wait) - break; - head = nextlist; + while ((tmp = head->next) != wait) { + head = tmp; } head->next = next; } diff --git a/include/linux/sdla_fr.h b/include/linux/sdla_fr.h index bcca8d58d..c66ee0ec3 100644 --- a/include/linux/sdla_fr.h +++ b/include/linux/sdla_fr.h @@ -281,7 +281,7 @@ typedef struct fr_dlc_conf } fr_dlc_conf_t; /*---------------------------------------------------------------------------- - * S502 Interrupt mode control block. + * S502 interrupt mode control block. * This structure is passed to the FR_SET_INTR_FLAGS and returned by the * FR_READ_INTR_FLAGS commands. */ @@ -292,7 +292,7 @@ typedef struct fr502_intr_ctl } fr502_intr_ctl_t; /*---------------------------------------------------------------------------- - * S508 Interrupt mode control block. + * S508 interrupt mode control block. * This structure is passed to the FR_SET_INTR_FLAGS and returned by the * FR_READ_INTR_FLAGS commands. */ @@ -306,10 +306,10 @@ typedef struct fr508_intr_ctl } fr508_intr_ctl_t; /*---------------------------------------------------------------------------- - * Channel Status. + * Channel status. * This structure is returned by the FR_READ_STATUS command. */ -typedef struct frDLCStatus +typedef struct fr_dlc_Status { unsigned char status PACKED; /* 00h: link/DLCI status */ struct @@ -317,7 +317,7 @@ typedef struct frDLCStatus unsigned short dlci PACKED; /* 01h: DLCI number */ unsigned char status PACKED; /* 03h: DLCI status */ } circuit[1] PACKED; -} frDLCStatus_t; +} fr_dlc_status_t; /* 'status' defines */ #define FR_LINK_INOPER 0x00 /* for global status (DLCI == 0) */ @@ -333,7 +333,7 @@ typedef struct frDLCStatus * This structure is returned by the FR_READ_STATISTICS command when * dcli == 0. */ -typedef struct frLinkStat +typedef struct fr_link_stat { unsigned short rx_too_long PACKED; /* 00h: */ unsigned short rx_dropped PACKED; /* 02h: */ @@ -363,14 +363,14 @@ typedef struct frLinkStat unsigned short current_T392 PACKED; /* 32h: */ unsigned short current_N392 PACKED; /* 34h: */ unsigned short current_N393 PACKED; /* 36h: */ -} frLinkStat_t; +} fr_link_stat_t; /*---------------------------------------------------------------------------- - * DLCI Statistics. + * DLCI statistics. * This structure is returned by the FR_READ_STATISTICS command when * dlci != 0. */ -typedef struct frDLCIStat +typedef struct fr_dlci_stat { unsigned long tx_frames PACKED; /* 00h: */ unsigned long tx_bytes PACKED; /* 04h: */ @@ -384,13 +384,13 @@ typedef struct frDLCIStat unsigned long tx_calc_timer PACKED; /* 24h: */ unsigned long rx_throughput PACKED; /* 28h: */ unsigned long rx_calc_timer PACKED; /* 2Ch: */ -} frDLCIStat_t; +} fr_dlci_stat_t; /*---------------------------------------------------------------------------- - * Communications Error Statistics. + * Communications error statistics. * This structure is returned by the FR_READ_ERROR_STATS command. */ -typedef struct frCommStat +typedef struct fr_comm_stat { unsigned char rx_overruns PACKED; /* 00h: */ unsigned char rx_bad_crc PACKED; /* 01h: */ @@ -401,7 +401,7 @@ typedef struct frCommStat unsigned char tx_missed_undr PACKED; /* 06h: */ unsigned char dcd_dropped PACKED; /* 07h: */ unsigned char cts_dropped PACKED; /* 08h: */ -} frCommStat_t; +} fr_comm_stat_t; /*---------------------------------------------------------------------------- * Defines for the FR_ISSUE_IS_FRAME command. diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h index 424e9fe6a..0cff58224 100644 --- a/include/linux/sdla_x25.h +++ b/include/linux/sdla_x25.h @@ -480,7 +480,7 @@ typedef struct X25Stats unsigned short rxRR PACKED; /* 3Ah: RR */ unsigned short txRNR PACKED; /* 3Ch: RNR */ unsigned short rxRNR PACKED; /* 3Eh: RNR */ -} X25Stats; +} TX25Stats; /*---------------------------------------------------------------------------- * X25_READ_HISTORY_TABLE Command. diff --git a/include/linux/selection.h b/include/linux/selection.h index d6f1248f0..cad2a29b0 100644 --- a/include/linux/selection.h +++ b/include/linux/selection.h @@ -23,11 +23,11 @@ extern unsigned long get_video_size_row(unsigned int console); #define get_video_num_columns(dummy) video_num_columns #define get_video_num_lines(dummy) video_num_lines #define get_video_size_row(dummy) video_size_row -#endif - extern unsigned long video_num_columns; extern unsigned long video_num_lines; extern unsigned long video_size_row; +#endif + extern unsigned char video_type; extern unsigned long video_mem_base; extern unsigned long video_mem_term; @@ -73,6 +73,8 @@ extern void putconsxy(int currcons, char *p); /* how to access screen memory */ +#include <linux/config.h> + #if defined(CONFIG_TGA_CONSOLE) extern int tga_blitc(unsigned int, unsigned long); diff --git a/include/linux/simp.h b/include/linux/simp.h new file mode 100644 index 000000000..bf838f815 --- /dev/null +++ b/include/linux/simp.h @@ -0,0 +1,39 @@ +/* + * include/linux/simp.h -- simple allocator for cached objects + * + * This is meant as a faster and simpler (not full-featured) replacement + * for SLAB, thus the name "simp" :-) + * + * (C) 1997 Thomas Schoebel-Theuer + */ + +#ifndef SIMP_H +#define SIMP_H + +/* used for constructors / destructors */ +typedef void (*structor)(void *); + +/* create an object cache */ +/* positive clearable_offset means the next two pointers at that offset + * can be internally used for freelist pointers when the object is + * deallocated / not in use; + * if there is no space inside the element that can be reused for + * this purpose, supply -1. Using positive offsets is essential for + * saving space with very small-sized objects. + * + * Note for big-sized objects in the range of whole pages, use + * the fast Linux page allocator instead, directly. + */ +extern struct simp * simp_create(char * name, long size, + structor first_ctor, + structor again_ctor, + structor dtor); + +/* alloc / dealloc routines */ +extern void * simp_alloc(struct simp * simp); +extern void simp_free(void * objp); + +/* garbage collection */ +extern long simp_garbage(void); + +#endif diff --git a/include/linux/slab.h b/include/linux/slab.h index 08be13221..decb1e747 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -32,7 +32,7 @@ typedef struct kmem_cache_s kmem_cache_t; #define SLAB_DEBUG_FREE 0x00000100UL /* Peform (expensive) checks on free */ #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ -#define SLAB_POISION 0x00000800UL /* Poision objects */ +#define SLAB_POISON 0x00000800UL /* Poison objects */ #define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ #if 0 @@ -56,8 +56,8 @@ extern void *kmem_cache_alloc(kmem_cache_t *, int); extern void kmem_cache_free(kmem_cache_t *, void *); extern void *kmalloc(size_t, int); -extern void kfree(void *); -extern void kfree_s(void *, size_t); +extern void kfree(const void *); +extern void kfree_s(const void *, size_t); extern int kmem_cache_reap(int, int, int); extern int get_slabinfo(char *); diff --git a/include/linux/swap.h b/include/linux/swap.h index 56fef7a21..7faaccf75 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -19,8 +19,7 @@ struct swap_info_struct { unsigned int flags; kdev_t swap_device; - char *swap_filename; - struct inode * swap_file; + struct dentry * swap_file; unsigned char * swap_map; unsigned char * swap_lockmap; unsigned int lowest_bit; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 2ec41aa05..75fdf6c3d 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -173,6 +173,7 @@ enum NET_IPV4_IGMP_AGE_THRESHOLD, NET_TCP_SYNCOOKIES, NET_TCP_ALWAYS_SYNCOOKIE, + NET_TCP_STDURG, }; diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h index e68f5d5f1..53ead0c99 100644 --- a/include/linux/sysv_fs.h +++ b/include/linux/sysv_fs.h @@ -372,8 +372,8 @@ extern int sysv_symlink(struct inode * inode, const char * name, int len, const char * symname); extern int sysv_link(struct inode * oldinode, struct inode * dir, const char * name, int len); extern int sysv_mknod(struct inode * dir, const char * name, int len, int mode, int rdev); -extern int sysv_rename(struct inode * old_dir, const char * old_name, int old_len, - struct inode * new_dir, const char * new_name, int new_len); +extern int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, + struct inode * new_dir, struct dentry * new_dentry); extern struct inode * sysv_new_inode(const struct inode * dir); extern void sysv_free_inode(struct inode * inode); extern unsigned long sysv_count_free_inodes(struct super_block *sb); @@ -396,7 +396,7 @@ extern void sysv_read_inode(struct inode *); extern int sysv_notify_change(struct inode *, struct iattr *); extern void sysv_write_inode(struct inode *); extern void sysv_put_inode(struct inode *); -extern void sysv_statfs(struct super_block *, struct statfs *, int); +extern int sysv_statfs(struct super_block *, struct statfs *, int); extern int sysv_sync_inode(struct inode *); extern int sysv_sync_file(struct inode *, struct file *); extern int sysv_mmap(struct inode *, struct file *, struct vm_area_struct *); diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h index de88d20d1..a2e1cb369 100644 --- a/include/linux/tqueue.h +++ b/include/linux/tqueue.h @@ -42,7 +42,7 @@ struct tq_struct { struct tq_struct *next; /* linked list of active bh's */ - int sync; /* must be initialized to zero */ + unsigned long sync; /* must be initialized to zero */ void (*routine)(void *); /* function to call */ void *data; /* argument to function */ }; diff --git a/include/linux/tty.h b/include/linux/tty.h index 109955a8d..589fc6b88 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -96,13 +96,19 @@ extern struct screen_info screen_info; struct tty_flip_buffer { struct tq_struct tqueue; - unsigned char char_buf[2*TTY_FLIPBUF_SIZE]; - char flag_buf[2*TTY_FLIPBUF_SIZE]; + struct semaphore pty_sem; char *char_buf_ptr; unsigned char *flag_buf_ptr; int count; int buf_num; + unsigned char char_buf[2*TTY_FLIPBUF_SIZE]; + char flag_buf[2*TTY_FLIPBUF_SIZE]; + unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */ }; +/* + * The pty uses char_buf and flag_buf as a contiguous buffer + */ +#define PTY_BUF_SIZE 4*TTY_FLIPBUF_SIZE /* * When a break, frame error, or parity error happens, these codes are @@ -204,7 +210,7 @@ struct tty_flip_buffer { * most often used by a windowing system, which will set the correct * size each time the window is created or resized anyway. * IMPORTANT: since this structure is dynamically allocated, it must - * be no larger than 4096 bytes. Changing TTY_BUF_SIZE will change + * be no larger than 4096 bytes. Changing TTY_FLIPBUF_SIZE will change * the size of this structure, and it needs to be done with care. * - TYT, 9/14/92 */ diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index af856645d..3afea01ad 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -6,7 +6,7 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_fs.h,v 1.7 1996/08/13 19:27:59 ecd Exp $ + * $Id: ufs_fs.h,v 1.1.1.1 1997/06/01 03:17:06 ralf Exp $ * */ @@ -225,7 +225,7 @@ extern void ufs_put_inode(struct inode * inode); extern void ufs_print_inode (struct inode *); /* ufs_namei.c */ -extern int ufs_lookup (struct inode *, const char *, int, struct inode **); +extern int ufs_lookup (struct inode *, struct qstr *, struct inode **); /* ufs_super.c */ extern void ufs_warning (struct super_block *, const char *, const char *, ...) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index fcc6ad09f..40072ab47 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -17,6 +17,8 @@ struct vm_struct * get_vm_area(unsigned long size); void vfree(void * addr); void * vmalloc(unsigned long size); int vread(char *buf, char *addr, int count); +void vmfree_area_pages(unsigned long address, unsigned long size); +int vmalloc_area_pages(unsigned long address, unsigned long size); extern inline void set_pgdir(unsigned long address, pgd_t entry) { @@ -34,3 +36,4 @@ extern inline void set_pgdir(unsigned long address, pgd_t entry) } #endif + diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index f36642161..922a76961 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h @@ -11,6 +11,8 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* Jan 15, 1997 Gene Kozin Version 3.1.0 +* o added UDP management stuff * Jan 02, 1997 Gene Kozin Version 3.0.0 *****************************************************************************/ #ifndef _WANPIPE_H @@ -19,6 +21,11 @@ #include <linux/wanrouter.h> /* Defines */ + +#ifndef PACKED +#define PACKED __attribute__((packed)) +#endif + #define WANPIPE_MAGIC 0x414C4453L /* signatire: 'SDLA' reversed */ /* IOCTL numbers (up to 16) */ @@ -44,6 +51,22 @@ typedef struct sdla_exec /* WANPIPE_EXEC */ void* data; /* -> data buffer */ } sdla_exec_t; +/* UDP management stuff */ + +typedef struct wum_header +{ + unsigned char signature[8]; /* 00h: signature */ + unsigned char type; /* 08h: request/reply */ + unsigned char command; /* 09h: commnand */ + unsigned char reserved[6]; /* 0Ah: reserved */ +} wum_header_t; + +#define WUM_SIGNATURE_L 0x50495046 +#define WUM_SIGNATURE_H 0x444E3845 + +#define WUM_KILL 0x50 +#define WUM_EXEC 0x51 + #ifdef __KERNEL__ /****** Kernel Interface ****************************************************/ @@ -77,6 +100,7 @@ typedef struct sdla wan_device_t wandev; /* WAN device data space */ unsigned open_cnt; /* number of open interfaces */ unsigned long state_tick; /* link state timestamp */ +/* unsigned tx_int_enabled; */ /* tranmit interrupt enabled or not */ char in_isr; /* interrupt-in-service flag */ void* mbox; /* -> mailbox */ void* rxmb; /* -> receive mailbox */ diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index 444608afb..accb9c9ee 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h @@ -1,5 +1,5 @@ /***************************************************************************** -* wanrouter.h Definitions for the WAN Multiprotocol Router Module. +* router.h Definitions for the WAN Multiprotocol Router Module. * This module provides API and common services for WAN Link * Drivers and is completely hardware-independent. * @@ -12,6 +12,10 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' tp 'wan_device_t' +* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t' +* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t' +* Jan 16, 1997 Gene Kozin router_devlist made public * Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). *****************************************************************************/ #ifndef _ROUTER_H @@ -128,7 +132,8 @@ typedef struct wandev_conf int dma; /* DMA request level */ unsigned bps; /* data transfer rate */ unsigned mtu; /* maximum transmit unit size */ - char interface; /* RS-232/V.35, etc. */ + unsigned udp_port; /* UDP port for management */ + char interface; /* RS-232/V.35, etc. */ char clocking; /* external/internal */ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ char station; /* DTE/DCE, primary/secondary, etc. */ @@ -283,6 +288,8 @@ typedef struct wan_device int dma; /* DMA request level */ unsigned bps; /* data transfer rate */ unsigned mtu; /* max physical transmit unit size */ + unsigned udp_port; /* UDP port for management */ + unsigned tx_int_enabled; /* Transmit Interrupt enabled or not */ char interface; /* RS-232/V.35, etc. */ char clocking; /* external/internal */ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ @@ -311,22 +318,24 @@ typedef struct wan_device struct proc_dir_entry dent; /* proc filesystem entry */ } wan_device_t; -/* Init Point */ -extern void wanrouter_init(void); - /* Public functions available for device drivers */ -extern int register_wan_device (wan_device_t* wandev); -extern int unregister_wan_device (char* name); -unsigned short wanrouter_type_trans (struct sk_buff* skb, struct device* dev); -int wanrouter_encapsulate (struct sk_buff* skb, struct device* dev); +extern int register_wandev (wan_device_t* wandev); +extern int unregister_wandev (char* name); +unsigned short wan_type_trans (struct sk_buff* skb, struct device* dev); +int wan_encapsulate (struct sk_buff* skb, struct device* dev); /* Proc interface functions. These must not be called by the drivers! */ extern int wanrouter_proc_init (void); extern void wanrouter_proc_cleanup (void); extern int wanrouter_proc_add (wan_device_t* wandev); extern int wanrouter_proc_delete (wan_device_t* wandev); -extern int wanrouter_ioctl(struct inode* inode, struct file* file, - unsigned int cmd, unsigned long arg); +extern int wanrouter_ioctl( + struct inode* inode, struct file* file, + unsigned int cmd, unsigned long arg) +; + +/* Public Data */ +extern wan_device_t* router_devlist; /* list of registered devices */ #endif /* __KERNEL__ */ #endif /* _ROUTER_H */ diff --git a/include/linux/wrapper.h b/include/linux/wrapper.h index 750b97084..2d6d4719f 100644 --- a/include/linux/wrapper.h +++ b/include/linux/wrapper.h @@ -20,9 +20,9 @@ #define module_unregister_blkdev unregister_blkdev #define inode_get_rdev(i) i->i_rdev -#define inode_get_count(i) atomic_read(&((i)->i_count)) -#define inode_inc_count(i) atomic_inc(&((i)->i_count)) -#define inode_dec_count(i) atomic_dec(&((i)->i_count)) +#define inode_get_count(i) i->i_count +#define inode_inc_count(i) i->i_count++ +#define inode_dec_count(i) i->i_count-- #define file_get_flags(f) f->f_flags diff --git a/include/linux/x25.h b/include/linux/x25.h index 6af8e9a5b..0435e9701 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h @@ -13,6 +13,7 @@ #define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3) #define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4) #define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5) +#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6) /* * Values for {get,set}sockopt. @@ -33,42 +34,11 @@ #define X25_PS4096 12 /* - * X.25 Reset error and diagnostic codes. - */ -#define X25_ERR_RESET 100 /* Call Reset */ -#define X25_ERR_ROUT 101 /* Out of Order */ -#define X25_ERR_RRPE 102 /* Remote Procedure Error */ -#define X25_ERR_RLPE 103 /* Local Procedure Error */ -#define X25_ERR_RNCG 104 /* Network Congestion */ -#define X25_ERR_RRDO 105 /* Remote DTE Operational */ -#define X25_ERR_RNOP 106 /* Network Operational */ -#define X25_ERR_RINV 107 /* Invalid Call */ -#define X25_ERR_RNOO 108 /* Network Out of Order */ - -/* - * X.25 Clear error and diagnostic codes. - */ -#define X25_ERR_CLEAR 110 /* Call Cleared */ -#define X25_ERR_CBUSY 111 /* Number Busy */ -#define X25_ERR_COUT 112 /* Out of Order */ -#define X25_ERR_CRPE 113 /* Remote Procedure Error */ -#define X25_ERR_CRRC 114 /* Collect Call Refused */ -#define X25_ERR_CINV 115 /* Invalid Call */ -#define X25_ERR_CNFS 116 /* Invalid Fast Select */ -#define X25_ERR_CSA 117 /* Ship Absent */ -#define X25_ERR_CIFR 118 /* Invalid Facility Request */ -#define X25_ERR_CAB 119 /* Access Barred */ -#define X25_ERR_CLPE 120 /* Local Procedure Error */ -#define X25_ERR_CNCG 121 /* Network Congestion */ -#define X25_ERR_CNOB 122 /* Not Obtainable */ -#define X25_ERR_CROO 123 /* RPOA Out of Order */ - -/* * An X.121 address, it is held as ASCII text, null terminated, up to 15 * digits and a null terminator. */ typedef struct { - char x25_addr[16]; + char x25_addr[16]; } x25_address; /* @@ -114,4 +84,12 @@ struct x25_calluserdata { unsigned char cuddata[128]; }; +/* + * Call clearing Cause and Diagnostic structure. + */ +struct x25_causediag { + unsigned char cause; + unsigned char diagnostic; +}; + #endif diff --git a/include/net/ax25.h b/include/net/ax25.h index 9e6f0df11..fd25e9f7f 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -9,10 +9,8 @@ #include <linux/config.h> #include <linux/ax25.h> -#define AX25_SLOWHZ 10 /* Run timing at 1/10 second - gives us better resolution for 56kbit links */ - -#define AX25_T1CLAMPLO (1 * AX25_SLOWHZ) /* If defined, clamp at 1 second **/ -#define AX25_T1CLAMPHI (30 * AX25_SLOWHZ) /* If defined, clamp at 30 seconds **/ +#define AX25_T1CLAMPLO 1 +#define AX25_T1CLAMPHI (30 * HZ) #define AX25_BPQ_HEADER_LEN 16 #define AX25_KISS_HEADER_LEN 1 @@ -125,14 +123,14 @@ enum { #define AX25_DEF_CONMODE 2 /* Connected mode allowed */ #define AX25_DEF_WINDOW 2 /* Window=2 */ #define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */ -#define AX25_DEF_T1 (10 * AX25_SLOWHZ) /* T1=10s */ -#define AX25_DEF_T2 (3 * AX25_SLOWHZ) /* T2=3s */ -#define AX25_DEF_T3 (300 * AX25_SLOWHZ) /* T3=300s */ +#define AX25_DEF_T1 (10 * HZ) /* T1=10s */ +#define AX25_DEF_T2 (3 * HZ) /* T2=3s */ +#define AX25_DEF_T3 (300 * HZ) /* T3=300s */ #define AX25_DEF_N2 10 /* N2=10 */ -#define AX25_DEF_IDLE (0 * 60 * AX25_SLOWHZ) /* Idle=None */ +#define AX25_DEF_IDLE (0 * 60 * HZ) /* Idle=None */ #define AX25_DEF_PACLEN 256 /* Paclen=256 */ #define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */ -#define AX25_DEF_DS_TIMEOUT (3 * 60 * AX25_SLOWHZ) /* DAMA timeout 3 minutes */ +#define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ typedef struct ax25_uid_assoc { struct ax25_uid_assoc *next; @@ -186,8 +184,8 @@ typedef struct ax25_cb { unsigned short vs, vr, va; unsigned char condition, backoff; unsigned char n2, n2count; - unsigned short t1, t2, t3, idle, rtt; - unsigned short t1timer, t2timer, t3timer, idletimer; + struct timer_list t1timer, t2timer, t3timer, idletimer; + unsigned long t1, t2, t3, idle, rtt; unsigned short paclen, fragno, fraglen; struct sk_buff_head write_queue; struct sk_buff_head reseq_queue; @@ -251,20 +249,22 @@ extern void ax25_ds_set_timer(ax25_dev *); extern void ax25_ds_del_timer(ax25_dev *); extern void ax25_ds_timer(ax25_cb *); extern void ax25_ds_t1_timeout(ax25_cb *); +extern void ax25_ds_heartbeat_expiry(ax25_cb *); +extern void ax25_ds_t3timer_expiry(ax25_cb *); +extern void ax25_ds_idletimer_expiry(ax25_cb *); #include <net/ax25call.h> /* ax25_iface.c */ extern int ax25_protocol_register(unsigned int, int (*)(struct sk_buff *, ax25_cb *)); extern void ax25_protocol_release(unsigned int); -extern int ax25_linkfail_register(void (*)(ax25_address *, struct device *)); -extern void ax25_linkfail_release(void (*)(ax25_address *, struct device *)); +extern int ax25_linkfail_register(void (*)(ax25_cb *, int)); +extern void ax25_linkfail_release(void (*)(ax25_cb *, int)); extern int ax25_listen_register(ax25_address *, struct device *); extern void ax25_listen_release(ax25_address *, struct device *); extern int (*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *); extern int ax25_listen_mine(ax25_address *, struct device *); -extern void ax25_link_failed(ax25_address *, struct device *); -extern int ax25_link_up(ax25_address *, ax25_address *, ax25_digi *, struct device *); +extern void ax25_link_failed(ax25_cb *, int); extern int ax25_protocol_is_registered(unsigned int); /* ax25_in.c */ @@ -276,7 +276,7 @@ extern int ax25_encapsulate(struct sk_buff *, struct device *, unsigned short, extern int ax25_rebuild_header(struct sk_buff *); /* ax25_out.c */ -extern int ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *, ax25_digi *, struct device *); +extern ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *, ax25_digi *, struct device *); extern void ax25_output(ax25_cb *, int, struct sk_buff *); extern void ax25_kick(ax25_cb *); extern void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int); @@ -288,9 +288,8 @@ extern void ax25_rt_device_down(struct device *); extern int ax25_rt_ioctl(unsigned int, void *); extern int ax25_rt_get_info(char *, char **, off_t, int, int); extern int ax25_rt_autobind(ax25_cb *, ax25_address *); -extern void ax25_rt_build_path(ax25_cb *, ax25_address *, struct device *); -extern struct sk_buff *ax25_dg_build_path(struct sk_buff *, ax25_address *, struct device *); -extern char ax25_ip_mode_get(ax25_address *, struct device *); +extern ax25_route *ax25_rt_find_route(ax25_address *, struct device *); +extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); extern void ax25_rt_free(void); /* ax25_std_in.c */ @@ -304,7 +303,11 @@ extern void ax25_std_enquiry_response(ax25_cb *); extern void ax25_std_timeout_response(ax25_cb *); /* ax25_std_timer.c */ -extern void ax25_std_timer(ax25_cb *); +extern void ax25_std_heartbeat_expiry(ax25_cb *); +extern void ax25_std_t1timer_expiry(ax25_cb *); +extern void ax25_std_t2timer_expiry(ax25_cb *); +extern void ax25_std_t3timer_expiry(ax25_cb *); +extern void ax25_std_idletimer_expiry(ax25_cb *); /* ax25_subr.c */ extern void ax25_clear_queues(ax25_cb *); @@ -314,11 +317,23 @@ extern int ax25_validate_nr(ax25_cb *, unsigned short); extern int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *); extern void ax25_send_control(ax25_cb *, int, int, int); extern void ax25_return_dm(struct device *, ax25_address *, ax25_address *, ax25_digi *); -extern unsigned short ax25_calculate_t1(ax25_cb *); +extern void ax25_calculate_t1(ax25_cb *); extern void ax25_calculate_rtt(ax25_cb *); +extern void ax25_disconnect(ax25_cb *, int); /* ax25_timer.c */ -extern void ax25_set_timer(ax25_cb *); +extern void ax25_start_heartbeat(ax25_cb *); +extern void ax25_start_t1timer(ax25_cb *); +extern void ax25_start_t2timer(ax25_cb *); +extern void ax25_start_t3timer(ax25_cb *); +extern void ax25_start_idletimer(ax25_cb *); +extern void ax25_stop_heartbeat(ax25_cb *); +extern void ax25_stop_t1timer(ax25_cb *); +extern void ax25_stop_t2timer(ax25_cb *); +extern void ax25_stop_t3timer(ax25_cb *); +extern void ax25_stop_idletimer(ax25_cb *); +extern int ax25_t1timer_running(ax25_cb *); +extern unsigned long ax25_display_timer(struct timer_list *); /* ax25_uid.c */ extern int ax25_uid_policy; diff --git a/include/net/lapb.h b/include/net/lapb.h index f06583cee..7cc9b3452 100644 --- a/include/net/lapb.h +++ b/include/net/lapb.h @@ -2,8 +2,6 @@ #define _LAPB_H #include <linux/lapb.h> -#define LAPB_SLOWHZ 10 /* Run timing at 1/10 second */ - #define LAPB_HEADER_LEN 20 /* LAPB over Ethernet + a bit more */ #define LAPB_ACK_PENDING_CONDITION 0x01 @@ -58,10 +56,10 @@ enum { }; #define LAPB_DEFAULT_MODE (LAPB_STANDARD | LAPB_SLP | LAPB_DTE) -#define LAPB_DEFAULT_WINDOW 7 /* Window=7 */ -#define LAPB_DEFAULT_T1 (5 * LAPB_SLOWHZ) /* T1=5s */ -#define LAPB_DEFAULT_T2 (1 * LAPB_SLOWHZ) /* T2=1s */ -#define LAPB_DEFAULT_N2 20 /* N2=20 */ +#define LAPB_DEFAULT_WINDOW 7 /* Window=7 */ +#define LAPB_DEFAULT_T1 (5 * HZ) /* T1=5s */ +#define LAPB_DEFAULT_T2 (1 * HZ) /* T2=1s */ +#define LAPB_DEFAULT_N2 20 /* N2=20 */ #define LAPB_SMODULUS 8 #define LAPB_EMODULUS 128 @@ -91,14 +89,12 @@ typedef struct lapb_cb { unsigned char condition; unsigned short n2, n2count; unsigned short t1, t2; - unsigned short t1timer, t2timer; + struct timer_list t1timer, t2timer; /* Internal control information */ - struct sk_buff_head input_queue; struct sk_buff_head write_queue; struct sk_buff_head ack_queue; unsigned char window; - struct timer_list timer; struct lapb_register_struct callbacks; /* FRMR control information */ @@ -136,7 +132,11 @@ extern void lapb_send_control(lapb_cb *, int, int, int); extern void lapb_transmit_frmr(lapb_cb *); /* lapb_timer.c */ -extern void lapb_set_timer(lapb_cb *); +extern void lapb_start_t1timer(lapb_cb *); +extern void lapb_start_t2timer(lapb_cb *); +extern void lapb_stop_t1timer(lapb_cb *); +extern void lapb_stop_t2timer(lapb_cb *); +extern int lapb_t1timer_running(lapb_cb *); /* * Debug levels. diff --git a/include/net/netrom.h b/include/net/netrom.h index 8a255660a..cc9fc842c 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h @@ -8,8 +8,6 @@ #define _NETROM_H #include <linux/netrom.h> -#define NR_SLOWHZ 10 /* Run timing at 1/10 second */ - #define NR_NETWORK_LEN 15 #define NR_TRANSPORT_LEN 5 @@ -40,17 +38,17 @@ enum { #define NR_COND_PEER_RX_BUSY 0x04 #define NR_COND_OWN_RX_BUSY 0x08 -#define NR_DEFAULT_T1 (120 * NR_SLOWHZ) /* Outstanding frames - 120 seconds */ -#define NR_DEFAULT_T2 (5 * NR_SLOWHZ) /* Response delay - 5 seconds */ -#define NR_DEFAULT_N2 3 /* Number of Retries - 3 */ -#define NR_DEFAULT_T4 (180 * NR_SLOWHZ) /* Busy Delay - 180 seconds */ -#define NR_DEFAULT_IDLE (20* 60 * NR_SLOWHZ) /* No Activuty Timeout - 900 seconds*/ -#define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */ -#define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */ -#define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */ -#define NR_DEFAULT_TTL 16 /* Default Time To Live - 16 */ -#define NR_DEFAULT_ROUTING 1 /* Is routing enabled ? */ -#define NR_DEFAULT_FAILS 2 /* Link fails until route fails */ +#define NR_DEFAULT_T1 (120 * HZ) /* Outstanding frames - 120 seconds */ +#define NR_DEFAULT_T2 (5 * HZ) /* Response delay - 5 seconds */ +#define NR_DEFAULT_N2 3 /* Number of Retries - 3 */ +#define NR_DEFAULT_T4 (180 * HZ) /* Busy Delay - 180 seconds */ +#define NR_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ +#define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */ +#define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */ +#define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */ +#define NR_DEFAULT_TTL 16 /* Default Time To Live - 16 */ +#define NR_DEFAULT_ROUTING 1 /* Is routing enabled ? */ +#define NR_DEFAULT_FAILS 2 /* Link fails until route fails */ #define NR_MODULUS 256 #define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ @@ -64,9 +62,12 @@ typedef struct { unsigned char state, condition, bpqext, window; unsigned short vs, vr, va, vl; unsigned char n2, n2count; - unsigned short t1, t2, t4, idle; - unsigned short t1timer, t2timer, t4timer, idletimer; + unsigned long t1, t2, t4, idle; unsigned short fraglen; + struct timer_list t1timer; + struct timer_list t2timer; + struct timer_list t4timer; + struct timer_list idletimer; struct sk_buff_head ack_queue; struct sk_buff_head reseq_queue; struct sk_buff_head frag_queue; @@ -77,6 +78,7 @@ struct nr_neigh { struct nr_neigh *next; ax25_address callsign; ax25_digi *digipeat; + ax25_cb *ax25; struct device *dev; unsigned char quality; unsigned char locked; @@ -138,7 +140,7 @@ extern void nr_rt_device_down(struct device *); extern struct device *nr_dev_first(void); extern struct device *nr_dev_get(ax25_address *); extern int nr_rt_ioctl(unsigned int, void *); -extern void nr_link_failed(ax25_address *, struct device *); +extern void nr_link_failed(ax25_cb *, int); extern int nr_route_frame(struct sk_buff *, ax25_cb *); extern int nr_nodes_get_info(char *, char **, off_t, int, int); extern int nr_neigh_get_info(char *, char **, off_t, int, int); @@ -152,9 +154,20 @@ extern int nr_validate_nr(struct sock *, unsigned short); extern int nr_in_rx_window(struct sock *, unsigned short); extern void nr_write_internal(struct sock *, int); extern void nr_transmit_dm(struct sk_buff *); +extern void nr_disconnect(struct sock *, int); /* nr_timer.c */ -extern void nr_set_timer(struct sock *); +extern void nr_start_heartbeat(struct sock *); +extern void nr_start_t1timer(struct sock *); +extern void nr_start_t2timer(struct sock *); +extern void nr_start_t4timer(struct sock *); +extern void nr_start_idletimer(struct sock *); +extern void nr_stop_heartbeat(struct sock *); +extern void nr_stop_t1timer(struct sock *); +extern void nr_stop_t2timer(struct sock *); +extern void nr_stop_t4timer(struct sock *); +extern void nr_stop_idletimer(struct sock *); +extern int nr_t1timer_running(struct sock *); /* sysctl_net_netrom.c */ extern void nr_register_sysctl(void); diff --git a/include/net/rose.h b/include/net/rose.h index 1e60cfa8f..86f6a6721 100644 --- a/include/net/rose.h +++ b/include/net/rose.h @@ -8,8 +8,6 @@ #define _ROSE_H #include <linux/rose.h> -#define ROSE_SLOWHZ 10 /* Run timing at 1/10 second */ - #define ROSE_ADDR_LEN 5 #define ROSE_MIN_LEN 3 @@ -45,22 +43,23 @@ enum { ROSE_STATE_1, /* Awaiting Call Accepted */ ROSE_STATE_2, /* Awaiting Clear Confirmation */ ROSE_STATE_3, /* Data Transfer */ - ROSE_STATE_4 /* Awaiting Reset Confirmation */ + ROSE_STATE_4, /* Awaiting Reset Confirmation */ + ROSE_STATE_5 /* Deferred Call Acceptance */ }; -#define ROSE_DEFAULT_T0 (180 * ROSE_SLOWHZ) /* Default T10 T20 value */ -#define ROSE_DEFAULT_T1 (200 * ROSE_SLOWHZ) /* Default T11 T21 value */ -#define ROSE_DEFAULT_T2 (180 * ROSE_SLOWHZ) /* Default T12 T22 value */ -#define ROSE_DEFAULT_T3 (180 * ROSE_SLOWHZ) /* Default T13 T23 value */ -#define ROSE_DEFAULT_HB (5 * ROSE_SLOWHZ) /* Default Holdback value */ -#define ROSE_DEFAULT_IDLE (20 * 60 * ROSE_SLOWHZ) /* Default No Activity value */ -#define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */ -#define ROSE_DEFAULT_FAIL_TIMEOUT (120 * ROSE_SLOWHZ) /* Time until link considered usable */ -#define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */ -#define ROSE_DEFAULT_WINDOW_SIZE 3 /* Default window size */ +#define ROSE_DEFAULT_T0 (180 * HZ) /* Default T10 T20 value */ +#define ROSE_DEFAULT_T1 (200 * HZ) /* Default T11 T21 value */ +#define ROSE_DEFAULT_T2 (180 * HZ) /* Default T12 T22 value */ +#define ROSE_DEFAULT_T3 (180 * HZ) /* Default T13 T23 value */ +#define ROSE_DEFAULT_HB (5 * HZ) /* Default Holdback value */ +#define ROSE_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ +#define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */ +#define ROSE_DEFAULT_FAIL_TIMEOUT (120 * HZ) /* Time until link considered usable */ +#define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */ +#define ROSE_DEFAULT_WINDOW_SIZE 3 /* Default window size */ #define ROSE_MODULUS 8 -#define ROSE_MAX_PACKET_SIZE 256 /* Maximum packet size */ +#define ROSE_MAX_PACKET_SIZE 251 /* Maximum packet size */ #define ROSE_COND_ACK_PENDING 0x01 #define ROSE_COND_PEER_RX_BUSY 0x02 @@ -81,14 +80,16 @@ struct rose_neigh { struct rose_neigh *next; ax25_address callsign; ax25_digi *digipeat; + ax25_cb *ax25; struct device *dev; unsigned short count; + unsigned short use; unsigned int number; char restarted; char dce_mode; struct sk_buff_head queue; - unsigned short t0timer, ftimer; - struct timer_list timer; + struct timer_list t0timer; + struct timer_list ftimer; }; struct rose_node { @@ -124,11 +125,13 @@ typedef struct { struct rose_neigh *neighbour; struct device *device; unsigned int lci, rand; - unsigned char state, condition, qbitincl; + unsigned char state, condition, qbitincl, defer; + unsigned char cause, diagnostic; unsigned short vs, vr, va, vl; - unsigned short timer; - unsigned short t1, t2, t3, hb, idle; + unsigned long t1, t2, t3, hb, idle; unsigned short fraglen; + struct timer_list timer; + struct timer_list idletimer; struct sk_buff_head frag_queue; struct sock *sk; /* Backlink to socket */ } rose_cb; @@ -164,12 +167,17 @@ extern int rose_init(struct device *); extern int rose_process_rx_frame(struct sock *, struct sk_buff *); /* rose_link.c */ -extern void rose_link_set_timer(struct rose_neigh *); +extern void rose_start_ftimer(struct rose_neigh *); +extern void rose_start_t0timer(struct rose_neigh *); +extern void rose_stop_ftimer(struct rose_neigh *); +extern void rose_stop_t0timer(struct rose_neigh *); +extern int rose_ftimer_running(struct rose_neigh *); +extern int rose_t0timer_running(struct rose_neigh *); extern void rose_link_rx_restart(struct sk_buff *, struct rose_neigh *, unsigned short); extern void rose_transmit_restart_request(struct rose_neigh *); extern void rose_transmit_restart_confirmation(struct rose_neigh *); extern void rose_transmit_diagnostic(struct rose_neigh *, unsigned char); -extern void rose_transmit_clear_request(struct rose_neigh *, unsigned int, unsigned char); +extern void rose_transmit_clear_request(struct rose_neigh *, unsigned int, unsigned char, unsigned char); extern void rose_transmit_link(struct sk_buff *, struct rose_neigh *); /* rose_out.c */ @@ -185,9 +193,9 @@ extern struct device *rose_dev_first(void); extern struct device *rose_dev_get(rose_address *); extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); extern struct device *rose_ax25_dev_get(char *); -extern struct rose_neigh *rose_get_neigh(rose_address *); +extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *); extern int rose_rt_ioctl(unsigned int, void *); -extern void rose_link_failed(ax25_address *, struct device *); +extern void rose_link_failed(ax25_cb *, int); extern int rose_route_frame(struct sk_buff *, ax25_cb *); extern int rose_nodes_get_info(char *, char **, off_t, int, int); extern int rose_neigh_get_info(char *, char **, off_t, int, int); @@ -201,9 +209,18 @@ extern void rose_write_internal(struct sock *, int); extern int rose_decode(struct sk_buff *, int *, int *, int *, int *, int *); extern int rose_parse_facilities(struct sk_buff *, struct rose_facilities *); extern int rose_create_facilities(unsigned char *, rose_cb *); +extern void rose_disconnect(struct sock *, int, int, int); /* rose_timer.c */ -extern void rose_set_timer(struct sock *); +extern void rose_start_heartbeat(struct sock *); +extern void rose_start_t1timer(struct sock *); +extern void rose_start_t2timer(struct sock *); +extern void rose_start_t3timer(struct sock *); +extern void rose_start_hbtimer(struct sock *); +extern void rose_start_idletimer(struct sock *); +extern void rose_stop_heartbeat(struct sock *); +extern void rose_stop_timer(struct sock *); +extern void rose_stop_idletimer(struct sock *); /* sysctl_net_rose.c */ extern void rose_register_sysctl(void); diff --git a/include/net/tcp.h b/include/net/tcp.h index cedc7f3b1..d0f812e4d 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -281,15 +281,17 @@ struct tcp_func { int (*conn_request) (struct sock *sk, struct sk_buff *skb, - void *opt, - __u32 isn); + void *opt, __u32 isn); struct sock * (*syn_recv_sock) (struct sock *sk, struct sk_buff *skb, - struct open_request *req); + struct open_request *req, + struct dst_entry *dst); +#if 0 __u32 (*init_sequence) (struct sock *sk, struct sk_buff *skb); +#endif struct sock * (*get_sock) (struct sk_buff *skb, struct tcphdr *th); @@ -385,7 +387,8 @@ extern int tcp_recvmsg(struct sock *sk, int len, int nonblock, int flags, int *addr_len); -extern void tcp_parse_options(struct tcphdr *th, struct tcp_opt *tp); +extern void tcp_parse_options(struct tcphdr *th, struct tcp_opt *tp, + int no_fancy); /* * TCP v4 functions exported for the inet6 API @@ -407,7 +410,8 @@ extern int tcp_v4_conn_request(struct sock *sk, extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, - struct open_request *req); + struct open_request *req, + struct dst_entry *dst); extern int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); @@ -417,6 +421,12 @@ extern int tcp_v4_connect(struct sock *sk, int addr_len); +/* From syncookies.c */ +extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, + struct ip_options *opt); +extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, + __u16 *mss); + extern void tcp_read_wakeup(struct sock *); extern void tcp_write_xmit(struct sock *); extern void tcp_time_wait(struct sock *); @@ -522,7 +532,6 @@ static __inline__ u16 tcp_v4_check(struct tcphdr *th, int len, return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); } - #undef STATE_TRACE #ifdef STATE_TRACE diff --git a/include/net/x25.h b/include/net/x25.h index cb1ae8bee..7b58ad4e3 100644 --- a/include/net/x25.h +++ b/include/net/x25.h @@ -8,8 +8,6 @@ #define _X25_H #include <linux/x25.h> -#define X25_SLOWHZ 1 /* Run timing at 1 Hz */ - #define X25_ADDR_LEN 16 #define X25_MAX_L2_LEN 18 /* 802.2 LLC */ @@ -67,11 +65,11 @@ enum { X25_LINK_STATE_3 }; -#define X25_DEFAULT_T20 (180 * X25_SLOWHZ) /* Default T20 value */ -#define X25_DEFAULT_T21 (200 * X25_SLOWHZ) /* Default T21 value */ -#define X25_DEFAULT_T22 (180 * X25_SLOWHZ) /* Default T22 value */ -#define X25_DEFAULT_T23 (180 * X25_SLOWHZ) /* Default T23 value */ -#define X25_DEFAULT_T2 (3 * X25_SLOWHZ) /* Default ack holdback value */ +#define X25_DEFAULT_T20 (180 * HZ) /* Default T20 value */ +#define X25_DEFAULT_T21 (200 * HZ) /* Default T21 value */ +#define X25_DEFAULT_T22 (180 * HZ) /* Default T22 value */ +#define X25_DEFAULT_T23 (180 * HZ) /* Default T23 value */ +#define X25_DEFAULT_T2 (3 * HZ) /* Default ack holdback value */ #define X25_DEFAULT_WINDOW_SIZE 2 /* Default Window Size */ #define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */ @@ -113,8 +111,8 @@ struct x25_neigh { unsigned int state; unsigned int extended; struct sk_buff_head queue; - unsigned short t20, t20timer; - struct timer_list timer; + unsigned long t20; + struct timer_list t20timer; }; typedef struct { @@ -123,13 +121,14 @@ typedef struct { unsigned int lci; unsigned char state, condition, qbitincl, intflag; unsigned short vs, vr, va, vl; - unsigned short timer; - unsigned short t2, t21, t22, t23; + unsigned long t2, t21, t22, t23; unsigned short fraglen; struct sk_buff_head fragment_queue; struct sk_buff_head interrupt_in_queue; struct sk_buff_head interrupt_out_queue; struct sock *sk; /* Backlink to socket */ + struct timer_list timer; + struct x25_causediag causediag; struct x25_facilities facilities; struct x25_calluserdata calluserdata; } x25_cb; @@ -143,8 +142,8 @@ extern int sysctl_x25_ack_holdback_timeout; extern int x25_addr_ntoa(unsigned char *, x25_address *, x25_address *); extern int x25_addr_aton(unsigned char *, x25_address *, x25_address *); -extern unsigned int x25_new_lci(void); -extern struct sock *x25_find_socket(unsigned int); +extern unsigned int x25_new_lci(struct x25_neigh *); +extern struct sock *x25_find_socket(unsigned int, struct x25_neigh *); extern void x25_destroy_socket(struct sock *); extern int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int); @@ -199,9 +198,17 @@ extern void x25_clear_queues(struct sock *); extern int x25_validate_nr(struct sock *, unsigned short); extern void x25_write_internal(struct sock *, int); extern int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *, int *); +extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char); /* x25_timer.c */ -extern void x25_set_timer(struct sock *); +extern void x25_start_heartbeat(struct sock *); +extern void x25_start_t2timer(struct sock *); +extern void x25_start_t21timer(struct sock *); +extern void x25_start_t22timer(struct sock *); +extern void x25_start_t23timer(struct sock *); +extern void x25_stop_heartbeat(struct sock *); +extern void x25_stop_timer(struct sock *); +extern unsigned long x25_display_timer(struct sock *); /* sysctl_net_x25.c */ extern void x25_register_sysctl(void); |