diff options
| author | Jeff Garzik <jgarzik@mandrakesoft.com> | 2002-05-16 10:40:40 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@mandrakesoft.com> | 2002-05-16 10:40:40 -0400 |
| commit | 6b537219d09688f68f0a433770cfdeec877844a0 (patch) | |
| tree | b8dee4745db0f8a33bd3a049400476b945c814d6 /include | |
| parent | 3ab2ff95673bb5b3baa6ef759f71cf3fcb18dcf8 (diff) | |
| parent | 4cc4c6970e6573cc6a671f44de95097217a2be50 (diff) | |
Merge mandrakesoft.com:/home/jgarzik/vanilla/linus-2.5
into mandrakesoft.com:/home/jgarzik/repo/net-drivers-2.5
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-arm/arch-clps711x/memory.h | 57 | ||||
| -rw-r--r-- | include/asm-arm/arch-integrator/time.h | 1 | ||||
| -rw-r--r-- | include/asm-arm/arch-sa1100/SA-1100.h | 10 | ||||
| -rw-r--r-- | include/asm-arm/arch-sa1100/hardware.h | 9 | ||||
| -rw-r--r-- | include/asm-arm/arch-sa1100/irqs.h | 5 | ||||
| -rw-r--r-- | include/asm-arm/arch-sa1100/memory.h | 41 | ||||
| -rw-r--r-- | include/asm-arm/glue.h | 19 | ||||
| -rw-r--r-- | include/asm-arm/io.h | 18 | ||||
| -rw-r--r-- | include/asm-arm/memory.h | 87 | ||||
| -rw-r--r-- | include/asm-arm/page.h | 13 | ||||
| -rw-r--r-- | include/asm-arm/pgtable.h | 26 | ||||
| -rw-r--r-- | include/asm-arm/setup.h | 72 | ||||
| -rw-r--r-- | include/asm-generic/tlb.h | 116 | ||||
| -rw-r--r-- | include/asm-i386/pgalloc.h | 4 | ||||
| -rw-r--r-- | include/linux/b1lli.h | 4 | ||||
| -rw-r--r-- | include/linux/cuda.h | 1 | ||||
| -rw-r--r-- | include/linux/ide.h | 65 | ||||
| -rw-r--r-- | include/linux/input.h | 3 | ||||
| -rw-r--r-- | include/linux/isdn/capilli.h | 24 | ||||
| -rw-r--r-- | include/linux/kernelcapi.h | 4 | ||||
| -rw-r--r-- | include/linux/mm.h | 2 | ||||
| -rw-r--r-- | include/linux/pmu.h | 41 | ||||
| -rw-r--r-- | include/linux/sched.h | 4 |
23 files changed, 273 insertions, 353 deletions
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h index 1e884d9e4167..dd1ae0acb55e 100644 --- a/include/asm-arm/arch-clps711x/memory.h +++ b/include/asm-arm/arch-clps711x/memory.h @@ -120,9 +120,10 @@ (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MAX_MEM_SHIFT) /* - * Given a physical address, convert it to a node id. + * Given a page frame number, convert it to a node id. */ -#define PHYS_TO_NID(addr) KVADDR_TO_NID(__phys_to_virt(addr)) +#define PFN_TO_NID(pfn) \ + (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MAX_MEM_SHIFT - PAGE_SHIFT)) /* * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory @@ -131,30 +132,15 @@ #define ADDR_TO_MAPBASE(kaddr) \ NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(kaddr))) +#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn)) + /* * Given a kaddr, LOCAL_MAR_NR finds the owning node of the memory * and returns the index corresponding to the appropriate page in the * node's mem_map. */ -#define LOCAL_MAP_NR(kaddr) \ - (((unsigned long)(kaddr)-LOCAL_BASE_ADDR((kaddr))) >> PAGE_SHIFT) - -/* - * Given a kaddr, virt_to_page returns a pointer to the corresponding - * mem_map entry. - */ -#define virt_to_page(kaddr) \ - (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr)) - -/* - * VALID_PAGE returns a non-zero value if given page pointer is valid. - * This assumes all node's mem_maps are stored within the node they refer to. - */ -#define VALID_PAGE(page) \ -({ unsigned int node = KVADDR_TO_NID(page); \ - ( (node < NR_NODES) && \ - ((unsigned)((page) - NODE_MEM_MAP(node)) < NODE_DATA(node)->node_size) ); \ -}) +#define LOCAL_MAP_NR(addr) \ + (((unsigned long)(addr) & (NODE_MAX_MEM_SIZE - 1)) >> PAGE_SHIFT) /* * The PS7211 allows up to 256MB max per DRAM bank, but the EDB7211 @@ -167,40 +153,13 @@ #define NODE_MAX_MEM_SHIFT 24 #define NODE_MAX_MEM_SIZE (1<<NODE_MAX_MEM_SHIFT) -/* - * Given a mem_map_t, LOCAL_MAP_BASE finds the owning node for the - * physical page and returns the kaddr for the mem_map of that node. - */ -#define LOCAL_MAP_BASE(page) \ - NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(page))) - -/* - * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory - * and returns the kaddr corresponding to first physical page in the - * node's mem_map. - */ -#define LOCAL_BASE_ADDR(kaddr) ((unsigned long)(kaddr) & ~(NODE_MAX_MEM_SIZE-1)) - -/* - * With discontigmem, the conceptual mem_map array starts from PAGE_OFFSET. - * Given a kaddr, MAP_NR returns the appropriate global mem_map index so - * it matches the corresponding node's local mem_map. - */ -#define MAP_NR(kaddr) (LOCAL_MAP_NR((kaddr)) + \ - (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ - sizeof(mem_map_t))) - #else -#define PHYS_TO_NID(addr) (0) +#define PFN_TO_NID(pfn) (0) #endif /* CONFIG_DISCONTIGMEM */ #endif /* CONFIG_ARCH_EDB7211 */ -#ifndef PHYS_TO_NID -#define PHYS_TO_NID(addr) (0) -#endif - #endif diff --git a/include/asm-arm/arch-integrator/time.h b/include/asm-arm/arch-integrator/time.h index 6ed75675387e..cb6f749f2db8 100644 --- a/include/asm-arm/arch-integrator/time.h +++ b/include/asm-arm/arch-integrator/time.h @@ -129,7 +129,6 @@ void __init time_init(void) timer2->TimerControl = 0; timer1->TimerLoad = TIMER_RELOAD; - timer1->TimerValue = TIMER_RELOAD; timer1->TimerControl = TIMER_CTRL | 0x40; /* periodic */ /* diff --git a/include/asm-arm/arch-sa1100/SA-1100.h b/include/asm-arm/arch-sa1100/SA-1100.h index 22d38d4f9276..62aaf04a3906 100644 --- a/include/asm-arm/arch-sa1100/SA-1100.h +++ b/include/asm-arm/arch-sa1100/SA-1100.h @@ -22,6 +22,16 @@ #include "bitfield.h" +/* + * SA1100 CS line to physical address + */ + +#define SA1100_CS0_PHYS 0x00000000 +#define SA1100_CS1_PHYS 0x08000000 +#define SA1100_CS2_PHYS 0x10000000 +#define SA1100_CS3_PHYS 0x18000000 +#define SA1100_CS4_PHYS 0x40000000 +#define SA1100_CS5_PHYS 0x48000000 /* * Personal Computer Memory Card International Association (PCMCIA) sockets diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index af9ce59b8ab2..f12446570ffd 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h @@ -24,15 +24,6 @@ /* - * Those are statically mapped PCMCIA IO space for designs using it as a - * generic IO bus, typically with ISA parts, hardwired IDE interfaces, etc. - * The actual PCMCIA code is mapping required IO region at run time. - */ -#define PCMCIA_IO_0_BASE 0xf6000000 -#define PCMCIA_IO_1_BASE 0xf7000000 - - -/* * We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for * in*()/out*() macros to be usable for all cases. */ diff --git a/include/asm-arm/arch-sa1100/irqs.h b/include/asm-arm/arch-sa1100/irqs.h index d8caa5c836b4..d4ba9b21f404 100644 --- a/include/asm-arm/arch-sa1100/irqs.h +++ b/include/asm-arm/arch-sa1100/irqs.h @@ -61,11 +61,6 @@ #define IRQ_GPIO27 48 /* - * To get the GPIO number from an IRQ number - */ -#define GPIO_11_27_IRQ(i) ((i) - 21) - -/* * The next 16 interrupts are for board specific purposes. Since * the kernel can only run on one machine at a time, we can re-use * these. If you need more, increase IRQ_BOARD_END, but keep it diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h index 192d44243330..1f7c463b32b1 100644 --- a/include/asm-arm/arch-sa1100/memory.h +++ b/include/asm-arm/arch-sa1100/memory.h @@ -79,49 +79,36 @@ /* * Given a kernel address, find the home node of the underlying memory. */ -#define KVADDR_TO_NID(addr) \ - (((unsigned long)(addr) - 0xc0000000) >> 27) +#define KVADDR_TO_NID(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> 27) /* - * Given a physical address, convert it to a node id. + * Given a page frame number, convert it to a node id. */ -#define PHYS_TO_NID(addr) KVADDR_TO_NID(__phys_to_virt(addr)) +#define PFN_TO_NID(pfn) (((pfn) - PHYS_PFN_OFFSET) >> (27 - PAGE_SHIFT)) /* * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory - * and returns the mem_map of that node. + * and return the mem_map of that node. */ -#define ADDR_TO_MAPBASE(kaddr) \ - NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(kaddr))) +#define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr)) /* - * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory - * and returns the index corresponding to the appropriate page in the - * node's mem_map. + * Given a page frame number, find the owning node of the memory + * and return the mem_map of that node. */ -#define LOCAL_MAP_NR(kvaddr) \ - (((unsigned long)(kvaddr) & 0x07ffffff) >> PAGE_SHIFT) +#define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn)) /* - * Given a kaddr, virt_to_page returns a pointer to the corresponding - * mem_map entry. - */ -#define virt_to_page(kaddr) \ - (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr)) - -/* - * VALID_PAGE returns a non-zero value if given page pointer is valid. - * This assumes all node's mem_maps are stored within the node they refer to. + * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory + * and returns the index corresponding to the appropriate page in the + * node's mem_map. */ -#define VALID_PAGE(page) \ -({ unsigned int node = KVADDR_TO_NID(page); \ - ( (node < NR_NODES) && \ - ((unsigned)((page) - NODE_MEM_MAP(node)) < NODE_DATA(node)->node_size) ); \ -}) +#define LOCAL_MAP_NR(addr) \ + (((unsigned long)(addr) & 0x07ffffff) >> PAGE_SHIFT) #else -#define PHYS_TO_NID(addr) (0) +#define PFN_TO_NID(addr) (0) #endif diff --git a/include/asm-arm/glue.h b/include/asm-arm/glue.h index 9cbfa2d6605c..d0c0c121aa28 100644 --- a/include/asm-arm/glue.h +++ b/include/asm-arm/glue.h @@ -158,7 +158,8 @@ * * We have the following to choose from: * v3 - ARMv3 - * v4 - ARMv4 without minicache + * v4wt - ARMv4 with writethrough cache, without minicache + * v4wb - ARMv4 with writeback cache, without minicache * v4_mc - ARMv4 with minicache * v5te_mc - ARMv5TE with minicache */ @@ -173,13 +174,21 @@ # endif #endif -#if defined(CONFIG_CPU_ARM720T) || defined(CONFIG_CPU_ARM920T) || \ - defined(CONFIG_CPU_ARM922T) || defined(CONFIG_CPU_ARM926T) || \ - defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_ARM1020) +#if defined(CONFIG_CPU_ARM720T) +# ifdef _USER +# define MULTI_USER 1 +# else +# define _USER v4wt +# endif +#endif + +#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \ + defined(CONFIG_CPU_ARM926T) || defined(CONFIG_CPU_SA110) || \ + defined(CONFIG_CPU_ARM1020) # ifdef _USER # define MULTI_USER 1 # else -# define _USER v4 +# define _USER v4wb # endif #endif diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index d12af77640aa..21ca5ae0b847 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -270,24 +270,6 @@ extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle); extern void consistent_sync(void *vaddr, size_t size, int rw); /* - * Change "struct page" to physical address. - */ -#ifdef CONFIG_DISCONTIGMEM -#define page_to_phys(page) \ - ((((page) - page_zone(page)->zone_mem_map) << PAGE_SHIFT) \ - + page_zone(page)->zone_start_paddr) -#else -#define page_to_phys(page) \ - (PHYS_OFFSET + (((page) - mem_map) << PAGE_SHIFT)) -#endif - -/* - * We should really eliminate virt_to_bus() here - it's depreciated. - */ -#define page_to_bus(page) \ - (virt_to_bus(page_address(page))) - -/* * can the hardware map this into one segment or not, given no other * constraints. */ diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index c9f63415e223..865f1d686a30 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h @@ -1,22 +1,34 @@ /* * linux/include/asm-arm/memory.h * - * Copyright (C) 2000 Russell King + * Copyright (C) 2000-2002 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Note: this file should not be included by non-asm/.h files - * - * Modifications: */ #ifndef __ASM_ARM_MEMORY_H #define __ASM_ARM_MEMORY_H +#include <linux/config.h> #include <asm/arch/memory.h> -static inline unsigned long virt_to_phys(volatile void *x) +/* + * PFNs are used to describe any physical page; this means + * PFN 0 == physical address 0. + * + * This is the PFN of the first RAM page in the kernel + * direct-mapped view. We assume this is the first page + * of RAM in the mem_map as well. + */ +#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT) + +/* + * These are *only* valid on the kernel direct mapped RAM memory. + */ +static inline unsigned long virt_to_phys(void *x) { return __virt_to_phys((unsigned long)(x)); } @@ -26,10 +38,77 @@ static inline void *phys_to_virt(unsigned long x) return (void *)(__phys_to_virt((unsigned long)(x))); } +#define __pa(x) __virt_to_phys((unsigned long)(x)) +#define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) + /* * Virtual <-> DMA view memory address translations + * Again, these are *only* valid on the kernel direct mapped RAM + * memory. Use of these is *depreciated*. */ #define virt_to_bus(x) (__virt_to_bus((unsigned long)(x))) #define bus_to_virt(x) ((void *)(__bus_to_virt((unsigned long)(x)))) +/* + * Conversion between a struct page and a physical address. + * + * Note: when converting an unknown physical address to a + * struct page, the resulting pointer must be validated + * using VALID_PAGE(). It must return an invalid struct page + * for any physical address not corresponding to a system + * RAM address. + * + * page_to_pfn(page) convert a struct page * to a PFN number + * pfn_to_page(pfn) convert a _valid_ PFN number to struct page * + * pfn_valid(pfn) indicates whether a PFN number is valid + * + * virt_to_page(k) convert a _valid_ virtual address to struct page * + * virt_addr_valid(k) indicates whether a virtual address is valid + */ +#ifndef CONFIG_DISCONTIGMEM + +#define page_to_pfn(page) (((page) - mem_map) + PHYS_PFN_OFFSET) +#define pfn_to_page(pfn) ((mem_map + (pfn)) - PHYS_PFN_OFFSET) +#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < max_mapnr) + +#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)) +#define virt_addr_valid(kaddr) ((kaddr) >= PAGE_OFFSET && (kaddr) < (unsigned long)high_memory) + +#else +/* + * This is more complex. We have a set of mem_map arrays spread + * around in memory. + */ +#define page_to_pfn(page) \ + (((page) - page_zone(page)->zone_mem_map) \ + + (page_zone(page)->zone_start_paddr >> PAGE_SHIFT)) + +#define pfn_to_page(pfn) \ + (PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT)) + +#define pfn_valid(pfn) (PFN_TO_NID(pfn) < NR_NODES) + +#define virt_to_page(kaddr) \ + (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr)) + +#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < NR_NODES) + +/* + * Common discontigmem stuff. + * PHYS_TO_NID is used by the ARM kernel/setup.c + */ +#define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT) + +#endif + +/* + * For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die. + */ +#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) + +/* + * We should really eliminate virt_to_bus() here - it's depreciated. + */ +#define page_to_bus(page) (virt_to_bus(page_address(page))) + #endif diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index 56730ced5d2d..6f8afed589ac 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h @@ -125,18 +125,9 @@ static inline int get_order(unsigned long size) return order; } -#endif /* !__ASSEMBLY__ */ - -#include <asm/arch/memory.h> - -#define __pa(x) __virt_to_phys((unsigned long)(x)) -#define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) +#include <asm/memory.h> -#ifndef CONFIG_DISCONTIGMEM -#define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT) - \ - (PHYS_OFFSET >> PAGE_SHIFT)) -#define VALID_PAGE(page) ((page - mem_map) < max_mapnr) -#endif +#endif /* !__ASSEMBLY__ */ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index f01a476df49a..dbbb85bd3995 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -11,7 +11,7 @@ #define _ASMARM_PGTABLE_H #include <linux/config.h> -#include <asm/arch/memory.h> +#include <asm/memory.h> #include <asm/arch/vmalloc.h> /* @@ -79,21 +79,12 @@ extern void __pgd_error(const char *file, int line, unsigned long val); extern struct page *empty_zero_page; #define ZERO_PAGE(vaddr) (empty_zero_page) +#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) +#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) + #define pte_none(pte) (!pte_val(pte)) #define pte_clear(ptep) set_pte((ptep), __pte(0)) - -#ifndef CONFIG_DISCONTIGMEM -#define pte_page(x) (mem_map + (pte_val((x)) >> PAGE_SHIFT) - \ - (PHYS_OFFSET >> PAGE_SHIFT)) -#else -/* - * I'm not happy with this - we needlessly convert a physical address - * to a virtual one, and then immediately back to a physical address, - * which, if __va and __pa are expensive causes twice the expense for - * zero gain. --rmk - */ -#define pte_page(x) (virt_to_page(__va(pte_val((x))))) -#endif +#define pte_page(pte) (pfn_to_page(pte_pfn(pte))) #define pmd_none(pmd) (!pmd_val(pmd)) #define pmd_present(pmd) (pmd_val(pmd)) @@ -107,12 +98,7 @@ extern struct page *empty_zero_page; * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. */ -static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) -{ - return __pte(physpage | pgprot_val(pgprot)); -} - -#define mk_pte(page,pgprot) mk_pte_phys(__pa(page_address(page)), pgprot) +#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot) /* * The "pgd_xxx()" functions here are trivial for a folded two-level diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h index b9d7ba17645f..1e1002711665 100644 --- a/include/asm-arm/setup.h +++ b/include/asm-arm/setup.h @@ -10,77 +10,12 @@ * Structure passed to kernel to tell it about the * hardware it's running on. See linux/Documentation/arm/Setup * for more info. - * - * NOTE: - * This file contains two ways to pass information from the boot - * loader to the kernel. The old struct param_struct is deprecated, - * but it will be kept in the kernel for 5 years from now - * (2001). This will allow boot loaders to convert to the new struct - * tag way. */ #ifndef __ASMARM_SETUP_H #define __ASMARM_SETUP_H -/* - * Usage: - * - do not go blindly adding fields, add them at the end - * - when adding fields, don't rely on the address until - * a patch from me has been released - * - unused fields should be zero (for future expansion) - * - this structure is relatively short-lived - only - * guaranteed to contain useful data in setup_arch() - */ #define COMMAND_LINE_SIZE 1024 -/* This is the old deprecated way to pass parameters to the kernel */ -struct param_struct { - union { - struct { - unsigned long page_size; /* 0 */ - unsigned long nr_pages; /* 4 */ - unsigned long ramdisk_size; /* 8 */ - unsigned long flags; /* 12 */ -#define FLAG_READONLY 1 -#define FLAG_RDLOAD 4 -#define FLAG_RDPROMPT 8 - unsigned long rootdev; /* 16 */ - unsigned long video_num_cols; /* 20 */ - unsigned long video_num_rows; /* 24 */ - unsigned long video_x; /* 28 */ - unsigned long video_y; /* 32 */ - unsigned long memc_control_reg; /* 36 */ - unsigned char sounddefault; /* 40 */ - unsigned char adfsdrives; /* 41 */ - unsigned char bytes_per_char_h; /* 42 */ - unsigned char bytes_per_char_v; /* 43 */ - unsigned long pages_in_bank[4]; /* 44 */ - unsigned long pages_in_vram; /* 60 */ - unsigned long initrd_start; /* 64 */ - unsigned long initrd_size; /* 68 */ - unsigned long rd_start; /* 72 */ - unsigned long system_rev; /* 76 */ - unsigned long system_serial_low; /* 80 */ - unsigned long system_serial_high; /* 84 */ - unsigned long mem_fclk_21285; /* 88 */ - } s; - char unused[256]; - } u1; - union { - char paths[8][128]; - struct { - unsigned long magic; - char n[1024 - sizeof(unsigned long)]; - } s; - } u2; - char commandline[COMMAND_LINE_SIZE]; -}; - - - -/* - * The new way of passing information: a list of tagged entries - */ - /* The list ends with an ATAG_NONE node. */ #define ATAG_NONE 0x00000000 @@ -131,8 +66,15 @@ struct tag_ramdisk { }; /* describes where the compressed ramdisk image lives */ +/* + * this one accidentally used virtual addresses - as such, + * its depreciated. + */ #define ATAG_INITRD 0x54410005 +/* describes where the compressed ramdisk image lives */ +#define ATAG_INITRD2 0x54420005 + struct tag_initrd { u32 start; /* physical start address */ u32 size; /* size of compressed ramdisk image in bytes */ diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 9f5766d595cf..0b7dc666fecf 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -16,7 +16,6 @@ #include <linux/config.h> #include <asm/tlbflush.h> -#ifdef CONFIG_SMP /* aim for something that fits in the L1 cache */ #define FREE_PTE_NR 508 @@ -26,90 +25,87 @@ * shootdown. */ typedef struct free_pte_ctx { - struct vm_area_struct *vma; + struct mm_struct *mm; unsigned long nr; /* set to ~0UL means fast mode */ - unsigned long start_addr, end_addr; - pte_t ptes[FREE_PTE_NR]; + unsigned long freed; + struct page * pages[FREE_PTE_NR]; } mmu_gather_t; /* Users of the generic TLB shootdown code must declare this storage space. */ extern mmu_gather_t mmu_gathers[NR_CPUS]; +/* Do me later */ +#define tlb_start_vma(tlb, vma) do { } while (0) +#define tlb_end_vma(tlb, vma) do { } while (0) + /* tlb_gather_mmu * Return a pointer to an initialized mmu_gather_t. */ -static inline mmu_gather_t *tlb_gather_mmu(struct vm_area_struct *vma) +static inline mmu_gather_t *tlb_gather_mmu(struct mm_struct *mm) { mmu_gather_t *tlb = &mmu_gathers[smp_processor_id()]; - struct mm_struct *mm = vma->vm_mm; + unsigned long nr; - tlb->vma = vma; - /* Use fast mode if there is only one user of this mm (this process) */ - tlb->nr = (atomic_read(&(mm)->mm_users) == 1) ? ~0UL : 0UL; + tlb->mm = mm; + tlb->freed = 0; + + /* Use fast mode if this MM only exists on this CPU */ + nr = ~0UL; +#ifdef CONFIG_SMP + if (mm->cpu_vm_mask != (1<<smp_processor_id())) + nr = 0UL; +#endif + tlb->nr = nr; return tlb; } -/* void tlb_remove_page(mmu_gather_t *tlb, pte_t *ptep, unsigned long addr) - * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while - * handling the additional races in SMP caused by other CPUs caching valid - * mappings in their TLBs. - */ -#define tlb_remove_page(ctxp, pte, addr) do {\ - /* Handle the common case fast, first. */\ - if ((ctxp)->nr == ~0UL) {\ - __free_pte(*(pte));\ - pte_clear((pte));\ - break;\ - }\ - if (!(ctxp)->nr) \ - (ctxp)->start_addr = (addr);\ - (ctxp)->ptes[(ctxp)->nr++] = ptep_get_and_clear(pte);\ - (ctxp)->end_addr = (addr) + PAGE_SIZE;\ - if ((ctxp)->nr >= FREE_PTE_NR)\ - tlb_finish_mmu((ctxp), 0, 0);\ - } while (0) +static inline void tlb_flush_mmu(mmu_gather_t *tlb, unsigned long start, unsigned long end) +{ + unsigned long nr; + + flush_tlb_mm(tlb->mm); + nr = tlb->nr; + if (nr != ~0UL) { + unsigned long i; + tlb->nr = 0; + for (i=0; i < nr; i++) + free_page_and_swap_cache(tlb->pages[i]); + } +} /* tlb_finish_mmu * Called at the end of the shootdown operation to free up any resources * that were required. The page table lock is still held at this point. */ -static inline void tlb_finish_mmu(struct free_pte_ctx *ctx, unsigned long start, unsigned long end) +static inline void tlb_finish_mmu(mmu_gather_t *tlb, unsigned long start, unsigned long end) { - unsigned long i, nr; - - /* Handle the fast case first. */ - if (ctx->nr == ~0UL) { - flush_tlb_range(ctx->vma, start, end); - return; - } - nr = ctx->nr; - ctx->nr = 0; - if (nr) - flush_tlb_range(ctx->vma, ctx->start_addr, ctx->end_addr); - for (i=0; i < nr; i++) { - pte_t pte = ctx->ptes[i]; - __free_pte(pte); - } + int freed = tlb->freed; + struct mm_struct *mm = tlb->mm; + int rss = mm->rss; + + if (rss < freed) + freed = rss; + mm->rss = rss - freed; + tlb_flush_mmu(tlb, start, end); } -#else -/* The uniprocessor functions are quite simple and are inline macros in an - * attempt to get gcc to generate optimal code since this code is run on each - * page in a process at exit. +/* void tlb_remove_page(mmu_gather_t *tlb, pte_t *ptep, unsigned long addr) + * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while + * handling the additional races in SMP caused by other CPUs caching valid + * mappings in their TLBs. */ -typedef struct vm_area_struct mmu_gather_t; - -#define tlb_gather_mmu(vma) (vma) -#define tlb_finish_mmu(tlb, start, end) flush_tlb_range(tlb, start, end) -#define tlb_remove_page(tlb, ptep, addr) do {\ - pte_t __pte = *(ptep);\ - pte_clear(ptep);\ - __free_pte(__pte);\ - } while (0) - -#endif - +static inline void tlb_remove_page(mmu_gather_t *tlb, struct page *page) +{ + /* Handle the common case fast, first. */\ + if (tlb->nr == ~0UL) { + free_page_and_swap_cache(page); + return; + } + tlb->pages[tlb->nr++] = page; + if (tlb->nr >= FREE_PTE_NR) + tlb_flush_mmu(tlb, 0, 0); +} #endif /* _ASM_GENERIC__TLB_H */ diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h index b078cdd4adaa..10e7021c33a6 100644 --- a/include/asm-i386/pgalloc.h +++ b/include/asm-i386/pgalloc.h @@ -35,6 +35,9 @@ static inline void pte_free(struct page *pte) __free_page(pte); } + +#define pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) + /* * allocating and freeing a pmd is trivial: the 1-entry pmd is * inside the pgd, so has no extra memory associated with it. @@ -43,6 +46,7 @@ static inline void pte_free(struct page *pte) #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) #define pmd_free(x) do { } while (0) +#define pmd_free_tlb(tlb,x) do { } while (0) #define pgd_populate(mm, pmd, pte) BUG() #define check_pgt_cache() do { } while (0) diff --git a/include/linux/b1lli.h b/include/linux/b1lli.h index 24ec4670a033..713f712685d3 100644 --- a/include/linux/b1lli.h +++ b/include/linux/b1lli.h @@ -61,12 +61,12 @@ typedef struct avmb1_extcarddef { } avmb1_extcarddef; #define AVMB1_LOAD 0 /* load image to card */ -#define AVMB1_ADDCARD 1 /* add a new card */ +#define AVMB1_ADDCARD 1 /* add a new card - OBSOLETE */ #define AVMB1_RESETCARD 2 /* reset a card */ #define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */ #define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */ #define AVMB1_GET_CARDINFO 5 /* get cardtype */ -#define AVMB1_REMOVECARD 6 /* remove a card (useful for T1) */ +#define AVMB1_REMOVECARD 6 /* remove a card - OBSOLETE */ #define AVMB1_REGISTERCARD_IS_OBSOLETE diff --git a/include/linux/cuda.h b/include/linux/cuda.h index 75549da3fc6a..6a3e6385d3f3 100644 --- a/include/linux/cuda.h +++ b/include/linux/cuda.h @@ -29,7 +29,6 @@ #ifdef __KERNEL__ extern int find_via_cuda(void); -extern int via_cuda_start(void); extern int cuda_request(struct adb_request *req, void (*done)(struct adb_request *), int nbytes, ...); extern void cuda_poll(void); diff --git a/include/linux/ide.h b/include/linux/ide.h index 8e2950781b00..f43f83e807f9 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -264,8 +264,6 @@ void ide_setup_ports(hw_regs_t *hw, #define ATA_SCSI 0x21 #define ATA_NO_LUN 0x7f -struct ide_settings_s; - typedef union { unsigned all : 8; /* all of the bits together */ struct { @@ -329,8 +327,6 @@ struct ata_device { unsigned long sleep; /* sleep until this time */ - u8 XXX_tune_req; /* requested drive tuning setting */ - byte using_dma; /* disk is using dma for read/write */ byte using_tcq; /* disk is using queueing */ byte retry_pio; /* retrying dma capable host in pio */ @@ -379,7 +375,6 @@ struct ata_device { void *driver_data; /* extra driver data */ devfs_handle_t de; /* directory for device */ - struct ide_settings_s *settings; /* ioctl entires */ char driver_req[10]; /* requests specific driver */ int last_lun; /* last logical unit */ @@ -418,6 +413,9 @@ struct ata_channel { int unit; /* channel number */ struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ + struct timer_list timer; /* failsafe timer */ + int (*expiry)(struct ata_device *, struct request *); /* irq handler, if active */ + struct ata_device *drive; /* last serviced drive */ ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */ hw_regs_t hw; /* Hardware info */ @@ -569,50 +567,10 @@ typedef struct hwgroup_s { */ ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */ unsigned long flags; /* BUSY, SLEEPING */ - struct ata_device *XXX_drive; /* current drive */ struct request *rq; /* current request */ - struct timer_list timer; /* failsafe timer */ - int (*expiry)(struct ata_device *, struct request *); /* irq handler, if active */ } ide_hwgroup_t; -/* structure attached to the request for IDE_TASK_CMDS */ - -/* - * configurable drive settings - */ - -#define TYPE_INT 0 -#define TYPE_INTA 1 -#define TYPE_BYTE 2 -#define TYPE_SHORT 3 - -#define SETTING_READ (1 << 0) -#define SETTING_WRITE (1 << 1) -#define SETTING_RW (SETTING_READ | SETTING_WRITE) - -typedef int (ide_procset_t)(struct ata_device *, int); -typedef struct ide_settings_s { - char *name; - int rw; - int read_ioctl; - int write_ioctl; - int data_type; - int min; - int max; - int mul_factor; - int div_factor; - void *data; - ide_procset_t *set; - int auto_remove; - struct ide_settings_s *next; -} ide_settings_t; - -extern void ide_add_setting(struct ata_device *, const char *, int, int, int, int, int, int, int, int, void *, ide_procset_t *); -extern void ide_remove_setting(struct ata_device *, char *); -extern int ide_read_setting(struct ata_device *, ide_settings_t *); -extern int ide_write_setting(struct ata_device *, ide_settings_t *, int); -extern void ide_add_generic_settings(struct ata_device *); - +/* FIXME: kill this as soon as possible */ #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; /* @@ -683,13 +641,10 @@ extern void ide_set_handler(struct ata_device *drive, ata_handler_t handler, /* * Error reporting, in human readable form (luxurious, but a memory hog). */ -extern byte ide_dump_status(struct ata_device *, const char *, byte); +extern u8 ide_dump_status(struct ata_device *, struct request *rq, const char *, u8); -/* - * ide_error() takes action based on the error returned by the controller. - * The caller should return immediately after invoking this. - */ -extern ide_startstop_t ide_error(struct ata_device *, const char *, byte); +extern ide_startstop_t ide_error(struct ata_device *, struct request *rq, + const char *, byte); /* * Issue a simple drive command @@ -713,7 +668,9 @@ void ide_fixstring(byte *s, const int bytecount, const int byteswap); * caller should return the updated value of "startstop" in this case. * "startstop" is unchanged when the function returns 0; */ -extern int ide_wait_stat(ide_startstop_t *, struct ata_device *, byte, byte, unsigned long); +extern int ide_wait_stat(ide_startstop_t *, + struct ata_device *, struct request *rq, + byte, byte, unsigned long); extern int ide_wait_noerr(struct ata_device *, byte, byte, unsigned long); @@ -759,7 +716,7 @@ extern int ide_do_drive_cmd(struct ata_device *, struct request *, ide_action_t) /* * Clean up after success/failure of an explicit drive cmd. */ -extern void ide_end_drive_cmd(struct ata_device *, byte, byte); +extern void ide_end_drive_cmd(struct ata_device *, struct request *, u8, u8); struct ata_taskfile { struct hd_drive_task_hdr taskfile; diff --git a/include/linux/input.h b/include/linux/input.h index 7ebdaaa7ae3f..aa5e80d60330 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -325,6 +325,9 @@ struct input_event { #define KEY_UNKNOWN 240 +#define KEY_BRIGHTNESSDOWN 224 +#define KEY_BRIGHTNESSUP 225 + #define BTN_MISC 0x100 #define BTN_0 0x100 #define BTN_1 0x101 diff --git a/include/linux/isdn/capilli.h b/include/linux/isdn/capilli.h index 76eb4e1d2fad..cd10cf67b6f3 100644 --- a/include/linux/isdn/capilli.h +++ b/include/linux/isdn/capilli.h @@ -12,7 +12,10 @@ #ifndef __CAPILLI_H__ #define __CAPILLI_H__ +#include <linux/kernel.h> #include <linux/list.h> +#include <linux/capi.h> +#include <linux/kernelcapi.h> typedef struct capiloaddatapart { int user; /* data in userspace ? */ @@ -60,10 +63,6 @@ struct capi_ctr { void (*handle_capimsg)(struct capi_ctr * card, __u16 appl, struct sk_buff *skb); - void (*new_ncci)(struct capi_ctr * card, - __u16 appl, __u32 ncci, __u32 winsize); - void (*free_ncci)(struct capi_ctr * card, __u16 appl, __u32 ncci); - /* management information for kcapi */ unsigned long nrecvctlpkt; @@ -81,11 +80,10 @@ struct capi_driver { char revision[32]; int (*load_firmware)(struct capi_ctr *, capiloaddata *); void (*reset_ctr)(struct capi_ctr *); - void (*remove_ctr)(struct capi_ctr *); void (*register_appl)(struct capi_ctr *, __u16 appl, capi_register_params *); void (*release_appl)(struct capi_ctr *, __u16 appl); - void (*send_message)(struct capi_ctr *, struct sk_buff *skb); + u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); char *(*procinfo)(struct capi_ctr *); int (*ctr_read_proc)(char *page, char **start, off_t off, @@ -93,8 +91,6 @@ struct capi_driver { int (*driver_read_proc)(char *page, char **start, off_t off, int count, int *eof, struct capi_driver *driver); - int (*add_card)(struct capi_driver *driver, capicardparams *data); - /* intitialized by kcapi */ struct list_head contr_head; /* list of controllers */ struct list_head driver_list; @@ -109,4 +105,16 @@ void detach_capi_driver(struct capi_driver *driver); struct capi_ctr *attach_capi_ctr(struct capi_driver *driver, char *name, void *data); int detach_capi_ctr(struct capi_ctr *); + + +// --------------------------------------------------------------------------- +// library functions for use by hardware controller drivers + +void capilib_new_ncci(struct list_head *head, u16 applid, u32 ncci, u32 winsize); +void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci); +void capilib_release_appl(struct list_head *head, u16 applid); +void capilib_release(struct list_head *head); +void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgid); +u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid); + #endif /* __CAPILLI_H__ */ diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index c162ff96f53b..e6312ebffbc4 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h @@ -32,7 +32,7 @@ typedef struct kcapi_carddef { /* new ioctls >= 10 */ #define KCAPI_CMD_TRACE 10 -#define KCAPI_CMD_ADDCARD 11 /* add card to named driver */ +#define KCAPI_CMD_ADDCARD 11 /* OBSOLETE */ /* * flag > 2 => trace also data @@ -47,6 +47,8 @@ typedef struct kcapi_carddef { #ifdef __KERNEL__ +#include <linux/skbuff.h> + struct capi_interface { __u16 (*capi_isinstalled) (void); diff --git a/include/linux/mm.h b/include/linux/mm.h index 9d92b69a8c36..2f0b56f0183b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -311,8 +311,6 @@ extern mem_map_t * mem_map; extern void show_free_areas(void); extern void show_free_areas_node(pg_data_t *pgdat); -extern void clear_page_tables(struct mm_struct *, unsigned long, int); - extern int fail_writepage(struct page *); struct page * shmem_nopage(struct vm_area_struct * vma, unsigned long address, int unused); struct file *shmem_file_setup(char * name, loff_t size); diff --git a/include/linux/pmu.h b/include/linux/pmu.h index 1186ebc301a8..b8e09e891eb9 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h @@ -113,11 +113,12 @@ enum { #define PMU_IOC_HAS_ADB _IOR('B', 4, sizeof(__u32*)) /* out param: u32* can_sleep: 0 or 1 */ #define PMU_IOC_CAN_SLEEP _IOR('B', 5, sizeof(__u32*)) +/* no param */ +#define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, 0) #ifdef __KERNEL__ extern int find_via_pmu(void); -extern int via_pmu_start(void); extern int pmu_request(struct adb_request *req, void (*done)(struct adb_request *), int nbytes, ...); @@ -168,19 +169,41 @@ struct pmu_sleep_notifier /* priority levels in notifiers */ #define SLEEP_LEVEL_VIDEO 100 /* Video driver (first wake) */ -#define SLEEP_LEVEL_SOUND 90 /* Sound driver */ -#define SLEEP_LEVEL_MEDIABAY 80 /* Media bay driver */ -#define SLEEP_LEVEL_BLOCK 70 /* IDE, SCSI */ -#define SLEEP_LEVEL_NET 60 /* bmac */ -#define SLEEP_LEVEL_ADB 50 /* ADB */ -#define SLEEP_LEVEL_MISC 30 /* Anything */ -#define SLEEP_LEVEL_LAST 0 /* Reserved for apm_emu */ +#define SLEEP_LEVEL_MEDIABAY 90 /* Media bay driver */ +#define SLEEP_LEVEL_BLOCK 80 /* IDE, SCSI */ +#define SLEEP_LEVEL_NET 70 /* bmac, gmac */ +#define SLEEP_LEVEL_MISC 60 /* Anything else */ +#define SLEEP_LEVEL_USERLAND 55 /* Reserved for apm_emu */ +#define SLEEP_LEVEL_ADB 50 /* ADB (async) */ +#define SLEEP_LEVEL_SOUND 40 /* Sound driver (blocking) */ /* special register notifier functions */ int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier); int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier); -#endif /* CONFIG_PMAC_PBOOK */ +#define PMU_MAX_BATTERIES 2 + +/* values for pmu_power_flags */ +#define PMU_PWR_AC_PRESENT 0x00000001 +/* values for pmu_battery_info.flags */ +#define PMU_BATT_PRESENT 0x00000001 +#define PMU_BATT_CHARGING 0x00000002 + +struct pmu_battery_info +{ + unsigned int flags; + unsigned int charge; /* current charge */ + unsigned int max_charge; /* maximum charge */ + signed int current; /* current, positive if charging */ + unsigned int voltage; /* voltage */ + unsigned int time_remaining; /* remaining time */ +}; + +extern int pmu_battery_count; +extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; +extern unsigned int pmu_power_flags; + +#endif /* CONFIG_PMAC_PBOOK */ #endif /* __KERNEL__ */ diff --git a/include/linux/sched.h b/include/linux/sched.h index fdf83faccdde..392d2174d84a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -39,7 +39,7 @@ struct exec_domain; #define CLONE_FS 0x00000200 /* set if fs info shared between processes */ #define CLONE_FILES 0x00000400 /* set if open files shared between processes */ #define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */ -#define CLONE_PID 0x00001000 /* set if pid shared */ +#define CLONE_IDLETASK 0x00001000 /* set if new pid should be 0 (kernel only)*/ #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */ #define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ #define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */ @@ -663,7 +663,7 @@ extern void daemonize(void); extern task_t *child_reaper; extern int do_execve(char *, char **, char **, struct pt_regs *); -extern int do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long); +extern struct task_struct *do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long); extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); |
