diff options
Diffstat (limited to 'include')
163 files changed, 3688 insertions, 1877 deletions
diff --git a/include/asm-alpha/core_mcpcia.h b/include/asm-alpha/core_mcpcia.h index fb100e508..bc3e44267 100644 --- a/include/asm-alpha/core_mcpcia.h +++ b/include/asm-alpha/core_mcpcia.h @@ -74,6 +74,10 @@ #define MCPCIA_MID(m) ((unsigned long)(m) << 33) +/* Dodge has PCI0 and PCI1 at MID 4 and 5 respectively. + Durango adds PCI2 and PCI3 at MID 6 and 7 respectively. */ +#define MCPCIA_HOSE2MID(h) ((h) + 4) + #define MCPCIA_MEM_MASK 0x07ffffff /* SPARSE Mem region mask is 27 bits */ /* diff --git a/include/asm-alpha/hardirq.h b/include/asm-alpha/hardirq.h index 86e895b83..6f8b9ffe3 100644 --- a/include/asm-alpha/hardirq.h +++ b/include/asm-alpha/hardirq.h @@ -8,8 +8,11 @@ #ifndef __SMP__ extern int __local_irq_count; #define local_irq_count(cpu) ((void)(cpu), __local_irq_count) +extern unsigned long __irq_attempt[]; +#define irq_attempt(cpu, irq) ((void)(cpu), __irq_attempt[irq]) #else #define local_irq_count(cpu) (cpu_data[cpu].irq_count) +#define irq_attempt(cpu, irq) (cpu_data[cpu].irq_attempt[irq]) #endif /* diff --git a/include/asm-alpha/hw_irq.h b/include/asm-alpha/hw_irq.h index c6af57999..1bf6629b4 100644 --- a/include/asm-alpha/hw_irq.h +++ b/include/asm-alpha/hw_irq.h @@ -1,91 +1,5 @@ -#ifndef _ALPHA_HW_IRQ_H -#define _ALPHA_HW_IRQ_H -/* - * linux/arch/alpha/kernel/irq.h - * - * Copyright (C) 1995 Linus Torvalds - * Copyright (C) 1998 Richard Henderson - * - * This file contains declarations and inline functions for interfacing - * with the IRQ handling routines in irq.c. - */ +/* This exists merely to satisfy <linux/irq.h>. There is + nothing that would go here of general interest. -#include <linux/config.h> - -#define STANDARD_INIT_IRQ_PROLOG \ - outb(0, DMA1_RESET_REG); \ - outb(0, DMA2_RESET_REG); \ - outb(0, DMA1_CLR_MASK_REG); \ - outb(0, DMA2_CLR_MASK_REG) - -extern unsigned long _alpha_irq_masks[2]; -#define alpha_irq_mask _alpha_irq_masks[0] - -extern void common_ack_irq(unsigned long irq); -extern void isa_device_interrupt(unsigned long vector, struct pt_regs * regs); -extern void srm_device_interrupt(unsigned long vector, struct pt_regs * regs); - -extern void handle_irq(int irq, int ack, struct pt_regs * regs); - -#define RTC_IRQ 8 -#ifdef CONFIG_RTC -#define TIMER_IRQ 0 /* timer is the pit */ -#else -#define TIMER_IRQ RTC_IRQ /* timer is the rtc */ -#endif - -/* - * PROBE_MASK is the bitset of irqs that we consider for autoprobing. - */ - -/* NOTE: we only handle the first 64 IRQs in this code. */ - -/* The normal mask includes all the IRQs except timer IRQ 0. */ -#define _PROBE_MASK(nr_irqs) \ - (((nr_irqs > 63) ? ~0UL : ((1UL << (nr_irqs & 63)) - 1)) & ~1UL) - -/* Mask out unused timer irq 0 and RTC irq 8. */ -#define P2K_PROBE_MASK (_PROBE_MASK(16) & ~0x101UL) - -/* Mask out unused timer irq 0, "irqs" 20-30, and the EISA cascade. */ -#define ALCOR_PROBE_MASK (_PROBE_MASK(48) & ~0xfff000000001UL) - -/* Leave timer IRQ 0 in the mask. */ -#define RUFFIAN_PROBE_MASK (_PROBE_MASK(48) | 1UL) - -/* Do not probe/enable beyond the PCI devices. */ -#define TSUNAMI_PROBE_MASK _PROBE_MASK(48) - -#if defined(CONFIG_ALPHA_GENERIC) -# define PROBE_MASK alpha_mv.irq_probe_mask -#elif defined(CONFIG_ALPHA_P2K) -# define PROBE_MASK P2K_PROBE_MASK -#elif defined(CONFIG_ALPHA_ALCOR) || defined(CONFIG_ALPHA_XLT) -# define PROBE_MASK ALCOR_PROBE_MASK -#elif defined(CONFIG_ALPHA_RUFFIAN) -# define PROBE_MASK RUFFIAN_PROBE_MASK -#elif defined(CONFIG_ALPHA_DP264) -# define PROBE_MASK TSUNAMI_PROBE_MASK -#else -# define PROBE_MASK _PROBE_MASK(NR_IRQS) -#endif - - -extern char _stext; -static inline void alpha_do_profile (unsigned long pc) -{ - if (prof_buffer && current->pid) { - pc -= (unsigned long) &_stext; - pc >>= prof_shift; - /* - * Don't ignore out-of-bounds PC values silently, - * put them into the last histogram slot, so if - * present, they will show up as a sharp peak. - */ - if (pc > prof_len - 1) - pc = prof_len - 1; - atomic_inc((atomic_t *)&prof_buffer[pc]); - } -} - -#endif + Everything of consequence is in arch/alpha/kernel/irq_impl.h, + to be used only in arch/alpha/kernel/. */ diff --git a/include/asm-alpha/hwrpb.h b/include/asm-alpha/hwrpb.h index ec710c9c8..39d84de1b 100644 --- a/include/asm-alpha/hwrpb.h +++ b/include/asm-alpha/hwrpb.h @@ -16,7 +16,7 @@ #define EV56_CPU 7 /* EV5.6 (21164) */ #define EV6_CPU 8 /* EV6 (21164) */ #define PCA56_CPU 9 /* PCA56 (21164PC) */ -#define PCA57_CPU 10 /* PCA57 (21164??) */ +#define PCA57_CPU 10 /* PCA57 (notyet) */ /* * DEC system types for Alpha systems. Found in HWRPB. @@ -62,8 +62,8 @@ #define ST_DTI_RUFFIAN 101 /* RUFFIAN systype */ /* Alpha Processor, Inc. systems */ -#define ST_API_BIAS 200 /* Offset for API systems */ -#define ST_API_NAUTILUS (ST_API_BIAS + 1) /* Nautilus systype */ +#define ST_API_BIAS 200 +#define ST_API_NAUTILUS 201 /* UP1000 systype */ struct pcb_struct { unsigned long ksp; diff --git a/include/asm-alpha/machvec.h b/include/asm-alpha/machvec.h index ccbed15fc..b8a2a1a96 100644 --- a/include/asm-alpha/machvec.h +++ b/include/asm-alpha/machvec.h @@ -22,6 +22,7 @@ struct linux_hose_info; struct pci_dev; struct pci_ops; struct pci_controler; +struct irqaction; struct alpha_machine_vector { @@ -81,7 +82,7 @@ struct alpha_machine_vector void (*init_arch)(void); void (*init_irq)(void); - void (*init_pit)(void); + void (*init_rtc)(struct irqaction *); void (*init_pci)(void); void (*kill_arch)(int); diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h index 17c61130a..d1dde606e 100644 --- a/include/asm-alpha/page.h +++ b/include/asm-alpha/page.h @@ -109,6 +109,20 @@ typedef unsigned long pgprot_t; #define BUG() __asm__ __volatile__("call_pal 129 # bugchk") #define PAGE_BUG(page) BUG() +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* !ASSEMBLY */ /* to align the pointer to the (next) page boundary */ diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index f5a9e09b8..0cf0e1c75 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h @@ -74,9 +74,9 @@ extern void pci_free_consistent(struct pci_dev *, long, void *, dma_addr_t); /* Map a single buffer of the indicate size for PCI DMA in streaming mode. The 32-bit PCI bus mastering address to use is returned. Once the device is given the dma address, the device owns this memory - until either pci_unmap_single or pci_sync_single is performed. */ + until either pci_unmap_single or pci_dma_sync_single is performed. */ -extern dma_addr_t pci_map_single(struct pci_dev *, void *, long); +extern dma_addr_t pci_map_single(struct pci_dev *, void *, long, int); /* Unmap a single streaming mode DMA translation. The DMA_ADDR and SIZE must match what was provided for in a previous pci_map_single @@ -84,7 +84,7 @@ extern dma_addr_t pci_map_single(struct pci_dev *, void *, long); the cpu to the buffer are guarenteed to see whatever the device wrote there. */ -extern void pci_unmap_single(struct pci_dev *, dma_addr_t, long); +extern void pci_unmap_single(struct pci_dev *, dma_addr_t, long, int); /* Map a set of buffers described by scatterlist in streaming mode for PCI DMA. This is the scather-gather version of the above @@ -100,13 +100,13 @@ extern void pci_unmap_single(struct pci_dev *, dma_addr_t, long); Device ownership issues as mentioned above for pci_map_single are the same here. */ -extern int pci_map_sg(struct pci_dev *, struct scatterlist *, int); +extern int pci_map_sg(struct pci_dev *, struct scatterlist *, int, int); /* Unmap a set of streaming mode DMA translations. Again, cpu read rules concerning calls here are the same as for pci_unmap_single() above. */ -extern void pci_unmap_sg(struct pci_dev *, struct scatterlist *, int); +extern void pci_unmap_sg(struct pci_dev *, struct scatterlist *, int, int); /* Make physical memory consistant for a single streaming mode DMA translation after a transfer. @@ -118,7 +118,7 @@ extern void pci_unmap_sg(struct pci_dev *, struct scatterlist *, int); again owns the buffer. */ extern inline void -pci_sync_single(struct pci_dev *dev, dma_addr_t dma_addr, long size) +pci_dma_sync_single(struct pci_dev *dev, dma_addr_t dma_addr, long size, int direction) { /* Nothing to do. */ } @@ -128,9 +128,19 @@ pci_sync_single(struct pci_dev *dev, dma_addr_t dma_addr, long size) for a scatter-gather list, same rules and usage. */ extern inline void -pci_sync_sg(struct pci_dev *dev, struct scatterlist *sg, int size) +pci_dma_sync_sg(struct pci_dev *dev, struct scatterlist *sg, int nents, int direction) { /* Nothing to do. */ } +/* Return whether the given PCI device DMA address mask can + * be supported properly. For example, if your device can + * only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) +{ + return 1; +} + #endif /* __ALPHA_PCI_H */ diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h index ae10466b8..e4689c758 100644 --- a/include/asm-alpha/pgalloc.h +++ b/include/asm-alpha/pgalloc.h @@ -9,7 +9,18 @@ #define flush_cache_range(mm, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_page_to_ram(page) do { } while (0) -#define flush_icache_range(start, end) do { } while (0) +/* + * The icache is not coherent with the dcache on alpha, thus before + * running self modified code like kernel modules we must always run + * an imb(). + */ +#ifndef __SMP__ +#define flush_icache_range(start, end) imb() +#else +#define flush_icache_range(start, end) smp_imb() +extern void smp_imb(void); +#endif +#define flush_icache_page(vma, page) do { } while (0) /* * Use a few helper functions to hide the ugly broken ASN @@ -95,6 +106,18 @@ static inline void flush_tlb(void) flush_tlb_current(current->mm); } +/* + * Flush a specified range of user mapping page tables + * from TLB. + * Although Alpha uses VPTE caches, this can be a nop, as Alpha does + * not have finegrained tlb flushing, so it will flush VPTE stuff + * during next flush_tlb_range. + */ +static inline void flush_tlb_pgtables(struct mm_struct *mm, + unsigned long start, unsigned long end) +{ +} + #ifndef __SMP__ /* * Flush everything (kernel mapping may also have @@ -145,18 +168,6 @@ static inline void flush_tlb_range(struct mm_struct *mm, flush_tlb_mm(mm); } -/* - * Flush a specified range of user mapping page tables - * from TLB. - * Although Alpha uses VPTE caches, this can be a nop, as Alpha does - * not have finegrained tlb flushing, so it will flush VPTE stuff - * during next flush_tlb_range. - */ -static inline void flush_tlb_pgtables(struct mm_struct *mm, - unsigned long start, unsigned long end) -{ -} - #else /* __SMP__ */ extern void flush_tlb_all(void); diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index a627d50ba..ff8c6e9d1 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h @@ -249,8 +249,9 @@ extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; retu #define pgd_offset_k(address) pgd_offset(&init_mm, address) /* to find an entry in a page-table-directory. */ -#define __pgd_offset(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) -#define pgd_offset(mm, address) ((mm)->pgd+__pgd_offset(address)) +#define pgd_index(address) ((address >> PGDIR_SHIFT) & PTRS_PER_PGD) +#define __pgd_offset(address) pgd_index(address) +#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) /* Find an entry in the second-level page table.. */ extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h index e342d9bd0..c189b6569 100644 --- a/include/asm-alpha/smp.h +++ b/include/asm-alpha/smp.h @@ -20,6 +20,7 @@ __hard_smp_processor_id(void) #ifdef __SMP__ #include <linux/threads.h> +#include <asm/irq.h> struct cpuinfo_alpha { unsigned long loops_per_sec; @@ -28,6 +29,8 @@ struct cpuinfo_alpha { unsigned long *pte_cache; unsigned long pgtable_cache_sz; unsigned long ipi_count; + unsigned long irq_attempt[NR_IRQS]; + unsigned long smp_local_irq_count; unsigned long prof_multiplier; unsigned long prof_counter; int irq_count, bh_count; diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h index 5b5b07921..500e473ca 100644 --- a/include/asm-arm/cpu-multi32.h +++ b/include/asm-arm/cpu-multi32.h @@ -96,6 +96,10 @@ extern struct processor { * Idle the processor */ int (*_do_idle)(void); + /* + * flush I cache for a page + */ + void (*_flush_icache_page)(unsigned long address); } processor; extern const struct processor arm6_processor_functions; @@ -123,6 +127,7 @@ extern const struct processor sa110_processor_functions; #define cpu_flush_icache_area(start,end) processor._flush_icache_area(start,end) #define cpu_cache_wback_area(start,end) processor._cache_wback_area(start,end) #define cpu_cache_purge_area(start,end) processor._cache_purge_area(start,end) +#define cpu_flush_icache_page(virt) processor._flush_icache_page(virt) #define cpu_switch_mm(pgd,tsk) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd))) diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h index fcfaf7745..0e992a564 100644 --- a/include/asm-arm/cpu-single.h +++ b/include/asm-arm/cpu-single.h @@ -35,6 +35,7 @@ #define cpu_flush_icache_area cpu_fn(CPU_NAME,_flush_icache_area) #define cpu_cache_wback_area cpu_fn(CPU_NAME,_cache_wback_area) #define cpu_cache_purge_area cpu_fn(CPU_NAME,_cache_purge_area) +#define cpu_flush_icache_page cpu_fn(CPU_NAME,_flush_icache_page) #ifndef __ASSEMBLY__ @@ -65,6 +66,7 @@ extern unsigned long cpu_reset(void); extern void cpu_flush_icache_area(unsigned long start, unsigned long size); extern void cpu_cache_wback_area(unsigned long start, unsigned long end); extern void cpu_cache_purge_area(unsigned long start, unsigned long end); +extern void cpu_flush_icache_page(unsigned long virt); #define cpu_switch_mm(pgd,tsk) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd))) diff --git a/include/asm-arm/hardirq.h b/include/asm-arm/hardirq.h index 79aec2cf6..399ba566d 100644 --- a/include/asm-arm/hardirq.h +++ b/include/asm-arm/hardirq.h @@ -9,7 +9,10 @@ extern unsigned int local_irq_count[NR_CPUS]; * Are we in an interrupt context? Either doing bottom half * or hardware interrupt processing? */ -#define in_interrupt() (local_irq_count[smp_processor_id()] + local_bh_count[smp_processor_id()] != 0) +#define in_interrupt() ({ const int __cpu = smp_processor_id(); \ + (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); }) + +#define in_irq() (local_irq_count[smp_processor_id()] != 0) #ifndef __SMP__ diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 7e2192902..871e50a65 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -15,6 +15,7 @@ #ifndef __ASM_ARM_IO_H #define __ASM_ARM_IO_H +#include <linux/types.h> #include <asm/arch/hardware.h> #include <asm/arch/io.h> #include <asm/proc/io.h> @@ -66,21 +67,31 @@ extern __inline__ void *phys_to_virt(unsigned long x) /* * ioremap and friends */ -extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); +extern void * __ioremap(unsigned long offset, size_t size, unsigned long flags); extern void __iounmap(void *addr); #define ioremap(off,sz) __arch_ioremap((off),(sz),0) #define ioremap_nocache(off,sz) __arch_ioremap((off),(sz),1) #define iounmap(_addr) __iounmap(_addr) +/* + * DMA-consistent mapping functions. These allocate/free a region of + * uncached, unwrite-buffered mapped memory space for use with DMA + * devices. This is the "generic" version. The PCI specific version + * is in pci.h + */ +extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle); +extern void consistent_free(void *vaddr); +extern void consistent_sync(void *vaddr, size_t size, int rw); + extern void __readwrite_bug(const char *fn); /* * String version of IO memory access ops: */ -extern void _memcpy_fromio(void *, unsigned long, unsigned long); -extern void _memcpy_toio(unsigned long, const void *, unsigned long); -extern void _memset_io(unsigned long, int, unsigned long); +extern void _memcpy_fromio(void *, unsigned long, size_t); +extern void _memcpy_toio(unsigned long, const void *, size_t); +extern void _memset_io(unsigned long, int, size_t); #define __raw_writeb(val,addr) __arch_putb(val,addr) #define __raw_writew(val,addr) __arch_putw(val,addr) diff --git a/include/asm-arm/md.h b/include/asm-arm/md.h deleted file mode 100644 index 0a2c5dd01..000000000 --- a/include/asm-arm/md.h +++ /dev/null @@ -1,13 +0,0 @@ -/* $Id: md.h,v 1.1 1997/12/15 15:11:57 jj Exp $ - * md.h: High speed xor_block operation for RAID4/5 - * - */ - -#ifndef __ASM_MD_H -#define __ASM_MD_H - -/* #define HAVE_ARCH_XORBLOCK */ - -#define MD_XORBLOCK_ALIGNMENT sizeof(long) - -#endif /* __ASM_MD_H */ diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index f46fadbb8..e33597ff6 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h @@ -65,6 +65,20 @@ extern void __bug(const char *file, int line, void *data); #define BUG() __bug(__FILE__, __LINE__, NULL) #define PAGE_BUG(page) __bug(__FILE__, __LINE__, page) +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* !__ASSEMBLY__ */ #include <asm/arch/memory.h> diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index 5505909d4..e0de271b3 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h @@ -3,5 +3,163 @@ #define pcibios_assign_all_busses() 0 -#endif +#define PCIBIOS_MIN_IO 0x8000 +#define PCIBIOS_MIN_MEM 0x40000000 + +#ifdef __KERNEL__ + +#include <asm/scatterlist.h> +#include <asm/io.h> + +struct pci_dev; + +/* Allocate and map kernel buffer using consistent mode DMA for a device. + * hwdev should be valid struct pci_dev pointer for PCI devices, + * NULL for PCI-like buses (ISA, EISA). + * Returns non-NULL cpu-view pointer to the buffer if successful and + * sets *dma_addrp to the pci side dma address as well, else *dma_addrp + * is undefined. + */ +#define pci_alloc_consistent(hwdev,size,handle) \ + ({ \ + void *__ret; \ + int __gfp = GFP_KERNEL; \ + \ + if ((hwdev) == NULL || \ + (hwdev)->dma_mask != 0xffffffff) \ + __gfp |= GFP_DMA; \ + \ + __ret = consistent_alloc(__gfp, (size), \ + (handle)); \ + __ret; \ + }) + +/* Free and unmap a consistent DMA buffer. + * cpu_addr is what was returned from pci_alloc_consistent, + * size must be the same as what as passed into pci_alloc_consistent, + * and likewise dma_addr must be the same as what *dma_addrp was set to. + * + * References to the memory and mappings associated with cpu_addr/dma_addr + * past this call are illegal. + */ +extern inline void +pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, + dma_addr_t dma_handle) +{ + consistent_free(vaddr); +} + +/* Map a single buffer of the indicated size for DMA in streaming mode. + * The 32-bit bus address to use is returned. + * + * Once the device is given the dma address, the device owns this memory + * until either pci_unmap_single or pci_dma_sync_single is performed. + */ +extern inline dma_addr_t +pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) +{ + consistent_sync(ptr, size, 3); + return virt_to_bus(ptr); +} + +/* Unmap a single streaming mode DMA translation. The dma_addr and size + * must match what was provided for in a previous pci_map_single call. All + * other usages are undefined. + * + * After this call, reads by the cpu to the buffer are guarenteed to see + * whatever the device wrote there. + */ +extern inline void +pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) +{ + /* nothing to do */ +} + +/* Map a set of buffers described by scatterlist in streaming + * mode for DMA. This is the scather-gather version of the + * above pci_map_single interface. Here the scatter gather list + * elements are each tagged with the appropriate dma address + * and length. They are obtained via sg_dma_{address,length}(SG). + * + * NOTE: An implementation may be able to use a smaller number of + * DMA address/length pairs than there are SG table elements. + * (for example via virtual mapping capabilities) + * The routine returns the number of addr/length pairs actually + * used, at most nents. + * + * Device ownership issues as mentioned above for pci_map_single are + * the same here. + */ +extern inline int +pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) +{ + int i; + for (i = 0; i < nents; i++, sg++) + consistent_sync(sg->address, sg->length, 3); + + return nents; +} + +/* Unmap a set of streaming mode DMA translations. + * Again, cpu read rules concerning calls here are the same as for + * pci_unmap_single() above. + */ +extern inline void +pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) +{ + /* nothing to do */ +} + +/* Make physical memory consistent for a single + * streaming mode DMA translation after a transfer. + * + * If you perform a pci_map_single() but wish to interrogate the + * buffer using the cpu, yet do not wish to teardown the PCI dma + * mapping, you must call this function before doing so. At the + * next point you give the PCI dma address back to the card, the + * device again owns the buffer. + */ +extern inline void +pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) +{ + consistent_sync(bus_to_virt(dma_handle), size, 3); +} + +/* Make physical memory consistent for a set of streaming + * mode DMA translations after a transfer. + * + * The same as pci_dma_sync_single but for a scatter-gather list, + * same rules and usage. + */ +extern inline void +pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) +{ + int i; + + for (i = 0; i < nelems; i++, sg++) + consistent_sync(sg->address, sg->length, 3); +} + +/* Return whether the given PCI device DMA address mask can + * be supported properly. For example, if your device can + * only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) +{ + return 1; +} + +/* These macros should be used after a pci_map_sg call has been done + * to get bus addresses of each of the SG entries and their lengths. + * You should only work with the number of sg entries pci_map_sg + * returns, or alternatively stop on the first sg_dma_len(sg) which + * is 0. + */ +#define sg_dma_address(sg) (virt_to_bus((sg)->address)) +#define sg_dma_len(sg) ((sg)->length) + +#endif /* __KERNEL__ */ + +#endif diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 033541764..418ed812a 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -122,9 +122,10 @@ extern __inline__ pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) #define page_pte(page) mk_pte(page, __pgprot(0)) /* to find an entry in a page-table-directory */ -#define __pgd_offset(addr) ((addr) >> PGDIR_SHIFT) +#define pgd_index(addr) ((addr) >> PGDIR_SHIFT) +#define __pgd_offset(addr) pgd_index(addr) -#define pgd_offset(mm, addr) ((mm)->pgd+__pgd_offset(addr)) +#define pgd_offset(mm, addr) ((mm)->pgd+pgd_index(addr)) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(addr) pgd_offset(&init_mm, addr) diff --git a/include/asm-arm/proc-armo/cache.h b/include/asm-arm/proc-armo/cache.h index cb0aa1975..5459eca07 100644 --- a/include/asm-arm/proc-armo/cache.h +++ b/include/asm-arm/proc-armo/cache.h @@ -6,6 +6,7 @@ #define flush_cache_range(mm,start,end) do { } while (0) #define flush_cache_page(vma,vmaddr) do { } while (0) #define flush_page_to_ram(page) do { } while (0) +#define flush_icache_page(vma,page) do { } while (0) #define flush_icache_range(start,end) do { } while (0) /* diff --git a/include/asm-arm/proc-armo/semaphore.h b/include/asm-arm/proc-armo/semaphore.h index 19fa29bf9..6926fad12 100644 --- a/include/asm-arm/proc-armo/semaphore.h +++ b/include/asm-arm/proc-armo/semaphore.h @@ -1,109 +1,75 @@ /* - * linux/include/asm-arm/proc-armo/semaphore.h + * linux/include/asm-arm/proc-armo/locks.h + * + * Copyright (C) 2000 Russell King + * + * Interrupt safe locking assembler. */ -#ifndef __ASM_PROC_SEMAPHORE_H -#define __ASM_PROC_SEMAPHORE_H +#ifndef __ASM_PROC_LOCKS_H +#define __ASM_PROC_LOCKS_H -/* - * This is ugly, but we want the default case to fall through. - * "__down" is the actual routine that waits... - */ -extern inline void down(struct semaphore * sem) -{ - __asm__ __volatile__ (" - @ atomic down operation - mov r0, pc - orr lr, r0, #0x08000000 - teqp lr, #0 - ldr lr, [%0] - and r0, r0, #0x0c000003 - subs lr, lr, #1 - str lr, [%0] - orrmi r0, r0, #0x80000000 @ set N - teqp r0, #0 - movmi r0, %0 - blmi " SYMBOL_NAME_STR(__down_failed) - : - : "r" (sem) - : "r0", "lr", "cc"); -} +#define __down_op(ptr,fail) \ + ({ \ + __asm__ __volatile__ ( \ + "@ atomic down operation\n" \ +" mov r0, pc\n" \ +" orr lr, r0, #0x08000000\n" \ +" teqp lr, #0\n" \ +" ldr lr, [%0]\n" \ +" and r0, r0, #0x0c000003\n" \ +" subs lr, lr, #1\n" \ +" str lr, [%0]\n" \ +" orrmi r0, r0, #0x80000000 @ set N\n" \ +" teqp r0, #0\n" \ +" movmi r0, %0\n" \ + blmi " SYMBOL_NAME_STR(fail) \ + : \ + : "r" (ptr) \ + : "r0", "lr", "cc"); \ + }) -/* - * This is ugly, but we want the default case to fall through. - * "__down_interruptible" is the actual routine that waits... - */ -extern inline int down_interruptible (struct semaphore * sem) -{ - int result; - __asm__ __volatile__ (" - @ atomic down operation - mov r0, pc - orr lr, r0, #0x08000000 - teqp lr, #0 - ldr lr, [%1] - and r0, r0, #0x0c000003 - subs lr, lr, #1 - str lr, [%1] - orrmi r0, r0, #0x80000000 @ set N - teqp r0, #0 - movmi r0, %1 - movpl r0, #0 - blmi " SYMBOL_NAME_STR(__down_interruptible_failed) " - mov %0, r0" - : "=r" (result) - : "r" (sem) - : "r0", "lr", "cc"); - return result; -} +#define __down_op_ret(ptr,fail) \ + ({ \ + unsigned int result; \ + __asm__ __volatile__ ( \ +" @ down_op_ret\n" \ +" mov r0, pc\n" \ +" orr lr, r0, #0x08000000\n" \ +" teqp lr, #0\n" \ +" ldr lr, [%1]\m" \ +" and r0, r0, #0x0c000003\n" \ +" subs lr, lr, #1\n" \ +" str lr, [%1]\n" \ +" orrmi r0, r0, #0x80000000 @ set N\n" \ +" teqp r0, #0\n" \ +" movmi r0, %1\n" \ +" movpl r0, #0\n" \ +" blmi " SYMBOL_NAME_STR(fail) "\n" \ +" mov %0, r0" \ + : "=&r" (result) \ + : "r" (ptr) \ + : "r0", "lr", "cc"); \ + result; \ + }) -extern inline int down_trylock(struct semaphore * sem) -{ - int result; - __asm__ __volatile__ (" - @ atomic down operation - mov r0, pc - orr lr, r0, #0x08000000 - teqp lr, #0 - ldr lr, [%1] - and r0, r0, #0x0c000003 - subs lr, lr, #1 - str lr, [%1] - orrmi r0, r0, #0x80000000 @ set N - teqp r0, #0 - movmi r0, %1 - movpl r0, #0 - blmi " SYMBOL_NAME_STR(__down_trylock_failed) " - mov %0, r0" - : "=r" (result) - : "r" (sem) - : "r0", "lr", "cc"); - return result; -} - -/* - * Note! This is subtle. We jump to wake people up only if - * the semaphore was negative (== somebody was waiting on it). - * The default case (no contention) will result in NO - * jumps for both down() and up(). - */ -extern inline void up(struct semaphore * sem) -{ - __asm__ __volatile__ (" - @ atomic up operation - mov r0, pc - orr lr, r0, #0x08000000 - teqp lr, #0 - ldr lr, [%0] - and r0, r0, #0x0c000003 - adds lr, lr, #1 - str lr, [%0] - orrle r0, r0, #0x80000000 @ set N - teqp r0, #0 - movmi r0, %0 - blmi " SYMBOL_NAME_STR(__up_wakeup) - : - : "r" (sem) - : "r0", "lr", "cc"); -} +#define __up_op(ptr,wake) \ + ({ \ + __asm__ __volatile__ ( \ + "@ up_op\n" \ + mov r0, pc\n" \ + orr lr, r0, #0x08000000\n" \ + teqp lr, #0\n" \ + ldr lr, [%0]\n" \ + and r0, r0, #0x0c000003\n" \ + adds lr, lr, #1\n" \ + str lr, [%0]\n" \ + orrle r0, r0, #0x80000000 @ set N\n" \ + teqp r0, #0\n" \ + movmi r0, %0\n" \ + blmi " SYMBOL_NAME_STR(wake) \ + : \ + : "r" (ptr) \ + : "r0", "lr", "cc"); \ + }) #endif diff --git a/include/asm-arm/proc-armv/cache.h b/include/asm-arm/proc-armv/cache.h index ac136d6ef..b6e45ebc4 100644 --- a/include/asm-arm/proc-armv/cache.h +++ b/include/asm-arm/proc-armv/cache.h @@ -1,3 +1,5 @@ +#include <asm/mman.h> + /* * Cache flushing... */ @@ -42,6 +44,12 @@ #define flush_icache_range(_start,_end) \ cpu_flush_icache_area((_start), (_end) - (_start)) +#define flush_icache_page(vma,pg) \ + do { \ + if ((vma)->vm_flags & PROT_EXEC) \ + cpu_flush_icache_page(page_address(pg)); \ + } while (0) + /* * We don't have a MEMC chip... */ diff --git a/include/asm-arm/proc-armv/locks.h b/include/asm-arm/proc-armv/locks.h new file mode 100644 index 000000000..c1cfded3e --- /dev/null +++ b/include/asm-arm/proc-armv/locks.h @@ -0,0 +1,134 @@ +/* + * linux/include/asm-arm/proc-armv/locks.h + * + * Copyright (C) 2000 Russell King + * + * Interrupt safe locking assembler. + */ +#ifndef __ASM_PROC_LOCKS_H +#define __ASM_PROC_LOCKS_H + +#define __down_op(ptr,fail) \ + ({ \ + __asm__ __volatile__( \ + "@ down_op\n" \ +" mrs r0, cpsr\n" \ +" orr lr, r0, #128\n" \ +" msr cpsr_c, lr\n" \ +" ldr lr, [%0]\n" \ +" subs lr, lr, %1\n" \ +" str lr, [%0]\n" \ +" msr cpsr_c, r0\n" \ +" movmi r0, %0\n" \ +" blmi " SYMBOL_NAME_STR(fail) \ + : \ + : "r" (ptr), "I" (1) \ + : "r0", "lr", "cc"); \ + }) + +#define __down_op_ret(ptr,fail) \ + ({ \ + unsigned int ret; \ + __asm__ __volatile__( \ + "@ down_op_ret\n" \ +" mrs r0, cpsr\n" \ +" orr lr, r0, #128\n" \ +" msr cpsr_c, lr\n" \ +" ldr lr, [%1]\n" \ +" subs lr, lr, %2\n" \ +" str lr, [%1]\n" \ +" msr cpsr_c, r0\n" \ +" movmi r0, %1\n" \ +" movpl r0, #0\n" \ +" blmi " SYMBOL_NAME_STR(fail) "\n" \ +" mov %0, r0" \ + : "=&r" (ret) \ + : "r" (ptr), "I" (1) \ + : "r0", "lr", "cc"); \ + ret; \ + }) + +#define __up_op(ptr,wake) \ + ({ \ + __asm__ __volatile__( \ + "@ up_op\n" \ +" mrs r0, cpsr\n" \ +" orr lr, r0, #128\n" \ +" msr cpsr_c, lr\n" \ +" ldr lr, [%0]\n" \ +" adds lr, lr, %1\n" \ +" str lr, [%0]\n" \ +" msr cpsr_c, r0\n" \ +" movle r0, %0\n" \ +" blle " SYMBOL_NAME_STR(wake) \ + : \ + : "r" (ptr), "I" (1) \ + : "r0", "lr", "cc"); \ + }) + +/* + * The value 0x01000000 supports up to 128 processors and + * lots of processes. BIAS must be chosen such that sub'ing + * BIAS once per CPU will result in the long remaining + * negative. + */ +#define RW_LOCK_BIAS 0x01000000 + +#define __down_op_write(ptr,fail) \ + ({ \ + __asm__ __volatile__( \ + "@ down_op_write\n" \ +" mrs r0, cpsr\n" \ +" orr lr, r0, #128\n" \ +" msr cpsr_c, lr\n" \ +" ldr lr, [%0]\n" \ +" subs lr, lr, %1\n" \ +" str lr, [%0]\n" \ +" msr cpsr_c, r0\n" \ +" movne r0, %0\n" \ +" blne " SYMBOL_NAME_STR(fail) \ + : \ + : "r" (ptr), "I" (RW_LOCK_BIAS) \ + : "r0", "lr", "cc"); \ + }) + +#define __up_op_write(ptr,wake) \ + ({ \ + __asm__ __volatile__( \ + "@ up_op_read\n" \ +" mrs r0, cpsr\n" \ +" orr lr, r0, #128\n" \ +" msr cpsr_c, lr\n" \ +" ldr lr, [%0]\n" \ +" adds lr, lr, %1\n" \ +" str lr, [%0]\n" \ +" msr cpsr_c, r0\n" \ +" movcs r0, %0\n" \ +" blcs " SYMBOL_NAME_STR(wake) \ + : \ + : "r" (ptr), "I" (RW_LOCK_BIAS) \ + : "r0", "lr", "cc"); \ + }) + +#define __down_op_read(ptr,fail) \ + __down_op(ptr, fail) + +#define __up_op_read(ptr,wake) \ + ({ \ + __asm__ __volatile__( \ + "@ up_op_read\n" \ +" mrs r0, cpsr\n" \ +" orr lr, r0, #128\n" \ +" msr cpsr_c, lr\n" \ +" ldr lr, [%0]\n" \ +" adds lr, lr, %1\n" \ +" str lr, [%0]\n" \ +" msr cpsr_c, r0\n" \ +" moveq r0, %0\n" \ +" bleq " SYMBOL_NAME_STR(wake) \ + : \ + : "r" (ptr), "I" (1) \ + : "r0", "lr", "cc"); \ + }) + +#endif diff --git a/include/asm-arm/proc-armv/semaphore.h b/include/asm-arm/proc-armv/semaphore.h deleted file mode 100644 index 45ceaa3f1..000000000 --- a/include/asm-arm/proc-armv/semaphore.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * linux/include/asm-arm/semaphore.h - */ -#ifndef __ASM_PROC_SEMAPHORE_H -#define __ASM_PROC_SEMAPHORE_H - -/* - * This is ugly, but we want the default case to fall through. - * "__down" is the actual routine that waits... - */ -extern inline void down(struct semaphore * sem) -{ - unsigned int cpsr, temp; - - __asm__ __volatile__ (" - @ atomic down operation - mrs %0, cpsr - orr %1, %0, #128 @ disable IRQs - msr cpsr, %1 - ldr %1, [%2] - bic %0, %0, #0x80000000 @ clear N - subs %1, %1, #1 - str %1, [%2] - orrmi %0, %0, #0x80000000 @ set N - msr cpsr, %0 - movmi r0, %2 - blmi " SYMBOL_NAME_STR(__down_failed) - : "=&r" (cpsr), "=&r" (temp) - : "r" (sem) - : "r0", "lr", "cc"); -} - -/* - * This is ugly, but we want the default case to fall through. - * "__down_interruptible" is the actual routine that waits... - */ -extern inline int down_interruptible (struct semaphore * sem) -{ - unsigned int cpsr, temp; - - __asm__ __volatile__ (" - @ atomic down interruptible operation - mrs %0, cpsr - orr %1, %0, #128 @ disable IRQs - msr cpsr, %1 - ldr %1, [%2] - bic %0, %0, #0x80000000 @ clear N - subs %1, %1, #1 - str %1, [%2] - orrmi %0, %0, #0x80000000 @ set N - msr cpsr, %0 - movmi r0, %2 - movpl r0, #0 - blmi " SYMBOL_NAME_STR(__down_interruptible_failed) " - mov %1, r0" - : "=&r" (cpsr), "=&r" (temp) - : "r" (sem) - : "r0", "lr", "cc"); - - return temp; -} - -extern inline int down_trylock(struct semaphore *sem) -{ - unsigned int cpsr, temp; - - __asm__ __volatile__ (" - @ atomic down try lock operation - mrs %0, cpsr - orr %1, %0, #128 @ disable IRQs - msr cpsr, %1 - ldr %1, [%2] - bic %0, %0, #0x80000000 @ clear N - subs %1, %1, #1 - str %1, [%2] - orrmi %0, %0, #0x80000000 @ set N - msr cpsr, %0 - movmi r0, %2 - movpl r0, #0 - blmi " SYMBOL_NAME_STR(__down_trylock_failed) " - mov %1, r0" - : "=&r" (cpsr), "=&r" (temp) - : "r" (sem) - : "r0", "lr", "cc"); - - return temp; -} - -/* - * Note! This is subtle. We jump to wake people up only if - * the semaphore was negative (== somebody was waiting on it). - * The default case (no contention) will result in NO - * jumps for both down() and up(). - */ -extern inline void up(struct semaphore * sem) -{ - unsigned int cpsr, temp; - - __asm__ __volatile__ (" - @ atomic up operation - mrs %0, cpsr - orr %1, %0, #128 @ disable IRQs - msr cpsr, %1 - ldr %1, [%2] - bic %0, %0, #0x80000000 @ clear N - adds %1, %1, #1 - str %1, [%2] - orrle %0, %0, #0x80000000 @ set N - msr cpsr, %0 - movmi r0, %2 - blmi " SYMBOL_NAME_STR(__up_wakeup) - : "=&r" (cpsr), "=&r" (temp) - : "r" (sem) - : "r0", "lr", "cc"); -} - -#endif diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h index 5ba171be8..0ce171a3f 100644 --- a/include/asm-arm/semaphore.h +++ b/include/asm-arm/semaphore.h @@ -9,16 +9,28 @@ #include <linux/wait.h> #include <asm/atomic.h> +#include <asm/proc/locks.h> struct semaphore { atomic_t count; int sleepers; wait_queue_head_t wait; +#if WAITQUEUE_DEBUG + long __magic; +#endif }; +#if WAITQUEUE_DEBUG +# define __SEM_DEBUG_INIT(name) \ + , (long)&(name).__magic +#else +# define __SEM_DEBUG_INIT(name) +#endif + #define __SEMAPHORE_INIT(name,count) \ { ATOMIC_INIT(count), 0, \ - __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) } + __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ + __SEM_DEBUG_INIT(name) } #define __MUTEX_INITIALIZER(name) \ __SEMAPHORE_INIT(name,1) @@ -29,12 +41,15 @@ struct semaphore { #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) -#define sema_init(sem, val) \ -do { \ - atomic_set(&((sem)->count), (val)); \ - (sem)->sleepers = 0; \ - init_waitqueue_head(&(sem)->wait); \ -} while (0) +extern inline void sema_init(struct semaphore *sem, int val) +{ + atomic_set(&sem->count, val); + sem->sleepers = 0; + init_waitqueue_head(&sem->wait); +#if WAITQUEUE_DEBUG + sem->__magic = (long)&sem->__magic; +#endif +} static inline void init_MUTEX(struct semaphore *sem) { @@ -46,18 +61,196 @@ static inline void init_MUTEX_LOCKED(struct semaphore *sem) sema_init(sem, 0); } -asmlinkage void __down_failed (void /* special register calling convention */); -asmlinkage int __down_interruptible_failed (void /* special register calling convention */); -asmlinkage int __down_trylock_failed(void /* params in registers */); -asmlinkage void __up_wakeup (void /* special register calling convention */); +/* + * special register calling convention + */ +asmlinkage void __down_failed(void); +asmlinkage int __down_interruptible_failed(void); +asmlinkage int __down_trylock_failed(void); +asmlinkage void __up_wakeup(void); extern void __down(struct semaphore * sem); extern int __down_interruptible(struct semaphore * sem); extern int __down_trylock(struct semaphore * sem); extern void __up(struct semaphore * sem); -extern spinlock_t semaphore_wake_lock; +/* + * This is ugly, but we want the default case to fall through. + * "__down" is the actual routine that waits... + */ +extern inline void down(struct semaphore * sem) +{ +#if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); +#endif + + __down_op(sem, __down_failed); +} + +/* + * This is ugly, but we want the default case to fall through. + * "__down_interruptible" is the actual routine that waits... + */ +extern inline int down_interruptible (struct semaphore * sem) +{ +#if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); +#endif + + return __down_op_ret(sem, __down_interruptible_failed); +} + +extern inline int down_trylock(struct semaphore *sem) +{ +#if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); +#endif + + return __down_op_ret(sem, __down_trylock_failed); +} + +/* + * Note! This is subtle. We jump to wake people up only if + * the semaphore was negative (== somebody was waiting on it). + * The default case (no contention) will result in NO + * jumps for both down() and up(). + */ +extern inline void up(struct semaphore * sem) +{ +#if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); +#endif + + __up_op(sem, __up_wakeup); +} + +/* rw mutexes (should that be mutices? =) -- throw rw + * spinlocks and semaphores together, and this is what we + * end up with... + * + * The lock is initialized to BIAS. This way, a writer + * subtracts BIAS ands gets 0 for the case of an uncontended + * lock. Readers decrement by 1 and see a positive value + * when uncontended, negative if there are writers waiting + * (in which case it goes to sleep). + * + * In terms of fairness, this should result in the lock + * flopping back and forth between readers and writers + * under heavy use. + * + * -ben + */ +struct rw_semaphore { + atomic_t count; + volatile unsigned char write_bias_granted; + volatile unsigned char read_bias_granted; + volatile unsigned char pad1; + volatile unsigned char pad2; + wait_queue_head_t wait; + wait_queue_head_t write_bias_wait; +#if WAITQUEUE_DEBUG + long __magic; + atomic_t readers; + atomic_t writers; +#endif +}; + +#if WAITQUEUE_DEBUG +#define __RWSEM_DEBUG_INIT , ATOMIC_INIT(0), ATOMIC_INIT(0) +#else +#define __RWSEM_DEBUG_INIT /* */ +#endif + +#define __RWSEM_INITIALIZER(name,count) \ +{ ATOMIC_INIT(count), 0, 0, 0, 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ + __WAIT_QUEUE_HEAD_INITIALIZER((name).write_bias_wait) \ + __SEM_DEBUG_INIT(name) __RWSEM_DEBUG_INIT } + +#define __DECLARE_RWSEM_GENERIC(name,count) \ + struct rw_semaphore name = __RWSEM_INITIALIZER(name,count) + +#define DECLARE_RWSEM(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS) +#define DECLARE_RWSEM_READ_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS-1) +#define DECLARE_RWSEM_WRITE_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,0) + +extern inline void init_rwsem(struct rw_semaphore *sem) +{ + atomic_set(&sem->count, RW_LOCK_BIAS); + sem->read_bias_granted = 0; + sem->write_bias_granted = 0; + init_waitqueue_head(&sem->wait); + init_waitqueue_head(&sem->write_bias_wait); +#if WAITQUEUE_DEBUG + sem->__magic = (long)&sem->__magic; + atomic_set(&sem->readers, 0); + atomic_set(&sem->writers, 0); +#endif +} + +extern struct rw_semaphore *__down_read_failed(struct rw_semaphore *sem); +extern struct rw_semaphore *__down_write_failed(struct rw_semaphore *sem); +extern struct rw_semaphore *__rwsem_wake(struct rw_semaphore *sem); + +extern inline void down_read(struct rw_semaphore *sem) +{ +#if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); +#endif + __down_op_read(sem, __down_read_failed); +#if WAITQUEUE_DEBUG + if (sem->write_bias_granted) + BUG(); + if (atomic_read(&sem->writers)) + BUG(); + atomic_inc(&sem->readers); +#endif +} + +extern inline void down_write(struct rw_semaphore *sem) +{ +#if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); +#endif + __down_op_write(sem, __down_write_failed); +#if WAITQUEUE_DEBUG + if (atomic_read(&sem->writers)) + BUG(); + if (atomic_read(&sem->readers)) + BUG(); + if (sem->read_bias_granted) + BUG(); + if (sem->write_bias_granted) + BUG(); + atomic_inc(&sem->writers); +#endif +} + +extern inline void up_read(struct rw_semaphore *sem) +{ +#if WAITQUEUE_DEBUG + if (sem->write_bias_granted) + BUG(); + if (atomic_read(&sem->writers)) + BUG(); + atomic_dec(&sem->readers); +#endif + __up_op_read(sem, __rwsem_wake); +} -#include <asm/proc/semaphore.h> +extern inline void up_write(struct rw_semaphore *sem) +{ +#if WAITQUEUE_DEBUG + if (sem->read_bias_granted) + BUG(); + if (sem->write_bias_granted) + BUG(); + if (atomic_read(&sem->readers)) + BUG(); + if (atomic_read(&sem->writers) != 1) + BUG(); + atomic_dec(&sem->writers); +#endif + __up_op_write(sem, __rwsem_wake); +} #endif diff --git a/include/asm-arm/softirq.h b/include/asm-arm/softirq.h index 28ac2eb2a..f98754813 100644 --- a/include/asm-arm/softirq.h +++ b/include/asm-arm/softirq.h @@ -9,72 +9,9 @@ extern unsigned int local_bh_count[NR_CPUS]; #define cpu_bh_disable(cpu) do { local_bh_count[(cpu)]++; barrier(); } while (0) #define cpu_bh_enable(cpu) do { barrier(); local_bh_count[(cpu)]--; } while (0) -#define cpu_bh_trylock(cpu) (local_bh_count[(cpu)] ? 0 : (local_bh_count[(cpu)] = 1)) -#define cpu_bh_endlock(cpu) (local_bh_count[(cpu)] = 0) - #define local_bh_disable() cpu_bh_disable(smp_processor_id()) #define local_bh_enable() cpu_bh_enable(smp_processor_id()) -#define get_active_bhs() (bh_mask & bh_active) -#define clear_active_bhs(x) atomic_clear_mask((x),&bh_active) - -extern inline void init_bh(int nr, void (*routine)(void)) -{ - bh_base[nr] = routine; - atomic_set(&bh_mask_count[nr], 0); - bh_mask |= 1 << nr; -} - -extern inline void remove_bh(int nr) -{ - bh_mask &= ~(1 << nr); - mb(); - bh_base[nr] = NULL; -} - -extern inline void mark_bh(int nr) -{ - set_bit(nr, &bh_active); -} - -#ifdef __SMP__ -#error SMP not supported -#else - -extern inline void start_bh_atomic(void) -{ - local_bh_disable(); - barrier(); -} - -extern inline void end_bh_atomic(void) -{ - barrier(); - local_bh_enable(); -} - -/* These are for the irq's testing the lock */ -#define softirq_trylock(cpu) (cpu_bh_trylock(cpu)) -#define softirq_endlock(cpu) (cpu_bh_endlock(cpu)) -#define synchronize_bh() barrier() - -#endif /* SMP */ - -/* - * These use a mask count to correctly handle - * nested disable/enable calls - */ -extern inline void disable_bh(int nr) -{ - bh_mask &= ~(1 << nr); - atomic_inc(&bh_mask_count[nr]); - synchronize_bh(); -} - -extern inline void enable_bh(int nr) -{ - if (atomic_dec_and_test(&bh_mask_count[nr])) - bh_mask |= 1 << nr; -} +#define in_softirq() (local_bh_count[smp_processor_id()] != 0) #endif /* __ASM_SOFTIRQ_H */ diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h index 277d778a1..3e4912a5c 100644 --- a/include/asm-arm/unaligned.h +++ b/include/asm-arm/unaligned.h @@ -1,6 +1,8 @@ #ifndef __ASM_ARM_UNALIGNED_H #define __ASM_ARM_UNALIGNED_H +#include <linux/types.h> + #define get_unaligned(ptr) \ ((__typeof__(*(ptr)))__get_unaligned_size((ptr), sizeof(*(ptr)))) diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index b941776f5..04a41eb58 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h @@ -190,7 +190,7 @@ static int fd_request_irq(void) static unsigned long dma_mem_alloc(unsigned long size) { - return __get_dma_pages(GFP_KERNEL,__get_order(size)); + return __get_dma_pages(GFP_KERNEL,get_order(size)); } @@ -207,7 +207,7 @@ static void _fd_dma_mem_free(unsigned long addr, unsigned long size) if((unsigned int) addr >= (unsigned int) high_memory) return vfree((void *)addr); else - free_pages(addr, __get_order(size)); + free_pages(addr, get_order(size)); } #define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size) diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index 4ec380c2d..7a4e9facc 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h @@ -195,15 +195,15 @@ extern void iounmap(void *addr); */ #define __ISA_IO_base ((char *)(PAGE_OFFSET)) -#define isa_readb(a) readb(__ISA_IO_base + (unsigned long)(a)) -#define isa_readw(a) readw(__ISA_IO_base + (unsigned long)(a)) -#define isa_readl(a) readl(__ISA_IO_base + (unsigned long)(a)) -#define isa_writeb(b,a) writeb(b,__ISA_IO_base + (unsigned long)(a)) -#define isa_writew(w,a) writew(w,__ISA_IO_base + (unsigned long)(a)) -#define isa_writel(l,a) writel(l,__ISA_IO_base + (unsigned long)(a)) -#define isa_memset_io(a,b,c) memset_io(__ISA_IO_base + (unsigned long)(a),(b),(c)) -#define isa_memcpy_fromio(a,b,c) memcpy_fromio((a),__ISA_IO_base + (unsigned long)(b),(c)) -#define isa_memcpy_toio(a,b,c) memcpy_toio(__ISA_IO_base + (unsigned long)(a),(b),(c)) +#define isa_readb(a) readb(__ISA_IO_base + (a)) +#define isa_readw(a) readw(__ISA_IO_base + (a)) +#define isa_readl(a) readl(__ISA_IO_base + (a)) +#define isa_writeb(b,a) writeb(b,__ISA_IO_base + (a)) +#define isa_writew(w,a) writew(w,__ISA_IO_base + (a)) +#define isa_writel(l,a) writel(l,__ISA_IO_base + (a)) +#define isa_memset_io(a,b,c) memset_io(__ISA_IO_base + (a),(b),(c)) +#define isa_memcpy_fromio(a,b,c) memcpy_fromio((a),__ISA_IO_base + (b),(c)) +#define isa_memcpy_toio(a,b,c) memcpy_toio(__ISA_IO_base + (a),(b),(c)) /* @@ -211,7 +211,7 @@ extern void iounmap(void *addr); */ #define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(b),(c),(d)) -#define isa_eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(__ISA_IO_base + (unsigned long)(b)),(c),(d)) +#define isa_eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(__ISA_IO_base + (b)),(c),(d)) static inline int check_signature(unsigned long io_addr, const unsigned char *signature, int length) diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 67855d163..9e159523a 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h @@ -94,6 +94,20 @@ extern int console_loglevel; BUG(); \ } while (0) +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* __ASSEMBLY__ */ #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h index 8cc99dda0..1e55ec60f 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-i386/pci.h @@ -52,8 +52,10 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, * until either pci_unmap_single or pci_dma_sync_single is performed. */ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); return virt_to_bus(ptr); } @@ -65,8 +67,10 @@ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, * whatever the device wrote there. */ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } @@ -86,8 +90,10 @@ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, * the same here. */ extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); return nents; } @@ -96,8 +102,10 @@ extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, * pci_unmap_single() above. */ extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } @@ -112,8 +120,10 @@ extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, */ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } @@ -125,11 +135,23 @@ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, */ extern inline void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nelems) + int nelems, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } +/* Return whether the given PCI device DMA address mask can + * be supported properly. For example, if your device can + * only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) +{ + return 1; +} + /* These macros should be used after a pci_map_sg call has been done * to get bus addresses of each of the SG entries and their lengths. * You should only work with the number of sg entries pci_map_sg diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index ef491587f..f0d1b00bf 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -26,6 +26,7 @@ extern pgd_t swapper_pg_dir[1024]; #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_page_to_ram(page) do { } while (0) #define flush_icache_range(start, end) do { } while (0) +#define flush_icache_page(vma,pg) do { } while (0) #define __flush_tlb() \ do { \ @@ -51,7 +52,7 @@ extern pgd_t swapper_pg_dir[1024]; "movl %%cr3, %0; # flush TLB \n" \ "movl %0, %%cr3; \n" \ "movl %2, %%cr4; # turn PGE back on \n" \ - : "=r" (tmpreg) \ + : "=&r" (tmpreg) \ : "r" (mmu_cr4_features & ~X86_CR4_PGE), \ "r" (mmu_cr4_features) \ : "memory"); \ @@ -129,7 +130,8 @@ extern unsigned long empty_zero_page[1024]; * area for the same reason. ;) */ #define VMALLOC_OFFSET (8*1024*1024) -#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) +#define VMALLOC_START (((unsigned long) high_memory + 2*VMALLOC_OFFSET-1) & \ + ~(VMALLOC_OFFSET-1)) #define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (FIXADDR_START) @@ -292,10 +294,11 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) /* to find an entry in a page-table-directory. */ -#define __pgd_offset(address) \ - ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) +#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) + +#define __pgd_offset(address) pgd_index(address) -#define pgd_offset(mm, address) ((mm)->pgd+__pgd_offset(address)) +#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index e5ccac281..1a4c151cd 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -419,4 +419,16 @@ unsigned long get_wchan(struct task_struct *p); #define init_task (init_task_union.task) #define init_stack (init_task_union.stack) +struct microcode { + unsigned int hdrver; + unsigned int rev; + unsigned int date; + unsigned int sig; + unsigned int cksum; + unsigned int ldrver; + unsigned int pf; + unsigned int reserved[5]; + unsigned int bits[500]; +}; + #endif /* __ASM_I386_PROCESSOR_H */ diff --git a/include/asm-ia64/dma.h b/include/asm-ia64/dma.h index 3e6185064..4e9b30a91 100644 --- a/include/asm-ia64/dma.h +++ b/include/asm-ia64/dma.h @@ -6,11 +6,11 @@ * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com> */ -#include <asm/io.h> /* need byte IO */ #include <linux/config.h> #include <linux/spinlock.h> /* And spinlocks */ #include <linux/delay.h> +#include <asm/io.h> /* need byte IO */ #ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER #define dma_outb outb_p diff --git a/include/asm-ia64/fpswa.h b/include/asm-ia64/fpswa.h index a6facbd8c..bbf8afcfd 100644 --- a/include/asm-ia64/fpswa.h +++ b/include/asm-ia64/fpswa.h @@ -9,7 +9,7 @@ * Copyright (C) 1999 Goutham Rao <goutham.rao@intel.com> */ -#if 0 +#if 1 #define FPSWA_BUG #endif diff --git a/include/asm-ia64/hardirq.h b/include/asm-ia64/hardirq.h index 95523854e..567243650 100644 --- a/include/asm-ia64/hardirq.h +++ b/include/asm-ia64/hardirq.h @@ -17,12 +17,16 @@ extern unsigned long hardirq_no[NR_CPUS]; * or hardware interrupt processing? */ +#define in_irq() (local_irq_count[smp_processor_id()] != 0) + #define in_interrupt() \ ({ \ int __cpu = smp_processor_id(); \ (local_irq_count[__cpu] + local_bh_count[__cpu]) != 0; \ }) + + #ifndef CONFIG_SMP # define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) # define hardirq_endlock(cpu) ((void) 0) diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h index b775d0a9a..22c2b2297 100644 --- a/include/asm-ia64/mmu_context.h +++ b/include/asm-ia64/mmu_context.h @@ -60,6 +60,11 @@ extern unsigned long ia64_next_context; extern void get_new_mmu_context (struct mm_struct *mm); +static inline void +enter_lazy_tlb (struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) +{ +} + extern inline unsigned long ia64_rid (unsigned long context, unsigned long region_addr) { diff --git a/include/asm-ia64/offsets.h b/include/asm-ia64/offsets.h index 9639a9e40..d989cb911 100644 --- a/include/asm-ia64/offsets.h +++ b/include/asm-ia64/offsets.h @@ -10,7 +10,7 @@ #define PF_PTRACED_BIT 4 -#define IA64_TASK_SIZE 2752 /* 0xac0 */ +#define IA64_TASK_SIZE 3280 /* 0xcd0 */ #define IA64_PT_REGS_SIZE 400 /* 0x190 */ #define IA64_SWITCH_STACK_SIZE 560 /* 0x230 */ #define IA64_SIGINFO_SIZE 136 /* 0x88 */ @@ -18,8 +18,9 @@ #define IA64_TASK_FLAGS_OFFSET 8 /* 0x8 */ #define IA64_TASK_SIGPENDING_OFFSET 16 /* 0x10 */ #define IA64_TASK_NEED_RESCHED_OFFSET 40 /* 0x28 */ -#define IA64_TASK_THREAD_OFFSET 912 /* 0x390 */ -#define IA64_TASK_THREAD_KSP_OFFSET 912 /* 0x390 */ +#define IA64_TASK_PROCESSOR_OFFSET 108 /* 0x6c */ +#define IA64_TASK_THREAD_OFFSET 1424 /* 0x590 */ +#define IA64_TASK_THREAD_KSP_OFFSET 1424 /* 0x590 */ #define IA64_TASK_PID_OFFSET 188 /* 0xbc */ #define IA64_TASK_MM_OFFSET 88 /* 0x58 */ #define IA64_PT_REGS_CR_IPSR_OFFSET 0 /* 0x0 */ diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 64d044599..53eb9f963 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h @@ -127,6 +127,18 @@ typedef union ia64_va { #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0) #define PAGE_BUG(page) do { BUG(); } while (0) +extern __inline__ int get_order(unsigned long size) +{ + double d = size - 1; + long order; + + __asm__ ("getf.exp %0=%1" : "=r"(order) : "f"(d)); + order = order - PAGE_SHIFT - 0xffff + 1; + if (order < 0) + order = 0; + return order; +} + #endif /* !ASSEMBLY */ #define PAGE_OFFSET 0xe000000000000000 diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index bb3e4fb21..de50f98f0 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h @@ -55,8 +55,10 @@ extern void pci_free_consistent (struct pci_dev *hwdev, size_t size, * until either pci_unmap_single or pci_dma_sync_single is performed. */ extern inline dma_addr_t -pci_map_single (struct pci_dev *hwdev, void *ptr, size_t size) +pci_map_single (struct pci_dev *hwdev, void *ptr, size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); return virt_to_bus(ptr); } @@ -69,8 +71,10 @@ pci_map_single (struct pci_dev *hwdev, void *ptr, size_t size) * whatever the device wrote there. */ extern inline void -pci_unmap_single (struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size) +pci_unmap_single (struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } @@ -91,8 +95,10 @@ pci_unmap_single (struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size) * the same here. */ extern inline int -pci_map_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nents) +pci_map_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); return nents; } @@ -102,8 +108,10 @@ pci_map_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nents) * pci_unmap_single() above. */ extern inline void -pci_unmap_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nents) +pci_unmap_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } @@ -118,8 +126,10 @@ pci_unmap_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nents) * device again owns the buffer. */ extern inline void -pci_dma_sync_single (struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size) +pci_dma_sync_single (struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } @@ -131,11 +141,23 @@ pci_dma_sync_single (struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size) * same rules and usage. */ extern inline void -pci_dma_sync_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems) +pci_dma_sync_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* Nothing to do */ } +/* Return whether the given PCI device DMA address mask can + * be supported properly. For example, if your device can + * only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) +{ + return 1; +} + /* These macros should be used after a pci_map_sg call has been done * to get bus addresses of each of the SG entries and their lengths. * You should only work with the number of sg entries pci_map_sg diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index 2defe7cdf..203005b5c 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h @@ -187,9 +187,14 @@ #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_page_to_ram(page) do { } while (0) #define flush_icache_range(start, end) do { } while (0) + extern void ia64_flush_icache_page (unsigned long addr); -#define flush_icache_page(pg) ia64_flush_icache_page(page_address(pg)) +#define flush_icache_page(vma,pg) \ +do { \ + if ((vma)->vm_flags & PROT_EXEC) \ + ia64_flush_icache_page(page_address(pg)); \ +} while (0) /* * Now come the defines and routines to manage and access the three-level @@ -289,15 +294,21 @@ extern pmd_t *ia64_bad_pagetable (void); */ #define pgprot_noncached(prot) __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_UC) +extern __inline__ unsigned long +pgd_index (unsigned long address) +{ + unsigned long region = address >> 61; + unsigned long l1index = (address >> PGDIR_SHIFT) & ((PTRS_PER_PGD >> 3) - 1); + + return (region << (PAGE_SHIFT - 6)) | l1index; +} + /* The offset in the 1-level directory is given by the 3 region bits (61..63) and the seven level-1 bits (33-39). */ extern __inline__ pgd_t* pgd_offset (struct mm_struct *mm, unsigned long address) { - unsigned long region = address >> 61; - unsigned long l1index = (address >> PGDIR_SHIFT) & ((PTRS_PER_PGD >> 3) - 1); - - return mm->pgd + ((region << (PAGE_SHIFT - 6)) | l1index); + return mm->pgd + pgd_index(address); } /* In the kernel's mapped region we have a full 43 bit space available and completely diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index b2d0cc906..d50ce82e7 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h @@ -145,10 +145,10 @@ struct pt_regs { * Floating point registers that the kernel considers * scratch: */ - struct ia64_fpreg f6; /* scratch*/ - struct ia64_fpreg f7; /* scratch*/ - struct ia64_fpreg f8; /* scratch*/ - struct ia64_fpreg f9; /* scratch*/ + struct ia64_fpreg f6; /* scratch */ + struct ia64_fpreg f7; /* scratch */ + struct ia64_fpreg f8; /* scratch */ + struct ia64_fpreg f9; /* scratch */ }; /* diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h index 2c75056c5..a50ee01e3 100644 --- a/include/asm-ia64/semaphore.h +++ b/include/asm-ia64/semaphore.h @@ -137,13 +137,6 @@ up (struct semaphore * sem) * In terms of fairness, when there is heavy use of the lock, we want * to see the lock being passed back and forth between readers and * writers (like in a producer/consumer style of communication). - * - - For - * liveness, it would be necessary to process the blocked readers and - * writers in FIFO order. However, we don't do this (yet). I suppose - * if you have a lock that is _that_ heavily contested, you're in big - * trouble anyhow. * * -ben (with clarifications & IA-64 comments by davidm) */ diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h index 1ad1a8149..a6ea5c17d 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h @@ -8,6 +8,7 @@ #define _ASM_IA64_SMP_H #include <linux/config.h> + #include <linux/init.h> #include <linux/threads.h> #include <linux/kernel.h> @@ -25,9 +26,10 @@ extern unsigned long cpu_present_map; extern unsigned long cpu_online_map; extern unsigned long ipi_base_addr; extern int bootstrap_processor; -extern volatile int cpu_number_map[NR_CPUS]; +extern volatile int __cpu_number_map[NR_CPUS]; extern volatile int __cpu_logical_map[NR_CPUS]; +#define cpu_number_map(i) __cpu_number_map[i] #define cpu_logical_map(i) __cpu_logical_map[i] #if defined(CONFIG_KDB) diff --git a/include/asm-ia64/softirq.h b/include/asm-ia64/softirq.h index 8b92f4442..fb40999e2 100644 --- a/include/asm-ia64/softirq.h +++ b/include/asm-ia64/softirq.h @@ -2,13 +2,9 @@ #define _ASM_IA64_SOFTIRQ_H /* - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com> + * Copyright (C) 1998-2000 Hewlett-Packard Co + * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com> */ -#include <linux/config.h> -#include <linux/stddef.h> - -#include <asm/system.h> #include <asm/hardirq.h> extern unsigned int local_bh_count[NR_CPUS]; @@ -16,137 +12,9 @@ extern unsigned int local_bh_count[NR_CPUS]; #define cpu_bh_disable(cpu) do { local_bh_count[(cpu)]++; barrier(); } while (0) #define cpu_bh_enable(cpu) do { barrier(); local_bh_count[(cpu)]--; } while (0) -#define cpu_bh_trylock(cpu) (local_bh_count[(cpu)] ? 0 : (local_bh_count[(cpu)] = 1)) -#define cpu_bh_endlock(cpu) (local_bh_count[(cpu)] = 0) - #define local_bh_disable() cpu_bh_disable(smp_processor_id()) #define local_bh_enable() cpu_bh_enable(smp_processor_id()) -#define get_active_bhs() (bh_mask & bh_active) - -static inline void -clear_active_bhs (unsigned long x) -{ - unsigned long old, new; - volatile unsigned long *bh_activep = (void *) &bh_active; - CMPXCHG_BUGCHECK_DECL - - do { - CMPXCHG_BUGCHECK(bh_activep); - old = *bh_activep; - new = old & ~x; - } while (ia64_cmpxchg(bh_activep, old, new, 8) != old); -} - -extern inline void -init_bh (int nr, void (*routine)(void)) -{ - bh_base[nr] = routine; - atomic_set(&bh_mask_count[nr], 0); - bh_mask |= 1 << nr; -} - -extern inline void -remove_bh (int nr) -{ - bh_mask &= ~(1 << nr); - mb(); - bh_base[nr] = NULL; -} - -extern inline void -mark_bh (int nr) -{ - set_bit(nr, &bh_active); -} - -#ifdef CONFIG_SMP - -/* - * The locking mechanism for base handlers, to prevent re-entrancy, - * is entirely private to an implementation, it should not be - * referenced at all outside of this file. - */ -extern atomic_t global_bh_lock; -extern atomic_t global_bh_count; - -extern void synchronize_bh(void); - -static inline void -start_bh_atomic (void) -{ - atomic_inc(&global_bh_lock); - synchronize_bh(); -} - -static inline void -end_bh_atomic (void) -{ - atomic_dec(&global_bh_lock); -} - -/* These are for the irq's testing the lock */ -static inline int -softirq_trylock (int cpu) -{ - if (cpu_bh_trylock(cpu)) { - if (!test_and_set_bit(0, &global_bh_count)) { - if (atomic_read(&global_bh_lock) == 0) - return 1; - clear_bit(0,&global_bh_count); - } - cpu_bh_endlock(cpu); - } - return 0; -} - -static inline void -softirq_endlock (int cpu) -{ - cpu_bh_enable(cpu); - clear_bit(0,&global_bh_count); -} - -#else /* !CONFIG_SMP */ - -extern inline void -start_bh_atomic (void) -{ - local_bh_disable(); - barrier(); -} - -extern inline void -end_bh_atomic (void) -{ - barrier(); - local_bh_enable(); -} - -/* These are for the irq's testing the lock */ -#define softirq_trylock(cpu) (cpu_bh_trylock(cpu)) -#define softirq_endlock(cpu) (cpu_bh_endlock(cpu)) -#define synchronize_bh() barrier() - -#endif /* !CONFIG_SMP */ - -/* - * These use a mask count to correctly handle - * nested disable/enable calls - */ -extern inline void -disable_bh (int nr) -{ - bh_mask &= ~(1 << nr); - atomic_inc(&bh_mask_count[nr]); - synchronize_bh(); -} - -extern inline void -enable_bh (int nr) -{ - if (atomic_dec_and_test(&bh_mask_count[nr])) - bh_mask |= 1 << nr; -} +#define in_softirq() (local_bh_count[smp_processor_id()] != 0) #endif /* _ASM_IA64_SOFTIRQ_H */ diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h index a86d0a7f3..d4b1732e2 100644 --- a/include/asm-ia64/types.h +++ b/include/asm-ia64/types.h @@ -8,8 +8,8 @@ * not a major issue. However, for interoperability, libraries still * need to be careful to avoid a name clashes. * - * Copyright (C) 1998, 1999 Hewlett-Packard Co - * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com> + * Copyright (C) 1998-2000 Hewlett-Packard Co + * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com> */ #ifdef __ASSEMBLY__ @@ -38,52 +38,28 @@ typedef unsigned short __u16; typedef __signed__ int __s32; typedef unsigned int __u32; -/* - * There are 32-bit compilers for the ia-64 out there.. - */ -# if ((~0UL) == 0xffffffff) -# if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -# endif -# else typedef __signed__ long __s64; typedef unsigned long __u64; -# endif /* * These aren't exported outside the kernel to avoid name space clashes */ # ifdef __KERNEL__ -typedef signed char s8; -typedef unsigned char u8; +typedef __s8 s8; +typedef __u8 u8; -typedef signed short s16; -typedef unsigned short u16; +typedef __s16 s16; +typedef __u16 u16; -typedef signed int s32; -typedef unsigned int u32; +typedef __s32 s32; +typedef __u32 u32; -/* - * There are 32-bit compilers for the ia-64 out there... (don't rely - * on cpp because that may cause su problem in a 32->64 bit - * cross-compilation environment). - */ -# ifdef __LP64__ +typedef __s64 s64; +typedef __u64 u64; -typedef signed long s64; -typedef unsigned long u64; #define BITS_PER_LONG 64 -# else - -typedef signed long long s64; -typedef unsigned long long u64; -#define BITS_PER_LONG 32 - -# endif - /* DMA addresses are 64-bits wide, in general. */ typedef u64 dma_addr_t; diff --git a/include/asm-m68k/adb_iop.h b/include/asm-m68k/adb_iop.h new file mode 100644 index 000000000..8a48e56f2 --- /dev/null +++ b/include/asm-m68k/adb_iop.h @@ -0,0 +1,44 @@ +/* + * ADB through the IOP + * Written by Joshua M. Thompson + */ + +/* IOP number and channel number for ADB */ + +#define ADB_IOP IOP_NUM_ISM +#define ADB_CHAN 2 + +/* From the A/UX headers...maybe important, maybe not */ + +#define ADB_IOP_LISTEN 0x01 +#define ADB_IOP_TALK 0x02 +#define ADB_IOP_EXISTS 0x04 +#define ADB_IOP_FLUSH 0x08 +#define ADB_IOP_RESET 0x10 +#define ADB_IOP_INT 0x20 +#define ADB_IOP_POLL 0x40 +#define ADB_IOP_UNINT 0x80 + +#define AIF_RESET 0x00 +#define AIF_FLUSH 0x01 +#define AIF_LISTEN 0x08 +#define AIF_TALK 0x0C + +/* Flag bits in struct adb_iopmsg */ + +#define ADB_IOP_EXPLICIT 0x80 /* nonzero if explicit command */ +#define ADB_IOP_AUTOPOLL 0x40 /* auto/SRQ polling enabled */ +#define ADB_IOP_SRQ 0x04 /* SRQ detected */ +#define ADB_IOP_TIMEOUT 0x02 /* nonzero if timeout */ + +#ifndef __ASSEMBLY__ + +struct adb_iopmsg { + __u8 flags; /* ADB flags */ + __u8 count; /* no. of data bytes */ + __u8 cmd; /* ADB command */ + __u8 data[8]; /* ADB data */ + __u8 spare[21]; /* spare */ +}; + +#endif /* __ASSEMBLY__ */ diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h index 0e3cd0c6f..aac7e8597 100644 --- a/include/asm-m68k/hardirq.h +++ b/include/asm-m68k/hardirq.h @@ -7,6 +7,8 @@ extern unsigned int local_irq_count[NR_CPUS]; #define in_interrupt() (local_irq_count[smp_processor_id()] + local_bh_count[smp_processor_id()] != 0) +#define in_irq() (local_irq_count[smp_processor_id()] != 0) + #define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) #define hardirq_endlock(cpu) do { } while (0) diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 0a62d30ef..be2dfbd61 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h @@ -15,7 +15,7 @@ * Currently the Atari has 72 and the Amiga 24, but if both are * supported in the kernel it is better to make room for 72. */ -#if defined(CONFIG_ATARI) +#if defined(CONFIG_ATARI) || defined(CONFIG_MAC) #define NR_IRQS (72+SYS_IRQS) #else #define NR_IRQS (24+SYS_IRQS) diff --git a/include/asm-m68k/mac_baboon.h b/include/asm-m68k/mac_baboon.h new file mode 100644 index 000000000..e87850830 --- /dev/null +++ b/include/asm-m68k/mac_baboon.h @@ -0,0 +1,34 @@ +/* + * Definitions for the "Baboon" custom IC on the PowerBook 190. + */ + +#define BABOON_BASE (0x50F1A000) /* same as IDE controller base */ + +#ifndef __ASSEMBLY__ + +struct baboon { + char pad1[208]; /* generic IDE registers, not used here */ + short mb_control; /* Control register: + * bit 5 : slot 2 power control + * bit 6 : slot 1 power control + */ + char pad2[2]; + short mb_status; /* (0xD4) media bay status register: + * + * bit 0: ???? + * bit 1: IDE interrupt active? + * bit 2: bay status, 0 = full, 1 = empty + * bit 3: ???? + */ + char pad3[2]; /* (0xD6) not used */ + short mb_ifr; /* (0xD8) media bay interrupt flags register: + * + * bit 0: ???? + * bit 1: IDE controller interrupt + * bit 2: media bay status change interrupt + */ +}; + +extern volatile struct baboon *baboon; + +#endif /* __ASSEMBLY **/ diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h index 40905e74d..e71462a8b 100644 --- a/include/asm-m68k/macintosh.h +++ b/include/asm-m68k/macintosh.h @@ -74,6 +74,7 @@ struct mac_model #define MAC_IDE_NONE 0 #define MAC_IDE_QUADRA 1 #define MAC_IDE_PB 2 +#define MAC_IDE_BABOON 3 #define MAC_SCC_II 1 #define MAC_SCC_QUADRA 2 diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h index 1014df89d..f60ffdc8b 100644 --- a/include/asm-m68k/macints.h +++ b/include/asm-m68k/macints.h @@ -43,13 +43,14 @@ #define PSC5_SOURCE_BASE 40 #define PSC6_SOURCE_BASE 48 #define NUBUS_SOURCE_BASE 56 +#define BABOON_SOURCE_BASE 64 /* - * Maximum IRQ number is NUBUS_SOURCE_BASE + 7, - * giving us IRQs up through 63. + * Maximum IRQ number is BABOON_SOURCE_BASE + 7, + * giving us IRQs up through 71 */ -#define NUM_MAC_SOURCES 64 +#define NUM_MAC_SOURCES 72 /* * clean way to separate IRQ into its source and index @@ -150,6 +151,12 @@ #define IRQ_NUBUS_E (61) #define IRQ_NUBUS_F (62) +/* Baboon interrupts (cascaded to nubus slot $C) */ +#define IRQ_BABOON_0 (64) +#define IRQ_BABOON_1 (65) +#define IRQ_BABOON_2 (66) +#define IRQ_BABOON_3 (67) + #define SLOT2IRQ(x) (x + 47) #define IRQ2SLOT(x) (x - 47) diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 23dd731c8..117abf25d 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h @@ -97,6 +97,20 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* !__ASSEMBLY__ */ #include <asm/page_offset.h> diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h index 9df773f9f..a92c28b12 100644 --- a/include/asm-m68k/pgtable.h +++ b/include/asm-m68k/pgtable.h @@ -285,10 +285,12 @@ extern inline pte_t pte_mkcache(pte_t pte) { pte_val(pte) = (pte_val(pte) & _CAC #define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address)) +#define pgd_index(address) ((address) >> PGDIR_SHIFT) + /* 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); + return mm->pgd + pgd_index(address); } #define swapper_pg_dir kernel_pg_dir diff --git a/include/asm-m68k/softirq.h b/include/asm-m68k/softirq.h index f27b11256..a51563cd7 100644 --- a/include/asm-m68k/softirq.h +++ b/include/asm-m68k/softirq.h @@ -7,59 +7,12 @@ #include <asm/atomic.h> -#define get_active_bhs() (bh_mask & bh_active) -#define clear_active_bhs(x) atomic_clear_mask((x),&bh_active) - -extern inline void init_bh(int nr, void (*routine)(void)) -{ - bh_base[nr] = routine; - atomic_set(&bh_mask_count[nr], 0); - bh_mask |= 1 << nr; -} - -extern inline void mark_bh(int nr) -{ - set_bit(nr, &bh_active); -} - -/* - * These use a mask count to correctly handle - * nested disable/enable calls - */ -extern inline void disable_bh(int nr) -{ - bh_mask &= ~(1 << nr); - atomic_inc(&bh_mask_count[nr]); -} - -extern inline void enable_bh(int nr) -{ - if (atomic_dec_and_test(&bh_mask_count[nr])) - bh_mask |= 1 << nr; -} - -extern inline void remove_bh(int nr) -{ - bh_base[nr] = NULL; - bh_mask &= ~(1 << nr); -} - extern unsigned int local_bh_count[NR_CPUS]; #define local_bh_disable() (local_bh_count[smp_processor_id()]++) #define local_bh_enable() (local_bh_count[smp_processor_id()]--) -extern inline void start_bh_atomic(void) -{ - local_bh_count[smp_processor_id()]++; - barrier(); -} - -extern inline void end_bh_atomic(void) -{ - barrier(); - local_bh_count[smp_processor_id()]--; -} +#define in_softirq() (local_bh_count != 0) /* These are for the irq's testing the lock */ #define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1)) diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index c02ddfd86..ebcb61569 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h @@ -1,4 +1,4 @@ -/* $Id: io.h,v 1.11 2000/02/04 07:40:53 ralf Exp $ +/* $Id: io.h,v 1.12 2000/02/16 01:45:55 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -435,8 +435,12 @@ __OUTS(w,l,4) * be discarded. This operation is necessary before dma operations * to the memory. */ -extern void (*dma_cache_wback_inv)(unsigned long start, unsigned long size); -extern void (*dma_cache_wback)(unsigned long start, unsigned long size); -extern void (*dma_cache_inv)(unsigned long start, unsigned long size); +extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); +extern void (*_dma_cache_wback)(unsigned long start, unsigned long size); +extern void (*_dma_cache_inv)(unsigned long start, unsigned long size); + +#define dma_cache_wback_inv(start,size) _dma_cache_wback_inv(start,size) +#define dma_cache_wback(start,size) _dma_cache_wback(start,size) +#define dma_cache_inv(start,size) _dma_cache_inv(start,size) #endif /* _ASM_IO_H */ diff --git a/include/asm-mips/offset.h b/include/asm-mips/offset.h index d90dfcac9..be9c36b06 100644 --- a/include/asm-mips/offset.h +++ b/include/asm-mips/offset.h @@ -52,35 +52,35 @@ #define TASK_COUNTER 32 #define TASK_PRIORITY 36 #define TASK_MM 44 -#define TASK_STRUCT_SIZE 888 +#define TASK_STRUCT_SIZE 904 /* MIPS specific thread_struct offsets. */ -#define THREAD_REG16 576 -#define THREAD_REG17 580 -#define THREAD_REG18 584 -#define THREAD_REG19 588 -#define THREAD_REG20 592 -#define THREAD_REG21 596 -#define THREAD_REG22 600 -#define THREAD_REG23 604 -#define THREAD_REG29 608 -#define THREAD_REG30 612 -#define THREAD_REG31 616 -#define THREAD_STATUS 620 -#define THREAD_FPU 624 -#define THREAD_BVADDR 760 -#define THREAD_BUADDR 764 -#define THREAD_ECODE 768 -#define THREAD_TRAPNO 772 -#define THREAD_MFLAGS 776 -#define THREAD_CURDS 780 -#define THREAD_TRAMP 784 -#define THREAD_OLDCTX 788 +#define THREAD_REG16 584 +#define THREAD_REG17 588 +#define THREAD_REG18 592 +#define THREAD_REG19 596 +#define THREAD_REG20 600 +#define THREAD_REG21 604 +#define THREAD_REG22 608 +#define THREAD_REG23 612 +#define THREAD_REG29 616 +#define THREAD_REG30 620 +#define THREAD_REG31 624 +#define THREAD_STATUS 628 +#define THREAD_FPU 632 +#define THREAD_BVADDR 768 +#define THREAD_BUADDR 772 +#define THREAD_ECODE 776 +#define THREAD_TRAPNO 780 +#define THREAD_MFLAGS 784 +#define THREAD_CURDS 788 +#define THREAD_TRAMP 792 +#define THREAD_OLDCTX 796 /* Linux mm_struct offsets. */ #define MM_USERS 16 #define MM_PGD 12 -#define MM_CONTEXT 56 +#define MM_CONTEXT 64 /* Linux sigcontext offsets. */ #define SC_REGS 16 diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 0fb32cb97..c458e3db1 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.7 1999/06/22 23:07:47 ralf Exp $ +/* $Id: page.h,v 1.8 2000/01/27 01:05:37 ralf Exp $ * * Definitions for page handling * @@ -23,8 +23,11 @@ #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0) #define PAGE_BUG(page) do { BUG(); } while (0) -extern void (*clear_page)(void * page); -extern void (*copy_page)(void * to, void * from); +extern void (*_clear_page)(void * page); +extern void (*_copy_page)(void * to, void * from); + +#define clear_page(page) _clear_page(page) +#define copy_page(to, from) _copy_page(to, from) /* * These are used to make use of C type-checking.. @@ -44,6 +47,20 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define __pgd(x) ((pgd_t) { (x) } ) #define __pgprot(x) ((pgprot_t) { (x) } ) +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* _LANGUAGE_ASSEMBLY */ /* to align the pointer to the (next) page boundary */ diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 20c330760..3f890fe68 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -1,4 +1,4 @@ -/* $Id: pci.h,v 1.7 2000/02/16 01:07:48 ralf Exp $ +/* $Id: pci.h,v 1.8 2000/02/18 00:24:48 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -63,8 +63,11 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, * until either pci_unmap_single or pci_dma_sync_single is performed. */ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + dma_cache_wback_inv((unsigned long)ptr, size); return virt_to_bus(ptr); @@ -79,8 +82,11 @@ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, * whatever the device wrote there. */ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + /* Nothing to do */ } @@ -101,12 +107,17 @@ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, * the same here. */ extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { - /* Make sure that gcc doesn't leave the empty loop body. */ #ifndef CONFIG_COHERENT_IO int i; +#endif + if (direction == PCI_DMA_NONE) + BUG(); + +#ifndef CONFIG_COHERENT_IO + /* Make sure that gcc doesn't leave the empty loop body. */ for (i = 0; i < nents; i++, sg++) dma_cache_wback_inv((unsigned long)sg->address, sg->length); #endif @@ -120,8 +131,11 @@ extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, * pci_unmap_single() above. */ extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + /* Nothing to do */ } @@ -137,8 +151,11 @@ extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, */ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + dma_cache_wback_inv((unsigned long)bus_to_virt(dma_handle), size); } @@ -151,12 +168,17 @@ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, */ extern inline void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nelems) + int nelems, int direction) { - /* Make sure that gcc doesn't leave the empty loop body. */ #ifndef CONFIG_COHERENT_IO int i; +#endif + if (direction == PCI_DMA_NONE) + BUG(); + + /* Make sure that gcc doesn't leave the empty loop body. */ +#ifndef CONFIG_COHERENT_IO for (i = 0; i < nelems; i++, sg++) dma_cache_wback_inv((unsigned long)sg->address, sg->length); #endif diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index aed22eedc..45677ce94 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id: pgalloc.h,v 1.2 2000/02/13 20:52:06 harald Exp $ +/* $Id: pgalloc.h,v 1.3 2000/02/23 00:41:38 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -10,23 +10,6 @@ #ifndef _ASM_PGALLOC_H #define _ASM_PGALLOC_H -/* Cache flushing: - * - * - flush_cache_all() flushes entire cache - * - flush_cache_mm(mm) flushes the specified mm context's cache lines - * - flush_cache_page(mm, vmaddr) flushes a single page - * - flush_cache_range(mm, start, end) flushes a range of pages - * - flush_page_to_ram(page) write back kernel page to ram - */ -extern void (*flush_cache_all)(void); -extern void (*flush_cache_mm)(struct mm_struct *mm); -extern void (*flush_cache_range)(struct mm_struct *mm, unsigned long start, - unsigned long end); -extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page); -extern void (*flush_cache_sigtramp)(unsigned long addr); -extern void (*flush_page_to_ram)(struct page * page); -#define flush_icache_range(start, end) flush_cache_all() - /* TLB flushing: * * - flush_tlb_all() flushes all processes TLB entries @@ -39,8 +22,12 @@ extern void flush_tlb_mm(struct mm_struct *mm); extern void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end); extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); -extern inline void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, - unsigned long end); + +extern inline void flush_tlb_pgtables(struct mm_struct *mm, + unsigned long start, unsigned long end) +{ + /* Nothing to do on MIPS. */ +} /* diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 89f6e132d..90f96e492 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.28 2000/02/04 07:40:53 ralf Exp $ +/* $Id: pgtable.h,v 1.29 2000/02/23 00:41:38 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -19,9 +19,31 @@ #include <asm/cachectl.h> #include <linux/config.h> -extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end) -{ -} +/* Cache flushing: + * + * - flush_cache_all() flushes entire cache + * - flush_cache_mm(mm) flushes the specified mm context's cache lines + * - flush_cache_page(mm, vmaddr) flushes a single page + * - flush_cache_range(mm, start, end) flushes a range of pages + * - flush_page_to_ram(page) write back kernel page to ram + */ +extern void (*_flush_cache_all)(void); +extern void (*_flush_cache_mm)(struct mm_struct *mm); +extern void (*_flush_cache_range)(struct mm_struct *mm, unsigned long start, + unsigned long end); +extern void (*_flush_cache_page)(struct vm_area_struct *vma, unsigned long page); +extern void (*_flush_cache_sigtramp)(unsigned long addr); +extern void (*_flush_page_to_ram)(struct page * page); + +#define flush_cache_all() _flush_cache_all() +#define flush_cache_mm(mm) _flush_cache_mm(mm) +#define flush_cache_range(mm,start,end) _flush_cache_range(mm,start,end) +#define flush_cache_page(vma,page) _flush_cache_page(vma, page) +#define flush_cache_sigtramp(addr) _flush_cache_sigtramp(addr) +#define flush_page_to_ram(page) _flush_page_to_ram(page) + +#define flush_icache_range(start, end) flush_cache_all() +#define flush_icache_page(start,page) do { } while(0) /* @@ -379,10 +401,12 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) +#define pgd_index(address) ((address) >> PGDIR_SHIFT) + /* 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); + return mm->pgd + pgd_index(address); } /* Find an entry in the second-level page table.. */ diff --git a/include/asm-mips64/elf.h b/include/asm-mips64/elf.h index f7724d9c8..80e08fa5e 100644 --- a/include/asm-mips64/elf.h +++ b/include/asm-mips64/elf.h @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: elf.h,v 1.3 2000/01/17 23:32:47 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -7,6 +7,9 @@ #ifndef _ASM_ELF_H #define _ASM_ELF_H +#include <asm/ptrace.h> +#include <asm/user.h> + #ifndef ELF_ARCH /* ELF register definitions */ #define ELF_NGREG 45 diff --git a/include/asm-mips64/io.h b/include/asm-mips64/io.h index 8afd3873d..f09fea50d 100644 --- a/include/asm-mips64/io.h +++ b/include/asm-mips64/io.h @@ -1,4 +1,4 @@ -/* $Id: io.h,v 1.8 2000/01/31 21:34:07 kanoj Exp $ +/* $Id: io.h,v 1.9 2000/02/04 07:40:53 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -389,9 +389,13 @@ extern inline void dma_cache_inv(unsigned long start, unsigned long size) #else -extern void (*dma_cache_wback_inv)(unsigned long start, unsigned long size); -extern void (*dma_cache_wback)(unsigned long start, unsigned long size); -extern void (*dma_cache_inv)(unsigned long start, unsigned long size); +extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); +extern void (*_dma_cache_wback)(unsigned long start, unsigned long size); +extern void (*_dma_cache_inv)(unsigned long start, unsigned long size); + +#define dma_cache_wback_inv(start,size) _dma_cache_wback_inv(start,size) +#define dma_cache_wback(start,size) _dma_cache_wback(start,size) +#define dma_cache_inv(start,size) _dma_cache_inv(start,size) #endif diff --git a/include/asm-mips64/offset.h b/include/asm-mips64/offset.h index abe647224..b0d9e97c3 100644 --- a/include/asm-mips64/offset.h +++ b/include/asm-mips64/offset.h @@ -52,35 +52,35 @@ #define TASK_COUNTER 56 #define TASK_PRIORITY 64 #define TASK_MM 80 -#define TASK_STRUCT_SIZE 1456 +#define TASK_STRUCT_SIZE 1480 /* MIPS specific thread_struct offsets. */ -#define THREAD_REG16 888 -#define THREAD_REG17 896 -#define THREAD_REG18 904 -#define THREAD_REG19 912 -#define THREAD_REG20 920 -#define THREAD_REG21 928 -#define THREAD_REG22 936 -#define THREAD_REG23 944 -#define THREAD_REG29 952 -#define THREAD_REG30 960 -#define THREAD_REG31 968 -#define THREAD_STATUS 976 -#define THREAD_FPU 984 -#define THREAD_BVADDR 1248 -#define THREAD_BUADDR 1256 -#define THREAD_ECODE 1264 -#define THREAD_TRAPNO 1272 -#define THREAD_MFLAGS 1280 -#define THREAD_CURDS 1288 -#define THREAD_TRAMP 1296 -#define THREAD_OLDCTX 1304 +#define THREAD_REG16 896 +#define THREAD_REG17 904 +#define THREAD_REG18 912 +#define THREAD_REG19 920 +#define THREAD_REG20 928 +#define THREAD_REG21 936 +#define THREAD_REG22 944 +#define THREAD_REG23 952 +#define THREAD_REG29 960 +#define THREAD_REG30 968 +#define THREAD_REG31 976 +#define THREAD_STATUS 984 +#define THREAD_FPU 992 +#define THREAD_BVADDR 1256 +#define THREAD_BUADDR 1264 +#define THREAD_ECODE 1272 +#define THREAD_TRAPNO 1280 +#define THREAD_MFLAGS 1288 +#define THREAD_CURDS 1296 +#define THREAD_TRAMP 1304 +#define THREAD_OLDCTX 1312 /* Linux mm_struct offsets. */ #define MM_USERS 32 #define MM_PGD 24 -#define MM_CONTEXT 96 +#define MM_CONTEXT 112 /* Linux sigcontext offsets. */ #define SC_REGS 0 diff --git a/include/asm-mips64/page.h b/include/asm-mips64/page.h index 74201e286..287c2995a 100644 --- a/include/asm-mips64/page.h +++ b/include/asm-mips64/page.h @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.4 2000/01/27 01:05:37 ralf Exp $ +/* $Id: page.h,v 1.5 2000/02/06 00:20:27 kanoj Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -24,8 +24,11 @@ #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0) #define PAGE_BUG(page) do { BUG(); } while (0) -extern void (*clear_page)(void * page); -extern void (*copy_page)(void * to, void * from); +extern void (*_clear_page)(void * page); +extern void (*_copy_page)(void * to, void * from); + +#define clear_page(page) _clear_page(page) +#define copy_page(to, from) _copy_page(to, from) /* * These are used to make use of C type-checking.. diff --git a/include/asm-mips64/pci.h b/include/asm-mips64/pci.h index a1e0e992e..217eea7d3 100644 --- a/include/asm-mips64/pci.h +++ b/include/asm-mips64/pci.h @@ -1,4 +1,4 @@ -/* $Id: pci.h,v 1.2 2000/02/16 01:07:49 ralf Exp $ +/* $Id: pci.h,v 1.3 2000/02/18 00:24:48 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -63,8 +63,11 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, * until either pci_unmap_single or pci_dma_sync_single is performed. */ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + dma_cache_wback_inv((unsigned long)ptr, size); return virt_to_bus(ptr); @@ -79,8 +82,11 @@ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, * whatever the device wrote there. */ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + /* Nothing to do */ } @@ -101,12 +107,17 @@ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, * the same here. */ extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { - /* Make sure that gcc doesn't leave the empty loop body. */ #ifndef CONFIG_COHERENT_IO int i; +#endif + if (direction == PCI_DMA_NONE) + BUG(); + + /* Make sure that gcc doesn't leave the empty loop body. */ +#ifndef CONFIG_COHERENT_IO for (i = 0; i < nents; i++, sg++) dma_cache_wback_inv((unsigned long)sg->address, sg->length); #endif @@ -120,8 +131,11 @@ extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, * pci_unmap_single() above. */ extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + /* Nothing to do */ } @@ -137,8 +151,11 @@ extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, */ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); + dma_cache_wback_inv((unsigned long)bus_to_virt(dma_handle), size); } @@ -151,12 +168,17 @@ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, */ extern inline void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nelems) + int nelems, int direction) { - /* Make sure that gcc doesn't leave the empty loop body. */ #ifndef CONFIG_COHERENT_IO int i; +#endif + if (direction == PCI_DMA_NONE) + BUG(); + + /* Make sure that gcc doesn't leave the empty loop body. */ +#ifndef CONFIG_COHERENT_IO for (i = 0; i < nelems; i++, sg++) dma_cache_wback_inv((unsigned long)sg->address, sg->length); #endif diff --git a/include/asm-mips64/pgalloc.h b/include/asm-mips64/pgalloc.h index 1e5de6c96..54e95eaf0 100644 --- a/include/asm-mips64/pgalloc.h +++ b/include/asm-mips64/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id: pgalloc.h,v 1.1 2000/02/04 07:40:53 ralf Exp $ +/* $Id: pgalloc.h,v 1.2 2000/02/23 00:41:38 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -10,23 +10,6 @@ #ifndef _ASM_PGALLOC_H #define _ASM_PGALLOC_H -/* Cache flushing: - * - * - flush_cache_all() flushes entire cache - * - flush_cache_mm(mm) flushes the specified mm context's cache lines - * - flush_cache_page(mm, vmaddr) flushes a single page - * - flush_cache_range(mm, start, end) flushes a range of pages - * - flush_page_to_ram(page) write back kernel page to ram - */ -extern void (*flush_cache_all)(void); -extern void (*flush_cache_mm)(struct mm_struct *mm); -extern void (*flush_cache_range)(struct mm_struct *mm, unsigned long start, - unsigned long end); -extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page); -extern void (*flush_cache_sigtramp)(unsigned long addr); -extern void (*flush_page_to_ram)(struct page * page); -#define flush_icache_range(start, end) flush_cache_all() - /* TLB flushing: * * - flush_tlb_all() flushes all processes TLB entries @@ -34,12 +17,22 @@ extern void (*flush_page_to_ram)(struct page * page); * - flush_tlb_page(mm, vmaddr) flushes a single page * - flush_tlb_range(mm, start, end) flushes a range of pages */ -extern void (*flush_tlb_all)(void); -extern void (*flush_tlb_mm)(struct mm_struct *mm); -extern void (*flush_tlb_range)(struct mm_struct *mm, unsigned long start, +extern void (*_flush_tlb_all)(void); +extern void (*_flush_tlb_mm)(struct mm_struct *mm); +extern void (*_flush_tlb_range)(struct mm_struct *mm, unsigned long start, unsigned long end); -extern void (*flush_tlb_page)(struct vm_area_struct *vma, unsigned long page); -extern inline void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end); +extern void (*_flush_tlb_page)(struct vm_area_struct *vma, unsigned long page); + +#define flush_tlb_all() _flush_tlb_all() +#define flush_tlb_mm(mm) _flush_tlb_mm(mm) +#define flush_tlb_range(mm,vmaddr,end) _flush_tlb_range(mm, vmaddr, end) +#define flush_tlb_page(vma,page) _flush_tlb_page(vma, page) + +extern inline void flush_tlb_pgtables(struct mm_struct *mm, + unsigned long start, unsigned long end) +{ + /* Nothing to do on MIPS. */ +} /* diff --git a/include/asm-mips64/pgtable.h b/include/asm-mips64/pgtable.h index f0ba45505..a136a3797 100644 --- a/include/asm-mips64/pgtable.h +++ b/include/asm-mips64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.10 2000/02/10 21:38:10 kanoj Exp $ +/* $Id: pgtable.h,v 1.11 2000/02/23 00:41:38 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -20,9 +20,32 @@ #include <linux/mmzone.h> #include <asm/cachectl.h> -extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end) -{ -} +/* Cache flushing: + * + * - flush_cache_all() flushes entire cache + * - flush_cache_mm(mm) flushes the specified mm context's cache lines + * - flush_cache_page(mm, vmaddr) flushes a single page + * - flush_cache_range(mm, start, end) flushes a range of pages + * - flush_page_to_ram(page) write back kernel page to ram + */ +extern void (*_flush_cache_all)(void); +extern void (*_flush_cache_mm)(struct mm_struct *mm); +extern void (*_flush_cache_range)(struct mm_struct *mm, unsigned long start, + unsigned long end); +extern void (*_flush_cache_page)(struct vm_area_struct *vma, unsigned long page); +extern void (*_flush_cache_sigtramp)(unsigned long addr); +extern void (*_flush_page_to_ram)(struct page * page); + +#define flush_cache_all() _flush_cache_all() +#define flush_cache_mm(mm) _flush_cache_mm(mm) +#define flush_cache_range(mm,start,end) _flush_cache_range(mm,start,end) +#define flush_cache_page(vma,page) _flush_cache_page(vma, page) +#define flush_cache_sigtramp(addr) _flush_cache_sigtramp(addr) +#define flush_page_to_ram(page) _flush_page_to_ram(page) + +#define flush_icache_range(start, end) flush_cache_all() +#define flush_icache_page(start, page) do { } while(0) + /* Basically we have the same two-level (which is the logical three level * Linux page table layout folded) page tables as the i386. Some day @@ -416,10 +439,12 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) +#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) + /* to find an entry in a page-table-directory */ extern inline pgd_t *pgd_offset(struct mm_struct *mm, unsigned long address) { - return mm->pgd + ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)); + return mm->pgd + pgd_index(address); } /* Find an entry in the second-level page table.. */ @@ -448,9 +473,16 @@ extern pgd_t swapper_pg_dir[1024]; extern void (*update_mmu_cache)(struct vm_area_struct *vma, unsigned long address, pte_t pte); +/* + * Non-present pages: high 24 bits are offset, next 8 bits type, + * low 32 bits zero. + */ +extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) +{ pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; } + #define SWP_TYPE(x) (((x).val >> 32) & 0xff) #define SWP_OFFSET(x) ((x).val >> 40) -#define SWP_ENTRY(type,offset) ((swp_entry_t) { ((type) << 32) | ((offset) << 40) }) +#define SWP_ENTRY(type,offset) ((swp_entry_t) { pte_val(mk_swap_pte((type),(offset))) }) #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define swp_entry_to_pte(x) ((pte_t) { (x).val }) diff --git a/include/asm-mips64/processor.h b/include/asm-mips64/processor.h index 664fc3dc1..f70258639 100644 --- a/include/asm-mips64/processor.h +++ b/include/asm-mips64/processor.h @@ -1,4 +1,4 @@ -/* $Id: processor.h,v 1.8 2000/01/29 01:42:28 ralf Exp $ +/* $Id: processor.h,v 1.9 2000/02/05 06:47:37 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -208,7 +208,8 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t) } struct pt_regs; -extern int (*user_mode)(struct pt_regs *); +extern int (*_user_mode)(struct pt_regs *); +#define user_mode(regs) _user_mode(regs) /* * Do necessary setup to start up a newly executed thread. diff --git a/include/asm-mips64/ptrace.h b/include/asm-mips64/ptrace.h index 3e61613ca..ff5745e24 100644 --- a/include/asm-mips64/ptrace.h +++ b/include/asm-mips64/ptrace.h @@ -1,4 +1,4 @@ -/* $Id: ptrace.h,v 1.2 1999/09/28 22:27:19 ralf Exp $ +/* $Id: ptrace.h,v 1.3 1999/12/04 03:59:12 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -64,7 +64,9 @@ struct pt_regs { #ifndef __ASSEMBLY__ #define instruction_pointer(regs) ((regs)->cp0_epc) -extern void (*show_regs)(struct pt_regs *); +extern void (*_show_regs)(struct pt_regs *); +#define show_regs(regs) _show_regs(regs) + #endif /* !(__ASSEMBLY__) */ #endif diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h index 002736abf..3ae89d9cc 100644 --- a/include/asm-ppc/elf.h +++ b/include/asm-ppc/elf.h @@ -8,6 +8,7 @@ #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ #define ELF_NFPREG 33 /* includes fpscr */ +#define ELF_NVRREG 33 /* includes vscr */ /* * This is used to ensure we don't load something for the wrong architecture. @@ -37,6 +38,10 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; +/* Altivec registers */ +typedef vector128 elf_vrreg_t; +typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; + #define ELF_CORE_COPY_REGS(gregs, regs) \ memcpy(gregs, regs, \ sizeof(struct pt_regs) < sizeof(elf_gregset_t)? \ diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h index ac5ac69fc..c2c58315e 100644 --- a/include/asm-ppc/hardirq.h +++ b/include/asm-ppc/hardirq.h @@ -1,24 +1,27 @@ #ifndef __ASM_HARDIRQ_H #define __ASM_HARDIRQ_H +#include <linux/config.h> #include <asm/smp.h> -extern unsigned int ppc_local_irq_count[NR_CPUS]; +extern unsigned int local_irq_count[NR_CPUS]; /* * Are we in an interrupt context? Either doing bottom half * or hardware interrupt processing? */ #define in_interrupt() ({ int __cpu = smp_processor_id(); \ - (ppc_local_irq_count[__cpu] + ppc_local_bh_count[__cpu] != 0); }) + (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); }) + +#define in_irq() (local_irq_count[smp_processor_id()] != 0) #ifndef __SMP__ -#define hardirq_trylock(cpu) (ppc_local_irq_count[cpu] == 0) +#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) #define hardirq_endlock(cpu) do { } while (0) -#define hardirq_enter(cpu) (ppc_local_irq_count[cpu]++) -#define hardirq_exit(cpu) (ppc_local_irq_count[cpu]--) +#define hardirq_enter(cpu) (local_irq_count[cpu]++) +#define hardirq_exit(cpu) (local_irq_count[cpu]--) #define synchronize_irq() do { } while (0) @@ -41,14 +44,31 @@ static inline void release_irqlock(int cpu) static inline void hardirq_enter(int cpu) { - ++ppc_local_irq_count[cpu]; + unsigned int loops = 10000000; + + ++local_irq_count[cpu]; atomic_inc(&global_irq_count); + while (test_bit(0,&global_irq_lock)) { + if (smp_processor_id() == global_irq_holder) { + printk("uh oh, interrupt while we hold global irq lock!\n"); +#ifdef CONFIG_XMON + xmon(0); +#endif + break; + } + if (loops-- == 0) { + printk("do_IRQ waiting for irq lock (holder=%d)\n", global_irq_holder); +#ifdef CONFIG_XMON + xmon(0); +#endif + } + } } static inline void hardirq_exit(int cpu) { atomic_dec(&global_irq_count); - --ppc_local_irq_count[cpu]; + --local_irq_count[cpu]; } static inline int hardirq_trylock(int cpu) diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index 55168a8b2..1be8ddfa5 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h @@ -77,7 +77,7 @@ typedef unsigned long pgprot_t; #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) extern void clear_page(void *page); -#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) +extern void copy_page(void *to, void *from); /* map phys->virtual and virtual->phys for RAM pages */ static inline unsigned long ___pa(unsigned long v) @@ -113,6 +113,21 @@ static inline void* ___va(unsigned long p) #define MAP_PAGE_RESERVED (1<<15) extern unsigned long get_zero_page_fast(void); + +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ #endif /* _PPC_PAGE_H */ diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 92347e406..5d022e02c 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -27,38 +27,60 @@ extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle); extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); return virt_to_bus(ptr); } extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* nothing to do */ } extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); return nents; } extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents) + int nents, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* nothing to do */ } extern inline void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, - size_t size) + size_t size, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* nothing to do */ } extern inline void pci_dma_syng_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nelems) + int nelems, int direction) { + if (direction == PCI_DMA_NONE) + BUG(); /* nothing to do */ } +/* Return whether the given PCI device DMA address mask can + * be supported properly. For example, if your device can + * only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) +{ + return 1; +} + #define sg_dma_address(sg) (virt_to_bus((sg)->address)) #define sg_dma_len(sg) ((sg)->length) diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index f1f0f578a..303b2aa05 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -69,6 +69,8 @@ extern inline void flush_tlb_pgtables(struct mm_struct *mm, extern void flush_icache_range(unsigned long, unsigned long); extern void __flush_page_to_ram(unsigned long page_va); #define flush_page_to_ram(page) __flush_page_to_ram(page_address(page)) +extern void __flush_icache_page(unsigned long page_va); +#define flush_icache_page(vma, page) __flush_icache_page(page_address(page)) extern unsigned long va_to_phys(unsigned long address); extern pte_t *va_to_pte(struct task_struct *tsk, unsigned long address); @@ -413,7 +415,8 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #define pgd_offset_k(address) pgd_offset(&init_mm, address) /* to find an entry in a page-table-directory */ -#define pgd_offset(mm, address) ((mm)->pgd + ((address) >> PGDIR_SHIFT)) +#define pgd_index(address) ((address) >> PGDIR_SHIFT) +#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) /* Find an entry in the second-level page table.. */ extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) diff --git a/include/asm-ppc/posix_types.h b/include/asm-ppc/posix_types.h index f6d0d70ea..04c59a5b3 100644 --- a/include/asm-ppc/posix_types.h +++ b/include/asm-ppc/posix_types.h @@ -24,8 +24,8 @@ typedef long __kernel_clock_t; typedef int __kernel_daddr_t; typedef char * __kernel_caddr_t; typedef short __kernel_ipc_pid_t; -typedef unsigned int __kernel_uid16_t; -typedef unsigned int __kernel_gid16_t; +typedef unsigned short __kernel_uid16_t; +typedef unsigned short __kernel_gid16_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index 20e337f34..704bd68ab 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -11,6 +11,7 @@ #include <asm/ptrace.h> #include <asm/residual.h> +#include <asm/types.h> /* Machine State Register (MSR) Fields */ @@ -625,9 +626,11 @@ struct thread_struct { double fpr[32]; /* Complete floating point set */ unsigned long fpscr_pad; /* fpr ... fpscr must be contiguous */ unsigned long fpscr; /* Floating point status */ - unsigned long vrf[128]; - unsigned long vscr; +#ifdef CONFIG_ALTIVEC + vector128 vr[32]; /* Complete AltiVec set */ + vector128 vscr; /* AltiVec status */ unsigned long vrsave; +#endif /* CONFIG_ALTIVEC */ }; #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index ac1442861..156d8db72 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h @@ -33,7 +33,7 @@ void smp_send_tlb_invalidate(int); /* 1 to 1 mapping on PPC -- Cort */ #define cpu_logical_map(cpu) (cpu) -extern int cpu_number_map[NR_CPUS]; +#define cpu_number_map(x) (x) extern volatile unsigned long cpu_callin_map[NR_CPUS]; #define hard_smp_processor_id() (0) diff --git a/include/asm-ppc/softirq.h b/include/asm-ppc/softirq.h index 1188809e9..550b46192 100644 --- a/include/asm-ppc/softirq.h +++ b/include/asm-ppc/softirq.h @@ -4,116 +4,11 @@ #include <asm/atomic.h> #include <asm/hardirq.h> -#define get_active_bhs() (bh_mask & bh_active) -#define clear_active_bhs(x) atomic_clear_mask((x),&bh_active) +extern unsigned int local_bh_count[NR_CPUS]; -extern unsigned int ppc_local_bh_count[NR_CPUS]; +#define local_bh_disable() do { local_bh_count[smp_processor_id()]++; barrier(); } while (0) +#define local_bh_enable() do { barrier(); local_bh_count[smp_processor_id()]--; } while (0) -extern inline void init_bh(int nr, void (*routine)(void)) -{ - bh_base[nr] = routine; - atomic_set(&bh_mask_count[nr], 0); - bh_mask |= 1 << nr; -} - -extern inline void remove_bh(int nr) -{ - bh_mask &= ~(1 << nr); - wmb(); - bh_base[nr] = 0; -} - -extern inline void mark_bh(int nr) -{ - set_bit(nr, &bh_active); -} - -#ifdef __SMP__ - -/* - * The locking mechanism for base handlers, to prevent re-entrancy, - * is entirely private to an implementation, it should not be - * referenced at all outside of this file. - */ -extern atomic_t global_bh_lock; -extern atomic_t global_bh_count; - -extern void synchronize_bh(void); - -static inline void start_bh_atomic(void) -{ - atomic_inc(&global_bh_lock); - synchronize_bh(); -} - -static inline void end_bh_atomic(void) -{ - atomic_dec(&global_bh_lock); -} - -/* These are for the IRQs testing the lock */ -static inline int softirq_trylock(int cpu) -{ - if (ppc_local_bh_count[cpu] == 0) { - ppc_local_bh_count[cpu] = 1; - if (!test_and_set_bit(0,&global_bh_count)) { - mb(); - if (atomic_read(&global_bh_lock) == 0) - return 1; - clear_bit(0,&global_bh_count); - } - ppc_local_bh_count[cpu] = 0; - mb(); - } - return 0; -} - -static inline void softirq_endlock(int cpu) -{ - mb(); - ppc_local_bh_count[cpu]--; - clear_bit(0,&global_bh_count); -} - -#else - -extern inline void start_bh_atomic(void) -{ - ppc_local_bh_count[smp_processor_id()]++; - barrier(); -} - -extern inline void end_bh_atomic(void) -{ - barrier(); - ppc_local_bh_count[smp_processor_id()]--; -} - -/* These are for the irq's testing the lock */ -#define softirq_trylock(cpu) (ppc_local_bh_count[cpu] ? 0 : (ppc_local_bh_count[cpu]=1)) -#define softirq_endlock(cpu) (ppc_local_bh_count[cpu] = 0) -#define synchronize_bh() barrier() - -#endif /* SMP */ - -#define local_bh_disable() (ppc_local_bh_count[smp_processor_id()]++) -#define local_bh_enable() (ppc_local_bh_count[smp_processor_id()]--) - -/* - * These use a mask count to correctly handle - * nested disable/enable calls - */ -extern inline void disable_bh(int nr) -{ - bh_mask &= ~(1 << nr); - atomic_inc(&bh_mask_count[nr]); - synchronize_bh(); -} - -extern inline void enable_bh(int nr) -{ - if (atomic_dec_and_test(&bh_mask_count[nr])) - bh_mask |= 1 << nr; -} +#define in_softirq() (local_bh_count[smp_processor_id()] != 0) #endif /* __ASM_SOFTIRQ_H */ diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index ad1fdda17..5e7e2a19e 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h @@ -14,6 +14,7 @@ typedef struct { #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 0, 0 } #define spin_lock_init(lp) do { (lp)->lock = 0; } while(0) #define spin_unlock_wait(lp) do { barrier(); } while((lp)->lock) +#define spin_is_locked(x) ((x)->lock != 0) extern void _spin_lock(spinlock_t *lock); extern void _spin_unlock(spinlock_t *lock); diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h index 4c5e9766e..d39f91cf9 100644 --- a/include/asm-ppc/types.h +++ b/include/asm-ppc/types.h @@ -1,6 +1,7 @@ #ifndef _PPC_TYPES_H #define _PPC_TYPES_H +#ifndef __ASSEMBLY__ /* * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space @@ -41,10 +42,15 @@ typedef unsigned long long u64; #define BITS_PER_LONG 32 +typedef struct { + u32 u[4]; +} __attribute((aligned(16))) vector128; + /* DMA addresses are 32-bits wide */ typedef u32 dma_addr_t; #endif /* __KERNEL__ */ +#endif /* __ASSEMBLY__ */ #endif diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 867c07122..24a374d4b 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h @@ -76,6 +76,21 @@ extern int console_loglevel; #define PAGE_BUG(page) do { \ BUG(); \ } while (0) + +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif #endif /* __KERNEL__ */ diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index cd6dc704a..9dbd7005c 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h @@ -250,10 +250,9 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) /* to find an entry in a page-table-directory. */ -#define __pgd_offset(address) \ - ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) - -#define pgd_offset(mm, address) ((mm)->pgd+__pgd_offset(address)) +#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) +#define __pgd_offset(address) pgd_index(address) +#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h index 15f2d5093..3bbf39b20 100644 --- a/include/asm-sparc/asm_offsets.h +++ b/include/asm-sparc/asm_offsets.h @@ -79,113 +79,113 @@ #define AOFF_task_pidhash_pprev 0x00000094 #define ASIZ_task_pidhash_pprev 0x00000004 #define AOFF_task_wait_chldexit 0x00000098 -#define ASIZ_task_wait_chldexit 0x00000010 -#define AOFF_task_vfork_sem 0x000000a8 +#define ASIZ_task_wait_chldexit 0x00000014 +#define AOFF_task_vfork_sem 0x000000ac #define ASIZ_task_vfork_sem 0x00000004 -#define AOFF_task_rt_priority 0x000000ac +#define AOFF_task_rt_priority 0x000000b0 #define ASIZ_task_rt_priority 0x00000004 -#define AOFF_task_it_real_value 0x000000b0 +#define AOFF_task_it_real_value 0x000000b4 #define ASIZ_task_it_real_value 0x00000004 -#define AOFF_task_it_prof_value 0x000000b4 +#define AOFF_task_it_prof_value 0x000000b8 #define ASIZ_task_it_prof_value 0x00000004 -#define AOFF_task_it_virt_value 0x000000b8 +#define AOFF_task_it_virt_value 0x000000bc #define ASIZ_task_it_virt_value 0x00000004 -#define AOFF_task_it_real_incr 0x000000bc +#define AOFF_task_it_real_incr 0x000000c0 #define ASIZ_task_it_real_incr 0x00000004 -#define AOFF_task_it_prof_incr 0x000000c0 +#define AOFF_task_it_prof_incr 0x000000c4 #define ASIZ_task_it_prof_incr 0x00000004 -#define AOFF_task_it_virt_incr 0x000000c4 +#define AOFF_task_it_virt_incr 0x000000c8 #define ASIZ_task_it_virt_incr 0x00000004 -#define AOFF_task_real_timer 0x000000c8 -#define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000dc +#define AOFF_task_real_timer 0x000000cc +#define ASIZ_task_real_timer 0x00000018 +#define AOFF_task_times 0x000000e4 #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000ec +#define AOFF_task_start_time 0x000000f4 #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000f0 +#define AOFF_task_per_cpu_utime 0x000000f8 #define ASIZ_task_per_cpu_utime 0x00000004 -#define AOFF_task_min_flt 0x000000f8 +#define AOFF_task_min_flt 0x00000100 #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000000fc +#define AOFF_task_maj_flt 0x00000104 #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x00000100 +#define AOFF_task_nswap 0x00000108 #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x00000104 +#define AOFF_task_cmin_flt 0x0000010c #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x00000108 +#define AOFF_task_cmaj_flt 0x00000110 #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x0000010c +#define AOFF_task_cnswap 0x00000114 #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_uid 0x00000114 +#define AOFF_task_uid 0x0000011c #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x00000118 +#define AOFF_task_euid 0x00000120 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x0000011c +#define AOFF_task_suid 0x00000124 #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x00000120 +#define AOFF_task_fsuid 0x00000128 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x00000124 +#define AOFF_task_gid 0x0000012c #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x00000128 +#define AOFF_task_egid 0x00000130 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x0000012c +#define AOFF_task_sgid 0x00000134 #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x00000130 +#define AOFF_task_fsgid 0x00000138 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x00000134 +#define AOFF_task_ngroups 0x0000013c #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000138 +#define AOFF_task_groups 0x00000140 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x000001b8 +#define AOFF_task_cap_effective 0x000001c0 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x000001bc +#define AOFF_task_cap_inheritable 0x000001c4 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x000001c0 +#define AOFF_task_cap_permitted 0x000001c8 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x000001c4 +#define AOFF_task_user 0x000001cc #define ASIZ_task_user 0x00000004 -#define AOFF_task_rlim 0x000001c8 +#define AOFF_task_rlim 0x000001d0 #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x00000218 +#define AOFF_task_used_math 0x00000220 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000021a +#define AOFF_task_comm 0x00000222 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000022c +#define AOFF_task_link_count 0x00000234 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000230 +#define AOFF_task_tty 0x00000238 #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x00000234 +#define AOFF_task_semundo 0x0000023c #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x00000238 +#define AOFF_task_semsleeping 0x00000240 #define ASIZ_task_semsleeping 0x00000004 -#define AOFF_task_thread 0x00000240 +#define AOFF_task_thread 0x00000248 #define ASIZ_task_thread 0x00000380 -#define AOFF_task_fs 0x000005c0 +#define AOFF_task_fs 0x000005c8 #define ASIZ_task_fs 0x00000004 -#define AOFF_task_files 0x000005c4 +#define AOFF_task_files 0x000005cc #define ASIZ_task_files 0x00000004 -#define AOFF_task_sigmask_lock 0x000005c8 -#define ASIZ_task_sigmask_lock 0x00000000 -#define AOFF_task_sig 0x000005c8 +#define AOFF_task_sigmask_lock 0x000005d0 +#define ASIZ_task_sigmask_lock 0x00000004 +#define AOFF_task_sig 0x000005d4 #define ASIZ_task_sig 0x00000004 -#define AOFF_task_signal 0x000005cc +#define AOFF_task_signal 0x000005d8 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x000005d4 +#define AOFF_task_blocked 0x000005e0 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x000005dc +#define AOFF_task_sigqueue 0x000005e8 #define ASIZ_task_sigqueue 0x00000004 -#define AOFF_task_sigqueue_tail 0x000005e0 +#define AOFF_task_sigqueue_tail 0x000005ec #define ASIZ_task_sigqueue_tail 0x00000004 -#define AOFF_task_sas_ss_sp 0x000005e4 +#define AOFF_task_sas_ss_sp 0x000005f0 #define ASIZ_task_sas_ss_sp 0x00000004 -#define AOFF_task_sas_ss_size 0x000005e8 +#define AOFF_task_sas_ss_size 0x000005f4 #define ASIZ_task_sas_ss_size 0x00000004 -#define AOFF_task_parent_exec_id 0x000005ec +#define AOFF_task_parent_exec_id 0x000005f8 #define ASIZ_task_parent_exec_id 0x00000004 -#define AOFF_task_self_exec_id 0x000005f0 +#define AOFF_task_self_exec_id 0x000005fc #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x000005f4 -#define ASIZ_task_exit_sem 0x0000001c +#define AOFF_task_exit_sem 0x00000600 +#define ASIZ_task_exit_sem 0x00000020 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000004 #define AOFF_mm_mmap_avl 0x00000004 @@ -201,48 +201,48 @@ #define AOFF_mm_map_count 0x00000018 #define ASIZ_mm_map_count 0x00000004 #define AOFF_mm_mmap_sem 0x0000001c -#define ASIZ_mm_mmap_sem 0x0000001c -#define AOFF_mm_page_table_lock 0x00000038 -#define ASIZ_mm_page_table_lock 0x00000000 -#define AOFF_mm_context 0x00000038 +#define ASIZ_mm_mmap_sem 0x00000020 +#define AOFF_mm_page_table_lock 0x0000003c +#define ASIZ_mm_page_table_lock 0x00000004 +#define AOFF_mm_context 0x00000040 #define ASIZ_mm_context 0x00000004 -#define AOFF_mm_start_code 0x0000003c +#define AOFF_mm_start_code 0x00000044 #define ASIZ_mm_start_code 0x00000004 -#define AOFF_mm_end_code 0x00000040 +#define AOFF_mm_end_code 0x00000048 #define ASIZ_mm_end_code 0x00000004 -#define AOFF_mm_start_data 0x00000044 +#define AOFF_mm_start_data 0x0000004c #define ASIZ_mm_start_data 0x00000004 -#define AOFF_mm_end_data 0x00000048 +#define AOFF_mm_end_data 0x00000050 #define ASIZ_mm_end_data 0x00000004 -#define AOFF_mm_start_brk 0x0000004c +#define AOFF_mm_start_brk 0x00000054 #define ASIZ_mm_start_brk 0x00000004 -#define AOFF_mm_brk 0x00000050 +#define AOFF_mm_brk 0x00000058 #define ASIZ_mm_brk 0x00000004 -#define AOFF_mm_start_stack 0x00000054 +#define AOFF_mm_start_stack 0x0000005c #define ASIZ_mm_start_stack 0x00000004 -#define AOFF_mm_arg_start 0x00000058 +#define AOFF_mm_arg_start 0x00000060 #define ASIZ_mm_arg_start 0x00000004 -#define AOFF_mm_arg_end 0x0000005c +#define AOFF_mm_arg_end 0x00000064 #define ASIZ_mm_arg_end 0x00000004 -#define AOFF_mm_env_start 0x00000060 +#define AOFF_mm_env_start 0x00000068 #define ASIZ_mm_env_start 0x00000004 -#define AOFF_mm_env_end 0x00000064 +#define AOFF_mm_env_end 0x0000006c #define ASIZ_mm_env_end 0x00000004 -#define AOFF_mm_rss 0x00000068 +#define AOFF_mm_rss 0x00000070 #define ASIZ_mm_rss 0x00000004 -#define AOFF_mm_total_vm 0x0000006c +#define AOFF_mm_total_vm 0x00000074 #define ASIZ_mm_total_vm 0x00000004 -#define AOFF_mm_locked_vm 0x00000070 +#define AOFF_mm_locked_vm 0x00000078 #define ASIZ_mm_locked_vm 0x00000004 -#define AOFF_mm_def_flags 0x00000074 +#define AOFF_mm_def_flags 0x0000007c #define ASIZ_mm_def_flags 0x00000004 -#define AOFF_mm_cpu_vm_mask 0x00000078 +#define AOFF_mm_cpu_vm_mask 0x00000080 #define ASIZ_mm_cpu_vm_mask 0x00000004 -#define AOFF_mm_swap_cnt 0x0000007c +#define AOFF_mm_swap_cnt 0x00000084 #define ASIZ_mm_swap_cnt 0x00000004 -#define AOFF_mm_swap_address 0x00000080 +#define AOFF_mm_swap_address 0x00000088 #define ASIZ_mm_swap_address 0x00000004 -#define AOFF_mm_segments 0x00000084 +#define AOFF_mm_segments 0x0000008c #define ASIZ_mm_segments 0x00000004 #define AOFF_thread_uwinmask 0x00000000 #define ASIZ_thread_uwinmask 0x00000004 @@ -378,66 +378,66 @@ #define AOFF_task_it_virt_incr 0x000000cc #define ASIZ_task_it_virt_incr 0x00000004 #define AOFF_task_real_timer 0x000000d0 -#define ASIZ_task_real_timer 0x00000014 -#define AOFF_task_times 0x000000e4 +#define ASIZ_task_real_timer 0x00000018 +#define AOFF_task_times 0x000000e8 #define ASIZ_task_times 0x00000010 -#define AOFF_task_start_time 0x000000f4 +#define AOFF_task_start_time 0x000000f8 #define ASIZ_task_start_time 0x00000004 -#define AOFF_task_per_cpu_utime 0x000000f8 +#define AOFF_task_per_cpu_utime 0x000000fc #define ASIZ_task_per_cpu_utime 0x00000080 -#define AOFF_task_min_flt 0x000001f8 +#define AOFF_task_min_flt 0x000001fc #define ASIZ_task_min_flt 0x00000004 -#define AOFF_task_maj_flt 0x000001fc +#define AOFF_task_maj_flt 0x00000200 #define ASIZ_task_maj_flt 0x00000004 -#define AOFF_task_nswap 0x00000200 +#define AOFF_task_nswap 0x00000204 #define ASIZ_task_nswap 0x00000004 -#define AOFF_task_cmin_flt 0x00000204 +#define AOFF_task_cmin_flt 0x00000208 #define ASIZ_task_cmin_flt 0x00000004 -#define AOFF_task_cmaj_flt 0x00000208 +#define AOFF_task_cmaj_flt 0x0000020c #define ASIZ_task_cmaj_flt 0x00000004 -#define AOFF_task_cnswap 0x0000020c +#define AOFF_task_cnswap 0x00000210 #define ASIZ_task_cnswap 0x00000004 -#define AOFF_task_uid 0x00000214 +#define AOFF_task_uid 0x00000218 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x00000218 +#define AOFF_task_euid 0x0000021c #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x0000021c +#define AOFF_task_suid 0x00000220 #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x00000220 +#define AOFF_task_fsuid 0x00000224 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x00000224 +#define AOFF_task_gid 0x00000228 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x00000228 +#define AOFF_task_egid 0x0000022c #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x0000022c +#define AOFF_task_sgid 0x00000230 #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x00000230 +#define AOFF_task_fsgid 0x00000234 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x00000234 +#define AOFF_task_ngroups 0x00000238 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000238 +#define AOFF_task_groups 0x0000023c #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x000002b8 +#define AOFF_task_cap_effective 0x000002bc #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x000002bc +#define AOFF_task_cap_inheritable 0x000002c0 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x000002c0 +#define AOFF_task_cap_permitted 0x000002c4 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x000002c4 +#define AOFF_task_user 0x000002c8 #define ASIZ_task_user 0x00000004 -#define AOFF_task_rlim 0x000002c8 +#define AOFF_task_rlim 0x000002cc #define ASIZ_task_rlim 0x00000050 -#define AOFF_task_used_math 0x00000318 +#define AOFF_task_used_math 0x0000031c #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000031a +#define AOFF_task_comm 0x0000031e #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000032c +#define AOFF_task_link_count 0x00000330 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000330 +#define AOFF_task_tty 0x00000334 #define ASIZ_task_tty 0x00000004 -#define AOFF_task_semundo 0x00000334 +#define AOFF_task_semundo 0x00000338 #define ASIZ_task_semundo 0x00000004 -#define AOFF_task_semsleeping 0x00000338 +#define AOFF_task_semsleeping 0x0000033c #define ASIZ_task_semsleeping 0x00000004 #define AOFF_task_thread 0x00000340 #define ASIZ_task_thread 0x00000380 diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h index 56fe88bba..bbe134c28 100644 --- a/include/asm-sparc/hardirq.h +++ b/include/asm-sparc/hardirq.h @@ -18,8 +18,8 @@ extern unsigned int local_irq_count; */ #define in_interrupt() ((local_irq_count + local_bh_count) != 0) -#define hardirq_trylock(cpu) (local_irq_count == 0) -#define hardirq_endlock(cpu) do { } while (0) +#define hardirq_trylock(cpu) ((void)(cpu), local_irq_count == 0) +#define hardirq_endlock(cpu) do { (void)(cpu); } while (0) #define hardirq_enter(cpu) (local_irq_count++) #define hardirq_exit(cpu) (local_irq_count--) diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h index 344640811..3c61eb636 100644 --- a/include/asm-sparc/page.h +++ b/include/asm-sparc/page.h @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.47 2000/01/29 00:41:49 anton Exp $ +/* $Id: page.h,v 1.48 2000/02/16 07:34:51 davem Exp $ * page.h: Various defines and such for MMU operations on the Sparc for * the Linux kernel. * @@ -129,6 +129,20 @@ BTFIXUPDEF_SETHI(sparc_unmapped_base) #define TASK_UNMAPPED_BASE BTFIXUP_SETHI(sparc_unmapped_base) +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #else /* !(__ASSEMBLY__) */ #define __pgprot(x) (x) diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h index a2749a907..80ea9d11d 100644 --- a/include/asm-sparc/pci.h +++ b/include/asm-sparc/pci.h @@ -40,7 +40,7 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, * Once the device is given the dma address, the device owns this memory * until either pci_unmap_single or pci_dma_sync_single is performed. */ -extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size); +extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction); /* Unmap a single streaming mode DMA translation. The dma_addr and size * must match what was provided for in a previous pci_map_single call. All @@ -49,7 +49,7 @@ extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size); * After this call, reads by the cpu to the buffer are guarenteed to see * whatever the device wrote there. */ -extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size); +extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction); /* Map a set of buffers described by scatterlist in streaming * mode for DMA. This is the scather-gather version of the @@ -66,13 +66,13 @@ extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t * Device ownership issues as mentioned above for pci_map_single are * the same here. */ -extern int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents); +extern int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction); /* Unmap a set of streaming mode DMA translations. * Again, cpu read rules concerning calls here are the same as for * pci_unmap_single() above. */ -extern void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwents); +extern void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwents, int direction); /* Make physical memory consistent for a single * streaming mode DMA translation after a transfer. @@ -83,7 +83,7 @@ extern void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwe * next point you give the PCI dma address back to the card, the * device again owns the buffer. */ -extern void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size); +extern void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction); /* Make physical memory consistent for a set of streaming * mode DMA translations after a transfer. @@ -91,7 +91,17 @@ extern void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, si * The same as pci_dma_sync_single but for a scatter-gather list, * same rules and usage. */ -extern void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems); +extern void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction); + +/* Return whether the given PCI device DMA address mask can + * be supported properly. For example, if your device can + * only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) +{ + return 1; +} #endif /* __KERNEL__ */ diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 8829d323c..6899b49cd 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.88 2000/02/06 22:56:09 zaitcev Exp $ */ +/* $Id: pgtable.h,v 1.91 2000/02/16 08:44:52 anton Exp $ */ #ifndef _SPARC_PGTABLE_H #define _SPARC_PGTABLE_H @@ -327,15 +327,16 @@ extern __inline__ pte_t pte_modify(pte_t pte, pgprot_t newprot) pgprot_val(newprot)); } -BTFIXUPDEF_CALL(pgd_t *, pgd_offset, struct mm_struct *, unsigned long) -BTFIXUPDEF_CALL(pmd_t *, pmd_offset, pgd_t *, unsigned long) -BTFIXUPDEF_CALL(pte_t *, pte_offset, pmd_t *, unsigned long) +#define pgd_index(address) ((address) >> PGDIR_SHIFT) + +/* to find an entry in a page-table-directory */ +#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) -/* to find an entry in a page-table-directory */ -#define pgd_offset(mm,addr) BTFIXUP_CALL(pgd_offset)(mm,addr) +BTFIXUPDEF_CALL(pmd_t *, pmd_offset, pgd_t *, unsigned long) +BTFIXUPDEF_CALL(pte_t *, pte_offset, pmd_t *, unsigned long) /* Find an entry in the second-level page table.. */ #define pmd_offset(dir,addr) BTFIXUP_CALL(pmd_offset)(dir,addr) @@ -346,6 +347,8 @@ BTFIXUPDEF_CALL(pte_t *, pte_offset, pmd_t *, unsigned long) /* The permissions for pgprot_val to make a page mapped on the obio space */ extern unsigned int pg_iobits; +#define flush_icache_page(vma, pg) do { } while(0) + /* Certain architectures need to do special things when pte's * within a page table are directly modified. Thus, the following * hook is made available. @@ -448,4 +451,7 @@ extern int io_remap_page_range(unsigned long from, unsigned long to, #endif /* !(__ASSEMBLY__) */ +/* We provide our own get_unmapped_area to cope with VA holes for userland */ +#define HAVE_ARCH_UNMAPPED_AREA + #endif /* !(_SPARC_PGTABLE_H) */ diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h index b7f2b8f9e..6a687a465 100644 --- a/include/asm-sparc/sbus.h +++ b/include/asm-sparc/sbus.h @@ -1,4 +1,4 @@ -/* $Id: sbus.h,v 1.21 2000/01/28 13:43:11 jj Exp $ +/* $Id: sbus.h,v 1.22 2000/02/18 13:50:50 davem Exp $ * sbus.h: Defines for the Sun SBus. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -97,22 +97,27 @@ sbus_is_slave(struct sbus_dev *dev) for((bus) = sbus_root, ((device) = (bus) ? (bus)->devices : 0); (bus); (device)=((device)->next ? (device)->next : ((bus) = (bus)->next, (bus) ? (bus)->devices : 0))) /* Driver DVMA interfaces. */ -#define sbus_can_dma_64bit(sdev) (1) -#define sbus_can_burst64(sdev) (1) +#define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */ +#define sbus_can_burst64(sdev) (0) /* actually, sparc_cpu_model==sun4d */ extern void sbus_set_sbus64(struct sbus_dev *, int); /* These yield IOMMU mappings in consistent mode. */ extern void *sbus_alloc_consistent(struct sbus_dev *, long, u32 *dma_addrp); extern void sbus_free_consistent(struct sbus_dev *, long, void *, u32); +#define SBUS_DMA_BIDIRECTIONAL 0 +#define SBUS_DMA_TODEVICE 1 +#define SBUS_DMA_FROMDEVICE 2 +#define SBUS_DMA_NONE 3 + /* All the rest use streaming mode mappings. */ -extern u32 sbus_map_single(struct sbus_dev *, void *, long); -extern void sbus_unmap_single(struct sbus_dev *, u32, long); -extern int sbus_map_sg(struct sbus_dev *, struct scatterlist *, int); -extern void sbus_unmap_sg(struct sbus_dev *, struct scatterlist *, int); +extern u32 sbus_map_single(struct sbus_dev *, void *, long, int); +extern void sbus_unmap_single(struct sbus_dev *, u32, long, int); +extern int sbus_map_sg(struct sbus_dev *, struct scatterlist *, int, int); +extern void sbus_unmap_sg(struct sbus_dev *, struct scatterlist *, int, int); /* Finally, allow explicit synchronization of streamable mappings. */ -extern void sbus_dma_sync_single(struct sbus_dev *, u32, long); -extern void sbus_dma_sync_sg(struct sbus_dev *, struct scatterlist *, int); +extern void sbus_dma_sync_single(struct sbus_dev *, u32, long, int); +extern void sbus_dma_sync_sg(struct sbus_dev *, struct scatterlist *, int, int); #endif /* !(_SPARC_SBUS_H) */ diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h index 895583bb8..3ed7dd760 100644 --- a/include/asm-sparc64/asm_offsets.h +++ b/include/asm-sparc64/asm_offsets.h @@ -85,114 +85,114 @@ #define AOFF_task_pidhash_pprev 0x000000f8 #define ASIZ_task_pidhash_pprev 0x00000008 #define AOFF_task_wait_chldexit 0x00000100 -#define ASIZ_task_wait_chldexit 0x00000020 -#define AOFF_task_vfork_sem 0x00000120 +#define ASIZ_task_wait_chldexit 0x00000028 +#define AOFF_task_vfork_sem 0x00000128 #define ASIZ_task_vfork_sem 0x00000008 -#define AOFF_task_rt_priority 0x00000128 +#define AOFF_task_rt_priority 0x00000130 #define ASIZ_task_rt_priority 0x00000008 -#define AOFF_task_it_real_value 0x00000130 +#define AOFF_task_it_real_value 0x00000138 #define ASIZ_task_it_real_value 0x00000008 -#define AOFF_task_it_prof_value 0x00000138 +#define AOFF_task_it_prof_value 0x00000140 #define ASIZ_task_it_prof_value 0x00000008 -#define AOFF_task_it_virt_value 0x00000140 +#define AOFF_task_it_virt_value 0x00000148 #define ASIZ_task_it_virt_value 0x00000008 -#define AOFF_task_it_real_incr 0x00000148 +#define AOFF_task_it_real_incr 0x00000150 #define ASIZ_task_it_real_incr 0x00000008 -#define AOFF_task_it_prof_incr 0x00000150 +#define AOFF_task_it_prof_incr 0x00000158 #define ASIZ_task_it_prof_incr 0x00000008 -#define AOFF_task_it_virt_incr 0x00000158 +#define AOFF_task_it_virt_incr 0x00000160 #define ASIZ_task_it_virt_incr 0x00000008 -#define AOFF_task_real_timer 0x00000160 -#define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000188 +#define AOFF_task_real_timer 0x00000168 +#define ASIZ_task_real_timer 0x00000030 +#define AOFF_task_times 0x00000198 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x000001a8 +#define AOFF_task_start_time 0x000001b8 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x000001b0 +#define AOFF_task_per_cpu_utime 0x000001c0 #define ASIZ_task_per_cpu_utime 0x00000008 -#define AOFF_task_min_flt 0x000001c0 +#define AOFF_task_min_flt 0x000001d0 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000001c8 +#define AOFF_task_maj_flt 0x000001d8 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000001d0 +#define AOFF_task_nswap 0x000001e0 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000001d8 +#define AOFF_task_cmin_flt 0x000001e8 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000001e0 +#define AOFF_task_cmaj_flt 0x000001f0 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000001e8 +#define AOFF_task_cnswap 0x000001f8 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000001f4 +#define AOFF_task_uid 0x00000204 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000001f8 +#define AOFF_task_euid 0x00000208 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000001fc +#define AOFF_task_suid 0x0000020c #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x00000200 +#define AOFF_task_fsuid 0x00000210 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x00000204 +#define AOFF_task_gid 0x00000214 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x00000208 +#define AOFF_task_egid 0x00000218 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x0000020c +#define AOFF_task_sgid 0x0000021c #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x00000210 +#define AOFF_task_fsgid 0x00000220 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x00000214 +#define AOFF_task_ngroups 0x00000224 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000218 +#define AOFF_task_groups 0x00000228 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000298 +#define AOFF_task_cap_effective 0x000002a8 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x0000029c +#define AOFF_task_cap_inheritable 0x000002ac #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x000002a0 +#define AOFF_task_cap_permitted 0x000002b0 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x000002a8 +#define AOFF_task_user 0x000002b8 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x000002b0 +#define AOFF_task_rlim 0x000002c0 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000350 +#define AOFF_task_used_math 0x00000360 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x00000352 +#define AOFF_task_comm 0x00000362 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x00000364 +#define AOFF_task_link_count 0x00000374 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000368 +#define AOFF_task_tty 0x00000378 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000370 +#define AOFF_task_semundo 0x00000380 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000378 +#define AOFF_task_semsleeping 0x00000388 #define ASIZ_task_semsleeping 0x00000008 -#define AOFF_task_thread 0x00000380 +#define AOFF_task_thread 0x00000390 #define ASIZ_task_thread 0x00000450 -#define AOFF_task_fs 0x000007d0 +#define AOFF_task_fs 0x000007e0 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x000007d8 +#define AOFF_task_files 0x000007e8 #define ASIZ_task_files 0x00000008 -#define AOFF_task_sigmask_lock 0x000007e0 -#define ASIZ_task_sigmask_lock 0x00000000 -#define AOFF_task_sig 0x000007e0 +#define AOFF_task_sigmask_lock 0x000007f0 +#define ASIZ_task_sigmask_lock 0x00000004 +#define AOFF_task_sig 0x000007f8 #define ASIZ_task_sig 0x00000008 -#define AOFF_task_signal 0x000007e8 +#define AOFF_task_signal 0x00000800 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x000007f0 +#define AOFF_task_blocked 0x00000808 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x000007f8 +#define AOFF_task_sigqueue 0x00000810 #define ASIZ_task_sigqueue 0x00000008 -#define AOFF_task_sigqueue_tail 0x00000800 +#define AOFF_task_sigqueue_tail 0x00000818 #define ASIZ_task_sigqueue_tail 0x00000008 -#define AOFF_task_sas_ss_sp 0x00000808 +#define AOFF_task_sas_ss_sp 0x00000820 #define ASIZ_task_sas_ss_sp 0x00000008 -#define AOFF_task_sas_ss_size 0x00000810 +#define AOFF_task_sas_ss_size 0x00000828 #define ASIZ_task_sas_ss_size 0x00000008 -#define AOFF_task_parent_exec_id 0x00000818 +#define AOFF_task_parent_exec_id 0x00000830 #define ASIZ_task_parent_exec_id 0x00000004 -#define AOFF_task_self_exec_id 0x0000081c +#define AOFF_task_self_exec_id 0x00000834 #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000820 -#define ASIZ_task_exit_sem 0x00000030 -#define ASIZ_task 0x00000850 +#define AOFF_task_exit_sem 0x00000838 +#define ASIZ_task_exit_sem 0x00000038 +#define ASIZ_task 0x00000870 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_avl 0x00000008 @@ -208,50 +208,50 @@ #define AOFF_mm_map_count 0x00000028 #define ASIZ_mm_map_count 0x00000004 #define AOFF_mm_mmap_sem 0x00000030 -#define ASIZ_mm_mmap_sem 0x00000030 -#define AOFF_mm_page_table_lock 0x00000060 -#define ASIZ_mm_page_table_lock 0x00000000 -#define AOFF_mm_context 0x00000060 +#define ASIZ_mm_mmap_sem 0x00000038 +#define AOFF_mm_page_table_lock 0x00000068 +#define ASIZ_mm_page_table_lock 0x00000004 +#define AOFF_mm_context 0x00000070 #define ASIZ_mm_context 0x00000008 -#define AOFF_mm_start_code 0x00000068 +#define AOFF_mm_start_code 0x00000078 #define ASIZ_mm_start_code 0x00000008 -#define AOFF_mm_end_code 0x00000070 +#define AOFF_mm_end_code 0x00000080 #define ASIZ_mm_end_code 0x00000008 -#define AOFF_mm_start_data 0x00000078 +#define AOFF_mm_start_data 0x00000088 #define ASIZ_mm_start_data 0x00000008 -#define AOFF_mm_end_data 0x00000080 +#define AOFF_mm_end_data 0x00000090 #define ASIZ_mm_end_data 0x00000008 -#define AOFF_mm_start_brk 0x00000088 +#define AOFF_mm_start_brk 0x00000098 #define ASIZ_mm_start_brk 0x00000008 -#define AOFF_mm_brk 0x00000090 +#define AOFF_mm_brk 0x000000a0 #define ASIZ_mm_brk 0x00000008 -#define AOFF_mm_start_stack 0x00000098 +#define AOFF_mm_start_stack 0x000000a8 #define ASIZ_mm_start_stack 0x00000008 -#define AOFF_mm_arg_start 0x000000a0 +#define AOFF_mm_arg_start 0x000000b0 #define ASIZ_mm_arg_start 0x00000008 -#define AOFF_mm_arg_end 0x000000a8 +#define AOFF_mm_arg_end 0x000000b8 #define ASIZ_mm_arg_end 0x00000008 -#define AOFF_mm_env_start 0x000000b0 +#define AOFF_mm_env_start 0x000000c0 #define ASIZ_mm_env_start 0x00000008 -#define AOFF_mm_env_end 0x000000b8 +#define AOFF_mm_env_end 0x000000c8 #define ASIZ_mm_env_end 0x00000008 -#define AOFF_mm_rss 0x000000c0 +#define AOFF_mm_rss 0x000000d0 #define ASIZ_mm_rss 0x00000008 -#define AOFF_mm_total_vm 0x000000c8 +#define AOFF_mm_total_vm 0x000000d8 #define ASIZ_mm_total_vm 0x00000008 -#define AOFF_mm_locked_vm 0x000000d0 +#define AOFF_mm_locked_vm 0x000000e0 #define ASIZ_mm_locked_vm 0x00000008 -#define AOFF_mm_def_flags 0x000000d8 +#define AOFF_mm_def_flags 0x000000e8 #define ASIZ_mm_def_flags 0x00000008 -#define AOFF_mm_cpu_vm_mask 0x000000e0 +#define AOFF_mm_cpu_vm_mask 0x000000f0 #define ASIZ_mm_cpu_vm_mask 0x00000008 -#define AOFF_mm_swap_cnt 0x000000e8 +#define AOFF_mm_swap_cnt 0x000000f8 #define ASIZ_mm_swap_cnt 0x00000008 -#define AOFF_mm_swap_address 0x000000f0 +#define AOFF_mm_swap_address 0x00000100 #define ASIZ_mm_swap_address 0x00000008 -#define AOFF_mm_segments 0x000000f8 +#define AOFF_mm_segments 0x00000108 #define ASIZ_mm_segments 0x00000008 -#define ASIZ_mm 0x00000100 +#define ASIZ_mm 0x00000110 #define AOFF_thread_ksp 0x00000000 #define ASIZ_thread_ksp 0x00000008 #define AOFF_thread_wstate 0x00000008 @@ -391,66 +391,66 @@ #define AOFF_task_it_virt_incr 0x00000160 #define ASIZ_task_it_virt_incr 0x00000008 #define AOFF_task_real_timer 0x00000168 -#define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000190 +#define ASIZ_task_real_timer 0x00000030 +#define AOFF_task_times 0x00000198 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x000001b0 +#define AOFF_task_start_time 0x000001b8 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x000001b8 +#define AOFF_task_per_cpu_utime 0x000001c0 #define ASIZ_task_per_cpu_utime 0x00000100 -#define AOFF_task_min_flt 0x000003b8 +#define AOFF_task_min_flt 0x000003c0 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000003c0 +#define AOFF_task_maj_flt 0x000003c8 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000003c8 +#define AOFF_task_nswap 0x000003d0 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000003d0 +#define AOFF_task_cmin_flt 0x000003d8 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000003d8 +#define AOFF_task_cmaj_flt 0x000003e0 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000003e0 +#define AOFF_task_cnswap 0x000003e8 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000003ec +#define AOFF_task_uid 0x000003f4 #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000003f0 +#define AOFF_task_euid 0x000003f8 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000003f4 +#define AOFF_task_suid 0x000003fc #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x000003f8 +#define AOFF_task_fsuid 0x00000400 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x000003fc +#define AOFF_task_gid 0x00000404 #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x00000400 +#define AOFF_task_egid 0x00000408 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x00000404 +#define AOFF_task_sgid 0x0000040c #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x00000408 +#define AOFF_task_fsgid 0x00000410 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x0000040c +#define AOFF_task_ngroups 0x00000414 #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000410 +#define AOFF_task_groups 0x00000418 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000490 +#define AOFF_task_cap_effective 0x00000498 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x00000494 +#define AOFF_task_cap_inheritable 0x0000049c #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x00000498 +#define AOFF_task_cap_permitted 0x000004a0 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x000004a0 +#define AOFF_task_user 0x000004a8 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x000004a8 +#define AOFF_task_rlim 0x000004b0 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000548 +#define AOFF_task_used_math 0x00000550 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x0000054a +#define AOFF_task_comm 0x00000552 #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x0000055c +#define AOFF_task_link_count 0x00000564 #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000560 +#define AOFF_task_tty 0x00000568 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000568 +#define AOFF_task_semundo 0x00000570 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000570 +#define AOFF_task_semsleeping 0x00000578 #define ASIZ_task_semsleeping 0x00000008 #define AOFF_task_thread 0x00000580 #define ASIZ_task_thread 0x00000450 @@ -677,96 +677,96 @@ #define AOFF_task_it_virt_incr 0x00000168 #define ASIZ_task_it_virt_incr 0x00000008 #define AOFF_task_real_timer 0x00000170 -#define ASIZ_task_real_timer 0x00000028 -#define AOFF_task_times 0x00000198 +#define ASIZ_task_real_timer 0x00000030 +#define AOFF_task_times 0x000001a0 #define ASIZ_task_times 0x00000020 -#define AOFF_task_start_time 0x000001b8 +#define AOFF_task_start_time 0x000001c0 #define ASIZ_task_start_time 0x00000008 -#define AOFF_task_per_cpu_utime 0x000001c0 +#define AOFF_task_per_cpu_utime 0x000001c8 #define ASIZ_task_per_cpu_utime 0x00000100 -#define AOFF_task_min_flt 0x000003c0 +#define AOFF_task_min_flt 0x000003c8 #define ASIZ_task_min_flt 0x00000008 -#define AOFF_task_maj_flt 0x000003c8 +#define AOFF_task_maj_flt 0x000003d0 #define ASIZ_task_maj_flt 0x00000008 -#define AOFF_task_nswap 0x000003d0 +#define AOFF_task_nswap 0x000003d8 #define ASIZ_task_nswap 0x00000008 -#define AOFF_task_cmin_flt 0x000003d8 +#define AOFF_task_cmin_flt 0x000003e0 #define ASIZ_task_cmin_flt 0x00000008 -#define AOFF_task_cmaj_flt 0x000003e0 +#define AOFF_task_cmaj_flt 0x000003e8 #define ASIZ_task_cmaj_flt 0x00000008 -#define AOFF_task_cnswap 0x000003e8 +#define AOFF_task_cnswap 0x000003f0 #define ASIZ_task_cnswap 0x00000008 -#define AOFF_task_uid 0x000003f4 +#define AOFF_task_uid 0x000003fc #define ASIZ_task_uid 0x00000004 -#define AOFF_task_euid 0x000003f8 +#define AOFF_task_euid 0x00000400 #define ASIZ_task_euid 0x00000004 -#define AOFF_task_suid 0x000003fc +#define AOFF_task_suid 0x00000404 #define ASIZ_task_suid 0x00000004 -#define AOFF_task_fsuid 0x00000400 +#define AOFF_task_fsuid 0x00000408 #define ASIZ_task_fsuid 0x00000004 -#define AOFF_task_gid 0x00000404 +#define AOFF_task_gid 0x0000040c #define ASIZ_task_gid 0x00000004 -#define AOFF_task_egid 0x00000408 +#define AOFF_task_egid 0x00000410 #define ASIZ_task_egid 0x00000004 -#define AOFF_task_sgid 0x0000040c +#define AOFF_task_sgid 0x00000414 #define ASIZ_task_sgid 0x00000004 -#define AOFF_task_fsgid 0x00000410 +#define AOFF_task_fsgid 0x00000418 #define ASIZ_task_fsgid 0x00000004 -#define AOFF_task_ngroups 0x00000414 +#define AOFF_task_ngroups 0x0000041c #define ASIZ_task_ngroups 0x00000004 -#define AOFF_task_groups 0x00000418 +#define AOFF_task_groups 0x00000420 #define ASIZ_task_groups 0x00000080 -#define AOFF_task_cap_effective 0x00000498 +#define AOFF_task_cap_effective 0x000004a0 #define ASIZ_task_cap_effective 0x00000004 -#define AOFF_task_cap_inheritable 0x0000049c +#define AOFF_task_cap_inheritable 0x000004a4 #define ASIZ_task_cap_inheritable 0x00000004 -#define AOFF_task_cap_permitted 0x000004a0 +#define AOFF_task_cap_permitted 0x000004a8 #define ASIZ_task_cap_permitted 0x00000004 -#define AOFF_task_user 0x000004a8 +#define AOFF_task_user 0x000004b0 #define ASIZ_task_user 0x00000008 -#define AOFF_task_rlim 0x000004b0 +#define AOFF_task_rlim 0x000004b8 #define ASIZ_task_rlim 0x000000a0 -#define AOFF_task_used_math 0x00000550 +#define AOFF_task_used_math 0x00000558 #define ASIZ_task_used_math 0x00000002 -#define AOFF_task_comm 0x00000552 +#define AOFF_task_comm 0x0000055a #define ASIZ_task_comm 0x00000010 -#define AOFF_task_link_count 0x00000564 +#define AOFF_task_link_count 0x0000056c #define ASIZ_task_link_count 0x00000004 -#define AOFF_task_tty 0x00000568 +#define AOFF_task_tty 0x00000570 #define ASIZ_task_tty 0x00000008 -#define AOFF_task_semundo 0x00000570 +#define AOFF_task_semundo 0x00000578 #define ASIZ_task_semundo 0x00000008 -#define AOFF_task_semsleeping 0x00000578 +#define AOFF_task_semsleeping 0x00000580 #define ASIZ_task_semsleeping 0x00000008 -#define AOFF_task_thread 0x00000580 +#define AOFF_task_thread 0x00000590 #define ASIZ_task_thread 0x00000450 -#define AOFF_task_fs 0x000009d0 +#define AOFF_task_fs 0x000009e0 #define ASIZ_task_fs 0x00000008 -#define AOFF_task_files 0x000009d8 +#define AOFF_task_files 0x000009e8 #define ASIZ_task_files 0x00000008 -#define AOFF_task_sigmask_lock 0x000009e0 +#define AOFF_task_sigmask_lock 0x000009f0 #define ASIZ_task_sigmask_lock 0x0000000c -#define AOFF_task_sig 0x000009f0 +#define AOFF_task_sig 0x00000a00 #define ASIZ_task_sig 0x00000008 -#define AOFF_task_signal 0x000009f8 +#define AOFF_task_signal 0x00000a08 #define ASIZ_task_signal 0x00000008 -#define AOFF_task_blocked 0x00000a00 +#define AOFF_task_blocked 0x00000a10 #define ASIZ_task_blocked 0x00000008 -#define AOFF_task_sigqueue 0x00000a08 +#define AOFF_task_sigqueue 0x00000a18 #define ASIZ_task_sigqueue 0x00000008 -#define AOFF_task_sigqueue_tail 0x00000a10 +#define AOFF_task_sigqueue_tail 0x00000a20 #define ASIZ_task_sigqueue_tail 0x00000008 -#define AOFF_task_sas_ss_sp 0x00000a18 +#define AOFF_task_sas_ss_sp 0x00000a28 #define ASIZ_task_sas_ss_sp 0x00000008 -#define AOFF_task_sas_ss_size 0x00000a20 +#define AOFF_task_sas_ss_size 0x00000a30 #define ASIZ_task_sas_ss_size 0x00000008 -#define AOFF_task_parent_exec_id 0x00000a28 +#define AOFF_task_parent_exec_id 0x00000a38 #define ASIZ_task_parent_exec_id 0x00000004 -#define AOFF_task_self_exec_id 0x00000a2c +#define AOFF_task_self_exec_id 0x00000a3c #define ASIZ_task_self_exec_id 0x00000004 -#define AOFF_task_exit_sem 0x00000a30 +#define AOFF_task_exit_sem 0x00000a40 #define ASIZ_task_exit_sem 0x00000040 -#define ASIZ_task 0x00000a70 +#define ASIZ_task 0x00000a80 #define AOFF_mm_mmap 0x00000000 #define ASIZ_mm_mmap 0x00000008 #define AOFF_mm_mmap_avl 0x00000008 diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index fb65d46dc..25cc6dd9f 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -1,4 +1,4 @@ -/* $Id: floppy.h,v 1.25 2000/01/28 13:43:14 jj Exp $ +/* $Id: floppy.h,v 1.28 2000/02/18 13:50:54 davem Exp $ * asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -273,7 +273,7 @@ static struct linux_ebus_dma *sun_pci_fd_ebus_dma; static struct pci_dev *sun_pci_ebus_dev; static int sun_pci_broken_drive = -1; static unsigned int sun_pci_dma_addr = -1U; -static int sun_pci_dma_len; +static int sun_pci_dma_len, sun_pci_dma_direction; extern void floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -369,7 +369,8 @@ static void sun_pci_fd_disable_dma(void) if (sun_pci_dma_addr != -1U) pci_unmap_single(sun_pci_ebus_dev, sun_pci_dma_addr, - sun_pci_dma_len); + sun_pci_dma_len, + sun_pci_dma_direction); sun_pci_dma_addr = -1U; } @@ -388,10 +389,13 @@ static void sun_pci_fd_set_dma_mode(int mode) * For EBus WRITE means to system memory, which is * READ for us. */ - if (mode == DMA_MODE_WRITE) + if (mode == DMA_MODE_WRITE) { dcsr &= ~(EBUS_DCSR_WRITE); - else + sun_pci_dma_direction = PCI_DMA_TODEVICE; + } else { dcsr |= EBUS_DCSR_WRITE; + sun_pci_dma_direction = PCI_DMA_FROMDEVICE; + } writel(dcsr, &sun_pci_fd_ebus_dma->dcsr); } @@ -407,7 +411,8 @@ static void sun_pci_fd_set_dma_addr(char *buffer) addr = sun_pci_dma_addr = pci_map_single(sun_pci_ebus_dev, buffer, - sun_pci_dma_len); + sun_pci_dma_len, + sun_pci_dma_direction); writel(addr, &sun_pci_fd_ebus_dma->dacr); } @@ -560,12 +565,9 @@ static int sun_pci_fd_test_drive(unsigned long port, int drive) #endif /* CONFIG_PCI */ -static struct linux_prom_registers fd_regs[2]; - static unsigned long __init sun_floppy_init(void) { char state[128]; - int fd_node, num_regs; struct sbus_bus *bus; struct sbus_dev *sdev = NULL; static int initialized = 0; @@ -714,21 +716,19 @@ static unsigned long __init sun_floppy_init(void) return 0; #endif } - fd_node = sdev->prom_node; - prom_getproperty(fd_node, "status", state, sizeof(state)); + prom_getproperty(sdev->prom_node, "status", state, sizeof(state)); if(!strncmp(state, "disabled", 8)) return 0; - num_regs = prom_getproperty(fd_node, "reg", (char *) fd_regs, - sizeof(fd_regs)); - num_regs = (num_regs / sizeof(fd_regs[0])); /* - * We cannot do sparc_alloc_io here: it does request_region, + * We cannot do sbus_ioremap here: it does request_region, * which the generic floppy driver tries to do once again. + * But we must use the sdev resource values as they have + * had parent ranges applied. */ sun_fdc = (struct sun_flpy_controller *) - (PAGE_OFFSET + fd_regs[0].phys_addr + - (((unsigned long)fd_regs[0].which_io) << 32)); + (sdev->resource[0].start + + ((sdev->resource[0].flags & 0x1ffUL) << 32UL)); /* Last minute sanity check... */ if(sbus_readb(&sun_fdc->status1_82077) == 0xff) { diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h index daff61ac4..58597a028 100644 --- a/include/asm-sparc64/hardirq.h +++ b/include/asm-sparc64/hardirq.h @@ -25,11 +25,11 @@ extern unsigned int local_irq_count; #ifndef __SMP__ -#define hardirq_trylock(cpu) (local_irq_count == 0) -#define hardirq_endlock(cpu) do { } while(0) +#define hardirq_trylock(cpu) ((void)(cpu), local_irq_count == 0) +#define hardirq_endlock(cpu) do { (void)(cpu); } while(0) -#define hardirq_enter(cpu) (local_irq_count++) -#define hardirq_exit(cpu) (local_irq_count--) +#define hardirq_enter(cpu) ((void)(cpu), local_irq_count++) +#define hardirq_exit(cpu) ((void)(cpu), local_irq_count--) #define synchronize_irq() barrier() @@ -73,7 +73,7 @@ static inline int hardirq_trylock(int cpu) ! spin_is_locked (&global_irq_lock)); } -#define hardirq_endlock(cpu) do { } while (0) +#define hardirq_endlock(cpu) do { (void)(cpu); } while (0) extern void synchronize_irq(void); diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h index 788e8dd18..0c137b72d 100644 --- a/include/asm-sparc64/io.h +++ b/include/asm-sparc64/io.h @@ -1,4 +1,4 @@ -/* $Id: io.h,v 1.31 2000/02/08 05:11:38 jj Exp $ */ +/* $Id: io.h,v 1.32 2000/02/15 10:04:54 jj Exp $ */ #ifndef __SPARC64_IO_H #define __SPARC64_IO_H @@ -82,6 +82,10 @@ extern __inline__ void outl(unsigned int l, unsigned long addr) #define inb_p inb #define outb_p outb +#define inw_p inw +#define outw_p outw +#define inl_p inl +#define outl_p outl extern void outsb(unsigned long addr, const void *src, unsigned long count); extern void outsw(unsigned long addr, const void *src, unsigned long count); diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index dabfea993..7653f4af1 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h @@ -1,4 +1,4 @@ -/* $Id: page.h,v 1.29 1999/12/09 10:32:43 davem Exp $ */ +/* $Id: page.h,v 1.30 2000/02/16 07:34:54 davem Exp $ */ #ifndef _SPARC64_PAGE_H #define _SPARC64_PAGE_H @@ -126,6 +126,20 @@ struct sparc_phys_banks { extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* !(__ASSEMBLY__) */ #endif /* !(__KERNEL__) */ diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 12f015edb..22281b176 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -1,4 +1,4 @@ -/* $Id: pbm.h,v 1.19 1999/12/17 12:32:13 jj Exp $ +/* $Id: pbm.h,v 1.20 2000/02/18 13:50:55 davem Exp $ * pbm.h: UltraSparc PCI controller software state. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com) @@ -69,6 +69,18 @@ struct pci_iommu { * these counters. You have been duly warned. -DaveM */ u16 lowest_free[PBM_NCLUSTERS]; + + /* Here a PCI controller driver describes the areas of + * PCI memory space where DMA to/from physical memory + * are addressed. Drivers interrogate the PCI layer + * if their device has addressing limitations. They + * do so via pci_dma_supported, and pass in a mask of + * DMA address bits their device can actually drive. + * + * The test for being usable is: + * (device_mask & dma_addr_mask) == dma_addr_mask + */ + u32 dma_addr_mask; }; /* This describes a PCI bus module's streaming buffer. */ diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 881de6c2f..267cbf797 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -40,7 +40,7 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, * Once the device is given the dma address, the device owns this memory * until either pci_unmap_single or pci_dma_sync_single is performed. */ -extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size); +extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction); /* Unmap a single streaming mode DMA translation. The dma_addr and size * must match what was provided for in a previous pci_map_single call. All @@ -49,7 +49,7 @@ extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size); * After this call, reads by the cpu to the buffer are guarenteed to see * whatever the device wrote there. */ -extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size); +extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction); /* Map a set of buffers described by scatterlist in streaming * mode for DMA. This is the scather-gather version of the @@ -66,13 +66,13 @@ extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t * Device ownership issues as mentioned above for pci_map_single are * the same here. */ -extern int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents); +extern int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction); /* Unmap a set of streaming mode DMA translations. * Again, cpu read rules concerning calls here are the same as for * pci_unmap_single() above. */ -extern void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwents); +extern void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwents, int direction); /* Make physical memory consistent for a single * streaming mode DMA translation after a transfer. @@ -83,7 +83,7 @@ extern void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwe * next point you give the PCI dma address back to the card, the * device again owns the buffer. */ -extern void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size); +extern void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction); /* Make physical memory consistent for a set of streaming * mode DMA translations after a transfer. @@ -91,7 +91,14 @@ extern void pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, si * The same as pci_dma_sync_single but for a scatter-gather list, * same rules and usage. */ -extern void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems); +extern void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction); + +/* Return whether the given PCI device DMA address mask can + * be supported properly. For example, if your device can + * only drive the low 24-bits during PCI bus mastering, then + * you would pass 0x00ffffff as the mask to this function. + */ +extern int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask); #endif /* __KERNEL__ */ diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 3b93b20c1..8bb88ee49 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.118 1999/12/21 21:24:35 davem Exp $ +/* $Id: pgtable.h,v 1.120 2000/02/16 07:34:54 davem Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -235,7 +235,8 @@ static __inline__ pte_t pte_mkdirty(pte_t _pte) } /* to find an entry in a page-table-directory. */ -#define pgd_offset(mm, address) ((mm)->pgd + ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD))) +#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD)) +#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) /* to find an entry in a kernel page-table-directory */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) @@ -279,17 +280,19 @@ extern pgd_t swapper_pg_dir[1]; * table. * 4) Splat. */ -extern void flush_icache_page(unsigned long phys_page); +extern void __flush_icache_page(unsigned long phys_page); #define update_mmu_cache(__vma, __address, _pte) \ do { \ unsigned short __flags = ((__vma)->vm_flags); \ if ((__flags & VM_EXEC) != 0 && \ ((pte_val(_pte) & (_PAGE_PRESENT | _PAGE_WRITE | _PAGE_MODIFIED)) == \ (_PAGE_PRESENT | _PAGE_WRITE | _PAGE_MODIFIED))) { \ - flush_icache_page(pte_pagenr(_pte) << PAGE_SHIFT); \ + __flush_icache_page(pte_pagenr(_pte) << PAGE_SHIFT); \ } \ } while(0) +#define flush_icache_page(vma, pg) do { } while(0) + /* Make a non-present pseudo-TTE. */ extern inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space) { @@ -350,4 +353,7 @@ extern int io_remap_page_range(unsigned long from, unsigned long offset, #endif /* !(__ASSEMBLY__) */ +/* We provide our own get_unmapped_area to cope with VA holes for userland */ +#define HAVE_ARCH_UNMAPPED_AREA + #endif /* !(_SPARC64_PGTABLE_H) */ diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h index f8c5e247f..e9f7344b4 100644 --- a/include/asm-sparc64/sbus.h +++ b/include/asm-sparc64/sbus.h @@ -1,4 +1,4 @@ -/* $Id: sbus.h,v 1.13 2000/01/28 13:43:14 jj Exp $ +/* $Id: sbus.h,v 1.14 2000/02/18 13:50:55 davem Exp $ * sbus.h: Defines for the Sun SBus. * * Copyright (C) 1996, 1999 David S. Miller (davem@redhat.com) @@ -98,14 +98,19 @@ extern void sbus_set_sbus64(struct sbus_dev *, int); extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); extern void sbus_free_consistent(struct sbus_dev *, size_t, void *, dma_addr_t); +#define SBUS_DMA_BIDIRECTIONAL 0 +#define SBUS_DMA_TODEVICE 1 +#define SBUS_DMA_FROMDEVICE 2 +#define SBUS_DMA_NONE 3 + /* All the rest use streaming mode mappings. */ -extern dma_addr_t sbus_map_single(struct sbus_dev *, void *, size_t); -extern void sbus_unmap_single(struct sbus_dev *, dma_addr_t, size_t); -extern int sbus_map_sg(struct sbus_dev *, struct scatterlist *, int); -extern void sbus_unmap_sg(struct sbus_dev *, struct scatterlist *, int); +extern dma_addr_t sbus_map_single(struct sbus_dev *, void *, size_t, int); +extern void sbus_unmap_single(struct sbus_dev *, dma_addr_t, size_t, int); +extern int sbus_map_sg(struct sbus_dev *, struct scatterlist *, int, int); +extern void sbus_unmap_sg(struct sbus_dev *, struct scatterlist *, int, int); /* Finally, allow explicit synchronization of streamable mappings. */ -extern void sbus_dma_sync_single(struct sbus_dev *, dma_addr_t, size_t); -extern void sbus_dma_sync_sg(struct sbus_dev *, struct scatterlist *, int); +extern void sbus_dma_sync_single(struct sbus_dev *, dma_addr_t, size_t, int); +extern void sbus_dma_sync_sg(struct sbus_dev *, struct scatterlist *, int, int); #endif /* !(_SPARC64_SBUS_H) */ diff --git a/include/linux/adfs_fs_i.h b/include/linux/adfs_fs_i.h index 94d5607bf..7da1ceda0 100644 --- a/include/linux/adfs_fs_i.h +++ b/include/linux/adfs_fs_i.h @@ -11,7 +11,7 @@ * adfs file system inode data in memory */ struct adfs_inode_info { - unsigned long mmu_private; + unsigned long mmu_private; unsigned long parent_id; /* object id of parent */ __u32 loadaddr; /* RISC OS load address */ __u32 execaddr; /* RISC OS exec address */ diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h index 074cad84f..69ea9cf48 100644 --- a/include/linux/apm_bios.h +++ b/include/linux/apm_bios.h @@ -3,7 +3,7 @@ /* * Include file for the interface to an APM BIOS - * Copyright 1994-1999 Stephen Rothwell (sfr@linuxcare.com) + * Copyright 1994-2000 Stephen Rothwell (sfr@linuxcare.com) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -91,32 +91,6 @@ struct apm_bios_info { #define APM_FUNC_TIMER_GET 2 /* - * Maximum number of events stored - */ -#define APM_MAX_EVENTS 20 - -/* - * The per-file APM data - */ -struct apm_bios_struct { - int magic; - struct apm_bios_struct * next; - int suser; - int suspends_pending; - int standbys_pending; - int suspends_read; - int standbys_read; - int event_head; - int event_tail; - apm_event_t events[APM_MAX_EVENTS]; -}; - -/* - * The magic number in apm_bios_struct - */ -#define APM_BIOS_MAGIC 0x4101 - -/* * in init/main.c */ extern struct apm_bios_info apm_bios_info; diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h index 962593cc8..aaacb18c4 100644 --- a/include/linux/auto_fs.h +++ b/include/linux/auto_fs.h @@ -81,11 +81,4 @@ struct autofs_packet_expire { #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) -#ifdef __KERNEL__ - -/* Init function */ -int init_autofs_fs(void); - -#endif /* __KERNEL__ */ - #endif /* _LINUX_AUTO_FS_H */ diff --git a/include/linux/ax25.h b/include/linux/ax25.h index 1e492c8ff..9191445bb 100644 --- a/include/linux/ax25.h +++ b/include/linux/ax25.h @@ -29,9 +29,11 @@ #define SIOCAX25NOUID (SIOCPROTOPRIVATE+3) #define SIOCAX25OPTRT (SIOCPROTOPRIVATE+7) #define SIOCAX25CTLCON (SIOCPROTOPRIVATE+8) -#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+9) +#define SIOCAX25GETINFOOLD (SIOCPROTOPRIVATE+9) #define SIOCAX25ADDFWD (SIOCPROTOPRIVATE+10) #define SIOCAX25DELFWD (SIOCPROTOPRIVATE+11) +#define SIOCAX25DEVCTL (SIOCPROTOPRIVATE+12) +#define SIOCAX25GETINFO (SIOCPROTOPRIVATE+13) #define AX25_SET_RT_IPMODE 2 @@ -80,6 +82,17 @@ struct ax25_ctl_struct { ax25_address digi_addr[AX25_MAX_DIGIS]; }; +/* this will go away. Please do not export to user land */ +struct ax25_info_struct_depreciated { + unsigned int n2, n2count; + unsigned int t1, t1timer; + unsigned int t2, t2timer; + unsigned int t3, t3timer; + unsigned int idle, idletimer; + unsigned int state; + unsigned int rcv_q, snd_q; +}; + struct ax25_info_struct { unsigned int n2, n2count; unsigned int t1, t1timer; @@ -88,6 +101,9 @@ struct ax25_info_struct { unsigned int idle, idletimer; unsigned int state; unsigned int rcv_q, snd_q; + unsigned int vs, vr, va, vs_max; + unsigned int paclen; + unsigned int window; }; struct ax25_fwd_struct { diff --git a/include/linux/blk.h b/include/linux/blk.h index aba8430a2..1a818c4fd 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -96,6 +96,18 @@ void initrd_init(void); * code duplication in drivers. */ +extern inline void blkdev_dequeue_request(struct request * req) +{ + if (req->q) + { + if (req->cmd == READ) + req->q->elevator.read_pendings--; + req->q->nr_segments -= req->nr_segments; + req->q = NULL; + } + list_del(&req->queue); +} + int end_that_request_first(struct request *req, int uptodate, char *name); void end_that_request_last(struct request *req); @@ -373,7 +385,10 @@ static void floppy_off(unsigned int nr); #if !defined(IDE_DRIVER) #ifndef CURRENT -#define CURRENT (blk_dev[MAJOR_NR].request_queue.current_request) +#define CURRENT blkdev_entry_next_request(&blk_dev[MAJOR_NR].request_queue.queue_head) +#endif +#ifndef QUEUE_EMPTY +#define QUEUE_EMPTY list_empty(&blk_dev[MAJOR_NR].request_queue.queue_head) #endif #ifndef DEVICE_NAME @@ -418,7 +433,7 @@ static void (DEVICE_REQUEST)(request_queue_t *); #endif #define INIT_REQUEST \ - if (!CURRENT) {\ + if (QUEUE_EMPTY) {\ CLEAR_INTR; \ return; \ } \ @@ -446,7 +461,7 @@ static void end_request(int uptodate) { add_blkdev_randomness(MAJOR(req->rq_dev)); #endif DEVICE_OFF(req->rq_dev); - CURRENT = req->next; + blkdev_dequeue_request(req); end_that_request_last(req); } diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6eed225b6..c035f1327 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -5,6 +5,10 @@ #include <linux/sched.h> #include <linux/genhd.h> #include <linux/tqueue.h> +#include <linux/list.h> + +struct request_queue; +typedef struct request_queue request_queue_t; /* * Ok, this is an expanded form so that we can use the same @@ -13,6 +17,9 @@ * for read/write completion. */ struct request { + struct list_head queue; + int elevator_sequence; + volatile int rq_status; /* should split this into a few status bits */ #define RQ_INACTIVE (-1) #define RQ_ACTIVE 1 @@ -33,27 +40,42 @@ struct request { struct semaphore * sem; struct buffer_head * bh; struct buffer_head * bhtail; - struct request * next; + request_queue_t * q; }; -typedef struct request_queue request_queue_t; typedef int (merge_request_fn) (request_queue_t *q, struct request *req, - struct buffer_head *bh); + struct buffer_head *bh, + int); typedef int (merge_requests_fn) (request_queue_t *q, struct request *req, - struct request *req2); + struct request *req2, + int); typedef void (request_fn_proc) (request_queue_t *q); typedef request_queue_t * (queue_proc) (kdev_t dev); typedef void (make_request_fn) (int rw, struct buffer_head *bh); typedef void (plug_device_fn) (request_queue_t *q, kdev_t device); typedef void (unplug_device_fn) (void *q); +typedef struct elevator_s +{ + int sequence; + int read_latency; + int write_latency; + int max_bomb_segments; + int read_pendings; +} elevator_t; + struct request_queue { - struct request * current_request; + struct list_head queue_head; + /* together with queue_head for cacheline sharing */ + elevator_t elevator; + unsigned int nr_segments; + request_fn_proc * request_fn; - merge_request_fn * merge_fn; + merge_request_fn * back_merge_fn; + merge_request_fn * front_merge_fn; merge_requests_fn * merge_requests_fn; make_request_fn * make_request_fn; plug_device_fn * plug_device_fn; @@ -107,7 +129,6 @@ extern wait_queue_head_t wait_for_request; extern void grok_partitions(struct gendisk *dev, int drive, unsigned minors, long size); extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size); extern void generic_unplug_device(void * data); -extern void generic_plug_device (request_queue_t *q, kdev_t dev); extern void generic_make_request(int rw, struct buffer_head * bh); extern request_queue_t * blk_get_queue(kdev_t dev); @@ -142,4 +163,12 @@ extern int * max_segments[MAX_BLKDEV]; #define MAX_READAHEAD 31 #define MIN_READAHEAD 3 +#define ELEVATOR_DEFAULTS ((elevator_t) { 0, NR_REQUEST>>1, NR_REQUEST<<5, 4, 0, }) + +#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queue) +#define blkdev_entry_next_request(entry) blkdev_entry_to_request((entry)->next) +#define blkdev_entry_prev_request(entry) blkdev_entry_to_request((entry)->prev) +#define blkdev_next_request(req) blkdev_entry_to_request((req)->queue.next) +#define blkdev_prev_request(req) blkdev_entry_to_request((req)->queue.prev) + #endif diff --git a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h index da6c40e1c..ebd81c013 100644 --- a/include/linux/byteorder/big_endian.h +++ b/include/linux/byteorder/big_endian.h @@ -14,6 +14,18 @@ #define __constant_ntohl(x) ((__u32)(x)) #define __constant_htons(x) ((__u16)(x)) #define __constant_ntohs(x) ((__u16)(x)) +#define __constant_cpu_to_le64(x) ___swab64((x)) +#define __constant_le64_to_cpu(x) ___swab64((x)) +#define __constant_cpu_to_le32(x) ___swab32((x)) +#define __constant_le32_to_cpu(x) ___swab32((x)) +#define __constant_cpu_to_le16(x) ___swab16((x)) +#define __constant_le16_to_cpu(x) ___swab16((x)) +#define __constant_cpu_to_be64(x) ((__u64)(x)) +#define __constant_be64_to_cpu(x) ((__u64)(x)) +#define __constant_cpu_to_be32(x) ((__u32)(x)) +#define __constant_be32_to_cpu(x) ((__u32)(x)) +#define __constant_cpu_to_be16(x) ((__u16)(x)) +#define __constant_be16_to_cpu(x) ((__u16)(x)) #define __cpu_to_le64(x) __swab64((x)) #define __le64_to_cpu(x) __swab64((x)) #define __cpu_to_le32(x) __swab32((x)) diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h index ede7054c1..5a5412403 100644 --- a/include/linux/byteorder/little_endian.h +++ b/include/linux/byteorder/little_endian.h @@ -14,6 +14,18 @@ #define __constant_ntohl(x) ___swab32((x)) #define __constant_htons(x) ___swab16((x)) #define __constant_ntohs(x) ___swab16((x)) +#define __constant_cpu_to_le64(x) ((__u64)(x)) +#define __constant_le64_to_cpu(x) ((__u64)(x)) +#define __constant_cpu_to_le32(x) ((__u32)(x)) +#define __constant_le32_to_cpu(x) ((__u32)(x)) +#define __constant_cpu_to_le16(x) ((__u16)(x)) +#define __constant_le16_to_cpu(x) ((__u16)(x)) +#define __constant_cpu_to_be64(x) ___swab64((x)) +#define __constant_be64_to_cpu(x) ___swab64((x)) +#define __constant_cpu_to_be32(x) ___swab32((x)) +#define __constant_be32_to_cpu(x) ___swab32((x)) +#define __constant_cpu_to_be16(x) ___swab16((x)) +#define __constant_be16_to_cpu(x) ___swab16((x)) #define __cpu_to_le64(x) ((__u64)(x)) #define __le64_to_cpu(x) ((__u64)(x)) #define __cpu_to_le32(x) ((__u32)(x)) diff --git a/include/linux/byteorder/pdp_endian.h b/include/linux/byteorder/pdp_endian.h index 306123839..90f8c7433 100644 --- a/include/linux/byteorder/pdp_endian.h +++ b/include/linux/byteorder/pdp_endian.h @@ -34,6 +34,18 @@ #define __constant_ntohl(x) ___swahb32((x)) #define __constant_htons(x) ___swab16((x)) #define __constant_ntohs(x) ___swab16((x)) +#define __constant_cpu_to_le64(x) I DON'T KNOW +#define __constant_le64_to_cpu(x) I DON'T KNOW +#define __constant_cpu_to_le32(x) ___swahw32((x)) +#define __constant_le32_to_cpu(x) ___swahw32((x)) +#define __constant_cpu_to_le16(x) ((__u16)(x) +#define __constant_le16_to_cpu(x) ((__u16)(x) +#define __constant_cpu_to_be64(x) I DON'T KNOW +#define __constant_be64_to_cpu(x) I DON'T KNOW +#define __constant_cpu_to_be32(x) ___swahb32((x)) +#define __constant_be32_to_cpu(x) ___swahb32((x)) +#define __constant_cpu_to_be16(x) ___swab16((x)) +#define __constant_be16_to_cpu(x) ___swab16((x)) #define __cpu_to_le64(x) I DON'T KNOW #define __le64_to_cpu(x) I DON'T KNOW #define __cpu_to_le32(x) ___swahw32((x)) diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 78f7d426b..3f15c3063 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -705,6 +705,7 @@ struct request_sense { }; #ifdef __KERNEL__ +#include <linux/devfs_fs_kernel.h> struct cdrom_write_settings { unsigned char fpacket; /* fixed/variable packets */ @@ -718,6 +719,7 @@ struct cdrom_device_info { struct cdrom_device_ops *ops; /* link to device_ops */ struct cdrom_device_info *next; /* next device_info for this major */ void *handle; /* driver-dependent data */ + devfs_handle_t de; /* real driver creates this */ /* specifications */ kdev_t dev; /* device number */ int mask; /* mask of capability: disables them */ diff --git a/include/linux/console.h b/include/linux/console.h index 1f4188a78..f8da31cbd 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -16,6 +16,7 @@ #include <linux/types.h> #include <linux/kdev_t.h> +#include <linux/spinlock.h> struct vc_data; struct console_font_op; @@ -90,6 +91,8 @@ extern struct console_cmdline console_list[MAX_CMDLINECONSOLES]; #define CON_CONSDEV (2) /* Last on the command line */ #define CON_ENABLED (4) +extern spinlock_t console_lock; + struct console { char name[8]; diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 3dfa8f67d..3dcad3357 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -98,6 +98,12 @@ struct dentry_operations { * renamed" and has to be * deleted on the last dput() */ +#define DCACHE_NFSD_DISCONNECTED 0x0004 /* This dentry is not currently connected to the + * dcache tree. Its parent will either be itself, + * or will have this flag as well. + * If this dentry points to a directory, then + * s_nfsd_free_path semaphore will be down + */ /* * d_drop() unhashes the entry from the parent diff --git a/include/linux/devfs_fs.h b/include/linux/devfs_fs.h new file mode 100644 index 000000000..9c4cf54c2 --- /dev/null +++ b/include/linux/devfs_fs.h @@ -0,0 +1,42 @@ +#ifndef _LINUX_DEVFS_FS_H +#define _LINUX_DEVFS_FS_H + +#include <linux/ioctl.h> + +#define DEVFSD_PROTOCOL_REVISION_KERNEL 5 + +#define DEVFSD_IOCTL_BASE 'd' + +/* These are the various ioctls */ +#define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int) +#define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int) +#define DEVFSDIOC_RELEASE_EVENT_QUEUE _IOW(DEVFSD_IOCTL_BASE, 3, int) +#define DEVFSDIOC_SET_DEBUG_MASK _IOW(DEVFSD_IOCTL_BASE, 4, int) + +#define DEVFSD_NOTIFY_REGISTERED 0 +#define DEVFSD_NOTIFY_UNREGISTERED 1 +#define DEVFSD_NOTIFY_ASYNC_OPEN 2 +#define DEVFSD_NOTIFY_CLOSE 3 +#define DEVFSD_NOTIFY_LOOKUP 4 +#define DEVFSD_NOTIFY_CHANGE 5 +#define DEVFSD_NOTIFY_CREATE 6 + +#define DEVFS_PATHLEN 1024 /* Never change this otherwise the + binary interface will change */ + +struct devfsd_notify_struct +{ + unsigned int type; /* DEVFSD_NOTIFY_* value */ + unsigned int mode; /* Mode of the inode or device entry */ + unsigned int major; /* Major number of device entry */ + unsigned int minor; /* Minor number of device entry */ + unsigned int uid; /* Uid of process, inode or device entry */ + unsigned int gid; /* Gid of process, inode or device entry */ + unsigned int overrun_count; /* Number of lost events */ + unsigned int namelen; /* Number of characters not including '\0' */ + /* The device name MUST come last */ + char devname[DEVFS_PATHLEN]; /* This will be '\0' terminated */ +}; + + +#endif /* _LINUX_DEVFS_FS_H */ diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h new file mode 100644 index 000000000..b3abeacd4 --- /dev/null +++ b/include/linux/devfs_fs_kernel.h @@ -0,0 +1,258 @@ +#ifndef _LINUX_DEVFS_FS_KERNEL_H +#define _LINUX_DEVFS_FS_KERNEL_H + +#include <linux/fs.h> +#include <linux/config.h> + +#define DEVFS_SUPER_MAGIC 0x1373 + +#define IS_DEVFS_INODE(inode) (DEVFS_SUPER_MAGIC == (inode)->i_sb->s_magic) + +#define DEVFS_MINOR(inode) \ + ({unsigned int m; /* evil GCC trickery */ \ + ((inode)->i_sb && \ + ((inode)->i_sb->s_magic==DEVFS_SUPER_MAGIC) && \ + (devfs_get_maj_min(devfs_get_handle_from_inode((inode)),NULL,&m)==0) \ + ) ? m : MINOR((inode)->r_dev); }) + + +#define DEVFS_FL_NONE 0x000 /* This helps making code more readable */ +#define DEVFS_FL_AUTO_OWNER 0x001 /* When a closed inode is opened the + ownerships are set to the opening + process and the protection is set to + that given in <<mode>>. When the inode + is closed, ownership reverts back to + <<uid>> and <<gid>> and the protection + is set to read-write for all */ +#define DEVFS_FL_SHOW_UNREG 0x002 /* Show unregistered entries in + directory listings */ +#define DEVFS_FL_HIDE 0x004 /* Do not show entry in directory list */ +#define DEVFS_FL_AUTO_DEVNUM 0x008 /* Automatically generate device number */ +#define DEVFS_FL_AOPEN_NOTIFY 0x010 /* Asynchronously notify devfsd on open */ +#define DEVFS_FL_REMOVABLE 0x020 /* This is a removable media device */ +#define DEVFS_FL_WAIT 0x040 /* Wait for devfsd to finish */ +#define DEVFS_FL_DEFAULT DEVFS_FL_NONE + + +#define DEVFS_SPECIAL_CHR 0 +#define DEVFS_SPECIAL_BLK 1 + +typedef struct devfs_entry * devfs_handle_t; + + +#ifdef CONFIG_BLK_DEV_INITRD +# define ROOT_DEVICE_NAME ((real_root_dev ==ROOT_DEV) ? root_device_name:NULL) +#else +# define ROOT_DEVICE_NAME root_device_name +#endif + + +#ifdef CONFIG_DEVFS_FS +extern devfs_handle_t devfs_register (devfs_handle_t dir, + const char *name, unsigned int namelen, + unsigned int flags, + unsigned int major, unsigned int minor, + umode_t mode, uid_t uid, gid_t gid, + void *ops, void *info); +extern void devfs_unregister (devfs_handle_t de); +extern int devfs_mk_symlink (devfs_handle_t dir, + const char *name, unsigned int namelen, + unsigned int flags, + const char *link, unsigned int linklength, + devfs_handle_t *handle, void *info); +extern devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name, + unsigned int namelen, void *info); +extern devfs_handle_t devfs_find_handle (devfs_handle_t dir, + const char *name,unsigned int namelen, + unsigned int major,unsigned int minor, + char type, int traverse_symlinks); +extern int devfs_get_flags (devfs_handle_t de, unsigned int *flags); +extern int devfs_set_flags (devfs_handle_t de, unsigned int flags); +extern int devfs_get_maj_min (devfs_handle_t de, + unsigned int *major, unsigned int *minor); +extern devfs_handle_t devfs_get_handle_from_inode (struct inode *inode); +extern int devfs_generate_path (devfs_handle_t de, char *path, int buflen); +extern void *devfs_get_ops (devfs_handle_t de); +extern int devfs_set_file_size (devfs_handle_t de, unsigned long size); +extern void *devfs_get_info (devfs_handle_t de); +extern int devfs_set_info (devfs_handle_t de, void *info); +extern devfs_handle_t devfs_get_parent (devfs_handle_t de); +extern devfs_handle_t devfs_get_first_child (devfs_handle_t de); +extern devfs_handle_t devfs_get_next_sibling (devfs_handle_t de); +extern void devfs_auto_unregister (devfs_handle_t master,devfs_handle_t slave); +extern devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master); +extern const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen); +extern int devfs_register_chrdev (unsigned int major, const char *name, + struct file_operations *fops); +extern int devfs_register_blkdev (unsigned int major, const char *name, + struct block_device_operations *bdops); +extern int devfs_unregister_chrdev (unsigned int major, const char *name); +extern int devfs_unregister_blkdev (unsigned int major, const char *name); + +extern void devfs_register_tape (devfs_handle_t de); +extern void devfs_register_series (devfs_handle_t dir, const char *format, + unsigned int num_entries, + unsigned int flags, unsigned int major, + unsigned int minor_start, + umode_t mode, uid_t uid, gid_t gid, + void *ops, void *info); + +extern int init_devfs_fs (void); +extern void mount_devfs_fs (void); +extern void devfs_make_root (const char *name); +#else /* CONFIG_DEVFS_FS */ +static inline devfs_handle_t devfs_register (devfs_handle_t dir, + const char *name, + unsigned int namelen, + unsigned int flags, + unsigned int major, + unsigned int minor, + umode_t mode, + uid_t uid, gid_t gid, + void *ops, void *info) +{ + return NULL; +} +static inline void devfs_unregister (devfs_handle_t de) +{ + return; +} +static inline int devfs_mk_symlink (devfs_handle_t dir, + const char *name, unsigned int namelen, + unsigned int flags, + const char *link, unsigned int linklength, + devfs_handle_t *handle, void *info) +{ + return 0; +} +static inline devfs_handle_t devfs_mk_dir (devfs_handle_t dir, + const char *name, + unsigned int namelen, void *info) +{ + return NULL; +} +static inline devfs_handle_t devfs_find_handle (devfs_handle_t dir, + const char *name, + unsigned int namelen, + unsigned int major, + unsigned int minor, + char type, + int traverse_symlinks) +{ + return NULL; +} +static inline int devfs_get_flags (devfs_handle_t de, unsigned int *flags) +{ + return 0; +} +static inline int devfs_set_flags (devfs_handle_t de, unsigned int flags) +{ + return 0; +} +static inline int devfs_get_maj_min (devfs_handle_t de, + unsigned int *major, unsigned int *minor) +{ + return 0; +} +static inline devfs_handle_t devfs_get_handle_from_inode (struct inode *inode) +{ + return NULL; +} +static inline int devfs_generate_path (devfs_handle_t de, char *path, + int buflen) +{ + return -ENOSYS; +} +static inline void *devfs_get_ops (devfs_handle_t de) +{ + return NULL; +} +static inline int devfs_set_file_size (devfs_handle_t de, unsigned long size) +{ + return -ENOSYS; +} +static inline void *devfs_get_info (devfs_handle_t de, unsigned long size) +{ + return NULL; +} +static inline int devfs_set_info (devfs_handle_t de, void *info) +{ + return 0; +} +static inline devfs_handle_t devfs_get_parent (devfs_handle_t de) +{ + return NULL; +} +static inline devfs_handle_t devfs_get_first_child (devfs_handle_t de) +{ + return NULL; +} +static inline devfs_handle_t devfs_get_next_sibling (devfs_handle_t de) +{ + return NULL; +} +static inline void devfs_auto_unregister (devfs_handle_t master, + devfs_handle_t slave) +{ + return; +} +static inline devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master) +{ + return NULL; +} +static inline const char *devfs_get_name (devfs_handle_t de, + unsigned int *namelen) +{ + return NULL; +} +static inline int devfs_register_chrdev (unsigned int major, const char *name, + struct file_operations *fops) +{ + return register_chrdev (major, name, fops); +} +static inline int devfs_register_blkdev (unsigned int major, const char *name, + struct block_device_operations *bdops) +{ + return register_blkdev (major, name, bdops); +} +static inline int devfs_unregister_chrdev (unsigned int major,const char *name) +{ + return unregister_chrdev (major, name); +} +static inline int devfs_unregister_blkdev (unsigned int major,const char *name) +{ + return unregister_blkdev (major, name); +} + +static inline void devfs_register_tape (devfs_handle_t de) +{ + return; +} + +static inline void devfs_register_series (devfs_handle_t dir, + const char *format, + unsigned int num_entries, + unsigned int flags, + unsigned int major, + unsigned int minor_start, + umode_t mode, uid_t uid, gid_t gid, + void *ops, void *info) +{ + return; +} + +static inline int init_devfs_fs (void) +{ + return 0; +} +static inline void mount_devfs_fs (void) +{ + return; +} +static inline void devfs_make_root (const char *name) +{ + return; +} +#endif /* CONFIG_DEVFS_FS */ + +#endif /* _LINUX_DEVFS_FS_KERNEL_H */ diff --git a/include/linux/fb.h b/include/linux/fb.h index 56a0f03b6..2f8013318 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -221,6 +221,7 @@ extern int GET_FB_IDX(kdev_t rdev); #include <linux/fs.h> #include <linux/init.h> +#include <linux/devfs_fs_kernel.h> struct fb_info; @@ -277,6 +278,8 @@ struct fb_info { struct display *disp; /* initial display variable */ struct vc_data *display_fg; /* Console visible on this display */ char fontname[40]; /* default font name */ + devfs_handle_t devfs_handle; /* Devfs handle for new name */ + devfs_handle_t devfs_lhandle; /* Devfs handle for compat. symlink */ int (*changevar)(int); /* tell console var has changed */ int (*switch_con)(int, struct fb_info*); /* tell fb to switch consoles */ @@ -371,7 +374,7 @@ extern void fbgen_blank(int blank, struct fb_info *info); /* drivers/video/fbmem.c */ extern int register_framebuffer(struct fb_info *fb_info); -extern int unregister_framebuffer(const struct fb_info *fb_info); +extern int unregister_framebuffer(struct fb_info *fb_info); extern int num_registered_fb; extern struct fb_info *registered_fb[FB_MAX]; diff --git a/include/linux/fs.h b/include/linux/fs.h index c10d1793b..a64c6f9c7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -349,7 +349,8 @@ struct address_space { unsigned long nrpages; /* number of pages */ struct address_space_operations *a_ops; /* methods */ void *host; /* owner: inode, block_device */ - void *private; /* private data */ + struct vm_area_struct *i_mmap; /* list of mappings */ + spinlock_t i_shared_lock; /* and spinlock protecting it */ }; struct block_device { @@ -387,10 +388,8 @@ struct inode { struct super_block *i_sb; wait_queue_head_t i_wait; struct file_lock *i_flock; - struct vm_area_struct *i_mmap; - struct address_space *i_mapping; + struct address_space *i_mapping; struct address_space i_data; - spinlock_t i_shared_lock; struct dquot *i_dquot[MAXQUOTAS]; struct pipe_inode_info *i_pipe; struct block_device *i_bdev; @@ -436,6 +435,7 @@ struct inode { #define I_DIRTY 1 #define I_LOCK 2 #define I_FREEING 4 +#define I_CLEAR 8 extern void __mark_inode_dirty(struct inode *); static inline void mark_inode_dirty(struct inode *inode) @@ -615,6 +615,15 @@ struct super_block { * even looking at it. You had been warned. */ struct semaphore s_vfs_rename_sem; /* Kludge */ + + /* The next field is used by knfsd when converting a (inode number based) + * file handle into a dentry. As it builds a path in the dcache tree from + * the bottom up, there may for a time be a subpath of dentrys which is not + * connected to the main tree. This semaphore ensure that there is only ever + * one such free path per filesystem. Note that unconnected files (or other + * non-directories) are allowed, but not unconnected diretories. + */ + struct semaphore s_nfsd_free_path_sem; }; /* @@ -654,6 +663,8 @@ struct file_operations { int (*fsync) (struct file *, struct dentry *); int (*fasync) (int, struct file *, int); int (*lock) (struct file *, int, struct file_lock *); + ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); + ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *); }; struct inode_operations { @@ -675,6 +686,10 @@ struct inode_operations { int (*revalidate) (struct dentry *); }; +/* + * NOTE: write_inode, delete_inode, clear_inode, put_inode can be called + * without the big kernel lock held in all filesystems. + */ struct super_operations { void (*read_inode) (struct inode *); void (*write_inode) (struct inode *); @@ -743,6 +758,19 @@ extern inline int locks_verify_area(int read_write, struct inode *inode, return 0; } +extern inline int locks_verify_truncate(struct inode *inode, + struct file *filp, + loff_t size) +{ + if (inode->i_flock && MANDATORY_LOCK(inode)) + return locks_mandatory_area( + FLOCK_VERIFY_WRITE, inode, filp, + size < inode->i_size ? size : inode->i_size, + abs(inode->i_size - size) + ); + return 0; +} + /* fs/open.c */ @@ -773,6 +801,8 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned, int); extern int blkdev_put(struct block_device *, int); /* fs/devices.c */ +extern const struct block_device_operations *get_blkfops(unsigned int); +extern struct file_operations *get_chrfops(unsigned int, unsigned int); extern int register_chrdev(unsigned int, const char *, struct file_operations *); extern int unregister_chrdev(unsigned int, const char *); extern int chrdev_open(struct inode *, struct file *); @@ -1002,6 +1032,8 @@ extern void put_super(kdev_t); unsigned long generate_cluster(kdev_t, int b[], int); unsigned long generate_cluster_swab32(kdev_t, int b[], int); extern kdev_t ROOT_DEV; +extern char root_device_name[]; + extern void show_buffers(void); extern void mount_root(void); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 9e228d0d7..e7bf84240 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -29,7 +29,7 @@ #define EZD_PARTITION 0x55 /* EZ-DRIVE */ #define DM6_AUX1PARTITION 0x51 /* no DDO: use xlated geom */ #define DM6_AUX3PARTITION 0x53 /* no DDO: use xlated geom */ - + struct partition { unsigned char boot_ind; /* 0x80 - active */ unsigned char head; /* starting head */ @@ -43,12 +43,18 @@ struct partition { unsigned int nr_sects; /* nr of sectors in partition */ } __attribute__((packed)); +#ifdef __KERNEL__ +# include <linux/devfs_fs_kernel.h> + struct hd_struct { long start_sect; long nr_sects; int type; /* currently RAID or normal */ + devfs_handle_t de; /* primary (master) devfs entry */ }; +#define GENHD_FL_REMOVABLE 1 + struct gendisk { int major; /* major number of driver */ const char *major_name; /* name of major driver */ @@ -62,7 +68,12 @@ struct gendisk { void *real_devices; /* internal use */ struct gendisk *next; + struct block_device_operations *fops; + + devfs_handle_t *de_arr; /* one per physical disc */ + char *flags; /* one per physical disc */ }; +#endif /* __KERNEL__ */ #ifdef CONFIG_SOLARIS_X86_PARTITION @@ -217,7 +228,11 @@ extern struct gendisk *gendisk_head; /* linked list of disks */ char *disk_name (struct gendisk *hd, int minor, char *buf); +extern void devfs_register_partitions (struct gendisk *dev, int minor, + int unregister); + int get_hardsect_size(kdev_t dev); + #endif #endif diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h index 2c7e5db58..c4d398e94 100644 --- a/include/linux/hdlcdrv.h +++ b/include/linux/hdlcdrv.h @@ -250,7 +250,8 @@ struct hdlcdrv_state { #endif int ptt_keyed; - struct sk_buff_head send_queue; /* Packets awaiting transmission */ + /* queued skb for transmission */ + struct sk_buff *skb; }; diff --git a/include/linux/hysdn_if.h b/include/linux/hysdn_if.h new file mode 100644 index 000000000..68cc72078 --- /dev/null +++ b/include/linux/hysdn_if.h @@ -0,0 +1,49 @@ +/* $Id: hysdn_if.h,v 1.1 2000/02/10 19:47:50 werner Exp $ + + * Linux driver for HYSDN cards, ioctl definitions shared by hynetmgr and driver. + * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH + * + * Copyright 1999 by Werner Cornelius (werner@titro.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Log: hysdn_if.h,v $ + * Revision 1.1 2000/02/10 19:47:50 werner + * + * Initial release + * + * + */ + +/****************/ +/* error values */ +/****************/ +#define ERR_NONE 0 /* no error occured */ +#define ERR_ALREADY_BOOT 1000 /* we are already booting */ +#define EPOF_BAD_MAGIC 1001 /* bad magic in POF header */ +#define ERR_BOARD_DPRAM 1002 /* board DPRAM failed */ +#define EPOF_INTERNAL 1003 /* internal POF handler error */ +#define EPOF_BAD_IMG_SIZE 1004 /* POF boot image size invalid */ +#define ERR_BOOTIMG_FAIL 1005 /* 1. stage boot image did not start */ +#define ERR_BOOTSEQ_FAIL 1006 /* 2. stage boot seq handshake timeout */ +#define ERR_POF_TIMEOUT 1007 /* timeout waiting for card pof ready */ +#define ERR_NOT_BOOTED 1008 /* operation only allowed when booted */ +#define ERR_CONF_LONG 1009 /* conf line is to long */ +#define ERR_INV_CHAN 1010 /* invalid channel number */ +#define ERR_ASYNC_TIME 1011 /* timeout sending async data */ + + + + diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 55e103dd5..22a5ed28a 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -68,6 +68,7 @@ #define I2C_DRIVERID_SAA7110 22 /* */ #define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */ #define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ +#define I2C_DRIVERID_PCF8583 25 /* real time clock */ #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ #define I2C_DRIVERID_EXP1 0xF1 @@ -119,6 +120,7 @@ #define I2C_HW_B_G400 0x09 /* Matrox G400 */ #define I2C_HW_B_I810 0x0a /* Intel I810 */ #define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */ +#define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */ /* --- PCF 8584 based algorithms */ #define I2C_HW_P_LP 0x00 /* Parallel port interface */ diff --git a/include/linux/ide.h b/include/linux/ide.h index 49ce1c179..62325a43e 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -13,6 +13,7 @@ #include <linux/hdsmart.h> #include <linux/blkdev.h> #include <linux/proc_fs.h> +#include <linux/devfs_fs_kernel.h> #include <asm/hdreg.h> /* @@ -142,7 +143,7 @@ typedef unsigned char byte; /* used everywhere */ /* * Some more useful definitions */ -#define IDE_MAJOR_NAME "ide" /* the same for all i/f; see also genhd.c */ +#define IDE_MAJOR_NAME "hd" /* the same for all i/f; see also genhd.c */ #define MAJOR_NAME IDE_MAJOR_NAME #define PARTN_BITS 6 /* number of minor dev bits for partitions */ #define PARTN_MASK ((1<<PARTN_BITS)-1) /* a useful bit mask */ @@ -156,11 +157,11 @@ typedef unsigned char byte; /* used everywhere */ * Timeouts for various operations: */ #define WAIT_DRQ (5*HZ/100) /* 50msec - spec allows up to 20ms */ -#ifdef CONFIG_APM +#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) #define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ #else #define WAIT_READY (3*HZ/100) /* 30msec - should be instantaneous */ -#endif /* CONFIG_APM */ +#endif /* CONFIG_APM || CONFIG_APM_MODULE */ #define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?) if all ATAPI CD is closed at boot */ #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ @@ -290,6 +291,7 @@ typedef struct ide_drive_s { char name[4]; /* drive name, such as "hda" */ void *driver; /* (ide_driver_t *) */ void *driver_data; /* extra driver data */ + devfs_handle_t de; /* directory for device */ struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ void *settings; /* /proc/ide/ drive settings */ char driver_req[10]; /* requests specific driver */ @@ -377,6 +379,7 @@ typedef struct hwif_s { u32 dmatable_dma; /* dma physical region descriptor table (dma view) */ struct scatterlist *sg_table; /* Scatter-gather list used to build the above */ int sg_nents; /* Current number of entries in it */ + int sg_dma_direction; /* dma transfer direction */ struct hwif_s *mate; /* other hwif from same PCI chip */ unsigned long dma_base; /* base addr for dma ports */ unsigned dma_extra; /* extra addr for dma ports */ diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h new file mode 100644 index 000000000..2b0aa1e9d --- /dev/null +++ b/include/linux/if_bridge.h @@ -0,0 +1,109 @@ +/* + * Linux ethernet bridge + * + * Authors: + * Lennert Buytenhek <buytenh@gnu.org> + * + * $Id: if_bridge.h,v 1.1 2000/02/18 16:47:01 davem Exp $ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#ifndef _LINUX_IF_BRIDGE_H +#define _LINUX_IF_BRIDGE_H + +#include <linux/types.h> + +#define BRCTL_VERSION 1 + +#define BRCTL_GET_VERSION 0 +#define BRCTL_GET_BRIDGES 1 +#define BRCTL_ADD_BRIDGE 2 +#define BRCTL_DEL_BRIDGE 3 +#define BRCTL_ADD_IF 4 +#define BRCTL_DEL_IF 5 +#define BRCTL_GET_BRIDGE_INFO 6 +#define BRCTL_GET_PORT_LIST 7 +#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8 +#define BRCTL_SET_BRIDGE_HELLO_TIME 9 +#define BRCTL_SET_BRIDGE_MAX_AGE 10 +#define BRCTL_SET_AGEING_TIME 11 +#define BRCTL_SET_GC_INTERVAL 12 +#define BRCTL_GET_PORT_INFO 13 +#define BRCTL_SET_BRIDGE_STP_STATE 14 +#define BRCTL_SET_BRIDGE_PRIORITY 15 +#define BRCTL_SET_PORT_PRIORITY 16 +#define BRCTL_SET_PATH_COST 17 +#define BRCTL_GET_FDB_ENTRIES 18 + +#define BR_STATE_DISABLED 0 +#define BR_STATE_LISTENING 1 +#define BR_STATE_LEARNING 2 +#define BR_STATE_FORWARDING 3 +#define BR_STATE_BLOCKING 4 + +struct __bridge_info +{ + __u64 designated_root; + __u64 bridge_id; + __u32 root_path_cost; + __u32 max_age; + __u32 hello_time; + __u32 forward_delay; + __u32 bridge_max_age; + __u32 bridge_hello_time; + __u32 bridge_forward_delay; + __u8 topology_change; + __u8 topology_change_detected; + __u8 root_port; + __u8 stp_enabled; + __u32 ageing_time; + __u32 gc_interval; + __u32 hello_timer_value; + __u32 tcn_timer_value; + __u32 topology_change_timer_value; + __u32 gc_timer_value; +}; + +struct __port_info +{ + __u64 designated_root; + __u64 designated_bridge; + __u16 port_id; + __u16 designated_port; + __u32 path_cost; + __u32 designated_cost; + __u8 state; + __u8 top_change_ack; + __u8 config_pending; + __u8 unused0; + __u32 message_age_timer_value; + __u32 forward_delay_timer_value; + __u32 hold_timer_value; +}; + +struct __fdb_entry +{ + __u8 mac_addr[6]; + __u8 port_no; + __u8 is_local; + __u32 ageing_timer_value; + __u32 unused; +}; + +#ifdef __KERNEL__ + +#include <linux/netdevice.h> + +struct net_bridge; +struct net_bridge_port; + +extern int (*br_ioctl_hook)(unsigned long arg); +extern void (*br_handle_frame_hook)(struct sk_buff *skb); + +#endif + +#endif diff --git a/include/linux/input.h b/include/linux/input.h index 3fdfa7e92..e65ce8f45 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -233,6 +233,12 @@ struct input_event { #define KEY_STOPCD 166 #define KEY_RECORD 167 #define KEY_REWIND 168 +#define KEY_PHONE 169 +#define KEY_CONFIG 171 +#define KEY_HOMEPAGE 172 +#define KEY_REFRESH 173 +#define KEY_EXIT 174 +#define KEY_MOVE 175 #define KEY_UNKNOWN 180 diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 29a42aef8..8e33913d3 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -4,6 +4,7 @@ #include <linux/kernel.h> #include <linux/smp.h> +#include <linux/cache.h> #include <asm/bitops.h> #include <asm/atomic.h> @@ -22,7 +23,6 @@ struct irqaction { enum { TIMER_BH = 0, - CONSOLE_BH, TQUEUE_BH, DIGI_BH, SERIAL_BH, @@ -46,8 +46,8 @@ enum { /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high frequency threaded job scheduling. For almost all the purposes - tasklets are more than enough. F.e. KEYBOARD_BH, CONSOLE_BH, all serial - device BHs et al. are converted to tasklets, not to softirqs. + tasklets are more than enough. F.e. all serial device BHs et + al. should be converted to tasklets, not to softirqs. */ enum @@ -242,24 +242,6 @@ extern __inline__ void mark_bh(int nr) tasklet_hi_schedule(bh_task_vec+nr); } -extern __inline__ void disable_bh_nosync(int nr) -{ - tasklet_disable_nosync(bh_task_vec+nr); -} - -extern __inline__ void disable_bh(int nr) -{ - tasklet_disable_nosync(bh_task_vec+nr); - if (!in_interrupt()) - tasklet_unlock_wait(bh_task_vec+nr); -} - -extern __inline__ void enable_bh(int nr) -{ - tasklet_enable(bh_task_vec+nr); -} - - extern void init_bh(int nr, void (*routine)(void)); extern void remove_bh(int nr); diff --git a/include/linux/irq.h b/include/linux/irq.h index f8a16d730..150266ff8 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -11,6 +11,7 @@ #define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */ #define IRQ_AUTODETECT 16 /* IRQ is being autodetected */ #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ +#define IRQ_LEVEL 64 /* IRQ level triggered */ /* * Interrupt controller descriptor. This is all we need diff --git a/include/linux/isdn.h b/include/linux/isdn.h index b73358b68..d7dc3b90f 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -1,4 +1,4 @@ -/* $Id: isdn.h,v 1.81 1999/10/27 21:21:18 detabc Exp $ +/* $Id: isdn.h,v 1.90 2000/02/06 21:50:00 detabc Exp $ * * Main header for the Linux ISDN subsystem (linklevel). * @@ -21,6 +21,52 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn.h,v $ + * Revision 1.90 2000/02/06 21:50:00 detabc + * add rewriting of socket's and frame's saddr for udp-ipv4 dynip-connections. + * Include checksum-recompute of ip- and udp-header's. + * + * Revision 1.89 2000/02/05 22:11:33 detabc + * Add rewriting of socket's and frame's saddr adressfield for + * dynip-connections. Only for tcp/ipv4 and switchable per interface. + * Include checksum-recompute of ip- and tcp-header's. + * + * Revision 1.88 2000/01/20 19:59:43 keil + * Add FAX Class 1 support + * + * Revision 1.87 2000/01/09 20:43:15 detabc + * exand logical bind-group's for both call's (in and out). + * add first part of kernel-config-help for abc-extension. + * + * Revision 1.86 1999/12/05 16:06:09 detabc + * add resethandling for rawip-compression. + * at now all B2-Protocols are usable with rawip-compression + * + * Revision 1.85 1999/11/30 11:29:06 detabc + * add a on the fly frame-counter and limit + * + * Revision 1.84 1999/11/28 14:49:08 detabc + * In case of rawip-compress adjust dev[x]->ibytes/obytes to reflect the + * uncompressed size. + * + * Revision 1.83 1999/11/26 15:54:59 detabc + * added compression (isdn_bsdcompress) for rawip interfaces with x75i B2-protocol. + * + * Revision 1.82 1999/11/20 22:14:14 detabc + * added channel dial-skip in case of external use + * (isdn phone or another isdn device) on the same NTBA. + * usefull with two or more card's connected the different NTBA's. + * global switchable in kernel-config and also per netinterface. + * + * add auto disable of netinterface's in case of: + * to many connection's in short time. + * config mistakes (wrong encapsulation, B2-protokoll or so on) on local + * or remote side. + * wrong password's or something else to a ISP (syncppp). + * + * possible encapsulations for this future are: + * ISDN_NET_ENCAP_SYNCPPP, ISDN_NET_ENCAP_UIHDLC, ISDN_NET_ENCAP_RAWIP, + * and ISDN_NET_ENCAP_CISCOHDLCK. + * * Revision 1.81 1999/10/27 21:21:18 detabc * Added support for building logically-bind-group's per interface. * usefull for outgoing call's with more then one isdn-card. @@ -333,6 +379,12 @@ #undef CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR #undef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER #undef CONFIG_ISDN_WITH_ABC_ICALL_BIND +#undef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE +#undef CONFIG_ISDN_WITH_ABC_CONN_ERROR +#undef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS +#undef CONFIG_ISDN_WITH_ABC_FRAME_LIMIT +#undef CONFIG_ISDN_WITH_ABC_IPV4_RW_SOCKADDR +#undef CONFIG_ISDN_WITH_ABC_IPV4_RWUDP_SOCKADDR /* New ioctl-codes */ @@ -359,6 +411,7 @@ #define IIOCGETCPS _IO('I',21) #define IIOCGETDVR _IO('I',22) #define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */ +#define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */ #define IIOCNETALN _IO('I',32) #define IIOCNETDLN _IO('I',33) @@ -494,6 +547,10 @@ typedef struct { # include <linux/concap.h> #endif +#ifdef CONFIG_DEVFS_FS +# include <linux/devfs_fs_kernel.h> +#endif + #include <linux/isdnif.h> #define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */ @@ -922,6 +979,16 @@ typedef struct isdn_devt { isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ struct semaphore sem; /* serialize list access*/ isdn_module *modules; + unsigned long global_features; +#ifdef CONFIG_DEVFS_FS + devfs_handle_t devfs_handle_isdninfo; + devfs_handle_t devfs_handle_isdnctrl; + devfs_handle_t devfs_handle_isdnX[ISDN_MAX_CHANNELS]; + devfs_handle_t devfs_handle_isdnctrlX[ISDN_MAX_CHANNELS]; +# ifdef CONFIG_ISDN_PPP + devfs_handle_t devfs_handle_ipppX[ISDN_MAX_CHANNELS]; +# endif +#endif } isdn_dev; extern isdn_dev *dev; diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h index 07e3b826d..209cd9d81 100644 --- a/include/linux/isdnif.h +++ b/include/linux/isdnif.h @@ -1,4 +1,4 @@ -/* $Id: isdnif.h,v 1.32 1999/10/11 22:03:00 keil Exp $ +/* $Id: isdnif.h,v 1.33 2000/01/20 19:59:43 keil Exp $ * * Linux ISDN subsystem * @@ -22,6 +22,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnif.h,v $ + * Revision 1.33 2000/01/20 19:59:43 keil + * Add FAX Class 1 support + * * Revision 1.32 1999/10/11 22:03:00 keil * COMPAT_NEED_UACCESS (no include in isdn_compat.h) * @@ -175,10 +178,11 @@ /* * Values for Layer-3-protocol-selection */ -#define ISDN_PROTO_L3_TRANS 0 /* Transparent */ -#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */ -#define ISDN_PROTO_L3_FAX 2 /* Fax Group 2/3 */ -#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */ +#define ISDN_PROTO_L3_TRANS 0 /* Transparent */ +#define ISDN_PROTO_L3_TRANSDSP 1 /* Transparent with DSP */ +#define ISDN_PROTO_L3_FCLASS2 2 /* Fax Group 2/3 CLASS 2 */ +#define ISDN_PROTO_L3_FCLASS1 3 /* Fax Group 2/3 CLASS 1 */ +#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */ #ifdef __KERNEL__ @@ -362,7 +366,8 @@ typedef struct /* Layer 3 */ #define ISDN_FEATURE_L3_TRANS (0x10000 << ISDN_PROTO_L3_TRANS) #define ISDN_FEATURE_L3_TRANSDSP (0x10000 << ISDN_PROTO_L3_TRANSDSP) -#define ISDN_FEATURE_L3_FAX (0x10000 << ISDN_PROTO_L3_FAX) +#define ISDN_FEATURE_L3_FCLASS2 (0x10000 << ISDN_PROTO_L3_FCLASS2) +#define ISDN_FEATURE_L3_FCLASS1 (0x10000 << ISDN_PROTO_L3_FCLASS1) #define ISDN_FEATURE_L3_MASK (0x0FF0000) /* Max. 8 Protocols */ #define ISDN_FEATURE_L3_SHIFT (16) @@ -463,6 +468,33 @@ typedef struct T30_s { #endif /* TTY_FAX */ +#define ISDN_FAX_CLASS1_FAE 0 +#define ISDN_FAX_CLASS1_FTS 1 +#define ISDN_FAX_CLASS1_FRS 2 +#define ISDN_FAX_CLASS1_FTM 3 +#define ISDN_FAX_CLASS1_FRM 4 +#define ISDN_FAX_CLASS1_FTH 5 +#define ISDN_FAX_CLASS1_FRH 6 +#define ISDN_FAX_CLASS1_CTRL 7 + +#define ISDN_FAX_CLASS1_OK 0 +#define ISDN_FAX_CLASS1_CONNECT 1 +#define ISDN_FAX_CLASS1_NOCARR 2 +#define ISDN_FAX_CLASS1_ERROR 3 +#define ISDN_FAX_CLASS1_FCERROR 4 +#define ISDN_FAX_CLASS1_QUERY 5 + +typedef struct { + __u8 cmd; + __u8 subcmd; + __u8 para[50]; +} aux_s; + +#define AT_COMMAND 0 +#define AT_EQ_VALUE 1 +#define AT_QUERY 2 +#define AT_EQ_QUERY 3 + /* CAPI structs */ /* this is compatible to the old union size */ @@ -494,13 +526,14 @@ typedef struct { int command; /* Command or Status (see above) */ ulong arg; /* Additional Data */ union { - ulong errcode; /* Type of error with STAT_L1ERR */ - int length; /* Amount of bytes sent with STAT_BSENT */ - u_char num[50];/* Additional Data */ + ulong errcode; /* Type of error with STAT_L1ERR */ + int length; /* Amount of bytes sent with STAT_BSENT */ + u_char num[50]; /* Additional Data */ setup_parm setup;/* For SETUP msg */ capi_msg cmsg; /* For CAPI like messages */ - char display[85];/* display message data */ - dss1_cmd_stat dss1_io; /* DSS1 IO-parameter/result */ + char display[85];/* display message data */ + dss1_cmd_stat dss1_io; /* DSS1 IO-parameter/result */ + aux_s aux; /* for modem commands/indications */ #ifdef CONFIG_ISDN_TTY_FAX T30_s *fax; /* Pointer to ttys fax struct */ #endif diff --git a/include/linux/joystick.h b/include/linux/joystick.h index b5b39d0f5..8cd5cbccb 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h @@ -129,6 +129,7 @@ struct JS_DATA_SAVE_TYPE { #define JS_BUFF_SIZE 64 /* output buffer size */ #include <linux/version.h> +#include <linux/devfs_fs_kernel.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) #error "You need to use at least v2.2 Linux kernel." @@ -217,6 +218,7 @@ struct js_dev { int num_axes; int num_buttons; char *name; + devfs_handle_t devfs_handle; }; struct js_list { diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 56dd41fac..ef922b039 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h @@ -69,6 +69,8 @@ extern int kbd_init(void); extern unsigned char getledstate(void); extern void setledstate(struct kbd_struct *kbd, unsigned int led); +extern struct tasklet_struct console_tasklet; + extern int do_poke_blanked_console; extern void (*kbd_ledfunc)(unsigned int led); @@ -76,13 +78,13 @@ extern void (*kbd_ledfunc)(unsigned int led); extern inline void show_console(void) { do_poke_blanked_console = 1; - mark_bh(CONSOLE_BH); + tasklet_schedule(&console_tasklet); } extern inline void set_console(int nr) { want_console = nr; - mark_bh(CONSOLE_BH); + tasklet_schedule(&console_tasklet); } extern inline void set_leds(void) @@ -162,7 +164,7 @@ extern task_queue con_task_queue; extern inline void con_schedule_flip(struct tty_struct *t) { queue_task(&t->flip.tqueue, &con_task_queue); - mark_bh(CONSOLE_BH); + tasklet_schedule(&console_tasklet); } #endif diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index 5778d2ebb..b10f304a5 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h @@ -1,11 +1,15 @@ /* - * $Id: kernelcapi.h,v 1.4 1999/09/10 17:24:19 calle Exp $ + * $Id: kernelcapi.h,v 1.5 2000/01/28 16:45:40 calle Exp $ * * Kernel CAPI 2.0 Interface for Linux * * (c) Copyright 1997 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: kernelcapi.h,v $ + * Revision 1.5 2000/01/28 16:45:40 calle + * new manufacturer command KCAPI_CMD_ADDCARD (generic addcard), + * will search named driver and call the add_card function if one exist. + * * Revision 1.4 1999/09/10 17:24:19 calle * Changes for proposed standard for CAPI2.0: * - AK148 "Linux Exention" @@ -57,8 +61,17 @@ typedef struct kcapi_flagdef { int flag; } kcapi_flagdef; +typedef struct kcapi_carddef { + char driver[32]; + unsigned int port; + unsigned irq; + unsigned int membase; + int cardnr; +} kcapi_carddef; + /* new ioctls >= 10 */ #define KCAPI_CMD_TRACE 10 +#define KCAPI_CMD_ADDCARD 11 /* add card to named driver */ /* * flag > 2 => trace also data diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 7392910d3..83abfcf92 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -3,10 +3,16 @@ */ #include <linux/config.h> +#include <linux/errno.h> #ifdef CONFIG_KMOD extern int request_module(const char * name); +extern int exec_usermodehelper(char *program_path, char *argv[], char *envp[]); #else #define request_module(x) do {} while(0) +extern inline int exec_usermodehelper(char *program_path, char *argv[], char *envp[]) +{ + return -EACCES; +} #endif diff --git a/include/linux/lists.h b/include/linux/lists.h index 6a2240a20..e1163acde 100644 --- a/include/linux/lists.h +++ b/include/linux/lists.h @@ -48,7 +48,7 @@ #define QUEUE_FIRST(head, listnam) (head)->DLIST_NEXT(listnam) #define QUEUE_LAST(head, listnam) (head)->DLIST_PREV(listnam) -#define QUEUE_EMPTY(head, listnam) \ +#define QUEUE_IS_EMPTY(head, listnam) \ ((QUEUE_FIRST(head, listnam) == QUEUE_LAST(head, listnam)) && \ ((u_long)QUEUE_FIRST(head, listnam) == (u_long)head)) diff --git a/include/linux/lockd/debug.h b/include/linux/lockd/debug.h index 2a2f97a1f..d19f72d36 100644 --- a/include/linux/lockd/debug.h +++ b/include/linux/lockd/debug.h @@ -45,6 +45,7 @@ char * nlm_procname(u32); #define NLMDBG_CLNTSUBS 0x0020 #define NLMDBG_SVCSUBS 0x0040 #define NLMDBG_HOSTCACHE 0x0080 +#define NLMDBG_XDR 0x0100 #define NLMDBG_ALL 0x7fff diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index fbc861f24..cb2c148f1 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -11,12 +11,16 @@ #ifdef __KERNEL__ +#include <linux/config.h> #include <linux/in.h> #include <linux/fs.h> #include <linux/utsname.h> #include <linux/nfsd/nfsfh.h> #include <linux/lockd/bind.h> #include <linux/lockd/xdr.h> +#ifdef CONFIG_LOCKD_V4 +#include <linux/lockd/xdr4.h> +#endif #include <linux/lockd/debug.h> /* @@ -112,6 +116,9 @@ struct nlm_block { */ extern struct rpc_program nlm_program; extern struct svc_procedure nlmsvc_procedures[]; +#ifdef CONFIG_LOCKD_V4 +extern struct svc_procedure nlmsvc_procedures4[]; +#endif extern unsigned long nlmsvc_grace_period; extern unsigned long nlmsvc_timeout; diff --git a/include/linux/lockd/nlm.h b/include/linux/lockd/nlm.h index ca606fca2..4bc44e7d9 100644 --- a/include/linux/lockd/nlm.h +++ b/include/linux/lockd/nlm.h @@ -9,6 +9,8 @@ #ifndef LINUX_LOCKD_NLM_H #define LINUX_LOCKD_NLM_H +#include <linux/config.h> + /* Maximum file offset in file_lock.fl_end */ #ifdef OFFSET_MAX # define NLM_OFFSET_MAX OFFSET_MAX @@ -18,11 +20,18 @@ /* Return states for NLM */ enum { - NLM_LCK_GRANTED = 0, - NLM_LCK_DENIED, - NLM_LCK_DENIED_NOLOCKS, - NLM_LCK_BLOCKED, - NLM_LCK_DENIED_GRACE_PERIOD, + NLM_LCK_GRANTED = 0, + NLM_LCK_DENIED = 1, + NLM_LCK_DENIED_NOLOCKS = 2, + NLM_LCK_BLOCKED = 3, + NLM_LCK_DENIED_GRACE_PERIOD = 4, +#ifdef CONFIG_LOCKD_V4 + NLM_DEADLCK = 5, + NLM_ROFS = 6, + NLM_STALE_FH = 7, + NLM_FBIG = 8, + NLM_FAILED = 9, +#endif }; #define NLM_PROGRAM 100021 diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h new file mode 100644 index 000000000..d9d7e3f75 --- /dev/null +++ b/include/linux/lockd/xdr4.h @@ -0,0 +1,41 @@ +/* + * linux/include/linux/lockd/xdr.h + * + * XDR types for the NLM protocol + * + * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de> + */ + +#ifndef LOCKD_XDR4_H +#define LOCKD_XDR4_H + +#include <linux/fs.h> +#include <linux/nfs.h> +#include <linux/sunrpc/xdr.h> +#include <linux/lockd/xdr.h> + +/* error codes new to NLMv4 */ +extern u32 nlm4_deadlock, nlm4_rofs, nlm4_stale_fh, nlm4_fbig, nlm4_failed; + + +int nlm4svc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_encode_void(struct svc_rqst *, u32 *, void *); +int nlm4svc_decode_void(struct svc_rqst *, u32 *, void *); +int nlm4svc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); +/* +int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); +int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); +int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); +int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); + */ + +#endif /* LOCKD_XDR4_H */ diff --git a/include/linux/lp.h b/include/linux/lp.h index 4bc121a30..e688137e7 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -26,8 +26,6 @@ #define LP_TRUST_IRQ_ 0x0200 /* obsolete */ #define LP_NO_REVERSE 0x0400 /* No reverse mode available. */ #define LP_DATA_AVAIL 0x0800 /* Data is available. */ -#define LP_HAVE_PORT_BIT 12 /* (0x1000) Port is claimed. */ -#define LP_PORT_BUSY (1<<13) /* Reading or writing. */ /* * bit defines for 8255 status port diff --git a/include/linux/lvm.h b/include/linux/lvm.h new file mode 100644 index 000000000..703d8f72e --- /dev/null +++ b/include/linux/lvm.h @@ -0,0 +1,829 @@ +/* + * kernel/lvm.h + * + * Copyright (C) 1997 - 2000 Heinz Mauelshagen, Germany + * + * February-November 1997 + * May-July 1998 + * January-March,July,September,October,Dezember 1999 + * January 2000 + * + * lvm is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * lvm is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU CC; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +/* + * Changelog + * + * 10/10/1997 - beginning of new structure creation + * 12/05/1998 - incorporated structures from lvm_v1.h and deleted lvm_v1.h + * 07/06/1998 - avoided LVM_KMALLOC_MAX define by using vmalloc/vfree + * instead of kmalloc/kfree + * 01/07/1998 - fixed wrong LVM_MAX_SIZE + * 07/07/1998 - extended pe_t structure by ios member (for statistic) + * 02/08/1998 - changes for official char/block major numbers + * 07/08/1998 - avoided init_module() and cleanup_module() to be static + * 29/08/1998 - seprated core and disk structure type definitions + * 01/09/1998 - merged kernel integration version (mike) + * 20/01/1999 - added LVM_PE_DISK_OFFSET macro for use in + * vg_read_with_pv_and_lv(), pv_move_pe(), pv_show_pe_text()... + * 18/02/1999 - added definition of time_disk_t structure for; + * keeps time stamps on disk for nonatomic writes (future) + * 15/03/1999 - corrected LV() and VG() macro definition to use argument + * instead of minor + * 03/07/1999 - define for genhd.c name handling + * 23/07/1999 - implemented snapshot part + * 08/12/1999 - changed LVM_LV_SIZE_MAX macro to reflect current 1TB limit + * 01/01/2000 - extended lv_v2 core structure by wait_queue member + * 12/02/2000 - integrated Andrea Arcagnelli's snapshot work + * + */ + + +#ifndef _LVM_H_INCLUDE +#define _LVM_H_INCLUDE + +#define _LVM_H_VERSION "LVM 0.8final (15/2/2000)" + +/* + * preprocessor definitions + */ +/* if you like emergency reset code in the driver */ +#define LVM_TOTAL_RESET + +#define LVM_GET_INODE +#define LVM_HD_NAME + +/* lots of debugging output (see driver source) + #define DEBUG_LVM_GET_INFO + #define DEBUG + #define DEBUG_MAP + #define DEBUG_MAP_SIZE + #define DEBUG_IOCTL + #define DEBUG_READ + #define DEBUG_GENDISK + #define DEBUG_VG_CREATE + #define DEBUG_LVM_BLK_OPEN + #define DEBUG_KFREE + */ + +#include <linux/version.h> + +#ifndef __KERNEL__ +#define __KERNEL__ +#include <linux/kdev_t.h> +#undef __KERNEL__ +#else +#include <linux/kdev_t.h> +#endif + +#include <linux/major.h> + +#if LINUX_VERSION_CODE >= KERNEL_VERSION ( 2, 3 ,0) +#include <linux/spinlock.h> +#else +#include <asm/spinlock.h> +#endif + +#include <asm/semaphore.h> +#include <asm/page.h> + +#if !defined ( LVM_BLK_MAJOR) || !defined ( LVM_CHAR_MAJOR) +#error Bad include/linux/major.h - LVM MAJOR undefined +#endif + + +#define LVM_STRUCT_VERSION 1 /* structure version */ + +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif + +/* set the default structure version */ +#if ( LVM_STRUCT_VERSION == 1) +#define pv_t pv_v1_t +#define lv_t lv_v2_t +#define vg_t vg_v1_t +#define pv_disk_t pv_disk_v1_t +#define lv_disk_t lv_disk_v1_t +#define vg_disk_t vg_disk_v1_t +#define lv_exception_t lv_v2_exception_t +#endif + + +/* + * i/o protocoll version + * + * defined here for the driver and defined seperate in the + * user land LVM parts + * + */ +#define LVM_DRIVER_IOP_VERSION 6 + +#define LVM_NAME "lvm" + +/* + * VG/LV indexing macros + */ +/* character minor maps directly to volume group */ +#define VG_CHR(a) ( a) + +/* block minor indexes into a volume group/logical volume indirection table */ +#define VG_BLK(a) ( vg_lv_map[a].vg_number) +#define LV_BLK(a) ( vg_lv_map[a].lv_number) + +/* + * absolute limits for VGs, PVs per VG and LVs per VG + */ +#define ABS_MAX_VG 99 +#define ABS_MAX_PV 256 +#define ABS_MAX_LV 256 /* caused by 8 bit minor */ + +#define MAX_VG ABS_MAX_VG +#define MAX_LV ABS_MAX_LV +#define MAX_PV ABS_MAX_PV + +#if ( MAX_VG > ABS_MAX_VG) +#undef MAX_VG +#define MAX_VG ABS_MAX_VG +#endif + +#if ( MAX_LV > ABS_MAX_LV) +#undef MAX_LV +#define MAX_LV ABS_MAX_LV +#endif + + +/* + * VGDA: default disk spaces and offsets + * + * there's space after the structures for later extensions. + * + * offset what size + * --------------- ---------------------------------- ------------ + * 0 physical volume structure ~500 byte + * + * 1K volume group structure ~200 byte + * + * 5K time stamp structure ~ + * + * 6K namelist of physical volumes 128 byte each + * + * 6k + n * 128byte n logical volume structures ~300 byte each + * + * + m * 328byte m physical extent alloc. structs 4 byte each + * + * End of disk - first physical extent typical 4 megabyte + * PE total * + * PE size + * + * + */ + +/* DONT TOUCH THESE !!! */ +/* base of PV structure in disk partition */ +#define LVM_PV_DISK_BASE 0L + +/* size reserved for PV structure on disk */ +#define LVM_PV_DISK_SIZE 1024L + +/* base of VG structure in disk partition */ +#define LVM_VG_DISK_BASE LVM_PV_DISK_SIZE + +/* size reserved for VG structure */ +#define LVM_VG_DISK_SIZE ( 9 * 512L) + +/* size reserved for timekeeping */ +#define LVM_TIMESTAMP_DISK_BASE ( LVM_VG_DISK_BASE + LVM_VG_DISK_SIZE) +#define LVM_TIMESTAMP_DISK_SIZE 512L /* reserved for timekeeping */ + +/* name list of physical volumes on disk */ +#define LVM_PV_NAMELIST_DISK_BASE ( LVM_TIMESTAMP_DISK_BASE + \ + LVM_TIMESTAMP_DISK_SIZE) + +/* now for the dynamically calculated parts of the VGDA */ +#define LVM_LV_DISK_OFFSET(a, b) ( (a)->lv_on_disk.base + sizeof ( lv_t) * b) +#define LVM_DISK_SIZE(pv) ( (pv)->pe_on_disk.base + \ + (pv)->pe_on_disk.size) +#define LVM_PE_DISK_OFFSET(pe, pv) ( pe * pv->pe_size + \ + ( LVM_DISK_SIZE ( pv) / SECTOR_SIZE)) +#define LVM_PE_ON_DISK_BASE(pv) \ + { int rest; \ + pv->pe_on_disk.base = pv->lv_on_disk.base + pv->lv_on_disk.size; \ + if ( ( rest = pv->pe_on_disk.base % SECTOR_SIZE) != 0) \ + pv->pe_on_disk.base += ( SECTOR_SIZE - rest); \ + } +/* END default disk spaces and offsets for PVs */ + + +/* + * LVM_PE_T_MAX corresponds to: + * + * 8KB PE size can map a ~512 MB logical volume at the cost of 1MB memory, + * + * 128MB PE size can map a 8TB logical volume at the same cost of memory. + * + * Default PE size of 4 MB gives a maximum logical volume size of 256 GB. + * + * Maximum PE size of 16GB gives a maximum logical volume size of 1024 TB. + * + * AFAIK, the actual kernels limit this to 1 TB. + * + * Should be a sufficient spectrum ;*) + */ + +/* This is the usable size of disk_pe_t.le_num !!! v v */ +#define LVM_PE_T_MAX ( ( 1 << ( sizeof ( uint16_t) * 8)) - 2) + +#define LVM_LV_SIZE_MAX(a) ( ( long long) LVM_PE_T_MAX * (a)->pe_size > ( long long) 2*1024*1024*1024 ? ( long long) 2*1024*1024*1024 : ( long long) LVM_PE_T_MAX * (a)->pe_size) +#define LVM_MIN_PE_SIZE ( 8L * 2) /* 8 KB in sectors */ +#define LVM_MAX_PE_SIZE ( 16L * 1024L * 1024L * 2) /* 16GB in sectors */ +#define LVM_DEFAULT_PE_SIZE ( 4096L * 2) /* 4 MB in sectors */ +#define LVM_DEFAULT_STRIPE_SIZE 16L /* 16 KB */ +#define LVM_MIN_STRIPE_SIZE ( PAGE_SIZE>>9) /* PAGESIZE in sectors */ +#define LVM_MAX_STRIPE_SIZE ( 512L * 2) /* 512 KB in sectors */ +#define LVM_MAX_STRIPES 128 /* max # of stripes */ +#define LVM_MAX_SIZE ( 1024LU * 1024 * 1024 * 2) /* 1TB[sectors] */ +#define LVM_MAX_MIRRORS 2 /* future use */ +#define LVM_MIN_READ_AHEAD 2 /* minimum read ahead sectors */ +#define LVM_MAX_READ_AHEAD 120 /* maximum read ahead sectors */ +#define LVM_MAX_LV_IO_TIMEOUT 60 /* seconds I/O timeout (future use) */ +#define LVM_PARTITION 0xfe /* LVM partition id */ +#define LVM_NEW_PARTITION 0x8e /* new LVM partition id (10/09/1999) */ +#define LVM_PE_SIZE_PV_SIZE_REL 5 /* max relation PV size and PE size */ + +#define LVM_SNAPSHOT_MAX_CHUNK 1024 /* 1024 KB */ +#define LVM_SNAPSHOT_DEF_CHUNK 64 /* 64 KB */ +#define LVM_SNAPSHOT_MIN_CHUNK 1 /* 1 KB */ + +#define UNDEF -1 +#define FALSE 0 +#define TRUE 1 + + +/* + * ioctls + */ +/* volume group */ +#define VG_CREATE _IOW ( 0xfe, 0x00, 1) +#define VG_REMOVE _IOW ( 0xfe, 0x01, 1) + +#define VG_EXTEND _IOW ( 0xfe, 0x03, 1) +#define VG_REDUCE _IOW ( 0xfe, 0x04, 1) + +#define VG_STATUS _IOWR ( 0xfe, 0x05, 1) +#define VG_STATUS_GET_COUNT _IOWR ( 0xfe, 0x06, 1) +#define VG_STATUS_GET_NAMELIST _IOWR ( 0xfe, 0x07, 1) + +#define VG_SET_EXTENDABLE _IOW ( 0xfe, 0x08, 1) + + +/* logical volume */ +#define LV_CREATE _IOW ( 0xfe, 0x20, 1) +#define LV_REMOVE _IOW ( 0xfe, 0x21, 1) + +#define LV_ACTIVATE _IO ( 0xfe, 0x22) +#define LV_DEACTIVATE _IO ( 0xfe, 0x23) + +#define LV_EXTEND _IOW ( 0xfe, 0x24, 1) +#define LV_REDUCE _IOW ( 0xfe, 0x25, 1) + +#define LV_STATUS_BYNAME _IOWR ( 0xfe, 0x26, 1) +#define LV_STATUS_BYINDEX _IOWR ( 0xfe, 0x27, 1) + +#define LV_SET_ACCESS _IOW ( 0xfe, 0x28, 1) +#define LV_SET_ALLOCATION _IOW ( 0xfe, 0x29, 1) +#define LV_SET_STATUS _IOW ( 0xfe, 0x2a, 1) + +#define LE_REMAP _IOW ( 0xfe, 0x2b, 1) + + +/* physical volume */ +#define PV_STATUS _IOWR ( 0xfe, 0x40, 1) +#define PV_CHANGE _IOWR ( 0xfe, 0x41, 1) +#define PV_FLUSH _IOW ( 0xfe, 0x42, 1) + +/* physical extent */ +#define PE_LOCK_UNLOCK _IOW ( 0xfe, 0x50, 1) + +/* i/o protocol version */ +#define LVM_GET_IOP_VERSION _IOR ( 0xfe, 0x98, 1) + +#ifdef LVM_TOTAL_RESET +/* special reset function for testing purposes */ +#define LVM_RESET _IO ( 0xfe, 0x99) +#endif + +/* lock the logical volume manager */ +#define LVM_LOCK_LVM _IO ( 0xfe, 0x100) +/* END ioctls */ + + +/* + * Status flags + */ +/* volume group */ +#define VG_ACTIVE 0x01 /* vg_status */ +#define VG_EXPORTED 0x02 /* " */ +#define VG_EXTENDABLE 0x04 /* " */ + +#define VG_READ 0x01 /* vg_access */ +#define VG_WRITE 0x02 /* " */ + +/* logical volume */ +#define LV_ACTIVE 0x01 /* lv_status */ +#define LV_SPINDOWN 0x02 /* " */ + +#define LV_READ 0x01 /* lv_access */ +#define LV_WRITE 0x02 /* " */ +#define LV_SNAPSHOT 0x04 /* " */ +#define LV_SNAPSHOT_ORG 0x08 /* " */ + +#define LV_BADBLOCK_ON 0x01 /* lv_badblock */ + +#define LV_STRICT 0x01 /* lv_allocation */ +#define LV_CONTIGUOUS 0x02 /* " */ + +/* physical volume */ +#define PV_ACTIVE 0x01 /* pv_status */ +#define PV_ALLOCATABLE 0x02 /* pv_allocatable */ + + +/* + * Structure definitions core/disk follow + * + * conditional conversion takes place on big endian architectures + * in functions * pv_copy_*(), vg_copy_*() and lv_copy_*() + * + */ + +#define NAME_LEN 128 /* don't change!!! */ +#define UUID_LEN 16 /* don't change!!! */ + +/* remap physical sector/rdev pairs */ +typedef struct +{ + struct list_head hash; + ulong rsector_org; + kdev_t rdev_org; + ulong rsector_new; + kdev_t rdev_new; +} lv_block_exception_t; + + +/* disk stored pe information */ +typedef struct + { + uint16_t lv_num; + uint16_t le_num; + } +disk_pe_t; + +/* disk stored PV, VG, LV and PE size and offset information */ +typedef struct + { + uint32_t base; + uint32_t size; + } +lvm_disk_data_t; + + +/* + * Structure Physical Volume (PV) Version 1 + */ + +/* core */ +typedef struct + { + uint8_t id[2]; /* Identifier */ + uint16_t version; /* HM lvm version */ + lvm_disk_data_t pv_on_disk; + lvm_disk_data_t vg_on_disk; + lvm_disk_data_t pv_namelist_on_disk; + lvm_disk_data_t lv_on_disk; + lvm_disk_data_t pe_on_disk; + uint8_t pv_name[NAME_LEN]; + uint8_t vg_name[NAME_LEN]; + uint8_t system_id[NAME_LEN]; /* for vgexport/vgimport */ + kdev_t pv_dev; + uint32_t pv_number; + uint32_t pv_status; + uint32_t pv_allocatable; + uint32_t pv_size; /* HM */ + uint32_t lv_cur; + uint32_t pe_size; + uint32_t pe_total; + uint32_t pe_allocated; + uint32_t pe_stale; /* for future use */ + + disk_pe_t *pe; /* HM */ + struct inode *inode; /* HM */ + } +pv_v1_t; + +/* disk */ +typedef struct + { + uint8_t id[2]; /* Identifier */ + uint16_t version; /* HM lvm version */ + lvm_disk_data_t pv_on_disk; + lvm_disk_data_t vg_on_disk; + lvm_disk_data_t pv_namelist_on_disk; + lvm_disk_data_t lv_on_disk; + lvm_disk_data_t pe_on_disk; + uint8_t pv_name[NAME_LEN]; + uint8_t vg_name[NAME_LEN]; + uint8_t system_id[NAME_LEN]; /* for vgexport/vgimport */ + uint32_t pv_major; + uint32_t pv_number; + uint32_t pv_status; + uint32_t pv_allocatable; + uint32_t pv_size; /* HM */ + uint32_t lv_cur; + uint32_t pe_size; + uint32_t pe_total; + uint32_t pe_allocated; + } +pv_disk_v1_t; + + +/* + * Structure Physical Volume (PV) Version 2 (future!) + */ + +typedef struct + { + uint8_t id[2]; /* Identifier */ + uint16_t version; /* HM lvm version */ + lvm_disk_data_t pv_on_disk; + lvm_disk_data_t vg_on_disk; + lvm_disk_data_t pv_uuid_on_disk; + lvm_disk_data_t lv_on_disk; + lvm_disk_data_t pe_on_disk; + uint8_t pv_name[NAME_LEN]; + uint8_t vg_name[NAME_LEN]; + uint8_t system_id[NAME_LEN]; /* for vgexport/vgimport */ + kdev_t pv_dev; + uint32_t pv_number; + uint32_t pv_status; + uint32_t pv_allocatable; + uint32_t pv_size; /* HM */ + uint32_t lv_cur; + uint32_t pe_size; + uint32_t pe_total; + uint32_t pe_allocated; + uint32_t pe_stale; /* for future use */ + disk_pe_t *pe; /* HM */ + struct inode *inode; /* HM */ + /* delta to version 1 starts here */ + uint8_t pv_uuid[UUID_LEN]; + uint32_t pv_atime; /* PV access time */ + uint32_t pv_ctime; /* PV creation time */ + uint32_t pv_mtime; /* PV modification time */ + } +pv_v2_t; + + +/* + * Structures for Logical Volume (LV) + */ + +/* core PE information */ +typedef struct + { + kdev_t dev; + uint32_t pe; /* to be changed if > 2TB */ + uint32_t reads; + uint32_t writes; + } +pe_t; + +typedef struct + { + uint8_t lv_name[NAME_LEN]; + kdev_t old_dev; + kdev_t new_dev; + ulong old_pe; + ulong new_pe; + } +le_remap_req_t; + + + +/* + * Structure Logical Volume (LV) Version 1 + */ + +/* disk */ +typedef struct + { + uint8_t lv_name[NAME_LEN]; + uint8_t vg_name[NAME_LEN]; + uint32_t lv_access; + uint32_t lv_status; + uint32_t lv_open; /* HM */ + uint32_t lv_dev; /* HM */ + uint32_t lv_number; /* HM */ + uint32_t lv_mirror_copies; /* for future use */ + uint32_t lv_recovery; /* " */ + uint32_t lv_schedule; /* " */ + uint32_t lv_size; + uint32_t dummy; + uint32_t lv_current_le; /* for future use */ + uint32_t lv_allocated_le; + uint32_t lv_stripes; + uint32_t lv_stripesize; + uint32_t lv_badblock; /* for future use */ + uint32_t lv_allocation; + uint32_t lv_io_timeout; /* for future use */ + uint32_t lv_read_ahead; /* HM, for future use */ + } +lv_disk_v1_t; + + +/* + * Structure Logical Volume (LV) Version 2 + */ + +/* core */ +typedef struct lv_v2 + { + uint8_t lv_name[NAME_LEN]; + uint8_t vg_name[NAME_LEN]; + uint32_t lv_access; + uint32_t lv_status; + uint32_t lv_open; /* HM */ + kdev_t lv_dev; /* HM */ + uint32_t lv_number; /* HM */ + uint32_t lv_mirror_copies; /* for future use */ + uint32_t lv_recovery; /* " */ + uint32_t lv_schedule; /* " */ + uint32_t lv_size; + pe_t *lv_current_pe; /* HM */ + uint32_t lv_current_le; /* for future use */ + uint32_t lv_allocated_le; + uint32_t lv_stripes; + uint32_t lv_stripesize; + uint32_t lv_badblock; /* for future use */ + uint32_t lv_allocation; + uint32_t lv_io_timeout; /* for future use */ + uint32_t lv_read_ahead; + + /* delta to version 1 starts here */ + struct lv_v2 *lv_snapshot_org; + struct lv_v2 *lv_snapshot_prev; + struct lv_v2 *lv_snapshot_next; + lv_block_exception_t *lv_block_exception; + uint32_t lv_remap_ptr; + uint32_t lv_remap_end; + uint32_t lv_chunk_size; + uint32_t lv_snapshot_minor; + struct kiobuf * lv_iobuf; + struct semaphore lv_snapshot_sem; + struct list_head * lv_snapshot_hash_table; + unsigned long lv_snapshot_hash_mask; +} lv_v2_t; + +/* disk */ +typedef struct + { + uint8_t lv_name[NAME_LEN]; + uint8_t vg_name[NAME_LEN]; + uint32_t lv_access; + uint32_t lv_status; + uint32_t lv_open; /* HM */ + uint32_t lv_dev; /* HM */ + uint32_t lv_number; /* HM */ + uint32_t lv_mirror_copies; /* for future use */ + uint32_t lv_recovery; /* " */ + uint32_t lv_schedule; /* " */ + uint32_t lv_size; + uint32_t dummy; + uint32_t lv_current_le; /* for future use */ + uint32_t lv_allocated_le; + uint32_t lv_stripes; + uint32_t lv_stripesize; + uint32_t lv_badblock; /* for future use */ + uint32_t lv_allocation; + uint32_t lv_io_timeout; /* for future use */ + uint32_t lv_read_ahead; /* HM, for future use */ + } +lv_disk_v2_t; + + +/* + * Structure Volume Group (VG) Version 1 + */ + +typedef struct + { + uint8_t vg_name[NAME_LEN]; /* volume group name */ + uint32_t vg_number; /* volume group number */ + uint32_t vg_access; /* read/write */ + uint32_t vg_status; /* active or not */ + uint32_t lv_max; /* maximum logical volumes */ + uint32_t lv_cur; /* current logical volumes */ + uint32_t lv_open; /* open logical volumes */ + uint32_t pv_max; /* maximum physical volumes */ + uint32_t pv_cur; /* current physical volumes FU */ + uint32_t pv_act; /* active physical volumes */ + uint32_t dummy; /* was obsolete max_pe_per_pv */ + uint32_t vgda; /* volume group descriptor arrays FU */ + uint32_t pe_size; /* physical extent size in sectors */ + uint32_t pe_total; /* total of physical extents */ + uint32_t pe_allocated; /* allocated physical extents */ + uint32_t pvg_total; /* physical volume groups FU */ + struct proc_dir_entry *proc; + pv_t *pv[ABS_MAX_PV + 1]; /* physical volume struct pointers */ + lv_t *lv[ABS_MAX_LV + 1]; /* logical volume struct pointers */ + } +vg_v1_t; + +typedef struct + { + uint8_t vg_name[NAME_LEN]; /* volume group name */ + uint32_t vg_number; /* volume group number */ + uint32_t vg_access; /* read/write */ + uint32_t vg_status; /* active or not */ + uint32_t lv_max; /* maximum logical volumes */ + uint32_t lv_cur; /* current logical volumes */ + uint32_t lv_open; /* open logical volumes */ + uint32_t pv_max; /* maximum physical volumes */ + uint32_t pv_cur; /* current physical volumes FU */ + uint32_t pv_act; /* active physical volumes */ + uint32_t dummy; + uint32_t vgda; /* volume group descriptor arrays FU */ + uint32_t pe_size; /* physical extent size in sectors */ + uint32_t pe_total; /* total of physical extents */ + uint32_t pe_allocated; /* allocated physical extents */ + uint32_t pvg_total; /* physical volume groups FU */ + } +vg_disk_v1_t; + +/* + * Structure Volume Group (VG) Version 2 + */ + +typedef struct + { + uint8_t vg_name[NAME_LEN]; /* volume group name */ + uint32_t vg_number; /* volume group number */ + uint32_t vg_access; /* read/write */ + uint32_t vg_status; /* active or not */ + uint32_t lv_max; /* maximum logical volumes */ + uint32_t lv_cur; /* current logical volumes */ + uint32_t lv_open; /* open logical volumes */ + uint32_t pv_max; /* maximum physical volumes */ + uint32_t pv_cur; /* current physical volumes FU */ + uint32_t pv_act; /* future: active physical volumes */ + uint32_t max_pe_per_pv; /* OBSOLETE maximum PE/PV */ + uint32_t vgda; /* volume group descriptor arrays FU */ + uint32_t pe_size; /* physical extent size in sectors */ + uint32_t pe_total; /* total of physical extents */ + uint32_t pe_allocated; /* allocated physical extents */ + uint32_t pvg_total; /* physical volume groups FU */ + struct proc_dir_entry *proc; + pv_t *pv[ABS_MAX_PV + 1]; /* physical volume struct pointers */ + lv_t *lv[ABS_MAX_LV + 1]; /* logical volume struct pointers */ + /* delta to version 1 starts here */ + uint8_t vg_uuid[UUID_LEN]; /* volume group UUID */ + time_t vg_atime; /* VG access time */ + time_t vg_ctime; /* VG creation time */ + time_t vg_mtime; /* VG modification time */ + } +vg_v2_t; + + +/* + * Timekeeping structure on disk (0.7 feature) + * + * Holds several timestamps for start/stop time of non + * atomic VGDA disk i/o operations + * + */ + +typedef struct + { + uint32_t seconds; /* seconds since the epoch */ + uint32_t jiffies; /* micro timer */ + } +lvm_time_t; + +#define TIMESTAMP_ID_SIZE 2 +typedef struct + { + uint8_t id[TIMESTAMP_ID_SIZE]; /* Identifier */ + lvm_time_t pv_vg_lv_pe_io_begin; + lvm_time_t pv_vg_lv_pe_io_end; + lvm_time_t pv_io_begin; + lvm_time_t pv_io_end; + lvm_time_t vg_io_begin; + lvm_time_t vg_io_end; + lvm_time_t lv_io_begin; + lvm_time_t lv_io_end; + lvm_time_t pe_io_begin; + lvm_time_t pe_io_end; + lvm_time_t pe_move_io_begin; + lvm_time_t pe_move_io_end; + uint8_t dummy[LVM_TIMESTAMP_DISK_SIZE - + TIMESTAMP_ID_SIZE - + 12 * sizeof (lvm_time_t)]; + /* ATTENTION ^^ */ + } +timestamp_disk_t; + +/* same on disk and in core so far */ +typedef timestamp_disk_t timestamp_t; + +/* function identifiers for timestamp actions */ +typedef enum + { + PV_VG_LV_PE_IO_BEGIN, + PV_VG_LV_PE_IO_END, + PV_IO_BEGIN, + PV_IO_END, + VG_IO_BEGIN, + VG_IO_END, + LV_IO_BEGIN, + LV_IO_END, + PE_IO_BEGIN, + PE_IO_END, + PE_MOVE_IO_BEGIN, + PE_MOVE_IO_END + } +ts_fct_id_t; + + +/* + * Request structures for ioctls + */ + +/* Request structure PV_STATUS */ +typedef struct + { + char pv_name[NAME_LEN]; + pv_t *pv; + } +pv_status_req_t, pv_change_req_t; + +/* Request structure PV_FLUSH */ +typedef struct + { + char pv_name[NAME_LEN]; + kdev_t pv_dev; + } +pv_flush_req_t; + + +/* Request structure PE_MOVE */ +typedef struct + { + enum + { + LOCK_PE, UNLOCK_PE + } + lock; + struct + { + kdev_t lv_dev; + kdev_t pv_dev; + uint32_t pv_offset; + } + data; + } +pe_lock_req_t; + + +/* Request structure LV_STATUS_BYNAME */ +typedef struct + { + char lv_name[NAME_LEN]; + lv_t *lv; + } +lv_status_byname_req_t, lv_req_t; + +/* Request structure LV_STATUS_BYINDEX */ +typedef struct + { + ulong lv_index; + lv_t *lv; + } +lv_status_byindex_req_t; + +#endif /* #ifndef _LVM_H_INCLUDE */ diff --git a/include/linux/major.h b/include/linux/major.h index 2eaa1741d..fc6e616ac 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -83,6 +83,8 @@ #define IDE4_MAJOR 56 #define IDE5_MAJOR 57 +#define LVM_BLK_MAJOR 58 /* Logical Volume Manager */ + #define SCSI_DISK1_MAJOR 65 #define SCSI_DISK2_MAJOR 66 #define SCSI_DISK3_MAJOR 67 @@ -92,8 +94,6 @@ #define SCSI_DISK7_MAJOR 71 -#define LVM_BLK_MAJOR 58 /* Logical Volume Manager */ - #define COMPAQ_SMART2_MAJOR 72 #define COMPAQ_SMART2_MAJOR1 73 #define COMPAQ_SMART2_MAJOR2 74 @@ -103,15 +103,11 @@ #define COMPAQ_SMART2_MAJOR6 78 #define COMPAQ_SMART2_MAJOR7 79 -#define LVM_BLK_MAJOR 58 /* Logical Volume Manager */ - #define SPECIALIX_NORMAL_MAJOR 75 #define SPECIALIX_CALLOUT_MAJOR 76 #define DASD_MAJOR 94 /* Official assignations from Peter */ -#define LVM_CHAR_MAJOR 109 /* Logical Volume Manager */ - #define MDISK_MAJOR 95 /* Official assignations from Peter */ #define I2O_MAJOR 80 /* 80->87 */ @@ -125,6 +121,8 @@ #define PHONE_MAJOR 100 +#define LVM_CHAR_MAJOR 109 /* Logical Volume Manager */ + #define RTF_MAJOR 150 #define RAW_MAJOR 162 diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 9e2a1e4ff..9cf4b9a14 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -1,6 +1,8 @@ #ifndef _LINUX_MISCDEVICE_H #define _LINUX_MISCDEVICE_H +#include <linux/devfs_fs_kernel.h> + #define BUSMOUSE_MINOR 0 #define PSMOUSE_MINOR 1 #define MS_BUSMOUSE_MINOR 2 @@ -36,6 +38,7 @@ struct miscdevice const char *name; struct file_operations *fops; struct miscdevice * next, * prev; + devfs_handle_t devfs_handle; }; extern int misc_register(struct miscdevice * misc); diff --git a/include/linux/mm.h b/include/linux/mm.h index 1b4cee348..f42f84857 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -396,7 +396,7 @@ extern int check_pgt_cache(void); extern void paging_init(void); extern void free_area_init(unsigned long * zones_size); extern void free_area_init_node(int nid, pg_data_t *pgdat, - unsigned int * zones_size, unsigned long zone_start_paddr); + unsigned long * zones_size, unsigned long zone_start_paddr); extern void mem_init(void); extern void show_mem(void); extern void oom(struct task_struct * tsk); @@ -436,7 +436,7 @@ struct zone_t; extern void remove_inode_page(struct page *); extern unsigned long page_unuse(struct page *); extern int shrink_mmap(int, int, zone_t *); -extern void truncate_inode_pages(struct inode *, loff_t); +extern void truncate_inode_pages(struct address_space *, loff_t); /* generic vm_area_ops exported for stackable file systems */ extern int filemap_swapout(struct page * page, struct file *file); @@ -453,15 +453,14 @@ extern struct page *filemap_nopage(struct vm_area_struct * area, #define __GFP_WAIT 0x01 #define __GFP_HIGH 0x02 #define __GFP_IO 0x04 -#define __GFP_SWAP 0x08 +#define __GFP_DMA 0x08 #ifdef CONFIG_HIGHMEM #define __GFP_HIGHMEM 0x10 #else #define __GFP_HIGHMEM 0x0 /* noop */ #endif -#define __GFP_DMA 0x20 -#define __GFP_UNCACHED 0x40 +#define __GFP_UNCACHED 0x20 #define GFP_BUFFER (__GFP_HIGH | __GFP_WAIT) #define GFP_ATOMIC (__GFP_HIGH) @@ -469,7 +468,7 @@ extern struct page *filemap_nopage(struct vm_area_struct * area, #define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) #define GFP_KERNEL (__GFP_HIGH | __GFP_WAIT | __GFP_IO) #define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO) -#define GFP_KSWAPD (__GFP_IO | __GFP_SWAP) +#define GFP_KSWAPD (__GFP_IO) /* Flag - indicates that the buffer should be allocated uncached as for an architecture where the caches don't snoop DMA access. This is a even diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d2b1d5a6a..46e366aef 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -30,7 +30,6 @@ typedef struct zone_struct { unsigned long free_pages; int low_on_memory; unsigned long pages_min, pages_low, pages_high; - struct pglist_data *zone_pgdat; /* * free areas of different sizes @@ -42,6 +41,13 @@ typedef struct zone_struct { */ char * name; unsigned long size; + /* + * Discontig memory support fields. + */ + struct pglist_data *zone_pgdat; + unsigned long zone_start_paddr; + unsigned long zone_start_mapnr; + struct page * zone_mem_map; } zone_t; #define ZONE_DMA 0 @@ -74,6 +80,10 @@ typedef struct pglist_data { struct page *node_mem_map; unsigned long *valid_addr_bitmap; struct bootmem_data *bdata; + unsigned long node_start_paddr; + unsigned long node_start_mapnr; + unsigned long node_size; + int node_id; } pg_data_t; extern int numnodes; @@ -82,6 +92,14 @@ extern int numnodes; && (((pgzone) - (pgzone)->zone_pgdat->node_zones) <= \ ((tzone) - (pgzone)->zone_pgdat->node_zones))) +/* + * The following two are not meant for general usage. They are here as + * prototypes for the discontig memory code. + */ +extern void show_free_areas_core(int); +extern void free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, + unsigned long *zones_size, unsigned long paddr); + #ifndef CONFIG_DISCONTIGMEM extern pg_data_t contig_page_data; @@ -98,19 +116,6 @@ extern pg_data_t contig_page_data; #define MAP_ALIGN(x) ((((x) % sizeof(mem_map_t)) == 0) ? (x) : ((x) + \ sizeof(mem_map_t) - ((x) % sizeof(mem_map_t)))) -#ifdef CONFIG_DISCONTIGMEM - -#define LOCAL_MAP_NR(kvaddr) \ - (((unsigned long)(kvaddr)-LOCAL_BASE_ADDR((kvaddr))) >> PAGE_SHIFT) -#define MAP_NR(kaddr) (LOCAL_MAP_NR((kaddr)) + \ - (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ - sizeof(mem_map_t))) -#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) >= \ - numnodes) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \ - NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap))) - -#endif /* CONFIG_DISCONTIGMEM */ - #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _LINUX_MMZONE_H */ diff --git a/include/linux/nbd.h b/include/linux/nbd.h index 934e87398..e5194b28f 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -60,8 +60,7 @@ struct nbd_device { struct socket * sock; struct file * file; /* If == NULL, device is not ready, yet */ int magic; /* FIXME: not if debugging is off */ - struct request *head; /* Requests are added here... */ - struct request *tail; + struct list_head queue_head; /* Requests are added here... */ struct semaphore queue_lock; }; #endif diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3905728e4..4c002a7cb 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -125,6 +125,7 @@ enum { extern const char *if_port_text[]; +#include <linux/cache.h> #include <linux/skbuff.h> struct neighbour; @@ -173,14 +174,17 @@ struct hh_cache unsigned long hh_data[16/sizeof(unsigned long)]; }; +/* These flag bits are private to the generic network queueing + * layer, they may not be explicitly referenced by any other + * code. + */ + enum netdev_state_t { - LINK_STATE_XOFF=0, - LINK_STATE_DOWN, - LINK_STATE_START, - LINK_STATE_RXSEM, - LINK_STATE_TXSEM, - LINK_STATE_SCHED + __LINK_STATE_XOFF=0, + __LINK_STATE_START, + __LINK_STATE_PRESENT, + __LINK_STATE_SCHED }; @@ -312,9 +316,6 @@ struct net_device /* Called after last user reference disappears. */ void (*destructor)(struct net_device *dev); - /* Bridge stuff */ - int bridge_port_id; - /* Pointers to interface service routines. */ int (*open)(struct net_device *dev); int (*stop)(struct net_device *dev); @@ -355,6 +356,9 @@ struct net_device int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); int (*accept_fastpath)(struct net_device *, struct dst_entry*); + /* bridge stuff */ + struct net_bridge_port *br_port; + #ifdef CONFIG_NET_FASTROUTE #define NETDEV_FASTROUTE_HMASK 0xF /* Semi-private data. Keep it at the end of device struct. */ @@ -426,11 +430,11 @@ struct softnet_data extern struct softnet_data softnet_data[NR_CPUS]; -#define HAS_NETIF_QUEUE +#define HAVE_NETIF_QUEUE extern __inline__ void __netif_schedule(struct net_device *dev) { - if (!test_and_set_bit(LINK_STATE_SCHED, &dev->state)) { + if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) { unsigned long flags; int cpu = smp_processor_id(); @@ -444,26 +448,59 @@ extern __inline__ void __netif_schedule(struct net_device *dev) extern __inline__ void netif_schedule(struct net_device *dev) { - if (!test_bit(LINK_STATE_XOFF, &dev->state)) + if (!test_bit(__LINK_STATE_XOFF, &dev->state)) __netif_schedule(dev); } extern __inline__ void netif_start_queue(struct net_device *dev) { - clear_bit(LINK_STATE_XOFF, &dev->state); + clear_bit(__LINK_STATE_XOFF, &dev->state); } extern __inline__ void netif_wake_queue(struct net_device *dev) { - if (test_and_clear_bit(LINK_STATE_XOFF, &dev->state)) + if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) __netif_schedule(dev); } extern __inline__ void netif_stop_queue(struct net_device *dev) { - set_bit(LINK_STATE_XOFF, &dev->state); + set_bit(__LINK_STATE_XOFF, &dev->state); +} + +extern __inline__ int netif_queue_stopped(struct net_device *dev) +{ + return test_bit(__LINK_STATE_XOFF, &dev->state); +} + +extern __inline__ int netif_running(struct net_device *dev) +{ + return test_bit(__LINK_STATE_START, &dev->state); } +/* Hot-plugging. */ +extern __inline__ int netif_device_present(struct net_device *dev) +{ + return test_bit(__LINK_STATE_PRESENT, &dev->state); +} + +extern __inline__ void netif_device_detach(struct net_device *dev) +{ + if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) && + netif_running(dev)) + netif_stop_queue(dev); +} + +extern __inline__ void netif_device_attach(struct net_device *dev) +{ + if (test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && + netif_running(dev)) + netif_wake_queue(dev); +} + +/* Use this variant when it is known for sure that it + * is executing from interrupt context. + */ extern __inline__ void dev_kfree_skb_irq(struct sk_buff *skb) { if (atomic_dec_and_test(&skb->users)) { @@ -478,7 +515,18 @@ extern __inline__ void dev_kfree_skb_irq(struct sk_buff *skb) } } +/* Use this variant in places where it could be invoked + * either from interrupt or non-interrupt context. + */ +extern __inline__ void dev_kfree_skb_any(struct sk_buff *skb) +{ + if (in_irq()) + dev_kfree_skb_irq(skb); + else + dev_kfree_skb(skb); +} +extern void net_call_rx_atomic(void (*fn)(void)); #define HAVE_NETIF_RX 1 extern void netif_rx(struct sk_buff *skb); extern int dev_ioctl(unsigned int cmd, void *); diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 67456e4d1..5b3c3860c 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h @@ -75,7 +75,7 @@ int nfsd_svc(unsigned short port, int nrservs); /* nfsd/vfs.c */ int fh_lock_parent(struct svc_fh *, struct dentry *); -void nfsd_racache_init(void); +int nfsd_racache_init(int); void nfsd_racache_shutdown(void); int nfsd_lookup(struct svc_rqst *, struct svc_fh *, const char *, int, struct svc_fh *); @@ -182,11 +182,6 @@ extern u32 nfs_ok, */ extern struct timeval nfssvc_boot; -/* - * The number of nfsd threads. - */ -extern int nfsd_nservers; - #endif /* __KERNEL__ */ #endif /* LINUX_NFSD_NFSD_H */ diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h index 7b787bb93..f3e72151c 100644 --- a/include/linux/nfsd/xdr3.h +++ b/include/linux/nfsd/xdr3.h @@ -296,19 +296,5 @@ int nfs3svc_encode_entry(struct readdir_cd *, const char *name, int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name, int namlen, off_t offset, ino_t ino); -#ifdef __KERNEL__ - -/* - * This is needed in nfs_readdir for encoding NFS3 directory cookies. - */ -static inline u32 * -enc64(u32 *p, u64 val) -{ - *p++ = htonl(val >> 32); - *p++ = htonl(val & 0xffffffff); - return p; -} - -#endif /* __KERNEL__ */ #endif /* _LINUX_NFSD_XDR3_H */ diff --git a/include/linux/parport.h b/include/linux/parport.h index 8a1e97501..f228dc42e 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -345,11 +345,11 @@ extern int parport_register_driver (struct parport_driver *); extern void parport_unregister_driver (struct parport_driver *); /* parport_register_device declares that a device is connected to a - port, and tells the kernel all it needs to know. pf is the - preemption function (may be NULL for no callback) kf is the wake-up - function (may be NULL for no callback) irq_func is the interrupt - handler (may be NULL for no interrupts) handle is a user pointer - that gets handed to callback functions. */ + port, and tells the kernel all it needs to know. + - pf is the preemption function (may be NULL for no callback) + - kf is the wake-up function (may be NULL for no callback) + - irq_func is the interrupt handler (may be NULL for no interrupts) + - handle is a user pointer that gets handed to callback functions. */ struct pardevice *parport_register_device(struct parport *port, const char *name, int (*pf)(void *), void (*kf)(void *), diff --git a/include/linux/pci.h b/include/linux/pci.h index 8fae97e9b..eda945b6c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -286,6 +286,12 @@ #include <linux/ioport.h> #include <linux/list.h> +/* This defines the direction arg to the DMA mapping routines. */ +#define PCI_DMA_BIDIRECTIONAL 0 +#define PCI_DMA_TODEVICE 1 +#define PCI_DMA_FROMDEVICE 2 +#define PCI_DMA_NONE 3 + #include <asm/pci.h> #define DEVICE_COUNT_COMPATIBLE 4 @@ -568,7 +574,39 @@ unsigned int ss_vendor, unsigned int ss_device, const struct pci_dev *from) { return NULL; } extern inline void pci_set_master(struct pci_dev *dev) { } -extern inline int pci_enable_device(struct pci_dev *dev) { return 0; } +extern inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } +extern inline int pci_module_init(struct pci_driver *drv) { return -ENODEV; } + +#else + +/* + * a helper function which helps ensure correct pci_driver + * setup and cleanup for commonly-encountered hotplug/modular cases + * + * This MUST stay in a header, as it checks for -DMODULE + */ +extern inline int pci_module_init(struct pci_driver *drv) +{ + int rc = pci_register_driver (drv); + + if (rc > 0) + return 0; + + /* iff CONFIG_HOTPLUG and built into kernel, we should + * leave the driver around for future hotplug events. + * For the module case, a hotplug daemon of some sort + * should load a module in response to an insert event. */ +#if defined(CONFIG_HOTPLUG) && !defined(MODULE) + if (rc == 0) + return 0; +#endif + + /* if we get here, we need to clean up pci driver instance + * and return some sort of error */ + pci_unregister_driver (drv); + + return -ENODEV; +} #endif /* !CONFIG_PCI */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ffc2aa7f3..3927b11f9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -167,6 +167,8 @@ #define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246 #define PCI_DEVICE_ID_ATI_RAGE128_RK 0x524b #define PCI_DEVICE_ID_ATI_RAGE128_RL 0x524c +#define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046 +#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052 #define PCI_VENDOR_ID_VLSI 0x1004 #define PCI_DEVICE_ID_VLSI_82C592 0x0005 @@ -1154,7 +1156,7 @@ #define PCI_DEVICE_ID_INTEL_82443BX_0 0x7190 #define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191 #define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 -#define PCI_DEVICE_ID_INTEL_P6 0x84c4 +#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 #define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca diff --git a/include/linux/pm.h b/include/linux/pm.h index aaafe127f..3f73f489f 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -105,7 +105,7 @@ struct pm_dev struct list_head entry; }; -#if defined(CONFIG_ACPI) || defined(CONFIG_APM) +#if defined(CONFIG_ACPI) || defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) extern int pm_active; @@ -141,7 +141,7 @@ struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from); extern inline void pm_access(struct pm_dev *dev) {} extern inline void pm_dev_idle(struct pm_dev *dev) {} -#else // CONFIG_ACPI || CONFIG_APM +#else /* CONFIG_ACPI || CONFIG_APM || CONFIG_APM_MODULE */ #define PM_IS_ACTIVE() 0 @@ -169,11 +169,11 @@ extern inline struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from) extern inline void pm_access(struct pm_dev *dev) {} extern inline void pm_dev_idle(struct pm_dev *dev) {} -#endif // CONFIG_ACPI || CONFIG_APM +#endif /* CONFIG_ACPI || CONFIG_APM || CONFIG_APM_MODULE */ extern void (*pm_idle)(void); extern void (*pm_power_off)(void); -#endif // __KERNEL__ +#endif /* __KERNEL__ */ #endif /* _LINUX_PM_H */ diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index d00563357..9e457818f 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -329,7 +329,7 @@ typedef struct mdk_thread_s { #define THREAD_WAKEUP 0 -#define MAX_DISKNAME_LEN 32 +#define MAX_DISKNAME_LEN 64 typedef struct dev_name_s { struct md_list_head list; diff --git a/include/linux/sched.h b/include/linux/sched.h index 6ec45eeff..48050ccb0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -389,45 +389,46 @@ struct task_struct { * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ -#define INIT_TASK(name) \ -/* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain,0, \ -/* avg_slice */ 0, -1, \ -/* counter */ DEF_PRIORITY,DEF_PRIORITY,SCHED_OTHER, \ -/* mm */ NULL, &init_mm, \ -/* has_cpu */ 0,0, \ -/* run_list */ LIST_HEAD_INIT(init_task.run_list), \ -/* next_task */ &init_task,&init_task, \ -/* last_proc */ 0, \ -/* binfmt */ NULL, \ -/* ec,brk... */ 0,0,0,0,0,0, \ -/* pid etc.. */ 0,0,0,0,0, \ -/* proc links*/ &init_task,&init_task,NULL,NULL,NULL, \ -/* pidhash */ NULL, NULL, \ -/* chld wait */ __WAIT_QUEUE_HEAD_INITIALIZER(name.wait_chldexit), NULL, \ -/* timeout */ 0,0,0,0,0,0,0, \ -/* timer */ { NULL, NULL, 0, 0, it_real_fn }, \ -/* utime */ {0,0,0,0},0, \ -/* per CPU times */ {0, }, {0, }, \ -/* flt */ 0,0,0,0,0,0, \ -/* swp */ 0, \ -/* process credentials */ \ -/* uid etc */ 0,0,0,0,0,0,0,0, \ -/* suppl grps*/ 0, {0,}, \ -/* caps */ CAP_INIT_EFF_SET,CAP_INIT_INH_SET,CAP_FULL_SET, \ -/* user */ NULL, \ -/* rlimits */ INIT_RLIMITS, \ -/* math */ 0, \ -/* comm */ "swapper", \ -/* fs info */ 0,NULL, \ -/* ipc */ NULL, NULL, \ -/* thread */ INIT_THREAD, \ -/* fs */ &init_fs, \ -/* files */ &init_files, \ -/* signals */ SPIN_LOCK_UNLOCKED, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \ -/* exec cts */ 0,0, \ -/* exit_sem */ __MUTEX_INITIALIZER(name.exit_sem), \ +#define INIT_TASK(tsk) \ +{ \ + state: 0, \ + flags: 0, \ + sigpending: 0, \ + addr_limit: KERNEL_DS, \ + exec_domain: &default_exec_domain, \ + lock_depth: -1, \ + counter: DEF_PRIORITY, \ + priority: DEF_PRIORITY, \ + policy: SCHED_OTHER, \ + mm: NULL, \ + active_mm: &init_mm, \ + run_list: LIST_HEAD_INIT(tsk.run_list), \ + next_task: &tsk, \ + prev_task: &tsk, \ + p_opptr: &tsk, \ + p_pptr: &tsk, \ + wait_chldexit: __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\ + real_timer: { \ + function: it_real_fn \ + }, \ + cap_effective: CAP_INIT_EFF_SET, \ + cap_inheritable: CAP_INIT_INH_SET, \ + cap_permitted: CAP_FULL_SET, \ + rlim: INIT_RLIMITS, \ + comm: "swapper", \ + thread: INIT_THREAD, \ + fs: &init_fs, \ + files: &init_files, \ + sigmask_lock: SPIN_LOCK_UNLOCKED, \ + sig: &init_signals, \ + signal: {{0}}, \ + blocked: {{0}}, \ + sigqueue: NULL, \ + sigqueue_tail: &tsk.sigqueue, \ + exit_sem: __MUTEX_INITIALIZER(tsk.exit_sem) \ } + #ifndef INIT_TASK_SIZE # define INIT_TASK_SIZE 2048*sizeof(long) #endif diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f2170ed5f..015855fa0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -96,7 +96,6 @@ struct sk_buff { unsigned char is_clone, /* We are a clone */ cloned, /* head may be cloned (check refcnt to be sure). */ pkt_type, /* Packet class */ - pkt_bridged, /* Tracker for bridging */ ip_summed; /* Driver fed us an IP checksum */ __u32 priority; /* Packet queueing priority */ atomic_t users; /* User count - see datagram.c,tcp.c */ diff --git a/include/linux/slab.h b/include/linux/slab.h index 36f1a6718..019538c7c 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -22,8 +22,7 @@ typedef struct kmem_cache_s kmem_cache_t; #define SLAB_NFS GFP_NFS #define SLAB_DMA GFP_DMA -#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_SWAP| \ - __GFP_HIGHMEM) +#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHMEM) #define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */ /* flags to pass to kmem_cache_create(). diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index a84ae422c..ff319aaa1 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -41,9 +41,9 @@ /* * Your basic spinlocks, allowing only a single CPU anywhere * - * Gcc-2.7.x has a nasty bug with empty initializers. + * Most gcc versions have a nasty bug with empty initializers. */ -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) +#if (__GNUC__ > 2) typedef struct { } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { } #else @@ -104,9 +104,9 @@ typedef struct { * irq-safe write-lock, but readers can get non-irqsafe * read-locks. * - * Gcc-2.7.x has a nasty bug with empty initializers. + * Most gcc versions have a nasty bug with empty initializers. */ -#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) +#if (__GNUC__ > 2) typedef struct { } rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { } #else diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index b316103d5..5a29918e6 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -1,7 +1,7 @@ /* * include/linux/sunrpc/xdr.h * - * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> + * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> */ #ifndef _SUNRPC_XDR_H_ @@ -66,6 +66,25 @@ u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); u32 * xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len); /* + * Decode 64bit quantities (NFSv3 support) + */ +static inline u32 * +xdr_encode_hyper(u32 *p, __u64 val) +{ + *p++ = htonl(val >> 32); + *p++ = htonl(val & 0xFFFFFFFF); + return p; +} + +static inline u32 * +xdr_decode_hyper(u32 *p, __u64 *valp) +{ + *valp = ((__u64) ntohl(*p++)) << 32; + *valp |= ntohl(*p++); + return p; +} + +/* * Adjust iovec to reflect end of xdr'ed data (RPC client XDR) */ static inline int diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 46ace283a..325e7f64d 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h @@ -197,10 +197,15 @@ struct tty_driver { * optimize for this case if this flag is set. (Note that there * is also a promise, if the above case is true, not to signal * overruns, either.) + * + * TTY_DRIVER_NO_DEVFS --- if set, do not create devfs entries. This + * is only used by tty_register_driver(). + * */ #define TTY_DRIVER_INSTALLED 0x0001 #define TTY_DRIVER_RESET_TERMIOS 0x0002 #define TTY_DRIVER_REAL_RAW 0x0004 +#define TTY_DRIVER_NO_DEVFS 0x0008 /* tty driver types */ #define TTY_DRIVER_TYPE_SYSTEM 0x0001 diff --git a/include/linux/videodev.h b/include/linux/videodev.h index e1ba268a7..5919a894e 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -9,6 +9,7 @@ #if LINUX_VERSION_CODE >= 0x020100 #include <linux/poll.h> #endif +#include <linux/devfs_fs_kernel.h> struct video_device { @@ -30,6 +31,7 @@ struct video_device void *priv; /* Used to be 'private' but that upsets C++ */ int busy; int minor; + devfs_handle_t devfs_handle; }; extern int videodev_init(void); diff --git a/include/net/br.h b/include/net/br.h deleted file mode 100644 index bfa25b645..000000000 --- a/include/net/br.h +++ /dev/null @@ -1,330 +0,0 @@ -#include <linux/config.h> -/* - * Constants and structure definitions for the bridging code - */ - -#if !defined(One) -#define Zero 0 -#define One 1 -#endif /* !defined(One) */ - -#if !defined(TRUE) -#define FALSE 0 -#define TRUE 1 -#endif /* !defined(TRUE) */ - -/** port states. **/ -#define Disabled 0 /* (4.4 5) */ -#define Listening 1 /* (4.4.2) */ -#define Learning 2 /* (4.4.3) */ -#define Forwarding 3 /* (4 4 4) */ -#define Blocking 4 /* (4.4.1) */ - - -/* MAG Yich! Easiest way of giving a configurable number of ports - * If you want more than 32, change BR_MAX_PORTS and recompile brcfg! - */ -#define BR_MAX_PORTS (32) -#if CONFIG_BRIDGE_NUM_PORTS > BR_MAX_PORTS -#undef CONFIG_BRIDGE_NUM_PORTS -#define CONFIG_BRIDGE_NUM_PORTS BR_MAX_PORTS -#endif -#define No_of_ports CONFIG_BRIDGE_NUM_PORTS -/* arbitrary choice, to allow the code below to compile */ - -#define All_ports (No_of_ports + 1) - -/* - * We time out our entries in the FDB after this many seconds. - */ -#define FDB_TIMEOUT 20 /* JRP: 20s as NSC bridge code, was 300 for Linux */ - -/* - * the following defines are the initial values used when the - * bridge is booted. These may be overridden when this bridge is - * not the root bridge. These are the recommended default values - * from the 802.1d specification. - */ -#define BRIDGE_MAX_AGE 20 -#define BRIDGE_HELLO_TIME 2 -#define BRIDGE_FORWARD_DELAY 15 -#define HOLD_TIME 1 - -/* broacast/multicast storm limitation. This per source. */ -#define MAX_MCAST_PER_PERIOD 4 -#define MCAST_HOLD_TIME (10*HZ/100) - -#define Default_path_cost 10 - -/* - * minimum increment possible to avoid underestimating age, allows for BPDU - * transmission time - */ -#define Message_age_increment 1 - -#define No_port 0 -/* - * reserved value for Bridge's root port parameter indicating no root port, - * used when Bridge is the root - also used to indicate the source when - * a frame is being generated by a higher layer protocol on this host - */ - -/** Configuration BPDU Parameters (4.5.1) **/ - -typedef struct { - union { - struct { - unsigned short priority; - unsigned char ula[6]; - } p_u; - unsigned int id[2]; - } bi; -} bridge_id_t; - -#define BRIDGE_PRIORITY bi.p_u.priority -#define BRIDGE_ID_ULA bi.p_u.ula -#define BRIDGE_ID bi.id - -/* JRP: on the network the flags field is between "type" and "root_id" - * this is unfortunated! To make the code portable to a RISC machine - * the pdus are now massaged a little bit for processing - */ -#define TOPOLOGY_CHANGE 0x01 -#define TOPOLOGY_CHANGE_ACK 0x80 -#define BRIDGE_BPDU_8021_CONFIG_SIZE 35 /* real size */ -#define BRIDGE_BPDU_8021_CONFIG_FLAG_OFFSET 4 -#define BRIDGE_BPDU_8021_PROTOCOL_ID 0 -#define BRIDGE_BPDU_8021_PROTOCOL_VERSION_ID 0 -#define BRIDGE_LLC1_HS 3 -#define BRIDGE_LLC1_DSAP 0x42 -#define BRIDGE_LLC1_SSAP 0x42 -#define BRIDGE_LLC1_CTRL 0x03 - -typedef struct { - unsigned short protocol_id; - unsigned char protocol_version_id; - unsigned char type; - bridge_id_t root_id; /* (4.5.1.1) */ - unsigned int root_path_cost; /* (4.5.1.2) */ - bridge_id_t bridge_id; /* (4.5.1.3) */ - unsigned short port_id; /* (4.5.1.4) */ - unsigned short message_age; /* (4.5.1.5) */ - unsigned short max_age; /* (4.5.1.6) */ - unsigned short hello_time; /* (4.5.1.7) */ - unsigned short forward_delay; /* (4.5.1.8) */ - unsigned char top_change_ack; - unsigned char top_change; -} Config_bpdu; - -#ifdef __LITTLE_ENDIAN -#define config_bpdu_hton(config_bpdu) \ - (config_bpdu)->root_path_cost = htonl((config_bpdu)->root_path_cost); \ - (config_bpdu)->port_id = htons((config_bpdu)->port_id); \ - (config_bpdu)->message_age = htons((config_bpdu)->message_age); \ - (config_bpdu)->max_age = htons((config_bpdu)->max_age); \ - (config_bpdu)->hello_time = htons((config_bpdu)->hello_time); \ - (config_bpdu)->forward_delay = htons((config_bpdu)->forward_delay); -#else -#define config_bpdu_hton(config_bpdu) -#endif -#define config_bpdu_ntoh config_bpdu_hton - - -/** Topology Change Notification BPDU Parameters (4.5.2) **/ - -typedef struct { - unsigned short protocol_id; - unsigned char protocol_version_id; - unsigned char type; -} Tcn_bpdu; - -#define BPDU_TYPE_CONFIG 0 -#define BPDU_TYPE_TOPO_CHANGE 128 - -/** Bridge Parameters (4.5.3) **/ -typedef struct { - bridge_id_t designated_root; /* (4.5.3.1) */ - unsigned int root_path_cost; /* (4.5.3.2) */ - unsigned int root_port; /* (4.5.3.3) */ - unsigned short max_age; /* (4.5.3.4) */ - unsigned short hello_time; /* (4.5.3.5) */ - unsigned short forward_delay; /* (4.5.3.6) */ - bridge_id_t bridge_id; /* (4.5.3.7) */ - unsigned short bridge_max_age; /* (4.5.3.8) */ - unsigned short bridge_hello_time; /* (4.5.3.9) */ - unsigned short bridge_forward_delay; /* (4.5.3.10) */ - unsigned int top_change_detected; /* (4.5.3.11) */ - unsigned int top_change; /* (4.5.3.12) */ - unsigned short topology_change_time; /* (4.5.3.13) */ - unsigned short hold_time; /* (4.5.3.14) */ - unsigned int instance; -} Bridge_data; - -/** Port Parameters (4.5.5) **/ -typedef struct { - unsigned short port_id; /* (4.5.5.1) */ - unsigned int state; /* (4.5.5.2) */ - unsigned int path_cost; /* (4.5.5.3) */ - bridge_id_t designated_root; /* (4.5.5.4) */ - unsigned int designated_cost; /* (4.5.5.5) */ - bridge_id_t designated_bridge; /* (4.5.5.6) */ - unsigned short designated_port; /* (4.5.5.7) */ - unsigned int top_change_ack; /* (4.5.5.8) */ - unsigned int config_pending; /* (4.5.5.9) */ - bridge_id_t ifmac; - char ifname[IFNAMSIZ]; /* Make life easier for brcfg */ - struct net_device *dev; - struct fdb *fdb; /* head of per port fdb chain */ -} Port_data; - - - -/** types to support timers for this pseudo-implementation. **/ -typedef struct { - unsigned int active; /* timer in use. */ - unsigned int value; /* current value of timer, - * counting up. */ -} Timer; - -struct fdb { - unsigned char ula[6]; - unsigned char pad[2]; - unsigned short port; - unsigned int timer; - unsigned short flags; -#define FDB_ENT_VALID 0x01 - unsigned short mcast_count; - unsigned int mcast_timer; /* oldest xxxxxcast */ - -/* AVL tree of all addresses, sorted by address */ - short fdb_avl_height; - struct fdb *fdb_avl_left; - struct fdb *fdb_avl_right; -/* linked list of addresses for each port */ - struct fdb *fdb_next; -}; - -/* data returned on BRCMD_DISPLAY_FDB */ -struct fdb_info { - unsigned char ula[6]; - unsigned char port; - unsigned char flags; - unsigned int timer; -}; -struct fdb_info_hdr { - int copied; /* nb of entries copied to user */ - int not_copied; /* when user buffer is too small */ - int cmd_time; -}; - -#define IS_BRIDGED 0x2e - - -#define BR_MAX_PROTOCOLS 32 -#define BR_MAX_PROT_STATS BR_MAX_PROTOCOLS - -/* policy values for policy field */ -#define BR_ACCEPT 1 -#define BR_REJECT 0 - -/* JRP: extra statistics for debug */ -typedef struct { - /* br_receive_frame counters */ - int port_disable_up_stack; - int rcv_bpdu; - int notForwarding; - int forwarding_up_stack; - int unknown_state; - - /* br_tx_frame counters */ - int port_disable; - int port_not_disable; - - /* br_forward counters */ - int local_multicast; - int forwarded_multicast; /* up stack as well */ - int flood_unicast; - int aged_flood_unicast; - int forwarded_unicast; - int forwarded_unicast_up_stack; - int forwarded_ip_up_stack; - int forwarded_ip_up_stack_lie; /* received on alternate device */ - int arp_for_local_mac; - int drop_same_port; - int drop_same_port_aged; - int drop_multicast; -} br_stats_counter; - -struct br_stat { - unsigned int flags; - Bridge_data bridge_data; - unsigned int policy; - unsigned int exempt_protocols; - unsigned short protocols[BR_MAX_PROTOCOLS]; - unsigned short prot_id[BR_MAX_PROT_STATS]; /* Protocol encountered */ - unsigned int prot_counter[BR_MAX_PROT_STATS]; /* How many packets ? */ - br_stats_counter packet_cnts; - unsigned int num_ports; - Port_data port_data[BR_MAX_PORTS + 1]; -}; - -/* defined flags for br_stat.flags */ -#define BR_UP 0x0001 /* bridging enabled */ -#define BR_DEBUG 0x0002 /* debugging enabled */ -#define BR_PROT_STATS 0x0004 /* protocol statistics enabled */ -#define BR_STP_DISABLED 0x0008 /* Spanning tree protocol disabled */ - -struct br_cf { - unsigned int cmd; - unsigned int arg1; - unsigned int arg2; -}; - -/* defined cmds */ -#define BRCMD_BRIDGE_ENABLE 1 -#define BRCMD_BRIDGE_DISABLE 2 -#define BRCMD_PORT_ENABLE 3 /* arg1 = port */ -#define BRCMD_PORT_DISABLE 4 /* arg1 = port */ -#define BRCMD_SET_BRIDGE_PRIORITY 5 /* arg1 = priority */ -#define BRCMD_SET_PORT_PRIORITY 6 /* arg1 = port, arg2 = priority */ -#define BRCMD_SET_PATH_COST 7 /* arg1 = port, arg2 = cost */ -#define BRCMD_DISPLAY_FDB 8 -#define BRCMD_ENABLE_DEBUG 9 -#define BRCMD_DISABLE_DEBUG 10 -#define BRCMD_SET_POLICY 11 /* arg1 = default policy (1==bridge all) */ -#define BRCMD_EXEMPT_PROTOCOL 12 /* arg1 = protocol (see net/if_ether.h) */ -#define BRCMD_ENABLE_PROT_STATS 13 -#define BRCMD_DISABLE_PROT_STATS 14 -#define BRCMD_ZERO_PROT_STATS 15 -#define BRCMD_TOGGLE_STP 16 -#define BRCMD_IF_ENABLE 17 /* arg1 = if_index */ -#define BRCMD_IF_DISABLE 18 /* arg1 = if_index */ -#define BRCMD_SET_IF_PRIORITY 19 /* arg1 = if_index, arg2 = priority */ -#define BRCMD_SET_IF_PATH_COST 20 /* arg1 = if_index, arg2 = cost */ - -/* prototypes of exported bridging functions... */ - -#ifdef __KERNEL__ -void br_init(void); -int br_receive_frame(struct sk_buff *skb); /* 3.5 */ -int br_tx_frame(struct sk_buff *skb); -int brg_init(void); -int br_ioctl(unsigned int cmd, void *arg); -void requeue_fdb(struct fdb *node, int new_port); - -struct fdb *br_avl_find_addr(unsigned char addr[6]); -struct fdb *br_avl_insert (struct fdb * new_node); -void sprintf_avl (char **pbuffer, struct fdb * tree, off_t *pos,int* len, off_t offset, int length); -void br_avl_delete_by_port(int port); -int br_call_bridge(struct sk_buff *skb, unsigned short type); -void br_spacedevice_register(void); - -/* externs */ - -extern struct br_stat br_stats; -extern Port_data port_info[]; - -#endif - - - diff --git a/include/net/ip.h b/include/net/ip.h index a17c12bbd..ecf397dbb 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -41,7 +41,6 @@ struct inet_skb_parm { struct ip_options opt; /* Compiled IP options */ - u16 redirport; /* Redirect port */ unsigned char flags; #define IPSKB_MASQUERADED 1 diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 2c4b4cff9..2089faac1 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -7,9 +7,14 @@ #define PSCHED_CLOCK_SOURCE PSCHED_JIFFIES +#include <linux/config.h> #include <linux/pkt_sched.h> #include <net/pkt_cls.h> +#ifdef CONFIG_X86_TSC +#include <asm/msr.h> +#endif + struct rtattr; struct Qdisc; @@ -247,11 +252,11 @@ extern int psched_clock_scale; #define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz) -#if CPU == 586 || CPU == 686 +#ifdef CONFIG_X86_TSC #define PSCHED_GET_TIME(stamp) \ ({ u64 __cur; \ - __asm__ __volatile__ (".byte 0x0f,0x31" :"=A" (__cur)); \ + rdtscll(__cur); \ (stamp) = __cur>>psched_clock_scale; \ }) @@ -430,7 +435,7 @@ extern int qdisc_restart(struct net_device *dev); extern __inline__ void qdisc_run(struct net_device *dev) { - while (!test_bit(LINK_STATE_XOFF, &dev->state) && + while (!netif_queue_stopped(dev) && qdisc_restart(dev)<0) /* NOTHING */; } diff --git a/include/net/profile.h b/include/net/profile.h index 82fad0a37..ebba04ae9 100644 --- a/include/net/profile.h +++ b/include/net/profile.h @@ -9,6 +9,10 @@ #include <linux/kernel.h> #include <asm/system.h> +#ifdef CONFIG_X86_TSC +#include <asm/msr.h> +#endif + struct net_profile_slot { char id[16]; @@ -25,14 +29,11 @@ extern atomic_t net_profile_active; extern struct timeval net_profile_adjust; extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leaved); -#if CPU == 586 || CPU == 686 - +#ifdef CONFIG_X86_TSC extern __inline__ void net_profile_stamp(struct timeval *pstamp) { - __asm__ __volatile__ (".byte 0x0f,0x31" - :"=a" (pstamp->tv_usec), - "=d" (pstamp->tv_sec)); + rdtsc(pstamp->tv_usec, pstamp->tv_sec); } extern __inline__ void net_profile_accumulate(struct timeval *entered, diff --git a/include/net/sock.h b/include/net/sock.h index 92519ee88..3bc870fc4 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -35,6 +35,7 @@ #include <linux/config.h> #include <linux/timer.h> +#include <linux/cache.h> #include <linux/in.h> /* struct sockaddr_in */ #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index 904fba0b8..e5c328054 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h @@ -1,5 +1,5 @@ /* - * ciscode.h 1.39 1999/10/25 20:23:17 + * ciscode.h 1.40 2000/02/01 19:06:40 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -91,6 +91,8 @@ #define PRODID_OSITECH_JACK_336 0x0007 #define PRODID_OSITECH_SEVEN 0x0008 +#define MANFID_PIONEER 0x000b + #define MANFID_PSION 0x016c #define MANFID_QUATECH 0x0137 diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index fb3819ba8..b53657fad 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -1,5 +1,5 @@ /* - * ss.h 1.25 1999/10/25 20:23:17 + * ss.h 1.26 2000/02/04 20:35:21 * * The contents of this file are subject to the Mozilla Public License * Version 1.1 (the "License"); you may not use this file except in @@ -45,6 +45,7 @@ #define SS_CARDBUS 0x0800 #define SS_3VCARD 0x1000 #define SS_XVCARD 0x2000 +#define SS_PENDING 0x4000 /* for InquireSocket */ typedef struct socket_cap_t { diff --git a/include/pcmcia/version.h b/include/pcmcia/version.h index 4606b40b3..4f6ffc702 100644 --- a/include/pcmcia/version.h +++ b/include/pcmcia/version.h @@ -1,4 +1,4 @@ -/* version.h 1.81 1999/12/23 21:37:32 (David Hinds) */ +/* version.h 1.83 2000/02/03 02:16:14 (David Hinds) */ -#define CS_RELEASE "3.1.9" -#define CS_RELEASE_CODE 0x3109 +#define CS_RELEASE "3.1.11" +#define CS_RELEASE_CODE 0x310b |