diff options
| author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-27 11:25:57 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-27 11:25:57 -0400 |
| commit | 50cb993ea6cd187bfed085cb3e0747066edeb02f (patch) | |
| tree | 61edac62c6c5bc07c59e4369c50c6821ad77f2c0 /include | |
| parent | 445c2714cf72817ab1ad3ca894c6d9b2047b3a3e (diff) | |
| parent | 8be1a6d6c77ab4532e4476fdb8177030ef48b52c (diff) | |
Merge ../linux-2.6
Diffstat (limited to 'include')
571 files changed, 4712 insertions, 10015 deletions
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h index db351d1296f4..a5801ae02e4b 100644 --- a/include/asm-alpha/dma-mapping.h +++ b/include/asm-alpha/dma-mapping.h | |||
| @@ -24,8 +24,8 @@ | |||
| 24 | pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir) | 24 | pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir) |
| 25 | #define dma_supported(dev, mask) \ | 25 | #define dma_supported(dev, mask) \ |
| 26 | pci_dma_supported(alpha_gendev_to_pci(dev), mask) | 26 | pci_dma_supported(alpha_gendev_to_pci(dev), mask) |
| 27 | #define dma_mapping_error(addr) \ | 27 | #define dma_mapping_error(dev, addr) \ |
| 28 | pci_dma_mapping_error(addr) | 28 | pci_dma_mapping_error(alpha_gendev_to_pci(dev), addr) |
| 29 | 29 | ||
| 30 | #else /* no PCI - no IOMMU. */ | 30 | #else /* no PCI - no IOMMU. */ |
| 31 | 31 | ||
| @@ -45,7 +45,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
| 45 | #define dma_unmap_page(dev, addr, size, dir) ((void)0) | 45 | #define dma_unmap_page(dev, addr, size, dir) ((void)0) |
| 46 | #define dma_unmap_sg(dev, sg, nents, dir) ((void)0) | 46 | #define dma_unmap_sg(dev, sg, nents, dir) ((void)0) |
| 47 | 47 | ||
| 48 | #define dma_mapping_error(addr) (0) | 48 | #define dma_mapping_error(dev, addr) (0) |
| 49 | 49 | ||
| 50 | #endif /* !CONFIG_PCI */ | 50 | #endif /* !CONFIG_PCI */ |
| 51 | 51 | ||
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h deleted file mode 100644 index f44129abc02c..000000000000 --- a/include/asm-alpha/ide.h +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-alpha/ide.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* | ||
| 8 | * This file contains the alpha architecture specific IDE code. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __ASMalpha_IDE_H | ||
| 12 | #define __ASMalpha_IDE_H | ||
| 13 | |||
| 14 | #ifdef __KERNEL__ | ||
| 15 | |||
| 16 | static inline int ide_default_irq(unsigned long base) | ||
| 17 | { | ||
| 18 | switch (base) { | ||
| 19 | case 0x1f0: return 14; | ||
| 20 | case 0x170: return 15; | ||
| 21 | case 0x1e8: return 11; | ||
| 22 | case 0x168: return 10; | ||
| 23 | default: | ||
| 24 | return 0; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | static inline unsigned long ide_default_io_base(int index) | ||
| 29 | { | ||
| 30 | switch (index) { | ||
| 31 | case 0: return 0x1f0; | ||
| 32 | case 1: return 0x170; | ||
| 33 | case 2: return 0x1e8; | ||
| 34 | case 3: return 0x168; | ||
| 35 | default: | ||
| 36 | return 0; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | #include <asm-generic/ide_iops.h> | ||
| 41 | |||
| 42 | #endif /* __KERNEL__ */ | ||
| 43 | |||
| 44 | #endif /* __ASMalpha_IDE_H */ | ||
diff --git a/include/asm-alpha/kvm.h b/include/asm-alpha/kvm.h deleted file mode 100644 index b9daec429689..000000000000 --- a/include/asm-alpha/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_ALPHA_H | ||
| 2 | #define __LINUX_KVM_ALPHA_H | ||
| 3 | |||
| 4 | /* alpha does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-alpha/namei.h b/include/asm-alpha/namei.h deleted file mode 100644 index 5cc9bb39499d..000000000000 --- a/include/asm-alpha/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $ | ||
| 2 | * linux/include/asm-alpha/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __ALPHA_NAMEI_H | ||
| 8 | #define __ALPHA_NAMEI_H | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif /* __ALPHA_NAMEI_H */ | ||
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h index 22ff9762d17b..0995f9d13417 100644 --- a/include/asm-alpha/page.h +++ b/include/asm-alpha/page.h | |||
| @@ -80,9 +80,6 @@ typedef struct page *pgtable_t; | |||
| 80 | 80 | ||
| 81 | #endif /* !__ASSEMBLY__ */ | 81 | #endif /* !__ASSEMBLY__ */ |
| 82 | 82 | ||
| 83 | /* to align the pointer to the (next) page boundary */ | ||
| 84 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 85 | |||
| 86 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) | 83 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) |
| 87 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) | 84 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) |
| 88 | #ifndef CONFIG_DISCONTIGMEM | 85 | #ifndef CONFIG_DISCONTIGMEM |
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index d31fd49ff79a..2a14302c17a3 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h | |||
| @@ -106,7 +106,7 @@ extern dma_addr_t pci_map_page(struct pci_dev *, struct page *, | |||
| 106 | /* Test for pci_map_single or pci_map_page having generated an error. */ | 106 | /* Test for pci_map_single or pci_map_page having generated an error. */ |
| 107 | 107 | ||
| 108 | static inline int | 108 | static inline int |
| 109 | pci_dma_mapping_error(dma_addr_t dma_addr) | 109 | pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr) |
| 110 | { | 110 | { |
| 111 | return dma_addr == 0; | 111 | return dma_addr == 0; |
| 112 | } | 112 | } |
diff --git a/include/asm-alpha/semaphore.h b/include/asm-alpha/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-alpha/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-alpha/socket.h b/include/asm-alpha/socket.h index 08c979319929..a1057c2d95e7 100644 --- a/include/asm-alpha/socket.h +++ b/include/asm-alpha/socket.h | |||
| @@ -62,4 +62,9 @@ | |||
| 62 | 62 | ||
| 63 | #define SO_MARK 36 | 63 | #define SO_MARK 36 |
| 64 | 64 | ||
| 65 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | ||
| 66 | * have to define SOCK_NONBLOCK to a different value here. | ||
| 67 | */ | ||
| 68 | #define SOCK_NONBLOCK 0x40000000 | ||
| 69 | |||
| 65 | #endif /* _ASM_SOCKET_H */ | 70 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h index fb3185196298..15fda4344424 100644 --- a/include/asm-alpha/thread_info.h +++ b/include/asm-alpha/thread_info.h | |||
| @@ -50,10 +50,8 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
| 50 | #define current_thread_info() __current_thread_info | 50 | #define current_thread_info() __current_thread_info |
| 51 | 51 | ||
| 52 | /* Thread information allocation. */ | 52 | /* Thread information allocation. */ |
| 53 | #define THREAD_SIZE_ORDER 1 | ||
| 53 | #define THREAD_SIZE (2*PAGE_SIZE) | 54 | #define THREAD_SIZE (2*PAGE_SIZE) |
| 54 | #define alloc_thread_info(tsk) \ | ||
| 55 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | ||
| 56 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | ||
| 57 | 55 | ||
| 58 | #endif /* __ASSEMBLY__ */ | 56 | #endif /* __ASSEMBLY__ */ |
| 59 | 57 | ||
diff --git a/include/asm-arm/arch-at91/at91_ecc.h b/include/asm-arm/arch-at91/at91_ecc.h deleted file mode 100644 index 1e5a8caca2d1..000000000000 --- a/include/asm-arm/arch-at91/at91_ecc.h +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-arm/arch-at91/at91_ecc.h | ||
| 3 | * | ||
| 4 | * Error Corrected Code Controller (ECC) - System peripherals regsters. | ||
| 5 | * Based on AT91SAM9260 datasheet revision B. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef AT91_ECC_H | ||
| 14 | #define AT91_ECC_H | ||
| 15 | |||
| 16 | #define AT91_ECC_CR 0x00 /* Control register */ | ||
| 17 | #define AT91_ECC_RST (1 << 0) /* Reset parity */ | ||
| 18 | |||
| 19 | #define AT91_ECC_MR 0x04 /* Mode register */ | ||
| 20 | #define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */ | ||
| 21 | #define AT91_ECC_PAGESIZE_528 (0) | ||
| 22 | #define AT91_ECC_PAGESIZE_1056 (1) | ||
| 23 | #define AT91_ECC_PAGESIZE_2112 (2) | ||
| 24 | #define AT91_ECC_PAGESIZE_4224 (3) | ||
| 25 | |||
| 26 | #define AT91_ECC_SR 0x08 /* Status register */ | ||
| 27 | #define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */ | ||
| 28 | #define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */ | ||
| 29 | #define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */ | ||
| 30 | |||
| 31 | #define AT91_ECC_PR 0x0c /* Parity register */ | ||
| 32 | #define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */ | ||
| 33 | #define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */ | ||
| 34 | |||
| 35 | #define AT91_ECC_NPR 0x10 /* NParity register */ | ||
| 36 | #define AT91_ECC_NPARITY (0xffff << 0) /* NParity */ | ||
| 37 | |||
| 38 | #endif | ||
diff --git a/include/asm-arm/arch-at91/board.h b/include/asm-arm/arch-at91/board.h index 94de788da76e..48bbd854f57d 100644 --- a/include/asm-arm/arch-at91/board.h +++ b/include/asm-arm/arch-at91/board.h | |||
| @@ -89,7 +89,7 @@ struct at91_usbh_data { | |||
| 89 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); | 89 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); |
| 90 | 90 | ||
| 91 | /* NAND / SmartMedia */ | 91 | /* NAND / SmartMedia */ |
| 92 | struct at91_nand_data { | 92 | struct atmel_nand_data { |
| 93 | u8 enable_pin; /* chip enable */ | 93 | u8 enable_pin; /* chip enable */ |
| 94 | u8 det_pin; /* card detect */ | 94 | u8 det_pin; /* card detect */ |
| 95 | u8 rdy_pin; /* ready/busy */ | 95 | u8 rdy_pin; /* ready/busy */ |
| @@ -98,7 +98,7 @@ struct at91_nand_data { | |||
| 98 | u8 bus_width_16; /* buswidth is 16 bit */ | 98 | u8 bus_width_16; /* buswidth is 16 bit */ |
| 99 | struct mtd_partition* (*partition_info)(int, int*); | 99 | struct mtd_partition* (*partition_info)(int, int*); |
| 100 | }; | 100 | }; |
| 101 | extern void __init at91_add_device_nand(struct at91_nand_data *data); | 101 | extern void __init at91_add_device_nand(struct atmel_nand_data *data); |
| 102 | 102 | ||
| 103 | /* I2C*/ | 103 | /* I2C*/ |
| 104 | extern void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices); | 104 | extern void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices); |
diff --git a/include/asm-arm/arch-sa1100/h3600.h b/include/asm-arm/arch-sa1100/h3600.h index 1b6355971574..3ca0ecf095e6 100644 --- a/include/asm-arm/arch-sa1100/h3600.h +++ b/include/asm-arm/arch-sa1100/h3600.h | |||
| @@ -23,6 +23,11 @@ | |||
| 23 | #ifndef _INCLUDE_H3600_H_ | 23 | #ifndef _INCLUDE_H3600_H_ |
| 24 | #define _INCLUDE_H3600_H_ | 24 | #define _INCLUDE_H3600_H_ |
| 25 | 25 | ||
| 26 | typedef int __bitwise pm_request_t; | ||
| 27 | |||
| 28 | #define PM_SUSPEND ((__force pm_request_t) 1) /* enter D1-D3 */ | ||
| 29 | #define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */ | ||
| 30 | |||
| 26 | /* generalized support for H3xxx series Compaq Pocket PC's */ | 31 | /* generalized support for H3xxx series Compaq Pocket PC's */ |
| 27 | #define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600() || machine_is_h3800()) | 32 | #define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600() || machine_is_h3800()) |
| 28 | 33 | ||
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index 70b0fe724b62..03cf1ee977b7 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h | |||
| @@ -424,9 +424,9 @@ static inline void flush_anon_page(struct vm_area_struct *vma, | |||
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | #define flush_dcache_mmap_lock(mapping) \ | 426 | #define flush_dcache_mmap_lock(mapping) \ |
| 427 | write_lock_irq(&(mapping)->tree_lock) | 427 | spin_lock_irq(&(mapping)->tree_lock) |
| 428 | #define flush_dcache_mmap_unlock(mapping) \ | 428 | #define flush_dcache_mmap_unlock(mapping) \ |
| 429 | write_unlock_irq(&(mapping)->tree_lock) | 429 | spin_unlock_irq(&(mapping)->tree_lock) |
| 430 | 430 | ||
| 431 | #define flush_icache_user_range(vma,page,addr,len) \ | 431 | #define flush_icache_user_range(vma,page,addr,len) \ |
| 432 | flush_dcache_page(page) | 432 | flush_dcache_page(page) |
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index e99406a7bece..f41335ba6337 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h | |||
| @@ -56,7 +56,7 @@ static inline int dma_is_consistent(struct device *dev, dma_addr_t handle) | |||
| 56 | /* | 56 | /* |
| 57 | * DMA errors are defined by all-bits-set in the DMA address. | 57 | * DMA errors are defined by all-bits-set in the DMA address. |
| 58 | */ | 58 | */ |
| 59 | static inline int dma_mapping_error(dma_addr_t dma_addr) | 59 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 60 | { | 60 | { |
| 61 | return dma_addr == ~0; | 61 | return dma_addr == ~0; |
| 62 | } | 62 | } |
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h index 88f4d231ce4f..a48019f99d08 100644 --- a/include/asm-arm/ide.h +++ b/include/asm-arm/ide.h | |||
| @@ -13,10 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
| 15 | 15 | ||
| 16 | #ifndef MAX_HWIFS | ||
| 17 | #define MAX_HWIFS 4 | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define __ide_mm_insw(port,addr,len) readsw(port,addr,len) | 16 | #define __ide_mm_insw(port,addr,len) readsw(port,addr,len) |
| 21 | #define __ide_mm_insl(port,addr,len) readsl(port,addr,len) | 17 | #define __ide_mm_insl(port,addr,len) readsl(port,addr,len) |
| 22 | #define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) | 18 | #define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) |
diff --git a/include/asm-arm/kvm.h b/include/asm-arm/kvm.h deleted file mode 100644 index cb3c08cbcb9e..000000000000 --- a/include/asm-arm/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_ARM_H | ||
| 2 | #define __LINUX_KVM_ARM_H | ||
| 3 | |||
| 4 | /* arm does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-arm/namei.h b/include/asm-arm/namei.h deleted file mode 100644 index a402d3b9d0f7..000000000000 --- a/include/asm-arm/namei.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-arm/namei.h | ||
| 3 | * | ||
| 4 | * Routines to handle famous /usr/gnemul | ||
| 5 | * Derived from the Sparc version of this file | ||
| 6 | * | ||
| 7 | * Included from linux/fs/namei.c | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __ASMARM_NAMEI_H | ||
| 11 | #define __ASMARM_NAMEI_H | ||
| 12 | |||
| 13 | #define ARM_BSD_EMUL "usr/gnemul/bsd/" | ||
| 14 | |||
| 15 | static inline char *__emul_prefix(void) | ||
| 16 | { | ||
| 17 | switch (current->personality) { | ||
| 18 | case PER_BSD: | ||
| 19 | return ARM_BSD_EMUL; | ||
| 20 | default: | ||
| 21 | return NULL; | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | #endif /* __ASMARM_NAMEI_H */ | ||
diff --git a/include/asm-arm/page-nommu.h b/include/asm-arm/page-nommu.h index a1bcad060480..ea1cde84f500 100644 --- a/include/asm-arm/page-nommu.h +++ b/include/asm-arm/page-nommu.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | |||
| 10 | #ifndef _ASMARM_PAGE_NOMMU_H | 11 | #ifndef _ASMARM_PAGE_NOMMU_H |
| 11 | #define _ASMARM_PAGE_NOMMU_H | 12 | #define _ASMARM_PAGE_NOMMU_H |
| 12 | 13 | ||
| @@ -42,9 +43,6 @@ typedef unsigned long pgprot_t; | |||
| 42 | #define __pmd(x) (x) | 43 | #define __pmd(x) (x) |
| 43 | #define __pgprot(x) (x) | 44 | #define __pgprot(x) (x) |
| 44 | 45 | ||
| 45 | /* to align the pointer to the (next) page boundary */ | ||
| 46 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 47 | |||
| 48 | extern unsigned long memory_start; | 46 | extern unsigned long memory_start; |
| 49 | extern unsigned long memory_end; | 47 | extern unsigned long memory_end; |
| 50 | 48 | ||
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index 8e05bdb5f12f..7c5fc5582e5d 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h | |||
| @@ -15,9 +15,6 @@ | |||
| 15 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 15 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
| 16 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 16 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
| 17 | 17 | ||
| 18 | /* to align the pointer to the (next) page boundary */ | ||
| 19 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 20 | |||
| 21 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
| 22 | 19 | ||
| 23 | #ifndef CONFIG_MMU | 20 | #ifndef CONFIG_MMU |
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h index 7aaa206cb54e..8382b7510f94 100644 --- a/include/asm-arm/ptrace.h +++ b/include/asm-arm/ptrace.h | |||
| @@ -139,8 +139,6 @@ static inline int valid_user_regs(struct pt_regs *regs) | |||
| 139 | return 0; | 139 | return 0; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | #endif /* __KERNEL__ */ | ||
| 143 | |||
| 144 | #define pc_pointer(v) \ | 142 | #define pc_pointer(v) \ |
| 145 | ((v) & ~PCMASK) | 143 | ((v) & ~PCMASK) |
| 146 | 144 | ||
| @@ -153,10 +151,10 @@ extern unsigned long profile_pc(struct pt_regs *regs); | |||
| 153 | #define profile_pc(regs) instruction_pointer(regs) | 151 | #define profile_pc(regs) instruction_pointer(regs) |
| 154 | #endif | 152 | #endif |
| 155 | 153 | ||
| 156 | #ifdef __KERNEL__ | ||
| 157 | #define predicate(x) ((x) & 0xf0000000) | 154 | #define predicate(x) ((x) & 0xf0000000) |
| 158 | #define PREDICATE_ALWAYS 0xe0000000 | 155 | #define PREDICATE_ALWAYS 0xe0000000 |
| 159 | #endif | 156 | |
| 157 | #endif /* __KERNEL__ */ | ||
| 160 | 158 | ||
| 161 | #endif /* __ASSEMBLY__ */ | 159 | #endif /* __ASSEMBLY__ */ |
| 162 | 160 | ||
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-arm/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index f5a664786311..d4be2d646160 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h | |||
| @@ -97,19 +97,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 97 | return (struct thread_info *)(sp & ~(THREAD_SIZE - 1)); | 97 | return (struct thread_info *)(sp & ~(THREAD_SIZE - 1)); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | /* thread information allocation */ | ||
| 101 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
| 102 | #define alloc_thread_info(tsk) \ | ||
| 103 | ((struct thread_info *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, \ | ||
| 104 | THREAD_SIZE_ORDER)) | ||
| 105 | #else | ||
| 106 | #define alloc_thread_info(tsk) \ | ||
| 107 | ((struct thread_info *)__get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER)) | ||
| 108 | #endif | ||
| 109 | |||
| 110 | #define free_thread_info(info) \ | ||
| 111 | free_pages((unsigned long)info, THREAD_SIZE_ORDER); | ||
| 112 | |||
| 113 | #define thread_saved_pc(tsk) \ | 100 | #define thread_saved_pc(tsk) \ |
| 114 | ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc))) | 101 | ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc))) |
| 115 | #define thread_saved_fp(tsk) \ | 102 | #define thread_saved_fp(tsk) \ |
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index a3783861cdd2..893aa6d0cd11 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h | |||
| @@ -97,4 +97,17 @@ struct platform_device * | |||
| 97 | at32_add_device_cf(unsigned int id, unsigned int extint, | 97 | at32_add_device_cf(unsigned int id, unsigned int extint, |
| 98 | struct cf_platform_data *data); | 98 | struct cf_platform_data *data); |
| 99 | 99 | ||
| 100 | /* NAND / SmartMedia */ | ||
| 101 | struct atmel_nand_data { | ||
| 102 | int enable_pin; /* chip enable */ | ||
| 103 | int det_pin; /* card detect */ | ||
| 104 | int rdy_pin; /* ready/busy */ | ||
| 105 | u8 ale; /* address line number connected to ALE */ | ||
| 106 | u8 cle; /* address line number connected to CLE */ | ||
| 107 | u8 bus_width_16; /* buswidth is 16 bit */ | ||
| 108 | struct mtd_partition *(*partition_info)(int size, int *num_partitions); | ||
| 109 | }; | ||
| 110 | struct platform_device * | ||
| 111 | at32_add_device_nand(unsigned int id, struct atmel_nand_data *data); | ||
| 112 | |||
| 100 | #endif /* __ASM_ARCH_BOARD_H */ | 113 | #endif /* __ASM_ARCH_BOARD_H */ |
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h index 57dc672bab8e..0399359ab5d8 100644 --- a/include/asm-avr32/dma-mapping.h +++ b/include/asm-avr32/dma-mapping.h | |||
| @@ -35,7 +35,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask) | |||
| 35 | /* | 35 | /* |
| 36 | * dma_map_single can't fail as it is implemented now. | 36 | * dma_map_single can't fail as it is implemented now. |
| 37 | */ | 37 | */ |
| 38 | static inline int dma_mapping_error(dma_addr_t addr) | 38 | static inline int dma_mapping_error(struct device *dev, dma_addr_t addr) |
| 39 | { | 39 | { |
| 40 | return 0; | 40 | return 0; |
| 41 | } | 41 | } |
diff --git a/include/asm-avr32/kvm.h b/include/asm-avr32/kvm.h deleted file mode 100644 index 8c5777020e2c..000000000000 --- a/include/asm-avr32/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_AVR32_H | ||
| 2 | #define __LINUX_KVM_AVR32_H | ||
| 3 | |||
| 4 | /* avr32 does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-avr32/namei.h b/include/asm-avr32/namei.h deleted file mode 100644 index f0a26de06cab..000000000000 --- a/include/asm-avr32/namei.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef __ASM_AVR32_NAMEI_H | ||
| 2 | #define __ASM_AVR32_NAMEI_H | ||
| 3 | |||
| 4 | /* This dummy routine may be changed to something useful */ | ||
| 5 | #define __emul_prefix() NULL | ||
| 6 | |||
| 7 | #endif /* __ASM_AVR32_NAMEI_H */ | ||
diff --git a/include/asm-avr32/page.h b/include/asm-avr32/page.h index cbbc5ca9728b..f805d1cb11bc 100644 --- a/include/asm-avr32/page.h +++ b/include/asm-avr32/page.h | |||
| @@ -57,9 +57,6 @@ static inline int get_order(unsigned long size) | |||
| 57 | 57 | ||
| 58 | #endif /* !__ASSEMBLY__ */ | 58 | #endif /* !__ASSEMBLY__ */ |
| 59 | 59 | ||
| 60 | /* Align the pointer to the (next) page boundary */ | ||
| 61 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | ||
| 62 | |||
| 63 | /* | 60 | /* |
| 64 | * The hardware maps the virtual addresses 0x80000000 -> 0x9fffffff | 61 | * The hardware maps the virtual addresses 0x80000000 -> 0x9fffffff |
| 65 | * permanently to the physical addresses 0x00000000 -> 0x1fffffff when | 62 | * permanently to the physical addresses 0x00000000 -> 0x1fffffff when |
diff --git a/include/asm-avr32/semaphore.h b/include/asm-avr32/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-avr32/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-avr32/thread_info.h b/include/asm-avr32/thread_info.h index df68631b7b27..294b25f9323d 100644 --- a/include/asm-avr32/thread_info.h +++ b/include/asm-avr32/thread_info.h | |||
| @@ -61,10 +61,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 61 | return (struct thread_info *)addr; | 61 | return (struct thread_info *)addr; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | /* thread information allocation */ | ||
| 65 | #define alloc_thread_info(ti) \ | ||
| 66 | ((struct thread_info *) __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER)) | ||
| 67 | #define free_thread_info(ti) free_pages((unsigned long)(ti), 1) | ||
| 68 | #define get_thread_info(ti) get_task_struct((ti)->task) | 64 | #define get_thread_info(ti) get_task_struct((ti)->task) |
| 69 | #define put_thread_info(ti) put_task_struct((ti)->task) | 65 | #define put_thread_info(ti) put_task_struct((ti)->task) |
| 70 | 66 | ||
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h index 76033831eb35..320aa5e167e9 100644 --- a/include/asm-blackfin/bfin-global.h +++ b/include/asm-blackfin/bfin-global.h | |||
| @@ -92,16 +92,20 @@ extern void *l1_data_B_sram_alloc(size_t); | |||
| 92 | extern void *l1_inst_sram_alloc(size_t); | 92 | extern void *l1_inst_sram_alloc(size_t); |
| 93 | extern void *l1_data_sram_alloc(size_t); | 93 | extern void *l1_data_sram_alloc(size_t); |
| 94 | extern void *l1_data_sram_zalloc(size_t); | 94 | extern void *l1_data_sram_zalloc(size_t); |
| 95 | extern void *l2_sram_alloc(size_t); | ||
| 96 | extern void *l2_sram_zalloc(size_t); | ||
| 95 | extern int l1_data_A_sram_free(const void*); | 97 | extern int l1_data_A_sram_free(const void*); |
| 96 | extern int l1_data_B_sram_free(const void*); | 98 | extern int l1_data_B_sram_free(const void*); |
| 97 | extern int l1_inst_sram_free(const void*); | 99 | extern int l1_inst_sram_free(const void*); |
| 98 | extern int l1_data_sram_free(const void*); | 100 | extern int l1_data_sram_free(const void*); |
| 101 | extern int l2_sram_free(const void *); | ||
| 99 | extern int sram_free(const void*); | 102 | extern int sram_free(const void*); |
| 100 | 103 | ||
| 101 | #define L1_INST_SRAM 0x00000001 | 104 | #define L1_INST_SRAM 0x00000001 |
| 102 | #define L1_DATA_A_SRAM 0x00000002 | 105 | #define L1_DATA_A_SRAM 0x00000002 |
| 103 | #define L1_DATA_B_SRAM 0x00000004 | 106 | #define L1_DATA_B_SRAM 0x00000004 |
| 104 | #define L1_DATA_SRAM 0x00000006 | 107 | #define L1_DATA_SRAM 0x00000006 |
| 108 | #define L2_SRAM 0x00000008 | ||
| 105 | extern void *sram_alloc_with_lsl(size_t, unsigned long); | 109 | extern void *sram_alloc_with_lsl(size_t, unsigned long); |
| 106 | extern int sram_free_with_lsl(const void*); | 110 | extern int sram_free_with_lsl(const void*); |
| 107 | 111 | ||
| @@ -114,7 +118,9 @@ extern struct file_operations dpmc_fops; | |||
| 114 | extern unsigned long _ramstart, _ramend, _rambase; | 118 | extern unsigned long _ramstart, _ramend, _rambase; |
| 115 | extern unsigned long memory_start, memory_end, physical_mem_end; | 119 | extern unsigned long memory_start, memory_end, physical_mem_end; |
| 116 | extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], | 120 | extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], |
| 117 | _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[]; | 121 | _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[], |
| 122 | _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[], | ||
| 123 | _ebss_l2[], _l2_lma_start[]; | ||
| 118 | 124 | ||
| 119 | #ifdef CONFIG_MTD_UCLINUX | 125 | #ifdef CONFIG_MTD_UCLINUX |
| 120 | extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size; | 126 | extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size; |
diff --git a/include/asm-blackfin/dma.h b/include/asm-blackfin/dma.h index c0d5259e315b..3cd4b522aa3f 100644 --- a/include/asm-blackfin/dma.h +++ b/include/asm-blackfin/dma.h | |||
| @@ -144,8 +144,16 @@ struct dma_channel { | |||
| 144 | void *data; | 144 | void *data; |
| 145 | unsigned int dma_enable_flag; | 145 | unsigned int dma_enable_flag; |
| 146 | unsigned int loopback_flag; | 146 | unsigned int loopback_flag; |
| 147 | #ifdef CONFIG_PM | ||
| 148 | unsigned short saved_peripheral_map; | ||
| 149 | #endif | ||
| 147 | }; | 150 | }; |
| 148 | 151 | ||
| 152 | #ifdef CONFIG_PM | ||
| 153 | int blackfin_dma_suspend(void); | ||
| 154 | void blackfin_dma_resume(void); | ||
| 155 | #endif | ||
| 156 | |||
| 149 | /******************************************************************************* | 157 | /******************************************************************************* |
| 150 | * DMA API's | 158 | * DMA API's |
| 151 | *******************************************************************************/ | 159 | *******************************************************************************/ |
diff --git a/include/asm-blackfin/dpmc.h b/include/asm-blackfin/dpmc.h index 7f34cd384f12..de28e6e018b3 100644 --- a/include/asm-blackfin/dpmc.h +++ b/include/asm-blackfin/dpmc.h | |||
| @@ -7,63 +7,18 @@ | |||
| 7 | #ifndef _BLACKFIN_DPMC_H_ | 7 | #ifndef _BLACKFIN_DPMC_H_ |
| 8 | #define _BLACKFIN_DPMC_H_ | 8 | #define _BLACKFIN_DPMC_H_ |
| 9 | 9 | ||
| 10 | #define SLEEP_MODE 1 | ||
| 11 | #define DEEP_SLEEP_MODE 2 | ||
| 12 | #define ACTIVE_PLL_DISABLED 3 | ||
| 13 | #define FULLON_MODE 4 | ||
| 14 | #define ACTIVE_PLL_ENABLED 5 | ||
| 15 | #define HIBERNATE_MODE 6 | ||
| 16 | |||
| 17 | #define IOCTL_FULL_ON_MODE _IO('s', 0xA0) | ||
| 18 | #define IOCTL_ACTIVE_MODE _IO('s', 0xA1) | ||
| 19 | #define IOCTL_SLEEP_MODE _IO('s', 0xA2) | ||
| 20 | #define IOCTL_DEEP_SLEEP_MODE _IO('s', 0xA3) | ||
| 21 | #define IOCTL_HIBERNATE_MODE _IO('s', 0xA4) | ||
| 22 | #define IOCTL_CHANGE_FREQUENCY _IOW('s', 0xA5, unsigned long) | ||
| 23 | #define IOCTL_CHANGE_VOLTAGE _IOW('s', 0xA6, unsigned long) | ||
| 24 | #define IOCTL_SET_CCLK _IOW('s', 0xA7, unsigned long) | ||
| 25 | #define IOCTL_SET_SCLK _IOW('s', 0xA8, unsigned long) | ||
| 26 | #define IOCTL_GET_PLLSTATUS _IOW('s', 0xA9, unsigned long) | ||
| 27 | #define IOCTL_GET_CORECLOCK _IOW('s', 0xAA, unsigned long) | ||
| 28 | #define IOCTL_GET_SYSTEMCLOCK _IOW('s', 0xAB, unsigned long) | ||
| 29 | #define IOCTL_GET_VCO _IOW('s', 0xAC, unsigned long) | ||
| 30 | #define IOCTL_DISABLE_WDOG_TIMER _IO('s', 0xAD) | ||
| 31 | #define IOCTL_UNMASK_WDOG_WAKEUP_EVENT _IO('s',0xAE) | ||
| 32 | #define IOCTL_PROGRAM_WDOG_TIMER _IOW('s',0xAF,unsigned long) | ||
| 33 | #define IOCTL_CLEAR_WDOG_WAKEUP_EVENT _IO('s',0xB0) | ||
| 34 | #define IOCTL_SLEEP_DEEPER_MODE _IO('s',0xB1) | ||
| 35 | |||
| 36 | #define DPMC_MINOR 254 | ||
| 37 | |||
| 38 | #define ON 0 | ||
| 39 | #define OFF 1 | ||
| 40 | |||
| 41 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
| 11 | #ifndef __ASSEMBLY__ | ||
| 42 | 12 | ||
| 43 | unsigned long calc_volt(void); | ||
| 44 | int calc_vlev(int vlt); | ||
| 45 | unsigned long change_voltage(unsigned long volt); | ||
| 46 | int calc_msel(int vco_hz); | ||
| 47 | unsigned long change_frequency(unsigned long vco_mhz); | ||
| 48 | int set_pll_div(unsigned short sel, unsigned char flag); | ||
| 49 | int get_vco(void); | ||
| 50 | unsigned long change_system_clock(unsigned long clock); | ||
| 51 | unsigned long change_core_clock(unsigned long clock); | ||
| 52 | unsigned long get_pll_status(void); | ||
| 53 | void change_baud(int baud); | ||
| 54 | void fullon_mode(void); | ||
| 55 | void active_mode(void); | ||
| 56 | void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); | 13 | void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
| 57 | void deep_sleep(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); | 14 | void deep_sleep(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
| 58 | void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); | 15 | void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
| 59 | void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); | 16 | void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
| 60 | void program_wdog_timer(unsigned long); | 17 | void do_hibernate(int wakeup); |
| 61 | void unmask_wdog_wakeup_evt(void); | 18 | void set_dram_srfs(void); |
| 62 | void clear_wdog_wakeup_evt(void); | 19 | void unset_dram_srfs(void); |
| 63 | void disable_wdog_timer(void); | ||
| 64 | 20 | ||
| 65 | extern unsigned long get_cclk(void); | 21 | #define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16)) |
| 66 | extern unsigned long get_sclk(void); | ||
| 67 | 22 | ||
| 68 | struct bfin_dpmc_platform_data { | 23 | struct bfin_dpmc_platform_data { |
| 69 | const unsigned int *tuple_tab; | 24 | const unsigned int *tuple_tab; |
| @@ -71,8 +26,33 @@ struct bfin_dpmc_platform_data { | |||
| 71 | unsigned short vr_settling_time; /* in us */ | 26 | unsigned short vr_settling_time; /* in us */ |
| 72 | }; | 27 | }; |
| 73 | 28 | ||
| 74 | #define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16)) | 29 | #else |
| 30 | |||
| 31 | #define PM_PUSH(x) \ | ||
| 32 | R0 = [P0 + (x - SRAM_BASE_ADDRESS)];\ | ||
| 33 | [--SP] = R0;\ | ||
| 34 | |||
| 35 | #define PM_POP(x) \ | ||
| 36 | R0 = [SP++];\ | ||
| 37 | [P0 + (x - SRAM_BASE_ADDRESS)] = R0;\ | ||
| 38 | |||
| 39 | #define PM_SYS_PUSH(x) \ | ||
| 40 | R0 = [P0 + (x - PLL_CTL)];\ | ||
| 41 | [--SP] = R0;\ | ||
| 42 | |||
| 43 | #define PM_SYS_POP(x) \ | ||
| 44 | R0 = [SP++];\ | ||
| 45 | [P0 + (x - PLL_CTL)] = R0;\ | ||
| 46 | |||
| 47 | #define PM_SYS_PUSH16(x) \ | ||
| 48 | R0 = w[P0 + (x - PLL_CTL)];\ | ||
| 49 | [--SP] = R0;\ | ||
| 50 | |||
| 51 | #define PM_SYS_POP16(x) \ | ||
| 52 | R0 = [SP++];\ | ||
| 53 | w[P0 + (x - PLL_CTL)] = R0;\ | ||
| 75 | 54 | ||
| 55 | #endif | ||
| 76 | #endif /* __KERNEL__ */ | 56 | #endif /* __KERNEL__ */ |
| 77 | 57 | ||
| 78 | #endif /*_BLACKFIN_DPMC_H_*/ | 58 | #endif /*_BLACKFIN_DPMC_H_*/ |
diff --git a/include/asm-blackfin/elf.h b/include/asm-blackfin/elf.h index 30303fc8292c..67a03a8a353e 100644 --- a/include/asm-blackfin/elf.h +++ b/include/asm-blackfin/elf.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */ | 15 | #define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */ |
| 16 | #define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */ | 16 | #define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */ |
| 17 | #define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */ | 17 | #define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */ |
| 18 | #define EF_BFIN_CODE_IN_L2 0x00000040 /* --code-in-l2 */ | ||
| 19 | #define EF_BFIN_DATA_IN_L2 0x00000080 /* --data-in-l2 */ | ||
| 18 | 20 | ||
| 19 | typedef unsigned long elf_greg_t; | 21 | typedef unsigned long elf_greg_t; |
| 20 | 22 | ||
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h index ff95e9d88342..168f1251eb4d 100644 --- a/include/asm-blackfin/gpio.h +++ b/include/asm-blackfin/gpio.h | |||
| @@ -376,8 +376,12 @@ struct gpio_port_t { | |||
| 376 | #endif | 376 | #endif |
| 377 | 377 | ||
| 378 | #ifdef CONFIG_PM | 378 | #ifdef CONFIG_PM |
| 379 | unsigned int bfin_pm_setup(void); | 379 | |
| 380 | void bfin_pm_restore(void); | 380 | unsigned int bfin_pm_standby_setup(void); |
| 381 | void bfin_pm_standby_restore(void); | ||
| 382 | |||
| 383 | void bfin_gpio_pm_hibernate_restore(void); | ||
| 384 | void bfin_gpio_pm_hibernate_suspend(void); | ||
| 381 | 385 | ||
| 382 | #ifndef CONFIG_BF54x | 386 | #ifndef CONFIG_BF54x |
| 383 | #define PM_WAKE_RISING 0x1 | 387 | #define PM_WAKE_RISING 0x1 |
| @@ -392,17 +396,8 @@ void gpio_pm_wakeup_free(unsigned gpio); | |||
| 392 | 396 | ||
| 393 | struct gpio_port_s { | 397 | struct gpio_port_s { |
| 394 | unsigned short data; | 398 | unsigned short data; |
| 395 | unsigned short data_clear; | ||
| 396 | unsigned short data_set; | ||
| 397 | unsigned short toggle; | ||
| 398 | unsigned short maska; | 399 | unsigned short maska; |
| 399 | unsigned short maska_clear; | ||
| 400 | unsigned short maska_set; | ||
| 401 | unsigned short maska_toggle; | ||
| 402 | unsigned short maskb; | 400 | unsigned short maskb; |
| 403 | unsigned short maskb_clear; | ||
| 404 | unsigned short maskb_set; | ||
| 405 | unsigned short maskb_toggle; | ||
| 406 | unsigned short dir; | 401 | unsigned short dir; |
| 407 | unsigned short polar; | 402 | unsigned short polar; |
| 408 | unsigned short edge; | 403 | unsigned short edge; |
| @@ -411,10 +406,10 @@ struct gpio_port_s { | |||
| 411 | 406 | ||
| 412 | unsigned short fer; | 407 | unsigned short fer; |
| 413 | unsigned short reserved; | 408 | unsigned short reserved; |
| 409 | unsigned short mux; | ||
| 414 | }; | 410 | }; |
| 415 | #endif /*CONFIG_BF54x*/ | 411 | #endif /*CONFIG_BF54x*/ |
| 416 | #endif /*CONFIG_PM*/ | 412 | #endif /*CONFIG_PM*/ |
| 417 | |||
| 418 | /*********************************************************** | 413 | /*********************************************************** |
| 419 | * | 414 | * |
| 420 | * FUNCTIONS: Blackfin GPIO Driver | 415 | * FUNCTIONS: Blackfin GPIO Driver |
diff --git a/include/asm-blackfin/ide.h b/include/asm-blackfin/ide.h deleted file mode 100644 index 5b88de115bf4..000000000000 --- a/include/asm-blackfin/ide.h +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | /****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * linux/include/asm-blackfin/ide.h | ||
| 5 | * | ||
| 6 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
| 7 | * Copyright (C) 2001 Lineo Inc., davidm@snapgear.com | ||
| 8 | * Copyright (C) 2002 Greg Ungerer (gerg@snapgear.com) | ||
| 9 | * Copyright (C) 2002 Yoshinori Sato (ysato@users.sourceforge.jp) | ||
| 10 | * Copyright (C) 2005 Hennerich Michael (hennerich@blackfin.uclinux.org) | ||
| 11 | */ | ||
| 12 | |||
| 13 | /****************************************************************************/ | ||
| 14 | #ifndef _BLACKFIN_IDE_H | ||
| 15 | #define _BLACKFIN_IDE_H | ||
| 16 | /****************************************************************************/ | ||
| 17 | #ifdef __KERNEL__ | ||
| 18 | /****************************************************************************/ | ||
| 19 | |||
| 20 | #define MAX_HWIFS 1 | ||
| 21 | |||
| 22 | #include <asm-generic/ide_iops.h> | ||
| 23 | |||
| 24 | /****************************************************************************/ | ||
| 25 | #endif /* __KERNEL__ */ | ||
| 26 | #endif /* _BLACKFIN_IDE_H */ | ||
| 27 | /****************************************************************************/ | ||
diff --git a/include/asm-blackfin/kvm.h b/include/asm-blackfin/kvm.h deleted file mode 100644 index e3477d77c014..000000000000 --- a/include/asm-blackfin/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_BLACKFIN_H | ||
| 2 | #define __LINUX_KVM_BLACKFIN_H | ||
| 3 | |||
| 4 | /* blackfin does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-blackfin/mach-bf527/anomaly.h b/include/asm-blackfin/mach-bf527/anomaly.h index 4725268a5ada..b7b166f4f064 100644 --- a/include/asm-blackfin/mach-bf527/anomaly.h +++ b/include/asm-blackfin/mach-bf527/anomaly.h | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | #define ANOMALY_05000245 (1) | 23 | #define ANOMALY_05000245 (1) |
| 24 | /* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ | 24 | /* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ |
| 25 | #define ANOMALY_05000265 (1) | 25 | #define ANOMALY_05000265 (1) |
| 26 | /* New Feature: EMAC TX DMA Word Alignment */ | ||
| 27 | #define ANOMALY_05000285 (1) | ||
| 26 | /* Errors when SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */ | 28 | /* Errors when SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */ |
| 27 | #define ANOMALY_05000312 (1) | 29 | #define ANOMALY_05000312 (1) |
| 28 | /* Incorrect Access of OTP_STATUS During otp_write() Function */ | 30 | /* Incorrect Access of OTP_STATUS During otp_write() Function */ |
diff --git a/include/asm-blackfin/mach-bf527/bfin_sir.h b/include/asm-blackfin/mach-bf527/bfin_sir.h index 0612d0c9501c..cfd8ad4f1f2c 100644 --- a/include/asm-blackfin/mach-bf527/bfin_sir.h +++ b/include/asm-blackfin/mach-bf527/bfin_sir.h | |||
| @@ -118,16 +118,25 @@ static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port) | |||
| 118 | 118 | ||
| 119 | #define DRIVER_NAME "bfin_sir" | 119 | #define DRIVER_NAME "bfin_sir" |
| 120 | 120 | ||
| 121 | static void bfin_sir_hw_init(void) | 121 | static int bfin_sir_hw_init(void) |
| 122 | { | 122 | { |
| 123 | int ret = -ENODEV; | ||
| 123 | #ifdef CONFIG_BFIN_SIR0 | 124 | #ifdef CONFIG_BFIN_SIR0 |
| 124 | peripheral_request(P_UART0_TX, DRIVER_NAME); | 125 | ret = peripheral_request(P_UART0_TX, DRIVER_NAME); |
| 125 | peripheral_request(P_UART0_RX, DRIVER_NAME); | 126 | if (ret) |
| 127 | return ret; | ||
| 128 | ret = peripheral_request(P_UART0_RX, DRIVER_NAME); | ||
| 129 | if (ret) | ||
| 130 | return ret; | ||
| 126 | #endif | 131 | #endif |
| 127 | 132 | ||
| 128 | #ifdef CONFIG_BFIN_SIR1 | 133 | #ifdef CONFIG_BFIN_SIR1 |
| 129 | peripheral_request(P_UART1_TX, DRIVER_NAME); | 134 | ret = peripheral_request(P_UART1_TX, DRIVER_NAME); |
| 130 | peripheral_request(P_UART1_RX, DRIVER_NAME); | 135 | if (ret) |
| 136 | return ret; | ||
| 137 | ret = peripheral_request(P_UART1_RX, DRIVER_NAME); | ||
| 138 | if (ret) | ||
| 139 | return ret; | ||
| 131 | #endif | 140 | #endif |
| 132 | SSYNC(); | 141 | return ret; |
| 133 | } | 142 | } |
diff --git a/include/asm-blackfin/mach-bf527/defBF527.h b/include/asm-blackfin/mach-bf527/defBF527.h index 82134f578f32..f1a70db70cb8 100644 --- a/include/asm-blackfin/mach-bf527/defBF527.h +++ b/include/asm-blackfin/mach-bf527/defBF527.h | |||
| @@ -302,6 +302,7 @@ | |||
| 302 | #define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */ | 302 | #define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */ |
| 303 | #define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */ | 303 | #define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */ |
| 304 | #define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */ | 304 | #define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */ |
| 305 | #define TXDWA 0x00000010 /* Transmit Frame DMA Word Alignment (Odd/Even*) */ | ||
| 305 | #define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */ | 306 | #define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */ |
| 306 | 307 | ||
| 307 | #define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */ | 308 | #define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */ |
diff --git a/include/asm-blackfin/mach-bf527/mem_init.h b/include/asm-blackfin/mach-bf527/mem_init.h index 008ca66719e2..cbe03f4a5698 100644 --- a/include/asm-blackfin/mach-bf527/mem_init.h +++ b/include/asm-blackfin/mach-bf527/mem_init.h | |||
| @@ -146,33 +146,6 @@ | |||
| 146 | #define SDRAM_CL CL_3 | 146 | #define SDRAM_CL CL_3 |
| 147 | #endif | 147 | #endif |
| 148 | 148 | ||
| 149 | #if (CONFIG_MEM_SIZE == 128) | ||
| 150 | #define SDRAM_SIZE EBSZ_128 | ||
| 151 | #endif | ||
| 152 | #if (CONFIG_MEM_SIZE == 64) | ||
| 153 | #define SDRAM_SIZE EBSZ_64 | ||
| 154 | #endif | ||
| 155 | #if (CONFIG_MEM_SIZE == 32) | ||
| 156 | #define SDRAM_SIZE EBSZ_32 | ||
| 157 | #endif | ||
| 158 | #if (CONFIG_MEM_SIZE == 16) | ||
| 159 | #define SDRAM_SIZE EBSZ_16 | ||
| 160 | #endif | ||
| 161 | #if (CONFIG_MEM_ADD_WIDTH == 11) | ||
| 162 | #define SDRAM_WIDTH EBCAW_11 | ||
| 163 | #endif | ||
| 164 | #if (CONFIG_MEM_ADD_WIDTH == 10) | ||
| 165 | #define SDRAM_WIDTH EBCAW_10 | ||
| 166 | #endif | ||
| 167 | #if (CONFIG_MEM_ADD_WIDTH == 9) | ||
| 168 | #define SDRAM_WIDTH EBCAW_9 | ||
| 169 | #endif | ||
| 170 | #if (CONFIG_MEM_ADD_WIDTH == 8) | ||
| 171 | #define SDRAM_WIDTH EBCAW_8 | ||
| 172 | #endif | ||
| 173 | |||
| 174 | #define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE) | ||
| 175 | |||
| 176 | /* Equation from section 17 (p17-46) of BF533 HRM */ | 149 | /* Equation from section 17 (p17-46) of BF533 HRM */ |
| 177 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) | 150 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) |
| 178 | 151 | ||
diff --git a/include/asm-blackfin/mach-bf533/bfin_sir.h b/include/asm-blackfin/mach-bf533/bfin_sir.h index cefcf8bb505b..9bb87e9e2e9b 100644 --- a/include/asm-blackfin/mach-bf533/bfin_sir.h +++ b/include/asm-blackfin/mach-bf533/bfin_sir.h | |||
| @@ -110,11 +110,16 @@ static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port) | |||
| 110 | 110 | ||
| 111 | #define DRIVER_NAME "bfin_sir" | 111 | #define DRIVER_NAME "bfin_sir" |
| 112 | 112 | ||
| 113 | static void bfin_sir_hw_init(void) | 113 | static int bfin_sir_hw_init(void) |
| 114 | { | 114 | { |
| 115 | int ret = -ENODEV; | ||
| 115 | #ifdef CONFIG_BFIN_SIR0 | 116 | #ifdef CONFIG_BFIN_SIR0 |
| 116 | peripheral_request(P_UART0_TX, DRIVER_NAME); | 117 | ret = peripheral_request(P_UART0_TX, DRIVER_NAME); |
| 117 | peripheral_request(P_UART0_RX, DRIVER_NAME); | 118 | if (ret) |
| 119 | return ret; | ||
| 120 | ret = peripheral_request(P_UART0_RX, DRIVER_NAME); | ||
| 121 | if (ret) | ||
| 122 | return ret; | ||
| 118 | #endif | 123 | #endif |
| 119 | SSYNC(); | 124 | return ret; |
| 120 | } | 125 | } |
diff --git a/include/asm-blackfin/mach-bf533/mem_init.h b/include/asm-blackfin/mach-bf533/mem_init.h index f8f31901fca9..995c06b2b1ef 100644 --- a/include/asm-blackfin/mach-bf533/mem_init.h +++ b/include/asm-blackfin/mach-bf533/mem_init.h | |||
| @@ -133,33 +133,6 @@ | |||
| 133 | #define SDRAM_CL CL_3 | 133 | #define SDRAM_CL CL_3 |
| 134 | #endif | 134 | #endif |
| 135 | 135 | ||
| 136 | #if (CONFIG_MEM_SIZE == 128) | ||
| 137 | #define SDRAM_SIZE EBSZ_128 | ||
| 138 | #endif | ||
| 139 | #if (CONFIG_MEM_SIZE == 64) | ||
| 140 | #define SDRAM_SIZE EBSZ_64 | ||
| 141 | #endif | ||
| 142 | #if (CONFIG_MEM_SIZE == 32) | ||
| 143 | #define SDRAM_SIZE EBSZ_32 | ||
| 144 | #endif | ||
| 145 | #if (CONFIG_MEM_SIZE == 16) | ||
| 146 | #define SDRAM_SIZE EBSZ_16 | ||
| 147 | #endif | ||
| 148 | #if (CONFIG_MEM_ADD_WIDTH == 11) | ||
| 149 | #define SDRAM_WIDTH EBCAW_11 | ||
| 150 | #endif | ||
| 151 | #if (CONFIG_MEM_ADD_WIDTH == 10) | ||
| 152 | #define SDRAM_WIDTH EBCAW_10 | ||
| 153 | #endif | ||
| 154 | #if (CONFIG_MEM_ADD_WIDTH == 9) | ||
| 155 | #define SDRAM_WIDTH EBCAW_9 | ||
| 156 | #endif | ||
| 157 | #if (CONFIG_MEM_ADD_WIDTH == 8) | ||
| 158 | #define SDRAM_WIDTH EBCAW_8 | ||
| 159 | #endif | ||
| 160 | |||
| 161 | #define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE) | ||
| 162 | |||
| 163 | /* Equation from section 17 (p17-46) of BF533 HRM */ | 136 | /* Equation from section 17 (p17-46) of BF533 HRM */ |
| 164 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) | 137 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) |
| 165 | 138 | ||
diff --git a/include/asm-blackfin/mach-bf537/bfin_sir.h b/include/asm-blackfin/mach-bf537/bfin_sir.h index 0612d0c9501c..cfd8ad4f1f2c 100644 --- a/include/asm-blackfin/mach-bf537/bfin_sir.h +++ b/include/asm-blackfin/mach-bf537/bfin_sir.h | |||
| @@ -118,16 +118,25 @@ static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port) | |||
| 118 | 118 | ||
| 119 | #define DRIVER_NAME "bfin_sir" | 119 | #define DRIVER_NAME "bfin_sir" |
| 120 | 120 | ||
| 121 | static void bfin_sir_hw_init(void) | 121 | static int bfin_sir_hw_init(void) |
| 122 | { | 122 | { |
| 123 | int ret = -ENODEV; | ||
| 123 | #ifdef CONFIG_BFIN_SIR0 | 124 | #ifdef CONFIG_BFIN_SIR0 |
| 124 | peripheral_request(P_UART0_TX, DRIVER_NAME); | 125 | ret = peripheral_request(P_UART0_TX, DRIVER_NAME); |
| 125 | peripheral_request(P_UART0_RX, DRIVER_NAME); | 126 | if (ret) |
| 127 | return ret; | ||
| 128 | ret = peripheral_request(P_UART0_RX, DRIVER_NAME); | ||
| 129 | if (ret) | ||
| 130 | return ret; | ||
| 126 | #endif | 131 | #endif |
| 127 | 132 | ||
| 128 | #ifdef CONFIG_BFIN_SIR1 | 133 | #ifdef CONFIG_BFIN_SIR1 |
| 129 | peripheral_request(P_UART1_TX, DRIVER_NAME); | 134 | ret = peripheral_request(P_UART1_TX, DRIVER_NAME); |
| 130 | peripheral_request(P_UART1_RX, DRIVER_NAME); | 135 | if (ret) |
| 136 | return ret; | ||
| 137 | ret = peripheral_request(P_UART1_RX, DRIVER_NAME); | ||
| 138 | if (ret) | ||
| 139 | return ret; | ||
| 131 | #endif | 140 | #endif |
| 132 | SSYNC(); | 141 | return ret; |
| 133 | } | 142 | } |
diff --git a/include/asm-blackfin/mach-bf537/defBF537.h b/include/asm-blackfin/mach-bf537/defBF537.h index 3f455909c418..abde24c6d3b1 100644 --- a/include/asm-blackfin/mach-bf537/defBF537.h +++ b/include/asm-blackfin/mach-bf537/defBF537.h | |||
| @@ -290,6 +290,7 @@ | |||
| 290 | #define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */ | 290 | #define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */ |
| 291 | #define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */ | 291 | #define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */ |
| 292 | #define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */ | 292 | #define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */ |
| 293 | #define TXDWA 0x00000010 /* Transmit Frame DMA Word Alignment (Odd/Even*) */ | ||
| 293 | #define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */ | 294 | #define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */ |
| 294 | 295 | ||
| 295 | #define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */ | 296 | #define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */ |
diff --git a/include/asm-blackfin/mach-bf537/mem_init.h b/include/asm-blackfin/mach-bf537/mem_init.h index 9ad979d416c6..f67698f670ca 100644 --- a/include/asm-blackfin/mach-bf537/mem_init.h +++ b/include/asm-blackfin/mach-bf537/mem_init.h | |||
| @@ -139,33 +139,6 @@ | |||
| 139 | #define SDRAM_CL CL_3 | 139 | #define SDRAM_CL CL_3 |
| 140 | #endif | 140 | #endif |
| 141 | 141 | ||
| 142 | #if (CONFIG_MEM_SIZE == 128) | ||
| 143 | #define SDRAM_SIZE EBSZ_128 | ||
| 144 | #endif | ||
| 145 | #if (CONFIG_MEM_SIZE == 64) | ||
| 146 | #define SDRAM_SIZE EBSZ_64 | ||
| 147 | #endif | ||
| 148 | #if (CONFIG_MEM_SIZE == 32) | ||
| 149 | #define SDRAM_SIZE EBSZ_32 | ||
| 150 | #endif | ||
| 151 | #if (CONFIG_MEM_SIZE == 16) | ||
| 152 | #define SDRAM_SIZE EBSZ_16 | ||
| 153 | #endif | ||
| 154 | #if (CONFIG_MEM_ADD_WIDTH == 11) | ||
| 155 | #define SDRAM_WIDTH EBCAW_11 | ||
| 156 | #endif | ||
| 157 | #if (CONFIG_MEM_ADD_WIDTH == 10) | ||
| 158 | #define SDRAM_WIDTH EBCAW_10 | ||
| 159 | #endif | ||
| 160 | #if (CONFIG_MEM_ADD_WIDTH == 9) | ||
| 161 | #define SDRAM_WIDTH EBCAW_9 | ||
| 162 | #endif | ||
| 163 | #if (CONFIG_MEM_ADD_WIDTH == 8) | ||
| 164 | #define SDRAM_WIDTH EBCAW_8 | ||
| 165 | #endif | ||
| 166 | |||
| 167 | #define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE) | ||
| 168 | |||
| 169 | /* Equation from section 17 (p17-46) of BF533 HRM */ | 142 | /* Equation from section 17 (p17-46) of BF533 HRM */ |
| 170 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) | 143 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) |
| 171 | 144 | ||
diff --git a/include/asm-blackfin/mach-bf548/bfin_sir.h b/include/asm-blackfin/mach-bf548/bfin_sir.h index 5e94271c7e3b..c41f9cf00268 100644 --- a/include/asm-blackfin/mach-bf548/bfin_sir.h +++ b/include/asm-blackfin/mach-bf548/bfin_sir.h | |||
| @@ -124,26 +124,43 @@ struct bfin_sir_self { | |||
| 124 | 124 | ||
| 125 | #define DRIVER_NAME "bfin_sir" | 125 | #define DRIVER_NAME "bfin_sir" |
| 126 | 126 | ||
| 127 | static void bfin_sir_hw_init(void) | 127 | static int bfin_sir_hw_init(void) |
| 128 | { | 128 | { |
| 129 | int ret = -ENODEV; | ||
| 129 | #ifdef CONFIG_BFIN_SIR0 | 130 | #ifdef CONFIG_BFIN_SIR0 |
| 130 | peripheral_request(P_UART0_TX, DRIVER_NAME); | 131 | ret = peripheral_request(P_UART0_TX, DRIVER_NAME); |
| 131 | peripheral_request(P_UART0_RX, DRIVER_NAME); | 132 | if (ret) |
| 133 | return ret; | ||
| 134 | ret = peripheral_request(P_UART0_RX, DRIVER_NAME); | ||
| 135 | if (ret) | ||
| 136 | return ret; | ||
| 132 | #endif | 137 | #endif |
| 133 | 138 | ||
| 134 | #ifdef CONFIG_BFIN_SIR1 | 139 | #ifdef CONFIG_BFIN_SIR1 |
| 135 | peripheral_request(P_UART1_TX, DRIVER_NAME); | 140 | ret = peripheral_request(P_UART1_TX, DRIVER_NAME); |
| 136 | peripheral_request(P_UART1_RX, DRIVER_NAME); | 141 | if (ret) |
| 142 | return ret; | ||
| 143 | ret = peripheral_request(P_UART1_RX, DRIVER_NAME); | ||
| 144 | if (ret) | ||
| 145 | return ret; | ||
| 137 | #endif | 146 | #endif |
| 138 | 147 | ||
| 139 | #ifdef CONFIG_BFIN_SIR2 | 148 | #ifdef CONFIG_BFIN_SIR2 |
| 140 | peripheral_request(P_UART2_TX, DRIVER_NAME); | 149 | ret = peripheral_request(P_UART2_TX, DRIVER_NAME); |
| 141 | peripheral_request(P_UART2_RX, DRIVER_NAME); | 150 | if (ret) |
| 151 | return ret; | ||
| 152 | ret = peripheral_request(P_UART2_RX, DRIVER_NAME); | ||
| 153 | if (ret) | ||
| 154 | return ret; | ||
| 142 | #endif | 155 | #endif |
| 143 | 156 | ||
| 144 | #ifdef CONFIG_BFIN_SIR3 | 157 | #ifdef CONFIG_BFIN_SIR3 |
| 145 | peripheral_request(P_UART3_TX, DRIVER_NAME); | 158 | ret = peripheral_request(P_UART3_TX, DRIVER_NAME); |
| 146 | peripheral_request(P_UART3_RX, DRIVER_NAME); | 159 | if (ret) |
| 160 | return ret; | ||
| 161 | ret = peripheral_request(P_UART3_RX, DRIVER_NAME); | ||
| 162 | if (ret) | ||
| 163 | return ret; | ||
| 147 | #endif | 164 | #endif |
| 148 | SSYNC(); | 165 | return ret; |
| 149 | } | 166 | } |
diff --git a/include/asm-blackfin/mach-bf548/gpio.h b/include/asm-blackfin/mach-bf548/gpio.h index cb8b0f15c9a6..bba82dc75f16 100644 --- a/include/asm-blackfin/mach-bf548/gpio.h +++ b/include/asm-blackfin/mach-bf548/gpio.h | |||
| @@ -209,3 +209,11 @@ struct gpio_port_t { | |||
| 209 | unsigned short dummy7; | 209 | unsigned short dummy7; |
| 210 | unsigned int port_mux; | 210 | unsigned int port_mux; |
| 211 | }; | 211 | }; |
| 212 | |||
| 213 | struct gpio_port_s { | ||
| 214 | unsigned short fer; | ||
| 215 | unsigned short data; | ||
| 216 | unsigned short dir; | ||
| 217 | unsigned short inen; | ||
| 218 | unsigned int mux; | ||
| 219 | }; | ||
diff --git a/include/asm-blackfin/mach-bf561/bfin_sir.h b/include/asm-blackfin/mach-bf561/bfin_sir.h index cefcf8bb505b..9bb87e9e2e9b 100644 --- a/include/asm-blackfin/mach-bf561/bfin_sir.h +++ b/include/asm-blackfin/mach-bf561/bfin_sir.h | |||
| @@ -110,11 +110,16 @@ static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port) | |||
| 110 | 110 | ||
| 111 | #define DRIVER_NAME "bfin_sir" | 111 | #define DRIVER_NAME "bfin_sir" |
| 112 | 112 | ||
| 113 | static void bfin_sir_hw_init(void) | 113 | static int bfin_sir_hw_init(void) |
| 114 | { | 114 | { |
| 115 | int ret = -ENODEV; | ||
| 115 | #ifdef CONFIG_BFIN_SIR0 | 116 | #ifdef CONFIG_BFIN_SIR0 |
| 116 | peripheral_request(P_UART0_TX, DRIVER_NAME); | 117 | ret = peripheral_request(P_UART0_TX, DRIVER_NAME); |
| 117 | peripheral_request(P_UART0_RX, DRIVER_NAME); | 118 | if (ret) |
| 119 | return ret; | ||
| 120 | ret = peripheral_request(P_UART0_RX, DRIVER_NAME); | ||
| 121 | if (ret) | ||
| 122 | return ret; | ||
| 118 | #endif | 123 | #endif |
| 119 | SSYNC(); | 124 | return ret; |
| 120 | } | 125 | } |
diff --git a/include/asm-blackfin/mach-bf561/mem_init.h b/include/asm-blackfin/mach-bf561/mem_init.h index 439a5895b346..e163260bca18 100644 --- a/include/asm-blackfin/mach-bf561/mem_init.h +++ b/include/asm-blackfin/mach-bf561/mem_init.h | |||
| @@ -131,33 +131,6 @@ | |||
| 131 | #define SDRAM_CL CL_3 | 131 | #define SDRAM_CL CL_3 |
| 132 | #endif | 132 | #endif |
| 133 | 133 | ||
| 134 | #if (CONFIG_MEM_SIZE == 128) | ||
| 135 | #define SDRAM_SIZE EB0_SZ_128 | ||
| 136 | #endif | ||
| 137 | #if (CONFIG_MEM_SIZE == 64) | ||
| 138 | #define SDRAM_SIZE EB0_SZ_64 | ||
| 139 | #endif | ||
| 140 | #if ( CONFIG_MEM_SIZE == 32) | ||
| 141 | #define SDRAM_SIZE EB0_SZ_32 | ||
| 142 | #endif | ||
| 143 | #if (CONFIG_MEM_SIZE == 16) | ||
| 144 | #define SDRAM_SIZE EB0_SZ_16 | ||
| 145 | #endif | ||
| 146 | #if (CONFIG_MEM_ADD_WIDTH == 11) | ||
| 147 | #define SDRAM_WIDTH EB0_CAW_11 | ||
| 148 | #endif | ||
| 149 | #if (CONFIG_MEM_ADD_WIDTH == 10) | ||
| 150 | #define SDRAM_WIDTH EB0_CAW_10 | ||
| 151 | #endif | ||
| 152 | #if (CONFIG_MEM_ADD_WIDTH == 9) | ||
| 153 | #define SDRAM_WIDTH EB0_CAW_9 | ||
| 154 | #endif | ||
| 155 | #if (CONFIG_MEM_ADD_WIDTH == 8) | ||
| 156 | #define SDRAM_WIDTH EB0_CAW_8 | ||
| 157 | #endif | ||
| 158 | |||
| 159 | #define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EB0_E) | ||
| 160 | |||
| 161 | /* Equation from section 17 (p17-46) of BF533 HRM */ | 134 | /* Equation from section 17 (p17-46) of BF533 HRM */ |
| 162 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) | 135 | #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) |
| 163 | 136 | ||
diff --git a/include/asm-blackfin/module.h b/include/asm-blackfin/module.h index 3c7ce1644280..e3128df139d6 100644 --- a/include/asm-blackfin/module.h +++ b/include/asm-blackfin/module.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | #define Elf_Shdr Elf32_Shdr | 6 | #define Elf_Shdr Elf32_Shdr |
| 7 | #define Elf_Sym Elf32_Sym | 7 | #define Elf_Sym Elf32_Sym |
| 8 | #define Elf_Ehdr Elf32_Ehdr | 8 | #define Elf_Ehdr Elf32_Ehdr |
| 9 | #define FLG_CODE_IN_L1 0x10 | ||
| 10 | #define FLG_DATA_IN_L1 0x20 | ||
| 11 | 9 | ||
| 12 | struct mod_arch_specific { | 10 | struct mod_arch_specific { |
| 13 | Elf_Shdr *text_l1; | 11 | Elf_Shdr *text_l1; |
| @@ -15,5 +13,8 @@ struct mod_arch_specific { | |||
| 15 | Elf_Shdr *bss_a_l1; | 13 | Elf_Shdr *bss_a_l1; |
| 16 | Elf_Shdr *data_b_l1; | 14 | Elf_Shdr *data_b_l1; |
| 17 | Elf_Shdr *bss_b_l1; | 15 | Elf_Shdr *bss_b_l1; |
| 16 | Elf_Shdr *text_l2; | ||
| 17 | Elf_Shdr *data_l2; | ||
| 18 | Elf_Shdr *bss_l2; | ||
| 18 | }; | 19 | }; |
| 19 | #endif /* _ASM_BFIN_MODULE_H */ | 20 | #endif /* _ASM_BFIN_MODULE_H */ |
diff --git a/include/asm-blackfin/namei.h b/include/asm-blackfin/namei.h deleted file mode 100644 index 8b89a2d65cb4..000000000000 --- a/include/asm-blackfin/namei.h +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | * | ||
| 6 | * Changes made by Lineo Inc. May 2001 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __BFIN_NAMEI_H | ||
| 10 | #define __BFIN_NAMEI_H | ||
| 11 | |||
| 12 | /* This dummy routine maybe changed to something useful | ||
| 13 | * for /usr/gnemul/ emulation stuff. | ||
| 14 | * Look at asm-sparc/namei.h for details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #define __emul_prefix() NULL | ||
| 18 | |||
| 19 | #endif | ||
diff --git a/include/asm-blackfin/page.h b/include/asm-blackfin/page.h index c7db0220fbd6..344f6a8c1f22 100644 --- a/include/asm-blackfin/page.h +++ b/include/asm-blackfin/page.h | |||
| @@ -51,9 +51,6 @@ typedef struct page *pgtable_t; | |||
| 51 | #define __pgd(x) ((pgd_t) { (x) } ) | 51 | #define __pgd(x) ((pgd_t) { (x) } ) |
| 52 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 52 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
| 53 | 53 | ||
| 54 | /* to align the pointer to the (next) page boundary */ | ||
| 55 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 56 | |||
| 57 | extern unsigned long memory_start; | 54 | extern unsigned long memory_start; |
| 58 | extern unsigned long memory_end; | 55 | extern unsigned long memory_end; |
| 59 | 56 | ||
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h index 1c0040724612..6f3995b119d8 100644 --- a/include/asm-blackfin/processor.h +++ b/include/asm-blackfin/processor.h | |||
| @@ -112,7 +112,26 @@ unsigned long get_wchan(struct task_struct *p); | |||
| 112 | static inline uint32_t __pure bfin_revid(void) | 112 | static inline uint32_t __pure bfin_revid(void) |
| 113 | { | 113 | { |
| 114 | /* stored in the upper 4 bits */ | 114 | /* stored in the upper 4 bits */ |
| 115 | return bfin_read_CHIPID() >> 28; | 115 | uint32_t revid = bfin_read_CHIPID() >> 28; |
| 116 | |||
| 117 | #ifdef CONFIG_BF52x | ||
| 118 | /* ANOMALY_05000357 | ||
| 119 | * Incorrect Revision Number in DSPID Register | ||
| 120 | */ | ||
| 121 | if (revid == 0) | ||
| 122 | switch (bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI)) { | ||
| 123 | case 0x0010: | ||
| 124 | revid = 0; | ||
| 125 | break; | ||
| 126 | case 0x2796: | ||
| 127 | revid = 1; | ||
| 128 | break; | ||
| 129 | default: | ||
| 130 | revid = 0xFFFF; | ||
| 131 | break; | ||
| 132 | } | ||
| 133 | #endif | ||
| 134 | return revid; | ||
| 116 | } | 135 | } |
| 117 | 136 | ||
| 118 | static inline uint32_t __pure bfin_compiled_revid(void) | 137 | static inline uint32_t __pure bfin_compiled_revid(void) |
diff --git a/include/asm-blackfin/ptrace.h b/include/asm-blackfin/ptrace.h index b8346cd3a6f6..a45a80e54adc 100644 --- a/include/asm-blackfin/ptrace.h +++ b/include/asm-blackfin/ptrace.h | |||
| @@ -83,14 +83,14 @@ struct pt_regs { | |||
| 83 | #define PTRACE_GETREGS 12 | 83 | #define PTRACE_GETREGS 12 |
| 84 | #define PTRACE_SETREGS 13 /* ptrace signal */ | 84 | #define PTRACE_SETREGS 13 /* ptrace signal */ |
| 85 | 85 | ||
| 86 | #ifdef CONFIG_BINFMT_ELF_FDPIC | ||
| 87 | #define PTRACE_GETFDPIC 31 | 86 | #define PTRACE_GETFDPIC 31 |
| 88 | #define PTRACE_GETFDPIC_EXEC 0 | 87 | #define PTRACE_GETFDPIC_EXEC 0 |
| 89 | #define PTRACE_GETFDPIC_INTERP 1 | 88 | #define PTRACE_GETFDPIC_INTERP 1 |
| 90 | #endif | ||
| 91 | 89 | ||
| 92 | #define PS_S (0x0002) | 90 | #define PS_S (0x0002) |
| 93 | 91 | ||
| 92 | #ifdef __KERNEL__ | ||
| 93 | |||
| 94 | /* user_mode returns true if only one bit is set in IPEND, other than the | 94 | /* user_mode returns true if only one bit is set in IPEND, other than the |
| 95 | master interrupt enable. */ | 95 | master interrupt enable. */ |
| 96 | #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1))) | 96 | #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1))) |
| @@ -98,6 +98,8 @@ struct pt_regs { | |||
| 98 | #define profile_pc(regs) instruction_pointer(regs) | 98 | #define profile_pc(regs) instruction_pointer(regs) |
| 99 | extern void show_regs(struct pt_regs *); | 99 | extern void show_regs(struct pt_regs *); |
| 100 | 100 | ||
| 101 | #endif /* __KERNEL__ */ | ||
| 102 | |||
| 101 | #endif /* __ASSEMBLY__ */ | 103 | #endif /* __ASSEMBLY__ */ |
| 102 | 104 | ||
| 103 | /* | 105 | /* |
diff --git a/include/asm-blackfin/semaphore.h b/include/asm-blackfin/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-blackfin/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-blackfin/thread_info.h b/include/asm-blackfin/thread_info.h index bc2fe5accf20..642769329d12 100644 --- a/include/asm-blackfin/thread_info.h +++ b/include/asm-blackfin/thread_info.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | /* | 42 | /* |
| 43 | * Size of kernel stack for each process. This must be a power of 2... | 43 | * Size of kernel stack for each process. This must be a power of 2... |
| 44 | */ | 44 | */ |
| 45 | #define THREAD_SIZE_ORDER 1 | ||
| 45 | #define THREAD_SIZE 8192 /* 2 pages */ | 46 | #define THREAD_SIZE 8192 /* 2 pages */ |
| 46 | 47 | ||
| 47 | #ifndef __ASSEMBLY__ | 48 | #ifndef __ASSEMBLY__ |
| @@ -94,10 +95,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 94 | return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1)); | 95 | return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1)); |
| 95 | } | 96 | } |
| 96 | 97 | ||
| 97 | /* thread information allocation */ | ||
| 98 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
| 99 | __get_free_pages(GFP_KERNEL, 1)) | ||
| 100 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | ||
| 101 | #endif /* __ASSEMBLY__ */ | 98 | #endif /* __ASSEMBLY__ */ |
| 102 | 99 | ||
| 103 | /* | 100 | /* |
diff --git a/include/asm-cris/arch-v10/Kbuild b/include/asm-cris/arch-v10/Kbuild index 60e7e1b73cec..7a192e1290b1 100644 --- a/include/asm-cris/arch-v10/Kbuild +++ b/include/asm-cris/arch-v10/Kbuild | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | header-y += ptrace.h | ||
| 2 | header-y += user.h | 1 | header-y += user.h |
| 3 | header-y += svinto.h | 2 | header-y += svinto.h |
| 4 | header-y += sv_addr_ag.h | 3 | header-y += sv_addr_ag.h |
diff --git a/include/asm-cris/arch-v10/ide.h b/include/asm-cris/arch-v10/ide.h deleted file mode 100644 index 5366e6239328..000000000000 --- a/include/asm-cris/arch-v10/ide.h +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-cris/ide.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2000, 2001, 2002 Axis Communications AB | ||
| 5 | * | ||
| 6 | * Authors: Bjorn Wesen | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | /* | ||
| 11 | * This file contains the ETRAX 100LX specific IDE code. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __ASMCRIS_IDE_H | ||
| 15 | #define __ASMCRIS_IDE_H | ||
| 16 | |||
| 17 | #ifdef __KERNEL__ | ||
| 18 | |||
| 19 | #include <asm/arch/svinto.h> | ||
| 20 | #include <asm/io.h> | ||
| 21 | #include <asm-generic/ide_iops.h> | ||
| 22 | |||
| 23 | |||
| 24 | /* ETRAX 100 can support 4 IDE busses on the same pins (serialized) */ | ||
| 25 | |||
| 26 | #define MAX_HWIFS 4 | ||
| 27 | |||
| 28 | static inline int ide_default_irq(unsigned long base) | ||
| 29 | { | ||
| 30 | /* all IDE busses share the same IRQ, number 4. | ||
| 31 | * this has the side-effect that ide-probe.c will cluster our 4 interfaces | ||
| 32 | * together in a hwgroup, and will serialize accesses. this is good, because | ||
| 33 | * we can't access more than one interface at the same time on ETRAX100. | ||
| 34 | */ | ||
| 35 | return 4; | ||
| 36 | } | ||
| 37 | |||
| 38 | static inline unsigned long ide_default_io_base(int index) | ||
| 39 | { | ||
| 40 | /* we have no real I/O base address per interface, since all go through the | ||
| 41 | * same register. but in a bitfield in that register, we have the i/f number. | ||
| 42 | * so we can use the io_base to remember that bitfield. | ||
| 43 | */ | ||
| 44 | static const unsigned long io_bases[MAX_HWIFS] = { | ||
| 45 | IO_FIELD(R_ATA_CTRL_DATA, sel, 0), | ||
| 46 | IO_FIELD(R_ATA_CTRL_DATA, sel, 1), | ||
| 47 | IO_FIELD(R_ATA_CTRL_DATA, sel, 2), | ||
| 48 | IO_FIELD(R_ATA_CTRL_DATA, sel, 3) | ||
| 49 | }; | ||
| 50 | return io_bases[index]; | ||
| 51 | } | ||
| 52 | |||
| 53 | /* this is called once for each interface, to setup the port addresses. data_port is the result | ||
| 54 | * of the ide_default_io_base call above. ctrl_port will be 0, but that is don't care for us. | ||
| 55 | */ | ||
| 56 | |||
| 57 | static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, unsigned long ctrl_port, int *irq) | ||
| 58 | { | ||
| 59 | int i; | ||
| 60 | |||
| 61 | /* fill in ports for ATA addresses 0 to 7 */ | ||
| 62 | for (i = 0; i <= 7; i++) { | ||
| 63 | hw->io_ports_array[i] = data_port | | ||
| 64 | IO_FIELD(R_ATA_CTRL_DATA, addr, i) | | ||
| 65 | IO_STATE(R_ATA_CTRL_DATA, cs0, active); | ||
| 66 | } | ||
| 67 | |||
| 68 | /* the IDE control register is at ATA address 6, with CS1 active instead of CS0 */ | ||
| 69 | hw->io_ports.ctl_addr = data_port | | ||
| 70 | IO_FIELD(R_ATA_CTRL_DATA, addr, 6) | | ||
| 71 | IO_STATE(R_ATA_CTRL_DATA, cs1, active); | ||
| 72 | |||
| 73 | /* whats this for ? */ | ||
| 74 | hw->io_ports.irq_addr = 0; | ||
| 75 | } | ||
| 76 | |||
| 77 | static inline void ide_init_default_hwifs(void) | ||
| 78 | { | ||
| 79 | hw_regs_t hw; | ||
| 80 | int index; | ||
| 81 | |||
| 82 | for(index = 0; index < MAX_HWIFS; index++) { | ||
| 83 | ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL); | ||
| 84 | hw.irq = ide_default_irq(ide_default_io_base(index)); | ||
| 85 | ide_register_hw(&hw, NULL); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | #endif /* __KERNEL__ */ | ||
| 90 | |||
| 91 | #endif /* __ASMCRIS_IDE_H */ | ||
diff --git a/include/asm-cris/arch-v10/ptrace.h b/include/asm-cris/arch-v10/ptrace.h index fb14c5ee37f9..2f464eab3a51 100644 --- a/include/asm-cris/arch-v10/ptrace.h +++ b/include/asm-cris/arch-v10/ptrace.h | |||
| @@ -106,10 +106,14 @@ struct switch_stack { | |||
| 106 | unsigned long return_ip; /* ip that _resume will return to */ | 106 | unsigned long return_ip; /* ip that _resume will return to */ |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | #ifdef __KERNEL__ | ||
| 110 | |||
| 109 | /* bit 8 is user-mode flag */ | 111 | /* bit 8 is user-mode flag */ |
| 110 | #define user_mode(regs) (((regs)->dccr & 0x100) != 0) | 112 | #define user_mode(regs) (((regs)->dccr & 0x100) != 0) |
| 111 | #define instruction_pointer(regs) ((regs)->irp) | 113 | #define instruction_pointer(regs) ((regs)->irp) |
| 112 | #define profile_pc(regs) instruction_pointer(regs) | 114 | #define profile_pc(regs) instruction_pointer(regs) |
| 113 | extern void show_regs(struct pt_regs *); | 115 | extern void show_regs(struct pt_regs *); |
| 114 | 116 | ||
| 117 | #endif /* __KERNEL__ */ | ||
| 118 | |||
| 115 | #endif | 119 | #endif |
diff --git a/include/asm-cris/arch-v32/Kbuild b/include/asm-cris/arch-v32/Kbuild index a0ec545e242e..35f2fc4f993e 100644 --- a/include/asm-cris/arch-v32/Kbuild +++ b/include/asm-cris/arch-v32/Kbuild | |||
| @@ -1,3 +1,2 @@ | |||
| 1 | header-y += ptrace.h | ||
| 2 | header-y += user.h | 1 | header-y += user.h |
| 3 | header-y += cryptocop.h | 2 | header-y += cryptocop.h |
diff --git a/include/asm-cris/arch-v32/ide.h b/include/asm-cris/arch-v32/ide.h deleted file mode 100644 index fb9c3627a5b4..000000000000 --- a/include/asm-cris/arch-v32/ide.h +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-cris/ide.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2000-2004 Axis Communications AB | ||
| 5 | * | ||
| 6 | * Authors: Bjorn Wesen, Mikael Starvik | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | /* | ||
| 11 | * This file contains the ETRAX FS specific IDE code. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __ASMCRIS_IDE_H | ||
| 15 | #define __ASMCRIS_IDE_H | ||
| 16 | |||
| 17 | #ifdef __KERNEL__ | ||
| 18 | |||
| 19 | #include <asm/arch/hwregs/intr_vect.h> | ||
| 20 | #include <asm/arch/hwregs/ata_defs.h> | ||
| 21 | #include <asm/io.h> | ||
| 22 | #include <asm-generic/ide_iops.h> | ||
| 23 | |||
| 24 | |||
| 25 | /* ETRAX FS can support 4 IDE busses on the same pins (serialized) */ | ||
| 26 | |||
| 27 | #define MAX_HWIFS 4 | ||
| 28 | |||
| 29 | static inline int ide_default_irq(unsigned long base) | ||
| 30 | { | ||
| 31 | /* all IDE busses share the same IRQ, | ||
| 32 | * this has the side-effect that ide-probe.c will cluster our 4 interfaces | ||
| 33 | * together in a hwgroup, and will serialize accesses. this is good, because | ||
| 34 | * we can't access more than one interface at the same time on ETRAX100. | ||
| 35 | */ | ||
| 36 | return ATA_INTR_VECT; | ||
| 37 | } | ||
| 38 | |||
| 39 | static inline unsigned long ide_default_io_base(int index) | ||
| 40 | { | ||
| 41 | reg_ata_rw_ctrl2 ctrl2 = {.sel = index}; | ||
| 42 | /* we have no real I/O base address per interface, since all go through the | ||
| 43 | * same register. but in a bitfield in that register, we have the i/f number. | ||
| 44 | * so we can use the io_base to remember that bitfield. | ||
| 45 | */ | ||
| 46 | ctrl2.sel = index; | ||
| 47 | |||
| 48 | return REG_TYPE_CONV(unsigned long, reg_ata_rw_ctrl2, ctrl2); | ||
| 49 | } | ||
| 50 | |||
| 51 | #define IDE_ARCH_ACK_INTR | ||
| 52 | #define ide_ack_intr(hwif) ((hwif)->ack_intr(hwif)) | ||
| 53 | |||
| 54 | #endif /* __KERNEL__ */ | ||
| 55 | |||
| 56 | #endif /* __ASMCRIS_IDE_H */ | ||
diff --git a/include/asm-cris/arch-v32/ptrace.h b/include/asm-cris/arch-v32/ptrace.h index 516cc7062d94..41f4e8662bc2 100644 --- a/include/asm-cris/arch-v32/ptrace.h +++ b/include/asm-cris/arch-v32/ptrace.h | |||
| @@ -106,9 +106,13 @@ struct switch_stack { | |||
| 106 | unsigned long return_ip; /* ip that _resume will return to */ | 106 | unsigned long return_ip; /* ip that _resume will return to */ |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | #ifdef __KERNEL__ | ||
| 110 | |||
| 109 | #define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0) | 111 | #define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0) |
| 110 | #define instruction_pointer(regs) ((regs)->erp) | 112 | #define instruction_pointer(regs) ((regs)->erp) |
| 111 | extern void show_regs(struct pt_regs *); | 113 | extern void show_regs(struct pt_regs *); |
| 112 | #define profile_pc(regs) instruction_pointer(regs) | 114 | #define profile_pc(regs) instruction_pointer(regs) |
| 113 | 115 | ||
| 116 | #endif /* __KERNEL__ */ | ||
| 117 | |||
| 114 | #endif | 118 | #endif |
diff --git a/include/asm-cris/cacheflush.h b/include/asm-cris/cacheflush.h index 01af2de27c5b..cf60e3f69f8d 100644 --- a/include/asm-cris/cacheflush.h +++ b/include/asm-cris/cacheflush.h | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 26 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
| 27 | memcpy(dst, src, len) | 27 | memcpy(dst, src, len) |
| 28 | 28 | ||
| 29 | void global_flush_tlb(void); | ||
| 30 | int change_page_attr(struct page *page, int numpages, pgprot_t prot); | 29 | int change_page_attr(struct page *page, int numpages, pgprot_t prot); |
| 31 | 30 | ||
| 32 | #endif /* _CRIS_CACHEFLUSH_H */ | 31 | #endif /* _CRIS_CACHEFLUSH_H */ |
diff --git a/include/asm-cris/dma-mapping.h b/include/asm-cris/dma-mapping.h index edc8d1bfaae2..cb2fb25ff8d9 100644 --- a/include/asm-cris/dma-mapping.h +++ b/include/asm-cris/dma-mapping.h | |||
| @@ -120,7 +120,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, | |||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | static inline int | 122 | static inline int |
| 123 | dma_mapping_error(dma_addr_t dma_addr) | 123 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 124 | { | 124 | { |
| 125 | return 0; | 125 | return 0; |
| 126 | } | 126 | } |
diff --git a/include/asm-cris/ide.h b/include/asm-cris/ide.h deleted file mode 100644 index a894f66665f8..000000000000 --- a/include/asm-cris/ide.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm/arch/ide.h> | ||
diff --git a/include/asm-cris/kvm.h b/include/asm-cris/kvm.h deleted file mode 100644 index c860f51149f0..000000000000 --- a/include/asm-cris/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_CRIS_H | ||
| 2 | #define __LINUX_KVM_CRIS_H | ||
| 3 | |||
| 4 | /* cris does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-cris/namei.h b/include/asm-cris/namei.h deleted file mode 100644 index 8a3be7a6d9f6..000000000000 --- a/include/asm-cris/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* $Id: namei.h,v 1.1 2000/07/10 16:32:31 bjornw Exp $ | ||
| 2 | * linux/include/asm-cris/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __CRIS_NAMEI_H | ||
| 8 | #define __CRIS_NAMEI_H | ||
| 9 | |||
| 10 | /* used to find file-system prefixes for doing emulations | ||
| 11 | * see for example asm-sparc/namei.h | ||
| 12 | * we don't use it... | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif /* __CRIS_NAMEI_H */ | ||
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h index c45bb1ef397c..d19272ba6b69 100644 --- a/include/asm-cris/page.h +++ b/include/asm-cris/page.h | |||
| @@ -60,9 +60,6 @@ typedef struct page *pgtable_t; | |||
| 60 | 60 | ||
| 61 | #define page_to_phys(page) __pa((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) | 61 | #define page_to_phys(page) __pa((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) |
| 62 | 62 | ||
| 63 | /* to align the pointer to the (next) page boundary */ | ||
| 64 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 65 | |||
| 66 | #ifndef __ASSEMBLY__ | 63 | #ifndef __ASSEMBLY__ |
| 67 | 64 | ||
| 68 | #endif /* __ASSEMBLY__ */ | 65 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-cris/ptrace.h b/include/asm-cris/ptrace.h index 1ec69a7ea836..d910925e3174 100644 --- a/include/asm-cris/ptrace.h +++ b/include/asm-cris/ptrace.h | |||
| @@ -4,11 +4,13 @@ | |||
| 4 | #include <asm/arch/ptrace.h> | 4 | #include <asm/arch/ptrace.h> |
| 5 | 5 | ||
| 6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 7 | |||
| 7 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | 8 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
| 8 | #define PTRACE_GETREGS 12 | 9 | #define PTRACE_GETREGS 12 |
| 9 | #define PTRACE_SETREGS 13 | 10 | #define PTRACE_SETREGS 13 |
| 10 | #endif | ||
| 11 | 11 | ||
| 12 | #define profile_pc(regs) instruction_pointer(regs) | 12 | #define profile_pc(regs) instruction_pointer(regs) |
| 13 | 13 | ||
| 14 | #endif /* __KERNEL__ */ | ||
| 15 | |||
| 14 | #endif /* _CRIS_PTRACE_H */ | 16 | #endif /* _CRIS_PTRACE_H */ |
diff --git a/include/asm-cris/semaphore.h b/include/asm-cris/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-cris/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-cris/thread_info.h b/include/asm-cris/thread_info.h index 784668ab0fa2..7efe1000f99d 100644 --- a/include/asm-cris/thread_info.h +++ b/include/asm-cris/thread_info.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | 11 | ||
| 12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
| 13 | 13 | ||
| 14 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 15 | |||
| 14 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
| 15 | #include <asm/types.h> | 17 | #include <asm/types.h> |
| 16 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild index bc3f12c5b7e0..0f8956def738 100644 --- a/include/asm-frv/Kbuild +++ b/include/asm-frv/Kbuild | |||
| @@ -3,4 +3,3 @@ include include/asm-generic/Kbuild.asm | |||
| 3 | header-y += registers.h | 3 | header-y += registers.h |
| 4 | 4 | ||
| 5 | unifdef-y += termios.h | 5 | unifdef-y += termios.h |
| 6 | unifdef-y += ptrace.h | ||
diff --git a/include/asm-frv/dma-mapping.h b/include/asm-frv/dma-mapping.h index 2e8966ca030d..b2898877c07b 100644 --- a/include/asm-frv/dma-mapping.h +++ b/include/asm-frv/dma-mapping.h | |||
| @@ -126,7 +126,7 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nele | |||
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | static inline | 128 | static inline |
| 129 | int dma_mapping_error(dma_addr_t dma_addr) | 129 | int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 130 | { | 130 | { |
| 131 | return 0; | 131 | return 0; |
| 132 | } | 132 | } |
diff --git a/include/asm-frv/ide.h b/include/asm-frv/ide.h index 8c9a540d4344..7ebcc56a2229 100644 --- a/include/asm-frv/ide.h +++ b/include/asm-frv/ide.h | |||
| @@ -18,10 +18,6 @@ | |||
| 18 | #include <asm/io.h> | 18 | #include <asm/io.h> |
| 19 | #include <asm/irq.h> | 19 | #include <asm/irq.h> |
| 20 | 20 | ||
| 21 | #ifndef MAX_HWIFS | ||
| 22 | #define MAX_HWIFS 8 | ||
| 23 | #endif | ||
| 24 | |||
| 25 | /****************************************************************************/ | 21 | /****************************************************************************/ |
| 26 | /* | 22 | /* |
| 27 | * some bits needed for parts of the IDE subsystem to compile | 23 | * some bits needed for parts of the IDE subsystem to compile |
diff --git a/include/asm-frv/kvm.h b/include/asm-frv/kvm.h deleted file mode 100644 index 9c8a4f08d0a9..000000000000 --- a/include/asm-frv/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_FRV_H | ||
| 2 | #define __LINUX_KVM_FRV_H | ||
| 3 | |||
| 4 | /* frv does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-frv/namei.h b/include/asm-frv/namei.h deleted file mode 100644 index 4ea57171d951..000000000000 --- a/include/asm-frv/namei.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-frv/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __ASM_NAMEI_H | ||
| 8 | #define __ASM_NAMEI_H | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif | ||
| 18 | |||
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h index c2c1e89e747d..bd9c220094c7 100644 --- a/include/asm-frv/page.h +++ b/include/asm-frv/page.h | |||
| @@ -40,9 +40,6 @@ typedef struct page *pgtable_t; | |||
| 40 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 40 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
| 41 | #define PTE_MASK PAGE_MASK | 41 | #define PTE_MASK PAGE_MASK |
| 42 | 42 | ||
| 43 | /* to align the pointer to the (next) page boundary */ | ||
| 44 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | ||
| 45 | |||
| 46 | #define devmem_is_allowed(pfn) 1 | 43 | #define devmem_is_allowed(pfn) 1 |
| 47 | 44 | ||
| 48 | #define __pa(vaddr) virt_to_phys((void *) (unsigned long) (vaddr)) | 45 | #define __pa(vaddr) virt_to_phys((void *) (unsigned long) (vaddr)) |
diff --git a/include/asm-frv/semaphore.h b/include/asm-frv/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-frv/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h index 348b8f1df17e..b7ac6bf2844c 100644 --- a/include/asm-frv/thread_info.h +++ b/include/asm-frv/thread_info.h | |||
| @@ -82,6 +82,8 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
| 82 | 82 | ||
| 83 | #define current_thread_info() ({ __current_thread_info; }) | 83 | #define current_thread_info() ({ __current_thread_info; }) |
| 84 | 84 | ||
| 85 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 86 | |||
| 85 | /* thread information allocation */ | 87 | /* thread information allocation */ |
| 86 | #ifdef CONFIG_DEBUG_STACK_USAGE | 88 | #ifdef CONFIG_DEBUG_STACK_USAGE |
| 87 | #define alloc_thread_info(tsk) \ | 89 | #define alloc_thread_info(tsk) \ |
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index 7cd25b8e7c9a..1170dc60e638 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm | |||
| @@ -1,4 +1,6 @@ | |||
| 1 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | ||
| 1 | header-y += kvm.h | 2 | header-y += kvm.h |
| 3 | endif | ||
| 2 | 4 | ||
| 3 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 5 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) |
| 4 | unifdef-y += a.out.h | 6 | unifdef-y += a.out.h |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 2632328d8646..a3f738cffdb6 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
| @@ -34,9 +34,14 @@ struct bug_entry { | |||
| 34 | #ifndef __WARN | 34 | #ifndef __WARN |
| 35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
| 36 | extern void warn_on_slowpath(const char *file, const int line); | 36 | extern void warn_on_slowpath(const char *file, const int line); |
| 37 | extern void warn_slowpath(const char *file, const int line, | ||
| 38 | const char *fmt, ...) __attribute__((format(printf, 3, 4))); | ||
| 37 | #define WANT_WARN_ON_SLOWPATH | 39 | #define WANT_WARN_ON_SLOWPATH |
| 38 | #endif | 40 | #endif |
| 39 | #define __WARN() warn_on_slowpath(__FILE__, __LINE__) | 41 | #define __WARN() warn_on_slowpath(__FILE__, __LINE__) |
| 42 | #define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg) | ||
| 43 | #else | ||
| 44 | #define __WARN_printf(arg...) __WARN() | ||
| 40 | #endif | 45 | #endif |
| 41 | 46 | ||
| 42 | #ifndef WARN_ON | 47 | #ifndef WARN_ON |
| @@ -48,6 +53,15 @@ extern void warn_on_slowpath(const char *file, const int line); | |||
| 48 | }) | 53 | }) |
| 49 | #endif | 54 | #endif |
| 50 | 55 | ||
| 56 | #ifndef WARN | ||
| 57 | #define WARN(condition, format...) ({ \ | ||
| 58 | int __ret_warn_on = !!(condition); \ | ||
| 59 | if (unlikely(__ret_warn_on)) \ | ||
| 60 | __WARN_printf(format); \ | ||
| 61 | unlikely(__ret_warn_on); \ | ||
| 62 | }) | ||
| 63 | #endif | ||
| 64 | |||
| 51 | #else /* !CONFIG_BUG */ | 65 | #else /* !CONFIG_BUG */ |
| 52 | #ifndef HAVE_ARCH_BUG | 66 | #ifndef HAVE_ARCH_BUG |
| 53 | #define BUG() | 67 | #define BUG() |
| @@ -63,6 +77,14 @@ extern void warn_on_slowpath(const char *file, const int line); | |||
| 63 | unlikely(__ret_warn_on); \ | 77 | unlikely(__ret_warn_on); \ |
| 64 | }) | 78 | }) |
| 65 | #endif | 79 | #endif |
| 80 | |||
| 81 | #ifndef WARN | ||
| 82 | #define WARN(condition, format...) ({ \ | ||
| 83 | int __ret_warn_on = !!(condition); \ | ||
| 84 | unlikely(__ret_warn_on); \ | ||
| 85 | }) | ||
| 86 | #endif | ||
| 87 | |||
| 66 | #endif | 88 | #endif |
| 67 | 89 | ||
| 68 | #define WARN_ON_ONCE(condition) ({ \ | 90 | #define WARN_ON_ONCE(condition) ({ \ |
| @@ -75,6 +97,9 @@ extern void warn_on_slowpath(const char *file, const int line); | |||
| 75 | unlikely(__ret_warn_once); \ | 97 | unlikely(__ret_warn_once); \ |
| 76 | }) | 98 | }) |
| 77 | 99 | ||
| 100 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
| 101 | WARN_ON((condition) && __ratelimit(state)) | ||
| 102 | |||
| 78 | #ifdef CONFIG_SMP | 103 | #ifdef CONFIG_SMP |
| 79 | # define WARN_ON_SMP(x) WARN_ON(x) | 104 | # define WARN_ON_SMP(x) WARN_ON(x) |
| 80 | #else | 105 | #else |
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h index e2468f894d2a..82cd0cb1c3fe 100644 --- a/include/asm-generic/dma-mapping-broken.h +++ b/include/asm-generic/dma-mapping-broken.h | |||
| @@ -61,7 +61,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, | |||
| 61 | #define dma_sync_sg_for_device dma_sync_sg_for_cpu | 61 | #define dma_sync_sg_for_device dma_sync_sg_for_cpu |
| 62 | 62 | ||
| 63 | extern int | 63 | extern int |
| 64 | dma_mapping_error(dma_addr_t dma_addr); | 64 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr); |
| 65 | 65 | ||
| 66 | extern int | 66 | extern int |
| 67 | dma_supported(struct device *dev, u64 mask); | 67 | dma_supported(struct device *dev, u64 mask); |
diff --git a/include/asm-generic/dma-mapping.h b/include/asm-generic/dma-mapping.h index 783ab9944d70..189486c3f92e 100644 --- a/include/asm-generic/dma-mapping.h +++ b/include/asm-generic/dma-mapping.h | |||
| @@ -144,9 +144,9 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, | |||
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static inline int | 146 | static inline int |
| 147 | dma_mapping_error(dma_addr_t dma_addr) | 147 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 148 | { | 148 | { |
| 149 | return pci_dma_mapping_error(dma_addr); | 149 | return pci_dma_mapping_error(to_pci_dev(dev), dma_addr); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | 152 | ||
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 6be061d09da9..c764a8fcb058 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | #ifdef CONFIG_HAVE_GPIO_LIB | 6 | #ifdef CONFIG_GPIOLIB |
| 7 | 7 | ||
| 8 | #include <linux/compiler.h> | 8 | #include <linux/compiler.h> |
| 9 | 9 | ||
| @@ -13,7 +13,7 @@ | |||
| 13 | * | 13 | * |
| 14 | * While the GPIO programming interface defines valid GPIO numbers | 14 | * While the GPIO programming interface defines valid GPIO numbers |
| 15 | * to be in the range 0..MAX_INT, this library restricts them to the | 15 | * to be in the range 0..MAX_INT, this library restricts them to the |
| 16 | * smaller range 0..ARCH_NR_GPIOS. | 16 | * smaller range 0..ARCH_NR_GPIOS-1. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #ifndef ARCH_NR_GPIOS | 19 | #ifndef ARCH_NR_GPIOS |
| @@ -32,6 +32,8 @@ struct module; | |||
| 32 | /** | 32 | /** |
| 33 | * struct gpio_chip - abstract a GPIO controller | 33 | * struct gpio_chip - abstract a GPIO controller |
| 34 | * @label: for diagnostics | 34 | * @label: for diagnostics |
| 35 | * @dev: optional device providing the GPIOs | ||
| 36 | * @owner: helps prevent removal of modules exporting active GPIOs | ||
| 35 | * @direction_input: configures signal "offset" as input, or returns error | 37 | * @direction_input: configures signal "offset" as input, or returns error |
| 36 | * @get: returns value for signal "offset"; for output signals this | 38 | * @get: returns value for signal "offset"; for output signals this |
| 37 | * returns either the value actually sensed, or zero | 39 | * returns either the value actually sensed, or zero |
| @@ -59,6 +61,7 @@ struct module; | |||
| 59 | */ | 61 | */ |
| 60 | struct gpio_chip { | 62 | struct gpio_chip { |
| 61 | char *label; | 63 | char *label; |
| 64 | struct device *dev; | ||
| 62 | struct module *owner; | 65 | struct module *owner; |
| 63 | 66 | ||
| 64 | int (*direction_input)(struct gpio_chip *chip, | 67 | int (*direction_input)(struct gpio_chip *chip, |
| @@ -74,6 +77,7 @@ struct gpio_chip { | |||
| 74 | int base; | 77 | int base; |
| 75 | u16 ngpio; | 78 | u16 ngpio; |
| 76 | unsigned can_sleep:1; | 79 | unsigned can_sleep:1; |
| 80 | unsigned exported:1; | ||
| 77 | }; | 81 | }; |
| 78 | 82 | ||
| 79 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | 83 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, |
| @@ -108,7 +112,18 @@ extern void __gpio_set_value(unsigned gpio, int value); | |||
| 108 | extern int __gpio_cansleep(unsigned gpio); | 112 | extern int __gpio_cansleep(unsigned gpio); |
| 109 | 113 | ||
| 110 | 114 | ||
| 111 | #else | 115 | #ifdef CONFIG_GPIO_SYSFS |
| 116 | |||
| 117 | /* | ||
| 118 | * A sysfs interface can be exported by individual drivers if they want, | ||
| 119 | * but more typically is configured entirely from userspace. | ||
| 120 | */ | ||
| 121 | extern int gpio_export(unsigned gpio, bool direction_may_change); | ||
| 122 | extern void gpio_unexport(unsigned gpio); | ||
| 123 | |||
| 124 | #endif /* CONFIG_GPIO_SYSFS */ | ||
| 125 | |||
| 126 | #else /* !CONFIG_HAVE_GPIO_LIB */ | ||
| 112 | 127 | ||
| 113 | static inline int gpio_is_valid(int number) | 128 | static inline int gpio_is_valid(int number) |
| 114 | { | 129 | { |
| @@ -137,6 +152,20 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) | |||
| 137 | gpio_set_value(gpio, value); | 152 | gpio_set_value(gpio, value); |
| 138 | } | 153 | } |
| 139 | 154 | ||
| 140 | #endif | 155 | #endif /* !CONFIG_HAVE_GPIO_LIB */ |
| 156 | |||
| 157 | #ifndef CONFIG_GPIO_SYSFS | ||
| 158 | |||
| 159 | /* sysfs support is only available with gpiolib, where it's optional */ | ||
| 160 | |||
| 161 | static inline int gpio_export(unsigned gpio, bool direction_may_change) | ||
| 162 | { | ||
| 163 | return -ENOSYS; | ||
| 164 | } | ||
| 165 | |||
| 166 | static inline void gpio_unexport(unsigned gpio) | ||
| 167 | { | ||
| 168 | } | ||
| 169 | #endif /* CONFIG_GPIO_SYSFS */ | ||
| 141 | 170 | ||
| 142 | #endif /* _ASM_GENERIC_GPIO_H */ | 171 | #endif /* _ASM_GENERIC_GPIO_H */ |
diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h index 260948905e4e..f9bc9ac29b36 100644 --- a/include/asm-generic/int-ll64.h +++ b/include/asm-generic/int-ll64.h | |||
| @@ -26,7 +26,7 @@ typedef unsigned int __u32; | |||
| 26 | #ifdef __GNUC__ | 26 | #ifdef __GNUC__ |
| 27 | __extension__ typedef __signed__ long long __s64; | 27 | __extension__ typedef __signed__ long long __s64; |
| 28 | __extension__ typedef unsigned long long __u64; | 28 | __extension__ typedef unsigned long long __u64; |
| 29 | #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | 29 | #else |
| 30 | typedef __signed__ long long __s64; | 30 | typedef __signed__ long long __s64; |
| 31 | typedef unsigned long long __u64; | 31 | typedef unsigned long long __u64; |
| 32 | #endif | 32 | #endif |
diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h index 25c10e96b2b7..37b3706226e7 100644 --- a/include/asm-generic/pci-dma-compat.h +++ b/include/asm-generic/pci-dma-compat.h | |||
| @@ -99,9 +99,9 @@ pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, | |||
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | static inline int | 101 | static inline int |
| 102 | pci_dma_mapping_error(dma_addr_t dma_addr) | 102 | pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr) |
| 103 | { | 103 | { |
| 104 | return dma_mapping_error(dma_addr); | 104 | return dma_mapping_error(&pdev->dev, dma_addr); |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | #endif | 107 | #endif |
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h new file mode 100644 index 000000000000..abcf34c2fdc7 --- /dev/null +++ b/include/asm-generic/syscall.h | |||
| @@ -0,0 +1,141 @@ | |||
| 1 | /* | ||
| 2 | * Access to user system call parameters and results | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | ||
| 5 | * | ||
| 6 | * This copyrighted material is made available to anyone wishing to use, | ||
| 7 | * modify, copy, or redistribute it subject to the terms and conditions | ||
| 8 | * of the GNU General Public License v.2. | ||
| 9 | * | ||
| 10 | * This file is a stub providing documentation for what functions | ||
| 11 | * asm-ARCH/syscall.h files need to define. Most arch definitions | ||
| 12 | * will be simple inlines. | ||
| 13 | * | ||
| 14 | * All of these functions expect to be called with no locks, | ||
| 15 | * and only when the caller is sure that the task of interest | ||
| 16 | * cannot return to user mode while we are looking at it. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _ASM_SYSCALL_H | ||
| 20 | #define _ASM_SYSCALL_H 1 | ||
| 21 | |||
| 22 | struct task_struct; | ||
| 23 | struct pt_regs; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * syscall_get_nr - find what system call a task is executing | ||
| 27 | * @task: task of interest, must be blocked | ||
| 28 | * @regs: task_pt_regs() of @task | ||
| 29 | * | ||
| 30 | * If @task is executing a system call or is at system call | ||
| 31 | * tracing about to attempt one, returns the system call number. | ||
| 32 | * If @task is not executing a system call, i.e. it's blocked | ||
| 33 | * inside the kernel for a fault or signal, returns -1. | ||
| 34 | * | ||
| 35 | * It's only valid to call this when @task is known to be blocked. | ||
| 36 | */ | ||
| 37 | long syscall_get_nr(struct task_struct *task, struct pt_regs *regs); | ||
| 38 | |||
| 39 | /** | ||
| 40 | * syscall_rollback - roll back registers after an aborted system call | ||
| 41 | * @task: task of interest, must be in system call exit tracing | ||
| 42 | * @regs: task_pt_regs() of @task | ||
| 43 | * | ||
| 44 | * It's only valid to call this when @task is stopped for system | ||
| 45 | * call exit tracing (due to TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT), | ||
| 46 | * after tracehook_report_syscall_entry() returned nonzero to prevent | ||
| 47 | * the system call from taking place. | ||
| 48 | * | ||
| 49 | * This rolls back the register state in @regs so it's as if the | ||
| 50 | * system call instruction was a no-op. The registers containing | ||
| 51 | * the system call number and arguments are as they were before the | ||
| 52 | * system call instruction. This may not be the same as what the | ||
| 53 | * register state looked like at system call entry tracing. | ||
| 54 | */ | ||
| 55 | void syscall_rollback(struct task_struct *task, struct pt_regs *regs); | ||
| 56 | |||
| 57 | /** | ||
| 58 | * syscall_get_error - check result of traced system call | ||
| 59 | * @task: task of interest, must be blocked | ||
| 60 | * @regs: task_pt_regs() of @task | ||
| 61 | * | ||
| 62 | * Returns 0 if the system call succeeded, or -ERRORCODE if it failed. | ||
| 63 | * | ||
| 64 | * It's only valid to call this when @task is stopped for tracing on exit | ||
| 65 | * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT. | ||
| 66 | */ | ||
| 67 | long syscall_get_error(struct task_struct *task, struct pt_regs *regs); | ||
| 68 | |||
| 69 | /** | ||
| 70 | * syscall_get_return_value - get the return value of a traced system call | ||
| 71 | * @task: task of interest, must be blocked | ||
| 72 | * @regs: task_pt_regs() of @task | ||
| 73 | * | ||
| 74 | * Returns the return value of the successful system call. | ||
| 75 | * This value is meaningless if syscall_get_error() returned nonzero. | ||
| 76 | * | ||
| 77 | * It's only valid to call this when @task is stopped for tracing on exit | ||
| 78 | * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT. | ||
| 79 | */ | ||
| 80 | long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs); | ||
| 81 | |||
| 82 | /** | ||
| 83 | * syscall_set_return_value - change the return value of a traced system call | ||
| 84 | * @task: task of interest, must be blocked | ||
| 85 | * @regs: task_pt_regs() of @task | ||
| 86 | * @error: negative error code, or zero to indicate success | ||
| 87 | * @val: user return value if @error is zero | ||
| 88 | * | ||
| 89 | * This changes the results of the system call that user mode will see. | ||
| 90 | * If @error is zero, the user sees a successful system call with a | ||
| 91 | * return value of @val. If @error is nonzero, it's a negated errno | ||
| 92 | * code; the user sees a failed system call with this errno code. | ||
| 93 | * | ||
| 94 | * It's only valid to call this when @task is stopped for tracing on exit | ||
| 95 | * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT. | ||
| 96 | */ | ||
| 97 | void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, | ||
| 98 | int error, long val); | ||
| 99 | |||
| 100 | /** | ||
| 101 | * syscall_get_arguments - extract system call parameter values | ||
| 102 | * @task: task of interest, must be blocked | ||
| 103 | * @regs: task_pt_regs() of @task | ||
| 104 | * @i: argument index [0,5] | ||
| 105 | * @n: number of arguments; n+i must be [1,6]. | ||
| 106 | * @args: array filled with argument values | ||
| 107 | * | ||
| 108 | * Fetches @n arguments to the system call starting with the @i'th argument | ||
| 109 | * (from 0 through 5). Argument @i is stored in @args[0], and so on. | ||
| 110 | * An arch inline version is probably optimal when @i and @n are constants. | ||
| 111 | * | ||
| 112 | * It's only valid to call this when @task is stopped for tracing on | ||
| 113 | * entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT. | ||
| 114 | * It's invalid to call this with @i + @n > 6; we only support system calls | ||
| 115 | * taking up to 6 arguments. | ||
| 116 | */ | ||
| 117 | void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, | ||
| 118 | unsigned int i, unsigned int n, unsigned long *args); | ||
| 119 | |||
| 120 | /** | ||
| 121 | * syscall_set_arguments - change system call parameter value | ||
| 122 | * @task: task of interest, must be in system call entry tracing | ||
| 123 | * @regs: task_pt_regs() of @task | ||
| 124 | * @i: argument index [0,5] | ||
| 125 | * @n: number of arguments; n+i must be [1,6]. | ||
| 126 | * @args: array of argument values to store | ||
| 127 | * | ||
| 128 | * Changes @n arguments to the system call starting with the @i'th argument. | ||
| 129 | * @n'th argument to @val. Argument @i gets value @args[0], and so on. | ||
| 130 | * An arch inline version is probably optimal when @i and @n are constants. | ||
| 131 | * | ||
| 132 | * It's only valid to call this when @task is stopped for tracing on | ||
| 133 | * entry to a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT. | ||
| 134 | * It's invalid to call this with @i + @n > 6; we only support system calls | ||
| 135 | * taking up to 6 arguments. | ||
| 136 | */ | ||
| 137 | void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs, | ||
| 138 | unsigned int i, unsigned int n, | ||
| 139 | const unsigned long *args); | ||
| 140 | |||
| 141 | #endif /* _ASM_SYSCALL_H */ | ||
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 729f6b0a60e9..9cd44b162ba1 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -359,6 +359,8 @@ | |||
| 359 | } | 359 | } |
| 360 | 360 | ||
| 361 | #define INITCALLS \ | 361 | #define INITCALLS \ |
| 362 | *(.initcallearly.init) \ | ||
| 363 | __early_initcall_end = .; \ | ||
| 362 | *(.initcall0.init) \ | 364 | *(.initcall0.init) \ |
| 363 | *(.initcall0s.init) \ | 365 | *(.initcall0s.init) \ |
| 364 | *(.initcall1.init) \ | 366 | *(.initcall1.init) \ |
diff --git a/include/asm-h8300/elf.h b/include/asm-h8300/elf.h index 26bfc7e641da..a8b57d1f4128 100644 --- a/include/asm-h8300/elf.h +++ b/include/asm-h8300/elf.h | |||
| @@ -26,10 +26,10 @@ typedef unsigned long elf_fpregset_t; | |||
| 26 | #define ELF_DATA ELFDATA2MSB | 26 | #define ELF_DATA ELFDATA2MSB |
| 27 | #define ELF_ARCH EM_H8_300 | 27 | #define ELF_ARCH EM_H8_300 |
| 28 | #if defined(__H8300H__) | 28 | #if defined(__H8300H__) |
| 29 | #define ELF_FLAGS 0x810000 | 29 | #define ELF_CORE_EFLAGS 0x810000 |
| 30 | #endif | 30 | #endif |
| 31 | #if defined(__H8300S__) | 31 | #if defined(__H8300S__) |
| 32 | #define ELF_FLAGS 0x820000 | 32 | #define ELF_CORE_EFLAGS 0x820000 |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | #define ELF_PLAT_INIT(_r) _r->er1 = 0 | 35 | #define ELF_PLAT_INIT(_r) _r->er1 = 0 |
diff --git a/include/asm-h8300/ide.h b/include/asm-h8300/ide.h deleted file mode 100644 index f8535ce7476e..000000000000 --- a/include/asm-h8300/ide.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /****************************************************************************/ | ||
| 2 | |||
| 3 | /* | ||
| 4 | * linux/include/asm-h8300/ide.h | ||
| 5 | * | ||
| 6 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
| 7 | * Copyright (C) 2001 Lineo Inc., davidm@snapgear.com | ||
| 8 | * Copyright (C) 2002 Greg Ungerer (gerg@snapgear.com) | ||
| 9 | * Copyright (C) 2002 Yoshinori Sato (ysato@users.sourceforge.jp) | ||
| 10 | */ | ||
| 11 | |||
| 12 | /****************************************************************************/ | ||
| 13 | #ifndef _H8300_IDE_H | ||
| 14 | #define _H8300_IDE_H | ||
| 15 | /****************************************************************************/ | ||
| 16 | #ifdef __KERNEL__ | ||
| 17 | /****************************************************************************/ | ||
| 18 | |||
| 19 | #define MAX_HWIFS 1 | ||
| 20 | |||
| 21 | #include <asm-generic/ide_iops.h> | ||
| 22 | |||
| 23 | /****************************************************************************/ | ||
| 24 | #endif /* __KERNEL__ */ | ||
| 25 | #endif /* _H8300_IDE_H */ | ||
| 26 | /****************************************************************************/ | ||
diff --git a/include/asm-h8300/keyboard.h b/include/asm-h8300/keyboard.h deleted file mode 100644 index 90efbd655390..000000000000 --- a/include/asm-h8300/keyboard.h +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-h8300/keyboard.h | ||
| 3 | * Created 04 Dec 2001 by Khaled Hassounah <khassounah@mediumware.net> | ||
| 4 | * This file contains the Dragonball architecture specific keyboard definitions | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _H8300_KEYBOARD_H | ||
| 8 | #define _H8300_KEYBOARD_H | ||
| 9 | |||
| 10 | |||
| 11 | /* dummy i.e. no real keyboard */ | ||
| 12 | #define kbd_setkeycode(x...) (-ENOSYS) | ||
| 13 | #define kbd_getkeycode(x...) (-ENOSYS) | ||
| 14 | #define kbd_translate(x...) (0) | ||
| 15 | #define kbd_unexpected_up(x...) (1) | ||
| 16 | #define kbd_leds(x...) do {;} while (0) | ||
| 17 | #define kbd_init_hw(x...) do {;} while (0) | ||
| 18 | #define kbd_enable_irq(x...) do {;} while (0) | ||
| 19 | #define kbd_disable_irq(x...) do {;} while (0) | ||
| 20 | |||
| 21 | #endif /* _H8300_KEYBOARD_H */ | ||
| 22 | |||
| 23 | |||
| 24 | |||
diff --git a/include/asm-h8300/kvm.h b/include/asm-h8300/kvm.h deleted file mode 100644 index bdbed7b987e1..000000000000 --- a/include/asm-h8300/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_H8300_H | ||
| 2 | #define __LINUX_KVM_H8300_H | ||
| 3 | |||
| 4 | /* h8300 does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-h8300/namei.h b/include/asm-h8300/namei.h deleted file mode 100644 index ab6f196db6e0..000000000000 --- a/include/asm-h8300/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-h8300/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __H8300_NAMEI_H | ||
| 8 | #define __H8300_NAMEI_H | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index d6a3eaf3b27e..0b6acf0b03aa 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h | |||
| @@ -43,9 +43,6 @@ typedef struct page *pgtable_t; | |||
| 43 | #define __pgd(x) ((pgd_t) { (x) } ) | 43 | #define __pgd(x) ((pgd_t) { (x) } ) |
| 44 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 44 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
| 45 | 45 | ||
| 46 | /* to align the pointer to the (next) page boundary */ | ||
| 47 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 48 | |||
| 49 | extern unsigned long memory_start; | 46 | extern unsigned long memory_start; |
| 50 | extern unsigned long memory_end; | 47 | extern unsigned long memory_end; |
| 51 | 48 | ||
diff --git a/include/asm-h8300/semaphore.h b/include/asm-h8300/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-h8300/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h index 27bb95e2944c..aafd4d322ec3 100644 --- a/include/asm-h8300/thread_info.h +++ b/include/asm-h8300/thread_info.h | |||
| @@ -49,6 +49,7 @@ struct thread_info { | |||
| 49 | /* | 49 | /* |
| 50 | * Size of kernel stack for each process. This must be a power of 2... | 50 | * Size of kernel stack for each process. This must be a power of 2... |
| 51 | */ | 51 | */ |
| 52 | #define THREAD_SIZE_ORDER 1 | ||
| 52 | #define THREAD_SIZE 8192 /* 2 pages */ | 53 | #define THREAD_SIZE 8192 /* 2 pages */ |
| 53 | 54 | ||
| 54 | 55 | ||
| @@ -65,10 +66,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 65 | return ti; | 66 | return ti; |
| 66 | } | 67 | } |
| 67 | 68 | ||
| 68 | /* thread information allocation */ | ||
| 69 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
| 70 | __get_free_pages(GFP_KERNEL, 1)) | ||
| 71 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | ||
| 72 | #endif /* __ASSEMBLY__ */ | 69 | #endif /* __ASSEMBLY__ */ |
| 73 | 70 | ||
| 74 | /* | 71 | /* |
diff --git a/include/asm-ia64/hugetlb.h b/include/asm-ia64/hugetlb.h index f28a9701f1cf..da55c63728e0 100644 --- a/include/asm-ia64/hugetlb.h +++ b/include/asm-ia64/hugetlb.h | |||
| @@ -4,11 +4,12 @@ | |||
| 4 | #include <asm/page.h> | 4 | #include <asm/page.h> |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | 7 | void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, |
| 8 | unsigned long end, unsigned long floor, | 8 | unsigned long end, unsigned long floor, |
| 9 | unsigned long ceiling); | 9 | unsigned long ceiling); |
| 10 | 10 | ||
| 11 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 11 | int prepare_hugepage_range(struct file *file, |
| 12 | unsigned long addr, unsigned long len); | ||
| 12 | 13 | ||
| 13 | static inline int is_hugepage_only_range(struct mm_struct *mm, | 14 | static inline int is_hugepage_only_range(struct mm_struct *mm, |
| 14 | unsigned long addr, | 15 | unsigned long addr, |
diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h deleted file mode 100644 index 8fa3f8cd067a..000000000000 --- a/include/asm-ia64/ide.h +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-ia64/ide.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* | ||
| 8 | * This file contains the ia64 architecture specific IDE code. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __ASM_IA64_IDE_H | ||
| 12 | #define __ASM_IA64_IDE_H | ||
| 13 | |||
| 14 | #ifdef __KERNEL__ | ||
| 15 | |||
| 16 | |||
| 17 | #include <linux/irq.h> | ||
| 18 | |||
| 19 | static inline int ide_default_irq(unsigned long base) | ||
| 20 | { | ||
| 21 | switch (base) { | ||
| 22 | case 0x1f0: return isa_irq_to_vector(14); | ||
| 23 | case 0x170: return isa_irq_to_vector(15); | ||
| 24 | case 0x1e8: return isa_irq_to_vector(11); | ||
| 25 | case 0x168: return isa_irq_to_vector(10); | ||
| 26 | case 0x1e0: return isa_irq_to_vector(8); | ||
| 27 | case 0x160: return isa_irq_to_vector(12); | ||
| 28 | default: | ||
| 29 | return 0; | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline unsigned long ide_default_io_base(int index) | ||
| 34 | { | ||
| 35 | switch (index) { | ||
| 36 | case 0: return 0x1f0; | ||
| 37 | case 1: return 0x170; | ||
| 38 | case 2: return 0x1e8; | ||
| 39 | case 3: return 0x168; | ||
| 40 | case 4: return 0x1e0; | ||
| 41 | case 5: return 0x160; | ||
| 42 | default: | ||
| 43 | return 0; | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | #include <asm-generic/ide_iops.h> | ||
| 48 | |||
| 49 | #endif /* __KERNEL__ */ | ||
| 50 | |||
| 51 | #endif /* __ASM_IA64_IDE_H */ | ||
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 0721a5e8271e..a6d50c77b6bf 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
| @@ -54,7 +54,7 @@ typedef void ia64_mv_dma_sync_single_for_cpu (struct device *, dma_addr_t, size_ | |||
| 54 | typedef void ia64_mv_dma_sync_sg_for_cpu (struct device *, struct scatterlist *, int, int); | 54 | typedef void ia64_mv_dma_sync_sg_for_cpu (struct device *, struct scatterlist *, int, int); |
| 55 | typedef void ia64_mv_dma_sync_single_for_device (struct device *, dma_addr_t, size_t, int); | 55 | typedef void ia64_mv_dma_sync_single_for_device (struct device *, dma_addr_t, size_t, int); |
| 56 | typedef void ia64_mv_dma_sync_sg_for_device (struct device *, struct scatterlist *, int, int); | 56 | typedef void ia64_mv_dma_sync_sg_for_device (struct device *, struct scatterlist *, int, int); |
| 57 | typedef int ia64_mv_dma_mapping_error (dma_addr_t dma_addr); | 57 | typedef int ia64_mv_dma_mapping_error(struct device *, dma_addr_t dma_addr); |
| 58 | typedef int ia64_mv_dma_supported (struct device *, u64); | 58 | typedef int ia64_mv_dma_supported (struct device *, u64); |
| 59 | 59 | ||
| 60 | typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t, int, struct dma_attrs *); | 60 | typedef dma_addr_t ia64_mv_dma_map_single_attrs (struct device *, void *, size_t, int, struct dma_attrs *); |
diff --git a/include/asm-ia64/namei.h b/include/asm-ia64/namei.h deleted file mode 100644 index 78e768079083..000000000000 --- a/include/asm-ia64/namei.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | #ifndef _ASM_IA64_NAMEI_H | ||
| 2 | #define _ASM_IA64_NAMEI_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Modified 1998, 1999, 2001 | ||
| 6 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <asm/ptrace.h> | ||
| 10 | #include <asm/system.h> | ||
| 11 | |||
| 12 | #define EMUL_PREFIX_LINUX_IA32 "/emul/ia32-linux/" | ||
| 13 | |||
| 14 | static inline char * | ||
| 15 | __emul_prefix (void) | ||
| 16 | { | ||
| 17 | switch (current->personality) { | ||
| 18 | case PER_LINUX32: | ||
| 19 | return EMUL_PREFIX_LINUX_IA32; | ||
| 20 | default: | ||
| 21 | return NULL; | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | #endif /* _ASM_IA64_NAMEI_H */ | ||
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 36f39321b768..5f271bc712ee 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h | |||
| @@ -40,7 +40,6 @@ | |||
| 40 | 40 | ||
| 41 | #define PAGE_SIZE (__IA64_UL_CONST(1) << PAGE_SHIFT) | 41 | #define PAGE_SIZE (__IA64_UL_CONST(1) << PAGE_SHIFT) |
| 42 | #define PAGE_MASK (~(PAGE_SIZE - 1)) | 42 | #define PAGE_MASK (~(PAGE_SIZE - 1)) |
| 43 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | ||
| 44 | 43 | ||
| 45 | #define PERCPU_PAGE_SHIFT 16 /* log2() of max. size of per-CPU area */ | 44 | #define PERCPU_PAGE_SHIFT 16 /* log2() of max. size of per-CPU area */ |
| 46 | #define PERCPU_PAGE_SIZE (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT) | 45 | #define PERCPU_PAGE_SIZE (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT) |
diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-ia64/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 2422ac61658a..7c60fcdd2efd 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
| @@ -54,6 +54,8 @@ struct thread_info { | |||
| 54 | }, \ | 54 | }, \ |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 58 | |||
| 57 | #ifndef ASM_OFFSETS_C | 59 | #ifndef ASM_OFFSETS_C |
| 58 | /* how to get the thread information struct from C */ | 60 | /* how to get the thread information struct from C */ |
| 59 | #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) | 61 | #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) |
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index e60314716122..d535833aab5e 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
| @@ -302,11 +302,17 @@ | |||
| 302 | #define __NR_timerfd_create 1310 | 302 | #define __NR_timerfd_create 1310 |
| 303 | #define __NR_timerfd_settime 1311 | 303 | #define __NR_timerfd_settime 1311 |
| 304 | #define __NR_timerfd_gettime 1312 | 304 | #define __NR_timerfd_gettime 1312 |
| 305 | #define __NR_signalfd4 1313 | ||
| 306 | #define __NR_eventfd2 1314 | ||
| 307 | #define __NR_epoll_create1 1315 | ||
| 308 | #define __NR_dup3 1316 | ||
| 309 | #define __NR_pipe2 1317 | ||
| 310 | #define __NR_inotify_init1 1318 | ||
| 305 | 311 | ||
| 306 | #ifdef __KERNEL__ | 312 | #ifdef __KERNEL__ |
| 307 | 313 | ||
| 308 | 314 | ||
| 309 | #define NR_syscalls 289 /* length of syscall table */ | 315 | #define NR_syscalls 295 /* length of syscall table */ |
| 310 | 316 | ||
| 311 | /* | 317 | /* |
| 312 | * The following defines stop scripts/checksyscalls.sh from complaining about | 318 | * The following defines stop scripts/checksyscalls.sh from complaining about |
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h deleted file mode 100644 index 1e7f6474d130..000000000000 --- a/include/asm-m32r/ide.h +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | #ifndef _ASM_M32R_IDE_H | ||
| 2 | #define _ASM_M32R_IDE_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * linux/include/asm-m32r/ide.h | ||
| 6 | * | ||
| 7 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
| 8 | */ | ||
| 9 | |||
| 10 | /* | ||
| 11 | * This file contains the i386 architecture specific IDE code. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifdef __KERNEL__ | ||
| 15 | |||
| 16 | #include <asm/m32r.h> | ||
| 17 | |||
| 18 | #ifndef MAX_HWIFS | ||
| 19 | # ifdef CONFIG_BLK_DEV_IDEPCI | ||
| 20 | #define MAX_HWIFS 10 | ||
| 21 | # else | ||
| 22 | #define MAX_HWIFS 2 | ||
| 23 | # endif | ||
| 24 | #endif | ||
| 25 | |||
| 26 | static __inline__ int ide_default_irq(unsigned long base) | ||
| 27 | { | ||
| 28 | switch (base) { | ||
| 29 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ | ||
| 30 | || defined(CONFIG_PLAT_OPSPUT) | ||
| 31 | case 0x1f0: return PLD_IRQ_CFIREQ; | ||
| 32 | default: | ||
| 33 | return 0; | ||
| 34 | #elif defined(CONFIG_PLAT_MAPPI3) | ||
| 35 | case 0x1f0: return PLD_IRQ_CFIREQ; | ||
| 36 | case 0x170: return PLD_IRQ_IDEIREQ; | ||
| 37 | default: | ||
| 38 | return 0; | ||
| 39 | #else | ||
| 40 | case 0x1f0: return 14; | ||
| 41 | case 0x170: return 15; | ||
| 42 | case 0x1e8: return 11; | ||
| 43 | case 0x168: return 10; | ||
| 44 | case 0x1e0: return 8; | ||
| 45 | case 0x160: return 12; | ||
| 46 | default: | ||
| 47 | return 0; | ||
| 48 | #endif | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | static __inline__ unsigned long ide_default_io_base(int index) | ||
| 53 | { | ||
| 54 | switch (index) { | ||
| 55 | case 0: return 0x1f0; | ||
| 56 | case 1: return 0x170; | ||
| 57 | case 2: return 0x1e8; | ||
| 58 | case 3: return 0x168; | ||
| 59 | case 4: return 0x1e0; | ||
| 60 | case 5: return 0x160; | ||
| 61 | default: | ||
| 62 | return 0; | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | #include <asm-generic/ide_iops.h> | ||
| 67 | |||
| 68 | #endif /* __KERNEL__ */ | ||
| 69 | |||
| 70 | #endif /* _ASM_M32R_IDE_H */ | ||
diff --git a/include/asm-m32r/kvm.h b/include/asm-m32r/kvm.h deleted file mode 100644 index 99a40515b77e..000000000000 --- a/include/asm-m32r/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_M32R_H | ||
| 2 | #define __LINUX_KVM_M32R_H | ||
| 3 | |||
| 4 | /* m32r does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-m32r/namei.h b/include/asm-m32r/namei.h deleted file mode 100644 index 210f8056b805..000000000000 --- a/include/asm-m32r/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #ifndef _ASM_M32R_NAMEI_H | ||
| 2 | #define _ASM_M32R_NAMEI_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * linux/include/asm-m32r/namei.h | ||
| 6 | * | ||
| 7 | * Included from linux/fs/namei.c | ||
| 8 | */ | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif /* _ASM_M32R_NAMEI_H */ | ||
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h index 8a677f3fca68..c9333089fe11 100644 --- a/include/asm-m32r/page.h +++ b/include/asm-m32r/page.h | |||
| @@ -41,9 +41,6 @@ typedef struct page *pgtable_t; | |||
| 41 | 41 | ||
| 42 | #endif /* !__ASSEMBLY__ */ | 42 | #endif /* !__ASSEMBLY__ */ |
| 43 | 43 | ||
| 44 | /* to align the pointer to the (next) page boundary */ | ||
| 45 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | ||
| 46 | |||
| 47 | /* | 44 | /* |
| 48 | * This handles the memory map.. We could make this a config | 45 | * This handles the memory map.. We could make this a config |
| 49 | * option, but too many people screw it up, and too few need | 46 | * option, but too many people screw it up, and too few need |
diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-m32r/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h index 1effcd0f5e63..8589d462df27 100644 --- a/include/asm-m32r/thread_info.h +++ b/include/asm-m32r/thread_info.h | |||
| @@ -94,6 +94,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 94 | return ti; | 94 | return ti; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 98 | |||
| 97 | /* thread information allocation */ | 99 | /* thread information allocation */ |
| 98 | #ifdef CONFIG_DEBUG_STACK_USAGE | 100 | #ifdef CONFIG_DEBUG_STACK_USAGE |
| 99 | #define alloc_thread_info(tsk) \ | 101 | #define alloc_thread_info(tsk) \ |
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h index a26cdeb46a57..91f7944333d4 100644 --- a/include/asm-m68k/dma-mapping.h +++ b/include/asm-m68k/dma-mapping.h | |||
| @@ -84,7 +84,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *s | |||
| 84 | { | 84 | { |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | static inline int dma_mapping_error(dma_addr_t handle) | 87 | static inline int dma_mapping_error(struct device *dev, dma_addr_t handle) |
| 88 | { | 88 | { |
| 89 | return 0; | 89 | return 0; |
| 90 | } | 90 | } |
diff --git a/include/asm-m68k/dvma.h b/include/asm-m68k/dvma.h index 4fff408d0150..890bbf7e7758 100644 --- a/include/asm-m68k/dvma.h +++ b/include/asm-m68k/dvma.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #define DVMA_PAGE_SHIFT 13 | 13 | #define DVMA_PAGE_SHIFT 13 |
| 14 | #define DVMA_PAGE_SIZE (1UL << DVMA_PAGE_SHIFT) | 14 | #define DVMA_PAGE_SIZE (1UL << DVMA_PAGE_SHIFT) |
| 15 | #define DVMA_PAGE_MASK (~(DVMA_PAGE_SIZE-1)) | 15 | #define DVMA_PAGE_MASK (~(DVMA_PAGE_SIZE-1)) |
| 16 | #define DVMA_PAGE_ALIGN(addr) (((addr)+DVMA_PAGE_SIZE-1)&DVMA_PAGE_MASK) | 16 | #define DVMA_PAGE_ALIGN(addr) ALIGN(addr, DVMA_PAGE_SIZE) |
| 17 | 17 | ||
| 18 | extern void dvma_init(void); | 18 | extern void dvma_init(void); |
| 19 | extern int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, | 19 | extern int dvma_map_iommu(unsigned long kaddr, unsigned long baddr, |
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index 909c6dfd3851..1daf6cbdd9f0 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h | |||
| @@ -45,10 +45,6 @@ | |||
| 45 | #include <asm/macints.h> | 45 | #include <asm/macints.h> |
| 46 | #endif | 46 | #endif |
| 47 | 47 | ||
| 48 | #ifndef MAX_HWIFS | ||
| 49 | #define MAX_HWIFS 4 /* same as the other archs */ | ||
| 50 | #endif | ||
| 51 | |||
| 52 | /* | 48 | /* |
| 53 | * Get rid of defs from io.h - ide has its private and conflicting versions | 49 | * Get rid of defs from io.h - ide has its private and conflicting versions |
| 54 | * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we | 50 | * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we |
diff --git a/include/asm-m68k/kvm.h b/include/asm-m68k/kvm.h deleted file mode 100644 index 7ed27fce5240..000000000000 --- a/include/asm-m68k/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_M68K_H | ||
| 2 | #define __LINUX_KVM_M68K_H | ||
| 3 | |||
| 4 | /* m68k does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-m68k/namei.h b/include/asm-m68k/namei.h deleted file mode 100644 index f33f243b644a..000000000000 --- a/include/asm-m68k/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-m68k/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __M68K_NAMEI_H | ||
| 8 | #define __M68K_NAMEI_H | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 880c2cbff8a6..a34b8bad7847 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h | |||
| @@ -103,9 +103,6 @@ typedef struct page *pgtable_t; | |||
| 103 | #define __pgd(x) ((pgd_t) { (x) } ) | 103 | #define __pgd(x) ((pgd_t) { (x) } ) |
| 104 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 104 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
| 105 | 105 | ||
| 106 | /* to align the pointer to the (next) page boundary */ | ||
| 107 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 108 | |||
| 109 | #endif /* !__ASSEMBLY__ */ | 106 | #endif /* !__ASSEMBLY__ */ |
| 110 | 107 | ||
| 111 | #include <asm/page_offset.h> | 108 | #include <asm/page_offset.h> |
diff --git a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-m68k/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-m68k/thread_info.h b/include/asm-m68k/thread_info.h index d635a3752488..abc002798a2b 100644 --- a/include/asm-m68k/thread_info.h +++ b/include/asm-m68k/thread_info.h | |||
| @@ -25,13 +25,7 @@ struct thread_info { | |||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | /* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */ | 27 | /* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */ |
| 28 | #if PAGE_SHIFT == 13 /* 8k machines */ | 28 | #define THREAD_SIZE_ORDER (13 - PAGE_SHIFT) |
| 29 | #define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,0)) | ||
| 30 | #define free_thread_info(ti) free_pages((unsigned long)(ti),0) | ||
| 31 | #else /* otherwise assume 4k pages */ | ||
| 32 | #define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,1)) | ||
| 33 | #define free_thread_info(ti) free_pages((unsigned long)(ti),1) | ||
| 34 | #endif /* PAGE_SHIFT == 13 */ | ||
| 35 | 29 | ||
| 36 | #define init_thread_info (init_task.thread.info) | 30 | #define init_thread_info (init_task.thread.info) |
| 37 | #define init_stack (init_thread_union.stack) | 31 | #define init_stack (init_thread_union.stack) |
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h index c142fbf2f376..6f3685eab44c 100644 --- a/include/asm-m68knommu/bitops.h +++ b/include/asm-m68knommu/bitops.h | |||
| @@ -14,8 +14,38 @@ | |||
| 14 | #error only <linux/bitops.h> can be included directly | 14 | #error only <linux/bitops.h> can be included directly |
| 15 | #endif | 15 | #endif |
| 16 | 16 | ||
| 17 | #if defined (__mcfisaaplus__) || defined (__mcfisac__) | ||
| 18 | static inline int ffs(unsigned int val) | ||
| 19 | { | ||
| 20 | if (!val) | ||
| 21 | return 0; | ||
| 22 | |||
| 23 | asm volatile( | ||
| 24 | "bitrev %0\n\t" | ||
| 25 | "ff1 %0\n\t" | ||
| 26 | : "=d" (val) | ||
| 27 | : "0" (val) | ||
| 28 | ); | ||
| 29 | val++; | ||
| 30 | return val; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline int __ffs(unsigned int val) | ||
| 34 | { | ||
| 35 | asm volatile( | ||
| 36 | "bitrev %0\n\t" | ||
| 37 | "ff1 %0\n\t" | ||
| 38 | : "=d" (val) | ||
| 39 | : "0" (val) | ||
| 40 | ); | ||
| 41 | return val; | ||
| 42 | } | ||
| 43 | |||
| 44 | #else | ||
| 17 | #include <asm-generic/bitops/ffs.h> | 45 | #include <asm-generic/bitops/ffs.h> |
| 18 | #include <asm-generic/bitops/__ffs.h> | 46 | #include <asm-generic/bitops/__ffs.h> |
| 47 | #endif | ||
| 48 | |||
| 19 | #include <asm-generic/bitops/sched.h> | 49 | #include <asm-generic/bitops/sched.h> |
| 20 | #include <asm-generic/bitops/ffz.h> | 50 | #include <asm-generic/bitops/ffz.h> |
| 21 | 51 | ||
diff --git a/include/asm-m68knommu/byteorder.h b/include/asm-m68knommu/byteorder.h index 8fcde907b0f9..20bb4426b610 100644 --- a/include/asm-m68knommu/byteorder.h +++ b/include/asm-m68knommu/byteorder.h | |||
| @@ -1,13 +1,27 @@ | |||
| 1 | #ifndef _M68KNOMMU_BYTEORDER_H | 1 | #ifndef _M68KNOMMU_BYTEORDER_H |
| 2 | #define _M68KNOMMU_BYTEORDER_H | 2 | #define _M68KNOMMU_BYTEORDER_H |
| 3 | 3 | ||
| 4 | #include <asm/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) | 6 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) |
| 7 | # define __BYTEORDER_HAS_U64__ | 7 | # define __BYTEORDER_HAS_U64__ |
| 8 | # define __SWAB_64_THRU_32__ | 8 | # define __SWAB_64_THRU_32__ |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #if defined (__mcfisaaplus__) || defined (__mcfisac__) | ||
| 12 | static inline __attribute_const__ __u32 ___arch__swab32(__u32 val) | ||
| 13 | { | ||
| 14 | asm( | ||
| 15 | "byterev %0" | ||
| 16 | : "=d" (val) | ||
| 17 | : "0" (val) | ||
| 18 | ); | ||
| 19 | return val; | ||
| 20 | } | ||
| 21 | |||
| 22 | #define __arch__swab32(x) ___arch__swab32(x) | ||
| 23 | #endif | ||
| 24 | |||
| 11 | #include <linux/byteorder/big_endian.h> | 25 | #include <linux/byteorder/big_endian.h> |
| 12 | 26 | ||
| 13 | #endif /* _M68KNOMMU_BYTEORDER_H */ | 27 | #endif /* _M68KNOMMU_BYTEORDER_H */ |
diff --git a/include/asm-m68knommu/commproc.h b/include/asm-m68knommu/commproc.h index 36e870b468ef..edf5eb6c08d2 100644 --- a/include/asm-m68knommu/commproc.h +++ b/include/asm-m68knommu/commproc.h | |||
| @@ -519,25 +519,6 @@ typedef struct scc_enet { | |||
| 519 | #define SICR_ENET_CLKRT ((uint)0x00002c00) | 519 | #define SICR_ENET_CLKRT ((uint)0x00002c00) |
| 520 | #endif | 520 | #endif |
| 521 | 521 | ||
| 522 | #ifdef CONFIG_RPXCLASSIC | ||
| 523 | /* Bits in parallel I/O port registers that have to be set/cleared | ||
| 524 | * to configure the pins for SCC1 use. | ||
| 525 | */ | ||
| 526 | #define PA_ENET_RXD ((ushort)0x0001) | ||
| 527 | #define PA_ENET_TXD ((ushort)0x0002) | ||
| 528 | #define PA_ENET_TCLK ((ushort)0x0200) | ||
| 529 | #define PA_ENET_RCLK ((ushort)0x0800) | ||
| 530 | #define PB_ENET_TENA ((uint)0x00001000) | ||
| 531 | #define PC_ENET_CLSN ((ushort)0x0010) | ||
| 532 | #define PC_ENET_RENA ((ushort)0x0020) | ||
| 533 | |||
| 534 | /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to | ||
| 535 | * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero. | ||
| 536 | */ | ||
| 537 | #define SICR_ENET_MASK ((uint)0x000000ff) | ||
| 538 | #define SICR_ENET_CLKRT ((uint)0x0000003d) | ||
| 539 | #endif | ||
| 540 | |||
| 541 | /* SCC Event register as used by Ethernet. | 522 | /* SCC Event register as used by Ethernet. |
| 542 | */ | 523 | */ |
| 543 | #define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */ | 524 | #define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */ |
diff --git a/include/asm-m68knommu/kvm.h b/include/asm-m68knommu/kvm.h deleted file mode 100644 index b49d4258dabb..000000000000 --- a/include/asm-m68knommu/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_M68KNOMMU_H | ||
| 2 | #define __LINUX_KVM_M68KNOMMU_H | ||
| 3 | |||
| 4 | /* m68knommu does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-m68knommu/namei.h b/include/asm-m68knommu/namei.h deleted file mode 100644 index 31a85d27b931..000000000000 --- a/include/asm-m68knommu/namei.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-m68k/namei.h> | ||
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h index 1e82ebb7d644..3a1ede4544cb 100644 --- a/include/asm-m68knommu/page.h +++ b/include/asm-m68knommu/page.h | |||
| @@ -43,9 +43,6 @@ typedef struct page *pgtable_t; | |||
| 43 | #define __pgd(x) ((pgd_t) { (x) } ) | 43 | #define __pgd(x) ((pgd_t) { (x) } ) |
| 44 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 44 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
| 45 | 45 | ||
| 46 | /* to align the pointer to the (next) page boundary */ | ||
| 47 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 48 | |||
| 49 | extern unsigned long memory_start; | 46 | extern unsigned long memory_start; |
| 50 | extern unsigned long memory_end; | 47 | extern unsigned long memory_end; |
| 51 | 48 | ||
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h index 47258e86e8c4..8c9194b98548 100644 --- a/include/asm-m68knommu/ptrace.h +++ b/include/asm-m68knommu/ptrace.h | |||
| @@ -68,10 +68,8 @@ struct switch_stack { | |||
| 68 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | 68 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
| 69 | #define PTRACE_GETREGS 12 | 69 | #define PTRACE_GETREGS 12 |
| 70 | #define PTRACE_SETREGS 13 | 70 | #define PTRACE_SETREGS 13 |
| 71 | #ifdef CONFIG_FPU | ||
| 72 | #define PTRACE_GETFPREGS 14 | 71 | #define PTRACE_GETFPREGS 14 |
| 73 | #define PTRACE_SETFPREGS 15 | 72 | #define PTRACE_SETFPREGS 15 |
| 74 | #endif | ||
| 75 | 73 | ||
| 76 | #ifdef __KERNEL__ | 74 | #ifdef __KERNEL__ |
| 77 | 75 | ||
diff --git a/include/asm-m68knommu/semaphore.h b/include/asm-m68knommu/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-m68knommu/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 64c64432bbb8..40f49de69821 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h | |||
| @@ -118,6 +118,8 @@ asmlinkage void resume(void); | |||
| 118 | #define smp_read_barrier_depends() do { } while(0) | 118 | #define smp_read_barrier_depends() do { } while(0) |
| 119 | #endif | 119 | #endif |
| 120 | 120 | ||
| 121 | #define read_barrier_depends() ((void)0) | ||
| 122 | |||
| 121 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | 123 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) |
| 122 | 124 | ||
| 123 | struct __xchg_dummy { unsigned long a[100]; }; | 125 | struct __xchg_dummy { unsigned long a[100]; }; |
| @@ -310,4 +312,13 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz | |||
| 310 | #endif | 312 | #endif |
| 311 | #define arch_align_stack(x) (x) | 313 | #define arch_align_stack(x) (x) |
| 312 | 314 | ||
| 315 | |||
| 316 | static inline int irqs_disabled_flags(unsigned long flags) | ||
| 317 | { | ||
| 318 | if (flags & 0x0700) | ||
| 319 | return 0; | ||
| 320 | else | ||
| 321 | return 1; | ||
| 322 | } | ||
| 323 | |||
| 313 | #endif /* _M68KNOMMU_SYSTEM_H */ | 324 | #endif /* _M68KNOMMU_SYSTEM_H */ |
diff --git a/include/asm-m68knommu/thread_info.h b/include/asm-m68knommu/thread_info.h index 95996d978bed..0c9bc095f3f0 100644 --- a/include/asm-m68knommu/thread_info.h +++ b/include/asm-m68knommu/thread_info.h | |||
| @@ -71,10 +71,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 71 | return ti; | 71 | return ti; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | /* thread information allocation */ | ||
| 75 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
| 76 | __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER)) | ||
| 77 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_SIZE_ORDER) | ||
| 78 | #endif /* __ASSEMBLY__ */ | 74 | #endif /* __ASSEMBLY__ */ |
| 79 | 75 | ||
| 80 | #define PREEMPT_ACTIVE 0x4000000 | 76 | #define PREEMPT_ACTIVE 0x4000000 |
diff --git a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h index 230b3f1b69b1..c64afb40cd06 100644 --- a/include/asm-mips/dma-mapping.h +++ b/include/asm-mips/dma-mapping.h | |||
| @@ -42,7 +42,7 @@ extern void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | |||
| 42 | int nelems, enum dma_data_direction direction); | 42 | int nelems, enum dma_data_direction direction); |
| 43 | extern void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | 43 | extern void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, |
| 44 | int nelems, enum dma_data_direction direction); | 44 | int nelems, enum dma_data_direction direction); |
| 45 | extern int dma_mapping_error(dma_addr_t dma_addr); | 45 | extern int dma_mapping_error(struct device *dev, dma_addr_t dma_addr); |
| 46 | extern int dma_supported(struct device *dev, u64 mask); | 46 | extern int dma_supported(struct device *dev, u64 mask); |
| 47 | 47 | ||
| 48 | static inline int | 48 | static inline int |
diff --git a/include/asm-mips/kvm.h b/include/asm-mips/kvm.h deleted file mode 100644 index 093a5b7f796b..000000000000 --- a/include/asm-mips/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_MIPS_H | ||
| 2 | #define __LINUX_KVM_MIPS_H | ||
| 3 | |||
| 4 | /* mips does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-mips/mach-au1x00/au1550_spi.h b/include/asm-mips/mach-au1x00/au1550_spi.h index 40e6c489833a..08e1958e9410 100644 --- a/include/asm-mips/mach-au1x00/au1550_spi.h +++ b/include/asm-mips/mach-au1x00/au1550_spi.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | #define _AU1550_SPI_H_ | 6 | #define _AU1550_SPI_H_ |
| 7 | 7 | ||
| 8 | struct au1550_spi_info { | 8 | struct au1550_spi_info { |
| 9 | s16 bus_num; /* defines which PSC and IRQ to use */ | ||
| 10 | u32 mainclk_hz; /* main input clock frequency of PSC */ | 9 | u32 mainclk_hz; /* main input clock frequency of PSC */ |
| 11 | u16 num_chipselect; /* number of chipselects supported */ | 10 | u16 num_chipselect; /* number of chipselects supported */ |
| 12 | void (*activate_cs)(struct au1550_spi_info *spi, int cs, int polarity); | 11 | void (*activate_cs)(struct au1550_spi_info *spi, int cs, int polarity); |
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h index e6b376bd9d06..b4e70208da64 100644 --- a/include/asm-mips/mach-generic/gpio.h +++ b/include/asm-mips/mach-generic/gpio.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef __ASM_MACH_GENERIC_GPIO_H | 1 | #ifndef __ASM_MACH_GENERIC_GPIO_H |
| 2 | #define __ASM_MACH_GENERIC_GPIO_H | 2 | #define __ASM_MACH_GENERIC_GPIO_H |
| 3 | 3 | ||
| 4 | #ifdef CONFIG_HAVE_GPIO_LIB | 4 | #ifdef CONFIG_GPIOLIB |
| 5 | #define gpio_get_value __gpio_get_value | 5 | #define gpio_get_value __gpio_get_value |
| 6 | #define gpio_set_value __gpio_set_value | 6 | #define gpio_set_value __gpio_set_value |
| 7 | #define gpio_cansleep __gpio_cansleep | 7 | #define gpio_cansleep __gpio_cansleep |
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 0f6c251f5fec..73008f7bdc93 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h | |||
| @@ -19,14 +19,6 @@ | |||
| 19 | #include <linux/stddef.h> | 19 | #include <linux/stddef.h> |
| 20 | #include <asm/processor.h> | 20 | #include <asm/processor.h> |
| 21 | 21 | ||
| 22 | #ifndef MAX_HWIFS | ||
| 23 | # ifdef CONFIG_BLK_DEV_IDEPCI | ||
| 24 | #define MAX_HWIFS 10 | ||
| 25 | # else | ||
| 26 | #define MAX_HWIFS 6 | ||
| 27 | # endif | ||
| 28 | #endif | ||
| 29 | |||
| 30 | static __inline__ int ide_probe_legacy(void) | 22 | static __inline__ int ide_probe_legacy(void) |
| 31 | { | 23 | { |
| 32 | #ifdef CONFIG_PCI | 24 | #ifdef CONFIG_PCI |
| @@ -56,46 +48,6 @@ found: | |||
| 56 | #endif | 48 | #endif |
| 57 | } | 49 | } |
| 58 | 50 | ||
| 59 | static __inline__ int ide_default_irq(unsigned long base) | ||
| 60 | { | ||
| 61 | switch (base) { | ||
| 62 | case 0x1f0: return 14; | ||
| 63 | case 0x170: return 15; | ||
| 64 | case 0x1e8: return 11; | ||
| 65 | case 0x168: return 10; | ||
| 66 | case 0x1e0: return 8; | ||
| 67 | case 0x160: return 12; | ||
| 68 | default: | ||
| 69 | return 0; | ||
| 70 | } | ||
| 71 | } | ||
| 72 | |||
| 73 | static __inline__ unsigned long ide_default_io_base(int index) | ||
| 74 | { | ||
| 75 | if (!ide_probe_legacy()) | ||
| 76 | return 0; | ||
| 77 | /* | ||
| 78 | * If PCI is present then it is not safe to poke around | ||
| 79 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | ||
| 80 | * defined compatibility mode ports for PCI. A user can | ||
| 81 | * override this using ide= but we must default safe. | ||
| 82 | */ | ||
| 83 | if (no_pci_devices()) { | ||
| 84 | switch (index) { | ||
| 85 | case 2: return 0x1e8; | ||
| 86 | case 3: return 0x168; | ||
| 87 | case 4: return 0x1e0; | ||
| 88 | case 5: return 0x160; | ||
| 89 | } | ||
| 90 | } | ||
| 91 | switch (index) { | ||
| 92 | case 0: return 0x1f0; | ||
| 93 | case 1: return 0x170; | ||
| 94 | default: | ||
| 95 | return 0; | ||
| 96 | } | ||
| 97 | } | ||
| 98 | |||
| 99 | /* MIPS port and memory-mapped I/O string operations. */ | 51 | /* MIPS port and memory-mapped I/O string operations. */ |
| 100 | static inline void __ide_flush_prologue(void) | 52 | static inline void __ide_flush_prologue(void) |
| 101 | { | 53 | { |
diff --git a/include/asm-mips/namei.h b/include/asm-mips/namei.h deleted file mode 100644 index a6605a752469..000000000000 --- a/include/asm-mips/namei.h +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | #ifndef _ASM_NAMEI_H | ||
| 2 | #define _ASM_NAMEI_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * This dummy routine maybe changed to something useful | ||
| 6 | * for /usr/gnemul/ emulation stuff. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #define __emul_prefix() NULL | ||
| 10 | |||
| 11 | #endif /* _ASM_NAMEI_H */ | ||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 494f00ba9541..fe7a88ea066e 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
| @@ -137,9 +137,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
| 137 | 137 | ||
| 138 | #endif /* !__ASSEMBLY__ */ | 138 | #endif /* !__ASSEMBLY__ */ |
| 139 | 139 | ||
| 140 | /* to align the pointer to the (next) page boundary */ | ||
| 141 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | ||
| 142 | |||
| 143 | /* | 140 | /* |
| 144 | * __pa()/__va() should be used only during mem init. | 141 | * __pa()/__va() should be used only during mem init. |
| 145 | */ | 142 | */ |
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 58cbac5a64e4..a1e4453469f9 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h | |||
| @@ -45,7 +45,7 @@ extern unsigned int vced_count, vcei_count; | |||
| 45 | * This decides where the kernel will search for a free chunk of vm | 45 | * This decides where the kernel will search for a free chunk of vm |
| 46 | * space during mmap's. | 46 | * space during mmap's. |
| 47 | */ | 47 | */ |
| 48 | #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) | 48 | #define TASK_UNMAPPED_BASE ((TASK_SIZE / 3) & ~(PAGE_SIZE)) |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | #ifdef CONFIG_64BIT | 51 | #ifdef CONFIG_64BIT |
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-mips/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h index 63f60254d308..facc2d7a87ca 100644 --- a/include/asm-mips/socket.h +++ b/include/asm-mips/socket.h | |||
| @@ -102,6 +102,13 @@ enum sock_type { | |||
| 102 | }; | 102 | }; |
| 103 | 103 | ||
| 104 | #define SOCK_MAX (SOCK_PACKET + 1) | 104 | #define SOCK_MAX (SOCK_PACKET + 1) |
| 105 | /* Mask which covers at least up to SOCK_MASK-1. The | ||
| 106 | * * remaining bits are used as flags. */ | ||
| 107 | #define SOCK_TYPE_MASK 0xf | ||
| 108 | |||
| 109 | /* Flags for socket, socketpair, paccept */ | ||
| 110 | #define SOCK_CLOEXEC O_CLOEXEC | ||
| 111 | #define SOCK_NONBLOCK O_NONBLOCK | ||
| 105 | 112 | ||
| 106 | #define ARCH_HAS_SOCKET_TYPES 1 | 113 | #define ARCH_HAS_SOCKET_TYPES 1 |
| 107 | 114 | ||
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index b2772df1a1bd..bb3060699df2 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h | |||
| @@ -82,6 +82,8 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
| 82 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) | 82 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) |
| 83 | #define THREAD_MASK (THREAD_SIZE - 1UL) | 83 | #define THREAD_MASK (THREAD_SIZE - 1UL) |
| 84 | 84 | ||
| 85 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 86 | |||
| 85 | #ifdef CONFIG_DEBUG_STACK_USAGE | 87 | #ifdef CONFIG_DEBUG_STACK_USAGE |
| 86 | #define alloc_thread_info(tsk) \ | 88 | #define alloc_thread_info(tsk) \ |
| 87 | ({ \ | 89 | ({ \ |
diff --git a/include/asm-mn10300/dma-mapping.h b/include/asm-mn10300/dma-mapping.h index 7c882fca9ec8..ccae8f6c6326 100644 --- a/include/asm-mn10300/dma-mapping.h +++ b/include/asm-mn10300/dma-mapping.h | |||
| @@ -182,7 +182,7 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | static inline | 184 | static inline |
| 185 | int dma_mapping_error(dma_addr_t dma_addr) | 185 | int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 186 | { | 186 | { |
| 187 | return 0; | 187 | return 0; |
| 188 | } | 188 | } |
diff --git a/include/asm-mn10300/ide.h b/include/asm-mn10300/ide.h index dc235121ec42..6adcdd92e83d 100644 --- a/include/asm-mn10300/ide.h +++ b/include/asm-mn10300/ide.h | |||
| @@ -23,10 +23,6 @@ | |||
| 23 | #undef SUPPORT_VLB_SYNC | 23 | #undef SUPPORT_VLB_SYNC |
| 24 | #define SUPPORT_VLB_SYNC 0 | 24 | #define SUPPORT_VLB_SYNC 0 |
| 25 | 25 | ||
| 26 | #ifndef MAX_HWIFS | ||
| 27 | #define MAX_HWIFS 8 | ||
| 28 | #endif | ||
| 29 | |||
| 30 | /* | 26 | /* |
| 31 | * some bits needed for parts of the IDE subsystem to compile | 27 | * some bits needed for parts of the IDE subsystem to compile |
| 32 | */ | 28 | */ |
diff --git a/include/asm-mn10300/kvm.h b/include/asm-mn10300/kvm.h deleted file mode 100644 index f6b609ff4a57..000000000000 --- a/include/asm-mn10300/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_MN10300_H | ||
| 2 | #define __LINUX_KVM_MN10300_H | ||
| 3 | |||
| 4 | /* mn10300 does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-mn10300/namei.h b/include/asm-mn10300/namei.h deleted file mode 100644 index bd9ce94aeb65..000000000000 --- a/include/asm-mn10300/namei.h +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | /* Emulation stuff | ||
| 2 | * | ||
| 3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public Licence | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the Licence, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _ASM_NAMEI_H | ||
| 13 | #define _ASM_NAMEI_H | ||
| 14 | |||
| 15 | /* This dummy routine maybe changed to something useful | ||
| 16 | * for /usr/gnemul/ emulation stuff. | ||
| 17 | * Look at asm-sparc/namei.h for details. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #define __emul_prefix() NULL | ||
| 21 | |||
| 22 | #endif /* _ASM_NAMEI_H */ | ||
diff --git a/include/asm-mn10300/page.h b/include/asm-mn10300/page.h index 124971b9fb9b..8288e124165b 100644 --- a/include/asm-mn10300/page.h +++ b/include/asm-mn10300/page.h | |||
| @@ -61,9 +61,6 @@ typedef struct page *pgtable_t; | |||
| 61 | 61 | ||
| 62 | #endif /* !__ASSEMBLY__ */ | 62 | #endif /* !__ASSEMBLY__ */ |
| 63 | 63 | ||
| 64 | /* to align the pointer to the (next) page boundary */ | ||
| 65 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | ||
| 66 | |||
| 67 | /* | 64 | /* |
| 68 | * This handles the memory map.. We could make this a config | 65 | * This handles the memory map.. We could make this a config |
| 69 | * option, but too many people screw it up, and too few need | 66 | * option, but too many people screw it up, and too few need |
diff --git a/include/asm-mn10300/pci.h b/include/asm-mn10300/pci.h index 205192c52bb5..cd9cc5c89cea 100644 --- a/include/asm-mn10300/pci.h +++ b/include/asm-mn10300/pci.h | |||
| @@ -74,15 +74,6 @@ struct pci_dev; | |||
| 74 | /* This is always fine. */ | 74 | /* This is always fine. */ |
| 75 | #define pci_dac_dma_supported(pci_dev, mask) (0) | 75 | #define pci_dac_dma_supported(pci_dev, mask) (0) |
| 76 | 76 | ||
| 77 | /* | ||
| 78 | * These macros should be used after a pci_map_sg call has been done | ||
| 79 | * to get bus addresses of each of the SG entries and their lengths. | ||
| 80 | * You should only work with the number of sg entries pci_map_sg | ||
| 81 | * returns. | ||
| 82 | */ | ||
| 83 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
| 84 | #define sg_dma_len(sg) ((sg)->length) | ||
| 85 | |||
| 86 | /* Return the index of the PCI controller for device. */ | 77 | /* Return the index of the PCI controller for device. */ |
| 87 | static inline int pci_controller_num(struct pci_dev *dev) | 78 | static inline int pci_controller_num(struct pci_dev *dev) |
| 88 | { | 79 | { |
diff --git a/include/asm-mn10300/ptrace.h b/include/asm-mn10300/ptrace.h index b3684689fcce..7b06cc623d8b 100644 --- a/include/asm-mn10300/ptrace.h +++ b/include/asm-mn10300/ptrace.h | |||
| @@ -88,12 +88,16 @@ extern struct pt_regs *__frame; /* current frame pointer */ | |||
| 88 | /* options set using PTRACE_SETOPTIONS */ | 88 | /* options set using PTRACE_SETOPTIONS */ |
| 89 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | 89 | #define PTRACE_O_TRACESYSGOOD 0x00000001 |
| 90 | 90 | ||
| 91 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) | 91 | #if defined(__KERNEL__) |
| 92 | |||
| 93 | #if !defined(__ASSEMBLY__) | ||
| 92 | #define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL) | 94 | #define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL) |
| 93 | #define instruction_pointer(regs) ((regs)->pc) | 95 | #define instruction_pointer(regs) ((regs)->pc) |
| 94 | extern void show_regs(struct pt_regs *); | 96 | extern void show_regs(struct pt_regs *); |
| 95 | #endif | 97 | #endif /* !__ASSEMBLY */ |
| 96 | 98 | ||
| 97 | #define profile_pc(regs) ((regs)->pc) | 99 | #define profile_pc(regs) ((regs)->pc) |
| 98 | 100 | ||
| 101 | #endif /* __KERNEL__ */ | ||
| 102 | |||
| 99 | #endif /* _ASM_PTRACE_H */ | 103 | #endif /* _ASM_PTRACE_H */ |
diff --git a/include/asm-mn10300/scatterlist.h b/include/asm-mn10300/scatterlist.h index e29d91dbcf2b..67535901b9ff 100644 --- a/include/asm-mn10300/scatterlist.h +++ b/include/asm-mn10300/scatterlist.h | |||
| @@ -43,4 +43,13 @@ struct scatterlist { | |||
| 43 | 43 | ||
| 44 | #define ISA_DMA_THRESHOLD (0x00ffffff) | 44 | #define ISA_DMA_THRESHOLD (0x00ffffff) |
| 45 | 45 | ||
| 46 | /* | ||
| 47 | * These macros should be used after a pci_map_sg call has been done | ||
| 48 | * to get bus addresses of each of the SG entries and their lengths. | ||
| 49 | * You should only work with the number of sg entries pci_map_sg | ||
| 50 | * returns. | ||
| 51 | */ | ||
| 52 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
| 53 | #define sg_dma_len(sg) ((sg)->length) | ||
| 54 | |||
| 46 | #endif /* _ASM_SCATTERLIST_H */ | 55 | #endif /* _ASM_SCATTERLIST_H */ |
diff --git a/include/asm-mn10300/semaphore.h b/include/asm-mn10300/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-mn10300/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-mn10300/thread_info.h b/include/asm-mn10300/thread_info.h index e397e7192785..78a3881f3c12 100644 --- a/include/asm-mn10300/thread_info.h +++ b/include/asm-mn10300/thread_info.h | |||
| @@ -112,6 +112,8 @@ static inline unsigned long current_stack_pointer(void) | |||
| 112 | return sp; | 112 | return sp; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 116 | |||
| 115 | /* thread information allocation */ | 117 | /* thread information allocation */ |
| 116 | #ifdef CONFIG_DEBUG_STACK_USAGE | 118 | #ifdef CONFIG_DEBUG_STACK_USAGE |
| 117 | #define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL) | 119 | #define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL) |
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index 2f1e1b05440a..b7ca6dc7fddc 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h | |||
| @@ -45,9 +45,9 @@ void flush_cache_mm(struct mm_struct *mm); | |||
| 45 | extern void flush_dcache_page(struct page *page); | 45 | extern void flush_dcache_page(struct page *page); |
| 46 | 46 | ||
| 47 | #define flush_dcache_mmap_lock(mapping) \ | 47 | #define flush_dcache_mmap_lock(mapping) \ |
| 48 | write_lock_irq(&(mapping)->tree_lock) | 48 | spin_lock_irq(&(mapping)->tree_lock) |
| 49 | #define flush_dcache_mmap_unlock(mapping) \ | 49 | #define flush_dcache_mmap_unlock(mapping) \ |
| 50 | write_unlock_irq(&(mapping)->tree_lock) | 50 | spin_unlock_irq(&(mapping)->tree_lock) |
| 51 | 51 | ||
| 52 | #define flush_icache_page(vma,page) do { \ | 52 | #define flush_icache_page(vma,page) do { \ |
| 53 | flush_kernel_dcache_page(page); \ | 53 | flush_kernel_dcache_page(page); \ |
diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h index c6c0e9ff6bde..53af696f23d2 100644 --- a/include/asm-parisc/dma-mapping.h +++ b/include/asm-parisc/dma-mapping.h | |||
| @@ -248,6 +248,6 @@ void * sba_get_iommu(struct parisc_device *dev); | |||
| 248 | #endif | 248 | #endif |
| 249 | 249 | ||
| 250 | /* At the moment, we panic on error for IOMMU resource exaustion */ | 250 | /* At the moment, we panic on error for IOMMU resource exaustion */ |
| 251 | #define dma_mapping_error(x) 0 | 251 | #define dma_mapping_error(dev, x) 0 |
| 252 | 252 | ||
| 253 | #endif | 253 | #endif |
diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h index db0c94410095..c246ef75017d 100644 --- a/include/asm-parisc/ide.h +++ b/include/asm-parisc/ide.h | |||
| @@ -13,10 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
| 15 | 15 | ||
| 16 | #ifndef MAX_HWIFS | ||
| 17 | #define MAX_HWIFS 2 | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) | 16 | #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) |
| 21 | #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) | 17 | #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) |
| 22 | #define ide_request_region(from,extent,name) request_region((from), (extent), (name)) | 18 | #define ide_request_region(from,extent,name) request_region((from), (extent), (name)) |
diff --git a/include/asm-parisc/kvm.h b/include/asm-parisc/kvm.h deleted file mode 100644 index 00cc45812547..000000000000 --- a/include/asm-parisc/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_PARISC_H | ||
| 2 | #define __LINUX_KVM_PARISC_H | ||
| 3 | |||
| 4 | /* parisc does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-parisc/namei.h b/include/asm-parisc/namei.h deleted file mode 100644 index 8d29b3d9fb33..000000000000 --- a/include/asm-parisc/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $ | ||
| 2 | * linux/include/asm-parisc/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __PARISC_NAMEI_H | ||
| 8 | #define __PARISC_NAMEI_H | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif /* __PARISC_NAMEI_H */ | ||
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index 27d50b859541..c3941f09a878 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h | |||
| @@ -119,10 +119,6 @@ extern int npmem_ranges; | |||
| 119 | #define PMD_ENTRY_SIZE (1UL << BITS_PER_PMD_ENTRY) | 119 | #define PMD_ENTRY_SIZE (1UL << BITS_PER_PMD_ENTRY) |
| 120 | #define PTE_ENTRY_SIZE (1UL << BITS_PER_PTE_ENTRY) | 120 | #define PTE_ENTRY_SIZE (1UL << BITS_PER_PTE_ENTRY) |
| 121 | 121 | ||
| 122 | /* to align the pointer to the (next) page boundary */ | ||
| 123 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 124 | |||
| 125 | |||
| 126 | #define LINUX_GATEWAY_SPACE 0 | 122 | #define LINUX_GATEWAY_SPACE 0 |
| 127 | 123 | ||
| 128 | /* This governs the relationship between virtual and physical addresses. | 124 | /* This governs the relationship between virtual and physical addresses. |
diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h index 93f990e418f1..3e94c5d85ff5 100644 --- a/include/asm-parisc/ptrace.h +++ b/include/asm-parisc/ptrace.h | |||
| @@ -33,7 +33,6 @@ struct pt_regs { | |||
| 33 | unsigned long ipsw; /* CR22 */ | 33 | unsigned long ipsw; /* CR22 */ |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | #define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS)) | ||
| 37 | /* | 36 | /* |
| 38 | * The numbers chosen here are somewhat arbitrary but absolutely MUST | 37 | * The numbers chosen here are somewhat arbitrary but absolutely MUST |
| 39 | * not overlap with any of the number assigned in <linux/ptrace.h>. | 38 | * not overlap with any of the number assigned in <linux/ptrace.h>. |
| @@ -43,8 +42,11 @@ struct pt_regs { | |||
| 43 | * since we have taken branch traps too) | 42 | * since we have taken branch traps too) |
| 44 | */ | 43 | */ |
| 45 | #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */ | 44 | #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */ |
| 45 | |||
| 46 | #ifdef __KERNEL__ | 46 | #ifdef __KERNEL__ |
| 47 | 47 | ||
| 48 | #define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS)) | ||
| 49 | |||
| 48 | /* XXX should we use iaoq[1] or iaoq[0] ? */ | 50 | /* XXX should we use iaoq[1] or iaoq[0] ? */ |
| 49 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) | 51 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) |
| 50 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) | 52 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) |
diff --git a/include/asm-parisc/semaphore.h b/include/asm-parisc/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-parisc/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-parisc/socket.h b/include/asm-parisc/socket.h index 69a7a0d30b02..fba402c95ac2 100644 --- a/include/asm-parisc/socket.h +++ b/include/asm-parisc/socket.h | |||
| @@ -54,4 +54,9 @@ | |||
| 54 | 54 | ||
| 55 | #define SO_MARK 0x401f | 55 | #define SO_MARK 0x401f |
| 56 | 56 | ||
| 57 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | ||
| 58 | * have to define SOCK_NONBLOCK to a different value here. | ||
| 59 | */ | ||
| 60 | #define SOCK_NONBLOCK 0x40000000 | ||
| 61 | |||
| 57 | #endif /* _ASM_SOCKET_H */ | 62 | #endif /* _ASM_SOCKET_H */ |
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h index 2d9c7500867b..9f812741c355 100644 --- a/include/asm-parisc/thread_info.h +++ b/include/asm-parisc/thread_info.h | |||
| @@ -34,15 +34,11 @@ struct thread_info { | |||
| 34 | 34 | ||
| 35 | /* thread information allocation */ | 35 | /* thread information allocation */ |
| 36 | 36 | ||
| 37 | #define THREAD_ORDER 2 | 37 | #define THREAD_SIZE_ORDER 2 |
| 38 | /* Be sure to hunt all references to this down when you change the size of | 38 | /* Be sure to hunt all references to this down when you change the size of |
| 39 | * the kernel stack */ | 39 | * the kernel stack */ |
| 40 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) | 40 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) |
| 41 | #define THREAD_SHIFT (PAGE_SHIFT + THREAD_ORDER) | 41 | #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) |
| 42 | |||
| 43 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
| 44 | __get_free_pages(GFP_KERNEL, THREAD_ORDER)) | ||
| 45 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) | ||
| 46 | 42 | ||
| 47 | /* how to get the thread information struct from C */ | 43 | /* how to get the thread information struct from C */ |
| 48 | #define current_thread_info() ((struct thread_info *)mfctl(30)) | 44 | #define current_thread_info() ((struct thread_info *)mfctl(30)) |
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild index 04ce8f8a2ee7..5ab7d7fe198c 100644 --- a/include/asm-powerpc/Kbuild +++ b/include/asm-powerpc/Kbuild | |||
| @@ -29,7 +29,6 @@ unifdef-y += elf.h | |||
| 29 | unifdef-y += nvram.h | 29 | unifdef-y += nvram.h |
| 30 | unifdef-y += param.h | 30 | unifdef-y += param.h |
| 31 | unifdef-y += posix_types.h | 31 | unifdef-y += posix_types.h |
| 32 | unifdef-y += ptrace.h | ||
| 33 | unifdef-y += seccomp.h | 32 | unifdef-y += seccomp.h |
| 34 | unifdef-y += signal.h | 33 | unifdef-y += signal.h |
| 35 | unifdef-y += spu_info.h | 34 | unifdef-y += spu_info.h |
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 2a3e9075a5a0..ef8a248dfd55 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
| @@ -127,6 +127,8 @@ extern struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr); | |||
| 127 | extern void do_feature_fixups(unsigned long value, void *fixup_start, | 127 | extern void do_feature_fixups(unsigned long value, void *fixup_start, |
| 128 | void *fixup_end); | 128 | void *fixup_end); |
| 129 | 129 | ||
| 130 | extern const char *powerpc_base_platform; | ||
| 131 | |||
| 130 | #endif /* __ASSEMBLY__ */ | 132 | #endif /* __ASSEMBLY__ */ |
| 131 | 133 | ||
| 132 | /* CPU kernel features */ | 134 | /* CPU kernel features */ |
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h index 74c549780987..c7ca45f97dd2 100644 --- a/include/asm-powerpc/dma-mapping.h +++ b/include/asm-powerpc/dma-mapping.h | |||
| @@ -415,7 +415,7 @@ static inline void dma_sync_sg_for_device(struct device *dev, | |||
| 415 | __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); | 415 | __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); |
| 416 | } | 416 | } |
| 417 | 417 | ||
| 418 | static inline int dma_mapping_error(dma_addr_t dma_addr) | 418 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 419 | { | 419 | { |
| 420 | #ifdef CONFIG_PPC64 | 420 | #ifdef CONFIG_PPC64 |
| 421 | return (dma_addr == DMA_ERROR_CODE); | 421 | return (dma_addr == DMA_ERROR_CODE); |
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index 89664675b469..80d1f399ee51 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
| @@ -217,6 +217,14 @@ typedef elf_vrregset_t elf_fpxregset_t; | |||
| 217 | 217 | ||
| 218 | #define ELF_PLATFORM (cur_cpu_spec->platform) | 218 | #define ELF_PLATFORM (cur_cpu_spec->platform) |
| 219 | 219 | ||
| 220 | /* While ELF_PLATFORM indicates the ISA supported by the platform, it | ||
| 221 | * may not accurately reflect the underlying behavior of the hardware | ||
| 222 | * (as in the case of running in Power5+ compatibility mode on a | ||
| 223 | * Power6 machine). ELF_BASE_PLATFORM allows ld.so to load libraries | ||
| 224 | * that are tuned for the real hardware. | ||
| 225 | */ | ||
| 226 | #define ELF_BASE_PLATFORM (powerpc_base_platform) | ||
| 227 | |||
| 220 | #ifdef __powerpc64__ | 228 | #ifdef __powerpc64__ |
| 221 | # define ELF_PLAT_INIT(_r, load_addr) do { \ | 229 | # define ELF_PLAT_INIT(_r, load_addr) do { \ |
| 222 | _r->gpr[2] = load_addr; \ | 230 | _r->gpr[2] = load_addr; \ |
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h index ef328995ba9d..3a179827528d 100644 --- a/include/asm-powerpc/firmware.h +++ b/include/asm-powerpc/firmware.h | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) | 46 | #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) |
| 47 | #define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000) | 47 | #define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000) |
| 48 | #define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000002000000) | 48 | #define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000002000000) |
| 49 | #define FW_FEATURE_CMO ASM_CONST(0x0000000004000000) | ||
| 49 | 50 | ||
| 50 | #ifndef __ASSEMBLY__ | 51 | #ifndef __ASSEMBLY__ |
| 51 | 52 | ||
| @@ -58,7 +59,7 @@ enum { | |||
| 58 | FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ | | 59 | FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ | |
| 59 | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | | 60 | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | |
| 60 | FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE | | 61 | FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE | |
| 61 | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR, | 62 | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | FW_FEATURE_CMO, |
| 62 | FW_FEATURE_PSERIES_ALWAYS = 0, | 63 | FW_FEATURE_PSERIES_ALWAYS = 0, |
| 63 | FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, | 64 | FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, |
| 64 | FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, | 65 | FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, |
diff --git a/include/asm-powerpc/gpio.h b/include/asm-powerpc/gpio.h index 77ad3a890f30..ea04632399d8 100644 --- a/include/asm-powerpc/gpio.h +++ b/include/asm-powerpc/gpio.h | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <asm-generic/gpio.h> | 18 | #include <asm-generic/gpio.h> |
| 19 | 19 | ||
| 20 | #ifdef CONFIG_HAVE_GPIO_LIB | 20 | #ifdef CONFIG_GPIOLIB |
| 21 | 21 | ||
| 22 | /* | 22 | /* |
| 23 | * We don't (yet) implement inlined/rapid versions for on-chip gpios. | 23 | * We don't (yet) implement inlined/rapid versions for on-chip gpios. |
| @@ -51,6 +51,6 @@ static inline int irq_to_gpio(unsigned int irq) | |||
| 51 | return -EINVAL; | 51 | return -EINVAL; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | #endif /* CONFIG_HAVE_GPIO_LIB */ | 54 | #endif /* CONFIG_GPIOLIB */ |
| 55 | 55 | ||
| 56 | #endif /* __ASM_POWERPC_GPIO_H */ | 56 | #endif /* __ASM_POWERPC_GPIO_H */ |
diff --git a/include/asm-powerpc/hugetlb.h b/include/asm-powerpc/hugetlb.h index be32ff02f4a0..26f0d0ab27a5 100644 --- a/include/asm-powerpc/hugetlb.h +++ b/include/asm-powerpc/hugetlb.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, | 7 | int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, |
| 8 | unsigned long len); | 8 | unsigned long len); |
| 9 | 9 | ||
| 10 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | 10 | void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, |
| 11 | unsigned long end, unsigned long floor, | 11 | unsigned long end, unsigned long floor, |
| 12 | unsigned long ceiling); | 12 | unsigned long ceiling); |
| 13 | 13 | ||
| @@ -21,11 +21,13 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | |||
| 21 | * If the arch doesn't supply something else, assume that hugepage | 21 | * If the arch doesn't supply something else, assume that hugepage |
| 22 | * size aligned regions are ok without further preparation. | 22 | * size aligned regions are ok without further preparation. |
| 23 | */ | 23 | */ |
| 24 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | 24 | static inline int prepare_hugepage_range(struct file *file, |
| 25 | unsigned long addr, unsigned long len) | ||
| 25 | { | 26 | { |
| 26 | if (len & ~HPAGE_MASK) | 27 | struct hstate *h = hstate_file(file); |
| 28 | if (len & ~huge_page_mask(h)) | ||
| 27 | return -EINVAL; | 29 | return -EINVAL; |
| 28 | if (addr & ~HPAGE_MASK) | 30 | if (addr & ~huge_page_mask(h)) |
| 29 | return -EINVAL; | 31 | return -EINVAL; |
| 30 | return 0; | 32 | return 0; |
| 31 | } | 33 | } |
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index bf6cd7cb996c..fbe2932fa9e9 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h | |||
| @@ -92,6 +92,11 @@ | |||
| 92 | #define H_EXACT (1UL<<(63-24)) /* Use exact PTE or return H_PTEG_FULL */ | 92 | #define H_EXACT (1UL<<(63-24)) /* Use exact PTE or return H_PTEG_FULL */ |
| 93 | #define H_R_XLATE (1UL<<(63-25)) /* include a valid logical page num in the pte if the valid bit is set */ | 93 | #define H_R_XLATE (1UL<<(63-25)) /* include a valid logical page num in the pte if the valid bit is set */ |
| 94 | #define H_READ_4 (1UL<<(63-26)) /* Return 4 PTEs */ | 94 | #define H_READ_4 (1UL<<(63-26)) /* Return 4 PTEs */ |
| 95 | #define H_PAGE_STATE_CHANGE (1UL<<(63-28)) | ||
| 96 | #define H_PAGE_UNUSED ((1UL<<(63-29)) | (1UL<<(63-30))) | ||
| 97 | #define H_PAGE_SET_UNUSED (H_PAGE_STATE_CHANGE | H_PAGE_UNUSED) | ||
| 98 | #define H_PAGE_SET_LOANED (H_PAGE_SET_UNUSED | (1UL<<(63-31))) | ||
| 99 | #define H_PAGE_SET_ACTIVE H_PAGE_STATE_CHANGE | ||
| 95 | #define H_AVPN (1UL<<(63-32)) /* An avpn is provided as a sanity test */ | 100 | #define H_AVPN (1UL<<(63-32)) /* An avpn is provided as a sanity test */ |
| 96 | #define H_ANDCOND (1UL<<(63-33)) | 101 | #define H_ANDCOND (1UL<<(63-33)) |
| 97 | #define H_ICACHE_INVALIDATE (1UL<<(63-40)) /* icbi, etc. (ignored for IO pages) */ | 102 | #define H_ICACHE_INVALIDATE (1UL<<(63-40)) /* icbi, etc. (ignored for IO pages) */ |
| @@ -210,7 +215,9 @@ | |||
| 210 | #define H_JOIN 0x298 | 215 | #define H_JOIN 0x298 |
| 211 | #define H_VASI_STATE 0x2A4 | 216 | #define H_VASI_STATE 0x2A4 |
| 212 | #define H_ENABLE_CRQ 0x2B0 | 217 | #define H_ENABLE_CRQ 0x2B0 |
| 213 | #define MAX_HCALL_OPCODE H_ENABLE_CRQ | 218 | #define H_SET_MPP 0x2D0 |
| 219 | #define H_GET_MPP 0x2D4 | ||
| 220 | #define MAX_HCALL_OPCODE H_GET_MPP | ||
| 214 | 221 | ||
| 215 | #ifndef __ASSEMBLY__ | 222 | #ifndef __ASSEMBLY__ |
| 216 | 223 | ||
| @@ -270,6 +277,20 @@ struct hcall_stats { | |||
| 270 | }; | 277 | }; |
| 271 | #define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1) | 278 | #define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1) |
| 272 | 279 | ||
| 280 | struct hvcall_mpp_data { | ||
| 281 | unsigned long entitled_mem; | ||
| 282 | unsigned long mapped_mem; | ||
| 283 | unsigned short group_num; | ||
| 284 | unsigned short pool_num; | ||
| 285 | unsigned char mem_weight; | ||
| 286 | unsigned char unallocated_mem_weight; | ||
| 287 | unsigned long unallocated_entitlement; /* value in bytes */ | ||
| 288 | unsigned long pool_size; | ||
| 289 | signed long loan_request; | ||
| 290 | unsigned long backing_mem; | ||
| 291 | }; | ||
| 292 | |||
| 293 | int h_get_mpp(struct hvcall_mpp_data *); | ||
| 273 | #endif /* __ASSEMBLY__ */ | 294 | #endif /* __ASSEMBLY__ */ |
| 274 | #endif /* __KERNEL__ */ | 295 | #endif /* __KERNEL__ */ |
| 275 | #endif /* _ASM_POWERPC_HVCALL_H */ | 296 | #endif /* _ASM_POWERPC_HVCALL_H */ |
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h index 3d90bf7d3d73..1aaf27be8741 100644 --- a/include/asm-powerpc/ide.h +++ b/include/asm-powerpc/ide.h | |||
| @@ -14,14 +14,6 @@ | |||
| 14 | #endif | 14 | #endif |
| 15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
| 16 | 16 | ||
| 17 | #ifndef MAX_HWIFS | ||
| 18 | #ifdef __powerpc64__ | ||
| 19 | #define MAX_HWIFS 10 | ||
| 20 | #else | ||
| 21 | #define MAX_HWIFS 8 | ||
| 22 | #endif | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c)) | 17 | #define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c)) |
| 26 | #define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c)) | 18 | #define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c)) |
| 27 | #define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c)) | 19 | #define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c)) |
| @@ -40,16 +32,6 @@ static __inline__ int ide_default_irq(unsigned long base) | |||
| 40 | case 0x170: return 15; | 32 | case 0x170: return 15; |
| 41 | } | 33 | } |
| 42 | #endif | 34 | #endif |
| 43 | #ifdef CONFIG_PPC_PREP | ||
| 44 | switch (base) { | ||
| 45 | case 0x1f0: return 13; | ||
| 46 | case 0x170: return 13; | ||
| 47 | case 0x1e8: return 11; | ||
| 48 | case 0x168: return 10; | ||
| 49 | case 0xfff0: return 14; /* MCP(N)750 ide0 */ | ||
| 50 | case 0xffe0: return 15; /* MCP(N)750 ide1 */ | ||
| 51 | } | ||
| 52 | #endif | ||
| 53 | return 0; | 35 | return 0; |
| 54 | } | 36 | } |
| 55 | 37 | ||
| @@ -62,14 +44,6 @@ static __inline__ unsigned long ide_default_io_base(int index) | |||
| 62 | case 1: return 0x170; | 44 | case 1: return 0x170; |
| 63 | } | 45 | } |
| 64 | #endif | 46 | #endif |
| 65 | #ifdef CONFIG_PPC_PREP | ||
| 66 | switch (index) { | ||
| 67 | case 0: return 0x1f0; | ||
| 68 | case 1: return 0x170; | ||
| 69 | case 2: return 0x1e8; | ||
| 70 | case 3: return 0x168; | ||
| 71 | } | ||
| 72 | #endif | ||
| 73 | return 0; | 47 | return 0; |
| 74 | } | 48 | } |
| 75 | 49 | ||
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 8b627823f5f9..77c7fa025e65 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
| @@ -617,7 +617,8 @@ static inline void iosync(void) | |||
| 617 | * and can be hooked by the platform via ppc_md | 617 | * and can be hooked by the platform via ppc_md |
| 618 | * | 618 | * |
| 619 | * * ioremap_flags allows to specify the page flags as an argument and can | 619 | * * ioremap_flags allows to specify the page flags as an argument and can |
| 620 | * also be hooked by the platform via ppc_md | 620 | * also be hooked by the platform via ppc_md. ioremap_prot is the exact |
| 621 | * same thing as ioremap_flags. | ||
| 621 | * | 622 | * |
| 622 | * * ioremap_nocache is identical to ioremap | 623 | * * ioremap_nocache is identical to ioremap |
| 623 | * | 624 | * |
| @@ -639,6 +640,8 @@ extern void __iomem *ioremap(phys_addr_t address, unsigned long size); | |||
| 639 | extern void __iomem *ioremap_flags(phys_addr_t address, unsigned long size, | 640 | extern void __iomem *ioremap_flags(phys_addr_t address, unsigned long size, |
| 640 | unsigned long flags); | 641 | unsigned long flags); |
| 641 | #define ioremap_nocache(addr, size) ioremap((addr), (size)) | 642 | #define ioremap_nocache(addr, size) ioremap((addr), (size)) |
| 643 | #define ioremap_prot(addr, size, prot) ioremap_flags((addr), (size), (prot)) | ||
| 644 | |||
| 642 | extern void iounmap(volatile void __iomem *addr); | 645 | extern void iounmap(volatile void __iomem *addr); |
| 643 | 646 | ||
| 644 | extern void __iomem *__ioremap(phys_addr_t, unsigned long size, | 647 | extern void __iomem *__ioremap(phys_addr_t, unsigned long size, |
diff --git a/include/asm-powerpc/lppaca.h b/include/asm-powerpc/lppaca.h index 567ed92cd91f..2fe268b10333 100644 --- a/include/asm-powerpc/lppaca.h +++ b/include/asm-powerpc/lppaca.h | |||
| @@ -125,7 +125,10 @@ struct lppaca { | |||
| 125 | // NOTE: This value will ALWAYS be zero for dedicated processors and | 125 | // NOTE: This value will ALWAYS be zero for dedicated processors and |
| 126 | // will NEVER be zero for shared processors (ie, initialized to a 1). | 126 | // will NEVER be zero for shared processors (ie, initialized to a 1). |
| 127 | volatile u32 yield_count; // PLIC increments each dispatchx00-x03 | 127 | volatile u32 yield_count; // PLIC increments each dispatchx00-x03 |
| 128 | u8 reserved6[124]; // Reserved x04-x7F | 128 | u32 reserved6; |
| 129 | volatile u64 cmo_faults; // CMO page fault count x08-x0F | ||
| 130 | volatile u64 cmo_fault_time; // CMO page fault time x10-x17 | ||
| 131 | u8 reserved7[104]; // Reserved x18-x7F | ||
| 129 | 132 | ||
| 130 | //============================================================================= | 133 | //============================================================================= |
| 131 | // CACHE_LINE_4-5 0x0180 - 0x027F Contains PMC interrupt data | 134 | // CACHE_LINE_4-5 0x0180 - 0x027F Contains PMC interrupt data |
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 1233d735fd28..893aafd87fde 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
| @@ -76,7 +76,7 @@ struct machdep_calls { | |||
| 76 | * destroyed as well */ | 76 | * destroyed as well */ |
| 77 | void (*hpte_clear_all)(void); | 77 | void (*hpte_clear_all)(void); |
| 78 | 78 | ||
| 79 | void (*tce_build)(struct iommu_table * tbl, | 79 | int (*tce_build)(struct iommu_table *tbl, |
| 80 | long index, | 80 | long index, |
| 81 | long npages, | 81 | long npages, |
| 82 | unsigned long uaddr, | 82 | unsigned long uaddr, |
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h index d1dc16afb118..19c7a9403490 100644 --- a/include/asm-powerpc/mmu-hash64.h +++ b/include/asm-powerpc/mmu-hash64.h | |||
| @@ -194,9 +194,9 @@ extern int mmu_ci_restrictions; | |||
| 194 | 194 | ||
| 195 | #ifdef CONFIG_HUGETLB_PAGE | 195 | #ifdef CONFIG_HUGETLB_PAGE |
| 196 | /* | 196 | /* |
| 197 | * The page size index of the huge pages for use by hugetlbfs | 197 | * The page size indexes of the huge pages for use by hugetlbfs |
| 198 | */ | 198 | */ |
| 199 | extern int mmu_huge_psize; | 199 | extern unsigned int mmu_huge_psizes[MMU_PAGE_COUNT]; |
| 200 | 200 | ||
| 201 | #endif /* CONFIG_HUGETLB_PAGE */ | 201 | #endif /* CONFIG_HUGETLB_PAGE */ |
| 202 | 202 | ||
| @@ -281,6 +281,8 @@ extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
| 281 | unsigned long pstart, unsigned long mode, | 281 | unsigned long pstart, unsigned long mode, |
| 282 | int psize, int ssize); | 282 | int psize, int ssize); |
| 283 | extern void set_huge_psize(int psize); | 283 | extern void set_huge_psize(int psize); |
| 284 | extern void add_gpage(unsigned long addr, unsigned long page_size, | ||
| 285 | unsigned long number_of_pages); | ||
| 284 | extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr); | 286 | extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr); |
| 285 | 287 | ||
| 286 | extern void htab_initialize(void); | 288 | extern void htab_initialize(void); |
diff --git a/include/asm-powerpc/mpc52xx_psc.h b/include/asm-powerpc/mpc52xx_psc.h index 710c5d36efaa..8917ed630565 100644 --- a/include/asm-powerpc/mpc52xx_psc.h +++ b/include/asm-powerpc/mpc52xx_psc.h | |||
| @@ -60,10 +60,12 @@ | |||
| 60 | #define MPC52xx_PSC_RXTX_FIFO_ALARM 0x0002 | 60 | #define MPC52xx_PSC_RXTX_FIFO_ALARM 0x0002 |
| 61 | #define MPC52xx_PSC_RXTX_FIFO_EMPTY 0x0001 | 61 | #define MPC52xx_PSC_RXTX_FIFO_EMPTY 0x0001 |
| 62 | 62 | ||
| 63 | /* PSC interrupt mask bits */ | 63 | /* PSC interrupt status/mask bits */ |
| 64 | #define MPC52xx_PSC_IMR_TXRDY 0x0100 | 64 | #define MPC52xx_PSC_IMR_TXRDY 0x0100 |
| 65 | #define MPC52xx_PSC_IMR_RXRDY 0x0200 | 65 | #define MPC52xx_PSC_IMR_RXRDY 0x0200 |
| 66 | #define MPC52xx_PSC_IMR_DB 0x0400 | 66 | #define MPC52xx_PSC_IMR_DB 0x0400 |
| 67 | #define MPC52xx_PSC_IMR_TXEMP 0x0800 | ||
| 68 | #define MPC52xx_PSC_IMR_ORERR 0x1000 | ||
| 67 | #define MPC52xx_PSC_IMR_IPC 0x8000 | 69 | #define MPC52xx_PSC_IMR_IPC 0x8000 |
| 68 | 70 | ||
| 69 | /* PSC input port change bit */ | 71 | /* PSC input port change bit */ |
| @@ -92,6 +94,34 @@ | |||
| 92 | 94 | ||
| 93 | #define MPC52xx_PSC_RFNUM_MASK 0x01ff | 95 | #define MPC52xx_PSC_RFNUM_MASK 0x01ff |
| 94 | 96 | ||
| 97 | #define MPC52xx_PSC_SICR_DTS1 (1 << 29) | ||
| 98 | #define MPC52xx_PSC_SICR_SHDR (1 << 28) | ||
| 99 | #define MPC52xx_PSC_SICR_SIM_MASK (0xf << 24) | ||
| 100 | #define MPC52xx_PSC_SICR_SIM_UART (0x0 << 24) | ||
| 101 | #define MPC52xx_PSC_SICR_SIM_UART_DCD (0x8 << 24) | ||
| 102 | #define MPC52xx_PSC_SICR_SIM_CODEC_8 (0x1 << 24) | ||
| 103 | #define MPC52xx_PSC_SICR_SIM_CODEC_16 (0x2 << 24) | ||
| 104 | #define MPC52xx_PSC_SICR_SIM_AC97 (0x3 << 24) | ||
| 105 | #define MPC52xx_PSC_SICR_SIM_SIR (0x8 << 24) | ||
| 106 | #define MPC52xx_PSC_SICR_SIM_SIR_DCD (0xc << 24) | ||
| 107 | #define MPC52xx_PSC_SICR_SIM_MIR (0x5 << 24) | ||
| 108 | #define MPC52xx_PSC_SICR_SIM_FIR (0x6 << 24) | ||
| 109 | #define MPC52xx_PSC_SICR_SIM_CODEC_24 (0x7 << 24) | ||
| 110 | #define MPC52xx_PSC_SICR_SIM_CODEC_32 (0xf << 24) | ||
| 111 | #define MPC52xx_PSC_SICR_GENCLK (1 << 23) | ||
| 112 | #define MPC52xx_PSC_SICR_I2S (1 << 22) | ||
| 113 | #define MPC52xx_PSC_SICR_CLKPOL (1 << 21) | ||
| 114 | #define MPC52xx_PSC_SICR_SYNCPOL (1 << 20) | ||
| 115 | #define MPC52xx_PSC_SICR_CELLSLAVE (1 << 19) | ||
| 116 | #define MPC52xx_PSC_SICR_CELL2XCLK (1 << 18) | ||
| 117 | #define MPC52xx_PSC_SICR_ESAI (1 << 17) | ||
| 118 | #define MPC52xx_PSC_SICR_ENAC97 (1 << 16) | ||
| 119 | #define MPC52xx_PSC_SICR_SPI (1 << 15) | ||
| 120 | #define MPC52xx_PSC_SICR_MSTR (1 << 14) | ||
| 121 | #define MPC52xx_PSC_SICR_CPOL (1 << 13) | ||
| 122 | #define MPC52xx_PSC_SICR_CPHA (1 << 12) | ||
| 123 | #define MPC52xx_PSC_SICR_USEEOF (1 << 11) | ||
| 124 | #define MPC52xx_PSC_SICR_DISABLEEOF (1 << 10) | ||
| 95 | 125 | ||
| 96 | /* Structure of the hardware registers */ | 126 | /* Structure of the hardware registers */ |
| 97 | struct mpc52xx_psc { | 127 | struct mpc52xx_psc { |
| @@ -132,8 +162,12 @@ struct mpc52xx_psc { | |||
| 132 | u8 reserved5[3]; | 162 | u8 reserved5[3]; |
| 133 | u8 ctlr; /* PSC + 0x1c */ | 163 | u8 ctlr; /* PSC + 0x1c */ |
| 134 | u8 reserved6[3]; | 164 | u8 reserved6[3]; |
| 135 | u16 ccr; /* PSC + 0x20 */ | 165 | /* BitClkDiv field of CCR is byte swapped in |
| 136 | u8 reserved7[14]; | 166 | * the hardware for mpc5200/b compatibility */ |
| 167 | u32 ccr; /* PSC + 0x20 */ | ||
| 168 | u32 ac97_slots; /* PSC + 0x24 */ | ||
| 169 | u32 ac97_cmd; /* PSC + 0x28 */ | ||
| 170 | u32 ac97_data; /* PSC + 0x2c */ | ||
| 137 | u8 ivr; /* PSC + 0x30 */ | 171 | u8 ivr; /* PSC + 0x30 */ |
| 138 | u8 reserved8[3]; | 172 | u8 reserved8[3]; |
| 139 | u8 ip; /* PSC + 0x34 */ | 173 | u8 ip; /* PSC + 0x34 */ |
diff --git a/include/asm-powerpc/namei.h b/include/asm-powerpc/namei.h deleted file mode 100644 index 657443474a6a..000000000000 --- a/include/asm-powerpc/namei.h +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | #ifndef _ASM_POWERPC_NAMEI_H | ||
| 2 | #define _ASM_POWERPC_NAMEI_H | ||
| 3 | |||
| 4 | #ifdef __KERNEL__ | ||
| 5 | |||
| 6 | /* | ||
| 7 | * Adapted from include/asm-alpha/namei.h | ||
| 8 | * | ||
| 9 | * Included from fs/namei.c | ||
| 10 | */ | ||
| 11 | |||
| 12 | /* This dummy routine maybe changed to something useful | ||
| 13 | * for /usr/gnemul/ emulation stuff. | ||
| 14 | * Look at asm-sparc/namei.h for details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #define __emul_prefix() NULL | ||
| 18 | |||
| 19 | #endif /* __KERNEL__ */ | ||
| 20 | #endif /* _ASM_POWERPC_NAMEI_H */ | ||
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h index cffdf0eb0df6..e088545cb3f5 100644 --- a/include/asm-powerpc/page.h +++ b/include/asm-powerpc/page.h | |||
| @@ -119,9 +119,6 @@ extern phys_addr_t kernstart_addr; | |||
| 119 | /* align addr on a size boundary - adjust address up if needed */ | 119 | /* align addr on a size boundary - adjust address up if needed */ |
| 120 | #define _ALIGN(addr,size) _ALIGN_UP(addr,size) | 120 | #define _ALIGN(addr,size) _ALIGN_UP(addr,size) |
| 121 | 121 | ||
| 122 | /* to align the pointer to the (next) page boundary */ | ||
| 123 | #define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) | ||
| 124 | |||
| 125 | /* | 122 | /* |
| 126 | * Don't compare things with KERNELBASE or PAGE_OFFSET to test for | 123 | * Don't compare things with KERNELBASE or PAGE_OFFSET to test for |
| 127 | * "kernelness", use is_kernel_addr() - it should do what you want. | 124 | * "kernelness", use is_kernel_addr() - it should do what you want. |
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h index 02fd80710e9d..043bfdfe4f73 100644 --- a/include/asm-powerpc/page_64.h +++ b/include/asm-powerpc/page_64.h | |||
| @@ -90,6 +90,7 @@ extern unsigned int HPAGE_SHIFT; | |||
| 90 | #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) | 90 | #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) |
| 91 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | 91 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) |
| 92 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | 92 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
| 93 | #define HUGE_MAX_HSTATE 3 | ||
| 93 | 94 | ||
| 94 | #endif /* __ASSEMBLY__ */ | 95 | #endif /* __ASSEMBLY__ */ |
| 95 | 96 | ||
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h index 68980990f62a..812a1d8f35cb 100644 --- a/include/asm-powerpc/pgalloc-64.h +++ b/include/asm-powerpc/pgalloc-64.h | |||
| @@ -22,7 +22,7 @@ extern struct kmem_cache *pgtable_cache[]; | |||
| 22 | #define PUD_CACHE_NUM 1 | 22 | #define PUD_CACHE_NUM 1 |
| 23 | #define PMD_CACHE_NUM 1 | 23 | #define PMD_CACHE_NUM 1 |
| 24 | #define HUGEPTE_CACHE_NUM 2 | 24 | #define HUGEPTE_CACHE_NUM 2 |
| 25 | #define PTE_NONCACHE_NUM 3 /* from GFP rather than kmem_cache */ | 25 | #define PTE_NONCACHE_NUM 7 /* from GFP rather than kmem_cache */ |
| 26 | 26 | ||
| 27 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 27 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
| 28 | { | 28 | { |
| @@ -119,7 +119,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) | |||
| 119 | __free_page(ptepage); | 119 | __free_page(ptepage); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | #define PGF_CACHENUM_MASK 0x3 | 122 | #define PGF_CACHENUM_MASK 0x7 |
| 123 | 123 | ||
| 124 | typedef struct pgtable_free { | 124 | typedef struct pgtable_free { |
| 125 | unsigned long val; | 125 | unsigned long val; |
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h index fd2090dc1dce..c9601dfb4a1e 100644 --- a/include/asm-powerpc/pgtable-4k.h +++ b/include/asm-powerpc/pgtable-4k.h | |||
| @@ -51,6 +51,9 @@ | |||
| 51 | #define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | \ | 51 | #define _PAGE_HPTEFLAGS (_PAGE_BUSY | _PAGE_HASHPTE | \ |
| 52 | _PAGE_SECONDARY | _PAGE_GROUP_IX) | 52 | _PAGE_SECONDARY | _PAGE_GROUP_IX) |
| 53 | 53 | ||
| 54 | /* There is no 4K PFN hack on 4K pages */ | ||
| 55 | #define _PAGE_4K_PFN 0 | ||
| 56 | |||
| 54 | /* PAGE_MASK gives the right answer below, but only by accident */ | 57 | /* PAGE_MASK gives the right answer below, but only by accident */ |
| 55 | /* It should be preserving the high 48 bits and then specifically */ | 58 | /* It should be preserving the high 48 bits and then specifically */ |
| 56 | /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ | 59 | /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ |
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h index c5007712473f..7e54adb35596 100644 --- a/include/asm-powerpc/pgtable-64k.h +++ b/include/asm-powerpc/pgtable-64k.h | |||
| @@ -138,7 +138,7 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd) | |||
| 138 | unsigned __split = (psize == MMU_PAGE_4K || \ | 138 | unsigned __split = (psize == MMU_PAGE_4K || \ |
| 139 | psize == MMU_PAGE_64K_AP); \ | 139 | psize == MMU_PAGE_64K_AP); \ |
| 140 | shift = mmu_psize_defs[psize].shift; \ | 140 | shift = mmu_psize_defs[psize].shift; \ |
| 141 | for (index = 0; va < __end; index++, va += (1 << shift)) { \ | 141 | for (index = 0; va < __end; index++, va += (1L << shift)) { \ |
| 142 | if (!__split || __rpte_sub_valid(rpte, index)) do { \ | 142 | if (!__split || __rpte_sub_valid(rpte, index)) do { \ |
| 143 | 143 | ||
| 144 | #define pte_iterate_hashed_end() } while(0); } } while(0) | 144 | #define pte_iterate_hashed_end() } while(0); } } while(0) |
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h index 3a96d001cb75..bdbab72f3ebc 100644 --- a/include/asm-powerpc/pgtable-ppc32.h +++ b/include/asm-powerpc/pgtable-ppc32.h | |||
| @@ -395,6 +395,12 @@ extern int icache_44x_need_flush; | |||
| 395 | #ifndef _PAGE_EXEC | 395 | #ifndef _PAGE_EXEC |
| 396 | #define _PAGE_EXEC 0 | 396 | #define _PAGE_EXEC 0 |
| 397 | #endif | 397 | #endif |
| 398 | #ifndef _PAGE_ENDIAN | ||
| 399 | #define _PAGE_ENDIAN 0 | ||
| 400 | #endif | ||
| 401 | #ifndef _PAGE_COHERENT | ||
| 402 | #define _PAGE_COHERENT 0 | ||
| 403 | #endif | ||
| 398 | #ifndef _PMD_PRESENT_MASK | 404 | #ifndef _PMD_PRESENT_MASK |
| 399 | #define _PMD_PRESENT_MASK _PMD_PRESENT | 405 | #define _PMD_PRESENT_MASK _PMD_PRESENT |
| 400 | #endif | 406 | #endif |
| @@ -405,6 +411,12 @@ extern int icache_44x_need_flush; | |||
| 405 | 411 | ||
| 406 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) | 412 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) |
| 407 | 413 | ||
| 414 | |||
| 415 | #define PAGE_PROT_BITS __pgprot(_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ | ||
| 416 | _PAGE_WRITETHRU | _PAGE_ENDIAN | \ | ||
| 417 | _PAGE_USER | _PAGE_ACCESSED | \ | ||
| 418 | _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \ | ||
| 419 | _PAGE_EXEC | _PAGE_HWEXEC) | ||
| 408 | /* | 420 | /* |
| 409 | * Note: the _PAGE_COHERENT bit automatically gets set in the hardware | 421 | * Note: the _PAGE_COHERENT bit automatically gets set in the hardware |
| 410 | * PTE if CONFIG_SMP is defined (hash_page does this); there is no need | 422 | * PTE if CONFIG_SMP is defined (hash_page does this); there is no need |
| @@ -538,6 +550,10 @@ static inline pte_t pte_mkyoung(pte_t pte) { | |||
| 538 | pte_val(pte) |= _PAGE_ACCESSED; return pte; } | 550 | pte_val(pte) |= _PAGE_ACCESSED; return pte; } |
| 539 | static inline pte_t pte_mkspecial(pte_t pte) { | 551 | static inline pte_t pte_mkspecial(pte_t pte) { |
| 540 | return pte; } | 552 | return pte; } |
| 553 | static inline unsigned long pte_pgprot(pte_t pte) | ||
| 554 | { | ||
| 555 | return __pgprot(pte_val(pte)) & PAGE_PROT_BITS; | ||
| 556 | } | ||
| 541 | 557 | ||
| 542 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 558 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
| 543 | { | 559 | { |
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index ab98a9c80b28..ba8000352b9a 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
| @@ -117,6 +117,10 @@ | |||
| 117 | #define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE) | 117 | #define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE) |
| 118 | #define HAVE_PAGE_AGP | 118 | #define HAVE_PAGE_AGP |
| 119 | 119 | ||
| 120 | #define PAGE_PROT_BITS __pgprot(_PAGE_GUARDED | _PAGE_COHERENT | \ | ||
| 121 | _PAGE_NO_CACHE | _PAGE_WRITETHRU | \ | ||
| 122 | _PAGE_4K_PFN | _PAGE_RW | _PAGE_USER | \ | ||
| 123 | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC) | ||
| 120 | /* PTEIDX nibble */ | 124 | /* PTEIDX nibble */ |
| 121 | #define _PTEIDX_SECONDARY 0x8 | 125 | #define _PTEIDX_SECONDARY 0x8 |
| 122 | #define _PTEIDX_GROUP_IX 0x7 | 126 | #define _PTEIDX_GROUP_IX 0x7 |
| @@ -262,6 +266,10 @@ static inline pte_t pte_mkhuge(pte_t pte) { | |||
| 262 | return pte; } | 266 | return pte; } |
| 263 | static inline pte_t pte_mkspecial(pte_t pte) { | 267 | static inline pte_t pte_mkspecial(pte_t pte) { |
| 264 | return pte; } | 268 | return pte; } |
| 269 | static inline unsigned long pte_pgprot(pte_t pte) | ||
| 270 | { | ||
| 271 | return __pgprot(pte_val(pte)) & PAGE_PROT_BITS; | ||
| 272 | } | ||
| 265 | 273 | ||
| 266 | /* Atomic PTE updates */ | 274 | /* Atomic PTE updates */ |
| 267 | static inline unsigned long pte_update(struct mm_struct *mm, | 275 | static inline unsigned long pte_update(struct mm_struct *mm, |
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h index d18ffe7bc7c4..dbb8ca172e44 100644 --- a/include/asm-powerpc/pgtable.h +++ b/include/asm-powerpc/pgtable.h | |||
| @@ -38,6 +38,19 @@ extern void paging_init(void); | |||
| 38 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 38 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
| 39 | 39 | ||
| 40 | #include <asm-generic/pgtable.h> | 40 | #include <asm-generic/pgtable.h> |
| 41 | |||
| 42 | |||
| 43 | /* | ||
| 44 | * This gets called at the end of handling a page fault, when | ||
| 45 | * the kernel has put a new PTE into the page table for the process. | ||
| 46 | * We use it to ensure coherency between the i-cache and d-cache | ||
| 47 | * for the page which has just been mapped in. | ||
| 48 | * On machines which use an MMU hash table, we use this to put a | ||
| 49 | * corresponding HPTE into the hash table ahead of time, instead of | ||
| 50 | * waiting for the inevitable extra hash-table miss exception. | ||
| 51 | */ | ||
| 52 | extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); | ||
| 53 | |||
| 41 | #endif /* __ASSEMBLY__ */ | 54 | #endif /* __ASSEMBLY__ */ |
| 42 | 55 | ||
| 43 | #endif /* __KERNEL__ */ | 56 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/semaphore.h b/include/asm-powerpc/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-powerpc/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-powerpc/syscalls.h b/include/asm-powerpc/syscalls.h index 2b8a458f990a..eb8eb400c664 100644 --- a/include/asm-powerpc/syscalls.h +++ b/include/asm-powerpc/syscalls.h | |||
| @@ -31,6 +31,7 @@ asmlinkage int sys_vfork(unsigned long p1, unsigned long p2, | |||
| 31 | unsigned long p3, unsigned long p4, unsigned long p5, | 31 | unsigned long p3, unsigned long p4, unsigned long p5, |
| 32 | unsigned long p6, struct pt_regs *regs); | 32 | unsigned long p6, struct pt_regs *regs); |
| 33 | asmlinkage long sys_pipe(int __user *fildes); | 33 | asmlinkage long sys_pipe(int __user *fildes); |
| 34 | asmlinkage long sys_pipe2(int __user *fildes, int flags); | ||
| 34 | asmlinkage long sys_rt_sigaction(int sig, | 35 | asmlinkage long sys_rt_sigaction(int sig, |
| 35 | const struct sigaction __user *act, | 36 | const struct sigaction __user *act, |
| 36 | struct sigaction __user *oact, size_t sigsetsize); | 37 | struct sigaction __user *oact, size_t sigsetsize); |
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h index ae7085c65692..e084272ed1c2 100644 --- a/include/asm-powerpc/systbl.h +++ b/include/asm-powerpc/systbl.h | |||
| @@ -316,3 +316,9 @@ COMPAT_SYS(fallocate) | |||
| 316 | SYSCALL(subpage_prot) | 316 | SYSCALL(subpage_prot) |
| 317 | COMPAT_SYS_SPU(timerfd_settime) | 317 | COMPAT_SYS_SPU(timerfd_settime) |
| 318 | COMPAT_SYS_SPU(timerfd_gettime) | 318 | COMPAT_SYS_SPU(timerfd_gettime) |
| 319 | COMPAT_SYS_SPU(signalfd4) | ||
| 320 | SYSCALL_SPU(eventfd2) | ||
| 321 | SYSCALL_SPU(epoll_create1) | ||
| 322 | SYSCALL_SPU(dup3) | ||
| 323 | SYSCALL_SPU(pipe2) | ||
| 324 | SYSCALL(inotify_init1) | ||
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index e6e25e2364eb..d6648c143322 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
| @@ -110,6 +110,8 @@ static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; } | |||
| 110 | #endif | 110 | #endif |
| 111 | 111 | ||
| 112 | extern int set_dabr(unsigned long dabr); | 112 | extern int set_dabr(unsigned long dabr); |
| 113 | extern void do_dabr(struct pt_regs *regs, unsigned long address, | ||
| 114 | unsigned long error_code); | ||
| 113 | extern void print_backtrace(unsigned long *); | 115 | extern void print_backtrace(unsigned long *); |
| 114 | extern void show_regs(struct pt_regs * regs); | 116 | extern void show_regs(struct pt_regs * regs); |
| 115 | extern void flush_instruction_cache(void); | 117 | extern void flush_instruction_cache(void); |
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index b705c2a7651a..a9db562df69a 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
| @@ -66,20 +66,12 @@ struct thread_info { | |||
| 66 | 66 | ||
| 67 | #if THREAD_SHIFT >= PAGE_SHIFT | 67 | #if THREAD_SHIFT >= PAGE_SHIFT |
| 68 | 68 | ||
| 69 | #define THREAD_ORDER (THREAD_SHIFT - PAGE_SHIFT) | 69 | #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) |
| 70 | |||
| 71 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
| 72 | #define alloc_thread_info(tsk) \ | ||
| 73 | ((struct thread_info *)__get_free_pages(GFP_KERNEL | \ | ||
| 74 | __GFP_ZERO, THREAD_ORDER)) | ||
| 75 | #else | ||
| 76 | #define alloc_thread_info(tsk) \ | ||
| 77 | ((struct thread_info *)__get_free_pages(GFP_KERNEL, THREAD_ORDER)) | ||
| 78 | #endif | ||
| 79 | #define free_thread_info(ti) free_pages((unsigned long)ti, THREAD_ORDER) | ||
| 80 | 70 | ||
| 81 | #else /* THREAD_SHIFT < PAGE_SHIFT */ | 71 | #else /* THREAD_SHIFT < PAGE_SHIFT */ |
| 82 | 72 | ||
| 73 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 74 | |||
| 83 | extern struct thread_info *alloc_thread_info(struct task_struct *tsk); | 75 | extern struct thread_info *alloc_thread_info(struct task_struct *tsk); |
| 84 | extern void free_thread_info(struct thread_info *ti); | 76 | extern void free_thread_info(struct thread_info *ti); |
| 85 | 77 | ||
diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h index 5c9108147644..361cd5c7a32b 100644 --- a/include/asm-powerpc/tlbflush.h +++ b/include/asm-powerpc/tlbflush.h | |||
| @@ -162,16 +162,5 @@ extern void __flush_hash_table_range(struct mm_struct *mm, unsigned long start, | |||
| 162 | 162 | ||
| 163 | #endif | 163 | #endif |
| 164 | 164 | ||
| 165 | /* | ||
| 166 | * This gets called at the end of handling a page fault, when | ||
| 167 | * the kernel has put a new PTE into the page table for the process. | ||
| 168 | * We use it to ensure coherency between the i-cache and d-cache | ||
| 169 | * for the page which has just been mapped in. | ||
| 170 | * On machines which use an MMU hash table, we use this to put a | ||
| 171 | * corresponding HPTE into the hash table ahead of time, instead of | ||
| 172 | * waiting for the inevitable extra hash-table miss exception. | ||
| 173 | */ | ||
| 174 | extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); | ||
| 175 | |||
| 176 | #endif /*__KERNEL__ */ | 165 | #endif /*__KERNEL__ */ |
| 177 | #endif /* _ASM_POWERPC_TLBFLUSH_H */ | 166 | #endif /* _ASM_POWERPC_TLBFLUSH_H */ |
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index ce91bb662063..e07d0c76ed77 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
| @@ -335,10 +335,16 @@ | |||
| 335 | #define __NR_subpage_prot 310 | 335 | #define __NR_subpage_prot 310 |
| 336 | #define __NR_timerfd_settime 311 | 336 | #define __NR_timerfd_settime 311 |
| 337 | #define __NR_timerfd_gettime 312 | 337 | #define __NR_timerfd_gettime 312 |
| 338 | #define __NR_signalfd4 313 | ||
| 339 | #define __NR_eventfd2 314 | ||
| 340 | #define __NR_epoll_create1 315 | ||
| 341 | #define __NR_dup3 316 | ||
| 342 | #define __NR_pipe2 317 | ||
| 343 | #define __NR_inotify_init1 318 | ||
| 338 | 344 | ||
| 339 | #ifdef __KERNEL__ | 345 | #ifdef __KERNEL__ |
| 340 | 346 | ||
| 341 | #define __NR_syscalls 313 | 347 | #define __NR_syscalls 319 |
| 342 | 348 | ||
| 343 | #define __NR__exit __NR_exit | 349 | #define __NR__exit __NR_exit |
| 344 | #define NR_syscalls __NR_syscalls | 350 | #define NR_syscalls __NR_syscalls |
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h index 56512a968dab..0a290a195946 100644 --- a/include/asm-powerpc/vio.h +++ b/include/asm-powerpc/vio.h | |||
| @@ -39,16 +39,32 @@ | |||
| 39 | #define VIO_IRQ_DISABLE 0UL | 39 | #define VIO_IRQ_DISABLE 0UL |
| 40 | #define VIO_IRQ_ENABLE 1UL | 40 | #define VIO_IRQ_ENABLE 1UL |
| 41 | 41 | ||
| 42 | /* | ||
| 43 | * VIO CMO minimum entitlement for all devices and spare entitlement | ||
| 44 | */ | ||
| 45 | #define VIO_CMO_MIN_ENT 1562624 | ||
| 46 | |||
| 42 | struct iommu_table; | 47 | struct iommu_table; |
| 43 | 48 | ||
| 44 | /* | 49 | /** |
| 45 | * The vio_dev structure is used to describe virtual I/O devices. | 50 | * vio_dev - This structure is used to describe virtual I/O devices. |
| 51 | * | ||
| 52 | * @desired: set from return of driver's get_desired_dma() function | ||
| 53 | * @entitled: bytes of IO data that has been reserved for this device. | ||
| 54 | * @allocated: bytes of IO data currently in use by the device. | ||
| 55 | * @allocs_failed: number of DMA failures due to insufficient entitlement. | ||
| 46 | */ | 56 | */ |
| 47 | struct vio_dev { | 57 | struct vio_dev { |
| 48 | const char *name; | 58 | const char *name; |
| 49 | const char *type; | 59 | const char *type; |
| 50 | uint32_t unit_address; | 60 | uint32_t unit_address; |
| 51 | unsigned int irq; | 61 | unsigned int irq; |
| 62 | struct { | ||
| 63 | size_t desired; | ||
| 64 | size_t entitled; | ||
| 65 | size_t allocated; | ||
| 66 | atomic_t allocs_failed; | ||
| 67 | } cmo; | ||
| 52 | struct device dev; | 68 | struct device dev; |
| 53 | }; | 69 | }; |
| 54 | 70 | ||
| @@ -56,12 +72,19 @@ struct vio_driver { | |||
| 56 | const struct vio_device_id *id_table; | 72 | const struct vio_device_id *id_table; |
| 57 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | 73 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); |
| 58 | int (*remove)(struct vio_dev *dev); | 74 | int (*remove)(struct vio_dev *dev); |
| 75 | /* A driver must have a get_desired_dma() function to | ||
| 76 | * be loaded in a CMO environment if it uses DMA. | ||
| 77 | */ | ||
| 78 | unsigned long (*get_desired_dma)(struct vio_dev *dev); | ||
| 59 | struct device_driver driver; | 79 | struct device_driver driver; |
| 60 | }; | 80 | }; |
| 61 | 81 | ||
| 62 | extern int vio_register_driver(struct vio_driver *drv); | 82 | extern int vio_register_driver(struct vio_driver *drv); |
| 63 | extern void vio_unregister_driver(struct vio_driver *drv); | 83 | extern void vio_unregister_driver(struct vio_driver *drv); |
| 64 | 84 | ||
| 85 | extern int vio_cmo_entitlement_update(size_t); | ||
| 86 | extern void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired); | ||
| 87 | |||
| 65 | extern void __devinit vio_unregister_device(struct vio_dev *dev); | 88 | extern void __devinit vio_unregister_device(struct vio_dev *dev); |
| 66 | 89 | ||
| 67 | struct device_node; | 90 | struct device_node; |
diff --git a/include/asm-s390/Kbuild b/include/asm-s390/Kbuild index bb5e9edb9825..63a23415fba6 100644 --- a/include/asm-s390/Kbuild +++ b/include/asm-s390/Kbuild | |||
| @@ -7,7 +7,6 @@ header-y += tape390.h | |||
| 7 | header-y += ucontext.h | 7 | header-y += ucontext.h |
| 8 | header-y += vtoc.h | 8 | header-y += vtoc.h |
| 9 | header-y += zcrypt.h | 9 | header-y += zcrypt.h |
| 10 | header-y += kvm.h | ||
| 11 | header-y += chsc.h | 10 | header-y += chsc.h |
| 12 | 11 | ||
| 13 | unifdef-y += cmb.h | 12 | unifdef-y += cmb.h |
diff --git a/include/asm-s390/hugetlb.h b/include/asm-s390/hugetlb.h index 600a776f8f75..670a1d1745d2 100644 --- a/include/asm-s390/hugetlb.h +++ b/include/asm-s390/hugetlb.h | |||
| @@ -22,7 +22,8 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | |||
| 22 | * If the arch doesn't supply something else, assume that hugepage | 22 | * If the arch doesn't supply something else, assume that hugepage |
| 23 | * size aligned regions are ok without further preparation. | 23 | * size aligned regions are ok without further preparation. |
| 24 | */ | 24 | */ |
| 25 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | 25 | static inline int prepare_hugepage_range(struct file *file, |
| 26 | unsigned long addr, unsigned long len) | ||
| 26 | { | 27 | { |
| 27 | if (len & ~HPAGE_MASK) | 28 | if (len & ~HPAGE_MASK) |
| 28 | return -EINVAL; | 29 | return -EINVAL; |
diff --git a/include/asm-s390/kvm_virtio.h b/include/asm-s390/kvm_virtio.h index 5c871a990c29..146100224def 100644 --- a/include/asm-s390/kvm_virtio.h +++ b/include/asm-s390/kvm_virtio.h | |||
| @@ -50,4 +50,14 @@ struct kvm_vqconfig { | |||
| 50 | #define KVM_S390_VIRTIO_RESET 1 | 50 | #define KVM_S390_VIRTIO_RESET 1 |
| 51 | #define KVM_S390_VIRTIO_SET_STATUS 2 | 51 | #define KVM_S390_VIRTIO_SET_STATUS 2 |
| 52 | 52 | ||
| 53 | #ifdef __KERNEL__ | ||
| 54 | /* early virtio console setup */ | ||
| 55 | #ifdef CONFIG_VIRTIO_CONSOLE | ||
| 56 | extern void s390_virtio_console_init(void); | ||
| 57 | #else | ||
| 58 | static inline void s390_virtio_console_init(void) | ||
| 59 | { | ||
| 60 | } | ||
| 61 | #endif /* CONFIG_VIRTIO_CONSOLE */ | ||
| 62 | #endif /* __KERNEL__ */ | ||
| 53 | #endif | 63 | #endif |
diff --git a/include/asm-s390/namei.h b/include/asm-s390/namei.h deleted file mode 100644 index 3e286bdde4b0..000000000000 --- a/include/asm-s390/namei.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-s390/namei.h | ||
| 3 | * | ||
| 4 | * S390 version | ||
| 5 | * | ||
| 6 | * Derived from "include/asm-i386/namei.h" | ||
| 7 | * | ||
| 8 | * Included from linux/fs/namei.c | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __S390_NAMEI_H | ||
| 12 | #define __S390_NAMEI_H | ||
| 13 | |||
| 14 | /* This dummy routine maybe changed to something useful | ||
| 15 | * for /usr/gnemul/ emulation stuff. | ||
| 16 | * Look at asm-sparc/namei.h for details. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #define __emul_prefix() NULL | ||
| 20 | |||
| 21 | #endif /* __S390_NAMEI_H */ | ||
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h index 12fd9c4f0f15..991ba939408c 100644 --- a/include/asm-s390/page.h +++ b/include/asm-s390/page.h | |||
| @@ -138,9 +138,6 @@ void arch_alloc_page(struct page *page, int order); | |||
| 138 | 138 | ||
| 139 | #endif /* !__ASSEMBLY__ */ | 139 | #endif /* !__ASSEMBLY__ */ |
| 140 | 140 | ||
| 141 | /* to align the pointer to the (next) page boundary */ | ||
| 142 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 143 | |||
| 144 | #define __PAGE_OFFSET 0x0UL | 141 | #define __PAGE_OFFSET 0x0UL |
| 145 | #define PAGE_OFFSET 0x0UL | 142 | #define PAGE_OFFSET 0x0UL |
| 146 | #define __pa(x) (unsigned long)(x) | 143 | #define __pa(x) (unsigned long)(x) |
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-s390/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h index 99bbed99a3b2..91a8f93ad355 100644 --- a/include/asm-s390/thread_info.h +++ b/include/asm-s390/thread_info.h | |||
| @@ -78,10 +78,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 78 | return (struct thread_info *)((*(unsigned long *) __LC_KERNEL_STACK)-THREAD_SIZE); | 78 | return (struct thread_info *)((*(unsigned long *) __LC_KERNEL_STACK)-THREAD_SIZE); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | /* thread information allocation */ | 81 | #define THREAD_SIZE_ORDER THREAD_ORDER |
| 82 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
| 83 | __get_free_pages(GFP_KERNEL,THREAD_ORDER)) | ||
| 84 | #define free_thread_info(ti) free_pages((unsigned long) (ti),THREAD_ORDER) | ||
| 85 | 82 | ||
| 86 | #endif | 83 | #endif |
| 87 | 84 | ||
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h index 22cc419389fe..6c0b8a2de143 100644 --- a/include/asm-sh/dma-mapping.h +++ b/include/asm-sh/dma-mapping.h | |||
| @@ -171,7 +171,7 @@ static inline int dma_get_cache_alignment(void) | |||
| 171 | return L1_CACHE_BYTES; | 171 | return L1_CACHE_BYTES; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | static inline int dma_mapping_error(dma_addr_t dma_addr) | 174 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 175 | { | 175 | { |
| 176 | return dma_addr == 0; | 176 | return dma_addr == 0; |
| 177 | } | 177 | } |
diff --git a/include/asm-sh/hugetlb.h b/include/asm-sh/hugetlb.h index 02402303d89b..967068fb79ac 100644 --- a/include/asm-sh/hugetlb.h +++ b/include/asm-sh/hugetlb.h | |||
| @@ -14,7 +14,8 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, | |||
| 14 | * If the arch doesn't supply something else, assume that hugepage | 14 | * If the arch doesn't supply something else, assume that hugepage |
| 15 | * size aligned regions are ok without further preparation. | 15 | * size aligned regions are ok without further preparation. |
| 16 | */ | 16 | */ |
| 17 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | 17 | static inline int prepare_hugepage_range(struct file *file, |
| 18 | unsigned long addr, unsigned long len) | ||
| 18 | { | 19 | { |
| 19 | if (len & ~HPAGE_MASK) | 20 | if (len & ~HPAGE_MASK) |
| 20 | return -EINVAL; | 21 | return -EINVAL; |
| @@ -26,7 +27,7 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | |||
| 26 | static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) { | 27 | static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) { |
| 27 | } | 28 | } |
| 28 | 29 | ||
| 29 | static inline void hugetlb_free_pgd_range(struct mmu_gather **tlb, | 30 | static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, |
| 30 | unsigned long addr, unsigned long end, | 31 | unsigned long addr, unsigned long end, |
| 31 | unsigned long floor, | 32 | unsigned long floor, |
| 32 | unsigned long ceiling) | 33 | unsigned long ceiling) |
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h deleted file mode 100644 index 58e0bdd52be4..000000000000 --- a/include/asm-sh/ide.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-sh/ide.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* | ||
| 8 | * This file contains the i386 architecture specific IDE code. | ||
| 9 | * In future, SuperH code. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __ASM_SH_IDE_H | ||
| 13 | #define __ASM_SH_IDE_H | ||
| 14 | |||
| 15 | #ifdef __KERNEL__ | ||
| 16 | |||
| 17 | #include <asm-generic/ide_iops.h> | ||
| 18 | |||
| 19 | #endif /* __KERNEL__ */ | ||
| 20 | |||
| 21 | #endif /* __ASM_SH_IDE_H */ | ||
diff --git a/include/asm-sh/kvm.h b/include/asm-sh/kvm.h deleted file mode 100644 index 6af51dbab2d0..000000000000 --- a/include/asm-sh/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_SH_H | ||
| 2 | #define __LINUX_KVM_SH_H | ||
| 3 | |||
| 4 | /* sh does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-sh/namei.h b/include/asm-sh/namei.h deleted file mode 100644 index 338a5d947143..000000000000 --- a/include/asm-sh/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* $Id: namei.h,v 1.3 2000/07/04 06:24:49 gniibe Exp $ | ||
| 2 | * linux/include/asm-sh/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __ASM_SH_NAMEI_H | ||
| 8 | #define __ASM_SH_NAMEI_H | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif /* __ASM_SH_NAMEI_H */ | ||
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 304c30b5d947..5dc01d2fcc4c 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
| @@ -22,9 +22,6 @@ | |||
| 22 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 22 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
| 23 | #define PTE_MASK PAGE_MASK | 23 | #define PTE_MASK PAGE_MASK |
| 24 | 24 | ||
| 25 | /* to align the pointer to the (next) page boundary */ | ||
| 26 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 27 | |||
| 28 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | 25 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) |
| 29 | #define HPAGE_SHIFT 16 | 26 | #define HPAGE_SHIFT 16 |
| 30 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K) | 27 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K) |
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h index 8d6c92b3e770..7d36dc3bee69 100644 --- a/include/asm-sh/ptrace.h +++ b/include/asm-sh/ptrace.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * Copyright (C) 1999, 2000 Niibe Yutaka | 5 | * Copyright (C) 1999, 2000 Niibe Yutaka |
| 6 | * | 6 | * |
| 7 | */ | 7 | */ |
| 8 | #if defined(__SH5__) || defined(CONFIG_SUPERH64) | 8 | #if defined(__SH5__) |
| 9 | struct pt_regs { | 9 | struct pt_regs { |
| 10 | unsigned long long pc; | 10 | unsigned long long pc; |
| 11 | unsigned long long sr; | 11 | unsigned long long sr; |
diff --git a/include/asm-sh/semaphore.h b/include/asm-sh/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-sh/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-sh/sh7760fb.h b/include/asm-sh/sh7760fb.h new file mode 100644 index 000000000000..8767f61aceca --- /dev/null +++ b/include/asm-sh/sh7760fb.h | |||
| @@ -0,0 +1,197 @@ | |||
| 1 | /* | ||
| 2 | * sh7760fb.h -- platform data for SH7760/SH7763 LCDC framebuffer driver. | ||
| 3 | * | ||
| 4 | * (c) 2006-2008 MSC Vertriebsges.m.b.H., | ||
| 5 | * Manuel Lauss <mano@roarinelk.homelinux.net> | ||
| 6 | * (c) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _ASM_SH_SH7760FB_H | ||
| 10 | #define _ASM_SH_SH7760FB_H | ||
| 11 | |||
| 12 | /* | ||
| 13 | * some bits of the colormap registers should be written as zero. | ||
| 14 | * create a mask for that. | ||
| 15 | */ | ||
| 16 | #define SH7760FB_PALETTE_MASK 0x00f8fcf8 | ||
| 17 | |||
| 18 | /* The LCDC dma engine always sets bits 27-26 to 1: this is Area3 */ | ||
| 19 | #define SH7760FB_DMA_MASK 0x0C000000 | ||
| 20 | |||
| 21 | /* palette */ | ||
| 22 | #define LDPR(x) (((x) << 2)) | ||
| 23 | |||
| 24 | /* framebuffer registers and bits */ | ||
| 25 | #define LDICKR 0x400 | ||
| 26 | #define LDMTR 0x402 | ||
| 27 | /* see sh7760fb.h for LDMTR bits */ | ||
| 28 | #define LDDFR 0x404 | ||
| 29 | #define LDDFR_PABD (1 << 8) | ||
| 30 | #define LDDFR_COLOR_MASK 0x7F | ||
| 31 | #define LDSMR 0x406 | ||
| 32 | #define LDSMR_ROT (1 << 13) | ||
| 33 | #define LDSARU 0x408 | ||
| 34 | #define LDSARL 0x40c | ||
| 35 | #define LDLAOR 0x410 | ||
| 36 | #define LDPALCR 0x412 | ||
| 37 | #define LDPALCR_PALS (1 << 4) | ||
| 38 | #define LDPALCR_PALEN (1 << 0) | ||
| 39 | #define LDHCNR 0x414 | ||
| 40 | #define LDHSYNR 0x416 | ||
| 41 | #define LDVDLNR 0x418 | ||
| 42 | #define LDVTLNR 0x41a | ||
| 43 | #define LDVSYNR 0x41c | ||
| 44 | #define LDACLNR 0x41e | ||
| 45 | #define LDINTR 0x420 | ||
| 46 | #define LDPMMR 0x424 | ||
| 47 | #define LDPSPR 0x426 | ||
| 48 | #define LDCNTR 0x428 | ||
| 49 | #define LDCNTR_DON (1 << 0) | ||
| 50 | #define LDCNTR_DON2 (1 << 4) | ||
| 51 | |||
| 52 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
| 53 | # define LDLIRNR 0x440 | ||
| 54 | /* LDINTR bit */ | ||
| 55 | # define LDINTR_MINTEN (1 << 15) | ||
| 56 | # define LDINTR_FINTEN (1 << 14) | ||
| 57 | # define LDINTR_VSINTEN (1 << 13) | ||
| 58 | # define LDINTR_VEINTEN (1 << 12) | ||
| 59 | # define LDINTR_MINTS (1 << 11) | ||
| 60 | # define LDINTR_FINTS (1 << 10) | ||
| 61 | # define LDINTR_VSINTS (1 << 9) | ||
| 62 | # define LDINTR_VEINTS (1 << 8) | ||
| 63 | # define VINT_START (LDINTR_VSINTEN) | ||
| 64 | # define VINT_CHECK (LDINTR_VSINTS) | ||
| 65 | #else | ||
| 66 | /* LDINTR bit */ | ||
| 67 | # define LDINTR_VINTSEL (1 << 12) | ||
| 68 | # define LDINTR_VINTE (1 << 8) | ||
| 69 | # define LDINTR_VINTS (1 << 0) | ||
| 70 | # define VINT_START (LDINTR_VINTSEL) | ||
| 71 | # define VINT_CHECK (LDINTR_VINTS) | ||
| 72 | #endif | ||
| 73 | |||
| 74 | /* HSYNC polarity inversion */ | ||
| 75 | #define LDMTR_FLMPOL (1 << 15) | ||
| 76 | |||
| 77 | /* VSYNC polarity inversion */ | ||
| 78 | #define LDMTR_CL1POL (1 << 14) | ||
| 79 | |||
| 80 | /* DISPLAY-ENABLE polarity inversion */ | ||
| 81 | #define LDMTR_DISPEN_LOWACT (1 << 13) | ||
| 82 | |||
| 83 | /* DISPLAY DATA BUS polarity inversion */ | ||
| 84 | #define LDMTR_DPOL_LOWACT (1 << 12) | ||
| 85 | |||
| 86 | /* AC modulation signal enable */ | ||
| 87 | #define LDMTR_MCNT (1 << 10) | ||
| 88 | |||
| 89 | /* Disable output of HSYNC during VSYNC period */ | ||
| 90 | #define LDMTR_CL1CNT (1 << 9) | ||
| 91 | |||
| 92 | /* Disable output of VSYNC during VSYNC period */ | ||
| 93 | #define LDMTR_CL2CNT (1 << 8) | ||
| 94 | |||
| 95 | /* Display types supported by the LCDC */ | ||
| 96 | #define LDMTR_STN_MONO_4 0x00 | ||
| 97 | #define LDMTR_STN_MONO_8 0x01 | ||
| 98 | #define LDMTR_STN_COLOR_4 0x08 | ||
| 99 | #define LDMTR_STN_COLOR_8 0x09 | ||
| 100 | #define LDMTR_STN_COLOR_12 0x0A | ||
| 101 | #define LDMTR_STN_COLOR_16 0x0B | ||
| 102 | #define LDMTR_DSTN_MONO_8 0x11 | ||
| 103 | #define LDMTR_DSTN_MONO_16 0x13 | ||
| 104 | #define LDMTR_DSTN_COLOR_8 0x19 | ||
| 105 | #define LDMTR_DSTN_COLOR_12 0x1A | ||
| 106 | #define LDMTR_DSTN_COLOR_16 0x1B | ||
| 107 | #define LDMTR_TFT_COLOR_16 0x2B | ||
| 108 | |||
| 109 | /* framebuffer color layout */ | ||
| 110 | #define LDDFR_1BPP_MONO 0x00 | ||
| 111 | #define LDDFR_2BPP_MONO 0x01 | ||
| 112 | #define LDDFR_4BPP_MONO 0x02 | ||
| 113 | #define LDDFR_6BPP_MONO 0x04 | ||
| 114 | #define LDDFR_4BPP 0x0A | ||
| 115 | #define LDDFR_8BPP 0x0C | ||
| 116 | #define LDDFR_16BPP_RGB555 0x1D | ||
| 117 | #define LDDFR_16BPP_RGB565 0x2D | ||
| 118 | |||
| 119 | /* LCDC Pixclock sources */ | ||
| 120 | #define LCDC_CLKSRC_BUSCLOCK 0 | ||
| 121 | #define LCDC_CLKSRC_PERIPHERAL 1 | ||
| 122 | #define LCDC_CLKSRC_EXTERNAL 2 | ||
| 123 | |||
| 124 | #define LDICKR_CLKSRC(x) \ | ||
| 125 | (((x) & 3) << 12) | ||
| 126 | |||
| 127 | /* LCDC pixclock input divider. Set to 1 at a minimum! */ | ||
| 128 | #define LDICKR_CLKDIV(x) \ | ||
| 129 | ((x) & 0x1f) | ||
| 130 | |||
| 131 | struct sh7760fb_platdata { | ||
| 132 | |||
| 133 | /* Set this member to a valid fb_videmode for the display you | ||
| 134 | * wish to use. The following members must be initialized: | ||
| 135 | * xres, yres, hsync_len, vsync_len, sync, | ||
| 136 | * {left,right,upper,lower}_margin. | ||
| 137 | * The driver uses the above members to calculate register values | ||
| 138 | * and memory requirements. Other members are ignored but may | ||
| 139 | * be used by other framebuffer layer components. | ||
| 140 | */ | ||
| 141 | struct fb_videomode *def_mode; | ||
| 142 | |||
| 143 | /* LDMTR includes display type and signal polarity. The | ||
| 144 | * HSYNC/VSYNC polarities are derived from the fb_var_screeninfo | ||
| 145 | * data above; however the polarities of the following signals | ||
| 146 | * must be encoded in the ldmtr member: | ||
| 147 | * Display Enable signal (default high-active) DISPEN_LOWACT | ||
| 148 | * Display Data signals (default high-active) DPOL_LOWACT | ||
| 149 | * AC Modulation signal (default off) MCNT | ||
| 150 | * Hsync-During-Vsync suppression (default off) CL1CNT | ||
| 151 | * Vsync-during-vsync suppression (default off) CL2CNT | ||
| 152 | * NOTE: also set a display type! | ||
| 153 | * (one of LDMTR_{STN,DSTN,TFT}_{MONO,COLOR}_{4,8,12,16}) | ||
| 154 | */ | ||
| 155 | u16 ldmtr; | ||
| 156 | |||
| 157 | /* LDDFR controls framebuffer image format (depth, organization) | ||
| 158 | * Use ONE of the LDDFR_?BPP_* macros! | ||
| 159 | */ | ||
| 160 | u16 lddfr; | ||
| 161 | |||
| 162 | /* LDPMMR and LDPSPR control the timing of the power signals | ||
| 163 | * for the display. Please read the SH7760 Hardware Manual, | ||
| 164 | * Chapters 30.3.17, 30.3.18 and 30.4.6! | ||
| 165 | */ | ||
| 166 | u16 ldpmmr; | ||
| 167 | u16 ldpspr; | ||
| 168 | |||
| 169 | /* LDACLNR contains the line numbers after which the AC modulation | ||
| 170 | * signal is to toggle. Set to ZERO for TFTs or displays which | ||
| 171 | * do not need it. (Chapter 30.3.15 in SH7760 Hardware Manual). | ||
| 172 | */ | ||
| 173 | u16 ldaclnr; | ||
| 174 | |||
| 175 | /* LDICKR contains information on pixelclock source and config. | ||
| 176 | * Please use the LDICKR_CLKSRC() and LDICKR_CLKDIV() macros. | ||
| 177 | * minimal value for CLKDIV() must be 1!. | ||
| 178 | */ | ||
| 179 | u16 ldickr; | ||
| 180 | |||
| 181 | /* set this member to 1 if you wish to use the LCDC's hardware | ||
| 182 | * rotation function. This is limited to displays <= 320x200 | ||
| 183 | * pixels resolution! | ||
| 184 | */ | ||
| 185 | int rotate; /* set to 1 to rotate 90 CCW */ | ||
| 186 | |||
| 187 | /* set this to 1 to suppress vsync irq use. */ | ||
| 188 | int novsync; | ||
| 189 | |||
| 190 | /* blanking hook for platform. Set this if your platform can do | ||
| 191 | * more than the LCDC in terms of blanking (e.g. disable clock | ||
| 192 | * generator / backlight power supply / etc. | ||
| 193 | */ | ||
| 194 | void (*blank) (int); | ||
| 195 | }; | ||
| 196 | |||
| 197 | #endif /* _ASM_SH_SH7760FB_H */ | ||
diff --git a/include/asm-sh/sh_mobile_lcdc.h b/include/asm-sh/sh_mobile_lcdc.h new file mode 100644 index 000000000000..27677727df4d --- /dev/null +++ b/include/asm-sh/sh_mobile_lcdc.h | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #ifndef __ASM_SH_MOBILE_LCDC_H__ | ||
| 2 | #define __ASM_SH_MOBILE_LCDC_H__ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | |||
| 6 | enum { RGB8, /* 24bpp, 8:8:8 */ | ||
| 7 | RGB9, /* 18bpp, 9:9 */ | ||
| 8 | RGB12A, /* 24bpp, 12:12 */ | ||
| 9 | RGB12B, /* 12bpp */ | ||
| 10 | RGB16, /* 16bpp */ | ||
| 11 | RGB18, /* 18bpp */ | ||
| 12 | RGB24, /* 24bpp */ | ||
| 13 | SYS8A, /* 24bpp, 8:8:8 */ | ||
| 14 | SYS8B, /* 18bpp, 8:8:2 */ | ||
| 15 | SYS8C, /* 18bpp, 2:8:8 */ | ||
| 16 | SYS8D, /* 16bpp, 8:8 */ | ||
| 17 | SYS9, /* 18bpp, 9:9 */ | ||
| 18 | SYS12, /* 24bpp, 12:12 */ | ||
| 19 | SYS16A, /* 16bpp */ | ||
| 20 | SYS16B, /* 18bpp, 16:2 */ | ||
| 21 | SYS16C, /* 18bpp, 2:16 */ | ||
| 22 | SYS18, /* 18bpp */ | ||
| 23 | SYS24 };/* 24bpp */ | ||
| 24 | |||
| 25 | enum { LCDC_CHAN_DISABLED = 0, | ||
| 26 | LCDC_CHAN_MAINLCD, | ||
| 27 | LCDC_CHAN_SUBLCD }; | ||
| 28 | |||
| 29 | enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL }; | ||
| 30 | |||
| 31 | struct sh_mobile_lcdc_sys_bus_cfg { | ||
| 32 | unsigned long ldmt2r; | ||
| 33 | unsigned long ldmt3r; | ||
| 34 | }; | ||
| 35 | |||
| 36 | struct sh_mobile_lcdc_sys_bus_ops { | ||
| 37 | void (*write_index)(void *handle, unsigned long data); | ||
| 38 | void (*write_data)(void *handle, unsigned long data); | ||
| 39 | unsigned long (*read_data)(void *handle); | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct sh_mobile_lcdc_board_cfg { | ||
| 43 | void *board_data; | ||
| 44 | int (*setup_sys)(void *board_data, void *sys_ops_handle, | ||
| 45 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | ||
| 46 | void (*display_on)(void *board_data); | ||
| 47 | void (*display_off)(void *board_data); | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct sh_mobile_lcdc_chan_cfg { | ||
| 51 | int chan; | ||
| 52 | int bpp; | ||
| 53 | int interface_type; /* selects RGBn or SYSn I/F, see above */ | ||
| 54 | int clock_divider; | ||
| 55 | struct fb_videomode lcd_cfg; | ||
| 56 | struct sh_mobile_lcdc_board_cfg board_cfg; | ||
| 57 | struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct sh_mobile_lcdc_info { | ||
| 61 | unsigned long lddckr; | ||
| 62 | int clock_source; | ||
| 63 | struct sh_mobile_lcdc_chan_cfg ch[2]; | ||
| 64 | }; | ||
| 65 | |||
| 66 | #endif /* __ASM_SH_MOBILE_LCDC_H__ */ | ||
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h index c50e5d35fe84..5131e3907525 100644 --- a/include/asm-sh/thread_info.h +++ b/include/asm-sh/thread_info.h | |||
| @@ -92,6 +92,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 92 | return ti; | 92 | return ti; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 96 | |||
| 95 | /* thread information allocation */ | 97 | /* thread information allocation */ |
| 96 | #ifdef CONFIG_DEBUG_STACK_USAGE | 98 | #ifdef CONFIG_DEBUG_STACK_USAGE |
| 97 | #define alloc_thread_info(ti) kzalloc(THREAD_SIZE, GFP_KERNEL) | 99 | #define alloc_thread_info(ti) kzalloc(THREAD_SIZE, GFP_KERNEL) |
diff --git a/include/asm-sparc/dma-mapping_64.h b/include/asm-sparc/dma-mapping_64.h index 38cbec76a33f..bfa64f9702d5 100644 --- a/include/asm-sparc/dma-mapping_64.h +++ b/include/asm-sparc/dma-mapping_64.h | |||
| @@ -135,7 +135,7 @@ static inline void dma_sync_sg_for_device(struct device *dev, | |||
| 135 | /* No flushing needed to sync cpu writes to the device. */ | 135 | /* No flushing needed to sync cpu writes to the device. */ |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static inline int dma_mapping_error(dma_addr_t dma_addr) | 138 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 139 | { | 139 | { |
| 140 | return (dma_addr == DMA_ERROR_CODE); | 140 | return (dma_addr == DMA_ERROR_CODE); |
| 141 | } | 141 | } |
diff --git a/include/asm-sparc/hugetlb.h b/include/asm-sparc/hugetlb.h index 412af58926a0..177061064ee6 100644 --- a/include/asm-sparc/hugetlb.h +++ b/include/asm-sparc/hugetlb.h | |||
| @@ -22,7 +22,8 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, | |||
| 22 | * If the arch doesn't supply something else, assume that hugepage | 22 | * If the arch doesn't supply something else, assume that hugepage |
| 23 | * size aligned regions are ok without further preparation. | 23 | * size aligned regions are ok without further preparation. |
| 24 | */ | 24 | */ |
| 25 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | 25 | static inline int prepare_hugepage_range(struct file *file, |
| 26 | unsigned long addr, unsigned long len) | ||
| 26 | { | 27 | { |
| 27 | if (len & ~HPAGE_MASK) | 28 | if (len & ~HPAGE_MASK) |
| 28 | return -EINVAL; | 29 | return -EINVAL; |
| @@ -31,7 +32,7 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | |||
| 31 | return 0; | 32 | return 0; |
| 32 | } | 33 | } |
| 33 | 34 | ||
| 34 | static inline void hugetlb_free_pgd_range(struct mmu_gather **tlb, | 35 | static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, |
| 35 | unsigned long addr, unsigned long end, | 36 | unsigned long addr, unsigned long end, |
| 36 | unsigned long floor, | 37 | unsigned long floor, |
| 37 | unsigned long ceiling) | 38 | unsigned long ceiling) |
diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index 879fcec72dc1..b7af3d658239 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h | |||
| @@ -21,9 +21,6 @@ | |||
| 21 | #include <asm/psr.h> | 21 | #include <asm/psr.h> |
| 22 | #endif | 22 | #endif |
| 23 | 23 | ||
| 24 | #undef MAX_HWIFS | ||
| 25 | #define MAX_HWIFS 2 | ||
| 26 | |||
| 27 | #define __ide_insl(data_reg, buffer, wcount) \ | 24 | #define __ide_insl(data_reg, buffer, wcount) \ |
| 28 | __ide_insw(data_reg, buffer, (wcount)<<1) | 25 | __ide_insw(data_reg, buffer, (wcount)<<1) |
| 29 | #define __ide_outsl(data_reg, buffer, wcount) \ | 26 | #define __ide_outsl(data_reg, buffer, wcount) \ |
diff --git a/include/asm-sparc/kvm.h b/include/asm-sparc/kvm.h deleted file mode 100644 index 2e5478da3819..000000000000 --- a/include/asm-sparc/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_SPARC_H | ||
| 2 | #define __LINUX_KVM_SPARC_H | ||
| 3 | |||
| 4 | /* sparc does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h deleted file mode 100644 index eff944b8e321..000000000000 --- a/include/asm-sparc/namei.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef ___ASM_SPARC_NAMEI_H | ||
| 2 | #define ___ASM_SPARC_NAMEI_H | ||
| 3 | #if defined(__sparc__) && defined(__arch64__) | ||
| 4 | #include <asm-sparc/namei_64.h> | ||
| 5 | #else | ||
| 6 | #include <asm-sparc/namei_32.h> | ||
| 7 | #endif | ||
| 8 | #endif | ||
diff --git a/include/asm-sparc/namei_32.h b/include/asm-sparc/namei_32.h deleted file mode 100644 index 0646102fb020..000000000000 --- a/include/asm-sparc/namei_32.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-sparc/namei.h | ||
| 3 | * | ||
| 4 | * Routines to handle famous /usr/gnemul/s*. | ||
| 5 | * Included from linux/fs/namei.c | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef __SPARC_NAMEI_H | ||
| 9 | #define __SPARC_NAMEI_H | ||
| 10 | |||
| 11 | #define __emul_prefix() NULL | ||
| 12 | |||
| 13 | #endif /* __SPARC_NAMEI_H */ | ||
diff --git a/include/asm-sparc/namei_64.h b/include/asm-sparc/namei_64.h deleted file mode 100644 index cbc1b4c06891..000000000000 --- a/include/asm-sparc/namei_64.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-sparc64/namei.h | ||
| 3 | * | ||
| 4 | * Routines to handle famous /usr/gnemul/s*. | ||
| 5 | * Included from linux/fs/namei.c | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef __SPARC64_NAMEI_H | ||
| 9 | #define __SPARC64_NAMEI_H | ||
| 10 | |||
| 11 | #define __emul_prefix() NULL | ||
| 12 | |||
| 13 | #endif /* __SPARC64_NAMEI_H */ | ||
diff --git a/include/asm-sparc/page_32.h b/include/asm-sparc/page_32.h index 14de518cc38f..cf5fb70ca1c1 100644 --- a/include/asm-sparc/page_32.h +++ b/include/asm-sparc/page_32.h | |||
| @@ -134,9 +134,6 @@ BTFIXUPDEF_SETHI(sparc_unmapped_base) | |||
| 134 | 134 | ||
| 135 | #endif /* !(__ASSEMBLY__) */ | 135 | #endif /* !(__ASSEMBLY__) */ |
| 136 | 136 | ||
| 137 | /* to align the pointer to the (next) page boundary */ | ||
| 138 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 139 | |||
| 140 | #define PAGE_OFFSET 0xf0000000 | 137 | #define PAGE_OFFSET 0xf0000000 |
| 141 | #ifndef __ASSEMBLY__ | 138 | #ifndef __ASSEMBLY__ |
| 142 | extern unsigned long phys_base; | 139 | extern unsigned long phys_base; |
diff --git a/include/asm-sparc/page_64.h b/include/asm-sparc/page_64.h index a8a2bba032c1..b579b910ef51 100644 --- a/include/asm-sparc/page_64.h +++ b/include/asm-sparc/page_64.h | |||
| @@ -106,9 +106,6 @@ typedef struct page *pgtable_t; | |||
| 106 | 106 | ||
| 107 | #endif /* !(__ASSEMBLY__) */ | 107 | #endif /* !(__ASSEMBLY__) */ |
| 108 | 108 | ||
| 109 | /* to align the pointer to the (next) page boundary */ | ||
| 110 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 111 | |||
| 112 | /* We used to stick this into a hard-coded global register (%g4) | 109 | /* We used to stick this into a hard-coded global register (%g4) |
| 113 | * but that does not make sense anymore. | 110 | * but that does not make sense anymore. |
| 114 | */ | 111 | */ |
diff --git a/include/asm-sparc/pci_32.h b/include/asm-sparc/pci_32.h index b93b6c79e08f..0ee949d220c0 100644 --- a/include/asm-sparc/pci_32.h +++ b/include/asm-sparc/pci_32.h | |||
| @@ -154,7 +154,8 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
| 154 | 154 | ||
| 155 | #define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0) | 155 | #define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0) |
| 156 | 156 | ||
| 157 | static inline int pci_dma_mapping_error(dma_addr_t dma_addr) | 157 | static inline int pci_dma_mapping_error(struct pci_dev *pdev, |
| 158 | dma_addr_t dma_addr) | ||
| 158 | { | 159 | { |
| 159 | return (dma_addr == PCI_DMA_ERROR_CODE); | 160 | return (dma_addr == PCI_DMA_ERROR_CODE); |
| 160 | } | 161 | } |
diff --git a/include/asm-sparc/pci_64.h b/include/asm-sparc/pci_64.h index f59f2571295b..4f79a54948f6 100644 --- a/include/asm-sparc/pci_64.h +++ b/include/asm-sparc/pci_64.h | |||
| @@ -140,9 +140,10 @@ extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask); | |||
| 140 | #define PCI64_REQUIRED_MASK (~(dma64_addr_t)0) | 140 | #define PCI64_REQUIRED_MASK (~(dma64_addr_t)0) |
| 141 | #define PCI64_ADDR_BASE 0xfffc000000000000UL | 141 | #define PCI64_ADDR_BASE 0xfffc000000000000UL |
| 142 | 142 | ||
| 143 | static inline int pci_dma_mapping_error(dma_addr_t dma_addr) | 143 | static inline int pci_dma_mapping_error(struct pci_dev *pdev, |
| 144 | dma_addr_t dma_addr) | ||
| 144 | { | 145 | { |
| 145 | return dma_mapping_error(dma_addr); | 146 | return dma_mapping_error(&pdev->dev, dma_addr); |
| 146 | } | 147 | } |
| 147 | 148 | ||
| 148 | #ifdef CONFIG_PCI | 149 | #ifdef CONFIG_PCI |
diff --git a/include/asm-sparc/semaphore.h b/include/asm-sparc/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-sparc/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-sparc/thread_info_32.h b/include/asm-sparc/thread_info_32.h index 91b9f5888c85..2cf9db044055 100644 --- a/include/asm-sparc/thread_info_32.h +++ b/include/asm-sparc/thread_info_32.h | |||
| @@ -86,6 +86,8 @@ register struct thread_info *current_thread_info_reg asm("g6"); | |||
| 86 | #define THREAD_INFO_ORDER 1 | 86 | #define THREAD_INFO_ORDER 1 |
| 87 | #endif | 87 | #endif |
| 88 | 88 | ||
| 89 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 90 | |||
| 89 | BTFIXUPDEF_CALL(struct thread_info *, alloc_thread_info, void) | 91 | BTFIXUPDEF_CALL(struct thread_info *, alloc_thread_info, void) |
| 90 | #define alloc_thread_info(tsk) BTFIXUP_CALL(alloc_thread_info)() | 92 | #define alloc_thread_info(tsk) BTFIXUP_CALL(alloc_thread_info)() |
| 91 | 93 | ||
diff --git a/include/asm-sparc/thread_info_64.h b/include/asm-sparc/thread_info_64.h index c6d2e6c7f844..960969d5ad06 100644 --- a/include/asm-sparc/thread_info_64.h +++ b/include/asm-sparc/thread_info_64.h | |||
| @@ -155,6 +155,8 @@ register struct thread_info *current_thread_info_reg asm("g6"); | |||
| 155 | #define __THREAD_INFO_ORDER 0 | 155 | #define __THREAD_INFO_ORDER 0 |
| 156 | #endif /* PAGE_SHIFT == 13 */ | 156 | #endif /* PAGE_SHIFT == 13 */ |
| 157 | 157 | ||
| 158 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 159 | |||
| 158 | #ifdef CONFIG_DEBUG_STACK_USAGE | 160 | #ifdef CONFIG_DEBUG_STACK_USAGE |
| 159 | #define alloc_thread_info(tsk) \ | 161 | #define alloc_thread_info(tsk) \ |
| 160 | ({ \ | 162 | ({ \ |
diff --git a/include/asm-sparc/unistd_32.h b/include/asm-sparc/unistd_32.h index 2338a0276377..648643a9f139 100644 --- a/include/asm-sparc/unistd_32.h +++ b/include/asm-sparc/unistd_32.h | |||
| @@ -332,8 +332,14 @@ | |||
| 332 | #define __NR_fallocate 314 | 332 | #define __NR_fallocate 314 |
| 333 | #define __NR_timerfd_settime 315 | 333 | #define __NR_timerfd_settime 315 |
| 334 | #define __NR_timerfd_gettime 316 | 334 | #define __NR_timerfd_gettime 316 |
| 335 | #define __NR_signalfd4 317 | ||
| 336 | #define __NR_eventfd2 318 | ||
| 337 | #define __NR_epoll_create1 319 | ||
| 338 | #define __NR_dup3 320 | ||
| 339 | #define __NR_pipe2 321 | ||
| 340 | #define __NR_inotify_init1 322 | ||
| 335 | 341 | ||
| 336 | #define NR_SYSCALLS 317 | 342 | #define NR_SYSCALLS 323 |
| 337 | 343 | ||
| 338 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, | 344 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, |
| 339 | * it never had the plain ones and there is no value to adding those | 345 | * it never had the plain ones and there is no value to adding those |
diff --git a/include/asm-sparc/unistd_64.h b/include/asm-sparc/unistd_64.h index 13be4453a1f0..c5cc0e052321 100644 --- a/include/asm-sparc/unistd_64.h +++ b/include/asm-sparc/unistd_64.h | |||
| @@ -334,8 +334,14 @@ | |||
| 334 | #define __NR_fallocate 314 | 334 | #define __NR_fallocate 314 |
| 335 | #define __NR_timerfd_settime 315 | 335 | #define __NR_timerfd_settime 315 |
| 336 | #define __NR_timerfd_gettime 316 | 336 | #define __NR_timerfd_gettime 316 |
| 337 | #define __NR_signalfd4 317 | ||
| 338 | #define __NR_eventfd2 318 | ||
| 339 | #define __NR_epoll_create1 319 | ||
| 340 | #define __NR_dup3 320 | ||
| 341 | #define __NR_pipe2 321 | ||
| 342 | #define __NR_inotify_init1 322 | ||
| 337 | 343 | ||
| 338 | #define NR_SYSCALLS 317 | 344 | #define NR_SYSCALLS 323 |
| 339 | 345 | ||
| 340 | #ifdef __KERNEL__ | 346 | #ifdef __KERNEL__ |
| 341 | #define __ARCH_WANT_IPC_PARSE_VERSION | 347 | #define __ARCH_WANT_IPC_PARSE_VERSION |
diff --git a/include/asm-sparc64/kvm.h b/include/asm-sparc64/kvm.h deleted file mode 100644 index 53564ad86b15..000000000000 --- a/include/asm-sparc64/kvm.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-sparc/kvm.h> | ||
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h deleted file mode 100644 index 1344a910ba2f..000000000000 --- a/include/asm-sparc64/namei.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-sparc/namei.h> | ||
diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h deleted file mode 100644 index 39362afde5fe..000000000000 --- a/include/asm-sparc64/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-sparc/semaphore.h> | ||
diff --git a/include/asm-um/kvm.h b/include/asm-um/kvm.h deleted file mode 100644 index 66aa77094551..000000000000 --- a/include/asm-um/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_UM_H | ||
| 2 | #define __LINUX_KVM_UM_H | ||
| 3 | |||
| 4 | /* um does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-um/namei.h b/include/asm-um/namei.h deleted file mode 100644 index 002984d5bc85..000000000000 --- a/include/asm-um/namei.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __UM_NAMEI_H | ||
| 2 | #define __UM_NAMEI_H | ||
| 3 | |||
| 4 | #include "asm/arch/namei.h" | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 916e1a61999f..a6df1f13d732 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
| @@ -92,9 +92,6 @@ typedef struct page *pgtable_t; | |||
| 92 | #define __pgd(x) ((pgd_t) { (x) } ) | 92 | #define __pgd(x) ((pgd_t) { (x) } ) |
| 93 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 93 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
| 94 | 94 | ||
| 95 | /* to align the pointer to the (next) page boundary */ | ||
| 96 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 97 | |||
| 98 | extern unsigned long uml_physmem; | 95 | extern unsigned long uml_physmem; |
| 99 | 96 | ||
| 100 | #define PAGE_OFFSET (uml_physmem) | 97 | #define PAGE_OFFSET (uml_physmem) |
| @@ -118,9 +115,6 @@ extern unsigned long uml_physmem; | |||
| 118 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 115 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
| 119 | #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) | 116 | #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) |
| 120 | 117 | ||
| 121 | extern struct page *arch_validate(struct page *page, gfp_t mask, int order); | ||
| 122 | #define HAVE_ARCH_VALIDATE | ||
| 123 | |||
| 124 | #include <asm-generic/memory_model.h> | 118 | #include <asm-generic/memory_model.h> |
| 125 | #include <asm-generic/page.h> | 119 | #include <asm-generic/page.h> |
| 126 | 120 | ||
diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h index 6aefcd32fc61..315749705ea1 100644 --- a/include/asm-um/ptrace-generic.h +++ b/include/asm-um/ptrace-generic.h | |||
| @@ -47,9 +47,6 @@ extern int set_fpregs(struct user_i387_struct __user *buf, | |||
| 47 | 47 | ||
| 48 | extern void show_regs(struct pt_regs *regs); | 48 | extern void show_regs(struct pt_regs *regs); |
| 49 | 49 | ||
| 50 | extern void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, | ||
| 51 | int error_code); | ||
| 52 | |||
| 53 | extern int arch_copy_tls(struct task_struct *new); | 50 | extern int arch_copy_tls(struct task_struct *new); |
| 54 | extern void clear_flushed_tls(struct task_struct *task); | 51 | extern void clear_flushed_tls(struct task_struct *task); |
| 55 | 52 | ||
diff --git a/include/asm-um/semaphore.h b/include/asm-um/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-um/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h index 356b83e2c22e..e07e72846c7a 100644 --- a/include/asm-um/thread_info.h +++ b/include/asm-um/thread_info.h | |||
| @@ -53,21 +53,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 53 | return ti; | 53 | return ti; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | #ifdef CONFIG_DEBUG_STACK_USAGE | 56 | #define THREAD_SIZE_ORDER CONFIG_KERNEL_STACK_ORDER |
| 57 | |||
| 58 | #define alloc_thread_info(tsk) \ | ||
| 59 | ((struct thread_info *) __get_free_pages(GFP_KERNEL | __GFP_ZERO, \ | ||
| 60 | CONFIG_KERNEL_STACK_ORDER)) | ||
| 61 | #else | ||
| 62 | |||
| 63 | /* thread information allocation */ | ||
| 64 | #define alloc_thread_info(tsk) \ | ||
| 65 | ((struct thread_info *) __get_free_pages(GFP_KERNEL, \ | ||
| 66 | CONFIG_KERNEL_STACK_ORDER)) | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #define free_thread_info(ti) \ | ||
| 70 | free_pages((unsigned long)(ti),CONFIG_KERNEL_STACK_ORDER) | ||
| 71 | 57 | ||
| 72 | #endif | 58 | #endif |
| 73 | 59 | ||
diff --git a/include/asm-v850/Kbuild b/include/asm-v850/Kbuild deleted file mode 100644 index c68e1680da01..000000000000 --- a/include/asm-v850/Kbuild +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | include include/asm-generic/Kbuild.asm | ||
diff --git a/include/asm-v850/a.out.h b/include/asm-v850/a.out.h deleted file mode 100644 index e9439a0708f6..000000000000 --- a/include/asm-v850/a.out.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | #ifndef __V850_A_OUT_H__ | ||
| 2 | #define __V850_A_OUT_H__ | ||
| 3 | |||
| 4 | struct exec | ||
| 5 | { | ||
| 6 | unsigned long a_info; /* Use macros N_MAGIC, etc for access */ | ||
| 7 | unsigned a_text; /* length of text, in bytes */ | ||
| 8 | unsigned a_data; /* length of data, in bytes */ | ||
| 9 | unsigned a_bss; /* length of uninitialized data area for file, in bytes */ | ||
| 10 | unsigned a_syms; /* length of symbol table data in file, in bytes */ | ||
| 11 | unsigned a_entry; /* start address */ | ||
| 12 | unsigned a_trsize; /* length of relocation info for text, in bytes */ | ||
| 13 | unsigned a_drsize; /* length of relocation info for data, in bytes */ | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define N_TRSIZE(a) ((a).a_trsize) | ||
| 17 | #define N_DRSIZE(a) ((a).a_drsize) | ||
| 18 | #define N_SYMSIZE(a) ((a).a_syms) | ||
| 19 | |||
| 20 | |||
| 21 | #endif /* __V850_A_OUT_H__ */ | ||
diff --git a/include/asm-v850/anna.h b/include/asm-v850/anna.h deleted file mode 100644 index cd5eaee103b0..000000000000 --- a/include/asm-v850/anna.h +++ /dev/null | |||
| @@ -1,137 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/anna.h -- Anna V850E2 evaluation cpu chip/board | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_ANNA_H__ | ||
| 15 | #define __V850_ANNA_H__ | ||
| 16 | |||
| 17 | #include <asm/v850e2.h> /* Based on V850E2 core. */ | ||
| 18 | |||
| 19 | |||
| 20 | #define CPU_MODEL "v850e2/anna" | ||
| 21 | #define CPU_MODEL_LONG "NEC V850E2/Anna" | ||
| 22 | #define PLATFORM "anna" | ||
| 23 | #define PLATFORM_LONG "NEC/Midas lab V850E2/Anna evaluation board" | ||
| 24 | |||
| 25 | #define CPU_CLOCK_FREQ 200000000 /* 200MHz */ | ||
| 26 | #define SYS_CLOCK_FREQ 33300000 /* 33.3MHz */ | ||
| 27 | |||
| 28 | |||
| 29 | /* 1MB of static RAM. This memory is mirrored 64 times. */ | ||
| 30 | #define SRAM_ADDR 0x04000000 | ||
| 31 | #define SRAM_SIZE 0x00100000 /* 1MB */ | ||
| 32 | /* 64MB of DRAM. */ | ||
| 33 | #define SDRAM_ADDR 0x08000000 | ||
| 34 | #define SDRAM_SIZE 0x04000000 /* 64MB */ | ||
| 35 | |||
| 36 | |||
| 37 | /* For <asm/page.h> */ | ||
| 38 | #define PAGE_OFFSET SRAM_ADDR | ||
| 39 | |||
| 40 | /* We use on-chip RAM, for a few miscellaneous variables that must be | ||
| 41 | accessible using a load instruction relative to R0. The Anna chip has | ||
| 42 | 128K of `dLB' ram nominally located at 0xFFF00000, but it's mirrored | ||
| 43 | every 128K, so we can use the `last mirror' (except for the portion at | ||
| 44 | the top which is overridden by I/O space). In addition, the early | ||
| 45 | sample chip we're using has lots of memory errors in the dLB ram, so we | ||
| 46 | use a specially chosen location that has at least 20 bytes of contiguous | ||
| 47 | valid memory (xxxF0020 - xxxF003F). */ | ||
| 48 | #define R0_RAM_ADDR 0xFFFF8020 | ||
| 49 | |||
| 50 | |||
| 51 | /* Anna specific control registers. */ | ||
| 52 | #define ANNA_ILBEN_ADDR 0xFFFFF7F2 | ||
| 53 | #define ANNA_ILBEN (*(volatile u16 *)ANNA_ILBEN_ADDR) | ||
| 54 | |||
| 55 | |||
| 56 | /* I/O port P0-P3. */ | ||
| 57 | /* Direct I/O. Bits 0-7 are pins Pn0-Pn7. */ | ||
| 58 | #define ANNA_PORT_IO_ADDR(n) (0xFFFFF400 + (n) * 2) | ||
| 59 | #define ANNA_PORT_IO(n) (*(volatile u8 *)ANNA_PORT_IO_ADDR(n)) | ||
| 60 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 61 | #define ANNA_PORT_PM_ADDR(n) (0xFFFFF410 + (n) * 2) | ||
| 62 | #define ANNA_PORT_PM(n) (*(volatile u8 *)ANNA_PORT_PM_ADDR(n)) | ||
| 63 | |||
| 64 | |||
| 65 | /* Hardware-specific interrupt numbers (in the kernel IRQ namespace). */ | ||
| 66 | #define IRQ_INTP(n) (n) /* Pnnn (pin) interrupts 0-15 */ | ||
| 67 | #define IRQ_INTP_NUM 16 | ||
| 68 | #define IRQ_INTOV(n) (0x10 + (n)) /* 0-2 */ | ||
| 69 | #define IRQ_INTOV_NUM 2 | ||
| 70 | #define IRQ_INTCCC(n) (0x12 + (n)) | ||
| 71 | #define IRQ_INTCCC_NUM 4 | ||
| 72 | #define IRQ_INTCMD(n) (0x16 + (n)) /* interval timer interrupts 0-5 */ | ||
| 73 | #define IRQ_INTCMD_NUM 6 | ||
| 74 | #define IRQ_INTDMA(n) (0x1C + (n)) /* DMA interrupts 0-3 */ | ||
| 75 | #define IRQ_INTDMA_NUM 4 | ||
| 76 | #define IRQ_INTDMXER 0x20 | ||
| 77 | #define IRQ_INTSRE(n) (0x21 + (n)*3) /* UART 0-1 reception error */ | ||
| 78 | #define IRQ_INTSRE_NUM 2 | ||
| 79 | #define IRQ_INTSR(n) (0x22 + (n)*3) /* UART 0-1 reception completion */ | ||
| 80 | #define IRQ_INTSR_NUM 2 | ||
| 81 | #define IRQ_INTST(n) (0x23 + (n)*3) /* UART 0-1 transmission completion */ | ||
| 82 | #define IRQ_INTST_NUM 2 | ||
| 83 | |||
| 84 | #define NUM_CPU_IRQS 64 | ||
| 85 | |||
| 86 | #ifndef __ASSEMBLY__ | ||
| 87 | /* Initialize chip interrupts. */ | ||
| 88 | extern void anna_init_irqs (void); | ||
| 89 | #endif | ||
| 90 | |||
| 91 | |||
| 92 | /* Anna UART details (basically the same as the V850E/MA1, but 2 channels). */ | ||
| 93 | #define V850E_UART_NUM_CHANNELS 2 | ||
| 94 | #define V850E_UART_BASE_FREQ (SYS_CLOCK_FREQ / 2) | ||
| 95 | #define V850E_UART_CHIP_NAME "V850E2/NA85E2A" | ||
| 96 | |||
| 97 | /* This is the UART channel that's actually connected on the board. */ | ||
| 98 | #define V850E_UART_CONSOLE_CHANNEL 1 | ||
| 99 | |||
| 100 | /* This is a function that gets called before configuring the UART. */ | ||
| 101 | #define V850E_UART_PRE_CONFIGURE anna_uart_pre_configure | ||
| 102 | #ifndef __ASSEMBLY__ | ||
| 103 | extern void anna_uart_pre_configure (unsigned chan, | ||
| 104 | unsigned cflags, unsigned baud); | ||
| 105 | #endif | ||
| 106 | |||
| 107 | /* This board supports RTS/CTS for the on-chip UART, but only for channel 1. */ | ||
| 108 | |||
| 109 | /* CTS for UART channel 1 is pin P37 (bit 7 of port 3). */ | ||
| 110 | #define V850E_UART_CTS(chan) ((chan) == 1 ? !(ANNA_PORT_IO(3) & 0x80) : 1) | ||
| 111 | /* RTS for UART channel 1 is pin P07 (bit 7 of port 0). */ | ||
| 112 | #define V850E_UART_SET_RTS(chan, val) \ | ||
| 113 | do { \ | ||
| 114 | if (chan == 1) { \ | ||
| 115 | unsigned old = ANNA_PORT_IO(0); \ | ||
| 116 | if (val) \ | ||
| 117 | ANNA_PORT_IO(0) = old & ~0x80; \ | ||
| 118 | else \ | ||
| 119 | ANNA_PORT_IO(0) = old | 0x80; \ | ||
| 120 | } \ | ||
| 121 | } while (0) | ||
| 122 | |||
| 123 | |||
| 124 | /* Timer C details. */ | ||
| 125 | #define V850E_TIMER_C_BASE_ADDR 0xFFFFF600 | ||
| 126 | |||
| 127 | /* Timer D details (the Anna actually has 5 of these; should change later). */ | ||
| 128 | #define V850E_TIMER_D_BASE_ADDR 0xFFFFF540 | ||
| 129 | #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0) | ||
| 130 | #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x2) | ||
| 131 | #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4) | ||
| 132 | |||
| 133 | #define V850E_TIMER_D_BASE_FREQ SYS_CLOCK_FREQ | ||
| 134 | #define V850E_TIMER_D_TMCD_CS_MIN 1 /* min 2^1 divider */ | ||
| 135 | |||
| 136 | |||
| 137 | #endif /* __V850_ANNA_H__ */ | ||
diff --git a/include/asm-v850/as85ep1.h b/include/asm-v850/as85ep1.h deleted file mode 100644 index 5a5ca9073d09..000000000000 --- a/include/asm-v850/as85ep1.h +++ /dev/null | |||
| @@ -1,152 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/as85ep1.h -- AS85EP1 evaluation CPU chip/board | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_AS85EP1_H__ | ||
| 15 | #define __V850_AS85EP1_H__ | ||
| 16 | |||
| 17 | #include <asm/v850e.h> | ||
| 18 | |||
| 19 | |||
| 20 | #define CPU_MODEL "as85ep1" | ||
| 21 | #define CPU_MODEL_LONG "NEC V850E/AS85EP1" | ||
| 22 | #define PLATFORM "AS85EP1" | ||
| 23 | #define PLATFORM_LONG "NEC V850E/AS85EP1 evaluation board" | ||
| 24 | |||
| 25 | #define CPU_CLOCK_FREQ 96000000 /* 96MHz */ | ||
| 26 | #define SYS_CLOCK_FREQ CPU_CLOCK_FREQ | ||
| 27 | |||
| 28 | |||
| 29 | /* 1MB of static RAM. */ | ||
| 30 | #define SRAM_ADDR 0x00400000 | ||
| 31 | #define SRAM_SIZE 0x00100000 /* 1MB */ | ||
| 32 | /* About 58MB of DRAM. This can actually be at one of two positions, | ||
| 33 | determined by jump JP3; we have to use the first position because the | ||
| 34 | second is partially out of processor instruction addressing range | ||
| 35 | (though in the second position there's actually 64MB available). */ | ||
| 36 | #define SDRAM_ADDR 0x00600000 | ||
| 37 | #define SDRAM_SIZE 0x039F8000 /* approx 58MB */ | ||
| 38 | |||
| 39 | /* For <asm/page.h> */ | ||
| 40 | #define PAGE_OFFSET SRAM_ADDR | ||
| 41 | |||
| 42 | /* We use on-chip RAM, for a few miscellaneous variables that must be | ||
| 43 | accessible using a load instruction relative to R0. The AS85EP1 chip | ||
| 44 | 16K of internal RAM located slightly before I/O space. */ | ||
| 45 | #define R0_RAM_ADDR 0xFFFF8000 | ||
| 46 | |||
| 47 | |||
| 48 | /* AS85EP1 specific control registers. */ | ||
| 49 | #define AS85EP1_CSC_ADDR(n) (0xFFFFF060 + (n) * 2) | ||
| 50 | #define AS85EP1_CSC(n) (*(volatile u16 *)AS85EP1_CSC_ADDR(n)) | ||
| 51 | #define AS85EP1_BSC_ADDR 0xFFFFF066 | ||
| 52 | #define AS85EP1_BSC (*(volatile u16 *)AS85EP1_BSC_ADDR) | ||
| 53 | #define AS85EP1_BCT_ADDR(n) (0xFFFFF480 + (n) * 2) | ||
| 54 | #define AS85EP1_BCT(n) (*(volatile u16 *)AS85EP1_BCT_ADDR(n)) | ||
| 55 | #define AS85EP1_DWC_ADDR(n) (0xFFFFF484 + (n) * 2) | ||
| 56 | #define AS85EP1_DWC(n) (*(volatile u16 *)AS85EP1_DWC_ADDR(n)) | ||
| 57 | #define AS85EP1_BCC_ADDR 0xFFFFF488 | ||
| 58 | #define AS85EP1_BCC (*(volatile u16 *)AS85EP1_BCC_ADDR) | ||
| 59 | #define AS85EP1_ASC_ADDR 0xFFFFF48A | ||
| 60 | #define AS85EP1_ASC (*(volatile u16 *)AS85EP1_ASC_ADDR) | ||
| 61 | #define AS85EP1_BCP_ADDR 0xFFFFF48C | ||
| 62 | #define AS85EP1_BCP (*(volatile u16 *)AS85EP1_BCP_ADDR) | ||
| 63 | #define AS85EP1_LBS_ADDR 0xFFFFF48E | ||
| 64 | #define AS85EP1_LBS (*(volatile u16 *)AS85EP1_LBS_ADDR) | ||
| 65 | #define AS85EP1_BMC_ADDR 0xFFFFF498 | ||
| 66 | #define AS85EP1_BMC (*(volatile u16 *)AS85EP1_BMC_ADDR) | ||
| 67 | #define AS85EP1_PRC_ADDR 0xFFFFF49A | ||
| 68 | #define AS85EP1_PRC (*(volatile u16 *)AS85EP1_PRC_ADDR) | ||
| 69 | #define AS85EP1_SCR_ADDR(n) (0xFFFFF4A0 + (n) * 4) | ||
| 70 | #define AS85EP1_SCR(n) (*(volatile u16 *)AS85EP1_SCR_ADDR(n)) | ||
| 71 | #define AS85EP1_RFS_ADDR(n) (0xFFFFF4A2 + (n) * 4) | ||
| 72 | #define AS85EP1_RFS(n) (*(volatile u16 *)AS85EP1_RFS_ADDR(n)) | ||
| 73 | #define AS85EP1_IRAMM_ADDR 0xFFFFF80A | ||
| 74 | #define AS85EP1_IRAMM (*(volatile u8 *)AS85EP1_IRAMM_ADDR) | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | /* I/O port P0-P13. */ | ||
| 79 | /* Direct I/O. Bits 0-7 are pins Pn0-Pn7. */ | ||
| 80 | #define AS85EP1_PORT_IO_ADDR(n) (0xFFFFF400 + (n) * 2) | ||
| 81 | #define AS85EP1_PORT_IO(n) (*(volatile u8 *)AS85EP1_PORT_IO_ADDR(n)) | ||
| 82 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 83 | #define AS85EP1_PORT_PM_ADDR(n) (0xFFFFF420 + (n) * 2) | ||
| 84 | #define AS85EP1_PORT_PM(n) (*(volatile u8 *)AS85EP1_PORT_PM_ADDR(n)) | ||
| 85 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 86 | #define AS85EP1_PORT_PMC_ADDR(n) (0xFFFFF440 + (n) * 2) | ||
| 87 | #define AS85EP1_PORT_PMC(n) (*(volatile u8 *)AS85EP1_PORT_PMC_ADDR(n)) | ||
| 88 | |||
| 89 | |||
| 90 | /* Hardware-specific interrupt numbers (in the kernel IRQ namespace). */ | ||
| 91 | #define IRQ_INTCCC(n) (0x0C + (n)) | ||
| 92 | #define IRQ_INTCCC_NUM 8 | ||
| 93 | #define IRQ_INTCMD(n) (0x14 + (n)) /* interval timer interrupts 0-5 */ | ||
| 94 | #define IRQ_INTCMD_NUM 6 | ||
| 95 | #define IRQ_INTSRE(n) (0x1E + (n)*3) /* UART 0-1 reception error */ | ||
| 96 | #define IRQ_INTSRE_NUM 2 | ||
| 97 | #define IRQ_INTSR(n) (0x1F + (n)*3) /* UART 0-1 reception completion */ | ||
| 98 | #define IRQ_INTSR_NUM 2 | ||
| 99 | #define IRQ_INTST(n) (0x20 + (n)*3) /* UART 0-1 transmission completion */ | ||
| 100 | #define IRQ_INTST_NUM 2 | ||
| 101 | |||
| 102 | #define NUM_CPU_IRQS 64 | ||
| 103 | |||
| 104 | #ifndef __ASSEMBLY__ | ||
| 105 | /* Initialize chip interrupts. */ | ||
| 106 | extern void as85ep1_init_irqs (void); | ||
| 107 | #endif | ||
| 108 | |||
| 109 | |||
| 110 | /* AS85EP1 UART details (basically the same as the V850E/MA1, but 2 channels). */ | ||
| 111 | #define V850E_UART_NUM_CHANNELS 2 | ||
| 112 | #define V850E_UART_BASE_FREQ (SYS_CLOCK_FREQ / 4) | ||
| 113 | #define V850E_UART_CHIP_NAME "V850E/NA85E" | ||
| 114 | |||
| 115 | /* This is a function that gets called before configuring the UART. */ | ||
| 116 | #define V850E_UART_PRE_CONFIGURE as85ep1_uart_pre_configure | ||
| 117 | #ifndef __ASSEMBLY__ | ||
| 118 | extern void as85ep1_uart_pre_configure (unsigned chan, | ||
| 119 | unsigned cflags, unsigned baud); | ||
| 120 | #endif | ||
| 121 | |||
| 122 | /* This board supports RTS/CTS for the on-chip UART, but only for channel 1. */ | ||
| 123 | |||
| 124 | /* CTS for UART channel 1 is pin P54 (bit 4 of port 5). */ | ||
| 125 | #define V850E_UART_CTS(chan) ((chan) == 1 ? !(AS85EP1_PORT_IO(5) & 0x10) : 1) | ||
| 126 | /* RTS for UART channel 1 is pin P53 (bit 3 of port 5). */ | ||
| 127 | #define V850E_UART_SET_RTS(chan, val) \ | ||
| 128 | do { \ | ||
| 129 | if (chan == 1) { \ | ||
| 130 | unsigned old = AS85EP1_PORT_IO(5); \ | ||
| 131 | if (val) \ | ||
| 132 | AS85EP1_PORT_IO(5) = old & ~0x8; \ | ||
| 133 | else \ | ||
| 134 | AS85EP1_PORT_IO(5) = old | 0x8; \ | ||
| 135 | } \ | ||
| 136 | } while (0) | ||
| 137 | |||
| 138 | |||
| 139 | /* Timer C details. */ | ||
| 140 | #define V850E_TIMER_C_BASE_ADDR 0xFFFFF600 | ||
| 141 | |||
| 142 | /* Timer D details (the AS85EP1 actually has 5 of these; should change later). */ | ||
| 143 | #define V850E_TIMER_D_BASE_ADDR 0xFFFFF540 | ||
| 144 | #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0) | ||
| 145 | #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x2) | ||
| 146 | #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4) | ||
| 147 | |||
| 148 | #define V850E_TIMER_D_BASE_FREQ SYS_CLOCK_FREQ | ||
| 149 | #define V850E_TIMER_D_TMCD_CS_MIN 2 /* min 2^2 divider */ | ||
| 150 | |||
| 151 | |||
| 152 | #endif /* __V850_AS85EP1_H__ */ | ||
diff --git a/include/asm-v850/asm.h b/include/asm-v850/asm.h deleted file mode 100644 index bf1e785a5dde..000000000000 --- a/include/asm-v850/asm.h +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/asm.h -- Macros for writing assembly code | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #define G_ENTRY(name) \ | ||
| 15 | .balign 4; \ | ||
| 16 | .globl name; \ | ||
| 17 | .type name,@function; \ | ||
| 18 | name | ||
| 19 | #define G_DATA(name) \ | ||
| 20 | .globl name; \ | ||
| 21 | .type name,@object; \ | ||
| 22 | name | ||
| 23 | #define END(name) \ | ||
| 24 | .size name,.-name | ||
| 25 | |||
| 26 | #define L_ENTRY(name) \ | ||
| 27 | .balign 4; \ | ||
| 28 | .type name,@function; \ | ||
| 29 | name | ||
| 30 | #define L_DATA(name) \ | ||
| 31 | .type name,@object; \ | ||
| 32 | name | ||
diff --git a/include/asm-v850/atomic.h b/include/asm-v850/atomic.h deleted file mode 100644 index e4e57de08f73..000000000000 --- a/include/asm-v850/atomic.h +++ /dev/null | |||
| @@ -1,131 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/atomic.h -- Atomic operations | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_ATOMIC_H__ | ||
| 15 | #define __V850_ATOMIC_H__ | ||
| 16 | |||
| 17 | |||
| 18 | #include <asm/system.h> | ||
| 19 | |||
| 20 | #ifdef CONFIG_SMP | ||
| 21 | #error SMP not supported | ||
| 22 | #endif | ||
| 23 | |||
| 24 | typedef struct { int counter; } atomic_t; | ||
| 25 | |||
| 26 | #define ATOMIC_INIT(i) { (i) } | ||
| 27 | |||
| 28 | #ifdef __KERNEL__ | ||
| 29 | |||
| 30 | #define atomic_read(v) ((v)->counter) | ||
| 31 | #define atomic_set(v,i) (((v)->counter) = (i)) | ||
| 32 | |||
| 33 | static inline int atomic_add_return (int i, volatile atomic_t *v) | ||
| 34 | { | ||
| 35 | unsigned long flags; | ||
| 36 | int res; | ||
| 37 | |||
| 38 | local_irq_save (flags); | ||
| 39 | res = v->counter + i; | ||
| 40 | v->counter = res; | ||
| 41 | local_irq_restore (flags); | ||
| 42 | |||
| 43 | return res; | ||
| 44 | } | ||
| 45 | |||
| 46 | static __inline__ int atomic_sub_return (int i, volatile atomic_t *v) | ||
| 47 | { | ||
| 48 | unsigned long flags; | ||
| 49 | int res; | ||
| 50 | |||
| 51 | local_irq_save (flags); | ||
| 52 | res = v->counter - i; | ||
| 53 | v->counter = res; | ||
| 54 | local_irq_restore (flags); | ||
| 55 | |||
| 56 | return res; | ||
| 57 | } | ||
| 58 | |||
| 59 | static __inline__ void atomic_clear_mask (unsigned long mask, unsigned long *addr) | ||
| 60 | { | ||
| 61 | unsigned long flags; | ||
| 62 | |||
| 63 | local_irq_save (flags); | ||
| 64 | *addr &= ~mask; | ||
| 65 | local_irq_restore (flags); | ||
| 66 | } | ||
| 67 | |||
| 68 | #endif | ||
| 69 | |||
| 70 | #define atomic_add(i, v) atomic_add_return ((i), (v)) | ||
| 71 | #define atomic_sub(i, v) atomic_sub_return ((i), (v)) | ||
| 72 | |||
| 73 | #define atomic_dec_return(v) atomic_sub_return (1, (v)) | ||
| 74 | #define atomic_inc_return(v) atomic_add_return (1, (v)) | ||
| 75 | #define atomic_inc(v) atomic_inc_return (v) | ||
| 76 | #define atomic_dec(v) atomic_dec_return (v) | ||
| 77 | |||
| 78 | /* | ||
| 79 | * atomic_inc_and_test - increment and test | ||
| 80 | * @v: pointer of type atomic_t | ||
| 81 | * | ||
| 82 | * Atomically increments @v by 1 | ||
| 83 | * and returns true if the result is zero, or false for all | ||
| 84 | * other cases. | ||
| 85 | */ | ||
| 86 | #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) | ||
| 87 | |||
| 88 | #define atomic_sub_and_test(i,v) (atomic_sub_return ((i), (v)) == 0) | ||
| 89 | #define atomic_dec_and_test(v) (atomic_sub_return (1, (v)) == 0) | ||
| 90 | #define atomic_add_negative(i,v) (atomic_add_return ((i), (v)) < 0) | ||
| 91 | |||
| 92 | static inline int atomic_cmpxchg(atomic_t *v, int old, int new) | ||
| 93 | { | ||
| 94 | int ret; | ||
| 95 | unsigned long flags; | ||
| 96 | |||
| 97 | local_irq_save(flags); | ||
| 98 | ret = v->counter; | ||
| 99 | if (likely(ret == old)) | ||
| 100 | v->counter = new; | ||
| 101 | local_irq_restore(flags); | ||
| 102 | |||
| 103 | return ret; | ||
| 104 | } | ||
| 105 | |||
| 106 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | ||
| 107 | |||
| 108 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | ||
| 109 | { | ||
| 110 | int ret; | ||
| 111 | unsigned long flags; | ||
| 112 | |||
| 113 | local_irq_save(flags); | ||
| 114 | ret = v->counter; | ||
| 115 | if (ret != u) | ||
| 116 | v->counter += a; | ||
| 117 | local_irq_restore(flags); | ||
| 118 | |||
| 119 | return ret != u; | ||
| 120 | } | ||
| 121 | |||
| 122 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
| 123 | |||
| 124 | /* Atomic operations are already serializing on ARM */ | ||
| 125 | #define smp_mb__before_atomic_dec() barrier() | ||
| 126 | #define smp_mb__after_atomic_dec() barrier() | ||
| 127 | #define smp_mb__before_atomic_inc() barrier() | ||
| 128 | #define smp_mb__after_atomic_inc() barrier() | ||
| 129 | |||
| 130 | #include <asm-generic/atomic.h> | ||
| 131 | #endif /* __V850_ATOMIC_H__ */ | ||
diff --git a/include/asm-v850/auxvec.h b/include/asm-v850/auxvec.h deleted file mode 100644 index f493232d0224..000000000000 --- a/include/asm-v850/auxvec.h +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | #ifndef __V850_AUXVEC_H__ | ||
| 2 | #define __V850_AUXVEC_H__ | ||
| 3 | |||
| 4 | #endif /* __V850_AUXVEC_H__ */ | ||
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h deleted file mode 100644 index f82f5b4a56e0..000000000000 --- a/include/asm-v850/bitops.h +++ /dev/null | |||
| @@ -1,161 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/bitops.h -- Bit operations | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03,04,05 Miles Bader <miles@gnu.org> | ||
| 6 | * Copyright (C) 1992 Linus Torvalds. | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __V850_BITOPS_H__ | ||
| 14 | #define __V850_BITOPS_H__ | ||
| 15 | |||
| 16 | #ifndef _LINUX_BITOPS_H | ||
| 17 | #error only <linux/bitops.h> can be included directly | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #include <linux/compiler.h> /* unlikely */ | ||
| 21 | #include <asm/byteorder.h> /* swab32 */ | ||
| 22 | #include <asm/system.h> /* interrupt enable/disable */ | ||
| 23 | |||
| 24 | |||
| 25 | #ifdef __KERNEL__ | ||
| 26 | |||
| 27 | #include <asm-generic/bitops/ffz.h> | ||
| 28 | |||
| 29 | /* | ||
| 30 | * The __ functions are not atomic | ||
| 31 | */ | ||
| 32 | |||
| 33 | /* In the following constant-bit-op macros, a "g" constraint is used when | ||
| 34 | we really need an integer ("i" constraint). This is to avoid | ||
| 35 | warnings/errors from the compiler in the case where the associated | ||
| 36 | operand _isn't_ an integer, and shouldn't produce bogus assembly because | ||
| 37 | use of that form is protected by a guard statement that checks for | ||
| 38 | constants, and should otherwise be removed by the optimizer. This | ||
| 39 | _usually_ works -- however, __builtin_constant_p returns true for a | ||
| 40 | variable with a known constant value too, and unfortunately gcc will | ||
| 41 | happily put the variable in a register and use the register for the "g" | ||
| 42 | constraint'd asm operand. To avoid the latter problem, we add a | ||
| 43 | constant offset to the operand and subtract it back in the asm code; | ||
| 44 | forcing gcc to do arithmetic on the value is usually enough to get it | ||
| 45 | to use a real constant value. This is horrible, and ultimately | ||
| 46 | unreliable too, but it seems to work for now (hopefully gcc will offer | ||
| 47 | us more control in the future, so we can do a better job). */ | ||
| 48 | |||
| 49 | #define __const_bit_op(op, nr, addr) \ | ||
| 50 | ({ __asm__ (op " (%0 - 0x123), %1" \ | ||
| 51 | :: "g" (((nr) & 0x7) + 0x123), \ | ||
| 52 | "m" (*((char *)(addr) + ((nr) >> 3))) \ | ||
| 53 | : "memory"); }) | ||
| 54 | #define __var_bit_op(op, nr, addr) \ | ||
| 55 | ({ int __nr = (nr); \ | ||
| 56 | __asm__ (op " %0, [%1]" \ | ||
| 57 | :: "r" (__nr & 0x7), \ | ||
| 58 | "r" ((char *)(addr) + (__nr >> 3)) \ | ||
| 59 | : "memory"); }) | ||
| 60 | #define __bit_op(op, nr, addr) \ | ||
| 61 | ((__builtin_constant_p (nr) && (unsigned)(nr) <= 0x7FFFF) \ | ||
| 62 | ? __const_bit_op (op, nr, addr) \ | ||
| 63 | : __var_bit_op (op, nr, addr)) | ||
| 64 | |||
| 65 | #define __set_bit(nr, addr) __bit_op ("set1", nr, addr) | ||
| 66 | #define __clear_bit(nr, addr) __bit_op ("clr1", nr, addr) | ||
| 67 | #define __change_bit(nr, addr) __bit_op ("not1", nr, addr) | ||
| 68 | |||
| 69 | /* The bit instructions used by `non-atomic' variants are actually atomic. */ | ||
| 70 | #define set_bit __set_bit | ||
| 71 | #define clear_bit __clear_bit | ||
| 72 | #define change_bit __change_bit | ||
| 73 | |||
| 74 | |||
| 75 | #define __const_tns_bit_op(op, nr, addr) \ | ||
| 76 | ({ int __tns_res; \ | ||
| 77 | __asm__ __volatile__ ( \ | ||
| 78 | "tst1 (%1 - 0x123), %2; setf nz, %0; " op " (%1 - 0x123), %2" \ | ||
| 79 | : "=&r" (__tns_res) \ | ||
| 80 | : "g" (((nr) & 0x7) + 0x123), \ | ||
| 81 | "m" (*((char *)(addr) + ((nr) >> 3))) \ | ||
| 82 | : "memory"); \ | ||
| 83 | __tns_res; \ | ||
| 84 | }) | ||
| 85 | #define __var_tns_bit_op(op, nr, addr) \ | ||
| 86 | ({ int __nr = (nr); \ | ||
| 87 | int __tns_res; \ | ||
| 88 | __asm__ __volatile__ ( \ | ||
| 89 | "tst1 %1, [%2]; setf nz, %0; " op " %1, [%2]" \ | ||
| 90 | : "=&r" (__tns_res) \ | ||
| 91 | : "r" (__nr & 0x7), \ | ||
| 92 | "r" ((char *)(addr) + (__nr >> 3)) \ | ||
| 93 | : "memory"); \ | ||
| 94 | __tns_res; \ | ||
| 95 | }) | ||
| 96 | #define __tns_bit_op(op, nr, addr) \ | ||
| 97 | ((__builtin_constant_p (nr) && (unsigned)(nr) <= 0x7FFFF) \ | ||
| 98 | ? __const_tns_bit_op (op, nr, addr) \ | ||
| 99 | : __var_tns_bit_op (op, nr, addr)) | ||
| 100 | #define __tns_atomic_bit_op(op, nr, addr) \ | ||
| 101 | ({ int __tns_atomic_res, __tns_atomic_flags; \ | ||
| 102 | local_irq_save (__tns_atomic_flags); \ | ||
| 103 | __tns_atomic_res = __tns_bit_op (op, nr, addr); \ | ||
| 104 | local_irq_restore (__tns_atomic_flags); \ | ||
| 105 | __tns_atomic_res; \ | ||
| 106 | }) | ||
| 107 | |||
| 108 | #define __test_and_set_bit(nr, addr) __tns_bit_op ("set1", nr, addr) | ||
| 109 | #define test_and_set_bit(nr, addr) __tns_atomic_bit_op ("set1", nr, addr) | ||
| 110 | |||
| 111 | #define __test_and_clear_bit(nr, addr) __tns_bit_op ("clr1", nr, addr) | ||
| 112 | #define test_and_clear_bit(nr, addr) __tns_atomic_bit_op ("clr1", nr, addr) | ||
| 113 | |||
| 114 | #define __test_and_change_bit(nr, addr) __tns_bit_op ("not1", nr, addr) | ||
| 115 | #define test_and_change_bit(nr, addr) __tns_atomic_bit_op ("not1", nr, addr) | ||
| 116 | |||
| 117 | |||
| 118 | #define __const_test_bit(nr, addr) \ | ||
| 119 | ({ int __test_bit_res; \ | ||
| 120 | __asm__ __volatile__ ("tst1 (%1 - 0x123), %2; setf nz, %0" \ | ||
| 121 | : "=r" (__test_bit_res) \ | ||
| 122 | : "g" (((nr) & 0x7) + 0x123), \ | ||
| 123 | "m" (*((const char *)(addr) + ((nr) >> 3)))); \ | ||
| 124 | __test_bit_res; \ | ||
| 125 | }) | ||
| 126 | static inline int __test_bit (int nr, const void *addr) | ||
| 127 | { | ||
| 128 | int res; | ||
| 129 | __asm__ __volatile__ ("tst1 %1, [%2]; setf nz, %0" | ||
| 130 | : "=r" (res) | ||
| 131 | : "r" (nr & 0x7), "r" (addr + (nr >> 3))); | ||
| 132 | return res; | ||
| 133 | } | ||
| 134 | #define test_bit(nr,addr) \ | ||
| 135 | ((__builtin_constant_p (nr) && (unsigned)(nr) <= 0x7FFFF) \ | ||
| 136 | ? __const_test_bit ((nr), (addr)) \ | ||
| 137 | : __test_bit ((nr), (addr))) | ||
| 138 | |||
| 139 | |||
| 140 | /* clear_bit doesn't provide any barrier for the compiler. */ | ||
| 141 | #define smp_mb__before_clear_bit() barrier () | ||
| 142 | #define smp_mb__after_clear_bit() barrier () | ||
| 143 | |||
| 144 | #include <asm-generic/bitops/ffs.h> | ||
| 145 | #include <asm-generic/bitops/fls.h> | ||
| 146 | #include <asm-generic/bitops/fls64.h> | ||
| 147 | #include <asm-generic/bitops/__ffs.h> | ||
| 148 | #include <asm-generic/bitops/find.h> | ||
| 149 | #include <asm-generic/bitops/sched.h> | ||
| 150 | #include <asm-generic/bitops/hweight.h> | ||
| 151 | #include <asm-generic/bitops/lock.h> | ||
| 152 | |||
| 153 | #include <asm-generic/bitops/ext2-non-atomic.h> | ||
| 154 | #define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) | ||
| 155 | #define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a) | ||
| 156 | |||
| 157 | #include <asm-generic/bitops/minix.h> | ||
| 158 | |||
| 159 | #endif /* __KERNEL__ */ | ||
| 160 | |||
| 161 | #endif /* __V850_BITOPS_H__ */ | ||
diff --git a/include/asm-v850/bug.h b/include/asm-v850/bug.h deleted file mode 100644 index b0ed2d35f3e8..000000000000 --- a/include/asm-v850/bug.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/bug.h -- Bug reporting | ||
| 3 | * | ||
| 4 | * Copyright (C) 2003 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2003 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_BUG_H__ | ||
| 15 | #define __V850_BUG_H__ | ||
| 16 | |||
| 17 | #ifdef CONFIG_BUG | ||
| 18 | extern void __bug (void) __attribute__ ((noreturn)); | ||
| 19 | #define BUG() __bug() | ||
| 20 | #define HAVE_ARCH_BUG | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #include <asm-generic/bug.h> | ||
| 24 | |||
| 25 | #endif /* __V850_BUG_H__ */ | ||
diff --git a/include/asm-v850/bugs.h b/include/asm-v850/bugs.h deleted file mode 100644 index 71110a65c1d7..000000000000 --- a/include/asm-v850/bugs.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850e/bugs.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 1994 Linus Torvalds | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* | ||
| 8 | * This is included by init/main.c to check for architecture-dependent bugs. | ||
| 9 | * | ||
| 10 | * Needs: | ||
| 11 | * void check_bugs(void); | ||
| 12 | */ | ||
| 13 | |||
| 14 | static void check_bugs(void) | ||
| 15 | { | ||
| 16 | } | ||
diff --git a/include/asm-v850/byteorder.h b/include/asm-v850/byteorder.h deleted file mode 100644 index a6f07530050e..000000000000 --- a/include/asm-v850/byteorder.h +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/byteorder.h -- Endian id and conversion ops | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001 NEC Corporation | ||
| 5 | * Copyright (C) 2001 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_BYTEORDER_H__ | ||
| 15 | #define __V850_BYTEORDER_H__ | ||
| 16 | |||
| 17 | #include <asm/types.h> | ||
| 18 | #include <linux/compiler.h> | ||
| 19 | |||
| 20 | #ifdef __GNUC__ | ||
| 21 | |||
| 22 | static __inline__ __attribute_const__ __u32 ___arch__swab32 (__u32 word) | ||
| 23 | { | ||
| 24 | __u32 res; | ||
| 25 | __asm__ ("bsw %1, %0" : "=r" (res) : "r" (word)); | ||
| 26 | return res; | ||
| 27 | } | ||
| 28 | |||
| 29 | static __inline__ __attribute_const__ __u16 ___arch__swab16 (__u16 half_word) | ||
| 30 | { | ||
| 31 | __u16 res; | ||
| 32 | __asm__ ("bsh %1, %0" : "=r" (res) : "r" (half_word)); | ||
| 33 | return res; | ||
| 34 | } | ||
| 35 | |||
| 36 | #define __arch__swab32(x) ___arch__swab32(x) | ||
| 37 | #define __arch__swab16(x) ___arch__swab16(x) | ||
| 38 | |||
| 39 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
| 40 | # define __BYTEORDER_HAS_U64__ | ||
| 41 | # define __SWAB_64_THRU_32__ | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #endif /* __GNUC__ */ | ||
| 45 | |||
| 46 | #include <linux/byteorder/little_endian.h> | ||
| 47 | |||
| 48 | #endif /* __V850_BYTEORDER_H__ */ | ||
diff --git a/include/asm-v850/cache.h b/include/asm-v850/cache.h deleted file mode 100644 index 8832c7ea3242..000000000000 --- a/include/asm-v850/cache.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/cache.h -- Cache operations | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,05 NEC Corporation | ||
| 5 | * Copyright (C) 2001,05 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_CACHE_H__ | ||
| 15 | #define __V850_CACHE_H__ | ||
| 16 | |||
| 17 | /* All cache operations are machine-dependent. */ | ||
| 18 | #include <asm/machdep.h> | ||
| 19 | |||
| 20 | #ifndef L1_CACHE_BYTES | ||
| 21 | /* This processor has no cache, so just choose an arbitrary value. */ | ||
| 22 | #define L1_CACHE_BYTES 16 | ||
| 23 | #define L1_CACHE_SHIFT 4 | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #endif /* __V850_CACHE_H__ */ | ||
diff --git a/include/asm-v850/cacheflush.h b/include/asm-v850/cacheflush.h deleted file mode 100644 index 9ece05a202ef..000000000000 --- a/include/asm-v850/cacheflush.h +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/cacheflush.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_CACHEFLUSH_H__ | ||
| 15 | #define __V850_CACHEFLUSH_H__ | ||
| 16 | |||
| 17 | /* Somebody depends on this; sigh... */ | ||
| 18 | #include <linux/mm.h> | ||
| 19 | |||
| 20 | #include <asm/machdep.h> | ||
| 21 | |||
| 22 | |||
| 23 | /* The following are all used by the kernel in ways that only affect | ||
| 24 | systems with MMUs, so we don't need them. */ | ||
| 25 | #define flush_cache_all() ((void)0) | ||
| 26 | #define flush_cache_mm(mm) ((void)0) | ||
| 27 | #define flush_cache_dup_mm(mm) ((void)0) | ||
| 28 | #define flush_cache_range(vma, start, end) ((void)0) | ||
| 29 | #define flush_cache_page(vma, vmaddr, pfn) ((void)0) | ||
| 30 | #define flush_dcache_page(page) ((void)0) | ||
| 31 | #define flush_dcache_mmap_lock(mapping) ((void)0) | ||
| 32 | #define flush_dcache_mmap_unlock(mapping) ((void)0) | ||
| 33 | #define flush_cache_vmap(start, end) ((void)0) | ||
| 34 | #define flush_cache_vunmap(start, end) ((void)0) | ||
| 35 | |||
| 36 | #ifdef CONFIG_NO_CACHE | ||
| 37 | |||
| 38 | /* Some systems have no cache at all, in which case we don't need these | ||
| 39 | either. */ | ||
| 40 | #define flush_icache() ((void)0) | ||
| 41 | #define flush_icache_range(start, end) ((void)0) | ||
| 42 | #define flush_icache_page(vma,pg) ((void)0) | ||
| 43 | #define flush_icache_user_range(vma,pg,adr,len) ((void)0) | ||
| 44 | #define flush_cache_sigtramp(vaddr) ((void)0) | ||
| 45 | |||
| 46 | #else /* !CONFIG_NO_CACHE */ | ||
| 47 | |||
| 48 | struct page; | ||
| 49 | struct mm_struct; | ||
| 50 | struct vm_area_struct; | ||
| 51 | |||
| 52 | /* Otherwise, somebody had better define them. */ | ||
| 53 | extern void flush_icache (void); | ||
| 54 | extern void flush_icache_range (unsigned long start, unsigned long end); | ||
| 55 | extern void flush_icache_page (struct vm_area_struct *vma, struct page *page); | ||
| 56 | extern void flush_icache_user_range (struct vm_area_struct *vma, | ||
| 57 | struct page *page, | ||
| 58 | unsigned long adr, int len); | ||
| 59 | extern void flush_cache_sigtramp (unsigned long addr); | ||
| 60 | |||
| 61 | #endif /* CONFIG_NO_CACHE */ | ||
| 62 | |||
| 63 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | ||
| 64 | do { memcpy(dst, src, len); \ | ||
| 65 | flush_icache_user_range(vma, page, vaddr, len); \ | ||
| 66 | } while (0) | ||
| 67 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | ||
| 68 | memcpy(dst, src, len) | ||
| 69 | |||
| 70 | #endif /* __V850_CACHEFLUSH_H__ */ | ||
diff --git a/include/asm-v850/checksum.h b/include/asm-v850/checksum.h deleted file mode 100644 index d1dddd938262..000000000000 --- a/include/asm-v850/checksum.h +++ /dev/null | |||
| @@ -1,112 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/checksum.h -- Checksum ops | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,2005 NEC Corporation | ||
| 5 | * Copyright (C) 2001,2005 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_CHECKSUM_H__ | ||
| 15 | #define __V850_CHECKSUM_H__ | ||
| 16 | |||
| 17 | /* | ||
| 18 | * computes the checksum of a memory block at buff, length len, | ||
| 19 | * and adds in "sum" (32-bit) | ||
| 20 | * | ||
| 21 | * returns a 32-bit number suitable for feeding into itself | ||
| 22 | * or csum_tcpudp_magic | ||
| 23 | * | ||
| 24 | * this function must be called with even lengths, except | ||
| 25 | * for the last fragment, which may be odd | ||
| 26 | * | ||
| 27 | * it's best to have buff aligned on a 32-bit boundary | ||
| 28 | */ | ||
| 29 | extern __wsum csum_partial(const void *buff, int len, __wsum sum); | ||
| 30 | |||
| 31 | /* | ||
| 32 | * the same as csum_partial, but copies from src while it | ||
| 33 | * checksums | ||
| 34 | * | ||
| 35 | * here even more important to align src and dst on a 32-bit (or even | ||
| 36 | * better 64-bit) boundary | ||
| 37 | */ | ||
| 38 | extern __wsum csum_partial_copy_nocheck(const void *src, | ||
| 39 | void *dst, int len, __wsum sum); | ||
| 40 | |||
| 41 | |||
| 42 | /* | ||
| 43 | * the same as csum_partial_copy, but copies from user space. | ||
| 44 | * | ||
| 45 | * here even more important to align src and dst on a 32-bit (or even | ||
| 46 | * better 64-bit) boundary | ||
| 47 | */ | ||
| 48 | extern __wsum csum_partial_copy_from_user (const void *src, | ||
| 49 | void *dst, | ||
| 50 | int len, __wsum sum, | ||
| 51 | int *csum_err); | ||
| 52 | |||
| 53 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); | ||
| 54 | |||
| 55 | /* | ||
| 56 | * Fold a partial checksum | ||
| 57 | */ | ||
| 58 | static inline __sum16 csum_fold (__wsum sum) | ||
| 59 | { | ||
| 60 | unsigned int result; | ||
| 61 | /* | ||
| 62 | %0 %1 | ||
| 63 | hsw %1, %0 H L L H | ||
| 64 | add %1, %0 H L H+L+C H+L | ||
| 65 | */ | ||
| 66 | asm ("hsw %1, %0; add %1, %0" : "=&r" (result) : "r" (sum)); | ||
| 67 | return (__force __sum16)(~result >> 16); | ||
| 68 | } | ||
| 69 | |||
| 70 | |||
| 71 | /* | ||
| 72 | * computes the checksum of the TCP/UDP pseudo-header | ||
| 73 | * returns a 16-bit checksum, already complemented | ||
| 74 | */ | ||
| 75 | static inline __wsum | ||
| 76 | csum_tcpudp_nofold (__be32 saddr, __be32 daddr, | ||
| 77 | unsigned short len, | ||
| 78 | unsigned short proto, __wsum sum) | ||
| 79 | { | ||
| 80 | int __carry; | ||
| 81 | __asm__ ("add %2, %0;" | ||
| 82 | "setf c, %1;" | ||
| 83 | "add %1, %0;" | ||
| 84 | "add %3, %0;" | ||
| 85 | "setf c, %1;" | ||
| 86 | "add %1, %0;" | ||
| 87 | "add %4, %0;" | ||
| 88 | "setf c, %1;" | ||
| 89 | "add %1, %0" | ||
| 90 | : "=&r" (sum), "=&r" (__carry) | ||
| 91 | : "r" (daddr), "r" (saddr), | ||
| 92 | "r" ((len + proto) << 8), | ||
| 93 | "0" (sum)); | ||
| 94 | return sum; | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline __sum16 | ||
| 98 | csum_tcpudp_magic (__be32 saddr, __be32 daddr, | ||
| 99 | unsigned short len, | ||
| 100 | unsigned short proto, __wsum sum) | ||
| 101 | { | ||
| 102 | return csum_fold (csum_tcpudp_nofold (saddr, daddr, len, proto, sum)); | ||
| 103 | } | ||
| 104 | |||
| 105 | /* | ||
| 106 | * this routine is used for miscellaneous IP-like checksums, mainly | ||
| 107 | * in icmp.c | ||
| 108 | */ | ||
| 109 | extern __sum16 ip_compute_csum(const void *buff, int len); | ||
| 110 | |||
| 111 | |||
| 112 | #endif /* __V850_CHECKSUM_H__ */ | ||
diff --git a/include/asm-v850/clinkage.h b/include/asm-v850/clinkage.h deleted file mode 100644 index c389691d6f86..000000000000 --- a/include/asm-v850/clinkage.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/clinkage.h -- Macros to reflect C symbol-naming conventions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporatione | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_CLINKAGE_H__ | ||
| 15 | #define __V850_CLINKAGE_H__ | ||
| 16 | |||
| 17 | #include <asm/macrology.h> | ||
| 18 | #include <asm/asm.h> | ||
| 19 | |||
| 20 | #define C_SYMBOL_NAME(name) macrology_paste(_, name) | ||
| 21 | #define C_SYMBOL_STRING(name) macrology_stringify(C_SYMBOL_NAME(name)) | ||
| 22 | #define C_ENTRY(name) G_ENTRY(C_SYMBOL_NAME(name)) | ||
| 23 | #define C_DATA(name) G_DATA(C_SYMBOL_NAME(name)) | ||
| 24 | #define C_END(name) END(C_SYMBOL_NAME(name)) | ||
| 25 | |||
| 26 | #endif /* __V850_CLINKAGE_H__ */ | ||
diff --git a/include/asm-v850/cputime.h b/include/asm-v850/cputime.h deleted file mode 100644 index 7c799c33b8a9..000000000000 --- a/include/asm-v850/cputime.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_CPUTIME_H | ||
| 2 | #define __V850_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm-generic/cputime.h> | ||
| 5 | |||
| 6 | #endif /* __V850_CPUTIME_H */ | ||
diff --git a/include/asm-v850/current.h b/include/asm-v850/current.h deleted file mode 100644 index 30aae5673770..000000000000 --- a/include/asm-v850/current.h +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/current.h -- Current task | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_CURRENT_H__ | ||
| 15 | #define __V850_CURRENT_H__ | ||
| 16 | |||
| 17 | #ifndef __ASSEMBLY__ /* <linux/thread_info.h> is not asm-safe. */ | ||
| 18 | #include <linux/thread_info.h> | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #include <asm/macrology.h> | ||
| 22 | |||
| 23 | |||
| 24 | /* Register used to hold the current task pointer while in the kernel. | ||
| 25 | Any `call clobbered' register without a special meaning should be OK, | ||
| 26 | but check asm/v850/kernel/entry.S to be sure. */ | ||
| 27 | #define CURRENT_TASK_REGNUM 16 | ||
| 28 | #define CURRENT_TASK macrology_paste (r, CURRENT_TASK_REGNUM) | ||
| 29 | |||
| 30 | |||
| 31 | #ifdef __ASSEMBLY__ | ||
| 32 | |||
| 33 | /* Put a pointer to the current task structure into REG. */ | ||
| 34 | #define GET_CURRENT_TASK(reg) \ | ||
| 35 | GET_CURRENT_THREAD(reg); \ | ||
| 36 | ld.w TI_TASK[reg], reg | ||
| 37 | |||
| 38 | #else /* !__ASSEMBLY__ */ | ||
| 39 | |||
| 40 | /* A pointer to the current task. */ | ||
| 41 | register struct task_struct *current \ | ||
| 42 | __asm__ (macrology_stringify (CURRENT_TASK)); | ||
| 43 | |||
| 44 | #endif /* __ASSEMBLY__ */ | ||
| 45 | |||
| 46 | |||
| 47 | #endif /* _V850_CURRENT_H */ | ||
diff --git a/include/asm-v850/delay.h b/include/asm-v850/delay.h deleted file mode 100644 index 6d028e6b2354..000000000000 --- a/include/asm-v850/delay.h +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/delay.h -- Delay routines, using a pre-computed | ||
| 3 | * "loops_per_second" value | ||
| 4 | * | ||
| 5 | * Copyright (C) 2001,03 NEC Corporation | ||
| 6 | * Copyright (C) 2001,03 Miles Bader <miles@gnu.org> | ||
| 7 | * Copyright (C) 1994 Hamish Macdonald | ||
| 8 | * | ||
| 9 | * This file is subject to the terms and conditions of the GNU General | ||
| 10 | * Public License. See the file COPYING in the main directory of this | ||
| 11 | * archive for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_DELAY_H__ | ||
| 15 | #define __V850_DELAY_H__ | ||
| 16 | |||
| 17 | #include <asm/param.h> | ||
| 18 | |||
| 19 | static inline void __delay(unsigned long loops) | ||
| 20 | { | ||
| 21 | if (loops) | ||
| 22 | __asm__ __volatile__ ("1: add -1, %0; bnz 1b" | ||
| 23 | : "=r" (loops) : "0" (loops)); | ||
| 24 | } | ||
| 25 | |||
| 26 | /* | ||
| 27 | * Use only for very small delays ( < 1 msec). Should probably use a | ||
| 28 | * lookup table, really, as the multiplications take much too long with | ||
| 29 | * short delays. This is a "reasonable" implementation, though (and the | ||
| 30 | * first constant multiplications gets optimized away if the delay is | ||
| 31 | * a constant) | ||
| 32 | */ | ||
| 33 | |||
| 34 | extern unsigned long loops_per_jiffy; | ||
| 35 | |||
| 36 | static inline void udelay(unsigned long usecs) | ||
| 37 | { | ||
| 38 | register unsigned long full_loops, part_loops; | ||
| 39 | |||
| 40 | full_loops = ((usecs * HZ) / 1000000) * loops_per_jiffy; | ||
| 41 | usecs %= (1000000 / HZ); | ||
| 42 | part_loops = (usecs * HZ * loops_per_jiffy) / 1000000; | ||
| 43 | |||
| 44 | __delay(full_loops + part_loops); | ||
| 45 | } | ||
| 46 | |||
| 47 | #endif /* __V850_DELAY_H__ */ | ||
diff --git a/include/asm-v850/device.h b/include/asm-v850/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/include/asm-v850/device.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Arch specific extensions to struct device | ||
| 3 | * | ||
| 4 | * This file is released under the GPLv2 | ||
| 5 | */ | ||
| 6 | #include <asm-generic/device.h> | ||
| 7 | |||
diff --git a/include/asm-v850/div64.h b/include/asm-v850/div64.h deleted file mode 100644 index 6cd978cefb28..000000000000 --- a/include/asm-v850/div64.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/div64.h> | ||
diff --git a/include/asm-v850/dma-mapping.h b/include/asm-v850/dma-mapping.h deleted file mode 100644 index 1cc42c603a1b..000000000000 --- a/include/asm-v850/dma-mapping.h +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | #ifndef __V850_DMA_MAPPING_H__ | ||
| 2 | #define __V850_DMA_MAPPING_H__ | ||
| 3 | |||
| 4 | |||
| 5 | #ifdef CONFIG_PCI | ||
| 6 | #include <asm-generic/dma-mapping.h> | ||
| 7 | #else | ||
| 8 | #include <asm-generic/dma-mapping-broken.h> | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #endif /* __V850_DMA_MAPPING_H__ */ | ||
diff --git a/include/asm-v850/dma.h b/include/asm-v850/dma.h deleted file mode 100644 index 2369849e2d0a..000000000000 --- a/include/asm-v850/dma.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef __V850_DMA_H__ | ||
| 2 | #define __V850_DMA_H__ | ||
| 3 | |||
| 4 | /* What should this be? */ | ||
| 5 | #define MAX_DMA_ADDRESS 0xFFFFFFFF | ||
| 6 | |||
| 7 | /* reserve a DMA channel */ | ||
| 8 | extern int request_dma (unsigned int dmanr, const char * device_id); | ||
| 9 | /* release it again */ | ||
| 10 | extern void free_dma (unsigned int dmanr); | ||
| 11 | |||
| 12 | #ifdef CONFIG_PCI | ||
| 13 | extern int isa_dma_bridge_buggy; | ||
| 14 | #else | ||
| 15 | #define isa_dma_bridge_buggy (0) | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #endif /* __V850_DMA_H__ */ | ||
diff --git a/include/asm-v850/elf.h b/include/asm-v850/elf.h deleted file mode 100644 index 28f5b176ff1a..000000000000 --- a/include/asm-v850/elf.h +++ /dev/null | |||
| @@ -1,99 +0,0 @@ | |||
| 1 | #ifndef __V850_ELF_H__ | ||
| 2 | #define __V850_ELF_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * ELF register definitions.. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <asm/ptrace.h> | ||
| 9 | #include <asm/user.h> | ||
| 10 | #include <asm/byteorder.h> | ||
| 11 | |||
| 12 | typedef unsigned long elf_greg_t; | ||
| 13 | |||
| 14 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) | ||
| 15 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
| 16 | |||
| 17 | typedef struct user_fpu_struct elf_fpregset_t; | ||
| 18 | |||
| 19 | /* | ||
| 20 | * This is used to ensure we don't load something for the wrong architecture. | ||
| 21 | */ | ||
| 22 | #define elf_check_arch(x) \ | ||
| 23 | ((x)->e_machine == EM_V850 || (x)->e_machine == EM_CYGNUS_V850) | ||
| 24 | |||
| 25 | |||
| 26 | /* v850 relocation types. */ | ||
| 27 | #define R_V850_NONE 0 | ||
| 28 | #define R_V850_9_PCREL 1 | ||
| 29 | #define R_V850_22_PCREL 2 | ||
| 30 | #define R_V850_HI16_S 3 | ||
| 31 | #define R_V850_HI16 4 | ||
| 32 | #define R_V850_LO16 5 | ||
| 33 | #define R_V850_32 6 | ||
| 34 | #define R_V850_16 7 | ||
| 35 | #define R_V850_8 8 | ||
| 36 | #define R_V850_SDA_16_16_OFFSET 9 /* For ld.b, st.b, set1, clr1, | ||
| 37 | not1, tst1, movea, movhi */ | ||
| 38 | #define R_V850_SDA_15_16_OFFSET 10 /* For ld.w, ld.h, ld.hu, st.w, st.h */ | ||
| 39 | #define R_V850_ZDA_16_16_OFFSET 11 /* For ld.b, st.b, set1, clr1, | ||
| 40 | not1, tst1, movea, movhi */ | ||
| 41 | #define R_V850_ZDA_15_16_OFFSET 12 /* For ld.w, ld.h, ld.hu, st.w, st.h */ | ||
| 42 | #define R_V850_TDA_6_8_OFFSET 13 /* For sst.w, sld.w */ | ||
| 43 | #define R_V850_TDA_7_8_OFFSET 14 /* For sst.h, sld.h */ | ||
| 44 | #define R_V850_TDA_7_7_OFFSET 15 /* For sst.b, sld.b */ | ||
| 45 | #define R_V850_TDA_16_16_OFFSET 16 /* For set1, clr1, not1, tst1, | ||
| 46 | movea, movhi */ | ||
| 47 | #define R_V850_NUM 17 | ||
| 48 | |||
| 49 | |||
| 50 | /* | ||
| 51 | * These are used to set parameters in the core dumps. | ||
| 52 | */ | ||
| 53 | #define ELF_CLASS ELFCLASS32 | ||
| 54 | #ifdef __LITTLE_ENDIAN__ | ||
| 55 | #define ELF_DATA ELFDATA2LSB | ||
| 56 | #else | ||
| 57 | #define ELF_DATA ELFDATA2MSB | ||
| 58 | #endif | ||
| 59 | #define ELF_ARCH EM_V850 | ||
| 60 | |||
| 61 | #define USE_ELF_CORE_DUMP | ||
| 62 | #define ELF_EXEC_PAGESIZE 4096 | ||
| 63 | |||
| 64 | |||
| 65 | #define ELF_CORE_COPY_REGS(_dest,_regs) \ | ||
| 66 | memcpy((char *) &_dest, (char *) _regs, \ | ||
| 67 | sizeof(struct pt_regs)); | ||
| 68 | |||
| 69 | /* This yields a mask that user programs can use to figure out what | ||
| 70 | instruction set this CPU supports. This could be done in user space, | ||
| 71 | but it's not easy, and we've already done it here. */ | ||
| 72 | |||
| 73 | #define ELF_HWCAP (0) | ||
| 74 | |||
| 75 | /* This yields a string that ld.so will use to load implementation | ||
| 76 | specific libraries for optimization. This is more specific in | ||
| 77 | intent than poking at uname or /proc/cpuinfo. | ||
| 78 | |||
| 79 | For the moment, we have only optimizations for the Intel generations, | ||
| 80 | but that could change... */ | ||
| 81 | |||
| 82 | #define ELF_PLATFORM (NULL) | ||
| 83 | |||
| 84 | #define ELF_PLAT_INIT(_r, load_addr) \ | ||
| 85 | do { \ | ||
| 86 | _r->gpr[0] = _r->gpr[1] = _r->gpr[2] = _r->gpr[3] = \ | ||
| 87 | _r->gpr[4] = _r->gpr[5] = _r->gpr[6] = _r->gpr[7] = \ | ||
| 88 | _r->gpr[8] = _r->gpr[9] = _r->gpr[10] = _r->gpr[11] = \ | ||
| 89 | _r->gpr[12] = _r->gpr[13] = _r->gpr[14] = _r->gpr[15] = \ | ||
| 90 | _r->gpr[16] = _r->gpr[17] = _r->gpr[18] = _r->gpr[19] = \ | ||
| 91 | _r->gpr[20] = _r->gpr[21] = _r->gpr[22] = _r->gpr[23] = \ | ||
| 92 | _r->gpr[24] = _r->gpr[25] = _r->gpr[26] = _r->gpr[27] = \ | ||
| 93 | _r->gpr[28] = _r->gpr[29] = _r->gpr[30] = _r->gpr[31] = \ | ||
| 94 | 0; \ | ||
| 95 | } while (0) | ||
| 96 | |||
| 97 | #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) | ||
| 98 | |||
| 99 | #endif /* __V850_ELF_H__ */ | ||
diff --git a/include/asm-v850/emergency-restart.h b/include/asm-v850/emergency-restart.h deleted file mode 100644 index 108d8c48e42e..000000000000 --- a/include/asm-v850/emergency-restart.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
| 2 | #define _ASM_EMERGENCY_RESTART_H | ||
| 3 | |||
| 4 | #include <asm-generic/emergency-restart.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/include/asm-v850/entry.h b/include/asm-v850/entry.h deleted file mode 100644 index d9df8ac48584..000000000000 --- a/include/asm-v850/entry.h +++ /dev/null | |||
| @@ -1,113 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/entry.h -- Definitions used by low-level trap handlers | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_ENTRY_H__ | ||
| 15 | #define __V850_ENTRY_H__ | ||
| 16 | |||
| 17 | |||
| 18 | #include <asm/ptrace.h> | ||
| 19 | #include <asm/machdep.h> | ||
| 20 | |||
| 21 | |||
| 22 | /* These are special variables using by the kernel trap/interrupt code | ||
| 23 | to save registers in, at a time when there are no spare registers we | ||
| 24 | can use to do so, and we can't depend on the value of the stack | ||
| 25 | pointer. This means that they must be within a signed 16-bit | ||
| 26 | displacement of 0x00000000. */ | ||
| 27 | |||
| 28 | #define KERNEL_VAR_SPACE_ADDR R0_RAM_ADDR | ||
| 29 | |||
| 30 | #ifdef __ASSEMBLY__ | ||
| 31 | #define KERNEL_VAR(addr) addr[r0] | ||
| 32 | #else | ||
| 33 | #define KERNEL_VAR(addr) (*(volatile unsigned long *)(addr)) | ||
| 34 | #endif | ||
| 35 | |||
| 36 | /* Kernel stack pointer, 4 bytes. */ | ||
| 37 | #define KSP_ADDR (KERNEL_VAR_SPACE_ADDR + 0) | ||
| 38 | #define KSP KERNEL_VAR (KSP_ADDR) | ||
| 39 | /* 1 if in kernel-mode, 0 if in user mode, 1 byte. */ | ||
| 40 | #define KM_ADDR (KERNEL_VAR_SPACE_ADDR + 4) | ||
| 41 | #define KM KERNEL_VAR (KM_ADDR) | ||
| 42 | /* Temporary storage for interrupt handlers, 4 bytes. */ | ||
| 43 | #define INT_SCRATCH_ADDR (KERNEL_VAR_SPACE_ADDR + 8) | ||
| 44 | #define INT_SCRATCH KERNEL_VAR (INT_SCRATCH_ADDR) | ||
| 45 | /* Where the stack-pointer is saved when jumping to various sorts of | ||
| 46 | interrupt handlers. ENTRY_SP is used by everything except NMIs, | ||
| 47 | which have their own location. Higher-priority NMIs can clobber the | ||
| 48 | value written by a lower priority NMI, since they can't be disabled, | ||
| 49 | but that's OK, because only NMI0 (the lowest-priority one) is allowed | ||
| 50 | to return. */ | ||
| 51 | #define ENTRY_SP_ADDR (KERNEL_VAR_SPACE_ADDR + 12) | ||
| 52 | #define ENTRY_SP KERNEL_VAR (ENTRY_SP_ADDR) | ||
| 53 | #define NMI_ENTRY_SP_ADDR (KERNEL_VAR_SPACE_ADDR + 16) | ||
| 54 | #define NMI_ENTRY_SP KERNEL_VAR (NMI_ENTRY_SP_ADDR) | ||
| 55 | |||
| 56 | #ifdef CONFIG_RESET_GUARD | ||
| 57 | /* Used to detect unexpected resets (since the v850 has no MMU, any call | ||
| 58 | through a null pointer will jump to the reset vector). We detect | ||
| 59 | such resets by checking for a magic value, RESET_GUARD_ACTIVE, in | ||
| 60 | this location. Properly resetting the machine stores zero there, so | ||
| 61 | it shouldn't trigger the guard; the power-on value is uncertain, but | ||
| 62 | it's unlikely to be RESET_GUARD_ACTIVE. */ | ||
| 63 | #define RESET_GUARD_ADDR (KERNEL_VAR_SPACE_ADDR + 28) | ||
| 64 | #define RESET_GUARD KERNEL_VAR (RESET_GUARD_ADDR) | ||
| 65 | #define RESET_GUARD_ACTIVE 0xFAB4BEEF | ||
| 66 | #endif /* CONFIG_RESET_GUARD */ | ||
| 67 | |||
| 68 | #ifdef CONFIG_V850E_HIGHRES_TIMER | ||
| 69 | #define HIGHRES_TIMER_SLOW_TICKS_ADDR (KERNEL_VAR_SPACE_ADDR + 32) | ||
| 70 | #define HIGHRES_TIMER_SLOW_TICKS KERNEL_VAR (HIGHRES_TIMER_SLOW_TICKS_ADDR) | ||
| 71 | #endif /* CONFIG_V850E_HIGHRES_TIMER */ | ||
| 72 | |||
| 73 | #ifndef __ASSEMBLY__ | ||
| 74 | |||
| 75 | #ifdef CONFIG_RESET_GUARD | ||
| 76 | /* Turn off reset guard, so that resetting the machine works normally. | ||
| 77 | This should be called in the various machine_halt, etc., functions. */ | ||
| 78 | static inline void disable_reset_guard (void) | ||
| 79 | { | ||
| 80 | RESET_GUARD = 0; | ||
| 81 | } | ||
| 82 | #endif /* CONFIG_RESET_GUARD */ | ||
| 83 | |||
| 84 | #endif /* !__ASSEMBLY__ */ | ||
| 85 | |||
| 86 | |||
| 87 | /* A `state save frame' is a struct pt_regs preceded by some extra space | ||
| 88 | suitable for a function call stack frame. */ | ||
| 89 | |||
| 90 | /* Amount of room on the stack reserved for arguments and to satisfy the | ||
| 91 | C calling conventions, in addition to the space used by the struct | ||
| 92 | pt_regs that actually holds saved values. */ | ||
| 93 | #define STATE_SAVE_ARG_SPACE (6*4) /* Up to six arguments. */ | ||
| 94 | |||
| 95 | |||
| 96 | #ifdef __ASSEMBLY__ | ||
| 97 | |||
| 98 | /* The size of a state save frame. */ | ||
| 99 | #define STATE_SAVE_SIZE (PT_SIZE + STATE_SAVE_ARG_SPACE) | ||
| 100 | |||
| 101 | #else /* !__ASSEMBLY__ */ | ||
| 102 | |||
| 103 | /* The size of a state save frame. */ | ||
| 104 | #define STATE_SAVE_SIZE (sizeof (struct pt_regs) + STATE_SAVE_ARG_SPACE) | ||
| 105 | |||
| 106 | #endif /* __ASSEMBLY__ */ | ||
| 107 | |||
| 108 | |||
| 109 | /* Offset of the struct pt_regs in a state save frame. */ | ||
| 110 | #define STATE_SAVE_PT_OFFSET STATE_SAVE_ARG_SPACE | ||
| 111 | |||
| 112 | |||
| 113 | #endif /* __V850_ENTRY_H__ */ | ||
diff --git a/include/asm-v850/errno.h b/include/asm-v850/errno.h deleted file mode 100644 index 31c91df01205..000000000000 --- a/include/asm-v850/errno.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_ERRNO_H__ | ||
| 2 | #define __V850_ERRNO_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/errno.h> | ||
| 5 | |||
| 6 | #endif /* __V850_ERRNO_H__ */ | ||
diff --git a/include/asm-v850/fb.h b/include/asm-v850/fb.h deleted file mode 100644 index c7df38030992..000000000000 --- a/include/asm-v850/fb.h +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | #include <linux/fb.h> | ||
| 4 | |||
| 5 | #define fb_pgprotect(...) do {} while (0) | ||
| 6 | |||
| 7 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 8 | { | ||
| 9 | return 0; | ||
| 10 | } | ||
| 11 | |||
| 12 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h deleted file mode 100644 index 3af4d56776dd..000000000000 --- a/include/asm-v850/fcntl.h +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | #ifndef __V850_FCNTL_H__ | ||
| 2 | #define __V850_FCNTL_H__ | ||
| 3 | |||
| 4 | #define O_DIRECTORY 040000 /* must be a directory */ | ||
| 5 | #define O_NOFOLLOW 0100000 /* don't follow links */ | ||
| 6 | #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ | ||
| 7 | #define O_LARGEFILE 0400000 | ||
| 8 | |||
| 9 | #include <asm-generic/fcntl.h> | ||
| 10 | |||
| 11 | #endif /* __V850_FCNTL_H__ */ | ||
diff --git a/include/asm-v850/flat.h b/include/asm-v850/flat.h deleted file mode 100644 index 17f0ea566611..000000000000 --- a/include/asm-v850/flat.h +++ /dev/null | |||
| @@ -1,133 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/flat.h -- uClinux flat-format executables | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2002,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_FLAT_H__ | ||
| 15 | #define __V850_FLAT_H__ | ||
| 16 | |||
| 17 | /* The amount by which a relocation can exceed the program image limits | ||
| 18 | without being regarded as an error. On the v850, the relocations of | ||
| 19 | some base-pointers can be offset by 0x8000 (to allow better usage of the | ||
| 20 | space offered by 16-bit signed offsets -- in most cases the offsets used | ||
| 21 | with such a base-pointer will be negative). */ | ||
| 22 | |||
| 23 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size + 0x8000)) | ||
| 24 | |||
| 25 | #define flat_stack_align(sp) /* nothing needed */ | ||
| 26 | #define flat_argvp_envp_on_stack() 0 | ||
| 27 | #define flat_old_ram_flag(flags) (flags) | ||
| 28 | #define flat_set_persistent(relval, p) 0 | ||
| 29 | |||
| 30 | /* We store the type of relocation in the top 4 bits of the `relval.' */ | ||
| 31 | |||
| 32 | /* Convert a relocation entry into an address. */ | ||
| 33 | static inline unsigned long | ||
| 34 | flat_get_relocate_addr (unsigned long relval) | ||
| 35 | { | ||
| 36 | return relval & 0x0fffffff; /* Mask out top 4-bits */ | ||
| 37 | } | ||
| 38 | |||
| 39 | #define flat_v850_get_reloc_type(relval) ((relval) >> 28) | ||
| 40 | |||
| 41 | #define FLAT_V850_R_32 0 /* Normal 32-bit reloc */ | ||
| 42 | #define FLAT_V850_R_HI16S_LO15 1 /* High 16-bits + signed 15-bit low field */ | ||
| 43 | #define FLAT_V850_R_HI16S_LO16 2 /* High 16-bits + signed 16-bit low field */ | ||
| 44 | |||
| 45 | /* Extract the address to be relocated from the symbol reference at RP; | ||
| 46 | RELVAL is the raw relocation-table entry from which RP is derived. | ||
| 47 | For the v850, RP should always be half-word aligned. */ | ||
| 48 | static inline unsigned long flat_get_addr_from_rp (unsigned long *rp, | ||
| 49 | unsigned long relval, | ||
| 50 | unsigned long flags, | ||
| 51 | unsigned long *persistent) | ||
| 52 | { | ||
| 53 | short *srp = (short *)rp; | ||
| 54 | |||
| 55 | switch (flat_v850_get_reloc_type (relval)) | ||
| 56 | { | ||
| 57 | case FLAT_V850_R_32: | ||
| 58 | /* Simple 32-bit address. */ | ||
| 59 | return srp[0] | (srp[1] << 16); | ||
| 60 | |||
| 61 | case FLAT_V850_R_HI16S_LO16: | ||
| 62 | /* The high and low halves of the address are in the 16 | ||
| 63 | bits at RP, and the 2nd word of the 32-bit instruction | ||
| 64 | following that, respectively. The low half is _signed_ | ||
| 65 | so we have to sign-extend it and add it to the upper | ||
| 66 | half instead of simply or-ing them together. | ||
| 67 | |||
| 68 | Unlike most relocated address, this one is stored in | ||
| 69 | native (little-endian) byte-order to avoid problems with | ||
| 70 | trashing the low-order bit, so we have to convert to | ||
| 71 | network-byte-order before returning, as that's what the | ||
| 72 | caller expects. */ | ||
| 73 | return htonl ((srp[0] << 16) + srp[2]); | ||
| 74 | |||
| 75 | case FLAT_V850_R_HI16S_LO15: | ||
| 76 | /* The high and low halves of the address are in the 16 | ||
| 77 | bits at RP, and the upper 15 bits of the 2nd word of the | ||
| 78 | 32-bit instruction following that, respectively. The | ||
| 79 | low half is _signed_ so we have to sign-extend it and | ||
| 80 | add it to the upper half instead of simply or-ing them | ||
| 81 | together. The lowest bit is always zero. | ||
| 82 | |||
| 83 | Unlike most relocated address, this one is stored in | ||
| 84 | native (little-endian) byte-order to avoid problems with | ||
| 85 | trashing the low-order bit, so we have to convert to | ||
| 86 | network-byte-order before returning, as that's what the | ||
| 87 | caller expects. */ | ||
| 88 | return htonl ((srp[0] << 16) + (srp[2] & ~0x1)); | ||
| 89 | |||
| 90 | default: | ||
| 91 | return ~0; /* bogus value */ | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 95 | /* Insert the address ADDR into the symbol reference at RP; | ||
| 96 | RELVAL is the raw relocation-table entry from which RP is derived. | ||
| 97 | For the v850, RP should always be half-word aligned. */ | ||
| 98 | static inline void flat_put_addr_at_rp (unsigned long *rp, unsigned long addr, | ||
| 99 | unsigned long relval) | ||
| 100 | { | ||
| 101 | short *srp = (short *)rp; | ||
| 102 | |||
| 103 | switch (flat_v850_get_reloc_type (relval)) { | ||
| 104 | case FLAT_V850_R_32: | ||
| 105 | /* Simple 32-bit address. */ | ||
| 106 | srp[0] = addr & 0xFFFF; | ||
| 107 | srp[1] = (addr >> 16); | ||
| 108 | break; | ||
| 109 | |||
| 110 | case FLAT_V850_R_HI16S_LO16: | ||
| 111 | /* The high and low halves of the address are in the 16 | ||
| 112 | bits at RP, and the 2nd word of the 32-bit instruction | ||
| 113 | following that, respectively. The low half is _signed_ | ||
| 114 | so we must carry its sign bit to the upper half before | ||
| 115 | writing the upper half. */ | ||
| 116 | srp[0] = (addr >> 16) + ((addr >> 15) & 0x1); | ||
| 117 | srp[2] = addr & 0xFFFF; | ||
| 118 | break; | ||
| 119 | |||
| 120 | case FLAT_V850_R_HI16S_LO15: | ||
| 121 | /* The high and low halves of the address are in the 16 | ||
| 122 | bits at RP, and the upper 15 bits of the 2nd word of the | ||
| 123 | 32-bit instruction following that, respectively. The | ||
| 124 | low half is _signed_ so we must carry its sign bit to | ||
| 125 | the upper half before writing the upper half. The | ||
| 126 | lowest bit we preserve from the existing instruction. */ | ||
| 127 | srp[0] = (addr >> 16) + ((addr >> 15) & 0x1); | ||
| 128 | srp[2] = (addr & 0xFFFE) | (srp[2] & 0x1); | ||
| 129 | break; | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | #endif /* __V850_FLAT_H__ */ | ||
diff --git a/include/asm-v850/fpga85e2c.h b/include/asm-v850/fpga85e2c.h deleted file mode 100644 index 23aae666c718..000000000000 --- a/include/asm-v850/fpga85e2c.h +++ /dev/null | |||
| @@ -1,82 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/fpga85e2c.h -- Machine-dependent defs for | ||
| 3 | * FPGA implementation of V850E2/NA85E2C | ||
| 4 | * | ||
| 5 | * Copyright (C) 2002,03 NEC Electronics Corporation | ||
| 6 | * Copyright (C) 2002,03 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __V850_FPGA85E2C_H__ | ||
| 16 | #define __V850_FPGA85E2C_H__ | ||
| 17 | |||
| 18 | #include <asm/v850e2.h> | ||
| 19 | #include <asm/clinkage.h> | ||
| 20 | |||
| 21 | |||
| 22 | #define CPU_MODEL "v850e2/fpga85e2c" | ||
| 23 | #define CPU_MODEL_LONG "NEC V850E2/NA85E2C" | ||
| 24 | #define PLATFORM "fpga85e2c" | ||
| 25 | #define PLATFORM_LONG "NA85E2C FPGA implementation" | ||
| 26 | |||
| 27 | |||
| 28 | /* `external ram'. */ | ||
| 29 | #define ERAM_ADDR 0 | ||
| 30 | #define ERAM_SIZE 0x00100000 /* 1MB */ | ||
| 31 | |||
| 32 | |||
| 33 | /* FPGA specific control registers. */ | ||
| 34 | |||
| 35 | /* Writing a non-zero value to FLGREG(0) will signal the controlling CPU | ||
| 36 | to stop execution. */ | ||
| 37 | #define FLGREG_ADDR(n) (0xFFE80100 + 2*(n)) | ||
| 38 | #define FLGREG(n) (*(volatile unsigned char *)FLGREG_ADDR (n)) | ||
| 39 | #define FLGREG_NUM 2 | ||
| 40 | |||
| 41 | #define CSDEV_ADDR(n) (0xFFE80110 + 2*(n)) | ||
| 42 | #define CSDEV(n) (*(volatile unsigned char *)CSDEV_ADDR (n)) | ||
| 43 | |||
| 44 | |||
| 45 | /* Timer interrupts 0-3, interrupt at intervals from CLK/4096 to CLK/16384. */ | ||
| 46 | #define IRQ_RPU(n) (60 + (n)) | ||
| 47 | #define IRQ_RPU_NUM 4 | ||
| 48 | |||
| 49 | /* For <asm/irq.h> */ | ||
| 50 | #define NUM_CPU_IRQS 64 | ||
| 51 | |||
| 52 | |||
| 53 | /* General-purpose timer. */ | ||
| 54 | /* control/status register (can only be read/written via bit insns) */ | ||
| 55 | #define RPU_GTMC_ADDR 0xFFFFFB00 | ||
| 56 | #define RPU_GTMC (*(volatile unsigned char *)RPU_GTMC_ADDR) | ||
| 57 | #define RPU_GTMC_CE_BIT 7 /* clock enable (control) */ | ||
| 58 | #define RPU_GTMC_OV_BIT 6 /* overflow (status) */ | ||
| 59 | #define RPU_GTMC_CLK_BIT 1 /* 0 = .5 MHz CLK, 1 = 1 Mhz (control) */ | ||
| 60 | /* 32-bit count (8 least-significant bits are always zero). */ | ||
| 61 | #define RPU_GTM_ADDR 0xFFFFFB28 | ||
| 62 | #define RPU_GTM (*(volatile unsigned long *)RPU_GTMC_ADDR) | ||
| 63 | |||
| 64 | |||
| 65 | /* For <asm/page.h> */ | ||
| 66 | #define PAGE_OFFSET ERAM_ADDR /* minimum allocatable address */ | ||
| 67 | |||
| 68 | |||
| 69 | /* For <asm/entry.h> */ | ||
| 70 | /* `R0 RAM', used for a few miscellaneous variables that must be accessible | ||
| 71 | using a load instruction relative to R0. The FPGA implementation | ||
| 72 | actually has no on-chip RAM, so we use part of main ram just after the | ||
| 73 | interrupt vectors. */ | ||
| 74 | #ifdef __ASSEMBLY__ | ||
| 75 | #define R0_RAM_ADDR lo(C_SYMBOL_NAME(_r0_ram)) | ||
| 76 | #else | ||
| 77 | extern char _r0_ram; | ||
| 78 | #define R0_RAM_ADDR ((unsigned long)&_r0_ram); | ||
| 79 | #endif | ||
| 80 | |||
| 81 | |||
| 82 | #endif /* __V850_FPGA85E2C_H__ */ | ||
diff --git a/include/asm-v850/futex.h b/include/asm-v850/futex.h deleted file mode 100644 index 6a332a9f099c..000000000000 --- a/include/asm-v850/futex.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef _ASM_FUTEX_H | ||
| 2 | #define _ASM_FUTEX_H | ||
| 3 | |||
| 4 | #include <asm-generic/futex.h> | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-v850/gbus_int.h b/include/asm-v850/gbus_int.h deleted file mode 100644 index 0c4bce753c7e..000000000000 --- a/include/asm-v850/gbus_int.h +++ /dev/null | |||
| @@ -1,97 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/gbus_int.h -- Midas labs GBUS interrupt support | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_GBUS_INT_H__ | ||
| 15 | #define __V850_GBUS_INT_H__ | ||
| 16 | |||
| 17 | |||
| 18 | /* The GBUS interrupt interface has 32 interrupts shared among 4 | ||
| 19 | processor interrupts. The 32 GBUS interrupts are divided into two | ||
| 20 | sets of 16 each, for allocating among control registers, etc (there | ||
| 21 | are two of each control register, with bits 0-15 controlling an | ||
| 22 | interrupt each). */ | ||
| 23 | |||
| 24 | /* The GBUS interrupts themselves. */ | ||
| 25 | #define IRQ_GBUS_INT(n) (GBUS_INT_BASE_IRQ + (n)) | ||
| 26 | #define IRQ_GBUS_INT_NUM 32 | ||
| 27 | |||
| 28 | /* Control registers. */ | ||
| 29 | #define GBUS_INT_STATUS_ADDR(w) (GBUS_INT_BASE_ADDR + (w)*0x40) | ||
| 30 | #define GBUS_INT_STATUS(w) (*(volatile u16 *)GBUS_INT_STATUS_ADDR(w)) | ||
| 31 | #define GBUS_INT_CLEAR_ADDR(w) (GBUS_INT_BASE_ADDR + 0x10 + (w)*0x40) | ||
| 32 | #define GBUS_INT_CLEAR(w) (*(volatile u16 *)GBUS_INT_CLEAR_ADDR(w)) | ||
| 33 | #define GBUS_INT_EDGE_ADDR(w) (GBUS_INT_BASE_ADDR + 0x20 + (w)*0x40) | ||
| 34 | #define GBUS_INT_EDGE(w) (*(volatile u16 *)GBUS_INT_EDGE_ADDR(w)) | ||
| 35 | #define GBUS_INT_POLARITY_ADDR(w) (GBUS_INT_BASE_ADDR + 0x30 + (w)*0x40) | ||
| 36 | #define GBUS_INT_POLARITY(w) (*(volatile u16 *)GBUS_INT_POLARITY_ADDR(w)) | ||
| 37 | /* This allows enabling interrupt bits in word W for interrupt GINTn. */ | ||
| 38 | #define GBUS_INT_ENABLE_ADDR(w, n) \ | ||
| 39 | (GBUS_INT_BASE_ADDR + 0x100 + (w)*0x10 + (n)*0x20) | ||
| 40 | #define GBUS_INT_ENABLE(w, n) (*(volatile u16 *)GBUS_INT_ENABLE_ADDR(w, n)) | ||
| 41 | |||
| 42 | /* Mapping between kernel interrupt numbers and hardware control regs/bits. */ | ||
| 43 | #define GBUS_INT_BITS_PER_WORD 16 | ||
| 44 | #define GBUS_INT_NUM_WORDS (IRQ_GBUS_INT_NUM / GBUS_INT_BITS_PER_WORD) | ||
| 45 | #define GBUS_INT_IRQ_WORD(irq) (((irq) - GBUS_INT_BASE_IRQ) >> 4) | ||
| 46 | #define GBUS_INT_IRQ_BIT(irq) (((irq) - GBUS_INT_BASE_IRQ) & 0xF) | ||
| 47 | #define GBUS_INT_IRQ_MASK(irq) (1 << GBUS_INT_IRQ_BIT(irq)) | ||
| 48 | |||
| 49 | |||
| 50 | /* Possible priorities for GBUS interrupts. */ | ||
| 51 | #define GBUS_INT_PRIORITY_HIGH 2 | ||
| 52 | #define GBUS_INT_PRIORITY_MEDIUM 4 | ||
| 53 | #define GBUS_INT_PRIORITY_LOW 6 | ||
| 54 | |||
| 55 | |||
| 56 | #ifndef __ASSEMBLY__ | ||
| 57 | |||
| 58 | /* Enable interrupt handling for interrupt IRQ. */ | ||
| 59 | extern void gbus_int_enable_irq (unsigned irq); | ||
| 60 | /* Disable interrupt handling for interrupt IRQ. Note that any | ||
| 61 | interrupts received while disabled will be delivered once the | ||
| 62 | interrupt is enabled again, unless they are explicitly cleared using | ||
| 63 | `gbus_int_clear_pending_irq'. */ | ||
| 64 | extern void gbus_int_disable_irq (unsigned irq); | ||
| 65 | /* Return true if interrupt handling for interrupt IRQ is enabled. */ | ||
| 66 | extern int gbus_int_irq_enabled (unsigned irq); | ||
| 67 | /* Disable all GBUS irqs. */ | ||
| 68 | extern void gbus_int_disable_irqs (void); | ||
| 69 | /* Clear any pending interrupts for IRQ. */ | ||
| 70 | extern void gbus_int_clear_pending_irq (unsigned irq); | ||
| 71 | /* Return true if interrupt IRQ is pending (but disabled). */ | ||
| 72 | extern int gbus_int_irq_pending (unsigned irq); | ||
| 73 | |||
| 74 | |||
| 75 | struct gbus_int_irq_init { | ||
| 76 | const char *name; /* name of interrupt type */ | ||
| 77 | |||
| 78 | /* Range of kernel irq numbers for this type: | ||
| 79 | BASE, BASE+INTERVAL, ..., BASE+INTERVAL*NUM */ | ||
| 80 | unsigned base, num, interval; | ||
| 81 | |||
| 82 | unsigned priority; /* interrupt priority to assign */ | ||
| 83 | }; | ||
| 84 | struct hw_interrupt_type; /* fwd decl */ | ||
| 85 | |||
| 86 | /* Initialize HW_IRQ_TYPES for GBUS irqs described in array | ||
| 87 | INITS (which is terminated by an entry with the name field == 0). */ | ||
| 88 | extern void gbus_int_init_irq_types (struct gbus_int_irq_init *inits, | ||
| 89 | struct hw_interrupt_type *hw_irq_types); | ||
| 90 | |||
| 91 | /* Initialize GBUS interrupts. */ | ||
| 92 | extern void gbus_int_init_irqs (void); | ||
| 93 | |||
| 94 | #endif /* !__ASSEMBLY__ */ | ||
| 95 | |||
| 96 | |||
| 97 | #endif /* __V850_GBUS_INT_H__ */ | ||
diff --git a/include/asm-v850/hardirq.h b/include/asm-v850/hardirq.h deleted file mode 100644 index 04e20127c5af..000000000000 --- a/include/asm-v850/hardirq.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | #ifndef __V850_HARDIRQ_H__ | ||
| 2 | #define __V850_HARDIRQ_H__ | ||
| 3 | |||
| 4 | #include <linux/threads.h> | ||
| 5 | #include <linux/cache.h> | ||
| 6 | |||
| 7 | #include <asm/irq.h> | ||
| 8 | |||
| 9 | typedef struct { | ||
| 10 | unsigned int __softirq_pending; | ||
| 11 | } ____cacheline_aligned irq_cpustat_t; | ||
| 12 | |||
| 13 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | ||
| 14 | |||
| 15 | #define HARDIRQ_BITS 8 | ||
| 16 | |||
| 17 | /* | ||
| 18 | * The hardirq mask has to be large enough to have | ||
| 19 | * space for potentially all IRQ sources in the system | ||
| 20 | * nesting on a single CPU: | ||
| 21 | */ | ||
| 22 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
| 23 | # error HARDIRQ_BITS is too low! | ||
| 24 | #endif | ||
| 25 | |||
| 26 | void ack_bad_irq(unsigned int irq); | ||
| 27 | |||
| 28 | #endif /* __V850_HARDIRQ_H__ */ | ||
diff --git a/include/asm-v850/highres_timer.h b/include/asm-v850/highres_timer.h deleted file mode 100644 index 486fb49ceab6..000000000000 --- a/include/asm-v850/highres_timer.h +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/highres_timer.h -- High resolution timing routines | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_HIGHRES_TIMER_H__ | ||
| 15 | #define __V850_HIGHRES_TIMER_H__ | ||
| 16 | |||
| 17 | #ifndef __ASSEMBLY__ | ||
| 18 | #include <linux/time.h> | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #include <asm/entry.h> | ||
| 22 | |||
| 23 | |||
| 24 | /* Frequency of the `slow ticks' (one tick each time the fast-tick | ||
| 25 | counter overflows). */ | ||
| 26 | #define HIGHRES_TIMER_SLOW_TICK_RATE 25 | ||
| 27 | |||
| 28 | /* Which timer in the V850E `Timer D' we use. */ | ||
| 29 | #define HIGHRES_TIMER_TIMER_D_UNIT 3 | ||
| 30 | |||
| 31 | |||
| 32 | #ifndef __ASSEMBLY__ | ||
| 33 | |||
| 34 | extern void highres_timer_start (void), highres_timer_stop (void); | ||
| 35 | extern void highres_timer_reset (void); | ||
| 36 | extern void highres_timer_read_ticks (u32 *slow_ticks, u32 *fast_ticks); | ||
| 37 | extern void highres_timer_ticks_to_timeval (u32 slow_ticks, u32 fast_ticks, | ||
| 38 | struct timeval *tv); | ||
| 39 | extern void highres_timer_read (struct timeval *tv); | ||
| 40 | |||
| 41 | #endif /* !__ASSEMBLY__ */ | ||
| 42 | |||
| 43 | |||
| 44 | #endif /* __V850_HIGHRES_TIMER_H__ */ | ||
diff --git a/include/asm-v850/hw_irq.h b/include/asm-v850/hw_irq.h deleted file mode 100644 index 043e94bb6bd8..000000000000 --- a/include/asm-v850/hw_irq.h +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | #ifndef __V850_HW_IRQ_H__ | ||
| 2 | #define __V850_HW_IRQ_H__ | ||
| 3 | |||
| 4 | #endif /* __V850_HW_IRQ_H__ */ | ||
diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h deleted file mode 100644 index cdad251fba9f..000000000000 --- a/include/asm-v850/io.h +++ /dev/null | |||
| @@ -1,142 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/io.h -- Misc I/O operations | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03,04,05 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_IO_H__ | ||
| 15 | #define __V850_IO_H__ | ||
| 16 | |||
| 17 | #define IO_SPACE_LIMIT 0xFFFFFFFF | ||
| 18 | |||
| 19 | #define readb(addr) \ | ||
| 20 | ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; }) | ||
| 21 | #define readw(addr) \ | ||
| 22 | ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) | ||
| 23 | #define readl(addr) \ | ||
| 24 | ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; }) | ||
| 25 | |||
| 26 | #define readb_relaxed(a) readb(a) | ||
| 27 | #define readw_relaxed(a) readw(a) | ||
| 28 | #define readl_relaxed(a) readl(a) | ||
| 29 | |||
| 30 | #define writeb(val, addr) \ | ||
| 31 | (void)((*(volatile unsigned char *) (addr)) = (val)) | ||
| 32 | #define writew(val, addr) \ | ||
| 33 | (void)((*(volatile unsigned short *) (addr)) = (val)) | ||
| 34 | #define writel(val, addr) \ | ||
| 35 | (void)((*(volatile unsigned int *) (addr)) = (val)) | ||
| 36 | |||
| 37 | #define __raw_readb readb | ||
| 38 | #define __raw_readw readw | ||
| 39 | #define __raw_readl readl | ||
| 40 | #define __raw_writeb writeb | ||
| 41 | #define __raw_writew writew | ||
| 42 | #define __raw_writel writel | ||
| 43 | |||
| 44 | #define inb(addr) readb (addr) | ||
| 45 | #define inw(addr) readw (addr) | ||
| 46 | #define inl(addr) readl (addr) | ||
| 47 | #define outb(x, addr) ((void) writeb (x, addr)) | ||
| 48 | #define outw(x, addr) ((void) writew (x, addr)) | ||
| 49 | #define outl(x, addr) ((void) writel (x, addr)) | ||
| 50 | |||
| 51 | #define inb_p(port) inb((port)) | ||
| 52 | #define outb_p(val, port) outb((val), (port)) | ||
| 53 | #define inw_p(port) inw((port)) | ||
| 54 | #define outw_p(val, port) outw((val), (port)) | ||
| 55 | #define inl_p(port) inl((port)) | ||
| 56 | #define outl_p(val, port) outl((val), (port)) | ||
| 57 | |||
| 58 | static inline void insb (unsigned long port, void *dst, unsigned long count) | ||
| 59 | { | ||
| 60 | unsigned char *p = dst; | ||
| 61 | while (count--) | ||
| 62 | *p++ = inb (port); | ||
| 63 | } | ||
| 64 | static inline void insw (unsigned long port, void *dst, unsigned long count) | ||
| 65 | { | ||
| 66 | unsigned short *p = dst; | ||
| 67 | while (count--) | ||
| 68 | *p++ = inw (port); | ||
| 69 | } | ||
| 70 | static inline void insl (unsigned long port, void *dst, unsigned long count) | ||
| 71 | { | ||
| 72 | unsigned long *p = dst; | ||
| 73 | while (count--) | ||
| 74 | *p++ = inl (port); | ||
| 75 | } | ||
| 76 | |||
| 77 | static inline void | ||
| 78 | outsb (unsigned long port, const void *src, unsigned long count) | ||
| 79 | { | ||
| 80 | const unsigned char *p = src; | ||
| 81 | while (count--) | ||
| 82 | outb (*p++, port); | ||
| 83 | } | ||
| 84 | static inline void | ||
| 85 | outsw (unsigned long port, const void *src, unsigned long count) | ||
| 86 | { | ||
| 87 | const unsigned short *p = src; | ||
| 88 | while (count--) | ||
| 89 | outw (*p++, port); | ||
| 90 | } | ||
| 91 | static inline void | ||
| 92 | outsl (unsigned long port, const void *src, unsigned long count) | ||
| 93 | { | ||
| 94 | const unsigned long *p = src; | ||
| 95 | while (count--) | ||
| 96 | outl (*p++, port); | ||
| 97 | } | ||
| 98 | |||
| 99 | |||
| 100 | /* Some places try to pass in an loff_t for PHYSADDR (?!), so we cast it to | ||
| 101 | long before casting it to a pointer to avoid compiler warnings. */ | ||
| 102 | #define ioremap(physaddr, size) ((void __iomem *)(unsigned long)(physaddr)) | ||
| 103 | #define iounmap(addr) ((void)0) | ||
| 104 | |||
| 105 | #define ioremap_nocache(physaddr, size) ioremap (physaddr, size) | ||
| 106 | #define ioremap_writethrough(physaddr, size) ioremap (physaddr, size) | ||
| 107 | #define ioremap_fullcache(physaddr, size) ioremap (physaddr, size) | ||
| 108 | |||
| 109 | #define ioread8(addr) readb (addr) | ||
| 110 | #define ioread16(addr) readw (addr) | ||
| 111 | #define ioread32(addr) readl (addr) | ||
| 112 | #define iowrite8(val, addr) writeb (val, addr) | ||
| 113 | #define iowrite16(val, addr) writew (val, addr) | ||
| 114 | #define iowrite32(val, addr) writel (val, addr) | ||
| 115 | |||
| 116 | #define mmiowb() | ||
| 117 | |||
| 118 | #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) | ||
| 119 | #if 0 | ||
| 120 | /* This is really stupid; don't define it. */ | ||
| 121 | #define page_to_bus(page) page_to_phys (page) | ||
| 122 | #endif | ||
| 123 | |||
| 124 | /* Conversion between virtual and physical mappings. */ | ||
| 125 | #define phys_to_virt(addr) ((void *)__phys_to_virt (addr)) | ||
| 126 | #define virt_to_phys(addr) ((unsigned long)__virt_to_phys (addr)) | ||
| 127 | |||
| 128 | #define memcpy_fromio(dst, src, len) memcpy (dst, (void *)src, len) | ||
| 129 | #define memcpy_toio(dst, src, len) memcpy ((void *)dst, src, len) | ||
| 130 | |||
| 131 | /* | ||
| 132 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | ||
| 133 | * access | ||
| 134 | */ | ||
| 135 | #define xlate_dev_mem_ptr(p) __va(p) | ||
| 136 | |||
| 137 | /* | ||
| 138 | * Convert a virtual cached pointer to an uncached pointer | ||
| 139 | */ | ||
| 140 | #define xlate_dev_kmem_ptr(p) p | ||
| 141 | |||
| 142 | #endif /* __V850_IO_H__ */ | ||
diff --git a/include/asm-v850/ioctl.h b/include/asm-v850/ioctl.h deleted file mode 100644 index b279fe06dfe5..000000000000 --- a/include/asm-v850/ioctl.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/ioctl.h> | ||
diff --git a/include/asm-v850/ioctls.h b/include/asm-v850/ioctls.h deleted file mode 100644 index 5313abd5f388..000000000000 --- a/include/asm-v850/ioctls.h +++ /dev/null | |||
| @@ -1,84 +0,0 @@ | |||
| 1 | #ifndef __V850_IOCTLS_H__ | ||
| 2 | #define __V850_IOCTLS_H__ | ||
| 3 | |||
| 4 | #include <asm/ioctl.h> | ||
| 5 | |||
| 6 | /* 0x54 is just a magic number to make these relatively unique ('T') */ | ||
| 7 | |||
| 8 | #define TCGETS 0x5401 | ||
| 9 | #define TCSETS 0x5402 | ||
| 10 | #define TCSETSW 0x5403 | ||
| 11 | #define TCSETSF 0x5404 | ||
| 12 | #define TCGETA 0x5405 | ||
| 13 | #define TCSETA 0x5406 | ||
| 14 | #define TCSETAW 0x5407 | ||
| 15 | #define TCSETAF 0x5408 | ||
| 16 | #define TCSBRK 0x5409 | ||
| 17 | #define TCXONC 0x540A | ||
| 18 | #define TCFLSH 0x540B | ||
| 19 | #define TIOCEXCL 0x540C | ||
| 20 | #define TIOCNXCL 0x540D | ||
| 21 | #define TIOCSCTTY 0x540E | ||
| 22 | #define TIOCGPGRP 0x540F | ||
| 23 | #define TIOCSPGRP 0x5410 | ||
| 24 | #define TIOCOUTQ 0x5411 | ||
| 25 | #define TIOCSTI 0x5412 | ||
| 26 | #define TIOCGWINSZ 0x5413 | ||
| 27 | #define TIOCSWINSZ 0x5414 | ||
| 28 | #define TIOCMGET 0x5415 | ||
| 29 | #define TIOCMBIS 0x5416 | ||
| 30 | #define TIOCMBIC 0x5417 | ||
| 31 | #define TIOCMSET 0x5418 | ||
| 32 | #define TIOCGSOFTCAR 0x5419 | ||
| 33 | #define TIOCSSOFTCAR 0x541A | ||
| 34 | #define FIONREAD 0x541B | ||
| 35 | #define TIOCINQ FIONREAD | ||
| 36 | #define TIOCLINUX 0x541C | ||
| 37 | #define TIOCCONS 0x541D | ||
| 38 | #define TIOCGSERIAL 0x541E | ||
| 39 | #define TIOCSSERIAL 0x541F | ||
| 40 | #define TIOCPKT 0x5420 | ||
| 41 | #define FIONBIO 0x5421 | ||
| 42 | #define TIOCNOTTY 0x5422 | ||
| 43 | #define TIOCSETD 0x5423 | ||
| 44 | #define TIOCGETD 0x5424 | ||
| 45 | #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ | ||
| 46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | ||
| 47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | ||
| 48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | ||
| 49 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
| 50 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
| 51 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
| 52 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
| 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | ||
| 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | ||
| 55 | |||
| 56 | #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ | ||
| 57 | #define FIOCLEX 0x5451 | ||
| 58 | #define FIOASYNC 0x5452 | ||
| 59 | #define TIOCSERCONFIG 0x5453 | ||
| 60 | #define TIOCSERGWILD 0x5454 | ||
| 61 | #define TIOCSERSWILD 0x5455 | ||
| 62 | #define TIOCGLCKTRMIOS 0x5456 | ||
| 63 | #define TIOCSLCKTRMIOS 0x5457 | ||
| 64 | #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ | ||
| 65 | #define TIOCSERGETLSR 0x5459 /* Get line status register */ | ||
| 66 | #define TIOCSERGETMULTI 0x545A /* Get multiport config */ | ||
| 67 | #define TIOCSERSETMULTI 0x545B /* Set multiport config */ | ||
| 68 | |||
| 69 | #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ | ||
| 70 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ | ||
| 71 | #define FIOQSIZE 0x545E | ||
| 72 | |||
| 73 | /* Used for packet mode */ | ||
| 74 | #define TIOCPKT_DATA 0 | ||
| 75 | #define TIOCPKT_FLUSHREAD 1 | ||
| 76 | #define TIOCPKT_FLUSHWRITE 2 | ||
| 77 | #define TIOCPKT_STOP 4 | ||
| 78 | #define TIOCPKT_START 8 | ||
| 79 | #define TIOCPKT_NOSTOP 16 | ||
| 80 | #define TIOCPKT_DOSTOP 32 | ||
| 81 | |||
| 82 | #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
| 83 | |||
| 84 | #endif /* __V850_IOCTLS_H__ */ | ||
diff --git a/include/asm-v850/ipcbuf.h b/include/asm-v850/ipcbuf.h deleted file mode 100644 index d8cbe9886d95..000000000000 --- a/include/asm-v850/ipcbuf.h +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | #ifndef __V850E_IPCBUF_H__ | ||
| 2 | #define __V850E_IPCBUF_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The user_ipc_perm structure for v850e architecture. | ||
| 6 | * Note extra padding because this structure is passed back and forth | ||
| 7 | * between kernel and user space. | ||
| 8 | * | ||
| 9 | * Pad space is left for: | ||
| 10 | * - 32-bit mode_t and seq | ||
| 11 | * - 2 miscellaneous 32-bit values | ||
| 12 | */ | ||
| 13 | |||
| 14 | struct ipc64_perm | ||
| 15 | { | ||
| 16 | __kernel_key_t key; | ||
| 17 | __kernel_uid32_t uid; | ||
| 18 | __kernel_gid32_t gid; | ||
| 19 | __kernel_uid32_t cuid; | ||
| 20 | __kernel_gid32_t cgid; | ||
| 21 | __kernel_mode_t mode; | ||
| 22 | unsigned short __pad1; | ||
| 23 | unsigned short seq; | ||
| 24 | unsigned short __pad2; | ||
| 25 | unsigned long __unused1; | ||
| 26 | unsigned long __unused2; | ||
| 27 | }; | ||
| 28 | |||
| 29 | #endif /* __V850E_IPCBUF_H__ */ | ||
diff --git a/include/asm-v850/irq.h b/include/asm-v850/irq.h deleted file mode 100644 index 7d0d4cd1ce54..000000000000 --- a/include/asm-v850/irq.h +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/irq.h -- Machine interrupt handling | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,04 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,04 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_IRQ_H__ | ||
| 15 | #define __V850_IRQ_H__ | ||
| 16 | |||
| 17 | #include <asm/machdep.h> | ||
| 18 | |||
| 19 | /* Default NUM_MACH_IRQS. */ | ||
| 20 | #ifndef NUM_MACH_IRQS | ||
| 21 | #define NUM_MACH_IRQS NUM_CPU_IRQS | ||
| 22 | #endif | ||
| 23 | |||
| 24 | /* NMIs have IRQ numbers from FIRST_NMI to FIRST_NMI+NUM_NMIS-1. */ | ||
| 25 | #define FIRST_NMI NUM_MACH_IRQS | ||
| 26 | #define IRQ_NMI(n) (FIRST_NMI + (n)) | ||
| 27 | /* v850 processors have 3 non-maskable interrupts. */ | ||
| 28 | #define NUM_NMIS 3 | ||
| 29 | |||
| 30 | /* Includes both maskable and non-maskable irqs. */ | ||
| 31 | #define NR_IRQS (NUM_MACH_IRQS + NUM_NMIS) | ||
| 32 | |||
| 33 | |||
| 34 | #ifndef __ASSEMBLY__ | ||
| 35 | |||
| 36 | struct pt_regs; | ||
| 37 | struct hw_interrupt_type; | ||
| 38 | struct irqaction; | ||
| 39 | |||
| 40 | #define irq_canonicalize(irq) (irq) | ||
| 41 | |||
| 42 | /* Initialize irq handling for IRQs. | ||
| 43 | BASE_IRQ, BASE_IRQ+INTERVAL, ..., BASE_IRQ+NUM*INTERVAL | ||
| 44 | to IRQ_TYPE. An IRQ_TYPE of 0 means to use a generic interrupt type. */ | ||
| 45 | extern void | ||
| 46 | init_irq_handlers (int base_irq, int num, int interval, | ||
| 47 | struct hw_interrupt_type *irq_type); | ||
| 48 | |||
| 49 | /* Handle interrupt IRQ. REGS are the registers at the time of ther | ||
| 50 | interrupt. */ | ||
| 51 | extern unsigned int handle_irq (int irq, struct pt_regs *regs); | ||
| 52 | |||
| 53 | #endif /* !__ASSEMBLY__ */ | ||
| 54 | |||
| 55 | #endif /* __V850_IRQ_H__ */ | ||
diff --git a/include/asm-v850/irq_regs.h b/include/asm-v850/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/include/asm-v850/irq_regs.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/irq_regs.h> | ||
diff --git a/include/asm-v850/kdebug.h b/include/asm-v850/kdebug.h deleted file mode 100644 index 6ece1b037665..000000000000 --- a/include/asm-v850/kdebug.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/kdebug.h> | ||
diff --git a/include/asm-v850/kmap_types.h b/include/asm-v850/kmap_types.h deleted file mode 100644 index 3288976b161f..000000000000 --- a/include/asm-v850/kmap_types.h +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | #ifndef __V850_KMAP_TYPES_H__ | ||
| 2 | #define __V850_KMAP_TYPES_H__ | ||
| 3 | |||
| 4 | enum km_type { | ||
| 5 | KM_BOUNCE_READ, | ||
| 6 | KM_SKB_SUNRPC_DATA, | ||
| 7 | KM_SKB_DATA_SOFTIRQ, | ||
| 8 | KM_USER0, | ||
| 9 | KM_USER1, | ||
| 10 | KM_BIO_SRC_IRQ, | ||
| 11 | KM_BIO_DST_IRQ, | ||
| 12 | KM_PTE0, | ||
| 13 | KM_PTE1, | ||
| 14 | KM_IRQ0, | ||
| 15 | KM_IRQ1, | ||
| 16 | KM_TYPE_NR | ||
| 17 | }; | ||
| 18 | |||
| 19 | #endif /* __V850_KMAP_TYPES_H__ */ | ||
diff --git a/include/asm-v850/kvm.h b/include/asm-v850/kvm.h deleted file mode 100644 index 3f729b79febc..000000000000 --- a/include/asm-v850/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_V850_H | ||
| 2 | #define __LINUX_KVM_V850_H | ||
| 3 | |||
| 4 | /* v850 does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-v850/linkage.h b/include/asm-v850/linkage.h deleted file mode 100644 index b6185d3cfe68..000000000000 --- a/include/asm-v850/linkage.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef __ASM_LINKAGE_H | ||
| 2 | #define __ASM_LINKAGE_H | ||
| 3 | |||
| 4 | #ifdef __ASSEMBLY__ | ||
| 5 | #include <asm/asm.h> | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #endif | ||
diff --git a/include/asm-v850/local.h b/include/asm-v850/local.h deleted file mode 100644 index 705148abe276..000000000000 --- a/include/asm-v850/local.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_LOCAL_H__ | ||
| 2 | #define __V850_LOCAL_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/local.h> | ||
| 5 | |||
| 6 | #endif /* __V850_LOCAL_H__ */ | ||
diff --git a/include/asm-v850/ma.h b/include/asm-v850/ma.h deleted file mode 100644 index 89e66473a176..000000000000 --- a/include/asm-v850/ma.h +++ /dev/null | |||
| @@ -1,101 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/ma.h -- V850E/MA series of cpu chips | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_MA_H__ | ||
| 15 | #define __V850_MA_H__ | ||
| 16 | |||
| 17 | /* The MA series uses the V850E cpu core. */ | ||
| 18 | #include <asm/v850e.h> | ||
| 19 | |||
| 20 | |||
| 21 | /* For <asm/entry.h> */ | ||
| 22 | /* We use on-chip RAM, for a few miscellaneous variables that must be | ||
| 23 | accessible using a load instruction relative to R0. The amount | ||
| 24 | varies between chip models, but there's always at least 4K, and it | ||
| 25 | should always start at FFFFC000. */ | ||
| 26 | #define R0_RAM_ADDR 0xFFFFC000 | ||
| 27 | |||
| 28 | |||
| 29 | /* MA series UART details. */ | ||
| 30 | #define V850E_UART_BASE_FREQ CPU_CLOCK_FREQ | ||
| 31 | |||
| 32 | /* This is a function that gets called before configuring the UART. */ | ||
| 33 | #define V850E_UART_PRE_CONFIGURE ma_uart_pre_configure | ||
| 34 | #ifndef __ASSEMBLY__ | ||
| 35 | extern void ma_uart_pre_configure (unsigned chan, | ||
| 36 | unsigned cflags, unsigned baud); | ||
| 37 | #endif | ||
| 38 | |||
| 39 | |||
| 40 | /* MA series timer C details. */ | ||
| 41 | #define V850E_TIMER_C_BASE_ADDR 0xFFFFF600 | ||
| 42 | |||
| 43 | |||
| 44 | /* MA series timer D details. */ | ||
| 45 | #define V850E_TIMER_D_BASE_ADDR 0xFFFFF540 | ||
| 46 | #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0) | ||
| 47 | #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x2) | ||
| 48 | #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4) | ||
| 49 | |||
| 50 | #define V850E_TIMER_D_BASE_FREQ CPU_CLOCK_FREQ | ||
| 51 | |||
| 52 | |||
| 53 | /* Port 0 */ | ||
| 54 | /* Direct I/O. Bits 0-7 are pins P00-P07. */ | ||
| 55 | #define MA_PORT0_IO_ADDR 0xFFFFF400 | ||
| 56 | #define MA_PORT0_IO (*(volatile u8 *)MA_PORT0_IO_ADDR) | ||
| 57 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 58 | #define MA_PORT0_PM_ADDR 0xFFFFF420 | ||
| 59 | #define MA_PORT0_PM (*(volatile u8 *)MA_PORT0_PM_ADDR) | ||
| 60 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 61 | #define MA_PORT0_PMC_ADDR 0xFFFFF440 | ||
| 62 | #define MA_PORT0_PMC (*(volatile u8 *)MA_PORT0_PMC_ADDR) | ||
| 63 | /* Port function control (for P04-P07, 0 = IRQ, 1 = DMARQ). */ | ||
| 64 | #define MA_PORT0_PFC_ADDR 0xFFFFF460 | ||
| 65 | #define MA_PORT0_PFC (*(volatile u8 *)MA_PORT0_PFC_ADDR) | ||
| 66 | |||
| 67 | /* Port 1 */ | ||
| 68 | /* Direct I/O. Bits 0-3 are pins P10-P13. */ | ||
| 69 | #define MA_PORT1_IO_ADDR 0xFFFFF402 | ||
| 70 | #define MA_PORT1_IO (*(volatile u8 *)MA_PORT1_IO_ADDR) | ||
| 71 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 72 | #define MA_PORT1_PM_ADDR 0xFFFFF420 | ||
| 73 | #define MA_PORT1_PM (*(volatile u8 *)MA_PORT1_PM_ADDR) | ||
| 74 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 75 | #define MA_PORT1_PMC_ADDR 0xFFFFF442 | ||
| 76 | #define MA_PORT1_PMC (*(volatile u8 *)MA_PORT1_PMC_ADDR) | ||
| 77 | |||
| 78 | /* Port 4 */ | ||
| 79 | /* Direct I/O. Bits 0-5 are pins P40-P45. */ | ||
| 80 | #define MA_PORT4_IO_ADDR 0xFFFFF408 | ||
| 81 | #define MA_PORT4_IO (*(volatile u8 *)MA_PORT4_IO_ADDR) | ||
| 82 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 83 | #define MA_PORT4_PM_ADDR 0xFFFFF428 | ||
| 84 | #define MA_PORT4_PM (*(volatile u8 *)MA_PORT4_PM_ADDR) | ||
| 85 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 86 | #define MA_PORT4_PMC_ADDR 0xFFFFF448 | ||
| 87 | #define MA_PORT4_PMC (*(volatile u8 *)MA_PORT4_PMC_ADDR) | ||
| 88 | /* Port function control (for serial interfaces, 0 = CSI, 1 = UART). */ | ||
| 89 | #define MA_PORT4_PFC_ADDR 0xFFFFF468 | ||
| 90 | #define MA_PORT4_PFC (*(volatile u8 *)MA_PORT4_PFC_ADDR) | ||
| 91 | |||
| 92 | |||
| 93 | #ifndef __ASSEMBLY__ | ||
| 94 | |||
| 95 | /* Initialize MA chip interrupts. */ | ||
| 96 | extern void ma_init_irqs (void); | ||
| 97 | |||
| 98 | #endif /* !__ASSEMBLY__ */ | ||
| 99 | |||
| 100 | |||
| 101 | #endif /* __V850_MA_H__ */ | ||
diff --git a/include/asm-v850/ma1.h b/include/asm-v850/ma1.h deleted file mode 100644 index ede1f1de2b7a..000000000000 --- a/include/asm-v850/ma1.h +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/ma1.h -- V850E/MA1 cpu chip | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_MA1_H__ | ||
| 15 | #define __V850_MA1_H__ | ||
| 16 | |||
| 17 | /* Inherit more generic details from MA series. */ | ||
| 18 | #include <asm/ma.h> | ||
| 19 | |||
| 20 | |||
| 21 | #define CPU_MODEL "v850e/ma1" | ||
| 22 | #define CPU_MODEL_LONG "NEC V850E/MA1" | ||
| 23 | |||
| 24 | |||
| 25 | /* Hardware-specific interrupt numbers (in the kernel IRQ namespace). */ | ||
| 26 | #define IRQ_INTOV(n) (n) /* 0-3 */ | ||
| 27 | #define IRQ_INTOV_NUM 4 | ||
| 28 | #define IRQ_INTP(n) (0x4 + (n)) /* Pnnn (pin) interrupts */ | ||
| 29 | #define IRQ_INTP_NUM 24 | ||
| 30 | #define IRQ_INTCMD(n) (0x1c + (n)) /* interval timer interrupts 0-3 */ | ||
| 31 | #define IRQ_INTCMD_NUM 4 | ||
| 32 | #define IRQ_INTDMA(n) (0x20 + (n)) /* DMA interrupts 0-3 */ | ||
| 33 | #define IRQ_INTDMA_NUM 4 | ||
| 34 | #define IRQ_INTCSI(n) (0x24 + (n)*4)/* CSI 0-2 transmit/receive completion */ | ||
| 35 | #define IRQ_INTCSI_NUM 3 | ||
| 36 | #define IRQ_INTSER(n) (0x25 + (n)*4) /* UART 0-2 reception error */ | ||
| 37 | #define IRQ_INTSER_NUM 3 | ||
| 38 | #define IRQ_INTSR(n) (0x26 + (n)*4) /* UART 0-2 reception completion */ | ||
| 39 | #define IRQ_INTSR_NUM 3 | ||
| 40 | #define IRQ_INTST(n) (0x27 + (n)*4) /* UART 0-2 transmission completion */ | ||
| 41 | #define IRQ_INTST_NUM 3 | ||
| 42 | |||
| 43 | #define NUM_CPU_IRQS 0x30 | ||
| 44 | |||
| 45 | |||
| 46 | /* The MA1 has a UART with 3 channels. */ | ||
| 47 | #define V850E_UART_NUM_CHANNELS 3 | ||
| 48 | |||
| 49 | |||
| 50 | #endif /* __V850_MA1_H__ */ | ||
diff --git a/include/asm-v850/machdep.h b/include/asm-v850/machdep.h deleted file mode 100644 index f1e3b8b91508..000000000000 --- a/include/asm-v850/machdep.h +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/machdep.h -- Machine-dependent definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_MACHDEP_H__ | ||
| 15 | #define __V850_MACHDEP_H__ | ||
| 16 | |||
| 17 | |||
| 18 | /* chips */ | ||
| 19 | #ifdef CONFIG_V850E_MA1 | ||
| 20 | #include <asm/ma1.h> | ||
| 21 | #endif | ||
| 22 | #ifdef CONFIG_V850E_ME2 | ||
| 23 | #include <asm/me2.h> | ||
| 24 | #endif | ||
| 25 | #ifdef CONFIG_V850E_TEG | ||
| 26 | #include <asm/teg.h> | ||
| 27 | #endif | ||
| 28 | |||
| 29 | /* These are both chips _and_ platforms, so put them in the middle... */ | ||
| 30 | #ifdef CONFIG_V850E2_ANNA | ||
| 31 | #include <asm/anna.h> | ||
| 32 | #endif | ||
| 33 | #ifdef CONFIG_V850E_AS85EP1 | ||
| 34 | #include <asm/as85ep1.h> | ||
| 35 | #endif | ||
| 36 | |||
| 37 | /* platforms */ | ||
| 38 | #ifdef CONFIG_RTE_CB_MA1 | ||
| 39 | #include <asm/rte_ma1_cb.h> | ||
| 40 | #endif | ||
| 41 | #ifdef CONFIG_RTE_CB_ME2 | ||
| 42 | #include <asm/rte_me2_cb.h> | ||
| 43 | #endif | ||
| 44 | #ifdef CONFIG_RTE_CB_NB85E | ||
| 45 | #include <asm/rte_nb85e_cb.h> | ||
| 46 | #endif | ||
| 47 | #ifdef CONFIG_V850E_SIM | ||
| 48 | #include <asm/sim.h> | ||
| 49 | #endif | ||
| 50 | #ifdef CONFIG_V850E2_SIM85E2C | ||
| 51 | #include <asm/sim85e2c.h> | ||
| 52 | #endif | ||
| 53 | #ifdef CONFIG_V850E2_SIM85E2S | ||
| 54 | #include <asm/sim85e2s.h> | ||
| 55 | #endif | ||
| 56 | #ifdef CONFIG_V850E2_FPGA85E2C | ||
| 57 | #include <asm/fpga85e2c.h> | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #endif /* __V850_MACHDEP_H__ */ | ||
diff --git a/include/asm-v850/macrology.h b/include/asm-v850/macrology.h deleted file mode 100644 index 37abf874832c..000000000000 --- a/include/asm-v850/macrology.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/macrology.h -- Various useful CPP macros | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001 NEC Corporation | ||
| 5 | * Copyright (C) 2001 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #define macrology_paste(arg1, arg2) macrology_paste_1(arg1, arg2) | ||
| 15 | #define macrology_paste_1(arg1, arg2) arg1 ## arg2 | ||
| 16 | #define macrology_stringify(sym) macrology_stringify_1(sym) | ||
| 17 | #define macrology_stringify_1(sym) #sym | ||
diff --git a/include/asm-v850/me2.h b/include/asm-v850/me2.h deleted file mode 100644 index ac7c9ce0bdc1..000000000000 --- a/include/asm-v850/me2.h +++ /dev/null | |||
| @@ -1,182 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/me2.h -- V850E/ME2 cpu chip | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_ME2_H__ | ||
| 15 | #define __V850_ME2_H__ | ||
| 16 | |||
| 17 | #include <asm/v850e.h> | ||
| 18 | #include <asm/v850e_cache.h> | ||
| 19 | |||
| 20 | |||
| 21 | #define CPU_MODEL "v850e/me2" | ||
| 22 | #define CPU_MODEL_LONG "NEC V850E/ME2" | ||
| 23 | |||
| 24 | |||
| 25 | /* Hardware-specific interrupt numbers (in the kernel IRQ namespace). */ | ||
| 26 | #define IRQ_INTP(n) (n) /* Pnnn (pin) interrupts */ | ||
| 27 | #define IRQ_INTP_NUM 31 | ||
| 28 | #define IRQ_INTCMD(n) (0x31 + (n)) /* interval timer interrupts 0-3 */ | ||
| 29 | #define IRQ_INTCMD_NUM 4 | ||
| 30 | #define IRQ_INTDMA(n) (0x41 + (n)) /* DMA interrupts 0-3 */ | ||
| 31 | #define IRQ_INTDMA_NUM 4 | ||
| 32 | #define IRQ_INTUBTIRE(n) (0x49 + (n)*5)/* UARTB 0-1 reception error */ | ||
| 33 | #define IRQ_INTUBTIRE_NUM 2 | ||
| 34 | #define IRQ_INTUBTIR(n) (0x4a + (n)*5) /* UARTB 0-1 reception complete */ | ||
| 35 | #define IRQ_INTUBTIR_NUM 2 | ||
| 36 | #define IRQ_INTUBTIT(n) (0x4b + (n)*5) /* UARTB 0-1 transmission complete */ | ||
| 37 | #define IRQ_INTUBTIT_NUM 2 | ||
| 38 | #define IRQ_INTUBTIF(n) (0x4c + (n)*5) /* UARTB 0-1 FIFO trans. complete */ | ||
| 39 | #define IRQ_INTUBTIF_NUM 2 | ||
| 40 | #define IRQ_INTUBTITO(n) (0x4d + (n)*5) /* UARTB 0-1 reception timeout */ | ||
| 41 | #define IRQ_INTUBTITO_NUM 2 | ||
| 42 | |||
| 43 | /* For <asm/irq.h> */ | ||
| 44 | #define NUM_CPU_IRQS 0x59 /* V850E/ME2 */ | ||
| 45 | |||
| 46 | |||
| 47 | /* For <asm/entry.h> */ | ||
| 48 | /* We use on-chip RAM, for a few miscellaneous variables that must be | ||
| 49 | accessible using a load instruction relative to R0. */ | ||
| 50 | #define R0_RAM_ADDR 0xFFFFB000 /* V850E/ME2 */ | ||
| 51 | |||
| 52 | |||
| 53 | /* V850E/ME2 UARTB details.*/ | ||
| 54 | #define V850E_UART_NUM_CHANNELS 2 | ||
| 55 | #define V850E_UARTB_BASE_FREQ (CPU_CLOCK_FREQ / 4) | ||
| 56 | |||
| 57 | /* This is a function that gets called before configuring the UART. */ | ||
| 58 | #define V850E_UART_PRE_CONFIGURE me2_uart_pre_configure | ||
| 59 | #ifndef __ASSEMBLY__ | ||
| 60 | extern void me2_uart_pre_configure (unsigned chan, | ||
| 61 | unsigned cflags, unsigned baud); | ||
| 62 | #endif /* __ASSEMBLY__ */ | ||
| 63 | |||
| 64 | |||
| 65 | /* V850E/ME2 timer C details. */ | ||
| 66 | #define V850E_TIMER_C_BASE_ADDR 0xFFFFF600 | ||
| 67 | |||
| 68 | |||
| 69 | /* V850E/ME2 timer D details. */ | ||
| 70 | #define V850E_TIMER_D_BASE_ADDR 0xFFFFF540 | ||
| 71 | #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0) | ||
| 72 | #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x2) | ||
| 73 | #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4) | ||
| 74 | |||
| 75 | #define V850E_TIMER_D_BASE_FREQ (CPU_CLOCK_FREQ / 2) | ||
| 76 | |||
| 77 | |||
| 78 | /* Select iRAM mode. */ | ||
| 79 | #define ME2_IRAMM_ADDR 0xFFFFF80A | ||
| 80 | #define ME2_IRAMM (*(volatile u8*)ME2_IRAMM_ADDR) | ||
| 81 | |||
| 82 | |||
| 83 | /* Interrupt edge-detection configuration. INTF(n) and INTR(n) are only | ||
| 84 | valid for n == 1, 2, or 5. */ | ||
| 85 | #define ME2_INTF_ADDR(n) (0xFFFFFC00 + (n) * 0x2) | ||
| 86 | #define ME2_INTF(n) (*(volatile u8*)ME2_INTF_ADDR(n)) | ||
| 87 | #define ME2_INTR_ADDR(n) (0xFFFFFC20 + (n) * 0x2) | ||
| 88 | #define ME2_INTR(n) (*(volatile u8*)ME2_INTR_ADDR(n)) | ||
| 89 | #define ME2_INTFAL_ADDR 0xFFFFFC10 | ||
| 90 | #define ME2_INTFAL (*(volatile u8*)ME2_INTFAL_ADDR) | ||
| 91 | #define ME2_INTRAL_ADDR 0xFFFFFC30 | ||
| 92 | #define ME2_INTRAL (*(volatile u8*)ME2_INTRAL_ADDR) | ||
| 93 | #define ME2_INTFDH_ADDR 0xFFFFFC16 | ||
| 94 | #define ME2_INTFDH (*(volatile u16*)ME2_INTFDH_ADDR) | ||
| 95 | #define ME2_INTRDH_ADDR 0xFFFFFC36 | ||
| 96 | #define ME2_INTRDH (*(volatile u16*)ME2_INTRDH_ADDR) | ||
| 97 | #define ME2_SESC_ADDR(n) (0xFFFFF609 + (n) * 0x10) | ||
| 98 | #define ME2_SESC(n) (*(volatile u8*)ME2_SESC_ADDR(n)) | ||
| 99 | #define ME2_SESA10_ADDR 0xFFFFF5AD | ||
| 100 | #define ME2_SESA10 (*(volatile u8*)ME2_SESA10_ADDR) | ||
| 101 | #define ME2_SESA11_ADDR 0xFFFFF5DD | ||
| 102 | #define ME2_SESA11 (*(volatile u8*)ME2_SESA11_ADDR) | ||
| 103 | |||
| 104 | |||
| 105 | /* Port 1 */ | ||
| 106 | /* Direct I/O. Bits 0-3 are pins P10-P13. */ | ||
| 107 | #define ME2_PORT1_IO_ADDR 0xFFFFF402 | ||
| 108 | #define ME2_PORT1_IO (*(volatile u8 *)ME2_PORT1_IO_ADDR) | ||
| 109 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 110 | #define ME2_PORT1_PM_ADDR 0xFFFFF422 | ||
| 111 | #define ME2_PORT1_PM (*(volatile u8 *)ME2_PORT1_PM_ADDR) | ||
| 112 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 113 | #define ME2_PORT1_PMC_ADDR 0xFFFFF442 | ||
| 114 | #define ME2_PORT1_PMC (*(volatile u8 *)ME2_PORT1_PMC_ADDR) | ||
| 115 | /* Port function control (for serial interfaces, 0 = CSI30, 1 = UARTB0 ). */ | ||
| 116 | #define ME2_PORT1_PFC_ADDR 0xFFFFF462 | ||
| 117 | #define ME2_PORT1_PFC (*(volatile u8 *)ME2_PORT1_PFC_ADDR) | ||
| 118 | |||
| 119 | /* Port 2 */ | ||
| 120 | /* Direct I/O. Bits 0-3 are pins P20-P25. */ | ||
| 121 | #define ME2_PORT2_IO_ADDR 0xFFFFF404 | ||
| 122 | #define ME2_PORT2_IO (*(volatile u8 *)ME2_PORT2_IO_ADDR) | ||
| 123 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 124 | #define ME2_PORT2_PM_ADDR 0xFFFFF424 | ||
| 125 | #define ME2_PORT2_PM (*(volatile u8 *)ME2_PORT2_PM_ADDR) | ||
| 126 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 127 | #define ME2_PORT2_PMC_ADDR 0xFFFFF444 | ||
| 128 | #define ME2_PORT2_PMC (*(volatile u8 *)ME2_PORT2_PMC_ADDR) | ||
| 129 | /* Port function control (for serial interfaces, 0 = INTP2x, 1 = UARTB1 ). */ | ||
| 130 | #define ME2_PORT2_PFC_ADDR 0xFFFFF464 | ||
| 131 | #define ME2_PORT2_PFC (*(volatile u8 *)ME2_PORT2_PFC_ADDR) | ||
| 132 | |||
| 133 | /* Port 5 */ | ||
| 134 | /* Direct I/O. Bits 0-5 are pins P50-P55. */ | ||
| 135 | #define ME2_PORT5_IO_ADDR 0xFFFFF40A | ||
| 136 | #define ME2_PORT5_IO (*(volatile u8 *)ME2_PORT5_IO_ADDR) | ||
| 137 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 138 | #define ME2_PORT5_PM_ADDR 0xFFFFF42A | ||
| 139 | #define ME2_PORT5_PM (*(volatile u8 *)ME2_PORT5_PM_ADDR) | ||
| 140 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 141 | #define ME2_PORT5_PMC_ADDR 0xFFFFF44A | ||
| 142 | #define ME2_PORT5_PMC (*(volatile u8 *)ME2_PORT5_PMC_ADDR) | ||
| 143 | /* Port function control (). */ | ||
| 144 | #define ME2_PORT5_PFC_ADDR 0xFFFFF46A | ||
| 145 | #define ME2_PORT5_PFC (*(volatile u8 *)ME2_PORT5_PFC_ADDR) | ||
| 146 | |||
| 147 | /* Port 6 */ | ||
| 148 | /* Direct I/O. Bits 5-7 are pins P65-P67. */ | ||
| 149 | #define ME2_PORT6_IO_ADDR 0xFFFFF40C | ||
| 150 | #define ME2_PORT6_IO (*(volatile u8 *)ME2_PORT6_IO_ADDR) | ||
| 151 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 152 | #define ME2_PORT6_PM_ADDR 0xFFFFF42C | ||
| 153 | #define ME2_PORT6_PM (*(volatile u8 *)ME2_PORT6_PM_ADDR) | ||
| 154 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 155 | #define ME2_PORT6_PMC_ADDR 0xFFFFF44C | ||
| 156 | #define ME2_PORT6_PMC (*(volatile u8 *)ME2_PORT6_PMC_ADDR) | ||
| 157 | /* Port function control (). */ | ||
| 158 | #define ME2_PORT6_PFC_ADDR 0xFFFFF46C | ||
| 159 | #define ME2_PORT6_PFC (*(volatile u8 *)ME2_PORT6_PFC_ADDR) | ||
| 160 | |||
| 161 | /* Port 7 */ | ||
| 162 | /* Direct I/O. Bits 2-7 are pins P72-P77. */ | ||
| 163 | #define ME2_PORT7_IO_ADDR 0xFFFFF40E | ||
| 164 | #define ME2_PORT7_IO (*(volatile u8 *)ME2_PORT7_IO_ADDR) | ||
| 165 | /* Port mode (for direct I/O, 0 = output, 1 = input). */ | ||
| 166 | #define ME2_PORT7_PM_ADDR 0xFFFFF42E | ||
| 167 | #define ME2_PORT7_PM (*(volatile u8 *)ME2_PORT7_PM_ADDR) | ||
| 168 | /* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */ | ||
| 169 | #define ME2_PORT7_PMC_ADDR 0xFFFFF44E | ||
| 170 | #define ME2_PORT7_PMC (*(volatile u8 *)ME2_PORT7_PMC_ADDR) | ||
| 171 | /* Port function control (). */ | ||
| 172 | #define ME2_PORT7_PFC_ADDR 0xFFFFF46E | ||
| 173 | #define ME2_PORT7_PFC (*(volatile u8 *)ME2_PORT7_PFC_ADDR) | ||
| 174 | |||
| 175 | |||
| 176 | #ifndef __ASSEMBLY__ | ||
| 177 | /* Initialize V850E/ME2 chip interrupts. */ | ||
| 178 | extern void me2_init_irqs (void); | ||
| 179 | #endif /* !__ASSEMBLY__ */ | ||
| 180 | |||
| 181 | |||
| 182 | #endif /* __V850_ME2_H__ */ | ||
diff --git a/include/asm-v850/mman.h b/include/asm-v850/mman.h deleted file mode 100644 index edbf6edbfb37..000000000000 --- a/include/asm-v850/mman.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef __V850_MMAN_H__ | ||
| 2 | #define __V850_MMAN_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/mman.h> | ||
| 5 | |||
| 6 | #define MAP_GROWSDOWN 0x0100 /* stack-like segment */ | ||
| 7 | #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ | ||
| 8 | #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | ||
| 9 | #define MAP_LOCKED 0x2000 /* pages are locked */ | ||
| 10 | #define MAP_NORESERVE 0x4000 /* don't check for reservations */ | ||
| 11 | |||
| 12 | #define MCL_CURRENT 1 /* lock all current mappings */ | ||
| 13 | #define MCL_FUTURE 2 /* lock all future mappings */ | ||
| 14 | |||
| 15 | #endif /* __V850_MMAN_H__ */ | ||
diff --git a/include/asm-v850/mmu.h b/include/asm-v850/mmu.h deleted file mode 100644 index 267768c66ef6..000000000000 --- a/include/asm-v850/mmu.h +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | /* Copyright (C) 2002, 2005, David McCullough <davidm@snapgear.com> */ | ||
| 2 | |||
| 3 | #ifndef __V850_MMU_H__ | ||
| 4 | #define __V850_MMU_H__ | ||
| 5 | |||
| 6 | typedef struct { | ||
| 7 | struct vm_list_struct *vmlist; | ||
| 8 | unsigned long end_brk; | ||
| 9 | } mm_context_t; | ||
| 10 | |||
| 11 | #endif /* __V850_MMU_H__ */ | ||
diff --git a/include/asm-v850/mmu_context.h b/include/asm-v850/mmu_context.h deleted file mode 100644 index 01daacd5474e..000000000000 --- a/include/asm-v850/mmu_context.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #ifndef __V850_MMU_CONTEXT_H__ | ||
| 2 | #define __V850_MMU_CONTEXT_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/mm_hooks.h> | ||
| 5 | |||
| 6 | #define destroy_context(mm) ((void)0) | ||
| 7 | #define init_new_context(tsk,mm) 0 | ||
| 8 | #define switch_mm(prev,next,tsk) ((void)0) | ||
| 9 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
| 10 | #define activate_mm(prev,next) ((void)0) | ||
| 11 | #define enter_lazy_tlb(mm,tsk) ((void)0) | ||
| 12 | |||
| 13 | #endif /* __V850_MMU_CONTEXT_H__ */ | ||
diff --git a/include/asm-v850/module.h b/include/asm-v850/module.h deleted file mode 100644 index 2c2f4944f09f..000000000000 --- a/include/asm-v850/module.h +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/module.h -- Architecture-specific module hooks | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03,04 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org> | ||
| 6 | * Copyright (C) 2001,03 Rusty Russell | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | * | ||
| 14 | * Derived in part from include/asm-ppc/module.h | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __V850_MODULE_H__ | ||
| 18 | #define __V850_MODULE_H__ | ||
| 19 | |||
| 20 | #define MODULE_SYMBOL_PREFIX "_" | ||
| 21 | |||
| 22 | struct v850_plt_entry | ||
| 23 | { | ||
| 24 | /* Indirect jump instruction sequence (6-byte mov + 2-byte jr). */ | ||
| 25 | unsigned long tramp[2]; | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct mod_arch_specific | ||
| 29 | { | ||
| 30 | /* Indices of PLT sections within module. */ | ||
| 31 | unsigned int core_plt_section, init_plt_section; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #define Elf_Shdr Elf32_Shdr | ||
| 35 | #define Elf_Sym Elf32_Sym | ||
| 36 | #define Elf_Ehdr Elf32_Ehdr | ||
| 37 | |||
| 38 | /* Make empty sections for module_frob_arch_sections to expand. */ | ||
| 39 | #ifdef MODULE | ||
| 40 | asm(".section .plt,\"ax\",@nobits; .align 3; .previous"); | ||
| 41 | asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous"); | ||
| 42 | #endif | ||
| 43 | |||
| 44 | /* We don't do exception tables. */ | ||
| 45 | struct exception_table_entry; | ||
| 46 | static inline const struct exception_table_entry * | ||
| 47 | search_extable(const struct exception_table_entry *first, | ||
| 48 | const struct exception_table_entry *last, | ||
| 49 | unsigned long value) | ||
| 50 | { | ||
| 51 | return 0; | ||
| 52 | } | ||
| 53 | #define ARCH_HAS_SEARCH_EXTABLE | ||
| 54 | static inline void | ||
| 55 | sort_extable(struct exception_table_entry *start, | ||
| 56 | struct exception_table_entry *finish) | ||
| 57 | { | ||
| 58 | /* nada */ | ||
| 59 | } | ||
| 60 | #define ARCH_HAS_SORT_EXTABLE | ||
| 61 | |||
| 62 | #endif /* __V850_MODULE_H__ */ | ||
diff --git a/include/asm-v850/msgbuf.h b/include/asm-v850/msgbuf.h deleted file mode 100644 index ed07dbd01637..000000000000 --- a/include/asm-v850/msgbuf.h +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | #ifndef __V850_MSGBUF_H__ | ||
| 2 | #define __V850_MSGBUF_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The msqid64_ds structure for v850 architecture. | ||
| 6 | * Note extra padding because this structure is passed back and forth | ||
| 7 | * between kernel and user space. | ||
| 8 | * | ||
| 9 | * Pad space is left for: | ||
| 10 | * - 64-bit time_t to solve y2038 problem | ||
| 11 | * - 2 miscellaneous 32-bit values | ||
| 12 | */ | ||
| 13 | |||
| 14 | struct msqid64_ds { | ||
| 15 | struct ipc64_perm msg_perm; | ||
| 16 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
| 17 | unsigned long __unused1; | ||
| 18 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
| 19 | unsigned long __unused2; | ||
| 20 | __kernel_time_t msg_ctime; /* last change time */ | ||
| 21 | unsigned long __unused3; | ||
| 22 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
| 23 | unsigned long msg_qnum; /* number of messages in queue */ | ||
| 24 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
| 25 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
| 26 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
| 27 | unsigned long __unused4; | ||
| 28 | unsigned long __unused5; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif /* __V850_MSGBUF_H__ */ | ||
diff --git a/include/asm-v850/mutex.h b/include/asm-v850/mutex.h deleted file mode 100644 index 458c1f7fbc18..000000000000 --- a/include/asm-v850/mutex.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Pull in the generic implementation for the mutex fastpath. | ||
| 3 | * | ||
| 4 | * TODO: implement optimized primitives instead, or leave the generic | ||
| 5 | * implementation in place, or pick the atomic_xchg() based generic | ||
| 6 | * implementation. (see asm-generic/mutex-xchg.h for details) | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <asm-generic/mutex-dec.h> | ||
diff --git a/include/asm-v850/namei.h b/include/asm-v850/namei.h deleted file mode 100644 index ee8339b23843..000000000000 --- a/include/asm-v850/namei.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-v850/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __V850_NAMEI_H__ | ||
| 8 | #define __V850_NAMEI_H__ | ||
| 9 | |||
| 10 | /* This dummy routine maybe changed to something useful | ||
| 11 | * for /usr/gnemul/ emulation stuff. | ||
| 12 | * Look at asm-sparc/namei.h for details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define __emul_prefix() NULL | ||
| 16 | |||
| 17 | #endif /* __V850_NAMEI_H__ */ | ||
diff --git a/include/asm-v850/page.h b/include/asm-v850/page.h deleted file mode 100644 index 74a539a9bd59..000000000000 --- a/include/asm-v850/page.h +++ /dev/null | |||
| @@ -1,128 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/page.h -- VM ops | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03,05 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_PAGE_H__ | ||
| 15 | #define __V850_PAGE_H__ | ||
| 16 | |||
| 17 | #include <asm/machdep.h> | ||
| 18 | |||
| 19 | |||
| 20 | #define PAGE_SHIFT 12 | ||
| 21 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | ||
| 22 | #define PAGE_MASK (~(PAGE_SIZE-1)) | ||
| 23 | |||
| 24 | |||
| 25 | /* | ||
| 26 | * PAGE_OFFSET -- the first address of the first page of memory. For archs with | ||
| 27 | * no MMU this corresponds to the first free page in physical memory (aligned | ||
| 28 | * on a page boundary). | ||
| 29 | */ | ||
| 30 | #ifndef PAGE_OFFSET | ||
| 31 | #define PAGE_OFFSET 0x0000000 | ||
| 32 | #endif | ||
| 33 | |||
| 34 | |||
| 35 | #ifndef __ASSEMBLY__ | ||
| 36 | |||
| 37 | #define STRICT_MM_TYPECHECKS | ||
| 38 | |||
| 39 | #define clear_page(page) memset ((void *)(page), 0, PAGE_SIZE) | ||
| 40 | #define copy_page(to, from) memcpy ((void *)(to), (void *)from, PAGE_SIZE) | ||
| 41 | |||
| 42 | #define clear_user_page(addr, vaddr, page) \ | ||
| 43 | do { clear_page(addr); \ | ||
| 44 | flush_dcache_page(page); \ | ||
| 45 | } while (0) | ||
| 46 | #define copy_user_page(to, from, vaddr, page) \ | ||
| 47 | do { copy_page(to, from); \ | ||
| 48 | flush_dcache_page(page); \ | ||
| 49 | } while (0) | ||
| 50 | |||
| 51 | #ifdef STRICT_MM_TYPECHECKS | ||
| 52 | /* | ||
| 53 | * These are used to make use of C type-checking.. | ||
| 54 | */ | ||
| 55 | |||
| 56 | typedef struct { unsigned long pte; } pte_t; | ||
| 57 | typedef struct { unsigned long pmd; } pmd_t; | ||
| 58 | typedef struct { unsigned long pgd; } pgd_t; | ||
| 59 | typedef struct { unsigned long pgprot; } pgprot_t; | ||
| 60 | typedef struct page *pgtable_t; | ||
| 61 | |||
| 62 | #define pte_val(x) ((x).pte) | ||
| 63 | #define pmd_val(x) ((x).pmd) | ||
| 64 | #define pgd_val(x) ((x).pgd) | ||
| 65 | #define pgprot_val(x) ((x).pgprot) | ||
| 66 | |||
| 67 | #define __pte(x) ((pte_t) { (x) } ) | ||
| 68 | #define __pmd(x) ((pmd_t) { (x) } ) | ||
| 69 | #define __pgd(x) ((pgd_t) { (x) } ) | ||
| 70 | #define __pgprot(x) ((pgprot_t) { (x) } ) | ||
| 71 | |||
| 72 | #else /* !STRICT_MM_TYPECHECKS */ | ||
| 73 | /* | ||
| 74 | * .. while these make it easier on the compiler | ||
| 75 | */ | ||
| 76 | |||
| 77 | typedef unsigned long pte_t; | ||
| 78 | typedef unsigned long pmd_t; | ||
| 79 | typedef unsigned long pgd_t; | ||
| 80 | typedef unsigned long pgprot_t; | ||
| 81 | |||
| 82 | #define pte_val(x) (x) | ||
| 83 | #define pmd_val(x) (x) | ||
| 84 | #define pgd_val(x) (x) | ||
| 85 | #define pgprot_val(x) (x) | ||
| 86 | |||
| 87 | #define __pte(x) (x) | ||
| 88 | #define __pmd(x) (x) | ||
| 89 | #define __pgd(x) (x) | ||
| 90 | #define __pgprot(x) (x) | ||
| 91 | |||
| 92 | #endif /* STRICT_MM_TYPECHECKS */ | ||
| 93 | |||
| 94 | #endif /* !__ASSEMBLY__ */ | ||
| 95 | |||
| 96 | |||
| 97 | /* to align the pointer to the (next) page boundary */ | ||
| 98 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | ||
| 99 | |||
| 100 | |||
| 101 | /* No current v850 processor has virtual memory. */ | ||
| 102 | #define __virt_to_phys(addr) (addr) | ||
| 103 | #define __phys_to_virt(addr) (addr) | ||
| 104 | |||
| 105 | #define virt_to_pfn(kaddr) (__virt_to_phys (kaddr) >> PAGE_SHIFT) | ||
| 106 | #define pfn_to_virt(pfn) __phys_to_virt ((pfn) << PAGE_SHIFT) | ||
| 107 | |||
| 108 | #define MAP_NR(kaddr) \ | ||
| 109 | (((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) | ||
| 110 | #define virt_to_page(kaddr) (mem_map + MAP_NR (kaddr)) | ||
| 111 | #define page_to_virt(page) \ | ||
| 112 | ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) | ||
| 113 | |||
| 114 | #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) | ||
| 115 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | ||
| 116 | |||
| 117 | #define virt_addr_valid(kaddr) \ | ||
| 118 | (((void *)(kaddr) >= (void *)PAGE_OFFSET) && MAP_NR (kaddr) < max_mapnr) | ||
| 119 | |||
| 120 | |||
| 121 | #define __pa(x) __virt_to_phys ((unsigned long)(x)) | ||
| 122 | #define __va(x) ((void *)__phys_to_virt ((unsigned long)(x))) | ||
| 123 | |||
| 124 | |||
| 125 | #include <asm-generic/memory_model.h> | ||
| 126 | #include <asm-generic/page.h> | ||
| 127 | |||
| 128 | #endif /* __V850_PAGE_H__ */ | ||
diff --git a/include/asm-v850/param.h b/include/asm-v850/param.h deleted file mode 100644 index 4391f5fe0204..000000000000 --- a/include/asm-v850/param.h +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/param.h -- Varions kernel parameters | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_PARAM_H__ | ||
| 15 | #define __V850_PARAM_H__ | ||
| 16 | |||
| 17 | #define EXEC_PAGESIZE 4096 | ||
| 18 | |||
| 19 | #ifndef NOGROUP | ||
| 20 | #define NOGROUP (-1) | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
| 24 | |||
| 25 | #ifdef __KERNEL__ | ||
| 26 | # define HZ CONFIG_HZ | ||
| 27 | # define USER_HZ 100 | ||
| 28 | # define CLOCKS_PER_SEC USER_HZ | ||
| 29 | #else | ||
| 30 | # define HZ 100 | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #endif /* __V850_PARAM_H__ */ | ||
diff --git a/include/asm-v850/pci.h b/include/asm-v850/pci.h deleted file mode 100644 index de2a7d0a81cc..000000000000 --- a/include/asm-v850/pci.h +++ /dev/null | |||
| @@ -1,119 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/pci.h -- PCI support | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,05 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02,05 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_PCI_H__ | ||
| 15 | #define __V850_PCI_H__ | ||
| 16 | |||
| 17 | /* Get any platform-dependent definitions. */ | ||
| 18 | #include <asm/machdep.h> | ||
| 19 | |||
| 20 | #define pcibios_scan_all_fns(a, b) 0 | ||
| 21 | |||
| 22 | /* Generic declarations. */ | ||
| 23 | |||
| 24 | struct scatterlist; | ||
| 25 | |||
| 26 | extern void pcibios_set_master (struct pci_dev *dev); | ||
| 27 | |||
| 28 | /* `Grant' to PDEV the memory block at CPU_ADDR, for doing DMA. The | ||
| 29 | 32-bit PCI bus mastering address to use is returned. the device owns | ||
| 30 | this memory until either pci_unmap_single or pci_dma_sync_single_for_cpu is | ||
| 31 | performed. */ | ||
| 32 | extern dma_addr_t | ||
| 33 | pci_map_single (struct pci_dev *pdev, void *cpu_addr, size_t size, int dir); | ||
| 34 | |||
| 35 | /* Return to the CPU the PCI DMA memory block previously `granted' to | ||
| 36 | PDEV, at DMA_ADDR. */ | ||
| 37 | extern void | ||
| 38 | pci_unmap_single (struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | ||
| 39 | int dir); | ||
| 40 | |||
| 41 | /* Make physical memory consistent for a single streaming mode DMA | ||
| 42 | translation after a transfer. | ||
| 43 | |||
| 44 | If you perform a pci_map_single() but wish to interrogate the | ||
| 45 | buffer using the cpu, yet do not wish to teardown the PCI dma | ||
| 46 | mapping, you must call this function before doing so. At the next | ||
| 47 | point you give the PCI dma address back to the card, you must first | ||
| 48 | perform a pci_dma_sync_for_device, and then the device again owns | ||
| 49 | the buffer. */ | ||
| 50 | extern void | ||
| 51 | pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, | ||
| 52 | size_t size, int dir); | ||
| 53 | |||
| 54 | extern void | ||
| 55 | pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, | ||
| 56 | size_t size, int dir); | ||
| 57 | |||
| 58 | |||
| 59 | /* Do multiple DMA mappings at once. */ | ||
| 60 | extern int | ||
| 61 | pci_map_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, int dir); | ||
| 62 | |||
| 63 | /* Unmap multiple DMA mappings at once. */ | ||
| 64 | extern void | ||
| 65 | pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, | ||
| 66 | int dir); | ||
| 67 | |||
| 68 | /* SG-list versions of pci_dma_sync functions. */ | ||
| 69 | extern void | ||
| 70 | pci_dma_sync_sg_for_cpu (struct pci_dev *dev, | ||
| 71 | struct scatterlist *sg, int sg_len, | ||
| 72 | int dir); | ||
| 73 | extern void | ||
| 74 | pci_dma_sync_sg_for_device (struct pci_dev *dev, | ||
| 75 | struct scatterlist *sg, int sg_len, | ||
| 76 | int dir); | ||
| 77 | |||
| 78 | #define pci_map_page(dev, page, offs, size, dir) \ | ||
| 79 | pci_map_single(dev, (page_address(page) + (offs)), size, dir) | ||
| 80 | #define pci_unmap_page(dev,addr,sz,dir) \ | ||
| 81 | pci_unmap_single(dev, addr, sz, dir) | ||
| 82 | |||
| 83 | /* Test for pci_map_single or pci_map_page having generated an error. */ | ||
| 84 | static inline int | ||
| 85 | pci_dma_mapping_error (dma_addr_t dma_addr) | ||
| 86 | { | ||
| 87 | return dma_addr == 0; | ||
| 88 | } | ||
| 89 | |||
| 90 | /* Allocate and map kernel buffer using consistent mode DMA for PCI | ||
| 91 | device. Returns non-NULL cpu-view pointer to the buffer if | ||
| 92 | successful and sets *DMA_ADDR to the pci side dma address as well, | ||
| 93 | else DMA_ADDR is undefined. */ | ||
| 94 | extern void * | ||
| 95 | pci_alloc_consistent (struct pci_dev *pdev, size_t size, dma_addr_t *dma_addr); | ||
| 96 | |||
| 97 | /* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must | ||
| 98 | be values that were returned from pci_alloc_consistent. SIZE must be | ||
| 99 | the same as what as passed into pci_alloc_consistent. References to | ||
| 100 | the memory and mappings assosciated with CPU_ADDR or DMA_ADDR past | ||
| 101 | this call are illegal. */ | ||
| 102 | extern void | ||
| 103 | pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr, | ||
| 104 | dma_addr_t dma_addr); | ||
| 105 | |||
| 106 | #ifdef CONFIG_PCI | ||
| 107 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
| 108 | enum pci_dma_burst_strategy *strat, | ||
| 109 | unsigned long *strategy_parameter) | ||
| 110 | { | ||
| 111 | *strat = PCI_DMA_BURST_INFINITY; | ||
| 112 | *strategy_parameter = ~0UL; | ||
| 113 | } | ||
| 114 | #endif | ||
| 115 | |||
| 116 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
| 117 | extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr); | ||
| 118 | |||
| 119 | #endif /* __V850_PCI_H__ */ | ||
diff --git a/include/asm-v850/percpu.h b/include/asm-v850/percpu.h deleted file mode 100644 index 755ac6522b63..000000000000 --- a/include/asm-v850/percpu.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef __V850_PERCPU_H__ | ||
| 2 | #define __V850_PERCPU_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/percpu.h> | ||
| 5 | |||
| 6 | /* This is a stupid hack to satisfy some grotty implicit include-file | ||
| 7 | dependency; basically, <linux/smp.h> uses BUG_ON, which calls BUG, but | ||
| 8 | doesn't include the necessary headers to define it. In the twisted | ||
| 9 | festering mess of includes this must all be resolved somehow on other | ||
| 10 | platforms, but I haven't the faintest idea how, and don't care; here will | ||
| 11 | do, even though doesn't actually make any sense. */ | ||
| 12 | #include <asm/page.h> | ||
| 13 | |||
| 14 | #endif /* __V850_PERCPU_H__ */ | ||
diff --git a/include/asm-v850/pgalloc.h b/include/asm-v850/pgalloc.h deleted file mode 100644 index b91eb2d02bfd..000000000000 --- a/include/asm-v850/pgalloc.h +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/pgalloc.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_PGALLOC_H__ | ||
| 15 | #define __V850_PGALLOC_H__ | ||
| 16 | |||
| 17 | #include <linux/mm.h> /* some crap code expects this */ | ||
| 18 | |||
| 19 | /* ... and then, there was one. */ | ||
| 20 | #define check_pgt_cache() ((void)0) | ||
| 21 | |||
| 22 | #endif /* __V850_PGALLOC_H__ */ | ||
diff --git a/include/asm-v850/pgtable.h b/include/asm-v850/pgtable.h deleted file mode 100644 index 1ea2a900f0f8..000000000000 --- a/include/asm-v850/pgtable.h +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | #ifndef __V850_PGTABLE_H__ | ||
| 2 | #define __V850_PGTABLE_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/4level-fixup.h> | ||
| 5 | |||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | |||
| 9 | #define pgd_present(pgd) (1) /* pages are always present on NO_MM */ | ||
| 10 | #define pgd_none(pgd) (0) | ||
| 11 | #define pgd_bad(pgd) (0) | ||
| 12 | #define pgd_clear(pgdp) ((void)0) | ||
| 13 | |||
| 14 | #define pmd_offset(a, b) ((void *)0) | ||
| 15 | |||
| 16 | #define kern_addr_valid(addr) (1) | ||
| 17 | |||
| 18 | |||
| 19 | #define __swp_type(x) (0) | ||
| 20 | #define __swp_offset(x) (0) | ||
| 21 | #define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) | ||
| 22 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | ||
| 23 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | ||
| 24 | |||
| 25 | static inline int pte_file (pte_t pte) { return 0; } | ||
| 26 | |||
| 27 | |||
| 28 | /* These mean nothing to !CONFIG_MMU. */ | ||
| 29 | #define PAGE_NONE __pgprot(0) | ||
| 30 | #define PAGE_SHARED __pgprot(0) | ||
| 31 | #define PAGE_COPY __pgprot(0) | ||
| 32 | #define PAGE_READONLY __pgprot(0) | ||
| 33 | #define PAGE_KERNEL __pgprot(0) | ||
| 34 | |||
| 35 | |||
| 36 | /* | ||
| 37 | * ZERO_PAGE is a global shared page that is always zero: used | ||
| 38 | * for zero-mapped memory areas etc. When CONFIG_MMU is not defined, this | ||
| 39 | * should never actually be used, so just define it to something that's | ||
| 40 | * will hopefully cause a bus error if it is. | ||
| 41 | */ | ||
| 42 | #define ZERO_PAGE(vaddr) ((void *)0x87654321) | ||
| 43 | |||
| 44 | |||
| 45 | /* Some bogus code in procfs uses these; whatever. */ | ||
| 46 | #define VMALLOC_START 0 | ||
| 47 | #define VMALLOC_END (~0) | ||
| 48 | |||
| 49 | |||
| 50 | extern void paging_init (void); | ||
| 51 | #define swapper_pg_dir ((pgd_t *) 0) | ||
| 52 | |||
| 53 | #define pgtable_cache_init() ((void)0) | ||
| 54 | |||
| 55 | |||
| 56 | extern unsigned int kobjsize(const void *objp); | ||
| 57 | |||
| 58 | |||
| 59 | #endif /* __V850_PGTABLE_H__ */ | ||
diff --git a/include/asm-v850/poll.h b/include/asm-v850/poll.h deleted file mode 100644 index 803cad0b9b59..000000000000 --- a/include/asm-v850/poll.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef __V850_POLL_H__ | ||
| 2 | #define __V850_POLL_H__ | ||
| 3 | |||
| 4 | #define POLLWRNORM POLLOUT | ||
| 5 | #define POLLWRBAND 0x0100 | ||
| 6 | |||
| 7 | #include <asm-generic/poll.h> | ||
| 8 | |||
| 9 | #endif /* __V850_POLL_H__ */ | ||
diff --git a/include/asm-v850/posix_types.h b/include/asm-v850/posix_types.h deleted file mode 100644 index 7f403b765390..000000000000 --- a/include/asm-v850/posix_types.h +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/posix_types.h -- Kernel versions of standard types | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_POSIX_TYPES_H__ | ||
| 15 | #define __V850_POSIX_TYPES_H__ | ||
| 16 | |||
| 17 | typedef unsigned long __kernel_ino_t; | ||
| 18 | typedef unsigned long long __kernel_ino64_t; | ||
| 19 | typedef unsigned int __kernel_mode_t; | ||
| 20 | typedef unsigned int __kernel_nlink_t; | ||
| 21 | typedef long __kernel_off_t; | ||
| 22 | typedef long long __kernel_loff_t; | ||
| 23 | typedef int __kernel_pid_t; | ||
| 24 | typedef unsigned short __kernel_ipc_pid_t; | ||
| 25 | typedef unsigned int __kernel_uid_t; | ||
| 26 | typedef unsigned int __kernel_gid_t; | ||
| 27 | typedef unsigned int __kernel_size_t; | ||
| 28 | typedef int __kernel_ssize_t; | ||
| 29 | typedef int __kernel_ptrdiff_t; | ||
| 30 | typedef long __kernel_time_t; | ||
| 31 | typedef long __kernel_suseconds_t; | ||
| 32 | typedef long __kernel_clock_t; | ||
| 33 | typedef int __kernel_timer_t; | ||
| 34 | typedef int __kernel_clockid_t; | ||
| 35 | typedef int __kernel_daddr_t; | ||
| 36 | typedef char * __kernel_caddr_t; | ||
| 37 | typedef unsigned short __kernel_uid16_t; | ||
| 38 | typedef unsigned short __kernel_gid16_t; | ||
| 39 | typedef unsigned int __kernel_uid32_t; | ||
| 40 | typedef unsigned int __kernel_gid32_t; | ||
| 41 | |||
| 42 | /* Some bogus code depends on this; we don't care. */ | ||
| 43 | typedef __kernel_uid_t __kernel_old_uid_t; | ||
| 44 | typedef unsigned int __kernel_old_dev_t; | ||
| 45 | |||
| 46 | typedef struct { | ||
| 47 | int val[2]; | ||
| 48 | } __kernel_fsid_t; | ||
| 49 | |||
| 50 | |||
| 51 | #if defined(__KERNEL__) | ||
| 52 | |||
| 53 | /* We used to include <asm/bitops.h> here, which seems the right thing, but | ||
| 54 | it caused nasty include-file definition order problems. Removing the | ||
| 55 | include seems to work, so fingers crossed... */ | ||
| 56 | |||
| 57 | #undef __FD_SET | ||
| 58 | #define __FD_SET(fd, fd_set) \ | ||
| 59 | __set_bit (fd, (void *)&((__kernel_fd_set *)fd_set)->fds_bits) | ||
| 60 | #undef __FD_CLR | ||
| 61 | #define __FD_CLR(fd, fd_set) \ | ||
| 62 | __clear_bit (fd, (void *)&((__kernel_fd_set *)fd_set)->fds_bits) | ||
| 63 | #undef __FD_ISSET | ||
| 64 | #define __FD_ISSET(fd, fd_set) \ | ||
| 65 | __test_bit (fd, (void *)&((__kernel_fd_set *)fd_set)->fds_bits) | ||
| 66 | #undef __FD_ZERO | ||
| 67 | #define __FD_ZERO(fd_set) \ | ||
| 68 | memset (fd_set, 0, sizeof (*(fd_set *)fd_set)) | ||
| 69 | |||
| 70 | #endif /* defined(__KERNEL__) */ | ||
| 71 | |||
| 72 | #endif /* __V850_POSIX_TYPES_H__ */ | ||
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h deleted file mode 100644 index 979e3467f9af..000000000000 --- a/include/asm-v850/processor.h +++ /dev/null | |||
| @@ -1,120 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/processor.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_PROCESSOR_H__ | ||
| 15 | #define __V850_PROCESSOR_H__ | ||
| 16 | |||
| 17 | #ifndef __ASSEMBLY__ /* <linux/thread_info.h> is not asm-safe. */ | ||
| 18 | #include <linux/thread_info.h> | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #include <linux/compiler.h> | ||
| 22 | #include <asm/ptrace.h> | ||
| 23 | #include <asm/entry.h> | ||
| 24 | |||
| 25 | /* Some code expects `segment' stuff to be defined here. */ | ||
| 26 | #include <asm/segment.h> | ||
| 27 | |||
| 28 | |||
| 29 | /* | ||
| 30 | * The only places this is used seem to be horrible bletcherous kludges, | ||
| 31 | * so we just define it to be as large as possible. | ||
| 32 | */ | ||
| 33 | #define TASK_SIZE (0xFFFFFFFF) | ||
| 34 | |||
| 35 | /* | ||
| 36 | * This decides where the kernel will search for a free chunk of vm | ||
| 37 | * space during mmap's. We won't be using it. | ||
| 38 | */ | ||
| 39 | #define TASK_UNMAPPED_BASE 0 | ||
| 40 | |||
| 41 | |||
| 42 | #ifndef __ASSEMBLY__ | ||
| 43 | |||
| 44 | |||
| 45 | /* | ||
| 46 | * Default implementation of macro that returns current | ||
| 47 | * instruction pointer ("program counter"). | ||
| 48 | */ | ||
| 49 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | ||
| 50 | |||
| 51 | /* If you change this, you must change the associated assembly-languages | ||
| 52 | constants defined below, THREAD_*. */ | ||
| 53 | struct thread_struct { | ||
| 54 | /* kernel stack pointer (must be first field in structure) */ | ||
| 55 | unsigned long ksp; | ||
| 56 | }; | ||
| 57 | |||
| 58 | #define INIT_THREAD { sizeof init_stack + (unsigned long)init_stack } | ||
| 59 | |||
| 60 | |||
| 61 | /* Do necessary setup to start up a newly executed thread. */ | ||
| 62 | static inline void start_thread (struct pt_regs *regs, | ||
| 63 | unsigned long pc, unsigned long usp) | ||
| 64 | { | ||
| 65 | regs->pc = pc; | ||
| 66 | regs->gpr[GPR_SP] = usp; | ||
| 67 | regs->kernel_mode = 0; | ||
| 68 | } | ||
| 69 | |||
| 70 | /* Free all resources held by a thread. */ | ||
| 71 | static inline void release_thread (struct task_struct *dead_task) | ||
| 72 | { | ||
| 73 | } | ||
| 74 | |||
| 75 | /* Prepare to copy thread state - unlazy all lazy status */ | ||
| 76 | #define prepare_to_copy(tsk) do { } while (0) | ||
| 77 | |||
| 78 | extern int kernel_thread (int (*fn)(void *), void * arg, unsigned long flags); | ||
| 79 | |||
| 80 | /* Free current thread data structures etc. */ | ||
| 81 | static inline void exit_thread (void) | ||
| 82 | { | ||
| 83 | } | ||
| 84 | |||
| 85 | |||
| 86 | /* Return the registers saved during context-switch by the currently | ||
| 87 | not-running thread T. Note that this only includes some registers! | ||
| 88 | See entry.S for details. */ | ||
| 89 | #define thread_saved_regs(t) \ | ||
| 90 | ((struct pt_regs*)((t)->thread.ksp + STATE_SAVE_PT_OFFSET)) | ||
| 91 | /* Return saved (kernel) PC of a blocked thread. Actually, we return the | ||
| 92 | LP register, because the thread is actually blocked in switch_thread, | ||
| 93 | and we're interested in the PC it will _return_ to. */ | ||
| 94 | #define thread_saved_pc(t) (thread_saved_regs(t)->gpr[GPR_LP]) | ||
| 95 | |||
| 96 | |||
| 97 | unsigned long get_wchan (struct task_struct *p); | ||
| 98 | |||
| 99 | |||
| 100 | /* Return some info about the user process TASK. */ | ||
| 101 | #define task_tos(task) ((unsigned long)task_stack_page(task) + THREAD_SIZE) | ||
| 102 | #define task_pt_regs(task) ((struct pt_regs *)task_tos (task) - 1) | ||
| 103 | #define task_sp(task) (task_pt_regs (task)->gpr[GPR_SP]) | ||
| 104 | #define task_pc(task) (task_pt_regs (task)->pc) | ||
| 105 | /* Grotty old names for some. */ | ||
| 106 | #define KSTK_EIP(task) task_pc (task) | ||
| 107 | #define KSTK_ESP(task) task_sp (task) | ||
| 108 | |||
| 109 | |||
| 110 | #define cpu_relax() barrier() | ||
| 111 | |||
| 112 | |||
| 113 | #else /* __ASSEMBLY__ */ | ||
| 114 | |||
| 115 | #define THREAD_KSP 0 | ||
| 116 | |||
| 117 | #endif /* !__ASSEMBLY__ */ | ||
| 118 | |||
| 119 | |||
| 120 | #endif /* __V850_PROCESSOR_H__ */ | ||
diff --git a/include/asm-v850/ptrace.h b/include/asm-v850/ptrace.h deleted file mode 100644 index 4f35cf2cd641..000000000000 --- a/include/asm-v850/ptrace.h +++ /dev/null | |||
| @@ -1,121 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/ptrace.h -- Access to CPU registers | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_PTRACE_H__ | ||
| 15 | #define __V850_PTRACE_H__ | ||
| 16 | |||
| 17 | |||
| 18 | /* v850 general purpose registers with special meanings. */ | ||
| 19 | #define GPR_ZERO 0 /* constant zero */ | ||
| 20 | #define GPR_ASM 1 /* reserved for assembler */ | ||
| 21 | #define GPR_SP 3 /* stack pointer */ | ||
| 22 | #define GPR_GP 4 /* global data pointer */ | ||
| 23 | #define GPR_TP 5 /* `text pointer' */ | ||
| 24 | #define GPR_EP 30 /* `element pointer' */ | ||
| 25 | #define GPR_LP 31 /* link pointer (current return address) */ | ||
| 26 | |||
| 27 | /* These aren't official names, but they make some code more descriptive. */ | ||
| 28 | #define GPR_ARG0 6 | ||
| 29 | #define GPR_ARG1 7 | ||
| 30 | #define GPR_ARG2 8 | ||
| 31 | #define GPR_ARG3 9 | ||
| 32 | #define GPR_RVAL0 10 | ||
| 33 | #define GPR_RVAL1 11 | ||
| 34 | #define GPR_RVAL GPR_RVAL0 | ||
| 35 | |||
| 36 | #define NUM_GPRS 32 | ||
| 37 | |||
| 38 | /* v850 `system' registers. */ | ||
| 39 | #define SR_EIPC 0 | ||
| 40 | #define SR_EIPSW 1 | ||
| 41 | #define SR_FEPC 2 | ||
| 42 | #define SR_FEPSW 3 | ||
| 43 | #define SR_ECR 4 | ||
| 44 | #define SR_PSW 5 | ||
| 45 | #define SR_CTPC 16 | ||
| 46 | #define SR_CTPSW 17 | ||
| 47 | #define SR_DBPC 18 | ||
| 48 | #define SR_DBPSW 19 | ||
| 49 | #define SR_CTBP 20 | ||
| 50 | #define SR_DIR 21 | ||
| 51 | #define SR_ASID 23 | ||
| 52 | |||
| 53 | |||
| 54 | #ifndef __ASSEMBLY__ | ||
| 55 | |||
| 56 | typedef unsigned long v850_reg_t; | ||
| 57 | |||
| 58 | /* How processor state is stored on the stack during a syscall/signal. | ||
| 59 | If you change this structure, change the associated assembly-language | ||
| 60 | macros below too (PT_*)! */ | ||
| 61 | struct pt_regs | ||
| 62 | { | ||
| 63 | /* General purpose registers. */ | ||
| 64 | v850_reg_t gpr[NUM_GPRS]; | ||
| 65 | |||
| 66 | v850_reg_t pc; /* program counter */ | ||
| 67 | v850_reg_t psw; /* program status word */ | ||
| 68 | |||
| 69 | /* Registers used by `callt' instruction: */ | ||
| 70 | v850_reg_t ctpc; /* saved program counter */ | ||
| 71 | v850_reg_t ctpsw; /* saved psw */ | ||
| 72 | v850_reg_t ctbp; /* base pointer for callt table */ | ||
| 73 | |||
| 74 | char kernel_mode; /* 1 if in `kernel mode', 0 if user mode */ | ||
| 75 | }; | ||
| 76 | |||
| 77 | |||
| 78 | #define instruction_pointer(regs) ((regs)->pc) | ||
| 79 | #define profile_pc(regs) instruction_pointer(regs) | ||
| 80 | #define user_mode(regs) (!(regs)->kernel_mode) | ||
| 81 | |||
| 82 | /* When a struct pt_regs is used to save user state for a system call in | ||
| 83 | the kernel, the system call is stored in the space for R0 (since it's | ||
| 84 | never used otherwise, R0 being a constant 0). Non-system-calls | ||
| 85 | simply store 0 there. */ | ||
| 86 | #define PT_REGS_SYSCALL(regs) (regs)->gpr[0] | ||
| 87 | #define PT_REGS_SET_SYSCALL(regs, val) ((regs)->gpr[0] = (val)) | ||
| 88 | |||
| 89 | #endif /* !__ASSEMBLY__ */ | ||
| 90 | |||
| 91 | |||
| 92 | /* The number of bytes used to store each register. */ | ||
| 93 | #define _PT_REG_SIZE 4 | ||
| 94 | |||
| 95 | /* Offset of a general purpose register in a struct pt_regs. */ | ||
| 96 | #define PT_GPR(num) ((num) * _PT_REG_SIZE) | ||
| 97 | |||
| 98 | /* Offsets of various special registers & fields in a struct pt_regs. */ | ||
| 99 | #define PT_PC ((NUM_GPRS + 0) * _PT_REG_SIZE) | ||
| 100 | #define PT_PSW ((NUM_GPRS + 1) * _PT_REG_SIZE) | ||
| 101 | #define PT_CTPC ((NUM_GPRS + 2) * _PT_REG_SIZE) | ||
| 102 | #define PT_CTPSW ((NUM_GPRS + 3) * _PT_REG_SIZE) | ||
| 103 | #define PT_CTBP ((NUM_GPRS + 4) * _PT_REG_SIZE) | ||
| 104 | #define PT_KERNEL_MODE ((NUM_GPRS + 5) * _PT_REG_SIZE) | ||
| 105 | |||
| 106 | /* Where the current syscall number is stashed; obviously only valid in | ||
| 107 | the kernel! */ | ||
| 108 | #define PT_CUR_SYSCALL PT_GPR(0) | ||
| 109 | |||
| 110 | /* Size of struct pt_regs, including alignment. */ | ||
| 111 | #define PT_SIZE ((NUM_GPRS + 6) * _PT_REG_SIZE) | ||
| 112 | |||
| 113 | |||
| 114 | /* These are `magic' values for PTRACE_PEEKUSR that return info about where | ||
| 115 | a process is located in memory. */ | ||
| 116 | #define PT_TEXT_ADDR (PT_SIZE + 1) | ||
| 117 | #define PT_TEXT_LEN (PT_SIZE + 2) | ||
| 118 | #define PT_DATA_ADDR (PT_SIZE + 3) | ||
| 119 | |||
| 120 | |||
| 121 | #endif /* __V850_PTRACE_H__ */ | ||
diff --git a/include/asm-v850/resource.h b/include/asm-v850/resource.h deleted file mode 100644 index 4b9dcd44f8d1..000000000000 --- a/include/asm-v850/resource.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_RESOURCE_H__ | ||
| 2 | #define __V850_RESOURCE_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/resource.h> | ||
| 5 | |||
| 6 | #endif /* __V850_RESOURCE_H__ */ | ||
diff --git a/include/asm-v850/rte_cb.h b/include/asm-v850/rte_cb.h deleted file mode 100644 index db9879f00aa7..000000000000 --- a/include/asm-v850/rte_cb.h +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/rte_cb.h -- Midas labs RTE-CB series of evaluation boards | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_RTE_CB_H__ | ||
| 15 | #define __V850_RTE_CB_H__ | ||
| 16 | |||
| 17 | |||
| 18 | /* The SRAM on the Mother-A motherboard. */ | ||
| 19 | #define MB_A_SRAM_ADDR GCS0_ADDR | ||
| 20 | #define MB_A_SRAM_SIZE 0x00200000 /* 2MB */ | ||
| 21 | |||
| 22 | |||
| 23 | #ifdef CONFIG_RTE_GBUS_INT | ||
| 24 | /* GBUS interrupt support. */ | ||
| 25 | |||
| 26 | # include <asm/gbus_int.h> | ||
| 27 | |||
| 28 | # define GBUS_INT_BASE_IRQ NUM_RTE_CB_IRQS | ||
| 29 | # define GBUS_INT_BASE_ADDR (GCS2_ADDR + 0x00006000) | ||
| 30 | |||
| 31 | /* Some specific interrupts. */ | ||
| 32 | # define IRQ_MB_A_LAN IRQ_GBUS_INT(10) | ||
| 33 | # define IRQ_MB_A_PCI1(n) (IRQ_GBUS_INT(16) + (n)) | ||
| 34 | # define IRQ_MB_A_PCI1_NUM 4 | ||
| 35 | # define IRQ_MB_A_PCI2(n) (IRQ_GBUS_INT(20) + (n)) | ||
| 36 | # define IRQ_MB_A_PCI2_NUM 4 | ||
| 37 | # define IRQ_MB_A_EXT(n) (IRQ_GBUS_INT(24) + (n)) | ||
| 38 | # define IRQ_MB_A_EXT_NUM 4 | ||
| 39 | # define IRQ_MB_A_USB_OC(n) (IRQ_GBUS_INT(28) + (n)) | ||
| 40 | # define IRQ_MB_A_USB_OC_NUM 2 | ||
| 41 | # define IRQ_MB_A_PCMCIA_OC IRQ_GBUS_INT(30) | ||
| 42 | |||
| 43 | /* We define NUM_MACH_IRQS to include extra interrupts from the GBUS. */ | ||
| 44 | # define NUM_MACH_IRQS (NUM_RTE_CB_IRQS + IRQ_GBUS_INT_NUM) | ||
| 45 | |||
| 46 | #else /* !CONFIG_RTE_GBUS_INT */ | ||
| 47 | |||
| 48 | # define NUM_MACH_IRQS NUM_RTE_CB_IRQS | ||
| 49 | |||
| 50 | #endif /* CONFIG_RTE_GBUS_INT */ | ||
| 51 | |||
| 52 | |||
| 53 | #ifdef CONFIG_RTE_MB_A_PCI | ||
| 54 | /* Mother-A PCI bus support. */ | ||
| 55 | |||
| 56 | # include <asm/rte_mb_a_pci.h> | ||
| 57 | |||
| 58 | /* These are the base addresses used for allocating device address | ||
| 59 | space. 512K of the motherboard SRAM is in the same space, so we have | ||
| 60 | to be careful not to let it be allocated. */ | ||
| 61 | # define PCIBIOS_MIN_MEM (MB_A_PCI_MEM_ADDR + 0x80000) | ||
| 62 | # define PCIBIOS_MIN_IO MB_A_PCI_IO_ADDR | ||
| 63 | |||
| 64 | /* As we don't really support PCI DMA to cpu memory, and use bounce-buffers | ||
| 65 | instead, perversely enough, this becomes always true! */ | ||
| 66 | # define pci_dma_supported(dev, mask) 1 | ||
| 67 | # define pcibios_assign_all_busses() 1 | ||
| 68 | |||
| 69 | #endif /* CONFIG_RTE_MB_A_PCI */ | ||
| 70 | |||
| 71 | |||
| 72 | #ifndef __ASSEMBLY__ | ||
| 73 | extern void rte_cb_early_init (void); | ||
| 74 | extern void rte_cb_init_irqs (void); | ||
| 75 | #endif /* !__ASSEMBLY__ */ | ||
| 76 | |||
| 77 | |||
| 78 | #endif /* __V850_RTE_CB_H__ */ | ||
diff --git a/include/asm-v850/rte_ma1_cb.h b/include/asm-v850/rte_ma1_cb.h deleted file mode 100644 index bd3162ab9844..000000000000 --- a/include/asm-v850/rte_ma1_cb.h +++ /dev/null | |||
| @@ -1,128 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/rte_ma1_cb.h -- Midas labs RTE-V850/MA1-CB board | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_RTE_MA1_CB_H__ | ||
| 15 | #define __V850_RTE_MA1_CB_H__ | ||
| 16 | |||
| 17 | #include <asm/rte_cb.h> /* Common defs for Midas RTE-CB boards. */ | ||
| 18 | |||
| 19 | |||
| 20 | #define PLATFORM "rte-v850e/ma1-cb" | ||
| 21 | #define PLATFORM_LONG "Midas lab RTE-V850E/MA1-CB" | ||
| 22 | |||
| 23 | #define CPU_CLOCK_FREQ 50000000 /* 50MHz */ | ||
| 24 | |||
| 25 | /* 1MB of onboard SRAM. Note that the monitor ROM uses parts of this | ||
| 26 | for its own purposes, so care must be taken. Some address lines are | ||
| 27 | not decoded, so the SRAM area is mirrored every 1MB from 0x400000 to | ||
| 28 | 0x800000 (exclusive). */ | ||
| 29 | #define SRAM_ADDR 0x00400000 | ||
| 30 | #define SRAM_SIZE 0x00100000 /* 1MB */ | ||
| 31 | |||
| 32 | /* 32MB of onbard SDRAM. */ | ||
| 33 | #define SDRAM_ADDR 0x00800000 | ||
| 34 | #define SDRAM_SIZE 0x02000000 /* 32MB */ | ||
| 35 | |||
| 36 | |||
| 37 | /* CPU addresses of GBUS memory spaces. */ | ||
| 38 | #define GCS0_ADDR 0x05000000 /* GCS0 - Common SRAM (2MB) */ | ||
| 39 | #define GCS0_SIZE 0x00200000 /* 2MB */ | ||
| 40 | #define GCS1_ADDR 0x06000000 /* GCS1 - Flash ROM (8MB) */ | ||
| 41 | #define GCS1_SIZE 0x00800000 /* 8MB */ | ||
| 42 | #define GCS2_ADDR 0x07900000 /* GCS2 - I/O registers */ | ||
| 43 | #define GCS2_SIZE 0x00400000 /* 4MB */ | ||
| 44 | #define GCS5_ADDR 0x04000000 /* GCS5 - PCI bus space */ | ||
| 45 | #define GCS5_SIZE 0x01000000 /* 16MB */ | ||
| 46 | #define GCS6_ADDR 0x07980000 /* GCS6 - PCI control registers */ | ||
| 47 | #define GCS6_SIZE 0x00000200 /* 512B */ | ||
| 48 | |||
| 49 | |||
| 50 | /* For <asm/page.h> */ | ||
| 51 | #define PAGE_OFFSET SRAM_ADDR | ||
| 52 | |||
| 53 | |||
| 54 | /* The GBUS GINT0 - GINT3 interrupts are connected to the INTP000 - INTP011 | ||
| 55 | pins on the CPU. These are shared among the GBUS interrupts. */ | ||
| 56 | #define IRQ_GINT(n) IRQ_INTP(n) | ||
| 57 | #define IRQ_GINT_NUM 4 | ||
| 58 | |||
| 59 | /* Used by <asm/rte_cb.h> to derive NUM_MACH_IRQS. */ | ||
| 60 | #define NUM_RTE_CB_IRQS NUM_CPU_IRQS | ||
| 61 | |||
| 62 | |||
| 63 | #ifdef CONFIG_ROM_KERNEL | ||
| 64 | /* Kernel is in ROM, starting at address 0. */ | ||
| 65 | |||
| 66 | #define INTV_BASE 0 | ||
| 67 | |||
| 68 | #else /* !CONFIG_ROM_KERNEL */ | ||
| 69 | |||
| 70 | #ifdef CONFIG_RTE_CB_MULTI | ||
| 71 | /* Using RAM kernel with ROM monitor for Multi debugger. */ | ||
| 72 | |||
| 73 | /* The chip's real interrupt vectors are in ROM, but they jump to a | ||
| 74 | secondary interrupt vector table in RAM. */ | ||
| 75 | #define INTV_BASE 0x004F8000 | ||
| 76 | |||
| 77 | /* Scratch memory used by the ROM monitor, which shouldn't be used by | ||
| 78 | linux (except for the alternate interrupt vector area, defined | ||
| 79 | above). */ | ||
| 80 | #define MON_SCRATCH_ADDR 0x004F8000 | ||
| 81 | #define MON_SCRATCH_SIZE 0x00008000 /* 32KB */ | ||
| 82 | |||
| 83 | #else /* !CONFIG_RTE_CB_MULTI */ | ||
| 84 | /* Using RAM-kernel. Assume some sort of boot-loader got us loaded at | ||
| 85 | address 0. */ | ||
| 86 | |||
| 87 | #define INTV_BASE 0 | ||
| 88 | |||
| 89 | #endif /* CONFIG_RTE_CB_MULTI */ | ||
| 90 | |||
| 91 | #endif /* CONFIG_ROM_KERNEL */ | ||
| 92 | |||
| 93 | |||
| 94 | /* Some misc. on-board devices. */ | ||
| 95 | |||
| 96 | /* Seven-segment LED display (two digits). Write-only. */ | ||
| 97 | #define LED_ADDR(n) (0x07802000 + (n)) | ||
| 98 | #define LED(n) (*(volatile unsigned char *)LED_ADDR(n)) | ||
| 99 | #define LED_NUM_DIGITS 2 | ||
| 100 | |||
| 101 | |||
| 102 | /* Override the basic MA uart pre-initialization so that we can | ||
| 103 | initialize extra stuff. */ | ||
| 104 | #undef V850E_UART_PRE_CONFIGURE /* should be defined by <asm/ma.h> */ | ||
| 105 | #define V850E_UART_PRE_CONFIGURE rte_ma1_cb_uart_pre_configure | ||
| 106 | #ifndef __ASSEMBLY__ | ||
| 107 | extern void rte_ma1_cb_uart_pre_configure (unsigned chan, | ||
| 108 | unsigned cflags, unsigned baud); | ||
| 109 | #endif | ||
| 110 | |||
| 111 | /* This board supports RTS/CTS for the on-chip UART, but only for channel 0. */ | ||
| 112 | |||
| 113 | /* CTS for UART channel 0 is pin P43 (bit 3 of port 4). */ | ||
| 114 | #define V850E_UART_CTS(chan) ((chan) == 0 ? !(MA_PORT4_IO & 0x8) : 1) | ||
| 115 | /* RTS for UART channel 0 is pin P42 (bit 2 of port 4). */ | ||
| 116 | #define V850E_UART_SET_RTS(chan, val) \ | ||
| 117 | do { \ | ||
| 118 | if (chan == 0) { \ | ||
| 119 | unsigned old = MA_PORT4_IO; \ | ||
| 120 | if (val) \ | ||
| 121 | MA_PORT4_IO = old & ~0x4; \ | ||
| 122 | else \ | ||
| 123 | MA_PORT4_IO = old | 0x4; \ | ||
| 124 | } \ | ||
| 125 | } while (0) | ||
| 126 | |||
| 127 | |||
| 128 | #endif /* __V850_RTE_MA1_CB_H__ */ | ||
diff --git a/include/asm-v850/rte_mb_a_pci.h b/include/asm-v850/rte_mb_a_pci.h deleted file mode 100644 index 41ac185ca9cd..000000000000 --- a/include/asm-v850/rte_mb_a_pci.h +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/mb_a_pci.h -- PCI support for Midas lab RTE-MOTHER-A board | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001 NEC Corporation | ||
| 5 | * Copyright (C) 2001 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_MB_A_PCI_H__ | ||
| 15 | #define __V850_MB_A_PCI_H__ | ||
| 16 | |||
| 17 | |||
| 18 | #define MB_A_PCI_MEM_ADDR GCS5_ADDR | ||
| 19 | #define MB_A_PCI_MEM_SIZE (GCS5_SIZE / 2) | ||
| 20 | #define MB_A_PCI_IO_ADDR (GCS5_ADDR + MB_A_PCI_MEM_SIZE) | ||
| 21 | #define MB_A_PCI_IO_SIZE (GCS5_SIZE / 2) | ||
| 22 | #define MB_A_PCI_REG_BASE_ADDR GCS6_ADDR | ||
| 23 | |||
| 24 | #define MB_A_PCI_PCICR_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x4) | ||
| 25 | #define MB_A_PCI_PCICR (*(volatile u16 *)MB_A_PCI_PCICR_ADDR) | ||
| 26 | #define MB_A_PCI_PCISR_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x6) | ||
| 27 | #define MB_A_PCI_PCISR (*(volatile u16 *)MB_A_PCI_PCISR_ADDR) | ||
| 28 | #define MB_A_PCI_PCILTR_ADDR (MB_A_PCI_REG_BASE_ADDR + 0xD) | ||
| 29 | #define MB_A_PCI_PCILTR (*(volatile u8 *)MB_A_PCI_PCILTR_ADDR) | ||
| 30 | #define MB_A_PCI_PCIBAR0_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x10) | ||
| 31 | #define MB_A_PCI_PCIBAR0 (*(volatile u32 *)MB_A_PCI_PCIBAR0_ADDR) | ||
| 32 | #define MB_A_PCI_PCIBAR1_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x14) | ||
| 33 | #define MB_A_PCI_PCIBAR1 (*(volatile u32 *)MB_A_PCI_PCIBAR1_ADDR) | ||
| 34 | #define MB_A_PCI_PCIBAR2_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x18) | ||
| 35 | #define MB_A_PCI_PCIBAR2 (*(volatile u32 *)MB_A_PCI_PCIBAR2_ADDR) | ||
| 36 | #define MB_A_PCI_VENDOR_ID_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x2C) | ||
| 37 | #define MB_A_PCI_VENDOR_ID (*(volatile u16 *)MB_A_PCI_VENDOR_ID_ADDR) | ||
| 38 | #define MB_A_PCI_DEVICE_ID_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x2E) | ||
| 39 | #define MB_A_PCI_DEVICE_ID (*(volatile u16 *)MB_A_PCI_DEVICE_ID_ADDR) | ||
| 40 | #define MB_A_PCI_DMRR_ADDR (MB_A_PCI_REG_BASE_ADDR + 0x9C) | ||
| 41 | #define MB_A_PCI_DMRR (*(volatile u32 *)MB_A_PCI_DMRR_ADDR) | ||
| 42 | #define MB_A_PCI_DMLBAM_ADDR (MB_A_PCI_REG_BASE_ADDR + 0xA0) | ||
| 43 | #define MB_A_PCI_DMLBAM (*(volatile u32 *)MB_A_PCI_DMLBAM_ADDR) | ||
| 44 | #define MB_A_PCI_DMLBAI_ADDR (MB_A_PCI_REG_BASE_ADDR + 0xA4) | ||
| 45 | #define MB_A_PCI_DMLBAI (*(volatile u32 *)MB_A_PCI_DMLBAI_ADDR) | ||
| 46 | #define MB_A_PCI_PCIPBAM_ADDR (MB_A_PCI_REG_BASE_ADDR + 0xA8) | ||
| 47 | #define MB_A_PCI_PCIPBAM (*(volatile u32 *)MB_A_PCI_PCIPBAM_ADDR) | ||
| 48 | /* `PCI Configuration Address Register for Direct Master to PCI IO/CFG' */ | ||
| 49 | #define MB_A_PCI_DMCFGA_ADDR (MB_A_PCI_REG_BASE_ADDR + 0xAC) | ||
| 50 | #define MB_A_PCI_DMCFGA (*(volatile u32 *)MB_A_PCI_DMCFGA_ADDR) | ||
| 51 | /* `PCI Permanent Configuration ID Register' */ | ||
| 52 | #define MB_A_PCI_PCIHIDR_ADDR (MB_A_PCI_REG_BASE_ADDR + 0xF0) | ||
| 53 | #define MB_A_PCI_PCIHIDR (*(volatile u32 *)MB_A_PCI_PCIHIDR_ADDR) | ||
| 54 | |||
| 55 | |||
| 56 | #endif /* __V850_MB_A_PCI_H__ */ | ||
diff --git a/include/asm-v850/rte_me2_cb.h b/include/asm-v850/rte_me2_cb.h deleted file mode 100644 index 9922c85c85a8..000000000000 --- a/include/asm-v850/rte_me2_cb.h +++ /dev/null | |||
| @@ -1,202 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/rte_me2_cb.h -- Midas labs RTE-V850E/ME2-CB board | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_RTE_ME2_CB_H__ | ||
| 15 | #define __V850_RTE_ME2_CB_H__ | ||
| 16 | |||
| 17 | #include <asm/rte_cb.h> /* Common defs for Midas RTE-CB boards. */ | ||
| 18 | |||
| 19 | |||
| 20 | #define PLATFORM "rte-v850e/me2-cb" | ||
| 21 | #define PLATFORM_LONG "Midas lab RTE-V850E/ME2-CB" | ||
| 22 | |||
| 23 | #define CPU_CLOCK_FREQ 150000000 /* 150MHz */ | ||
| 24 | #define FIXED_BOGOMIPS 50 | ||
| 25 | |||
| 26 | /* 32MB of onbard SDRAM. */ | ||
| 27 | #define SDRAM_ADDR 0x00800000 | ||
| 28 | #define SDRAM_SIZE 0x02000000 /* 32MB */ | ||
| 29 | |||
| 30 | |||
| 31 | /* CPU addresses of GBUS memory spaces. */ | ||
| 32 | #define GCS0_ADDR 0x04000000 /* GCS0 - Common SRAM (2MB) */ | ||
| 33 | #define GCS0_SIZE 0x00800000 /* 8MB */ | ||
| 34 | #define GCS1_ADDR 0x04800000 /* GCS1 - Flash ROM (8MB) */ | ||
| 35 | #define GCS1_SIZE 0x00800000 /* 8MB */ | ||
| 36 | #define GCS2_ADDR 0x07000000 /* GCS2 - I/O registers */ | ||
| 37 | #define GCS2_SIZE 0x00800000 /* 8MB */ | ||
| 38 | #define GCS5_ADDR 0x08000000 /* GCS5 - PCI bus space */ | ||
| 39 | #define GCS5_SIZE 0x02000000 /* 32MB */ | ||
| 40 | #define GCS6_ADDR 0x07800000 /* GCS6 - PCI control registers */ | ||
| 41 | #define GCS6_SIZE 0x00800000 /* 8MB */ | ||
| 42 | |||
| 43 | |||
| 44 | /* For <asm/page.h> */ | ||
| 45 | #define PAGE_OFFSET SDRAM_ADDR | ||
| 46 | |||
| 47 | |||
| 48 | #ifdef CONFIG_ROM_KERNEL | ||
| 49 | /* Kernel is in ROM, starting at address 0. */ | ||
| 50 | |||
| 51 | #define INTV_BASE 0 | ||
| 52 | #define ROOT_FS_IMAGE_RW 0 | ||
| 53 | |||
| 54 | #else /* !CONFIG_ROM_KERNEL */ | ||
| 55 | /* Using RAM-kernel. Assume some sort of boot-loader got us loaded at | ||
| 56 | address 0. */ | ||
| 57 | |||
| 58 | #define INTV_BASE 0 | ||
| 59 | #define ROOT_FS_IMAGE_RW 1 | ||
| 60 | |||
| 61 | #endif /* CONFIG_ROM_KERNEL */ | ||
| 62 | |||
| 63 | |||
| 64 | /* Some misc. on-board devices. */ | ||
| 65 | |||
| 66 | /* Seven-segment LED display (four digits). */ | ||
| 67 | #define LED_ADDR(n) (0x0FE02000 + (n)) | ||
| 68 | #define LED(n) (*(volatile unsigned char *)LED_ADDR(n)) | ||
| 69 | #define LED_NUM_DIGITS 4 | ||
| 70 | |||
| 71 | |||
| 72 | /* On-board PIC. */ | ||
| 73 | |||
| 74 | #define CB_PIC_BASE_ADDR 0x0FE04000 | ||
| 75 | |||
| 76 | #define CB_PIC_INT0M_ADDR (CB_PIC_BASE_ADDR + 0x00) | ||
| 77 | #define CB_PIC_INT0M (*(volatile u16 *)CB_PIC_INT0M_ADDR) | ||
| 78 | #define CB_PIC_INT1M_ADDR (CB_PIC_BASE_ADDR + 0x10) | ||
| 79 | #define CB_PIC_INT1M (*(volatile u16 *)CB_PIC_INT1M_ADDR) | ||
| 80 | #define CB_PIC_INTR_ADDR (CB_PIC_BASE_ADDR + 0x20) | ||
| 81 | #define CB_PIC_INTR (*(volatile u16 *)CB_PIC_INTR_ADDR) | ||
| 82 | #define CB_PIC_INTEN_ADDR (CB_PIC_BASE_ADDR + 0x30) | ||
| 83 | #define CB_PIC_INTEN (*(volatile u16 *)CB_PIC_INTEN_ADDR) | ||
| 84 | |||
| 85 | #define CB_PIC_INT0EN 0x0001 | ||
| 86 | #define CB_PIC_INT1EN 0x0002 | ||
| 87 | #define CB_PIC_INT0SEL 0x0080 | ||
| 88 | |||
| 89 | /* The PIC interrupts themselves. */ | ||
| 90 | #define CB_PIC_BASE_IRQ NUM_CPU_IRQS | ||
| 91 | #define IRQ_CB_PIC_NUM 10 | ||
| 92 | |||
| 93 | /* Some specific CB_PIC interrupts. */ | ||
| 94 | #define IRQ_CB_EXTTM0 (CB_PIC_BASE_IRQ + 0) | ||
| 95 | #define IRQ_CB_EXTSIO (CB_PIC_BASE_IRQ + 1) | ||
| 96 | #define IRQ_CB_TOVER (CB_PIC_BASE_IRQ + 2) | ||
| 97 | #define IRQ_CB_GINT0 (CB_PIC_BASE_IRQ + 3) | ||
| 98 | #define IRQ_CB_USB (CB_PIC_BASE_IRQ + 4) | ||
| 99 | #define IRQ_CB_LANC (CB_PIC_BASE_IRQ + 5) | ||
| 100 | #define IRQ_CB_USB_VBUS_ON (CB_PIC_BASE_IRQ + 6) | ||
| 101 | #define IRQ_CB_USB_VBUS_OFF (CB_PIC_BASE_IRQ + 7) | ||
| 102 | #define IRQ_CB_EXTTM1 (CB_PIC_BASE_IRQ + 8) | ||
| 103 | #define IRQ_CB_EXTTM2 (CB_PIC_BASE_IRQ + 9) | ||
| 104 | |||
| 105 | /* The GBUS GINT1 - GINT3 (note, not GINT0!) interrupts are connected to | ||
| 106 | the INTP65 - INTP67 pins on the CPU. These are shared among the GBUS | ||
| 107 | interrupts. */ | ||
| 108 | #define IRQ_GINT(n) IRQ_INTP((n) + 9) /* 0 is unused! */ | ||
| 109 | #define IRQ_GINT_NUM 4 /* 0 is unused! */ | ||
| 110 | |||
| 111 | /* The shared interrupt line from the PIC is connected to CPU pin INTP23. */ | ||
| 112 | #define IRQ_CB_PIC IRQ_INTP(4) /* P23 */ | ||
| 113 | |||
| 114 | /* Used by <asm/rte_cb.h> to derive NUM_MACH_IRQS. */ | ||
| 115 | #define NUM_RTE_CB_IRQS (NUM_CPU_IRQS + IRQ_CB_PIC_NUM) | ||
| 116 | |||
| 117 | |||
| 118 | #ifndef __ASSEMBLY__ | ||
| 119 | struct cb_pic_irq_init { | ||
| 120 | const char *name; /* name of interrupt type */ | ||
| 121 | |||
| 122 | /* Range of kernel irq numbers for this type: | ||
| 123 | BASE, BASE+INTERVAL, ..., BASE+INTERVAL*NUM */ | ||
| 124 | unsigned base, num, interval; | ||
| 125 | |||
| 126 | unsigned priority; /* interrupt priority to assign */ | ||
| 127 | }; | ||
| 128 | struct hw_interrupt_type; /* fwd decl */ | ||
| 129 | |||
| 130 | /* Enable interrupt handling for interrupt IRQ. */ | ||
| 131 | extern void cb_pic_enable_irq (unsigned irq); | ||
| 132 | /* Disable interrupt handling for interrupt IRQ. Note that any interrupts | ||
| 133 | received while disabled will be delivered once the interrupt is enabled | ||
| 134 | again, unless they are explicitly cleared using `cb_pic_clear_pending_irq'. */ | ||
| 135 | extern void cb_pic_disable_irq (unsigned irq); | ||
| 136 | /* Initialize HW_IRQ_TYPES for PIC irqs described in array INITS (which is | ||
| 137 | terminated by an entry with the name field == 0). */ | ||
| 138 | extern void cb_pic_init_irq_types (struct cb_pic_irq_init *inits, | ||
| 139 | struct hw_interrupt_type *hw_irq_types); | ||
| 140 | /* Initialize PIC interrupts. */ | ||
| 141 | extern void cb_pic_init_irqs (void); | ||
| 142 | #endif /* __ASSEMBLY__ */ | ||
| 143 | |||
| 144 | |||
| 145 | /* TL16C550C on board UART see also asm/serial.h */ | ||
| 146 | #define CB_UART_BASE 0x0FE08000 | ||
| 147 | #define CB_UART_REG_GAP 0x10 | ||
| 148 | #define CB_UART_CLOCK 0x16000000 | ||
| 149 | |||
| 150 | /* CompactFlash setting */ | ||
| 151 | #define CB_CF_BASE 0x0FE0C000 | ||
| 152 | #define CB_CF_CCR_ADDR (CB_CF_BASE+0x200) | ||
| 153 | #define CB_CF_CCR (*(volatile u8 *)CB_CF_CCR_ADDR) | ||
| 154 | #define CB_CF_REG0_ADDR (CB_CF_BASE+0x1000) | ||
| 155 | #define CB_CF_REG0 (*(volatile u16 *)CB_CF_REG0_ADDR) | ||
| 156 | #define CB_CF_STS0_ADDR (CB_CF_BASE+0x1004) | ||
| 157 | #define CB_CF_STS0 (*(volatile u16 *)CB_CF_STS0_ADDR) | ||
| 158 | #define CB_PCATA_BASE (CB_CF_BASE+0x800) | ||
| 159 | #define CB_IDE_BASE (CB_CF_BASE+0x9F0) | ||
| 160 | #define CB_IDE_CTRL (CB_CF_BASE+0xBF6) | ||
| 161 | #define CB_IDE_REG_OFFS 0x1 | ||
| 162 | |||
| 163 | |||
| 164 | /* SMSC LAN91C111 setting */ | ||
| 165 | #if defined(CONFIG_SMC91111) | ||
| 166 | #define CB_LANC_BASE 0x0FE10300 | ||
| 167 | #define CONFIG_SMC16BITONLY | ||
| 168 | #define ETH0_ADDR CB_LANC_BASE | ||
| 169 | #define ETH0_IRQ IRQ_CB_LANC | ||
| 170 | #endif /* CONFIG_SMC16BITONLY */ | ||
| 171 | |||
| 172 | |||
| 173 | #undef V850E_UART_PRE_CONFIGURE | ||
| 174 | #define V850E_UART_PRE_CONFIGURE rte_me2_cb_uart_pre_configure | ||
| 175 | #ifndef __ASSEMBLY__ | ||
| 176 | extern void rte_me2_cb_uart_pre_configure (unsigned chan, | ||
| 177 | unsigned cflags, unsigned baud); | ||
| 178 | #endif /* __ASSEMBLY__ */ | ||
| 179 | |||
| 180 | /* This board supports RTS/CTS for the on-chip UART, but only for channel 0. */ | ||
| 181 | |||
| 182 | /* CTS for UART channel 0 is pin P22 (bit 2 of port 2). */ | ||
| 183 | #define V850E_UART_CTS(chan) ((chan) == 0 ? !(ME2_PORT2_IO & 0x4) : 1) | ||
| 184 | /* RTS for UART channel 0 is pin P21 (bit 1 of port 2). */ | ||
| 185 | #define V850E_UART_SET_RTS(chan, val) \ | ||
| 186 | do { \ | ||
| 187 | if (chan == 0) { \ | ||
| 188 | unsigned old = ME2_PORT2_IO; \ | ||
| 189 | if (val) \ | ||
| 190 | ME2_PORT2_IO = old & ~0x2; \ | ||
| 191 | else \ | ||
| 192 | ME2_PORT2_IO = old | 0x2; \ | ||
| 193 | } \ | ||
| 194 | } while (0) | ||
| 195 | |||
| 196 | |||
| 197 | #ifndef __ASSEMBLY__ | ||
| 198 | extern void rte_me2_cb_init_irqs (void); | ||
| 199 | #endif /* !__ASSEMBLY__ */ | ||
| 200 | |||
| 201 | |||
| 202 | #endif /* __V850_RTE_ME2_CB_H__ */ | ||
diff --git a/include/asm-v850/rte_nb85e_cb.h b/include/asm-v850/rte_nb85e_cb.h deleted file mode 100644 index f56591cad90a..000000000000 --- a/include/asm-v850/rte_nb85e_cb.h +++ /dev/null | |||
| @@ -1,111 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/rte_nb85e_cb.h -- Midas labs RTE-V850/NB85E-CB board | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_RTE_NB85E_CB_H__ | ||
| 15 | #define __V850_RTE_NB85E_CB_H__ | ||
| 16 | |||
| 17 | #include <asm/rte_cb.h> /* Common defs for Midas RTE-CB boards. */ | ||
| 18 | |||
| 19 | |||
| 20 | #define PLATFORM "rte-v850e/nb85e-cb" | ||
| 21 | #define PLATFORM_LONG "Midas lab RTE-V850E/NB85E-CB" | ||
| 22 | |||
| 23 | #define CPU_CLOCK_FREQ 50000000 /* 50MHz */ | ||
| 24 | |||
| 25 | /* 1MB of onboard SRAM. Note that the monitor ROM uses parts of this | ||
| 26 | for its own purposes, so care must be taken. */ | ||
| 27 | #define SRAM_ADDR 0x03C00000 | ||
| 28 | #define SRAM_SIZE 0x00100000 /* 1MB */ | ||
| 29 | |||
| 30 | /* 16MB of onbard SDRAM. */ | ||
| 31 | #define SDRAM_ADDR 0x01000000 | ||
| 32 | #define SDRAM_SIZE 0x01000000 /* 16MB */ | ||
| 33 | |||
| 34 | |||
| 35 | /* CPU addresses of GBUS memory spaces. */ | ||
| 36 | #define GCS0_ADDR 0x00400000 /* GCS0 - Common SRAM (2MB) */ | ||
| 37 | #define GCS0_SIZE 0x00400000 /* 4MB */ | ||
| 38 | #define GCS1_ADDR 0x02000000 /* GCS1 - Flash ROM (8MB) */ | ||
| 39 | #define GCS1_SIZE 0x00800000 /* 8MB */ | ||
| 40 | #define GCS2_ADDR 0x03900000 /* GCS2 - I/O registers */ | ||
| 41 | #define GCS2_SIZE 0x00080000 /* 512KB */ | ||
| 42 | #define GCS3_ADDR 0x02800000 /* GCS3 - EXT-bus: memory space */ | ||
| 43 | #define GCS3_SIZE 0x00800000 /* 8MB */ | ||
| 44 | #define GCS4_ADDR 0x03A00000 /* GCS4 - EXT-bus: I/O space */ | ||
| 45 | #define GCS4_SIZE 0x00200000 /* 2MB */ | ||
| 46 | #define GCS5_ADDR 0x00800000 /* GCS5 - PCI bus space */ | ||
| 47 | #define GCS5_SIZE 0x00800000 /* 8MB */ | ||
| 48 | #define GCS6_ADDR 0x03980000 /* GCS6 - PCI control registers */ | ||
| 49 | #define GCS6_SIZE 0x00010000 /* 64KB */ | ||
| 50 | |||
| 51 | |||
| 52 | /* The GBUS GINT0 - GINT3 interrupts are connected to CPU interrupts 10-12. | ||
| 53 | These are shared among the GBUS interrupts. */ | ||
| 54 | #define IRQ_GINT(n) (10 + (n)) | ||
| 55 | #define IRQ_GINT_NUM 3 | ||
| 56 | |||
| 57 | /* Used by <asm/rte_cb.h> to derive NUM_MACH_IRQS. */ | ||
| 58 | #define NUM_RTE_CB_IRQS NUM_CPU_IRQS | ||
| 59 | |||
| 60 | |||
| 61 | #ifdef CONFIG_ROM_KERNEL | ||
| 62 | /* Kernel is in ROM, starting at address 0. */ | ||
| 63 | |||
| 64 | #define INTV_BASE 0 | ||
| 65 | |||
| 66 | #else /* !CONFIG_ROM_KERNEL */ | ||
| 67 | /* We're using the ROM monitor. */ | ||
| 68 | |||
| 69 | /* The chip's real interrupt vectors are in ROM, but they jump to a | ||
| 70 | secondary interrupt vector table in RAM. */ | ||
| 71 | #define INTV_BASE 0x03CF8000 | ||
| 72 | |||
| 73 | /* Scratch memory used by the ROM monitor, which shouldn't be used by | ||
| 74 | linux (except for the alternate interrupt vector area, defined | ||
| 75 | above). */ | ||
| 76 | #define MON_SCRATCH_ADDR 0x03CE8000 | ||
| 77 | #define MON_SCRATCH_SIZE 0x00018000 /* 96KB */ | ||
| 78 | |||
| 79 | #endif /* CONFIG_ROM_KERNEL */ | ||
| 80 | |||
| 81 | |||
| 82 | /* Some misc. on-board devices. */ | ||
| 83 | |||
| 84 | /* Seven-segment LED display (two digits). Write-only. */ | ||
| 85 | #define LED_ADDR(n) (0x03802000 + (n)) | ||
| 86 | #define LED(n) (*(volatile unsigned char *)LED_ADDR(n)) | ||
| 87 | #define LED_NUM_DIGITS 4 | ||
| 88 | |||
| 89 | |||
| 90 | /* Override the basic TEG UART pre-initialization so that we can | ||
| 91 | initialize extra stuff. */ | ||
| 92 | #undef V850E_UART_PRE_CONFIGURE /* should be defined by <asm/teg.h> */ | ||
| 93 | #define V850E_UART_PRE_CONFIGURE rte_nb85e_cb_uart_pre_configure | ||
| 94 | #ifndef __ASSEMBLY__ | ||
| 95 | extern void rte_nb85e_cb_uart_pre_configure (unsigned chan, | ||
| 96 | unsigned cflags, unsigned baud); | ||
| 97 | #endif | ||
| 98 | |||
| 99 | /* This board supports RTS/CTS for the on-chip UART. */ | ||
| 100 | |||
| 101 | /* CTS is pin P00. */ | ||
| 102 | #define V850E_UART_CTS(chan) (! (TEG_PORT0_IO & 0x1)) | ||
| 103 | /* RTS is pin P02. */ | ||
| 104 | #define V850E_UART_SET_RTS(chan, val) \ | ||
| 105 | do { \ | ||
| 106 | unsigned old = TEG_PORT0_IO; \ | ||
| 107 | TEG_PORT0_IO = val ? (old & ~0x4) : (old | 0x4); \ | ||
| 108 | } while (0) | ||
| 109 | |||
| 110 | |||
| 111 | #endif /* __V850_RTE_NB85E_CB_H__ */ | ||
diff --git a/include/asm-v850/scatterlist.h b/include/asm-v850/scatterlist.h deleted file mode 100644 index 02d27b3fb061..000000000000 --- a/include/asm-v850/scatterlist.h +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/scatterlist.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_SCATTERLIST_H__ | ||
| 15 | #define __V850_SCATTERLIST_H__ | ||
| 16 | |||
| 17 | #include <asm/types.h> | ||
| 18 | |||
| 19 | struct scatterlist { | ||
| 20 | #ifdef CONFIG_DEBUG_SG | ||
| 21 | unsigned long sg_magic; | ||
| 22 | #endif | ||
| 23 | unsigned long page_link; | ||
| 24 | unsigned offset; | ||
| 25 | dma_addr_t dma_address; | ||
| 26 | unsigned length; | ||
| 27 | }; | ||
| 28 | |||
| 29 | #define ISA_DMA_THRESHOLD (~0UL) | ||
| 30 | |||
| 31 | #endif /* __V850_SCATTERLIST_H__ */ | ||
diff --git a/include/asm-v850/sections.h b/include/asm-v850/sections.h deleted file mode 100644 index e0238253a0d0..000000000000 --- a/include/asm-v850/sections.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_SECTIONS_H__ | ||
| 2 | #define __V850_SECTIONS_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/sections.h> | ||
| 5 | |||
| 6 | #endif /* __V850_SECTIONS_H__ */ | ||
diff --git a/include/asm-v850/segment.h b/include/asm-v850/segment.h deleted file mode 100644 index 5e2b15dcf3d9..000000000000 --- a/include/asm-v850/segment.h +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | #ifndef __V850_SEGMENT_H__ | ||
| 2 | #define __V850_SEGMENT_H__ | ||
| 3 | |||
| 4 | |||
| 5 | #ifndef __ASSEMBLY__ | ||
| 6 | |||
| 7 | typedef unsigned long mm_segment_t; /* domain register */ | ||
| 8 | |||
| 9 | #endif /* !__ASSEMBLY__ */ | ||
| 10 | |||
| 11 | |||
| 12 | #define __KERNEL_CS 0x0 | ||
| 13 | #define __KERNEL_DS 0x0 | ||
| 14 | |||
| 15 | #define __USER_CS 0x1 | ||
| 16 | #define __USER_DS 0x1 | ||
| 17 | |||
| 18 | #define KERNEL_DS __KERNEL_DS | ||
| 19 | #define KERNEL_CS __KERNEL_CS | ||
| 20 | #define USER_DS __USER_DS | ||
| 21 | #define USER_CS __USER_CS | ||
| 22 | |||
| 23 | #define segment_eq(a,b) ((a) == (b)) | ||
| 24 | |||
| 25 | #define get_ds() (KERNEL_DS) | ||
| 26 | #define get_fs() (USER_DS) | ||
| 27 | |||
| 28 | #define set_fs(seg) ((void)(seg)) | ||
| 29 | |||
| 30 | |||
| 31 | #define copy_segments(task, mm) ((void)((void)(task), (mm))) | ||
| 32 | #define release_segments(mm) ((void)(mm)) | ||
| 33 | #define forget_segments() ((void)0) | ||
| 34 | |||
| 35 | |||
| 36 | #endif /* __V850_SEGMENT_H__ */ | ||
diff --git a/include/asm-v850/semaphore.h b/include/asm-v850/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-v850/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-v850/sembuf.h b/include/asm-v850/sembuf.h deleted file mode 100644 index 1622231a8b85..000000000000 --- a/include/asm-v850/sembuf.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | #ifndef __V850_SEMBUF_H__ | ||
| 2 | #define __V850_SEMBUF_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The semid64_ds structure for v850 architecture. | ||
| 6 | * Note extra padding because this structure is passed back and forth | ||
| 7 | * between kernel and user space. | ||
| 8 | * | ||
| 9 | * Pad space is left for: | ||
| 10 | * - 64-bit time_t to solve y2038 problem | ||
| 11 | * - 2 miscellaneous 32-bit values | ||
| 12 | */ | ||
| 13 | |||
| 14 | struct semid64_ds { | ||
| 15 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | ||
| 16 | __kernel_time_t sem_otime; /* last semop time */ | ||
| 17 | unsigned long __unused1; | ||
| 18 | __kernel_time_t sem_ctime; /* last change time */ | ||
| 19 | unsigned long __unused2; | ||
| 20 | unsigned long sem_nsems; /* no. of semaphores in array */ | ||
| 21 | unsigned long __unused3; | ||
| 22 | unsigned long __unused4; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif /* __V850_SEMBUF_H__ */ | ||
diff --git a/include/asm-v850/serial.h b/include/asm-v850/serial.h deleted file mode 100644 index 36d8f4cbbf39..000000000000 --- a/include/asm-v850/serial.h +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 3 | * License. See the file "COPYING" in the main directory of this archive | ||
| 4 | * for more details. | ||
| 5 | * | ||
| 6 | * Copyright (C) 1999 by Ralf Baechle | ||
| 7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifdef CONFIG_RTE_CB_ME2 | ||
| 11 | |||
| 12 | #include <asm/rte_me2_cb.h> | ||
| 13 | |||
| 14 | #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) | ||
| 15 | |||
| 16 | #define irq_cannonicalize(x) (x) | ||
| 17 | #define BASE_BAUD 250000 /* (16MHz / (16 * 38400)) * 9600 */ | ||
| 18 | #define SERIAL_PORT_DFNS \ | ||
| 19 | { 0, BASE_BAUD, CB_UART_BASE, IRQ_CB_EXTSIO, STD_COM_FLAGS }, | ||
| 20 | |||
| 21 | /* Redefine UART register offsets. */ | ||
| 22 | #undef UART_RX | ||
| 23 | #undef UART_TX | ||
| 24 | #undef UART_DLL | ||
| 25 | #undef UART_TRG | ||
| 26 | #undef UART_DLM | ||
| 27 | #undef UART_IER | ||
| 28 | #undef UART_FCTR | ||
| 29 | #undef UART_IIR | ||
| 30 | #undef UART_FCR | ||
| 31 | #undef UART_EFR | ||
| 32 | #undef UART_LCR | ||
| 33 | #undef UART_MCR | ||
| 34 | #undef UART_LSR | ||
| 35 | #undef UART_MSR | ||
| 36 | #undef UART_SCR | ||
| 37 | #undef UART_EMSR | ||
| 38 | |||
| 39 | #define UART_RX (0 * CB_UART_REG_GAP) | ||
| 40 | #define UART_TX (0 * CB_UART_REG_GAP) | ||
| 41 | #define UART_DLL (0 * CB_UART_REG_GAP) | ||
| 42 | #define UART_TRG (0 * CB_UART_REG_GAP) | ||
| 43 | #define UART_DLM (1 * CB_UART_REG_GAP) | ||
| 44 | #define UART_IER (1 * CB_UART_REG_GAP) | ||
| 45 | #define UART_FCTR (1 * CB_UART_REG_GAP) | ||
| 46 | #define UART_IIR (2 * CB_UART_REG_GAP) | ||
| 47 | #define UART_FCR (2 * CB_UART_REG_GAP) | ||
| 48 | #define UART_EFR (2 * CB_UART_REG_GAP) | ||
| 49 | #define UART_LCR (3 * CB_UART_REG_GAP) | ||
| 50 | #define UART_MCR (4 * CB_UART_REG_GAP) | ||
| 51 | #define UART_LSR (5 * CB_UART_REG_GAP) | ||
| 52 | #define UART_MSR (6 * CB_UART_REG_GAP) | ||
| 53 | #define UART_SCR (7 * CB_UART_REG_GAP) | ||
| 54 | #define UART_EMSR (7 * CB_UART_REG_GAP) | ||
| 55 | |||
| 56 | #endif /* CONFIG_RTE_CB_ME2 */ | ||
diff --git a/include/asm-v850/setup.h b/include/asm-v850/setup.h deleted file mode 100644 index c48a9b97d05b..000000000000 --- a/include/asm-v850/setup.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef _V850_SETUP_H | ||
| 2 | #define _V850_SETUP_H | ||
| 3 | |||
| 4 | #define COMMAND_LINE_SIZE 512 | ||
| 5 | |||
| 6 | #endif /* __SETUP_H */ | ||
diff --git a/include/asm-v850/shmbuf.h b/include/asm-v850/shmbuf.h deleted file mode 100644 index 3d085c9c418e..000000000000 --- a/include/asm-v850/shmbuf.h +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | #ifndef __V850_SHMBUF_H__ | ||
| 2 | #define __V850_SHMBUF_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * The shmid64_ds structure for v850 architecture. | ||
| 6 | * Note extra padding because this structure is passed back and forth | ||
| 7 | * between kernel and user space. | ||
| 8 | * | ||
| 9 | * Pad space is left for: | ||
| 10 | * - 64-bit time_t to solve y2038 problem | ||
| 11 | * - 2 miscellaneous 32-bit values | ||
| 12 | */ | ||
| 13 | |||
| 14 | struct shmid64_ds { | ||
| 15 | struct ipc64_perm shm_perm; /* operation perms */ | ||
| 16 | size_t shm_segsz; /* size of segment (bytes) */ | ||
| 17 | __kernel_time_t shm_atime; /* last attach time */ | ||
| 18 | unsigned long __unused1; | ||
| 19 | __kernel_time_t shm_dtime; /* last detach time */ | ||
| 20 | unsigned long __unused2; | ||
| 21 | __kernel_time_t shm_ctime; /* last change time */ | ||
| 22 | unsigned long __unused3; | ||
| 23 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
| 24 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
| 25 | unsigned long shm_nattch; /* no. of current attaches */ | ||
| 26 | unsigned long __unused4; | ||
| 27 | unsigned long __unused5; | ||
| 28 | }; | ||
| 29 | |||
| 30 | struct shminfo64 { | ||
| 31 | unsigned long shmmax; | ||
| 32 | unsigned long shmmin; | ||
| 33 | unsigned long shmmni; | ||
| 34 | unsigned long shmseg; | ||
| 35 | unsigned long shmall; | ||
| 36 | unsigned long __unused1; | ||
| 37 | unsigned long __unused2; | ||
| 38 | unsigned long __unused3; | ||
| 39 | unsigned long __unused4; | ||
| 40 | }; | ||
| 41 | |||
| 42 | #endif /* __V850_SHMBUF_H__ */ | ||
diff --git a/include/asm-v850/shmparam.h b/include/asm-v850/shmparam.h deleted file mode 100644 index 7dcb6739073e..000000000000 --- a/include/asm-v850/shmparam.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_SHMPARAM_H__ | ||
| 2 | #define __V850_SHMPARAM_H__ | ||
| 3 | |||
| 4 | #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ | ||
| 5 | |||
| 6 | #endif /* __V850_SHMPARAM_H__ */ | ||
diff --git a/include/asm-v850/sigcontext.h b/include/asm-v850/sigcontext.h deleted file mode 100644 index e0890f6f4bc9..000000000000 --- a/include/asm-v850/sigcontext.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/sigcontext.h -- Signal contexts | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001 NEC Corporation | ||
| 5 | * Copyright (C) 2001 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_SIGCONTEXT_H__ | ||
| 15 | #define __V850_SIGCONTEXT_H__ | ||
| 16 | |||
| 17 | #include <asm/ptrace.h> | ||
| 18 | |||
| 19 | struct sigcontext | ||
| 20 | { | ||
| 21 | struct pt_regs regs; | ||
| 22 | unsigned long oldmask; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif /* __V850_SIGCONTEXT_H__ */ | ||
diff --git a/include/asm-v850/siginfo.h b/include/asm-v850/siginfo.h deleted file mode 100644 index 7eb94703dce0..000000000000 --- a/include/asm-v850/siginfo.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_SIGINFO_H__ | ||
| 2 | #define __V850_SIGINFO_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/siginfo.h> | ||
| 5 | |||
| 6 | #endif /* __V850_SIGINFO_H__ */ | ||
diff --git a/include/asm-v850/signal.h b/include/asm-v850/signal.h deleted file mode 100644 index a38df0834bbf..000000000000 --- a/include/asm-v850/signal.h +++ /dev/null | |||
| @@ -1,168 +0,0 @@ | |||
| 1 | #ifndef __V850_SIGNAL_H__ | ||
| 2 | #define __V850_SIGNAL_H__ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | /* Avoid too many header ordering problems. */ | ||
| 7 | struct siginfo; | ||
| 8 | |||
| 9 | |||
| 10 | #ifdef __KERNEL__ | ||
| 11 | |||
| 12 | /* Most things should be clean enough to redefine this at will, if care | ||
| 13 | is taken to make libc match. */ | ||
| 14 | #define _NSIG 64 | ||
| 15 | #define _NSIG_BPW 32 | ||
| 16 | #define _NSIG_WORDS (_NSIG / _NSIG_BPW) | ||
| 17 | |||
| 18 | typedef unsigned long old_sigset_t; /* at least 32 bits */ | ||
| 19 | |||
| 20 | typedef struct { | ||
| 21 | unsigned long sig[_NSIG_WORDS]; | ||
| 22 | } sigset_t; | ||
| 23 | |||
| 24 | #else /* !__KERNEL__ */ | ||
| 25 | |||
| 26 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
| 27 | |||
| 28 | #define NSIG 32 | ||
| 29 | typedef unsigned long sigset_t; | ||
| 30 | |||
| 31 | #endif /* __KERNEL__ */ | ||
| 32 | |||
| 33 | |||
| 34 | #define SIGHUP 1 | ||
| 35 | #define SIGINT 2 | ||
| 36 | #define SIGQUIT 3 | ||
| 37 | #define SIGILL 4 | ||
| 38 | #define SIGTRAP 5 | ||
| 39 | #define SIGABRT 6 | ||
| 40 | #define SIGIOT 6 | ||
| 41 | #define SIGBUS 7 | ||
| 42 | #define SIGFPE 8 | ||
| 43 | #define SIGKILL 9 | ||
| 44 | #define SIGUSR1 10 | ||
| 45 | #define SIGSEGV 11 | ||
| 46 | #define SIGUSR2 12 | ||
| 47 | #define SIGPIPE 13 | ||
| 48 | #define SIGALRM 14 | ||
| 49 | #define SIGTERM 15 | ||
| 50 | #define SIGSTKFLT 16 | ||
| 51 | #define SIGCHLD 17 | ||
| 52 | #define SIGCONT 18 | ||
| 53 | #define SIGSTOP 19 | ||
| 54 | #define SIGTSTP 20 | ||
| 55 | #define SIGTTIN 21 | ||
| 56 | #define SIGTTOU 22 | ||
| 57 | #define SIGURG 23 | ||
| 58 | #define SIGXCPU 24 | ||
| 59 | #define SIGXFSZ 25 | ||
| 60 | #define SIGVTALRM 26 | ||
| 61 | #define SIGPROF 27 | ||
| 62 | #define SIGWINCH 28 | ||
| 63 | #define SIGIO 29 | ||
| 64 | #define SIGPOLL SIGIO | ||
| 65 | /* | ||
| 66 | #define SIGLOST 29 | ||
| 67 | */ | ||
| 68 | #define SIGPWR 30 | ||
| 69 | #define SIGSYS 31 | ||
| 70 | #define SIGUNUSED 31 | ||
| 71 | |||
| 72 | /* These should not be considered constants from userland. */ | ||
| 73 | #define SIGRTMIN 32 | ||
| 74 | #define SIGRTMAX _NSIG | ||
| 75 | |||
| 76 | /* | ||
| 77 | * SA_FLAGS values: | ||
| 78 | * | ||
| 79 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
| 80 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
| 81 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
| 82 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
| 83 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
| 84 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
| 85 | * | ||
| 86 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
| 87 | * Unix names RESETHAND and NODEFER respectively. | ||
| 88 | */ | ||
| 89 | #define SA_NOCLDSTOP 0x00000001 | ||
| 90 | #define SA_NOCLDWAIT 0x00000002 | ||
| 91 | #define SA_SIGINFO 0x00000004 | ||
| 92 | #define SA_ONSTACK 0x08000000 | ||
| 93 | #define SA_RESTART 0x10000000 | ||
| 94 | #define SA_NODEFER 0x40000000 | ||
| 95 | #define SA_RESETHAND 0x80000000 | ||
| 96 | |||
| 97 | #define SA_NOMASK SA_NODEFER | ||
| 98 | #define SA_ONESHOT SA_RESETHAND | ||
| 99 | |||
| 100 | #define SA_RESTORER 0x04000000 | ||
| 101 | |||
| 102 | /* | ||
| 103 | * sigaltstack controls | ||
| 104 | */ | ||
| 105 | #define SS_ONSTACK 1 | ||
| 106 | #define SS_DISABLE 2 | ||
| 107 | |||
| 108 | #define MINSIGSTKSZ 2048 | ||
| 109 | #define SIGSTKSZ 8192 | ||
| 110 | |||
| 111 | #include <asm-generic/signal.h> | ||
| 112 | |||
| 113 | #ifdef __KERNEL__ | ||
| 114 | |||
| 115 | struct old_sigaction { | ||
| 116 | __sighandler_t sa_handler; | ||
| 117 | old_sigset_t sa_mask; | ||
| 118 | unsigned long sa_flags; | ||
| 119 | void (*sa_restorer)(void); | ||
| 120 | }; | ||
| 121 | |||
| 122 | struct sigaction { | ||
| 123 | __sighandler_t sa_handler; | ||
| 124 | unsigned long sa_flags; | ||
| 125 | void (*sa_restorer)(void); | ||
| 126 | sigset_t sa_mask; /* mask last for extensibility */ | ||
| 127 | }; | ||
| 128 | |||
| 129 | struct k_sigaction { | ||
| 130 | struct sigaction sa; | ||
| 131 | }; | ||
| 132 | |||
| 133 | #else /* !__KERNEL__ */ | ||
| 134 | |||
| 135 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
| 136 | |||
| 137 | struct sigaction { | ||
| 138 | union { | ||
| 139 | __sighandler_t _sa_handler; | ||
| 140 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
| 141 | } _u; | ||
| 142 | sigset_t sa_mask; | ||
| 143 | unsigned long sa_flags; | ||
| 144 | void (*sa_restorer)(void); | ||
| 145 | }; | ||
| 146 | |||
| 147 | #define sa_handler _u._sa_handler | ||
| 148 | #define sa_sigaction _u._sa_sigaction | ||
| 149 | |||
| 150 | #endif /* __KERNEL__ */ | ||
| 151 | |||
| 152 | |||
| 153 | typedef struct sigaltstack { | ||
| 154 | void *ss_sp; | ||
| 155 | int ss_flags; | ||
| 156 | size_t ss_size; | ||
| 157 | } stack_t; | ||
| 158 | |||
| 159 | #ifdef __KERNEL__ | ||
| 160 | |||
| 161 | #include <asm/sigcontext.h> | ||
| 162 | #undef __HAVE_ARCH_SIG_BITOPS | ||
| 163 | |||
| 164 | #define ptrace_signal_deliver(regs, cookie) do { } while (0) | ||
| 165 | |||
| 166 | #endif /* __KERNEL__ */ | ||
| 167 | |||
| 168 | #endif /* __V850_SIGNAL_H__ */ | ||
diff --git a/include/asm-v850/sim.h b/include/asm-v850/sim.h deleted file mode 100644 index 026932d476cd..000000000000 --- a/include/asm-v850/sim.h +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/sim.h -- Machine-dependent defs for GDB v850e simulator | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_SIM_H__ | ||
| 15 | #define __V850_SIM_H__ | ||
| 16 | |||
| 17 | |||
| 18 | #define CPU_ARCH "v850e" | ||
| 19 | #define CPU_MODEL "v850e" | ||
| 20 | #define CPU_MODEL_LONG "NEC V850E" | ||
| 21 | #define PLATFORM "gdb/v850e" | ||
| 22 | #define PLATFORM_LONG "GDB V850E simulator" | ||
| 23 | |||
| 24 | |||
| 25 | /* We use a weird value for RAM, not just 0, for testing purposes. | ||
| 26 | These must match the values used in the linker script. */ | ||
| 27 | #define RAM_ADDR 0x8F000000 | ||
| 28 | #define RAM_SIZE 0x03000000 | ||
| 29 | |||
| 30 | |||
| 31 | /* For <asm/page.h> */ | ||
| 32 | #define PAGE_OFFSET RAM_ADDR | ||
| 33 | |||
| 34 | |||
| 35 | /* For <asm/entry.h> */ | ||
| 36 | /* `R0 RAM', used for a few miscellaneous variables that must be | ||
| 37 | accessible using a load instruction relative to R0. On real | ||
| 38 | processors, this usually is on-chip RAM, but here we just | ||
| 39 | choose an arbitrary address that meets the above constraint. */ | ||
| 40 | #define R0_RAM_ADDR 0xFFFFF000 | ||
| 41 | |||
| 42 | |||
| 43 | /* For <asm/irq.h> */ | ||
| 44 | #define NUM_CPU_IRQS 6 | ||
| 45 | |||
| 46 | |||
| 47 | #endif /* __V850_SIM_H__ */ | ||
diff --git a/include/asm-v850/sim85e2.h b/include/asm-v850/sim85e2.h deleted file mode 100644 index 8b4d6974066c..000000000000 --- a/include/asm-v850/sim85e2.h +++ /dev/null | |||
| @@ -1,69 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/sim85e2.h -- Machine-dependent defs for | ||
| 3 | * V850E2 RTL simulator | ||
| 4 | * | ||
| 5 | * Copyright (C) 2002,03 NEC Electronics Corporation | ||
| 6 | * Copyright (C) 2002,03 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __V850_SIM85E2_H__ | ||
| 16 | #define __V850_SIM85E2_H__ | ||
| 17 | |||
| 18 | |||
| 19 | #include <asm/v850e2.h> /* Based on V850E2 core. */ | ||
| 20 | |||
| 21 | |||
| 22 | /* Various memory areas supported by the simulator. | ||
| 23 | These should match the corresponding definitions in the linker script. */ | ||
| 24 | |||
| 25 | /* `instruction RAM'; instruction fetches are much faster from IRAM than | ||
| 26 | from DRAM. */ | ||
| 27 | #define IRAM_ADDR 0 | ||
| 28 | #define IRAM_SIZE 0x00100000 /* 1MB */ | ||
| 29 | /* `data RAM', below and contiguous with the I/O space. | ||
| 30 | Data fetches are much faster from DRAM than from IRAM. */ | ||
| 31 | #define DRAM_ADDR 0xfff00000 | ||
| 32 | #define DRAM_SIZE 0x000ff000 /* 1020KB */ | ||
| 33 | /* `external ram'. Unlike the above RAM areas, this memory is cached, | ||
| 34 | so both instruction and data fetches should be (mostly) fast -- | ||
| 35 | however, currently only write-through caching is supported, so writes | ||
| 36 | to ERAM will be slow. */ | ||
| 37 | #define ERAM_ADDR 0x00100000 | ||
| 38 | #define ERAM_SIZE 0x07f00000 /* 127MB (max) */ | ||
| 39 | /* Dynamic RAM; uses memory controller. */ | ||
| 40 | #define SDRAM_ADDR 0x10000000 | ||
| 41 | #define SDRAM_SIZE 0x01000000 /* 16MB */ | ||
| 42 | |||
| 43 | |||
| 44 | /* Simulator specific control registers. */ | ||
| 45 | /* NOTHAL controls whether the simulator will stop at a `halt' insn. */ | ||
| 46 | #define SIM85E2_NOTHAL_ADDR 0xffffff22 | ||
| 47 | #define SIM85E2_NOTHAL (*(volatile u8 *)SIM85E2_NOTHAL_ADDR) | ||
| 48 | /* The simulator will stop N cycles after N is written to SIMFIN. */ | ||
| 49 | #define SIM85E2_SIMFIN_ADDR 0xffffff24 | ||
| 50 | #define SIM85E2_SIMFIN (*(volatile u16 *)SIM85E2_SIMFIN_ADDR) | ||
| 51 | |||
| 52 | |||
| 53 | /* For <asm/irq.h> */ | ||
| 54 | #define NUM_CPU_IRQS 64 | ||
| 55 | |||
| 56 | |||
| 57 | /* For <asm/page.h> */ | ||
| 58 | #define PAGE_OFFSET SDRAM_ADDR | ||
| 59 | |||
| 60 | |||
| 61 | /* For <asm/entry.h> */ | ||
| 62 | /* `R0 RAM', used for a few miscellaneous variables that must be accessible | ||
| 63 | using a load instruction relative to R0. The sim85e2 simulator | ||
| 64 | actually puts 1020K of RAM from FFF00000 to FFFFF000, so we arbitarily | ||
| 65 | choose a small portion at the end of that. */ | ||
| 66 | #define R0_RAM_ADDR 0xFFFFE000 | ||
| 67 | |||
| 68 | |||
| 69 | #endif /* __V850_SIM85E2_H__ */ | ||
diff --git a/include/asm-v850/sim85e2c.h b/include/asm-v850/sim85e2c.h deleted file mode 100644 index eee543ff3af8..000000000000 --- a/include/asm-v850/sim85e2c.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/sim85e2c.h -- Machine-dependent defs for | ||
| 3 | * V850E2 RTL simulator | ||
| 4 | * | ||
| 5 | * Copyright (C) 2002 NEC Corporation | ||
| 6 | * Copyright (C) 2002 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __V850_SIM85E2C_H__ | ||
| 16 | #define __V850_SIM85E2C_H__ | ||
| 17 | |||
| 18 | /* Use generic sim85e2 settings, other than the various names. */ | ||
| 19 | #include <asm/sim85e2.h> | ||
| 20 | |||
| 21 | #define CPU_MODEL "v850e2" | ||
| 22 | #define CPU_MODEL_LONG "NEC V850E2" | ||
| 23 | #define PLATFORM "sim85e2c" | ||
| 24 | #define PLATFORM_LONG "SIM85E2C V850E2 simulator" | ||
| 25 | |||
| 26 | #endif /* __V850_SIM85E2C_H__ */ | ||
diff --git a/include/asm-v850/sim85e2s.h b/include/asm-v850/sim85e2s.h deleted file mode 100644 index ee066d5d3c51..000000000000 --- a/include/asm-v850/sim85e2s.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/sim85e2s.h -- Machine-dependent defs for | ||
| 3 | * V850E2 RTL simulator | ||
| 4 | * | ||
| 5 | * Copyright (C) 2003 NEC Electronics Corporation | ||
| 6 | * Copyright (C) 2003 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __V850_SIM85E2S_H__ | ||
| 16 | #define __V850_SIM85E2S_H__ | ||
| 17 | |||
| 18 | #include <asm/sim85e2.h> /* Use generic sim85e2 settings. */ | ||
| 19 | #if 0 | ||
| 20 | #include <asm/v850e2_cache.h> /* + cache */ | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #define CPU_MODEL "v850e2" | ||
| 24 | #define CPU_MODEL_LONG "NEC V850E2" | ||
| 25 | #define PLATFORM "sim85e2s" | ||
| 26 | #define PLATFORM_LONG "SIM85E2S V850E2 simulator" | ||
| 27 | |||
| 28 | #endif /* __V850_SIM85E2S_H__ */ | ||
diff --git a/include/asm-v850/simsyscall.h b/include/asm-v850/simsyscall.h deleted file mode 100644 index 4a19d5ae9d17..000000000000 --- a/include/asm-v850/simsyscall.h +++ /dev/null | |||
| @@ -1,99 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/simsyscall.h -- `System calls' under the v850e emulator | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001 NEC Corporation | ||
| 5 | * Copyright (C) 2001 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_SIMSYSCALL_H__ | ||
| 15 | #define __V850_SIMSYSCALL_H__ | ||
| 16 | |||
| 17 | #define V850_SIM_SYS_exit(a...) V850_SIM_SYSCALL_1 (1 , ##a) | ||
| 18 | #define V850_SIM_SYS_fork(a...) V850_SIM_SYSCALL_0 (2 , ##a) | ||
| 19 | #define V850_SIM_SYS_read(a...) V850_SIM_SYSCALL_3 (3 , ##a) | ||
| 20 | #define V850_SIM_SYS_write(a...) V850_SIM_SYSCALL_3 (4 , ##a) | ||
| 21 | #define V850_SIM_SYS_open(a...) V850_SIM_SYSCALL_2 (5 , ##a) | ||
| 22 | #define V850_SIM_SYS_close(a...) V850_SIM_SYSCALL_1 (6 , ##a) | ||
| 23 | #define V850_SIM_SYS_wait4(a...) V850_SIM_SYSCALL_4 (7 , ##a) | ||
| 24 | /* #define V850_SIM_SYS_creat(a...) V850_SIM_SYSCALL_1 (8 , ##a) */ | ||
| 25 | /* #define V850_SIM_SYS_link(a...) V850_SIM_SYSCALL_1 (9 , ##a) */ | ||
| 26 | /* #define V850_SIM_SYS_unlink(a...) V850_SIM_SYSCALL_1 (10 , ##a) */ | ||
| 27 | #define V850_SIM_SYS_execv(a...) V850_SIM_SYSCALL_2 (11 , ##a) | ||
| 28 | /* #define V850_SIM_SYS_chdir(a...) V850_SIM_SYSCALL_1 (12 , ##a) */ | ||
| 29 | /* #define V850_SIM_SYS_mknod(a...) V850_SIM_SYSCALL_1 (14 , ##a) */ | ||
| 30 | #define V850_SIM_SYS_chmod(a...) V850_SIM_SYSCALL_2 (15 , ##a) | ||
| 31 | #define V850_SIM_SYS_chown(a...) V850_SIM_SYSCALL_2 (16 , ##a) | ||
| 32 | #define V850_SIM_SYS_lseek(a...) V850_SIM_SYSCALL_3 (19 , ##a) | ||
| 33 | /* #define V850_SIM_SYS_getpid(a...) V850_SIM_SYSCALL_1 (20 , ##a) */ | ||
| 34 | /* #define V850_SIM_SYS_isatty(a...) V850_SIM_SYSCALL_1 (21 , ##a) */ | ||
| 35 | /* #define V850_SIM_SYS_fstat(a...) V850_SIM_SYSCALL_1 (22 , ##a) */ | ||
| 36 | #define V850_SIM_SYS_time(a...) V850_SIM_SYSCALL_1 (23 , ##a) | ||
| 37 | #define V850_SIM_SYS_poll(a...) V850_SIM_SYSCALL_3 (24 , ##a) | ||
| 38 | #define V850_SIM_SYS_stat(a...) V850_SIM_SYSCALL_2 (38 , ##a) | ||
| 39 | #define V850_SIM_SYS_pipe(a...) V850_SIM_SYSCALL_1 (42 , ##a) | ||
| 40 | #define V850_SIM_SYS_times(a...) V850_SIM_SYSCALL_1 (43 , ##a) | ||
| 41 | #define V850_SIM_SYS_execve(a...) V850_SIM_SYSCALL_3 (59 , ##a) | ||
| 42 | #define V850_SIM_SYS_gettimeofday(a...) V850_SIM_SYSCALL_2 (116 , ##a) | ||
| 43 | /* #define V850_SIM_SYS_utime(a...) V850_SIM_SYSCALL_2 (201 , ##a) */ | ||
| 44 | /* #define V850_SIM_SYS_wait(a...) V850_SIM_SYSCALL_1 (202 , ##a) */ | ||
| 45 | |||
| 46 | #define V850_SIM_SYS_make_raw(a...) V850_SIM_SYSCALL_1 (1024 , ##a) | ||
| 47 | |||
| 48 | |||
| 49 | #define V850_SIM_SYSCALL_0(_call) \ | ||
| 50 | ({ \ | ||
| 51 | register int call __asm__ ("r6") = _call; \ | ||
| 52 | register int rval __asm__ ("r10"); \ | ||
| 53 | __asm__ __volatile__ ("trap 31" \ | ||
| 54 | : "=r" (rval) \ | ||
| 55 | : "r" (call) \ | ||
| 56 | : "r11", "memory"); \ | ||
| 57 | rval; \ | ||
| 58 | }) | ||
| 59 | #define V850_SIM_SYSCALL_1(_call, _arg0) \ | ||
| 60 | ({ \ | ||
| 61 | register int call __asm__ ("r6") = _call; \ | ||
| 62 | register long arg0 __asm__ ("r7") = (long)_arg0; \ | ||
| 63 | register int rval __asm__ ("r10"); \ | ||
| 64 | __asm__ __volatile__ ("trap 31" \ | ||
| 65 | : "=r" (rval) \ | ||
| 66 | : "r" (call), "r" (arg0) \ | ||
| 67 | : "r11", "memory"); \ | ||
| 68 | rval; \ | ||
| 69 | }) | ||
| 70 | #define V850_SIM_SYSCALL_2(_call, _arg0, _arg1) \ | ||
| 71 | ({ \ | ||
| 72 | register int call __asm__ ("r6") = _call; \ | ||
| 73 | register long arg0 __asm__ ("r7") = (long)_arg0; \ | ||
| 74 | register long arg1 __asm__ ("r8") = (long)_arg1; \ | ||
| 75 | register int rval __asm__ ("r10"); \ | ||
| 76 | __asm__ __volatile__ ("trap 31" \ | ||
| 77 | : "=r" (rval) \ | ||
| 78 | : "r" (call), "r" (arg0), "r" (arg1) \ | ||
| 79 | : "r11", "memory"); \ | ||
| 80 | rval; \ | ||
| 81 | }) | ||
| 82 | #define V850_SIM_SYSCALL_3(_call, _arg0, _arg1, _arg2) \ | ||
| 83 | ({ \ | ||
| 84 | register int call __asm__ ("r6") = _call; \ | ||
| 85 | register long arg0 __asm__ ("r7") = (long)_arg0; \ | ||
| 86 | register long arg1 __asm__ ("r8") = (long)_arg1; \ | ||
| 87 | register long arg2 __asm__ ("r9") = (long)_arg2; \ | ||
| 88 | register int rval __asm__ ("r10"); \ | ||
| 89 | __asm__ __volatile__ ("trap 31" \ | ||
| 90 | : "=r" (rval) \ | ||
| 91 | : "r" (call), "r" (arg0), "r" (arg1), "r" (arg2)\ | ||
| 92 | : "r11", "memory"); \ | ||
| 93 | rval; \ | ||
| 94 | }) | ||
| 95 | |||
| 96 | #define V850_SIM_SYSCALL(call, args...) \ | ||
| 97 | V850_SIM_SYS_##call (args) | ||
| 98 | |||
| 99 | #endif /* __V850_SIMSYSCALL_H__ */ | ||
diff --git a/include/asm-v850/socket.h b/include/asm-v850/socket.h deleted file mode 100644 index e199a2bf12aa..000000000000 --- a/include/asm-v850/socket.h +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | #ifndef __V850_SOCKET_H__ | ||
| 2 | #define __V850_SOCKET_H__ | ||
| 3 | |||
| 4 | #include <asm/sockios.h> | ||
| 5 | |||
| 6 | /* For setsockoptions(2) */ | ||
| 7 | #define SOL_SOCKET 1 | ||
| 8 | |||
| 9 | #define SO_DEBUG 1 | ||
| 10 | #define SO_REUSEADDR 2 | ||
| 11 | #define SO_TYPE 3 | ||
| 12 | #define SO_ERROR 4 | ||
| 13 | #define SO_DONTROUTE 5 | ||
| 14 | #define SO_BROADCAST 6 | ||
| 15 | #define SO_SNDBUF 7 | ||
| 16 | #define SO_RCVBUF 8 | ||
| 17 | #define SO_SNDBUFFORCE 32 | ||
| 18 | #define SO_RCVBUFFORCE 33 | ||
| 19 | #define SO_KEEPALIVE 9 | ||
| 20 | #define SO_OOBINLINE 10 | ||
| 21 | #define SO_NO_CHECK 11 | ||
| 22 | #define SO_PRIORITY 12 | ||
| 23 | #define SO_LINGER 13 | ||
| 24 | #define SO_BSDCOMPAT 14 | ||
| 25 | /* To add :#define SO_REUSEPORT 15 */ | ||
| 26 | #define SO_PASSCRED 16 | ||
| 27 | #define SO_PEERCRED 17 | ||
| 28 | #define SO_RCVLOWAT 18 | ||
| 29 | #define SO_SNDLOWAT 19 | ||
| 30 | #define SO_RCVTIMEO 20 | ||
| 31 | #define SO_SNDTIMEO 21 | ||
| 32 | |||
| 33 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | ||
| 34 | #define SO_SECURITY_AUTHENTICATION 22 | ||
| 35 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 | ||
| 36 | #define SO_SECURITY_ENCRYPTION_NETWORK 24 | ||
| 37 | |||
| 38 | #define SO_BINDTODEVICE 25 | ||
| 39 | |||
| 40 | /* Socket filtering */ | ||
| 41 | #define SO_ATTACH_FILTER 26 | ||
| 42 | #define SO_DETACH_FILTER 27 | ||
| 43 | |||
| 44 | #define SO_PEERNAME 28 | ||
| 45 | #define SO_TIMESTAMP 29 | ||
| 46 | #define SCM_TIMESTAMP SO_TIMESTAMP | ||
| 47 | |||
| 48 | #define SO_ACCEPTCONN 30 | ||
| 49 | |||
| 50 | #define SO_PEERSEC 31 | ||
| 51 | #define SO_PASSSEC 34 | ||
| 52 | #define SO_TIMESTAMPNS 35 | ||
| 53 | #define SCM_TIMESTAMPNS SO_TIMESTAMPNS | ||
| 54 | |||
| 55 | #define SO_MARK 36 | ||
| 56 | |||
| 57 | #endif /* __V850_SOCKET_H__ */ | ||
diff --git a/include/asm-v850/sockios.h b/include/asm-v850/sockios.h deleted file mode 100644 index 823e106e6cd0..000000000000 --- a/include/asm-v850/sockios.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #ifndef __V850_SOCKIOS_H__ | ||
| 2 | #define __V850_SOCKIOS_H__ | ||
| 3 | |||
| 4 | /* Socket-level I/O control calls. */ | ||
| 5 | #define FIOSETOWN 0x8901 | ||
| 6 | #define SIOCSPGRP 0x8902 | ||
| 7 | #define FIOGETOWN 0x8903 | ||
| 8 | #define SIOCGPGRP 0x8904 | ||
| 9 | #define SIOCATMARK 0x8905 | ||
| 10 | #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
| 11 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
| 12 | |||
| 13 | #endif /* __V850_SOCKIOS_H__ */ | ||
diff --git a/include/asm-v850/stat.h b/include/asm-v850/stat.h deleted file mode 100644 index c68c60d06e2f..000000000000 --- a/include/asm-v850/stat.h +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/stat.h -- v850 stat structure | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_STAT_H__ | ||
| 15 | #define __V850_STAT_H__ | ||
| 16 | |||
| 17 | #include <asm/posix_types.h> | ||
| 18 | |||
| 19 | struct stat { | ||
| 20 | unsigned int st_dev; | ||
| 21 | unsigned long st_ino; | ||
| 22 | unsigned int st_mode; | ||
| 23 | unsigned int st_nlink; | ||
| 24 | unsigned int st_uid; | ||
| 25 | unsigned int st_gid; | ||
| 26 | unsigned int st_rdev; | ||
| 27 | long st_size; | ||
| 28 | unsigned long st_blksize; | ||
| 29 | unsigned long st_blocks; | ||
| 30 | unsigned long st_atime; | ||
| 31 | unsigned long __unused1; | ||
| 32 | unsigned long st_mtime; | ||
| 33 | unsigned long __unused2; | ||
| 34 | unsigned long st_ctime; | ||
| 35 | unsigned long __unused3; | ||
| 36 | unsigned long __unused4; | ||
| 37 | unsigned long __unused5; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct stat64 { | ||
| 41 | unsigned long long st_dev; | ||
| 42 | unsigned long __unused1; | ||
| 43 | |||
| 44 | unsigned long long st_ino; | ||
| 45 | |||
| 46 | unsigned int st_mode; | ||
| 47 | unsigned int st_nlink; | ||
| 48 | |||
| 49 | unsigned int st_uid; | ||
| 50 | unsigned int st_gid; | ||
| 51 | |||
| 52 | unsigned long long st_rdev; | ||
| 53 | unsigned long __unused3; | ||
| 54 | |||
| 55 | long long st_size; | ||
| 56 | unsigned long st_blksize; | ||
| 57 | |||
| 58 | unsigned long st_blocks; /* No. of 512-byte blocks allocated */ | ||
| 59 | unsigned long __unused4; /* future possible st_blocks high bits */ | ||
| 60 | |||
| 61 | unsigned long st_atime; | ||
| 62 | unsigned long st_atime_nsec; | ||
| 63 | |||
| 64 | unsigned long st_mtime; | ||
| 65 | unsigned long st_mtime_nsec; | ||
| 66 | |||
| 67 | unsigned long st_ctime; | ||
| 68 | unsigned long st_ctime_nsec; | ||
| 69 | |||
| 70 | unsigned long __unused8; | ||
| 71 | }; | ||
| 72 | |||
| 73 | #endif /* __V850_STAT_H__ */ | ||
diff --git a/include/asm-v850/statfs.h b/include/asm-v850/statfs.h deleted file mode 100644 index ea1596607f26..000000000000 --- a/include/asm-v850/statfs.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_STATFS_H__ | ||
| 2 | #define __V850_STATFS_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/statfs.h> | ||
| 5 | |||
| 6 | #endif /* __V850_STATFS_H__ */ | ||
diff --git a/include/asm-v850/string.h b/include/asm-v850/string.h deleted file mode 100644 index 478e234789d6..000000000000 --- a/include/asm-v850/string.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/string.h -- Architecture specific string routines | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02 NEC Corporation | ||
| 5 | * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_STRING_H__ | ||
| 15 | #define __V850_STRING_H__ | ||
| 16 | |||
| 17 | #define __HAVE_ARCH_MEMCPY | ||
| 18 | #define __HAVE_ARCH_MEMSET | ||
| 19 | #define __HAVE_ARCH_MEMMOVE | ||
| 20 | |||
| 21 | extern void *memcpy (void *, const void *, __kernel_size_t); | ||
| 22 | extern void *memset (void *, int, __kernel_size_t); | ||
| 23 | extern void *memmove (void *, const void *, __kernel_size_t); | ||
| 24 | |||
| 25 | #endif /* __V850_STRING_H__ */ | ||
diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h deleted file mode 100644 index 7daf1fdee119..000000000000 --- a/include/asm-v850/system.h +++ /dev/null | |||
| @@ -1,123 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/system.h -- Low-level interrupt/thread ops | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_SYSTEM_H__ | ||
| 15 | #define __V850_SYSTEM_H__ | ||
| 16 | |||
| 17 | #include <linux/linkage.h> | ||
| 18 | #include <asm/ptrace.h> | ||
| 19 | |||
| 20 | |||
| 21 | /* | ||
| 22 | * switch_to(n) should switch tasks to task ptr, first checking that | ||
| 23 | * ptr isn't the current task, in which case it does nothing. | ||
| 24 | */ | ||
| 25 | struct thread_struct; | ||
| 26 | extern void *switch_thread (struct thread_struct *last, | ||
| 27 | struct thread_struct *next); | ||
| 28 | #define switch_to(prev,next,last) \ | ||
| 29 | do { \ | ||
| 30 | if (prev != next) { \ | ||
| 31 | (last) = switch_thread (&prev->thread, &next->thread); \ | ||
| 32 | } \ | ||
| 33 | } while (0) | ||
| 34 | |||
| 35 | |||
| 36 | /* Enable/disable interrupts. */ | ||
| 37 | #define local_irq_enable() __asm__ __volatile__ ("ei") | ||
| 38 | #define local_irq_disable() __asm__ __volatile__ ("di") | ||
| 39 | |||
| 40 | #define local_save_flags(flags) \ | ||
| 41 | __asm__ __volatile__ ("stsr %1, %0" : "=r" (flags) : "i" (SR_PSW)) | ||
| 42 | #define local_restore_flags(flags) \ | ||
| 43 | __asm__ __volatile__ ("ldsr %0, %1" :: "r" (flags), "i" (SR_PSW)) | ||
| 44 | |||
| 45 | /* For spinlocks etc */ | ||
| 46 | #define local_irq_save(flags) \ | ||
| 47 | do { local_save_flags (flags); local_irq_disable (); } while (0) | ||
| 48 | #define local_irq_restore(flags) \ | ||
| 49 | local_restore_flags (flags); | ||
| 50 | |||
| 51 | |||
| 52 | static inline int irqs_disabled (void) | ||
| 53 | { | ||
| 54 | unsigned flags; | ||
| 55 | local_save_flags (flags); | ||
| 56 | return !!(flags & 0x20); | ||
| 57 | } | ||
| 58 | |||
| 59 | |||
| 60 | /* | ||
| 61 | * Force strict CPU ordering. | ||
| 62 | * Not really required on v850... | ||
| 63 | */ | ||
| 64 | #define nop() __asm__ __volatile__ ("nop") | ||
| 65 | #define mb() __asm__ __volatile__ ("" ::: "memory") | ||
| 66 | #define rmb() mb () | ||
| 67 | #define wmb() mb () | ||
| 68 | #define read_barrier_depends() ((void)0) | ||
| 69 | #define set_mb(var, value) do { xchg (&var, value); } while (0) | ||
| 70 | |||
| 71 | #define smp_mb() mb () | ||
| 72 | #define smp_rmb() rmb () | ||
| 73 | #define smp_wmb() wmb () | ||
| 74 | #define smp_read_barrier_depends() read_barrier_depends() | ||
| 75 | |||
| 76 | #define xchg(ptr, with) \ | ||
| 77 | ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr)))) | ||
| 78 | |||
| 79 | static inline unsigned long __xchg (unsigned long with, | ||
| 80 | __volatile__ void *ptr, int size) | ||
| 81 | { | ||
| 82 | unsigned long tmp, flags; | ||
| 83 | |||
| 84 | local_irq_save (flags); | ||
| 85 | |||
| 86 | switch (size) { | ||
| 87 | case 1: | ||
| 88 | tmp = *(unsigned char *)ptr; | ||
| 89 | *(unsigned char *)ptr = with; | ||
| 90 | break; | ||
| 91 | case 2: | ||
| 92 | tmp = *(unsigned short *)ptr; | ||
| 93 | *(unsigned short *)ptr = with; | ||
| 94 | break; | ||
| 95 | case 4: | ||
| 96 | tmp = *(unsigned long *)ptr; | ||
| 97 | *(unsigned long *)ptr = with; | ||
| 98 | break; | ||
| 99 | } | ||
| 100 | |||
| 101 | local_irq_restore (flags); | ||
| 102 | |||
| 103 | return tmp; | ||
| 104 | } | ||
| 105 | |||
| 106 | #include <asm-generic/cmpxchg-local.h> | ||
| 107 | |||
| 108 | /* | ||
| 109 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
| 110 | * them available. | ||
| 111 | */ | ||
| 112 | #define cmpxchg_local(ptr, o, n) \ | ||
| 113 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
| 114 | (unsigned long)(n), sizeof(*(ptr)))) | ||
| 115 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
| 116 | |||
| 117 | #ifndef CONFIG_SMP | ||
| 118 | #include <asm-generic/cmpxchg.h> | ||
| 119 | #endif | ||
| 120 | |||
| 121 | #define arch_align_stack(x) (x) | ||
| 122 | |||
| 123 | #endif /* __V850_SYSTEM_H__ */ | ||
diff --git a/include/asm-v850/teg.h b/include/asm-v850/teg.h deleted file mode 100644 index acc8c7d95329..000000000000 --- a/include/asm-v850/teg.h +++ /dev/null | |||
| @@ -1,101 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/teg.h -- NB85E-TEG cpu chip | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_TEG_H__ | ||
| 15 | #define __V850_TEG_H__ | ||
| 16 | |||
| 17 | |||
| 18 | /* The TEG uses the V850E cpu core. */ | ||
| 19 | #include <asm/v850e.h> | ||
| 20 | #include <asm/v850e_cache.h> | ||
| 21 | |||
| 22 | |||
| 23 | #define CPU_MODEL "v850e/nb85e-teg" | ||
| 24 | #define CPU_MODEL_LONG "NEC V850E/NB85E TEG" | ||
| 25 | |||
| 26 | |||
| 27 | /* For <asm/entry.h> */ | ||
| 28 | /* We use on-chip RAM, for a few miscellaneous variables that must be | ||
| 29 | accessible using a load instruction relative to R0. On the NB85E/TEG, | ||
| 30 | There's 60KB of iRAM starting at 0xFFFF0000, however we need the base | ||
| 31 | address to be addressable by a 16-bit signed offset, so we only use the | ||
| 32 | second half of it starting from 0xFFFF8000. */ | ||
| 33 | #define R0_RAM_ADDR 0xFFFF8000 | ||
| 34 | |||
| 35 | |||
| 36 | /* Hardware-specific interrupt numbers (in the kernel IRQ namespace). | ||
| 37 | Some of these are parameterized even though there's only a single | ||
| 38 | interrupt, for compatibility with some generic code that works on other | ||
| 39 | processor models. */ | ||
| 40 | #define IRQ_INTCMD(n) 6 /* interval timer interrupt */ | ||
| 41 | #define IRQ_INTCMD_NUM 1 | ||
| 42 | #define IRQ_INTSER(n) 16 /* UART reception error */ | ||
| 43 | #define IRQ_INTSER_NUM 1 | ||
| 44 | #define IRQ_INTSR(n) 17 /* UART reception completion */ | ||
| 45 | #define IRQ_INTSR_NUM 1 | ||
| 46 | #define IRQ_INTST(n) 18 /* UART transmission completion */ | ||
| 47 | #define IRQ_INTST_NUM 1 | ||
| 48 | |||
| 49 | /* For <asm/irq.h> */ | ||
| 50 | #define NUM_CPU_IRQS 64 | ||
| 51 | |||
| 52 | |||
| 53 | /* TEG UART details. */ | ||
| 54 | #define V850E_UART_BASE_ADDR(n) (0xFFFFF600 + 0x10 * (n)) | ||
| 55 | #define V850E_UART_ASIM_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x0) | ||
| 56 | #define V850E_UART_ASIS_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x2) | ||
| 57 | #define V850E_UART_ASIF_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x4) | ||
| 58 | #define V850E_UART_CKSR_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x6) | ||
| 59 | #define V850E_UART_BRGC_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x8) | ||
| 60 | #define V850E_UART_TXB_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0xA) | ||
| 61 | #define V850E_UART_RXB_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0xC) | ||
| 62 | #define V850E_UART_NUM_CHANNELS 1 | ||
| 63 | #define V850E_UART_BASE_FREQ CPU_CLOCK_FREQ | ||
| 64 | /* This is a function that gets called before configuring the UART. */ | ||
| 65 | #define V850E_UART_PRE_CONFIGURE teg_uart_pre_configure | ||
| 66 | #ifndef __ASSEMBLY__ | ||
| 67 | extern void teg_uart_pre_configure (unsigned chan, | ||
| 68 | unsigned cflags, unsigned baud); | ||
| 69 | #endif | ||
| 70 | |||
| 71 | |||
| 72 | /* The TEG RTPU. */ | ||
| 73 | #define V850E_RTPU_BASE_ADDR 0xFFFFF210 | ||
| 74 | |||
| 75 | |||
| 76 | /* TEG series timer D details. */ | ||
| 77 | #define V850E_TIMER_D_BASE_ADDR 0xFFFFF210 | ||
| 78 | #define V850E_TIMER_D_TMCD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x0) | ||
| 79 | #define V850E_TIMER_D_TMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x4) | ||
| 80 | #define V850E_TIMER_D_CMD_BASE_ADDR (V850E_TIMER_D_BASE_ADDR + 0x8) | ||
| 81 | #define V850E_TIMER_D_BASE_FREQ CPU_CLOCK_FREQ | ||
| 82 | |||
| 83 | |||
| 84 | /* `Interrupt Source Select' control register. */ | ||
| 85 | #define TEG_ISS_ADDR 0xFFFFF7FA | ||
| 86 | #define TEG_ISS (*(volatile u8 *)TEG_ISS_ADDR) | ||
| 87 | |||
| 88 | /* Port 0 I/O register (bits 0-3 used). */ | ||
| 89 | #define TEG_PORT0_IO_ADDR 0xFFFFF7F2 | ||
| 90 | #define TEG_PORT0_IO (*(volatile u8 *)TEG_PORT0_IO_ADDR) | ||
| 91 | /* Port 0 control register (bits 0-3 control mode, 0 = output, 1 = input). */ | ||
| 92 | #define TEG_PORT0_PM_ADDR 0xFFFFF7F4 | ||
| 93 | #define TEG_PORT0_PM (*(volatile u8 *)TEG_PORT0_PM_ADDR) | ||
| 94 | |||
| 95 | |||
| 96 | #ifndef __ASSEMBLY__ | ||
| 97 | extern void teg_init_irqs (void); | ||
| 98 | #endif | ||
| 99 | |||
| 100 | |||
| 101 | #endif /* __V850_TEG_H__ */ | ||
diff --git a/include/asm-v850/termbits.h b/include/asm-v850/termbits.h deleted file mode 100644 index 295d7bf69451..000000000000 --- a/include/asm-v850/termbits.h +++ /dev/null | |||
| @@ -1,200 +0,0 @@ | |||
| 1 | #ifndef __V850_TERMBITS_H__ | ||
| 2 | #define __V850_TERMBITS_H__ | ||
| 3 | |||
| 4 | #include <linux/posix_types.h> | ||
| 5 | |||
| 6 | typedef unsigned char cc_t; | ||
| 7 | typedef unsigned int speed_t; | ||
| 8 | typedef unsigned int tcflag_t; | ||
| 9 | |||
| 10 | #define NCCS 19 | ||
| 11 | struct termios { | ||
| 12 | tcflag_t c_iflag; /* input mode flags */ | ||
| 13 | tcflag_t c_oflag; /* output mode flags */ | ||
| 14 | tcflag_t c_cflag; /* control mode flags */ | ||
| 15 | tcflag_t c_lflag; /* local mode flags */ | ||
| 16 | cc_t c_line; /* line discipline */ | ||
| 17 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct termios2 { | ||
| 21 | tcflag_t c_iflag; /* input mode flags */ | ||
| 22 | tcflag_t c_oflag; /* output mode flags */ | ||
| 23 | tcflag_t c_cflag; /* control mode flags */ | ||
| 24 | tcflag_t c_lflag; /* local mode flags */ | ||
| 25 | cc_t c_line; /* line discipline */ | ||
| 26 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 27 | speed_t c_ispeed; /* input speed */ | ||
| 28 | speed_t c_ospeed; /* output speed */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct ktermios { | ||
| 32 | tcflag_t c_iflag; /* input mode flags */ | ||
| 33 | tcflag_t c_oflag; /* output mode flags */ | ||
| 34 | tcflag_t c_cflag; /* control mode flags */ | ||
| 35 | tcflag_t c_lflag; /* local mode flags */ | ||
| 36 | cc_t c_line; /* line discipline */ | ||
| 37 | cc_t c_cc[NCCS]; /* control characters */ | ||
| 38 | speed_t c_ispeed; /* input speed */ | ||
| 39 | speed_t c_ospeed; /* output speed */ | ||
| 40 | }; | ||
| 41 | |||
| 42 | /* c_cc characters */ | ||
| 43 | #define VINTR 0 | ||
| 44 | #define VQUIT 1 | ||
| 45 | #define VERASE 2 | ||
| 46 | #define VKILL 3 | ||
| 47 | #define VEOF 4 | ||
| 48 | #define VTIME 5 | ||
| 49 | #define VMIN 6 | ||
| 50 | #define VSWTC 7 | ||
| 51 | #define VSTART 8 | ||
| 52 | #define VSTOP 9 | ||
| 53 | #define VSUSP 10 | ||
| 54 | #define VEOL 11 | ||
| 55 | #define VREPRINT 12 | ||
| 56 | #define VDISCARD 13 | ||
| 57 | #define VWERASE 14 | ||
| 58 | #define VLNEXT 15 | ||
| 59 | #define VEOL2 16 | ||
| 60 | |||
| 61 | |||
| 62 | /* c_iflag bits */ | ||
| 63 | #define IGNBRK 0000001 | ||
| 64 | #define BRKINT 0000002 | ||
| 65 | #define IGNPAR 0000004 | ||
| 66 | #define PARMRK 0000010 | ||
| 67 | #define INPCK 0000020 | ||
| 68 | #define ISTRIP 0000040 | ||
| 69 | #define INLCR 0000100 | ||
| 70 | #define IGNCR 0000200 | ||
| 71 | #define ICRNL 0000400 | ||
| 72 | #define IUCLC 0001000 | ||
| 73 | #define IXON 0002000 | ||
| 74 | #define IXANY 0004000 | ||
| 75 | #define IXOFF 0010000 | ||
| 76 | #define IMAXBEL 0020000 | ||
| 77 | #define IUTF8 0040000 | ||
| 78 | |||
| 79 | /* c_oflag bits */ | ||
| 80 | #define OPOST 0000001 | ||
| 81 | #define OLCUC 0000002 | ||
| 82 | #define ONLCR 0000004 | ||
| 83 | #define OCRNL 0000010 | ||
| 84 | #define ONOCR 0000020 | ||
| 85 | #define ONLRET 0000040 | ||
| 86 | #define OFILL 0000100 | ||
| 87 | #define OFDEL 0000200 | ||
| 88 | #define NLDLY 0000400 | ||
| 89 | #define NL0 0000000 | ||
| 90 | #define NL1 0000400 | ||
| 91 | #define CRDLY 0003000 | ||
| 92 | #define CR0 0000000 | ||
| 93 | #define CR1 0001000 | ||
| 94 | #define CR2 0002000 | ||
| 95 | #define CR3 0003000 | ||
| 96 | #define TABDLY 0014000 | ||
| 97 | #define TAB0 0000000 | ||
| 98 | #define TAB1 0004000 | ||
| 99 | #define TAB2 0010000 | ||
| 100 | #define TAB3 0014000 | ||
| 101 | #define XTABS 0014000 | ||
| 102 | #define BSDLY 0020000 | ||
| 103 | #define BS0 0000000 | ||
| 104 | #define BS1 0020000 | ||
| 105 | #define VTDLY 0040000 | ||
| 106 | #define VT0 0000000 | ||
| 107 | #define VT1 0040000 | ||
| 108 | #define FFDLY 0100000 | ||
| 109 | #define FF0 0000000 | ||
| 110 | #define FF1 0100000 | ||
| 111 | |||
| 112 | /* c_cflag bit meaning */ | ||
| 113 | #define CBAUD 0010017 | ||
| 114 | #define B0 0000000 /* hang up */ | ||
| 115 | #define B50 0000001 | ||
| 116 | #define B75 0000002 | ||
| 117 | #define B110 0000003 | ||
| 118 | #define B134 0000004 | ||
| 119 | #define B150 0000005 | ||
| 120 | #define B200 0000006 | ||
| 121 | #define B300 0000007 | ||
| 122 | #define B600 0000010 | ||
| 123 | #define B1200 0000011 | ||
| 124 | #define B1800 0000012 | ||
| 125 | #define B2400 0000013 | ||
| 126 | #define B4800 0000014 | ||
| 127 | #define B9600 0000015 | ||
| 128 | #define B19200 0000016 | ||
| 129 | #define B38400 0000017 | ||
| 130 | #define EXTA B19200 | ||
| 131 | #define EXTB B38400 | ||
| 132 | #define CSIZE 0000060 | ||
| 133 | #define CS5 0000000 | ||
| 134 | #define CS6 0000020 | ||
| 135 | #define CS7 0000040 | ||
| 136 | #define CS8 0000060 | ||
| 137 | #define CSTOPB 0000100 | ||
| 138 | #define CREAD 0000200 | ||
| 139 | #define PARENB 0000400 | ||
| 140 | #define PARODD 0001000 | ||
| 141 | #define HUPCL 0002000 | ||
| 142 | #define CLOCAL 0004000 | ||
| 143 | #define CBAUDEX 0010000 | ||
| 144 | #define BOTHER 0010000 | ||
| 145 | #define B57600 0010001 | ||
| 146 | #define B115200 0010002 | ||
| 147 | #define B230400 0010003 | ||
| 148 | #define B460800 0010004 | ||
| 149 | #define B500000 0010005 | ||
| 150 | #define B576000 0010006 | ||
| 151 | #define B921600 0010007 | ||
| 152 | #define B1000000 0010010 | ||
| 153 | #define B1152000 0010011 | ||
| 154 | #define B1500000 0010012 | ||
| 155 | #define B2000000 0010013 | ||
| 156 | #define B2500000 0010014 | ||
| 157 | #define B3000000 0010015 | ||
| 158 | #define B3500000 0010016 | ||
| 159 | #define B4000000 0010017 | ||
| 160 | #define CIBAUD 002003600000 /* input baud rate */ | ||
| 161 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
| 162 | #define CRTSCTS 020000000000 /* flow control */ | ||
| 163 | |||
| 164 | #define IBSHIFT 16 /* Shifr from CBAUD to CIBAUD */ | ||
| 165 | |||
| 166 | /* c_lflag bits */ | ||
| 167 | #define ISIG 0000001 | ||
| 168 | #define ICANON 0000002 | ||
| 169 | #define XCASE 0000004 | ||
| 170 | #define ECHO 0000010 | ||
| 171 | #define ECHOE 0000020 | ||
| 172 | #define ECHOK 0000040 | ||
| 173 | #define ECHONL 0000100 | ||
| 174 | #define NOFLSH 0000200 | ||
| 175 | #define TOSTOP 0000400 | ||
| 176 | #define ECHOCTL 0001000 | ||
| 177 | #define ECHOPRT 0002000 | ||
| 178 | #define ECHOKE 0004000 | ||
| 179 | #define FLUSHO 0010000 | ||
| 180 | #define PENDIN 0040000 | ||
| 181 | #define IEXTEN 0100000 | ||
| 182 | |||
| 183 | |||
| 184 | /* tcflow() and TCXONC use these */ | ||
| 185 | #define TCOOFF 0 | ||
| 186 | #define TCOON 1 | ||
| 187 | #define TCIOFF 2 | ||
| 188 | #define TCION 3 | ||
| 189 | |||
| 190 | /* tcflush() and TCFLSH use these */ | ||
| 191 | #define TCIFLUSH 0 | ||
| 192 | #define TCOFLUSH 1 | ||
| 193 | #define TCIOFLUSH 2 | ||
| 194 | |||
| 195 | /* tcsetattr uses these */ | ||
| 196 | #define TCSANOW 0 | ||
| 197 | #define TCSADRAIN 1 | ||
| 198 | #define TCSAFLUSH 2 | ||
| 199 | |||
| 200 | #endif /* __V850_TERMBITS_H__ */ | ||
diff --git a/include/asm-v850/termios.h b/include/asm-v850/termios.h deleted file mode 100644 index fcd171838d9c..000000000000 --- a/include/asm-v850/termios.h +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | #ifndef __V850_TERMIOS_H__ | ||
| 2 | #define __V850_TERMIOS_H__ | ||
| 3 | |||
| 4 | #include <asm/termbits.h> | ||
| 5 | #include <asm/ioctls.h> | ||
| 6 | |||
| 7 | struct winsize { | ||
| 8 | unsigned short ws_row; | ||
| 9 | unsigned short ws_col; | ||
| 10 | unsigned short ws_xpixel; | ||
| 11 | unsigned short ws_ypixel; | ||
| 12 | }; | ||
| 13 | |||
| 14 | #define NCC 8 | ||
| 15 | struct termio { | ||
| 16 | unsigned short c_iflag; /* input mode flags */ | ||
| 17 | unsigned short c_oflag; /* output mode flags */ | ||
| 18 | unsigned short c_cflag; /* control mode flags */ | ||
| 19 | unsigned short c_lflag; /* local mode flags */ | ||
| 20 | unsigned char c_line; /* line discipline */ | ||
| 21 | unsigned char c_cc[NCC]; /* control characters */ | ||
| 22 | }; | ||
| 23 | |||
| 24 | /* modem lines */ | ||
| 25 | #define TIOCM_LE 0x001 | ||
| 26 | #define TIOCM_DTR 0x002 | ||
| 27 | #define TIOCM_RTS 0x004 | ||
| 28 | #define TIOCM_ST 0x008 | ||
| 29 | #define TIOCM_SR 0x010 | ||
| 30 | #define TIOCM_CTS 0x020 | ||
| 31 | #define TIOCM_CAR 0x040 | ||
| 32 | #define TIOCM_RNG 0x080 | ||
| 33 | #define TIOCM_DSR 0x100 | ||
| 34 | #define TIOCM_CD TIOCM_CAR | ||
| 35 | #define TIOCM_RI TIOCM_RNG | ||
| 36 | #define TIOCM_OUT1 0x2000 | ||
| 37 | #define TIOCM_OUT2 0x4000 | ||
| 38 | #define TIOCM_LOOP 0x8000 | ||
| 39 | |||
| 40 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
| 41 | |||
| 42 | #ifdef __KERNEL__ | ||
| 43 | |||
| 44 | /* intr=^C quit=^\ erase=del kill=^U | ||
| 45 | eof=^D vtime=\0 vmin=\1 sxtc=\0 | ||
| 46 | start=^Q stop=^S susp=^Z eol=\0 | ||
| 47 | reprint=^R discard=^U werase=^W lnext=^V | ||
| 48 | eol2=\0 | ||
| 49 | */ | ||
| 50 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" | ||
| 51 | |||
| 52 | /* | ||
| 53 | * Translate a "termio" structure into a "termios". Ugh. | ||
| 54 | */ | ||
| 55 | #define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ | ||
| 56 | unsigned short __tmp; \ | ||
| 57 | get_user(__tmp,&(termio)->x); \ | ||
| 58 | *(unsigned short *) &(termios)->x = __tmp; \ | ||
| 59 | } | ||
| 60 | |||
| 61 | #define user_termio_to_kernel_termios(termios, termio) \ | ||
| 62 | ({ \ | ||
| 63 | SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ | ||
| 64 | SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ | ||
| 65 | SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ | ||
| 66 | SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ | ||
| 67 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | ||
| 68 | }) | ||
| 69 | |||
| 70 | /* | ||
| 71 | * Translate a "termios" structure into a "termio". Ugh. | ||
| 72 | */ | ||
| 73 | #define kernel_termios_to_user_termio(termio, termios) \ | ||
| 74 | ({ \ | ||
| 75 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | ||
| 76 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | ||
| 77 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | ||
| 78 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | ||
| 79 | put_user((termios)->c_line, &(termio)->c_line); \ | ||
| 80 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
| 81 | }) | ||
| 82 | |||
| 83 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) | ||
| 84 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) | ||
| 85 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
| 86 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
| 87 | |||
| 88 | #endif /* __KERNEL__ */ | ||
| 89 | |||
| 90 | #endif /* __V850_TERMIOS_H__ */ | ||
diff --git a/include/asm-v850/thread_info.h b/include/asm-v850/thread_info.h deleted file mode 100644 index 1a9e6ae0c5fd..000000000000 --- a/include/asm-v850/thread_info.h +++ /dev/null | |||
| @@ -1,129 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/thread_info.h -- v850 low-level thread information | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 NEC Corporation | ||
| 5 | * Copyright (C) 2002 Miles Bader <miles@gnu.org> | ||
| 6 | * Copyright (C) 2002 David Howells (dhowells@redhat.com) | ||
| 7 | * - Incorporating suggestions made by Linus Torvalds and Dave Miller | ||
| 8 | * | ||
| 9 | * This file is subject to the terms and conditions of the GNU General | ||
| 10 | * Public License. See the file COPYING in the main directory of this | ||
| 11 | * archive for more details. | ||
| 12 | * | ||
| 13 | * This file was derived from the PPC version, include/asm-ppc/thread_info.h | ||
| 14 | * which was adapted from the i386 version by Paul Mackerras | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __V850_THREAD_INFO_H__ | ||
| 18 | #define __V850_THREAD_INFO_H__ | ||
| 19 | |||
| 20 | #ifdef __KERNEL__ | ||
| 21 | |||
| 22 | #ifndef __ASSEMBLY__ | ||
| 23 | |||
| 24 | /* | ||
| 25 | * low level task data. | ||
| 26 | * If you change this, change the TI_* offsets below to match. | ||
| 27 | */ | ||
| 28 | struct thread_info { | ||
| 29 | struct task_struct *task; /* main task structure */ | ||
| 30 | struct exec_domain *exec_domain; /* execution domain */ | ||
| 31 | unsigned long flags; /* low level flags */ | ||
| 32 | int cpu; /* cpu we're on */ | ||
| 33 | int preempt_count; /* 0 => preemptable, | ||
| 34 | <0 => BUG */ | ||
| 35 | struct restart_block restart_block; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #define INIT_THREAD_INFO(tsk) \ | ||
| 39 | { \ | ||
| 40 | .task = &tsk, \ | ||
| 41 | .exec_domain = &default_exec_domain, \ | ||
| 42 | .flags = 0, \ | ||
| 43 | .cpu = 0, \ | ||
| 44 | .preempt_count = 1, \ | ||
| 45 | .restart_block = { \ | ||
| 46 | .fn = do_no_restart_syscall, \ | ||
| 47 | }, \ | ||
| 48 | } | ||
| 49 | |||
| 50 | #define init_thread_info (init_thread_union.thread_info) | ||
| 51 | #define init_stack (init_thread_union.stack) | ||
| 52 | |||
| 53 | /* | ||
| 54 | * macros/functions for gaining access to the thread information structure | ||
| 55 | */ | ||
| 56 | |||
| 57 | /* thread information allocation */ | ||
| 58 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
| 59 | __get_free_pages(GFP_KERNEL, 1)) | ||
| 60 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | ||
| 61 | |||
| 62 | #endif /* __ASSEMBLY__ */ | ||
| 63 | |||
| 64 | |||
| 65 | /* | ||
| 66 | * Offsets in thread_info structure, used in assembly code | ||
| 67 | */ | ||
| 68 | #define TI_TASK 0 | ||
| 69 | #define TI_EXECDOMAIN 4 | ||
| 70 | #define TI_FLAGS 8 | ||
| 71 | #define TI_CPU 12 | ||
| 72 | #define TI_PREEMPT 16 | ||
| 73 | |||
| 74 | #define PREEMPT_ACTIVE 0x4000000 | ||
| 75 | |||
| 76 | /* | ||
| 77 | * thread information flag bit numbers | ||
| 78 | */ | ||
| 79 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | ||
| 80 | #define TIF_SIGPENDING 1 /* signal pending */ | ||
| 81 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | ||
| 82 | #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling | ||
| 83 | TIF_NEED_RESCHED */ | ||
| 84 | #define TIF_MEMDIE 4 | ||
| 85 | |||
| 86 | /* as above, but as bit values */ | ||
| 87 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | ||
| 88 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | ||
| 89 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | ||
| 90 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | ||
| 91 | |||
| 92 | |||
| 93 | /* Size of kernel stack for each process. */ | ||
| 94 | #define THREAD_SIZE 0x2000 | ||
| 95 | |||
| 96 | /* The alignment of kernel threads, with thread_info structures at their | ||
| 97 | base. Thus, a pointer for a task's task structure can be derived from | ||
| 98 | its kernel stack pointer. */ | ||
| 99 | #define THREAD_ALIGNMENT THREAD_SIZE | ||
| 100 | #define THREAD_MASK (-THREAD_ALIGNMENT) | ||
| 101 | |||
| 102 | |||
| 103 | #ifdef __ASSEMBLY__ | ||
| 104 | |||
| 105 | /* Put a pointer to the current thread_info structure into REG. Note that | ||
| 106 | this definition requires THREAD_MASK to be representable as a signed | ||
| 107 | 16-bit value. */ | ||
| 108 | #define GET_CURRENT_THREAD(reg) \ | ||
| 109 | /* Use `addi' and then `and' instead of just `andi', because \ | ||
| 110 | `addi' sign-extends the immediate value, whereas `andi' \ | ||
| 111 | zero-extends it. */ \ | ||
| 112 | addi THREAD_MASK, r0, reg; \ | ||
| 113 | and sp, reg | ||
| 114 | |||
| 115 | #else | ||
| 116 | |||
| 117 | /* Return a pointer to the current thread_info structure. */ | ||
| 118 | static inline struct thread_info *current_thread_info (void) | ||
| 119 | { | ||
| 120 | register unsigned long sp __asm__ ("sp"); | ||
| 121 | return (struct thread_info *)(sp & THREAD_MASK); | ||
| 122 | } | ||
| 123 | |||
| 124 | #endif /* __ASSEMBLY__ */ | ||
| 125 | |||
| 126 | |||
| 127 | #endif /* __KERNEL__ */ | ||
| 128 | |||
| 129 | #endif /* __V850_THREAD_INFO_H__ */ | ||
diff --git a/include/asm-v850/timex.h b/include/asm-v850/timex.h deleted file mode 100644 index 6279e5a0ee8e..000000000000 --- a/include/asm-v850/timex.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-v850/timex.h | ||
| 3 | * | ||
| 4 | * v850 architecture timex specifications | ||
| 5 | */ | ||
| 6 | #ifndef __V850_TIMEX_H__ | ||
| 7 | #define __V850_TIMEX_H__ | ||
| 8 | |||
| 9 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
| 10 | |||
| 11 | typedef unsigned long cycles_t; | ||
| 12 | |||
| 13 | static inline cycles_t get_cycles(void) | ||
| 14 | { | ||
| 15 | return 0; | ||
| 16 | } | ||
| 17 | |||
| 18 | #endif /* __V850_TIMEX_H__ */ | ||
diff --git a/include/asm-v850/tlb.h b/include/asm-v850/tlb.h deleted file mode 100644 index 73bc9ead40dd..000000000000 --- a/include/asm-v850/tlb.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/tlb.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 NEC Corporation | ||
| 5 | * Copyright (C) 2002 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_TLB_H__ | ||
| 15 | #define __V850_TLB_H__ | ||
| 16 | |||
| 17 | #define tlb_flush(tlb) ((void)0) | ||
| 18 | |||
| 19 | #include <asm-generic/tlb.h> | ||
| 20 | |||
| 21 | #endif /* __V850_TLB_H__ */ | ||
diff --git a/include/asm-v850/tlbflush.h b/include/asm-v850/tlbflush.h deleted file mode 100644 index c44aa64449c8..000000000000 --- a/include/asm-v850/tlbflush.h +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/tlbflush.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_TLBFLUSH_H__ | ||
| 15 | #define __V850_TLBFLUSH_H__ | ||
| 16 | |||
| 17 | #include <asm/machdep.h> | ||
| 18 | |||
| 19 | |||
| 20 | /* | ||
| 21 | * flush all user-space atc entries. | ||
| 22 | */ | ||
| 23 | static inline void __flush_tlb(void) | ||
| 24 | { | ||
| 25 | BUG (); | ||
| 26 | } | ||
| 27 | |||
| 28 | static inline void __flush_tlb_one(unsigned long addr) | ||
| 29 | { | ||
| 30 | BUG (); | ||
| 31 | } | ||
| 32 | |||
| 33 | #define flush_tlb() __flush_tlb() | ||
| 34 | |||
| 35 | /* | ||
| 36 | * flush all atc entries (both kernel and user-space entries). | ||
| 37 | */ | ||
| 38 | static inline void flush_tlb_all(void) | ||
| 39 | { | ||
| 40 | BUG (); | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline void flush_tlb_mm(struct mm_struct *mm) | ||
| 44 | { | ||
| 45 | BUG (); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) | ||
| 49 | { | ||
| 50 | BUG (); | ||
| 51 | } | ||
| 52 | |||
| 53 | static inline void flush_tlb_range(struct vm_area_struct *vma, | ||
| 54 | unsigned long start, unsigned long end) | ||
| 55 | { | ||
| 56 | BUG (); | ||
| 57 | } | ||
| 58 | |||
| 59 | static inline void flush_tlb_kernel_page(unsigned long addr) | ||
| 60 | { | ||
| 61 | BUG (); | ||
| 62 | } | ||
| 63 | |||
| 64 | #endif /* __V850_TLBFLUSH_H__ */ | ||
diff --git a/include/asm-v850/topology.h b/include/asm-v850/topology.h deleted file mode 100644 index 6040e41d7945..000000000000 --- a/include/asm-v850/topology.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __V850_TOPOLOGY_H__ | ||
| 2 | #define __V850_TOPOLOGY_H__ | ||
| 3 | |||
| 4 | #include <asm-generic/topology.h> | ||
| 5 | |||
| 6 | #endif /* __V850_TOPOLOGY_H__ */ | ||
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h deleted file mode 100644 index 89f735ee41dd..000000000000 --- a/include/asm-v850/types.h +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | #ifndef __V850_TYPES_H__ | ||
| 2 | #define __V850_TYPES_H__ | ||
| 3 | |||
| 4 | #ifndef __ASSEMBLY__ | ||
| 5 | |||
| 6 | /* | ||
| 7 | * This file is never included by application software unless | ||
| 8 | * explicitly requested (e.g., via linux/types.h) in which case the | ||
| 9 | * application is Linux specific so (user-) name space pollution is | ||
| 10 | * not a major issue. However, for interoperability, libraries still | ||
| 11 | * need to be careful to avoid a name clashes. | ||
| 12 | */ | ||
| 13 | #include <asm-generic/int-ll64.h> | ||
| 14 | |||
| 15 | typedef unsigned short umode_t; | ||
| 16 | |||
| 17 | #endif /* !__ASSEMBLY__ */ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * These aren't exported outside the kernel to avoid name space clashes | ||
| 21 | */ | ||
| 22 | #ifdef __KERNEL__ | ||
| 23 | |||
| 24 | #define BITS_PER_LONG 32 | ||
| 25 | |||
| 26 | #ifndef __ASSEMBLY__ | ||
| 27 | |||
| 28 | /* Dma addresses are 32-bits wide. */ | ||
| 29 | |||
| 30 | typedef u32 dma_addr_t; | ||
| 31 | |||
| 32 | #endif /* !__ASSEMBLY__ */ | ||
| 33 | |||
| 34 | #endif /* __KERNEL__ */ | ||
| 35 | |||
| 36 | #endif /* __V850_TYPES_H__ */ | ||
diff --git a/include/asm-v850/uaccess.h b/include/asm-v850/uaccess.h deleted file mode 100644 index 64563c409bb2..000000000000 --- a/include/asm-v850/uaccess.h +++ /dev/null | |||
| @@ -1,159 +0,0 @@ | |||
| 1 | #ifndef __V850_UACCESS_H__ | ||
| 2 | #define __V850_UACCESS_H__ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * User space memory access functions | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <linux/errno.h> | ||
| 9 | #include <linux/string.h> | ||
| 10 | |||
| 11 | #include <asm/segment.h> | ||
| 12 | #include <asm/machdep.h> | ||
| 13 | |||
| 14 | #define VERIFY_READ 0 | ||
| 15 | #define VERIFY_WRITE 1 | ||
| 16 | |||
| 17 | static inline int access_ok (int type, const void *addr, unsigned long size) | ||
| 18 | { | ||
| 19 | /* XXX I guess we should check against real ram bounds at least, and | ||
| 20 | possibly make sure ADDR is not within the kernel. | ||
| 21 | For now we just check to make sure it's not a small positive | ||
| 22 | or negative value, as that will at least catch some kinds of | ||
| 23 | error. In particular, we make sure that ADDR's not within the | ||
| 24 | interrupt vector area, which we know starts at zero, or within the | ||
| 25 | peripheral-I/O area, which is located just _before_ zero. */ | ||
| 26 | unsigned long val = (unsigned long)addr; | ||
| 27 | return val >= (0x80 + NUM_CPU_IRQS*16) && val < 0xFFFFF000; | ||
| 28 | } | ||
| 29 | |||
| 30 | /* | ||
| 31 | * The exception table consists of pairs of addresses: the first is the | ||
| 32 | * address of an instruction that is allowed to fault, and the second is | ||
| 33 | * the address at which the program should continue. No registers are | ||
| 34 | * modified, so it is entirely up to the continuation code to figure out | ||
| 35 | * what to do. | ||
| 36 | * | ||
| 37 | * All the routines below use bits of fixup code that are out of line | ||
| 38 | * with the main instruction path. This means when everything is well, | ||
| 39 | * we don't even have to jump over them. Further, they do not intrude | ||
| 40 | * on our cache or tlb entries. | ||
| 41 | */ | ||
| 42 | |||
| 43 | struct exception_table_entry | ||
| 44 | { | ||
| 45 | unsigned long insn, fixup; | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* Returns 0 if exception not found and fixup otherwise. */ | ||
| 49 | extern unsigned long search_exception_table (unsigned long); | ||
| 50 | |||
| 51 | |||
| 52 | /* | ||
| 53 | * These are the main single-value transfer routines. They automatically | ||
| 54 | * use the right size if we just have the right pointer type. | ||
| 55 | */ | ||
| 56 | |||
| 57 | extern int bad_user_access_length (void); | ||
| 58 | |||
| 59 | #define __get_user(var, ptr) \ | ||
| 60 | ({ \ | ||
| 61 | int __gu_err = 0; \ | ||
| 62 | typeof(*(ptr)) __gu_val = 0; \ | ||
| 63 | switch (sizeof (*(ptr))) { \ | ||
| 64 | case 1: \ | ||
| 65 | case 2: \ | ||
| 66 | case 4: \ | ||
| 67 | __gu_val = *(ptr); \ | ||
| 68 | break; \ | ||
| 69 | case 8: \ | ||
| 70 | memcpy(&__gu_val, ptr, sizeof(__gu_val)); \ | ||
| 71 | break; \ | ||
| 72 | default: \ | ||
| 73 | __gu_val = 0; \ | ||
| 74 | __gu_err = __get_user_bad (); \ | ||
| 75 | break; \ | ||
| 76 | } \ | ||
| 77 | (var) = __gu_val; \ | ||
| 78 | __gu_err; \ | ||
| 79 | }) | ||
| 80 | #define __get_user_bad() (bad_user_access_length (), (-EFAULT)) | ||
| 81 | |||
| 82 | #define __put_user(var, ptr) \ | ||
| 83 | ({ \ | ||
| 84 | int __pu_err = 0; \ | ||
| 85 | switch (sizeof (*(ptr))) { \ | ||
| 86 | case 1: \ | ||
| 87 | case 2: \ | ||
| 88 | case 4: \ | ||
| 89 | *(ptr) = (var); \ | ||
| 90 | break; \ | ||
| 91 | case 8: { \ | ||
| 92 | typeof(*(ptr)) __pu_val = 0; \ | ||
| 93 | memcpy(ptr, &__pu_val, sizeof(__pu_val)); \ | ||
| 94 | } \ | ||
| 95 | break; \ | ||
| 96 | default: \ | ||
| 97 | __pu_err = __put_user_bad (); \ | ||
| 98 | break; \ | ||
| 99 | } \ | ||
| 100 | __pu_err; \ | ||
| 101 | }) | ||
| 102 | #define __put_user_bad() (bad_user_access_length (), (-EFAULT)) | ||
| 103 | |||
| 104 | #define put_user(x, ptr) __put_user(x, ptr) | ||
| 105 | #define get_user(x, ptr) __get_user(x, ptr) | ||
| 106 | |||
| 107 | #define __copy_from_user(to, from, n) (memcpy (to, from, n), 0) | ||
| 108 | #define __copy_to_user(to, from, n) (memcpy(to, from, n), 0) | ||
| 109 | |||
| 110 | #define __copy_to_user_inatomic __copy_to_user | ||
| 111 | #define __copy_from_user_inatomic __copy_from_user | ||
| 112 | |||
| 113 | #define copy_from_user(to, from, n) __copy_from_user (to, from, n) | ||
| 114 | #define copy_to_user(to, from, n) __copy_to_user(to, from, n) | ||
| 115 | |||
| 116 | #define copy_to_user_ret(to,from,n,retval) \ | ||
| 117 | ({ if (copy_to_user (to,from,n)) return retval; }) | ||
| 118 | |||
| 119 | #define copy_from_user_ret(to,from,n,retval) \ | ||
| 120 | ({ if (copy_from_user (to,from,n)) return retval; }) | ||
| 121 | |||
| 122 | /* | ||
| 123 | * Copy a null terminated string from userspace. | ||
| 124 | */ | ||
| 125 | |||
| 126 | static inline long | ||
| 127 | strncpy_from_user (char *dst, const char *src, long count) | ||
| 128 | { | ||
| 129 | char *tmp; | ||
| 130 | strncpy (dst, src, count); | ||
| 131 | for (tmp = dst; *tmp && count > 0; tmp++, count--) | ||
| 132 | ; | ||
| 133 | return tmp - dst; | ||
| 134 | } | ||
| 135 | |||
| 136 | /* | ||
| 137 | * Return the size of a string (including the ending 0) | ||
| 138 | * | ||
| 139 | * Return 0 on exception, a value greater than N if too long | ||
| 140 | */ | ||
| 141 | static inline long strnlen_user (const char *src, long n) | ||
| 142 | { | ||
| 143 | return strlen (src) + 1; | ||
| 144 | } | ||
| 145 | |||
| 146 | #define strlen_user(str) strnlen_user (str, 32767) | ||
| 147 | |||
| 148 | /* | ||
| 149 | * Zero Userspace | ||
| 150 | */ | ||
| 151 | |||
| 152 | static inline unsigned long | ||
| 153 | clear_user (void *to, unsigned long n) | ||
| 154 | { | ||
| 155 | memset (to, 0, n); | ||
| 156 | return 0; | ||
| 157 | } | ||
| 158 | |||
| 159 | #endif /* __V850_UACCESS_H__ */ | ||
diff --git a/include/asm-v850/ucontext.h b/include/asm-v850/ucontext.h deleted file mode 100644 index 303c21590cff..000000000000 --- a/include/asm-v850/ucontext.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef __V850_UCONTEXT_H__ | ||
| 2 | #define __V850_UCONTEXT_H__ | ||
| 3 | |||
| 4 | #include <asm/sigcontext.h> | ||
| 5 | |||
| 6 | struct ucontext { | ||
| 7 | unsigned long uc_flags; | ||
| 8 | struct ucontext *uc_link; | ||
| 9 | stack_t uc_stack; | ||
| 10 | struct sigcontext uc_mcontext; | ||
| 11 | sigset_t uc_sigmask; /* mask last for extensibility */ | ||
| 12 | }; | ||
| 13 | |||
| 14 | #endif /* __V850_UCONTEXT_H__ */ | ||
diff --git a/include/asm-v850/unaligned.h b/include/asm-v850/unaligned.h deleted file mode 100644 index 53122b28491e..000000000000 --- a/include/asm-v850/unaligned.h +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001 NEC Corporation | ||
| 3 | * Copyright (C) 2001 Miles Bader <miles@gnu.org> | ||
| 4 | * | ||
| 5 | * This file is subject to the terms and conditions of the GNU General | ||
| 6 | * Public License. See the file COPYING in the main directory of this | ||
| 7 | * archive for more details. | ||
| 8 | * | ||
| 9 | * Note that some v850 chips support unaligned access, but it seems too | ||
| 10 | * annoying to use. | ||
| 11 | */ | ||
| 12 | #ifndef _ASM_V850_UNALIGNED_H | ||
| 13 | #define _ASM_V850_UNALIGNED_H | ||
| 14 | |||
| 15 | #include <linux/unaligned/be_byteshift.h> | ||
| 16 | #include <linux/unaligned/le_byteshift.h> | ||
| 17 | #include <linux/unaligned/generic.h> | ||
| 18 | |||
| 19 | #define get_unaligned __get_unaligned_le | ||
| 20 | #define put_unaligned __put_unaligned_le | ||
| 21 | |||
| 22 | #endif /* _ASM_V850_UNALIGNED_H */ | ||
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h deleted file mode 100644 index 2241ed45ecfe..000000000000 --- a/include/asm-v850/unistd.h +++ /dev/null | |||
| @@ -1,244 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/unistd.h -- System call numbers and invocation mechanism | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03,04 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_UNISTD_H__ | ||
| 15 | #define __V850_UNISTD_H__ | ||
| 16 | |||
| 17 | #define __NR_restart_syscall 0 | ||
| 18 | #define __NR_exit 1 | ||
| 19 | #define __NR_fork 2 | ||
| 20 | #define __NR_read 3 | ||
| 21 | #define __NR_write 4 | ||
| 22 | #define __NR_open 5 | ||
| 23 | #define __NR_close 6 | ||
| 24 | #define __NR_waitpid 7 | ||
| 25 | #define __NR_creat 8 | ||
| 26 | #define __NR_link 9 | ||
| 27 | #define __NR_unlink 10 | ||
| 28 | #define __NR_execve 11 | ||
| 29 | #define __NR_chdir 12 | ||
| 30 | #define __NR_time 13 | ||
| 31 | #define __NR_mknod 14 | ||
| 32 | #define __NR_chmod 15 | ||
| 33 | #define __NR_chown 16 | ||
| 34 | #define __NR_break 17 | ||
| 35 | #define __NR_lseek 19 | ||
| 36 | #define __NR_getpid 20 | ||
| 37 | #define __NR_mount 21 | ||
| 38 | #define __NR_umount 22 | ||
| 39 | #define __NR_setuid 23 | ||
| 40 | #define __NR_getuid 24 | ||
| 41 | #define __NR_stime 25 | ||
| 42 | #define __NR_ptrace 26 | ||
| 43 | #define __NR_alarm 27 | ||
| 44 | #define __NR_pause 29 | ||
| 45 | #define __NR_utime 30 | ||
| 46 | #define __NR_stty 31 | ||
| 47 | #define __NR_gtty 32 | ||
| 48 | #define __NR_access 33 | ||
| 49 | #define __NR_nice 34 | ||
| 50 | #define __NR_ftime 35 | ||
| 51 | #define __NR_sync 36 | ||
| 52 | #define __NR_kill 37 | ||
| 53 | #define __NR_rename 38 | ||
| 54 | #define __NR_mkdir 39 | ||
| 55 | #define __NR_rmdir 40 | ||
| 56 | #define __NR_dup 41 | ||
| 57 | #define __NR_pipe 42 | ||
| 58 | #define __NR_times 43 | ||
| 59 | #define __NR_prof 44 | ||
| 60 | #define __NR_brk 45 | ||
| 61 | #define __NR_setgid 46 | ||
| 62 | #define __NR_getgid 47 | ||
| 63 | #define __NR_signal 48 | ||
| 64 | #define __NR_geteuid 49 | ||
| 65 | #define __NR_getegid 50 | ||
| 66 | #define __NR_acct 51 | ||
| 67 | #define __NR_umount2 52 | ||
| 68 | #define __NR_lock 53 | ||
| 69 | #define __NR_ioctl 54 | ||
| 70 | #define __NR_fcntl 55 | ||
| 71 | #define __NR_setpgid 57 | ||
| 72 | #define __NR_umask 60 | ||
| 73 | #define __NR_chroot 61 | ||
| 74 | #define __NR_ustat 62 | ||
| 75 | #define __NR_dup2 63 | ||
| 76 | #define __NR_getppid 64 | ||
| 77 | #define __NR_getpgrp 65 | ||
| 78 | #define __NR_setsid 66 | ||
| 79 | #define __NR_sigaction 67 | ||
| 80 | #define __NR_sgetmask 68 | ||
| 81 | #define __NR_ssetmask 69 | ||
| 82 | #define __NR_setreuid 70 | ||
| 83 | #define __NR_setregid 71 | ||
| 84 | #define __NR_sigsuspend 72 | ||
| 85 | #define __NR_sigpending 73 | ||
| 86 | #define __NR_sethostname 74 | ||
| 87 | #define __NR_setrlimit 75 | ||
| 88 | #define __NR_ugetrlimit 76 | ||
| 89 | #define __NR_getrusage 77 | ||
| 90 | #define __NR_gettimeofday 78 | ||
| 91 | #define __NR_settimeofday 79 | ||
| 92 | #define __NR_getgroups 80 | ||
| 93 | #define __NR_setgroups 81 | ||
| 94 | #define __NR_select 82 | ||
| 95 | #define __NR_symlink 83 | ||
| 96 | #define __NR_readlink 85 | ||
| 97 | #define __NR_uselib 86 | ||
| 98 | #define __NR_swapon 87 | ||
| 99 | #define __NR_reboot 88 | ||
| 100 | #define __NR_readdir 89 | ||
| 101 | #define __NR_mmap 90 | ||
| 102 | #define __NR_munmap 91 | ||
| 103 | #define __NR_truncate 92 | ||
| 104 | #define __NR_ftruncate 93 | ||
| 105 | #define __NR_fchmod 94 | ||
| 106 | #define __NR_fchown 95 | ||
| 107 | #define __NR_getpriority 96 | ||
| 108 | #define __NR_setpriority 97 | ||
| 109 | #define __NR_profil 98 | ||
| 110 | #define __NR_statfs 99 | ||
| 111 | #define __NR_fstatfs 100 | ||
| 112 | #define __NR_socketcall 102 | ||
| 113 | #define __NR_syslog 103 | ||
| 114 | #define __NR_setitimer 104 | ||
| 115 | #define __NR_getitimer 105 | ||
| 116 | #define __NR_stat 106 | ||
| 117 | #define __NR_lstat 107 | ||
| 118 | #define __NR_fstat 108 | ||
| 119 | #define __NR_vhangup 111 | ||
| 120 | #define __NR_wait4 114 | ||
| 121 | #define __NR_swapoff 115 | ||
| 122 | #define __NR_sysinfo 116 | ||
| 123 | #define __NR_ipc 117 | ||
| 124 | #define __NR_fsync 118 | ||
| 125 | #define __NR_sigreturn 119 | ||
| 126 | #define __NR_clone 120 | ||
| 127 | #define __NR_setdomainname 121 | ||
| 128 | #define __NR_uname 122 | ||
| 129 | #define __NR_cacheflush 123 | ||
| 130 | #define __NR_adjtimex 124 | ||
| 131 | #define __NR_mprotect 125 | ||
| 132 | #define __NR_sigprocmask 126 | ||
| 133 | #define __NR_create_module 127 | ||
| 134 | #define __NR_init_module 128 | ||
| 135 | #define __NR_delete_module 129 | ||
| 136 | #define __NR_get_kernel_syms 130 | ||
| 137 | #define __NR_quotactl 131 | ||
| 138 | #define __NR_getpgid 132 | ||
| 139 | #define __NR_fchdir 133 | ||
| 140 | #define __NR_bdflush 134 | ||
| 141 | #define __NR_sysfs 135 | ||
| 142 | #define __NR_personality 136 | ||
| 143 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
| 144 | #define __NR_setfsuid 138 | ||
| 145 | #define __NR_setfsgid 139 | ||
| 146 | #define __NR__llseek 140 | ||
| 147 | #define __NR_getdents 141 | ||
| 148 | #define __NR_flock 143 | ||
| 149 | #define __NR_msync 144 | ||
| 150 | #define __NR_readv 145 | ||
| 151 | #define __NR_writev 146 | ||
| 152 | #define __NR_getsid 147 | ||
| 153 | #define __NR_fdatasync 148 | ||
| 154 | #define __NR__sysctl 149 | ||
| 155 | #define __NR_mlock 150 | ||
| 156 | #define __NR_munlock 151 | ||
| 157 | #define __NR_mlockall 152 | ||
| 158 | #define __NR_munlockall 153 | ||
| 159 | #define __NR_sched_setparam 154 | ||
| 160 | #define __NR_sched_getparam 155 | ||
| 161 | #define __NR_sched_setscheduler 156 | ||
| 162 | #define __NR_sched_getscheduler 157 | ||
| 163 | #define __NR_sched_yield 158 | ||
| 164 | #define __NR_sched_get_priority_max 159 | ||
| 165 | #define __NR_sched_get_priority_min 160 | ||
| 166 | #define __NR_sched_rr_get_interval 161 | ||
| 167 | #define __NR_nanosleep 162 | ||
| 168 | #define __NR_mremap 163 | ||
| 169 | #define __NR_setresuid 164 | ||
| 170 | #define __NR_getresuid 165 | ||
| 171 | #define __NR_query_module 167 | ||
| 172 | #define __NR_poll 168 | ||
| 173 | #define __NR_nfsservctl 169 | ||
| 174 | #define __NR_setresgid 170 | ||
| 175 | #define __NR_getresgid 171 | ||
| 176 | #define __NR_prctl 172 | ||
| 177 | #define __NR_rt_sigreturn 173 | ||
| 178 | #define __NR_rt_sigaction 174 | ||
| 179 | #define __NR_rt_sigprocmask 175 | ||
| 180 | #define __NR_rt_sigpending 176 | ||
| 181 | #define __NR_rt_sigtimedwait 177 | ||
| 182 | #define __NR_rt_sigqueueinfo 178 | ||
| 183 | #define __NR_rt_sigsuspend 179 | ||
| 184 | #define __NR_pread 180 | ||
| 185 | #define __NR_pwrite 181 | ||
| 186 | #define __NR_lchown 182 | ||
| 187 | #define __NR_getcwd 183 | ||
| 188 | #define __NR_capget 184 | ||
| 189 | #define __NR_capset 185 | ||
| 190 | #define __NR_sigaltstack 186 | ||
| 191 | #define __NR_sendfile 187 | ||
| 192 | #define __NR_getpmsg 188 /* some people actually want streams */ | ||
| 193 | #define __NR_putpmsg 189 /* some people actually want streams */ | ||
| 194 | #define __NR_vfork 190 | ||
| 195 | #define __NR_mmap2 192 | ||
| 196 | #define __NR_truncate64 193 | ||
| 197 | #define __NR_ftruncate64 194 | ||
| 198 | #define __NR_stat64 195 | ||
| 199 | #define __NR_lstat64 196 | ||
| 200 | #define __NR_fstat64 197 | ||
| 201 | #define __NR_fcntl64 198 | ||
| 202 | #define __NR_getdents64 199 | ||
| 203 | #define __NR_pivot_root 200 | ||
| 204 | #define __NR_gettid 201 | ||
| 205 | #define __NR_tkill 202 | ||
| 206 | |||
| 207 | #ifdef __KERNEL__ | ||
| 208 | |||
| 209 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
| 210 | #define __ARCH_WANT_OLD_READDIR | ||
| 211 | #define __ARCH_WANT_STAT64 | ||
| 212 | #define __ARCH_WANT_SYS_ALARM | ||
| 213 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
| 214 | #define __ARCH_WANT_SYS_PAUSE | ||
| 215 | #define __ARCH_WANT_SYS_SGETMASK | ||
| 216 | #define __ARCH_WANT_SYS_SIGNAL | ||
| 217 | #define __ARCH_WANT_SYS_TIME | ||
| 218 | #define __ARCH_WANT_SYS_UTIME | ||
| 219 | #define __ARCH_WANT_SYS_WAITPID | ||
| 220 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
| 221 | #define __ARCH_WANT_SYS_FADVISE64 | ||
| 222 | #define __ARCH_WANT_SYS_GETPGRP | ||
| 223 | #define __ARCH_WANT_SYS_LLSEEK | ||
| 224 | #define __ARCH_WANT_SYS_NICE | ||
| 225 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
| 226 | #define __ARCH_WANT_SYS_SIGPENDING | ||
| 227 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
| 228 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
| 229 | |||
| 230 | /* | ||
| 231 | * "Conditional" syscalls | ||
| 232 | */ | ||
| 233 | #define cond_syscall(name) \ | ||
| 234 | asm (".weak\t" C_SYMBOL_STRING(name) ";" \ | ||
| 235 | ".set\t" C_SYMBOL_STRING(name) "," C_SYMBOL_STRING(sys_ni_syscall)) | ||
| 236 | #if 0 | ||
| 237 | /* This doesn't work if there's a function prototype for NAME visible, | ||
| 238 | because the argument types probably won't match. */ | ||
| 239 | #define cond_syscall(name) \ | ||
| 240 | void name (void) __attribute__ ((weak, alias ("sys_ni_syscall"))); | ||
| 241 | #endif | ||
| 242 | |||
| 243 | #endif /* __KERNEL__ */ | ||
| 244 | #endif /* __V850_UNISTD_H__ */ | ||
diff --git a/include/asm-v850/user.h b/include/asm-v850/user.h deleted file mode 100644 index 63cdc567d272..000000000000 --- a/include/asm-v850/user.h +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | #ifndef __V850_USER_H__ | ||
| 2 | #define __V850_USER_H__ | ||
| 3 | |||
| 4 | /* Adapted from <asm-ppc/user.h>. */ | ||
| 5 | |||
| 6 | #include <linux/ptrace.h> | ||
| 7 | #include <asm/page.h> | ||
| 8 | |||
| 9 | /* | ||
| 10 | * Core file format: The core file is written in such a way that gdb | ||
| 11 | * can understand it and provide useful information to the user (under | ||
| 12 | * linux we use the `trad-core' bfd, NOT the osf-core). The file contents | ||
| 13 | * are as follows: | ||
| 14 | * | ||
| 15 | * upage: 1 page consisting of a user struct that tells gdb | ||
| 16 | * what is present in the file. Directly after this is a | ||
| 17 | * copy of the task_struct, which is currently not used by gdb, | ||
| 18 | * but it may come in handy at some point. All of the registers | ||
| 19 | * are stored as part of the upage. The upage should always be | ||
| 20 | * only one page long. | ||
| 21 | * data: The data segment follows next. We use current->end_text to | ||
| 22 | * current->brk to pick up all of the user variables, plus any memory | ||
| 23 | * that may have been sbrk'ed. No attempt is made to determine if a | ||
| 24 | * page is demand-zero or if a page is totally unused, we just cover | ||
| 25 | * the entire range. All of the addresses are rounded in such a way | ||
| 26 | * that an integral number of pages is written. | ||
| 27 | * stack: We need the stack information in order to get a meaningful | ||
| 28 | * backtrace. We need to write the data from usp to | ||
| 29 | * current->start_stack, so we round each of these in order to be able | ||
| 30 | * to write an integer number of pages. | ||
| 31 | */ | ||
| 32 | struct user { | ||
| 33 | struct pt_regs regs; /* entire machine state */ | ||
| 34 | size_t u_tsize; /* text size (pages) */ | ||
| 35 | size_t u_dsize; /* data size (pages) */ | ||
| 36 | size_t u_ssize; /* stack size (pages) */ | ||
| 37 | unsigned long start_code; /* text starting address */ | ||
| 38 | unsigned long start_data; /* data starting address */ | ||
| 39 | unsigned long start_stack; /* stack starting address */ | ||
| 40 | long int signal; /* signal causing core dump */ | ||
| 41 | unsigned long u_ar0; /* help gdb find registers */ | ||
| 42 | unsigned long magic; /* identifies a core file */ | ||
| 43 | char u_comm[32]; /* user command name */ | ||
| 44 | }; | ||
| 45 | |||
| 46 | #define NBPG PAGE_SIZE | ||
| 47 | #define UPAGES 1 | ||
| 48 | #define HOST_TEXT_START_ADDR (u.start_code) | ||
| 49 | #define HOST_DATA_START_ADDR (u.start_data) | ||
| 50 | #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) | ||
| 51 | |||
| 52 | #endif /* __V850_USER_H__ */ | ||
diff --git a/include/asm-v850/v850e.h b/include/asm-v850/v850e.h deleted file mode 100644 index 5a222eb5117f..000000000000 --- a/include/asm-v850/v850e.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e.h -- V850E CPU | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_V850E_H__ | ||
| 15 | #define __V850_V850E_H__ | ||
| 16 | |||
| 17 | #include <asm/v850e_intc.h> | ||
| 18 | |||
| 19 | #define CPU_ARCH "v850e" | ||
| 20 | |||
| 21 | #endif /* __V850_V850E_H__ */ | ||
diff --git a/include/asm-v850/v850e2.h b/include/asm-v850/v850e2.h deleted file mode 100644 index 48680408ab7e..000000000000 --- a/include/asm-v850/v850e2.h +++ /dev/null | |||
| @@ -1,69 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e2.h -- Machine-dependent defs for V850E2 CPUs | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2002,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_V850E2_H__ | ||
| 15 | #define __V850_V850E2_H__ | ||
| 16 | |||
| 17 | #include <asm/v850e_intc.h> /* v850e-style interrupt system. */ | ||
| 18 | |||
| 19 | |||
| 20 | #define CPU_ARCH "v850e2" | ||
| 21 | |||
| 22 | |||
| 23 | /* Control registers. */ | ||
| 24 | |||
| 25 | /* Chip area select control */ | ||
| 26 | #define V850E2_CSC_ADDR(n) (0xFFFFF060 + (n) * 2) | ||
| 27 | #define V850E2_CSC(n) (*(volatile u16 *)V850E2_CSC_ADDR(n)) | ||
| 28 | /* I/O area select control */ | ||
| 29 | #define V850E2_BPC_ADDR 0xFFFFF064 | ||
| 30 | #define V850E2_BPC (*(volatile u16 *)V850E2_BPC_ADDR) | ||
| 31 | /* Bus size configuration */ | ||
| 32 | #define V850E2_BSC_ADDR 0xFFFFF066 | ||
| 33 | #define V850E2_BSC (*(volatile u16 *)V850E2_BSC_ADDR) | ||
| 34 | /* Endian configuration */ | ||
| 35 | #define V850E2_BEC_ADDR 0xFFFFF068 | ||
| 36 | #define V850E2_BEC (*(volatile u16 *)V850E2_BEC_ADDR) | ||
| 37 | /* Cache configuration */ | ||
| 38 | #define V850E2_BHC_ADDR 0xFFFFF06A | ||
| 39 | #define V850E2_BHC (*(volatile u16 *)V850E2_BHC_ADDR) | ||
| 40 | /* NPB strobe-wait configuration */ | ||
| 41 | #define V850E2_VSWC_ADDR 0xFFFFF06E | ||
| 42 | #define V850E2_VSWC (*(volatile u16 *)V850E2_VSWC_ADDR) | ||
| 43 | /* Bus cycle type */ | ||
| 44 | #define V850E2_BCT_ADDR(n) (0xFFFFF480 + (n) * 2) | ||
| 45 | #define V850E2_BCT(n) (*(volatile u16 *)V850E2_BCT_ADDR(n)) | ||
| 46 | /* Data wait control */ | ||
| 47 | #define V850E2_DWC_ADDR(n) (0xFFFFF484 + (n) * 2) | ||
| 48 | #define V850E2_DWC(n) (*(volatile u16 *)V850E2_DWC_ADDR(n)) | ||
| 49 | /* Bus cycle control */ | ||
| 50 | #define V850E2_BCC_ADDR 0xFFFFF488 | ||
| 51 | #define V850E2_BCC (*(volatile u16 *)V850E2_BCC_ADDR) | ||
| 52 | /* Address wait control */ | ||
| 53 | #define V850E2_ASC_ADDR 0xFFFFF48A | ||
| 54 | #define V850E2_ASC (*(volatile u16 *)V850E2_ASC_ADDR) | ||
| 55 | /* Local bus sizing control */ | ||
| 56 | #define V850E2_LBS_ADDR 0xFFFFF48E | ||
| 57 | #define V850E2_LBS (*(volatile u16 *)V850E2_LBS_ADDR) | ||
| 58 | /* Line buffer control */ | ||
| 59 | #define V850E2_LBC_ADDR(n) (0xFFFFF490 + (n) * 2) | ||
| 60 | #define V850E2_LBC(n) (*(volatile u16 *)V850E2_LBC_ADDR(n)) | ||
| 61 | /* SDRAM configuration */ | ||
| 62 | #define V850E2_SCR_ADDR(n) (0xFFFFF4A0 + (n) * 4) | ||
| 63 | #define V850E2_SCR(n) (*(volatile u16 *)V850E2_SCR_ADDR(n)) | ||
| 64 | /* SDRAM refresh cycle control */ | ||
| 65 | #define V850E2_RFS_ADDR(n) (0xFFFFF4A2 + (n) * 4) | ||
| 66 | #define V850E2_RFS(n) (*(volatile u16 *)V850E2_RFS_ADDR(n)) | ||
| 67 | |||
| 68 | |||
| 69 | #endif /* __V850_V850E2_H__ */ | ||
diff --git a/include/asm-v850/v850e2_cache.h b/include/asm-v850/v850e2_cache.h deleted file mode 100644 index 87edf0d311d5..000000000000 --- a/include/asm-v850/v850e2_cache.h +++ /dev/null | |||
| @@ -1,75 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e2_cache_cache.h -- Cache control for V850E2 | ||
| 3 | * cache memories | ||
| 4 | * | ||
| 5 | * Copyright (C) 2003,05 NEC Electronics Corporation | ||
| 6 | * Copyright (C) 2003,05 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __V850_V850E2_CACHE_H__ | ||
| 16 | #define __V850_V850E2_CACHE_H__ | ||
| 17 | |||
| 18 | #include <asm/types.h> | ||
| 19 | |||
| 20 | |||
| 21 | /* Cache control registers. */ | ||
| 22 | |||
| 23 | /* Bus Transaction Control */ | ||
| 24 | #define V850E2_CACHE_BTSC_ADDR 0xFFFFF070 | ||
| 25 | #define V850E2_CACHE_BTSC (*(volatile u16 *)V850E2_CACHE_BTSC_ADDR) | ||
| 26 | #define V850E2_CACHE_BTSC_ICM 0x0001 /* icache enable */ | ||
| 27 | #define V850E2_CACHE_BTSC_DCM0 0x0004 /* dcache enable, bit 0 */ | ||
| 28 | #define V850E2_CACHE_BTSC_DCM1 0x0008 /* dcache enable, bit 1 */ | ||
| 29 | #define V850E2_CACHE_BTSC_DCM_WT /* write-through */ \ | ||
| 30 | V850E2_CACHE_BTSC_DCM0 | ||
| 31 | #ifdef CONFIG_V850E2_V850E2S | ||
| 32 | # define V850E2_CACHE_BTSC_DCM_WB_NO_ALLOC /* write-back, non-alloc */ \ | ||
| 33 | V850E2_CACHE_BTSC_DCM1 | ||
| 34 | # define V850E2_CACHE_BTSC_DCM_WB_ALLOC /* write-back, non-alloc */ \ | ||
| 35 | (V850E2_CACHE_BTSC_DCM1 | V850E2_CACHE_BTSC_DCM0) | ||
| 36 | # define V850E2_CACHE_BTSC_ISEQ 0x0010 /* icache `address sequence mode' */ | ||
| 37 | # define V850E2_CACHE_BTSC_DSEQ 0x0020 /* dcache `address sequence mode' */ | ||
| 38 | # define V850E2_CACHE_BTSC_IRFC 0x0030 | ||
| 39 | # define V850E2_CACHE_BTSC_ILCD 0x4000 | ||
| 40 | # define V850E2_CACHE_BTSC_VABE 0x8000 | ||
| 41 | #endif /* CONFIG_V850E2_V850E2S */ | ||
| 42 | |||
| 43 | /* Cache operation start address register (low-bits). */ | ||
| 44 | #define V850E2_CACHE_CADL_ADDR 0xFFFFF074 | ||
| 45 | #define V850E2_CACHE_CADL (*(volatile u16 *)V850E2_CACHE_CADL_ADDR) | ||
| 46 | /* Cache operation start address register (high-bits). */ | ||
| 47 | #define V850E2_CACHE_CADH_ADDR 0xFFFFF076 | ||
| 48 | #define V850E2_CACHE_CADH (*(volatile u16 *)V850E2_CACHE_CADH_ADDR) | ||
| 49 | /* Cache operation count register. */ | ||
| 50 | #define V850E2_CACHE_CCNT_ADDR 0xFFFFF078 | ||
| 51 | #define V850E2_CACHE_CCNT (*(volatile u16 *)V850E2_CACHE_CCNT_ADDR) | ||
| 52 | /* Cache operation specification register. */ | ||
| 53 | #define V850E2_CACHE_COPR_ADDR 0xFFFFF07A | ||
| 54 | #define V850E2_CACHE_COPR (*(volatile u16 *)V850E2_CACHE_COPR_ADDR) | ||
| 55 | #define V850E2_CACHE_COPR_STRT 0x0001 /* start cache operation */ | ||
| 56 | #define V850E2_CACHE_COPR_LBSL 0x0100 /* 0 = icache, 1 = dcache */ | ||
| 57 | #define V850E2_CACHE_COPR_WSLE 0x0200 /* operate on cache way */ | ||
| 58 | #define V850E2_CACHE_COPR_WSL(way) ((way) * 0x0400) /* way select */ | ||
| 59 | #define V850E2_CACHE_COPR_CFC(op) ((op) * 0x1000) /* cache function code */ | ||
| 60 | |||
| 61 | |||
| 62 | /* Size of a cache line in bytes. */ | ||
| 63 | #define V850E2_CACHE_LINE_SIZE_BITS 4 | ||
| 64 | #define V850E2_CACHE_LINE_SIZE (1 << V850E2_CACHE_LINE_SIZE_BITS) | ||
| 65 | |||
| 66 | /* The size of each cache `way' in lines. */ | ||
| 67 | #define V850E2_CACHE_WAY_SIZE 256 | ||
| 68 | |||
| 69 | |||
| 70 | /* For <asm/cache.h> */ | ||
| 71 | #define L1_CACHE_BYTES V850E2_CACHE_LINE_SIZE | ||
| 72 | #define L1_CACHE_SHIFT V850E2_CACHE_LINE_SIZE_BITS | ||
| 73 | |||
| 74 | |||
| 75 | #endif /* __V850_V850E2_CACHE_H__ */ | ||
diff --git a/include/asm-v850/v850e_cache.h b/include/asm-v850/v850e_cache.h deleted file mode 100644 index aa7d7eb9da50..000000000000 --- a/include/asm-v850/v850e_cache.h +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_cache.h -- Cache control for V850E cache memories | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | /* This file implements cache control for the rather simple cache used on | ||
| 15 | some V850E CPUs, specifically the NB85E/TEG CPU-core and the V850E/ME2 | ||
| 16 | CPU. V850E2 processors have their own (better) cache | ||
| 17 | implementation. */ | ||
| 18 | |||
| 19 | #ifndef __V850_V850E_CACHE_H__ | ||
| 20 | #define __V850_V850E_CACHE_H__ | ||
| 21 | |||
| 22 | #include <asm/types.h> | ||
| 23 | |||
| 24 | |||
| 25 | /* Cache control registers. */ | ||
| 26 | #define V850E_CACHE_BHC_ADDR 0xFFFFF06A | ||
| 27 | #define V850E_CACHE_BHC (*(volatile u16 *)V850E_CACHE_BHC_ADDR) | ||
| 28 | #define V850E_CACHE_ICC_ADDR 0xFFFFF070 | ||
| 29 | #define V850E_CACHE_ICC (*(volatile u16 *)V850E_CACHE_ICC_ADDR) | ||
| 30 | #define V850E_CACHE_ISI_ADDR 0xFFFFF072 | ||
| 31 | #define V850E_CACHE_ISI (*(volatile u16 *)V850E_CACHE_ISI_ADDR) | ||
| 32 | #define V850E_CACHE_DCC_ADDR 0xFFFFF078 | ||
| 33 | #define V850E_CACHE_DCC (*(volatile u16 *)V850E_CACHE_DCC_ADDR) | ||
| 34 | |||
| 35 | /* Size of a cache line in bytes. */ | ||
| 36 | #define V850E_CACHE_LINE_SIZE 16 | ||
| 37 | |||
| 38 | /* For <asm/cache.h> */ | ||
| 39 | #define L1_CACHE_BYTES V850E_CACHE_LINE_SIZE | ||
| 40 | |||
| 41 | |||
| 42 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) | ||
| 43 | /* Set caching params via the BHC, ICC, and DCC registers. */ | ||
| 44 | void v850e_cache_enable (u16 bhc, u16 icc, u16 dcc); | ||
| 45 | #endif /* __KERNEL__ && !__ASSEMBLY__ */ | ||
| 46 | |||
| 47 | |||
| 48 | #endif /* __V850_V850E_CACHE_H__ */ | ||
diff --git a/include/asm-v850/v850e_intc.h b/include/asm-v850/v850e_intc.h deleted file mode 100644 index 6fdf95708317..000000000000 --- a/include/asm-v850/v850e_intc.h +++ /dev/null | |||
| @@ -1,133 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_intc.h -- V850E CPU interrupt controller (INTC) | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __V850_V850E_INTC_H__ | ||
| 15 | #define __V850_V850E_INTC_H__ | ||
| 16 | |||
| 17 | |||
| 18 | /* There are 4 16-bit `Interrupt Mask Registers' located contiguously | ||
| 19 | starting from this base. Each interrupt uses a single bit to | ||
| 20 | indicated enabled/disabled status. */ | ||
| 21 | #define V850E_INTC_IMR_BASE_ADDR 0xFFFFF100 | ||
| 22 | #define V850E_INTC_IMR_ADDR(irq) (V850E_INTC_IMR_BASE_ADDR + ((irq) >> 3)) | ||
| 23 | #define V850E_INTC_IMR_BIT(irq) ((irq) & 0x7) | ||
| 24 | |||
| 25 | /* Each maskable interrupt has a single-byte control register at this | ||
| 26 | address. */ | ||
| 27 | #define V850E_INTC_IC_BASE_ADDR 0xFFFFF110 | ||
| 28 | #define V850E_INTC_IC_ADDR(irq) (V850E_INTC_IC_BASE_ADDR + ((irq) << 1)) | ||
| 29 | #define V850E_INTC_IC(irq) (*(volatile u8 *)V850E_INTC_IC_ADDR(irq)) | ||
| 30 | /* Encode priority PR for storing in an interrupt control register. */ | ||
| 31 | #define V850E_INTC_IC_PR(pr) (pr) | ||
| 32 | /* Interrupt disable bit in an interrupt control register. */ | ||
| 33 | #define V850E_INTC_IC_MK_BIT 6 | ||
| 34 | #define V850E_INTC_IC_MK (1 << V850E_INTC_IC_MK_BIT) | ||
| 35 | /* Interrupt pending flag in an interrupt control register. */ | ||
| 36 | #define V850E_INTC_IC_IF_BIT 7 | ||
| 37 | #define V850E_INTC_IC_IF (1 << V850E_INTC_IC_IF_BIT) | ||
| 38 | |||
| 39 | /* The ISPR (In-service priority register) contains one bit for each interrupt | ||
| 40 | priority level, which is set to one when that level is currently being | ||
| 41 | serviced (and thus blocking any interrupts of equal or lesser level). */ | ||
| 42 | #define V850E_INTC_ISPR_ADDR 0xFFFFF1FA | ||
| 43 | #define V850E_INTC_ISPR (*(volatile u8 *)V850E_INTC_ISPR_ADDR) | ||
| 44 | |||
| 45 | |||
| 46 | #ifndef __ASSEMBLY__ | ||
| 47 | |||
| 48 | /* Enable interrupt handling for interrupt IRQ. */ | ||
| 49 | static inline void v850e_intc_enable_irq (unsigned irq) | ||
| 50 | { | ||
| 51 | __asm__ __volatile__ ("clr1 %0, [%1]" | ||
| 52 | :: "r" (V850E_INTC_IMR_BIT (irq)), | ||
| 53 | "r" (V850E_INTC_IMR_ADDR (irq)) | ||
| 54 | : "memory"); | ||
| 55 | } | ||
| 56 | |||
| 57 | /* Disable interrupt handling for interrupt IRQ. Note that any | ||
| 58 | interrupts received while disabled will be delivered once the | ||
| 59 | interrupt is enabled again, unless they are explicitly cleared using | ||
| 60 | `v850e_intc_clear_pending_irq'. */ | ||
| 61 | static inline void v850e_intc_disable_irq (unsigned irq) | ||
| 62 | { | ||
| 63 | __asm__ __volatile__ ("set1 %0, [%1]" | ||
| 64 | :: "r" (V850E_INTC_IMR_BIT (irq)), | ||
| 65 | "r" (V850E_INTC_IMR_ADDR (irq)) | ||
| 66 | : "memory"); | ||
| 67 | } | ||
| 68 | |||
| 69 | /* Return true if interrupt handling for interrupt IRQ is enabled. */ | ||
| 70 | static inline int v850e_intc_irq_enabled (unsigned irq) | ||
| 71 | { | ||
| 72 | int rval; | ||
| 73 | __asm__ __volatile__ ("tst1 %1, [%2]; setf z, %0" | ||
| 74 | : "=r" (rval) | ||
| 75 | : "r" (V850E_INTC_IMR_BIT (irq)), | ||
| 76 | "r" (V850E_INTC_IMR_ADDR (irq))); | ||
| 77 | return rval; | ||
| 78 | } | ||
| 79 | |||
| 80 | /* Disable irqs from 0 until LIMIT. LIMIT must be a multiple of 8. */ | ||
| 81 | static inline void _v850e_intc_disable_irqs (unsigned limit) | ||
| 82 | { | ||
| 83 | unsigned long addr; | ||
| 84 | for (addr = V850E_INTC_IMR_BASE_ADDR; limit >= 8; addr++, limit -= 8) | ||
| 85 | *(char *)addr = 0xFF; | ||
| 86 | } | ||
| 87 | |||
| 88 | /* Disable all irqs. This is purposely a macro, because NUM_MACH_IRQS | ||
| 89 | will be only be defined later. */ | ||
| 90 | #define v850e_intc_disable_irqs() _v850e_intc_disable_irqs (NUM_MACH_IRQS) | ||
| 91 | |||
| 92 | /* Clear any pending interrupts for IRQ. */ | ||
| 93 | static inline void v850e_intc_clear_pending_irq (unsigned irq) | ||
| 94 | { | ||
| 95 | __asm__ __volatile__ ("clr1 %0, 0[%1]" | ||
| 96 | :: "i" (V850E_INTC_IC_IF_BIT), | ||
| 97 | "r" (V850E_INTC_IC_ADDR (irq)) | ||
| 98 | : "memory"); | ||
| 99 | } | ||
| 100 | |||
| 101 | /* Return true if interrupt IRQ is pending (but disabled). */ | ||
| 102 | static inline int v850e_intc_irq_pending (unsigned irq) | ||
| 103 | { | ||
| 104 | int rval; | ||
| 105 | __asm__ __volatile__ ("tst1 %1, 0[%2]; setf nz, %0" | ||
| 106 | : "=r" (rval) | ||
| 107 | : "i" (V850E_INTC_IC_IF_BIT), | ||
| 108 | "r" (V850E_INTC_IC_ADDR (irq))); | ||
| 109 | return rval; | ||
| 110 | } | ||
| 111 | |||
| 112 | |||
| 113 | struct v850e_intc_irq_init { | ||
| 114 | const char *name; /* name of interrupt type */ | ||
| 115 | |||
| 116 | /* Range of kernel irq numbers for this type: | ||
| 117 | BASE, BASE+INTERVAL, ..., BASE+INTERVAL*NUM */ | ||
| 118 | unsigned base, num, interval; | ||
| 119 | |||
| 120 | unsigned priority; /* interrupt priority to assign */ | ||
| 121 | }; | ||
| 122 | struct hw_interrupt_type; /* fwd decl */ | ||
| 123 | |||
| 124 | /* Initialize HW_IRQ_TYPES for INTC-controlled irqs described in array | ||
| 125 | INITS (which is terminated by an entry with the name field == 0). */ | ||
| 126 | extern void v850e_intc_init_irq_types (struct v850e_intc_irq_init *inits, | ||
| 127 | struct hw_interrupt_type *hw_irq_types); | ||
| 128 | |||
| 129 | |||
| 130 | #endif /* !__ASSEMBLY__ */ | ||
| 131 | |||
| 132 | |||
| 133 | #endif /* __V850_V850E_INTC_H__ */ | ||
diff --git a/include/asm-v850/v850e_timer_c.h b/include/asm-v850/v850e_timer_c.h deleted file mode 100644 index f70575df6ea9..000000000000 --- a/include/asm-v850/v850e_timer_c.h +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_timer_c.h -- `Timer C' component often used | ||
| 3 | * with the V850E cpu core | ||
| 4 | * | ||
| 5 | * Copyright (C) 2001,03 NEC Electronics Corporation | ||
| 6 | * Copyright (C) 2001,03 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | /* NOTE: this include file currently contains only enough to allow us to | ||
| 16 | use timer C as an interrupt pass-through. */ | ||
| 17 | |||
| 18 | #ifndef __V850_V850E_TIMER_C_H__ | ||
| 19 | #define __V850_V850E_TIMER_C_H__ | ||
| 20 | |||
| 21 | #include <asm/types.h> | ||
| 22 | #include <asm/machdep.h> /* Pick up chip-specific defs. */ | ||
| 23 | |||
| 24 | |||
| 25 | /* Timer C (16-bit interval timers). */ | ||
| 26 | |||
| 27 | /* Control register 0 for timer C. */ | ||
| 28 | #define V850E_TIMER_C_TMCC0_ADDR(n) (V850E_TIMER_C_BASE_ADDR + 0x6 + 0x10 *(n)) | ||
| 29 | #define V850E_TIMER_C_TMCC0(n) (*(volatile u8 *)V850E_TIMER_C_TMCC0_ADDR(n)) | ||
| 30 | #define V850E_TIMER_C_TMCC0_CAE 0x01 /* clock action enable */ | ||
| 31 | #define V850E_TIMER_C_TMCC0_CE 0x02 /* count enable */ | ||
| 32 | /* ... */ | ||
| 33 | |||
| 34 | /* Control register 1 for timer C. */ | ||
| 35 | #define V850E_TIMER_C_TMCC1_ADDR(n) (V850E_TIMER_C_BASE_ADDR + 0x8 + 0x10 *(n)) | ||
| 36 | #define V850E_TIMER_C_TMCC1(n) (*(volatile u8 *)V850E_TIMER_C_TMCC1_ADDR(n)) | ||
| 37 | #define V850E_TIMER_C_TMCC1_CMS0 0x01 /* capture/compare mode select (ccc0) */ | ||
| 38 | #define V850E_TIMER_C_TMCC1_CMS1 0x02 /* capture/compare mode select (ccc1) */ | ||
| 39 | /* ... */ | ||
| 40 | |||
| 41 | /* Interrupt edge-sensitivity control for timer C. */ | ||
| 42 | #define V850E_TIMER_C_SESC_ADDR(n) (V850E_TIMER_C_BASE_ADDR + 0x9 + 0x10 *(n)) | ||
| 43 | #define V850E_TIMER_C_SESC(n) (*(volatile u8 *)V850E_TIMER_C_SESC_ADDR(n)) | ||
| 44 | |||
| 45 | /* ...etc... */ | ||
| 46 | |||
| 47 | |||
| 48 | #endif /* __V850_V850E_TIMER_C_H__ */ | ||
diff --git a/include/asm-v850/v850e_timer_d.h b/include/asm-v850/v850e_timer_d.h deleted file mode 100644 index 417612c5b22f..000000000000 --- a/include/asm-v850/v850e_timer_d.h +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_timer_d.h -- `Timer D' component often used | ||
| 3 | * with the V850E cpu core | ||
| 4 | * | ||
| 5 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 6 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __V850_V850E_TIMER_D_H__ | ||
| 16 | #define __V850_V850E_TIMER_D_H__ | ||
| 17 | |||
| 18 | #include <asm/types.h> | ||
| 19 | #include <asm/machdep.h> /* Pick up chip-specific defs. */ | ||
| 20 | |||
| 21 | |||
| 22 | /* Timer D (16-bit interval timers). */ | ||
| 23 | |||
| 24 | /* Count registers for timer D. */ | ||
| 25 | #define V850E_TIMER_D_TMD_ADDR(n) (V850E_TIMER_D_TMD_BASE_ADDR + 0x10 * (n)) | ||
| 26 | #define V850E_TIMER_D_TMD(n) (*(volatile u16 *)V850E_TIMER_D_TMD_ADDR(n)) | ||
| 27 | |||
| 28 | /* Count compare registers for timer D. */ | ||
| 29 | #define V850E_TIMER_D_CMD_ADDR(n) (V850E_TIMER_D_CMD_BASE_ADDR + 0x10 * (n)) | ||
| 30 | #define V850E_TIMER_D_CMD(n) (*(volatile u16 *)V850E_TIMER_D_CMD_ADDR(n)) | ||
| 31 | |||
| 32 | /* Control registers for timer D. */ | ||
| 33 | #define V850E_TIMER_D_TMCD_ADDR(n) (V850E_TIMER_D_TMCD_BASE_ADDR + 0x10 * (n)) | ||
| 34 | #define V850E_TIMER_D_TMCD(n) (*(volatile u8 *)V850E_TIMER_D_TMCD_ADDR(n)) | ||
| 35 | /* Control bits for timer D. */ | ||
| 36 | #define V850E_TIMER_D_TMCD_CE 0x2 /* count enable */ | ||
| 37 | #define V850E_TIMER_D_TMCD_CAE 0x1 /* clock action enable */ | ||
| 38 | /* Clock divider setting (log2). */ | ||
| 39 | #define V850E_TIMER_D_TMCD_CS(divlog2) (((divlog2) - V850E_TIMER_D_TMCD_CS_MIN) << 4) | ||
| 40 | /* Minimum clock divider setting (log2). */ | ||
| 41 | #ifndef V850E_TIMER_D_TMCD_CS_MIN /* Can be overridden by mach-specific hdrs */ | ||
| 42 | #define V850E_TIMER_D_TMCD_CS_MIN 2 /* Default is correct for the v850e/ma1 */ | ||
| 43 | #endif | ||
| 44 | /* Maximum clock divider setting (log2). */ | ||
| 45 | #define V850E_TIMER_D_TMCD_CS_MAX (V850E_TIMER_D_TMCD_CS_MIN + 7) | ||
| 46 | |||
| 47 | /* Return the clock-divider (log2) of timer D unit N. */ | ||
| 48 | #define V850E_TIMER_D_DIVLOG2(n) \ | ||
| 49 | (((V850E_TIMER_D_TMCD(n) >> 4) & 0x7) + V850E_TIMER_D_TMCD_CS_MIN) | ||
| 50 | |||
| 51 | |||
| 52 | #ifndef __ASSEMBLY__ | ||
| 53 | |||
| 54 | /* Start interval timer TIMER (0-3). The timer will issue the | ||
| 55 | corresponding INTCMD interrupt RATE times per second. This function | ||
| 56 | does not enable the interrupt. */ | ||
| 57 | extern void v850e_timer_d_configure (unsigned timer, unsigned rate); | ||
| 58 | |||
| 59 | #endif /* !__ASSEMBLY__ */ | ||
| 60 | |||
| 61 | |||
| 62 | #endif /* __V850_V850E_TIMER_D_H__ */ | ||
diff --git a/include/asm-v850/v850e_uart.h b/include/asm-v850/v850e_uart.h deleted file mode 100644 index 5182fb4cc989..000000000000 --- a/include/asm-v850/v850e_uart.h +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_uart.h -- common V850E on-chip UART driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | /* There's not actually a single UART implementation used by V850E CPUs, | ||
| 15 | but rather a series of implementations that are all `close' to one | ||
| 16 | another. This file corresponds to the single driver which handles all | ||
| 17 | of them. */ | ||
| 18 | |||
| 19 | #ifndef __V850_V850E_UART_H__ | ||
| 20 | #define __V850_V850E_UART_H__ | ||
| 21 | |||
| 22 | #include <linux/termios.h> | ||
| 23 | |||
| 24 | #include <asm/v850e_utils.h> | ||
| 25 | #include <asm/types.h> | ||
| 26 | #include <asm/machdep.h> /* Pick up chip-specific defs. */ | ||
| 27 | |||
| 28 | |||
| 29 | /* Include model-specific definitions. */ | ||
| 30 | #ifdef CONFIG_V850E_UART | ||
| 31 | # ifdef CONFIG_V850E_UARTB | ||
| 32 | # include <asm-v850/v850e_uartb.h> | ||
| 33 | # else | ||
| 34 | # include <asm-v850/v850e_uarta.h> /* original V850E UART */ | ||
| 35 | # endif | ||
| 36 | #endif | ||
| 37 | |||
| 38 | |||
| 39 | /* Optional capabilities some hardware provides. */ | ||
| 40 | |||
| 41 | /* This UART doesn't implement RTS/CTS by default, but some platforms | ||
| 42 | implement them externally, so check to see if <asm/machdep.h> defined | ||
| 43 | anything. */ | ||
| 44 | #ifdef V850E_UART_CTS | ||
| 45 | #define v850e_uart_cts(n) V850E_UART_CTS(n) | ||
| 46 | #else | ||
| 47 | #define v850e_uart_cts(n) (1) | ||
| 48 | #endif | ||
| 49 | |||
| 50 | /* Do the same for RTS. */ | ||
| 51 | #ifdef V850E_UART_SET_RTS | ||
| 52 | #define v850e_uart_set_rts(n,v) V850E_UART_SET_RTS(n,v) | ||
| 53 | #else | ||
| 54 | #define v850e_uart_set_rts(n,v) ((void)0) | ||
| 55 | #endif | ||
| 56 | |||
| 57 | |||
| 58 | /* This is the serial channel to use for the boot console (if desired). */ | ||
| 59 | #ifndef V850E_UART_CONSOLE_CHANNEL | ||
| 60 | # define V850E_UART_CONSOLE_CHANNEL 0 | ||
| 61 | #endif | ||
| 62 | |||
| 63 | |||
| 64 | #ifndef __ASSEMBLY__ | ||
| 65 | |||
| 66 | /* Setup a console using channel 0 of the builtin uart. */ | ||
| 67 | extern void v850e_uart_cons_init (unsigned chan); | ||
| 68 | |||
| 69 | /* Configure and turn on uart channel CHAN, using the termios `control | ||
| 70 | modes' bits in CFLAGS, and a baud-rate of BAUD. */ | ||
| 71 | void v850e_uart_configure (unsigned chan, unsigned cflags, unsigned baud); | ||
| 72 | |||
| 73 | #endif /* !__ASSEMBLY__ */ | ||
| 74 | |||
| 75 | |||
| 76 | #endif /* __V850_V850E_UART_H__ */ | ||
diff --git a/include/asm-v850/v850e_uarta.h b/include/asm-v850/v850e_uarta.h deleted file mode 100644 index e483e0950725..000000000000 --- a/include/asm-v850/v850e_uarta.h +++ /dev/null | |||
| @@ -1,278 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_uarta.h -- original V850E on-chip UART | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | /* This is the original V850E UART implementation is called just `UART' in | ||
| 15 | the docs, but we name this header file <asm/v850e_uarta.h> because the | ||
| 16 | name <asm/v850e_uart.h> is used for the common driver that handles both | ||
| 17 | `UART' and `UARTB' implementations. */ | ||
| 18 | |||
| 19 | #ifndef __V850_V850E_UARTA_H__ | ||
| 20 | #define __V850_V850E_UARTA_H__ | ||
| 21 | |||
| 22 | |||
| 23 | /* Raw hardware interface. */ | ||
| 24 | |||
| 25 | /* The base address of the UART control registers for channel N. | ||
| 26 | The default is the address used on the V850E/MA1. */ | ||
| 27 | #ifndef V850E_UART_BASE_ADDR | ||
| 28 | #define V850E_UART_BASE_ADDR(n) (0xFFFFFA00 + 0x10 * (n)) | ||
| 29 | #endif | ||
| 30 | |||
| 31 | /* Addresses of specific UART control registers for channel N. | ||
| 32 | The defaults are the addresses used on the V850E/MA1; if a platform | ||
| 33 | wants to redefine any of these, it must redefine them all. */ | ||
| 34 | #ifndef V850E_UART_ASIM_ADDR | ||
| 35 | #define V850E_UART_ASIM_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x0) | ||
| 36 | #define V850E_UART_RXB_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x2) | ||
| 37 | #define V850E_UART_ASIS_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x3) | ||
| 38 | #define V850E_UART_TXB_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x4) | ||
| 39 | #define V850E_UART_ASIF_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x5) | ||
| 40 | #define V850E_UART_CKSR_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x6) | ||
| 41 | #define V850E_UART_BRGC_ADDR(n) (V850E_UART_BASE_ADDR(n) + 0x7) | ||
| 42 | #endif | ||
| 43 | |||
| 44 | /* UART config registers. */ | ||
| 45 | #define V850E_UART_ASIM(n) (*(volatile u8 *)V850E_UART_ASIM_ADDR(n)) | ||
| 46 | /* Control bits for config registers. */ | ||
| 47 | #define V850E_UART_ASIM_CAE 0x80 /* clock enable */ | ||
| 48 | #define V850E_UART_ASIM_TXE 0x40 /* transmit enable */ | ||
| 49 | #define V850E_UART_ASIM_RXE 0x20 /* receive enable */ | ||
| 50 | #define V850E_UART_ASIM_PS_MASK 0x18 /* mask covering parity-select bits */ | ||
| 51 | #define V850E_UART_ASIM_PS_NONE 0x00 /* no parity */ | ||
| 52 | #define V850E_UART_ASIM_PS_ZERO 0x08 /* zero parity */ | ||
| 53 | #define V850E_UART_ASIM_PS_ODD 0x10 /* odd parity */ | ||
| 54 | #define V850E_UART_ASIM_PS_EVEN 0x18 /* even parity */ | ||
| 55 | #define V850E_UART_ASIM_CL_8 0x04 /* char len is 8 bits (otherwise, 7) */ | ||
| 56 | #define V850E_UART_ASIM_SL_2 0x02 /* 2 stop bits (otherwise, 1) */ | ||
| 57 | #define V850E_UART_ASIM_ISRM 0x01 /* generate INTSR interrupt on errors | ||
| 58 | (otherwise, generate INTSER) */ | ||
| 59 | |||
| 60 | /* UART serial interface status registers. */ | ||
| 61 | #define V850E_UART_ASIS(n) (*(volatile u8 *)V850E_UART_ASIS_ADDR(n)) | ||
| 62 | /* Control bits for status registers. */ | ||
| 63 | #define V850E_UART_ASIS_PE 0x04 /* parity error */ | ||
| 64 | #define V850E_UART_ASIS_FE 0x02 /* framing error */ | ||
| 65 | #define V850E_UART_ASIS_OVE 0x01 /* overrun error */ | ||
| 66 | |||
| 67 | /* UART serial interface transmission status registers. */ | ||
| 68 | #define V850E_UART_ASIF(n) (*(volatile u8 *)V850E_UART_ASIF_ADDR(n)) | ||
| 69 | #define V850E_UART_ASIF_TXBF 0x02 /* transmit buffer flag (data in TXB) */ | ||
| 70 | #define V850E_UART_ASIF_TXSF 0x01 /* transmit shift flag (sending data) */ | ||
| 71 | |||
| 72 | /* UART receive buffer register. */ | ||
| 73 | #define V850E_UART_RXB(n) (*(volatile u8 *)V850E_UART_RXB_ADDR(n)) | ||
| 74 | |||
| 75 | /* UART transmit buffer register. */ | ||
| 76 | #define V850E_UART_TXB(n) (*(volatile u8 *)V850E_UART_TXB_ADDR(n)) | ||
| 77 | |||
| 78 | /* UART baud-rate generator control registers. */ | ||
| 79 | #define V850E_UART_CKSR(n) (*(volatile u8 *)V850E_UART_CKSR_ADDR(n)) | ||
| 80 | #define V850E_UART_CKSR_MAX 11 | ||
| 81 | #define V850E_UART_BRGC(n) (*(volatile u8 *)V850E_UART_BRGC_ADDR(n)) | ||
| 82 | #define V850E_UART_BRGC_MIN 8 | ||
| 83 | |||
| 84 | |||
| 85 | #ifndef V850E_UART_CKSR_MAX_FREQ | ||
| 86 | #define V850E_UART_CKSR_MAX_FREQ (25*1000*1000) | ||
| 87 | #endif | ||
| 88 | |||
| 89 | /* Calculate the minimum value for CKSR on this processor. */ | ||
| 90 | static inline unsigned v850e_uart_cksr_min (void) | ||
| 91 | { | ||
| 92 | int min = 0; | ||
| 93 | unsigned freq = V850E_UART_BASE_FREQ; | ||
| 94 | while (freq > V850E_UART_CKSR_MAX_FREQ) { | ||
| 95 | freq >>= 1; | ||
| 96 | min++; | ||
| 97 | } | ||
| 98 | return min; | ||
| 99 | } | ||
| 100 | |||
| 101 | |||
| 102 | /* Slightly abstract interface used by driver. */ | ||
| 103 | |||
| 104 | |||
| 105 | /* Interrupts used by the UART. */ | ||
| 106 | |||
| 107 | /* Received when the most recently transmitted character has been sent. */ | ||
| 108 | #define V850E_UART_TX_IRQ(chan) IRQ_INTST (chan) | ||
| 109 | /* Received when a new character has been received. */ | ||
| 110 | #define V850E_UART_RX_IRQ(chan) IRQ_INTSR (chan) | ||
| 111 | |||
| 112 | |||
| 113 | /* UART clock generator interface. */ | ||
| 114 | |||
| 115 | /* This type encapsulates a particular uart frequency. */ | ||
| 116 | typedef struct { | ||
| 117 | unsigned clk_divlog2; | ||
| 118 | unsigned brgen_count; | ||
| 119 | } v850e_uart_speed_t; | ||
| 120 | |||
| 121 | /* Calculate a uart speed from BAUD for this uart. */ | ||
| 122 | static inline v850e_uart_speed_t v850e_uart_calc_speed (unsigned baud) | ||
| 123 | { | ||
| 124 | v850e_uart_speed_t speed; | ||
| 125 | |||
| 126 | /* Calculate the log2 clock divider and baud-rate counter values | ||
| 127 | (note that the UART divides the resulting clock by 2, so | ||
| 128 | multiply BAUD by 2 here to compensate). */ | ||
| 129 | calc_counter_params (V850E_UART_BASE_FREQ, baud * 2, | ||
| 130 | v850e_uart_cksr_min(), | ||
| 131 | V850E_UART_CKSR_MAX, 8/*bits*/, | ||
| 132 | &speed.clk_divlog2, &speed.brgen_count); | ||
| 133 | |||
| 134 | return speed; | ||
| 135 | } | ||
| 136 | |||
| 137 | /* Return the current speed of uart channel CHAN. */ | ||
| 138 | static inline v850e_uart_speed_t v850e_uart_speed (unsigned chan) | ||
| 139 | { | ||
| 140 | v850e_uart_speed_t speed; | ||
| 141 | speed.clk_divlog2 = V850E_UART_CKSR (chan); | ||
| 142 | speed.brgen_count = V850E_UART_BRGC (chan); | ||
| 143 | return speed; | ||
| 144 | } | ||
| 145 | |||
| 146 | /* Set the current speed of uart channel CHAN. */ | ||
| 147 | static inline void v850e_uart_set_speed(unsigned chan,v850e_uart_speed_t speed) | ||
| 148 | { | ||
| 149 | V850E_UART_CKSR (chan) = speed.clk_divlog2; | ||
| 150 | V850E_UART_BRGC (chan) = speed.brgen_count; | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline int | ||
| 154 | v850e_uart_speed_eq (v850e_uart_speed_t speed1, v850e_uart_speed_t speed2) | ||
| 155 | { | ||
| 156 | return speed1.clk_divlog2 == speed2.clk_divlog2 | ||
| 157 | && speed1.brgen_count == speed2.brgen_count; | ||
| 158 | } | ||
| 159 | |||
| 160 | /* Minimum baud rate possible. */ | ||
| 161 | #define v850e_uart_min_baud() \ | ||
| 162 | ((V850E_UART_BASE_FREQ >> V850E_UART_CKSR_MAX) / (2 * 255) + 1) | ||
| 163 | |||
| 164 | /* Maximum baud rate possible. The error is quite high at max, though. */ | ||
| 165 | #define v850e_uart_max_baud() \ | ||
| 166 | ((V850E_UART_BASE_FREQ >> v850e_uart_cksr_min()) / (2 *V850E_UART_BRGC_MIN)) | ||
| 167 | |||
| 168 | /* The `maximum' clock rate the uart can used, which is wanted (though not | ||
| 169 | really used in any useful way) by the serial framework. */ | ||
| 170 | #define v850e_uart_max_clock() \ | ||
| 171 | ((V850E_UART_BASE_FREQ >> v850e_uart_cksr_min()) / 2) | ||
| 172 | |||
| 173 | |||
| 174 | /* UART configuration interface. */ | ||
| 175 | |||
| 176 | /* Type of the uart config register; must be a scalar. */ | ||
| 177 | typedef u16 v850e_uart_config_t; | ||
| 178 | |||
| 179 | /* The uart hardware config register for channel CHAN. */ | ||
| 180 | #define V850E_UART_CONFIG(chan) V850E_UART_ASIM (chan) | ||
| 181 | |||
| 182 | /* This config bit set if the uart is enabled. */ | ||
| 183 | #define V850E_UART_CONFIG_ENABLED V850E_UART_ASIM_CAE | ||
| 184 | /* If the uart _isn't_ enabled, store this value to it to do so. */ | ||
| 185 | #define V850E_UART_CONFIG_INIT V850E_UART_ASIM_CAE | ||
| 186 | /* Store this config value to disable the uart channel completely. */ | ||
| 187 | #define V850E_UART_CONFIG_FINI 0 | ||
| 188 | |||
| 189 | /* Setting/clearing these bits enable/disable TX/RX, respectively (but | ||
| 190 | otherwise generally leave things running). */ | ||
| 191 | #define V850E_UART_CONFIG_RX_ENABLE V850E_UART_ASIM_RXE | ||
| 192 | #define V850E_UART_CONFIG_TX_ENABLE V850E_UART_ASIM_TXE | ||
| 193 | |||
| 194 | /* These masks define which config bits affect TX/RX modes, respectively. */ | ||
| 195 | #define V850E_UART_CONFIG_RX_BITS \ | ||
| 196 | (V850E_UART_ASIM_PS_MASK | V850E_UART_ASIM_CL_8 | V850E_UART_ASIM_ISRM) | ||
| 197 | #define V850E_UART_CONFIG_TX_BITS \ | ||
| 198 | (V850E_UART_ASIM_PS_MASK | V850E_UART_ASIM_CL_8 | V850E_UART_ASIM_SL_2) | ||
| 199 | |||
| 200 | static inline v850e_uart_config_t v850e_uart_calc_config (unsigned cflags) | ||
| 201 | { | ||
| 202 | v850e_uart_config_t config = 0; | ||
| 203 | |||
| 204 | /* Figure out new configuration of control register. */ | ||
| 205 | if (cflags & CSTOPB) | ||
| 206 | /* Number of stop bits, 1 or 2. */ | ||
| 207 | config |= V850E_UART_ASIM_SL_2; | ||
| 208 | if ((cflags & CSIZE) == CS8) | ||
| 209 | /* Number of data bits, 7 or 8. */ | ||
| 210 | config |= V850E_UART_ASIM_CL_8; | ||
| 211 | if (! (cflags & PARENB)) | ||
| 212 | /* No parity check/generation. */ | ||
| 213 | config |= V850E_UART_ASIM_PS_NONE; | ||
| 214 | else if (cflags & PARODD) | ||
| 215 | /* Odd parity check/generation. */ | ||
| 216 | config |= V850E_UART_ASIM_PS_ODD; | ||
| 217 | else | ||
| 218 | /* Even parity check/generation. */ | ||
| 219 | config |= V850E_UART_ASIM_PS_EVEN; | ||
| 220 | if (cflags & CREAD) | ||
| 221 | /* Reading enabled. */ | ||
| 222 | config |= V850E_UART_ASIM_RXE; | ||
| 223 | |||
| 224 | config |= V850E_UART_ASIM_CAE; | ||
| 225 | config |= V850E_UART_ASIM_TXE; /* Writing is always enabled. */ | ||
| 226 | config |= V850E_UART_ASIM_ISRM; /* Errors generate a read-irq. */ | ||
| 227 | |||
| 228 | return config; | ||
| 229 | } | ||
| 230 | |||
| 231 | /* This should delay as long as necessary for a recently written config | ||
| 232 | setting to settle, before we turn the uart back on. */ | ||
| 233 | static inline void | ||
| 234 | v850e_uart_config_delay (v850e_uart_config_t config, v850e_uart_speed_t speed) | ||
| 235 | { | ||
| 236 | /* The UART may not be reset properly unless we wait at least 2 | ||
| 237 | `basic-clocks' until turning on the TXE/RXE bits again. | ||
| 238 | A `basic clock' is the clock used by the baud-rate generator, | ||
| 239 | i.e., the cpu clock divided by the 2^new_clk_divlog2. | ||
| 240 | The loop takes 2 insns, so loop CYCLES / 2 times. */ | ||
| 241 | register unsigned count = 1 << speed.clk_divlog2; | ||
| 242 | while (--count != 0) | ||
| 243 | /* nothing */; | ||
| 244 | } | ||
| 245 | |||
| 246 | |||
| 247 | /* RX/TX interface. */ | ||
| 248 | |||
| 249 | /* Return true if all characters awaiting transmission on uart channel N | ||
| 250 | have been transmitted. */ | ||
| 251 | #define v850e_uart_xmit_done(n) \ | ||
| 252 | (! (V850E_UART_ASIF(n) & V850E_UART_ASIF_TXBF)) | ||
| 253 | /* Wait for this to be true. */ | ||
| 254 | #define v850e_uart_wait_for_xmit_done(n) \ | ||
| 255 | do { } while (! v850e_uart_xmit_done (n)) | ||
| 256 | |||
| 257 | /* Return true if uart channel N is ready to transmit a character. */ | ||
| 258 | #define v850e_uart_xmit_ok(n) \ | ||
| 259 | (v850e_uart_xmit_done(n) && v850e_uart_cts(n)) | ||
| 260 | /* Wait for this to be true. */ | ||
| 261 | #define v850e_uart_wait_for_xmit_ok(n) \ | ||
| 262 | do { } while (! v850e_uart_xmit_ok (n)) | ||
| 263 | |||
| 264 | /* Write character CH to uart channel CHAN. */ | ||
| 265 | #define v850e_uart_putc(chan, ch) (V850E_UART_TXB(chan) = (ch)) | ||
| 266 | |||
| 267 | /* Return latest character read on channel CHAN. */ | ||
| 268 | #define v850e_uart_getc(chan) V850E_UART_RXB (chan) | ||
| 269 | |||
| 270 | /* Return bit-mask of uart error status. */ | ||
| 271 | #define v850e_uart_err(chan) V850E_UART_ASIS (chan) | ||
| 272 | /* Various error bits set in the error result. */ | ||
| 273 | #define V850E_UART_ERR_OVERRUN V850E_UART_ASIS_OVE | ||
| 274 | #define V850E_UART_ERR_FRAME V850E_UART_ASIS_FE | ||
| 275 | #define V850E_UART_ERR_PARITY V850E_UART_ASIS_PE | ||
| 276 | |||
| 277 | |||
| 278 | #endif /* __V850_V850E_UARTA_H__ */ | ||
diff --git a/include/asm-v850/v850e_uartb.h b/include/asm-v850/v850e_uartb.h deleted file mode 100644 index 6d4767d5a835..000000000000 --- a/include/asm-v850/v850e_uartb.h +++ /dev/null | |||
| @@ -1,262 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_uartb.h -- V850E on-chip `UARTB' UART | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | ||
| 5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General | ||
| 8 | * Public License. See the file COPYING in the main directory of this | ||
| 9 | * archive for more details. | ||
| 10 | * | ||
| 11 | * Written by Miles Bader <miles@gnu.org> | ||
| 12 | */ | ||
| 13 | |||
| 14 | /* The V850E UARTB is basically a superset of the original V850E UART, but | ||
| 15 | even where it's the same, the names and details have changed a bit. | ||
| 16 | It's similar enough to use the same driver (v850e_uart.c), but the | ||
| 17 | details have been abstracted slightly to do so. */ | ||
| 18 | |||
| 19 | #ifndef __V850_V850E_UARTB_H__ | ||
| 20 | #define __V850_V850E_UARTB_H__ | ||
| 21 | |||
| 22 | |||
| 23 | /* Raw hardware interface. */ | ||
| 24 | |||
| 25 | #define V850E_UARTB_BASE_ADDR(n) (0xFFFFFA00 + 0x10 * (n)) | ||
| 26 | |||
| 27 | /* Addresses of specific UART control registers for channel N. */ | ||
| 28 | #define V850E_UARTB_CTL0_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0x0) | ||
| 29 | #define V850E_UARTB_CTL2_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0x2) | ||
| 30 | #define V850E_UARTB_STR_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0x4) | ||
| 31 | #define V850E_UARTB_RX_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0x6) | ||
| 32 | #define V850E_UARTB_RXAP_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0x6) | ||
| 33 | #define V850E_UARTB_TX_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0x8) | ||
| 34 | #define V850E_UARTB_FIC0_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0xA) | ||
| 35 | #define V850E_UARTB_FIC1_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0xB) | ||
| 36 | #define V850E_UARTB_FIC2_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0xC) | ||
| 37 | #define V850E_UARTB_FIS0_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0xE) | ||
| 38 | #define V850E_UARTB_FIS1_ADDR(n) (V850E_UARTB_BASE_ADDR(n) + 0xF) | ||
| 39 | |||
| 40 | /* UARTB control register 0 (general config). */ | ||
| 41 | #define V850E_UARTB_CTL0(n) (*(volatile u8 *)V850E_UARTB_CTL0_ADDR(n)) | ||
| 42 | /* Control bits for config registers. */ | ||
| 43 | #define V850E_UARTB_CTL0_PWR 0x80 /* clock enable */ | ||
| 44 | #define V850E_UARTB_CTL0_TXE 0x40 /* transmit enable */ | ||
| 45 | #define V850E_UARTB_CTL0_RXE 0x20 /* receive enable */ | ||
| 46 | #define V850E_UARTB_CTL0_DIR 0x10 /* */ | ||
| 47 | #define V850E_UARTB_CTL0_PS1 0x08 /* parity */ | ||
| 48 | #define V850E_UARTB_CTL0_PS0 0x04 /* parity */ | ||
| 49 | #define V850E_UARTB_CTL0_CL 0x02 /* char len 1:8bit, 0:7bit */ | ||
| 50 | #define V850E_UARTB_CTL0_SL 0x01 /* stop bit 1:2bit, 0:1bit */ | ||
| 51 | #define V850E_UARTB_CTL0_PS_MASK 0x0C /* mask covering parity bits */ | ||
| 52 | #define V850E_UARTB_CTL0_PS_NONE 0x00 /* no parity */ | ||
| 53 | #define V850E_UARTB_CTL0_PS_ZERO 0x04 /* zero parity */ | ||
| 54 | #define V850E_UARTB_CTL0_PS_ODD 0x08 /* odd parity */ | ||
| 55 | #define V850E_UARTB_CTL0_PS_EVEN 0x0C /* even parity */ | ||
| 56 | #define V850E_UARTB_CTL0_CL_8 0x02 /* char len 1:8bit, 0:7bit */ | ||
| 57 | #define V850E_UARTB_CTL0_SL_2 0x01 /* stop bit 1:2bit, 0:1bit */ | ||
| 58 | |||
| 59 | /* UARTB control register 2 (clock divider). */ | ||
| 60 | #define V850E_UARTB_CTL2(n) (*(volatile u16 *)V850E_UARTB_CTL2_ADDR(n)) | ||
| 61 | #define V850E_UARTB_CTL2_MIN 4 | ||
| 62 | #define V850E_UARTB_CTL2_MAX 0xFFFF | ||
| 63 | |||
| 64 | /* UARTB serial interface status register. */ | ||
| 65 | #define V850E_UARTB_STR(n) (*(volatile u8 *)V850E_UARTB_STR_ADDR(n)) | ||
| 66 | /* Control bits for status registers. */ | ||
| 67 | #define V850E_UARTB_STR_TSF 0x80 /* UBTX or FIFO exist data */ | ||
| 68 | #define V850E_UARTB_STR_OVF 0x08 /* overflow error */ | ||
| 69 | #define V850E_UARTB_STR_PE 0x04 /* parity error */ | ||
| 70 | #define V850E_UARTB_STR_FE 0x02 /* framing error */ | ||
| 71 | #define V850E_UARTB_STR_OVE 0x01 /* overrun error */ | ||
| 72 | |||
| 73 | /* UARTB receive data register. */ | ||
| 74 | #define V850E_UARTB_RX(n) (*(volatile u8 *)V850E_UARTB_RX_ADDR(n)) | ||
| 75 | #define V850E_UARTB_RXAP(n) (*(volatile u16 *)V850E_UARTB_RXAP_ADDR(n)) | ||
| 76 | /* Control bits for status registers. */ | ||
| 77 | #define V850E_UARTB_RXAP_PEF 0x0200 /* parity error */ | ||
| 78 | #define V850E_UARTB_RXAP_FEF 0x0100 /* framing error */ | ||
| 79 | |||
| 80 | /* UARTB transmit data register. */ | ||
| 81 | #define V850E_UARTB_TX(n) (*(volatile u8 *)V850E_UARTB_TX_ADDR(n)) | ||
| 82 | |||
| 83 | /* UARTB FIFO control register 0. */ | ||
| 84 | #define V850E_UARTB_FIC0(n) (*(volatile u8 *)V850E_UARTB_FIC0_ADDR(n)) | ||
| 85 | |||
| 86 | /* UARTB FIFO control register 1. */ | ||
| 87 | #define V850E_UARTB_FIC1(n) (*(volatile u8 *)V850E_UARTB_FIC1_ADDR(n)) | ||
| 88 | |||
| 89 | /* UARTB FIFO control register 2. */ | ||
| 90 | #define V850E_UARTB_FIC2(n) (*(volatile u16 *)V850E_UARTB_FIC2_ADDR(n)) | ||
| 91 | |||
| 92 | /* UARTB FIFO status register 0. */ | ||
| 93 | #define V850E_UARTB_FIS0(n) (*(volatile u8 *)V850E_UARTB_FIS0_ADDR(n)) | ||
| 94 | |||
| 95 | /* UARTB FIFO status register 1. */ | ||
| 96 | #define V850E_UARTB_FIS1(n) (*(volatile u8 *)V850E_UARTB_FIS1_ADDR(n)) | ||
| 97 | |||
| 98 | |||
| 99 | /* Slightly abstract interface used by driver. */ | ||
| 100 | |||
| 101 | |||
| 102 | /* Interrupts used by the UART. */ | ||
| 103 | |||
| 104 | /* Received when the most recently transmitted character has been sent. */ | ||
| 105 | #define V850E_UART_TX_IRQ(chan) IRQ_INTUBTIT (chan) | ||
| 106 | /* Received when a new character has been received. */ | ||
| 107 | #define V850E_UART_RX_IRQ(chan) IRQ_INTUBTIR (chan) | ||
| 108 | |||
| 109 | /* Use by serial driver for information purposes. */ | ||
| 110 | #define V850E_UART_BASE_ADDR(chan) V850E_UARTB_BASE_ADDR(chan) | ||
| 111 | |||
| 112 | |||
| 113 | /* UART clock generator interface. */ | ||
| 114 | |||
| 115 | /* This type encapsulates a particular uart frequency. */ | ||
| 116 | typedef u16 v850e_uart_speed_t; | ||
| 117 | |||
| 118 | /* Calculate a uart speed from BAUD for this uart. */ | ||
| 119 | static inline v850e_uart_speed_t v850e_uart_calc_speed (unsigned baud) | ||
| 120 | { | ||
| 121 | v850e_uart_speed_t speed; | ||
| 122 | |||
| 123 | /* | ||
| 124 | * V850E/ME2 UARTB baud rate is determined by the value of UBCTL2 | ||
| 125 | * fx = V850E_UARTB_BASE_FREQ = CPU_CLOCK_FREQ/4 | ||
| 126 | * baud = fx / 2*speed [ speed >= 4 ] | ||
| 127 | */ | ||
| 128 | speed = V850E_UARTB_CTL2_MIN; | ||
| 129 | while (((V850E_UARTB_BASE_FREQ / 2) / speed ) > baud) | ||
| 130 | speed++; | ||
| 131 | |||
| 132 | return speed; | ||
| 133 | } | ||
| 134 | |||
| 135 | /* Return the current speed of uart channel CHAN. */ | ||
| 136 | #define v850e_uart_speed(chan) V850E_UARTB_CTL2 (chan) | ||
| 137 | |||
| 138 | /* Set the current speed of uart channel CHAN. */ | ||
| 139 | #define v850e_uart_set_speed(chan, speed) (V850E_UARTB_CTL2 (chan) = (speed)) | ||
| 140 | |||
| 141 | /* Return true if SPEED1 and SPEED2 are the same. */ | ||
| 142 | #define v850e_uart_speed_eq(speed1, speed2) ((speed1) == (speed2)) | ||
| 143 | |||
| 144 | /* Minimum baud rate possible. */ | ||
| 145 | #define v850e_uart_min_baud() \ | ||
| 146 | ((V850E_UARTB_BASE_FREQ / 2) / V850E_UARTB_CTL2_MAX) | ||
| 147 | |||
| 148 | /* Maximum baud rate possible. The error is quite high at max, though. */ | ||
| 149 | #define v850e_uart_max_baud() \ | ||
| 150 | ((V850E_UARTB_BASE_FREQ / 2) / V850E_UARTB_CTL2_MIN) | ||
| 151 | |||
| 152 | /* The `maximum' clock rate the uart can used, which is wanted (though not | ||
| 153 | really used in any useful way) by the serial framework. */ | ||
| 154 | #define v850e_uart_max_clock() \ | ||
| 155 | (V850E_UARTB_BASE_FREQ / 2) | ||
| 156 | |||
| 157 | |||
| 158 | /* UART configuration interface. */ | ||
| 159 | |||
| 160 | /* Type of the uart config register; must be a scalar. */ | ||
| 161 | typedef u16 v850e_uart_config_t; | ||
| 162 | |||
| 163 | /* The uart hardware config register for channel CHAN. */ | ||
| 164 | #define V850E_UART_CONFIG(chan) V850E_UARTB_CTL0 (chan) | ||
| 165 | |||
| 166 | /* This config bit set if the uart is enabled. */ | ||
| 167 | #define V850E_UART_CONFIG_ENABLED V850E_UARTB_CTL0_PWR | ||
| 168 | /* If the uart _isn't_ enabled, store this value to it to do so. */ | ||
| 169 | #define V850E_UART_CONFIG_INIT V850E_UARTB_CTL0_PWR | ||
| 170 | /* Store this config value to disable the uart channel completely. */ | ||
| 171 | #define V850E_UART_CONFIG_FINI 0 | ||
| 172 | |||
| 173 | /* Setting/clearing these bits enable/disable TX/RX, respectively (but | ||
| 174 | otherwise generally leave things running). */ | ||
| 175 | #define V850E_UART_CONFIG_RX_ENABLE V850E_UARTB_CTL0_RXE | ||
| 176 | #define V850E_UART_CONFIG_TX_ENABLE V850E_UARTB_CTL0_TXE | ||
| 177 | |||
| 178 | /* These masks define which config bits affect TX/RX modes, respectively. */ | ||
| 179 | #define V850E_UART_CONFIG_RX_BITS \ | ||
| 180 | (V850E_UARTB_CTL0_PS_MASK | V850E_UARTB_CTL0_CL_8) | ||
| 181 | #define V850E_UART_CONFIG_TX_BITS \ | ||
| 182 | (V850E_UARTB_CTL0_PS_MASK | V850E_UARTB_CTL0_CL_8 | V850E_UARTB_CTL0_SL_2) | ||
| 183 | |||
| 184 | static inline v850e_uart_config_t v850e_uart_calc_config (unsigned cflags) | ||
| 185 | { | ||
| 186 | v850e_uart_config_t config = 0; | ||
| 187 | |||
| 188 | /* Figure out new configuration of control register. */ | ||
| 189 | if (cflags & CSTOPB) | ||
| 190 | /* Number of stop bits, 1 or 2. */ | ||
| 191 | config |= V850E_UARTB_CTL0_SL_2; | ||
| 192 | if ((cflags & CSIZE) == CS8) | ||
| 193 | /* Number of data bits, 7 or 8. */ | ||
| 194 | config |= V850E_UARTB_CTL0_CL_8; | ||
| 195 | if (! (cflags & PARENB)) | ||
| 196 | /* No parity check/generation. */ | ||
| 197 | config |= V850E_UARTB_CTL0_PS_NONE; | ||
| 198 | else if (cflags & PARODD) | ||
| 199 | /* Odd parity check/generation. */ | ||
| 200 | config |= V850E_UARTB_CTL0_PS_ODD; | ||
| 201 | else | ||
| 202 | /* Even parity check/generation. */ | ||
| 203 | config |= V850E_UARTB_CTL0_PS_EVEN; | ||
| 204 | if (cflags & CREAD) | ||
| 205 | /* Reading enabled. */ | ||
| 206 | config |= V850E_UARTB_CTL0_RXE; | ||
| 207 | |||
| 208 | config |= V850E_UARTB_CTL0_PWR; | ||
| 209 | config |= V850E_UARTB_CTL0_TXE; /* Writing is always enabled. */ | ||
| 210 | config |= V850E_UARTB_CTL0_DIR; /* LSB first. */ | ||
| 211 | |||
| 212 | return config; | ||
| 213 | } | ||
| 214 | |||
| 215 | /* This should delay as long as necessary for a recently written config | ||
| 216 | setting to settle, before we turn the uart back on. */ | ||
| 217 | static inline void | ||
| 218 | v850e_uart_config_delay (v850e_uart_config_t config, v850e_uart_speed_t speed) | ||
| 219 | { | ||
| 220 | /* The UART may not be reset properly unless we wait at least 2 | ||
| 221 | `basic-clocks' until turning on the TXE/RXE bits again. | ||
| 222 | A `basic clock' is the clock used by the baud-rate generator, | ||
| 223 | i.e., the cpu clock divided by the 2^new_clk_divlog2. | ||
| 224 | The loop takes 2 insns, so loop CYCLES / 2 times. */ | ||
| 225 | register unsigned count = 1 << speed; | ||
| 226 | while (--count != 0) | ||
| 227 | /* nothing */; | ||
| 228 | } | ||
| 229 | |||
| 230 | |||
| 231 | /* RX/TX interface. */ | ||
| 232 | |||
| 233 | /* Return true if all characters awaiting transmission on uart channel N | ||
| 234 | have been transmitted. */ | ||
| 235 | #define v850e_uart_xmit_done(n) \ | ||
| 236 | (! (V850E_UARTB_STR(n) & V850E_UARTB_STR_TSF)) | ||
| 237 | /* Wait for this to be true. */ | ||
| 238 | #define v850e_uart_wait_for_xmit_done(n) \ | ||
| 239 | do { } while (! v850e_uart_xmit_done (n)) | ||
| 240 | |||
| 241 | /* Return true if uart channel N is ready to transmit a character. */ | ||
| 242 | #define v850e_uart_xmit_ok(n) \ | ||
| 243 | (v850e_uart_xmit_done(n) && v850e_uart_cts(n)) | ||
| 244 | /* Wait for this to be true. */ | ||
| 245 | #define v850e_uart_wait_for_xmit_ok(n) \ | ||
| 246 | do { } while (! v850e_uart_xmit_ok (n)) | ||
| 247 | |||
| 248 | /* Write character CH to uart channel CHAN. */ | ||
| 249 | #define v850e_uart_putc(chan, ch) (V850E_UARTB_TX(chan) = (ch)) | ||
| 250 | |||
| 251 | /* Return latest character read on channel CHAN. */ | ||
| 252 | #define v850e_uart_getc(chan) V850E_UARTB_RX (chan) | ||
| 253 | |||
| 254 | /* Return bit-mask of uart error status. */ | ||
| 255 | #define v850e_uart_err(chan) V850E_UARTB_STR (chan) | ||
| 256 | /* Various error bits set in the error result. */ | ||
| 257 | #define V850E_UART_ERR_OVERRUN V850E_UARTB_STR_OVE | ||
| 258 | #define V850E_UART_ERR_FRAME V850E_UARTB_STR_FE | ||
| 259 | #define V850E_UART_ERR_PARITY V850E_UARTB_STR_PE | ||
| 260 | |||
| 261 | |||
| 262 | #endif /* __V850_V850E_UARTB_H__ */ | ||
diff --git a/include/asm-v850/v850e_utils.h b/include/asm-v850/v850e_utils.h deleted file mode 100644 index 52eb72822d3d..000000000000 --- a/include/asm-v850/v850e_utils.h +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-v850/v850e_utils.h -- Utility functions associated with | ||
| 3 | * V850E CPUs | ||
| 4 | * | ||
| 5 | * Copyright (C) 2001,03 NEC Electronics Corporation | ||
| 6 | * Copyright (C) 2001,03 Miles Bader <miles@gnu.org> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General | ||
| 9 | * Public License. See the file COPYING in the main directory of this | ||
| 10 | * archive for more details. | ||
| 11 | * | ||
| 12 | * Written by Miles Bader <miles@gnu.org> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __V850_V850E_UTILS_H__ | ||
| 16 | #define __V850_V850E_UTILS_H__ | ||
| 17 | |||
| 18 | /* Calculate counter clock-divider and count values to attain the | ||
| 19 | desired frequency RATE from the base frequency BASE_FREQ. The | ||
| 20 | counter is expected to have a clock-divider, which can divide the | ||
| 21 | system cpu clock by a power of two value from MIN_DIVLOG2 to | ||
| 22 | MAX_DIV_LOG2, and a word-size of COUNTER_SIZE bits (the counter | ||
| 23 | counts up and resets whenever it's equal to the compare register, | ||
| 24 | generating an interrupt or whatever when it does so). The returned | ||
| 25 | values are: *DIVLOG2 -- log2 of the desired clock divider and *COUNT | ||
| 26 | -- the counter compare value to use. Returns true if it was possible | ||
| 27 | to find a reasonable value, otherwise false (and the other return | ||
| 28 | values will be set to be as good as possible). */ | ||
| 29 | extern int calc_counter_params (unsigned long base_freq, | ||
| 30 | unsigned long rate, | ||
| 31 | unsigned min_divlog2, unsigned max_divlog2, | ||
| 32 | unsigned counter_size, | ||
| 33 | unsigned *divlog2, unsigned *count); | ||
| 34 | |||
| 35 | #endif /* __V850_V850E_UTILS_H__ */ | ||
diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 1e3554596f72..4a8e80cdcfa5 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild | |||
| @@ -3,7 +3,6 @@ include include/asm-generic/Kbuild.asm | |||
| 3 | header-y += boot.h | 3 | header-y += boot.h |
| 4 | header-y += bootparam.h | 4 | header-y += bootparam.h |
| 5 | header-y += debugreg.h | 5 | header-y += debugreg.h |
| 6 | header-y += kvm.h | ||
| 7 | header-y += ldt.h | 6 | header-y += ldt.h |
| 8 | header-y += msr-index.h | 7 | header-y += msr-index.h |
| 9 | header-y += prctl.h | 8 | header-y += prctl.h |
| @@ -19,7 +18,6 @@ unifdef-y += msr.h | |||
| 19 | unifdef-y += mtrr.h | 18 | unifdef-y += mtrr.h |
| 20 | unifdef-y += posix_types_32.h | 19 | unifdef-y += posix_types_32.h |
| 21 | unifdef-y += posix_types_64.h | 20 | unifdef-y += posix_types_64.h |
| 22 | unifdef-y += ptrace.h | ||
| 23 | unifdef-y += unistd_32.h | 21 | unifdef-y += unistd_32.h |
| 24 | unifdef-y += unistd_64.h | 22 | unifdef-y += unistd_64.h |
| 25 | unifdef-y += vm86.h | 23 | unifdef-y += vm86.h |
diff --git a/include/asm-x86/device.h b/include/asm-x86/device.h index 87a715367a1b..3c034f48fdb0 100644 --- a/include/asm-x86/device.h +++ b/include/asm-x86/device.h | |||
| @@ -5,6 +5,9 @@ struct dev_archdata { | |||
| 5 | #ifdef CONFIG_ACPI | 5 | #ifdef CONFIG_ACPI |
| 6 | void *acpi_handle; | 6 | void *acpi_handle; |
| 7 | #endif | 7 | #endif |
| 8 | #ifdef CONFIG_X86_64 | ||
| 9 | struct dma_mapping_ops *dma_ops; | ||
| 10 | #endif | ||
| 8 | #ifdef CONFIG_DMAR | 11 | #ifdef CONFIG_DMAR |
| 9 | void *iommu; /* hook for IOMMU specific extension */ | 12 | void *iommu; /* hook for IOMMU specific extension */ |
| 10 | #endif | 13 | #endif |
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h index c2ddd3d1b883..0eaa9bf6011f 100644 --- a/include/asm-x86/dma-mapping.h +++ b/include/asm-x86/dma-mapping.h | |||
| @@ -17,7 +17,8 @@ extern int panic_on_overflow; | |||
| 17 | extern int force_iommu; | 17 | extern int force_iommu; |
| 18 | 18 | ||
| 19 | struct dma_mapping_ops { | 19 | struct dma_mapping_ops { |
| 20 | int (*mapping_error)(dma_addr_t dma_addr); | 20 | int (*mapping_error)(struct device *dev, |
| 21 | dma_addr_t dma_addr); | ||
| 21 | void* (*alloc_coherent)(struct device *dev, size_t size, | 22 | void* (*alloc_coherent)(struct device *dev, size_t size, |
| 22 | dma_addr_t *dma_handle, gfp_t gfp); | 23 | dma_addr_t *dma_handle, gfp_t gfp); |
| 23 | void (*free_coherent)(struct device *dev, size_t size, | 24 | void (*free_coherent)(struct device *dev, size_t size, |
| @@ -56,14 +57,32 @@ struct dma_mapping_ops { | |||
| 56 | int is_phys; | 57 | int is_phys; |
| 57 | }; | 58 | }; |
| 58 | 59 | ||
| 59 | extern const struct dma_mapping_ops *dma_ops; | 60 | extern struct dma_mapping_ops *dma_ops; |
| 60 | 61 | ||
| 61 | static inline int dma_mapping_error(dma_addr_t dma_addr) | 62 | static inline struct dma_mapping_ops *get_dma_ops(struct device *dev) |
| 62 | { | 63 | { |
| 63 | if (dma_ops->mapping_error) | 64 | #ifdef CONFIG_X86_32 |
| 64 | return dma_ops->mapping_error(dma_addr); | 65 | return dma_ops; |
| 66 | #else | ||
| 67 | if (unlikely(!dev) || !dev->archdata.dma_ops) | ||
| 68 | return dma_ops; | ||
| 69 | else | ||
| 70 | return dev->archdata.dma_ops; | ||
| 71 | #endif | ||
| 72 | } | ||
| 73 | |||
| 74 | /* Make sure we keep the same behaviour */ | ||
| 75 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
| 76 | { | ||
| 77 | #ifdef CONFIG_X86_32 | ||
| 78 | return 0; | ||
| 79 | #else | ||
| 80 | struct dma_mapping_ops *ops = get_dma_ops(dev); | ||
| 81 | if (ops->mapping_error) | ||
| 82 | return ops->mapping_error(dev, dma_addr); | ||
| 65 | 83 | ||
| 66 | return (dma_addr == bad_dma_address); | 84 | return (dma_addr == bad_dma_address); |
| 85 | #endif | ||
| 67 | } | 86 | } |
| 68 | 87 | ||
| 69 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 88 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
| @@ -83,44 +102,53 @@ static inline dma_addr_t | |||
| 83 | dma_map_single(struct device *hwdev, void *ptr, size_t size, | 102 | dma_map_single(struct device *hwdev, void *ptr, size_t size, |
| 84 | int direction) | 103 | int direction) |
| 85 | { | 104 | { |
| 105 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); | ||
| 106 | |||
| 86 | BUG_ON(!valid_dma_direction(direction)); | 107 | BUG_ON(!valid_dma_direction(direction)); |
| 87 | return dma_ops->map_single(hwdev, virt_to_phys(ptr), size, direction); | 108 | return ops->map_single(hwdev, virt_to_phys(ptr), size, direction); |
| 88 | } | 109 | } |
| 89 | 110 | ||
| 90 | static inline void | 111 | static inline void |
| 91 | dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size, | 112 | dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size, |
| 92 | int direction) | 113 | int direction) |
| 93 | { | 114 | { |
| 115 | struct dma_mapping_ops *ops = get_dma_ops(dev); | ||
| 116 | |||
| 94 | BUG_ON(!valid_dma_direction(direction)); | 117 | BUG_ON(!valid_dma_direction(direction)); |
| 95 | if (dma_ops->unmap_single) | 118 | if (ops->unmap_single) |
| 96 | dma_ops->unmap_single(dev, addr, size, direction); | 119 | ops->unmap_single(dev, addr, size, direction); |
| 97 | } | 120 | } |
| 98 | 121 | ||
| 99 | static inline int | 122 | static inline int |
| 100 | dma_map_sg(struct device *hwdev, struct scatterlist *sg, | 123 | dma_map_sg(struct device *hwdev, struct scatterlist *sg, |
| 101 | int nents, int direction) | 124 | int nents, int direction) |
| 102 | { | 125 | { |
| 126 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); | ||
| 127 | |||
| 103 | BUG_ON(!valid_dma_direction(direction)); | 128 | BUG_ON(!valid_dma_direction(direction)); |
| 104 | return dma_ops->map_sg(hwdev, sg, nents, direction); | 129 | return ops->map_sg(hwdev, sg, nents, direction); |
| 105 | } | 130 | } |
| 106 | 131 | ||
| 107 | static inline void | 132 | static inline void |
| 108 | dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 133 | dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
| 109 | int direction) | 134 | int direction) |
| 110 | { | 135 | { |
| 136 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); | ||
| 137 | |||
| 111 | BUG_ON(!valid_dma_direction(direction)); | 138 | BUG_ON(!valid_dma_direction(direction)); |
| 112 | if (dma_ops->unmap_sg) | 139 | if (ops->unmap_sg) |
| 113 | dma_ops->unmap_sg(hwdev, sg, nents, direction); | 140 | ops->unmap_sg(hwdev, sg, nents, direction); |
| 114 | } | 141 | } |
| 115 | 142 | ||
| 116 | static inline void | 143 | static inline void |
| 117 | dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle, | 144 | dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle, |
| 118 | size_t size, int direction) | 145 | size_t size, int direction) |
| 119 | { | 146 | { |
| 147 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); | ||
| 148 | |||
| 120 | BUG_ON(!valid_dma_direction(direction)); | 149 | BUG_ON(!valid_dma_direction(direction)); |
| 121 | if (dma_ops->sync_single_for_cpu) | 150 | if (ops->sync_single_for_cpu) |
| 122 | dma_ops->sync_single_for_cpu(hwdev, dma_handle, size, | 151 | ops->sync_single_for_cpu(hwdev, dma_handle, size, direction); |
| 123 | direction); | ||
| 124 | flush_write_buffers(); | 152 | flush_write_buffers(); |
| 125 | } | 153 | } |
| 126 | 154 | ||
| @@ -128,10 +156,11 @@ static inline void | |||
| 128 | dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle, | 156 | dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle, |
| 129 | size_t size, int direction) | 157 | size_t size, int direction) |
| 130 | { | 158 | { |
| 159 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); | ||
| 160 | |||
| 131 | BUG_ON(!valid_dma_direction(direction)); | 161 | BUG_ON(!valid_dma_direction(direction)); |
| 132 | if (dma_ops->sync_single_for_device) | 162 | if (ops->sync_single_for_device) |
| 133 | dma_ops->sync_single_for_device(hwdev, dma_handle, size, | 163 | ops->sync_single_for_device(hwdev, dma_handle, size, direction); |
| 134 | direction); | ||
| 135 | flush_write_buffers(); | 164 | flush_write_buffers(); |
| 136 | } | 165 | } |
| 137 | 166 | ||
| @@ -139,11 +168,12 @@ static inline void | |||
| 139 | dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle, | 168 | dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle, |
| 140 | unsigned long offset, size_t size, int direction) | 169 | unsigned long offset, size_t size, int direction) |
| 141 | { | 170 | { |
| 142 | BUG_ON(!valid_dma_direction(direction)); | 171 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); |
| 143 | if (dma_ops->sync_single_range_for_cpu) | ||
| 144 | dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, | ||
| 145 | size, direction); | ||
| 146 | 172 | ||
| 173 | BUG_ON(!valid_dma_direction(direction)); | ||
| 174 | if (ops->sync_single_range_for_cpu) | ||
| 175 | ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, | ||
| 176 | size, direction); | ||
| 147 | flush_write_buffers(); | 177 | flush_write_buffers(); |
| 148 | } | 178 | } |
| 149 | 179 | ||
| @@ -152,11 +182,12 @@ dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle, | |||
| 152 | unsigned long offset, size_t size, | 182 | unsigned long offset, size_t size, |
| 153 | int direction) | 183 | int direction) |
| 154 | { | 184 | { |
| 155 | BUG_ON(!valid_dma_direction(direction)); | 185 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); |
| 156 | if (dma_ops->sync_single_range_for_device) | ||
| 157 | dma_ops->sync_single_range_for_device(hwdev, dma_handle, | ||
| 158 | offset, size, direction); | ||
| 159 | 186 | ||
| 187 | BUG_ON(!valid_dma_direction(direction)); | ||
| 188 | if (ops->sync_single_range_for_device) | ||
| 189 | ops->sync_single_range_for_device(hwdev, dma_handle, | ||
| 190 | offset, size, direction); | ||
| 160 | flush_write_buffers(); | 191 | flush_write_buffers(); |
| 161 | } | 192 | } |
| 162 | 193 | ||
| @@ -164,9 +195,11 @@ static inline void | |||
| 164 | dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, | 195 | dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, |
| 165 | int nelems, int direction) | 196 | int nelems, int direction) |
| 166 | { | 197 | { |
| 198 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); | ||
| 199 | |||
| 167 | BUG_ON(!valid_dma_direction(direction)); | 200 | BUG_ON(!valid_dma_direction(direction)); |
| 168 | if (dma_ops->sync_sg_for_cpu) | 201 | if (ops->sync_sg_for_cpu) |
| 169 | dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction); | 202 | ops->sync_sg_for_cpu(hwdev, sg, nelems, direction); |
| 170 | flush_write_buffers(); | 203 | flush_write_buffers(); |
| 171 | } | 204 | } |
| 172 | 205 | ||
| @@ -174,9 +207,11 @@ static inline void | |||
| 174 | dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, | 207 | dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, |
| 175 | int nelems, int direction) | 208 | int nelems, int direction) |
| 176 | { | 209 | { |
| 210 | struct dma_mapping_ops *ops = get_dma_ops(hwdev); | ||
| 211 | |||
| 177 | BUG_ON(!valid_dma_direction(direction)); | 212 | BUG_ON(!valid_dma_direction(direction)); |
| 178 | if (dma_ops->sync_sg_for_device) | 213 | if (ops->sync_sg_for_device) |
| 179 | dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction); | 214 | ops->sync_sg_for_device(hwdev, sg, nelems, direction); |
| 180 | 215 | ||
| 181 | flush_write_buffers(); | 216 | flush_write_buffers(); |
| 182 | } | 217 | } |
| @@ -185,9 +220,11 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
| 185 | size_t offset, size_t size, | 220 | size_t offset, size_t size, |
| 186 | int direction) | 221 | int direction) |
| 187 | { | 222 | { |
| 223 | struct dma_mapping_ops *ops = get_dma_ops(dev); | ||
| 224 | |||
| 188 | BUG_ON(!valid_dma_direction(direction)); | 225 | BUG_ON(!valid_dma_direction(direction)); |
| 189 | return dma_ops->map_single(dev, page_to_phys(page)+offset, | 226 | return ops->map_single(dev, page_to_phys(page) + offset, |
| 190 | size, direction); | 227 | size, direction); |
| 191 | } | 228 | } |
| 192 | 229 | ||
| 193 | static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, | 230 | static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, |
diff --git a/include/asm-x86/gpio.h b/include/asm-x86/gpio.h index ff87fca0caf9..c4c91b37c104 100644 --- a/include/asm-x86/gpio.h +++ b/include/asm-x86/gpio.h | |||
| @@ -1,6 +1,56 @@ | |||
| 1 | /* | ||
| 2 | * Generic GPIO API implementation for x86. | ||
| 3 | * | ||
| 4 | * Derived from the generic GPIO API for powerpc: | ||
| 5 | * | ||
| 6 | * Copyright (c) 2007-2008 MontaVista Software, Inc. | ||
| 7 | * | ||
| 8 | * Author: Anton Vorontsov <avorontsov@ru.mvista.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | */ | ||
| 15 | |||
| 1 | #ifndef _ASM_I386_GPIO_H | 16 | #ifndef _ASM_I386_GPIO_H |
| 2 | #define _ASM_I386_GPIO_H | 17 | #define _ASM_I386_GPIO_H |
| 3 | 18 | ||
| 4 | #include <gpio.h> | 19 | #include <asm-generic/gpio.h> |
| 20 | |||
| 21 | #ifdef CONFIG_GPIOLIB | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Just call gpiolib. | ||
| 25 | */ | ||
| 26 | static inline int gpio_get_value(unsigned int gpio) | ||
| 27 | { | ||
| 28 | return __gpio_get_value(gpio); | ||
| 29 | } | ||
| 30 | |||
| 31 | static inline void gpio_set_value(unsigned int gpio, int value) | ||
| 32 | { | ||
| 33 | __gpio_set_value(gpio, value); | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline int gpio_cansleep(unsigned int gpio) | ||
| 37 | { | ||
| 38 | return __gpio_cansleep(gpio); | ||
| 39 | } | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Not implemented, yet. | ||
| 43 | */ | ||
| 44 | static inline int gpio_to_irq(unsigned int gpio) | ||
| 45 | { | ||
| 46 | return -ENOSYS; | ||
| 47 | } | ||
| 48 | |||
| 49 | static inline int irq_to_gpio(unsigned int irq) | ||
| 50 | { | ||
| 51 | return -EINVAL; | ||
| 52 | } | ||
| 53 | |||
| 54 | #endif /* CONFIG_GPIOLIB */ | ||
| 5 | 55 | ||
| 6 | #endif /* _ASM_I386_GPIO_H */ | 56 | #endif /* _ASM_I386_GPIO_H */ |
diff --git a/include/asm-x86/hugetlb.h b/include/asm-x86/hugetlb.h index 14171a4924f6..439a9acc132d 100644 --- a/include/asm-x86/hugetlb.h +++ b/include/asm-x86/hugetlb.h | |||
| @@ -14,11 +14,13 @@ static inline int is_hugepage_only_range(struct mm_struct *mm, | |||
| 14 | * If the arch doesn't supply something else, assume that hugepage | 14 | * If the arch doesn't supply something else, assume that hugepage |
| 15 | * size aligned regions are ok without further preparation. | 15 | * size aligned regions are ok without further preparation. |
| 16 | */ | 16 | */ |
| 17 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | 17 | static inline int prepare_hugepage_range(struct file *file, |
| 18 | unsigned long addr, unsigned long len) | ||
| 18 | { | 19 | { |
| 19 | if (len & ~HPAGE_MASK) | 20 | struct hstate *h = hstate_file(file); |
| 21 | if (len & ~huge_page_mask(h)) | ||
| 20 | return -EINVAL; | 22 | return -EINVAL; |
| 21 | if (addr & ~HPAGE_MASK) | 23 | if (addr & ~huge_page_mask(h)) |
| 22 | return -EINVAL; | 24 | return -EINVAL; |
| 23 | return 0; | 25 | return 0; |
| 24 | } | 26 | } |
| @@ -26,7 +28,7 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | |||
| 26 | static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) { | 28 | static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) { |
| 27 | } | 29 | } |
| 28 | 30 | ||
| 29 | static inline void hugetlb_free_pgd_range(struct mmu_gather **tlb, | 31 | static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, |
| 30 | unsigned long addr, unsigned long end, | 32 | unsigned long addr, unsigned long end, |
| 31 | unsigned long floor, | 33 | unsigned long floor, |
| 32 | unsigned long ceiling) | 34 | unsigned long ceiling) |
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h index 37672f79dcc8..96fa8449ff11 100644 --- a/include/asm-x86/i387.h +++ b/include/asm-x86/i387.h | |||
| @@ -137,60 +137,6 @@ static inline void __save_init_fpu(struct task_struct *tsk) | |||
| 137 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | 137 | task_thread_info(tsk)->status &= ~TS_USEDFPU; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | /* | ||
| 141 | * Signal frame handlers. | ||
| 142 | */ | ||
| 143 | |||
| 144 | static inline int save_i387(struct _fpstate __user *buf) | ||
| 145 | { | ||
| 146 | struct task_struct *tsk = current; | ||
| 147 | int err = 0; | ||
| 148 | |||
| 149 | BUILD_BUG_ON(sizeof(struct user_i387_struct) != | ||
| 150 | sizeof(tsk->thread.xstate->fxsave)); | ||
| 151 | |||
| 152 | if ((unsigned long)buf % 16) | ||
| 153 | printk("save_i387: bad fpstate %p\n", buf); | ||
| 154 | |||
| 155 | if (!used_math()) | ||
| 156 | return 0; | ||
| 157 | clear_used_math(); /* trigger finit */ | ||
| 158 | if (task_thread_info(tsk)->status & TS_USEDFPU) { | ||
| 159 | err = save_i387_checking((struct i387_fxsave_struct __user *) | ||
| 160 | buf); | ||
| 161 | if (err) | ||
| 162 | return err; | ||
| 163 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
| 164 | stts(); | ||
| 165 | } else { | ||
| 166 | if (__copy_to_user(buf, &tsk->thread.xstate->fxsave, | ||
| 167 | sizeof(struct i387_fxsave_struct))) | ||
| 168 | return -1; | ||
| 169 | } | ||
| 170 | return 1; | ||
| 171 | } | ||
| 172 | |||
| 173 | /* | ||
| 174 | * This restores directly out of user space. Exceptions are handled. | ||
| 175 | */ | ||
| 176 | static inline int restore_i387(struct _fpstate __user *buf) | ||
| 177 | { | ||
| 178 | struct task_struct *tsk = current; | ||
| 179 | int err; | ||
| 180 | |||
| 181 | if (!used_math()) { | ||
| 182 | err = init_fpu(tsk); | ||
| 183 | if (err) | ||
| 184 | return err; | ||
| 185 | } | ||
| 186 | |||
| 187 | if (!(task_thread_info(current)->status & TS_USEDFPU)) { | ||
| 188 | clts(); | ||
| 189 | task_thread_info(current)->status |= TS_USEDFPU; | ||
| 190 | } | ||
| 191 | return restore_fpu_checking((__force struct i387_fxsave_struct *)buf); | ||
| 192 | } | ||
| 193 | |||
| 194 | #else /* CONFIG_X86_32 */ | 140 | #else /* CONFIG_X86_32 */ |
| 195 | 141 | ||
| 196 | extern void finit(void); | 142 | extern void finit(void); |
diff --git a/include/asm-x86/ide.h b/include/asm-x86/ide.h deleted file mode 100644 index cf9c98e5bdb5..000000000000 --- a/include/asm-x86/ide.h +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 1994-1996 Linus Torvalds & authors | ||
| 3 | */ | ||
| 4 | |||
| 5 | /* | ||
| 6 | * This file contains the i386 architecture specific IDE code. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __ASMi386_IDE_H | ||
| 10 | #define __ASMi386_IDE_H | ||
| 11 | |||
| 12 | #ifdef __KERNEL__ | ||
| 13 | |||
| 14 | |||
| 15 | #ifndef MAX_HWIFS | ||
| 16 | # ifdef CONFIG_BLK_DEV_IDEPCI | ||
| 17 | #define MAX_HWIFS 10 | ||
| 18 | # else | ||
| 19 | #define MAX_HWIFS 6 | ||
| 20 | # endif | ||
| 21 | #endif | ||
| 22 | |||
| 23 | static __inline__ int ide_default_irq(unsigned long base) | ||
| 24 | { | ||
| 25 | switch (base) { | ||
| 26 | case 0x1f0: return 14; | ||
| 27 | case 0x170: return 15; | ||
| 28 | case 0x1e8: return 11; | ||
| 29 | case 0x168: return 10; | ||
| 30 | case 0x1e0: return 8; | ||
| 31 | case 0x160: return 12; | ||
| 32 | default: | ||
| 33 | return 0; | ||
| 34 | } | ||
| 35 | } | ||
| 36 | |||
| 37 | static __inline__ unsigned long ide_default_io_base(int index) | ||
| 38 | { | ||
| 39 | /* | ||
| 40 | * If PCI is present then it is not safe to poke around | ||
| 41 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | ||
| 42 | * defined compatibility mode ports for PCI. A user can | ||
| 43 | * override this using ide= but we must default safe. | ||
| 44 | */ | ||
| 45 | if (no_pci_devices()) { | ||
| 46 | switch(index) { | ||
| 47 | case 2: return 0x1e8; | ||
| 48 | case 3: return 0x168; | ||
| 49 | case 4: return 0x1e0; | ||
| 50 | case 5: return 0x160; | ||
| 51 | } | ||
| 52 | } | ||
| 53 | switch (index) { | ||
| 54 | case 0: return 0x1f0; | ||
| 55 | case 1: return 0x170; | ||
| 56 | default: | ||
| 57 | return 0; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 | #include <asm-generic/ide_iops.h> | ||
| 62 | |||
| 63 | #endif /* __KERNEL__ */ | ||
| 64 | |||
| 65 | #endif /* __ASMi386_IDE_H */ | ||
diff --git a/include/asm-x86/io_32.h b/include/asm-x86/io_32.h index 4df44ed54077..e876d89ac156 100644 --- a/include/asm-x86/io_32.h +++ b/include/asm-x86/io_32.h | |||
| @@ -110,6 +110,8 @@ static inline void *phys_to_virt(unsigned long address) | |||
| 110 | */ | 110 | */ |
| 111 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); | 111 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); |
| 112 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); | 112 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); |
| 113 | extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size, | ||
| 114 | unsigned long prot_val); | ||
| 113 | 115 | ||
| 114 | /* | 116 | /* |
| 115 | * The default ioremap() behavior is non-cached: | 117 | * The default ioremap() behavior is non-cached: |
diff --git a/include/asm-x86/io_64.h b/include/asm-x86/io_64.h index ddd8058a5026..22995c5c5adc 100644 --- a/include/asm-x86/io_64.h +++ b/include/asm-x86/io_64.h | |||
| @@ -175,6 +175,8 @@ extern void early_iounmap(void *addr, unsigned long size); | |||
| 175 | */ | 175 | */ |
| 176 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); | 176 | extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size); |
| 177 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); | 177 | extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size); |
| 178 | extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size, | ||
| 179 | unsigned long prot_val); | ||
| 178 | 180 | ||
| 179 | /* | 181 | /* |
| 180 | * The default ioremap() behavior is non-cached: | 182 | * The default ioremap() behavior is non-cached: |
diff --git a/include/asm-x86/iommu.h b/include/asm-x86/iommu.h index d63166fb3ab7..ecc8061904a9 100644 --- a/include/asm-x86/iommu.h +++ b/include/asm-x86/iommu.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | extern void pci_iommu_shutdown(void); | 4 | extern void pci_iommu_shutdown(void); |
| 5 | extern void no_iommu_init(void); | 5 | extern void no_iommu_init(void); |
| 6 | extern struct dma_mapping_ops nommu_dma_ops; | ||
| 6 | extern int force_iommu, no_iommu; | 7 | extern int force_iommu, no_iommu; |
| 7 | extern int iommu_detected; | 8 | extern int iommu_detected; |
| 8 | 9 | ||
diff --git a/include/asm-x86/kexec.h b/include/asm-x86/kexec.h index 8f855a15f64d..c0e52a14fd4d 100644 --- a/include/asm-x86/kexec.h +++ b/include/asm-x86/kexec.h | |||
| @@ -10,14 +10,15 @@ | |||
| 10 | # define VA_PTE_0 5 | 10 | # define VA_PTE_0 5 |
| 11 | # define PA_PTE_1 6 | 11 | # define PA_PTE_1 6 |
| 12 | # define VA_PTE_1 7 | 12 | # define VA_PTE_1 7 |
| 13 | # define PA_SWAP_PAGE 8 | ||
| 13 | # ifdef CONFIG_X86_PAE | 14 | # ifdef CONFIG_X86_PAE |
| 14 | # define PA_PMD_0 8 | 15 | # define PA_PMD_0 9 |
| 15 | # define VA_PMD_0 9 | 16 | # define VA_PMD_0 10 |
| 16 | # define PA_PMD_1 10 | 17 | # define PA_PMD_1 11 |
| 17 | # define VA_PMD_1 11 | 18 | # define VA_PMD_1 12 |
| 18 | # define PAGES_NR 12 | 19 | # define PAGES_NR 13 |
| 19 | # else | 20 | # else |
| 20 | # define PAGES_NR 8 | 21 | # define PAGES_NR 9 |
| 21 | # endif | 22 | # endif |
| 22 | #else | 23 | #else |
| 23 | # define PA_CONTROL_PAGE 0 | 24 | # define PA_CONTROL_PAGE 0 |
| @@ -152,11 +153,12 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
| 152 | } | 153 | } |
| 153 | 154 | ||
| 154 | #ifdef CONFIG_X86_32 | 155 | #ifdef CONFIG_X86_32 |
| 155 | asmlinkage NORET_TYPE void | 156 | asmlinkage unsigned long |
| 156 | relocate_kernel(unsigned long indirection_page, | 157 | relocate_kernel(unsigned long indirection_page, |
| 157 | unsigned long control_page, | 158 | unsigned long control_page, |
| 158 | unsigned long start_address, | 159 | unsigned long start_address, |
| 159 | unsigned int has_pae) ATTRIB_NORET; | 160 | unsigned int has_pae, |
| 161 | unsigned int preserve_context); | ||
| 160 | #else | 162 | #else |
| 161 | NORET_TYPE void | 163 | NORET_TYPE void |
| 162 | relocate_kernel(unsigned long indirection_page, | 164 | relocate_kernel(unsigned long indirection_page, |
diff --git a/include/asm-x86/mach-summit/mach_apic.h b/include/asm-x86/mach-summit/mach_apic.h index 75d2c95005d7..c47e2ab5c5ca 100644 --- a/include/asm-x86/mach-summit/mach_apic.h +++ b/include/asm-x86/mach-summit/mach_apic.h | |||
| @@ -122,7 +122,7 @@ static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_id_map) | |||
| 122 | 122 | ||
| 123 | static inline physid_mask_t apicid_to_cpu_present(int apicid) | 123 | static inline physid_mask_t apicid_to_cpu_present(int apicid) |
| 124 | { | 124 | { |
| 125 | return physid_mask_of_physid(0); | 125 | return physid_mask_of_physid(apicid); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | static inline void setup_portio_remap(void) | 128 | static inline void setup_portio_remap(void) |
diff --git a/include/asm-x86/namei.h b/include/asm-x86/namei.h deleted file mode 100644 index 415ef5d9550e..000000000000 --- a/include/asm-x86/namei.h +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | #ifndef _ASM_X86_NAMEI_H | ||
| 2 | #define _ASM_X86_NAMEI_H | ||
| 3 | |||
| 4 | /* This dummy routine maybe changed to something useful | ||
| 5 | * for /usr/gnemul/ emulation stuff. | ||
| 6 | * Look at asm-sparc/namei.h for details. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #define __emul_prefix() NULL | ||
| 10 | |||
| 11 | #endif /* _ASM_X86_NAMEI_H */ | ||
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h index 6c846228948d..49982110e4d9 100644 --- a/include/asm-x86/page.h +++ b/include/asm-x86/page.h | |||
| @@ -32,8 +32,7 @@ | |||
| 32 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | 32 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) |
| 33 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | 33 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
| 34 | 34 | ||
| 35 | /* to align the pointer to the (next) page boundary */ | 35 | #define HUGE_MAX_HSTATE 2 |
| 36 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
| 37 | 36 | ||
| 38 | #ifndef __ASSEMBLY__ | 37 | #ifndef __ASSEMBLY__ |
| 39 | #include <linux/types.h> | 38 | #include <linux/types.h> |
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index 3e5dbc4195f4..04caa2f544df 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #define _PAGE_BIT_UNUSED2 10 | 18 | #define _PAGE_BIT_UNUSED2 10 |
| 19 | #define _PAGE_BIT_UNUSED3 11 | 19 | #define _PAGE_BIT_UNUSED3 11 |
| 20 | #define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */ | 20 | #define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */ |
| 21 | #define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1 | ||
| 21 | #define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ | 22 | #define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ |
| 22 | 23 | ||
| 23 | #define _PAGE_PRESENT (_AT(pteval_t, 1) << _PAGE_BIT_PRESENT) | 24 | #define _PAGE_PRESENT (_AT(pteval_t, 1) << _PAGE_BIT_PRESENT) |
| @@ -34,6 +35,8 @@ | |||
| 34 | #define _PAGE_UNUSED3 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED3) | 35 | #define _PAGE_UNUSED3 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED3) |
| 35 | #define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) | 36 | #define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) |
| 36 | #define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) | 37 | #define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) |
| 38 | #define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) | ||
| 39 | #define __HAVE_ARCH_PTE_SPECIAL | ||
| 37 | 40 | ||
| 38 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) | 41 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) |
| 39 | #define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX) | 42 | #define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX) |
| @@ -54,7 +57,7 @@ | |||
| 54 | 57 | ||
| 55 | /* Set of bits not changed in pte_modify */ | 58 | /* Set of bits not changed in pte_modify */ |
| 56 | #define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ | 59 | #define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ |
| 57 | _PAGE_ACCESSED | _PAGE_DIRTY) | 60 | _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY) |
| 58 | 61 | ||
| 59 | #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) | 62 | #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) |
| 60 | #define _PAGE_CACHE_WB (0) | 63 | #define _PAGE_CACHE_WB (0) |
| @@ -180,7 +183,7 @@ static inline int pte_exec(pte_t pte) | |||
| 180 | 183 | ||
| 181 | static inline int pte_special(pte_t pte) | 184 | static inline int pte_special(pte_t pte) |
| 182 | { | 185 | { |
| 183 | return 0; | 186 | return pte_val(pte) & _PAGE_SPECIAL; |
| 184 | } | 187 | } |
| 185 | 188 | ||
| 186 | static inline int pmd_large(pmd_t pte) | 189 | static inline int pmd_large(pmd_t pte) |
| @@ -246,7 +249,7 @@ static inline pte_t pte_clrglobal(pte_t pte) | |||
| 246 | 249 | ||
| 247 | static inline pte_t pte_mkspecial(pte_t pte) | 250 | static inline pte_t pte_mkspecial(pte_t pte) |
| 248 | { | 251 | { |
| 249 | return pte; | 252 | return __pte(pte_val(pte) | _PAGE_SPECIAL); |
| 250 | } | 253 | } |
| 251 | 254 | ||
| 252 | extern pteval_t __supported_pte_mask; | 255 | extern pteval_t __supported_pte_mask; |
diff --git a/include/asm-x86/processor-flags.h b/include/asm-x86/processor-flags.h index 092b39b3a7e6..eff2ecd7fff0 100644 --- a/include/asm-x86/processor-flags.h +++ b/include/asm-x86/processor-flags.h | |||
| @@ -88,10 +88,12 @@ | |||
| 88 | #define CX86_ARR_BASE 0xc4 | 88 | #define CX86_ARR_BASE 0xc4 |
| 89 | #define CX86_RCR_BASE 0xdc | 89 | #define CX86_RCR_BASE 0xdc |
| 90 | 90 | ||
| 91 | #ifdef __KERNEL__ | ||
| 91 | #ifdef CONFIG_VM86 | 92 | #ifdef CONFIG_VM86 |
| 92 | #define X86_VM_MASK X86_EFLAGS_VM | 93 | #define X86_VM_MASK X86_EFLAGS_VM |
| 93 | #else | 94 | #else |
| 94 | #define X86_VM_MASK 0 /* No VM86 support */ | 95 | #define X86_VM_MASK 0 /* No VM86 support */ |
| 95 | #endif | 96 | #endif |
| 97 | #endif | ||
| 96 | 98 | ||
| 97 | #endif /* __ASM_I386_PROCESSOR_FLAGS_H */ | 99 | #endif /* __ASM_I386_PROCESSOR_FLAGS_H */ |
diff --git a/include/asm-x86/semaphore.h b/include/asm-x86/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-x86/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-x86/swiotlb.h b/include/asm-x86/swiotlb.h index c706a7442633..2730b351afcf 100644 --- a/include/asm-x86/swiotlb.h +++ b/include/asm-x86/swiotlb.h | |||
| @@ -35,7 +35,7 @@ extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, | |||
| 35 | int nents, int direction); | 35 | int nents, int direction); |
| 36 | extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, | 36 | extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, |
| 37 | int nents, int direction); | 37 | int nents, int direction); |
| 38 | extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); | 38 | extern int swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); |
| 39 | extern void swiotlb_free_coherent(struct device *hwdev, size_t size, | 39 | extern void swiotlb_free_coherent(struct device *hwdev, size_t size, |
| 40 | void *vaddr, dma_addr_t dma_handle); | 40 | void *vaddr, dma_addr_t dma_handle); |
| 41 | extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); | 41 | extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); |
diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h index 3f2de1050988..da0a675adf94 100644 --- a/include/asm-x86/thread_info.h +++ b/include/asm-x86/thread_info.h | |||
| @@ -152,6 +152,8 @@ struct thread_info { | |||
| 152 | #define THREAD_FLAGS GFP_KERNEL | 152 | #define THREAD_FLAGS GFP_KERNEL |
| 153 | #endif | 153 | #endif |
| 154 | 154 | ||
| 155 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
| 156 | |||
| 155 | #define alloc_thread_info(tsk) \ | 157 | #define alloc_thread_info(tsk) \ |
| 156 | ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER)) | 158 | ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER)) |
| 157 | 159 | ||
diff --git a/include/asm-x86/uaccess.h b/include/asm-x86/uaccess.h index f6fa4d841bbc..5f702d1d5218 100644 --- a/include/asm-x86/uaccess.h +++ b/include/asm-x86/uaccess.h | |||
| @@ -451,3 +451,4 @@ extern struct movsl_mask { | |||
| 451 | #endif | 451 | #endif |
| 452 | 452 | ||
| 453 | #endif | 453 | #endif |
| 454 | |||
diff --git a/include/asm-x86/unistd_32.h b/include/asm-x86/unistd_32.h index 8317d94771d3..d7394673b772 100644 --- a/include/asm-x86/unistd_32.h +++ b/include/asm-x86/unistd_32.h | |||
| @@ -332,6 +332,12 @@ | |||
| 332 | #define __NR_fallocate 324 | 332 | #define __NR_fallocate 324 |
| 333 | #define __NR_timerfd_settime 325 | 333 | #define __NR_timerfd_settime 325 |
| 334 | #define __NR_timerfd_gettime 326 | 334 | #define __NR_timerfd_gettime 326 |
| 335 | #define __NR_signalfd4 327 | ||
| 336 | #define __NR_eventfd2 328 | ||
| 337 | #define __NR_epoll_create1 329 | ||
| 338 | #define __NR_dup3 330 | ||
| 339 | #define __NR_pipe2 331 | ||
| 340 | #define __NR_inotify_init1 332 | ||
| 335 | 341 | ||
| 336 | #ifdef __KERNEL__ | 342 | #ifdef __KERNEL__ |
| 337 | 343 | ||
diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h index 9c1a4a3470d9..3a341d791792 100644 --- a/include/asm-x86/unistd_64.h +++ b/include/asm-x86/unistd_64.h | |||
| @@ -639,6 +639,20 @@ __SYSCALL(__NR_fallocate, sys_fallocate) | |||
| 639 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) | 639 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) |
| 640 | #define __NR_timerfd_gettime 287 | 640 | #define __NR_timerfd_gettime 287 |
| 641 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) | 641 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) |
| 642 | #define __NR_paccept 288 | ||
| 643 | __SYSCALL(__NR_paccept, sys_paccept) | ||
| 644 | #define __NR_signalfd4 289 | ||
| 645 | __SYSCALL(__NR_signalfd4, sys_signalfd4) | ||
| 646 | #define __NR_eventfd2 290 | ||
| 647 | __SYSCALL(__NR_eventfd2, sys_eventfd2) | ||
| 648 | #define __NR_epoll_create1 291 | ||
| 649 | __SYSCALL(__NR_epoll_create1, sys_epoll_create1) | ||
| 650 | #define __NR_dup3 292 | ||
| 651 | __SYSCALL(__NR_dup3, sys_dup3) | ||
| 652 | #define __NR_pipe2 293 | ||
| 653 | __SYSCALL(__NR_pipe2, sys_pipe2) | ||
| 654 | #define __NR_inotify_init1 294 | ||
| 655 | __SYSCALL(__NR_inotify_init1, sys_inotify_init1) | ||
| 642 | 656 | ||
| 643 | 657 | ||
| 644 | #ifndef __NO_STUBS | 658 | #ifndef __NO_STUBS |
diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h index 3c7d537dd15d..51882ae3db4d 100644 --- a/include/asm-xtensa/dma-mapping.h +++ b/include/asm-xtensa/dma-mapping.h | |||
| @@ -139,7 +139,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, | |||
| 139 | consistent_sync(sg_virt(sg), sg->length, dir); | 139 | consistent_sync(sg_virt(sg), sg->length, dir); |
| 140 | } | 140 | } |
| 141 | static inline int | 141 | static inline int |
| 142 | dma_mapping_error(dma_addr_t dma_addr) | 142 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
| 143 | { | 143 | { |
| 144 | return 0; | 144 | return 0; |
| 145 | } | 145 | } |
diff --git a/include/asm-xtensa/ide.h b/include/asm-xtensa/ide.h deleted file mode 100644 index 6b912742a42d..000000000000 --- a/include/asm-xtensa/ide.h +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-xtensa/ide.h | ||
| 3 | * | ||
| 4 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 5 | * License. See the file "COPYING" in the main directory of this archive | ||
| 6 | * for more details. | ||
| 7 | * | ||
| 8 | * Copyright (C) 1994 - 1996 Linus Torvalds & authors | ||
| 9 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _XTENSA_IDE_H | ||
| 13 | #define _XTENSA_IDE_H | ||
| 14 | |||
| 15 | #ifdef __KERNEL__ | ||
| 16 | |||
| 17 | |||
| 18 | #ifndef MAX_HWIFS | ||
| 19 | # define MAX_HWIFS 1 | ||
| 20 | #endif | ||
| 21 | |||
| 22 | static __inline__ int ide_default_irq(unsigned long base) | ||
| 23 | { | ||
| 24 | /* Unsupported! */ | ||
| 25 | return 0; | ||
| 26 | } | ||
| 27 | |||
| 28 | static __inline__ unsigned long ide_default_io_base(int index) | ||
| 29 | { | ||
| 30 | /* Unsupported! */ | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | |||
| 34 | #endif /* __KERNEL__ */ | ||
| 35 | #endif /* _XTENSA_IDE_H */ | ||
diff --git a/include/asm-xtensa/kvm.h b/include/asm-xtensa/kvm.h deleted file mode 100644 index bda4e331e98c..000000000000 --- a/include/asm-xtensa/kvm.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __LINUX_KVM_XTENSA_H | ||
| 2 | #define __LINUX_KVM_XTENSA_H | ||
| 3 | |||
| 4 | /* xtensa does not support KVM */ | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/include/asm-xtensa/namei.h b/include/asm-xtensa/namei.h deleted file mode 100644 index 3fdff039d27d..000000000000 --- a/include/asm-xtensa/namei.h +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-xtensa/namei.h | ||
| 3 | * | ||
| 4 | * Included from linux/fs/namei.c | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | * | ||
| 10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef _XTENSA_NAMEI_H | ||
| 14 | #define _XTENSA_NAMEI_H | ||
| 15 | |||
| 16 | #ifdef __KERNEL__ | ||
| 17 | |||
| 18 | /* This dummy routine maybe changed to something useful | ||
| 19 | * for /usr/gnemul/ emulation stuff. | ||
| 20 | * Look at asm-sparc/namei.h for details. | ||
| 21 | */ | ||
| 22 | |||
| 23 | #define __emul_prefix() NULL | ||
| 24 | |||
| 25 | #endif /* __KERNEL__ */ | ||
| 26 | #endif /* _XTENSA_NAMEI_H */ | ||
diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h index 80a6ae0dd259..11f7dc2dbec7 100644 --- a/include/asm-xtensa/page.h +++ b/include/asm-xtensa/page.h | |||
| @@ -26,13 +26,11 @@ | |||
| 26 | 26 | ||
| 27 | /* | 27 | /* |
| 28 | * PAGE_SHIFT determines the page size | 28 | * PAGE_SHIFT determines the page size |
| 29 | * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary | ||
| 30 | */ | 29 | */ |
| 31 | 30 | ||
| 32 | #define PAGE_SHIFT 12 | 31 | #define PAGE_SHIFT 12 |
| 33 | #define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT) | 32 | #define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT) |
| 34 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 33 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
| 35 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK) | ||
| 36 | 34 | ||
| 37 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR | 35 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR |
| 38 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE | 36 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE |
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h index 422c73e26937..089b0db44816 100644 --- a/include/asm-xtensa/ptrace.h +++ b/include/asm-xtensa/ptrace.h | |||
| @@ -73,10 +73,10 @@ | |||
| 73 | #define PTRACE_GETXTREGS 18 | 73 | #define PTRACE_GETXTREGS 18 |
| 74 | #define PTRACE_SETXTREGS 19 | 74 | #define PTRACE_SETXTREGS 19 |
| 75 | 75 | ||
| 76 | #ifndef __ASSEMBLY__ | ||
| 77 | |||
| 78 | #ifdef __KERNEL__ | 76 | #ifdef __KERNEL__ |
| 79 | 77 | ||
| 78 | #ifndef __ASSEMBLY__ | ||
| 79 | |||
| 80 | /* | 80 | /* |
| 81 | * This struct defines the way the registers are stored on the | 81 | * This struct defines the way the registers are stored on the |
| 82 | * kernel stack during a system call or other kernel entry. | 82 | * kernel stack during a system call or other kernel entry. |
| @@ -122,14 +122,14 @@ extern void show_regs(struct pt_regs *); | |||
| 122 | # ifndef CONFIG_SMP | 122 | # ifndef CONFIG_SMP |
| 123 | # define profile_pc(regs) instruction_pointer(regs) | 123 | # define profile_pc(regs) instruction_pointer(regs) |
| 124 | # endif | 124 | # endif |
| 125 | #endif /* __KERNEL__ */ | ||
| 126 | 125 | ||
| 127 | #else /* __ASSEMBLY__ */ | 126 | #else /* __ASSEMBLY__ */ |
| 128 | 127 | ||
| 129 | #ifdef __KERNEL__ | ||
| 130 | # include <asm/asm-offsets.h> | 128 | # include <asm/asm-offsets.h> |
| 131 | #define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE) | 129 | #define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE) |
| 132 | #endif | ||
| 133 | 130 | ||
| 134 | #endif /* !__ASSEMBLY__ */ | 131 | #endif /* !__ASSEMBLY__ */ |
| 132 | |||
| 133 | #endif /* __KERNEL__ */ | ||
| 134 | |||
| 135 | #endif /* _XTENSA_PTRACE_H */ | 135 | #endif /* _XTENSA_PTRACE_H */ |
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h deleted file mode 100644 index d9b2034ed1d2..000000000000 --- a/include/asm-xtensa/semaphore.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <linux/semaphore.h> | ||
diff --git a/include/asm-xtensa/thread_info.h b/include/asm-xtensa/thread_info.h index a2c640682ed9..7e4131dd546c 100644 --- a/include/asm-xtensa/thread_info.h +++ b/include/asm-xtensa/thread_info.h | |||
| @@ -111,10 +111,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 111 | return ti; | 111 | return ti; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | /* thread information allocation */ | ||
| 115 | #define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | ||
| 116 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | ||
| 117 | |||
| 118 | #else /* !__ASSEMBLY__ */ | 114 | #else /* !__ASSEMBLY__ */ |
| 119 | 115 | ||
| 120 | /* how to get the thread information struct from ASM */ | 116 | /* how to get the thread information struct from ASM */ |
| @@ -160,6 +156,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 160 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ | 156 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ |
| 161 | 157 | ||
| 162 | #define THREAD_SIZE 8192 //(2*PAGE_SIZE) | 158 | #define THREAD_SIZE 8192 //(2*PAGE_SIZE) |
| 159 | #define THREAD_SIZE_ORDER 1 | ||
| 163 | 160 | ||
| 164 | #endif /* __KERNEL__ */ | 161 | #endif /* __KERNEL__ */ |
| 165 | #endif /* _XTENSA_THREAD_INFO */ | 162 | #endif /* _XTENSA_THREAD_INFO */ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 71d70d1fbce2..4c4142c5aa6e 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -189,7 +189,6 @@ unifdef-y += connector.h | |||
| 189 | unifdef-y += cuda.h | 189 | unifdef-y += cuda.h |
| 190 | unifdef-y += cyclades.h | 190 | unifdef-y += cyclades.h |
| 191 | unifdef-y += dccp.h | 191 | unifdef-y += dccp.h |
| 192 | unifdef-y += dirent.h | ||
| 193 | unifdef-y += dlm.h | 192 | unifdef-y += dlm.h |
| 194 | unifdef-y += dlm_plock.h | 193 | unifdef-y += dlm_plock.h |
| 195 | unifdef-y += edd.h | 194 | unifdef-y += edd.h |
| @@ -256,7 +255,9 @@ unifdef-y += kd.h | |||
| 256 | unifdef-y += kernelcapi.h | 255 | unifdef-y += kernelcapi.h |
| 257 | unifdef-y += kernel.h | 256 | unifdef-y += kernel.h |
| 258 | unifdef-y += keyboard.h | 257 | unifdef-y += keyboard.h |
| 258 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | ||
| 259 | unifdef-y += kvm.h | 259 | unifdef-y += kvm.h |
| 260 | endif | ||
| 260 | unifdef-y += llc.h | 261 | unifdef-y += llc.h |
| 261 | unifdef-y += loop.h | 262 | unifdef-y += loop.h |
| 262 | unifdef-y += lp.h | 263 | unifdef-y += lp.h |
diff --git a/include/linux/acct.h b/include/linux/acct.h index e8cae54e8d88..882dc7248766 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
| @@ -120,17 +120,20 @@ struct acct_v3 | |||
| 120 | struct vfsmount; | 120 | struct vfsmount; |
| 121 | struct super_block; | 121 | struct super_block; |
| 122 | struct pacct_struct; | 122 | struct pacct_struct; |
| 123 | struct pid_namespace; | ||
| 123 | extern void acct_auto_close_mnt(struct vfsmount *m); | 124 | extern void acct_auto_close_mnt(struct vfsmount *m); |
| 124 | extern void acct_auto_close(struct super_block *sb); | 125 | extern void acct_auto_close(struct super_block *sb); |
| 125 | extern void acct_init_pacct(struct pacct_struct *pacct); | 126 | extern void acct_init_pacct(struct pacct_struct *pacct); |
| 126 | extern void acct_collect(long exitcode, int group_dead); | 127 | extern void acct_collect(long exitcode, int group_dead); |
| 127 | extern void acct_process(void); | 128 | extern void acct_process(void); |
| 129 | extern void acct_exit_ns(struct pid_namespace *); | ||
| 128 | #else | 130 | #else |
| 129 | #define acct_auto_close_mnt(x) do { } while (0) | 131 | #define acct_auto_close_mnt(x) do { } while (0) |
| 130 | #define acct_auto_close(x) do { } while (0) | 132 | #define acct_auto_close(x) do { } while (0) |
| 131 | #define acct_init_pacct(x) do { } while (0) | 133 | #define acct_init_pacct(x) do { } while (0) |
| 132 | #define acct_collect(x,y) do { } while (0) | 134 | #define acct_collect(x,y) do { } while (0) |
| 133 | #define acct_process() do { } while (0) | 135 | #define acct_process() do { } while (0) |
| 136 | #define acct_exit_ns(ns) do { } while (0) | ||
| 134 | #endif | 137 | #endif |
| 135 | 138 | ||
| 136 | /* | 139 | /* |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a17177639376..702f79dad16a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -236,6 +236,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n, | |||
| 236 | const char *name); | 236 | const char *name); |
| 237 | 237 | ||
| 238 | #ifdef CONFIG_PM_SLEEP | 238 | #ifdef CONFIG_PM_SLEEP |
| 239 | void __init acpi_no_s4_hw_signature(void); | ||
| 239 | void __init acpi_old_suspend_ordering(void); | 240 | void __init acpi_old_suspend_ordering(void); |
| 240 | #endif /* CONFIG_PM_SLEEP */ | 241 | #endif /* CONFIG_PM_SLEEP */ |
| 241 | #else /* CONFIG_ACPI */ | 242 | #else /* CONFIG_ACPI */ |
diff --git a/include/linux/aio.h b/include/linux/aio.h index b51ddd28444e..09b276c35227 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include <linux/uio.h> | 7 | #include <linux/uio.h> |
| 8 | 8 | ||
| 9 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
| 10 | #include <linux/uio.h> | ||
| 11 | 10 | ||
| 12 | #define AIO_MAXSEGS 4 | 11 | #define AIO_MAXSEGS 4 |
| 13 | #define AIO_KIOGRP_NR_ATOMIC 8 | 12 | #define AIO_KIOGRP_NR_ATOMIC 8 |
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index 6129e58ca7c9..e0a0cdc2da43 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #define _LINUX_ANON_INODES_H | 9 | #define _LINUX_ANON_INODES_H |
| 10 | 10 | ||
| 11 | int anon_inode_getfd(const char *name, const struct file_operations *fops, | 11 | int anon_inode_getfd(const char *name, const struct file_operations *fops, |
| 12 | void *priv); | 12 | void *priv, int flags); |
| 13 | 13 | ||
| 14 | #endif /* _LINUX_ANON_INODES_H */ | 14 | #endif /* _LINUX_ANON_INODES_H */ |
| 15 | 15 | ||
diff --git a/include/linux/atmel-pwm-bl.h b/include/linux/atmel-pwm-bl.h new file mode 100644 index 000000000000..0153a47806c2 --- /dev/null +++ b/include/linux/atmel-pwm-bl.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007 Atmel Corporation | ||
| 3 | * | ||
| 4 | * Driver for the AT32AP700X PS/2 controller (PSIF). | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License version 2 as published | ||
| 8 | * by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __INCLUDE_ATMEL_PWM_BL_H | ||
| 12 | #define __INCLUDE_ATMEL_PWM_BL_H | ||
| 13 | |||
| 14 | /** | ||
| 15 | * struct atmel_pwm_bl_platform_data | ||
| 16 | * @pwm_channel: which PWM channel in the PWM module to use. | ||
| 17 | * @pwm_frequency: PWM frequency to generate, the driver will try to be as | ||
| 18 | * close as the prescaler allows. | ||
| 19 | * @pwm_compare_max: value to use in the PWM channel compare register. | ||
| 20 | * @pwm_duty_max: maximum duty cycle value, must be less than or equal to | ||
| 21 | * pwm_compare_max. | ||
| 22 | * @pwm_duty_min: minimum duty cycle value, must be less than pwm_duty_max. | ||
| 23 | * @pwm_active_low: set to one if the low part of the PWM signal increases the | ||
| 24 | * brightness of the backlight. | ||
| 25 | * @gpio_on: GPIO line to control the backlight on/off, set to -1 if not used. | ||
| 26 | * @on_active_low: set to one if the on/off signal is on when GPIO is low. | ||
| 27 | * | ||
| 28 | * This struct must be added to the platform device in the board code. It is | ||
| 29 | * used by the atmel-pwm-bl driver to setup the GPIO to control on/off and the | ||
| 30 | * PWM device. | ||
| 31 | */ | ||
| 32 | struct atmel_pwm_bl_platform_data { | ||
| 33 | unsigned int pwm_channel; | ||
| 34 | unsigned int pwm_frequency; | ||
| 35 | unsigned int pwm_compare_max; | ||
| 36 | unsigned int pwm_duty_max; | ||
| 37 | unsigned int pwm_duty_min; | ||
| 38 | unsigned int pwm_active_low; | ||
| 39 | int gpio_on; | ||
| 40 | unsigned int on_active_low; | ||
| 41 | }; | ||
| 42 | |||
| 43 | #endif /* __INCLUDE_ATMEL_PWM_BL_H */ | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 8b82974bdc12..6272a395d43c 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -286,7 +286,6 @@ | |||
| 286 | #define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | 286 | #define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) |
| 287 | #define AUDIT_ARCH_SPARC (EM_SPARC) | 287 | #define AUDIT_ARCH_SPARC (EM_SPARC) |
| 288 | #define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT) | 288 | #define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT) |
| 289 | #define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) | ||
| 290 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | 289 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) |
| 291 | 290 | ||
| 292 | #define AUDIT_PERM_EXEC 1 | 291 | #define AUDIT_PERM_EXEC 1 |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 31a29541b504..b785c6f8644d 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
| @@ -98,8 +98,6 @@ union autofs_v5_packet_union { | |||
| 98 | #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI | 98 | #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI |
| 99 | #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI | 99 | #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI |
| 100 | #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) | 100 | #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) |
| 101 | #define AUTOFS_IOC_ASKREGHOST _IOR(0x93,0x68,int) | ||
| 102 | #define AUTOFS_IOC_TOGGLEREGHOST _IOR(0x93,0x69,int) | ||
| 103 | #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int) | 101 | #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int) |
| 104 | 102 | ||
| 105 | 103 | ||
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index 0da17d14fd13..d7afa9dd6635 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h | |||
| @@ -26,9 +26,13 @@ | |||
| 26 | 26 | ||
| 27 | #define AT_SECURE 23 /* secure mode boolean */ | 27 | #define AT_SECURE 23 /* secure mode boolean */ |
| 28 | 28 | ||
| 29 | #define AT_BASE_PLATFORM 24 /* string identifying real platform, may | ||
| 30 | * differ from AT_PLATFORM. */ | ||
| 31 | |||
| 29 | #define AT_EXECFN 31 /* filename of program */ | 32 | #define AT_EXECFN 31 /* filename of program */ |
| 33 | |||
| 30 | #ifdef __KERNEL__ | 34 | #ifdef __KERNEL__ |
| 31 | #define AT_VECTOR_SIZE_BASE 17 /* NEW_AUX_ENT entries in auxiliary table */ | 35 | #define AT_VECTOR_SIZE_BASE 18 /* NEW_AUX_ENT entries in auxiliary table */ |
| 32 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ | 36 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ |
| 33 | #endif | 37 | #endif |
| 34 | 38 | ||
diff --git a/include/linux/bcd.h b/include/linux/bcd.h index c545308125b0..7ac518e3c152 100644 --- a/include/linux/bcd.h +++ b/include/linux/bcd.h | |||
| @@ -10,8 +10,13 @@ | |||
| 10 | #ifndef _BCD_H | 10 | #ifndef _BCD_H |
| 11 | #define _BCD_H | 11 | #define _BCD_H |
| 12 | 12 | ||
| 13 | #define BCD2BIN(val) (((val) & 0x0f) + ((val)>>4)*10) | 13 | #include <linux/compiler.h> |
| 14 | #define BIN2BCD(val) ((((val)/10)<<4) + (val)%10) | 14 | |
| 15 | unsigned bcd2bin(unsigned char val) __attribute_const__; | ||
| 16 | unsigned char bin2bcd(unsigned val) __attribute_const__; | ||
| 17 | |||
| 18 | #define BCD2BIN(val) bcd2bin(val) | ||
| 19 | #define BIN2BCD(val) bin2bcd(val) | ||
| 15 | 20 | ||
| 16 | /* backwards compat */ | 21 | /* backwards compat */ |
| 17 | #define BCD_TO_BIN(val) ((val)=BCD2BIN(val)) | 22 | #define BCD_TO_BIN(val) ((val)=BCD2BIN(val)) |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index ee0ed48e8348..826f62350805 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -38,7 +38,7 @@ struct linux_binprm{ | |||
| 38 | misc_bang:1; | 38 | misc_bang:1; |
| 39 | struct file * file; | 39 | struct file * file; |
| 40 | int e_uid, e_gid; | 40 | int e_uid, e_gid; |
| 41 | kernel_cap_t cap_inheritable, cap_permitted; | 41 | kernel_cap_t cap_post_exec_permitted; |
| 42 | bool cap_effective; | 42 | bool cap_effective; |
| 43 | void *security; | 43 | void *security; |
| 44 | int argc, envc; | 44 | int argc, envc; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index a1d9b79078ea..652470b687c9 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -28,52 +28,73 @@ extern unsigned long saved_max_pfn; | |||
| 28 | * memory pages (including holes) on the node. | 28 | * memory pages (including holes) on the node. |
| 29 | */ | 29 | */ |
| 30 | typedef struct bootmem_data { | 30 | typedef struct bootmem_data { |
| 31 | unsigned long node_boot_start; | 31 | unsigned long node_min_pfn; |
| 32 | unsigned long node_low_pfn; | 32 | unsigned long node_low_pfn; |
| 33 | void *node_bootmem_map; | 33 | void *node_bootmem_map; |
| 34 | unsigned long last_offset; | 34 | unsigned long last_end_off; |
| 35 | unsigned long last_pos; | 35 | unsigned long hint_idx; |
| 36 | unsigned long last_success; /* Previous allocation point. To speed | ||
| 37 | * up searching */ | ||
| 38 | struct list_head list; | 36 | struct list_head list; |
| 39 | } bootmem_data_t; | 37 | } bootmem_data_t; |
| 40 | 38 | ||
| 39 | extern bootmem_data_t bootmem_node_data[]; | ||
| 40 | |||
| 41 | extern unsigned long bootmem_bootmap_pages(unsigned long); | 41 | extern unsigned long bootmem_bootmap_pages(unsigned long); |
| 42 | |||
| 43 | extern unsigned long init_bootmem_node(pg_data_t *pgdat, | ||
| 44 | unsigned long freepfn, | ||
| 45 | unsigned long startpfn, | ||
| 46 | unsigned long endpfn); | ||
| 42 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); | 47 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); |
| 48 | |||
| 49 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | ||
| 50 | extern unsigned long free_all_bootmem(void); | ||
| 51 | |||
| 52 | extern void free_bootmem_node(pg_data_t *pgdat, | ||
| 53 | unsigned long addr, | ||
| 54 | unsigned long size); | ||
| 43 | extern void free_bootmem(unsigned long addr, unsigned long size); | 55 | extern void free_bootmem(unsigned long addr, unsigned long size); |
| 44 | extern void *__alloc_bootmem(unsigned long size, | 56 | |
| 57 | /* | ||
| 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
| 59 | * the architecture-specific code should honor this). | ||
| 60 | * | ||
| 61 | * If flags is 0, then the return value is always 0 (success). If | ||
| 62 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
| 63 | * memory already was reserved. | ||
| 64 | */ | ||
| 65 | #define BOOTMEM_DEFAULT 0 | ||
| 66 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
| 67 | |||
| 68 | extern int reserve_bootmem_node(pg_data_t *pgdat, | ||
| 69 | unsigned long physaddr, | ||
| 70 | unsigned long size, | ||
| 71 | int flags); | ||
| 72 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | ||
| 73 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
| 74 | #endif | ||
| 75 | |||
| 76 | extern void *__alloc_bootmem_nopanic(unsigned long size, | ||
| 45 | unsigned long align, | 77 | unsigned long align, |
| 46 | unsigned long goal); | 78 | unsigned long goal); |
| 47 | extern void *__alloc_bootmem_nopanic(unsigned long size, | 79 | extern void *__alloc_bootmem(unsigned long size, |
| 48 | unsigned long align, | 80 | unsigned long align, |
| 49 | unsigned long goal); | 81 | unsigned long goal); |
| 50 | extern void *__alloc_bootmem_low(unsigned long size, | 82 | extern void *__alloc_bootmem_low(unsigned long size, |
| 51 | unsigned long align, | 83 | unsigned long align, |
| 52 | unsigned long goal); | 84 | unsigned long goal); |
| 85 | extern void *__alloc_bootmem_node(pg_data_t *pgdat, | ||
| 86 | unsigned long size, | ||
| 87 | unsigned long align, | ||
| 88 | unsigned long goal); | ||
| 89 | extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat, | ||
| 90 | unsigned long size, | ||
| 91 | unsigned long align, | ||
| 92 | unsigned long goal); | ||
| 53 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | 93 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, |
| 54 | unsigned long size, | 94 | unsigned long size, |
| 55 | unsigned long align, | 95 | unsigned long align, |
| 56 | unsigned long goal); | 96 | unsigned long goal); |
| 57 | extern void *__alloc_bootmem_core(struct bootmem_data *bdata, | ||
| 58 | unsigned long size, | ||
| 59 | unsigned long align, | ||
| 60 | unsigned long goal, | ||
| 61 | unsigned long limit); | ||
| 62 | |||
| 63 | /* | ||
| 64 | * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
| 65 | * the architecture-specific code should honor this) | ||
| 66 | */ | ||
| 67 | #define BOOTMEM_DEFAULT 0 | ||
| 68 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
| 69 | |||
| 70 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 97 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
| 71 | /* | ||
| 72 | * If flags is 0, then the return value is always 0 (success). If | ||
| 73 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
| 74 | * memory already was reserved. | ||
| 75 | */ | ||
| 76 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
| 77 | #define alloc_bootmem(x) \ | 98 | #define alloc_bootmem(x) \ |
| 78 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 99 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
| 79 | #define alloc_bootmem_low(x) \ | 100 | #define alloc_bootmem_low(x) \ |
| @@ -82,31 +103,6 @@ extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | |||
| 82 | __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 103 | __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
| 83 | #define alloc_bootmem_low_pages(x) \ | 104 | #define alloc_bootmem_low_pages(x) \ |
| 84 | __alloc_bootmem_low(x, PAGE_SIZE, 0) | 105 | __alloc_bootmem_low(x, PAGE_SIZE, 0) |
| 85 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | ||
| 86 | |||
| 87 | extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, | ||
| 88 | int flags); | ||
| 89 | extern unsigned long free_all_bootmem(void); | ||
| 90 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | ||
| 91 | extern void *__alloc_bootmem_node(pg_data_t *pgdat, | ||
| 92 | unsigned long size, | ||
| 93 | unsigned long align, | ||
| 94 | unsigned long goal); | ||
| 95 | extern unsigned long init_bootmem_node(pg_data_t *pgdat, | ||
| 96 | unsigned long freepfn, | ||
| 97 | unsigned long startpfn, | ||
| 98 | unsigned long endpfn); | ||
| 99 | extern int reserve_bootmem_node(pg_data_t *pgdat, | ||
| 100 | unsigned long physaddr, | ||
| 101 | unsigned long size, | ||
| 102 | int flags); | ||
| 103 | extern void free_bootmem_node(pg_data_t *pgdat, | ||
| 104 | unsigned long addr, | ||
| 105 | unsigned long size); | ||
| 106 | extern void *alloc_bootmem_section(unsigned long size, | ||
| 107 | unsigned long section_nr); | ||
| 108 | |||
| 109 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | ||
| 110 | #define alloc_bootmem_node(pgdat, x) \ | 106 | #define alloc_bootmem_node(pgdat, x) \ |
| 111 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 107 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
| 112 | #define alloc_bootmem_pages_node(pgdat, x) \ | 108 | #define alloc_bootmem_pages_node(pgdat, x) \ |
| @@ -115,6 +111,12 @@ extern void *alloc_bootmem_section(unsigned long size, | |||
| 115 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) | 111 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) |
| 116 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 112 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
| 117 | 113 | ||
| 114 | extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, | ||
| 115 | int flags); | ||
| 116 | |||
| 117 | extern void *alloc_bootmem_section(unsigned long size, | ||
| 118 | unsigned long section_nr); | ||
| 119 | |||
| 118 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 120 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
| 119 | extern void *alloc_remap(int nid, unsigned long size); | 121 | extern void *alloc_remap(int nid, unsigned long size); |
| 120 | #else | 122 | #else |
diff --git a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h index 961ed4b48d8e..44f95b92393b 100644 --- a/include/linux/byteorder/big_endian.h +++ b/include/linux/byteorder/big_endian.h | |||
| @@ -94,12 +94,12 @@ static inline __u16 __be16_to_cpup(const __be16 *p) | |||
| 94 | #define __le32_to_cpus(x) __swab32s((x)) | 94 | #define __le32_to_cpus(x) __swab32s((x)) |
| 95 | #define __cpu_to_le16s(x) __swab16s((x)) | 95 | #define __cpu_to_le16s(x) __swab16s((x)) |
| 96 | #define __le16_to_cpus(x) __swab16s((x)) | 96 | #define __le16_to_cpus(x) __swab16s((x)) |
| 97 | #define __cpu_to_be64s(x) do {} while (0) | 97 | #define __cpu_to_be64s(x) do { (void)(x); } while (0) |
| 98 | #define __be64_to_cpus(x) do {} while (0) | 98 | #define __be64_to_cpus(x) do { (void)(x); } while (0) |
| 99 | #define __cpu_to_be32s(x) do {} while (0) | 99 | #define __cpu_to_be32s(x) do { (void)(x); } while (0) |
| 100 | #define __be32_to_cpus(x) do {} while (0) | 100 | #define __be32_to_cpus(x) do { (void)(x); } while (0) |
| 101 | #define __cpu_to_be16s(x) do {} while (0) | 101 | #define __cpu_to_be16s(x) do { (void)(x); } while (0) |
| 102 | #define __be16_to_cpus(x) do {} while (0) | 102 | #define __be16_to_cpus(x) do { (void)(x); } while (0) |
| 103 | 103 | ||
| 104 | #ifdef __KERNEL__ | 104 | #ifdef __KERNEL__ |
| 105 | #include <linux/byteorder/generic.h> | 105 | #include <linux/byteorder/generic.h> |
diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h index 05dc7c35b3b2..4cc170a31762 100644 --- a/include/linux/byteorder/little_endian.h +++ b/include/linux/byteorder/little_endian.h | |||
| @@ -88,12 +88,12 @@ static inline __u16 __be16_to_cpup(const __be16 *p) | |||
| 88 | { | 88 | { |
| 89 | return __swab16p((__u16 *)p); | 89 | return __swab16p((__u16 *)p); |
| 90 | } | 90 | } |
| 91 | #define __cpu_to_le64s(x) do {} while (0) | 91 | #define __cpu_to_le64s(x) do { (void)(x); } while (0) |
| 92 | #define __le64_to_cpus(x) do {} while (0) | 92 | #define __le64_to_cpus(x) do { (void)(x); } while (0) |
| 93 | #define __cpu_to_le32s(x) do {} while (0) | 93 | #define __cpu_to_le32s(x) do { (void)(x); } while (0) |
| 94 | #define __le32_to_cpus(x) do {} while (0) | 94 | #define __le32_to_cpus(x) do { (void)(x); } while (0) |
| 95 | #define __cpu_to_le16s(x) do {} while (0) | 95 | #define __cpu_to_le16s(x) do { (void)(x); } while (0) |
| 96 | #define __le16_to_cpus(x) do {} while (0) | 96 | #define __le16_to_cpus(x) do { (void)(x); } while (0) |
| 97 | #define __cpu_to_be64s(x) __swab64s((x)) | 97 | #define __cpu_to_be64s(x) __swab64s((x)) |
| 98 | #define __be64_to_cpus(x) __swab64s((x)) | 98 | #define __be64_to_cpus(x) __swab64s((x)) |
| 99 | #define __cpu_to_be32s(x) __swab32s((x)) | 99 | #define __cpu_to_be32s(x) __swab32s((x)) |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index e155aa78d859..c98dd7cb7076 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -21,11 +21,13 @@ | |||
| 21 | struct cgroupfs_root; | 21 | struct cgroupfs_root; |
| 22 | struct cgroup_subsys; | 22 | struct cgroup_subsys; |
| 23 | struct inode; | 23 | struct inode; |
| 24 | struct cgroup; | ||
| 24 | 25 | ||
| 25 | extern int cgroup_init_early(void); | 26 | extern int cgroup_init_early(void); |
| 26 | extern int cgroup_init(void); | 27 | extern int cgroup_init(void); |
| 27 | extern void cgroup_init_smp(void); | 28 | extern void cgroup_init_smp(void); |
| 28 | extern void cgroup_lock(void); | 29 | extern void cgroup_lock(void); |
| 30 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); | ||
| 29 | extern void cgroup_unlock(void); | 31 | extern void cgroup_unlock(void); |
| 30 | extern void cgroup_fork(struct task_struct *p); | 32 | extern void cgroup_fork(struct task_struct *p); |
| 31 | extern void cgroup_fork_callbacks(struct task_struct *p); | 33 | extern void cgroup_fork_callbacks(struct task_struct *p); |
| @@ -205,50 +207,64 @@ struct cftype { | |||
| 205 | * subsystem, followed by a period */ | 207 | * subsystem, followed by a period */ |
| 206 | char name[MAX_CFTYPE_NAME]; | 208 | char name[MAX_CFTYPE_NAME]; |
| 207 | int private; | 209 | int private; |
| 208 | int (*open) (struct inode *inode, struct file *file); | 210 | |
| 209 | ssize_t (*read) (struct cgroup *cgrp, struct cftype *cft, | 211 | /* |
| 210 | struct file *file, | 212 | * If non-zero, defines the maximum length of string that can |
| 211 | char __user *buf, size_t nbytes, loff_t *ppos); | 213 | * be passed to write_string; defaults to 64 |
| 214 | */ | ||
| 215 | size_t max_write_len; | ||
| 216 | |||
| 217 | int (*open)(struct inode *inode, struct file *file); | ||
| 218 | ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, | ||
| 219 | struct file *file, | ||
| 220 | char __user *buf, size_t nbytes, loff_t *ppos); | ||
| 212 | /* | 221 | /* |
| 213 | * read_u64() is a shortcut for the common case of returning a | 222 | * read_u64() is a shortcut for the common case of returning a |
| 214 | * single integer. Use it in place of read() | 223 | * single integer. Use it in place of read() |
| 215 | */ | 224 | */ |
| 216 | u64 (*read_u64) (struct cgroup *cgrp, struct cftype *cft); | 225 | u64 (*read_u64)(struct cgroup *cgrp, struct cftype *cft); |
| 217 | /* | 226 | /* |
| 218 | * read_s64() is a signed version of read_u64() | 227 | * read_s64() is a signed version of read_u64() |
| 219 | */ | 228 | */ |
| 220 | s64 (*read_s64) (struct cgroup *cgrp, struct cftype *cft); | 229 | s64 (*read_s64)(struct cgroup *cgrp, struct cftype *cft); |
| 221 | /* | 230 | /* |
| 222 | * read_map() is used for defining a map of key/value | 231 | * read_map() is used for defining a map of key/value |
| 223 | * pairs. It should call cb->fill(cb, key, value) for each | 232 | * pairs. It should call cb->fill(cb, key, value) for each |
| 224 | * entry. The key/value pairs (and their ordering) should not | 233 | * entry. The key/value pairs (and their ordering) should not |
| 225 | * change between reboots. | 234 | * change between reboots. |
| 226 | */ | 235 | */ |
| 227 | int (*read_map) (struct cgroup *cont, struct cftype *cft, | 236 | int (*read_map)(struct cgroup *cont, struct cftype *cft, |
| 228 | struct cgroup_map_cb *cb); | 237 | struct cgroup_map_cb *cb); |
| 229 | /* | 238 | /* |
| 230 | * read_seq_string() is used for outputting a simple sequence | 239 | * read_seq_string() is used for outputting a simple sequence |
| 231 | * using seqfile. | 240 | * using seqfile. |
| 232 | */ | 241 | */ |
| 233 | int (*read_seq_string) (struct cgroup *cont, struct cftype *cft, | 242 | int (*read_seq_string)(struct cgroup *cont, struct cftype *cft, |
| 234 | struct seq_file *m); | 243 | struct seq_file *m); |
| 235 | 244 | ||
| 236 | ssize_t (*write) (struct cgroup *cgrp, struct cftype *cft, | 245 | ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, |
| 237 | struct file *file, | 246 | struct file *file, |
| 238 | const char __user *buf, size_t nbytes, loff_t *ppos); | 247 | const char __user *buf, size_t nbytes, loff_t *ppos); |
| 239 | 248 | ||
| 240 | /* | 249 | /* |
| 241 | * write_u64() is a shortcut for the common case of accepting | 250 | * write_u64() is a shortcut for the common case of accepting |
| 242 | * a single integer (as parsed by simple_strtoull) from | 251 | * a single integer (as parsed by simple_strtoull) from |
| 243 | * userspace. Use in place of write(); return 0 or error. | 252 | * userspace. Use in place of write(); return 0 or error. |
| 244 | */ | 253 | */ |
| 245 | int (*write_u64) (struct cgroup *cgrp, struct cftype *cft, u64 val); | 254 | int (*write_u64)(struct cgroup *cgrp, struct cftype *cft, u64 val); |
| 246 | /* | 255 | /* |
| 247 | * write_s64() is a signed version of write_u64() | 256 | * write_s64() is a signed version of write_u64() |
| 248 | */ | 257 | */ |
| 249 | int (*write_s64) (struct cgroup *cgrp, struct cftype *cft, s64 val); | 258 | int (*write_s64)(struct cgroup *cgrp, struct cftype *cft, s64 val); |
| 250 | 259 | ||
| 251 | /* | 260 | /* |
| 261 | * write_string() is passed a nul-terminated kernelspace | ||
| 262 | * buffer of maximum length determined by max_write_len. | ||
| 263 | * Returns 0 or -ve error code. | ||
| 264 | */ | ||
| 265 | int (*write_string)(struct cgroup *cgrp, struct cftype *cft, | ||
| 266 | const char *buffer); | ||
| 267 | /* | ||
| 252 | * trigger() callback can be used to get some kick from the | 268 | * trigger() callback can be used to get some kick from the |
| 253 | * userspace, when the actual string written is not important | 269 | * userspace, when the actual string written is not important |
| 254 | * at all. The private field can be used to determine the | 270 | * at all. The private field can be used to determine the |
| @@ -256,7 +272,7 @@ struct cftype { | |||
| 256 | */ | 272 | */ |
| 257 | int (*trigger)(struct cgroup *cgrp, unsigned int event); | 273 | int (*trigger)(struct cgroup *cgrp, unsigned int event); |
| 258 | 274 | ||
| 259 | int (*release) (struct inode *inode, struct file *file); | 275 | int (*release)(struct inode *inode, struct file *file); |
| 260 | }; | 276 | }; |
| 261 | 277 | ||
| 262 | struct cgroup_scanner { | 278 | struct cgroup_scanner { |
| @@ -348,7 +364,8 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
| 348 | return task_subsys_state(task, subsys_id)->cgroup; | 364 | return task_subsys_state(task, subsys_id)->cgroup; |
| 349 | } | 365 | } |
| 350 | 366 | ||
| 351 | int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss); | 367 | int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss, |
| 368 | char *nodename); | ||
| 352 | 369 | ||
| 353 | /* A cgroup_iter should be treated as an opaque object */ | 370 | /* A cgroup_iter should be treated as an opaque object */ |
| 354 | struct cgroup_iter { | 371 | struct cgroup_iter { |
diff --git a/include/linux/coda.h b/include/linux/coda.h index b5cf0780c51a..96c87693800b 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h | |||
| @@ -199,28 +199,6 @@ typedef u_int32_t vuid_t; | |||
| 199 | typedef u_int32_t vgid_t; | 199 | typedef u_int32_t vgid_t; |
| 200 | #endif /*_VUID_T_ */ | 200 | #endif /*_VUID_T_ */ |
| 201 | 201 | ||
| 202 | #ifdef CONFIG_CODA_FS_OLD_API | ||
| 203 | struct CodaFid { | ||
| 204 | u_int32_t opaque[3]; | ||
| 205 | }; | ||
| 206 | |||
| 207 | static __inline__ ino_t coda_f2i(struct CodaFid *fid) | ||
| 208 | { | ||
| 209 | if ( ! fid ) | ||
| 210 | return 0; | ||
| 211 | if (fid->opaque[1] == 0xfffffffe || fid->opaque[1] == 0xffffffff) | ||
| 212 | return ((fid->opaque[0] << 20) | (fid->opaque[2] & 0xfffff)); | ||
| 213 | else | ||
| 214 | return (fid->opaque[2] + (fid->opaque[1]<<10) + (fid->opaque[0]<<20)); | ||
| 215 | } | ||
| 216 | |||
| 217 | struct coda_cred { | ||
| 218 | vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/ | ||
| 219 | vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ | ||
| 220 | }; | ||
| 221 | |||
| 222 | #else /* not defined(CONFIG_CODA_FS_OLD_API) */ | ||
| 223 | |||
| 224 | struct CodaFid { | 202 | struct CodaFid { |
| 225 | u_int32_t opaque[4]; | 203 | u_int32_t opaque[4]; |
| 226 | }; | 204 | }; |
| @@ -228,8 +206,6 @@ struct CodaFid { | |||
| 228 | #define coda_f2i(fid)\ | 206 | #define coda_f2i(fid)\ |
| 229 | (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0) | 207 | (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0) |
| 230 | 208 | ||
| 231 | #endif | ||
| 232 | |||
| 233 | #ifndef _VENUS_VATTR_T_ | 209 | #ifndef _VENUS_VATTR_T_ |
| 234 | #define _VENUS_VATTR_T_ | 210 | #define _VENUS_VATTR_T_ |
| 235 | /* | 211 | /* |
| @@ -313,15 +289,7 @@ struct coda_statfs { | |||
| 313 | 289 | ||
| 314 | #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t) | 290 | #define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t) |
| 315 | 291 | ||
| 316 | #if 0 | ||
| 317 | #define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */ | ||
| 318 | #define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */ | ||
| 319 | #endif | ||
| 320 | #ifdef CONFIG_CODA_FS_OLD_API | ||
| 321 | #define CODA_KERNEL_VERSION 2 /* venus_lookup got an extra parameter */ | ||
| 322 | #else | ||
| 323 | #define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */ | 292 | #define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */ |
| 324 | #endif | ||
| 325 | 293 | ||
| 326 | /* | 294 | /* |
| 327 | * Venus <-> Coda RPC arguments | 295 | * Venus <-> Coda RPC arguments |
| @@ -329,16 +297,9 @@ struct coda_statfs { | |||
| 329 | struct coda_in_hdr { | 297 | struct coda_in_hdr { |
| 330 | u_int32_t opcode; | 298 | u_int32_t opcode; |
| 331 | u_int32_t unique; /* Keep multiple outstanding msgs distinct */ | 299 | u_int32_t unique; /* Keep multiple outstanding msgs distinct */ |
| 332 | #ifdef CONFIG_CODA_FS_OLD_API | ||
| 333 | u_int16_t pid; /* Common to all */ | ||
| 334 | u_int16_t pgid; /* Common to all */ | ||
| 335 | u_int16_t sid; /* Common to all */ | ||
| 336 | struct coda_cred cred; /* Common to all */ | ||
| 337 | #else | ||
| 338 | pid_t pid; | 300 | pid_t pid; |
| 339 | pid_t pgid; | 301 | pid_t pgid; |
| 340 | vuid_t uid; | 302 | vuid_t uid; |
| 341 | #endif | ||
| 342 | }; | 303 | }; |
| 343 | 304 | ||
| 344 | /* Really important that opcode and unique are 1st two fields! */ | 305 | /* Really important that opcode and unique are 1st two fields! */ |
| @@ -613,11 +574,7 @@ struct coda_vget_out { | |||
| 613 | /* CODA_PURGEUSER is a venus->kernel call */ | 574 | /* CODA_PURGEUSER is a venus->kernel call */ |
| 614 | struct coda_purgeuser_out { | 575 | struct coda_purgeuser_out { |
| 615 | struct coda_out_hdr oh; | 576 | struct coda_out_hdr oh; |
| 616 | #ifdef CONFIG_CODA_FS_OLD_API | ||
| 617 | struct coda_cred cred; | ||
| 618 | #else | ||
| 619 | vuid_t uid; | 577 | vuid_t uid; |
| 620 | #endif | ||
| 621 | }; | 578 | }; |
| 622 | 579 | ||
| 623 | /* coda_zapfile: */ | 580 | /* coda_zapfile: */ |
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index 31b75311e2ca..dcc228aa335a 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
| @@ -37,7 +37,7 @@ extern const struct file_operations coda_ioctl_operations; | |||
| 37 | /* operations shared over more than one file */ | 37 | /* operations shared over more than one file */ |
| 38 | int coda_open(struct inode *i, struct file *f); | 38 | int coda_open(struct inode *i, struct file *f); |
| 39 | int coda_release(struct inode *i, struct file *f); | 39 | int coda_release(struct inode *i, struct file *f); |
| 40 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); | 40 | int coda_permission(struct inode *inode, int mask); |
| 41 | int coda_revalidate_inode(struct dentry *); | 41 | int coda_revalidate_inode(struct dentry *); |
| 42 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 42 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
| 43 | int coda_setattr(struct dentry *, struct iattr *); | 43 | int coda_setattr(struct dentry *, struct iattr *); |
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h index e2bf7e5db39a..c4811da1338b 100644 --- a/include/linux/consolemap.h +++ b/include/linux/consolemap.h | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | * | 3 | * |
| 4 | * Interface between console.c, selection.c and consolemap.c | 4 | * Interface between console.c, selection.c and consolemap.c |
| 5 | */ | 5 | */ |
| 6 | #ifndef __LINUX_CONSOLEMAP_H__ | ||
| 7 | #define __LINUX_CONSOLEMAP_H__ | ||
| 8 | |||
| 6 | #define LAT1_MAP 0 | 9 | #define LAT1_MAP 0 |
| 7 | #define GRAF_MAP 1 | 10 | #define GRAF_MAP 1 |
| 8 | #define IBMPC_MAP 2 | 11 | #define IBMPC_MAP 2 |
| @@ -10,6 +13,7 @@ | |||
| 10 | 13 | ||
| 11 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 12 | 15 | ||
| 16 | #ifdef CONFIG_CONSOLE_TRANSLATIONS | ||
| 13 | struct vc_data; | 17 | struct vc_data; |
| 14 | 18 | ||
| 15 | extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode); | 19 | extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode); |
| @@ -18,3 +22,13 @@ extern int conv_uni_to_pc(struct vc_data *conp, long ucs); | |||
| 18 | extern u32 conv_8bit_to_uni(unsigned char c); | 22 | extern u32 conv_8bit_to_uni(unsigned char c); |
| 19 | extern int conv_uni_to_8bit(u32 uni); | 23 | extern int conv_uni_to_8bit(u32 uni); |
| 20 | void console_map_init(void); | 24 | void console_map_init(void); |
| 25 | #else | ||
| 26 | #define inverse_translate(conp, glyph, uni) ((uint16_t)glyph) | ||
| 27 | #define set_translate(m, vc) ((unsigned short *)NULL) | ||
| 28 | #define conv_uni_to_pc(conp, ucs) ((int) (ucs > 0xff ? -1: ucs)) | ||
| 29 | #define conv_8bit_to_uni(c) ((uint32_t)(c)) | ||
| 30 | #define conv_uni_to_8bit(c) ((int) ((c) & 0xff)) | ||
| 31 | #define console_map_init(c) do { ; } while (0) | ||
| 32 | #endif /* CONFIG_CONSOLE_TRANSLATIONS */ | ||
| 33 | |||
| 34 | #endif /* __LINUX_CONSOLEMAP_H__ */ | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 7464ba3b4333..d7faf8808497 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -69,10 +69,11 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) | |||
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | int cpu_up(unsigned int cpu); | 71 | int cpu_up(unsigned int cpu); |
| 72 | |||
| 73 | extern void cpu_hotplug_init(void); | 72 | extern void cpu_hotplug_init(void); |
| 73 | extern void cpu_maps_update_begin(void); | ||
| 74 | extern void cpu_maps_update_done(void); | ||
| 74 | 75 | ||
| 75 | #else | 76 | #else /* CONFIG_SMP */ |
| 76 | 77 | ||
| 77 | static inline int register_cpu_notifier(struct notifier_block *nb) | 78 | static inline int register_cpu_notifier(struct notifier_block *nb) |
| 78 | { | 79 | { |
| @@ -87,10 +88,16 @@ static inline void cpu_hotplug_init(void) | |||
| 87 | { | 88 | { |
| 88 | } | 89 | } |
| 89 | 90 | ||
| 91 | static inline void cpu_maps_update_begin(void) | ||
| 92 | { | ||
| 93 | } | ||
| 94 | |||
| 95 | static inline void cpu_maps_update_done(void) | ||
| 96 | { | ||
| 97 | } | ||
| 98 | |||
| 90 | #endif /* CONFIG_SMP */ | 99 | #endif /* CONFIG_SMP */ |
| 91 | extern struct sysdev_class cpu_sysdev_class; | 100 | extern struct sysdev_class cpu_sysdev_class; |
| 92 | extern void cpu_maps_update_begin(void); | ||
| 93 | extern void cpu_maps_update_done(void); | ||
| 94 | 101 | ||
| 95 | #ifdef CONFIG_HOTPLUG_CPU | 102 | #ifdef CONFIG_HOTPLUG_CPU |
| 96 | /* Stop CPUs going up and down. */ | 103 | /* Stop CPUs going up and down. */ |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 22c7ac5cd80c..025e4f575103 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
| @@ -8,7 +8,13 @@ | |||
| 8 | #include <linux/proc_fs.h> | 8 | #include <linux/proc_fs.h> |
| 9 | 9 | ||
| 10 | #define ELFCORE_ADDR_MAX (-1ULL) | 10 | #define ELFCORE_ADDR_MAX (-1ULL) |
| 11 | |||
| 12 | #ifdef CONFIG_PROC_VMCORE | ||
| 11 | extern unsigned long long elfcorehdr_addr; | 13 | extern unsigned long long elfcorehdr_addr; |
| 14 | #else | ||
| 15 | static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; | ||
| 16 | #endif | ||
| 17 | |||
| 12 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | 18 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, |
| 13 | unsigned long, int); | 19 | unsigned long, int); |
| 14 | extern const struct file_operations proc_vmcore_operations; | 20 | extern const struct file_operations proc_vmcore_operations; |
| @@ -22,5 +28,13 @@ extern struct proc_dir_entry *proc_vmcore; | |||
| 22 | 28 | ||
| 23 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | 29 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) |
| 24 | 30 | ||
| 31 | static inline int is_kdump_kernel(void) | ||
| 32 | { | ||
| 33 | return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0; | ||
| 34 | } | ||
| 35 | #else /* !CONFIG_CRASH_DUMP */ | ||
| 36 | static inline int is_kdump_kernel(void) { return 0; } | ||
| 25 | #endif /* CONFIG_CRASH_DUMP */ | 37 | #endif /* CONFIG_CRASH_DUMP */ |
| 38 | |||
| 39 | extern unsigned long saved_max_pfn; | ||
| 26 | #endif /* LINUX_CRASHDUMP_H */ | 40 | #endif /* LINUX_CRASHDUMP_H */ |
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index ab94bc083558..f352f06fa063 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h | |||
| @@ -39,6 +39,8 @@ extern void __delayacct_blkio_start(void); | |||
| 39 | extern void __delayacct_blkio_end(void); | 39 | extern void __delayacct_blkio_end(void); |
| 40 | extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); | 40 | extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); |
| 41 | extern __u64 __delayacct_blkio_ticks(struct task_struct *); | 41 | extern __u64 __delayacct_blkio_ticks(struct task_struct *); |
| 42 | extern void __delayacct_freepages_start(void); | ||
| 43 | extern void __delayacct_freepages_end(void); | ||
| 42 | 44 | ||
| 43 | static inline int delayacct_is_task_waiting_on_io(struct task_struct *p) | 45 | static inline int delayacct_is_task_waiting_on_io(struct task_struct *p) |
| 44 | { | 46 | { |
| @@ -107,6 +109,18 @@ static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) | |||
| 107 | return 0; | 109 | return 0; |
| 108 | } | 110 | } |
| 109 | 111 | ||
| 112 | static inline void delayacct_freepages_start(void) | ||
| 113 | { | ||
| 114 | if (current->delays) | ||
| 115 | __delayacct_freepages_start(); | ||
| 116 | } | ||
| 117 | |||
| 118 | static inline void delayacct_freepages_end(void) | ||
| 119 | { | ||
| 120 | if (current->delays) | ||
| 121 | __delayacct_freepages_end(); | ||
| 122 | } | ||
| 123 | |||
| 110 | #else | 124 | #else |
| 111 | static inline void delayacct_set_flag(int flag) | 125 | static inline void delayacct_set_flag(int flag) |
| 112 | {} | 126 | {} |
| @@ -129,6 +143,11 @@ static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) | |||
| 129 | { return 0; } | 143 | { return 0; } |
| 130 | static inline int delayacct_is_task_waiting_on_io(struct task_struct *p) | 144 | static inline int delayacct_is_task_waiting_on_io(struct task_struct *p) |
| 131 | { return 0; } | 145 | { return 0; } |
| 146 | static inline void delayacct_freepages_start(void) | ||
| 147 | {} | ||
| 148 | static inline void delayacct_freepages_end(void) | ||
| 149 | {} | ||
| 150 | |||
| 132 | #endif /* CONFIG_TASK_DELAY_ACCT */ | 151 | #endif /* CONFIG_TASK_DELAY_ACCT */ |
| 133 | 152 | ||
| 134 | #endif | 153 | #endif |
diff --git a/include/linux/dirent.h b/include/linux/dirent.h index 5d6023b87800..f072fb8d10a3 100644 --- a/include/linux/dirent.h +++ b/include/linux/dirent.h | |||
| @@ -1,23 +1,6 @@ | |||
| 1 | #ifndef _LINUX_DIRENT_H | 1 | #ifndef _LINUX_DIRENT_H |
| 2 | #define _LINUX_DIRENT_H | 2 | #define _LINUX_DIRENT_H |
| 3 | 3 | ||
| 4 | struct dirent { | ||
| 5 | long d_ino; | ||
| 6 | __kernel_off_t d_off; | ||
| 7 | unsigned short d_reclen; | ||
| 8 | char d_name[256]; /* We must not include limits.h! */ | ||
| 9 | }; | ||
| 10 | |||
| 11 | struct dirent64 { | ||
| 12 | __u64 d_ino; | ||
| 13 | __s64 d_off; | ||
| 14 | unsigned short d_reclen; | ||
| 15 | unsigned char d_type; | ||
| 16 | char d_name[256]; | ||
| 17 | }; | ||
| 18 | |||
| 19 | #ifdef __KERNEL__ | ||
| 20 | |||
| 21 | struct linux_dirent64 { | 4 | struct linux_dirent64 { |
| 22 | u64 d_ino; | 5 | u64 d_ino; |
| 23 | s64 d_off; | 6 | s64 d_off; |
| @@ -26,7 +9,4 @@ struct linux_dirent64 { | |||
| 26 | char d_name[0]; | 9 | char d_name[0]; |
| 27 | }; | 10 | }; |
| 28 | 11 | ||
| 29 | #endif /* __KERNEL__ */ | ||
| 30 | |||
| 31 | |||
| 32 | #endif | 12 | #endif |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index a701399b7fed..a667637b54e3 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
| @@ -10,6 +10,13 @@ | |||
| 10 | 10 | ||
| 11 | #ifdef CONFIG_EVENTFD | 11 | #ifdef CONFIG_EVENTFD |
| 12 | 12 | ||
| 13 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
| 14 | #include <linux/fcntl.h> | ||
| 15 | |||
| 16 | /* Flags for eventfd2. */ | ||
| 17 | #define EFD_CLOEXEC O_CLOEXEC | ||
| 18 | #define EFD_NONBLOCK O_NONBLOCK | ||
| 19 | |||
| 13 | struct file *eventfd_fget(int fd); | 20 | struct file *eventfd_fget(int fd); |
| 14 | int eventfd_signal(struct file *file, int n); | 21 | int eventfd_signal(struct file *file, int n); |
| 15 | 22 | ||
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index cf79853967ff..f1e1d3c47125 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
| @@ -14,8 +14,12 @@ | |||
| 14 | #ifndef _LINUX_EVENTPOLL_H | 14 | #ifndef _LINUX_EVENTPOLL_H |
| 15 | #define _LINUX_EVENTPOLL_H | 15 | #define _LINUX_EVENTPOLL_H |
| 16 | 16 | ||
| 17 | /* For O_CLOEXEC */ | ||
| 18 | #include <linux/fcntl.h> | ||
| 17 | #include <linux/types.h> | 19 | #include <linux/types.h> |
| 18 | 20 | ||
| 21 | /* Flags for epoll_create1. */ | ||
| 22 | #define EPOLL_CLOEXEC O_CLOEXEC | ||
| 19 | 23 | ||
| 20 | /* Valid opcodes to issue to sys_epoll_ctl() */ | 24 | /* Valid opcodes to issue to sys_epoll_ctl() */ |
| 21 | #define EPOLL_CTL_ADD 1 | 25 | #define EPOLL_CTL_ADD 1 |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 84cec2aa9f1e..2efe7b863cff 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
| @@ -284,8 +284,8 @@ struct ext2_inode { | |||
| 284 | 284 | ||
| 285 | #ifdef __hurd__ | 285 | #ifdef __hurd__ |
| 286 | #define i_translator osd1.hurd1.h_i_translator | 286 | #define i_translator osd1.hurd1.h_i_translator |
| 287 | #define i_frag osd2.hurd2.h_i_frag; | 287 | #define i_frag osd2.hurd2.h_i_frag |
| 288 | #define i_fsize osd2.hurd2.h_i_fsize; | 288 | #define i_fsize osd2.hurd2.h_i_fsize |
| 289 | #define i_uid_high osd2.hurd2.h_i_uid_high | 289 | #define i_uid_high osd2.hurd2.h_i_uid_high |
| 290 | #define i_gid_high osd2.hurd2.h_i_gid_high | 290 | #define i_gid_high osd2.hurd2.h_i_gid_high |
| 291 | #define i_author osd2.hurd2.h_i_author | 291 | #define i_author osd2.hurd2.h_i_author |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 36c540396377..80171ee89a22 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -832,6 +832,7 @@ extern void ext3_discard_reservation (struct inode *); | |||
| 832 | extern void ext3_dirty_inode(struct inode *); | 832 | extern void ext3_dirty_inode(struct inode *); |
| 833 | extern int ext3_change_inode_journal_flag(struct inode *, int); | 833 | extern int ext3_change_inode_journal_flag(struct inode *, int); |
| 834 | extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); | 834 | extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); |
| 835 | extern int ext3_can_truncate(struct inode *inode); | ||
| 835 | extern void ext3_truncate (struct inode *); | 836 | extern void ext3_truncate (struct inode *); |
| 836 | extern void ext3_set_inode_flags(struct inode *); | 837 | extern void ext3_set_inode_flags(struct inode *); |
| 837 | extern void ext3_get_inode_flags(struct ext3_inode_info *); | 838 | extern void ext3_get_inode_flags(struct ext3_inode_info *); |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 72295b099228..3b8870e32afd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -8,7 +8,6 @@ struct dentry; | |||
| 8 | 8 | ||
| 9 | /* Definitions of frame buffers */ | 9 | /* Definitions of frame buffers */ |
| 10 | 10 | ||
| 11 | #define FB_MAJOR 29 | ||
| 12 | #define FB_MAX 32 /* sufficient for now */ | 11 | #define FB_MAX 32 /* sufficient for now */ |
| 13 | 12 | ||
| 14 | /* ioctls | 13 | /* ioctls |
| @@ -120,6 +119,10 @@ struct dentry; | |||
| 120 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ | 119 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ |
| 121 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ | 120 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ |
| 122 | #define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */ | 121 | #define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */ |
| 122 | #define FB_ACCEL_TRIDENT_TGUI 50 /* Trident TGUI */ | ||
| 123 | #define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage */ | ||
| 124 | #define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D */ | ||
| 125 | #define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP */ | ||
| 123 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ | 126 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ |
| 124 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ | 127 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ |
| 125 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ | 128 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ |
diff --git a/include/linux/fd1772.h b/include/linux/fd1772.h deleted file mode 100644 index 871d6e4c677e..000000000000 --- a/include/linux/fd1772.h +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | #ifndef _LINUX_FD1772REG_H | ||
| 2 | #define _LINUX_FD1772REG_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | ** WD1772 stuff - originally from the M68K Linux | ||
| 6 | * Modified for Archimedes by Dave Gilbert (gilbertd@cs.man.ac.uk) | ||
| 7 | */ | ||
| 8 | |||
| 9 | /* register codes */ | ||
| 10 | |||
| 11 | #define FDC1772SELREG_STP (0x80) /* command/status register */ | ||
| 12 | #define FDC1772SELREG_TRA (0x82) /* track register */ | ||
| 13 | #define FDC1772SELREG_SEC (0x84) /* sector register */ | ||
| 14 | #define FDC1772SELREG_DTA (0x86) /* data register */ | ||
| 15 | |||
| 16 | /* register names for FDC1772_READ/WRITE macros */ | ||
| 17 | |||
| 18 | #define FDC1772REG_CMD 0 | ||
| 19 | #define FDC1772REG_STATUS 0 | ||
| 20 | #define FDC1772REG_TRACK 2 | ||
| 21 | #define FDC1772REG_SECTOR 4 | ||
| 22 | #define FDC1772REG_DATA 6 | ||
| 23 | |||
| 24 | /* command opcodes */ | ||
| 25 | |||
| 26 | #define FDC1772CMD_RESTORE (0x00) /* - */ | ||
| 27 | #define FDC1772CMD_SEEK (0x10) /* | */ | ||
| 28 | #define FDC1772CMD_STEP (0x20) /* | TYP 1 Commands */ | ||
| 29 | #define FDC1772CMD_STIN (0x40) /* | */ | ||
| 30 | #define FDC1772CMD_STOT (0x60) /* - */ | ||
| 31 | #define FDC1772CMD_RDSEC (0x80) /* - TYP 2 Commands */ | ||
| 32 | #define FDC1772CMD_WRSEC (0xa0) /* - " */ | ||
| 33 | #define FDC1772CMD_RDADR (0xc0) /* - */ | ||
| 34 | #define FDC1772CMD_RDTRA (0xe0) /* | TYP 3 Commands */ | ||
| 35 | #define FDC1772CMD_WRTRA (0xf0) /* - */ | ||
| 36 | #define FDC1772CMD_FORCI (0xd0) /* - TYP 4 Command */ | ||
| 37 | |||
| 38 | /* command modifier bits */ | ||
| 39 | |||
| 40 | #define FDC1772CMDADD_SR6 (0x00) /* step rate settings */ | ||
| 41 | #define FDC1772CMDADD_SR12 (0x01) | ||
| 42 | #define FDC1772CMDADD_SR2 (0x02) | ||
| 43 | #define FDC1772CMDADD_SR3 (0x03) | ||
| 44 | #define FDC1772CMDADD_V (0x04) /* verify */ | ||
| 45 | #define FDC1772CMDADD_H (0x08) /* wait for spin-up */ | ||
| 46 | #define FDC1772CMDADD_U (0x10) /* update track register */ | ||
| 47 | #define FDC1772CMDADD_M (0x10) /* multiple sector access */ | ||
| 48 | #define FDC1772CMDADD_E (0x04) /* head settling flag */ | ||
| 49 | #define FDC1772CMDADD_P (0x02) /* precompensation */ | ||
| 50 | #define FDC1772CMDADD_A0 (0x01) /* DAM flag */ | ||
| 51 | |||
| 52 | /* status register bits */ | ||
| 53 | |||
| 54 | #define FDC1772STAT_MOTORON (0x80) /* motor on */ | ||
| 55 | #define FDC1772STAT_WPROT (0x40) /* write protected (FDC1772CMD_WR*) */ | ||
| 56 | #define FDC1772STAT_SPINUP (0x20) /* motor speed stable (Type I) */ | ||
| 57 | #define FDC1772STAT_DELDAM (0x20) /* sector has deleted DAM (Type II+III) */ | ||
| 58 | #define FDC1772STAT_RECNF (0x10) /* record not found */ | ||
| 59 | #define FDC1772STAT_CRC (0x08) /* CRC error */ | ||
| 60 | #define FDC1772STAT_TR00 (0x04) /* Track 00 flag (Type I) */ | ||
| 61 | #define FDC1772STAT_LOST (0x04) /* Lost Data (Type II+III) */ | ||
| 62 | #define FDC1772STAT_IDX (0x02) /* Index status (Type I) */ | ||
| 63 | #define FDC1772STAT_DRQ (0x02) /* DRQ status (Type II+III) */ | ||
| 64 | #define FDC1772STAT_BUSY (0x01) /* FDC1772 is busy */ | ||
| 65 | |||
| 66 | |||
| 67 | /* PSG Port A Bit Nr 0 .. Side Sel .. 0 -> Side 1 1 -> Side 2 */ | ||
| 68 | #define DSKSIDE (0x01) | ||
| 69 | |||
| 70 | #define DSKDRVNONE (0x06) | ||
| 71 | #define DSKDRV0 (0x02) | ||
| 72 | #define DSKDRV1 (0x04) | ||
| 73 | |||
| 74 | /* step rates */ | ||
| 75 | #define FDC1772STEP_6 0x00 | ||
| 76 | #define FDC1772STEP_12 0x01 | ||
| 77 | #define FDC1772STEP_2 0x02 | ||
| 78 | #define FDC1772STEP_3 0x03 | ||
| 79 | |||
| 80 | #endif | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9c2ac5c0ef5c..8252b045e624 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -60,6 +60,8 @@ extern int dir_notify_enable; | |||
| 60 | #define MAY_WRITE 2 | 60 | #define MAY_WRITE 2 |
| 61 | #define MAY_READ 4 | 61 | #define MAY_READ 4 |
| 62 | #define MAY_APPEND 8 | 62 | #define MAY_APPEND 8 |
| 63 | #define MAY_ACCESS 16 | ||
| 64 | #define MAY_OPEN 32 | ||
| 63 | 65 | ||
| 64 | #define FMODE_READ 1 | 66 | #define FMODE_READ 1 |
| 65 | #define FMODE_WRITE 2 | 67 | #define FMODE_WRITE 2 |
| @@ -277,7 +279,7 @@ extern int dir_notify_enable; | |||
| 277 | #include <linux/types.h> | 279 | #include <linux/types.h> |
| 278 | #include <linux/kdev_t.h> | 280 | #include <linux/kdev_t.h> |
| 279 | #include <linux/dcache.h> | 281 | #include <linux/dcache.h> |
| 280 | #include <linux/namei.h> | 282 | #include <linux/path.h> |
| 281 | #include <linux/stat.h> | 283 | #include <linux/stat.h> |
| 282 | #include <linux/cache.h> | 284 | #include <linux/cache.h> |
| 283 | #include <linux/kobject.h> | 285 | #include <linux/kobject.h> |
| @@ -318,22 +320,23 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
| 318 | * Attribute flags. These should be or-ed together to figure out what | 320 | * Attribute flags. These should be or-ed together to figure out what |
| 319 | * has been changed! | 321 | * has been changed! |
| 320 | */ | 322 | */ |
| 321 | #define ATTR_MODE 1 | 323 | #define ATTR_MODE (1 << 0) |
| 322 | #define ATTR_UID 2 | 324 | #define ATTR_UID (1 << 1) |
| 323 | #define ATTR_GID 4 | 325 | #define ATTR_GID (1 << 2) |
| 324 | #define ATTR_SIZE 8 | 326 | #define ATTR_SIZE (1 << 3) |
| 325 | #define ATTR_ATIME 16 | 327 | #define ATTR_ATIME (1 << 4) |
| 326 | #define ATTR_MTIME 32 | 328 | #define ATTR_MTIME (1 << 5) |
| 327 | #define ATTR_CTIME 64 | 329 | #define ATTR_CTIME (1 << 6) |
| 328 | #define ATTR_ATIME_SET 128 | 330 | #define ATTR_ATIME_SET (1 << 7) |
| 329 | #define ATTR_MTIME_SET 256 | 331 | #define ATTR_MTIME_SET (1 << 8) |
| 330 | #define ATTR_FORCE 512 /* Not a change, but a change it */ | 332 | #define ATTR_FORCE (1 << 9) /* Not a change, but a change it */ |
| 331 | #define ATTR_ATTR_FLAG 1024 | 333 | #define ATTR_ATTR_FLAG (1 << 10) |
| 332 | #define ATTR_KILL_SUID 2048 | 334 | #define ATTR_KILL_SUID (1 << 11) |
| 333 | #define ATTR_KILL_SGID 4096 | 335 | #define ATTR_KILL_SGID (1 << 12) |
| 334 | #define ATTR_FILE 8192 | 336 | #define ATTR_FILE (1 << 13) |
| 335 | #define ATTR_KILL_PRIV 16384 | 337 | #define ATTR_KILL_PRIV (1 << 14) |
| 336 | #define ATTR_OPEN 32768 /* Truncating from open(O_TRUNC) */ | 338 | #define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */ |
| 339 | #define ATTR_TIMES_SET (1 << 16) | ||
| 337 | 340 | ||
| 338 | /* | 341 | /* |
| 339 | * This is the Inode Attributes structure, used for notify_change(). It | 342 | * This is the Inode Attributes structure, used for notify_change(). It |
| @@ -499,7 +502,7 @@ struct backing_dev_info; | |||
| 499 | struct address_space { | 502 | struct address_space { |
| 500 | struct inode *host; /* owner: inode, block_device */ | 503 | struct inode *host; /* owner: inode, block_device */ |
| 501 | struct radix_tree_root page_tree; /* radix tree of all pages */ | 504 | struct radix_tree_root page_tree; /* radix tree of all pages */ |
| 502 | rwlock_t tree_lock; /* and rwlock protecting it */ | 505 | spinlock_t tree_lock; /* and lock protecting it */ |
| 503 | unsigned int i_mmap_writable;/* count VM_SHARED mappings */ | 506 | unsigned int i_mmap_writable;/* count VM_SHARED mappings */ |
| 504 | struct prio_tree_root i_mmap; /* tree of private and shared mappings */ | 507 | struct prio_tree_root i_mmap; /* tree of private and shared mappings */ |
| 505 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ | 508 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ |
| @@ -792,7 +795,7 @@ struct file { | |||
| 792 | #define f_dentry f_path.dentry | 795 | #define f_dentry f_path.dentry |
| 793 | #define f_vfsmnt f_path.mnt | 796 | #define f_vfsmnt f_path.mnt |
| 794 | const struct file_operations *f_op; | 797 | const struct file_operations *f_op; |
| 795 | atomic_t f_count; | 798 | atomic_long_t f_count; |
| 796 | unsigned int f_flags; | 799 | unsigned int f_flags; |
| 797 | mode_t f_mode; | 800 | mode_t f_mode; |
| 798 | loff_t f_pos; | 801 | loff_t f_pos; |
| @@ -821,8 +824,8 @@ extern spinlock_t files_lock; | |||
| 821 | #define file_list_lock() spin_lock(&files_lock); | 824 | #define file_list_lock() spin_lock(&files_lock); |
| 822 | #define file_list_unlock() spin_unlock(&files_lock); | 825 | #define file_list_unlock() spin_unlock(&files_lock); |
| 823 | 826 | ||
| 824 | #define get_file(x) atomic_inc(&(x)->f_count) | 827 | #define get_file(x) atomic_long_inc(&(x)->f_count) |
| 825 | #define file_count(x) atomic_read(&(x)->f_count) | 828 | #define file_count(x) atomic_long_read(&(x)->f_count) |
| 826 | 829 | ||
| 827 | #ifdef CONFIG_DEBUG_WRITECOUNT | 830 | #ifdef CONFIG_DEBUG_WRITECOUNT |
| 828 | static inline void file_take_write(struct file *f) | 831 | static inline void file_take_write(struct file *f) |
| @@ -886,6 +889,12 @@ static inline int file_check_writeable(struct file *filp) | |||
| 886 | #define FL_SLEEP 128 /* A blocking lock */ | 889 | #define FL_SLEEP 128 /* A blocking lock */ |
| 887 | 890 | ||
| 888 | /* | 891 | /* |
| 892 | * Special return value from posix_lock_file() and vfs_lock_file() for | ||
| 893 | * asynchronous locking. | ||
| 894 | */ | ||
| 895 | #define FILE_LOCK_DEFERRED 1 | ||
| 896 | |||
| 897 | /* | ||
| 889 | * The POSIX file lock owner is determined by | 898 | * The POSIX file lock owner is determined by |
| 890 | * the "struct files_struct" in the thread group | 899 | * the "struct files_struct" in the thread group |
| 891 | * (or NULL for no owner - BSD locks). | 900 | * (or NULL for no owner - BSD locks). |
| @@ -1025,6 +1034,7 @@ extern int send_sigurg(struct fown_struct *fown); | |||
| 1025 | extern struct list_head super_blocks; | 1034 | extern struct list_head super_blocks; |
| 1026 | extern spinlock_t sb_lock; | 1035 | extern spinlock_t sb_lock; |
| 1027 | 1036 | ||
| 1037 | #define sb_entry(list) list_entry((list), struct super_block, s_list) | ||
| 1028 | #define S_BIAS (1<<30) | 1038 | #define S_BIAS (1<<30) |
| 1029 | struct super_block { | 1039 | struct super_block { |
| 1030 | struct list_head s_list; /* Keep this first */ | 1040 | struct list_head s_list; /* Keep this first */ |
| @@ -1058,6 +1068,9 @@ struct super_block { | |||
| 1058 | struct list_head s_more_io; /* parked for more writeback */ | 1068 | struct list_head s_more_io; /* parked for more writeback */ |
| 1059 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1069 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ |
| 1060 | struct list_head s_files; | 1070 | struct list_head s_files; |
| 1071 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | ||
| 1072 | struct list_head s_dentry_lru; /* unused dentry lru */ | ||
| 1073 | int s_nr_dentry_unused; /* # of dentry on lru */ | ||
| 1061 | 1074 | ||
| 1062 | struct block_device *s_bdev; | 1075 | struct block_device *s_bdev; |
| 1063 | struct mtd_info *s_mtd; | 1076 | struct mtd_info *s_mtd; |
| @@ -1126,7 +1139,7 @@ extern int vfs_permission(struct nameidata *, int); | |||
| 1126 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); | 1139 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); |
| 1127 | extern int vfs_mkdir(struct inode *, struct dentry *, int); | 1140 | extern int vfs_mkdir(struct inode *, struct dentry *, int); |
| 1128 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); | 1141 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); |
| 1129 | extern int vfs_symlink(struct inode *, struct dentry *, const char *, int); | 1142 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); |
| 1130 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *); | 1143 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *); |
| 1131 | extern int vfs_rmdir(struct inode *, struct dentry *); | 1144 | extern int vfs_rmdir(struct inode *, struct dentry *); |
| 1132 | extern int vfs_unlink(struct inode *, struct dentry *); | 1145 | extern int vfs_unlink(struct inode *, struct dentry *); |
| @@ -1262,7 +1275,7 @@ struct inode_operations { | |||
| 1262 | void * (*follow_link) (struct dentry *, struct nameidata *); | 1275 | void * (*follow_link) (struct dentry *, struct nameidata *); |
| 1263 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 1276 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
| 1264 | void (*truncate) (struct inode *); | 1277 | void (*truncate) (struct inode *); |
| 1265 | int (*permission) (struct inode *, int, struct nameidata *); | 1278 | int (*permission) (struct inode *, int); |
| 1266 | int (*setattr) (struct dentry *, struct iattr *); | 1279 | int (*setattr) (struct dentry *, struct iattr *); |
| 1267 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | 1280 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); |
| 1268 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | 1281 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); |
| @@ -1686,9 +1699,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t); | |||
| 1686 | extern void make_bad_inode(struct inode *); | 1699 | extern void make_bad_inode(struct inode *); |
| 1687 | extern int is_bad_inode(struct inode *); | 1700 | extern int is_bad_inode(struct inode *); |
| 1688 | 1701 | ||
| 1689 | extern const struct file_operations read_fifo_fops; | 1702 | extern const struct file_operations read_pipefifo_fops; |
| 1690 | extern const struct file_operations write_fifo_fops; | 1703 | extern const struct file_operations write_pipefifo_fops; |
| 1691 | extern const struct file_operations rdwr_fifo_fops; | 1704 | extern const struct file_operations rdwr_pipefifo_fops; |
| 1692 | 1705 | ||
| 1693 | extern int fs_may_remount_ro(struct super_block *); | 1706 | extern int fs_may_remount_ro(struct super_block *); |
| 1694 | 1707 | ||
| @@ -1757,7 +1770,7 @@ extern int do_remount_sb(struct super_block *sb, int flags, | |||
| 1757 | extern sector_t bmap(struct inode *, sector_t); | 1770 | extern sector_t bmap(struct inode *, sector_t); |
| 1758 | #endif | 1771 | #endif |
| 1759 | extern int notify_change(struct dentry *, struct iattr *); | 1772 | extern int notify_change(struct dentry *, struct iattr *); |
| 1760 | extern int permission(struct inode *, int, struct nameidata *); | 1773 | extern int inode_permission(struct inode *, int); |
| 1761 | extern int generic_permission(struct inode *, int, | 1774 | extern int generic_permission(struct inode *, int, |
| 1762 | int (*check_acl)(struct inode *, int)); | 1775 | int (*check_acl)(struct inode *, int)); |
| 1763 | 1776 | ||
| @@ -1773,8 +1786,9 @@ static inline void allow_write_access(struct file *file) | |||
| 1773 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | 1786 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
| 1774 | } | 1787 | } |
| 1775 | extern int do_pipe(int *); | 1788 | extern int do_pipe(int *); |
| 1776 | extern struct file *create_read_pipe(struct file *f); | 1789 | extern int do_pipe_flags(int *, int); |
| 1777 | extern struct file *create_write_pipe(void); | 1790 | extern struct file *create_read_pipe(struct file *f, int flags); |
| 1791 | extern struct file *create_write_pipe(int flags); | ||
| 1778 | extern void free_write_pipe(struct file *); | 1792 | extern void free_write_pipe(struct file *); |
| 1779 | 1793 | ||
| 1780 | extern struct file *do_filp_open(int dfd, const char *pathname, | 1794 | extern struct file *do_filp_open(int dfd, const char *pathname, |
| @@ -1820,7 +1834,7 @@ extern void clear_inode(struct inode *); | |||
| 1820 | extern void destroy_inode(struct inode *); | 1834 | extern void destroy_inode(struct inode *); |
| 1821 | extern struct inode *new_inode(struct super_block *); | 1835 | extern struct inode *new_inode(struct super_block *); |
| 1822 | extern int should_remove_suid(struct dentry *); | 1836 | extern int should_remove_suid(struct dentry *); |
| 1823 | extern int remove_suid(struct dentry *); | 1837 | extern int file_remove_suid(struct file *); |
| 1824 | 1838 | ||
| 1825 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | 1839 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); |
| 1826 | extern void remove_inode_hash(struct inode *); | 1840 | extern void remove_inode_hash(struct inode *); |
| @@ -2006,8 +2020,6 @@ extern void simple_release_fs(struct vfsmount **mount, int *count); | |||
| 2006 | 2020 | ||
| 2007 | extern ssize_t simple_read_from_buffer(void __user *to, size_t count, | 2021 | extern ssize_t simple_read_from_buffer(void __user *to, size_t count, |
| 2008 | loff_t *ppos, const void *from, size_t available); | 2022 | loff_t *ppos, const void *from, size_t available); |
| 2009 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | ||
| 2010 | const void *from, size_t available); | ||
| 2011 | 2023 | ||
| 2012 | #ifdef CONFIG_MIGRATION | 2024 | #ifdef CONFIG_MIGRATION |
| 2013 | extern int buffer_migrate_page(struct address_space *, | 2025 | extern int buffer_migrate_page(struct address_space *, |
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 282f54219129..9e5a06e78d02 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
| @@ -7,7 +7,7 @@ struct fs_struct { | |||
| 7 | atomic_t count; | 7 | atomic_t count; |
| 8 | rwlock_t lock; | 8 | rwlock_t lock; |
| 9 | int umask; | 9 | int umask; |
| 10 | struct path root, pwd, altroot; | 10 | struct path root, pwd; |
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | #define INIT_FS { \ | 13 | #define INIT_FS { \ |
| @@ -19,7 +19,6 @@ struct fs_struct { | |||
| 19 | extern struct kmem_cache *fs_cachep; | 19 | extern struct kmem_cache *fs_cachep; |
| 20 | 20 | ||
| 21 | extern void exit_fs(struct task_struct *); | 21 | extern void exit_fs(struct task_struct *); |
| 22 | extern void set_fs_altroot(void); | ||
| 23 | extern void set_fs_root(struct fs_struct *, struct path *); | 22 | extern void set_fs_root(struct fs_struct *, struct path *); |
| 24 | extern void set_fs_pwd(struct fs_struct *, struct path *); | 23 | extern void set_fs_pwd(struct fs_struct *, struct path *); |
| 25 | extern struct fs_struct *copy_fs_struct(struct fs_struct *); | 24 | extern struct fs_struct *copy_fs_struct(struct fs_struct *); |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index d48282197696..265635dc9908 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -104,11 +104,14 @@ struct fuse_file_lock { | |||
| 104 | 104 | ||
| 105 | /** | 105 | /** |
| 106 | * INIT request/reply flags | 106 | * INIT request/reply flags |
| 107 | * | ||
| 108 | * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." | ||
| 107 | */ | 109 | */ |
| 108 | #define FUSE_ASYNC_READ (1 << 0) | 110 | #define FUSE_ASYNC_READ (1 << 0) |
| 109 | #define FUSE_POSIX_LOCKS (1 << 1) | 111 | #define FUSE_POSIX_LOCKS (1 << 1) |
| 110 | #define FUSE_FILE_OPS (1 << 2) | 112 | #define FUSE_FILE_OPS (1 << 2) |
| 111 | #define FUSE_ATOMIC_O_TRUNC (1 << 3) | 113 | #define FUSE_ATOMIC_O_TRUNC (1 << 3) |
| 114 | #define FUSE_EXPORT_SUPPORT (1 << 4) | ||
| 112 | #define FUSE_BIG_WRITES (1 << 5) | 115 | #define FUSE_BIG_WRITES (1 << 5) |
| 113 | 116 | ||
| 114 | /** | 117 | /** |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index e8787417f65a..118216f1bd3c 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -541,7 +541,7 @@ extern dev_t blk_lookup_devt(const char *name, int part); | |||
| 541 | extern char *disk_name (struct gendisk *hd, int part, char *buf); | 541 | extern char *disk_name (struct gendisk *hd, int part, char *buf); |
| 542 | 542 | ||
| 543 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); | 543 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); |
| 544 | extern void add_partition(struct gendisk *, int, sector_t, sector_t, int); | 544 | extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int); |
| 545 | extern void delete_partition(struct gendisk *, int); | 545 | extern void delete_partition(struct gendisk *, int); |
| 546 | extern void printk_all_partitions(void); | 546 | extern void printk_all_partitions(void); |
| 547 | 547 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index b414be387180..e8003afeffba 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -173,11 +173,24 @@ static inline void arch_free_page(struct page *page, int order) { } | |||
| 173 | static inline void arch_alloc_page(struct page *page, int order) { } | 173 | static inline void arch_alloc_page(struct page *page, int order) { } |
| 174 | #endif | 174 | #endif |
| 175 | 175 | ||
| 176 | extern struct page *__alloc_pages(gfp_t, unsigned int, struct zonelist *); | 176 | struct page * |
| 177 | __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | ||
| 178 | struct zonelist *zonelist, nodemask_t *nodemask); | ||
| 179 | |||
| 180 | static inline struct page * | ||
| 181 | __alloc_pages(gfp_t gfp_mask, unsigned int order, | ||
| 182 | struct zonelist *zonelist) | ||
| 183 | { | ||
| 184 | return __alloc_pages_internal(gfp_mask, order, zonelist, NULL); | ||
| 185 | } | ||
| 186 | |||
| 187 | static inline struct page * | ||
| 188 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
| 189 | struct zonelist *zonelist, nodemask_t *nodemask) | ||
| 190 | { | ||
| 191 | return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask); | ||
| 192 | } | ||
| 177 | 193 | ||
| 178 | extern struct page * | ||
| 179 | __alloc_pages_nodemask(gfp_t, unsigned int, | ||
| 180 | struct zonelist *, nodemask_t *nodemask); | ||
| 181 | 194 | ||
| 182 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | 195 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
| 183 | unsigned int order) | 196 | unsigned int order) |
| @@ -215,6 +228,9 @@ extern struct page *alloc_page_vma(gfp_t gfp_mask, | |||
| 215 | extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); | 228 | extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); |
| 216 | extern unsigned long get_zeroed_page(gfp_t gfp_mask); | 229 | extern unsigned long get_zeroed_page(gfp_t gfp_mask); |
| 217 | 230 | ||
| 231 | void *alloc_pages_exact(size_t size, gfp_t gfp_mask); | ||
| 232 | void free_pages_exact(void *virt, size_t size); | ||
| 233 | |||
| 218 | #define __get_free_page(gfp_mask) \ | 234 | #define __get_free_page(gfp_mask) \ |
| 219 | __get_free_pages((gfp_mask),0) | 235 | __get_free_pages((gfp_mask),0) |
| 220 | 236 | ||
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 98be6c5762b9..730a20b83576 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -79,6 +79,19 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value) | |||
| 79 | WARN_ON(1); | 79 | WARN_ON(1); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static inline int gpio_export(unsigned gpio, bool direction_may_change) | ||
| 83 | { | ||
| 84 | /* GPIO can never have been requested or set as {in,out}put */ | ||
| 85 | WARN_ON(1); | ||
| 86 | return -EINVAL; | ||
| 87 | } | ||
| 88 | |||
| 89 | static inline void gpio_unexport(unsigned gpio) | ||
| 90 | { | ||
| 91 | /* GPIO can never have been exported */ | ||
| 92 | WARN_ON(1); | ||
| 93 | } | ||
| 94 | |||
| 82 | static inline int gpio_to_irq(unsigned gpio) | 95 | static inline int gpio_to_irq(unsigned gpio) |
| 83 | { | 96 | { |
| 84 | /* GPIO can never have been requested or set as input */ | 97 | /* GPIO can never have been requested or set as input */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index a79e80b689d8..32e0ef0f6e1f 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include <linux/mempolicy.h> | 8 | #include <linux/mempolicy.h> |
| 9 | #include <linux/shm.h> | 9 | #include <linux/shm.h> |
| 10 | #include <asm/tlbflush.h> | 10 | #include <asm/tlbflush.h> |
| 11 | #include <asm/hugetlb.h> | ||
| 12 | 11 | ||
| 13 | struct ctl_table; | 12 | struct ctl_table; |
| 14 | 13 | ||
| @@ -17,38 +16,45 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
| 17 | return vma->vm_flags & VM_HUGETLB; | 16 | return vma->vm_flags & VM_HUGETLB; |
| 18 | } | 17 | } |
| 19 | 18 | ||
| 19 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | ||
| 20 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 20 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
| 21 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 21 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
| 22 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 22 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
| 23 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 23 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
| 24 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); | 24 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); |
| 25 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | 25 | void unmap_hugepage_range(struct vm_area_struct *, |
| 26 | void __unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | 26 | unsigned long, unsigned long, struct page *); |
| 27 | void __unmap_hugepage_range(struct vm_area_struct *, | ||
| 28 | unsigned long, unsigned long, struct page *); | ||
| 27 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 29 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
| 28 | int hugetlb_report_meminfo(char *); | 30 | int hugetlb_report_meminfo(char *); |
| 29 | int hugetlb_report_node_meminfo(int, char *); | 31 | int hugetlb_report_node_meminfo(int, char *); |
| 30 | unsigned long hugetlb_total_pages(void); | 32 | unsigned long hugetlb_total_pages(void); |
| 31 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 33 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
| 32 | unsigned long address, int write_access); | 34 | unsigned long address, int write_access); |
| 33 | int hugetlb_reserve_pages(struct inode *inode, long from, long to); | 35 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, |
| 36 | struct vm_area_struct *vma); | ||
| 34 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 37 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
| 35 | 38 | ||
| 36 | extern unsigned long max_huge_pages; | ||
| 37 | extern unsigned long sysctl_overcommit_huge_pages; | ||
| 38 | extern unsigned long hugepages_treat_as_movable; | 39 | extern unsigned long hugepages_treat_as_movable; |
| 39 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 40 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
| 40 | extern int sysctl_hugetlb_shm_group; | 41 | extern int sysctl_hugetlb_shm_group; |
| 42 | extern struct list_head huge_boot_pages; | ||
| 41 | 43 | ||
| 42 | /* arch callbacks */ | 44 | /* arch callbacks */ |
| 43 | 45 | ||
| 44 | pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr); | 46 | pte_t *huge_pte_alloc(struct mm_struct *mm, |
| 47 | unsigned long addr, unsigned long sz); | ||
| 45 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); | 48 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); |
| 46 | int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep); | 49 | int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep); |
| 47 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | 50 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, |
| 48 | int write); | 51 | int write); |
| 49 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 52 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
| 50 | pmd_t *pmd, int write); | 53 | pmd_t *pmd, int write); |
| 54 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, | ||
| 55 | pud_t *pud, int write); | ||
| 51 | int pmd_huge(pmd_t pmd); | 56 | int pmd_huge(pmd_t pmd); |
| 57 | int pud_huge(pud_t pmd); | ||
| 52 | void hugetlb_change_protection(struct vm_area_struct *vma, | 58 | void hugetlb_change_protection(struct vm_area_struct *vma, |
| 53 | unsigned long address, unsigned long end, pgprot_t newprot); | 59 | unsigned long address, unsigned long end, pgprot_t newprot); |
| 54 | 60 | ||
| @@ -58,6 +64,11 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
| 58 | { | 64 | { |
| 59 | return 0; | 65 | return 0; |
| 60 | } | 66 | } |
| 67 | |||
| 68 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) | ||
| 69 | { | ||
| 70 | } | ||
| 71 | |||
| 61 | static inline unsigned long hugetlb_total_pages(void) | 72 | static inline unsigned long hugetlb_total_pages(void) |
| 62 | { | 73 | { |
| 63 | return 0; | 74 | return 0; |
| @@ -67,12 +78,14 @@ static inline unsigned long hugetlb_total_pages(void) | |||
| 67 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) | 78 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) |
| 68 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 79 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
| 69 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | 80 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) |
| 70 | #define unmap_hugepage_range(vma, start, end) BUG() | 81 | #define unmap_hugepage_range(vma, start, end, page) BUG() |
| 71 | #define hugetlb_report_meminfo(buf) 0 | 82 | #define hugetlb_report_meminfo(buf) 0 |
| 72 | #define hugetlb_report_node_meminfo(n, buf) 0 | 83 | #define hugetlb_report_node_meminfo(n, buf) 0 |
| 73 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 84 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
| 74 | #define prepare_hugepage_range(addr,len) (-EINVAL) | 85 | #define follow_huge_pud(mm, addr, pud, write) NULL |
| 86 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) | ||
| 75 | #define pmd_huge(x) 0 | 87 | #define pmd_huge(x) 0 |
| 88 | #define pud_huge(x) 0 | ||
| 76 | #define is_hugepage_only_range(mm, addr, len) 0 | 89 | #define is_hugepage_only_range(mm, addr, len) 0 |
| 77 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) | 90 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
| 78 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 91 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) |
| @@ -93,6 +106,7 @@ struct hugetlbfs_config { | |||
| 93 | umode_t mode; | 106 | umode_t mode; |
| 94 | long nr_blocks; | 107 | long nr_blocks; |
| 95 | long nr_inodes; | 108 | long nr_inodes; |
| 109 | struct hstate *hstate; | ||
| 96 | }; | 110 | }; |
| 97 | 111 | ||
| 98 | struct hugetlbfs_sb_info { | 112 | struct hugetlbfs_sb_info { |
| @@ -101,6 +115,7 @@ struct hugetlbfs_sb_info { | |||
| 101 | long max_inodes; /* inodes allowed */ | 115 | long max_inodes; /* inodes allowed */ |
| 102 | long free_inodes; /* inodes free */ | 116 | long free_inodes; /* inodes free */ |
| 103 | spinlock_t stat_lock; | 117 | spinlock_t stat_lock; |
| 118 | struct hstate *hstate; | ||
| 104 | }; | 119 | }; |
| 105 | 120 | ||
| 106 | 121 | ||
| @@ -125,8 +140,6 @@ struct file *hugetlb_file_setup(const char *name, size_t); | |||
| 125 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 140 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
| 126 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 141 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
| 127 | 142 | ||
| 128 | #define BLOCKS_PER_HUGEPAGE (HPAGE_SIZE / 512) | ||
| 129 | |||
| 130 | static inline int is_file_hugepages(struct file *file) | 143 | static inline int is_file_hugepages(struct file *file) |
| 131 | { | 144 | { |
| 132 | if (file->f_op == &hugetlbfs_file_operations) | 145 | if (file->f_op == &hugetlbfs_file_operations) |
| @@ -155,4 +168,115 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | |||
| 155 | unsigned long flags); | 168 | unsigned long flags); |
| 156 | #endif /* HAVE_ARCH_HUGETLB_UNMAPPED_AREA */ | 169 | #endif /* HAVE_ARCH_HUGETLB_UNMAPPED_AREA */ |
| 157 | 170 | ||
| 171 | #ifdef CONFIG_HUGETLB_PAGE | ||
| 172 | |||
| 173 | #define HSTATE_NAME_LEN 32 | ||
| 174 | /* Defines one hugetlb page size */ | ||
| 175 | struct hstate { | ||
| 176 | int hugetlb_next_nid; | ||
| 177 | unsigned int order; | ||
| 178 | unsigned long mask; | ||
| 179 | unsigned long max_huge_pages; | ||
| 180 | unsigned long nr_huge_pages; | ||
| 181 | unsigned long free_huge_pages; | ||
| 182 | unsigned long resv_huge_pages; | ||
| 183 | unsigned long surplus_huge_pages; | ||
| 184 | unsigned long nr_overcommit_huge_pages; | ||
| 185 | struct list_head hugepage_freelists[MAX_NUMNODES]; | ||
| 186 | unsigned int nr_huge_pages_node[MAX_NUMNODES]; | ||
| 187 | unsigned int free_huge_pages_node[MAX_NUMNODES]; | ||
| 188 | unsigned int surplus_huge_pages_node[MAX_NUMNODES]; | ||
| 189 | char name[HSTATE_NAME_LEN]; | ||
| 190 | }; | ||
| 191 | |||
| 192 | struct huge_bootmem_page { | ||
| 193 | struct list_head list; | ||
| 194 | struct hstate *hstate; | ||
| 195 | }; | ||
| 196 | |||
| 197 | /* arch callback */ | ||
| 198 | int __init alloc_bootmem_huge_page(struct hstate *h); | ||
| 199 | |||
| 200 | void __init hugetlb_add_hstate(unsigned order); | ||
| 201 | struct hstate *size_to_hstate(unsigned long size); | ||
| 202 | |||
| 203 | #ifndef HUGE_MAX_HSTATE | ||
| 204 | #define HUGE_MAX_HSTATE 1 | ||
| 205 | #endif | ||
| 206 | |||
| 207 | extern struct hstate hstates[HUGE_MAX_HSTATE]; | ||
| 208 | extern unsigned int default_hstate_idx; | ||
| 209 | |||
| 210 | #define default_hstate (hstates[default_hstate_idx]) | ||
| 211 | |||
| 212 | static inline struct hstate *hstate_inode(struct inode *i) | ||
| 213 | { | ||
| 214 | struct hugetlbfs_sb_info *hsb; | ||
| 215 | hsb = HUGETLBFS_SB(i->i_sb); | ||
| 216 | return hsb->hstate; | ||
| 217 | } | ||
| 218 | |||
| 219 | static inline struct hstate *hstate_file(struct file *f) | ||
| 220 | { | ||
| 221 | return hstate_inode(f->f_dentry->d_inode); | ||
| 222 | } | ||
| 223 | |||
| 224 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) | ||
| 225 | { | ||
| 226 | return hstate_file(vma->vm_file); | ||
| 227 | } | ||
| 228 | |||
| 229 | static inline unsigned long huge_page_size(struct hstate *h) | ||
| 230 | { | ||
| 231 | return (unsigned long)PAGE_SIZE << h->order; | ||
| 232 | } | ||
| 233 | |||
| 234 | static inline unsigned long huge_page_mask(struct hstate *h) | ||
| 235 | { | ||
| 236 | return h->mask; | ||
| 237 | } | ||
| 238 | |||
| 239 | static inline unsigned int huge_page_order(struct hstate *h) | ||
| 240 | { | ||
| 241 | return h->order; | ||
| 242 | } | ||
| 243 | |||
| 244 | static inline unsigned huge_page_shift(struct hstate *h) | ||
| 245 | { | ||
| 246 | return h->order + PAGE_SHIFT; | ||
| 247 | } | ||
| 248 | |||
| 249 | static inline unsigned int pages_per_huge_page(struct hstate *h) | ||
| 250 | { | ||
| 251 | return 1 << h->order; | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline unsigned int blocks_per_huge_page(struct hstate *h) | ||
| 255 | { | ||
| 256 | return huge_page_size(h) / 512; | ||
| 257 | } | ||
| 258 | |||
| 259 | #include <asm/hugetlb.h> | ||
| 260 | |||
| 261 | static inline struct hstate *page_hstate(struct page *page) | ||
| 262 | { | ||
| 263 | return size_to_hstate(PAGE_SIZE << compound_order(page)); | ||
| 264 | } | ||
| 265 | |||
| 266 | #else | ||
| 267 | struct hstate {}; | ||
| 268 | #define alloc_bootmem_huge_page(h) NULL | ||
| 269 | #define hstate_file(f) NULL | ||
| 270 | #define hstate_vma(v) NULL | ||
| 271 | #define hstate_inode(i) NULL | ||
| 272 | #define huge_page_size(h) PAGE_SIZE | ||
| 273 | #define huge_page_mask(h) PAGE_MASK | ||
| 274 | #define huge_page_order(h) 0 | ||
| 275 | #define huge_page_shift(h) PAGE_SHIFT | ||
| 276 | static inline unsigned int pages_per_huge_page(struct hstate *h) | ||
| 277 | { | ||
| 278 | return 1; | ||
| 279 | } | ||
| 280 | #endif | ||
| 281 | |||
| 158 | #endif /* _LINUX_HUGETLB_H */ | 282 | #endif /* _LINUX_HUGETLB_H */ |
diff --git a/include/linux/i2c/max732x.h b/include/linux/i2c/max732x.h new file mode 100644 index 000000000000..e10336631c62 --- /dev/null +++ b/include/linux/i2c/max732x.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef __LINUX_I2C_MAX732X_H | ||
| 2 | #define __LINUX_I2C_MAX732X_H | ||
| 3 | |||
| 4 | /* platform data for the MAX732x 8/16-bit I/O expander driver */ | ||
| 5 | |||
| 6 | struct max732x_platform_data { | ||
| 7 | /* number of the first GPIO */ | ||
| 8 | unsigned gpio_base; | ||
| 9 | |||
| 10 | void *context; /* param to setup/teardown */ | ||
| 11 | |||
| 12 | int (*setup)(struct i2c_client *client, | ||
| 13 | unsigned gpio, unsigned ngpio, | ||
| 14 | void *context); | ||
| 15 | int (*teardown)(struct i2c_client *client, | ||
| 16 | unsigned gpio, unsigned ngpio, | ||
| 17 | void *context); | ||
| 18 | }; | ||
| 19 | #endif /* __LINUX_I2C_MAX732X_H */ | ||
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 7d51cbca49ab..75ae6d8aba4f 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
| @@ -758,7 +758,7 @@ static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr, | |||
| 758 | } | 758 | } |
| 759 | 759 | ||
| 760 | dma_addr = dma_map_single(&c->pdev->dev, ptr, size, direction); | 760 | dma_addr = dma_map_single(&c->pdev->dev, ptr, size, direction); |
| 761 | if (!dma_mapping_error(dma_addr)) { | 761 | if (!dma_mapping_error(&c->pdev->dev, dma_addr)) { |
| 762 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 | 762 | #ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 |
| 763 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) { | 763 | if ((sizeof(dma_addr_t) > 4) && c->pae_support) { |
| 764 | *mptr++ = cpu_to_le32(0x7C020002); | 764 | *mptr++ = cpu_to_le32(0x7C020002); |
diff --git a/include/linux/ide.h b/include/linux/ide.h index d67ccca2b964..b846bc44a27e 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -211,7 +211,21 @@ static inline int __ide_default_irq(unsigned long base) | |||
| 211 | return 0; | 211 | return 0; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | #if defined(CONFIG_ARM) || defined(CONFIG_FRV) || defined(CONFIG_M68K) || \ | ||
| 215 | defined(CONFIG_MIPS) || defined(CONFIG_MN10300) || defined(CONFIG_PARISC) \ | ||
| 216 | || defined(CONFIG_PPC) || defined(CONFIG_SPARC) || defined(CONFIG_SPARC64) | ||
| 214 | #include <asm/ide.h> | 217 | #include <asm/ide.h> |
| 218 | #else | ||
| 219 | #include <asm-generic/ide_iops.h> | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #ifndef MAX_HWIFS | ||
| 223 | #if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA) | ||
| 224 | # define MAX_HWIFS 1 | ||
| 225 | #else | ||
| 226 | # define MAX_HWIFS 10 | ||
| 227 | #endif | ||
| 228 | #endif | ||
| 215 | 229 | ||
| 216 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) | 230 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) |
| 217 | #undef MAX_HWIFS | 231 | #undef MAX_HWIFS |
| @@ -532,12 +546,16 @@ struct ide_dma_ops { | |||
| 532 | void (*dma_timeout)(struct ide_drive_s *); | 546 | void (*dma_timeout)(struct ide_drive_s *); |
| 533 | }; | 547 | }; |
| 534 | 548 | ||
| 549 | struct ide_host; | ||
| 550 | |||
| 535 | typedef struct hwif_s { | 551 | typedef struct hwif_s { |
| 536 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ | 552 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ |
| 537 | struct hwif_s *mate; /* other hwif from same PCI chip */ | 553 | struct hwif_s *mate; /* other hwif from same PCI chip */ |
| 538 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ | 554 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ |
| 539 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 555 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
| 540 | 556 | ||
| 557 | struct ide_host *host; | ||
| 558 | |||
| 541 | char name[6]; /* name of interface, eg. "ide0" */ | 559 | char name[6]; /* name of interface, eg. "ide0" */ |
| 542 | 560 | ||
| 543 | struct ide_io_ports io_ports; | 561 | struct ide_io_ports io_ports; |
| @@ -626,6 +644,9 @@ typedef struct hwif_s { | |||
| 626 | struct ide_host { | 644 | struct ide_host { |
| 627 | ide_hwif_t *ports[MAX_HWIFS]; | 645 | ide_hwif_t *ports[MAX_HWIFS]; |
| 628 | unsigned int n_ports; | 646 | unsigned int n_ports; |
| 647 | struct device *dev[2]; | ||
| 648 | unsigned long host_flags; | ||
| 649 | void *host_priv; | ||
| 629 | }; | 650 | }; |
| 630 | 651 | ||
| 631 | /* | 652 | /* |
| @@ -874,6 +895,9 @@ struct ide_driver_s { | |||
| 874 | 895 | ||
| 875 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) | 896 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) |
| 876 | 897 | ||
| 898 | int ide_device_get(ide_drive_t *); | ||
| 899 | void ide_device_put(ide_drive_t *); | ||
| 900 | |||
| 877 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 901 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); |
| 878 | 902 | ||
| 879 | extern int ide_vlb_clk; | 903 | extern int ide_vlb_clk; |
| @@ -1182,7 +1206,7 @@ enum { | |||
| 1182 | 1206 | ||
| 1183 | struct ide_port_info { | 1207 | struct ide_port_info { |
| 1184 | char *name; | 1208 | char *name; |
| 1185 | unsigned int (*init_chipset)(struct pci_dev *, const char *); | 1209 | unsigned int (*init_chipset)(struct pci_dev *); |
| 1186 | void (*init_iops)(ide_hwif_t *); | 1210 | void (*init_iops)(ide_hwif_t *); |
| 1187 | void (*init_hwif)(ide_hwif_t *); | 1211 | void (*init_hwif)(ide_hwif_t *); |
| 1188 | int (*init_dma)(ide_hwif_t *, | 1212 | int (*init_dma)(ide_hwif_t *, |
| @@ -1201,8 +1225,10 @@ struct ide_port_info { | |||
| 1201 | u8 udma_mask; | 1225 | u8 udma_mask; |
| 1202 | }; | 1226 | }; |
| 1203 | 1227 | ||
| 1204 | int ide_setup_pci_device(struct pci_dev *, const struct ide_port_info *); | 1228 | int ide_pci_init_one(struct pci_dev *, const struct ide_port_info *, void *); |
| 1205 | int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, const struct ide_port_info *); | 1229 | int ide_pci_init_two(struct pci_dev *, struct pci_dev *, |
| 1230 | const struct ide_port_info *, void *); | ||
| 1231 | void ide_pci_remove(struct pci_dev *); | ||
| 1206 | 1232 | ||
| 1207 | void ide_map_sg(ide_drive_t *, struct request *); | 1233 | void ide_map_sg(ide_drive_t *, struct request *); |
| 1208 | void ide_init_sg_cmd(ide_drive_t *, struct request *); | 1234 | void ide_init_sg_cmd(ide_drive_t *, struct request *); |
diff --git a/include/linux/idr.h b/include/linux/idr.h index 9a2d762124de..fa035f96f2a3 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 16 | #include <linux/bitops.h> | 16 | #include <linux/bitops.h> |
| 17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/rcupdate.h> | ||
| 18 | 19 | ||
| 19 | #if BITS_PER_LONG == 32 | 20 | #if BITS_PER_LONG == 32 |
| 20 | # define IDR_BITS 5 | 21 | # define IDR_BITS 5 |
| @@ -51,6 +52,7 @@ struct idr_layer { | |||
| 51 | unsigned long bitmap; /* A zero bit means "space here" */ | 52 | unsigned long bitmap; /* A zero bit means "space here" */ |
| 52 | struct idr_layer *ary[1<<IDR_BITS]; | 53 | struct idr_layer *ary[1<<IDR_BITS]; |
| 53 | int count; /* When zero, we can release it */ | 54 | int count; /* When zero, we can release it */ |
| 55 | struct rcu_head rcu_head; | ||
| 54 | }; | 56 | }; |
| 55 | 57 | ||
| 56 | struct idr { | 58 | struct idr { |
| @@ -71,6 +73,28 @@ struct idr { | |||
| 71 | } | 73 | } |
| 72 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) | 74 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) |
| 73 | 75 | ||
| 76 | /* Actions to be taken after a call to _idr_sub_alloc */ | ||
| 77 | #define IDR_NEED_TO_GROW -2 | ||
| 78 | #define IDR_NOMORE_SPACE -3 | ||
| 79 | |||
| 80 | #define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) | ||
| 81 | |||
| 82 | /** | ||
| 83 | * idr synchronization (stolen from radix-tree.h) | ||
| 84 | * | ||
| 85 | * idr_find() is able to be called locklessly, using RCU. The caller must | ||
| 86 | * ensure calls to this function are made within rcu_read_lock() regions. | ||
| 87 | * Other readers (lock-free or otherwise) and modifications may be running | ||
| 88 | * concurrently. | ||
| 89 | * | ||
| 90 | * It is still required that the caller manage the synchronization and | ||
| 91 | * lifetimes of the items. So if RCU lock-free lookups are used, typically | ||
| 92 | * this would mean that the items have their own locks, or are amenable to | ||
| 93 | * lock-free access; and that the items are freed by RCU (or only freed after | ||
| 94 | * having been deleted from the idr tree *and* a synchronize_rcu() grace | ||
| 95 | * period). | ||
| 96 | */ | ||
| 97 | |||
| 74 | /* | 98 | /* |
| 75 | * This is what we export. | 99 | * This is what we export. |
| 76 | */ | 100 | */ |
diff --git a/include/linux/init.h b/include/linux/init.h index 21d658cdfa27..11b84e106053 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -170,6 +170,13 @@ extern void (*late_time_init)(void); | |||
| 170 | __attribute__((__section__(".initcall" level ".init"))) = fn | 170 | __attribute__((__section__(".initcall" level ".init"))) = fn |
| 171 | 171 | ||
| 172 | /* | 172 | /* |
| 173 | * Early initcalls run before initializing SMP. | ||
| 174 | * | ||
| 175 | * Only for built-in code, not modules. | ||
| 176 | */ | ||
| 177 | #define early_initcall(fn) __define_initcall("early",fn,early) | ||
| 178 | |||
| 179 | /* | ||
| 173 | * A "pure" initcall has no dependencies on anything else, and purely | 180 | * A "pure" initcall has no dependencies on anything else, and purely |
| 174 | * initializes variables that couldn't be statically initialized. | 181 | * initializes variables that couldn't be statically initialized. |
| 175 | * | 182 | * |
| @@ -275,13 +282,7 @@ void __init parse_early_param(void); | |||
| 275 | 282 | ||
| 276 | #define security_initcall(fn) module_init(fn) | 283 | #define security_initcall(fn) module_init(fn) |
| 277 | 284 | ||
| 278 | /* These macros create a dummy inline: gcc 2.9x does not count alias | 285 | /* Each module must use one module_init(). */ |
| 279 | as usage, hence the `unused function' warning when __init functions | ||
| 280 | are declared static. We use the dummy __*_module_inline functions | ||
| 281 | both to kill the warning and check the type of the init/cleanup | ||
| 282 | function. */ | ||
| 283 | |||
| 284 | /* Each module must use one module_init(), or one no_module_init */ | ||
| 285 | #define module_init(initfn) \ | 286 | #define module_init(initfn) \ |
| 286 | static inline initcall_t __inittest(void) \ | 287 | static inline initcall_t __inittest(void) \ |
| 287 | { return initfn; } \ | 288 | { return initfn; } \ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 93c45acf249a..021d8e720c79 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -122,7 +122,7 @@ extern struct group_info init_groups; | |||
| 122 | .state = 0, \ | 122 | .state = 0, \ |
| 123 | .stack = &init_thread_info, \ | 123 | .stack = &init_thread_info, \ |
| 124 | .usage = ATOMIC_INIT(2), \ | 124 | .usage = ATOMIC_INIT(2), \ |
| 125 | .flags = 0, \ | 125 | .flags = PF_KTHREAD, \ |
| 126 | .lock_depth = -1, \ | 126 | .lock_depth = -1, \ |
| 127 | .prio = MAX_PRIO-20, \ | 127 | .prio = MAX_PRIO-20, \ |
| 128 | .static_prio = MAX_PRIO-20, \ | 128 | .static_prio = MAX_PRIO-20, \ |
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 742b917e7d1b..bd578578a8b9 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #ifndef _LINUX_INOTIFY_H | 7 | #ifndef _LINUX_INOTIFY_H |
| 8 | #define _LINUX_INOTIFY_H | 8 | #define _LINUX_INOTIFY_H |
| 9 | 9 | ||
| 10 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
| 11 | #include <linux/fcntl.h> | ||
| 10 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 11 | 13 | ||
| 12 | /* | 14 | /* |
| @@ -63,6 +65,10 @@ struct inotify_event { | |||
| 63 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \ | 65 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \ |
| 64 | IN_MOVE_SELF) | 66 | IN_MOVE_SELF) |
| 65 | 67 | ||
| 68 | /* Flags for sys_inotify_init1. */ | ||
| 69 | #define IN_CLOEXEC O_CLOEXEC | ||
| 70 | #define IN_NONBLOCK O_NONBLOCK | ||
| 71 | |||
| 66 | #ifdef __KERNEL__ | 72 | #ifdef __KERNEL__ |
| 67 | 73 | ||
| 68 | #include <linux/dcache.h> | 74 | #include <linux/dcache.h> |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index ea6c18a8b0d4..ea330f9e7100 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
| @@ -36,6 +36,7 @@ struct ipc_namespace { | |||
| 36 | int msg_ctlmni; | 36 | int msg_ctlmni; |
| 37 | atomic_t msg_bytes; | 37 | atomic_t msg_bytes; |
| 38 | atomic_t msg_hdrs; | 38 | atomic_t msg_hdrs; |
| 39 | int auto_msgmni; | ||
| 39 | 40 | ||
| 40 | size_t shm_ctlmax; | 41 | size_t shm_ctlmax; |
| 41 | size_t shm_ctlall; | 42 | size_t shm_ctlall; |
| @@ -53,7 +54,7 @@ extern atomic_t nr_ipc_ns; | |||
| 53 | 54 | ||
| 54 | extern int register_ipcns_notifier(struct ipc_namespace *); | 55 | extern int register_ipcns_notifier(struct ipc_namespace *); |
| 55 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); | 56 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); |
| 56 | extern int unregister_ipcns_notifier(struct ipc_namespace *); | 57 | extern void unregister_ipcns_notifier(struct ipc_namespace *); |
| 57 | extern int ipcns_notify(unsigned long); | 58 | extern int ipcns_notify(unsigned long); |
| 58 | 59 | ||
| 59 | #else /* CONFIG_SYSVIPC */ | 60 | #else /* CONFIG_SYSVIPC */ |
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h index 2b1c2e58566e..74bde13224c9 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | #ifndef _LINUX_TRACE_IRQFLAGS_H | 11 | #ifndef _LINUX_TRACE_IRQFLAGS_H |
| 12 | #define _LINUX_TRACE_IRQFLAGS_H | 12 | #define _LINUX_TRACE_IRQFLAGS_H |
| 13 | 13 | ||
| 14 | #include <linux/typecheck.h> | ||
| 15 | |||
| 14 | #ifdef CONFIG_TRACE_IRQFLAGS | 16 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 15 | extern void trace_softirqs_on(unsigned long ip); | 17 | extern void trace_softirqs_on(unsigned long ip); |
| 16 | extern void trace_softirqs_off(unsigned long ip); | 18 | extern void trace_softirqs_off(unsigned long ip); |
| @@ -58,18 +60,24 @@ | |||
| 58 | do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0) | 60 | do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0) |
| 59 | #define local_irq_disable() \ | 61 | #define local_irq_disable() \ |
| 60 | do { raw_local_irq_disable(); trace_hardirqs_off(); } while (0) | 62 | do { raw_local_irq_disable(); trace_hardirqs_off(); } while (0) |
| 61 | #define local_irq_save(flags) \ | 63 | #define local_irq_save(flags) \ |
| 62 | do { raw_local_irq_save(flags); trace_hardirqs_off(); } while (0) | 64 | do { \ |
| 65 | typecheck(unsigned long, flags); \ | ||
| 66 | raw_local_irq_save(flags); \ | ||
| 67 | trace_hardirqs_off(); \ | ||
| 68 | } while (0) | ||
| 63 | 69 | ||
| 64 | #define local_irq_restore(flags) \ | 70 | |
| 65 | do { \ | 71 | #define local_irq_restore(flags) \ |
| 66 | if (raw_irqs_disabled_flags(flags)) { \ | 72 | do { \ |
| 67 | raw_local_irq_restore(flags); \ | 73 | typecheck(unsigned long, flags); \ |
| 68 | trace_hardirqs_off(); \ | 74 | if (raw_irqs_disabled_flags(flags)) { \ |
| 69 | } else { \ | 75 | raw_local_irq_restore(flags); \ |
| 70 | trace_hardirqs_on(); \ | 76 | trace_hardirqs_off(); \ |
| 71 | raw_local_irq_restore(flags); \ | 77 | } else { \ |
| 72 | } \ | 78 | trace_hardirqs_on(); \ |
| 79 | raw_local_irq_restore(flags); \ | ||
| 80 | } \ | ||
| 73 | } while (0) | 81 | } while (0) |
| 74 | #else /* !CONFIG_TRACE_IRQFLAGS_SUPPORT */ | 82 | #else /* !CONFIG_TRACE_IRQFLAGS_SUPPORT */ |
| 75 | /* | 83 | /* |
| @@ -78,8 +86,16 @@ | |||
| 78 | */ | 86 | */ |
| 79 | # define raw_local_irq_disable() local_irq_disable() | 87 | # define raw_local_irq_disable() local_irq_disable() |
| 80 | # define raw_local_irq_enable() local_irq_enable() | 88 | # define raw_local_irq_enable() local_irq_enable() |
| 81 | # define raw_local_irq_save(flags) local_irq_save(flags) | 89 | # define raw_local_irq_save(flags) \ |
| 82 | # define raw_local_irq_restore(flags) local_irq_restore(flags) | 90 | do { \ |
| 91 | typecheck(unsigned long, flags); \ | ||
| 92 | local_irq_save(flags); \ | ||
| 93 | } while (0) | ||
| 94 | # define raw_local_irq_restore(flags) \ | ||
| 95 | do { \ | ||
| 96 | typecheck(unsigned long, flags); \ | ||
| 97 | local_irq_restore(flags); \ | ||
| 98 | } while (0) | ||
| 83 | #endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */ | 99 | #endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */ |
| 84 | 100 | ||
| 85 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT | 101 | #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT |
| @@ -89,7 +105,11 @@ | |||
| 89 | raw_safe_halt(); \ | 105 | raw_safe_halt(); \ |
| 90 | } while (0) | 106 | } while (0) |
| 91 | 107 | ||
| 92 | #define local_save_flags(flags) raw_local_save_flags(flags) | 108 | #define local_save_flags(flags) \ |
| 109 | do { \ | ||
| 110 | typecheck(unsigned long, flags); \ | ||
| 111 | raw_local_save_flags(flags); \ | ||
| 112 | } while (0) | ||
| 93 | 113 | ||
| 94 | #define irqs_disabled() \ | 114 | #define irqs_disabled() \ |
| 95 | ({ \ | 115 | ({ \ |
| @@ -99,7 +119,11 @@ | |||
| 99 | raw_irqs_disabled_flags(_flags); \ | 119 | raw_irqs_disabled_flags(_flags); \ |
| 100 | }) | 120 | }) |
| 101 | 121 | ||
| 102 | #define irqs_disabled_flags(flags) raw_irqs_disabled_flags(flags) | 122 | #define irqs_disabled_flags(flags) \ |
| 123 | ({ \ | ||
| 124 | typecheck(unsigned long, flags); \ | ||
| 125 | raw_irqs_disabled_flags(flags); \ | ||
| 126 | }) | ||
| 103 | #endif /* CONFIG_X86 */ | 127 | #endif /* CONFIG_X86 */ |
| 104 | 128 | ||
| 105 | #endif | 129 | #endif |
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index 6b563cae23df..da720bc3eb15 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
| @@ -7,9 +7,6 @@ | |||
| 7 | * | 7 | * |
| 8 | * For licensing information, see the file 'LICENCE' in the | 8 | * For licensing information, see the file 'LICENCE' in the |
| 9 | * jffs2 directory. | 9 | * jffs2 directory. |
| 10 | * | ||
| 11 | * $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $ | ||
| 12 | * | ||
| 13 | */ | 10 | */ |
| 14 | 11 | ||
| 15 | #ifndef __LINUX_JFFS2_H__ | 12 | #ifndef __LINUX_JFFS2_H__ |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 00c1801099fa..57aefa160a92 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #define _LINUX_KALLSYMS_H | 6 | #define _LINUX_KALLSYMS_H |
| 7 | 7 | ||
| 8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
| 9 | #include <linux/kernel.h> | ||
| 9 | #include <linux/stddef.h> | 10 | #include <linux/stddef.h> |
| 10 | 11 | ||
| 11 | #define KSYM_NAME_LEN 128 | 12 | #define KSYM_NAME_LEN 128 |
| @@ -105,18 +106,10 @@ static inline void print_fn_descriptor_symbol(const char *fmt, void *addr) | |||
| 105 | print_symbol(fmt, (unsigned long)addr); | 106 | print_symbol(fmt, (unsigned long)addr); |
| 106 | } | 107 | } |
| 107 | 108 | ||
| 108 | #ifndef CONFIG_64BIT | 109 | static inline void print_ip_sym(unsigned long ip) |
| 109 | #define print_ip_sym(ip) \ | 110 | { |
| 110 | do { \ | 111 | printk("[<%p>]", (void *) ip); |
| 111 | printk("[<%08lx>]", ip); \ | 112 | print_symbol(" %s\n", ip); |
| 112 | print_symbol(" %s\n", ip); \ | 113 | } |
| 113 | } while(0) | ||
| 114 | #else | ||
| 115 | #define print_ip_sym(ip) \ | ||
| 116 | do { \ | ||
| 117 | printk("[<%016lx>]", ip); \ | ||
| 118 | print_symbol(" %s\n", ip); \ | ||
| 119 | } while(0) | ||
| 120 | #endif | ||
| 121 | 114 | ||
| 122 | #endif /*_LINUX_KALLSYMS_H*/ | 115 | #endif /*_LINUX_KALLSYMS_H*/ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f9cd7a513f9c..fdbbf72ca2eb 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #include <linux/compiler.h> | 14 | #include <linux/compiler.h> |
| 15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
| 16 | #include <linux/log2.h> | 16 | #include <linux/log2.h> |
| 17 | #include <linux/typecheck.h> | ||
| 18 | #include <linux/ratelimit.h> | ||
| 17 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
| 18 | #include <asm/bug.h> | 20 | #include <asm/bug.h> |
| 19 | 21 | ||
| @@ -188,11 +190,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
| 188 | asmlinkage int printk(const char * fmt, ...) | 190 | asmlinkage int printk(const char * fmt, ...) |
| 189 | __attribute__ ((format (printf, 1, 2))) __cold; | 191 | __attribute__ ((format (printf, 1, 2))) __cold; |
| 190 | 192 | ||
| 191 | extern int printk_ratelimit_jiffies; | 193 | extern struct ratelimit_state printk_ratelimit_state; |
| 192 | extern int printk_ratelimit_burst; | ||
| 193 | extern int printk_ratelimit(void); | 194 | extern int printk_ratelimit(void); |
| 194 | extern int __ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
| 195 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
| 196 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 195 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
| 197 | unsigned int interval_msec); | 196 | unsigned int interval_msec); |
| 198 | #else | 197 | #else |
| @@ -203,8 +202,6 @@ static inline int printk(const char *s, ...) | |||
| 203 | __attribute__ ((format (printf, 1, 2))); | 202 | __attribute__ ((format (printf, 1, 2))); |
| 204 | static inline int __cold printk(const char *s, ...) { return 0; } | 203 | static inline int __cold printk(const char *s, ...) { return 0; } |
| 205 | static inline int printk_ratelimit(void) { return 0; } | 204 | static inline int printk_ratelimit(void) { return 0; } |
| 206 | static inline int __printk_ratelimit(int ratelimit_jiffies, \ | ||
| 207 | int ratelimit_burst) { return 0; } | ||
| 208 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | 205 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ |
| 209 | unsigned int interval_msec) \ | 206 | unsigned int interval_msec) \ |
| 210 | { return false; } | 207 | { return false; } |
| @@ -441,26 +438,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 441 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | 438 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ |
| 442 | (type *)( (char *)__mptr - offsetof(type,member) );}) | 439 | (type *)( (char *)__mptr - offsetof(type,member) );}) |
| 443 | 440 | ||
| 444 | /* | ||
| 445 | * Check at compile time that something is of a particular type. | ||
| 446 | * Always evaluates to 1 so you may use it easily in comparisons. | ||
| 447 | */ | ||
| 448 | #define typecheck(type,x) \ | ||
| 449 | ({ type __dummy; \ | ||
| 450 | typeof(x) __dummy2; \ | ||
| 451 | (void)(&__dummy == &__dummy2); \ | ||
| 452 | 1; \ | ||
| 453 | }) | ||
| 454 | |||
| 455 | /* | ||
| 456 | * Check at compile time that 'function' is a certain type, or is a pointer | ||
| 457 | * to that type (needs to use typedef for the function type.) | ||
| 458 | */ | ||
| 459 | #define typecheck_fn(type,function) \ | ||
| 460 | ({ typeof(type) __tmp = function; \ | ||
| 461 | (void)__tmp; \ | ||
| 462 | }) | ||
| 463 | |||
| 464 | struct sysinfo; | 441 | struct sysinfo; |
| 465 | extern int do_sysinfo(struct sysinfo *info); | 442 | extern int do_sysinfo(struct sysinfo *info); |
| 466 | 443 | ||
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 3265968cd2cd..82f88a8a827b 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -83,6 +83,7 @@ struct kimage { | |||
| 83 | 83 | ||
| 84 | unsigned long start; | 84 | unsigned long start; |
| 85 | struct page *control_code_page; | 85 | struct page *control_code_page; |
| 86 | struct page *swap_page; | ||
| 86 | 87 | ||
| 87 | unsigned long nr_segments; | 88 | unsigned long nr_segments; |
| 88 | struct kexec_segment segment[KEXEC_SEGMENT_MAX]; | 89 | struct kexec_segment segment[KEXEC_SEGMENT_MAX]; |
| @@ -98,18 +99,20 @@ struct kimage { | |||
| 98 | unsigned int type : 1; | 99 | unsigned int type : 1; |
| 99 | #define KEXEC_TYPE_DEFAULT 0 | 100 | #define KEXEC_TYPE_DEFAULT 0 |
| 100 | #define KEXEC_TYPE_CRASH 1 | 101 | #define KEXEC_TYPE_CRASH 1 |
| 102 | unsigned int preserve_context : 1; | ||
| 101 | }; | 103 | }; |
| 102 | 104 | ||
| 103 | 105 | ||
| 104 | 106 | ||
| 105 | /* kexec interface functions */ | 107 | /* kexec interface functions */ |
| 106 | extern NORET_TYPE void machine_kexec(struct kimage *image) ATTRIB_NORET; | 108 | extern void machine_kexec(struct kimage *image); |
| 107 | extern int machine_kexec_prepare(struct kimage *image); | 109 | extern int machine_kexec_prepare(struct kimage *image); |
| 108 | extern void machine_kexec_cleanup(struct kimage *image); | 110 | extern void machine_kexec_cleanup(struct kimage *image); |
| 109 | extern asmlinkage long sys_kexec_load(unsigned long entry, | 111 | extern asmlinkage long sys_kexec_load(unsigned long entry, |
| 110 | unsigned long nr_segments, | 112 | unsigned long nr_segments, |
| 111 | struct kexec_segment __user *segments, | 113 | struct kexec_segment __user *segments, |
| 112 | unsigned long flags); | 114 | unsigned long flags); |
| 115 | extern int kernel_kexec(void); | ||
| 113 | #ifdef CONFIG_COMPAT | 116 | #ifdef CONFIG_COMPAT |
| 114 | extern asmlinkage long compat_sys_kexec_load(unsigned long entry, | 117 | extern asmlinkage long compat_sys_kexec_load(unsigned long entry, |
| 115 | unsigned long nr_segments, | 118 | unsigned long nr_segments, |
| @@ -156,8 +159,9 @@ extern struct kimage *kexec_crash_image; | |||
| 156 | #define kexec_flush_icache_page(page) | 159 | #define kexec_flush_icache_page(page) |
| 157 | #endif | 160 | #endif |
| 158 | 161 | ||
| 159 | #define KEXEC_ON_CRASH 0x00000001 | 162 | #define KEXEC_ON_CRASH 0x00000001 |
| 160 | #define KEXEC_ARCH_MASK 0xffff0000 | 163 | #define KEXEC_PRESERVE_CONTEXT 0x00000002 |
| 164 | #define KEXEC_ARCH_MASK 0xffff0000 | ||
| 161 | 165 | ||
| 162 | /* These values match the ELF architecture values. | 166 | /* These values match the ELF architecture values. |
| 163 | * Unless there is a good reason that should continue to be the case. | 167 | * Unless there is a good reason that should continue to be the case. |
| @@ -174,7 +178,12 @@ extern struct kimage *kexec_crash_image; | |||
| 174 | #define KEXEC_ARCH_MIPS_LE (10 << 16) | 178 | #define KEXEC_ARCH_MIPS_LE (10 << 16) |
| 175 | #define KEXEC_ARCH_MIPS ( 8 << 16) | 179 | #define KEXEC_ARCH_MIPS ( 8 << 16) |
| 176 | 180 | ||
| 177 | #define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ | 181 | /* List of defined/legal kexec flags */ |
| 182 | #ifndef CONFIG_KEXEC_JUMP | ||
| 183 | #define KEXEC_FLAGS KEXEC_ON_CRASH | ||
| 184 | #else | ||
| 185 | #define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT) | ||
| 186 | #endif | ||
| 178 | 187 | ||
| 179 | #define VMCOREINFO_BYTES (4096) | 188 | #define VMCOREINFO_BYTES (4096) |
| 180 | #define VMCOREINFO_NOTE_NAME "VMCOREINFO" | 189 | #define VMCOREINFO_NOTE_NAME "VMCOREINFO" |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 0509c4ce4857..a1a91577813c 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include <linux/gfp.h> | ||
| 22 | #include <linux/stddef.h> | 23 | #include <linux/stddef.h> |
| 23 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
| 24 | #include <linux/compiler.h> | 25 | #include <linux/compiler.h> |
| @@ -41,8 +42,8 @@ struct file; | |||
| 41 | struct subprocess_info; | 42 | struct subprocess_info; |
| 42 | 43 | ||
| 43 | /* Allocate a subprocess_info structure */ | 44 | /* Allocate a subprocess_info structure */ |
| 44 | struct subprocess_info *call_usermodehelper_setup(char *path, | 45 | struct subprocess_info *call_usermodehelper_setup(char *path, char **argv, |
| 45 | char **argv, char **envp); | 46 | char **envp, gfp_t gfp_mask); |
| 46 | 47 | ||
| 47 | /* Set various pieces of state into the subprocess_info structure */ | 48 | /* Set various pieces of state into the subprocess_info structure */ |
| 48 | void call_usermodehelper_setkeys(struct subprocess_info *info, | 49 | void call_usermodehelper_setkeys(struct subprocess_info *info, |
| @@ -69,8 +70,9 @@ static inline int | |||
| 69 | call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait) | 70 | call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait) |
| 70 | { | 71 | { |
| 71 | struct subprocess_info *info; | 72 | struct subprocess_info *info; |
| 73 | gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; | ||
| 72 | 74 | ||
| 73 | info = call_usermodehelper_setup(path, argv, envp); | 75 | info = call_usermodehelper_setup(path, argv, envp, gfp_mask); |
| 74 | if (info == NULL) | 76 | if (info == NULL) |
| 75 | return -ENOMEM; | 77 | return -ENOMEM; |
| 76 | return call_usermodehelper_exec(info, wait); | 78 | return call_usermodehelper_exec(info, wait); |
| @@ -81,8 +83,9 @@ call_usermodehelper_keys(char *path, char **argv, char **envp, | |||
| 81 | struct key *session_keyring, enum umh_wait wait) | 83 | struct key *session_keyring, enum umh_wait wait) |
| 82 | { | 84 | { |
| 83 | struct subprocess_info *info; | 85 | struct subprocess_info *info; |
| 86 | gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; | ||
| 84 | 87 | ||
| 85 | info = call_usermodehelper_setup(path, argv, envp); | 88 | info = call_usermodehelper_setup(path, argv, envp, gfp_mask); |
| 86 | if (info == NULL) | 89 | if (info == NULL) |
| 87 | return -ENOMEM; | 90 | return -ENOMEM; |
| 88 | 91 | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 60f0d418ae32..5437ac0276e2 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -186,6 +186,8 @@ extern struct kobject *kset_find_obj(struct kset *, const char *); | |||
| 186 | 186 | ||
| 187 | /* The global /sys/kernel/ kobject for people to chain off of */ | 187 | /* The global /sys/kernel/ kobject for people to chain off of */ |
| 188 | extern struct kobject *kernel_kobj; | 188 | extern struct kobject *kernel_kobj; |
| 189 | /* The global /sys/kernel/mm/ kobject for people to chain off of */ | ||
| 190 | extern struct kobject *mm_kobj; | ||
| 189 | /* The global /sys/hypervisor/ kobject for people to chain off of */ | 191 | /* The global /sys/hypervisor/ kobject for people to chain off of */ |
| 190 | extern struct kobject *hypervisor_kobj; | 192 | extern struct kobject *hypervisor_kobj; |
| 191 | /* The global /sys/power/ kobject for people to chain off of */ | 193 | /* The global /sys/power/ kobject for people to chain off of */ |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 04a3556bdea6..0be7795655fa 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -157,11 +157,10 @@ struct kretprobe { | |||
| 157 | int nmissed; | 157 | int nmissed; |
| 158 | size_t data_size; | 158 | size_t data_size; |
| 159 | struct hlist_head free_instances; | 159 | struct hlist_head free_instances; |
| 160 | struct hlist_head used_instances; | 160 | spinlock_t lock; |
| 161 | }; | 161 | }; |
| 162 | 162 | ||
| 163 | struct kretprobe_instance { | 163 | struct kretprobe_instance { |
| 164 | struct hlist_node uflist; /* either on free list or used list */ | ||
| 165 | struct hlist_node hlist; | 164 | struct hlist_node hlist; |
| 166 | struct kretprobe *rp; | 165 | struct kretprobe *rp; |
| 167 | kprobe_opcode_t *ret_addr; | 166 | kprobe_opcode_t *ret_addr; |
| @@ -201,7 +200,6 @@ static inline int init_test_probes(void) | |||
| 201 | } | 200 | } |
| 202 | #endif /* CONFIG_KPROBES_SANITY_TEST */ | 201 | #endif /* CONFIG_KPROBES_SANITY_TEST */ |
| 203 | 202 | ||
| 204 | extern spinlock_t kretprobe_lock; | ||
| 205 | extern struct mutex kprobe_mutex; | 203 | extern struct mutex kprobe_mutex; |
| 206 | extern int arch_prepare_kprobe(struct kprobe *p); | 204 | extern int arch_prepare_kprobe(struct kprobe *p); |
| 207 | extern void arch_arm_kprobe(struct kprobe *p); | 205 | extern void arch_arm_kprobe(struct kprobe *p); |
| @@ -214,6 +212,9 @@ extern void kprobes_inc_nmissed_count(struct kprobe *p); | |||
| 214 | 212 | ||
| 215 | /* Get the kprobe at this addr (if any) - called with preemption disabled */ | 213 | /* Get the kprobe at this addr (if any) - called with preemption disabled */ |
| 216 | struct kprobe *get_kprobe(void *addr); | 214 | struct kprobe *get_kprobe(void *addr); |
| 215 | void kretprobe_hash_lock(struct task_struct *tsk, | ||
| 216 | struct hlist_head **head, unsigned long *flags); | ||
| 217 | void kretprobe_hash_unlock(struct task_struct *tsk, unsigned long *flags); | ||
| 217 | struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); | 218 | struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); |
| 218 | 219 | ||
| 219 | /* kprobe_running() will just return the current_kprobe on this CPU */ | 220 | /* kprobe_running() will just return the current_kprobe on this CPU */ |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 00dd957e245b..aabc8a13ba71 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | 6 | ||
| 7 | struct task_struct *kthread_create(int (*threadfn)(void *data), | 7 | struct task_struct *kthread_create(int (*threadfn)(void *data), |
| 8 | void *data, | 8 | void *data, |
| 9 | const char namefmt[], ...); | 9 | const char namefmt[], ...) |
| 10 | __attribute__((format(printf, 3, 4))); | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * kthread_run - create and wake a thread. | 13 | * kthread_run - create and wake a thread. |
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 1d379787f2e7..173febac6656 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
| @@ -47,7 +47,7 @@ struct lcd_ops { | |||
| 47 | int (*set_contrast)(struct lcd_device *, int contrast); | 47 | int (*set_contrast)(struct lcd_device *, int contrast); |
| 48 | /* Check if given framebuffer device is the one LCD is bound to; | 48 | /* Check if given framebuffer device is the one LCD is bound to; |
| 49 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ | 49 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ |
| 50 | int (*check_fb)(struct fb_info *); | 50 | int (*check_fb)(struct lcd_device *, struct fb_info *); |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | struct lcd_device { | 53 | struct lcd_device { |
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h new file mode 100644 index 000000000000..81b4207deb95 --- /dev/null +++ b/include/linux/leds-pca9532.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * pca9532.h - platform data structure for pca9532 led controller | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; version 2 of the License. | ||
| 9 | * | ||
| 10 | * Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_PCA9532_H | ||
| 15 | #define __LINUX_PCA9532_H | ||
| 16 | |||
| 17 | #include <linux/leds.h> | ||
| 18 | |||
| 19 | enum pca9532_state { | ||
| 20 | PCA9532_OFF = 0x0, | ||
| 21 | PCA9532_ON = 0x1, | ||
| 22 | PCA9532_PWM0 = 0x2, | ||
| 23 | PCA9532_PWM1 = 0x3 | ||
| 24 | }; | ||
| 25 | |||
| 26 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, | ||
| 27 | PCA9532_TYPE_N2100_BEEP }; | ||
| 28 | |||
| 29 | struct pca9532_led { | ||
| 30 | u8 id; | ||
| 31 | struct i2c_client *client; | ||
| 32 | char *name; | ||
| 33 | struct led_classdev ldev; | ||
| 34 | enum pca9532_type type; | ||
| 35 | enum pca9532_state state; | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct pca9532_platform_data { | ||
| 39 | struct pca9532_led leds[16]; | ||
| 40 | u8 pwm[2]; | ||
| 41 | u8 psc[2]; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #endif /* __LINUX_PCA9532_H */ | ||
| 45 | |||
diff --git a/include/linux/leds.h b/include/linux/leds.h index 519df72e939d..d41ccb56146a 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
| @@ -48,7 +48,7 @@ struct led_classdev { | |||
| 48 | 48 | ||
| 49 | struct device *dev; | 49 | struct device *dev; |
| 50 | struct list_head node; /* LED Device list */ | 50 | struct list_head node; /* LED Device list */ |
| 51 | char *default_trigger; /* Trigger to use */ | 51 | const char *default_trigger; /* Trigger to use */ |
| 52 | 52 | ||
| 53 | #ifdef CONFIG_LEDS_TRIGGERS | 53 | #ifdef CONFIG_LEDS_TRIGGERS |
| 54 | /* Protects the trigger data below */ | 54 | /* Protects the trigger data below */ |
| @@ -118,6 +118,20 @@ extern void ledtrig_ide_activity(void); | |||
| 118 | #define ledtrig_ide_activity() do {} while(0) | 118 | #define ledtrig_ide_activity() do {} while(0) |
| 119 | #endif | 119 | #endif |
| 120 | 120 | ||
| 121 | /* | ||
| 122 | * Generic LED platform data for describing LED names and default triggers. | ||
| 123 | */ | ||
| 124 | struct led_info { | ||
| 125 | const char *name; | ||
| 126 | char *default_trigger; | ||
| 127 | int flags; | ||
| 128 | }; | ||
| 129 | |||
| 130 | struct led_platform_data { | ||
| 131 | int num_leds; | ||
| 132 | struct led_info *leds; | ||
| 133 | }; | ||
| 134 | |||
| 121 | /* For the leds-gpio driver */ | 135 | /* For the leds-gpio driver */ |
| 122 | struct gpio_led { | 136 | struct gpio_led { |
| 123 | const char *name; | 137 | const char *name; |
diff --git a/include/linux/list.h b/include/linux/list.h index 139ec41d9c2e..453916bc0412 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -61,14 +61,10 @@ extern void __list_add(struct list_head *new, | |||
| 61 | * Insert a new entry after the specified head. | 61 | * Insert a new entry after the specified head. |
| 62 | * This is good for implementing stacks. | 62 | * This is good for implementing stacks. |
| 63 | */ | 63 | */ |
| 64 | #ifndef CONFIG_DEBUG_LIST | ||
| 65 | static inline void list_add(struct list_head *new, struct list_head *head) | 64 | static inline void list_add(struct list_head *new, struct list_head *head) |
| 66 | { | 65 | { |
| 67 | __list_add(new, head, head->next); | 66 | __list_add(new, head, head->next); |
| 68 | } | 67 | } |
| 69 | #else | ||
| 70 | extern void list_add(struct list_head *new, struct list_head *head); | ||
| 71 | #endif | ||
| 72 | 68 | ||
| 73 | 69 | ||
| 74 | /** | 70 | /** |
diff --git a/include/linux/mISDNdsp.h b/include/linux/mISDNdsp.h new file mode 100644 index 000000000000..6b71d2dce508 --- /dev/null +++ b/include/linux/mISDNdsp.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #ifndef __mISDNdsp_H__ | ||
| 2 | #define __mISDNdsp_H__ | ||
| 3 | |||
| 4 | struct mISDN_dsp_element_arg { | ||
| 5 | char *name; | ||
| 6 | char *def; | ||
| 7 | char *desc; | ||
| 8 | }; | ||
| 9 | |||
| 10 | struct mISDN_dsp_element { | ||
| 11 | char *name; | ||
| 12 | void *(*new)(const char *arg); | ||
| 13 | void (*free)(void *p); | ||
| 14 | void (*process_tx)(void *p, unsigned char *data, int len); | ||
| 15 | void (*process_rx)(void *p, unsigned char *data, int len); | ||
| 16 | int num_args; | ||
| 17 | struct mISDN_dsp_element_arg | ||
| 18 | *args; | ||
| 19 | }; | ||
| 20 | |||
| 21 | extern int mISDN_dsp_element_register(struct mISDN_dsp_element *elem); | ||
| 22 | extern void mISDN_dsp_element_unregister(struct mISDN_dsp_element *elem); | ||
| 23 | |||
| 24 | struct dsp_features { | ||
| 25 | int hfc_id; /* unique id to identify the chip (or -1) */ | ||
| 26 | int hfc_dtmf; /* set if HFCmulti card supports dtmf */ | ||
| 27 | int hfc_loops; /* set if card supports tone loops */ | ||
| 28 | int hfc_echocanhw; /* set if card supports echocancelation*/ | ||
| 29 | int pcm_id; /* unique id to identify the pcm bus (or -1) */ | ||
| 30 | int pcm_slots; /* number of slots on the pcm bus */ | ||
| 31 | int pcm_banks; /* number of IO banks of pcm bus */ | ||
| 32 | int unclocked; /* data is not clocked (has jitter/loss) */ | ||
| 33 | int unordered; /* data is unordered (packets have index) */ | ||
| 34 | }; | ||
| 35 | |||
| 36 | #endif | ||
| 37 | |||
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h new file mode 100644 index 000000000000..e794dfb87504 --- /dev/null +++ b/include/linux/mISDNhw.h | |||
| @@ -0,0 +1,193 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * Author Karsten Keil <kkeil@novell.com> | ||
| 4 | * | ||
| 5 | * Basic declarations for the mISDN HW channels | ||
| 6 | * | ||
| 7 | * Copyright 2008 by Karsten Keil <kkeil@novell.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License version 2 as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef MISDNHW_H | ||
| 21 | #define MISDNHW_H | ||
| 22 | #include <linux/mISDNif.h> | ||
| 23 | #include <linux/timer.h> | ||
| 24 | |||
| 25 | /* | ||
| 26 | * HW DEBUG 0xHHHHGGGG | ||
| 27 | * H - hardware driver specific bits | ||
| 28 | * G - for all drivers | ||
| 29 | */ | ||
| 30 | |||
| 31 | #define DEBUG_HW 0x00000001 | ||
| 32 | #define DEBUG_HW_OPEN 0x00000002 | ||
| 33 | #define DEBUG_HW_DCHANNEL 0x00000100 | ||
| 34 | #define DEBUG_HW_DFIFO 0x00000200 | ||
| 35 | #define DEBUG_HW_BCHANNEL 0x00001000 | ||
| 36 | #define DEBUG_HW_BFIFO 0x00002000 | ||
| 37 | |||
| 38 | #define MAX_DFRAME_LEN_L1 300 | ||
| 39 | #define MAX_MON_FRAME 32 | ||
| 40 | #define MAX_LOG_SPACE 2048 | ||
| 41 | #define MISDN_COPY_SIZE 32 | ||
| 42 | |||
| 43 | /* channel->Flags bit field */ | ||
| 44 | #define FLG_TX_BUSY 0 /* tx_buf in use */ | ||
| 45 | #define FLG_TX_NEXT 1 /* next_skb in use */ | ||
| 46 | #define FLG_L1_BUSY 2 /* L1 is permanent busy */ | ||
| 47 | #define FLG_L2_ACTIVATED 3 /* activated from L2 */ | ||
| 48 | #define FLG_OPEN 5 /* channel is in use */ | ||
| 49 | #define FLG_ACTIVE 6 /* channel is activated */ | ||
| 50 | #define FLG_BUSY_TIMER 7 | ||
| 51 | /* channel type */ | ||
| 52 | #define FLG_DCHANNEL 8 /* channel is D-channel */ | ||
| 53 | #define FLG_BCHANNEL 9 /* channel is B-channel */ | ||
| 54 | #define FLG_ECHANNEL 10 /* channel is E-channel */ | ||
| 55 | #define FLG_TRANSPARENT 12 /* channel use transparent data */ | ||
| 56 | #define FLG_HDLC 13 /* channel use hdlc data */ | ||
| 57 | #define FLG_L2DATA 14 /* channel use L2 DATA primitivs */ | ||
| 58 | #define FLG_ORIGIN 15 /* channel is on origin site */ | ||
| 59 | /* channel specific stuff */ | ||
| 60 | /* arcofi specific */ | ||
| 61 | #define FLG_ARCOFI_TIMER 16 | ||
| 62 | #define FLG_ARCOFI_ERROR 17 | ||
| 63 | /* isar specific */ | ||
| 64 | #define FLG_INITIALIZED 16 | ||
| 65 | #define FLG_DLEETX 17 | ||
| 66 | #define FLG_LASTDLE 18 | ||
| 67 | #define FLG_FIRST 19 | ||
| 68 | #define FLG_LASTDATA 20 | ||
| 69 | #define FLG_NMD_DATA 21 | ||
| 70 | #define FLG_FTI_RUN 22 | ||
| 71 | #define FLG_LL_OK 23 | ||
| 72 | #define FLG_LL_CONN 24 | ||
| 73 | #define FLG_DTMFSEND 25 | ||
| 74 | |||
| 75 | /* workq events */ | ||
| 76 | #define FLG_RECVQUEUE 30 | ||
| 77 | #define FLG_PHCHANGE 31 | ||
| 78 | |||
| 79 | #define schedule_event(s, ev) do { \ | ||
| 80 | test_and_set_bit(ev, &((s)->Flags)); \ | ||
| 81 | schedule_work(&((s)->workq)); \ | ||
| 82 | } while (0) | ||
| 83 | |||
| 84 | struct dchannel { | ||
| 85 | struct mISDNdevice dev; | ||
| 86 | u_long Flags; | ||
| 87 | struct work_struct workq; | ||
| 88 | void (*phfunc) (struct dchannel *); | ||
| 89 | u_int state; | ||
| 90 | void *l1; | ||
| 91 | /* HW access */ | ||
| 92 | u_char (*read_reg) (void *, u_char); | ||
| 93 | void (*write_reg) (void *, u_char, u_char); | ||
| 94 | void (*read_fifo) (void *, u_char *, int); | ||
| 95 | void (*write_fifo) (void *, u_char *, int); | ||
| 96 | void *hw; | ||
| 97 | int slot; /* multiport card channel slot */ | ||
| 98 | struct timer_list timer; | ||
| 99 | /* receive data */ | ||
| 100 | struct sk_buff *rx_skb; | ||
| 101 | int maxlen; | ||
| 102 | /* send data */ | ||
| 103 | struct sk_buff_head squeue; | ||
| 104 | struct sk_buff_head rqueue; | ||
| 105 | struct sk_buff *tx_skb; | ||
| 106 | int tx_idx; | ||
| 107 | int debug; | ||
| 108 | /* statistics */ | ||
| 109 | int err_crc; | ||
| 110 | int err_tx; | ||
| 111 | int err_rx; | ||
| 112 | }; | ||
| 113 | |||
| 114 | typedef int (dchannel_l1callback)(struct dchannel *, u_int); | ||
| 115 | extern int create_l1(struct dchannel *, dchannel_l1callback *); | ||
| 116 | |||
| 117 | /* private L1 commands */ | ||
| 118 | #define INFO0 0x8002 | ||
| 119 | #define INFO1 0x8102 | ||
| 120 | #define INFO2 0x8202 | ||
| 121 | #define INFO3_P8 0x8302 | ||
| 122 | #define INFO3_P10 0x8402 | ||
| 123 | #define INFO4_P8 0x8502 | ||
| 124 | #define INFO4_P10 0x8602 | ||
| 125 | #define LOSTFRAMING 0x8702 | ||
| 126 | #define ANYSIGNAL 0x8802 | ||
| 127 | #define HW_POWERDOWN 0x8902 | ||
| 128 | #define HW_RESET_REQ 0x8a02 | ||
| 129 | #define HW_POWERUP_REQ 0x8b02 | ||
| 130 | #define HW_DEACT_REQ 0x8c02 | ||
| 131 | #define HW_ACTIVATE_REQ 0x8e02 | ||
| 132 | #define HW_D_NOBLOCKED 0x8f02 | ||
| 133 | #define HW_RESET_IND 0x9002 | ||
| 134 | #define HW_POWERUP_IND 0x9102 | ||
| 135 | #define HW_DEACT_IND 0x9202 | ||
| 136 | #define HW_ACTIVATE_IND 0x9302 | ||
| 137 | #define HW_DEACT_CNF 0x9402 | ||
| 138 | #define HW_TESTLOOP 0x9502 | ||
| 139 | #define HW_TESTRX_RAW 0x9602 | ||
| 140 | #define HW_TESTRX_HDLC 0x9702 | ||
| 141 | #define HW_TESTRX_OFF 0x9802 | ||
| 142 | |||
| 143 | struct layer1; | ||
| 144 | extern int l1_event(struct layer1 *, u_int); | ||
| 145 | |||
| 146 | |||
| 147 | struct bchannel { | ||
| 148 | struct mISDNchannel ch; | ||
| 149 | int nr; | ||
| 150 | u_long Flags; | ||
| 151 | struct work_struct workq; | ||
| 152 | u_int state; | ||
| 153 | /* HW access */ | ||
| 154 | u_char (*read_reg) (void *, u_char); | ||
| 155 | void (*write_reg) (void *, u_char, u_char); | ||
| 156 | void (*read_fifo) (void *, u_char *, int); | ||
| 157 | void (*write_fifo) (void *, u_char *, int); | ||
| 158 | void *hw; | ||
| 159 | int slot; /* multiport card channel slot */ | ||
| 160 | struct timer_list timer; | ||
| 161 | /* receive data */ | ||
| 162 | struct sk_buff *rx_skb; | ||
| 163 | int maxlen; | ||
| 164 | /* send data */ | ||
| 165 | struct sk_buff *next_skb; | ||
| 166 | struct sk_buff *tx_skb; | ||
| 167 | struct sk_buff_head rqueue; | ||
| 168 | int rcount; | ||
| 169 | int tx_idx; | ||
| 170 | int debug; | ||
| 171 | /* statistics */ | ||
| 172 | int err_crc; | ||
| 173 | int err_tx; | ||
| 174 | int err_rx; | ||
| 175 | }; | ||
| 176 | |||
| 177 | extern int mISDN_initdchannel(struct dchannel *, int, void *); | ||
| 178 | extern int mISDN_initbchannel(struct bchannel *, int); | ||
| 179 | extern int mISDN_freedchannel(struct dchannel *); | ||
| 180 | extern int mISDN_freebchannel(struct bchannel *); | ||
| 181 | extern void queue_ch_frame(struct mISDNchannel *, u_int, | ||
| 182 | int, struct sk_buff *); | ||
| 183 | extern int dchannel_senddata(struct dchannel *, struct sk_buff *); | ||
| 184 | extern int bchannel_senddata(struct bchannel *, struct sk_buff *); | ||
| 185 | extern void recv_Dchannel(struct dchannel *); | ||
| 186 | extern void recv_Bchannel(struct bchannel *); | ||
| 187 | extern void recv_Dchannel_skb(struct dchannel *, struct sk_buff *); | ||
| 188 | extern void recv_Bchannel_skb(struct bchannel *, struct sk_buff *); | ||
| 189 | extern void confirm_Bsend(struct bchannel *bch); | ||
| 190 | extern int get_next_bframe(struct bchannel *); | ||
| 191 | extern int get_next_dframe(struct dchannel *); | ||
| 192 | |||
| 193 | #endif | ||
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h new file mode 100644 index 000000000000..5c948f337817 --- /dev/null +++ b/include/linux/mISDNif.h | |||
| @@ -0,0 +1,487 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * Author Karsten Keil <kkeil@novell.com> | ||
| 4 | * | ||
| 5 | * Copyright 2008 by Karsten Keil <kkeil@novell.com> | ||
| 6 | * | ||
| 7 | * This code is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE | ||
| 9 | * version 2.1 as published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This code is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU LESSER GENERAL PUBLIC LICENSE for more details. | ||
| 15 | * | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef mISDNIF_H | ||
| 19 | #define mISDNIF_H | ||
| 20 | |||
| 21 | #include <stdarg.h> | ||
| 22 | #include <linux/types.h> | ||
| 23 | #include <linux/errno.h> | ||
| 24 | #include <linux/socket.h> | ||
| 25 | |||
| 26 | /* | ||
| 27 | * ABI Version 32 bit | ||
| 28 | * | ||
| 29 | * <8 bit> Major version | ||
| 30 | * - changed if any interface become backwards incompatible | ||
| 31 | * | ||
| 32 | * <8 bit> Minor version | ||
| 33 | * - changed if any interface is extended but backwards compatible | ||
| 34 | * | ||
| 35 | * <16 bit> Release number | ||
| 36 | * - should be incremented on every checkin | ||
| 37 | */ | ||
| 38 | #define MISDN_MAJOR_VERSION 1 | ||
| 39 | #define MISDN_MINOR_VERSION 0 | ||
| 40 | #define MISDN_RELEASE 18 | ||
| 41 | |||
| 42 | /* primitives for information exchange | ||
| 43 | * generell format | ||
| 44 | * <16 bit 0 > | ||
| 45 | * <8 bit command> | ||
| 46 | * BIT 8 = 1 LAYER private | ||
| 47 | * BIT 7 = 1 answer | ||
| 48 | * BIT 6 = 1 DATA | ||
| 49 | * <8 bit target layer mask> | ||
| 50 | * | ||
| 51 | * Layer = 00 is reserved for general commands | ||
| 52 | Layer = 01 L2 -> HW | ||
| 53 | Layer = 02 HW -> L2 | ||
| 54 | Layer = 04 L3 -> L2 | ||
| 55 | Layer = 08 L2 -> L3 | ||
| 56 | * Layer = FF is reserved for broadcast commands | ||
| 57 | */ | ||
| 58 | |||
| 59 | #define MISDN_CMDMASK 0xff00 | ||
| 60 | #define MISDN_LAYERMASK 0x00ff | ||
| 61 | |||
| 62 | /* generell commands */ | ||
| 63 | #define OPEN_CHANNEL 0x0100 | ||
| 64 | #define CLOSE_CHANNEL 0x0200 | ||
| 65 | #define CONTROL_CHANNEL 0x0300 | ||
| 66 | #define CHECK_DATA 0x0400 | ||
| 67 | |||
| 68 | /* layer 2 -> layer 1 */ | ||
| 69 | #define PH_ACTIVATE_REQ 0x0101 | ||
| 70 | #define PH_DEACTIVATE_REQ 0x0201 | ||
| 71 | #define PH_DATA_REQ 0x2001 | ||
| 72 | #define MPH_ACTIVATE_REQ 0x0501 | ||
| 73 | #define MPH_DEACTIVATE_REQ 0x0601 | ||
| 74 | #define MPH_INFORMATION_REQ 0x0701 | ||
| 75 | #define PH_CONTROL_REQ 0x0801 | ||
| 76 | |||
| 77 | /* layer 1 -> layer 2 */ | ||
| 78 | #define PH_ACTIVATE_IND 0x0102 | ||
| 79 | #define PH_ACTIVATE_CNF 0x4102 | ||
| 80 | #define PH_DEACTIVATE_IND 0x0202 | ||
| 81 | #define PH_DEACTIVATE_CNF 0x4202 | ||
| 82 | #define PH_DATA_IND 0x2002 | ||
| 83 | #define MPH_ACTIVATE_IND 0x0502 | ||
| 84 | #define MPH_DEACTIVATE_IND 0x0602 | ||
| 85 | #define MPH_INFORMATION_IND 0x0702 | ||
| 86 | #define PH_DATA_CNF 0x6002 | ||
| 87 | #define PH_CONTROL_IND 0x0802 | ||
| 88 | #define PH_CONTROL_CNF 0x4802 | ||
| 89 | |||
| 90 | /* layer 3 -> layer 2 */ | ||
| 91 | #define DL_ESTABLISH_REQ 0x1004 | ||
| 92 | #define DL_RELEASE_REQ 0x1104 | ||
| 93 | #define DL_DATA_REQ 0x3004 | ||
| 94 | #define DL_UNITDATA_REQ 0x3104 | ||
| 95 | #define DL_INFORMATION_REQ 0x0004 | ||
| 96 | |||
| 97 | /* layer 2 -> layer 3 */ | ||
| 98 | #define DL_ESTABLISH_IND 0x1008 | ||
| 99 | #define DL_ESTABLISH_CNF 0x5008 | ||
| 100 | #define DL_RELEASE_IND 0x1108 | ||
| 101 | #define DL_RELEASE_CNF 0x5108 | ||
| 102 | #define DL_DATA_IND 0x3008 | ||
| 103 | #define DL_UNITDATA_IND 0x3108 | ||
| 104 | #define DL_INFORMATION_IND 0x0008 | ||
| 105 | |||
| 106 | /* intern layer 2 managment */ | ||
| 107 | #define MDL_ASSIGN_REQ 0x1804 | ||
| 108 | #define MDL_ASSIGN_IND 0x1904 | ||
| 109 | #define MDL_REMOVE_REQ 0x1A04 | ||
| 110 | #define MDL_REMOVE_IND 0x1B04 | ||
| 111 | #define MDL_STATUS_UP_IND 0x1C04 | ||
| 112 | #define MDL_STATUS_DOWN_IND 0x1D04 | ||
| 113 | #define MDL_STATUS_UI_IND 0x1E04 | ||
| 114 | #define MDL_ERROR_IND 0x1F04 | ||
| 115 | #define MDL_ERROR_RSP 0x5F04 | ||
| 116 | |||
| 117 | /* DL_INFORMATION_IND types */ | ||
| 118 | #define DL_INFO_L2_CONNECT 0x0001 | ||
| 119 | #define DL_INFO_L2_REMOVED 0x0002 | ||
| 120 | |||
| 121 | /* PH_CONTROL types */ | ||
| 122 | /* TOUCH TONE IS 0x20XX XX "0"..."9", "A","B","C","D","*","#" */ | ||
| 123 | #define DTMF_TONE_VAL 0x2000 | ||
| 124 | #define DTMF_TONE_MASK 0x007F | ||
| 125 | #define DTMF_TONE_START 0x2100 | ||
| 126 | #define DTMF_TONE_STOP 0x2200 | ||
| 127 | #define DTMF_HFC_COEF 0x4000 | ||
| 128 | #define DSP_CONF_JOIN 0x2403 | ||
| 129 | #define DSP_CONF_SPLIT 0x2404 | ||
| 130 | #define DSP_RECEIVE_OFF 0x2405 | ||
| 131 | #define DSP_RECEIVE_ON 0x2406 | ||
| 132 | #define DSP_ECHO_ON 0x2407 | ||
| 133 | #define DSP_ECHO_OFF 0x2408 | ||
| 134 | #define DSP_MIX_ON 0x2409 | ||
| 135 | #define DSP_MIX_OFF 0x240a | ||
| 136 | #define DSP_DELAY 0x240b | ||
| 137 | #define DSP_JITTER 0x240c | ||
| 138 | #define DSP_TXDATA_ON 0x240d | ||
| 139 | #define DSP_TXDATA_OFF 0x240e | ||
| 140 | #define DSP_TX_DEJITTER 0x240f | ||
| 141 | #define DSP_TX_DEJ_OFF 0x2410 | ||
| 142 | #define DSP_TONE_PATT_ON 0x2411 | ||
| 143 | #define DSP_TONE_PATT_OFF 0x2412 | ||
| 144 | #define DSP_VOL_CHANGE_TX 0x2413 | ||
| 145 | #define DSP_VOL_CHANGE_RX 0x2414 | ||
| 146 | #define DSP_BF_ENABLE_KEY 0x2415 | ||
| 147 | #define DSP_BF_DISABLE 0x2416 | ||
| 148 | #define DSP_BF_ACCEPT 0x2416 | ||
| 149 | #define DSP_BF_REJECT 0x2417 | ||
| 150 | #define DSP_PIPELINE_CFG 0x2418 | ||
| 151 | #define HFC_VOL_CHANGE_TX 0x2601 | ||
| 152 | #define HFC_VOL_CHANGE_RX 0x2602 | ||
| 153 | #define HFC_SPL_LOOP_ON 0x2603 | ||
| 154 | #define HFC_SPL_LOOP_OFF 0x2604 | ||
| 155 | |||
| 156 | /* DSP_TONE_PATT_ON parameter */ | ||
| 157 | #define TONE_OFF 0x0000 | ||
| 158 | #define TONE_GERMAN_DIALTONE 0x0001 | ||
| 159 | #define TONE_GERMAN_OLDDIALTONE 0x0002 | ||
| 160 | #define TONE_AMERICAN_DIALTONE 0x0003 | ||
| 161 | #define TONE_GERMAN_DIALPBX 0x0004 | ||
| 162 | #define TONE_GERMAN_OLDDIALPBX 0x0005 | ||
| 163 | #define TONE_AMERICAN_DIALPBX 0x0006 | ||
| 164 | #define TONE_GERMAN_RINGING 0x0007 | ||
| 165 | #define TONE_GERMAN_OLDRINGING 0x0008 | ||
| 166 | #define TONE_AMERICAN_RINGPBX 0x000b | ||
| 167 | #define TONE_GERMAN_RINGPBX 0x000c | ||
| 168 | #define TONE_GERMAN_OLDRINGPBX 0x000d | ||
| 169 | #define TONE_AMERICAN_RINGING 0x000e | ||
| 170 | #define TONE_GERMAN_BUSY 0x000f | ||
| 171 | #define TONE_GERMAN_OLDBUSY 0x0010 | ||
| 172 | #define TONE_AMERICAN_BUSY 0x0011 | ||
| 173 | #define TONE_GERMAN_HANGUP 0x0012 | ||
| 174 | #define TONE_GERMAN_OLDHANGUP 0x0013 | ||
| 175 | #define TONE_AMERICAN_HANGUP 0x0014 | ||
| 176 | #define TONE_SPECIAL_INFO 0x0015 | ||
| 177 | #define TONE_GERMAN_GASSENBESETZT 0x0016 | ||
| 178 | #define TONE_GERMAN_AUFSCHALTTON 0x0016 | ||
| 179 | |||
| 180 | /* MPH_INFORMATION_IND */ | ||
| 181 | #define L1_SIGNAL_LOS_OFF 0x0010 | ||
| 182 | #define L1_SIGNAL_LOS_ON 0x0011 | ||
| 183 | #define L1_SIGNAL_AIS_OFF 0x0012 | ||
| 184 | #define L1_SIGNAL_AIS_ON 0x0013 | ||
| 185 | #define L1_SIGNAL_RDI_OFF 0x0014 | ||
| 186 | #define L1_SIGNAL_RDI_ON 0x0015 | ||
| 187 | #define L1_SIGNAL_SLIP_RX 0x0020 | ||
| 188 | #define L1_SIGNAL_SLIP_TX 0x0021 | ||
| 189 | |||
| 190 | /* | ||
| 191 | * protocol ids | ||
| 192 | * D channel 1-31 | ||
| 193 | * B channel 33 - 63 | ||
| 194 | */ | ||
| 195 | |||
| 196 | #define ISDN_P_NONE 0 | ||
| 197 | #define ISDN_P_BASE 0 | ||
| 198 | #define ISDN_P_TE_S0 0x01 | ||
| 199 | #define ISDN_P_NT_S0 0x02 | ||
| 200 | #define ISDN_P_TE_E1 0x03 | ||
| 201 | #define ISDN_P_NT_E1 0x04 | ||
| 202 | #define ISDN_P_LAPD_TE 0x10 | ||
| 203 | #define ISDN_P_LAPD_NT 0x11 | ||
| 204 | |||
| 205 | #define ISDN_P_B_MASK 0x1f | ||
| 206 | #define ISDN_P_B_START 0x20 | ||
| 207 | |||
| 208 | #define ISDN_P_B_RAW 0x21 | ||
| 209 | #define ISDN_P_B_HDLC 0x22 | ||
| 210 | #define ISDN_P_B_X75SLP 0x23 | ||
| 211 | #define ISDN_P_B_L2DTMF 0x24 | ||
| 212 | #define ISDN_P_B_L2DSP 0x25 | ||
| 213 | #define ISDN_P_B_L2DSPHDLC 0x26 | ||
| 214 | |||
| 215 | #define OPTION_L2_PMX 1 | ||
| 216 | #define OPTION_L2_PTP 2 | ||
| 217 | #define OPTION_L2_FIXEDTEI 3 | ||
| 218 | #define OPTION_L2_CLEANUP 4 | ||
| 219 | |||
| 220 | /* should be in sync with linux/kobject.h:KOBJ_NAME_LEN */ | ||
| 221 | #define MISDN_MAX_IDLEN 20 | ||
| 222 | |||
| 223 | struct mISDNhead { | ||
| 224 | unsigned int prim; | ||
| 225 | unsigned int id; | ||
| 226 | } __attribute__((packed)); | ||
| 227 | |||
| 228 | #define MISDN_HEADER_LEN sizeof(struct mISDNhead) | ||
| 229 | #define MAX_DATA_SIZE 2048 | ||
| 230 | #define MAX_DATA_MEM (MAX_DATA_SIZE + MISDN_HEADER_LEN) | ||
| 231 | #define MAX_DFRAME_LEN 260 | ||
| 232 | |||
| 233 | #define MISDN_ID_ADDR_MASK 0xFFFF | ||
| 234 | #define MISDN_ID_TEI_MASK 0xFF00 | ||
| 235 | #define MISDN_ID_SAPI_MASK 0x00FF | ||
| 236 | #define MISDN_ID_TEI_ANY 0x7F00 | ||
| 237 | |||
| 238 | #define MISDN_ID_ANY 0xFFFF | ||
| 239 | #define MISDN_ID_NONE 0xFFFE | ||
| 240 | |||
| 241 | #define GROUP_TEI 127 | ||
| 242 | #define TEI_SAPI 63 | ||
| 243 | #define CTRL_SAPI 0 | ||
| 244 | |||
| 245 | #define MISDN_CHMAP_SIZE 4 | ||
| 246 | |||
| 247 | #define SOL_MISDN 0 | ||
| 248 | |||
| 249 | struct sockaddr_mISDN { | ||
| 250 | sa_family_t family; | ||
| 251 | unsigned char dev; | ||
| 252 | unsigned char channel; | ||
| 253 | unsigned char sapi; | ||
| 254 | unsigned char tei; | ||
| 255 | }; | ||
| 256 | |||
| 257 | /* timer device ioctl */ | ||
| 258 | #define IMADDTIMER _IOR('I', 64, int) | ||
| 259 | #define IMDELTIMER _IOR('I', 65, int) | ||
| 260 | /* socket ioctls */ | ||
| 261 | #define IMGETVERSION _IOR('I', 66, int) | ||
| 262 | #define IMGETCOUNT _IOR('I', 67, int) | ||
| 263 | #define IMGETDEVINFO _IOR('I', 68, int) | ||
| 264 | #define IMCTRLREQ _IOR('I', 69, int) | ||
| 265 | #define IMCLEAR_L2 _IOR('I', 70, int) | ||
| 266 | |||
| 267 | struct mISDNversion { | ||
| 268 | unsigned char major; | ||
| 269 | unsigned char minor; | ||
| 270 | unsigned short release; | ||
| 271 | }; | ||
| 272 | |||
| 273 | struct mISDN_devinfo { | ||
| 274 | u_int id; | ||
| 275 | u_int Dprotocols; | ||
| 276 | u_int Bprotocols; | ||
| 277 | u_int protocol; | ||
| 278 | u_long channelmap[MISDN_CHMAP_SIZE]; | ||
| 279 | u_int nrbchan; | ||
| 280 | char name[MISDN_MAX_IDLEN]; | ||
| 281 | }; | ||
| 282 | |||
| 283 | /* CONTROL_CHANNEL parameters */ | ||
| 284 | #define MISDN_CTRL_GETOP 0x0000 | ||
| 285 | #define MISDN_CTRL_LOOP 0x0001 | ||
| 286 | #define MISDN_CTRL_CONNECT 0x0002 | ||
| 287 | #define MISDN_CTRL_DISCONNECT 0x0004 | ||
| 288 | #define MISDN_CTRL_PCMCONNECT 0x0010 | ||
| 289 | #define MISDN_CTRL_PCMDISCONNECT 0x0020 | ||
| 290 | #define MISDN_CTRL_SETPEER 0x0040 | ||
| 291 | #define MISDN_CTRL_UNSETPEER 0x0080 | ||
| 292 | #define MISDN_CTRL_RX_OFF 0x0100 | ||
| 293 | #define MISDN_CTRL_HW_FEATURES_OP 0x2000 | ||
| 294 | #define MISDN_CTRL_HW_FEATURES 0x2001 | ||
| 295 | #define MISDN_CTRL_HFC_OP 0x4000 | ||
| 296 | #define MISDN_CTRL_HFC_PCM_CONN 0x4001 | ||
| 297 | #define MISDN_CTRL_HFC_PCM_DISC 0x4002 | ||
| 298 | #define MISDN_CTRL_HFC_CONF_JOIN 0x4003 | ||
| 299 | #define MISDN_CTRL_HFC_CONF_SPLIT 0x4004 | ||
| 300 | #define MISDN_CTRL_HFC_RECEIVE_OFF 0x4005 | ||
| 301 | #define MISDN_CTRL_HFC_RECEIVE_ON 0x4006 | ||
| 302 | #define MISDN_CTRL_HFC_ECHOCAN_ON 0x4007 | ||
| 303 | #define MISDN_CTRL_HFC_ECHOCAN_OFF 0x4008 | ||
| 304 | |||
| 305 | |||
| 306 | /* socket options */ | ||
| 307 | #define MISDN_TIME_STAMP 0x0001 | ||
| 308 | |||
| 309 | struct mISDN_ctrl_req { | ||
| 310 | int op; | ||
| 311 | int channel; | ||
| 312 | int p1; | ||
| 313 | int p2; | ||
| 314 | }; | ||
| 315 | |||
| 316 | /* muxer options */ | ||
| 317 | #define MISDN_OPT_ALL 1 | ||
| 318 | #define MISDN_OPT_TEIMGR 2 | ||
| 319 | |||
| 320 | #ifdef __KERNEL__ | ||
| 321 | #include <linux/list.h> | ||
| 322 | #include <linux/skbuff.h> | ||
| 323 | #include <linux/net.h> | ||
| 324 | #include <net/sock.h> | ||
| 325 | #include <linux/completion.h> | ||
| 326 | |||
| 327 | #define DEBUG_CORE 0x000000ff | ||
| 328 | #define DEBUG_CORE_FUNC 0x00000002 | ||
| 329 | #define DEBUG_SOCKET 0x00000004 | ||
| 330 | #define DEBUG_MANAGER 0x00000008 | ||
| 331 | #define DEBUG_SEND_ERR 0x00000010 | ||
| 332 | #define DEBUG_MSG_THREAD 0x00000020 | ||
| 333 | #define DEBUG_QUEUE_FUNC 0x00000040 | ||
| 334 | #define DEBUG_L1 0x0000ff00 | ||
| 335 | #define DEBUG_L1_FSM 0x00000200 | ||
| 336 | #define DEBUG_L2 0x00ff0000 | ||
| 337 | #define DEBUG_L2_FSM 0x00020000 | ||
| 338 | #define DEBUG_L2_CTRL 0x00040000 | ||
| 339 | #define DEBUG_L2_RECV 0x00080000 | ||
| 340 | #define DEBUG_L2_TEI 0x00100000 | ||
| 341 | #define DEBUG_L2_TEIFSM 0x00200000 | ||
| 342 | #define DEBUG_TIMER 0x01000000 | ||
| 343 | |||
| 344 | #define mISDN_HEAD_P(s) ((struct mISDNhead *)&s->cb[0]) | ||
| 345 | #define mISDN_HEAD_PRIM(s) (((struct mISDNhead *)&s->cb[0])->prim) | ||
| 346 | #define mISDN_HEAD_ID(s) (((struct mISDNhead *)&s->cb[0])->id) | ||
| 347 | |||
| 348 | /* socket states */ | ||
| 349 | #define MISDN_OPEN 1 | ||
| 350 | #define MISDN_BOUND 2 | ||
| 351 | #define MISDN_CLOSED 3 | ||
| 352 | |||
| 353 | struct mISDNchannel; | ||
| 354 | struct mISDNdevice; | ||
| 355 | struct mISDNstack; | ||
| 356 | |||
| 357 | struct channel_req { | ||
| 358 | u_int protocol; | ||
| 359 | struct sockaddr_mISDN adr; | ||
| 360 | struct mISDNchannel *ch; | ||
| 361 | }; | ||
| 362 | |||
| 363 | typedef int (ctrl_func_t)(struct mISDNchannel *, u_int, void *); | ||
| 364 | typedef int (send_func_t)(struct mISDNchannel *, struct sk_buff *); | ||
| 365 | typedef int (create_func_t)(struct channel_req *); | ||
| 366 | |||
| 367 | struct Bprotocol { | ||
| 368 | struct list_head list; | ||
| 369 | char *name; | ||
| 370 | u_int Bprotocols; | ||
| 371 | create_func_t *create; | ||
| 372 | }; | ||
| 373 | |||
| 374 | struct mISDNchannel { | ||
| 375 | struct list_head list; | ||
| 376 | u_int protocol; | ||
| 377 | u_int nr; | ||
| 378 | u_long opt; | ||
| 379 | u_int addr; | ||
| 380 | struct mISDNstack *st; | ||
| 381 | struct mISDNchannel *peer; | ||
| 382 | send_func_t *send; | ||
| 383 | send_func_t *recv; | ||
| 384 | ctrl_func_t *ctrl; | ||
| 385 | }; | ||
| 386 | |||
| 387 | struct mISDN_sock_list { | ||
| 388 | struct hlist_head head; | ||
| 389 | rwlock_t lock; | ||
| 390 | }; | ||
| 391 | |||
| 392 | struct mISDN_sock { | ||
| 393 | struct sock sk; | ||
| 394 | struct mISDNchannel ch; | ||
| 395 | u_int cmask; | ||
| 396 | struct mISDNdevice *dev; | ||
| 397 | }; | ||
| 398 | |||
| 399 | |||
| 400 | |||
| 401 | struct mISDNdevice { | ||
| 402 | struct mISDNchannel D; | ||
| 403 | u_int id; | ||
| 404 | char name[MISDN_MAX_IDLEN]; | ||
| 405 | u_int Dprotocols; | ||
| 406 | u_int Bprotocols; | ||
| 407 | u_int nrbchan; | ||
| 408 | u_long channelmap[MISDN_CHMAP_SIZE]; | ||
| 409 | struct list_head bchannels; | ||
| 410 | struct mISDNchannel *teimgr; | ||
| 411 | struct device dev; | ||
| 412 | }; | ||
| 413 | |||
| 414 | struct mISDNstack { | ||
| 415 | u_long status; | ||
| 416 | struct mISDNdevice *dev; | ||
| 417 | struct task_struct *thread; | ||
| 418 | struct completion *notify; | ||
| 419 | wait_queue_head_t workq; | ||
| 420 | struct sk_buff_head msgq; | ||
| 421 | struct list_head layer2; | ||
| 422 | struct mISDNchannel *layer1; | ||
| 423 | struct mISDNchannel own; | ||
| 424 | struct mutex lmutex; /* protect lists */ | ||
| 425 | struct mISDN_sock_list l1sock; | ||
| 426 | #ifdef MISDN_MSG_STATS | ||
| 427 | u_int msg_cnt; | ||
| 428 | u_int sleep_cnt; | ||
| 429 | u_int stopped_cnt; | ||
| 430 | #endif | ||
| 431 | }; | ||
| 432 | |||
| 433 | /* global alloc/queue dunctions */ | ||
| 434 | |||
| 435 | static inline struct sk_buff * | ||
| 436 | mI_alloc_skb(unsigned int len, gfp_t gfp_mask) | ||
| 437 | { | ||
| 438 | struct sk_buff *skb; | ||
| 439 | |||
| 440 | skb = alloc_skb(len + MISDN_HEADER_LEN, gfp_mask); | ||
| 441 | if (likely(skb)) | ||
| 442 | skb_reserve(skb, MISDN_HEADER_LEN); | ||
| 443 | return skb; | ||
| 444 | } | ||
| 445 | |||
| 446 | static inline struct sk_buff * | ||
| 447 | _alloc_mISDN_skb(u_int prim, u_int id, u_int len, void *dp, gfp_t gfp_mask) | ||
| 448 | { | ||
| 449 | struct sk_buff *skb = mI_alloc_skb(len, gfp_mask); | ||
| 450 | struct mISDNhead *hh; | ||
| 451 | |||
| 452 | if (!skb) | ||
| 453 | return NULL; | ||
| 454 | if (len) | ||
| 455 | memcpy(skb_put(skb, len), dp, len); | ||
| 456 | hh = mISDN_HEAD_P(skb); | ||
| 457 | hh->prim = prim; | ||
| 458 | hh->id = id; | ||
| 459 | return skb; | ||
| 460 | } | ||
| 461 | |||
| 462 | static inline void | ||
| 463 | _queue_data(struct mISDNchannel *ch, u_int prim, | ||
| 464 | u_int id, u_int len, void *dp, gfp_t gfp_mask) | ||
| 465 | { | ||
| 466 | struct sk_buff *skb; | ||
| 467 | |||
| 468 | if (!ch->peer) | ||
| 469 | return; | ||
| 470 | skb = _alloc_mISDN_skb(prim, id, len, dp, gfp_mask); | ||
| 471 | if (!skb) | ||
| 472 | return; | ||
| 473 | if (ch->recv(ch->peer, skb)) | ||
| 474 | dev_kfree_skb(skb); | ||
| 475 | } | ||
| 476 | |||
| 477 | /* global register/unregister functions */ | ||
| 478 | |||
| 479 | extern int mISDN_register_device(struct mISDNdevice *, char *name); | ||
| 480 | extern void mISDN_unregister_device(struct mISDNdevice *); | ||
| 481 | extern int mISDN_register_Bprotocol(struct Bprotocol *); | ||
| 482 | extern void mISDN_unregister_Bprotocol(struct Bprotocol *); | ||
| 483 | |||
| 484 | extern void set_channel_address(struct mISDNchannel *, u_int, u_int); | ||
| 485 | |||
| 486 | #endif /* __KERNEL__ */ | ||
| 487 | #endif /* mISDNIF_H */ | ||
diff --git a/include/linux/major.h b/include/linux/major.h index 0cb98053537a..53d5fafd85c3 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
| @@ -53,7 +53,7 @@ | |||
| 53 | #define STL_SIOMEMMAJOR 28 | 53 | #define STL_SIOMEMMAJOR 28 |
| 54 | #define ACSI_MAJOR 28 | 54 | #define ACSI_MAJOR 28 |
| 55 | #define AZTECH_CDROM_MAJOR 29 | 55 | #define AZTECH_CDROM_MAJOR 29 |
| 56 | #define GRAPHDEV_MAJOR 29 /* SparcLinux & Linux/68k /dev/fb */ | 56 | #define FB_MAJOR 29 /* /dev/fb* framebuffers */ |
| 57 | #define CM206_CDROM_MAJOR 32 | 57 | #define CM206_CDROM_MAJOR 32 |
| 58 | #define IDE2_MAJOR 33 | 58 | #define IDE2_MAJOR 33 |
| 59 | #define IDE3_MAJOR 34 | 59 | #define IDE3_MAJOR 34 |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e6608776bc96..fdf3967e1397 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -35,7 +35,10 @@ extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | |||
| 35 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | 35 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
| 36 | gfp_t gfp_mask); | 36 | gfp_t gfp_mask); |
| 37 | extern void mem_cgroup_uncharge_page(struct page *page); | 37 | extern void mem_cgroup_uncharge_page(struct page *page); |
| 38 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | ||
| 38 | extern void mem_cgroup_move_lists(struct page *page, bool active); | 39 | extern void mem_cgroup_move_lists(struct page *page, bool active); |
| 40 | extern int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask); | ||
| 41 | |||
| 39 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 42 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
| 40 | struct list_head *dst, | 43 | struct list_head *dst, |
| 41 | unsigned long *scanned, int order, | 44 | unsigned long *scanned, int order, |
| @@ -50,9 +53,9 @@ extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | |||
| 50 | #define mm_match_cgroup(mm, cgroup) \ | 53 | #define mm_match_cgroup(mm, cgroup) \ |
| 51 | ((cgroup) == mem_cgroup_from_task((mm)->owner)) | 54 | ((cgroup) == mem_cgroup_from_task((mm)->owner)) |
| 52 | 55 | ||
| 53 | extern int mem_cgroup_prepare_migration(struct page *page); | 56 | extern int |
| 57 | mem_cgroup_prepare_migration(struct page *page, struct page *newpage); | ||
| 54 | extern void mem_cgroup_end_migration(struct page *page); | 58 | extern void mem_cgroup_end_migration(struct page *page); |
| 55 | extern void mem_cgroup_page_migration(struct page *page, struct page *newpage); | ||
| 56 | 59 | ||
| 57 | /* | 60 | /* |
| 58 | * For memory reclaim. | 61 | * For memory reclaim. |
| @@ -97,6 +100,15 @@ static inline void mem_cgroup_uncharge_page(struct page *page) | |||
| 97 | { | 100 | { |
| 98 | } | 101 | } |
| 99 | 102 | ||
| 103 | static inline void mem_cgroup_uncharge_cache_page(struct page *page) | ||
| 104 | { | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask) | ||
| 108 | { | ||
| 109 | return 0; | ||
| 110 | } | ||
| 111 | |||
| 100 | static inline void mem_cgroup_move_lists(struct page *page, bool active) | 112 | static inline void mem_cgroup_move_lists(struct page *page, bool active) |
| 101 | { | 113 | { |
| 102 | } | 114 | } |
| @@ -112,7 +124,8 @@ static inline int task_in_mem_cgroup(struct task_struct *task, | |||
| 112 | return 1; | 124 | return 1; |
| 113 | } | 125 | } |
| 114 | 126 | ||
| 115 | static inline int mem_cgroup_prepare_migration(struct page *page) | 127 | static inline int |
| 128 | mem_cgroup_prepare_migration(struct page *page, struct page *newpage) | ||
| 116 | { | 129 | { |
| 117 | return 0; | 130 | return 0; |
| 118 | } | 131 | } |
| @@ -121,11 +134,6 @@ static inline void mem_cgroup_end_migration(struct page *page) | |||
| 121 | { | 134 | { |
| 122 | } | 135 | } |
| 123 | 136 | ||
| 124 | static inline void | ||
| 125 | mem_cgroup_page_migration(struct page *page, struct page *newpage) | ||
| 126 | { | ||
| 127 | } | ||
| 128 | |||
| 129 | static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem) | 137 | static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem) |
| 130 | { | 138 | { |
| 131 | return 0; | 139 | return 0; |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index ea9f5ad9ec8e..763ba81fc0f0 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -13,12 +13,12 @@ struct mem_section; | |||
| 13 | #ifdef CONFIG_MEMORY_HOTPLUG | 13 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 14 | 14 | ||
| 15 | /* | 15 | /* |
| 16 | * Magic number for free bootmem. | 16 | * Types for free bootmem. |
| 17 | * The normal smallest mapcount is -1. Here is smaller value than it. | 17 | * The normal smallest mapcount is -1. Here is smaller value than it. |
| 18 | */ | 18 | */ |
| 19 | #define SECTION_INFO 0xfffffffe | 19 | #define SECTION_INFO (-1 - 1) |
| 20 | #define MIX_INFO 0xfffffffd | 20 | #define MIX_SECTION_INFO (-1 - 2) |
| 21 | #define NODE_INFO 0xfffffffc | 21 | #define NODE_INFO (-1 - 3) |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * pgdat resizing functions | 24 | * pgdat resizing functions |
| @@ -199,6 +199,18 @@ extern int walk_memory_resource(unsigned long start_pfn, | |||
| 199 | unsigned long nr_pages, void *arg, | 199 | unsigned long nr_pages, void *arg, |
| 200 | int (*func)(unsigned long, unsigned long, void *)); | 200 | int (*func)(unsigned long, unsigned long, void *)); |
| 201 | 201 | ||
| 202 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
| 203 | |||
| 204 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | ||
| 205 | |||
| 206 | #else | ||
| 207 | static inline int is_mem_section_removable(unsigned long pfn, | ||
| 208 | unsigned long nr_pages) | ||
| 209 | { | ||
| 210 | return 0; | ||
| 211 | } | ||
| 212 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | ||
| 213 | |||
| 202 | extern int add_memory(int nid, u64 start, u64 size); | 214 | extern int add_memory(int nid, u64 start, u64 size); |
| 203 | extern int arch_add_memory(int nid, u64 start, u64 size); | 215 | extern int arch_add_memory(int nid, u64 start, u64 size); |
| 204 | extern int remove_memory(u64 start, u64 size); | 216 | extern int remove_memory(u64 start, u64 size); |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 3a39570b81b8..085c903fe0f1 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -59,6 +59,7 @@ enum { | |||
| 59 | #include <linux/rbtree.h> | 59 | #include <linux/rbtree.h> |
| 60 | #include <linux/spinlock.h> | 60 | #include <linux/spinlock.h> |
| 61 | #include <linux/nodemask.h> | 61 | #include <linux/nodemask.h> |
| 62 | #include <linux/pagemap.h> | ||
| 62 | 63 | ||
| 63 | struct mm_struct; | 64 | struct mm_struct; |
| 64 | 65 | ||
| @@ -220,6 +221,24 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context); | |||
| 220 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | 221 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, |
| 221 | int no_context); | 222 | int no_context); |
| 222 | #endif | 223 | #endif |
| 224 | |||
| 225 | /* Check if a vma is migratable */ | ||
| 226 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
| 227 | { | ||
| 228 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | ||
| 229 | return 0; | ||
| 230 | /* | ||
| 231 | * Migration allocates pages in the highest zone. If we cannot | ||
| 232 | * do so then migration (at least from node to node) is not | ||
| 233 | * possible. | ||
| 234 | */ | ||
| 235 | if (vma->vm_file && | ||
| 236 | gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping)) | ||
| 237 | < policy_zone) | ||
| 238 | return 0; | ||
| 239 | return 1; | ||
| 240 | } | ||
| 241 | |||
| 223 | #else | 242 | #else |
| 224 | 243 | ||
| 225 | struct mempolicy {}; | 244 | struct mempolicy {}; |
diff --git a/include/linux/memstick.h b/include/linux/memstick.h index 37a5cdb03918..a9f998a3f48b 100644 --- a/include/linux/memstick.h +++ b/include/linux/memstick.h | |||
| @@ -263,6 +263,10 @@ struct memstick_dev { | |||
| 263 | /* Get next request from the media driver. */ | 263 | /* Get next request from the media driver. */ |
| 264 | int (*next_request)(struct memstick_dev *card, | 264 | int (*next_request)(struct memstick_dev *card, |
| 265 | struct memstick_request **mrq); | 265 | struct memstick_request **mrq); |
| 266 | /* Tell the media driver to stop doing things */ | ||
| 267 | void (*stop)(struct memstick_dev *card); | ||
| 268 | /* Allow the media driver to continue */ | ||
| 269 | void (*start)(struct memstick_dev *card); | ||
| 266 | 270 | ||
| 267 | struct device dev; | 271 | struct device dev; |
| 268 | }; | 272 | }; |
| @@ -284,7 +288,7 @@ struct memstick_host { | |||
| 284 | /* Notify the host that some requests are pending. */ | 288 | /* Notify the host that some requests are pending. */ |
| 285 | void (*request)(struct memstick_host *host); | 289 | void (*request)(struct memstick_host *host); |
| 286 | /* Set host IO parameters (power, clock, etc). */ | 290 | /* Set host IO parameters (power, clock, etc). */ |
| 287 | void (*set_param)(struct memstick_host *host, | 291 | int (*set_param)(struct memstick_host *host, |
| 288 | enum memstick_param param, | 292 | enum memstick_param param, |
| 289 | int value); | 293 | int value); |
| 290 | unsigned long private[0] ____cacheline_aligned; | 294 | unsigned long private[0] ____cacheline_aligned; |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index e10a90a93b5d..03aea612d284 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -3,28 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
| 5 | #include <linux/mempolicy.h> | 5 | #include <linux/mempolicy.h> |
| 6 | #include <linux/pagemap.h> | ||
| 7 | 6 | ||
| 8 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
| 9 | 8 | ||
| 10 | #ifdef CONFIG_MIGRATION | 9 | #ifdef CONFIG_MIGRATION |
| 11 | /* Check if a vma is migratable */ | ||
| 12 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
| 13 | { | ||
| 14 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | ||
| 15 | return 0; | ||
| 16 | /* | ||
| 17 | * Migration allocates pages in the highest zone. If we cannot | ||
| 18 | * do so then migration (at least from node to node) is not | ||
| 19 | * possible. | ||
| 20 | */ | ||
| 21 | if (vma->vm_file && | ||
| 22 | gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping)) | ||
| 23 | < policy_zone) | ||
| 24 | return 0; | ||
| 25 | return 1; | ||
| 26 | } | ||
| 27 | |||
| 28 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | 10 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); |
| 29 | extern int putback_lru_pages(struct list_head *l); | 11 | extern int putback_lru_pages(struct list_head *l); |
| 30 | extern int migrate_page(struct address_space *, | 12 | extern int migrate_page(struct address_space *, |
| @@ -39,9 +21,6 @@ extern int migrate_vmas(struct mm_struct *mm, | |||
| 39 | const nodemask_t *from, const nodemask_t *to, | 21 | const nodemask_t *from, const nodemask_t *to, |
| 40 | unsigned long flags); | 22 | unsigned long flags); |
| 41 | #else | 23 | #else |
| 42 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
| 43 | { return 0; } | ||
| 44 | |||
| 45 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | 24 | static inline int isolate_lru_page(struct page *p, struct list_head *list) |
| 46 | { return -ENOSYS; } | 25 | { return -ENOSYS; } |
| 47 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 26 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 81b3dd5206e0..655ea0d1ee14 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -68,6 +68,14 @@ enum { | |||
| 68 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 | 68 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | enum { | ||
| 72 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, | ||
| 73 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, | ||
| 74 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | ||
| 75 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, | ||
| 76 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, | ||
| 77 | }; | ||
| 78 | |||
| 71 | enum mlx4_event { | 79 | enum mlx4_event { |
| 72 | MLX4_EVENT_TYPE_COMP = 0x00, | 80 | MLX4_EVENT_TYPE_COMP = 0x00, |
| 73 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, | 81 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, |
| @@ -184,6 +192,8 @@ struct mlx4_caps { | |||
| 184 | u32 max_msg_sz; | 192 | u32 max_msg_sz; |
| 185 | u32 page_size_cap; | 193 | u32 page_size_cap; |
| 186 | u32 flags; | 194 | u32 flags; |
| 195 | u32 bmme_flags; | ||
| 196 | u32 reserved_lkey; | ||
| 187 | u16 stat_rate_support; | 197 | u16 stat_rate_support; |
| 188 | u8 port_width_cap[MLX4_MAX_PORTS + 1]; | 198 | u8 port_width_cap[MLX4_MAX_PORTS + 1]; |
| 189 | int max_gso_sz; | 199 | int max_gso_sz; |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 7f128b266faa..bf8f11982dae 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -164,11 +164,13 @@ enum { | |||
| 164 | MLX4_WQE_CTRL_SOLICITED = 1 << 1, | 164 | MLX4_WQE_CTRL_SOLICITED = 1 << 1, |
| 165 | MLX4_WQE_CTRL_IP_CSUM = 1 << 4, | 165 | MLX4_WQE_CTRL_IP_CSUM = 1 << 4, |
| 166 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, | 166 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, |
| 167 | MLX4_WQE_CTRL_INS_VLAN = 1 << 6, | ||
| 167 | }; | 168 | }; |
| 168 | 169 | ||
| 169 | struct mlx4_wqe_ctrl_seg { | 170 | struct mlx4_wqe_ctrl_seg { |
| 170 | __be32 owner_opcode; | 171 | __be32 owner_opcode; |
| 171 | u8 reserved2[3]; | 172 | __be16 vlan_tag; |
| 173 | u8 ins_vlan; | ||
| 172 | u8 fence_size; | 174 | u8 fence_size; |
| 173 | /* | 175 | /* |
| 174 | * High 24 bits are SRC remote buffer; low 8 bits are flags: | 176 | * High 24 bits are SRC remote buffer; low 8 bits are flags: |
| @@ -219,7 +221,7 @@ struct mlx4_wqe_datagram_seg { | |||
| 219 | __be32 reservd[2]; | 221 | __be32 reservd[2]; |
| 220 | }; | 222 | }; |
| 221 | 223 | ||
| 222 | struct mlx4_lso_seg { | 224 | struct mlx4_wqe_lso_seg { |
| 223 | __be32 mss_hdr_size; | 225 | __be32 mss_hdr_size; |
| 224 | __be32 header[0]; | 226 | __be32 header[0]; |
| 225 | }; | 227 | }; |
| @@ -233,6 +235,14 @@ struct mlx4_wqe_bind_seg { | |||
| 233 | __be64 length; | 235 | __be64 length; |
| 234 | }; | 236 | }; |
| 235 | 237 | ||
| 238 | enum { | ||
| 239 | MLX4_WQE_FMR_PERM_LOCAL_READ = 1 << 27, | ||
| 240 | MLX4_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, | ||
| 241 | MLX4_WQE_FMR_PERM_REMOTE_READ = 1 << 29, | ||
| 242 | MLX4_WQE_FMR_PERM_REMOTE_WRITE = 1 << 30, | ||
| 243 | MLX4_WQE_FMR_PERM_ATOMIC = 1 << 31 | ||
| 244 | }; | ||
| 245 | |||
| 236 | struct mlx4_wqe_fmr_seg { | 246 | struct mlx4_wqe_fmr_seg { |
| 237 | __be32 flags; | 247 | __be32 flags; |
| 238 | __be32 mem_key; | 248 | __be32 mem_key; |
| @@ -255,11 +265,11 @@ struct mlx4_wqe_fmr_ext_seg { | |||
| 255 | }; | 265 | }; |
| 256 | 266 | ||
| 257 | struct mlx4_wqe_local_inval_seg { | 267 | struct mlx4_wqe_local_inval_seg { |
| 258 | u8 flags; | 268 | __be32 flags; |
| 259 | u8 reserved1[3]; | 269 | u32 reserved1; |
| 260 | __be32 mem_key; | 270 | __be32 mem_key; |
| 261 | u8 reserved2[3]; | 271 | u32 reserved2[2]; |
| 262 | u8 guest_id; | 272 | __be32 guest_id; |
| 263 | __be64 pa; | 273 | __be64 pa; |
| 264 | }; | 274 | }; |
| 265 | 275 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 2128ef7780c6..6e695eaab4ce 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -41,6 +41,9 @@ extern unsigned long mmap_min_addr; | |||
| 41 | 41 | ||
| 42 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) | 42 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
| 43 | 43 | ||
| 44 | /* to align the pointer to the (next) page boundary */ | ||
| 45 | #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) | ||
| 46 | |||
| 44 | /* | 47 | /* |
| 45 | * Linux kernel virtual memory manager primitives. | 48 | * Linux kernel virtual memory manager primitives. |
| 46 | * The idea being to have a "virtual" mm in the same way | 49 | * The idea being to have a "virtual" mm in the same way |
| @@ -100,6 +103,7 @@ extern unsigned int kobjsize(const void *objp); | |||
| 100 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ | 103 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ |
| 101 | #define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */ | 104 | #define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */ |
| 102 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ | 105 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ |
| 106 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ | ||
| 103 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 107 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
| 104 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | 108 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ |
| 105 | #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ | 109 | #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ |
| @@ -166,12 +170,16 @@ struct vm_operations_struct { | |||
| 166 | void (*open)(struct vm_area_struct * area); | 170 | void (*open)(struct vm_area_struct * area); |
| 167 | void (*close)(struct vm_area_struct * area); | 171 | void (*close)(struct vm_area_struct * area); |
| 168 | int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); | 172 | int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); |
| 169 | unsigned long (*nopfn)(struct vm_area_struct *area, | ||
| 170 | unsigned long address); | ||
| 171 | 173 | ||
| 172 | /* notification that a previously read-only page is about to become | 174 | /* notification that a previously read-only page is about to become |
| 173 | * writable, if an error is returned it will cause a SIGBUS */ | 175 | * writable, if an error is returned it will cause a SIGBUS */ |
| 174 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); | 176 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); |
| 177 | |||
| 178 | /* called by access_process_vm when get_user_pages() fails, typically | ||
| 179 | * for use by special VMAs that can switch between memory and hardware | ||
| 180 | */ | ||
| 181 | int (*access)(struct vm_area_struct *vma, unsigned long addr, | ||
| 182 | void *buf, int len, int write); | ||
| 175 | #ifdef CONFIG_NUMA | 183 | #ifdef CONFIG_NUMA |
| 176 | /* | 184 | /* |
| 177 | * set_policy() op must add a reference to any non-NULL @new mempolicy | 185 | * set_policy() op must add a reference to any non-NULL @new mempolicy |
| @@ -675,13 +683,6 @@ static inline int page_mapped(struct page *page) | |||
| 675 | } | 683 | } |
| 676 | 684 | ||
| 677 | /* | 685 | /* |
| 678 | * Error return values for the *_nopfn functions | ||
| 679 | */ | ||
| 680 | #define NOPFN_SIGBUS ((unsigned long) -1) | ||
| 681 | #define NOPFN_OOM ((unsigned long) -2) | ||
| 682 | #define NOPFN_REFAULT ((unsigned long) -3) | ||
| 683 | |||
| 684 | /* | ||
| 685 | * Different kinds of faults, as returned by handle_mm_fault(). | 686 | * Different kinds of faults, as returned by handle_mm_fault(). |
| 686 | * Used to decide whether a process gets delivered SIGBUS or | 687 | * Used to decide whether a process gets delivered SIGBUS or |
| 687 | * just gets major/minor fault counters bumped up. | 688 | * just gets major/minor fault counters bumped up. |
| @@ -772,14 +773,14 @@ struct mm_walk { | |||
| 772 | 773 | ||
| 773 | int walk_page_range(unsigned long addr, unsigned long end, | 774 | int walk_page_range(unsigned long addr, unsigned long end, |
| 774 | struct mm_walk *walk); | 775 | struct mm_walk *walk); |
| 775 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | 776 | void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, |
| 776 | unsigned long end, unsigned long floor, unsigned long ceiling); | 777 | unsigned long end, unsigned long floor, unsigned long ceiling); |
| 777 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, | ||
| 778 | unsigned long floor, unsigned long ceiling); | ||
| 779 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | 778 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, |
| 780 | struct vm_area_struct *vma); | 779 | struct vm_area_struct *vma); |
| 781 | void unmap_mapping_range(struct address_space *mapping, | 780 | void unmap_mapping_range(struct address_space *mapping, |
| 782 | loff_t const holebegin, loff_t const holelen, int even_cows); | 781 | loff_t const holebegin, loff_t const holelen, int even_cows); |
| 782 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, | ||
| 783 | void *buf, int len, int write); | ||
| 783 | 784 | ||
| 784 | static inline void unmap_shared_mapping_range(struct address_space *mapping, | 785 | static inline void unmap_shared_mapping_range(struct address_space *mapping, |
| 785 | loff_t const holebegin, loff_t const holelen) | 786 | loff_t const holebegin, loff_t const holelen) |
| @@ -809,7 +810,6 @@ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void * | |||
| 809 | 810 | ||
| 810 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, | 811 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, |
| 811 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 812 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); |
| 812 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); | ||
| 813 | 813 | ||
| 814 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 814 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
| 815 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 815 | extern void do_invalidatepage(struct page *page, unsigned long offset); |
| @@ -832,6 +832,39 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
| 832 | struct vm_area_struct **pprev, unsigned long start, | 832 | struct vm_area_struct **pprev, unsigned long start, |
| 833 | unsigned long end, unsigned long newflags); | 833 | unsigned long end, unsigned long newflags); |
| 834 | 834 | ||
| 835 | #ifdef CONFIG_HAVE_GET_USER_PAGES_FAST | ||
| 836 | /* | ||
| 837 | * get_user_pages_fast provides equivalent functionality to get_user_pages, | ||
| 838 | * operating on current and current->mm (force=0 and doesn't return any vmas). | ||
| 839 | * | ||
| 840 | * get_user_pages_fast may take mmap_sem and page tables, so no assumptions | ||
| 841 | * can be made about locking. get_user_pages_fast is to be implemented in a | ||
| 842 | * way that is advantageous (vs get_user_pages()) when the user memory area is | ||
| 843 | * already faulted in and present in ptes. However if the pages have to be | ||
| 844 | * faulted in, it may turn out to be slightly slower). | ||
| 845 | */ | ||
| 846 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
| 847 | struct page **pages); | ||
| 848 | |||
| 849 | #else | ||
| 850 | /* | ||
| 851 | * Should probably be moved to asm-generic, and architectures can include it if | ||
| 852 | * they don't implement their own get_user_pages_fast. | ||
| 853 | */ | ||
| 854 | #define get_user_pages_fast(start, nr_pages, write, pages) \ | ||
| 855 | ({ \ | ||
| 856 | struct mm_struct *mm = current->mm; \ | ||
| 857 | int ret; \ | ||
| 858 | \ | ||
| 859 | down_read(&mm->mmap_sem); \ | ||
| 860 | ret = get_user_pages(current, mm, start, nr_pages, \ | ||
| 861 | write, 0, pages, NULL); \ | ||
| 862 | up_read(&mm->mmap_sem); \ | ||
| 863 | \ | ||
| 864 | ret; \ | ||
| 865 | }) | ||
| 866 | #endif | ||
| 867 | |||
| 835 | /* | 868 | /* |
| 836 | * A callback you can register to apply pressure to ageable caches. | 869 | * A callback you can register to apply pressure to ageable caches. |
| 837 | * | 870 | * |
| @@ -965,9 +998,8 @@ static inline void pgtable_page_dtor(struct page *page) | |||
| 965 | NULL: pte_offset_kernel(pmd, address)) | 998 | NULL: pte_offset_kernel(pmd, address)) |
| 966 | 999 | ||
| 967 | extern void free_area_init(unsigned long * zones_size); | 1000 | extern void free_area_init(unsigned long * zones_size); |
| 968 | extern void free_area_init_node(int nid, pg_data_t *pgdat, | 1001 | extern void free_area_init_node(int nid, unsigned long * zones_size, |
| 969 | unsigned long * zones_size, unsigned long zone_start_pfn, | 1002 | unsigned long zone_start_pfn, unsigned long *zholes_size); |
| 970 | unsigned long *zholes_size); | ||
| 971 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | 1003 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP |
| 972 | /* | 1004 | /* |
| 973 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its | 1005 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 02a27ae78539..746f975b58ef 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -159,6 +159,17 @@ struct vm_area_struct { | |||
| 159 | #endif | 159 | #endif |
| 160 | }; | 160 | }; |
| 161 | 161 | ||
| 162 | struct core_thread { | ||
| 163 | struct task_struct *task; | ||
| 164 | struct core_thread *next; | ||
| 165 | }; | ||
| 166 | |||
| 167 | struct core_state { | ||
| 168 | atomic_t nr_threads; | ||
| 169 | struct core_thread dumper; | ||
| 170 | struct completion startup; | ||
| 171 | }; | ||
| 172 | |||
| 162 | struct mm_struct { | 173 | struct mm_struct { |
| 163 | struct vm_area_struct * mmap; /* list of VMAs */ | 174 | struct vm_area_struct * mmap; /* list of VMAs */ |
| 164 | struct rb_root mm_rb; | 175 | struct rb_root mm_rb; |
| @@ -175,7 +186,6 @@ struct mm_struct { | |||
| 175 | atomic_t mm_users; /* How many users with user space? */ | 186 | atomic_t mm_users; /* How many users with user space? */ |
| 176 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | 187 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ |
| 177 | int map_count; /* number of VMAs */ | 188 | int map_count; /* number of VMAs */ |
| 178 | int core_waiters; | ||
| 179 | struct rw_semaphore mmap_sem; | 189 | struct rw_semaphore mmap_sem; |
| 180 | spinlock_t page_table_lock; /* Protects page tables and some counters */ | 190 | spinlock_t page_table_lock; /* Protects page tables and some counters */ |
| 181 | 191 | ||
| @@ -219,8 +229,7 @@ struct mm_struct { | |||
| 219 | 229 | ||
| 220 | unsigned long flags; /* Must use atomic bitops to access the bits */ | 230 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
| 221 | 231 | ||
| 222 | /* coredumping support */ | 232 | struct core_state *core_state; /* coredumping support */ |
| 223 | struct completion *core_startup_done, core_done; | ||
| 224 | 233 | ||
| 225 | /* aio bits */ | 234 | /* aio bits */ |
| 226 | rwlock_t ioctx_list_lock; /* aio lock */ | 235 | rwlock_t ioctx_list_lock; /* aio lock */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 0d508ac17d64..ee6e822d5994 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -111,6 +111,8 @@ struct mmc_card { | |||
| 111 | unsigned num_info; /* number of info strings */ | 111 | unsigned num_info; /* number of info strings */ |
| 112 | const char **info; /* info strings */ | 112 | const char **info; /* info strings */ |
| 113 | struct sdio_func_tuple *tuples; /* unknown common tuples */ | 113 | struct sdio_func_tuple *tuples; /* unknown common tuples */ |
| 114 | |||
| 115 | struct dentry *debugfs_root; | ||
| 114 | }; | 116 | }; |
| 115 | 117 | ||
| 116 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) | 118 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 10a2080086ca..9c288c909878 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -157,6 +157,8 @@ struct mmc_host { | |||
| 157 | struct led_trigger *led; /* activity led */ | 157 | struct led_trigger *led; /* activity led */ |
| 158 | #endif | 158 | #endif |
| 159 | 159 | ||
| 160 | struct dentry *debugfs_root; | ||
| 161 | |||
| 160 | unsigned long private[0] ____cacheline_aligned; | 162 | unsigned long private[0] ____cacheline_aligned; |
| 161 | }; | 163 | }; |
| 162 | 164 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index fce15ebd0e1c..68e09557c951 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | /* Not Yet Implemented */ | 23 | /* Not Yet Implemented */ |
| 24 | #define MODULE_SUPPORTED_DEVICE(name) | 24 | #define MODULE_SUPPORTED_DEVICE(name) |
| 25 | 25 | ||
| 26 | /* v850 toolchain uses a `_' prefix for all user symbols */ | 26 | /* some toolchains uses a `_' prefix for all user symbols */ |
| 27 | #ifndef MODULE_SYMBOL_PREFIX | 27 | #ifndef MODULE_SYMBOL_PREFIX |
| 28 | #define MODULE_SYMBOL_PREFIX "" | 28 | #define MODULE_SYMBOL_PREFIX "" |
| 29 | #endif | 29 | #endif |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 4374d1adeb4b..b5efaa2132ab 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
| @@ -47,7 +47,7 @@ struct vfsmount { | |||
| 47 | struct list_head mnt_child; /* and going through their mnt_child */ | 47 | struct list_head mnt_child; /* and going through their mnt_child */ |
| 48 | int mnt_flags; | 48 | int mnt_flags; |
| 49 | /* 4 bytes hole on 64bits arches */ | 49 | /* 4 bytes hole on 64bits arches */ |
| 50 | char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ | 50 | const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ |
| 51 | struct list_head mnt_list; | 51 | struct list_head mnt_list; |
| 52 | struct list_head mnt_expire; /* link in fs-specific expiry list */ | 52 | struct list_head mnt_expire; /* link in fs-specific expiry list */ |
| 53 | struct list_head mnt_share; /* circular list of shared mounts */ | 53 | struct list_head mnt_share; /* circular list of shared mounts */ |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 81cd36b735b0..ba63858056c7 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
| @@ -2,11 +2,11 @@ | |||
| 2 | #define _LINUX_MSDOS_FS_H | 2 | #define _LINUX_MSDOS_FS_H |
| 3 | 3 | ||
| 4 | #include <linux/magic.h> | 4 | #include <linux/magic.h> |
| 5 | #include <asm/byteorder.h> | ||
| 5 | 6 | ||
| 6 | /* | 7 | /* |
| 7 | * The MS-DOS filesystem constants/structures | 8 | * The MS-DOS filesystem constants/structures |
| 8 | */ | 9 | */ |
| 9 | #include <asm/byteorder.h> | ||
| 10 | 10 | ||
| 11 | #define SECTOR_SIZE 512 /* sector size (bytes) */ | 11 | #define SECTOR_SIZE 512 /* sector size (bytes) */ |
| 12 | #define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */ | 12 | #define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */ |
| @@ -89,24 +89,22 @@ | |||
| 89 | #define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \ | 89 | #define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \ |
| 90 | && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2) | 90 | && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2) |
| 91 | 91 | ||
| 92 | struct __fat_dirent { | ||
| 93 | long d_ino; | ||
| 94 | __kernel_off_t d_off; | ||
| 95 | unsigned short d_reclen; | ||
| 96 | char d_name[256]; /* We must not include limits.h! */ | ||
| 97 | }; | ||
| 98 | |||
| 92 | /* | 99 | /* |
| 93 | * ioctl commands | 100 | * ioctl commands |
| 94 | */ | 101 | */ |
| 95 | #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) | 102 | #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct __fat_dirent[2]) |
| 96 | #define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct dirent [2]) | 103 | #define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct __fat_dirent[2]) |
| 97 | /* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */ | 104 | /* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */ |
| 98 | #define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32) | 105 | #define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32) |
| 99 | #define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32) | 106 | #define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32) |
| 100 | 107 | ||
| 101 | /* | ||
| 102 | * vfat shortname flags | ||
| 103 | */ | ||
| 104 | #define VFAT_SFN_DISPLAY_LOWER 0x0001 /* convert to lowercase for display */ | ||
| 105 | #define VFAT_SFN_DISPLAY_WIN95 0x0002 /* emulate win95 rule for display */ | ||
| 106 | #define VFAT_SFN_DISPLAY_WINNT 0x0004 /* emulate winnt rule for display */ | ||
| 107 | #define VFAT_SFN_CREATE_WIN95 0x0100 /* emulate win95 rule for create */ | ||
| 108 | #define VFAT_SFN_CREATE_WINNT 0x0200 /* emulate winnt rule for create */ | ||
| 109 | |||
| 110 | struct fat_boot_sector { | 108 | struct fat_boot_sector { |
| 111 | __u8 ignored[3]; /* Boot strap short or near jump */ | 109 | __u8 ignored[3]; /* Boot strap short or near jump */ |
| 112 | __u8 system_id[8]; /* Name - can be used to special case | 110 | __u8 system_id[8]; /* Name - can be used to special case |
| @@ -168,14 +166,6 @@ struct msdos_dir_slot { | |||
| 168 | __u8 name11_12[4]; /* last 2 characters in name */ | 166 | __u8 name11_12[4]; /* last 2 characters in name */ |
| 169 | }; | 167 | }; |
| 170 | 168 | ||
| 171 | struct fat_slot_info { | ||
| 172 | loff_t i_pos; /* on-disk position of directory entry */ | ||
| 173 | loff_t slot_off; /* offset for slot or de start */ | ||
| 174 | int nr_slots; /* number of slots + 1(de) in filename */ | ||
| 175 | struct msdos_dir_entry *de; | ||
| 176 | struct buffer_head *bh; | ||
| 177 | }; | ||
| 178 | |||
| 179 | #ifdef __KERNEL__ | 169 | #ifdef __KERNEL__ |
| 180 | 170 | ||
| 181 | #include <linux/buffer_head.h> | 171 | #include <linux/buffer_head.h> |
| @@ -184,6 +174,15 @@ struct fat_slot_info { | |||
| 184 | #include <linux/fs.h> | 174 | #include <linux/fs.h> |
| 185 | #include <linux/mutex.h> | 175 | #include <linux/mutex.h> |
| 186 | 176 | ||
| 177 | /* | ||
| 178 | * vfat shortname flags | ||
| 179 | */ | ||
| 180 | #define VFAT_SFN_DISPLAY_LOWER 0x0001 /* convert to lowercase for display */ | ||
| 181 | #define VFAT_SFN_DISPLAY_WIN95 0x0002 /* emulate win95 rule for display */ | ||
| 182 | #define VFAT_SFN_DISPLAY_WINNT 0x0004 /* emulate winnt rule for display */ | ||
| 183 | #define VFAT_SFN_CREATE_WIN95 0x0100 /* emulate win95 rule for create */ | ||
| 184 | #define VFAT_SFN_CREATE_WINNT 0x0200 /* emulate winnt rule for create */ | ||
| 185 | |||
| 187 | struct fat_mount_options { | 186 | struct fat_mount_options { |
| 188 | uid_t fs_uid; | 187 | uid_t fs_uid; |
| 189 | gid_t fs_gid; | 188 | gid_t fs_gid; |
| @@ -202,10 +201,10 @@ struct fat_mount_options { | |||
| 202 | utf8:1, /* Use of UTF-8 character set (Default) */ | 201 | utf8:1, /* Use of UTF-8 character set (Default) */ |
| 203 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ | 202 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ |
| 204 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ | 203 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ |
| 205 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ | ||
| 206 | flush:1, /* write things quickly */ | 204 | flush:1, /* write things quickly */ |
| 207 | nocase:1, /* Does this need case conversion? 0=need case conversion*/ | 205 | nocase:1, /* Does this need case conversion? 0=need case conversion*/ |
| 208 | usefree:1; /* Use free_clusters for FAT32 */ | 206 | usefree:1, /* Use free_clusters for FAT32 */ |
| 207 | tz_utc:1; /* Filesystem timestamps are in UTC */ | ||
| 209 | }; | 208 | }; |
| 210 | 209 | ||
| 211 | #define FAT_HASH_BITS 8 | 210 | #define FAT_HASH_BITS 8 |
| @@ -267,6 +266,14 @@ struct msdos_inode_info { | |||
| 267 | struct inode vfs_inode; | 266 | struct inode vfs_inode; |
| 268 | }; | 267 | }; |
| 269 | 268 | ||
| 269 | struct fat_slot_info { | ||
| 270 | loff_t i_pos; /* on-disk position of directory entry */ | ||
| 271 | loff_t slot_off; /* offset for slot or de start */ | ||
| 272 | int nr_slots; /* number of slots + 1(de) in filename */ | ||
| 273 | struct msdos_dir_entry *de; | ||
| 274 | struct buffer_head *bh; | ||
| 275 | }; | ||
| 276 | |||
| 270 | static inline struct msdos_sb_info *MSDOS_SB(struct super_block *sb) | 277 | static inline struct msdos_sb_info *MSDOS_SB(struct super_block *sb) |
| 271 | { | 278 | { |
| 272 | return sb->s_fs_info; | 279 | return sb->s_fs_info; |
| @@ -428,8 +435,9 @@ extern int fat_flush_inodes(struct super_block *sb, struct inode *i1, | |||
| 428 | extern void fat_fs_panic(struct super_block *s, const char *fmt, ...); | 435 | extern void fat_fs_panic(struct super_block *s, const char *fmt, ...); |
| 429 | extern void fat_clusters_flush(struct super_block *sb); | 436 | extern void fat_clusters_flush(struct super_block *sb); |
| 430 | extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster); | 437 | extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster); |
| 431 | extern int date_dos2unix(unsigned short time, unsigned short date); | 438 | extern int date_dos2unix(unsigned short time, unsigned short date, int tz_utc); |
| 432 | extern void fat_date_unix2dos(int unix_date, __le16 *time, __le16 *date); | 439 | extern void fat_date_unix2dos(int unix_date, __le16 *time, __le16 *date, |
| 440 | int tz_utc); | ||
| 433 | extern int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs); | 441 | extern int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs); |
| 434 | 442 | ||
| 435 | int fat_cache_init(void); | 443 | int fat_cache_init(void); |
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index 9a6e2f953cba..310e61606415 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: blktrans.h,v 1.6 2005/11/07 11:14:54 gleixner Exp $ | ||
| 3 | * | ||
| 4 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> | 2 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> |
| 5 | * | 3 | * |
| 6 | * Interface to Linux block layer for MTD 'translation layers'. | 4 | * Interface to Linux block layer for MTD 'translation layers'. |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index b0ddf4b25862..d6fb115f5a07 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | 1 | ||
| 2 | /* Common Flash Interface structures | 2 | /* Common Flash Interface structures |
| 3 | * See http://support.intel.com/design/flash/technote/index.htm | 3 | * See http://support.intel.com/design/flash/technote/index.htm |
| 4 | * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $ | ||
| 5 | */ | 4 | */ |
| 6 | 5 | ||
| 7 | #ifndef __MTD_CFI_H__ | 6 | #ifndef __MTD_CFI_H__ |
diff --git a/include/linux/mtd/cfi_endian.h b/include/linux/mtd/cfi_endian.h index 25724f7d3867..d802f7736be3 100644 --- a/include/linux/mtd/cfi_endian.h +++ b/include/linux/mtd/cfi_endian.h | |||
| @@ -1,8 +1,3 @@ | |||
| 1 | /* | ||
| 2 | * $Id: cfi_endian.h,v 1.11 2002/01/30 23:20:48 awozniak Exp $ | ||
| 3 | * | ||
| 4 | */ | ||
| 5 | |||
| 6 | #include <asm/byteorder.h> | 1 | #include <asm/byteorder.h> |
| 7 | 2 | ||
| 8 | #ifndef CONFIG_MTD_CFI_ADV_OPTIONS | 3 | #ifndef CONFIG_MTD_CFI_ADV_OPTIONS |
diff --git a/include/linux/mtd/concat.h b/include/linux/mtd/concat.h index ed8dc6755219..c02f3d264ecf 100644 --- a/include/linux/mtd/concat.h +++ b/include/linux/mtd/concat.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | * (C) 2002 Robert Kaiser <rkaiser@sysgo.de> | 4 | * (C) 2002 Robert Kaiser <rkaiser@sysgo.de> |
| 5 | * | 5 | * |
| 6 | * This code is GPL | 6 | * This code is GPL |
| 7 | * | ||
| 8 | * $Id: concat.h,v 1.1 2002/03/08 16:34:36 rkaiser Exp $ | ||
| 9 | */ | 7 | */ |
| 10 | 8 | ||
| 11 | #ifndef MTD_CONCAT_H | 9 | #ifndef MTD_CONCAT_H |
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h index 9addd073bf15..0a6d516ab71d 100644 --- a/include/linux/mtd/doc2000.h +++ b/include/linux/mtd/doc2000.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> | 6 | * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> |
| 7 | * Copyright (C) 2002-2003 SnapGear Inc | 7 | * Copyright (C) 2002-2003 SnapGear Inc |
| 8 | * | 8 | * |
| 9 | * $Id: doc2000.h,v 1.25 2005/11/07 11:14:54 gleixner Exp $ | ||
| 10 | * | ||
| 11 | * Released under GPL | 9 | * Released under GPL |
| 12 | */ | 10 | */ |
| 13 | 11 | ||
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index 39e7d2a1be9a..08dd131301c1 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h | |||
| @@ -5,9 +5,6 @@ | |||
| 5 | * Contains information about the location and state of a given flash device | 5 | * Contains information about the location and state of a given flash device |
| 6 | * | 6 | * |
| 7 | * (C) 2000 Red Hat. GPLd. | 7 | * (C) 2000 Red Hat. GPLd. |
| 8 | * | ||
| 9 | * $Id: flashchip.h,v 1.18 2005/11/07 11:14:54 gleixner Exp $ | ||
| 10 | * | ||
| 11 | */ | 8 | */ |
| 12 | 9 | ||
| 13 | #ifndef __MTD_FLASHCHIP_H__ | 10 | #ifndef __MTD_FLASHCHIP_H__ |
diff --git a/include/linux/mtd/ftl.h b/include/linux/mtd/ftl.h index d99609113307..0be442f881dd 100644 --- a/include/linux/mtd/ftl.h +++ b/include/linux/mtd/ftl.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: ftl.h,v 1.7 2005/11/07 11:14:54 gleixner Exp $ | ||
| 3 | * | ||
| 4 | * Derived from (and probably identical to): | 2 | * Derived from (and probably identical to): |
| 5 | * ftl.h 1.7 1999/10/25 20:23:17 | 3 | * ftl.h 1.7 1999/10/25 20:23:17 |
| 6 | * | 4 | * |
diff --git a/include/linux/mtd/gen_probe.h b/include/linux/mtd/gen_probe.h index 256e7342ed1e..df362ddf2949 100644 --- a/include/linux/mtd/gen_probe.h +++ b/include/linux/mtd/gen_probe.h | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * (C) 2001, 2001 Red Hat, Inc. | 2 | * (C) 2001, 2001 Red Hat, Inc. |
| 3 | * GPL'd | 3 | * GPL'd |
| 4 | * $Id: gen_probe.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $ | ||
| 5 | */ | 4 | */ |
| 6 | 5 | ||
| 7 | #ifndef __LINUX_MTD_GEN_PROBE_H__ | 6 | #ifndef __LINUX_MTD_GEN_PROBE_H__ |
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h index 85fd041d44ad..64ee53ce95a9 100644 --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/inftl.h | |||
| @@ -2,8 +2,6 @@ | |||
| 2 | * inftl.h -- defines to support the Inverse NAND Flash Translation Layer | 2 | * inftl.h -- defines to support the Inverse NAND Flash Translation Layer |
| 3 | * | 3 | * |
| 4 | * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) | 4 | * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) |
| 5 | * | ||
| 6 | * $Id: inftl.h,v 1.7 2005/06/13 13:08:45 sean Exp $ | ||
| 7 | */ | 5 | */ |
| 8 | 6 | ||
| 9 | #ifndef __MTD_INFTL_H__ | 7 | #ifndef __MTD_INFTL_H__ |
| @@ -52,8 +50,6 @@ struct INFTLrecord { | |||
| 52 | int INFTL_mount(struct INFTLrecord *s); | 50 | int INFTL_mount(struct INFTLrecord *s); |
| 53 | int INFTL_formatblock(struct INFTLrecord *s, int block); | 51 | int INFTL_formatblock(struct INFTLrecord *s, int block); |
| 54 | 52 | ||
| 55 | extern char inftlmountrev[]; | ||
| 56 | |||
| 57 | void INFTL_dumptables(struct INFTLrecord *s); | 53 | void INFTL_dumptables(struct INFTLrecord *s); |
| 58 | void INFTL_dumpVUchains(struct INFTLrecord *s); | 54 | void INFTL_dumpVUchains(struct INFTLrecord *s); |
| 59 | 55 | ||
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 9c1d95491f8b..aa30244492c6 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | 1 | ||
| 2 | /* Overhauled routines for dealing with different mmap regions of flash */ | 2 | /* Overhauled routines for dealing with different mmap regions of flash */ |
| 3 | /* $Id: map.h,v 1.54 2005/11/07 11:14:54 gleixner Exp $ */ | ||
| 4 | 3 | ||
| 5 | #ifndef __LINUX_MTD_MAP_H__ | 4 | #ifndef __LINUX_MTD_MAP_H__ |
| 6 | #define __LINUX_MTD_MAP_H__ | 5 | #define __LINUX_MTD_MAP_H__ |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 8b5d49133ec6..4ed40caff4e5 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: mtd.h,v 1.61 2005/11/07 11:14:54 gleixner Exp $ | ||
| 3 | * | ||
| 4 | * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. | 2 | * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. |
| 5 | * | 3 | * |
| 6 | * Released under GPL | 4 | * Released under GPL |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 53ea3dc8b0e8..83f678702dff 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -5,8 +5,6 @@ | |||
| 5 | * Steven J. Hill <sjhill@realitydiluted.com> | 5 | * Steven J. Hill <sjhill@realitydiluted.com> |
| 6 | * Thomas Gleixner <tglx@linutronix.de> | 6 | * Thomas Gleixner <tglx@linutronix.de> |
| 7 | * | 7 | * |
| 8 | * $Id: nand.h,v 1.74 2005/09/15 13:58:50 vwool Exp $ | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
| @@ -179,6 +177,7 @@ typedef enum { | |||
| 179 | #define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) | 177 | #define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) |
| 180 | #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) | 178 | #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) |
| 181 | #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) | 179 | #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) |
| 180 | #define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT)) | ||
| 182 | 181 | ||
| 183 | /* Mask to zero out the chip options, which come from the id table */ | 182 | /* Mask to zero out the chip options, which come from the id table */ |
| 184 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) | 183 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) |
| @@ -276,6 +275,10 @@ struct nand_ecc_ctrl { | |||
| 276 | int (*read_page)(struct mtd_info *mtd, | 275 | int (*read_page)(struct mtd_info *mtd, |
| 277 | struct nand_chip *chip, | 276 | struct nand_chip *chip, |
| 278 | uint8_t *buf); | 277 | uint8_t *buf); |
| 278 | int (*read_subpage)(struct mtd_info *mtd, | ||
| 279 | struct nand_chip *chip, | ||
| 280 | uint32_t offs, uint32_t len, | ||
| 281 | uint8_t *buf); | ||
| 279 | void (*write_page)(struct mtd_info *mtd, | 282 | void (*write_page)(struct mtd_info *mtd, |
| 280 | struct nand_chip *chip, | 283 | struct nand_chip *chip, |
| 281 | const uint8_t *buf); | 284 | const uint8_t *buf); |
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h index 12c5bc342ead..090da505425d 100644 --- a/include/linux/mtd/nand_ecc.h +++ b/include/linux/mtd/nand_ecc.h | |||
| @@ -3,8 +3,6 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) | 4 | * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) |
| 5 | * | 5 | * |
| 6 | * $Id: nand_ecc.h,v 1.4 2004/06/17 02:35:02 dbrown Exp $ | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h index 001eec50cac6..dcaf611ed748 100644 --- a/include/linux/mtd/nftl.h +++ b/include/linux/mtd/nftl.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: nftl.h,v 1.16 2004/06/30 14:49:00 dbrown Exp $ | ||
| 3 | * | ||
| 4 | * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> | 2 | * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> |
| 5 | */ | 3 | */ |
| 6 | 4 | ||
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 7c37d7e55abc..5014f7a9f5df 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | * (C) 2000 Nicolas Pitre <nico@cam.org> | 4 | * (C) 2000 Nicolas Pitre <nico@cam.org> |
| 5 | * | 5 | * |
| 6 | * This code is GPL | 6 | * This code is GPL |
| 7 | * | ||
| 8 | * $Id: partitions.h,v 1.17 2005/11/07 11:14:55 gleixner Exp $ | ||
| 9 | */ | 7 | */ |
| 10 | 8 | ||
| 11 | #ifndef MTD_PARTITIONS_H | 9 | #ifndef MTD_PARTITIONS_H |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index 0dc07d5f3354..c8e63a5ee72e 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
| @@ -2,8 +2,6 @@ | |||
| 2 | * For boards with physically mapped flash and using | 2 | * For boards with physically mapped flash and using |
| 3 | * drivers/mtd/maps/physmap.c mapping driver. | 3 | * drivers/mtd/maps/physmap.c mapping driver. |
| 4 | * | 4 | * |
| 5 | * $Id: physmap.h,v 1.4 2005/11/07 11:14:55 gleixner Exp $ | ||
| 6 | * | ||
| 7 | * Copyright (C) 2003 MontaVista Software Inc. | 5 | * Copyright (C) 2003 MontaVista Software Inc. |
| 8 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | 6 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net |
| 9 | * | 7 | * |
diff --git a/include/linux/mtd/plat-ram.h b/include/linux/mtd/plat-ram.h index 0e37ad07bce2..e07890aff1cf 100644 --- a/include/linux/mtd/plat-ram.h +++ b/include/linux/mtd/plat-ram.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | * | 6 | * |
| 7 | * Generic platform device based RAM map | 7 | * Generic platform device based RAM map |
| 8 | * | 8 | * |
| 9 | * $Id: plat-ram.h,v 1.2 2005/01/24 00:37:40 bjd Exp $ | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
| 13 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
diff --git a/include/linux/mtd/pmc551.h b/include/linux/mtd/pmc551.h index 5cc070c24d88..27ad40aed19f 100644 --- a/include/linux/mtd/pmc551.h +++ b/include/linux/mtd/pmc551.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $ | ||
| 3 | * | ||
| 4 | * PMC551 PCI Mezzanine Ram Device | 2 | * PMC551 PCI Mezzanine Ram Device |
| 5 | * | 3 | * |
| 6 | * Author: | 4 | * Author: |
| @@ -17,7 +15,7 @@ | |||
| 17 | 15 | ||
| 18 | #include <linux/mtd/mtd.h> | 16 | #include <linux/mtd/mtd.h> |
| 19 | 17 | ||
| 20 | #define PMC551_VERSION "$Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $\n"\ | 18 | #define PMC551_VERSION \ |
| 21 | "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" | 19 | "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" |
| 22 | 20 | ||
| 23 | /* | 21 | /* |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index f71201d0f3e7..6316fafe5c2a 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
| @@ -45,13 +45,13 @@ enum { | |||
| 45 | * @size: how many physical eraseblocks are reserved for this volume | 45 | * @size: how many physical eraseblocks are reserved for this volume |
| 46 | * @used_bytes: how many bytes of data this volume contains | 46 | * @used_bytes: how many bytes of data this volume contains |
| 47 | * @used_ebs: how many physical eraseblocks of this volume actually contain any | 47 | * @used_ebs: how many physical eraseblocks of this volume actually contain any |
| 48 | * data | 48 | * data |
| 49 | * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME) | 49 | * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME) |
| 50 | * @corrupted: non-zero if the volume is corrupted (static volumes only) | 50 | * @corrupted: non-zero if the volume is corrupted (static volumes only) |
| 51 | * @upd_marker: non-zero if the volume has update marker set | 51 | * @upd_marker: non-zero if the volume has update marker set |
| 52 | * @alignment: volume alignment | 52 | * @alignment: volume alignment |
| 53 | * @usable_leb_size: how many bytes are available in logical eraseblocks of | 53 | * @usable_leb_size: how many bytes are available in logical eraseblocks of |
| 54 | * this volume | 54 | * this volume |
| 55 | * @name_len: volume name length | 55 | * @name_len: volume name length |
| 56 | * @name: volume name | 56 | * @name: volume name |
| 57 | * @cdev: UBI volume character device major and minor numbers | 57 | * @cdev: UBI volume character device major and minor numbers |
| @@ -152,6 +152,7 @@ int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum); | |||
| 152 | int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); | 152 | int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); |
| 153 | int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype); | 153 | int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype); |
| 154 | int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); | 154 | int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); |
| 155 | int ubi_sync(int ubi_num); | ||
| 155 | 156 | ||
| 156 | /* | 157 | /* |
| 157 | * This function is the same as the 'ubi_leb_read()' function, but it does not | 158 | * This function is the same as the 'ubi_leb_read()' function, but it does not |
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h index e9d40bdde48c..36efcba15ecd 100644 --- a/include/linux/mtd/xip.h +++ b/include/linux/mtd/xip.h | |||
| @@ -11,8 +11,6 @@ | |||
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
| 13 | * published by the Free Software Foundation. | 13 | * published by the Free Software Foundation. |
| 14 | * | ||
| 15 | * $Id: xip.h,v 1.5 2005/11/07 11:14:55 gleixner Exp $ | ||
| 16 | */ | 14 | */ |
| 17 | 15 | ||
| 18 | #ifndef __LINUX_MTD_XIP_H__ | 16 | #ifndef __LINUX_MTD_XIP_H__ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 24d88e98a626..68f8c3203c89 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -47,27 +47,24 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
| 47 | #define LOOKUP_DIRECTORY 2 | 47 | #define LOOKUP_DIRECTORY 2 |
| 48 | #define LOOKUP_CONTINUE 4 | 48 | #define LOOKUP_CONTINUE 4 |
| 49 | #define LOOKUP_PARENT 16 | 49 | #define LOOKUP_PARENT 16 |
| 50 | #define LOOKUP_NOALT 32 | ||
| 51 | #define LOOKUP_REVAL 64 | 50 | #define LOOKUP_REVAL 64 |
| 52 | /* | 51 | /* |
| 53 | * Intent data | 52 | * Intent data |
| 54 | */ | 53 | */ |
| 55 | #define LOOKUP_OPEN (0x0100) | 54 | #define LOOKUP_OPEN (0x0100) |
| 56 | #define LOOKUP_CREATE (0x0200) | 55 | #define LOOKUP_CREATE (0x0200) |
| 57 | #define LOOKUP_ACCESS (0x0400) | 56 | |
| 58 | #define LOOKUP_CHDIR (0x0800) | 57 | extern int user_path_at(int, const char __user *, unsigned, struct path *); |
| 59 | 58 | ||
| 60 | extern int __user_walk(const char __user *, unsigned, struct nameidata *); | 59 | #define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) |
| 61 | extern int __user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *); | 60 | #define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) |
| 62 | #define user_path_walk(name,nd) \ | 61 | #define user_path_dir(name, path) \ |
| 63 | __user_walk_fd(AT_FDCWD, name, LOOKUP_FOLLOW, nd) | 62 | user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path) |
| 64 | #define user_path_walk_link(name,nd) \ | 63 | |
| 65 | __user_walk_fd(AT_FDCWD, name, 0, nd) | ||
| 66 | extern int path_lookup(const char *, unsigned, struct nameidata *); | 64 | extern int path_lookup(const char *, unsigned, struct nameidata *); |
| 67 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | 65 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, |
| 68 | const char *, unsigned int, struct nameidata *); | 66 | const char *, unsigned int, struct nameidata *); |
| 69 | 67 | ||
| 70 | extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags); | ||
| 71 | extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags); | 68 | extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags); |
| 72 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, | 69 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, |
| 73 | int (*open)(struct inode *, struct file *)); | 70 | int (*open)(struct inode *, struct file *)); |
diff --git a/include/linux/net.h b/include/linux/net.h index 150a48c68d52..4a9a30f2d68f 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <linux/wait.h> | 21 | #include <linux/wait.h> |
| 22 | #include <linux/socket.h> | 22 | #include <linux/socket.h> |
| 23 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | ||
| 23 | #include <asm/socket.h> | 24 | #include <asm/socket.h> |
| 24 | 25 | ||
| 25 | struct poll_table_struct; | 26 | struct poll_table_struct; |
| @@ -46,6 +47,7 @@ struct net; | |||
| 46 | #define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ | 47 | #define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ |
| 47 | #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ | 48 | #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ |
| 48 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ | 49 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ |
| 50 | #define SYS_PACCEPT 18 /* sys_paccept(2) */ | ||
| 49 | 51 | ||
| 50 | typedef enum { | 52 | typedef enum { |
| 51 | SS_FREE = 0, /* not allocated */ | 53 | SS_FREE = 0, /* not allocated */ |
| @@ -94,6 +96,15 @@ enum sock_type { | |||
| 94 | }; | 96 | }; |
| 95 | 97 | ||
| 96 | #define SOCK_MAX (SOCK_PACKET + 1) | 98 | #define SOCK_MAX (SOCK_PACKET + 1) |
| 99 | /* Mask which covers at least up to SOCK_MASK-1. The | ||
| 100 | * remaining bits are used as flags. */ | ||
| 101 | #define SOCK_TYPE_MASK 0xf | ||
| 102 | |||
| 103 | /* Flags for socket, socketpair, paccept */ | ||
| 104 | #define SOCK_CLOEXEC O_CLOEXEC | ||
| 105 | #ifndef SOCK_NONBLOCK | ||
| 106 | #define SOCK_NONBLOCK O_NONBLOCK | ||
| 107 | #endif | ||
| 97 | 108 | ||
| 98 | #endif /* ARCH_HAS_SOCKET_TYPES */ | 109 | #endif /* ARCH_HAS_SOCKET_TYPES */ |
| 99 | 110 | ||
| @@ -208,10 +219,12 @@ extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, | |||
| 208 | size_t len); | 219 | size_t len); |
| 209 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, | 220 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, |
| 210 | size_t size, int flags); | 221 | size_t size, int flags); |
| 211 | extern int sock_map_fd(struct socket *sock); | 222 | extern int sock_map_fd(struct socket *sock, int flags); |
| 212 | extern struct socket *sockfd_lookup(int fd, int *err); | 223 | extern struct socket *sockfd_lookup(int fd, int *err); |
| 213 | #define sockfd_put(sock) fput(sock->file) | 224 | #define sockfd_put(sock) fput(sock->file) |
| 214 | extern int net_ratelimit(void); | 225 | extern int net_ratelimit(void); |
| 226 | extern long do_accept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
| 227 | int __user *upeer_addrlen, int flags); | ||
| 215 | 228 | ||
| 216 | #define net_random() random32() | 229 | #define net_random() random32() |
| 217 | #define net_srandom(seed) srandom32((__force u32)seed) | 230 | #define net_srandom(seed) srandom32((__force u32)seed) |
| @@ -338,8 +351,7 @@ static const struct proto_ops name##_ops = { \ | |||
| 338 | 351 | ||
| 339 | #ifdef CONFIG_SYSCTL | 352 | #ifdef CONFIG_SYSCTL |
| 340 | #include <linux/sysctl.h> | 353 | #include <linux/sysctl.h> |
| 341 | extern int net_msg_cost; | 354 | extern struct ratelimit_state net_ratelimit_state; |
| 342 | extern int net_msg_burst; | ||
| 343 | #endif | 355 | #endif |
| 344 | 356 | ||
| 345 | #endif /* __KERNEL__ */ | 357 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 29d261918734..78a5922a2f11 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -42,7 +42,6 @@ | |||
| 42 | #include <linux/in.h> | 42 | #include <linux/in.h> |
| 43 | #include <linux/kref.h> | 43 | #include <linux/kref.h> |
| 44 | #include <linux/mm.h> | 44 | #include <linux/mm.h> |
| 45 | #include <linux/namei.h> | ||
| 46 | #include <linux/pagemap.h> | 45 | #include <linux/pagemap.h> |
| 47 | #include <linux/rbtree.h> | 46 | #include <linux/rbtree.h> |
| 48 | #include <linux/rwsem.h> | 47 | #include <linux/rwsem.h> |
| @@ -332,7 +331,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | |||
| 332 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | 331 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); |
| 333 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); | 332 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); |
| 334 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 333 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
| 335 | extern int nfs_permission(struct inode *, int, struct nameidata *); | 334 | extern int nfs_permission(struct inode *, int); |
| 336 | extern int nfs_open(struct inode *, struct file *); | 335 | extern int nfs_open(struct inode *, struct file *); |
| 337 | extern int nfs_release(struct inode *, struct file *); | 336 | extern int nfs_release(struct inode *, struct file *); |
| 338 | extern int nfs_attribute_timeout(struct inode *inode); | 337 | extern int nfs_attribute_timeout(struct inode *inode); |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index a2861d95ecc3..108f47e5fd95 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/unistd.h> | 14 | #include <linux/unistd.h> |
| 15 | #include <linux/dirent.h> | ||
| 16 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 17 | #include <linux/posix_acl.h> | 16 | #include <linux/posix_acl.h> |
| 18 | #include <linux/mount.h> | 17 | #include <linux/mount.h> |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index bd3d72ddf333..da2698b0fdd1 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
| @@ -214,6 +214,8 @@ static inline int notifier_to_errno(int ret) | |||
| 214 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | 214 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ |
| 215 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, | 215 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, |
| 216 | * not handling interrupts, soon dead */ | 216 | * not handling interrupts, soon dead */ |
| 217 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | ||
| 218 | * lock is dropped */ | ||
| 217 | 219 | ||
| 218 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend | 220 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend |
| 219 | * operation in progress | 221 | * operation in progress |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 0e66b57631fc..c8a768e59640 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
| @@ -82,9 +82,12 @@ static inline void get_nsproxy(struct nsproxy *ns) | |||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | #ifdef CONFIG_CGROUP_NS | 84 | #ifdef CONFIG_CGROUP_NS |
| 85 | int ns_cgroup_clone(struct task_struct *tsk); | 85 | int ns_cgroup_clone(struct task_struct *tsk, struct pid *pid); |
| 86 | #else | 86 | #else |
| 87 | static inline int ns_cgroup_clone(struct task_struct *tsk) { return 0; } | 87 | static inline int ns_cgroup_clone(struct task_struct *tsk, struct pid *pid) |
| 88 | { | ||
| 89 | return 0; | ||
| 90 | } | ||
| 88 | #endif | 91 | #endif |
| 89 | 92 | ||
| 90 | #endif | 93 | #endif |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 0d2a4e7012aa..54590a9a103e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -96,7 +96,22 @@ enum pageflags { | |||
| 96 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 96 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR |
| 97 | PG_uncached, /* Page has been mapped as uncached */ | 97 | PG_uncached, /* Page has been mapped as uncached */ |
| 98 | #endif | 98 | #endif |
| 99 | __NR_PAGEFLAGS | 99 | __NR_PAGEFLAGS, |
| 100 | |||
| 101 | /* Filesystems */ | ||
| 102 | PG_checked = PG_owner_priv_1, | ||
| 103 | |||
| 104 | /* XEN */ | ||
| 105 | PG_pinned = PG_owner_priv_1, | ||
| 106 | PG_savepinned = PG_dirty, | ||
| 107 | |||
| 108 | /* SLOB */ | ||
| 109 | PG_slob_page = PG_active, | ||
| 110 | PG_slob_free = PG_private, | ||
| 111 | |||
| 112 | /* SLUB */ | ||
| 113 | PG_slub_frozen = PG_active, | ||
| 114 | PG_slub_debug = PG_error, | ||
| 100 | }; | 115 | }; |
| 101 | 116 | ||
| 102 | #ifndef __GENERATING_BOUNDS_H | 117 | #ifndef __GENERATING_BOUNDS_H |
| @@ -155,13 +170,19 @@ PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | |||
| 155 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) | 170 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) |
| 156 | PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active) | 171 | PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active) |
| 157 | __PAGEFLAG(Slab, slab) | 172 | __PAGEFLAG(Slab, slab) |
| 158 | PAGEFLAG(Checked, owner_priv_1) /* Used by some filesystems */ | 173 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ |
| 159 | PAGEFLAG(Pinned, owner_priv_1) TESTSCFLAG(Pinned, owner_priv_1) /* Xen */ | 174 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ |
| 160 | PAGEFLAG(SavePinned, dirty); /* Xen */ | 175 | PAGEFLAG(SavePinned, savepinned); /* Xen */ |
| 161 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) | 176 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) |
| 162 | PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) | 177 | PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) |
| 163 | __SETPAGEFLAG(Private, private) | 178 | __SETPAGEFLAG(Private, private) |
| 164 | 179 | ||
| 180 | __PAGEFLAG(SlobPage, slob_page) | ||
| 181 | __PAGEFLAG(SlobFree, slob_free) | ||
| 182 | |||
| 183 | __PAGEFLAG(SlubFrozen, slub_frozen) | ||
| 184 | __PAGEFLAG(SlubDebug, slub_debug) | ||
| 185 | |||
| 165 | /* | 186 | /* |
| 166 | * Only test-and-set exist for PG_writeback. The unconditional operators are | 187 | * Only test-and-set exist for PG_writeback. The unconditional operators are |
| 167 | * risky: they bypass page accounting. | 188 | * risky: they bypass page accounting. |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index d2fca802f809..a81d81890422 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
| 13 | #include <linux/gfp.h> | 13 | #include <linux/gfp.h> |
| 14 | #include <linux/bitops.h> | 14 | #include <linux/bitops.h> |
| 15 | #include <linux/hardirq.h> /* for in_interrupt() */ | ||
| 15 | 16 | ||
| 16 | /* | 17 | /* |
| 17 | * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page | 18 | * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page |
| @@ -22,7 +23,7 @@ | |||
| 22 | 23 | ||
| 23 | static inline void mapping_set_error(struct address_space *mapping, int error) | 24 | static inline void mapping_set_error(struct address_space *mapping, int error) |
| 24 | { | 25 | { |
| 25 | if (error) { | 26 | if (unlikely(error)) { |
| 26 | if (error == -ENOSPC) | 27 | if (error == -ENOSPC) |
| 27 | set_bit(AS_ENOSPC, &mapping->flags); | 28 | set_bit(AS_ENOSPC, &mapping->flags); |
| 28 | else | 29 | else |
| @@ -62,6 +63,98 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) | |||
| 62 | #define page_cache_release(page) put_page(page) | 63 | #define page_cache_release(page) put_page(page) |
| 63 | void release_pages(struct page **pages, int nr, int cold); | 64 | void release_pages(struct page **pages, int nr, int cold); |
| 64 | 65 | ||
| 66 | /* | ||
| 67 | * speculatively take a reference to a page. | ||
| 68 | * If the page is free (_count == 0), then _count is untouched, and 0 | ||
| 69 | * is returned. Otherwise, _count is incremented by 1 and 1 is returned. | ||
| 70 | * | ||
| 71 | * This function must be called inside the same rcu_read_lock() section as has | ||
| 72 | * been used to lookup the page in the pagecache radix-tree (or page table): | ||
| 73 | * this allows allocators to use a synchronize_rcu() to stabilize _count. | ||
| 74 | * | ||
| 75 | * Unless an RCU grace period has passed, the count of all pages coming out | ||
| 76 | * of the allocator must be considered unstable. page_count may return higher | ||
| 77 | * than expected, and put_page must be able to do the right thing when the | ||
| 78 | * page has been finished with, no matter what it is subsequently allocated | ||
| 79 | * for (because put_page is what is used here to drop an invalid speculative | ||
| 80 | * reference). | ||
| 81 | * | ||
| 82 | * This is the interesting part of the lockless pagecache (and lockless | ||
| 83 | * get_user_pages) locking protocol, where the lookup-side (eg. find_get_page) | ||
| 84 | * has the following pattern: | ||
| 85 | * 1. find page in radix tree | ||
| 86 | * 2. conditionally increment refcount | ||
| 87 | * 3. check the page is still in pagecache (if no, goto 1) | ||
| 88 | * | ||
| 89 | * Remove-side that cares about stability of _count (eg. reclaim) has the | ||
| 90 | * following (with tree_lock held for write): | ||
| 91 | * A. atomically check refcount is correct and set it to 0 (atomic_cmpxchg) | ||
| 92 | * B. remove page from pagecache | ||
| 93 | * C. free the page | ||
| 94 | * | ||
| 95 | * There are 2 critical interleavings that matter: | ||
| 96 | * - 2 runs before A: in this case, A sees elevated refcount and bails out | ||
| 97 | * - A runs before 2: in this case, 2 sees zero refcount and retries; | ||
| 98 | * subsequently, B will complete and 1 will find no page, causing the | ||
| 99 | * lookup to return NULL. | ||
| 100 | * | ||
| 101 | * It is possible that between 1 and 2, the page is removed then the exact same | ||
| 102 | * page is inserted into the same position in pagecache. That's OK: the | ||
| 103 | * old find_get_page using tree_lock could equally have run before or after | ||
| 104 | * such a re-insertion, depending on order that locks are granted. | ||
| 105 | * | ||
| 106 | * Lookups racing against pagecache insertion isn't a big problem: either 1 | ||
| 107 | * will find the page or it will not. Likewise, the old find_get_page could run | ||
| 108 | * either before the insertion or afterwards, depending on timing. | ||
| 109 | */ | ||
| 110 | static inline int page_cache_get_speculative(struct page *page) | ||
| 111 | { | ||
| 112 | VM_BUG_ON(in_interrupt()); | ||
| 113 | |||
| 114 | #if !defined(CONFIG_SMP) && defined(CONFIG_CLASSIC_RCU) | ||
| 115 | # ifdef CONFIG_PREEMPT | ||
| 116 | VM_BUG_ON(!in_atomic()); | ||
| 117 | # endif | ||
| 118 | /* | ||
| 119 | * Preempt must be disabled here - we rely on rcu_read_lock doing | ||
| 120 | * this for us. | ||
| 121 | * | ||
| 122 | * Pagecache won't be truncated from interrupt context, so if we have | ||
| 123 | * found a page in the radix tree here, we have pinned its refcount by | ||
| 124 | * disabling preempt, and hence no need for the "speculative get" that | ||
| 125 | * SMP requires. | ||
| 126 | */ | ||
| 127 | VM_BUG_ON(page_count(page) == 0); | ||
| 128 | atomic_inc(&page->_count); | ||
| 129 | |||
| 130 | #else | ||
| 131 | if (unlikely(!get_page_unless_zero(page))) { | ||
| 132 | /* | ||
| 133 | * Either the page has been freed, or will be freed. | ||
| 134 | * In either case, retry here and the caller should | ||
| 135 | * do the right thing (see comments above). | ||
| 136 | */ | ||
| 137 | return 0; | ||
| 138 | } | ||
| 139 | #endif | ||
| 140 | VM_BUG_ON(PageTail(page)); | ||
| 141 | |||
| 142 | return 1; | ||
| 143 | } | ||
| 144 | |||
| 145 | static inline int page_freeze_refs(struct page *page, int count) | ||
| 146 | { | ||
| 147 | return likely(atomic_cmpxchg(&page->_count, count, 0) == count); | ||
| 148 | } | ||
| 149 | |||
| 150 | static inline void page_unfreeze_refs(struct page *page, int count) | ||
| 151 | { | ||
| 152 | VM_BUG_ON(page_count(page) != 0); | ||
| 153 | VM_BUG_ON(count == 0); | ||
| 154 | |||
| 155 | atomic_set(&page->_count, count); | ||
| 156 | } | ||
| 157 | |||
| 65 | #ifdef CONFIG_NUMA | 158 | #ifdef CONFIG_NUMA |
| 66 | extern struct page *__page_cache_alloc(gfp_t gfp); | 159 | extern struct page *__page_cache_alloc(gfp_t gfp); |
| 67 | #else | 160 | #else |
| @@ -133,7 +226,7 @@ static inline struct page *read_mapping_page(struct address_space *mapping, | |||
| 133 | return read_cache_page(mapping, index, filler, data); | 226 | return read_cache_page(mapping, index, filler, data); |
| 134 | } | 227 | } |
| 135 | 228 | ||
| 136 | int add_to_page_cache(struct page *page, struct address_space *mapping, | 229 | int add_to_page_cache_locked(struct page *page, struct address_space *mapping, |
| 137 | pgoff_t index, gfp_t gfp_mask); | 230 | pgoff_t index, gfp_t gfp_mask); |
| 138 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | 231 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, |
| 139 | pgoff_t index, gfp_t gfp_mask); | 232 | pgoff_t index, gfp_t gfp_mask); |
| @@ -141,6 +234,22 @@ extern void remove_from_page_cache(struct page *page); | |||
| 141 | extern void __remove_from_page_cache(struct page *page); | 234 | extern void __remove_from_page_cache(struct page *page); |
| 142 | 235 | ||
| 143 | /* | 236 | /* |
| 237 | * Like add_to_page_cache_locked, but used to add newly allocated pages: | ||
| 238 | * the page is new, so we can just run SetPageLocked() against it. | ||
| 239 | */ | ||
| 240 | static inline int add_to_page_cache(struct page *page, | ||
| 241 | struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) | ||
| 242 | { | ||
| 243 | int error; | ||
| 244 | |||
| 245 | SetPageLocked(page); | ||
| 246 | error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); | ||
| 247 | if (unlikely(error)) | ||
| 248 | ClearPageLocked(page); | ||
| 249 | return error; | ||
| 250 | } | ||
| 251 | |||
| 252 | /* | ||
| 144 | * Return byte-offset into filesystem object for page. | 253 | * Return byte-offset into filesystem object for page. |
| 145 | */ | 254 | */ |
| 146 | static inline loff_t page_offset(struct page *page) | 255 | static inline loff_t page_offset(struct page *page) |
diff --git a/include/linux/parport.h b/include/linux/parport.h index dcb9e01a69ca..6a0d7cdb5774 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h | |||
| @@ -560,5 +560,8 @@ extern int parport_device_proc_unregister(struct pardevice *device); | |||
| 560 | 560 | ||
| 561 | #endif /* !CONFIG_PARPORT_NOT_PC */ | 561 | #endif /* !CONFIG_PARPORT_NOT_PC */ |
| 562 | 562 | ||
| 563 | extern unsigned long parport_default_timeslice; | ||
| 564 | extern int parport_default_spintime; | ||
| 565 | |||
| 563 | #endif /* __KERNEL__ */ | 566 | #endif /* __KERNEL__ */ |
| 564 | #endif /* _PARPORT_H_ */ | 567 | #endif /* _PARPORT_H_ */ |
diff --git a/include/linux/parser.h b/include/linux/parser.h index 7dcd05075756..cc554ca8bc78 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
| @@ -14,7 +14,7 @@ struct match_token { | |||
| 14 | const char *pattern; | 14 | const char *pattern; |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | typedef struct match_token match_table_t[]; | 17 | typedef const struct match_token match_table_t[]; |
| 18 | 18 | ||
| 19 | /* Maximum number of arguments that match_token will find in a pattern */ | 19 | /* Maximum number of arguments that match_token will find in a pattern */ |
| 20 | enum {MAX_OPT_ARGS = 3}; | 20 | enum {MAX_OPT_ARGS = 3}; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index a6a088e1a804..1d296d31abe0 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -638,7 +638,9 @@ int pci_save_state(struct pci_dev *dev); | |||
| 638 | int pci_restore_state(struct pci_dev *dev); | 638 | int pci_restore_state(struct pci_dev *dev); |
| 639 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 639 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
| 640 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 640 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| 641 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | ||
| 641 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); | 642 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); |
| 643 | pci_power_t pci_target_state(struct pci_dev *dev); | ||
| 642 | int pci_prepare_to_sleep(struct pci_dev *dev); | 644 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| 643 | int pci_back_from_sleep(struct pci_dev *dev); | 645 | int pci_back_from_sleep(struct pci_dev *dev); |
| 644 | 646 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 119ae7b8f028..ffe479ba0779 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -1832,7 +1832,13 @@ | |||
| 1832 | #define PCI_DEVICE_ID_MOXA_C320 0x3200 | 1832 | #define PCI_DEVICE_ID_MOXA_C320 0x3200 |
| 1833 | 1833 | ||
| 1834 | #define PCI_VENDOR_ID_CCD 0x1397 | 1834 | #define PCI_VENDOR_ID_CCD 0x1397 |
| 1835 | #define PCI_DEVICE_ID_CCD_HFC4S 0x08B4 | ||
| 1836 | #define PCI_SUBDEVICE_ID_CCD_PMX2S 0x1234 | ||
| 1837 | #define PCI_DEVICE_ID_CCD_HFC8S 0x16B8 | ||
| 1835 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 | 1838 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 |
| 1839 | #define PCI_DEVICE_ID_CCD_HFCE1 0x30B1 | ||
| 1840 | #define PCI_SUBDEVICE_ID_CCD_SPD4S 0x3136 | ||
| 1841 | #define PCI_SUBDEVICE_ID_CCD_SPDE1 0x3137 | ||
| 1836 | #define PCI_DEVICE_ID_CCD_B000 0xb000 | 1842 | #define PCI_DEVICE_ID_CCD_B000 0xb000 |
| 1837 | #define PCI_DEVICE_ID_CCD_B006 0xb006 | 1843 | #define PCI_DEVICE_ID_CCD_B006 0xb006 |
| 1838 | #define PCI_DEVICE_ID_CCD_B007 0xb007 | 1844 | #define PCI_DEVICE_ID_CCD_B007 0xb007 |
| @@ -1842,8 +1848,32 @@ | |||
| 1842 | #define PCI_DEVICE_ID_CCD_B00B 0xb00b | 1848 | #define PCI_DEVICE_ID_CCD_B00B 0xb00b |
| 1843 | #define PCI_DEVICE_ID_CCD_B00C 0xb00c | 1849 | #define PCI_DEVICE_ID_CCD_B00C 0xb00c |
| 1844 | #define PCI_DEVICE_ID_CCD_B100 0xb100 | 1850 | #define PCI_DEVICE_ID_CCD_B100 0xb100 |
| 1851 | #define PCI_SUBDEVICE_ID_CCD_IOB4ST 0xB520 | ||
| 1852 | #define PCI_SUBDEVICE_ID_CCD_IOB8STR 0xB521 | ||
| 1853 | #define PCI_SUBDEVICE_ID_CCD_IOB8ST 0xB522 | ||
| 1854 | #define PCI_SUBDEVICE_ID_CCD_IOB1E1 0xB523 | ||
| 1855 | #define PCI_SUBDEVICE_ID_CCD_SWYX4S 0xB540 | ||
| 1856 | #define PCI_SUBDEVICE_ID_CCD_JH4S20 0xB550 | ||
| 1857 | #define PCI_SUBDEVICE_ID_CCD_IOB8ST_1 0xB552 | ||
| 1858 | #define PCI_SUBDEVICE_ID_CCD_BN4S 0xB560 | ||
| 1859 | #define PCI_SUBDEVICE_ID_CCD_BN8S 0xB562 | ||
| 1860 | #define PCI_SUBDEVICE_ID_CCD_BNE1 0xB563 | ||
| 1861 | #define PCI_SUBDEVICE_ID_CCD_BNE1D 0xB564 | ||
| 1862 | #define PCI_SUBDEVICE_ID_CCD_BNE1DP 0xB565 | ||
| 1863 | #define PCI_SUBDEVICE_ID_CCD_BN2S 0xB566 | ||
| 1864 | #define PCI_SUBDEVICE_ID_CCD_BN1SM 0xB567 | ||
| 1865 | #define PCI_SUBDEVICE_ID_CCD_BN4SM 0xB568 | ||
| 1866 | #define PCI_SUBDEVICE_ID_CCD_BN2SM 0xB569 | ||
| 1867 | #define PCI_SUBDEVICE_ID_CCD_BNE1M 0xB56A | ||
| 1868 | #define PCI_SUBDEVICE_ID_CCD_BN8SP 0xB56B | ||
| 1869 | #define PCI_SUBDEVICE_ID_CCD_HFC4S 0xB620 | ||
| 1870 | #define PCI_SUBDEVICE_ID_CCD_HFC8S 0xB622 | ||
| 1845 | #define PCI_DEVICE_ID_CCD_B700 0xb700 | 1871 | #define PCI_DEVICE_ID_CCD_B700 0xb700 |
| 1846 | #define PCI_DEVICE_ID_CCD_B701 0xb701 | 1872 | #define PCI_DEVICE_ID_CCD_B701 0xb701 |
| 1873 | #define PCI_SUBDEVICE_ID_CCD_HFCE1 0xC523 | ||
| 1874 | #define PCI_SUBDEVICE_ID_CCD_OV2S 0xE884 | ||
| 1875 | #define PCI_SUBDEVICE_ID_CCD_OV4S 0xE888 | ||
| 1876 | #define PCI_SUBDEVICE_ID_CCD_OV8S 0xE998 | ||
| 1847 | 1877 | ||
| 1848 | #define PCI_VENDOR_ID_EXAR 0x13a8 | 1878 | #define PCI_VENDOR_ID_EXAR 0x13a8 |
| 1849 | #define PCI_DEVICE_ID_EXAR_XR17C152 0x0152 | 1879 | #define PCI_DEVICE_ID_EXAR_XR17C152 0x0152 |
| @@ -2400,6 +2430,9 @@ | |||
| 2400 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 | 2430 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 |
| 2401 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 | 2431 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 |
| 2402 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2432 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
| 2433 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | ||
| 2434 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | ||
| 2435 | #define PCI_DEVICE_ID_INTEL_5100_22 0x65f6 | ||
| 2403 | #define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030 | 2436 | #define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030 |
| 2404 | #define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035 | 2437 | #define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035 |
| 2405 | #define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036 | 2438 | #define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036 |
| @@ -2520,6 +2553,9 @@ | |||
| 2520 | 2553 | ||
| 2521 | #define PCI_VENDOR_ID_3COM_2 0xa727 | 2554 | #define PCI_VENDOR_ID_3COM_2 0xa727 |
| 2522 | 2555 | ||
| 2556 | #define PCI_VENDOR_ID_DIGIUM 0xd161 | ||
| 2557 | #define PCI_DEVICE_ID_DIGIUM_HFC4S 0xb410 | ||
| 2558 | |||
| 2523 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d | 2559 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d |
| 2524 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 | 2560 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 |
| 2525 | #define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 | 2561 | #define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 4cdd393e71e1..fac3337547eb 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -74,11 +74,6 @@ struct percpu_data { | |||
| 74 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ | 74 | (__typeof__(ptr))__p->ptrs[(cpu)]; \ |
| 75 | }) | 75 | }) |
| 76 | 76 | ||
| 77 | extern void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu); | ||
| 78 | extern void percpu_depopulate(void *__pdata, int cpu); | ||
| 79 | extern int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, | ||
| 80 | cpumask_t *mask); | ||
| 81 | extern void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask); | ||
| 82 | extern void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask); | 77 | extern void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask); |
| 83 | extern void percpu_free(void *__pdata); | 78 | extern void percpu_free(void *__pdata); |
| 84 | 79 | ||
| @@ -86,26 +81,6 @@ extern void percpu_free(void *__pdata); | |||
| 86 | 81 | ||
| 87 | #define percpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) | 82 | #define percpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) |
| 88 | 83 | ||
| 89 | static inline void percpu_depopulate(void *__pdata, int cpu) | ||
| 90 | { | ||
| 91 | } | ||
| 92 | |||
| 93 | static inline void __percpu_depopulate_mask(void *__pdata, cpumask_t *mask) | ||
| 94 | { | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, | ||
| 98 | int cpu) | ||
| 99 | { | ||
| 100 | return percpu_ptr(__pdata, cpu); | ||
| 101 | } | ||
| 102 | |||
| 103 | static inline int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, | ||
| 104 | cpumask_t *mask) | ||
| 105 | { | ||
| 106 | return 0; | ||
| 107 | } | ||
| 108 | |||
| 109 | static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) | 84 | static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) |
| 110 | { | 85 | { |
| 111 | return kzalloc(size, gfp); | 86 | return kzalloc(size, gfp); |
| @@ -118,10 +93,6 @@ static inline void percpu_free(void *__pdata) | |||
| 118 | 93 | ||
| 119 | #endif /* CONFIG_SMP */ | 94 | #endif /* CONFIG_SMP */ |
| 120 | 95 | ||
| 121 | #define percpu_populate_mask(__pdata, size, gfp, mask) \ | ||
| 122 | __percpu_populate_mask((__pdata), (size), (gfp), &(mask)) | ||
| 123 | #define percpu_depopulate_mask(__pdata, mask) \ | ||
| 124 | __percpu_depopulate_mask((__pdata), &(mask)) | ||
| 125 | #define percpu_alloc_mask(size, gfp, mask) \ | 96 | #define percpu_alloc_mask(size, gfp, mask) \ |
| 126 | __percpu_alloc_mask((size), (gfp), &(mask)) | 97 | __percpu_alloc_mask((size), (gfp), &(mask)) |
| 127 | 98 | ||
diff --git a/include/linux/pid.h b/include/linux/pid.h index c21c7e8124a7..22921ac4cfd9 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
| @@ -48,7 +48,7 @@ enum pid_type | |||
| 48 | */ | 48 | */ |
| 49 | 49 | ||
| 50 | struct upid { | 50 | struct upid { |
| 51 | /* Try to keep pid_chain in the same cacheline as nr for find_pid */ | 51 | /* Try to keep pid_chain in the same cacheline as nr for find_vpid */ |
| 52 | int nr; | 52 | int nr; |
| 53 | struct pid_namespace *ns; | 53 | struct pid_namespace *ns; |
| 54 | struct hlist_node pid_chain; | 54 | struct hlist_node pid_chain; |
| @@ -57,10 +57,10 @@ struct upid { | |||
| 57 | struct pid | 57 | struct pid |
| 58 | { | 58 | { |
| 59 | atomic_t count; | 59 | atomic_t count; |
| 60 | unsigned int level; | ||
| 60 | /* lists of tasks that use this pid */ | 61 | /* lists of tasks that use this pid */ |
| 61 | struct hlist_head tasks[PIDTYPE_MAX]; | 62 | struct hlist_head tasks[PIDTYPE_MAX]; |
| 62 | struct rcu_head rcu; | 63 | struct rcu_head rcu; |
| 63 | unsigned int level; | ||
| 64 | struct upid numbers[1]; | 64 | struct upid numbers[1]; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| @@ -105,14 +105,12 @@ extern struct pid_namespace init_pid_ns; | |||
| 105 | * or rcu_read_lock() held. | 105 | * or rcu_read_lock() held. |
| 106 | * | 106 | * |
| 107 | * find_pid_ns() finds the pid in the namespace specified | 107 | * find_pid_ns() finds the pid in the namespace specified |
| 108 | * find_pid() find the pid by its global id, i.e. in the init namespace | ||
| 109 | * find_vpid() finr the pid by its virtual id, i.e. in the current namespace | 108 | * find_vpid() finr the pid by its virtual id, i.e. in the current namespace |
| 110 | * | 109 | * |
| 111 | * see also find_task_by_pid() set in include/linux/sched.h | 110 | * see also find_task_by_vpid() set in include/linux/sched.h |
| 112 | */ | 111 | */ |
| 113 | extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns); | 112 | extern struct pid *find_pid_ns(int nr, struct pid_namespace *ns); |
| 114 | extern struct pid *find_vpid(int nr); | 113 | extern struct pid *find_vpid(int nr); |
| 115 | extern struct pid *find_pid(int nr); | ||
| 116 | 114 | ||
| 117 | /* | 115 | /* |
| 118 | * Lookup a PID in the hash table, and return with it's count elevated. | 116 | * Lookup a PID in the hash table, and return with it's count elevated. |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index caff5283d15c..1af82c4e17d4 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
| @@ -14,6 +14,8 @@ struct pidmap { | |||
| 14 | 14 | ||
| 15 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) | 15 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) |
| 16 | 16 | ||
| 17 | struct bsd_acct_struct; | ||
| 18 | |||
| 17 | struct pid_namespace { | 19 | struct pid_namespace { |
| 18 | struct kref kref; | 20 | struct kref kref; |
| 19 | struct pidmap pidmap[PIDMAP_ENTRIES]; | 21 | struct pidmap pidmap[PIDMAP_ENTRIES]; |
| @@ -25,6 +27,9 @@ struct pid_namespace { | |||
| 25 | #ifdef CONFIG_PROC_FS | 27 | #ifdef CONFIG_PROC_FS |
| 26 | struct vfsmount *proc_mnt; | 28 | struct vfsmount *proc_mnt; |
| 27 | #endif | 29 | #endif |
| 30 | #ifdef CONFIG_BSD_PROCESS_ACCT | ||
| 31 | struct bsd_acct_struct *bacct; | ||
| 32 | #endif | ||
| 28 | }; | 33 | }; |
| 29 | 34 | ||
| 30 | extern struct pid_namespace init_pid_ns; | 35 | extern struct pid_namespace init_pid_ns; |
| @@ -85,4 +90,7 @@ static inline struct task_struct *task_child_reaper(struct task_struct *tsk) | |||
| 85 | return tsk->nsproxy->pid_ns->child_reaper; | 90 | return tsk->nsproxy->pid_ns->child_reaper; |
| 86 | } | 91 | } |
| 87 | 92 | ||
| 93 | void pidhash_init(void); | ||
| 94 | void pidmap_init(void); | ||
| 95 | |||
| 88 | #endif /* _LINUX_PID_NS_H */ | 96 | #endif /* _LINUX_PID_NS_H */ |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 4ad9de94449a..4dcce54b6d76 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -22,78 +22,6 @@ | |||
| 22 | #define _LINUX_PM_H | 22 | #define _LINUX_PM_H |
| 23 | 23 | ||
| 24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
| 25 | #include <asm/atomic.h> | ||
| 26 | #include <asm/errno.h> | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Power management requests... these are passed to pm_send_all() and friends. | ||
| 30 | * | ||
| 31 | * these functions are old and deprecated, see below. | ||
| 32 | */ | ||
| 33 | typedef int __bitwise pm_request_t; | ||
| 34 | |||
| 35 | #define PM_SUSPEND ((__force pm_request_t) 1) /* enter D1-D3 */ | ||
| 36 | #define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */ | ||
| 37 | |||
| 38 | |||
| 39 | /* | ||
| 40 | * Device types... these are passed to pm_register | ||
| 41 | */ | ||
| 42 | typedef int __bitwise pm_dev_t; | ||
| 43 | |||
| 44 | #define PM_UNKNOWN_DEV ((__force pm_dev_t) 0) /* generic */ | ||
| 45 | #define PM_SYS_DEV ((__force pm_dev_t) 1) /* system device (fan, KB controller, ...) */ | ||
| 46 | #define PM_PCI_DEV ((__force pm_dev_t) 2) /* PCI device */ | ||
| 47 | #define PM_USB_DEV ((__force pm_dev_t) 3) /* USB device */ | ||
| 48 | #define PM_SCSI_DEV ((__force pm_dev_t) 4) /* SCSI device */ | ||
| 49 | #define PM_ISA_DEV ((__force pm_dev_t) 5) /* ISA device */ | ||
| 50 | #define PM_MTD_DEV ((__force pm_dev_t) 6) /* Memory Technology Device */ | ||
| 51 | |||
| 52 | /* | ||
| 53 | * System device hardware ID (PnP) values | ||
| 54 | */ | ||
| 55 | enum | ||
| 56 | { | ||
| 57 | PM_SYS_UNKNOWN = 0x00000000, /* generic */ | ||
| 58 | PM_SYS_KBC = 0x41d00303, /* keyboard controller */ | ||
| 59 | PM_SYS_COM = 0x41d00500, /* serial port */ | ||
| 60 | PM_SYS_IRDA = 0x41d00510, /* IRDA controller */ | ||
| 61 | PM_SYS_FDC = 0x41d00700, /* floppy controller */ | ||
| 62 | PM_SYS_VGA = 0x41d00900, /* VGA controller */ | ||
| 63 | PM_SYS_PCMCIA = 0x41d00e00, /* PCMCIA controller */ | ||
| 64 | }; | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Device identifier | ||
| 68 | */ | ||
| 69 | #define PM_PCI_ID(dev) ((dev)->bus->number << 16 | (dev)->devfn) | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Request handler callback | ||
| 73 | */ | ||
| 74 | struct pm_dev; | ||
| 75 | |||
| 76 | typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data); | ||
| 77 | |||
| 78 | /* | ||
| 79 | * Dynamic device information | ||
| 80 | */ | ||
| 81 | struct pm_dev | ||
| 82 | { | ||
| 83 | pm_dev_t type; | ||
| 84 | unsigned long id; | ||
| 85 | pm_callback callback; | ||
| 86 | void *data; | ||
| 87 | |||
| 88 | unsigned long flags; | ||
| 89 | unsigned long state; | ||
| 90 | unsigned long prev_state; | ||
| 91 | |||
| 92 | struct list_head entry; | ||
| 93 | }; | ||
| 94 | |||
| 95 | /* Functions above this comment are list-based old-style power | ||
| 96 | * management. Please avoid using them. */ | ||
| 97 | 25 | ||
| 98 | /* | 26 | /* |
| 99 | * Callbacks for platform drivers to implement. | 27 | * Callbacks for platform drivers to implement. |
| @@ -317,6 +245,21 @@ struct pm_ext_ops { | |||
| 317 | * RECOVER Creation of a hibernation image or restoration of the main | 245 | * RECOVER Creation of a hibernation image or restoration of the main |
| 318 | * memory contents from a hibernation image has failed, call | 246 | * memory contents from a hibernation image has failed, call |
| 319 | * ->thaw() and ->complete() for all devices. | 247 | * ->thaw() and ->complete() for all devices. |
| 248 | * | ||
| 249 | * The following PM_EVENT_ messages are defined for internal use by | ||
| 250 | * kernel subsystems. They are never issued by the PM core. | ||
| 251 | * | ||
| 252 | * USER_SUSPEND Manual selective suspend was issued by userspace. | ||
| 253 | * | ||
| 254 | * USER_RESUME Manual selective resume was issued by userspace. | ||
| 255 | * | ||
| 256 | * REMOTE_WAKEUP Remote-wakeup request was received from the device. | ||
| 257 | * | ||
| 258 | * AUTO_SUSPEND Automatic (device idle) runtime suspend was | ||
| 259 | * initiated by the subsystem. | ||
| 260 | * | ||
| 261 | * AUTO_RESUME Automatic (device needed) runtime resume was | ||
| 262 | * requested by a driver. | ||
| 320 | */ | 263 | */ |
| 321 | 264 | ||
| 322 | #define PM_EVENT_ON 0x0000 | 265 | #define PM_EVENT_ON 0x0000 |
| @@ -328,9 +271,18 @@ struct pm_ext_ops { | |||
| 328 | #define PM_EVENT_THAW 0x0020 | 271 | #define PM_EVENT_THAW 0x0020 |
| 329 | #define PM_EVENT_RESTORE 0x0040 | 272 | #define PM_EVENT_RESTORE 0x0040 |
| 330 | #define PM_EVENT_RECOVER 0x0080 | 273 | #define PM_EVENT_RECOVER 0x0080 |
| 274 | #define PM_EVENT_USER 0x0100 | ||
| 275 | #define PM_EVENT_REMOTE 0x0200 | ||
| 276 | #define PM_EVENT_AUTO 0x0400 | ||
| 331 | 277 | ||
| 332 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) | 278 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) |
| 279 | #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) | ||
| 280 | #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME) | ||
| 281 | #define PM_EVENT_REMOTE_WAKEUP (PM_EVENT_REMOTE | PM_EVENT_RESUME) | ||
| 282 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) | ||
| 283 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) | ||
| 333 | 284 | ||
| 285 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | ||
| 334 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) | 286 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) |
| 335 | #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) | 287 | #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) |
| 336 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) | 288 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) |
| @@ -339,7 +291,16 @@ struct pm_ext_ops { | |||
| 339 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) | 291 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) |
| 340 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) | 292 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) |
| 341 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) | 293 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) |
| 342 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | 294 | #define PMSG_USER_SUSPEND ((struct pm_messge) \ |
| 295 | { .event = PM_EVENT_USER_SUSPEND, }) | ||
| 296 | #define PMSG_USER_RESUME ((struct pm_messge) \ | ||
| 297 | { .event = PM_EVENT_USER_RESUME, }) | ||
| 298 | #define PMSG_REMOTE_RESUME ((struct pm_messge) \ | ||
| 299 | { .event = PM_EVENT_REMOTE_RESUME, }) | ||
| 300 | #define PMSG_AUTO_SUSPEND ((struct pm_messge) \ | ||
| 301 | { .event = PM_EVENT_AUTO_SUSPEND, }) | ||
| 302 | #define PMSG_AUTO_RESUME ((struct pm_messge) \ | ||
| 303 | { .event = PM_EVENT_AUTO_RESUME, }) | ||
| 343 | 304 | ||
| 344 | /** | 305 | /** |
| 345 | * Device power management states | 306 | * Device power management states |
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h deleted file mode 100644 index 446f4f42b952..000000000000 --- a/include/linux/pm_legacy.h +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | #ifndef __LINUX_PM_LEGACY_H__ | ||
| 2 | #define __LINUX_PM_LEGACY_H__ | ||
| 3 | |||
| 4 | |||
| 5 | #ifdef CONFIG_PM_LEGACY | ||
| 6 | |||
| 7 | /* | ||
| 8 | * Register a device with power management | ||
| 9 | */ | ||
| 10 | struct pm_dev __deprecated * | ||
| 11 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); | ||
| 12 | |||
| 13 | /* | ||
| 14 | * Send a request to all devices | ||
| 15 | */ | ||
| 16 | int __deprecated pm_send_all(pm_request_t rqst, void *data); | ||
| 17 | |||
| 18 | #else /* CONFIG_PM_LEGACY */ | ||
| 19 | |||
| 20 | static inline struct pm_dev *pm_register(pm_dev_t type, | ||
| 21 | unsigned long id, | ||
| 22 | pm_callback callback) | ||
| 23 | { | ||
| 24 | return NULL; | ||
| 25 | } | ||
| 26 | |||
| 27 | static inline int pm_send_all(pm_request_t rqst, void *data) | ||
| 28 | { | ||
| 29 | return 0; | ||
| 30 | } | ||
| 31 | |||
| 32 | #endif /* CONFIG_PM_LEGACY */ | ||
| 33 | |||
| 34 | #endif /* __LINUX_PM_LEGACY_H__ */ | ||
| 35 | |||
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 15a9eaf4a802..fb61850d1cfc 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -79,6 +79,7 @@ struct proc_dir_entry { | |||
| 79 | int pde_users; /* number of callers into module in progress */ | 79 | int pde_users; /* number of callers into module in progress */ |
| 80 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | 80 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ |
| 81 | struct completion *pde_unload_completion; | 81 | struct completion *pde_unload_completion; |
| 82 | struct list_head pde_openers; /* who did ->open, but not ->release */ | ||
| 82 | }; | 83 | }; |
| 83 | 84 | ||
| 84 | struct kcore_list { | 85 | struct kcore_list { |
| @@ -138,7 +139,6 @@ extern int proc_readdir(struct file *, void *, filldir_t); | |||
| 138 | extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); | 139 | extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); |
| 139 | 140 | ||
| 140 | extern const struct file_operations proc_kcore_operations; | 141 | extern const struct file_operations proc_kcore_operations; |
| 141 | extern const struct file_operations proc_kmsg_operations; | ||
| 142 | extern const struct file_operations ppc_htab_operations; | 142 | extern const struct file_operations ppc_htab_operations; |
| 143 | 143 | ||
| 144 | extern int pid_ns_prepare_proc(struct pid_namespace *ns); | 144 | extern int pid_ns_prepare_proc(struct pid_namespace *ns); |
| @@ -282,11 +282,16 @@ union proc_op { | |||
| 282 | struct task_struct *task); | 282 | struct task_struct *task); |
| 283 | }; | 283 | }; |
| 284 | 284 | ||
| 285 | struct ctl_table_header; | ||
| 286 | struct ctl_table; | ||
| 287 | |||
| 285 | struct proc_inode { | 288 | struct proc_inode { |
| 286 | struct pid *pid; | 289 | struct pid *pid; |
| 287 | int fd; | 290 | int fd; |
| 288 | union proc_op op; | 291 | union proc_op op; |
| 289 | struct proc_dir_entry *pde; | 292 | struct proc_dir_entry *pde; |
| 293 | struct ctl_table_header *sysctl; | ||
| 294 | struct ctl_table *sysctl_entry; | ||
| 290 | struct inode vfs_inode; | 295 | struct inode vfs_inode; |
| 291 | }; | 296 | }; |
| 292 | 297 | ||
diff --git a/include/linux/profile.h b/include/linux/profile.h index 05c1cc736937..7e7087239af5 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
| @@ -8,8 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #include <asm/errno.h> | 9 | #include <asm/errno.h> |
| 10 | 10 | ||
| 11 | extern int prof_on __read_mostly; | ||
| 12 | |||
| 13 | #define CPU_PROFILING 1 | 11 | #define CPU_PROFILING 1 |
| 14 | #define SCHED_PROFILING 2 | 12 | #define SCHED_PROFILING 2 |
| 15 | #define SLEEP_PROFILING 3 | 13 | #define SLEEP_PROFILING 3 |
| @@ -19,14 +17,31 @@ struct proc_dir_entry; | |||
| 19 | struct pt_regs; | 17 | struct pt_regs; |
| 20 | struct notifier_block; | 18 | struct notifier_block; |
| 21 | 19 | ||
| 20 | #if defined(CONFIG_PROFILING) && defined(CONFIG_PROC_FS) | ||
| 21 | void create_prof_cpu_mask(struct proc_dir_entry *de); | ||
| 22 | #else | ||
| 23 | static inline void create_prof_cpu_mask(struct proc_dir_entry *de) | ||
| 24 | { | ||
| 25 | } | ||
| 26 | #endif | ||
| 27 | |||
| 28 | enum profile_type { | ||
| 29 | PROFILE_TASK_EXIT, | ||
| 30 | PROFILE_MUNMAP | ||
| 31 | }; | ||
| 32 | |||
| 33 | #ifdef CONFIG_PROFILING | ||
| 34 | |||
| 35 | extern int prof_on __read_mostly; | ||
| 36 | |||
| 22 | /* init basic kernel profiler */ | 37 | /* init basic kernel profiler */ |
| 23 | void __init profile_init(void); | 38 | void __init profile_init(void); |
| 24 | void profile_tick(int); | 39 | void profile_tick(int type); |
| 25 | 40 | ||
| 26 | /* | 41 | /* |
| 27 | * Add multiple profiler hits to a given address: | 42 | * Add multiple profiler hits to a given address: |
| 28 | */ | 43 | */ |
| 29 | void profile_hits(int, void *ip, unsigned int nr_hits); | 44 | void profile_hits(int type, void *ip, unsigned int nr_hits); |
| 30 | 45 | ||
| 31 | /* | 46 | /* |
| 32 | * Single profiler hit: | 47 | * Single profiler hit: |
| @@ -40,19 +55,6 @@ static inline void profile_hit(int type, void *ip) | |||
| 40 | profile_hits(type, ip, 1); | 55 | profile_hits(type, ip, 1); |
| 41 | } | 56 | } |
| 42 | 57 | ||
| 43 | #ifdef CONFIG_PROC_FS | ||
| 44 | void create_prof_cpu_mask(struct proc_dir_entry *); | ||
| 45 | #else | ||
| 46 | #define create_prof_cpu_mask(x) do { (void)(x); } while (0) | ||
| 47 | #endif | ||
| 48 | |||
| 49 | enum profile_type { | ||
| 50 | PROFILE_TASK_EXIT, | ||
| 51 | PROFILE_MUNMAP | ||
| 52 | }; | ||
| 53 | |||
| 54 | #ifdef CONFIG_PROFILING | ||
| 55 | |||
| 56 | struct task_struct; | 58 | struct task_struct; |
| 57 | struct mm_struct; | 59 | struct mm_struct; |
| 58 | 60 | ||
| @@ -80,6 +82,28 @@ struct pt_regs; | |||
| 80 | 82 | ||
| 81 | #else | 83 | #else |
| 82 | 84 | ||
| 85 | #define prof_on 0 | ||
| 86 | |||
| 87 | static inline void profile_init(void) | ||
| 88 | { | ||
| 89 | return; | ||
| 90 | } | ||
| 91 | |||
| 92 | static inline void profile_tick(int type) | ||
| 93 | { | ||
| 94 | return; | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline void profile_hits(int type, void *ip, unsigned int nr_hits) | ||
| 98 | { | ||
| 99 | return; | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline void profile_hit(int type, void *ip) | ||
| 103 | { | ||
| 104 | return; | ||
| 105 | } | ||
| 106 | |||
| 83 | static inline int task_handoff_register(struct notifier_block * n) | 107 | static inline int task_handoff_register(struct notifier_block * n) |
| 84 | { | 108 | { |
| 85 | return -ENOSYS; | 109 | return -ENOSYS; |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index c6f5f9dd0cee..fd31756e1a00 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
| @@ -121,6 +121,74 @@ static inline void ptrace_unlink(struct task_struct *child) | |||
| 121 | int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data); | 121 | int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data); |
| 122 | int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data); | 122 | int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data); |
| 123 | 123 | ||
| 124 | /** | ||
| 125 | * task_ptrace - return %PT_* flags that apply to a task | ||
| 126 | * @task: pointer to &task_struct in question | ||
| 127 | * | ||
| 128 | * Returns the %PT_* flags that apply to @task. | ||
| 129 | */ | ||
| 130 | static inline int task_ptrace(struct task_struct *task) | ||
| 131 | { | ||
| 132 | return task->ptrace; | ||
| 133 | } | ||
| 134 | |||
| 135 | /** | ||
| 136 | * ptrace_event - possibly stop for a ptrace event notification | ||
| 137 | * @mask: %PT_* bit to check in @current->ptrace | ||
| 138 | * @event: %PTRACE_EVENT_* value to report if @mask is set | ||
| 139 | * @message: value for %PTRACE_GETEVENTMSG to return | ||
| 140 | * | ||
| 141 | * This checks the @mask bit to see if ptrace wants stops for this event. | ||
| 142 | * If so we stop, reporting @event and @message to the ptrace parent. | ||
| 143 | * | ||
| 144 | * Returns nonzero if we did a ptrace notification, zero if not. | ||
| 145 | * | ||
| 146 | * Called without locks. | ||
| 147 | */ | ||
| 148 | static inline int ptrace_event(int mask, int event, unsigned long message) | ||
| 149 | { | ||
| 150 | if (mask && likely(!(current->ptrace & mask))) | ||
| 151 | return 0; | ||
| 152 | current->ptrace_message = message; | ||
| 153 | ptrace_notify((event << 8) | SIGTRAP); | ||
| 154 | return 1; | ||
| 155 | } | ||
| 156 | |||
| 157 | /** | ||
| 158 | * ptrace_init_task - initialize ptrace state for a new child | ||
| 159 | * @child: new child task | ||
| 160 | * @ptrace: true if child should be ptrace'd by parent's tracer | ||
| 161 | * | ||
| 162 | * This is called immediately after adding @child to its parent's children | ||
| 163 | * list. @ptrace is false in the normal case, and true to ptrace @child. | ||
| 164 | * | ||
| 165 | * Called with current's siglock and write_lock_irq(&tasklist_lock) held. | ||
| 166 | */ | ||
| 167 | static inline void ptrace_init_task(struct task_struct *child, bool ptrace) | ||
| 168 | { | ||
| 169 | INIT_LIST_HEAD(&child->ptrace_entry); | ||
| 170 | INIT_LIST_HEAD(&child->ptraced); | ||
| 171 | child->parent = child->real_parent; | ||
| 172 | child->ptrace = 0; | ||
| 173 | if (unlikely(ptrace)) { | ||
| 174 | child->ptrace = current->ptrace; | ||
| 175 | __ptrace_link(child, current->parent); | ||
| 176 | } | ||
| 177 | } | ||
| 178 | |||
| 179 | /** | ||
| 180 | * ptrace_release_task - final ptrace-related cleanup of a zombie being reaped | ||
| 181 | * @task: task in %EXIT_DEAD state | ||
| 182 | * | ||
| 183 | * Called with write_lock(&tasklist_lock) held. | ||
| 184 | */ | ||
| 185 | static inline void ptrace_release_task(struct task_struct *task) | ||
| 186 | { | ||
| 187 | BUG_ON(!list_empty(&task->ptraced)); | ||
| 188 | ptrace_unlink(task); | ||
| 189 | BUG_ON(!list_empty(&task->ptrace_entry)); | ||
| 190 | } | ||
| 191 | |||
| 124 | #ifndef force_successful_syscall_return | 192 | #ifndef force_successful_syscall_return |
| 125 | /* | 193 | /* |
| 126 | * System call handlers that, upon successful completion, need to return a | 194 | * System call handlers that, upon successful completion, need to return a |
| @@ -246,6 +314,10 @@ static inline void user_enable_block_step(struct task_struct *task) | |||
| 246 | #define arch_ptrace_stop(code, info) do { } while (0) | 314 | #define arch_ptrace_stop(code, info) do { } while (0) |
| 247 | #endif | 315 | #endif |
| 248 | 316 | ||
| 317 | extern int task_current_syscall(struct task_struct *target, long *callno, | ||
| 318 | unsigned long args[6], unsigned int maxargs, | ||
| 319 | unsigned long *sp, unsigned long *pc); | ||
| 320 | |||
| 249 | #endif | 321 | #endif |
| 250 | 322 | ||
| 251 | #endif | 323 | #endif |
diff --git a/include/linux/quota.h b/include/linux/quota.h index dcddfb200947..376a05048bc5 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -41,9 +41,6 @@ | |||
| 41 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 41 | #define __DQUOT_VERSION__ "dquot_6.5.1" |
| 42 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | 42 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 |
| 43 | 43 | ||
| 44 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | ||
| 45 | typedef __u64 qsize_t; /* Type in which we store sizes */ | ||
| 46 | |||
| 47 | /* Size of blocks in which are counted size limits */ | 44 | /* Size of blocks in which are counted size limits */ |
| 48 | #define QUOTABLOCK_BITS 10 | 45 | #define QUOTABLOCK_BITS 10 |
| 49 | #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) | 46 | #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) |
| @@ -138,6 +135,10 @@ struct if_dqinfo { | |||
| 138 | #define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */ | 135 | #define QUOTA_NL_BHARDWARN 4 /* Block hardlimit reached */ |
| 139 | #define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */ | 136 | #define QUOTA_NL_BSOFTLONGWARN 5 /* Block grace time expired */ |
| 140 | #define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */ | 137 | #define QUOTA_NL_BSOFTWARN 6 /* Block softlimit reached */ |
| 138 | #define QUOTA_NL_IHARDBELOW 7 /* Usage got below inode hardlimit */ | ||
| 139 | #define QUOTA_NL_ISOFTBELOW 8 /* Usage got below inode softlimit */ | ||
| 140 | #define QUOTA_NL_BHARDBELOW 9 /* Usage got below block hardlimit */ | ||
| 141 | #define QUOTA_NL_BSOFTBELOW 10 /* Usage got below block softlimit */ | ||
| 141 | 142 | ||
| 142 | enum { | 143 | enum { |
| 143 | QUOTA_NL_C_UNSPEC, | 144 | QUOTA_NL_C_UNSPEC, |
| @@ -172,6 +173,9 @@ enum { | |||
| 172 | 173 | ||
| 173 | #include <asm/atomic.h> | 174 | #include <asm/atomic.h> |
| 174 | 175 | ||
| 176 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | ||
| 177 | typedef __u64 qsize_t; /* Type in which we store sizes */ | ||
| 178 | |||
| 175 | extern spinlock_t dq_data_lock; | 179 | extern spinlock_t dq_data_lock; |
| 176 | 180 | ||
| 177 | /* Maximal numbers of writes for quota operation (insert/delete/update) | 181 | /* Maximal numbers of writes for quota operation (insert/delete/update) |
| @@ -223,12 +227,10 @@ struct super_block; | |||
| 223 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ | 227 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ |
| 224 | 228 | ||
| 225 | extern void mark_info_dirty(struct super_block *sb, int type); | 229 | extern void mark_info_dirty(struct super_block *sb, int type); |
| 226 | #define info_dirty(info) test_bit(DQF_INFO_DIRTY_B, &(info)->dqi_flags) | 230 | static inline int info_dirty(struct mem_dqinfo *info) |
| 227 | #define info_any_dquot_dirty(info) (!list_empty(&(info)->dqi_dirty_list)) | 231 | { |
| 228 | #define info_any_dirty(info) (info_dirty(info) || info_any_dquot_dirty(info)) | 232 | return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags); |
| 229 | 233 | } | |
| 230 | #define sb_dqopt(sb) (&(sb)->s_dquot) | ||
| 231 | #define sb_dqinfo(sb, type) (sb_dqopt(sb)->info+(type)) | ||
| 232 | 234 | ||
| 233 | struct dqstats { | 235 | struct dqstats { |
| 234 | int lookups; | 236 | int lookups; |
| @@ -337,19 +339,6 @@ struct quota_info { | |||
| 337 | struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ | 339 | struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ |
| 338 | }; | 340 | }; |
| 339 | 341 | ||
| 340 | #define sb_has_quota_enabled(sb, type) ((type)==USRQUOTA ? \ | ||
| 341 | (sb_dqopt(sb)->flags & DQUOT_USR_ENABLED) : (sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED)) | ||
| 342 | |||
| 343 | #define sb_any_quota_enabled(sb) (sb_has_quota_enabled(sb, USRQUOTA) | \ | ||
| 344 | sb_has_quota_enabled(sb, GRPQUOTA)) | ||
| 345 | |||
| 346 | #define sb_has_quota_suspended(sb, type) \ | ||
| 347 | ((type) == USRQUOTA ? (sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED) : \ | ||
| 348 | (sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED)) | ||
| 349 | |||
| 350 | #define sb_any_quota_suspended(sb) (sb_has_quota_suspended(sb, USRQUOTA) | \ | ||
| 351 | sb_has_quota_suspended(sb, GRPQUOTA)) | ||
| 352 | |||
| 353 | int register_quota_format(struct quota_format_type *fmt); | 342 | int register_quota_format(struct quota_format_type *fmt); |
| 354 | void unregister_quota_format(struct quota_format_type *fmt); | 343 | void unregister_quota_format(struct quota_format_type *fmt); |
| 355 | 344 | ||
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index f86702053853..742187f7a05c 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -11,42 +11,85 @@ | |||
| 11 | #define _LINUX_QUOTAOPS_ | 11 | #define _LINUX_QUOTAOPS_ |
| 12 | 12 | ||
| 13 | #include <linux/smp_lock.h> | 13 | #include <linux/smp_lock.h> |
| 14 | |||
| 15 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
| 16 | 15 | ||
| 16 | static inline struct quota_info *sb_dqopt(struct super_block *sb) | ||
| 17 | { | ||
| 18 | return &sb->s_dquot; | ||
| 19 | } | ||
| 20 | |||
| 17 | #if defined(CONFIG_QUOTA) | 21 | #if defined(CONFIG_QUOTA) |
| 18 | 22 | ||
| 19 | /* | 23 | /* |
| 20 | * declaration of quota_function calls in kernel. | 24 | * declaration of quota_function calls in kernel. |
| 21 | */ | 25 | */ |
| 22 | extern void sync_dquots(struct super_block *sb, int type); | 26 | void sync_dquots(struct super_block *sb, int type); |
| 23 | 27 | ||
| 24 | extern int dquot_initialize(struct inode *inode, int type); | 28 | int dquot_initialize(struct inode *inode, int type); |
| 25 | extern int dquot_drop(struct inode *inode); | 29 | int dquot_drop(struct inode *inode); |
| 26 | 30 | ||
| 27 | extern int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); | 31 | int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); |
| 28 | extern int dquot_alloc_inode(const struct inode *inode, unsigned long number); | 32 | int dquot_alloc_inode(const struct inode *inode, unsigned long number); |
| 29 | 33 | ||
| 30 | extern int dquot_free_space(struct inode *inode, qsize_t number); | 34 | int dquot_free_space(struct inode *inode, qsize_t number); |
| 31 | extern int dquot_free_inode(const struct inode *inode, unsigned long number); | 35 | int dquot_free_inode(const struct inode *inode, unsigned long number); |
| 32 | 36 | ||
| 33 | extern int dquot_transfer(struct inode *inode, struct iattr *iattr); | 37 | int dquot_transfer(struct inode *inode, struct iattr *iattr); |
| 34 | extern int dquot_commit(struct dquot *dquot); | 38 | int dquot_commit(struct dquot *dquot); |
| 35 | extern int dquot_acquire(struct dquot *dquot); | 39 | int dquot_acquire(struct dquot *dquot); |
| 36 | extern int dquot_release(struct dquot *dquot); | 40 | int dquot_release(struct dquot *dquot); |
| 37 | extern int dquot_commit_info(struct super_block *sb, int type); | 41 | int dquot_commit_info(struct super_block *sb, int type); |
| 38 | extern int dquot_mark_dquot_dirty(struct dquot *dquot); | 42 | int dquot_mark_dquot_dirty(struct dquot *dquot); |
| 39 | 43 | ||
| 40 | extern int vfs_quota_on(struct super_block *sb, int type, int format_id, | 44 | int vfs_quota_on(struct super_block *sb, int type, int format_id, |
| 41 | char *path, int remount); | 45 | char *path, int remount); |
| 42 | extern int vfs_quota_on_mount(struct super_block *sb, char *qf_name, | 46 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, |
| 43 | int format_id, int type); | 47 | int format_id, int type); |
| 44 | extern int vfs_quota_off(struct super_block *sb, int type, int remount); | 48 | int vfs_quota_off(struct super_block *sb, int type, int remount); |
| 45 | extern int vfs_quota_sync(struct super_block *sb, int type); | 49 | int vfs_quota_sync(struct super_block *sb, int type); |
| 46 | extern int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 50 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
| 47 | extern int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 51 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
| 48 | extern int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); | 52 | int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); |
| 49 | extern int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); | 53 | int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); |
| 54 | |||
| 55 | void vfs_dq_drop(struct inode *inode); | ||
| 56 | int vfs_dq_transfer(struct inode *inode, struct iattr *iattr); | ||
| 57 | int vfs_dq_quota_on_remount(struct super_block *sb); | ||
| 58 | |||
| 59 | static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) | ||
| 60 | { | ||
| 61 | return sb_dqopt(sb)->info + type; | ||
| 62 | } | ||
| 63 | |||
| 64 | /* | ||
| 65 | * Functions for checking status of quota | ||
| 66 | */ | ||
| 67 | |||
| 68 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | ||
| 69 | { | ||
| 70 | if (type == USRQUOTA) | ||
| 71 | return sb_dqopt(sb)->flags & DQUOT_USR_ENABLED; | ||
| 72 | return sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED; | ||
| 73 | } | ||
| 74 | |||
| 75 | static inline int sb_any_quota_enabled(struct super_block *sb) | ||
| 76 | { | ||
| 77 | return sb_has_quota_enabled(sb, USRQUOTA) || | ||
| 78 | sb_has_quota_enabled(sb, GRPQUOTA); | ||
| 79 | } | ||
| 80 | |||
| 81 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) | ||
| 82 | { | ||
| 83 | if (type == USRQUOTA) | ||
| 84 | return sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED; | ||
| 85 | return sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED; | ||
| 86 | } | ||
| 87 | |||
| 88 | static inline int sb_any_quota_suspended(struct super_block *sb) | ||
| 89 | { | ||
| 90 | return sb_has_quota_suspended(sb, USRQUOTA) || | ||
| 91 | sb_has_quota_suspended(sb, GRPQUOTA); | ||
| 92 | } | ||
| 50 | 93 | ||
| 51 | /* | 94 | /* |
| 52 | * Operations supported for diskquotas. | 95 | * Operations supported for diskquotas. |
| @@ -59,38 +102,16 @@ extern struct quotactl_ops vfs_quotactl_ops; | |||
| 59 | 102 | ||
| 60 | /* It is better to call this function outside of any transaction as it might | 103 | /* It is better to call this function outside of any transaction as it might |
| 61 | * need a lot of space in journal for dquot structure allocation. */ | 104 | * need a lot of space in journal for dquot structure allocation. */ |
| 62 | static inline void DQUOT_INIT(struct inode *inode) | 105 | static inline void vfs_dq_init(struct inode *inode) |
| 63 | { | 106 | { |
| 64 | BUG_ON(!inode->i_sb); | 107 | BUG_ON(!inode->i_sb); |
| 65 | if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) | 108 | if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) |
| 66 | inode->i_sb->dq_op->initialize(inode, -1); | 109 | inode->i_sb->dq_op->initialize(inode, -1); |
| 67 | } | 110 | } |
| 68 | 111 | ||
| 69 | /* The same as with DQUOT_INIT */ | ||
| 70 | static inline void DQUOT_DROP(struct inode *inode) | ||
| 71 | { | ||
| 72 | /* Here we can get arbitrary inode from clear_inode() so we have | ||
| 73 | * to be careful. OTOH we don't need locking as quota operations | ||
| 74 | * are allowed to change only at mount time */ | ||
| 75 | if (!IS_NOQUOTA(inode) && inode->i_sb && inode->i_sb->dq_op | ||
| 76 | && inode->i_sb->dq_op->drop) { | ||
| 77 | int cnt; | ||
| 78 | /* Test before calling to rule out calls from proc and such | ||
| 79 | * where we are not allowed to block. Note that this is | ||
| 80 | * actually reliable test even without the lock - the caller | ||
| 81 | * must assure that nobody can come after the DQUOT_DROP and | ||
| 82 | * add quota pointers back anyway */ | ||
| 83 | for (cnt = 0; cnt < MAXQUOTAS; cnt++) | ||
| 84 | if (inode->i_dquot[cnt] != NODQUOT) | ||
| 85 | break; | ||
| 86 | if (cnt < MAXQUOTAS) | ||
| 87 | inode->i_sb->dq_op->drop(inode); | ||
| 88 | } | ||
| 89 | } | ||
| 90 | |||
| 91 | /* The following allocation/freeing/transfer functions *must* be called inside | 112 | /* The following allocation/freeing/transfer functions *must* be called inside |
| 92 | * a transaction (deadlocks possible otherwise) */ | 113 | * a transaction (deadlocks possible otherwise) */ |
| 93 | static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 114 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) |
| 94 | { | 115 | { |
| 95 | if (sb_any_quota_enabled(inode->i_sb)) { | 116 | if (sb_any_quota_enabled(inode->i_sb)) { |
| 96 | /* Used space is updated in alloc_space() */ | 117 | /* Used space is updated in alloc_space() */ |
| @@ -102,15 +123,15 @@ static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | |||
| 102 | return 0; | 123 | return 0; |
| 103 | } | 124 | } |
| 104 | 125 | ||
| 105 | static inline int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr) | 126 | static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr) |
| 106 | { | 127 | { |
| 107 | int ret; | 128 | int ret; |
| 108 | if (!(ret = DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr))) | 129 | if (!(ret = vfs_dq_prealloc_space_nodirty(inode, nr))) |
| 109 | mark_inode_dirty(inode); | 130 | mark_inode_dirty(inode); |
| 110 | return ret; | 131 | return ret; |
| 111 | } | 132 | } |
| 112 | 133 | ||
| 113 | static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 134 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) |
| 114 | { | 135 | { |
| 115 | if (sb_any_quota_enabled(inode->i_sb)) { | 136 | if (sb_any_quota_enabled(inode->i_sb)) { |
| 116 | /* Used space is updated in alloc_space() */ | 137 | /* Used space is updated in alloc_space() */ |
| @@ -122,25 +143,25 @@ static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | |||
| 122 | return 0; | 143 | return 0; |
| 123 | } | 144 | } |
| 124 | 145 | ||
| 125 | static inline int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr) | 146 | static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr) |
| 126 | { | 147 | { |
| 127 | int ret; | 148 | int ret; |
| 128 | if (!(ret = DQUOT_ALLOC_SPACE_NODIRTY(inode, nr))) | 149 | if (!(ret = vfs_dq_alloc_space_nodirty(inode, nr))) |
| 129 | mark_inode_dirty(inode); | 150 | mark_inode_dirty(inode); |
| 130 | return ret; | 151 | return ret; |
| 131 | } | 152 | } |
| 132 | 153 | ||
| 133 | static inline int DQUOT_ALLOC_INODE(struct inode *inode) | 154 | static inline int vfs_dq_alloc_inode(struct inode *inode) |
| 134 | { | 155 | { |
| 135 | if (sb_any_quota_enabled(inode->i_sb)) { | 156 | if (sb_any_quota_enabled(inode->i_sb)) { |
| 136 | DQUOT_INIT(inode); | 157 | vfs_dq_init(inode); |
| 137 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) | 158 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) |
| 138 | return 1; | 159 | return 1; |
| 139 | } | 160 | } |
| 140 | return 0; | 161 | return 0; |
| 141 | } | 162 | } |
| 142 | 163 | ||
| 143 | static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 164 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) |
| 144 | { | 165 | { |
| 145 | if (sb_any_quota_enabled(inode->i_sb)) | 166 | if (sb_any_quota_enabled(inode->i_sb)) |
| 146 | inode->i_sb->dq_op->free_space(inode, nr); | 167 | inode->i_sb->dq_op->free_space(inode, nr); |
| @@ -148,35 +169,25 @@ static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | |||
| 148 | inode_sub_bytes(inode, nr); | 169 | inode_sub_bytes(inode, nr); |
| 149 | } | 170 | } |
| 150 | 171 | ||
| 151 | static inline void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr) | 172 | static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) |
| 152 | { | 173 | { |
| 153 | DQUOT_FREE_SPACE_NODIRTY(inode, nr); | 174 | vfs_dq_free_space_nodirty(inode, nr); |
| 154 | mark_inode_dirty(inode); | 175 | mark_inode_dirty(inode); |
| 155 | } | 176 | } |
| 156 | 177 | ||
| 157 | static inline void DQUOT_FREE_INODE(struct inode *inode) | 178 | static inline void vfs_dq_free_inode(struct inode *inode) |
| 158 | { | 179 | { |
| 159 | if (sb_any_quota_enabled(inode->i_sb)) | 180 | if (sb_any_quota_enabled(inode->i_sb)) |
| 160 | inode->i_sb->dq_op->free_inode(inode, 1); | 181 | inode->i_sb->dq_op->free_inode(inode, 1); |
| 161 | } | 182 | } |
| 162 | 183 | ||
| 163 | static inline int DQUOT_TRANSFER(struct inode *inode, struct iattr *iattr) | ||
| 164 | { | ||
| 165 | if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) { | ||
| 166 | DQUOT_INIT(inode); | ||
| 167 | if (inode->i_sb->dq_op->transfer(inode, iattr) == NO_QUOTA) | ||
| 168 | return 1; | ||
| 169 | } | ||
| 170 | return 0; | ||
| 171 | } | ||
| 172 | |||
| 173 | /* The following two functions cannot be called inside a transaction */ | 184 | /* The following two functions cannot be called inside a transaction */ |
| 174 | static inline void DQUOT_SYNC(struct super_block *sb) | 185 | static inline void vfs_dq_sync(struct super_block *sb) |
| 175 | { | 186 | { |
| 176 | sync_dquots(sb, -1); | 187 | sync_dquots(sb, -1); |
| 177 | } | 188 | } |
| 178 | 189 | ||
| 179 | static inline int DQUOT_OFF(struct super_block *sb, int remount) | 190 | static inline int vfs_dq_off(struct super_block *sb, int remount) |
| 180 | { | 191 | { |
| 181 | int ret = -ENOSYS; | 192 | int ret = -ENOSYS; |
| 182 | 193 | ||
| @@ -185,22 +196,27 @@ static inline int DQUOT_OFF(struct super_block *sb, int remount) | |||
| 185 | return ret; | 196 | return ret; |
| 186 | } | 197 | } |
| 187 | 198 | ||
| 188 | static inline int DQUOT_ON_REMOUNT(struct super_block *sb) | 199 | #else |
| 200 | |||
| 201 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | ||
| 189 | { | 202 | { |
| 190 | int cnt; | 203 | return 0; |
| 191 | int ret = 0, err; | 204 | } |
| 192 | 205 | ||
| 193 | if (!sb->s_qcop || !sb->s_qcop->quota_on) | 206 | static inline int sb_any_quota_enabled(struct super_block *sb) |
| 194 | return -ENOSYS; | 207 | { |
| 195 | for (cnt = 0; cnt < MAXQUOTAS; cnt++) { | 208 | return 0; |
| 196 | err = sb->s_qcop->quota_on(sb, cnt, 0, NULL, 1); | ||
| 197 | if (err < 0 && !ret) | ||
| 198 | ret = err; | ||
| 199 | } | ||
| 200 | return ret; | ||
| 201 | } | 209 | } |
| 202 | 210 | ||
| 203 | #else | 211 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) |
| 212 | { | ||
| 213 | return 0; | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline int sb_any_quota_suspended(struct super_block *sb) | ||
| 217 | { | ||
| 218 | return 0; | ||
| 219 | } | ||
| 204 | 220 | ||
| 205 | /* | 221 | /* |
| 206 | * NO-OP when quota not configured. | 222 | * NO-OP when quota not configured. |
| @@ -208,113 +224,144 @@ static inline int DQUOT_ON_REMOUNT(struct super_block *sb) | |||
| 208 | #define sb_dquot_ops (NULL) | 224 | #define sb_dquot_ops (NULL) |
| 209 | #define sb_quotactl_ops (NULL) | 225 | #define sb_quotactl_ops (NULL) |
| 210 | 226 | ||
| 211 | static inline void DQUOT_INIT(struct inode *inode) | 227 | static inline void vfs_dq_init(struct inode *inode) |
| 212 | { | 228 | { |
| 213 | } | 229 | } |
| 214 | 230 | ||
| 215 | static inline void DQUOT_DROP(struct inode *inode) | 231 | static inline void vfs_dq_drop(struct inode *inode) |
| 216 | { | 232 | { |
| 217 | } | 233 | } |
| 218 | 234 | ||
| 219 | static inline int DQUOT_ALLOC_INODE(struct inode *inode) | 235 | static inline int vfs_dq_alloc_inode(struct inode *inode) |
| 220 | { | 236 | { |
| 221 | return 0; | 237 | return 0; |
| 222 | } | 238 | } |
| 223 | 239 | ||
| 224 | static inline void DQUOT_FREE_INODE(struct inode *inode) | 240 | static inline void vfs_dq_free_inode(struct inode *inode) |
| 225 | { | 241 | { |
| 226 | } | 242 | } |
| 227 | 243 | ||
| 228 | static inline void DQUOT_SYNC(struct super_block *sb) | 244 | static inline void vfs_dq_sync(struct super_block *sb) |
| 229 | { | 245 | { |
| 230 | } | 246 | } |
| 231 | 247 | ||
| 232 | static inline int DQUOT_OFF(struct super_block *sb, int remount) | 248 | static inline int vfs_dq_off(struct super_block *sb, int remount) |
| 233 | { | 249 | { |
| 234 | return 0; | 250 | return 0; |
| 235 | } | 251 | } |
| 236 | 252 | ||
| 237 | static inline int DQUOT_ON_REMOUNT(struct super_block *sb) | 253 | static inline int vfs_dq_quota_on_remount(struct super_block *sb) |
| 238 | { | 254 | { |
| 239 | return 0; | 255 | return 0; |
| 240 | } | 256 | } |
| 241 | 257 | ||
| 242 | static inline int DQUOT_TRANSFER(struct inode *inode, struct iattr *iattr) | 258 | static inline int vfs_dq_transfer(struct inode *inode, struct iattr *iattr) |
| 243 | { | 259 | { |
| 244 | return 0; | 260 | return 0; |
| 245 | } | 261 | } |
| 246 | 262 | ||
| 247 | static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 263 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) |
| 248 | { | 264 | { |
| 249 | inode_add_bytes(inode, nr); | 265 | inode_add_bytes(inode, nr); |
| 250 | return 0; | 266 | return 0; |
| 251 | } | 267 | } |
| 252 | 268 | ||
| 253 | static inline int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr) | 269 | static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr) |
| 254 | { | 270 | { |
| 255 | DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr); | 271 | vfs_dq_prealloc_space_nodirty(inode, nr); |
| 256 | mark_inode_dirty(inode); | 272 | mark_inode_dirty(inode); |
| 257 | return 0; | 273 | return 0; |
| 258 | } | 274 | } |
| 259 | 275 | ||
| 260 | static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 276 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) |
| 261 | { | 277 | { |
| 262 | inode_add_bytes(inode, nr); | 278 | inode_add_bytes(inode, nr); |
| 263 | return 0; | 279 | return 0; |
| 264 | } | 280 | } |
| 265 | 281 | ||
| 266 | static inline int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr) | 282 | static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr) |
| 267 | { | 283 | { |
| 268 | DQUOT_ALLOC_SPACE_NODIRTY(inode, nr); | 284 | vfs_dq_alloc_space_nodirty(inode, nr); |
| 269 | mark_inode_dirty(inode); | 285 | mark_inode_dirty(inode); |
| 270 | return 0; | 286 | return 0; |
| 271 | } | 287 | } |
| 272 | 288 | ||
| 273 | static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) | 289 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) |
| 274 | { | 290 | { |
| 275 | inode_sub_bytes(inode, nr); | 291 | inode_sub_bytes(inode, nr); |
| 276 | } | 292 | } |
| 277 | 293 | ||
| 278 | static inline void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr) | 294 | static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) |
| 279 | { | 295 | { |
| 280 | DQUOT_FREE_SPACE_NODIRTY(inode, nr); | 296 | vfs_dq_free_space_nodirty(inode, nr); |
| 281 | mark_inode_dirty(inode); | 297 | mark_inode_dirty(inode); |
| 282 | } | 298 | } |
| 283 | 299 | ||
| 284 | #endif /* CONFIG_QUOTA */ | 300 | #endif /* CONFIG_QUOTA */ |
| 285 | 301 | ||
| 286 | static inline int DQUOT_PREALLOC_BLOCK_NODIRTY(struct inode *inode, qsize_t nr) | 302 | static inline int vfs_dq_prealloc_block_nodirty(struct inode *inode, qsize_t nr) |
| 287 | { | 303 | { |
| 288 | return DQUOT_PREALLOC_SPACE_NODIRTY(inode, | 304 | return vfs_dq_prealloc_space_nodirty(inode, |
| 289 | nr << inode->i_sb->s_blocksize_bits); | 305 | nr << inode->i_sb->s_blocksize_bits); |
| 290 | } | 306 | } |
| 291 | 307 | ||
| 292 | static inline int DQUOT_PREALLOC_BLOCK(struct inode *inode, qsize_t nr) | 308 | static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr) |
| 293 | { | 309 | { |
| 294 | return DQUOT_PREALLOC_SPACE(inode, | 310 | return vfs_dq_prealloc_space(inode, |
| 295 | nr << inode->i_sb->s_blocksize_bits); | 311 | nr << inode->i_sb->s_blocksize_bits); |
| 296 | } | 312 | } |
| 297 | 313 | ||
| 298 | static inline int DQUOT_ALLOC_BLOCK_NODIRTY(struct inode *inode, qsize_t nr) | 314 | static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr) |
| 299 | { | 315 | { |
| 300 | return DQUOT_ALLOC_SPACE_NODIRTY(inode, | 316 | return vfs_dq_alloc_space_nodirty(inode, |
| 301 | nr << inode->i_sb->s_blocksize_bits); | 317 | nr << inode->i_sb->s_blocksize_bits); |
| 302 | } | 318 | } |
| 303 | 319 | ||
| 304 | static inline int DQUOT_ALLOC_BLOCK(struct inode *inode, qsize_t nr) | 320 | static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr) |
| 305 | { | 321 | { |
| 306 | return DQUOT_ALLOC_SPACE(inode, | 322 | return vfs_dq_alloc_space(inode, |
| 307 | nr << inode->i_sb->s_blocksize_bits); | 323 | nr << inode->i_sb->s_blocksize_bits); |
| 308 | } | 324 | } |
| 309 | 325 | ||
| 310 | static inline void DQUOT_FREE_BLOCK_NODIRTY(struct inode *inode, qsize_t nr) | 326 | static inline void vfs_dq_free_block_nodirty(struct inode *inode, qsize_t nr) |
| 311 | { | 327 | { |
| 312 | DQUOT_FREE_SPACE_NODIRTY(inode, nr << inode->i_sb->s_blocksize_bits); | 328 | vfs_dq_free_space_nodirty(inode, nr << inode->i_sb->s_blocksize_bits); |
| 313 | } | 329 | } |
| 314 | 330 | ||
| 315 | static inline void DQUOT_FREE_BLOCK(struct inode *inode, qsize_t nr) | 331 | static inline void vfs_dq_free_block(struct inode *inode, qsize_t nr) |
| 316 | { | 332 | { |
| 317 | DQUOT_FREE_SPACE(inode, nr << inode->i_sb->s_blocksize_bits); | 333 | vfs_dq_free_space(inode, nr << inode->i_sb->s_blocksize_bits); |
| 318 | } | 334 | } |
| 319 | 335 | ||
| 336 | /* | ||
| 337 | * Define uppercase equivalents for compatibility with old function names | ||
| 338 | * Can go away when we think all users have been converted (15/04/2008) | ||
| 339 | */ | ||
| 340 | #define DQUOT_INIT(inode) vfs_dq_init(inode) | ||
| 341 | #define DQUOT_DROP(inode) vfs_dq_drop(inode) | ||
| 342 | #define DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr) \ | ||
| 343 | vfs_dq_prealloc_space_nodirty(inode, nr) | ||
| 344 | #define DQUOT_PREALLOC_SPACE(inode, nr) vfs_dq_prealloc_space(inode, nr) | ||
| 345 | #define DQUOT_ALLOC_SPACE_NODIRTY(inode, nr) \ | ||
| 346 | vfs_dq_alloc_space_nodirty(inode, nr) | ||
| 347 | #define DQUOT_ALLOC_SPACE(inode, nr) vfs_dq_alloc_space(inode, nr) | ||
| 348 | #define DQUOT_PREALLOC_BLOCK_NODIRTY(inode, nr) \ | ||
| 349 | vfs_dq_prealloc_block_nodirty(inode, nr) | ||
| 350 | #define DQUOT_PREALLOC_BLOCK(inode, nr) vfs_dq_prealloc_block(inode, nr) | ||
| 351 | #define DQUOT_ALLOC_BLOCK_NODIRTY(inode, nr) \ | ||
| 352 | vfs_dq_alloc_block_nodirty(inode, nr) | ||
| 353 | #define DQUOT_ALLOC_BLOCK(inode, nr) vfs_dq_alloc_block(inode, nr) | ||
| 354 | #define DQUOT_ALLOC_INODE(inode) vfs_dq_alloc_inode(inode) | ||
| 355 | #define DQUOT_FREE_SPACE_NODIRTY(inode, nr) \ | ||
| 356 | vfs_dq_free_space_nodirty(inode, nr) | ||
| 357 | #define DQUOT_FREE_SPACE(inode, nr) vfs_dq_free_space(inode, nr) | ||
| 358 | #define DQUOT_FREE_BLOCK_NODIRTY(inode, nr) \ | ||
| 359 | vfs_dq_free_block_nodirty(inode, nr) | ||
| 360 | #define DQUOT_FREE_BLOCK(inode, nr) vfs_dq_free_block(inode, nr) | ||
| 361 | #define DQUOT_FREE_INODE(inode) vfs_dq_free_inode(inode) | ||
| 362 | #define DQUOT_TRANSFER(inode, iattr) vfs_dq_transfer(inode, iattr) | ||
| 363 | #define DQUOT_SYNC(sb) vfs_dq_sync(sb) | ||
| 364 | #define DQUOT_OFF(sb, remount) vfs_dq_off(sb, remount) | ||
| 365 | #define DQUOT_ON_REMOUNT(sb) vfs_dq_quota_on_remount(sb) | ||
| 366 | |||
| 320 | #endif /* _LINUX_QUOTAOPS_ */ | 367 | #endif /* _LINUX_QUOTAOPS_ */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index b8ce2b444bb5..a916c6660dfa 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
| @@ -99,12 +99,15 @@ do { \ | |||
| 99 | * | 99 | * |
| 100 | * The notable exceptions to this rule are the following functions: | 100 | * The notable exceptions to this rule are the following functions: |
| 101 | * radix_tree_lookup | 101 | * radix_tree_lookup |
| 102 | * radix_tree_lookup_slot | ||
| 102 | * radix_tree_tag_get | 103 | * radix_tree_tag_get |
| 103 | * radix_tree_gang_lookup | 104 | * radix_tree_gang_lookup |
| 105 | * radix_tree_gang_lookup_slot | ||
| 104 | * radix_tree_gang_lookup_tag | 106 | * radix_tree_gang_lookup_tag |
| 107 | * radix_tree_gang_lookup_tag_slot | ||
| 105 | * radix_tree_tagged | 108 | * radix_tree_tagged |
| 106 | * | 109 | * |
| 107 | * The first 4 functions are able to be called locklessly, using RCU. The | 110 | * The first 7 functions are able to be called locklessly, using RCU. The |
| 108 | * caller must ensure calls to these functions are made within rcu_read_lock() | 111 | * caller must ensure calls to these functions are made within rcu_read_lock() |
| 109 | * regions. Other readers (lock-free or otherwise) and modifications may be | 112 | * regions. Other readers (lock-free or otherwise) and modifications may be |
| 110 | * running concurrently. | 113 | * running concurrently. |
| @@ -159,6 +162,9 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |||
| 159 | unsigned int | 162 | unsigned int |
| 160 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 163 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
| 161 | unsigned long first_index, unsigned int max_items); | 164 | unsigned long first_index, unsigned int max_items); |
| 165 | unsigned int | ||
| 166 | radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results, | ||
| 167 | unsigned long first_index, unsigned int max_items); | ||
| 162 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, | 168 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, |
| 163 | unsigned long index, unsigned long max_scan); | 169 | unsigned long index, unsigned long max_scan); |
| 164 | int radix_tree_preload(gfp_t gfp_mask); | 170 | int radix_tree_preload(gfp_t gfp_mask); |
| @@ -173,6 +179,10 @@ unsigned int | |||
| 173 | radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, | 179 | radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, |
| 174 | unsigned long first_index, unsigned int max_items, | 180 | unsigned long first_index, unsigned int max_items, |
| 175 | unsigned int tag); | 181 | unsigned int tag); |
| 182 | unsigned int | ||
| 183 | radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results, | ||
| 184 | unsigned long first_index, unsigned int max_items, | ||
| 185 | unsigned int tag); | ||
| 176 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); | 186 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); |
| 177 | 187 | ||
| 178 | static inline void radix_tree_preload_end(void) | 188 | static inline void radix_tree_preload_end(void) |
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h new file mode 100644 index 000000000000..18a5b9ba9d40 --- /dev/null +++ b/include/linux/ratelimit.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #ifndef _LINUX_RATELIMIT_H | ||
| 2 | #define _LINUX_RATELIMIT_H | ||
| 3 | #include <linux/param.h> | ||
| 4 | |||
| 5 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) | ||
| 6 | #define DEFAULT_RATELIMIT_BURST 10 | ||
| 7 | |||
| 8 | struct ratelimit_state { | ||
| 9 | int interval; | ||
| 10 | int burst; | ||
| 11 | int printed; | ||
| 12 | int missed; | ||
| 13 | unsigned long begin; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define DEFINE_RATELIMIT_STATE(name, interval, burst) \ | ||
| 17 | struct ratelimit_state name = {interval, burst,} | ||
| 18 | |||
| 19 | extern int __ratelimit(struct ratelimit_state *rs); | ||
| 20 | |||
| 21 | static inline int ratelimit(void) | ||
| 22 | { | ||
| 23 | static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL, | ||
| 24 | DEFAULT_RATELIMIT_BURST); | ||
| 25 | return __ratelimit(&rs); | ||
| 26 | } | ||
| 27 | #endif | ||
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index f04b64eca636..0967f03b0705 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h | |||
| @@ -115,16 +115,21 @@ DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched); | |||
| 115 | 115 | ||
| 116 | static inline void rcu_enter_nohz(void) | 116 | static inline void rcu_enter_nohz(void) |
| 117 | { | 117 | { |
| 118 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); | ||
| 119 | |||
| 118 | smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */ | 120 | smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */ |
| 119 | __get_cpu_var(rcu_dyntick_sched).dynticks++; | 121 | __get_cpu_var(rcu_dyntick_sched).dynticks++; |
| 120 | WARN_ON(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1); | 122 | WARN_ON_RATELIMIT(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1, &rs); |
| 121 | } | 123 | } |
| 122 | 124 | ||
| 123 | static inline void rcu_exit_nohz(void) | 125 | static inline void rcu_exit_nohz(void) |
| 124 | { | 126 | { |
| 127 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); | ||
| 128 | |||
| 125 | smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ | 129 | smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ |
| 126 | __get_cpu_var(rcu_dyntick_sched).dynticks++; | 130 | __get_cpu_var(rcu_dyntick_sched).dynticks++; |
| 127 | WARN_ON(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1)); | 131 | WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1), |
| 132 | &rs); | ||
| 128 | } | 133 | } |
| 129 | 134 | ||
| 130 | #else /* CONFIG_NO_HZ */ | 135 | #else /* CONFIG_NO_HZ */ |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 4aacaeecb56f..e9963af16cda 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
| @@ -526,8 +526,8 @@ struct item_head { | |||
| 526 | ** p is the array of __u32, i is the index into the array, v is the value | 526 | ** p is the array of __u32, i is the index into the array, v is the value |
| 527 | ** to store there. | 527 | ** to store there. |
| 528 | */ | 528 | */ |
| 529 | #define get_block_num(p, i) le32_to_cpu(get_unaligned((p) + (i))) | 529 | #define get_block_num(p, i) get_unaligned_le32((p) + (i)) |
| 530 | #define put_block_num(p, i, v) put_unaligned(cpu_to_le32(v), (p) + (i)) | 530 | #define put_block_num(p, i, v) put_unaligned_le32((v), (p) + (i)) |
| 531 | 531 | ||
| 532 | // | 532 | // |
| 533 | // in old version uniqueness field shows key type | 533 | // in old version uniqueness field shows key type |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 336ee43ed7d8..315517e8bfa1 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
| @@ -152,7 +152,7 @@ struct reiserfs_journal_list { | |||
| 152 | atomic_t j_nonzerolen; | 152 | atomic_t j_nonzerolen; |
| 153 | atomic_t j_commit_left; | 153 | atomic_t j_commit_left; |
| 154 | atomic_t j_older_commits_done; /* all commits older than this on disk */ | 154 | atomic_t j_older_commits_done; /* all commits older than this on disk */ |
| 155 | struct semaphore j_commit_lock; | 155 | struct mutex j_commit_mutex; |
| 156 | unsigned long j_trans_id; | 156 | unsigned long j_trans_id; |
| 157 | time_t j_timestamp; | 157 | time_t j_timestamp; |
| 158 | struct reiserfs_list_bitmap *j_list_bitmap; | 158 | struct reiserfs_list_bitmap *j_list_bitmap; |
| @@ -193,8 +193,8 @@ struct reiserfs_journal { | |||
| 193 | struct buffer_head *j_header_bh; | 193 | struct buffer_head *j_header_bh; |
| 194 | 194 | ||
| 195 | time_t j_trans_start_time; /* time this transaction started */ | 195 | time_t j_trans_start_time; /* time this transaction started */ |
| 196 | struct semaphore j_lock; | 196 | struct mutex j_mutex; |
| 197 | struct semaphore j_flush_sem; | 197 | struct mutex j_flush_mutex; |
| 198 | wait_queue_head_t j_join_wait; /* wait for current transaction to finish before starting new one */ | 198 | wait_queue_head_t j_join_wait; /* wait for current transaction to finish before starting new one */ |
| 199 | atomic_t j_jlock; /* lock for j_join_wait */ | 199 | atomic_t j_jlock; /* lock for j_join_wait */ |
| 200 | int j_list_bitmap_index; /* number of next list bitmap to use */ | 200 | int j_list_bitmap_index; /* number of next list bitmap to use */ |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 66a96814d614..af135ae895db 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
| @@ -55,7 +55,7 @@ int reiserfs_removexattr(struct dentry *dentry, const char *name); | |||
| 55 | int reiserfs_delete_xattrs(struct inode *inode); | 55 | int reiserfs_delete_xattrs(struct inode *inode); |
| 56 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); | 56 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); |
| 57 | int reiserfs_xattr_init(struct super_block *sb, int mount_flags); | 57 | int reiserfs_xattr_init(struct super_block *sb, int mount_flags); |
| 58 | int reiserfs_permission(struct inode *inode, int mask, struct nameidata *nd); | 58 | int reiserfs_permission(struct inode *inode, int mask); |
| 59 | 59 | ||
| 60 | int reiserfs_xattr_del(struct inode *, const char *); | 60 | int reiserfs_xattr_del(struct inode *, const char *); |
| 61 | int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t); | 61 | int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t); |
diff --git a/include/linux/relay.h b/include/linux/relay.h index 6cd8c4425fc7..953fc055e875 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h | |||
| @@ -48,6 +48,7 @@ struct rchan_buf | |||
| 48 | size_t *padding; /* padding counts per sub-buffer */ | 48 | size_t *padding; /* padding counts per sub-buffer */ |
| 49 | size_t prev_padding; /* temporary variable */ | 49 | size_t prev_padding; /* temporary variable */ |
| 50 | size_t bytes_consumed; /* bytes consumed in cur read subbuf */ | 50 | size_t bytes_consumed; /* bytes consumed in cur read subbuf */ |
| 51 | size_t early_bytes; /* bytes consumed before VFS inited */ | ||
| 51 | unsigned int cpu; /* this buf's cpu */ | 52 | unsigned int cpu; /* this buf's cpu */ |
| 52 | } ____cacheline_aligned; | 53 | } ____cacheline_aligned; |
| 53 | 54 | ||
| @@ -68,6 +69,7 @@ struct rchan | |||
| 68 | int is_global; /* One global buffer ? */ | 69 | int is_global; /* One global buffer ? */ |
| 69 | struct list_head list; /* for channel list */ | 70 | struct list_head list; /* for channel list */ |
| 70 | struct dentry *parent; /* parent dentry passed to open */ | 71 | struct dentry *parent; /* parent dentry passed to open */ |
| 72 | int has_base_filename; /* has a filename associated? */ | ||
| 71 | char base_filename[NAME_MAX]; /* saved base filename */ | 73 | char base_filename[NAME_MAX]; /* saved base filename */ |
| 72 | }; | 74 | }; |
| 73 | 75 | ||
| @@ -169,6 +171,9 @@ struct rchan *relay_open(const char *base_filename, | |||
| 169 | size_t n_subbufs, | 171 | size_t n_subbufs, |
| 170 | struct rchan_callbacks *cb, | 172 | struct rchan_callbacks *cb, |
| 171 | void *private_data); | 173 | void *private_data); |
| 174 | extern int relay_late_setup_files(struct rchan *chan, | ||
| 175 | const char *base_filename, | ||
| 176 | struct dentry *parent); | ||
| 172 | extern void relay_close(struct rchan *chan); | 177 | extern void relay_close(struct rchan *chan); |
| 173 | extern void relay_flush(struct rchan *chan); | 178 | extern void relay_flush(struct rchan *chan); |
| 174 | extern void relay_subbufs_consumed(struct rchan *chan, | 179 | extern void relay_subbufs_consumed(struct rchan *chan, |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 6d9e1fca098c..fdeadd9740dc 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
| @@ -63,9 +63,14 @@ u64 res_counter_read_u64(struct res_counter *counter, int member); | |||
| 63 | ssize_t res_counter_read(struct res_counter *counter, int member, | 63 | ssize_t res_counter_read(struct res_counter *counter, int member, |
| 64 | const char __user *buf, size_t nbytes, loff_t *pos, | 64 | const char __user *buf, size_t nbytes, loff_t *pos, |
| 65 | int (*read_strategy)(unsigned long long val, char *s)); | 65 | int (*read_strategy)(unsigned long long val, char *s)); |
| 66 | ssize_t res_counter_write(struct res_counter *counter, int member, | 66 | |
| 67 | const char __user *buf, size_t nbytes, loff_t *pos, | 67 | typedef int (*write_strategy_fn)(const char *buf, unsigned long long *val); |
| 68 | int (*write_strategy)(char *buf, unsigned long long *val)); | 68 | |
| 69 | int res_counter_memparse_write_strategy(const char *buf, | ||
| 70 | unsigned long long *res); | ||
| 71 | |||
| 72 | int res_counter_write(struct res_counter *counter, int member, | ||
| 73 | const char *buffer, write_strategy_fn write_strategy); | ||
| 69 | 74 | ||
| 70 | /* | 75 | /* |
| 71 | * the field descriptors. one for each member of res_counter | 76 | * the field descriptors. one for each member of res_counter |
| @@ -95,8 +100,10 @@ void res_counter_init(struct res_counter *counter); | |||
| 95 | * counter->limit _locked call expects the counter->lock to be taken | 100 | * counter->limit _locked call expects the counter->lock to be taken |
| 96 | */ | 101 | */ |
| 97 | 102 | ||
| 98 | int res_counter_charge_locked(struct res_counter *counter, unsigned long val); | 103 | int __must_check res_counter_charge_locked(struct res_counter *counter, |
| 99 | int res_counter_charge(struct res_counter *counter, unsigned long val); | 104 | unsigned long val); |
| 105 | int __must_check res_counter_charge(struct res_counter *counter, | ||
| 106 | unsigned long val); | ||
| 100 | 107 | ||
| 101 | /* | 108 | /* |
| 102 | * uncharge - tell that some portion of the resource is released | 109 | * uncharge - tell that some portion of the resource is released |
| @@ -151,4 +158,20 @@ static inline void res_counter_reset_failcnt(struct res_counter *cnt) | |||
| 151 | cnt->failcnt = 0; | 158 | cnt->failcnt = 0; |
| 152 | spin_unlock_irqrestore(&cnt->lock, flags); | 159 | spin_unlock_irqrestore(&cnt->lock, flags); |
| 153 | } | 160 | } |
| 161 | |||
| 162 | static inline int res_counter_set_limit(struct res_counter *cnt, | ||
| 163 | unsigned long long limit) | ||
| 164 | { | ||
| 165 | unsigned long flags; | ||
| 166 | int ret = -EBUSY; | ||
| 167 | |||
| 168 | spin_lock_irqsave(&cnt->lock, flags); | ||
| 169 | if (cnt->usage < limit) { | ||
| 170 | cnt->limit = limit; | ||
| 171 | ret = 0; | ||
| 172 | } | ||
| 173 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
| 174 | return ret; | ||
| 175 | } | ||
| 176 | |||
| 154 | #endif | 177 | #endif |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index f2d0d1527721..91f597ad6acc 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
| @@ -115,6 +115,23 @@ extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | |||
| 115 | 115 | ||
| 116 | extern struct class *rtc_class; | 116 | extern struct class *rtc_class; |
| 117 | 117 | ||
| 118 | /* | ||
| 119 | * For these RTC methods the device parameter is the physical device | ||
| 120 | * on whatever bus holds the hardware (I2C, Platform, SPI, etc), which | ||
| 121 | * was passed to rtc_device_register(). Its driver_data normally holds | ||
| 122 | * device state, including the rtc_device pointer for the RTC. | ||
| 123 | * | ||
| 124 | * Most of these methods are called with rtc_device.ops_lock held, | ||
| 125 | * through the rtc_*(struct rtc_device *, ...) calls. | ||
| 126 | * | ||
| 127 | * The (current) exceptions are mostly filesystem hooks: | ||
| 128 | * - the proc() hook for procfs | ||
| 129 | * - non-ioctl() chardev hooks: open(), release(), read_callback() | ||
| 130 | * - periodic irq calls: irq_set_state(), irq_set_freq() | ||
| 131 | * | ||
| 132 | * REVISIT those periodic irq calls *do* have ops_lock when they're | ||
| 133 | * issued through ioctl() ... | ||
| 134 | */ | ||
| 118 | struct rtc_class_ops { | 135 | struct rtc_class_ops { |
| 119 | int (*open)(struct device *); | 136 | int (*open)(struct device *); |
| 120 | void (*release)(struct device *); | 137 | void (*release)(struct device *); |
| @@ -208,8 +225,6 @@ typedef struct rtc_task { | |||
| 208 | int rtc_register(rtc_task_t *task); | 225 | int rtc_register(rtc_task_t *task); |
| 209 | int rtc_unregister(rtc_task_t *task); | 226 | int rtc_unregister(rtc_task_t *task); |
| 210 | int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg); | 227 | int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg); |
| 211 | void rtc_get_rtc_time(struct rtc_time *rtc_tm); | ||
| 212 | irqreturn_t rtc_interrupt(int irq, void *dev_id); | ||
| 213 | 228 | ||
| 214 | #endif /* __KERNEL__ */ | 229 | #endif /* __KERNEL__ */ |
| 215 | 230 | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index f4d386c191f5..ca643b13b026 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -755,13 +755,6 @@ extern void __rtnl_unlock(void); | |||
| 755 | } \ | 755 | } \ |
| 756 | } while(0) | 756 | } while(0) |
| 757 | 757 | ||
| 758 | #define BUG_TRAP(x) do { \ | ||
| 759 | if (unlikely(!(x))) { \ | ||
| 760 | printk(KERN_ERR "KERNEL: assertion (%s) failed at %s (%d)\n", \ | ||
| 761 | #x, __FILE__ , __LINE__); \ | ||
| 762 | } \ | ||
| 763 | } while(0) | ||
| 764 | |||
| 765 | static inline u32 rtm_get_table(struct rtattr **rta, u8 table) | 758 | static inline u32 rtm_get_table(struct rtattr **rta, u8 table) |
| 766 | { | 759 | { |
| 767 | return RTA_GET_U32(rta[RTA_TABLE-1]); | 760 | return RTA_GET_U32(rta[RTA_TABLE-1]); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index dc7e592c473a..f59318a0099b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -292,7 +292,6 @@ extern void sched_show_task(struct task_struct *p); | |||
| 292 | 292 | ||
| 293 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 293 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
| 294 | extern void softlockup_tick(void); | 294 | extern void softlockup_tick(void); |
| 295 | extern void spawn_softlockup_task(void); | ||
| 296 | extern void touch_softlockup_watchdog(void); | 295 | extern void touch_softlockup_watchdog(void); |
| 297 | extern void touch_all_softlockup_watchdogs(void); | 296 | extern void touch_all_softlockup_watchdogs(void); |
| 298 | extern unsigned int softlockup_panic; | 297 | extern unsigned int softlockup_panic; |
| @@ -506,6 +505,10 @@ struct signal_struct { | |||
| 506 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 505 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
| 507 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 506 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
| 508 | unsigned long inblock, oublock, cinblock, coublock; | 507 | unsigned long inblock, oublock, cinblock, coublock; |
| 508 | #ifdef CONFIG_TASK_XACCT | ||
| 509 | u64 rchar, wchar, syscr, syscw; | ||
| 510 | #endif | ||
| 511 | struct task_io_accounting ioac; | ||
| 509 | 512 | ||
| 510 | /* | 513 | /* |
| 511 | * Cumulative ns of scheduled CPU time for dead threads in the | 514 | * Cumulative ns of scheduled CPU time for dead threads in the |
| @@ -668,6 +671,10 @@ struct task_delay_info { | |||
| 668 | /* io operations performed */ | 671 | /* io operations performed */ |
| 669 | u32 swapin_count; /* total count of the number of swapin block */ | 672 | u32 swapin_count; /* total count of the number of swapin block */ |
| 670 | /* io operations performed */ | 673 | /* io operations performed */ |
| 674 | |||
| 675 | struct timespec freepages_start, freepages_end; | ||
| 676 | u64 freepages_delay; /* wait for memory reclaim */ | ||
| 677 | u32 freepages_count; /* total count of memory reclaim */ | ||
| 671 | }; | 678 | }; |
| 672 | #endif /* CONFIG_TASK_DELAY_ACCT */ | 679 | #endif /* CONFIG_TASK_DELAY_ACCT */ |
| 673 | 680 | ||
| @@ -1257,7 +1264,7 @@ struct task_struct { | |||
| 1257 | #if defined(CONFIG_TASK_XACCT) | 1264 | #if defined(CONFIG_TASK_XACCT) |
| 1258 | u64 acct_rss_mem1; /* accumulated rss usage */ | 1265 | u64 acct_rss_mem1; /* accumulated rss usage */ |
| 1259 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ | 1266 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ |
| 1260 | cputime_t acct_stimexpd;/* stime since last update */ | 1267 | cputime_t acct_timexpd; /* stime + utime since last update */ |
| 1261 | #endif | 1268 | #endif |
| 1262 | #ifdef CONFIG_CPUSETS | 1269 | #ifdef CONFIG_CPUSETS |
| 1263 | nodemask_t mems_allowed; | 1270 | nodemask_t mems_allowed; |
| @@ -1496,7 +1503,7 @@ static inline void put_task_struct(struct task_struct *t) | |||
| 1496 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1503 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
| 1497 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ | 1504 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ |
| 1498 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1505 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
| 1499 | #define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */ | 1506 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
| 1500 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1507 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
| 1501 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ | 1508 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ |
| 1502 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | 1509 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
| @@ -1715,19 +1722,13 @@ extern struct pid_namespace init_pid_ns; | |||
| 1715 | * finds a task by its pid in the specified namespace | 1722 | * finds a task by its pid in the specified namespace |
| 1716 | * find_task_by_vpid(): | 1723 | * find_task_by_vpid(): |
| 1717 | * finds a task by its virtual pid | 1724 | * finds a task by its virtual pid |
| 1718 | * find_task_by_pid(): | ||
| 1719 | * finds a task by its global pid | ||
| 1720 | * | 1725 | * |
| 1721 | * see also find_pid() etc in include/linux/pid.h | 1726 | * see also find_vpid() etc in include/linux/pid.h |
| 1722 | */ | 1727 | */ |
| 1723 | 1728 | ||
| 1724 | extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, | 1729 | extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, |
| 1725 | struct pid_namespace *ns); | 1730 | struct pid_namespace *ns); |
| 1726 | 1731 | ||
| 1727 | static inline struct task_struct *__deprecated find_task_by_pid(pid_t nr) | ||
| 1728 | { | ||
| 1729 | return find_task_by_pid_type_ns(PIDTYPE_PID, nr, &init_pid_ns); | ||
| 1730 | } | ||
| 1731 | extern struct task_struct *find_task_by_vpid(pid_t nr); | 1732 | extern struct task_struct *find_task_by_vpid(pid_t nr); |
| 1732 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, | 1733 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, |
| 1733 | struct pid_namespace *ns); | 1734 | struct pid_namespace *ns); |
| @@ -1795,12 +1796,11 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_ | |||
| 1795 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | 1796 | extern int kill_pgrp(struct pid *pid, int sig, int priv); |
| 1796 | extern int kill_pid(struct pid *pid, int sig, int priv); | 1797 | extern int kill_pid(struct pid *pid, int sig, int priv); |
| 1797 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1798 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
| 1798 | extern void do_notify_parent(struct task_struct *, int); | 1799 | extern int do_notify_parent(struct task_struct *, int); |
| 1799 | extern void force_sig(int, struct task_struct *); | 1800 | extern void force_sig(int, struct task_struct *); |
| 1800 | extern void force_sig_specific(int, struct task_struct *); | 1801 | extern void force_sig_specific(int, struct task_struct *); |
| 1801 | extern int send_sig(int, struct task_struct *, int); | 1802 | extern int send_sig(int, struct task_struct *, int); |
| 1802 | extern void zap_other_threads(struct task_struct *p); | 1803 | extern void zap_other_threads(struct task_struct *p); |
| 1803 | extern int kill_proc(pid_t, int, int); | ||
| 1804 | extern struct sigqueue *sigqueue_alloc(void); | 1804 | extern struct sigqueue *sigqueue_alloc(void); |
| 1805 | extern void sigqueue_free(struct sigqueue *); | 1805 | extern void sigqueue_free(struct sigqueue *); |
| 1806 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); | 1806 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); |
| @@ -1882,9 +1882,13 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
| 1882 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 1882 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
| 1883 | 1883 | ||
| 1884 | #ifdef CONFIG_SMP | 1884 | #ifdef CONFIG_SMP |
| 1885 | extern void wait_task_inactive(struct task_struct * p); | 1885 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
| 1886 | #else | 1886 | #else |
| 1887 | #define wait_task_inactive(p) do { } while (0) | 1887 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
| 1888 | long match_state) | ||
| 1889 | { | ||
| 1890 | return 1; | ||
| 1891 | } | ||
| 1888 | #endif | 1892 | #endif |
| 1889 | 1893 | ||
| 1890 | #define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) | 1894 | #define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) |
| @@ -1983,6 +1987,13 @@ static inline unsigned long *end_of_stack(struct task_struct *p) | |||
| 1983 | 1987 | ||
| 1984 | #endif | 1988 | #endif |
| 1985 | 1989 | ||
| 1990 | static inline int object_is_on_stack(void *obj) | ||
| 1991 | { | ||
| 1992 | void *stack = task_stack_page(current); | ||
| 1993 | |||
| 1994 | return (obj >= stack) && (obj < (stack + THREAD_SIZE)); | ||
| 1995 | } | ||
| 1996 | |||
| 1986 | extern void thread_info_cache_init(void); | 1997 | extern void thread_info_cache_init(void); |
| 1987 | 1998 | ||
| 1988 | /* set thread flags in other task's structures | 1999 | /* set thread flags in other task's structures |
| @@ -2047,9 +2058,6 @@ static inline int signal_pending_state(long state, struct task_struct *p) | |||
| 2047 | if (!signal_pending(p)) | 2058 | if (!signal_pending(p)) |
| 2048 | return 0; | 2059 | return 0; |
| 2049 | 2060 | ||
| 2050 | if (state & (__TASK_STOPPED | __TASK_TRACED)) | ||
| 2051 | return 0; | ||
| 2052 | |||
| 2053 | return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); | 2061 | return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); |
| 2054 | } | 2062 | } |
| 2055 | 2063 | ||
| @@ -2134,16 +2142,7 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
| 2134 | 2142 | ||
| 2135 | #endif /* CONFIG_SMP */ | 2143 | #endif /* CONFIG_SMP */ |
| 2136 | 2144 | ||
| 2137 | #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT | ||
| 2138 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | 2145 | extern void arch_pick_mmap_layout(struct mm_struct *mm); |
| 2139 | #else | ||
| 2140 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) | ||
| 2141 | { | ||
| 2142 | mm->mmap_base = TASK_UNMAPPED_BASE; | ||
| 2143 | mm->get_unmapped_area = arch_get_unmapped_area; | ||
| 2144 | mm->unmap_area = arch_unmap_area; | ||
| 2145 | } | ||
| 2146 | #endif | ||
| 2147 | 2146 | ||
| 2148 | #ifdef CONFIG_TRACING | 2147 | #ifdef CONFIG_TRACING |
| 2149 | extern void | 2148 | extern void |
| @@ -2226,14 +2225,6 @@ static inline void inc_syscw(struct task_struct *tsk) | |||
| 2226 | } | 2225 | } |
| 2227 | #endif | 2226 | #endif |
| 2228 | 2227 | ||
| 2229 | #ifdef CONFIG_SMP | ||
| 2230 | void migration_init(void); | ||
| 2231 | #else | ||
| 2232 | static inline void migration_init(void) | ||
| 2233 | { | ||
| 2234 | } | ||
| 2235 | #endif | ||
| 2236 | |||
| 2237 | #ifndef TASK_SIZE_OF | 2228 | #ifndef TASK_SIZE_OF |
| 2238 | #define TASK_SIZE_OF(tsk) TASK_SIZE | 2229 | #define TASK_SIZE_OF(tsk) TASK_SIZE |
| 2239 | #endif | 2230 | #endif |
diff --git a/include/linux/security.h b/include/linux/security.h index 31c8851ec5d0..fd96e7f8a6f9 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -102,9 +102,7 @@ extern unsigned long mmap_min_addr; | |||
| 102 | #define LSM_SETID_FS 8 | 102 | #define LSM_SETID_FS 8 |
| 103 | 103 | ||
| 104 | /* forward declares to avoid warnings */ | 104 | /* forward declares to avoid warnings */ |
| 105 | struct nfsctl_arg; | ||
| 106 | struct sched_param; | 105 | struct sched_param; |
| 107 | struct swap_info_struct; | ||
| 108 | struct request_sock; | 106 | struct request_sock; |
| 109 | 107 | ||
| 110 | /* bprm_apply_creds unsafe reasons */ | 108 | /* bprm_apply_creds unsafe reasons */ |
| @@ -1364,7 +1362,7 @@ struct security_operations { | |||
| 1364 | struct inode *new_dir, struct dentry *new_dentry); | 1362 | struct inode *new_dir, struct dentry *new_dentry); |
| 1365 | int (*inode_readlink) (struct dentry *dentry); | 1363 | int (*inode_readlink) (struct dentry *dentry); |
| 1366 | int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); | 1364 | int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); |
| 1367 | int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd); | 1365 | int (*inode_permission) (struct inode *inode, int mask); |
| 1368 | int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); | 1366 | int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); |
| 1369 | int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); | 1367 | int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); |
| 1370 | void (*inode_delete) (struct inode *inode); | 1368 | void (*inode_delete) (struct inode *inode); |
| @@ -1630,7 +1628,7 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 1630 | struct inode *new_dir, struct dentry *new_dentry); | 1628 | struct inode *new_dir, struct dentry *new_dentry); |
| 1631 | int security_inode_readlink(struct dentry *dentry); | 1629 | int security_inode_readlink(struct dentry *dentry); |
| 1632 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); | 1630 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); |
| 1633 | int security_inode_permission(struct inode *inode, int mask, struct nameidata *nd); | 1631 | int security_inode_permission(struct inode *inode, int mask); |
| 1634 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); | 1632 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); |
| 1635 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); | 1633 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); |
| 1636 | void security_inode_delete(struct inode *inode); | 1634 | void security_inode_delete(struct inode *inode); |
| @@ -2023,8 +2021,7 @@ static inline int security_inode_follow_link(struct dentry *dentry, | |||
| 2023 | return 0; | 2021 | return 0; |
| 2024 | } | 2022 | } |
| 2025 | 2023 | ||
| 2026 | static inline int security_inode_permission(struct inode *inode, int mask, | 2024 | static inline int security_inode_permission(struct inode *inode, int mask) |
| 2027 | struct nameidata *nd) | ||
| 2028 | { | 2025 | { |
| 2029 | return 0; | 2026 | return 0; |
| 2030 | } | 2027 | } |
diff --git a/include/linux/sem.h b/include/linux/sem.h index c8eaad9e4b72..1b191c176bcd 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
| @@ -78,6 +78,7 @@ struct seminfo { | |||
| 78 | 78 | ||
| 79 | #ifdef __KERNEL__ | 79 | #ifdef __KERNEL__ |
| 80 | #include <asm/atomic.h> | 80 | #include <asm/atomic.h> |
| 81 | #include <linux/rcupdate.h> | ||
| 81 | 82 | ||
| 82 | struct task_struct; | 83 | struct task_struct; |
| 83 | 84 | ||
| @@ -93,23 +94,19 @@ struct sem_array { | |||
| 93 | time_t sem_otime; /* last semop time */ | 94 | time_t sem_otime; /* last semop time */ |
| 94 | time_t sem_ctime; /* last change time */ | 95 | time_t sem_ctime; /* last change time */ |
| 95 | struct sem *sem_base; /* ptr to first semaphore in array */ | 96 | struct sem *sem_base; /* ptr to first semaphore in array */ |
| 96 | struct sem_queue *sem_pending; /* pending operations to be processed */ | 97 | struct list_head sem_pending; /* pending operations to be processed */ |
| 97 | struct sem_queue **sem_pending_last; /* last pending operation */ | 98 | struct list_head list_id; /* undo requests on this array */ |
| 98 | struct sem_undo *undo; /* undo requests on this array */ | ||
| 99 | unsigned long sem_nsems; /* no. of semaphores in array */ | 99 | unsigned long sem_nsems; /* no. of semaphores in array */ |
| 100 | }; | 100 | }; |
| 101 | 101 | ||
| 102 | /* One queue for each sleeping process in the system. */ | 102 | /* One queue for each sleeping process in the system. */ |
| 103 | struct sem_queue { | 103 | struct sem_queue { |
| 104 | struct sem_queue * next; /* next entry in the queue */ | 104 | struct list_head list; /* queue of pending operations */ |
| 105 | struct sem_queue ** prev; /* previous entry in the queue, *(q->prev) == q */ | 105 | struct task_struct *sleeper; /* this process */ |
| 106 | struct task_struct* sleeper; /* this process */ | 106 | struct sem_undo *undo; /* undo structure */ |
| 107 | struct sem_undo * undo; /* undo structure */ | ||
| 108 | int pid; /* process id of requesting process */ | 107 | int pid; /* process id of requesting process */ |
| 109 | int status; /* completion status of operation */ | 108 | int status; /* completion status of operation */ |
| 110 | struct sem_array * sma; /* semaphore array for operations */ | 109 | struct sembuf *sops; /* array of pending operations */ |
| 111 | int id; /* internal sem id */ | ||
| 112 | struct sembuf * sops; /* array of pending operations */ | ||
| 113 | int nsops; /* number of operations */ | 110 | int nsops; /* number of operations */ |
| 114 | int alter; /* does the operation alter the array? */ | 111 | int alter; /* does the operation alter the array? */ |
| 115 | }; | 112 | }; |
| @@ -118,8 +115,11 @@ struct sem_queue { | |||
| 118 | * when the process exits. | 115 | * when the process exits. |
| 119 | */ | 116 | */ |
| 120 | struct sem_undo { | 117 | struct sem_undo { |
| 121 | struct sem_undo * proc_next; /* next entry on this process */ | 118 | struct list_head list_proc; /* per-process list: all undos from one process. */ |
| 122 | struct sem_undo * id_next; /* next entry on this semaphore set */ | 119 | /* rcu protected */ |
| 120 | struct rcu_head rcu; /* rcu struct for sem_undo() */ | ||
| 121 | struct sem_undo_list *ulp; /* sem_undo_list for the process */ | ||
| 122 | struct list_head list_id; /* per semaphore array list: all undos for one array */ | ||
| 123 | int semid; /* semaphore set identifier */ | 123 | int semid; /* semaphore set identifier */ |
| 124 | short * semadj; /* array of adjustments, one per semaphore */ | 124 | short * semadj; /* array of adjustments, one per semaphore */ |
| 125 | }; | 125 | }; |
| @@ -128,9 +128,9 @@ struct sem_undo { | |||
| 128 | * that may be shared among all a CLONE_SYSVSEM task group. | 128 | * that may be shared among all a CLONE_SYSVSEM task group. |
| 129 | */ | 129 | */ |
| 130 | struct sem_undo_list { | 130 | struct sem_undo_list { |
| 131 | atomic_t refcnt; | 131 | atomic_t refcnt; |
| 132 | spinlock_t lock; | 132 | spinlock_t lock; |
| 133 | struct sem_undo *proc_list; | 133 | struct list_head list_proc; |
| 134 | }; | 134 | }; |
| 135 | 135 | ||
| 136 | struct sysv_sem { | 136 | struct sysv_sem { |
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h index 9cae64b00d6b..7415839ac890 100644 --- a/include/linux/semaphore.h +++ b/include/linux/semaphore.h | |||
| @@ -26,10 +26,8 @@ struct semaphore { | |||
| 26 | .wait_list = LIST_HEAD_INIT((name).wait_list), \ | 26 | .wait_list = LIST_HEAD_INIT((name).wait_list), \ |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ | 29 | #define DECLARE_MUTEX(name) \ |
| 30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) | 30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) |
| 31 | |||
| 32 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) | ||
| 33 | 31 | ||
| 34 | static inline void sema_init(struct semaphore *sem, int val) | 32 | static inline void sema_init(struct semaphore *sem, int val) |
| 35 | { | 33 | { |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f3a1c0e45021..3b2f6c04855e 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -59,9 +59,6 @@ | |||
| 59 | #define PORT_SUNZILOG 38 | 59 | #define PORT_SUNZILOG 38 |
| 60 | #define PORT_SUNSAB 39 | 60 | #define PORT_SUNSAB 39 |
| 61 | 61 | ||
| 62 | /* NEC v850. */ | ||
| 63 | #define PORT_V850E_UART 40 | ||
| 64 | |||
| 65 | /* DEC */ | 62 | /* DEC */ |
| 66 | #define PORT_DZ 46 | 63 | #define PORT_DZ 46 |
| 67 | #define PORT_ZS 47 | 64 | #define PORT_ZS 47 |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index f2d12d5a21b8..fd83f2584b15 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -43,7 +43,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | #ifdef CONFIG_TMPFS_POSIX_ACL | 45 | #ifdef CONFIG_TMPFS_POSIX_ACL |
| 46 | int shmem_permission(struct inode *, int, struct nameidata *); | 46 | int shmem_permission(struct inode *, int); |
| 47 | int shmem_acl_init(struct inode *, struct inode *); | 47 | int shmem_acl_init(struct inode *, struct inode *); |
| 48 | void shmem_acl_destroy_inode(struct inode *); | 48 | void shmem_acl_destroy_inode(struct inode *); |
| 49 | 49 | ||
diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h index ea037f28df91..bef0c46d4713 100644 --- a/include/linux/signalfd.h +++ b/include/linux/signalfd.h | |||
| @@ -8,6 +8,12 @@ | |||
| 8 | #ifndef _LINUX_SIGNALFD_H | 8 | #ifndef _LINUX_SIGNALFD_H |
| 9 | #define _LINUX_SIGNALFD_H | 9 | #define _LINUX_SIGNALFD_H |
| 10 | 10 | ||
| 11 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
| 12 | #include <linux/fcntl.h> | ||
| 13 | |||
| 14 | /* Flags for signalfd4. */ | ||
| 15 | #define SFD_CLOEXEC O_CLOEXEC | ||
| 16 | #define SFD_NONBLOCK O_NONBLOCK | ||
| 11 | 17 | ||
| 12 | struct signalfd_siginfo { | 18 | struct signalfd_siginfo { |
| 13 | __u32 ssi_signo; | 19 | __u32 ssi_signo; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 9aa90a6f20e0..5ff9676c1e2c 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -58,7 +58,7 @@ int slab_is_available(void); | |||
| 58 | 58 | ||
| 59 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, | 59 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, |
| 60 | unsigned long, | 60 | unsigned long, |
| 61 | void (*)(struct kmem_cache *, void *)); | 61 | void (*)(void *)); |
| 62 | void kmem_cache_destroy(struct kmem_cache *); | 62 | void kmem_cache_destroy(struct kmem_cache *); |
| 63 | int kmem_cache_shrink(struct kmem_cache *); | 63 | int kmem_cache_shrink(struct kmem_cache *); |
| 64 | void kmem_cache_free(struct kmem_cache *, void *); | 64 | void kmem_cache_free(struct kmem_cache *, void *); |
| @@ -96,6 +96,7 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); | |||
| 96 | /* | 96 | /* |
| 97 | * Common kmalloc functions provided by all allocators | 97 | * Common kmalloc functions provided by all allocators |
| 98 | */ | 98 | */ |
| 99 | void * __must_check __krealloc(const void *, size_t, gfp_t); | ||
| 99 | void * __must_check krealloc(const void *, size_t, gfp_t); | 100 | void * __must_check krealloc(const void *, size_t, gfp_t); |
| 100 | void kfree(const void *); | 101 | void kfree(const void *); |
| 101 | size_t ksize(const void *); | 102 | size_t ksize(const void *); |
| @@ -180,7 +181,7 @@ size_t ksize(const void *); | |||
| 180 | */ | 181 | */ |
| 181 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | 182 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
| 182 | { | 183 | { |
| 183 | if (n != 0 && size > ULONG_MAX / n) | 184 | if (size != 0 && n > ULONG_MAX / size) |
| 184 | return NULL; | 185 | return NULL; |
| 185 | return __kmalloc(n * size, flags | __GFP_ZERO); | 186 | return __kmalloc(n * size, flags | __GFP_ZERO); |
| 186 | } | 187 | } |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index d117ea2825a9..5bad61a93f65 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -85,7 +85,7 @@ struct kmem_cache { | |||
| 85 | struct kmem_cache_order_objects min; | 85 | struct kmem_cache_order_objects min; |
| 86 | gfp_t allocflags; /* gfp flags to use on each alloc */ | 86 | gfp_t allocflags; /* gfp flags to use on each alloc */ |
| 87 | int refcount; /* Refcount for slab cache destroy */ | 87 | int refcount; /* Refcount for slab cache destroy */ |
| 88 | void (*ctor)(struct kmem_cache *, void *); | 88 | void (*ctor)(void *); |
| 89 | int inuse; /* Offset to metadata */ | 89 | int inuse; /* Offset to metadata */ |
| 90 | int align; /* Alignment */ | 90 | int align; /* Alignment */ |
| 91 | const char *name; /* Name (only for display!) */ | 91 | const char *name; /* Name (only for display!) */ |
diff --git a/include/linux/sm501.h b/include/linux/sm501.h index 95c1c39ba445..214f93209b8c 100644 --- a/include/linux/sm501.h +++ b/include/linux/sm501.h | |||
| @@ -46,24 +46,6 @@ extern unsigned long sm501_modify_reg(struct device *dev, | |||
| 46 | unsigned long set, | 46 | unsigned long set, |
| 47 | unsigned long clear); | 47 | unsigned long clear); |
| 48 | 48 | ||
| 49 | /* sm501_gpio_set | ||
| 50 | * | ||
| 51 | * set the state of the given GPIO line | ||
| 52 | */ | ||
| 53 | |||
| 54 | extern void sm501_gpio_set(struct device *dev, | ||
| 55 | unsigned long gpio, | ||
| 56 | unsigned int to, | ||
| 57 | unsigned int dir); | ||
| 58 | |||
| 59 | /* sm501_gpio_get | ||
| 60 | * | ||
| 61 | * get the state of the given GPIO line | ||
| 62 | */ | ||
| 63 | |||
| 64 | extern unsigned long sm501_gpio_get(struct device *dev, | ||
| 65 | unsigned long gpio); | ||
| 66 | |||
| 67 | 49 | ||
| 68 | /* Platform data definitions */ | 50 | /* Platform data definitions */ |
| 69 | 51 | ||
| @@ -73,6 +55,8 @@ extern unsigned long sm501_gpio_get(struct device *dev, | |||
| 73 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) | 55 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) |
| 74 | #define SM501FB_FLAG_PANEL_NO_FPEN (1<<4) | 56 | #define SM501FB_FLAG_PANEL_NO_FPEN (1<<4) |
| 75 | #define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5) | 57 | #define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5) |
| 58 | #define SM501FB_FLAG_PANEL_INV_FPEN (1<<6) | ||
| 59 | #define SM501FB_FLAG_PANEL_INV_VBIASEN (1<<7) | ||
| 76 | 60 | ||
| 77 | struct sm501_platdata_fbsub { | 61 | struct sm501_platdata_fbsub { |
| 78 | struct fb_videomode *def_mode; | 62 | struct fb_videomode *def_mode; |
| @@ -102,11 +86,19 @@ struct sm501_platdata_fb { | |||
| 102 | struct sm501_platdata_fbsub *fb_pnl; | 86 | struct sm501_platdata_fbsub *fb_pnl; |
| 103 | }; | 87 | }; |
| 104 | 88 | ||
| 105 | /* gpio i2c */ | 89 | /* gpio i2c |
| 90 | * | ||
| 91 | * Note, we have to pass in the bus number, as the number used will be | ||
| 92 | * passed to the i2c-gpio driver's platform_device.id, subsequently used | ||
| 93 | * to register the i2c bus. | ||
| 94 | */ | ||
| 106 | 95 | ||
| 107 | struct sm501_platdata_gpio_i2c { | 96 | struct sm501_platdata_gpio_i2c { |
| 97 | unsigned int bus_num; | ||
| 108 | unsigned int pin_sda; | 98 | unsigned int pin_sda; |
| 109 | unsigned int pin_scl; | 99 | unsigned int pin_scl; |
| 100 | int udelay; | ||
| 101 | int timeout; | ||
| 110 | }; | 102 | }; |
| 111 | 103 | ||
| 112 | /* sm501_initdata | 104 | /* sm501_initdata |
| @@ -129,6 +121,7 @@ struct sm501_reg_init { | |||
| 129 | #define SM501_USE_FBACCEL (1<<6) | 121 | #define SM501_USE_FBACCEL (1<<6) |
| 130 | #define SM501_USE_AC97 (1<<7) | 122 | #define SM501_USE_AC97 (1<<7) |
| 131 | #define SM501_USE_I2S (1<<8) | 123 | #define SM501_USE_I2S (1<<8) |
| 124 | #define SM501_USE_GPIO (1<<9) | ||
| 132 | 125 | ||
| 133 | #define SM501_USE_ALL (0xffffffff) | 126 | #define SM501_USE_ALL (0xffffffff) |
| 134 | 127 | ||
| @@ -155,6 +148,8 @@ struct sm501_init_gpio { | |||
| 155 | struct sm501_reg_init gpio_ddr_high; | 148 | struct sm501_reg_init gpio_ddr_high; |
| 156 | }; | 149 | }; |
| 157 | 150 | ||
| 151 | #define SM501_FLAG_SUSPEND_OFF (1<<4) | ||
| 152 | |||
| 158 | /* sm501_platdata | 153 | /* sm501_platdata |
| 159 | * | 154 | * |
| 160 | * This is passed with the platform device to allow the board | 155 | * This is passed with the platform device to allow the board |
| @@ -168,6 +163,12 @@ struct sm501_platdata { | |||
| 168 | struct sm501_init_gpio *init_gpiop; | 163 | struct sm501_init_gpio *init_gpiop; |
| 169 | struct sm501_platdata_fb *fb; | 164 | struct sm501_platdata_fb *fb; |
| 170 | 165 | ||
| 166 | int flags; | ||
| 167 | int gpio_base; | ||
| 168 | |||
| 169 | int (*get_power)(struct device *dev); | ||
| 170 | int (*set_power)(struct device *dev, unsigned int on); | ||
| 171 | |||
| 171 | struct sm501_platdata_gpio_i2c *gpio_i2c; | 172 | struct sm501_platdata_gpio_i2c *gpio_i2c; |
| 172 | unsigned int gpio_i2c_nr; | 173 | unsigned int gpio_i2c_nr; |
| 173 | }; | 174 | }; |
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index 2c5cd55f44ff..923cd8a247b1 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h | |||
| @@ -43,18 +43,13 @@ static inline struct smb_inode_info *SMB_I(struct inode *inode) | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | /* macro names are short for word, double-word, long value (?) */ | 45 | /* macro names are short for word, double-word, long value (?) */ |
| 46 | #define WVAL(buf,pos) \ | 46 | #define WVAL(buf, pos) (get_unaligned_le16((u8 *)(buf) + (pos))) |
| 47 | (le16_to_cpu(get_unaligned((__le16 *)((u8 *)(buf) + (pos))))) | 47 | #define DVAL(buf, pos) (get_unaligned_le32((u8 *)(buf) + (pos))) |
| 48 | #define DVAL(buf,pos) \ | 48 | #define LVAL(buf, pos) (get_unaligned_le64((u8 *)(buf) + (pos))) |
| 49 | (le32_to_cpu(get_unaligned((__le32 *)((u8 *)(buf) + (pos))))) | 49 | |
| 50 | #define LVAL(buf,pos) \ | 50 | #define WSET(buf, pos, val) put_unaligned_le16((val), (u8 *)(buf) + (pos)) |
| 51 | (le64_to_cpu(get_unaligned((__le64 *)((u8 *)(buf) + (pos))))) | 51 | #define DSET(buf, pos, val) put_unaligned_le32((val), (u8 *)(buf) + (pos)) |
| 52 | #define WSET(buf,pos,val) \ | 52 | #define LSET(buf, pos, val) put_unaligned_le64((val), (u8 *)(buf) + (pos)) |
| 53 | put_unaligned(cpu_to_le16((u16)(val)), (__le16 *)((u8 *)(buf) + (pos))) | ||
| 54 | #define DSET(buf,pos,val) \ | ||
| 55 | put_unaligned(cpu_to_le32((u32)(val)), (__le32 *)((u8 *)(buf) + (pos))) | ||
| 56 | #define LSET(buf,pos,val) \ | ||
| 57 | put_unaligned(cpu_to_le64((u64)(val)), (__le64 *)((u8 *)(buf) + (pos))) | ||
| 58 | 53 | ||
| 59 | /* where to find the base of the SMB packet proper */ | 54 | /* where to find the base of the SMB packet proper */ |
| 60 | #define smb_base(buf) ((u8 *)(((u8 *)(buf))+4)) | 55 | #define smb_base(buf) ((u8 *)(((u8 *)(buf))+4)) |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 48262f86c969..66484d4a8459 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -74,15 +74,10 @@ void __smp_call_function_single(int cpuid, struct call_single_data *data); | |||
| 74 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS | 74 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS |
| 75 | void generic_smp_call_function_single_interrupt(void); | 75 | void generic_smp_call_function_single_interrupt(void); |
| 76 | void generic_smp_call_function_interrupt(void); | 76 | void generic_smp_call_function_interrupt(void); |
| 77 | void init_call_single_data(void); | ||
| 78 | void ipi_call_lock(void); | 77 | void ipi_call_lock(void); |
| 79 | void ipi_call_unlock(void); | 78 | void ipi_call_unlock(void); |
| 80 | void ipi_call_lock_irq(void); | 79 | void ipi_call_lock_irq(void); |
| 81 | void ipi_call_unlock_irq(void); | 80 | void ipi_call_unlock_irq(void); |
| 82 | #else | ||
| 83 | static inline void init_call_single_data(void) | ||
| 84 | { | ||
| 85 | } | ||
| 86 | #endif | 81 | #endif |
| 87 | 82 | ||
| 88 | /* | 83 | /* |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 950af631e7fb..dc5086fe7736 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -189,7 +189,8 @@ struct ucred { | |||
| 189 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ | 189 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ |
| 190 | #define AF_IUCV 32 /* IUCV sockets */ | 190 | #define AF_IUCV 32 /* IUCV sockets */ |
| 191 | #define AF_RXRPC 33 /* RxRPC sockets */ | 191 | #define AF_RXRPC 33 /* RxRPC sockets */ |
| 192 | #define AF_MAX 34 /* For now.. */ | 192 | #define AF_ISDN 34 /* mISDN sockets */ |
| 193 | #define AF_MAX 35 /* For now.. */ | ||
| 193 | 194 | ||
| 194 | /* Protocol families, same as address families. */ | 195 | /* Protocol families, same as address families. */ |
| 195 | #define PF_UNSPEC AF_UNSPEC | 196 | #define PF_UNSPEC AF_UNSPEC |
| @@ -225,6 +226,7 @@ struct ucred { | |||
| 225 | #define PF_BLUETOOTH AF_BLUETOOTH | 226 | #define PF_BLUETOOTH AF_BLUETOOTH |
| 226 | #define PF_IUCV AF_IUCV | 227 | #define PF_IUCV AF_IUCV |
| 227 | #define PF_RXRPC AF_RXRPC | 228 | #define PF_RXRPC AF_RXRPC |
| 229 | #define PF_ISDN AF_ISDN | ||
| 228 | #define PF_MAX AF_MAX | 230 | #define PF_MAX AF_MAX |
| 229 | 231 | ||
| 230 | /* Maximum queue length specifiable by listen. */ | 232 | /* Maximum queue length specifiable by listen. */ |
diff --git a/include/linux/spi/ds1305.h b/include/linux/spi/ds1305.h new file mode 100644 index 000000000000..287ec830eab7 --- /dev/null +++ b/include/linux/spi/ds1305.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | #ifndef __LINUX_SPI_DS1305_H | ||
| 2 | #define __LINUX_SPI_DS1305_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * One-time configuration for ds1305 and ds1306 RTC chips. | ||
| 6 | * | ||
| 7 | * Put a pointer to this in spi_board_info.platform_data if you want to | ||
| 8 | * be sure that Linux (re)initializes this as needed ... after losing | ||
| 9 | * backup power, and potentially on the first boot. | ||
| 10 | */ | ||
| 11 | struct ds1305_platform_data { | ||
| 12 | |||
| 13 | /* Trickle charge configuration: it's OK to leave out the MAGIC | ||
| 14 | * bitmask; mask in either DS1 or DS2, and then one of 2K/4k/8K. | ||
| 15 | */ | ||
| 16 | #define DS1305_TRICKLE_MAGIC 0xa0 | ||
| 17 | #define DS1305_TRICKLE_DS2 0x08 /* two diodes */ | ||
| 18 | #define DS1305_TRICKLE_DS1 0x04 /* one diode */ | ||
| 19 | #define DS1305_TRICKLE_2K 0x01 /* 2 KOhm resistance */ | ||
| 20 | #define DS1305_TRICKLE_4K 0x02 /* 4 KOhm resistance */ | ||
| 21 | #define DS1305_TRICKLE_8K 0x03 /* 8 KOhm resistance */ | ||
| 22 | u8 trickle; | ||
| 23 | |||
| 24 | /* set only on ds1306 parts */ | ||
| 25 | bool is_ds1306; | ||
| 26 | |||
| 27 | /* ds1306 only: enable 1 Hz output */ | ||
| 28 | bool en_1hz; | ||
| 29 | |||
| 30 | /* REVISIT: the driver currently expects nINT0 to be wired | ||
| 31 | * as the alarm IRQ. ALM1 may also need to be set up ... | ||
| 32 | */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | #endif /* __LINUX_SPI_DS1305_H */ | ||
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h index 835ddf47d45c..22ef107d7704 100644 --- a/include/linux/spi/mcp23s08.h +++ b/include/linux/spi/mcp23s08.h | |||
| @@ -1,18 +1,25 @@ | |||
| 1 | 1 | ||
| 2 | /* FIXME driver should be able to handle all four slaves that | 2 | /* FIXME driver should be able to handle IRQs... */ |
| 3 | * can be hooked up to each chipselect, as well as IRQs... | 3 | |
| 4 | */ | 4 | struct mcp23s08_chip_info { |
| 5 | bool is_present; /* true iff populated */ | ||
| 6 | u8 pullups; /* BIT(x) means enable pullup x */ | ||
| 7 | }; | ||
| 5 | 8 | ||
| 6 | struct mcp23s08_platform_data { | 9 | struct mcp23s08_platform_data { |
| 7 | /* four slaves can share one SPI chipselect */ | 10 | /* Four slaves (numbered 0..3) can share one SPI chipselect, and |
| 8 | u8 slave; | 11 | * will provide 8..32 GPIOs using 1..4 gpio_chip instances. |
| 12 | */ | ||
| 13 | struct mcp23s08_chip_info chip[4]; | ||
| 9 | 14 | ||
| 10 | /* number assigned to the first GPIO */ | 15 | /* "base" is the number of the first GPIO. Dynamic assignment is |
| 16 | * not currently supported, and even if there are gaps in chip | ||
| 17 | * addressing the GPIO numbers are sequential .. so for example | ||
| 18 | * if only slaves 0 and 3 are present, their GPIOs range from | ||
| 19 | * base to base+15. | ||
| 20 | */ | ||
| 11 | unsigned base; | 21 | unsigned base; |
| 12 | 22 | ||
| 13 | /* pins with pullups */ | ||
| 14 | u8 pullups; | ||
| 15 | |||
| 16 | void *context; /* param to setup/teardown */ | 23 | void *context; /* param to setup/teardown */ |
| 17 | 24 | ||
| 18 | int (*setup)(struct spi_device *spi, | 25 | int (*setup)(struct spi_device *spi, |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index b9a76c972084..a9cc29d46653 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -82,7 +82,7 @@ struct spi_device { | |||
| 82 | int irq; | 82 | int irq; |
| 83 | void *controller_state; | 83 | void *controller_state; |
| 84 | void *controller_data; | 84 | void *controller_data; |
| 85 | const char *modalias; | 85 | char modalias[32]; |
| 86 | 86 | ||
| 87 | /* | 87 | /* |
| 88 | * likely need more hooks for more protocol options affecting how | 88 | * likely need more hooks for more protocol options affecting how |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index d311a090fae7..61e5610ad165 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | * linux/spinlock.h: builds the final spin_*() APIs. | 46 | * linux/spinlock.h: builds the final spin_*() APIs. |
| 47 | */ | 47 | */ |
| 48 | 48 | ||
| 49 | #include <linux/typecheck.h> | ||
| 49 | #include <linux/preempt.h> | 50 | #include <linux/preempt.h> |
| 50 | #include <linux/linkage.h> | 51 | #include <linux/linkage.h> |
| 51 | #include <linux/compiler.h> | 52 | #include <linux/compiler.h> |
| @@ -191,23 +192,53 @@ do { \ | |||
| 191 | 192 | ||
| 192 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 193 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
| 193 | 194 | ||
| 194 | #define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock) | 195 | #define spin_lock_irqsave(lock, flags) \ |
| 195 | #define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock) | 196 | do { \ |
| 196 | #define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock) | 197 | typecheck(unsigned long, flags); \ |
| 198 | flags = _spin_lock_irqsave(lock); \ | ||
| 199 | } while (0) | ||
| 200 | #define read_lock_irqsave(lock, flags) \ | ||
| 201 | do { \ | ||
| 202 | typecheck(unsigned long, flags); \ | ||
| 203 | flags = _read_lock_irqsave(lock); \ | ||
| 204 | } while (0) | ||
| 205 | #define write_lock_irqsave(lock, flags) \ | ||
| 206 | do { \ | ||
| 207 | typecheck(unsigned long, flags); \ | ||
| 208 | flags = _write_lock_irqsave(lock); \ | ||
| 209 | } while (0) | ||
| 197 | 210 | ||
| 198 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 211 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 199 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | 212 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ |
| 200 | flags = _spin_lock_irqsave_nested(lock, subclass) | 213 | do { \ |
| 214 | typecheck(unsigned long, flags); \ | ||
| 215 | flags = _spin_lock_irqsave_nested(lock, subclass); \ | ||
| 216 | } while (0) | ||
| 201 | #else | 217 | #else |
| 202 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | 218 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ |
| 203 | flags = _spin_lock_irqsave(lock) | 219 | do { \ |
| 220 | typecheck(unsigned long, flags); \ | ||
| 221 | flags = _spin_lock_irqsave(lock); \ | ||
| 222 | } while (0) | ||
| 204 | #endif | 223 | #endif |
| 205 | 224 | ||
| 206 | #else | 225 | #else |
| 207 | 226 | ||
| 208 | #define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags) | 227 | #define spin_lock_irqsave(lock, flags) \ |
| 209 | #define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags) | 228 | do { \ |
| 210 | #define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags) | 229 | typecheck(unsigned long, flags); \ |
| 230 | _spin_lock_irqsave(lock, flags); \ | ||
| 231 | } while (0) | ||
| 232 | #define read_lock_irqsave(lock, flags) \ | ||
| 233 | do { \ | ||
| 234 | typecheck(unsigned long, flags); \ | ||
| 235 | _read_lock_irqsave(lock, flags); \ | ||
| 236 | } while (0) | ||
| 237 | #define write_lock_irqsave(lock, flags) \ | ||
| 238 | do { \ | ||
| 239 | typecheck(unsigned long, flags); \ | ||
| 240 | _write_lock_irqsave(lock, flags); \ | ||
| 241 | } while (0) | ||
| 211 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | 242 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ |
| 212 | spin_lock_irqsave(lock, flags) | 243 | spin_lock_irqsave(lock, flags) |
| 213 | 244 | ||
| @@ -260,16 +291,25 @@ do { \ | |||
| 260 | } while (0) | 291 | } while (0) |
| 261 | #endif | 292 | #endif |
| 262 | 293 | ||
| 263 | #define spin_unlock_irqrestore(lock, flags) \ | 294 | #define spin_unlock_irqrestore(lock, flags) \ |
| 264 | _spin_unlock_irqrestore(lock, flags) | 295 | do { \ |
| 296 | typecheck(unsigned long, flags); \ | ||
| 297 | _spin_unlock_irqrestore(lock, flags); \ | ||
| 298 | } while (0) | ||
| 265 | #define spin_unlock_bh(lock) _spin_unlock_bh(lock) | 299 | #define spin_unlock_bh(lock) _spin_unlock_bh(lock) |
| 266 | 300 | ||
| 267 | #define read_unlock_irqrestore(lock, flags) \ | 301 | #define read_unlock_irqrestore(lock, flags) \ |
| 268 | _read_unlock_irqrestore(lock, flags) | 302 | do { \ |
| 303 | typecheck(unsigned long, flags); \ | ||
| 304 | _read_unlock_irqrestore(lock, flags); \ | ||
| 305 | } while (0) | ||
| 269 | #define read_unlock_bh(lock) _read_unlock_bh(lock) | 306 | #define read_unlock_bh(lock) _read_unlock_bh(lock) |
| 270 | 307 | ||
| 271 | #define write_unlock_irqrestore(lock, flags) \ | 308 | #define write_unlock_irqrestore(lock, flags) \ |
| 272 | _write_unlock_irqrestore(lock, flags) | 309 | do { \ |
| 310 | typecheck(unsigned long, flags); \ | ||
| 311 | _write_unlock_irqrestore(lock, flags); \ | ||
| 312 | } while (0) | ||
| 273 | #define write_unlock_bh(lock) _write_unlock_bh(lock) | 313 | #define write_unlock_bh(lock) _write_unlock_bh(lock) |
| 274 | 314 | ||
| 275 | #define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock)) | 315 | #define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock)) |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 4bf8cade9dbc..e530026eedf7 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -427,9 +427,9 @@ static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr) | |||
| 427 | { | 427 | { |
| 428 | switch (dev->bus->bustype) { | 428 | switch (dev->bus->bustype) { |
| 429 | case SSB_BUSTYPE_PCI: | 429 | case SSB_BUSTYPE_PCI: |
| 430 | return pci_dma_mapping_error(addr); | 430 | return pci_dma_mapping_error(dev->bus->host_pci, addr); |
| 431 | case SSB_BUSTYPE_SSB: | 431 | case SSB_BUSTYPE_SSB: |
| 432 | return dma_mapping_error(addr); | 432 | return dma_mapping_error(dev->dev, addr); |
| 433 | default: | 433 | default: |
| 434 | __ssb_dma_not_implemented(dev); | 434 | __ssb_dma_not_implemented(dev); |
| 435 | } | 435 | } |
diff --git a/include/linux/string.h b/include/linux/string.h index efdc44593b52..810d80df0a1d 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -111,5 +111,8 @@ extern void argv_free(char **argv); | |||
| 111 | 111 | ||
| 112 | extern bool sysfs_streq(const char *s1, const char *s2); | 112 | extern bool sysfs_streq(const char *s1, const char *s2); |
| 113 | 113 | ||
| 114 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | ||
| 115 | const void *from, size_t available); | ||
| 116 | |||
| 114 | #endif | 117 | #endif |
| 115 | #endif /* _LINUX_STRING_H_ */ | 118 | #endif /* _LINUX_STRING_H_ */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index e8e69159af71..c63435095970 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -278,4 +278,6 @@ static inline void register_nosave_region_late(unsigned long b, unsigned long e) | |||
| 278 | } | 278 | } |
| 279 | #endif | 279 | #endif |
| 280 | 280 | ||
| 281 | extern struct mutex pm_mutex; | ||
| 282 | |||
| 281 | #endif /* _LINUX_SUSPEND_H */ | 283 | #endif /* _LINUX_SUSPEND_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 0b3377650c85..de40f169a4e4 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -237,7 +237,6 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t, | |||
| 237 | 237 | ||
| 238 | /* linux/mm/swapfile.c */ | 238 | /* linux/mm/swapfile.c */ |
| 239 | extern long total_swap_pages; | 239 | extern long total_swap_pages; |
| 240 | extern unsigned int nr_swapfiles; | ||
| 241 | extern void si_swapinfo(struct sysinfo *); | 240 | extern void si_swapinfo(struct sysinfo *); |
| 242 | extern swp_entry_t get_swap_page(void); | 241 | extern swp_entry_t get_swap_page(void); |
| 243 | extern swp_entry_t get_swap_page_of_type(int); | 242 | extern swp_entry_t get_swap_page_of_type(int); |
| @@ -254,8 +253,6 @@ extern int can_share_swap_page(struct page *); | |||
| 254 | extern int remove_exclusive_swap_page(struct page *); | 253 | extern int remove_exclusive_swap_page(struct page *); |
| 255 | struct backing_dev_info; | 254 | struct backing_dev_info; |
| 256 | 255 | ||
| 257 | extern spinlock_t swap_lock; | ||
| 258 | |||
| 259 | /* linux/mm/thrash.c */ | 256 | /* linux/mm/thrash.c */ |
| 260 | extern struct mm_struct * swap_token_mm; | 257 | extern struct mm_struct * swap_token_mm; |
| 261 | extern void grab_swap_token(void); | 258 | extern void grab_swap_token(void); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 0522f368f9d7..d6ff145919ca 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -305,6 +305,7 @@ asmlinkage long sys_fcntl64(unsigned int fd, | |||
| 305 | #endif | 305 | #endif |
| 306 | asmlinkage long sys_dup(unsigned int fildes); | 306 | asmlinkage long sys_dup(unsigned int fildes); |
| 307 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); | 307 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); |
| 308 | asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags); | ||
| 308 | asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on); | 309 | asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on); |
| 309 | asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, | 310 | asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, |
| 310 | unsigned long arg); | 311 | unsigned long arg); |
| @@ -409,6 +410,8 @@ asmlinkage long sys_getsockopt(int fd, int level, int optname, | |||
| 409 | asmlinkage long sys_bind(int, struct sockaddr __user *, int); | 410 | asmlinkage long sys_bind(int, struct sockaddr __user *, int); |
| 410 | asmlinkage long sys_connect(int, struct sockaddr __user *, int); | 411 | asmlinkage long sys_connect(int, struct sockaddr __user *, int); |
| 411 | asmlinkage long sys_accept(int, struct sockaddr __user *, int __user *); | 412 | asmlinkage long sys_accept(int, struct sockaddr __user *, int __user *); |
| 413 | asmlinkage long sys_paccept(int, struct sockaddr __user *, int __user *, | ||
| 414 | const __user sigset_t *, size_t, int); | ||
| 412 | asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *); | 415 | asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *); |
| 413 | asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *); | 416 | asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *); |
| 414 | asmlinkage long sys_send(int, void __user *, size_t, unsigned); | 417 | asmlinkage long sys_send(int, void __user *, size_t, unsigned); |
| @@ -428,6 +431,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | |||
| 428 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 431 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, |
| 429 | fd_set __user *exp, struct timeval __user *tvp); | 432 | fd_set __user *exp, struct timeval __user *tvp); |
| 430 | asmlinkage long sys_epoll_create(int size); | 433 | asmlinkage long sys_epoll_create(int size); |
| 434 | asmlinkage long sys_epoll_create1(int flags); | ||
| 431 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, | 435 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, |
| 432 | struct epoll_event __user *event); | 436 | struct epoll_event __user *event); |
| 433 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, | 437 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, |
| @@ -443,7 +447,7 @@ asmlinkage long sys_newuname(struct new_utsname __user *name); | |||
| 443 | 447 | ||
| 444 | asmlinkage long sys_getrlimit(unsigned int resource, | 448 | asmlinkage long sys_getrlimit(unsigned int resource, |
| 445 | struct rlimit __user *rlim); | 449 | struct rlimit __user *rlim); |
| 446 | #if defined(COMPAT_RLIM_OLD_INFINITY) || !(defined(CONFIG_IA64) || defined(CONFIG_V850)) | 450 | #if defined(COMPAT_RLIM_OLD_INFINITY) || !(defined(CONFIG_IA64)) |
| 447 | asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim); | 451 | asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim); |
| 448 | #endif | 452 | #endif |
| 449 | asmlinkage long sys_setrlimit(unsigned int resource, | 453 | asmlinkage long sys_setrlimit(unsigned int resource, |
| @@ -543,6 +547,7 @@ asmlinkage long sys_get_mempolicy(int __user *policy, | |||
| 543 | unsigned long addr, unsigned long flags); | 547 | unsigned long addr, unsigned long flags); |
| 544 | 548 | ||
| 545 | asmlinkage long sys_inotify_init(void); | 549 | asmlinkage long sys_inotify_init(void); |
| 550 | asmlinkage long sys_inotify_init1(int flags); | ||
| 546 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, | 551 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, |
| 547 | u32 mask); | 552 | u32 mask); |
| 548 | asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); | 553 | asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); |
| @@ -608,12 +613,14 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | |||
| 608 | size_t len); | 613 | size_t len); |
| 609 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | 614 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); |
| 610 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); | 615 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); |
| 616 | asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, size_t sizemask, int flags); | ||
| 611 | asmlinkage long sys_timerfd_create(int clockid, int flags); | 617 | asmlinkage long sys_timerfd_create(int clockid, int flags); |
| 612 | asmlinkage long sys_timerfd_settime(int ufd, int flags, | 618 | asmlinkage long sys_timerfd_settime(int ufd, int flags, |
| 613 | const struct itimerspec __user *utmr, | 619 | const struct itimerspec __user *utmr, |
| 614 | struct itimerspec __user *otmr); | 620 | struct itimerspec __user *otmr); |
| 615 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); | 621 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); |
| 616 | asmlinkage long sys_eventfd(unsigned int count); | 622 | asmlinkage long sys_eventfd(unsigned int count); |
| 623 | asmlinkage long sys_eventfd2(unsigned int count, int flags); | ||
| 617 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | 624 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
| 618 | 625 | ||
| 619 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 626 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 24141b4d1a11..d0437f36921f 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -947,6 +947,22 @@ struct ctl_table; | |||
| 947 | struct nsproxy; | 947 | struct nsproxy; |
| 948 | struct ctl_table_root; | 948 | struct ctl_table_root; |
| 949 | 949 | ||
| 950 | struct ctl_table_set { | ||
| 951 | struct list_head list; | ||
| 952 | struct ctl_table_set *parent; | ||
| 953 | int (*is_seen)(struct ctl_table_set *); | ||
| 954 | }; | ||
| 955 | |||
| 956 | extern void setup_sysctl_set(struct ctl_table_set *p, | ||
| 957 | struct ctl_table_set *parent, | ||
| 958 | int (*is_seen)(struct ctl_table_set *)); | ||
| 959 | |||
| 960 | struct ctl_table_header; | ||
| 961 | |||
| 962 | extern void sysctl_head_get(struct ctl_table_header *); | ||
| 963 | extern void sysctl_head_put(struct ctl_table_header *); | ||
| 964 | extern int sysctl_is_seen(struct ctl_table_header *); | ||
| 965 | extern struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *); | ||
| 950 | extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev); | 966 | extern struct ctl_table_header *sysctl_head_next(struct ctl_table_header *prev); |
| 951 | extern struct ctl_table_header *__sysctl_head_next(struct nsproxy *namespaces, | 967 | extern struct ctl_table_header *__sysctl_head_next(struct nsproxy *namespaces, |
| 952 | struct ctl_table_header *prev); | 968 | struct ctl_table_header *prev); |
| @@ -1049,8 +1065,8 @@ struct ctl_table | |||
| 1049 | 1065 | ||
| 1050 | struct ctl_table_root { | 1066 | struct ctl_table_root { |
| 1051 | struct list_head root_list; | 1067 | struct list_head root_list; |
| 1052 | struct list_head header_list; | 1068 | struct ctl_table_set default_set; |
| 1053 | struct list_head *(*lookup)(struct ctl_table_root *root, | 1069 | struct ctl_table_set *(*lookup)(struct ctl_table_root *root, |
| 1054 | struct nsproxy *namespaces); | 1070 | struct nsproxy *namespaces); |
| 1055 | int (*permissions)(struct ctl_table_root *root, | 1071 | int (*permissions)(struct ctl_table_root *root, |
| 1056 | struct nsproxy *namespaces, struct ctl_table *table); | 1072 | struct nsproxy *namespaces, struct ctl_table *table); |
| @@ -1063,9 +1079,14 @@ struct ctl_table_header | |||
| 1063 | struct ctl_table *ctl_table; | 1079 | struct ctl_table *ctl_table; |
| 1064 | struct list_head ctl_entry; | 1080 | struct list_head ctl_entry; |
| 1065 | int used; | 1081 | int used; |
| 1082 | int count; | ||
| 1066 | struct completion *unregistering; | 1083 | struct completion *unregistering; |
| 1067 | struct ctl_table *ctl_table_arg; | 1084 | struct ctl_table *ctl_table_arg; |
| 1068 | struct ctl_table_root *root; | 1085 | struct ctl_table_root *root; |
| 1086 | struct ctl_table_set *set; | ||
| 1087 | struct ctl_table *attached_by; | ||
| 1088 | struct ctl_table *attached_to; | ||
| 1089 | struct ctl_table_header *parent; | ||
| 1069 | }; | 1090 | }; |
| 1070 | 1091 | ||
| 1071 | /* struct ctl_path describes where in the hierarchy a table is added */ | 1092 | /* struct ctl_path describes where in the hierarchy a table is added */ |
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index 5d69c0744fff..18269e956a71 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | #define TASKSTATS_VERSION 6 | 34 | #define TASKSTATS_VERSION 7 |
| 35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | 35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN |
| 36 | * in linux/sched.h */ | 36 | * in linux/sched.h */ |
| 37 | 37 | ||
| @@ -157,6 +157,10 @@ struct taskstats { | |||
| 157 | __u64 ac_utimescaled; /* utime scaled on frequency etc */ | 157 | __u64 ac_utimescaled; /* utime scaled on frequency etc */ |
| 158 | __u64 ac_stimescaled; /* stime scaled on frequency etc */ | 158 | __u64 ac_stimescaled; /* stime scaled on frequency etc */ |
| 159 | __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ | 159 | __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ |
| 160 | |||
| 161 | /* Delay waiting for memory reclaim */ | ||
| 162 | __u64 freepages_count; | ||
| 163 | __u64 freepages_delay_total; | ||
| 160 | }; | 164 | }; |
| 161 | 165 | ||
| 162 | 166 | ||
diff --git a/include/linux/tick.h b/include/linux/tick.h index a881c652f7e9..d3c02695dc5d 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
| @@ -49,6 +49,7 @@ struct tick_sched { | |||
| 49 | unsigned long check_clocks; | 49 | unsigned long check_clocks; |
| 50 | enum tick_nohz_mode nohz_mode; | 50 | enum tick_nohz_mode nohz_mode; |
| 51 | ktime_t idle_tick; | 51 | ktime_t idle_tick; |
| 52 | int inidle; | ||
| 52 | int tick_stopped; | 53 | int tick_stopped; |
| 53 | unsigned long idle_jiffies; | 54 | unsigned long idle_jiffies; |
| 54 | unsigned long idle_calls; | 55 | unsigned long idle_calls; |
| @@ -105,14 +106,14 @@ static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | |||
| 105 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | 106 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ |
| 106 | 107 | ||
| 107 | # ifdef CONFIG_NO_HZ | 108 | # ifdef CONFIG_NO_HZ |
| 108 | extern void tick_nohz_stop_sched_tick(void); | 109 | extern void tick_nohz_stop_sched_tick(int inidle); |
| 109 | extern void tick_nohz_restart_sched_tick(void); | 110 | extern void tick_nohz_restart_sched_tick(void); |
| 110 | extern void tick_nohz_update_jiffies(void); | 111 | extern void tick_nohz_update_jiffies(void); |
| 111 | extern ktime_t tick_nohz_get_sleep_length(void); | 112 | extern ktime_t tick_nohz_get_sleep_length(void); |
| 112 | extern void tick_nohz_stop_idle(int cpu); | 113 | extern void tick_nohz_stop_idle(int cpu); |
| 113 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); | 114 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); |
| 114 | # else | 115 | # else |
| 115 | static inline void tick_nohz_stop_sched_tick(void) { } | 116 | static inline void tick_nohz_stop_sched_tick(int inidle) { } |
| 116 | static inline void tick_nohz_restart_sched_tick(void) { } | 117 | static inline void tick_nohz_restart_sched_tick(void) { } |
| 117 | static inline void tick_nohz_update_jiffies(void) { } | 118 | static inline void tick_nohz_update_jiffies(void) { } |
| 118 | static inline ktime_t tick_nohz_get_sleep_length(void) | 119 | static inline ktime_t tick_nohz_get_sleep_length(void) |
diff --git a/include/linux/timerfd.h b/include/linux/timerfd.h index cf2b10d75731..86cb0501d3e2 100644 --- a/include/linux/timerfd.h +++ b/include/linux/timerfd.h | |||
| @@ -8,9 +8,15 @@ | |||
| 8 | #ifndef _LINUX_TIMERFD_H | 8 | #ifndef _LINUX_TIMERFD_H |
| 9 | #define _LINUX_TIMERFD_H | 9 | #define _LINUX_TIMERFD_H |
| 10 | 10 | ||
| 11 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
| 12 | #include <linux/fcntl.h> | ||
| 11 | 13 | ||
| 14 | /* Flags for timerfd_settime. */ | ||
| 12 | #define TFD_TIMER_ABSTIME (1 << 0) | 15 | #define TFD_TIMER_ABSTIME (1 << 0) |
| 13 | 16 | ||
| 17 | /* Flags for timerfd_create. */ | ||
| 18 | #define TFD_CLOEXEC O_CLOEXEC | ||
| 19 | #define TFD_NONBLOCK O_NONBLOCK | ||
| 14 | 20 | ||
| 15 | 21 | ||
| 16 | #endif /* _LINUX_TIMERFD_H */ | 22 | #endif /* _LINUX_TIMERFD_H */ |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h new file mode 100644 index 000000000000..b1875582c1a1 --- /dev/null +++ b/include/linux/tracehook.h | |||
| @@ -0,0 +1,576 @@ | |||
| 1 | /* | ||
| 2 | * Tracing hooks | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | ||
| 5 | * | ||
| 6 | * This copyrighted material is made available to anyone wishing to use, | ||
| 7 | * modify, copy, or redistribute it subject to the terms and conditions | ||
| 8 | * of the GNU General Public License v.2. | ||
| 9 | * | ||
| 10 | * This file defines hook entry points called by core code where | ||
| 11 | * user tracing/debugging support might need to do something. These | ||
| 12 | * entry points are called tracehook_*(). Each hook declared below | ||
| 13 | * has a detailed kerneldoc comment giving the context (locking et | ||
| 14 | * al) from which it is called, and the meaning of its return value. | ||
| 15 | * | ||
| 16 | * Each function here typically has only one call site, so it is ok | ||
| 17 | * to have some nontrivial tracehook_*() inlines. In all cases, the | ||
| 18 | * fast path when no tracing is enabled should be very short. | ||
| 19 | * | ||
| 20 | * The purpose of this file and the tracehook_* layer is to consolidate | ||
| 21 | * the interface that the kernel core and arch code uses to enable any | ||
| 22 | * user debugging or tracing facility (such as ptrace). The interfaces | ||
| 23 | * here are carefully documented so that maintainers of core and arch | ||
| 24 | * code do not need to think about the implementation details of the | ||
| 25 | * tracing facilities. Likewise, maintainers of the tracing code do not | ||
| 26 | * need to understand all the calling core or arch code in detail, just | ||
| 27 | * documented circumstances of each call, such as locking conditions. | ||
| 28 | * | ||
| 29 | * If the calling core code changes so that locking is different, then | ||
| 30 | * it is ok to change the interface documented here. The maintainer of | ||
| 31 | * core code changing should notify the maintainers of the tracing code | ||
| 32 | * that they need to work out the change. | ||
| 33 | * | ||
| 34 | * Some tracehook_*() inlines take arguments that the current tracing | ||
| 35 | * implementations might not necessarily use. These function signatures | ||
| 36 | * are chosen to pass in all the information that is on hand in the | ||
| 37 | * caller and might conceivably be relevant to a tracer, so that the | ||
| 38 | * core code won't have to be updated when tracing adds more features. | ||
| 39 | * If a call site changes so that some of those parameters are no longer | ||
| 40 | * already on hand without extra work, then the tracehook_* interface | ||
| 41 | * can change so there is no make-work burden on the core code. The | ||
| 42 | * maintainer of core code changing should notify the maintainers of the | ||
| 43 | * tracing code that they need to work out the change. | ||
| 44 | */ | ||
| 45 | |||
| 46 | #ifndef _LINUX_TRACEHOOK_H | ||
| 47 | #define _LINUX_TRACEHOOK_H 1 | ||
| 48 | |||
| 49 | #include <linux/sched.h> | ||
| 50 | #include <linux/ptrace.h> | ||
| 51 | #include <linux/security.h> | ||
| 52 | struct linux_binprm; | ||
| 53 | |||
| 54 | /** | ||
| 55 | * tracehook_expect_breakpoints - guess if task memory might be touched | ||
| 56 | * @task: current task, making a new mapping | ||
| 57 | * | ||
| 58 | * Return nonzero if @task is expected to want breakpoint insertion in | ||
| 59 | * its memory at some point. A zero return is no guarantee it won't | ||
| 60 | * be done, but this is a hint that it's known to be likely. | ||
| 61 | * | ||
| 62 | * May be called with @task->mm->mmap_sem held for writing. | ||
| 63 | */ | ||
| 64 | static inline int tracehook_expect_breakpoints(struct task_struct *task) | ||
| 65 | { | ||
| 66 | return (task_ptrace(task) & PT_PTRACED) != 0; | ||
| 67 | } | ||
| 68 | |||
| 69 | /* | ||
| 70 | * ptrace report for syscall entry and exit looks identical. | ||
| 71 | */ | ||
| 72 | static inline void ptrace_report_syscall(struct pt_regs *regs) | ||
| 73 | { | ||
| 74 | int ptrace = task_ptrace(current); | ||
| 75 | |||
| 76 | if (!(ptrace & PT_PTRACED)) | ||
| 77 | return; | ||
| 78 | |||
| 79 | ptrace_notify(SIGTRAP | ((ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); | ||
| 80 | |||
| 81 | /* | ||
| 82 | * this isn't the same as continuing with a signal, but it will do | ||
| 83 | * for normal use. strace only continues with a signal if the | ||
| 84 | * stopping signal is not SIGTRAP. -brl | ||
| 85 | */ | ||
| 86 | if (current->exit_code) { | ||
| 87 | send_sig(current->exit_code, current, 1); | ||
| 88 | current->exit_code = 0; | ||
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 92 | /** | ||
| 93 | * tracehook_report_syscall_entry - task is about to attempt a system call | ||
| 94 | * @regs: user register state of current task | ||
| 95 | * | ||
| 96 | * This will be called if %TIF_SYSCALL_TRACE has been set, when the | ||
| 97 | * current task has just entered the kernel for a system call. | ||
| 98 | * Full user register state is available here. Changing the values | ||
| 99 | * in @regs can affect the system call number and arguments to be tried. | ||
| 100 | * It is safe to block here, preventing the system call from beginning. | ||
| 101 | * | ||
| 102 | * Returns zero normally, or nonzero if the calling arch code should abort | ||
| 103 | * the system call. That must prevent normal entry so no system call is | ||
| 104 | * made. If @task ever returns to user mode after this, its register state | ||
| 105 | * is unspecified, but should be something harmless like an %ENOSYS error | ||
| 106 | * return. It should preserve enough information so that syscall_rollback() | ||
| 107 | * can work (see asm-generic/syscall.h). | ||
| 108 | * | ||
| 109 | * Called without locks, just after entering kernel mode. | ||
| 110 | */ | ||
| 111 | static inline __must_check int tracehook_report_syscall_entry( | ||
| 112 | struct pt_regs *regs) | ||
| 113 | { | ||
| 114 | ptrace_report_syscall(regs); | ||
| 115 | return 0; | ||
| 116 | } | ||
| 117 | |||
| 118 | /** | ||
| 119 | * tracehook_report_syscall_exit - task has just finished a system call | ||
| 120 | * @regs: user register state of current task | ||
| 121 | * @step: nonzero if simulating single-step or block-step | ||
| 122 | * | ||
| 123 | * This will be called if %TIF_SYSCALL_TRACE has been set, when the | ||
| 124 | * current task has just finished an attempted system call. Full | ||
| 125 | * user register state is available here. It is safe to block here, | ||
| 126 | * preventing signals from being processed. | ||
| 127 | * | ||
| 128 | * If @step is nonzero, this report is also in lieu of the normal | ||
| 129 | * trap that would follow the system call instruction because | ||
| 130 | * user_enable_block_step() or user_enable_single_step() was used. | ||
| 131 | * In this case, %TIF_SYSCALL_TRACE might not be set. | ||
| 132 | * | ||
| 133 | * Called without locks, just before checking for pending signals. | ||
| 134 | */ | ||
| 135 | static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step) | ||
| 136 | { | ||
| 137 | ptrace_report_syscall(regs); | ||
| 138 | } | ||
| 139 | |||
| 140 | /** | ||
| 141 | * tracehook_unsafe_exec - check for exec declared unsafe due to tracing | ||
| 142 | * @task: current task doing exec | ||
| 143 | * | ||
| 144 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. | ||
| 145 | * | ||
| 146 | * Called with task_lock() held on @task. | ||
| 147 | */ | ||
| 148 | static inline int tracehook_unsafe_exec(struct task_struct *task) | ||
| 149 | { | ||
| 150 | int unsafe = 0; | ||
| 151 | int ptrace = task_ptrace(task); | ||
| 152 | if (ptrace & PT_PTRACED) { | ||
| 153 | if (ptrace & PT_PTRACE_CAP) | ||
| 154 | unsafe |= LSM_UNSAFE_PTRACE_CAP; | ||
| 155 | else | ||
| 156 | unsafe |= LSM_UNSAFE_PTRACE; | ||
| 157 | } | ||
| 158 | return unsafe; | ||
| 159 | } | ||
| 160 | |||
| 161 | /** | ||
| 162 | * tracehook_tracer_task - return the task that is tracing the given task | ||
| 163 | * @tsk: task to consider | ||
| 164 | * | ||
| 165 | * Returns NULL if noone is tracing @task, or the &struct task_struct | ||
| 166 | * pointer to its tracer. | ||
| 167 | * | ||
| 168 | * Must called under rcu_read_lock(). The pointer returned might be kept | ||
| 169 | * live only by RCU. During exec, this may be called with task_lock() | ||
| 170 | * held on @task, still held from when tracehook_unsafe_exec() was called. | ||
| 171 | */ | ||
| 172 | static inline struct task_struct *tracehook_tracer_task(struct task_struct *tsk) | ||
| 173 | { | ||
| 174 | if (task_ptrace(tsk) & PT_PTRACED) | ||
| 175 | return rcu_dereference(tsk->parent); | ||
| 176 | return NULL; | ||
| 177 | } | ||
| 178 | |||
| 179 | /** | ||
| 180 | * tracehook_report_exec - a successful exec was completed | ||
| 181 | * @fmt: &struct linux_binfmt that performed the exec | ||
| 182 | * @bprm: &struct linux_binprm containing exec details | ||
| 183 | * @regs: user-mode register state | ||
| 184 | * | ||
| 185 | * An exec just completed, we are shortly going to return to user mode. | ||
| 186 | * The freshly initialized register state can be seen and changed in @regs. | ||
| 187 | * The name, file and other pointers in @bprm are still on hand to be | ||
| 188 | * inspected, but will be freed as soon as this returns. | ||
| 189 | * | ||
| 190 | * Called with no locks, but with some kernel resources held live | ||
| 191 | * and a reference on @fmt->module. | ||
| 192 | */ | ||
| 193 | static inline void tracehook_report_exec(struct linux_binfmt *fmt, | ||
| 194 | struct linux_binprm *bprm, | ||
| 195 | struct pt_regs *regs) | ||
| 196 | { | ||
| 197 | if (!ptrace_event(PT_TRACE_EXEC, PTRACE_EVENT_EXEC, 0) && | ||
| 198 | unlikely(task_ptrace(current) & PT_PTRACED)) | ||
| 199 | send_sig(SIGTRAP, current, 0); | ||
| 200 | } | ||
| 201 | |||
| 202 | /** | ||
| 203 | * tracehook_report_exit - task has begun to exit | ||
| 204 | * @exit_code: pointer to value destined for @current->exit_code | ||
| 205 | * | ||
| 206 | * @exit_code points to the value passed to do_exit(), which tracing | ||
| 207 | * might change here. This is almost the first thing in do_exit(), | ||
| 208 | * before freeing any resources or setting the %PF_EXITING flag. | ||
| 209 | * | ||
| 210 | * Called with no locks held. | ||
| 211 | */ | ||
| 212 | static inline void tracehook_report_exit(long *exit_code) | ||
| 213 | { | ||
| 214 | ptrace_event(PT_TRACE_EXIT, PTRACE_EVENT_EXIT, *exit_code); | ||
| 215 | } | ||
| 216 | |||
| 217 | /** | ||
| 218 | * tracehook_prepare_clone - prepare for new child to be cloned | ||
| 219 | * @clone_flags: %CLONE_* flags from clone/fork/vfork system call | ||
| 220 | * | ||
| 221 | * This is called before a new user task is to be cloned. | ||
| 222 | * Its return value will be passed to tracehook_finish_clone(). | ||
| 223 | * | ||
| 224 | * Called with no locks held. | ||
| 225 | */ | ||
| 226 | static inline int tracehook_prepare_clone(unsigned clone_flags) | ||
| 227 | { | ||
| 228 | if (clone_flags & CLONE_UNTRACED) | ||
| 229 | return 0; | ||
| 230 | |||
| 231 | if (clone_flags & CLONE_VFORK) { | ||
| 232 | if (current->ptrace & PT_TRACE_VFORK) | ||
| 233 | return PTRACE_EVENT_VFORK; | ||
| 234 | } else if ((clone_flags & CSIGNAL) != SIGCHLD) { | ||
| 235 | if (current->ptrace & PT_TRACE_CLONE) | ||
| 236 | return PTRACE_EVENT_CLONE; | ||
| 237 | } else if (current->ptrace & PT_TRACE_FORK) | ||
| 238 | return PTRACE_EVENT_FORK; | ||
| 239 | |||
| 240 | return 0; | ||
| 241 | } | ||
| 242 | |||
| 243 | /** | ||
| 244 | * tracehook_finish_clone - new child created and being attached | ||
| 245 | * @child: new child task | ||
| 246 | * @clone_flags: %CLONE_* flags from clone/fork/vfork system call | ||
| 247 | * @trace: return value from tracehook_prepare_clone() | ||
| 248 | * | ||
| 249 | * This is called immediately after adding @child to its parent's children list. | ||
| 250 | * The @trace value is that returned by tracehook_prepare_clone(). | ||
| 251 | * | ||
| 252 | * Called with current's siglock and write_lock_irq(&tasklist_lock) held. | ||
| 253 | */ | ||
| 254 | static inline void tracehook_finish_clone(struct task_struct *child, | ||
| 255 | unsigned long clone_flags, int trace) | ||
| 256 | { | ||
| 257 | ptrace_init_task(child, (clone_flags & CLONE_PTRACE) || trace); | ||
| 258 | } | ||
| 259 | |||
| 260 | /** | ||
| 261 | * tracehook_report_clone - in parent, new child is about to start running | ||
| 262 | * @trace: return value from tracehook_prepare_clone() | ||
| 263 | * @regs: parent's user register state | ||
| 264 | * @clone_flags: flags from parent's system call | ||
| 265 | * @pid: new child's PID in the parent's namespace | ||
| 266 | * @child: new child task | ||
| 267 | * | ||
| 268 | * Called after a child is set up, but before it has been started | ||
| 269 | * running. @trace is the value returned by tracehook_prepare_clone(). | ||
| 270 | * This is not a good place to block, because the child has not started | ||
| 271 | * yet. Suspend the child here if desired, and then block in | ||
| 272 | * tracehook_report_clone_complete(). This must prevent the child from | ||
| 273 | * self-reaping if tracehook_report_clone_complete() uses the @child | ||
| 274 | * pointer; otherwise it might have died and been released by the time | ||
| 275 | * tracehook_report_report_clone_complete() is called. | ||
| 276 | * | ||
| 277 | * Called with no locks held, but the child cannot run until this returns. | ||
| 278 | */ | ||
| 279 | static inline void tracehook_report_clone(int trace, struct pt_regs *regs, | ||
| 280 | unsigned long clone_flags, | ||
| 281 | pid_t pid, struct task_struct *child) | ||
| 282 | { | ||
| 283 | if (unlikely(trace)) { | ||
| 284 | /* | ||
| 285 | * The child starts up with an immediate SIGSTOP. | ||
| 286 | */ | ||
| 287 | sigaddset(&child->pending.signal, SIGSTOP); | ||
| 288 | set_tsk_thread_flag(child, TIF_SIGPENDING); | ||
| 289 | } | ||
| 290 | } | ||
| 291 | |||
| 292 | /** | ||
| 293 | * tracehook_report_clone_complete - new child is running | ||
| 294 | * @trace: return value from tracehook_prepare_clone() | ||
| 295 | * @regs: parent's user register state | ||
| 296 | * @clone_flags: flags from parent's system call | ||
| 297 | * @pid: new child's PID in the parent's namespace | ||
| 298 | * @child: child task, already running | ||
| 299 | * | ||
| 300 | * This is called just after the child has started running. This is | ||
| 301 | * just before the clone/fork syscall returns, or blocks for vfork | ||
| 302 | * child completion if @clone_flags has the %CLONE_VFORK bit set. | ||
| 303 | * The @child pointer may be invalid if a self-reaping child died and | ||
| 304 | * tracehook_report_clone() took no action to prevent it from self-reaping. | ||
| 305 | * | ||
| 306 | * Called with no locks held. | ||
| 307 | */ | ||
| 308 | static inline void tracehook_report_clone_complete(int trace, | ||
| 309 | struct pt_regs *regs, | ||
| 310 | unsigned long clone_flags, | ||
| 311 | pid_t pid, | ||
| 312 | struct task_struct *child) | ||
| 313 | { | ||
| 314 | if (unlikely(trace)) | ||
| 315 | ptrace_event(0, trace, pid); | ||
| 316 | } | ||
| 317 | |||
| 318 | /** | ||
| 319 | * tracehook_report_vfork_done - vfork parent's child has exited or exec'd | ||
| 320 | * @child: child task, already running | ||
| 321 | * @pid: new child's PID in the parent's namespace | ||
| 322 | * | ||
| 323 | * Called after a %CLONE_VFORK parent has waited for the child to complete. | ||
| 324 | * The clone/vfork system call will return immediately after this. | ||
| 325 | * The @child pointer may be invalid if a self-reaping child died and | ||
| 326 | * tracehook_report_clone() took no action to prevent it from self-reaping. | ||
| 327 | * | ||
| 328 | * Called with no locks held. | ||
| 329 | */ | ||
| 330 | static inline void tracehook_report_vfork_done(struct task_struct *child, | ||
| 331 | pid_t pid) | ||
| 332 | { | ||
| 333 | ptrace_event(PT_TRACE_VFORK_DONE, PTRACE_EVENT_VFORK_DONE, pid); | ||
| 334 | } | ||
| 335 | |||
| 336 | /** | ||
| 337 | * tracehook_prepare_release_task - task is being reaped, clean up tracing | ||
| 338 | * @task: task in %EXIT_DEAD state | ||
| 339 | * | ||
| 340 | * This is called in release_task() just before @task gets finally reaped | ||
| 341 | * and freed. This would be the ideal place to remove and clean up any | ||
| 342 | * tracing-related state for @task. | ||
| 343 | * | ||
| 344 | * Called with no locks held. | ||
| 345 | */ | ||
| 346 | static inline void tracehook_prepare_release_task(struct task_struct *task) | ||
| 347 | { | ||
| 348 | } | ||
| 349 | |||
| 350 | /** | ||
| 351 | * tracehook_finish_release_task - final tracing clean-up | ||
| 352 | * @task: task in %EXIT_DEAD state | ||
| 353 | * | ||
| 354 | * This is called in release_task() when @task is being in the middle of | ||
| 355 | * being reaped. After this, there must be no tracing entanglements. | ||
| 356 | * | ||
| 357 | * Called with write_lock_irq(&tasklist_lock) held. | ||
| 358 | */ | ||
| 359 | static inline void tracehook_finish_release_task(struct task_struct *task) | ||
| 360 | { | ||
| 361 | ptrace_release_task(task); | ||
| 362 | } | ||
| 363 | |||
| 364 | /** | ||
| 365 | * tracehook_signal_handler - signal handler setup is complete | ||
| 366 | * @sig: number of signal being delivered | ||
| 367 | * @info: siginfo_t of signal being delivered | ||
| 368 | * @ka: sigaction setting that chose the handler | ||
| 369 | * @regs: user register state | ||
| 370 | * @stepping: nonzero if debugger single-step or block-step in use | ||
| 371 | * | ||
| 372 | * Called by the arch code after a signal handler has been set up. | ||
| 373 | * Register and stack state reflects the user handler about to run. | ||
| 374 | * Signal mask changes have already been made. | ||
| 375 | * | ||
| 376 | * Called without locks, shortly before returning to user mode | ||
| 377 | * (or handling more signals). | ||
| 378 | */ | ||
| 379 | static inline void tracehook_signal_handler(int sig, siginfo_t *info, | ||
| 380 | const struct k_sigaction *ka, | ||
| 381 | struct pt_regs *regs, int stepping) | ||
| 382 | { | ||
| 383 | if (stepping) | ||
| 384 | ptrace_notify(SIGTRAP); | ||
| 385 | } | ||
| 386 | |||
| 387 | /** | ||
| 388 | * tracehook_consider_ignored_signal - suppress short-circuit of ignored signal | ||
| 389 | * @task: task receiving the signal | ||
| 390 | * @sig: signal number being sent | ||
| 391 | * @handler: %SIG_IGN or %SIG_DFL | ||
| 392 | * | ||
| 393 | * Return zero iff tracing doesn't care to examine this ignored signal, | ||
| 394 | * so it can short-circuit normal delivery and never even get queued. | ||
| 395 | * Either @handler is %SIG_DFL and @sig's default is ignore, or it's %SIG_IGN. | ||
| 396 | * | ||
| 397 | * Called with @task->sighand->siglock held. | ||
| 398 | */ | ||
| 399 | static inline int tracehook_consider_ignored_signal(struct task_struct *task, | ||
| 400 | int sig, | ||
| 401 | void __user *handler) | ||
| 402 | { | ||
| 403 | return (task_ptrace(task) & PT_PTRACED) != 0; | ||
| 404 | } | ||
| 405 | |||
| 406 | /** | ||
| 407 | * tracehook_consider_fatal_signal - suppress special handling of fatal signal | ||
| 408 | * @task: task receiving the signal | ||
| 409 | * @sig: signal number being sent | ||
| 410 | * @handler: %SIG_DFL or %SIG_IGN | ||
| 411 | * | ||
| 412 | * Return nonzero to prevent special handling of this termination signal. | ||
| 413 | * Normally @handler is %SIG_DFL. It can be %SIG_IGN if @sig is ignored, | ||
| 414 | * in which case force_sig() is about to reset it to %SIG_DFL. | ||
| 415 | * When this returns zero, this signal might cause a quick termination | ||
| 416 | * that does not give the debugger a chance to intercept the signal. | ||
| 417 | * | ||
| 418 | * Called with or without @task->sighand->siglock held. | ||
| 419 | */ | ||
| 420 | static inline int tracehook_consider_fatal_signal(struct task_struct *task, | ||
| 421 | int sig, | ||
| 422 | void __user *handler) | ||
| 423 | { | ||
| 424 | return (task_ptrace(task) & PT_PTRACED) != 0; | ||
| 425 | } | ||
| 426 | |||
| 427 | /** | ||
| 428 | * tracehook_force_sigpending - let tracing force signal_pending(current) on | ||
| 429 | * | ||
| 430 | * Called when recomputing our signal_pending() flag. Return nonzero | ||
| 431 | * to force the signal_pending() flag on, so that tracehook_get_signal() | ||
| 432 | * will be called before the next return to user mode. | ||
| 433 | * | ||
| 434 | * Called with @current->sighand->siglock held. | ||
| 435 | */ | ||
| 436 | static inline int tracehook_force_sigpending(void) | ||
| 437 | { | ||
| 438 | return 0; | ||
| 439 | } | ||
| 440 | |||
| 441 | /** | ||
| 442 | * tracehook_get_signal - deliver synthetic signal to traced task | ||
| 443 | * @task: @current | ||
| 444 | * @regs: task_pt_regs(@current) | ||
| 445 | * @info: details of synthetic signal | ||
| 446 | * @return_ka: sigaction for synthetic signal | ||
| 447 | * | ||
| 448 | * Return zero to check for a real pending signal normally. | ||
| 449 | * Return -1 after releasing the siglock to repeat the check. | ||
| 450 | * Return a signal number to induce an artifical signal delivery, | ||
| 451 | * setting *@info and *@return_ka to specify its details and behavior. | ||
| 452 | * | ||
| 453 | * The @return_ka->sa_handler value controls the disposition of the | ||
| 454 | * signal, no matter the signal number. For %SIG_DFL, the return value | ||
| 455 | * is a representative signal to indicate the behavior (e.g. %SIGTERM | ||
| 456 | * for death, %SIGQUIT for core dump, %SIGSTOP for job control stop, | ||
| 457 | * %SIGTSTP for stop unless in an orphaned pgrp), but the signal number | ||
| 458 | * reported will be @info->si_signo instead. | ||
| 459 | * | ||
| 460 | * Called with @task->sighand->siglock held, before dequeuing pending signals. | ||
| 461 | */ | ||
| 462 | static inline int tracehook_get_signal(struct task_struct *task, | ||
| 463 | struct pt_regs *regs, | ||
| 464 | siginfo_t *info, | ||
| 465 | struct k_sigaction *return_ka) | ||
| 466 | { | ||
| 467 | return 0; | ||
| 468 | } | ||
| 469 | |||
| 470 | /** | ||
| 471 | * tracehook_notify_jctl - report about job control stop/continue | ||
| 472 | * @notify: nonzero if this is the last thread in the group to stop | ||
| 473 | * @why: %CLD_STOPPED or %CLD_CONTINUED | ||
| 474 | * | ||
| 475 | * This is called when we might call do_notify_parent_cldstop(). | ||
| 476 | * It's called when about to stop for job control; we are already in | ||
| 477 | * %TASK_STOPPED state, about to call schedule(). It's also called when | ||
| 478 | * a delayed %CLD_STOPPED or %CLD_CONTINUED report is ready to be made. | ||
| 479 | * | ||
| 480 | * Return nonzero to generate a %SIGCHLD with @why, which is | ||
| 481 | * normal if @notify is nonzero. | ||
| 482 | * | ||
| 483 | * Called with no locks held. | ||
| 484 | */ | ||
| 485 | static inline int tracehook_notify_jctl(int notify, int why) | ||
| 486 | { | ||
| 487 | return notify || (current->ptrace & PT_PTRACED); | ||
| 488 | } | ||
| 489 | |||
| 490 | /** | ||
| 491 | * tracehook_notify_death - task is dead, ready to notify parent | ||
| 492 | * @task: @current task now exiting | ||
| 493 | * @death_cookie: value to pass to tracehook_report_death() | ||
| 494 | * @group_dead: nonzero if this was the last thread in the group to die | ||
| 495 | * | ||
| 496 | * Return the signal number to send our parent with do_notify_parent(), or | ||
| 497 | * zero to send no signal and leave a zombie, or -1 to self-reap right now. | ||
| 498 | * | ||
| 499 | * Called with write_lock_irq(&tasklist_lock) held. | ||
| 500 | */ | ||
| 501 | static inline int tracehook_notify_death(struct task_struct *task, | ||
| 502 | void **death_cookie, int group_dead) | ||
| 503 | { | ||
| 504 | if (task->exit_signal == -1) | ||
| 505 | return task->ptrace ? SIGCHLD : -1; | ||
| 506 | |||
| 507 | /* | ||
| 508 | * If something other than our normal parent is ptracing us, then | ||
| 509 | * send it a SIGCHLD instead of honoring exit_signal. exit_signal | ||
| 510 | * only has special meaning to our real parent. | ||
| 511 | */ | ||
| 512 | if (thread_group_empty(task) && !ptrace_reparented(task)) | ||
| 513 | return task->exit_signal; | ||
| 514 | |||
| 515 | return task->ptrace ? SIGCHLD : 0; | ||
| 516 | } | ||
| 517 | |||
| 518 | /** | ||
| 519 | * tracehook_report_death - task is dead and ready to be reaped | ||
| 520 | * @task: @current task now exiting | ||
| 521 | * @signal: signal number sent to parent, or 0 or -1 | ||
| 522 | * @death_cookie: value passed back from tracehook_notify_death() | ||
| 523 | * @group_dead: nonzero if this was the last thread in the group to die | ||
| 524 | * | ||
| 525 | * Thread has just become a zombie or is about to self-reap. If positive, | ||
| 526 | * @signal is the signal number just sent to the parent (usually %SIGCHLD). | ||
| 527 | * If @signal is -1, this thread will self-reap. If @signal is 0, this is | ||
| 528 | * a delayed_group_leader() zombie. The @death_cookie was passed back by | ||
| 529 | * tracehook_notify_death(). | ||
| 530 | * | ||
| 531 | * If normal reaping is not inhibited, @task->exit_state might be changing | ||
| 532 | * in parallel. | ||
| 533 | * | ||
| 534 | * Called without locks. | ||
| 535 | */ | ||
| 536 | static inline void tracehook_report_death(struct task_struct *task, | ||
| 537 | int signal, void *death_cookie, | ||
| 538 | int group_dead) | ||
| 539 | { | ||
| 540 | } | ||
| 541 | |||
| 542 | #ifdef TIF_NOTIFY_RESUME | ||
| 543 | /** | ||
| 544 | * set_notify_resume - cause tracehook_notify_resume() to be called | ||
| 545 | * @task: task that will call tracehook_notify_resume() | ||
| 546 | * | ||
| 547 | * Calling this arranges that @task will call tracehook_notify_resume() | ||
| 548 | * before returning to user mode. If it's already running in user mode, | ||
| 549 | * it will enter the kernel and call tracehook_notify_resume() soon. | ||
| 550 | * If it's blocked, it will not be woken. | ||
| 551 | */ | ||
| 552 | static inline void set_notify_resume(struct task_struct *task) | ||
| 553 | { | ||
| 554 | if (!test_and_set_tsk_thread_flag(task, TIF_NOTIFY_RESUME)) | ||
| 555 | kick_process(task); | ||
| 556 | } | ||
| 557 | |||
| 558 | /** | ||
| 559 | * tracehook_notify_resume - report when about to return to user mode | ||
| 560 | * @regs: user-mode registers of @current task | ||
| 561 | * | ||
| 562 | * This is called when %TIF_NOTIFY_RESUME has been set. Now we are | ||
| 563 | * about to return to user mode, and the user state in @regs can be | ||
| 564 | * inspected or adjusted. The caller in arch code has cleared | ||
| 565 | * %TIF_NOTIFY_RESUME before the call. If the flag gets set again | ||
| 566 | * asynchronously, this will be called again before we return to | ||
| 567 | * user mode. | ||
| 568 | * | ||
| 569 | * Called without locks. | ||
| 570 | */ | ||
| 571 | static inline void tracehook_notify_resume(struct pt_regs *regs) | ||
| 572 | { | ||
| 573 | } | ||
| 574 | #endif /* TIF_NOTIFY_RESUME */ | ||
| 575 | |||
| 576 | #endif /* <linux/tracehook.h> */ | ||
diff --git a/include/linux/typecheck.h b/include/linux/typecheck.h new file mode 100644 index 000000000000..eb5b74a575be --- /dev/null +++ b/include/linux/typecheck.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #ifndef TYPECHECK_H_INCLUDED | ||
| 2 | #define TYPECHECK_H_INCLUDED | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Check at compile time that something is of a particular type. | ||
| 6 | * Always evaluates to 1 so you may use it easily in comparisons. | ||
| 7 | */ | ||
| 8 | #define typecheck(type,x) \ | ||
| 9 | ({ type __dummy; \ | ||
| 10 | typeof(x) __dummy2; \ | ||
| 11 | (void)(&__dummy == &__dummy2); \ | ||
| 12 | 1; \ | ||
| 13 | }) | ||
| 14 | |||
| 15 | /* | ||
| 16 | * Check at compile time that 'function' is a certain type, or is a pointer | ||
| 17 | * to that type (needs to use typedef for the function type.) | ||
| 18 | */ | ||
| 19 | #define typecheck_fn(type,function) \ | ||
| 20 | ({ typeof(type) __tmp = function; \ | ||
| 21 | (void)__tmp; \ | ||
| 22 | }) | ||
| 23 | |||
| 24 | #endif /* TYPECHECK_H_INCLUDED */ | ||
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 747c3a49cdc9..c932390c6da0 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -330,7 +330,7 @@ extern int usb_string_id(struct usb_composite_dev *c); | |||
| 330 | dev_vdbg(&(d)->gadget->dev , fmt , ## args) | 330 | dev_vdbg(&(d)->gadget->dev , fmt , ## args) |
| 331 | #define ERROR(d, fmt, args...) \ | 331 | #define ERROR(d, fmt, args...) \ |
| 332 | dev_err(&(d)->gadget->dev , fmt , ## args) | 332 | dev_err(&(d)->gadget->dev , fmt , ## args) |
| 333 | #define WARN(d, fmt, args...) \ | 333 | #define WARNING(d, fmt, args...) \ |
| 334 | dev_warn(&(d)->gadget->dev , fmt , ## args) | 334 | dev_warn(&(d)->gadget->dev , fmt , ## args) |
| 335 | #define INFO(d, fmt, args...) \ | 335 | #define INFO(d, fmt, args...) \ |
| 336 | dev_info(&(d)->gadget->dev , fmt , ## args) | 336 | dev_info(&(d)->gadget->dev , fmt , ## args) |
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index 8eff0b53910b..b3c4a60ceeb3 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_9P_H | 1 | #ifndef _LINUX_VIRTIO_9P_H |
| 2 | #define _LINUX_VIRTIO_9P_H | 2 | #define _LINUX_VIRTIO_9P_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
| 4 | * compatible drivers/servers. */ | ||
| 3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
| 4 | 6 | ||
| 5 | /* The ID for virtio console */ | 7 | /* The ID for virtio console */ |
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index 979524ee75b7..c30c7bfbf39b 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_BALLOON_H | 1 | #ifndef _LINUX_VIRTIO_BALLOON_H |
| 2 | #define _LINUX_VIRTIO_BALLOON_H | 2 | #define _LINUX_VIRTIO_BALLOON_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
| 4 | * compatible drivers/servers. */ | ||
| 3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
| 4 | 6 | ||
| 5 | /* The ID for virtio_balloon */ | 7 | /* The ID for virtio_balloon */ |
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index 5f79a5f9de79..c1aef85243bf 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_BLK_H | 1 | #ifndef _LINUX_VIRTIO_BLK_H |
| 2 | #define _LINUX_VIRTIO_BLK_H | 2 | #define _LINUX_VIRTIO_BLK_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
| 4 | * compatible drivers/servers. */ | ||
| 3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
| 4 | 6 | ||
| 5 | /* The ID for virtio_block */ | 7 | /* The ID for virtio_block */ |
| @@ -11,6 +13,7 @@ | |||
| 11 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ | 13 | #define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */ |
| 12 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ | 14 | #define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */ |
| 13 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ | 15 | #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ |
| 16 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | ||
| 14 | 17 | ||
| 15 | struct virtio_blk_config | 18 | struct virtio_blk_config |
| 16 | { | 19 | { |
| @@ -26,6 +29,8 @@ struct virtio_blk_config | |||
| 26 | __u8 heads; | 29 | __u8 heads; |
| 27 | __u8 sectors; | 30 | __u8 sectors; |
| 28 | } geometry; | 31 | } geometry; |
| 32 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ | ||
| 33 | __u32 blk_size; | ||
| 29 | } __attribute__((packed)); | 34 | } __attribute__((packed)); |
| 30 | 35 | ||
| 31 | /* These two define direction. */ | 36 | /* These two define direction. */ |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index f364bbf63c34..bf8ec283b232 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_CONFIG_H | 1 | #ifndef _LINUX_VIRTIO_CONFIG_H |
| 2 | #define _LINUX_VIRTIO_CONFIG_H | 2 | #define _LINUX_VIRTIO_CONFIG_H |
| 3 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | ||
| 4 | * anyone can use the definitions to implement compatible drivers/servers. */ | ||
| 5 | |||
| 3 | /* Virtio devices use a standardized configuration space to define their | 6 | /* Virtio devices use a standardized configuration space to define their |
| 4 | * features and pass configuration information, but each implementation can | 7 | * features and pass configuration information, but each implementation can |
| 5 | * store and access that space differently. */ | 8 | * store and access that space differently. */ |
| @@ -15,6 +18,12 @@ | |||
| 15 | /* We've given up on this device. */ | 18 | /* We've given up on this device. */ |
| 16 | #define VIRTIO_CONFIG_S_FAILED 0x80 | 19 | #define VIRTIO_CONFIG_S_FAILED 0x80 |
| 17 | 20 | ||
| 21 | /* Some virtio feature bits (currently bits 28 through 31) are reserved for the | ||
| 22 | * transport being used (eg. virtio_ring), the rest are per-device feature | ||
| 23 | * bits. */ | ||
| 24 | #define VIRTIO_TRANSPORT_F_START 28 | ||
| 25 | #define VIRTIO_TRANSPORT_F_END 32 | ||
| 26 | |||
| 18 | /* Do we get callbacks when the ring is completely used, even if we've | 27 | /* Do we get callbacks when the ring is completely used, even if we've |
| 19 | * suppressed them? */ | 28 | * suppressed them? */ |
| 20 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |
| @@ -52,9 +61,10 @@ | |||
| 52 | * @get_features: get the array of feature bits for this device. | 61 | * @get_features: get the array of feature bits for this device. |
| 53 | * vdev: the virtio_device | 62 | * vdev: the virtio_device |
| 54 | * Returns the first 32 feature bits (all we currently need). | 63 | * Returns the first 32 feature bits (all we currently need). |
| 55 | * @set_features: confirm what device features we'll be using. | 64 | * @finalize_features: confirm what device features we'll be using. |
| 56 | * vdev: the virtio_device | 65 | * vdev: the virtio_device |
| 57 | * feature: the first 32 feature bits | 66 | * This gives the final feature bits for the device: it can change |
| 67 | * the dev->feature bits if it wants. | ||
| 58 | */ | 68 | */ |
| 59 | struct virtio_config_ops | 69 | struct virtio_config_ops |
| 60 | { | 70 | { |
| @@ -70,7 +80,7 @@ struct virtio_config_ops | |||
| 70 | void (*callback)(struct virtqueue *)); | 80 | void (*callback)(struct virtqueue *)); |
| 71 | void (*del_vq)(struct virtqueue *vq); | 81 | void (*del_vq)(struct virtqueue *vq); |
| 72 | u32 (*get_features)(struct virtio_device *vdev); | 82 | u32 (*get_features)(struct virtio_device *vdev); |
| 73 | void (*set_features)(struct virtio_device *vdev, u32 features); | 83 | void (*finalize_features)(struct virtio_device *vdev); |
| 74 | }; | 84 | }; |
| 75 | 85 | ||
| 76 | /* If driver didn't advertise the feature, it will never appear. */ | 86 | /* If driver didn't advertise the feature, it will never appear. */ |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index ed2d4ead7eb7..19a0da0dba41 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_CONSOLE_H | 1 | #ifndef _LINUX_VIRTIO_CONSOLE_H |
| 2 | #define _LINUX_VIRTIO_CONSOLE_H | 2 | #define _LINUX_VIRTIO_CONSOLE_H |
| 3 | #include <linux/virtio_config.h> | 3 | #include <linux/virtio_config.h> |
| 4 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | ||
| 5 | * anyone can use the definitions to implement compatible drivers/servers. */ | ||
| 4 | 6 | ||
| 5 | /* The ID for virtio console */ | 7 | /* The ID for virtio console */ |
| 6 | #define VIRTIO_ID_CONSOLE 3 | 8 | #define VIRTIO_ID_CONSOLE 3 |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 38c0571820fb..5e33761b9b8a 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_NET_H | 1 | #ifndef _LINUX_VIRTIO_NET_H |
| 2 | #define _LINUX_VIRTIO_NET_H | 2 | #define _LINUX_VIRTIO_NET_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
| 4 | * compatible drivers/servers. */ | ||
| 3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
| 4 | 6 | ||
| 5 | /* The ID for virtio_net */ | 7 | /* The ID for virtio_net */ |
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h index b3151659cf49..cdef35742932 100644 --- a/include/linux/virtio_pci.h +++ b/include/linux/virtio_pci.h | |||
| @@ -9,9 +9,8 @@ | |||
| 9 | * Authors: | 9 | * Authors: |
| 10 | * Anthony Liguori <aliguori@us.ibm.com> | 10 | * Anthony Liguori <aliguori@us.ibm.com> |
| 11 | * | 11 | * |
| 12 | * This work is licensed under the terms of the GNU GPL, version 2 or later. | 12 | * This header is BSD licensed so anyone can use the definitions to implement |
| 13 | * See the COPYING file in the top-level directory. | 13 | * compatible drivers/servers. |
| 14 | * | ||
| 15 | */ | 14 | */ |
| 16 | 15 | ||
| 17 | #ifndef _LINUX_VIRTIO_PCI_H | 16 | #ifndef _LINUX_VIRTIO_PCI_H |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index abe481ed990e..c4a598fb3826 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
| @@ -120,6 +120,8 @@ struct virtqueue *vring_new_virtqueue(unsigned int num, | |||
| 120 | void (*notify)(struct virtqueue *vq), | 120 | void (*notify)(struct virtqueue *vq), |
| 121 | void (*callback)(struct virtqueue *vq)); | 121 | void (*callback)(struct virtqueue *vq)); |
| 122 | void vring_del_virtqueue(struct virtqueue *vq); | 122 | void vring_del_virtqueue(struct virtqueue *vq); |
| 123 | /* Filter out transport-specific feature bits. */ | ||
| 124 | void vring_transport_features(struct virtio_device *vdev); | ||
| 123 | 125 | ||
| 124 | irqreturn_t vring_interrupt(int irq, void *_vq); | 126 | irqreturn_t vring_interrupt(int irq, void *_vq); |
| 125 | #endif /* __KERNEL__ */ | 127 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/virtio_rng.h b/include/linux/virtio_rng.h index 331afb6c9f62..1a85dab8a940 100644 --- a/include/linux/virtio_rng.h +++ b/include/linux/virtio_rng.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_RNG_H | 1 | #ifndef _LINUX_VIRTIO_RNG_H |
| 2 | #define _LINUX_VIRTIO_RNG_H | 2 | #define _LINUX_VIRTIO_RNG_H |
| 3 | /* This header is BSD licensed so anyone can use the definitions to implement | ||
| 4 | * compatible drivers/servers. */ | ||
| 3 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
| 4 | 6 | ||
| 5 | /* The ID for virtio_rng */ | 7 | /* The ID for virtio_rng */ |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index e83b69346d23..58334d439516 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -44,6 +44,12 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
| 44 | NR_VM_EVENT_ITEMS | 44 | NR_VM_EVENT_ITEMS |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | extern const struct seq_operations fragmentation_op; | ||
| 48 | extern const struct seq_operations pagetypeinfo_op; | ||
| 49 | extern const struct seq_operations zoneinfo_op; | ||
| 50 | extern const struct seq_operations vmstat_op; | ||
| 51 | extern int sysctl_stat_interval; | ||
| 52 | |||
| 47 | #ifdef CONFIG_VM_EVENT_COUNTERS | 53 | #ifdef CONFIG_VM_EVENT_COUNTERS |
| 48 | /* | 54 | /* |
| 49 | * Light weight per cpu counter implementation. | 55 | * Light weight per cpu counter implementation. |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 9448ffbdcbf6..14c0e91be9b5 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/mutex.h> | 12 | #include <linux/mutex.h> |
| 13 | #include <linux/console_struct.h> | 13 | #include <linux/console_struct.h> |
| 14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
| 15 | #include <linux/consolemap.h> | ||
| 15 | 16 | ||
| 16 | /* | 17 | /* |
| 17 | * Presently, a lot of graphics programs do not restore the contents of | 18 | * Presently, a lot of graphics programs do not restore the contents of |
| @@ -54,6 +55,7 @@ void redraw_screen(struct vc_data *vc, int is_switch); | |||
| 54 | struct tty_struct; | 55 | struct tty_struct; |
| 55 | int tioclinux(struct tty_struct *tty, unsigned long arg); | 56 | int tioclinux(struct tty_struct *tty, unsigned long arg); |
| 56 | 57 | ||
| 58 | #ifdef CONFIG_CONSOLE_TRANSLATIONS | ||
| 57 | /* consolemap.c */ | 59 | /* consolemap.c */ |
| 58 | 60 | ||
| 59 | struct unimapinit; | 61 | struct unimapinit; |
| @@ -71,6 +73,23 @@ void con_free_unimap(struct vc_data *vc); | |||
| 71 | void con_protect_unimap(struct vc_data *vc, int rdonly); | 73 | void con_protect_unimap(struct vc_data *vc, int rdonly); |
| 72 | int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | 74 | int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); |
| 73 | 75 | ||
| 76 | #define vc_translate(vc, c) ((vc)->vc_translate[(c) | \ | ||
| 77 | (vc)->vc_toggle_meta ? 0x80 : 0]) | ||
| 78 | #else | ||
| 79 | #define con_set_trans_old(arg) (0) | ||
| 80 | #define con_get_trans_old(arg) (-EINVAL) | ||
| 81 | #define con_set_trans_new(arg) (0) | ||
| 82 | #define con_get_trans_new(arg) (-EINVAL) | ||
| 83 | #define con_clear_unimap(vc, ui) (0) | ||
| 84 | #define con_set_unimap(vc, ct, list) (0) | ||
| 85 | #define con_set_default_unimap(vc) (0) | ||
| 86 | #define con_copy_unimap(d, s) (0) | ||
| 87 | #define con_get_unimap(vc, ct, uct, list) (-EINVAL) | ||
| 88 | #define con_free_unimap(vc) do { ; } while (0) | ||
| 89 | |||
| 90 | #define vc_translate(vc, c) (c) | ||
| 91 | #endif | ||
| 92 | |||
| 74 | /* vt.c */ | 93 | /* vt.c */ |
| 75 | int vt_waitactive(int vt); | 94 | int vt_waitactive(int vt); |
| 76 | void change_console(struct vc_data *new_vc); | 95 | void change_console(struct vc_data *new_vc); |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 542526c6e8ef..5c158c477ac7 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -179,6 +179,8 @@ __create_workqueue_key(const char *name, int singlethread, | |||
| 179 | extern void destroy_workqueue(struct workqueue_struct *wq); | 179 | extern void destroy_workqueue(struct workqueue_struct *wq); |
| 180 | 180 | ||
| 181 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); | 181 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); |
| 182 | extern int queue_work_on(int cpu, struct workqueue_struct *wq, | ||
| 183 | struct work_struct *work); | ||
| 182 | extern int queue_delayed_work(struct workqueue_struct *wq, | 184 | extern int queue_delayed_work(struct workqueue_struct *wq, |
| 183 | struct delayed_work *work, unsigned long delay); | 185 | struct delayed_work *work, unsigned long delay); |
| 184 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | 186 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, |
| @@ -188,6 +190,7 @@ extern void flush_workqueue(struct workqueue_struct *wq); | |||
| 188 | extern void flush_scheduled_work(void); | 190 | extern void flush_scheduled_work(void); |
| 189 | 191 | ||
| 190 | extern int schedule_work(struct work_struct *work); | 192 | extern int schedule_work(struct work_struct *work); |
| 193 | extern int schedule_work_on(int cpu, struct work_struct *work); | ||
| 191 | extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); | 194 | extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); |
| 192 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, | 195 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, |
| 193 | unsigned long delay); | 196 | unsigned long delay); |
| @@ -198,6 +201,8 @@ extern int keventd_up(void); | |||
| 198 | extern void init_workqueues(void); | 201 | extern void init_workqueues(void); |
| 199 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 202 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
| 200 | 203 | ||
| 204 | extern int flush_work(struct work_struct *work); | ||
| 205 | |||
| 201 | extern int cancel_work_sync(struct work_struct *work); | 206 | extern int cancel_work_sync(struct work_struct *work); |
| 202 | 207 | ||
| 203 | /* | 208 | /* |
diff --git a/include/mtd/inftl-user.h b/include/mtd/inftl-user.h index 9b1e2526b45e..e17eda302b2d 100644 --- a/include/mtd/inftl-user.h +++ b/include/mtd/inftl-user.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: inftl-user.h,v 1.2 2005/11/07 11:14:56 gleixner Exp $ | ||
| 3 | * | ||
| 4 | * Parts of INFTL headers shared with userspace | 2 | * Parts of INFTL headers shared with userspace |
| 5 | * | 3 | * |
| 6 | */ | 4 | */ |
diff --git a/include/mtd/jffs2-user.h b/include/mtd/jffs2-user.h index d508ef0ae091..001685d7fa88 100644 --- a/include/mtd/jffs2-user.h +++ b/include/mtd/jffs2-user.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: jffs2-user.h,v 1.1 2004/05/05 11:57:54 dwmw2 Exp $ | ||
| 3 | * | ||
| 4 | * JFFS2 definitions for use in user space only | 2 | * JFFS2 definitions for use in user space only |
| 5 | */ | 3 | */ |
| 6 | 4 | ||
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index 615072c4da04..c6c61cd5a254 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: mtd-abi.h,v 1.13 2005/11/07 11:14:56 gleixner Exp $ | ||
| 3 | * | ||
| 4 | * Portions of MTD ABI definition which are shared by kernel and user space | 2 | * Portions of MTD ABI definition which are shared by kernel and user space |
| 5 | */ | 3 | */ |
| 6 | 4 | ||
diff --git a/include/mtd/mtd-user.h b/include/mtd/mtd-user.h index 713f34d3e62e..170ceca3b2d0 100644 --- a/include/mtd/mtd-user.h +++ b/include/mtd/mtd-user.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: mtd-user.h,v 1.2 2004/05/05 14:44:57 dwmw2 Exp $ | ||
| 3 | * | ||
| 4 | * MTD ABI header for use by user space only. | 2 | * MTD ABI header for use by user space only. |
| 5 | */ | 3 | */ |
| 6 | 4 | ||
diff --git a/include/mtd/nftl-user.h b/include/mtd/nftl-user.h index b2bca18e7311..390d21c080aa 100644 --- a/include/mtd/nftl-user.h +++ b/include/mtd/nftl-user.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * $Id: nftl-user.h,v 1.2 2005/11/07 11:14:56 gleixner Exp $ | ||
| 3 | * | ||
| 4 | * Parts of NFTL headers shared with userspace | 2 | * Parts of NFTL headers shared with userspace |
| 5 | * | 3 | * |
| 6 | */ | 4 | */ |
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h index a7421f130cc0..ccdc562e444e 100644 --- a/include/mtd/ubi-user.h +++ b/include/mtd/ubi-user.h | |||
| @@ -58,6 +58,13 @@ | |||
| 58 | * device should be used. A &struct ubi_rsvol_req object has to be properly | 58 | * device should be used. A &struct ubi_rsvol_req object has to be properly |
| 59 | * filled and a pointer to it has to be passed to the IOCTL. | 59 | * filled and a pointer to it has to be passed to the IOCTL. |
| 60 | * | 60 | * |
| 61 | * UBI volumes re-name | ||
| 62 | * ~~~~~~~~~~~~~~~~~~~ | ||
| 63 | * | ||
| 64 | * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command | ||
| 65 | * of the UBI character device should be used. A &struct ubi_rnvol_req object | ||
| 66 | * has to be properly filled and a pointer to it has to be passed to the IOCTL. | ||
| 67 | * | ||
| 61 | * UBI volume update | 68 | * UBI volume update |
| 62 | * ~~~~~~~~~~~~~~~~~ | 69 | * ~~~~~~~~~~~~~~~~~ |
| 63 | * | 70 | * |
| @@ -104,6 +111,8 @@ | |||
| 104 | #define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, int32_t) | 111 | #define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, int32_t) |
| 105 | /* Re-size an UBI volume */ | 112 | /* Re-size an UBI volume */ |
| 106 | #define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req) | 113 | #define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req) |
| 114 | /* Re-name volumes */ | ||
| 115 | #define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req) | ||
| 107 | 116 | ||
| 108 | /* IOCTL commands of the UBI control character device */ | 117 | /* IOCTL commands of the UBI control character device */ |
| 109 | 118 | ||
| @@ -128,6 +137,9 @@ | |||
| 128 | /* Maximum MTD device name length supported by UBI */ | 137 | /* Maximum MTD device name length supported by UBI */ |
| 129 | #define MAX_UBI_MTD_NAME_LEN 127 | 138 | #define MAX_UBI_MTD_NAME_LEN 127 |
| 130 | 139 | ||
| 140 | /* Maximum amount of UBI volumes that can be re-named at one go */ | ||
| 141 | #define UBI_MAX_RNVOL 32 | ||
| 142 | |||
| 131 | /* | 143 | /* |
| 132 | * UBI data type hint constants. | 144 | * UBI data type hint constants. |
| 133 | * | 145 | * |
| @@ -176,20 +188,20 @@ enum { | |||
| 176 | * it will be 512 in case of a 2KiB page NAND flash with 4 512-byte sub-pages. | 188 | * it will be 512 in case of a 2KiB page NAND flash with 4 512-byte sub-pages. |
| 177 | * | 189 | * |
| 178 | * But in rare cases, if this optimizes things, the VID header may be placed to | 190 | * But in rare cases, if this optimizes things, the VID header may be placed to |
| 179 | * a different offset. For example, the boot-loader might do things faster if the | 191 | * a different offset. For example, the boot-loader might do things faster if |
| 180 | * VID header sits at the end of the first 2KiB NAND page with 4 sub-pages. As | 192 | * the VID header sits at the end of the first 2KiB NAND page with 4 sub-pages. |
| 181 | * the boot-loader would not normally need to read EC headers (unless it needs | 193 | * As the boot-loader would not normally need to read EC headers (unless it |
| 182 | * UBI in RW mode), it might be faster to calculate ECC. This is weird example, | 194 | * needs UBI in RW mode), it might be faster to calculate ECC. This is weird |
| 183 | * but it real-life example. So, in this example, @vid_hdr_offer would be | 195 | * example, but it real-life example. So, in this example, @vid_hdr_offer would |
| 184 | * 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes | 196 | * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes |
| 185 | * aligned, which is OK, as UBI is clever enough to realize this is 4th sub-page | 197 | * aligned, which is OK, as UBI is clever enough to realize this is 4th |
| 186 | * of the first page and add needed padding. | 198 | * sub-page of the first page and add needed padding. |
| 187 | */ | 199 | */ |
| 188 | struct ubi_attach_req { | 200 | struct ubi_attach_req { |
| 189 | int32_t ubi_num; | 201 | int32_t ubi_num; |
| 190 | int32_t mtd_num; | 202 | int32_t mtd_num; |
| 191 | int32_t vid_hdr_offset; | 203 | int32_t vid_hdr_offset; |
| 192 | uint8_t padding[12]; | 204 | int8_t padding[12]; |
| 193 | }; | 205 | }; |
| 194 | 206 | ||
| 195 | /** | 207 | /** |
| @@ -251,6 +263,48 @@ struct ubi_rsvol_req { | |||
| 251 | } __attribute__ ((packed)); | 263 | } __attribute__ ((packed)); |
| 252 | 264 | ||
| 253 | /** | 265 | /** |
| 266 | * struct ubi_rnvol_req - volumes re-name request. | ||
| 267 | * @count: count of volumes to re-name | ||
| 268 | * @padding1: reserved for future, not used, has to be zeroed | ||
| 269 | * @vol_id: ID of the volume to re-name | ||
| 270 | * @name_len: name length | ||
| 271 | * @padding2: reserved for future, not used, has to be zeroed | ||
| 272 | * @name: new volume name | ||
| 273 | * | ||
| 274 | * UBI allows to re-name up to %32 volumes at one go. The count of volumes to | ||
| 275 | * re-name is specified in the @count field. The ID of the volumes to re-name | ||
| 276 | * and the new names are specified in the @vol_id and @name fields. | ||
| 277 | * | ||
| 278 | * The UBI volume re-name operation is atomic, which means that should power cut | ||
| 279 | * happen, the volumes will have either old name or new name. So the possible | ||
| 280 | * use-cases of this command is atomic upgrade. Indeed, to upgrade, say, volumes | ||
| 281 | * A and B one may create temporary volumes %A1 and %B1 with the new contents, | ||
| 282 | * then atomically re-name A1->A and B1->B, in which case old %A and %B will | ||
| 283 | * be removed. | ||
| 284 | * | ||
| 285 | * If it is not desirable to remove old A and B, the re-name request has to | ||
| 286 | * contain 4 entries: A1->A, A->A1, B1->B, B->B1, in which case old A1 and B1 | ||
| 287 | * become A and B, and old A and B will become A1 and B1. | ||
| 288 | * | ||
| 289 | * It is also OK to request: A1->A, A1->X, B1->B, B->Y, in which case old A1 | ||
| 290 | * and B1 become A and B, and old A and B become X and Y. | ||
| 291 | * | ||
| 292 | * In other words, in case of re-naming into an existing volume name, the | ||
| 293 | * existing volume is removed, unless it is re-named as well at the same | ||
| 294 | * re-name request. | ||
| 295 | */ | ||
| 296 | struct ubi_rnvol_req { | ||
| 297 | int32_t count; | ||
| 298 | int8_t padding1[12]; | ||
| 299 | struct { | ||
| 300 | int32_t vol_id; | ||
| 301 | int16_t name_len; | ||
| 302 | int8_t padding2[2]; | ||
| 303 | char name[UBI_MAX_VOLUME_NAME + 1]; | ||
| 304 | } ents[UBI_MAX_RNVOL]; | ||
| 305 | } __attribute__ ((packed)); | ||
| 306 | |||
| 307 | /** | ||
| 254 | * struct ubi_leb_change_req - a data structure used in atomic logical | 308 | * struct ubi_leb_change_req - a data structure used in atomic logical |
| 255 | * eraseblock change requests. | 309 | * eraseblock change requests. |
| 256 | * @lnum: logical eraseblock number to change | 310 | * @lnum: logical eraseblock number to change |
| @@ -261,8 +315,8 @@ struct ubi_rsvol_req { | |||
| 261 | struct ubi_leb_change_req { | 315 | struct ubi_leb_change_req { |
| 262 | int32_t lnum; | 316 | int32_t lnum; |
| 263 | int32_t bytes; | 317 | int32_t bytes; |
| 264 | uint8_t dtype; | 318 | int8_t dtype; |
| 265 | uint8_t padding[7]; | 319 | int8_t padding[7]; |
| 266 | } __attribute__ ((packed)); | 320 | } __attribute__ ((packed)); |
| 267 | 321 | ||
| 268 | #endif /* __UBI_USER_H__ */ | 322 | #endif /* __UBI_USER_H__ */ |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 2dfa96b0575e..7dd29b7e461d 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -51,7 +51,7 @@ struct unix_sock { | |||
| 51 | struct sock *peer; | 51 | struct sock *peer; |
| 52 | struct sock *other; | 52 | struct sock *other; |
| 53 | struct list_head link; | 53 | struct list_head link; |
| 54 | atomic_t inflight; | 54 | atomic_long_t inflight; |
| 55 | spinlock_t lock; | 55 | spinlock_t lock; |
| 56 | unsigned int gc_candidate : 1; | 56 | unsigned int gc_candidate : 1; |
| 57 | wait_queue_head_t peer_wait; | 57 | wait_queue_head_t peer_wait; |
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index dfd8bf66ce27..d364fd594ea4 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h | |||
| @@ -262,7 +262,7 @@ static inline int ieee80211_get_radiotap_len(unsigned char *data) | |||
| 262 | struct ieee80211_radiotap_header *hdr = | 262 | struct ieee80211_radiotap_header *hdr = |
| 263 | (struct ieee80211_radiotap_header *)data; | 263 | (struct ieee80211_radiotap_header *)data; |
| 264 | 264 | ||
| 265 | return le16_to_cpu(get_unaligned(&hdr->it_len)); | 265 | return get_unaligned_le16(&hdr->it_len); |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | #endif /* IEEE80211_RADIOTAP_H */ | 268 | #endif /* IEEE80211_RADIOTAP_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index b5862b975207..250e6ef025a4 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -188,6 +188,8 @@ extern int sysctl_ip_dynaddr; | |||
| 188 | 188 | ||
| 189 | extern void ipfrag_init(void); | 189 | extern void ipfrag_init(void); |
| 190 | 190 | ||
| 191 | extern void ip_static_sysctl_init(void); | ||
| 192 | |||
| 191 | #ifdef CONFIG_INET | 193 | #ifdef CONFIG_INET |
| 192 | #include <net/dst.h> | 194 | #include <net/dst.h> |
| 193 | 195 | ||
diff --git a/include/net/ipcomp.h b/include/net/ipcomp.h index 330b74e813a9..2a1092abaa07 100644 --- a/include/net/ipcomp.h +++ b/include/net/ipcomp.h | |||
| @@ -14,6 +14,12 @@ struct ipcomp_data { | |||
| 14 | 14 | ||
| 15 | struct ip_comp_hdr; | 15 | struct ip_comp_hdr; |
| 16 | struct sk_buff; | 16 | struct sk_buff; |
| 17 | struct xfrm_state; | ||
| 18 | |||
| 19 | int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb); | ||
| 20 | int ipcomp_output(struct xfrm_state *x, struct sk_buff *skb); | ||
| 21 | void ipcomp_destroy(struct xfrm_state *x); | ||
| 22 | int ipcomp_init_state(struct xfrm_state *x); | ||
| 17 | 23 | ||
| 18 | static inline struct ip_comp_hdr *ip_comp_hdr(const struct sk_buff *skb) | 24 | static inline struct ip_comp_hdr *ip_comp_hdr(const struct sk_buff *skb) |
| 19 | { | 25 | { |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 3855620b78a9..a8eb43cf0c7e 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -38,7 +38,9 @@ struct net { | |||
| 38 | struct proc_dir_entry *proc_net; | 38 | struct proc_dir_entry *proc_net; |
| 39 | struct proc_dir_entry *proc_net_stat; | 39 | struct proc_dir_entry *proc_net_stat; |
| 40 | 40 | ||
| 41 | struct list_head sysctl_table_headers; | 41 | #ifdef CONFIG_SYSCTL |
| 42 | struct ctl_table_set sysctls; | ||
| 43 | #endif | ||
| 42 | 44 | ||
| 43 | struct net_device *loopback_dev; /* The loopback */ | 45 | struct net_device *loopback_dev; /* The loopback */ |
| 44 | 46 | ||
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 0c96e7bed5db..8d6e991ef4df 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
| 19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
| 20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
| 21 | #include <linux/bug.h> | ||
| 21 | 22 | ||
| 22 | #include <net/sock.h> | 23 | #include <net/sock.h> |
| 23 | 24 | ||
| @@ -170,7 +171,7 @@ static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue | |||
| 170 | { | 171 | { |
| 171 | struct request_sock *req = queue->rskq_accept_head; | 172 | struct request_sock *req = queue->rskq_accept_head; |
| 172 | 173 | ||
| 173 | BUG_TRAP(req != NULL); | 174 | WARN_ON(req == NULL); |
| 174 | 175 | ||
| 175 | queue->rskq_accept_head = req->dl_next; | 176 | queue->rskq_accept_head = req->dl_next; |
| 176 | if (queue->rskq_accept_head == NULL) | 177 | if (queue->rskq_accept_head == NULL) |
| @@ -185,7 +186,7 @@ static inline struct sock *reqsk_queue_get_child(struct request_sock_queue *queu | |||
| 185 | struct request_sock *req = reqsk_queue_remove(queue); | 186 | struct request_sock *req = reqsk_queue_remove(queue); |
| 186 | struct sock *child = req->sk; | 187 | struct sock *child = req->sk; |
| 187 | 188 | ||
| 188 | BUG_TRAP(child != NULL); | 189 | WARN_ON(child == NULL); |
| 189 | 190 | ||
| 190 | sk_acceptq_removed(parent); | 191 | sk_acceptq_removed(parent); |
| 191 | __reqsk_free(req); | 192 | __reqsk_free(req); |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 90b529f7a154..936e333e7ce5 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
| @@ -1590,7 +1590,7 @@ static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr) | |||
| 1590 | { | 1590 | { |
| 1591 | if (dev->dma_ops) | 1591 | if (dev->dma_ops) |
| 1592 | return dev->dma_ops->mapping_error(dev, dma_addr); | 1592 | return dev->dma_ops->mapping_error(dev, dma_addr); |
| 1593 | return dma_mapping_error(dma_addr); | 1593 | return dma_mapping_error(dev->dma_device, dma_addr); |
| 1594 | } | 1594 | } |
| 1595 | 1595 | ||
| 1596 | /** | 1596 | /** |
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index 22bb2e7bab1a..df7faf09d66f 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h | |||
| @@ -57,7 +57,9 @@ enum rdma_cm_event_type { | |||
| 57 | RDMA_CM_EVENT_DISCONNECTED, | 57 | RDMA_CM_EVENT_DISCONNECTED, |
| 58 | RDMA_CM_EVENT_DEVICE_REMOVAL, | 58 | RDMA_CM_EVENT_DEVICE_REMOVAL, |
| 59 | RDMA_CM_EVENT_MULTICAST_JOIN, | 59 | RDMA_CM_EVENT_MULTICAST_JOIN, |
| 60 | RDMA_CM_EVENT_MULTICAST_ERROR | 60 | RDMA_CM_EVENT_MULTICAST_ERROR, |
| 61 | RDMA_CM_EVENT_ADDR_CHANGE, | ||
| 62 | RDMA_CM_EVENT_TIMEWAIT_EXIT | ||
| 61 | }; | 63 | }; |
| 62 | 64 | ||
| 63 | enum rdma_port_space { | 65 | enum rdma_port_space { |
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h index ed64862c4e18..613173b5db69 100644 --- a/include/video/atmel_lcdc.h +++ b/include/video/atmel_lcdc.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #ifndef __ATMEL_LCDC_H__ | 22 | #ifndef __ATMEL_LCDC_H__ |
| 23 | #define __ATMEL_LCDC_H__ | 23 | #define __ATMEL_LCDC_H__ |
| 24 | 24 | ||
| 25 | #include <linux/workqueue.h> | ||
| 25 | 26 | ||
| 26 | /* Way LCD wires are connected to the chip: | 27 | /* Way LCD wires are connected to the chip: |
| 27 | * Some Atmel chips use BGR color mode (instead of standard RGB) | 28 | * Some Atmel chips use BGR color mode (instead of standard RGB) |
| @@ -37,6 +38,7 @@ struct atmel_lcdfb_info { | |||
| 37 | struct fb_info *info; | 38 | struct fb_info *info; |
| 38 | void __iomem *mmio; | 39 | void __iomem *mmio; |
| 39 | unsigned long irq_base; | 40 | unsigned long irq_base; |
| 41 | struct work_struct task; | ||
| 40 | 42 | ||
| 41 | unsigned int guard_time; | 43 | unsigned int guard_time; |
| 42 | struct platform_device *pdev; | 44 | struct platform_device *pdev; |
diff --git a/include/video/ili9320.h b/include/video/ili9320.h new file mode 100644 index 000000000000..e5d1622e3f33 --- /dev/null +++ b/include/video/ili9320.h | |||
| @@ -0,0 +1,201 @@ | |||
| 1 | /* include/video/ili9320.c | ||
| 2 | * | ||
| 3 | * ILI9320 LCD controller configuration control. | ||
| 4 | * | ||
| 5 | * Copyright 2007 Simtec Electronics | ||
| 6 | * Ben Dooks <ben@simtec.co.uk> | ||
| 7 | * | ||
| 8 | * http://armlinux.simtec.co.uk/ | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define ILI9320_REG(x) (x) | ||
| 16 | |||
| 17 | #define ILI9320_INDEX ILI9320_REG(0x00) | ||
| 18 | |||
| 19 | #define ILI9320_OSCILATION ILI9320_REG(0x00) | ||
| 20 | #define ILI9320_DRIVER ILI9320_REG(0x01) | ||
| 21 | #define ILI9320_DRIVEWAVE ILI9320_REG(0x02) | ||
| 22 | #define ILI9320_ENTRYMODE ILI9320_REG(0x03) | ||
| 23 | #define ILI9320_RESIZING ILI9320_REG(0x04) | ||
| 24 | #define ILI9320_DISPLAY1 ILI9320_REG(0x07) | ||
| 25 | #define ILI9320_DISPLAY2 ILI9320_REG(0x08) | ||
| 26 | #define ILI9320_DISPLAY3 ILI9320_REG(0x09) | ||
| 27 | #define ILI9320_DISPLAY4 ILI9320_REG(0x0A) | ||
| 28 | #define ILI9320_RGB_IF1 ILI9320_REG(0x0C) | ||
| 29 | #define ILI9320_FRAMEMAKER ILI9320_REG(0x0D) | ||
| 30 | #define ILI9320_RGB_IF2 ILI9320_REG(0x0F) | ||
| 31 | |||
| 32 | #define ILI9320_POWER1 ILI9320_REG(0x10) | ||
| 33 | #define ILI9320_POWER2 ILI9320_REG(0x11) | ||
| 34 | #define ILI9320_POWER3 ILI9320_REG(0x12) | ||
| 35 | #define ILI9320_POWER4 ILI9320_REG(0x13) | ||
| 36 | #define ILI9320_GRAM_HORIZ_ADDR ILI9320_REG(0x20) | ||
| 37 | #define ILI9320_GRAM_VERT_ADD ILI9320_REG(0x21) | ||
| 38 | #define ILI9320_POWER7 ILI9320_REG(0x29) | ||
| 39 | #define ILI9320_FRAME_RATE_COLOUR ILI9320_REG(0x2B) | ||
| 40 | |||
| 41 | #define ILI9320_GAMMA1 ILI9320_REG(0x30) | ||
| 42 | #define ILI9320_GAMMA2 ILI9320_REG(0x31) | ||
| 43 | #define ILI9320_GAMMA3 ILI9320_REG(0x32) | ||
| 44 | #define ILI9320_GAMMA4 ILI9320_REG(0x35) | ||
| 45 | #define ILI9320_GAMMA5 ILI9320_REG(0x36) | ||
| 46 | #define ILI9320_GAMMA6 ILI9320_REG(0x37) | ||
| 47 | #define ILI9320_GAMMA7 ILI9320_REG(0x38) | ||
| 48 | #define ILI9320_GAMMA8 ILI9320_REG(0x39) | ||
| 49 | #define ILI9320_GAMMA9 ILI9320_REG(0x3C) | ||
| 50 | #define ILI9320_GAMMA10 ILI9320_REG(0x3D) | ||
| 51 | |||
| 52 | #define ILI9320_HORIZ_START ILI9320_REG(0x50) | ||
| 53 | #define ILI9320_HORIZ_END ILI9320_REG(0x51) | ||
| 54 | #define ILI9320_VERT_START ILI9320_REG(0x52) | ||
| 55 | #define ILI9320_VERT_END ILI9320_REG(0x53) | ||
| 56 | |||
| 57 | #define ILI9320_DRIVER2 ILI9320_REG(0x60) | ||
| 58 | #define ILI9320_BASE_IMAGE ILI9320_REG(0x61) | ||
| 59 | #define ILI9320_VERT_SCROLL ILI9320_REG(0x6a) | ||
| 60 | |||
| 61 | #define ILI9320_PARTIAL1_POSITION ILI9320_REG(0x80) | ||
| 62 | #define ILI9320_PARTIAL1_START ILI9320_REG(0x81) | ||
| 63 | #define ILI9320_PARTIAL1_END ILI9320_REG(0x82) | ||
| 64 | #define ILI9320_PARTIAL2_POSITION ILI9320_REG(0x83) | ||
| 65 | #define ILI9320_PARTIAL2_START ILI9320_REG(0x84) | ||
| 66 | #define ILI9320_PARTIAL2_END ILI9320_REG(0x85) | ||
| 67 | |||
| 68 | #define ILI9320_INTERFACE1 ILI9320_REG(0x90) | ||
| 69 | #define ILI9320_INTERFACE2 ILI9320_REG(0x92) | ||
| 70 | #define ILI9320_INTERFACE3 ILI9320_REG(0x93) | ||
| 71 | #define ILI9320_INTERFACE4 ILI9320_REG(0x95) | ||
| 72 | #define ILI9320_INTERFACE5 ILI9320_REG(0x97) | ||
| 73 | #define ILI9320_INTERFACE6 ILI9320_REG(0x98) | ||
| 74 | |||
| 75 | /* Register contents definitions. */ | ||
| 76 | |||
| 77 | #define ILI9320_OSCILATION_OSC (1 << 0) | ||
| 78 | |||
| 79 | #define ILI9320_DRIVER_SS (1 << 8) | ||
| 80 | #define ILI9320_DRIVER_SM (1 << 10) | ||
| 81 | |||
| 82 | #define ILI9320_DRIVEWAVE_EOR (1 << 8) | ||
| 83 | #define ILI9320_DRIVEWAVE_BC (1 << 9) | ||
| 84 | #define ILI9320_DRIVEWAVE_MUSTSET (1 << 10) | ||
| 85 | |||
| 86 | #define ILI9320_ENTRYMODE_AM (1 << 3) | ||
| 87 | #define ILI9320_ENTRYMODE_ID(x) ((x) << 4) | ||
| 88 | #define ILI9320_ENTRYMODE_ORG (1 << 7) | ||
| 89 | #define ILI9320_ENTRYMODE_HWM (1 << 8) | ||
| 90 | #define ILI9320_ENTRYMODE_BGR (1 << 12) | ||
| 91 | #define ILI9320_ENTRYMODE_DFM (1 << 14) | ||
| 92 | #define ILI9320_ENTRYMODE_TRI (1 << 15) | ||
| 93 | |||
| 94 | |||
| 95 | #define ILI9320_RESIZING_RSZ(x) ((x) << 0) | ||
| 96 | #define ILI9320_RESIZING_RCH(x) ((x) << 4) | ||
| 97 | #define ILI9320_RESIZING_RCV(x) ((x) << 8) | ||
| 98 | |||
| 99 | |||
| 100 | #define ILI9320_DISPLAY1_D(x) ((x) << 0) | ||
| 101 | #define ILI9320_DISPLAY1_CL (1 << 3) | ||
| 102 | #define ILI9320_DISPLAY1_DTE (1 << 4) | ||
| 103 | #define ILI9320_DISPLAY1_GON (1 << 5) | ||
| 104 | #define ILI9320_DISPLAY1_BASEE (1 << 8) | ||
| 105 | #define ILI9320_DISPLAY1_PTDE(x) ((x) << 12) | ||
| 106 | |||
| 107 | |||
| 108 | #define ILI9320_DISPLAY2_BP(x) ((x) << 0) | ||
| 109 | #define ILI9320_DISPLAY2_FP(x) ((x) << 8) | ||
| 110 | |||
| 111 | |||
| 112 | #define ILI9320_RGBIF1_RIM_RGB18 (0 << 0) | ||
| 113 | #define ILI9320_RGBIF1_RIM_RGB16 (1 << 0) | ||
| 114 | #define ILI9320_RGBIF1_RIM_RGB6 (2 << 0) | ||
| 115 | |||
| 116 | #define ILI9320_RGBIF1_CLK_INT (0 << 4) | ||
| 117 | #define ILI9320_RGBIF1_CLK_RGBIF (1 << 4) | ||
| 118 | #define ILI9320_RGBIF1_CLK_VSYNC (2 << 4) | ||
| 119 | |||
| 120 | #define ILI9320_RGBIF1_RM (1 << 8) | ||
| 121 | |||
| 122 | #define ILI9320_RGBIF1_ENC_FRAMES(x) (((x) - 1)<< 13) | ||
| 123 | |||
| 124 | #define ILI9320_RGBIF2_DPL (1 << 0) | ||
| 125 | #define ILI9320_RGBIF2_EPL (1 << 1) | ||
| 126 | #define ILI9320_RGBIF2_HSPL (1 << 3) | ||
| 127 | #define ILI9320_RGBIF2_VSPL (1 << 4) | ||
| 128 | |||
| 129 | |||
| 130 | #define ILI9320_POWER1_SLP (1 << 1) | ||
| 131 | #define ILI9320_POWER1_DSTB (1 << 2) | ||
| 132 | #define ILI9320_POWER1_AP(x) ((x) << 4) | ||
| 133 | #define ILI9320_POWER1_APE (1 << 7) | ||
| 134 | #define ILI9320_POWER1_BT(x) ((x) << 8) | ||
| 135 | #define ILI9320_POWER1_SAP (1 << 12) | ||
| 136 | |||
| 137 | |||
| 138 | #define ILI9320_POWER2_VC(x) ((x) << 0) | ||
| 139 | #define ILI9320_POWER2_DC0(x) ((x) << 4) | ||
| 140 | #define ILI9320_POWER2_DC1(x) ((x) << 8) | ||
| 141 | |||
| 142 | |||
| 143 | #define ILI9320_POWER3_VRH(x) ((x) << 0) | ||
| 144 | #define ILI9320_POWER3_PON (1 << 4) | ||
| 145 | #define ILI9320_POWER3_VCMR (1 << 8) | ||
| 146 | |||
| 147 | |||
| 148 | #define ILI9320_POWER4_VREOUT(x) ((x) << 8) | ||
| 149 | |||
| 150 | |||
| 151 | #define ILI9320_DRIVER2_SCNL(x) ((x) << 0) | ||
| 152 | #define ILI9320_DRIVER2_NL(x) ((x) << 8) | ||
| 153 | #define ILI9320_DRIVER2_GS (1 << 15) | ||
| 154 | |||
| 155 | |||
| 156 | #define ILI9320_BASEIMAGE_REV (1 << 0) | ||
| 157 | #define ILI9320_BASEIMAGE_VLE (1 << 1) | ||
| 158 | #define ILI9320_BASEIMAGE_NDL (1 << 2) | ||
| 159 | |||
| 160 | |||
| 161 | #define ILI9320_INTERFACE4_RTNE(x) (x) | ||
| 162 | #define ILI9320_INTERFACE4_DIVE(x) ((x) << 8) | ||
| 163 | |||
| 164 | /* SPI interface definitions */ | ||
| 165 | |||
| 166 | #define ILI9320_SPI_IDCODE (0x70) | ||
| 167 | #define ILI9320_SPI_ID(x) ((x) << 2) | ||
| 168 | #define ILI9320_SPI_READ (0x01) | ||
| 169 | #define ILI9320_SPI_WRITE (0x00) | ||
| 170 | #define ILI9320_SPI_DATA (0x02) | ||
| 171 | #define ILI9320_SPI_INDEX (0x00) | ||
| 172 | |||
| 173 | /* platform data to pass configuration from lcd */ | ||
| 174 | |||
| 175 | enum ili9320_suspend { | ||
| 176 | ILI9320_SUSPEND_OFF, | ||
| 177 | ILI9320_SUSPEND_DEEP, | ||
| 178 | }; | ||
| 179 | |||
| 180 | struct ili9320_platdata { | ||
| 181 | unsigned short hsize; | ||
| 182 | unsigned short vsize; | ||
| 183 | |||
| 184 | enum ili9320_suspend suspend; | ||
| 185 | |||
| 186 | /* set the reset line, 0 = reset asserted, 1 = normal */ | ||
| 187 | void (*reset)(unsigned int val); | ||
| 188 | |||
| 189 | unsigned short entry_mode; | ||
| 190 | unsigned short display2; | ||
| 191 | unsigned short display3; | ||
| 192 | unsigned short display4; | ||
| 193 | unsigned short rgb_if1; | ||
| 194 | unsigned short rgb_if2; | ||
| 195 | unsigned short interface2; | ||
| 196 | unsigned short interface3; | ||
| 197 | unsigned short interface4; | ||
| 198 | unsigned short interface5; | ||
| 199 | unsigned short interface6; | ||
| 200 | }; | ||
| 201 | |||
diff --git a/include/video/neomagic.h b/include/video/neomagic.h index a9e118a1cd16..38910da0ae59 100644 --- a/include/video/neomagic.h +++ b/include/video/neomagic.h | |||
| @@ -90,23 +90,6 @@ | |||
| 90 | #define PCI_CHIP_NM2360 0x0006 | 90 | #define PCI_CHIP_NM2360 0x0006 |
| 91 | #define PCI_CHIP_NM2380 0x0016 | 91 | #define PCI_CHIP_NM2380 0x0016 |
| 92 | 92 | ||
| 93 | |||
| 94 | struct xtimings { | ||
| 95 | unsigned int pixclock; | ||
| 96 | unsigned int HDisplay; | ||
| 97 | unsigned int HSyncStart; | ||
| 98 | unsigned int HSyncEnd; | ||
| 99 | unsigned int HTotal; | ||
| 100 | unsigned int VDisplay; | ||
| 101 | unsigned int VSyncStart; | ||
| 102 | unsigned int VSyncEnd; | ||
| 103 | unsigned int VTotal; | ||
| 104 | unsigned int sync; | ||
| 105 | int dblscan; | ||
| 106 | int interlaced; | ||
| 107 | }; | ||
| 108 | |||
| 109 | |||
| 110 | /* --------------------------------------------------------------------- */ | 93 | /* --------------------------------------------------------------------- */ |
| 111 | 94 | ||
| 112 | typedef volatile struct { | 95 | typedef volatile struct { |
diff --git a/include/video/platform_lcd.h b/include/video/platform_lcd.h new file mode 100644 index 000000000000..ad3bdfe743b2 --- /dev/null +++ b/include/video/platform_lcd.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* include/video/platform_lcd.h | ||
| 2 | * | ||
| 3 | * Copyright 2008 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Generic platform-device LCD power control interface. | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | struct plat_lcd_data; | ||
| 15 | struct fb_info; | ||
| 16 | |||
| 17 | struct plat_lcd_data { | ||
| 18 | void (*set_power)(struct plat_lcd_data *, unsigned int power); | ||
| 19 | int (*match_fb)(struct plat_lcd_data *, struct fb_info *); | ||
| 20 | }; | ||
| 21 | |||
diff --git a/include/video/trident.h b/include/video/trident.h index 200be2551681..b6ce19d1b61b 100644 --- a/include/video/trident.h +++ b/include/video/trident.h | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | #endif | 4 | #endif |
| 5 | 5 | ||
| 6 | #if TRIDENTFB_DEBUG | 6 | #if TRIDENTFB_DEBUG |
| 7 | #define debug(f,a...) printk("%s:" f, __FUNCTION__ , ## a);mdelay(1000); | 7 | #define debug(f, a...) printk("%s:" f, __func__ , ## a); |
| 8 | #else | 8 | #else |
| 9 | #define debug(f,a...) | 9 | #define debug(f, a...) |
| 10 | #endif | 10 | #endif |
| 11 | 11 | ||
| 12 | #define output(f, a...) pr_info("tridentfb: " f, ## a) | 12 | #define output(f, a...) pr_info("tridentfb: " f, ## a) |
| @@ -24,7 +24,9 @@ | |||
| 24 | #define CYBER9397DVD 0x939A | 24 | #define CYBER9397DVD 0x939A |
| 25 | #define CYBER9520 0x9520 | 25 | #define CYBER9520 0x9520 |
| 26 | #define CYBER9525DVD 0x9525 | 26 | #define CYBER9525DVD 0x9525 |
| 27 | #define TGUI9440 0x9440 | ||
| 27 | #define TGUI9660 0x9660 | 28 | #define TGUI9660 0x9660 |
| 29 | #define PROVIDIA9685 0x9685 | ||
| 28 | #define IMAGE975 0x9750 | 30 | #define IMAGE975 0x9750 |
| 29 | #define IMAGE985 0x9850 | 31 | #define IMAGE985 0x9850 |
| 30 | #define BLADE3D 0x9880 | 32 | #define BLADE3D 0x9880 |
| @@ -39,36 +41,11 @@ | |||
| 39 | #define CYBERBLADEXPm8 0x9910 | 41 | #define CYBERBLADEXPm8 0x9910 |
| 40 | #define CYBERBLADEXPm16 0x9930 | 42 | #define CYBERBLADEXPm16 0x9930 |
| 41 | 43 | ||
| 42 | /* acceleration families */ | ||
| 43 | #define IMAGE 0 | ||
| 44 | #define BLADE 1 | ||
| 45 | #define XP 2 | ||
| 46 | |||
| 47 | #define is_image(id) | ||
| 48 | #define is_xp(id) ((id == CYBERBLADEXPAi1) ||\ | ||
| 49 | (id == CYBERBLADEXPm8) ||\ | ||
| 50 | (id == CYBERBLADEXPm16)) | ||
| 51 | |||
| 52 | #define is_blade(id) ((id == BLADE3D) ||\ | ||
| 53 | (id == CYBERBLADEE4) ||\ | ||
| 54 | (id == CYBERBLADEi7) ||\ | ||
| 55 | (id == CYBERBLADEi7D) ||\ | ||
| 56 | (id == CYBERBLADEi1) ||\ | ||
| 57 | (id == CYBERBLADEi1D) ||\ | ||
| 58 | (id == CYBERBLADEAi1) ||\ | ||
| 59 | (id == CYBERBLADEAi1D)) | ||
| 60 | |||
| 61 | /* these defines are for 'lcd' variable */ | 44 | /* these defines are for 'lcd' variable */ |
| 62 | #define LCD_STRETCH 0 | 45 | #define LCD_STRETCH 0 |
| 63 | #define LCD_CENTER 1 | 46 | #define LCD_CENTER 1 |
| 64 | #define LCD_BIOS 2 | 47 | #define LCD_BIOS 2 |
| 65 | 48 | ||
| 66 | /* display types */ | ||
| 67 | #define DISPLAY_CRT 0 | ||
| 68 | #define DISPLAY_FP 1 | ||
| 69 | |||
| 70 | #define flatpanel (displaytype == DISPLAY_FP) | ||
| 71 | |||
| 72 | /* General Registers */ | 49 | /* General Registers */ |
| 73 | #define SPR 0x1F /* Software Programming Register (videoram) */ | 50 | #define SPR 0x1F /* Software Programming Register (videoram) */ |
| 74 | 51 | ||
| @@ -88,33 +65,7 @@ | |||
| 88 | #define SKey 0x37 | 65 | #define SKey 0x37 |
| 89 | #define SPKey 0x57 | 66 | #define SPKey 0x57 |
| 90 | 67 | ||
| 91 | /* 0x3x4 */ | ||
| 92 | #define CRTHTotal 0x00 | ||
| 93 | #define CRTHDispEnd 0x01 | ||
| 94 | #define CRTHBlankStart 0x02 | ||
| 95 | #define CRTHBlankEnd 0x03 | ||
| 96 | #define CRTHSyncStart 0x04 | ||
| 97 | #define CRTHSyncEnd 0x05 | ||
| 98 | |||
| 99 | #define CRTVTotal 0x06 | ||
| 100 | #define CRTVDispEnd 0x12 | ||
| 101 | #define CRTVBlankStart 0x15 | ||
| 102 | #define CRTVBlankEnd 0x16 | ||
| 103 | #define CRTVSyncStart 0x10 | ||
| 104 | #define CRTVSyncEnd 0x11 | ||
| 105 | |||
| 106 | #define CRTOverflow 0x07 | ||
| 107 | #define CRTPRowScan 0x08 | ||
| 108 | #define CRTMaxScanLine 0x09 | ||
| 109 | #define CRTModeControl 0x17 | ||
| 110 | #define CRTLineCompare 0x18 | ||
| 111 | |||
| 112 | /* 3x4 */ | 68 | /* 3x4 */ |
| 113 | #define StartAddrHigh 0x0C | ||
| 114 | #define StartAddrLow 0x0D | ||
| 115 | #define Offset 0x13 | ||
| 116 | #define Underline 0x14 | ||
| 117 | #define CRTCMode 0x17 | ||
| 118 | #define CRTCModuleTest 0x1E | 69 | #define CRTCModuleTest 0x1E |
| 119 | #define FIFOControl 0x20 | 70 | #define FIFOControl 0x20 |
| 120 | #define LinearAddReg 0x21 | 71 | #define LinearAddReg 0x21 |
| @@ -173,3 +124,23 @@ | |||
| 173 | #define BiosMode 0x5c | 124 | #define BiosMode 0x5c |
| 174 | #define BiosReg 0x5d | 125 | #define BiosReg 0x5d |
| 175 | 126 | ||
| 127 | /* Graphics Engine */ | ||
| 128 | #define STATUS 0x2120 | ||
| 129 | #define OLDCMD 0x2124 | ||
| 130 | #define DRAWFL 0x2128 | ||
| 131 | #define OLDCLR 0x212C | ||
| 132 | #define OLDDST 0x2138 | ||
| 133 | #define OLDSRC 0x213C | ||
| 134 | #define OLDDIM 0x2140 | ||
| 135 | #define CMD 0x2144 | ||
| 136 | #define ROP 0x2148 | ||
| 137 | #define COLOR 0x2160 | ||
| 138 | #define BGCOLOR 0x2164 | ||
| 139 | #define SRC1 0x2100 | ||
| 140 | #define SRC2 0x2104 | ||
| 141 | #define DST1 0x2108 | ||
| 142 | #define DST2 0x210C | ||
| 143 | |||
| 144 | #define ROP_S 0xCC | ||
| 145 | #define ROP_P 0xF0 | ||
| 146 | #define ROP_X 0x66 | ||
