diff options
Diffstat (limited to 'include')
300 files changed, 4181 insertions, 2149 deletions
diff --git a/include/asm-alpha/fb.h b/include/asm-alpha/fb.h new file mode 100644 index 000000000000..fa9bbb96b2b3 --- /dev/null +++ b/include/asm-alpha/fb.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | #include <linux/device.h> | ||
| 4 | |||
| 5 | /* Caching is off in the I/O space quadrant by design. */ | ||
| 6 | #define fb_pgprotect(...) do {} while (0) | ||
| 7 | |||
| 8 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 9 | { | ||
| 10 | return 0; | ||
| 11 | } | ||
| 12 | |||
| 13 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h index 21a86f1a05b3..ab5b60dcef19 100644 --- a/include/asm-alpha/io.h +++ b/include/asm-alpha/io.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
| 5 | 5 | ||
| 6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
| 7 | #include <linux/mm.h> | ||
| 7 | #include <asm/compiler.h> | 8 | #include <asm/compiler.h> |
| 8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
| 9 | #include <asm/pgtable.h> | 10 | #include <asm/pgtable.h> |
| @@ -90,6 +91,11 @@ static inline void * phys_to_virt(unsigned long address) | |||
| 90 | 91 | ||
| 91 | #define page_to_phys(page) page_to_pa(page) | 92 | #define page_to_phys(page) page_to_pa(page) |
| 92 | 93 | ||
| 94 | static inline dma_addr_t __deprecated isa_page_to_bus(struct page *page) | ||
| 95 | { | ||
| 96 | return page_to_phys(page); | ||
| 97 | } | ||
| 98 | |||
| 93 | /* This depends on working iommu. */ | 99 | /* This depends on working iommu. */ |
| 94 | #define BIO_VMERGE_BOUNDARY (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0) | 100 | #define BIO_VMERGE_BOUNDARY (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0) |
| 95 | 101 | ||
| @@ -102,12 +108,12 @@ static inline void * phys_to_virt(unsigned long address) | |||
| 102 | * | 108 | * |
| 103 | * Note that this only works for a limited range of kernel addresses, | 109 | * Note that this only works for a limited range of kernel addresses, |
| 104 | * and very well may not span all memory. Consider this interface | 110 | * and very well may not span all memory. Consider this interface |
| 105 | * deprecated in favour of the mapping functions in <asm/pci.h>. | 111 | * deprecated in favour of the DMA-mapping API. |
| 106 | */ | 112 | */ |
| 107 | extern unsigned long __direct_map_base; | 113 | extern unsigned long __direct_map_base; |
| 108 | extern unsigned long __direct_map_size; | 114 | extern unsigned long __direct_map_size; |
| 109 | 115 | ||
| 110 | static inline unsigned long virt_to_bus(void *address) | 116 | static inline unsigned long __deprecated virt_to_bus(void *address) |
| 111 | { | 117 | { |
| 112 | unsigned long phys = virt_to_phys(address); | 118 | unsigned long phys = virt_to_phys(address); |
| 113 | unsigned long bus = phys + __direct_map_base; | 119 | unsigned long bus = phys + __direct_map_base; |
| @@ -115,7 +121,7 @@ static inline unsigned long virt_to_bus(void *address) | |||
| 115 | } | 121 | } |
| 116 | #define isa_virt_to_bus virt_to_bus | 122 | #define isa_virt_to_bus virt_to_bus |
| 117 | 123 | ||
| 118 | static inline void *bus_to_virt(unsigned long address) | 124 | static inline void * __deprecated bus_to_virt(unsigned long address) |
| 119 | { | 125 | { |
| 120 | void *virt; | 126 | void *virt; |
| 121 | 127 | ||
| @@ -126,6 +132,7 @@ static inline void *bus_to_virt(unsigned long address) | |||
| 126 | virt = phys_to_virt(address); | 132 | virt = phys_to_virt(address); |
| 127 | return (long)address <= 0 ? NULL : virt; | 133 | return (long)address <= 0 ? NULL : virt; |
| 128 | } | 134 | } |
| 135 | #define isa_bus_to_virt bus_to_virt | ||
| 129 | 136 | ||
| 130 | /* | 137 | /* |
| 131 | * There are different chipsets to interface the Alpha CPUs to the world. | 138 | * There are different chipsets to interface the Alpha CPUs to the world. |
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h index d2bed3cb33ff..bae7f05716d4 100644 --- a/include/asm-alpha/page.h +++ b/include/asm-alpha/page.h | |||
| @@ -17,7 +17,8 @@ | |||
| 17 | extern void clear_page(void *page); | 17 | extern void clear_page(void *page); |
| 18 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 18 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 19 | 19 | ||
| 20 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vmaddr) | 20 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 21 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vmaddr) | ||
| 21 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 22 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 22 | 23 | ||
| 23 | extern void copy_page(void * _to, void * _from); | 24 | extern void copy_page(void * _to, void * _from); |
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index 616d20662ff3..99037b032357 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h | |||
| @@ -264,21 +264,15 @@ extern inline void pgd_clear(pgd_t * pgdp) { pgd_val(*pgdp) = 0; } | |||
| 264 | * The following only work if pte_present() is true. | 264 | * The following only work if pte_present() is true. |
| 265 | * Undefined behaviour if not.. | 265 | * Undefined behaviour if not.. |
| 266 | */ | 266 | */ |
| 267 | extern inline int pte_read(pte_t pte) { return !(pte_val(pte) & _PAGE_FOR); } | ||
| 268 | extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_FOW); } | 267 | extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_FOW); } |
| 269 | extern inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_FOE); } | ||
| 270 | extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 268 | extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
| 271 | extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 269 | extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 272 | extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 270 | extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| 273 | 271 | ||
| 274 | extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; } | 272 | extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; } |
| 275 | extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOR; return pte; } | ||
| 276 | extern inline pte_t pte_exprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOE; return pte; } | ||
| 277 | extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(__DIRTY_BITS); return pte; } | 273 | extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~(__DIRTY_BITS); return pte; } |
| 278 | extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(__ACCESS_BITS); return pte; } | 274 | extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(__ACCESS_BITS); return pte; } |
| 279 | extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_FOW; return pte; } | 275 | extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_FOW; return pte; } |
| 280 | extern inline pte_t pte_mkread(pte_t pte) { pte_val(pte) &= ~_PAGE_FOR; return pte; } | ||
| 281 | extern inline pte_t pte_mkexec(pte_t pte) { pte_val(pte) &= ~_PAGE_FOE; return pte; } | ||
| 282 | extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; return pte; } | 276 | extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; return pte; } |
| 283 | extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; } | 277 | extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; } |
| 284 | 278 | ||
diff --git a/include/asm-alpha/termios.h b/include/asm-alpha/termios.h index 39e492c3bfa3..fa13716a11c3 100644 --- a/include/asm-alpha/termios.h +++ b/include/asm-alpha/termios.h | |||
| @@ -81,7 +81,7 @@ struct termio { | |||
| 81 | 81 | ||
| 82 | #define user_termio_to_kernel_termios(a_termios, u_termio) \ | 82 | #define user_termio_to_kernel_termios(a_termios, u_termio) \ |
| 83 | ({ \ | 83 | ({ \ |
| 84 | struct termios *k_termios = (a_termios); \ | 84 | struct ktermios *k_termios = (a_termios); \ |
| 85 | struct termio k_termio; \ | 85 | struct termio k_termio; \ |
| 86 | int canon, ret; \ | 86 | int canon, ret; \ |
| 87 | \ | 87 | \ |
| @@ -113,7 +113,7 @@ struct termio { | |||
| 113 | */ | 113 | */ |
| 114 | #define kernel_termios_to_user_termio(u_termio, a_termios) \ | 114 | #define kernel_termios_to_user_termio(u_termio, a_termios) \ |
| 115 | ({ \ | 115 | ({ \ |
| 116 | struct termios *k_termios = (a_termios); \ | 116 | struct ktermios *k_termios = (a_termios); \ |
| 117 | struct termio k_termio; \ | 117 | struct termio k_termio; \ |
| 118 | int canon; \ | 118 | int canon; \ |
| 119 | \ | 119 | \ |
diff --git a/include/asm-arm/arch-at91/board.h b/include/asm-arm/arch-at91/board.h index 0ce6ee98ed0b..d96b10fd449f 100644 --- a/include/asm-arm/arch-at91/board.h +++ b/include/asm-arm/arch-at91/board.h | |||
| @@ -64,6 +64,7 @@ extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) | |||
| 64 | 64 | ||
| 65 | /* Ethernet (EMAC & MACB) */ | 65 | /* Ethernet (EMAC & MACB) */ |
| 66 | struct at91_eth_data { | 66 | struct at91_eth_data { |
| 67 | u32 phy_mask; | ||
| 67 | u8 phy_irq_pin; /* PHY IRQ */ | 68 | u8 phy_irq_pin; /* PHY IRQ */ |
| 68 | u8 is_rmii; /* using RMII interface? */ | 69 | u8 is_rmii; /* using RMII interface? */ |
| 69 | }; | 70 | }; |
diff --git a/include/asm-arm/fb.h b/include/asm-arm/fb.h new file mode 100644 index 000000000000..d92e99cd8c8a --- /dev/null +++ b/include/asm-arm/fb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 21dec9f258d8..d2e8171d1d4e 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
| @@ -83,14 +83,14 @@ | |||
| 83 | * means that a write to a clean page will cause a permission fault, and | 83 | * means that a write to a clean page will cause a permission fault, and |
| 84 | * the Linux MM layer will mark the page dirty via handle_pte_fault(). | 84 | * the Linux MM layer will mark the page dirty via handle_pte_fault(). |
| 85 | * For the hardware to notice the permission change, the TLB entry must | 85 | * For the hardware to notice the permission change, the TLB entry must |
| 86 | * be flushed, and ptep_establish() does that for us. | 86 | * be flushed, and ptep_set_access_flags() does that for us. |
| 87 | * | 87 | * |
| 88 | * The "accessed" or "young" bit is emulated by a similar method; we only | 88 | * The "accessed" or "young" bit is emulated by a similar method; we only |
| 89 | * allow accesses to the page if the "young" bit is set. Accesses to the | 89 | * allow accesses to the page if the "young" bit is set. Accesses to the |
| 90 | * page will cause a fault, and handle_pte_fault() will set the young bit | 90 | * page will cause a fault, and handle_pte_fault() will set the young bit |
| 91 | * for us as long as the page is marked present in the corresponding Linux | 91 | * for us as long as the page is marked present in the corresponding Linux |
| 92 | * PTE entry. Again, ptep_establish() will ensure that the TLB is up to | 92 | * PTE entry. Again, ptep_set_access_flags() will ensure that the TLB is |
| 93 | * date. | 93 | * up to date. |
| 94 | * | 94 | * |
| 95 | * However, when the "young" bit is cleared, we deny access to the page | 95 | * However, when the "young" bit is cleared, we deny access to the page |
| 96 | * by clearing the hardware PTE. Currently Linux does not flush the TLB | 96 | * by clearing the hardware PTE. Currently Linux does not flush the TLB |
| @@ -257,9 +257,7 @@ extern struct page *empty_zero_page; | |||
| 257 | * Undefined behaviour if not.. | 257 | * Undefined behaviour if not.. |
| 258 | */ | 258 | */ |
| 259 | #define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT) | 259 | #define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT) |
| 260 | #define pte_read(pte) (pte_val(pte) & L_PTE_USER) | ||
| 261 | #define pte_write(pte) (pte_val(pte) & L_PTE_WRITE) | 260 | #define pte_write(pte) (pte_val(pte) & L_PTE_WRITE) |
| 262 | #define pte_exec(pte) (pte_val(pte) & L_PTE_EXEC) | ||
| 263 | #define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY) | 261 | #define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY) |
| 264 | #define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) | 262 | #define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) |
| 265 | 263 | ||
| @@ -275,12 +273,8 @@ extern struct page *empty_zero_page; | |||
| 275 | #define PTE_BIT_FUNC(fn,op) \ | 273 | #define PTE_BIT_FUNC(fn,op) \ |
| 276 | static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } | 274 | static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } |
| 277 | 275 | ||
| 278 | /*PTE_BIT_FUNC(rdprotect, &= ~L_PTE_USER);*/ | ||
| 279 | /*PTE_BIT_FUNC(mkread, |= L_PTE_USER);*/ | ||
| 280 | PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE); | 276 | PTE_BIT_FUNC(wrprotect, &= ~L_PTE_WRITE); |
| 281 | PTE_BIT_FUNC(mkwrite, |= L_PTE_WRITE); | 277 | PTE_BIT_FUNC(mkwrite, |= L_PTE_WRITE); |
| 282 | PTE_BIT_FUNC(exprotect, &= ~L_PTE_EXEC); | ||
| 283 | PTE_BIT_FUNC(mkexec, |= L_PTE_EXEC); | ||
| 284 | PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY); | 278 | PTE_BIT_FUNC(mkclean, &= ~L_PTE_DIRTY); |
| 285 | PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY); | 279 | PTE_BIT_FUNC(mkdirty, |= L_PTE_DIRTY); |
| 286 | PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG); | 280 | PTE_BIT_FUNC(mkold, &= ~L_PTE_YOUNG); |
diff --git a/include/asm-arm26/dma-mapping.h b/include/asm-arm26/dma-mapping.h deleted file mode 100644 index a95eae0aeb77..000000000000 --- a/include/asm-arm26/dma-mapping.h +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | #include <asm-generic/dma-mapping-broken.h> | ||
| 2 | |||
diff --git a/include/asm-arm26/fb.h b/include/asm-arm26/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-arm26/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-arm26/ioctls.h b/include/asm-arm26/ioctls.h index ba9c7d81d24e..8a3296200be1 100644 --- a/include/asm-arm26/ioctls.h +++ b/include/asm-arm26/ioctls.h | |||
| @@ -47,6 +47,10 @@ | |||
| 47 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 47 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
| 48 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 48 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
| 49 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 49 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
| 50 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
| 51 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
| 52 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
| 53 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
| 50 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
| 51 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
| 52 | 56 | ||
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h index 2b20e9f08857..55a1a697d12b 100644 --- a/include/asm-arm26/pgtable.h +++ b/include/asm-arm26/pgtable.h | |||
| @@ -218,9 +218,7 @@ extern struct page *empty_zero_page; | |||
| 218 | * The following only work if pte_present() is true. | 218 | * The following only work if pte_present() is true. |
| 219 | * Undefined behaviour if not.. | 219 | * Undefined behaviour if not.. |
| 220 | */ | 220 | */ |
| 221 | #define pte_read(pte) (!(pte_val(pte) & _PAGE_NOT_USER)) | ||
| 222 | #define pte_write(pte) (!(pte_val(pte) & _PAGE_READONLY)) | 221 | #define pte_write(pte) (!(pte_val(pte) & _PAGE_READONLY)) |
| 223 | #define pte_exec(pte) (!(pte_val(pte) & _PAGE_NOT_USER)) | ||
| 224 | #define pte_dirty(pte) (!(pte_val(pte) & _PAGE_CLEAN)) | 222 | #define pte_dirty(pte) (!(pte_val(pte) & _PAGE_CLEAN)) |
| 225 | #define pte_young(pte) (!(pte_val(pte) & _PAGE_OLD)) | 223 | #define pte_young(pte) (!(pte_val(pte) & _PAGE_OLD)) |
| 226 | //ONLY when !pte_present() I think. nicked from arm32 (FIXME!) | 224 | //ONLY when !pte_present() I think. nicked from arm32 (FIXME!) |
| @@ -231,8 +229,6 @@ static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } | |||
| 231 | 229 | ||
| 232 | PTE_BIT_FUNC(wrprotect, |= _PAGE_READONLY); | 230 | PTE_BIT_FUNC(wrprotect, |= _PAGE_READONLY); |
| 233 | PTE_BIT_FUNC(mkwrite, &= ~_PAGE_READONLY); | 231 | PTE_BIT_FUNC(mkwrite, &= ~_PAGE_READONLY); |
| 234 | PTE_BIT_FUNC(exprotect, |= _PAGE_NOT_USER); | ||
| 235 | PTE_BIT_FUNC(mkexec, &= ~_PAGE_NOT_USER); | ||
| 236 | PTE_BIT_FUNC(mkclean, |= _PAGE_CLEAN); | 232 | PTE_BIT_FUNC(mkclean, |= _PAGE_CLEAN); |
| 237 | PTE_BIT_FUNC(mkdirty, &= ~_PAGE_CLEAN); | 233 | PTE_BIT_FUNC(mkdirty, &= ~_PAGE_CLEAN); |
| 238 | PTE_BIT_FUNC(mkold, |= _PAGE_OLD); | 234 | PTE_BIT_FUNC(mkold, |= _PAGE_OLD); |
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h index f66b51804736..48d2f5c7bcb8 100644 --- a/include/asm-arm26/termbits.h +++ b/include/asm-arm26/termbits.h | |||
| @@ -138,6 +138,7 @@ struct ktermios { | |||
| 138 | #define HUPCL 0002000 | 138 | #define HUPCL 0002000 |
| 139 | #define CLOCAL 0004000 | 139 | #define CLOCAL 0004000 |
| 140 | #define CBAUDEX 0010000 | 140 | #define CBAUDEX 0010000 |
| 141 | #define BOTHER 0010000 | ||
| 141 | #define B57600 0010001 | 142 | #define B57600 0010001 |
| 142 | #define B115200 0010002 | 143 | #define B115200 0010002 |
| 143 | #define B230400 0010003 | 144 | #define B230400 0010003 |
| @@ -153,10 +154,12 @@ struct ktermios { | |||
| 153 | #define B3000000 0010015 | 154 | #define B3000000 0010015 |
| 154 | #define B3500000 0010016 | 155 | #define B3500000 0010016 |
| 155 | #define B4000000 0010017 | 156 | #define B4000000 0010017 |
| 156 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 157 | #define CIBAUD 002003600000 /* input baud rate */ |
| 157 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 158 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
| 158 | #define CRTSCTS 020000000000 /* flow control */ | 159 | #define CRTSCTS 020000000000 /* flow control */ |
| 159 | 160 | ||
| 161 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
| 162 | |||
| 160 | /* c_lflag bits */ | 163 | /* c_lflag bits */ |
| 161 | #define ISIG 0000001 | 164 | #define ISIG 0000001 |
| 162 | #define ICANON 0000002 | 165 | #define ICANON 0000002 |
diff --git a/include/asm-arm26/termios.h b/include/asm-arm26/termios.h index 329c324c4040..293e3f1bc3f2 100644 --- a/include/asm-arm26/termios.h +++ b/include/asm-arm26/termios.h | |||
| @@ -82,8 +82,10 @@ struct termio { | |||
| 82 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 82 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
| 83 | }) | 83 | }) |
| 84 | 84 | ||
| 85 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 85 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
| 86 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 86 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
| 87 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
| 88 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
| 87 | 89 | ||
| 88 | #endif /* __KERNEL__ */ | 90 | #endif /* __KERNEL__ */ |
| 89 | 91 | ||
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h index 9fd2e32f84b8..974480438849 100644 --- a/include/asm-avr32/arch-at32ap/board.h +++ b/include/asm-avr32/arch-at32ap/board.h | |||
| @@ -21,6 +21,7 @@ void at32_map_usart(unsigned int hw_id, unsigned int line); | |||
| 21 | struct platform_device *at32_add_device_usart(unsigned int id); | 21 | struct platform_device *at32_add_device_usart(unsigned int id); |
| 22 | 22 | ||
| 23 | struct eth_platform_data { | 23 | struct eth_platform_data { |
| 24 | u32 phy_mask; | ||
| 24 | u8 is_rmii; | 25 | u8 is_rmii; |
| 25 | }; | 26 | }; |
| 26 | struct platform_device * | 27 | struct platform_device * |
diff --git a/include/asm-avr32/fb.h b/include/asm-avr32/fb.h new file mode 100644 index 000000000000..41baf84ad402 --- /dev/null +++ b/include/asm-avr32/fb.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | vma->vm_page_prot = __pgprot((pgprot_val(vma->vm_page_prot) | ||
| 12 | & ~_PAGE_CACHABLE) | ||
| 13 | | (_PAGE_BUFFER | _PAGE_DIRTY)); | ||
| 14 | } | ||
| 15 | |||
| 16 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 17 | { | ||
| 18 | return 0; | ||
| 19 | } | ||
| 20 | |||
| 21 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-avr32/pgtable.h b/include/asm-avr32/pgtable.h index f6cc2b0f75c3..c07bdd10b891 100644 --- a/include/asm-avr32/pgtable.h +++ b/include/asm-avr32/pgtable.h | |||
| @@ -201,18 +201,10 @@ extern struct page *empty_zero_page; | |||
| 201 | * The following only work if pte_present() is true. | 201 | * The following only work if pte_present() is true. |
| 202 | * Undefined behaviour if not.. | 202 | * Undefined behaviour if not.. |
| 203 | */ | 203 | */ |
| 204 | static inline int pte_read(pte_t pte) | ||
| 205 | { | ||
| 206 | return pte_val(pte) & _PAGE_USER; | ||
| 207 | } | ||
| 208 | static inline int pte_write(pte_t pte) | 204 | static inline int pte_write(pte_t pte) |
| 209 | { | 205 | { |
| 210 | return pte_val(pte) & _PAGE_RW; | 206 | return pte_val(pte) & _PAGE_RW; |
| 211 | } | 207 | } |
| 212 | static inline int pte_exec(pte_t pte) | ||
| 213 | { | ||
| 214 | return pte_val(pte) & _PAGE_EXECUTE; | ||
| 215 | } | ||
| 216 | static inline int pte_dirty(pte_t pte) | 208 | static inline int pte_dirty(pte_t pte) |
| 217 | { | 209 | { |
| 218 | return pte_val(pte) & _PAGE_DIRTY; | 210 | return pte_val(pte) & _PAGE_DIRTY; |
| @@ -231,21 +223,11 @@ static inline int pte_file(pte_t pte) | |||
| 231 | } | 223 | } |
| 232 | 224 | ||
| 233 | /* Mutator functions for PTE bits */ | 225 | /* Mutator functions for PTE bits */ |
| 234 | static inline pte_t pte_rdprotect(pte_t pte) | ||
| 235 | { | ||
| 236 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); | ||
| 237 | return pte; | ||
| 238 | } | ||
| 239 | static inline pte_t pte_wrprotect(pte_t pte) | 226 | static inline pte_t pte_wrprotect(pte_t pte) |
| 240 | { | 227 | { |
| 241 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); | 228 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); |
| 242 | return pte; | 229 | return pte; |
| 243 | } | 230 | } |
| 244 | static inline pte_t pte_exprotect(pte_t pte) | ||
| 245 | { | ||
| 246 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE)); | ||
| 247 | return pte; | ||
| 248 | } | ||
| 249 | static inline pte_t pte_mkclean(pte_t pte) | 231 | static inline pte_t pte_mkclean(pte_t pte) |
| 250 | { | 232 | { |
| 251 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); | 233 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); |
| @@ -256,21 +238,11 @@ static inline pte_t pte_mkold(pte_t pte) | |||
| 256 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); | 238 | set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); |
| 257 | return pte; | 239 | return pte; |
| 258 | } | 240 | } |
| 259 | static inline pte_t pte_mkread(pte_t pte) | ||
| 260 | { | ||
| 261 | set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); | ||
| 262 | return pte; | ||
| 263 | } | ||
| 264 | static inline pte_t pte_mkwrite(pte_t pte) | 241 | static inline pte_t pte_mkwrite(pte_t pte) |
| 265 | { | 242 | { |
| 266 | set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); | 243 | set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); |
| 267 | return pte; | 244 | return pte; |
| 268 | } | 245 | } |
| 269 | static inline pte_t pte_mkexec(pte_t pte) | ||
| 270 | { | ||
| 271 | set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); | ||
| 272 | return pte; | ||
| 273 | } | ||
| 274 | static inline pte_t pte_mkdirty(pte_t pte) | 246 | static inline pte_t pte_mkdirty(pte_t pte) |
| 275 | { | 247 | { |
| 276 | set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); | 248 | set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); |
diff --git a/include/asm-blackfin/fb.h b/include/asm-blackfin/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-blackfin/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-cris/fb.h b/include/asm-cris/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-cris/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-cris/ioctls.h b/include/asm-cris/ioctls.h index 97787c3c575f..4f4e52531fa0 100644 --- a/include/asm-cris/ioctls.h +++ b/include/asm-cris/ioctls.h | |||
| @@ -48,6 +48,10 @@ | |||
| 48 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 48 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
| 49 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 49 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
| 50 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 50 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
| 51 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
| 52 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
| 53 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
| 54 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
| 51 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 55 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
| 52 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 56 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
| 53 | 57 | ||
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h index 9f13c32552bf..0648e3153f81 100644 --- a/include/asm-cris/page.h +++ b/include/asm-cris/page.h | |||
| @@ -20,7 +20,8 @@ | |||
| 20 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 20 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 21 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 21 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
| 22 | 22 | ||
| 23 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) | 23 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 24 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | ||
| 24 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 25 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 25 | 26 | ||
| 26 | /* | 27 | /* |
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h index c94a7107019c..417f71116215 100644 --- a/include/asm-cris/pgtable.h +++ b/include/asm-cris/pgtable.h | |||
| @@ -111,9 +111,7 @@ extern unsigned long empty_zero_page; | |||
| 111 | * Undefined behaviour if not.. | 111 | * Undefined behaviour if not.. |
| 112 | */ | 112 | */ |
| 113 | 113 | ||
| 114 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; } | ||
| 115 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } | 114 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } |
| 116 | static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_READ; } | ||
| 117 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } | 115 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } |
| 118 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 116 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 119 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 117 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| @@ -124,18 +122,6 @@ static inline pte_t pte_wrprotect(pte_t pte) | |||
| 124 | return pte; | 122 | return pte; |
| 125 | } | 123 | } |
| 126 | 124 | ||
| 127 | static inline pte_t pte_rdprotect(pte_t pte) | ||
| 128 | { | ||
| 129 | pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ); | ||
| 130 | return pte; | ||
| 131 | } | ||
| 132 | |||
| 133 | static inline pte_t pte_exprotect(pte_t pte) | ||
| 134 | { | ||
| 135 | pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ); | ||
| 136 | return pte; | ||
| 137 | } | ||
| 138 | |||
| 139 | static inline pte_t pte_mkclean(pte_t pte) | 125 | static inline pte_t pte_mkclean(pte_t pte) |
| 140 | { | 126 | { |
| 141 | pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); | 127 | pte_val(pte) &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); |
| @@ -156,22 +142,6 @@ static inline pte_t pte_mkwrite(pte_t pte) | |||
| 156 | return pte; | 142 | return pte; |
| 157 | } | 143 | } |
| 158 | 144 | ||
| 159 | static inline pte_t pte_mkread(pte_t pte) | ||
| 160 | { | ||
| 161 | pte_val(pte) |= _PAGE_READ; | ||
| 162 | if (pte_val(pte) & _PAGE_ACCESSED) | ||
| 163 | pte_val(pte) |= _PAGE_SILENT_READ; | ||
| 164 | return pte; | ||
| 165 | } | ||
| 166 | |||
| 167 | static inline pte_t pte_mkexec(pte_t pte) | ||
| 168 | { | ||
| 169 | pte_val(pte) |= _PAGE_READ; | ||
| 170 | if (pte_val(pte) & _PAGE_ACCESSED) | ||
| 171 | pte_val(pte) |= _PAGE_SILENT_READ; | ||
| 172 | return pte; | ||
| 173 | } | ||
| 174 | |||
| 175 | static inline pte_t pte_mkdirty(pte_t pte) | 145 | static inline pte_t pte_mkdirty(pte_t pte) |
| 176 | { | 146 | { |
| 177 | pte_val(pte) |= _PAGE_MODIFIED; | 147 | pte_val(pte) |= _PAGE_MODIFIED; |
diff --git a/include/asm-cris/termbits.h b/include/asm-cris/termbits.h index 6cc2e2736f7b..71c1b36269b8 100644 --- a/include/asm-cris/termbits.h +++ b/include/asm-cris/termbits.h | |||
| @@ -166,6 +166,7 @@ struct ktermios { | |||
| 166 | #define HUPCL 0002000 | 166 | #define HUPCL 0002000 |
| 167 | #define CLOCAL 0004000 | 167 | #define CLOCAL 0004000 |
| 168 | #define CBAUDEX 0010000 | 168 | #define CBAUDEX 0010000 |
| 169 | #define BOTHER 0010000 | ||
| 169 | #define B57600 0010001 | 170 | #define B57600 0010001 |
| 170 | #define B115200 0010002 | 171 | #define B115200 0010002 |
| 171 | #define B230400 0010003 | 172 | #define B230400 0010003 |
diff --git a/include/asm-cris/termios.h b/include/asm-cris/termios.h index c9dbd4d43368..b0124e6c2e41 100644 --- a/include/asm-cris/termios.h +++ b/include/asm-cris/termios.h | |||
| @@ -81,8 +81,10 @@ struct termio { | |||
| 81 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 81 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
| 82 | }) | 82 | }) |
| 83 | 83 | ||
| 84 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 84 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
| 85 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 85 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
| 86 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
| 87 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
| 86 | 88 | ||
| 87 | #endif /* __KERNEL__ */ | 89 | #endif /* __KERNEL__ */ |
| 88 | 90 | ||
diff --git a/include/asm-frv/fb.h b/include/asm-frv/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-frv/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-frv/pgtable.h b/include/asm-frv/pgtable.h index 114aefae2701..147e995bec24 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
| @@ -377,30 +377,17 @@ static inline pmd_t *pmd_offset(pud_t *dir, unsigned long address) | |||
| 377 | * The following only work if pte_present() is true. | 377 | * The following only work if pte_present() is true. |
| 378 | * Undefined behaviour if not.. | 378 | * Undefined behaviour if not.. |
| 379 | */ | 379 | */ |
| 380 | static inline int pte_read(pte_t pte) { return !((pte).pte & _PAGE_SUPER); } | ||
| 381 | static inline int pte_exec(pte_t pte) { return !((pte).pte & _PAGE_SUPER); } | ||
| 382 | static inline int pte_dirty(pte_t pte) { return (pte).pte & _PAGE_DIRTY; } | 380 | static inline int pte_dirty(pte_t pte) { return (pte).pte & _PAGE_DIRTY; } |
| 383 | static inline int pte_young(pte_t pte) { return (pte).pte & _PAGE_ACCESSED; } | 381 | static inline int pte_young(pte_t pte) { return (pte).pte & _PAGE_ACCESSED; } |
| 384 | static inline int pte_write(pte_t pte) { return !((pte).pte & _PAGE_WP); } | 382 | static inline int pte_write(pte_t pte) { return !((pte).pte & _PAGE_WP); } |
| 385 | 383 | ||
| 386 | static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte |= _PAGE_SUPER; return pte; } | ||
| 387 | static inline pte_t pte_exprotect(pte_t pte) { (pte).pte |= _PAGE_SUPER; return pte; } | ||
| 388 | static inline pte_t pte_mkclean(pte_t pte) { (pte).pte &= ~_PAGE_DIRTY; return pte; } | 384 | static inline pte_t pte_mkclean(pte_t pte) { (pte).pte &= ~_PAGE_DIRTY; return pte; } |
| 389 | static inline pte_t pte_mkold(pte_t pte) { (pte).pte &= ~_PAGE_ACCESSED; return pte; } | 385 | static inline pte_t pte_mkold(pte_t pte) { (pte).pte &= ~_PAGE_ACCESSED; return pte; } |
| 390 | static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte |= _PAGE_WP; return pte; } | 386 | static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte |= _PAGE_WP; return pte; } |
| 391 | static inline pte_t pte_mkread(pte_t pte) { (pte).pte &= ~_PAGE_SUPER; return pte; } | ||
| 392 | static inline pte_t pte_mkexec(pte_t pte) { (pte).pte &= ~_PAGE_SUPER; return pte; } | ||
| 393 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte |= _PAGE_DIRTY; return pte; } | 387 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte |= _PAGE_DIRTY; return pte; } |
| 394 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte |= _PAGE_ACCESSED; return pte; } | 388 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte |= _PAGE_ACCESSED; return pte; } |
| 395 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte &= ~_PAGE_WP; return pte; } | 389 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte &= ~_PAGE_WP; return pte; } |
| 396 | 390 | ||
| 397 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | ||
| 398 | { | ||
| 399 | int i = test_and_clear_bit(_PAGE_BIT_DIRTY, ptep); | ||
| 400 | asm volatile("dcf %M0" :: "U"(*ptep)); | ||
| 401 | return i; | ||
| 402 | } | ||
| 403 | |||
| 404 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | 391 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) |
| 405 | { | 392 | { |
| 406 | int i = test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); | 393 | int i = test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); |
| @@ -510,7 +497,6 @@ static inline int pte_file(pte_t pte) | |||
| 510 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 497 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
| 511 | 498 | ||
| 512 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 499 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 513 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 514 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 500 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 515 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 501 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
| 516 | #define __HAVE_ARCH_PTE_SAME | 502 | #define __HAVE_ARCH_PTE_SAME |
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index d0ea6789b31e..7306c71a8926 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
| @@ -326,10 +326,14 @@ | |||
| 326 | #define __NR_move_pages 317 | 326 | #define __NR_move_pages 317 |
| 327 | #define __NR_getcpu 318 | 327 | #define __NR_getcpu 318 |
| 328 | #define __NR_epoll_pwait 319 | 328 | #define __NR_epoll_pwait 319 |
| 329 | #define __NR_utimensat 320 | ||
| 330 | #define __NR_signalfd 321 | ||
| 331 | #define __NR_timerfd 322 | ||
| 332 | #define __NR_eventfd 323 | ||
| 329 | 333 | ||
| 330 | #ifdef __KERNEL__ | 334 | #ifdef __KERNEL__ |
| 331 | 335 | ||
| 332 | #define NR_syscalls 320 | 336 | #define NR_syscalls 324 |
| 333 | 337 | ||
| 334 | #define __ARCH_WANT_IPC_PARSE_VERSION | 338 | #define __ARCH_WANT_IPC_PARSE_VERSION |
| 335 | /* #define __ARCH_WANT_OLD_READDIR */ | 339 | /* #define __ARCH_WANT_OLD_READDIR */ |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 7f30cce52857..344e3091af24 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
| @@ -28,7 +28,7 @@ struct bug_entry { | |||
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | #ifndef HAVE_ARCH_BUG_ON | 30 | #ifndef HAVE_ARCH_BUG_ON |
| 31 | #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) | 31 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) |
| 32 | #endif | 32 | #endif |
| 33 | 33 | ||
| 34 | #ifndef HAVE_ARCH_WARN_ON | 34 | #ifndef HAVE_ARCH_WARN_ON |
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h index 29413d3d4605..e2468f894d2a 100644 --- a/include/asm-generic/dma-mapping-broken.h +++ b/include/asm-generic/dma-mapping-broken.h | |||
| @@ -1,24 +1,82 @@ | |||
| 1 | #ifndef _ASM_GENERIC_DMA_MAPPING_H | 1 | #ifndef _ASM_GENERIC_DMA_MAPPING_H |
| 2 | #define _ASM_GENERIC_DMA_MAPPING_H | 2 | #define _ASM_GENERIC_DMA_MAPPING_H |
| 3 | 3 | ||
| 4 | /* This is used for archs that do not support DMA */ | 4 | /* define the dma api to allow compilation but not linking of |
| 5 | * dma dependent code. Code that depends on the dma-mapping | ||
| 6 | * API needs to set 'depends on HAS_DMA' in its Kconfig | ||
| 7 | */ | ||
| 5 | 8 | ||
| 6 | static inline void * | 9 | struct scatterlist; |
| 10 | |||
| 11 | extern void * | ||
| 7 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 12 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
| 8 | gfp_t flag) | 13 | gfp_t flag); |
| 9 | { | ||
| 10 | BUG(); | ||
| 11 | return NULL; | ||
| 12 | } | ||
| 13 | 14 | ||
| 14 | static inline void | 15 | extern void |
| 15 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | 16 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, |
| 16 | dma_addr_t dma_handle) | 17 | dma_addr_t dma_handle); |
| 17 | { | ||
| 18 | BUG(); | ||
| 19 | } | ||
| 20 | 18 | ||
| 21 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 19 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
| 22 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 20 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
| 23 | 21 | ||
| 22 | extern dma_addr_t | ||
| 23 | dma_map_single(struct device *dev, void *ptr, size_t size, | ||
| 24 | enum dma_data_direction direction); | ||
| 25 | |||
| 26 | extern void | ||
| 27 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
| 28 | enum dma_data_direction direction); | ||
| 29 | |||
| 30 | extern int | ||
| 31 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
| 32 | enum dma_data_direction direction); | ||
| 33 | |||
| 34 | extern void | ||
| 35 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, | ||
| 36 | enum dma_data_direction direction); | ||
| 37 | |||
| 38 | extern dma_addr_t | ||
| 39 | dma_map_page(struct device *dev, struct page *page, unsigned long offset, | ||
| 40 | size_t size, enum dma_data_direction direction); | ||
| 41 | |||
| 42 | extern void | ||
| 43 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | ||
| 44 | enum dma_data_direction direction); | ||
| 45 | |||
| 46 | extern void | ||
| 47 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
| 48 | enum dma_data_direction direction); | ||
| 49 | |||
| 50 | extern void | ||
| 51 | dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, | ||
| 52 | unsigned long offset, size_t size, | ||
| 53 | enum dma_data_direction direction); | ||
| 54 | |||
| 55 | extern void | ||
| 56 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, | ||
| 57 | enum dma_data_direction direction); | ||
| 58 | |||
| 59 | #define dma_sync_single_for_device dma_sync_single_for_cpu | ||
| 60 | #define dma_sync_single_range_for_device dma_sync_single_range_for_cpu | ||
| 61 | #define dma_sync_sg_for_device dma_sync_sg_for_cpu | ||
| 62 | |||
| 63 | extern int | ||
| 64 | dma_mapping_error(dma_addr_t dma_addr); | ||
| 65 | |||
| 66 | extern int | ||
| 67 | dma_supported(struct device *dev, u64 mask); | ||
| 68 | |||
| 69 | extern int | ||
| 70 | dma_set_mask(struct device *dev, u64 mask); | ||
| 71 | |||
| 72 | extern int | ||
| 73 | dma_get_cache_alignment(void); | ||
| 74 | |||
| 75 | extern int | ||
| 76 | dma_is_consistent(struct device *dev, dma_addr_t dma_handle); | ||
| 77 | |||
| 78 | extern void | ||
| 79 | dma_cache_sync(struct device *dev, void *vaddr, size_t size, | ||
| 80 | enum dma_data_direction direction); | ||
| 81 | |||
| 24 | #endif /* _ASM_GENERIC_DMA_MAPPING_H */ | 82 | #endif /* _ASM_GENERIC_DMA_MAPPING_H */ |
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index c154b9d6e7e5..b8477414c5c8 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h | |||
| @@ -48,6 +48,9 @@ | |||
| 48 | #ifndef O_NOATIME | 48 | #ifndef O_NOATIME |
| 49 | #define O_NOATIME 01000000 | 49 | #define O_NOATIME 01000000 |
| 50 | #endif | 50 | #endif |
| 51 | #ifndef O_CLOEXEC | ||
| 52 | #define O_CLOEXEC 02000000 /* set close_on_exec */ | ||
| 53 | #endif | ||
| 51 | #ifndef O_NDELAY | 54 | #ifndef O_NDELAY |
| 52 | #define O_NDELAY O_NONBLOCK | 55 | #define O_NDELAY O_NONBLOCK |
| 53 | #endif | 56 | #endif |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 7d7bcf990e99..f605e8d0eed3 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
| @@ -3,25 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
| 5 | 5 | ||
| 6 | #ifndef __HAVE_ARCH_PTEP_ESTABLISH | ||
| 7 | /* | ||
| 8 | * Establish a new mapping: | ||
| 9 | * - flush the old one | ||
| 10 | * - update the page tables | ||
| 11 | * - inform the TLB about the new one | ||
| 12 | * | ||
| 13 | * We hold the mm semaphore for reading, and the pte lock. | ||
| 14 | * | ||
| 15 | * Note: the old pte is known to not be writable, so we don't need to | ||
| 16 | * worry about dirty bits etc getting lost. | ||
| 17 | */ | ||
| 18 | #define ptep_establish(__vma, __address, __ptep, __entry) \ | ||
| 19 | do { \ | ||
| 20 | set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ | ||
| 21 | flush_tlb_page(__vma, __address); \ | ||
| 22 | } while (0) | ||
| 23 | #endif | ||
| 24 | |||
| 25 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 6 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
| 26 | /* | 7 | /* |
| 27 | * Largely same as above, but only sets the access flags (dirty, | 8 | * Largely same as above, but only sets the access flags (dirty, |
| @@ -68,31 +49,6 @@ do { \ | |||
| 68 | }) | 49 | }) |
| 69 | #endif | 50 | #endif |
| 70 | 51 | ||
| 71 | #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 72 | #define ptep_test_and_clear_dirty(__vma, __address, __ptep) \ | ||
| 73 | ({ \ | ||
| 74 | pte_t __pte = *__ptep; \ | ||
| 75 | int r = 1; \ | ||
| 76 | if (!pte_dirty(__pte)) \ | ||
| 77 | r = 0; \ | ||
| 78 | else \ | ||
| 79 | set_pte_at((__vma)->vm_mm, (__address), (__ptep), \ | ||
| 80 | pte_mkclean(__pte)); \ | ||
| 81 | r; \ | ||
| 82 | }) | ||
| 83 | #endif | ||
| 84 | |||
| 85 | #ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH | ||
| 86 | #define ptep_clear_flush_dirty(__vma, __address, __ptep) \ | ||
| 87 | ({ \ | ||
| 88 | int __dirty; \ | ||
| 89 | __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep); \ | ||
| 90 | if (__dirty) \ | ||
| 91 | flush_tlb_page(__vma, __address); \ | ||
| 92 | __dirty; \ | ||
| 93 | }) | ||
| 94 | #endif | ||
| 95 | |||
| 96 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR | 52 | #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 97 | #define ptep_get_and_clear(__mm, __address, __ptep) \ | 53 | #define ptep_get_and_clear(__mm, __address, __ptep) \ |
| 98 | ({ \ | 54 | ({ \ |
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 09ec447fe2af..16a466e50681 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h | |||
| @@ -18,7 +18,8 @@ | |||
| 18 | #define get_unaligned(ptr) \ | 18 | #define get_unaligned(ptr) \ |
| 19 | __get_unaligned((ptr), sizeof(*(ptr))) | 19 | __get_unaligned((ptr), sizeof(*(ptr))) |
| 20 | #define put_unaligned(x,ptr) \ | 20 | #define put_unaligned(x,ptr) \ |
| 21 | __put_unaligned((__u64)(x), (ptr), sizeof(*(ptr))) | 21 | ((void)sizeof(*(ptr)=(x)),\ |
| 22 | __put_unaligned((__force __u64)(x), (ptr), sizeof(*(ptr)))) | ||
| 22 | 23 | ||
| 23 | /* | 24 | /* |
| 24 | * This function doesn't actually exist. The idea is that when | 25 | * This function doesn't actually exist. The idea is that when |
| @@ -95,21 +96,21 @@ static inline void __ustw(__u16 val, __u16 *addr) | |||
| 95 | default: \ | 96 | default: \ |
| 96 | bad_unaligned_access_length(); \ | 97 | bad_unaligned_access_length(); \ |
| 97 | }; \ | 98 | }; \ |
| 98 | (__typeof__(*(ptr)))val; \ | 99 | (__force __typeof__(*(ptr)))val; \ |
| 99 | }) | 100 | }) |
| 100 | 101 | ||
| 101 | #define __put_unaligned(val, ptr, size) \ | 102 | #define __put_unaligned(val, ptr, size) \ |
| 102 | do { \ | 103 | ({ \ |
| 103 | void *__gu_p = ptr; \ | 104 | void *__gu_p = ptr; \ |
| 104 | switch (size) { \ | 105 | switch (size) { \ |
| 105 | case 1: \ | 106 | case 1: \ |
| 106 | *(__u8 *)__gu_p = val; \ | 107 | *(__u8 *)__gu_p = (__force __u8)val; \ |
| 107 | break; \ | 108 | break; \ |
| 108 | case 2: \ | 109 | case 2: \ |
| 109 | __ustw(val, __gu_p); \ | 110 | __ustw((__force __u16)val, __gu_p); \ |
| 110 | break; \ | 111 | break; \ |
| 111 | case 4: \ | 112 | case 4: \ |
| 112 | __ustl(val, __gu_p); \ | 113 | __ustl((__force __u32)val, __gu_p); \ |
| 113 | break; \ | 114 | break; \ |
| 114 | case 8: \ | 115 | case 8: \ |
| 115 | __ustq(val, __gu_p); \ | 116 | __ustq(val, __gu_p); \ |
| @@ -117,6 +118,7 @@ do { \ | |||
| 117 | default: \ | 118 | default: \ |
| 118 | bad_unaligned_access_length(); \ | 119 | bad_unaligned_access_length(); \ |
| 119 | }; \ | 120 | }; \ |
| 120 | } while(0) | 121 | (void)0; \ |
| 122 | }) | ||
| 121 | 123 | ||
| 122 | #endif /* _ASM_GENERIC_UNALIGNED_H */ | 124 | #endif /* _ASM_GENERIC_UNALIGNED_H */ |
diff --git a/include/asm-h8300/dma-mapping.h b/include/asm-h8300/dma-mapping.h deleted file mode 100644 index d00e40099165..000000000000 --- a/include/asm-h8300/dma-mapping.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/dma-mapping-broken.h> | ||
diff --git a/include/asm-h8300/fb.h b/include/asm-h8300/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-h8300/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-h8300/ioctls.h b/include/asm-h8300/ioctls.h index ac20457e5978..98a53d067269 100644 --- a/include/asm-h8300/ioctls.h +++ b/include/asm-h8300/ioctls.h | |||
| @@ -47,6 +47,10 @@ | |||
| 47 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 47 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
| 48 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 48 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
| 49 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 49 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
| 50 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
| 51 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
| 52 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
| 53 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
| 50 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
| 51 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
| 52 | 56 | ||
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index 3b4f2903f91d..c8cc81a3aca5 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h | |||
| @@ -22,7 +22,8 @@ | |||
| 22 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 22 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 23 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 23 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
| 24 | 24 | ||
| 25 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) | 25 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 26 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | ||
| 26 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 27 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 27 | 28 | ||
| 28 | /* | 29 | /* |
diff --git a/include/asm-h8300/termbits.h b/include/asm-h8300/termbits.h index e877b40ac5ba..31eca81db3f7 100644 --- a/include/asm-h8300/termbits.h +++ b/include/asm-h8300/termbits.h | |||
| @@ -141,6 +141,7 @@ struct ktermios { | |||
| 141 | #define HUPCL 0002000 | 141 | #define HUPCL 0002000 |
| 142 | #define CLOCAL 0004000 | 142 | #define CLOCAL 0004000 |
| 143 | #define CBAUDEX 0010000 | 143 | #define CBAUDEX 0010000 |
| 144 | #define BOTHER 0010000 | ||
| 144 | #define B57600 0010001 | 145 | #define B57600 0010001 |
| 145 | #define B115200 0010002 | 146 | #define B115200 0010002 |
| 146 | #define B230400 0010003 | 147 | #define B230400 0010003 |
| @@ -156,10 +157,12 @@ struct ktermios { | |||
| 156 | #define B3000000 0010015 | 157 | #define B3000000 0010015 |
| 157 | #define B3500000 0010016 | 158 | #define B3500000 0010016 |
| 158 | #define B4000000 0010017 | 159 | #define B4000000 0010017 |
| 159 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 160 | #define CIBAUD 002003600000 /* input baud rate */ |
| 160 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 161 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
| 161 | #define CRTSCTS 020000000000 /* flow control */ | 162 | #define CRTSCTS 020000000000 /* flow control */ |
| 162 | 163 | ||
| 164 | #define IBSHIFT 16 /* shift from CBAUD to CIBAUD */ | ||
| 165 | |||
| 163 | /* c_lflag bits */ | 166 | /* c_lflag bits */ |
| 164 | #define ISIG 0000001 | 167 | #define ISIG 0000001 |
| 165 | #define ICANON 0000002 | 168 | #define ICANON 0000002 |
diff --git a/include/asm-h8300/termios.h b/include/asm-h8300/termios.h index fb2925d08c49..70eea64b4213 100644 --- a/include/asm-h8300/termios.h +++ b/include/asm-h8300/termios.h | |||
| @@ -82,8 +82,10 @@ struct termio { | |||
| 82 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 82 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
| 83 | }) | 83 | }) |
| 84 | 84 | ||
| 85 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 85 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
| 86 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 86 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
| 87 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
| 88 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
| 87 | 89 | ||
| 88 | #endif /* __KERNEL__ */ | 90 | #endif /* __KERNEL__ */ |
| 89 | 91 | ||
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h index 45f09dc9caff..aee4009a498e 100644 --- a/include/asm-h8300/thread_info.h +++ b/include/asm-h8300/thread_info.h | |||
| @@ -92,6 +92,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 92 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling | 92 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling |
| 93 | TIF_NEED_RESCHED */ | 93 | TIF_NEED_RESCHED */ |
| 94 | #define TIF_MEMDIE 5 | 94 | #define TIF_MEMDIE 5 |
| 95 | #define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ | ||
| 95 | 96 | ||
| 96 | /* as above, but as bit values */ | 97 | /* as above, but as bit values */ |
| 97 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 98 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| @@ -99,6 +100,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 99 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 100 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
| 100 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 101 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
| 101 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 102 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
| 103 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | ||
| 102 | 104 | ||
| 103 | #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ | 105 | #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ |
| 104 | 106 | ||
diff --git a/include/asm-i386/fb.h b/include/asm-i386/fb.h new file mode 100644 index 000000000000..d1c6297d4a61 --- /dev/null +++ b/include/asm-i386/fb.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | extern int fb_is_primary_device(struct fb_info *info); | ||
| 9 | |||
| 10 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 11 | unsigned long off) | ||
| 12 | { | ||
| 13 | if (boot_cpu_data.x86 > 3) | ||
| 14 | pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; | ||
| 15 | } | ||
| 16 | |||
| 17 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h index 80ea052ee3a4..249e753ac805 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-i386/fixmap.h | |||
| @@ -54,6 +54,8 @@ extern unsigned long __FIXADDR_TOP; | |||
| 54 | enum fixed_addresses { | 54 | enum fixed_addresses { |
| 55 | FIX_HOLE, | 55 | FIX_HOLE, |
| 56 | FIX_VDSO, | 56 | FIX_VDSO, |
| 57 | FIX_DBGP_BASE, | ||
| 58 | FIX_EARLYCON_MEM_BASE, | ||
| 57 | #ifdef CONFIG_X86_LOCAL_APIC | 59 | #ifdef CONFIG_X86_LOCAL_APIC |
| 58 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ | 60 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ |
| 59 | #endif | 61 | #endif |
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index 0fc240c80f49..e7817a3d6578 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h | |||
| @@ -40,14 +40,13 @@ static __inline__ int ide_default_irq(unsigned long base) | |||
| 40 | 40 | ||
| 41 | static __inline__ unsigned long ide_default_io_base(int index) | 41 | static __inline__ unsigned long ide_default_io_base(int index) |
| 42 | { | 42 | { |
| 43 | struct pci_dev *pdev; | ||
| 44 | /* | 43 | /* |
| 45 | * If PCI is present then it is not safe to poke around | 44 | * If PCI is present then it is not safe to poke around |
| 46 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | 45 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are |
| 47 | * defined compatibility mode ports for PCI. A user can | 46 | * defined compatibility mode ports for PCI. A user can |
| 48 | * override this using ide= but we must default safe. | 47 | * override this using ide= but we must default safe. |
| 49 | */ | 48 | */ |
| 50 | if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) { | 49 | if (no_pci_devices()) { |
| 51 | switch(index) { | 50 | switch(index) { |
| 52 | case 2: return 0x1e8; | 51 | case 2: return 0x1e8; |
| 53 | case 3: return 0x168; | 52 | case 3: return 0x168; |
| @@ -55,7 +54,6 @@ static __inline__ unsigned long ide_default_io_base(int index) | |||
| 55 | case 5: return 0x160; | 54 | case 5: return 0x160; |
| 56 | } | 55 | } |
| 57 | } | 56 | } |
| 58 | pci_dev_put(pdev); | ||
| 59 | switch (index) { | 57 | switch (index) { |
| 60 | case 0: return 0x1f0; | 58 | case 0: return 0x1f0; |
| 61 | case 1: return 0x170; | 59 | case 1: return 0x170; |
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index e797586a5bfc..7b65b5b00034 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h | |||
| @@ -129,6 +129,7 @@ extern void iounmap(volatile void __iomem *addr); | |||
| 129 | */ | 129 | */ |
| 130 | extern void *bt_ioremap(unsigned long offset, unsigned long size); | 130 | extern void *bt_ioremap(unsigned long offset, unsigned long size); |
| 131 | extern void bt_iounmap(void *addr, unsigned long size); | 131 | extern void bt_iounmap(void *addr, unsigned long size); |
| 132 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
| 132 | 133 | ||
| 133 | /* Use early IO mappings for DMI because it's initialized early */ | 134 | /* Use early IO mappings for DMI because it's initialized early */ |
| 134 | #define dmi_ioremap bt_ioremap | 135 | #define dmi_ioremap bt_ioremap |
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 818ac8bf01e2..99cf5d3692a9 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h | |||
| @@ -34,7 +34,8 @@ | |||
| 34 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 34 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 35 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 35 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
| 36 | 36 | ||
| 37 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) | 37 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 38 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | ||
| 38 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 39 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 39 | 40 | ||
| 40 | /* | 41 | /* |
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h index a50fd1773de8..84b03cf56a79 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-i386/pgtable-2level.h | |||
| @@ -57,14 +57,6 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp) | |||
| 57 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 57 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
| 58 | 58 | ||
| 59 | /* | 59 | /* |
| 60 | * All present user pages are user-executable: | ||
| 61 | */ | ||
| 62 | static inline int pte_exec(pte_t pte) | ||
| 63 | { | ||
| 64 | return pte_user(pte); | ||
| 65 | } | ||
| 66 | |||
| 67 | /* | ||
| 68 | * All present pages are kernel-executable: | 60 | * All present pages are kernel-executable: |
| 69 | */ | 61 | */ |
| 70 | static inline int pte_exec_kernel(pte_t pte) | 62 | static inline int pte_exec_kernel(pte_t pte) |
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index eb0f1d7e96a1..948a33414118 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h | |||
| @@ -20,26 +20,11 @@ | |||
| 20 | #define pud_present(pud) 1 | 20 | #define pud_present(pud) 1 |
| 21 | 21 | ||
| 22 | /* | 22 | /* |
| 23 | * Is the pte executable? | ||
| 24 | */ | ||
| 25 | static inline int pte_x(pte_t pte) | ||
| 26 | { | ||
| 27 | return !(pte_val(pte) & _PAGE_NX); | ||
| 28 | } | ||
| 29 | |||
| 30 | /* | ||
| 31 | * All present user-pages with !NX bit are user-executable: | ||
| 32 | */ | ||
| 33 | static inline int pte_exec(pte_t pte) | ||
| 34 | { | ||
| 35 | return pte_user(pte) && pte_x(pte); | ||
| 36 | } | ||
| 37 | /* | ||
| 38 | * All present pages with !NX bit are kernel-executable: | 23 | * All present pages with !NX bit are kernel-executable: |
| 39 | */ | 24 | */ |
| 40 | static inline int pte_exec_kernel(pte_t pte) | 25 | static inline int pte_exec_kernel(pte_t pte) |
| 41 | { | 26 | { |
| 42 | return pte_x(pte); | 27 | return !(pte_val(pte) & _PAGE_NX); |
| 43 | } | 28 | } |
| 44 | 29 | ||
| 45 | /* Rules for using set_pte: the pte being assigned *must* be | 30 | /* Rules for using set_pte: the pte being assigned *must* be |
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 628fa7747d0c..c7fefa6b12fd 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
| @@ -79,7 +79,7 @@ void paging_init(void); | |||
| 79 | * area for the same reason. ;) | 79 | * area for the same reason. ;) |
| 80 | */ | 80 | */ |
| 81 | #define VMALLOC_OFFSET (8*1024*1024) | 81 | #define VMALLOC_OFFSET (8*1024*1024) |
| 82 | #define VMALLOC_START (((unsigned long) high_memory + vmalloc_earlyreserve + \ | 82 | #define VMALLOC_START (((unsigned long) high_memory + \ |
| 83 | 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1)) | 83 | 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1)) |
| 84 | #ifdef CONFIG_HIGHMEM | 84 | #ifdef CONFIG_HIGHMEM |
| 85 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) | 85 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) |
| @@ -218,8 +218,6 @@ extern unsigned long pg0[]; | |||
| 218 | * The following only work if pte_present() is true. | 218 | * The following only work if pte_present() is true. |
| 219 | * Undefined behaviour if not.. | 219 | * Undefined behaviour if not.. |
| 220 | */ | 220 | */ |
| 221 | static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; } | ||
| 222 | static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; } | ||
| 223 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } | 221 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } |
| 224 | static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } | 222 | static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } |
| 225 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } | 223 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } |
| @@ -230,13 +228,9 @@ static inline int pte_huge(pte_t pte) { return (pte).pte_low & _PAGE_PSE; } | |||
| 230 | */ | 228 | */ |
| 231 | static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; } | 229 | static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; } |
| 232 | 230 | ||
| 233 | static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; } | ||
| 234 | static inline pte_t pte_exprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; } | ||
| 235 | static inline pte_t pte_mkclean(pte_t pte) { (pte).pte_low &= ~_PAGE_DIRTY; return pte; } | 231 | static inline pte_t pte_mkclean(pte_t pte) { (pte).pte_low &= ~_PAGE_DIRTY; return pte; } |
| 236 | static inline pte_t pte_mkold(pte_t pte) { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; } | 232 | static inline pte_t pte_mkold(pte_t pte) { (pte).pte_low &= ~_PAGE_ACCESSED; return pte; } |
| 237 | static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_RW; return pte; } | 233 | static inline pte_t pte_wrprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_RW; return pte; } |
| 238 | static inline pte_t pte_mkread(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; } | ||
| 239 | static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return pte; } | ||
| 240 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } | 234 | static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } |
| 241 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } | 235 | static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } |
| 242 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } | 236 | static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } |
| @@ -295,17 +289,6 @@ static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep) | |||
| 295 | __changed; \ | 289 | __changed; \ |
| 296 | }) | 290 | }) |
| 297 | 291 | ||
| 298 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 299 | #define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \ | ||
| 300 | int __ret = 0; \ | ||
| 301 | if (pte_dirty(*(ptep))) \ | ||
| 302 | __ret = test_and_clear_bit(_PAGE_BIT_DIRTY, \ | ||
| 303 | &(ptep)->pte_low); \ | ||
| 304 | if (__ret) \ | ||
| 305 | pte_update((vma)->vm_mm, addr, ptep); \ | ||
| 306 | __ret; \ | ||
| 307 | }) | ||
| 308 | |||
| 309 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 292 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 310 | #define ptep_test_and_clear_young(vma, addr, ptep) ({ \ | 293 | #define ptep_test_and_clear_young(vma, addr, ptep) ({ \ |
| 311 | int __ret = 0; \ | 294 | int __ret = 0; \ |
| @@ -317,27 +300,6 @@ static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep) | |||
| 317 | __ret; \ | 300 | __ret; \ |
| 318 | }) | 301 | }) |
| 319 | 302 | ||
| 320 | /* | ||
| 321 | * Rules for using ptep_establish: the pte MUST be a user pte, and | ||
| 322 | * must be a present->present transition. | ||
| 323 | */ | ||
| 324 | #define __HAVE_ARCH_PTEP_ESTABLISH | ||
| 325 | #define ptep_establish(vma, address, ptep, pteval) \ | ||
| 326 | do { \ | ||
| 327 | set_pte_present((vma)->vm_mm, address, ptep, pteval); \ | ||
| 328 | flush_tlb_page(vma, address); \ | ||
| 329 | } while (0) | ||
| 330 | |||
| 331 | #define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH | ||
| 332 | #define ptep_clear_flush_dirty(vma, address, ptep) \ | ||
| 333 | ({ \ | ||
| 334 | int __dirty; \ | ||
| 335 | __dirty = ptep_test_and_clear_dirty((vma), (address), (ptep)); \ | ||
| 336 | if (__dirty) \ | ||
| 337 | flush_tlb_page(vma, address); \ | ||
| 338 | __dirty; \ | ||
| 339 | }) | ||
| 340 | |||
| 341 | #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | 303 | #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH |
| 342 | #define ptep_clear_flush_young(vma, address, ptep) \ | 304 | #define ptep_clear_flush_young(vma, address, ptep) \ |
| 343 | ({ \ | 305 | ({ \ |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 94e0c147c165..422cffef00c9 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
| @@ -228,6 +228,10 @@ extern int bootloader_type; | |||
| 228 | 228 | ||
| 229 | #define HAVE_ARCH_PICK_MMAP_LAYOUT | 229 | #define HAVE_ARCH_PICK_MMAP_LAYOUT |
| 230 | 230 | ||
| 231 | extern void hard_disable_TSC(void); | ||
| 232 | extern void disable_TSC(void); | ||
| 233 | extern void hard_enable_TSC(void); | ||
| 234 | |||
| 231 | /* | 235 | /* |
| 232 | * Size of io_bitmap. | 236 | * Size of io_bitmap. |
| 233 | */ | 237 | */ |
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 4cb0f91ae64f..54424e045e01 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h | |||
| @@ -137,6 +137,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 137 | #define TIF_DEBUG 17 /* uses debug registers */ | 137 | #define TIF_DEBUG 17 /* uses debug registers */ |
| 138 | #define TIF_IO_BITMAP 18 /* uses I/O bitmap */ | 138 | #define TIF_IO_BITMAP 18 /* uses I/O bitmap */ |
| 139 | #define TIF_FREEZE 19 /* is freezing for suspend */ | 139 | #define TIF_FREEZE 19 /* is freezing for suspend */ |
| 140 | #define TIF_NOTSC 20 /* TSC is not accessible in userland */ | ||
| 140 | 141 | ||
| 141 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 142 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| 142 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 143 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
| @@ -151,6 +152,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 151 | #define _TIF_DEBUG (1<<TIF_DEBUG) | 152 | #define _TIF_DEBUG (1<<TIF_DEBUG) |
| 152 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) | 153 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) |
| 153 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 154 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
| 155 | #define _TIF_NOTSC (1<<TIF_NOTSC) | ||
| 154 | 156 | ||
| 155 | /* work to do on interrupt/exception return */ | 157 | /* work to do on interrupt/exception return */ |
| 156 | #define _TIF_WORK_MASK \ | 158 | #define _TIF_WORK_MASK \ |
| @@ -160,7 +162,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 160 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) | 162 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) |
| 161 | 163 | ||
| 162 | /* flags to check in __switch_to() */ | 164 | /* flags to check in __switch_to() */ |
| 163 | #define _TIF_WORK_CTXSW (_TIF_DEBUG|_TIF_IO_BITMAP) | 165 | #define _TIF_WORK_CTXSW_NEXT (_TIF_IO_BITMAP | _TIF_NOTSC | _TIF_DEBUG) |
| 166 | #define _TIF_WORK_CTXSW_PREV (_TIF_IO_BITMAP | _TIF_NOTSC) | ||
| 164 | 167 | ||
| 165 | /* | 168 | /* |
| 166 | * Thread-synchronous status. | 169 | * Thread-synchronous status. |
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h index 40d01d80610d..0f6e5264ab8f 100644 --- a/include/asm-ia64/compat.h +++ b/include/asm-ia64/compat.h | |||
| @@ -31,8 +31,10 @@ typedef s32 compat_timer_t; | |||
| 31 | 31 | ||
| 32 | typedef s32 compat_int_t; | 32 | typedef s32 compat_int_t; |
| 33 | typedef s32 compat_long_t; | 33 | typedef s32 compat_long_t; |
| 34 | typedef s64 __attribute__((aligned(4))) compat_s64; | ||
| 34 | typedef u32 compat_uint_t; | 35 | typedef u32 compat_uint_t; |
| 35 | typedef u32 compat_ulong_t; | 36 | typedef u32 compat_ulong_t; |
| 37 | typedef u64 __attribute__((aligned(4))) compat_u64; | ||
| 36 | 38 | ||
| 37 | struct compat_timespec { | 39 | struct compat_timespec { |
| 38 | compat_time_t tv_sec; | 40 | compat_time_t tv_sec; |
diff --git a/include/asm-ia64/fb.h b/include/asm-ia64/fb.h new file mode 100644 index 000000000000..89a397cee90a --- /dev/null +++ b/include/asm-ia64/fb.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <linux/efi.h> | ||
| 7 | #include <asm/page.h> | ||
| 8 | |||
| 9 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 10 | unsigned long off) | ||
| 11 | { | ||
| 12 | if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start)) | ||
| 13 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
| 14 | else | ||
| 15 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
| 16 | } | ||
| 17 | |||
| 18 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 19 | { | ||
| 20 | return 0; | ||
| 21 | } | ||
| 22 | |||
| 23 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-ia64/ioctls.h b/include/asm-ia64/ioctls.h index 31ee521aeb7a..f41b636a0bf6 100644 --- a/include/asm-ia64/ioctls.h +++ b/include/asm-ia64/ioctls.h | |||
| @@ -53,6 +53,10 @@ | |||
| 53 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 53 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
| 54 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 54 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
| 55 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 55 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
| 56 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
| 57 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
| 58 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
| 59 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
| 56 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 60 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
| 57 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 61 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
| 58 | 62 | ||
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 485759ba9e36..d6345464a2b3 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h | |||
| @@ -87,12 +87,13 @@ do { \ | |||
| 87 | } while (0) | 87 | } while (0) |
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | #define alloc_zeroed_user_highpage(vma, vaddr) \ | 90 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 91 | ({ \ | 91 | ({ \ |
| 92 | struct page *page = alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr); \ | 92 | struct page *page = alloc_page_vma( \ |
| 93 | if (page) \ | 93 | GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr); \ |
| 94 | flush_dcache_page(page); \ | 94 | if (page) \ |
| 95 | page; \ | 95 | flush_dcache_page(page); \ |
| 96 | page; \ | ||
| 96 | }) | 97 | }) |
| 97 | 98 | ||
| 98 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 99 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index 6580f31b3135..de6d01e24dd0 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
| @@ -297,8 +297,6 @@ ia64_phys_addr_valid (unsigned long addr) | |||
| 297 | /* | 297 | /* |
| 298 | * The following have defined behavior only work if pte_present() is true. | 298 | * The following have defined behavior only work if pte_present() is true. |
| 299 | */ | 299 | */ |
| 300 | #define pte_user(pte) ((pte_val(pte) & _PAGE_PL_MASK) == _PAGE_PL_3) | ||
| 301 | #define pte_read(pte) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) < 6) | ||
| 302 | #define pte_write(pte) ((unsigned) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) - 2) <= 4) | 300 | #define pte_write(pte) ((unsigned) (((pte_val(pte) & _PAGE_AR_MASK) >> _PAGE_AR_SHIFT) - 2) <= 4) |
| 303 | #define pte_exec(pte) ((pte_val(pte) & _PAGE_AR_RX) != 0) | 301 | #define pte_exec(pte) ((pte_val(pte) & _PAGE_AR_RX) != 0) |
| 304 | #define pte_dirty(pte) ((pte_val(pte) & _PAGE_D) != 0) | 302 | #define pte_dirty(pte) ((pte_val(pte) & _PAGE_D) != 0) |
| @@ -310,7 +308,6 @@ ia64_phys_addr_valid (unsigned long addr) | |||
| 310 | */ | 308 | */ |
| 311 | #define pte_wrprotect(pte) (__pte(pte_val(pte) & ~_PAGE_AR_RW)) | 309 | #define pte_wrprotect(pte) (__pte(pte_val(pte) & ~_PAGE_AR_RW)) |
| 312 | #define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_AR_RW)) | 310 | #define pte_mkwrite(pte) (__pte(pte_val(pte) | _PAGE_AR_RW)) |
| 313 | #define pte_mkexec(pte) (__pte(pte_val(pte) | _PAGE_AR_RX)) | ||
| 314 | #define pte_mkold(pte) (__pte(pte_val(pte) & ~_PAGE_A)) | 311 | #define pte_mkold(pte) (__pte(pte_val(pte) & ~_PAGE_A)) |
| 315 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) | 312 | #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) |
| 316 | #define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) | 313 | #define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) |
| @@ -398,22 +395,6 @@ ptep_test_and_clear_young (struct vm_area_struct *vma, unsigned long addr, pte_t | |||
| 398 | #endif | 395 | #endif |
| 399 | } | 396 | } |
| 400 | 397 | ||
| 401 | static inline int | ||
| 402 | ptep_test_and_clear_dirty (struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | ||
| 403 | { | ||
| 404 | #ifdef CONFIG_SMP | ||
| 405 | if (!pte_dirty(*ptep)) | ||
| 406 | return 0; | ||
| 407 | return test_and_clear_bit(_PAGE_D_BIT, ptep); | ||
| 408 | #else | ||
| 409 | pte_t pte = *ptep; | ||
| 410 | if (!pte_dirty(pte)) | ||
| 411 | return 0; | ||
| 412 | set_pte_at(vma->vm_mm, addr, ptep, pte_mkclean(pte)); | ||
| 413 | return 1; | ||
| 414 | #endif | ||
| 415 | } | ||
| 416 | |||
| 417 | static inline pte_t | 398 | static inline pte_t |
| 418 | ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 399 | ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
| 419 | { | 400 | { |
| @@ -546,8 +527,10 @@ extern void lazy_mmu_prot_update (pte_t pte); | |||
| 546 | # define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ | 527 | # define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __safely_writable) \ |
| 547 | ({ \ | 528 | ({ \ |
| 548 | int __changed = !pte_same(*(__ptep), __entry); \ | 529 | int __changed = !pte_same(*(__ptep), __entry); \ |
| 549 | if (__changed) \ | 530 | if (__changed) { \ |
| 550 | ptep_establish(__vma, __addr, __ptep, __entry); \ | 531 | set_pte_at((__vma)->vm_mm, (__addr), __ptep, __entry); \ |
| 532 | flush_tlb_page(__vma, __addr); \ | ||
| 533 | } \ | ||
| 551 | __changed; \ | 534 | __changed; \ |
| 552 | }) | 535 | }) |
| 553 | #endif | 536 | #endif |
| @@ -591,7 +574,6 @@ extern void lazy_mmu_prot_update (pte_t pte); | |||
| 591 | #endif | 574 | #endif |
| 592 | 575 | ||
| 593 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 576 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 594 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 595 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 577 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 596 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 578 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
| 597 | #define __HAVE_ARCH_PTE_SAME | 579 | #define __HAVE_ARCH_PTE_SAME |
diff --git a/include/asm-ia64/termbits.h b/include/asm-ia64/termbits.h index 7fae3109ef47..9f162e0089ad 100644 --- a/include/asm-ia64/termbits.h +++ b/include/asm-ia64/termbits.h | |||
| @@ -149,6 +149,7 @@ struct ktermios { | |||
| 149 | #define HUPCL 0002000 | 149 | #define HUPCL 0002000 |
| 150 | #define CLOCAL 0004000 | 150 | #define CLOCAL 0004000 |
| 151 | #define CBAUDEX 0010000 | 151 | #define CBAUDEX 0010000 |
| 152 | #define BOTHER 0010000 | ||
| 152 | #define B57600 0010001 | 153 | #define B57600 0010001 |
| 153 | #define B115200 0010002 | 154 | #define B115200 0010002 |
| 154 | #define B230400 0010003 | 155 | #define B230400 0010003 |
| @@ -164,10 +165,12 @@ struct ktermios { | |||
| 164 | #define B3000000 0010015 | 165 | #define B3000000 0010015 |
| 165 | #define B3500000 0010016 | 166 | #define B3500000 0010016 |
| 166 | #define B4000000 0010017 | 167 | #define B4000000 0010017 |
| 167 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 168 | #define CIBAUD 002003600000 /* input baud rate */ |
| 168 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 169 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
| 169 | #define CRTSCTS 020000000000 /* flow control */ | 170 | #define CRTSCTS 020000000000 /* flow control */ |
| 170 | 171 | ||
| 172 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
| 173 | |||
| 171 | /* c_lflag bits */ | 174 | /* c_lflag bits */ |
| 172 | #define ISIG 0000001 | 175 | #define ISIG 0000001 |
| 173 | #define ICANON 0000002 | 176 | #define ICANON 0000002 |
diff --git a/include/asm-ia64/termios.h b/include/asm-ia64/termios.h index 08750c2d3607..689d218c0c28 100644 --- a/include/asm-ia64/termios.h +++ b/include/asm-ia64/termios.h | |||
| @@ -87,8 +87,10 @@ struct termio { | |||
| 87 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 87 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
| 88 | }) | 88 | }) |
| 89 | 89 | ||
| 90 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 90 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
| 91 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 91 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
| 92 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
| 93 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
| 92 | 94 | ||
| 93 | # endif /* __KERNEL__ */ | 95 | # endif /* __KERNEL__ */ |
| 94 | 96 | ||
diff --git a/include/asm-m32r/dma-mapping.h b/include/asm-m32r/dma-mapping.h deleted file mode 100644 index f9b58ebba361..000000000000 --- a/include/asm-m32r/dma-mapping.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef _ASM_M32R_DMA_MAPPING_H | ||
| 2 | #define _ASM_M32R_DMA_MAPPING_H | ||
| 3 | |||
| 4 | #include <asm-generic/dma-mapping-broken.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_M32R_DMA_MAPPING_H */ | ||
diff --git a/include/asm-m32r/fb.h b/include/asm-m32r/fb.h new file mode 100644 index 000000000000..d92e99cd8c8a --- /dev/null +++ b/include/asm-m32r/fb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-m32r/ioctls.h b/include/asm-m32r/ioctls.h index d23cfc45738a..b9f54bb5d7cf 100644 --- a/include/asm-m32r/ioctls.h +++ b/include/asm-m32r/ioctls.h | |||
| @@ -47,6 +47,10 @@ | |||
| 47 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 47 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
| 48 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 48 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
| 49 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 49 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
| 50 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
| 51 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
| 52 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
| 53 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
| 50 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
| 51 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
| 52 | 56 | ||
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h index 6f6ecf7d14a3..04fd183a2c58 100644 --- a/include/asm-m32r/page.h +++ b/include/asm-m32r/page.h | |||
| @@ -15,7 +15,8 @@ extern void copy_page(void *to, void *from); | |||
| 15 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 15 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 16 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 16 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
| 17 | 17 | ||
| 18 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) | 18 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 19 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | ||
| 19 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 20 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 20 | 21 | ||
| 21 | /* | 22 | /* |
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h index 6604303fc47c..92d7266783fd 100644 --- a/include/asm-m32r/pgtable.h +++ b/include/asm-m32r/pgtable.h | |||
| @@ -191,16 +191,6 @@ extern unsigned long empty_zero_page[1024]; | |||
| 191 | * The following only work if pte_present() is true. | 191 | * The following only work if pte_present() is true. |
| 192 | * Undefined behaviour if not.. | 192 | * Undefined behaviour if not.. |
| 193 | */ | 193 | */ |
| 194 | static inline int pte_read(pte_t pte) | ||
| 195 | { | ||
| 196 | return pte_val(pte) & _PAGE_READ; | ||
| 197 | } | ||
| 198 | |||
| 199 | static inline int pte_exec(pte_t pte) | ||
| 200 | { | ||
| 201 | return pte_val(pte) & _PAGE_EXEC; | ||
| 202 | } | ||
| 203 | |||
| 204 | static inline int pte_dirty(pte_t pte) | 194 | static inline int pte_dirty(pte_t pte) |
| 205 | { | 195 | { |
| 206 | return pte_val(pte) & _PAGE_DIRTY; | 196 | return pte_val(pte) & _PAGE_DIRTY; |
| @@ -224,18 +214,6 @@ static inline int pte_file(pte_t pte) | |||
| 224 | return pte_val(pte) & _PAGE_FILE; | 214 | return pte_val(pte) & _PAGE_FILE; |
| 225 | } | 215 | } |
| 226 | 216 | ||
| 227 | static inline pte_t pte_rdprotect(pte_t pte) | ||
| 228 | { | ||
| 229 | pte_val(pte) &= ~_PAGE_READ; | ||
| 230 | return pte; | ||
| 231 | } | ||
| 232 | |||
| 233 | static inline pte_t pte_exprotect(pte_t pte) | ||
| 234 | { | ||
| 235 | pte_val(pte) &= ~_PAGE_EXEC; | ||
| 236 | return pte; | ||
| 237 | } | ||
| 238 | |||
| 239 | static inline pte_t pte_mkclean(pte_t pte) | 217 | static inline pte_t pte_mkclean(pte_t pte) |
| 240 | { | 218 | { |
| 241 | pte_val(pte) &= ~_PAGE_DIRTY; | 219 | pte_val(pte) &= ~_PAGE_DIRTY; |
| @@ -254,18 +232,6 @@ static inline pte_t pte_wrprotect(pte_t pte) | |||
| 254 | return pte; | 232 | return pte; |
| 255 | } | 233 | } |
| 256 | 234 | ||
| 257 | static inline pte_t pte_mkread(pte_t pte) | ||
| 258 | { | ||
| 259 | pte_val(pte) |= _PAGE_READ; | ||
| 260 | return pte; | ||
| 261 | } | ||
| 262 | |||
| 263 | static inline pte_t pte_mkexec(pte_t pte) | ||
| 264 | { | ||
| 265 | pte_val(pte) |= _PAGE_EXEC; | ||
| 266 | return pte; | ||
| 267 | } | ||
| 268 | |||
| 269 | static inline pte_t pte_mkdirty(pte_t pte) | 235 | static inline pte_t pte_mkdirty(pte_t pte) |
| 270 | { | 236 | { |
| 271 | pte_val(pte) |= _PAGE_DIRTY; | 237 | pte_val(pte) |= _PAGE_DIRTY; |
| @@ -284,11 +250,6 @@ static inline pte_t pte_mkwrite(pte_t pte) | |||
| 284 | return pte; | 250 | return pte; |
| 285 | } | 251 | } |
| 286 | 252 | ||
| 287 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | ||
| 288 | { | ||
| 289 | return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep); | ||
| 290 | } | ||
| 291 | |||
| 292 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | 253 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) |
| 293 | { | 254 | { |
| 294 | return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); | 255 | return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); |
| @@ -382,7 +343,6 @@ static inline void pmd_set(pmd_t * pmdp, pte_t * ptep) | |||
| 382 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 343 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
| 383 | 344 | ||
| 384 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 345 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 385 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 386 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 346 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 387 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 347 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
| 388 | #define __HAVE_ARCH_PTE_SAME | 348 | #define __HAVE_ARCH_PTE_SAME |
diff --git a/include/asm-m32r/termbits.h b/include/asm-m32r/termbits.h index 6be3b8a39841..bc104008b55b 100644 --- a/include/asm-m32r/termbits.h +++ b/include/asm-m32r/termbits.h | |||
| @@ -140,6 +140,7 @@ struct ktermios { | |||
| 140 | #define HUPCL 0002000 | 140 | #define HUPCL 0002000 |
| 141 | #define CLOCAL 0004000 | 141 | #define CLOCAL 0004000 |
| 142 | #define CBAUDEX 0010000 | 142 | #define CBAUDEX 0010000 |
| 143 | #define BOTHER 0010000 | ||
| 143 | #define B57600 0010001 | 144 | #define B57600 0010001 |
| 144 | #define B115200 0010002 | 145 | #define B115200 0010002 |
| 145 | #define B230400 0010003 | 146 | #define B230400 0010003 |
| @@ -155,11 +156,13 @@ struct ktermios { | |||
| 155 | #define B3000000 0010015 | 156 | #define B3000000 0010015 |
| 156 | #define B3500000 0010016 | 157 | #define B3500000 0010016 |
| 157 | #define B4000000 0010017 | 158 | #define B4000000 0010017 |
| 158 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 159 | #define CIBAUD 002003600000 /** input baud rate */ |
| 159 | #define CTVB 004000000000 /* VisioBraille Terminal flow control */ | 160 | #define CTVB 004000000000 /* VisioBraille Terminal flow control */ |
| 160 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 161 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
| 161 | #define CRTSCTS 020000000000 /* flow control */ | 162 | #define CRTSCTS 020000000000 /* flow control */ |
| 162 | 163 | ||
| 164 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
| 165 | |||
| 163 | /* c_lflag bits */ | 166 | /* c_lflag bits */ |
| 164 | #define ISIG 0000001 | 167 | #define ISIG 0000001 |
| 165 | #define ICANON 0000002 | 168 | #define ICANON 0000002 |
diff --git a/include/asm-m32r/termios.h b/include/asm-m32r/termios.h index 4943dd8db44d..93ce79fd342a 100644 --- a/include/asm-m32r/termios.h +++ b/include/asm-m32r/termios.h | |||
| @@ -81,8 +81,10 @@ struct termio { | |||
| 81 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 81 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
| 82 | }) | 82 | }) |
| 83 | 83 | ||
| 84 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 84 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
| 85 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 85 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
| 86 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
| 87 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
| 86 | 88 | ||
| 87 | #endif /* __KERNEL__ */ | 89 | #endif /* __KERNEL__ */ |
| 88 | 90 | ||
diff --git a/include/asm-m68k/atari_SLM.h b/include/asm-m68k/atari_SLM.h deleted file mode 100644 index 42f4fcdd8bc7..000000000000 --- a/include/asm-m68k/atari_SLM.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | |||
| 2 | #ifndef _ATARI_SLM_H | ||
| 3 | #define _ATARI_SLM_H | ||
| 4 | |||
| 5 | /* Atari SLM laser printer specific ioctls */ | ||
| 6 | |||
| 7 | #define SLMIOGSTAT 0xa100 | ||
| 8 | #define SLMIOGPSIZE 0xa101 | ||
| 9 | #define SLMIOGMFEED 0xa102 | ||
| 10 | |||
| 11 | #define SLMIORESET 0xa140 | ||
| 12 | |||
| 13 | #define SLMIOSPSIZE 0xa181 | ||
| 14 | #define SLMIOSMFEED 0xa182 | ||
| 15 | |||
| 16 | /* Status returning structure (SLMIOGSTAT) */ | ||
| 17 | struct SLM_status { | ||
| 18 | int stat; /* numeric status code */ | ||
| 19 | char str[40]; /* status string */ | ||
| 20 | }; | ||
| 21 | |||
| 22 | /* Paper size structure (SLMIO[GS]PSIZE) */ | ||
| 23 | struct SLM_paper_size { | ||
| 24 | int width; | ||
| 25 | int height; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #endif /* _ATARI_SLM_H */ | ||
diff --git a/include/asm-m68k/atari_acsi.h b/include/asm-m68k/atari_acsi.h deleted file mode 100644 index 10fea68f191a..000000000000 --- a/include/asm-m68k/atari_acsi.h +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | #ifndef _ASM_ATARI_ACSI_H | ||
| 2 | #define _ASM_ATARI_ACSI_H | ||
| 3 | |||
| 4 | /* Functions exported by drivers/block/acsi.c */ | ||
| 5 | |||
| 6 | void acsi_delay_start( void ); | ||
| 7 | void acsi_delay_end( long usec ); | ||
| 8 | int acsi_wait_for_IRQ( unsigned timeout ); | ||
| 9 | int acsi_wait_for_noIRQ( unsigned timeout ); | ||
| 10 | int acsicmd_nodma( const char *cmd, int enable); | ||
| 11 | int acsi_getstatus( void ); | ||
| 12 | int acsi_extstatus( char *buffer, int cnt ); | ||
| 13 | void acsi_end_extstatus( void ); | ||
| 14 | int acsi_extcmd( unsigned char *buffer, int cnt ); | ||
| 15 | |||
| 16 | /* The ACSI buffer is guarantueed to reside in ST-RAM and may be used by other | ||
| 17 | * drivers that work on the ACSI bus, too. It's data are valid only as long as | ||
| 18 | * the ST-DMA is locked. */ | ||
| 19 | extern char *acsi_buffer; | ||
| 20 | extern unsigned long phys_acsi_buffer; | ||
| 21 | |||
| 22 | /* Utility macros */ | ||
| 23 | |||
| 24 | /* Send one data byte over the bus and set mode for next operation | ||
| 25 | * with one move.l -- Atari recommends this... | ||
| 26 | */ | ||
| 27 | |||
| 28 | #define DMA_LONG_WRITE(data,mode) \ | ||
| 29 | do { \ | ||
| 30 | *((unsigned long *)&dma_wd.fdc_acces_seccount) = \ | ||
| 31 | ((data)<<16) | (mode); \ | ||
| 32 | } while(0) | ||
| 33 | |||
| 34 | #define ENABLE_IRQ() atari_turnon_irq( IRQ_MFP_ACSI ) | ||
| 35 | #define DISABLE_IRQ() atari_turnoff_irq( IRQ_MFP_ACSI ) | ||
| 36 | |||
| 37 | #endif /* _ASM_ATARI_ACSI_H */ | ||
diff --git a/include/asm-m68k/fb.h b/include/asm-m68k/fb.h new file mode 100644 index 000000000000..380b97ae8157 --- /dev/null +++ b/include/asm-m68k/fb.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | #include <asm/setup.h> | ||
| 8 | |||
| 9 | #ifdef CONFIG_SUN3 | ||
| 10 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 11 | unsigned long off) | ||
| 12 | { | ||
| 13 | pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; | ||
| 14 | } | ||
| 15 | #else | ||
| 16 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 17 | unsigned long off) | ||
| 18 | { | ||
| 19 | if (CPU_IS_020_OR_030) | ||
| 20 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030; | ||
| 21 | if (CPU_IS_040_OR_060) { | ||
| 22 | pgprot_val(vma->vm_page_prot) &= _CACHEMASK040; | ||
| 23 | /* Use no-cache mode, serialized */ | ||
| 24 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | #endif /* CONFIG_SUN3 */ | ||
| 28 | |||
| 29 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 30 | { | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | |||
| 34 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h index b5b78c01eb6c..d029b75bcf04 100644 --- a/include/asm-m68k/motorola_pgtable.h +++ b/include/asm-m68k/motorola_pgtable.h | |||
| @@ -164,21 +164,15 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp) | |||
| 164 | * The following only work if pte_present() is true. | 164 | * The following only work if pte_present() is true. |
| 165 | * Undefined behaviour if not.. | 165 | * Undefined behaviour if not.. |
| 166 | */ | 166 | */ |
| 167 | static inline int pte_read(pte_t pte) { return 1; } | ||
| 168 | static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); } | 167 | static inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_RONLY); } |
| 169 | static inline int pte_exec(pte_t pte) { return 1; } | ||
| 170 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 168 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
| 171 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 169 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 172 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 170 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| 173 | 171 | ||
| 174 | static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_RONLY; return pte; } | 172 | static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_RONLY; return pte; } |
| 175 | static inline pte_t pte_rdprotect(pte_t pte) { return pte; } | ||
| 176 | static inline pte_t pte_exprotect(pte_t pte) { return pte; } | ||
| 177 | static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } | 173 | static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } |
| 178 | static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } | 174 | static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } |
| 179 | static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_RONLY; return pte; } | 175 | static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_RONLY; return pte; } |
| 180 | static inline pte_t pte_mkread(pte_t pte) { return pte; } | ||
| 181 | static inline pte_t pte_mkexec(pte_t pte) { return pte; } | ||
| 182 | static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } | 176 | static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } |
| 183 | static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } | 177 | static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } |
| 184 | static inline pte_t pte_mknocache(pte_t pte) | 178 | static inline pte_t pte_mknocache(pte_t pte) |
diff --git a/include/asm-m68k/sun3_pgtable.h b/include/asm-m68k/sun3_pgtable.h index b9e62c1e7ae3..b766fc261bde 100644 --- a/include/asm-m68k/sun3_pgtable.h +++ b/include/asm-m68k/sun3_pgtable.h | |||
| @@ -165,21 +165,15 @@ static inline void pgd_clear (pgd_t *pgdp) {} | |||
| 165 | * Undefined behaviour if not... | 165 | * Undefined behaviour if not... |
| 166 | * [we have the full set here even if they don't change from m68k] | 166 | * [we have the full set here even if they don't change from m68k] |
| 167 | */ | 167 | */ |
| 168 | static inline int pte_read(pte_t pte) { return 1; } | ||
| 169 | static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; } | 168 | static inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEABLE; } |
| 170 | static inline int pte_exec(pte_t pte) { return 1; } | ||
| 171 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; } | 169 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; } |
| 172 | static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } | 170 | static inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } |
| 173 | static inline int pte_file(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } | 171 | static inline int pte_file(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } |
| 174 | 172 | ||
| 175 | static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; } | 173 | static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; } |
| 176 | static inline pte_t pte_rdprotect(pte_t pte) { return pte; } | ||
| 177 | static inline pte_t pte_exprotect(pte_t pte) { return pte; } | ||
| 178 | static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_MODIFIED; return pte; } | 174 | static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_MODIFIED; return pte; } |
| 179 | static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_ACCESSED; return pte; } | 175 | static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_ACCESSED; return pte; } |
| 180 | static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= SUN3_PAGE_WRITEABLE; return pte; } | 176 | static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= SUN3_PAGE_WRITEABLE; return pte; } |
| 181 | static inline pte_t pte_mkread(pte_t pte) { return pte; } | ||
| 182 | static inline pte_t pte_mkexec(pte_t pte) { return pte; } | ||
| 183 | static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= SUN3_PAGE_MODIFIED; return pte; } | 177 | static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= SUN3_PAGE_MODIFIED; return pte; } |
| 184 | static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= SUN3_PAGE_ACCESSED; return pte; } | 178 | static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= SUN3_PAGE_ACCESSED; return pte; } |
| 185 | static inline pte_t pte_mknocache(pte_t pte) { pte_val(pte) |= SUN3_PAGE_NOCACHE; return pte; } | 179 | static inline pte_t pte_mknocache(pte_t pte) { pte_val(pte) |= SUN3_PAGE_NOCACHE; return pte; } |
diff --git a/include/asm-m68knommu/fb.h b/include/asm-m68knommu/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-m68knommu/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-m68knommu/page.h b/include/asm-m68knommu/page.h index 2a1b8bdcb29c..9efa0a9851b1 100644 --- a/include/asm-m68knommu/page.h +++ b/include/asm-m68knommu/page.h | |||
| @@ -22,7 +22,8 @@ | |||
| 22 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 22 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 23 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 23 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
| 24 | 24 | ||
| 25 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) | 25 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 26 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | ||
| 26 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 27 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 27 | 28 | ||
| 28 | /* | 29 | /* |
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index 67c3f8ec0303..568c76cdd900 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h | |||
| @@ -37,8 +37,10 @@ typedef s32 compat_key_t; | |||
| 37 | 37 | ||
| 38 | typedef s32 compat_int_t; | 38 | typedef s32 compat_int_t; |
| 39 | typedef s32 compat_long_t; | 39 | typedef s32 compat_long_t; |
| 40 | typedef s64 compat_s64; | ||
| 40 | typedef u32 compat_uint_t; | 41 | typedef u32 compat_uint_t; |
| 41 | typedef u32 compat_ulong_t; | 42 | typedef u32 compat_ulong_t; |
| 43 | typedef u64 compat_u64; | ||
| 42 | 44 | ||
| 43 | struct compat_timespec { | 45 | struct compat_timespec { |
| 44 | compat_time_t tv_sec; | 46 | compat_time_t tv_sec; |
diff --git a/include/asm-mips/fb.h b/include/asm-mips/fb.h new file mode 100644 index 000000000000..bd3f68c9ddfc --- /dev/null +++ b/include/asm-mips/fb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 27d77d981937..2e2d70d13ff6 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
| @@ -178,9 +178,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
| 178 | * The following only work if pte_present() is true. | 178 | * The following only work if pte_present() is true. |
| 179 | * Undefined behaviour if not.. | 179 | * Undefined behaviour if not.. |
| 180 | */ | 180 | */ |
| 181 | static inline int pte_user(pte_t pte) { BUG(); return 0; } | ||
| 182 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 181 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
| 183 | static inline int pte_read(pte_t pte) { return pte.pte_low & _PAGE_READ; } | ||
| 184 | static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } | 182 | static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } |
| 185 | static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } | 183 | static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } |
| 186 | static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } | 184 | static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } |
| @@ -193,13 +191,6 @@ static inline pte_t pte_wrprotect(pte_t pte) | |||
| 193 | return pte; | 191 | return pte; |
| 194 | } | 192 | } |
| 195 | 193 | ||
| 196 | static inline pte_t pte_rdprotect(pte_t pte) | ||
| 197 | { | ||
| 198 | pte.pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ); | ||
| 199 | pte.pte_high &= ~_PAGE_SILENT_READ; | ||
| 200 | return pte; | ||
| 201 | } | ||
| 202 | |||
| 203 | static inline pte_t pte_mkclean(pte_t pte) | 194 | static inline pte_t pte_mkclean(pte_t pte) |
| 204 | { | 195 | { |
| 205 | pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); | 196 | pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); |
| @@ -224,16 +215,6 @@ static inline pte_t pte_mkwrite(pte_t pte) | |||
| 224 | return pte; | 215 | return pte; |
| 225 | } | 216 | } |
| 226 | 217 | ||
| 227 | static inline pte_t pte_mkread(pte_t pte) | ||
| 228 | { | ||
| 229 | pte.pte_low |= _PAGE_READ; | ||
| 230 | if (pte.pte_low & _PAGE_ACCESSED) { | ||
| 231 | pte.pte_low |= _PAGE_SILENT_READ; | ||
| 232 | pte.pte_high |= _PAGE_SILENT_READ; | ||
| 233 | } | ||
| 234 | return pte; | ||
| 235 | } | ||
| 236 | |||
| 237 | static inline pte_t pte_mkdirty(pte_t pte) | 218 | static inline pte_t pte_mkdirty(pte_t pte) |
| 238 | { | 219 | { |
| 239 | pte.pte_low |= _PAGE_MODIFIED; | 220 | pte.pte_low |= _PAGE_MODIFIED; |
| @@ -253,7 +234,6 @@ static inline pte_t pte_mkyoung(pte_t pte) | |||
| 253 | return pte; | 234 | return pte; |
| 254 | } | 235 | } |
| 255 | #else | 236 | #else |
| 256 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; } | ||
| 257 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } | 237 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } |
| 258 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } | 238 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_MODIFIED; } |
| 259 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 239 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| @@ -265,12 +245,6 @@ static inline pte_t pte_wrprotect(pte_t pte) | |||
| 265 | return pte; | 245 | return pte; |
| 266 | } | 246 | } |
| 267 | 247 | ||
| 268 | static inline pte_t pte_rdprotect(pte_t pte) | ||
| 269 | { | ||
| 270 | pte_val(pte) &= ~(_PAGE_READ | _PAGE_SILENT_READ); | ||
| 271 | return pte; | ||
| 272 | } | ||
| 273 | |||
| 274 | static inline pte_t pte_mkclean(pte_t pte) | 248 | static inline pte_t pte_mkclean(pte_t pte) |
| 275 | { | 249 | { |
| 276 | pte_val(pte) &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE); | 250 | pte_val(pte) &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE); |
| @@ -291,14 +265,6 @@ static inline pte_t pte_mkwrite(pte_t pte) | |||
| 291 | return pte; | 265 | return pte; |
| 292 | } | 266 | } |
| 293 | 267 | ||
| 294 | static inline pte_t pte_mkread(pte_t pte) | ||
| 295 | { | ||
| 296 | pte_val(pte) |= _PAGE_READ; | ||
| 297 | if (pte_val(pte) & _PAGE_ACCESSED) | ||
| 298 | pte_val(pte) |= _PAGE_SILENT_READ; | ||
| 299 | return pte; | ||
| 300 | } | ||
| 301 | |||
| 302 | static inline pte_t pte_mkdirty(pte_t pte) | 268 | static inline pte_t pte_mkdirty(pte_t pte) |
| 303 | { | 269 | { |
| 304 | pte_val(pte) |= _PAGE_MODIFIED; | 270 | pte_val(pte) |= _PAGE_MODIFIED; |
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h index bda391d3af85..2738c1366f66 100644 --- a/include/asm-mips/sibyte/bcm1480_regs.h +++ b/include/asm-mips/sibyte/bcm1480_regs.h | |||
| @@ -220,17 +220,25 @@ | |||
| 220 | #define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1) | 220 | #define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1) |
| 221 | 221 | ||
| 222 | #define BCM1480_DUART_CHANREG_SPACING 0x100 | 222 | #define BCM1480_DUART_CHANREG_SPACING 0x100 |
| 223 | #define A_BCM1480_DUART_CHANREG(chan,reg) (A_BCM1480_DUART(chan) \ | 223 | #define A_BCM1480_DUART_CHANREG(chan, reg) \ |
| 224 | + BCM1480_DUART_CHANREG_SPACING*((chan)&1) \ | 224 | (A_BCM1480_DUART(chan) + \ |
| 225 | + (reg)) | 225 | BCM1480_DUART_CHANREG_SPACING * (((chan) & 1) + 1) + (reg)) |
| 226 | #define R_BCM1480_DUART_CHANREG(chan,reg) (BCM1480_DUART_CHANREG_SPACING*((chan)&1) + (reg)) | 226 | #define A_BCM1480_DUART_CTRLREG(chan, reg) \ |
| 227 | 227 | (A_BCM1480_DUART(chan) + \ | |
| 228 | #define R_BCM1480_DUART_IMRREG(chan) (R_DUART_IMR_A + ((chan)&1)*DUART_IMRISR_SPACING) | 228 | BCM1480_DUART_CHANREG_SPACING * 3 + (reg)) |
| 229 | #define R_BCM1480_DUART_ISRREG(chan) (R_DUART_ISR_A + ((chan)&1)*DUART_IMRISR_SPACING) | 229 | |
| 230 | 230 | #define R_BCM1480_DUART_IMRREG(chan) \ | |
| 231 | #define A_BCM1480_DUART_IMRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_IMRREG(chan)) | 231 | (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING) |
| 232 | #define A_BCM1480_DUART_ISRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_ISRREG(chan)) | 232 | #define R_BCM1480_DUART_ISRREG(chan) \ |
| 233 | #define A_BCM1480_DUART_IN_PORT(chan) (A_BCM1480_DUART(chan) + R_DUART_INP_ORT) | 233 | (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING) |
| 234 | |||
| 235 | #define A_BCM1480_DUART_IMRREG(chan) \ | ||
| 236 | (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan))) | ||
| 237 | #define A_BCM1480_DUART_ISRREG(chan) \ | ||
| 238 | (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_ISRREG(chan))) | ||
| 239 | |||
| 240 | #define A_BCM1480_DUART_IN_PORT(chan) \ | ||
| 241 | (A_BCM1480_DUART_CTRLREG((chan), R_DUART_IN_PORT)) | ||
| 234 | 242 | ||
| 235 | /* | 243 | /* |
| 236 | * These constants are the absolute addresses. | 244 | * These constants are the absolute addresses. |
diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h index da7c188993c9..220b7e94f1bf 100644 --- a/include/asm-mips/sibyte/sb1250_regs.h +++ b/include/asm-mips/sibyte/sb1250_regs.h | |||
| @@ -272,59 +272,69 @@ | |||
| 272 | ********************************************************************* */ | 272 | ********************************************************************* */ |
| 273 | 273 | ||
| 274 | 274 | ||
| 275 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | 275 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ |
| 276 | #define R_DUART_NUM_PORTS 2 | 276 | #define R_DUART_NUM_PORTS 2 |
| 277 | 277 | ||
| 278 | #define A_DUART 0x0010060000 | 278 | #define A_DUART 0x0010060000 |
| 279 | 279 | ||
| 280 | #define DUART_CHANREG_SPACING 0x100 | 280 | #define DUART_CHANREG_SPACING 0x100 |
| 281 | #define A_DUART_CHANREG(chan,reg) (A_DUART + DUART_CHANREG_SPACING*(chan) + (reg)) | 281 | |
| 282 | #define R_DUART_CHANREG(chan,reg) (DUART_CHANREG_SPACING*(chan) + (reg)) | 282 | #define A_DUART_CHANREG(chan, reg) \ |
| 283 | (A_DUART + DUART_CHANREG_SPACING * ((chan) + 1) + (reg)) | ||
| 283 | #endif /* 1250 & 112x */ | 284 | #endif /* 1250 & 112x */ |
| 284 | 285 | ||
| 285 | #define R_DUART_MODE_REG_1 0x100 | 286 | #define R_DUART_MODE_REG_1 0x000 |
| 286 | #define R_DUART_MODE_REG_2 0x110 | 287 | #define R_DUART_MODE_REG_2 0x010 |
| 287 | #define R_DUART_STATUS 0x120 | 288 | #define R_DUART_STATUS 0x020 |
| 288 | #define R_DUART_CLK_SEL 0x130 | 289 | #define R_DUART_CLK_SEL 0x030 |
| 289 | #define R_DUART_CMD 0x150 | 290 | #define R_DUART_CMD 0x050 |
| 290 | #define R_DUART_RX_HOLD 0x160 | 291 | #define R_DUART_RX_HOLD 0x060 |
| 291 | #define R_DUART_TX_HOLD 0x170 | 292 | #define R_DUART_TX_HOLD 0x070 |
| 292 | 293 | ||
| 293 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | 294 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
| 294 | #define R_DUART_FULL_CTL 0x140 | 295 | #define R_DUART_FULL_CTL 0x040 |
| 295 | #define R_DUART_OPCR_X 0x180 | 296 | #define R_DUART_OPCR_X 0x080 |
| 296 | #define R_DUART_AUXCTL_X 0x190 | 297 | #define R_DUART_AUXCTL_X 0x090 |
| 297 | #endif /* 1250 PASS2 || 112x PASS1 || 1480*/ | 298 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
| 298 | 299 | ||
| 299 | 300 | ||
| 300 | /* | 301 | /* |
| 301 | * The IMR and ISR can't be addressed with A_DUART_CHANREG, | 302 | * The IMR and ISR can't be addressed with A_DUART_CHANREG, |
| 302 | * so use this macro instead. | 303 | * so use these macros instead. |
| 303 | */ | 304 | */ |
| 304 | 305 | ||
| 305 | #define R_DUART_AUX_CTRL 0x310 | 306 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ |
| 306 | #define R_DUART_ISR_A 0x320 | 307 | #define DUART_IMRISR_SPACING 0x20 |
| 307 | #define R_DUART_IMR_A 0x330 | 308 | #define DUART_INCHNG_SPACING 0x10 |
| 308 | #define R_DUART_ISR_B 0x340 | ||
| 309 | #define R_DUART_IMR_B 0x350 | ||
| 310 | #define R_DUART_OUT_PORT 0x360 | ||
| 311 | #define R_DUART_OPCR 0x370 | ||
| 312 | #define R_DUART_IN_PORT 0x380 | ||
| 313 | 309 | ||
| 314 | #define R_DUART_SET_OPR 0x3B0 | 310 | #define A_DUART_CTRLREG(reg) \ |
| 315 | #define R_DUART_CLEAR_OPR 0x3C0 | 311 | (A_DUART + DUART_CHANREG_SPACING * 3 + (reg)) |
| 316 | 312 | ||
| 317 | #define DUART_IMRISR_SPACING 0x20 | 313 | #define R_DUART_IMRREG(chan) \ |
| 314 | (R_DUART_IMR_A + (chan) * DUART_IMRISR_SPACING) | ||
| 315 | #define R_DUART_ISRREG(chan) \ | ||
| 316 | (R_DUART_ISR_A + (chan) * DUART_IMRISR_SPACING) | ||
| 317 | #define R_DUART_INCHREG(chan) \ | ||
| 318 | (R_DUART_IN_CHNG_A + (chan) * DUART_INCHNG_SPACING) | ||
| 318 | 319 | ||
| 319 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | 320 | #define A_DUART_IMRREG(chan) A_DUART_CTRLREG(R_DUART_IMRREG(chan)) |
| 320 | #define R_DUART_IMRREG(chan) (R_DUART_IMR_A + (chan)*DUART_IMRISR_SPACING) | 321 | #define A_DUART_ISRREG(chan) A_DUART_CTRLREG(R_DUART_ISRREG(chan)) |
| 321 | #define R_DUART_ISRREG(chan) (R_DUART_ISR_A + (chan)*DUART_IMRISR_SPACING) | 322 | #define A_DUART_INCHREG(chan) A_DUART_CTRLREG(R_DUART_INCHREG(chan)) |
| 322 | |||
| 323 | #define A_DUART_IMRREG(chan) (A_DUART + R_DUART_IMRREG(chan)) | ||
| 324 | #define A_DUART_ISRREG(chan) (A_DUART + R_DUART_ISRREG(chan)) | ||
| 325 | #endif /* 1250 & 112x */ | 323 | #endif /* 1250 & 112x */ |
| 326 | 324 | ||
| 327 | 325 | #define R_DUART_AUX_CTRL 0x010 | |
| 326 | #define R_DUART_ISR_A 0x020 | ||
| 327 | #define R_DUART_IMR_A 0x030 | ||
| 328 | #define R_DUART_ISR_B 0x040 | ||
| 329 | #define R_DUART_IMR_B 0x050 | ||
| 330 | #define R_DUART_OUT_PORT 0x060 | ||
| 331 | #define R_DUART_OPCR 0x070 | ||
| 332 | #define R_DUART_IN_PORT 0x080 | ||
| 333 | |||
| 334 | #define R_DUART_SET_OPR 0x0B0 | ||
| 335 | #define R_DUART_CLEAR_OPR 0x0C0 | ||
| 336 | #define R_DUART_IN_CHNG_A 0x0D0 | ||
| 337 | #define R_DUART_IN_CHNG_B 0x0E0 | ||
| 328 | 338 | ||
| 329 | 339 | ||
| 330 | /* | 340 | /* |
diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h index e87045e62bf0..cf74fedcbef1 100644 --- a/include/asm-mips/sibyte/sb1250_uart.h +++ b/include/asm-mips/sibyte/sb1250_uart.h | |||
| @@ -75,7 +75,8 @@ | |||
| 75 | #define V_DUART_PARITY_MODE_ADD_FIXED V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD_FIXED) | 75 | #define V_DUART_PARITY_MODE_ADD_FIXED V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD_FIXED) |
| 76 | #define V_DUART_PARITY_MODE_NONE V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_NONE) | 76 | #define V_DUART_PARITY_MODE_NONE V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_NONE) |
| 77 | 77 | ||
| 78 | #define M_DUART_ERR_MODE _SB_MAKEMASK1(5) /* must be zero */ | 78 | #define M_DUART_TX_IRQ_SEL_TXRDY 0 |
| 79 | #define M_DUART_TX_IRQ_SEL_TXEMPT _SB_MAKEMASK1(5) | ||
| 79 | 80 | ||
| 80 | #define M_DUART_RX_IRQ_SEL_RXRDY 0 | 81 | #define M_DUART_RX_IRQ_SEL_RXRDY 0 |
| 81 | #define M_DUART_RX_IRQ_SEL_RXFULL _SB_MAKEMASK1(6) | 82 | #define M_DUART_RX_IRQ_SEL_RXFULL _SB_MAKEMASK1(6) |
| @@ -246,10 +247,13 @@ | |||
| 246 | 247 | ||
| 247 | #define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2) | 248 | #define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2) |
| 248 | #define M_DUART_ISR_IN_A _SB_MAKEMASK1(3) | 249 | #define M_DUART_ISR_IN_A _SB_MAKEMASK1(3) |
| 250 | #define M_DUART_ISR_ALL_A _SB_MAKEMASK(4,0) | ||
| 251 | |||
| 249 | #define M_DUART_ISR_TX_B _SB_MAKEMASK1(4) | 252 | #define M_DUART_ISR_TX_B _SB_MAKEMASK1(4) |
| 250 | #define M_DUART_ISR_RX_B _SB_MAKEMASK1(5) | 253 | #define M_DUART_ISR_RX_B _SB_MAKEMASK1(5) |
| 251 | #define M_DUART_ISR_BRK_B _SB_MAKEMASK1(6) | 254 | #define M_DUART_ISR_BRK_B _SB_MAKEMASK1(6) |
| 252 | #define M_DUART_ISR_IN_B _SB_MAKEMASK1(7) | 255 | #define M_DUART_ISR_IN_B _SB_MAKEMASK1(7) |
| 256 | #define M_DUART_ISR_ALL_B _SB_MAKEMASK(4,4) | ||
| 253 | 257 | ||
| 254 | /* | 258 | /* |
| 255 | * DUART Channel A Interrupt Status Register (Table 10-17) | 259 | * DUART Channel A Interrupt Status Register (Table 10-17) |
| @@ -262,6 +266,7 @@ | |||
| 262 | #define M_DUART_ISR_RX _SB_MAKEMASK1(1) | 266 | #define M_DUART_ISR_RX _SB_MAKEMASK1(1) |
| 263 | #define M_DUART_ISR_BRK _SB_MAKEMASK1(2) | 267 | #define M_DUART_ISR_BRK _SB_MAKEMASK1(2) |
| 264 | #define M_DUART_ISR_IN _SB_MAKEMASK1(3) | 268 | #define M_DUART_ISR_IN _SB_MAKEMASK1(3) |
| 269 | #define M_DUART_ISR_ALL _SB_MAKEMASK(4,0) | ||
| 265 | #define M_DUART_ISR_RESERVED _SB_MAKEMASK(4,4) | 270 | #define M_DUART_ISR_RESERVED _SB_MAKEMASK(4,4) |
| 266 | 271 | ||
| 267 | /* | 272 | /* |
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h index 11f4222597a0..5a85d1b025c8 100644 --- a/include/asm-parisc/compat.h +++ b/include/asm-parisc/compat.h | |||
| @@ -31,8 +31,10 @@ typedef s32 compat_timer_t; | |||
| 31 | 31 | ||
| 32 | typedef s32 compat_int_t; | 32 | typedef s32 compat_int_t; |
| 33 | typedef s32 compat_long_t; | 33 | typedef s32 compat_long_t; |
| 34 | typedef s64 compat_s64; | ||
| 34 | typedef u32 compat_uint_t; | 35 | typedef u32 compat_uint_t; |
| 35 | typedef u32 compat_ulong_t; | 36 | typedef u32 compat_ulong_t; |
| 37 | typedef u64 compat_u64; | ||
| 36 | 38 | ||
| 37 | struct compat_timespec { | 39 | struct compat_timespec { |
| 38 | compat_time_t tv_sec; | 40 | compat_time_t tv_sec; |
diff --git a/include/asm-parisc/fb.h b/include/asm-parisc/fb.h new file mode 100644 index 000000000000..4d503a023ab2 --- /dev/null +++ b/include/asm-parisc/fb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE; | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h index 317851fa78f3..1e1c824764ee 100644 --- a/include/asm-parisc/fcntl.h +++ b/include/asm-parisc/fcntl.h | |||
| @@ -3,21 +3,22 @@ | |||
| 3 | 3 | ||
| 4 | /* open/fcntl - O_SYNC is only implemented on blocks devices and on files | 4 | /* open/fcntl - O_SYNC is only implemented on blocks devices and on files |
| 5 | located on an ext2 file system */ | 5 | located on an ext2 file system */ |
| 6 | #define O_APPEND 00000010 | 6 | #define O_APPEND 000000010 |
| 7 | #define O_BLKSEEK 00000100 /* HPUX only */ | 7 | #define O_BLKSEEK 000000100 /* HPUX only */ |
| 8 | #define O_CREAT 00000400 /* not fcntl */ | 8 | #define O_CREAT 000000400 /* not fcntl */ |
| 9 | #define O_EXCL 00002000 /* not fcntl */ | 9 | #define O_EXCL 000002000 /* not fcntl */ |
| 10 | #define O_LARGEFILE 00004000 | 10 | #define O_LARGEFILE 000004000 |
| 11 | #define O_SYNC 00100000 | 11 | #define O_SYNC 000100000 |
| 12 | #define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */ | 12 | #define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */ |
| 13 | #define O_NOCTTY 00400000 /* not fcntl */ | 13 | #define O_NOCTTY 000400000 /* not fcntl */ |
| 14 | #define O_DSYNC 01000000 /* HPUX only */ | 14 | #define O_DSYNC 001000000 /* HPUX only */ |
| 15 | #define O_RSYNC 02000000 /* HPUX only */ | 15 | #define O_RSYNC 002000000 /* HPUX only */ |
| 16 | #define O_NOATIME 04000000 | 16 | #define O_NOATIME 004000000 |
| 17 | #define O_CLOEXEC 010000000 /* set close_on_exec */ | ||
| 17 | 18 | ||
| 18 | #define O_DIRECTORY 00010000 /* must be a directory */ | 19 | #define O_DIRECTORY 000010000 /* must be a directory */ |
| 19 | #define O_NOFOLLOW 00000200 /* don't follow links */ | 20 | #define O_NOFOLLOW 000000200 /* don't follow links */ |
| 20 | #define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */ | 21 | #define O_INVISIBLE 004000000 /* invisible I/O, for DMAPI/XDSM */ |
| 21 | 22 | ||
| 22 | #define F_GETLK64 8 | 23 | #define F_GETLK64 8 |
| 23 | #define F_SETLK64 9 | 24 | #define F_SETLK64 9 |
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index beb2adb979d9..e88cacd63724 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h | |||
| @@ -335,18 +335,14 @@ extern inline void pgd_clear(pgd_t * pgdp) { } | |||
| 335 | * The following only work if pte_present() is true. | 335 | * The following only work if pte_present() is true. |
| 336 | * Undefined behaviour if not.. | 336 | * Undefined behaviour if not.. |
| 337 | */ | 337 | */ |
| 338 | extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; } | ||
| 339 | extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 338 | extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
| 340 | extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 339 | extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 341 | extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } | 340 | extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITE; } |
| 342 | extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 341 | extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| 343 | extern inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | ||
| 344 | 342 | ||
| 345 | extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_READ; return pte; } | ||
| 346 | extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } | 343 | extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } |
| 347 | extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } | 344 | extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } |
| 348 | extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_WRITE; return pte; } | 345 | extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_WRITE; return pte; } |
| 349 | extern inline pte_t pte_mkread(pte_t pte) { pte_val(pte) |= _PAGE_READ; return pte; } | ||
| 350 | extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } | 346 | extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } |
| 351 | extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } | 347 | extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } |
| 352 | extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return pte; } | 348 | extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return pte; } |
| @@ -451,21 +447,6 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned | |||
| 451 | #endif | 447 | #endif |
| 452 | } | 448 | } |
| 453 | 449 | ||
| 454 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | ||
| 455 | { | ||
| 456 | #ifdef CONFIG_SMP | ||
| 457 | if (!pte_dirty(*ptep)) | ||
| 458 | return 0; | ||
| 459 | return test_and_clear_bit(xlate_pabit(_PAGE_DIRTY_BIT), &pte_val(*ptep)); | ||
| 460 | #else | ||
| 461 | pte_t pte = *ptep; | ||
| 462 | if (!pte_dirty(pte)) | ||
| 463 | return 0; | ||
| 464 | set_pte_at(vma->vm_mm, addr, ptep, pte_mkclean(pte)); | ||
| 465 | return 1; | ||
| 466 | #endif | ||
| 467 | } | ||
| 468 | |||
| 469 | extern spinlock_t pa_dbit_lock; | 450 | extern spinlock_t pa_dbit_lock; |
| 470 | 451 | ||
| 471 | struct mm_struct; | 452 | struct mm_struct; |
| @@ -533,7 +514,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
| 533 | #define HAVE_ARCH_UNMAPPED_AREA | 514 | #define HAVE_ARCH_UNMAPPED_AREA |
| 534 | 515 | ||
| 535 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 516 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 536 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 537 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 517 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 538 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 518 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
| 539 | #define __HAVE_ARCH_PTE_SAME | 519 | #define __HAVE_ARCH_PTE_SAME |
diff --git a/include/asm-powerpc/cache.h b/include/asm-powerpc/cache.h index 642be62cf393..53507046a1b1 100644 --- a/include/asm-powerpc/cache.h +++ b/include/asm-powerpc/cache.h | |||
| @@ -34,5 +34,9 @@ struct ppc64_caches { | |||
| 34 | extern struct ppc64_caches ppc64_caches; | 34 | extern struct ppc64_caches ppc64_caches; |
| 35 | #endif /* __powerpc64__ && ! __ASSEMBLY__ */ | 35 | #endif /* __powerpc64__ && ! __ASSEMBLY__ */ |
| 36 | 36 | ||
| 37 | #if !defined(__ASSEMBLY__) | ||
| 38 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
| 39 | #endif | ||
| 40 | |||
| 37 | #endif /* __KERNEL__ */ | 41 | #endif /* __KERNEL__ */ |
| 38 | #endif /* _ASM_POWERPC_CACHE_H */ | 42 | #endif /* _ASM_POWERPC_CACHE_H */ |
diff --git a/include/asm-powerpc/compat.h b/include/asm-powerpc/compat.h index aacaabd28ac1..64ab1ddbdf85 100644 --- a/include/asm-powerpc/compat.h +++ b/include/asm-powerpc/compat.h | |||
| @@ -33,8 +33,10 @@ typedef s32 compat_timer_t; | |||
| 33 | 33 | ||
| 34 | typedef s32 compat_int_t; | 34 | typedef s32 compat_int_t; |
| 35 | typedef s32 compat_long_t; | 35 | typedef s32 compat_long_t; |
| 36 | typedef s64 compat_s64; | ||
| 36 | typedef u32 compat_uint_t; | 37 | typedef u32 compat_uint_t; |
| 37 | typedef u32 compat_ulong_t; | 38 | typedef u32 compat_ulong_t; |
| 39 | typedef u64 compat_u64; | ||
| 38 | 40 | ||
| 39 | struct compat_timespec { | 41 | struct compat_timespec { |
| 40 | compat_time_t tv_sec; | 42 | compat_time_t tv_sec; |
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 82d595a52109..3dc8e2dfca84 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
| @@ -111,7 +111,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
| 111 | /* CPU kernel features */ | 111 | /* CPU kernel features */ |
| 112 | 112 | ||
| 113 | /* Retain the 32b definitions all use bottom half of word */ | 113 | /* Retain the 32b definitions all use bottom half of word */ |
| 114 | #define CPU_FTR_SPLIT_ID_CACHE ASM_CONST(0x0000000000000001) | 114 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000000000000001) |
| 115 | #define CPU_FTR_L2CR ASM_CONST(0x0000000000000002) | 115 | #define CPU_FTR_L2CR ASM_CONST(0x0000000000000002) |
| 116 | #define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004) | 116 | #define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004) |
| 117 | #define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008) | 117 | #define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008) |
| @@ -135,6 +135,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
| 135 | #define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) | 135 | #define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) |
| 136 | #define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) | 136 | #define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) |
| 137 | #define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000) | 137 | #define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000) |
| 138 | #define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000) | ||
| 138 | 139 | ||
| 139 | /* | 140 | /* |
| 140 | * Add the 64-bit processor unique features in the top half of the word; | 141 | * Add the 64-bit processor unique features in the top half of the word; |
| @@ -154,7 +155,6 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
| 154 | #define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000) | 155 | #define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000) |
| 155 | #define CPU_FTR_CTRL LONG_ASM_CONST(0x0000008000000000) | 156 | #define CPU_FTR_CTRL LONG_ASM_CONST(0x0000008000000000) |
| 156 | #define CPU_FTR_SMT LONG_ASM_CONST(0x0000010000000000) | 157 | #define CPU_FTR_SMT LONG_ASM_CONST(0x0000010000000000) |
| 157 | #define CPU_FTR_COHERENT_ICACHE LONG_ASM_CONST(0x0000020000000000) | ||
| 158 | #define CPU_FTR_LOCKLESS_TLBIE LONG_ASM_CONST(0x0000040000000000) | 158 | #define CPU_FTR_LOCKLESS_TLBIE LONG_ASM_CONST(0x0000040000000000) |
| 159 | #define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) | 159 | #define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) |
| 160 | #define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) | 160 | #define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) |
| @@ -206,164 +206,149 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, | |||
| 206 | !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ | 206 | !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ |
| 207 | !defined(CONFIG_BOOKE)) | 207 | !defined(CONFIG_BOOKE)) |
| 208 | 208 | ||
| 209 | #define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE) | 209 | #define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE | \ |
| 210 | #define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 210 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE) |
| 211 | #define CPU_FTRS_603 (CPU_FTR_COMMON | \ | ||
| 211 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ | 212 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ |
| 212 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) | 213 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
| 213 | #define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 214 | #define CPU_FTRS_604 (CPU_FTR_COMMON | \ |
| 214 | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \ | 215 | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \ |
| 215 | CPU_FTR_PPC_LE) | 216 | CPU_FTR_PPC_LE) |
| 216 | #define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 217 | #define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | \ |
| 217 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 218 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
| 218 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) | 219 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
| 219 | #define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 220 | #define CPU_FTRS_740 (CPU_FTR_COMMON | \ |
| 220 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 221 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
| 221 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 222 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
| 222 | CPU_FTR_PPC_LE) | 223 | CPU_FTR_PPC_LE) |
| 223 | #define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 224 | #define CPU_FTRS_750 (CPU_FTR_COMMON | \ |
| 224 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 225 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
| 225 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 226 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
| 226 | CPU_FTR_PPC_LE) | 227 | CPU_FTR_PPC_LE) |
| 227 | #define CPU_FTRS_750CL (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 228 | #define CPU_FTRS_750CL (CPU_FTRS_750 | CPU_FTR_HAS_HIGH_BATS) |
| 228 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 229 | #define CPU_FTRS_750FX1 (CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM) |
| 229 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 230 | #define CPU_FTRS_750FX2 (CPU_FTRS_750 | CPU_FTR_NO_DPM) |
| 230 | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) | 231 | #define CPU_FTRS_750FX (CPU_FTRS_750 | CPU_FTR_DUAL_PLL_750FX | \ |
| 231 | #define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 232 | CPU_FTR_HAS_HIGH_BATS) |
| 232 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 233 | #define CPU_FTRS_750GX (CPU_FTRS_750FX) |
| 233 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 234 | #define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | \ |
| 234 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM | CPU_FTR_PPC_LE) | ||
| 235 | #define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | ||
| 236 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | ||
| 237 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | ||
| 238 | CPU_FTR_NO_DPM | CPU_FTR_PPC_LE) | ||
| 239 | #define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | ||
| 240 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | ||
| 241 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | ||
| 242 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) | ||
| 243 | #define CPU_FTRS_750GX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | ||
| 244 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | ||
| 245 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | ||
| 246 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) | ||
| 247 | #define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | ||
| 248 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 235 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
| 249 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ | 236 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ |
| 250 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) | 237 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
| 251 | #define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 238 | #define CPU_FTRS_7400 (CPU_FTR_COMMON | \ |
| 252 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 239 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
| 253 | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ | 240 | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ |
| 254 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) | 241 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
| 255 | #define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 242 | #define CPU_FTRS_7450_20 (CPU_FTR_COMMON | \ |
| 256 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 243 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 257 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 244 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 258 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) | 245 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
| 259 | #define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 246 | #define CPU_FTRS_7450_21 (CPU_FTR_COMMON | \ |
| 260 | CPU_FTR_USE_TB | \ | 247 | CPU_FTR_USE_TB | \ |
| 261 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 248 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 262 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 249 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 263 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ | 250 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ |
| 264 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) | 251 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
| 265 | #define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 252 | #define CPU_FTRS_7450_23 (CPU_FTR_COMMON | \ |
| 266 | CPU_FTR_USE_TB | \ | 253 | CPU_FTR_USE_TB | \ |
| 267 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 254 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 268 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 255 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 269 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) | 256 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
| 270 | #define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 257 | #define CPU_FTRS_7455_1 (CPU_FTR_COMMON | \ |
| 271 | CPU_FTR_USE_TB | \ | 258 | CPU_FTR_USE_TB | \ |
| 272 | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \ | 259 | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \ |
| 273 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \ | 260 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \ |
| 274 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) | 261 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
| 275 | #define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 262 | #define CPU_FTRS_7455_20 (CPU_FTR_COMMON | \ |
| 276 | CPU_FTR_USE_TB | \ | 263 | CPU_FTR_USE_TB | \ |
| 277 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 264 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 278 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 265 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 279 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ | 266 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ |
| 280 | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) | 267 | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) |
| 281 | #define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 268 | #define CPU_FTRS_7455 (CPU_FTR_COMMON | \ |
| 282 | CPU_FTR_USE_TB | \ | 269 | CPU_FTR_USE_TB | \ |
| 283 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 270 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 284 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 271 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 285 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 272 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
| 286 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) | 273 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
| 287 | #define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 274 | #define CPU_FTRS_7447_10 (CPU_FTR_COMMON | \ |
| 288 | CPU_FTR_USE_TB | \ | 275 | CPU_FTR_USE_TB | \ |
| 289 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 276 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 290 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 277 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 291 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 278 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
| 292 | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE) | 279 | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE) |
| 293 | #define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 280 | #define CPU_FTRS_7447 (CPU_FTR_COMMON | \ |
| 294 | CPU_FTR_USE_TB | \ | 281 | CPU_FTR_USE_TB | \ |
| 295 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 282 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 296 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 283 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 297 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 284 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
| 298 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) | 285 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
| 299 | #define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 286 | #define CPU_FTRS_7447A (CPU_FTR_COMMON | \ |
| 300 | CPU_FTR_USE_TB | \ | 287 | CPU_FTR_USE_TB | \ |
| 301 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 288 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 302 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 289 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 303 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 290 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
| 304 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) | 291 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
| 305 | #define CPU_FTRS_7448 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 292 | #define CPU_FTRS_7448 (CPU_FTR_COMMON | \ |
| 306 | CPU_FTR_USE_TB | \ | 293 | CPU_FTR_USE_TB | \ |
| 307 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 294 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
| 308 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 295 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
| 309 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 296 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
| 310 | CPU_FTR_PPC_LE) | 297 | CPU_FTR_PPC_LE) |
| 311 | #define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 298 | #define CPU_FTRS_82XX (CPU_FTR_COMMON | \ |
| 312 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) | 299 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) |
| 313 | #define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ | 300 | #define CPU_FTRS_G2_LE (CPU_FTR_MAYBE_CAN_DOZE | \ |
| 314 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS) | 301 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS) |
| 315 | #define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ | 302 | #define CPU_FTRS_E300 (CPU_FTR_MAYBE_CAN_DOZE | \ |
| 316 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ | 303 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ |
| 317 | CPU_FTR_COMMON) | 304 | CPU_FTR_COMMON) |
| 318 | #define CPU_FTRS_E300C2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ | 305 | #define CPU_FTRS_E300C2 (CPU_FTR_MAYBE_CAN_DOZE | \ |
| 319 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ | 306 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ |
| 320 | CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE) | 307 | CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE) |
| 321 | #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 308 | #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | \ |
| 322 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) | 309 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) |
| 323 | #define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) | 310 | #define CPU_FTRS_8XX (CPU_FTR_USE_TB) |
| 324 | #define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 311 | #define CPU_FTRS_40X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) |
| 325 | CPU_FTR_NODSISRALIGN) | 312 | #define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) |
| 326 | #define CPU_FTRS_44X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 313 | #define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \ |
| 327 | CPU_FTR_NODSISRALIGN) | 314 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE) |
| 328 | #define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) | 315 | #define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) |
| 329 | #define CPU_FTRS_E500 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 316 | #define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | \ |
| 330 | CPU_FTR_NODSISRALIGN) | ||
| 331 | #define CPU_FTRS_E500_2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | ||
| 332 | CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) | 317 | CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) |
| 333 | #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) | 318 | #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) |
| 334 | 319 | ||
| 335 | /* 64-bit CPUs */ | 320 | /* 64-bit CPUs */ |
| 336 | #define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 321 | #define CPU_FTRS_POWER3 (CPU_FTR_USE_TB | \ |
| 337 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE) | 322 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE) |
| 338 | #define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 323 | #define CPU_FTRS_RS64 (CPU_FTR_USE_TB | \ |
| 339 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ | 324 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ |
| 340 | CPU_FTR_MMCRA | CPU_FTR_CTRL) | 325 | CPU_FTR_MMCRA | CPU_FTR_CTRL) |
| 341 | #define CPU_FTRS_POWER4 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 326 | #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | \ |
| 342 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 327 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
| 343 | CPU_FTR_MMCRA) | 328 | CPU_FTR_MMCRA) |
| 344 | #define CPU_FTRS_PPC970 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 329 | #define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | \ |
| 345 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 330 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
| 346 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA) | 331 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA) |
| 347 | #define CPU_FTRS_POWER5 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 332 | #define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | \ |
| 348 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 333 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
| 349 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 334 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
| 350 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 335 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
| 351 | CPU_FTR_PURR) | 336 | CPU_FTR_PURR) |
| 352 | #define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 337 | #define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | \ |
| 353 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 338 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
| 354 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 339 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
| 355 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 340 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
| 356 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ | 341 | CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ |
| 357 | CPU_FTR_DSCR) | 342 | CPU_FTR_DSCR) |
| 358 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 343 | #define CPU_FTRS_CELL (CPU_FTR_USE_TB | \ |
| 359 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 344 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
| 360 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 345 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
| 361 | CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG) | 346 | CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG) |
| 362 | #define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 347 | #define CPU_FTRS_PA6T (CPU_FTR_USE_TB | \ |
| 363 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | 348 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ |
| 364 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ | 349 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ |
| 365 | CPU_FTR_PURR | CPU_FTR_REAL_LE) | 350 | CPU_FTR_PURR | CPU_FTR_REAL_LE) |
| 366 | #define CPU_FTRS_COMPATIBLE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 351 | #define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | \ |
| 367 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2) | 352 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2) |
| 368 | 353 | ||
| 369 | #ifdef __powerpc64__ | 354 | #ifdef __powerpc64__ |
diff --git a/include/asm-powerpc/fb.h b/include/asm-powerpc/fb.h new file mode 100644 index 000000000000..411af8d17a69 --- /dev/null +++ b/include/asm-powerpc/fb.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | vma->vm_page_prot = phys_mem_access_prot(file, off >> PAGE_SHIFT, | ||
| 12 | vma->vm_end - vma->vm_start, | ||
| 13 | vma->vm_page_prot); | ||
| 14 | } | ||
| 15 | |||
| 16 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 17 | { | ||
| 18 | return 0; | ||
| 19 | } | ||
| 20 | |||
| 21 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h index afa700ded877..34146f0eea63 100644 --- a/include/asm-powerpc/floppy.h +++ b/include/asm-powerpc/floppy.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); | 29 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); |
| 30 | 30 | ||
| 31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
| 32 | #include <asm/ppc-pci.h> /* for ppc64_isabridge_dev */ | 32 | #include <asm/ppc-pci.h> /* for isa_bridge_pcidev */ |
| 33 | 33 | ||
| 34 | #define fd_dma_setup(addr,size,mode,io) fd_ops->_dma_setup(addr,size,mode,io) | 34 | #define fd_dma_setup(addr,size,mode,io) fd_ops->_dma_setup(addr,size,mode,io) |
| 35 | 35 | ||
| @@ -139,12 +139,12 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io) | |||
| 139 | if (bus_addr | 139 | if (bus_addr |
| 140 | && (addr != prev_addr || size != prev_size || dir != prev_dir)) { | 140 | && (addr != prev_addr || size != prev_size || dir != prev_dir)) { |
| 141 | /* different from last time -- unmap prev */ | 141 | /* different from last time -- unmap prev */ |
| 142 | pci_unmap_single(ppc64_isabridge_dev, bus_addr, prev_size, prev_dir); | 142 | pci_unmap_single(isa_bridge_pcidev, bus_addr, prev_size, prev_dir); |
| 143 | bus_addr = 0; | 143 | bus_addr = 0; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | if (!bus_addr) /* need to map it */ | 146 | if (!bus_addr) /* need to map it */ |
| 147 | bus_addr = pci_map_single(ppc64_isabridge_dev, addr, size, dir); | 147 | bus_addr = pci_map_single(isa_bridge_pcidev, addr, size, dir); |
| 148 | 148 | ||
| 149 | /* remember this one as prev */ | 149 | /* remember this one as prev */ |
| 150 | prev_addr = addr; | 150 | prev_addr = addr; |
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index 62efd9d7a43d..bf6cd7cb996c 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h | |||
| @@ -206,6 +206,7 @@ | |||
| 206 | #define H_FREE_LOGICAL_LAN_BUFFER 0x1D4 | 206 | #define H_FREE_LOGICAL_LAN_BUFFER 0x1D4 |
| 207 | #define H_QUERY_INT_STATE 0x1E4 | 207 | #define H_QUERY_INT_STATE 0x1E4 |
| 208 | #define H_POLL_PENDING 0x1D8 | 208 | #define H_POLL_PENDING 0x1D8 |
| 209 | #define H_ILLAN_ATTRIBUTES 0x244 | ||
| 209 | #define H_JOIN 0x298 | 210 | #define H_JOIN 0x298 |
| 210 | #define H_VASI_STATE 0x2A4 | 211 | #define H_VASI_STATE 0x2A4 |
| 211 | #define H_ENABLE_CRQ 0x2B0 | 212 | #define H_ENABLE_CRQ 0x2B0 |
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 350c9bdb31dc..bb8d965f96c6 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
| @@ -607,9 +607,9 @@ static inline void iosync(void) | |||
| 607 | * | 607 | * |
| 608 | * * iounmap undoes such a mapping and can be hooked | 608 | * * iounmap undoes such a mapping and can be hooked |
| 609 | * | 609 | * |
| 610 | * * __ioremap_explicit (and the pending __iounmap_explicit) are low level | 610 | * * __ioremap_at (and the pending __iounmap_at) are low level functions to |
| 611 | * functions to create hand-made mappings for use only by the PCI code | 611 | * create hand-made mappings for use only by the PCI code and cannot |
| 612 | * and cannot currently be hooked. | 612 | * currently be hooked. Must be page aligned. |
| 613 | * | 613 | * |
| 614 | * * __ioremap is the low level implementation used by ioremap and | 614 | * * __ioremap is the low level implementation used by ioremap and |
| 615 | * ioremap_flags and cannot be hooked (but can be used by a hook on one | 615 | * ioremap_flags and cannot be hooked (but can be used by a hook on one |
| @@ -629,19 +629,9 @@ extern void __iomem *__ioremap(phys_addr_t, unsigned long size, | |||
| 629 | unsigned long flags); | 629 | unsigned long flags); |
| 630 | extern void __iounmap(volatile void __iomem *addr); | 630 | extern void __iounmap(volatile void __iomem *addr); |
| 631 | 631 | ||
| 632 | extern int __ioremap_explicit(phys_addr_t p_addr, unsigned long v_addr, | 632 | extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea, |
| 633 | unsigned long size, unsigned long flags); | 633 | unsigned long size, unsigned long flags); |
| 634 | extern int __iounmap_explicit(volatile void __iomem *start, | 634 | extern void __iounmap_at(void *ea, unsigned long size); |
| 635 | unsigned long size); | ||
| 636 | |||
| 637 | extern void __iomem * reserve_phb_iospace(unsigned long size); | ||
| 638 | |||
| 639 | /* Those are more 32 bits only functions */ | ||
| 640 | extern unsigned long iopa(unsigned long addr); | ||
| 641 | extern unsigned long mm_ptov(unsigned long addr) __attribute_const__; | ||
| 642 | extern void io_block_mapping(unsigned long virt, phys_addr_t phys, | ||
| 643 | unsigned int size, int flags); | ||
| 644 | |||
| 645 | 635 | ||
| 646 | /* | 636 | /* |
| 647 | * When CONFIG_PPC_INDIRECT_IO is set, we use the generic iomap implementation | 637 | * When CONFIG_PPC_INDIRECT_IO is set, we use the generic iomap implementation |
| @@ -651,8 +641,8 @@ extern void io_block_mapping(unsigned long virt, phys_addr_t phys, | |||
| 651 | */ | 641 | */ |
| 652 | #define HAVE_ARCH_PIO_SIZE 1 | 642 | #define HAVE_ARCH_PIO_SIZE 1 |
| 653 | #define PIO_OFFSET 0x00000000UL | 643 | #define PIO_OFFSET 0x00000000UL |
| 654 | #define PIO_MASK 0x3fffffffUL | 644 | #define PIO_MASK (FULL_IO_SIZE - 1) |
| 655 | #define PIO_RESERVED 0x40000000UL | 645 | #define PIO_RESERVED (FULL_IO_SIZE) |
| 656 | 646 | ||
| 657 | #define mmio_read16be(addr) readw_be(addr) | 647 | #define mmio_read16be(addr) readw_be(addr) |
| 658 | #define mmio_read32be(addr) readl_be(addr) | 648 | #define mmio_read32be(addr) readl_be(addr) |
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index 05dd5a3eb3aa..0485c53db2b5 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
| @@ -223,6 +223,15 @@ extern void irq_dispose_mapping(unsigned int virq); | |||
| 223 | extern unsigned int irq_find_mapping(struct irq_host *host, | 223 | extern unsigned int irq_find_mapping(struct irq_host *host, |
| 224 | irq_hw_number_t hwirq); | 224 | irq_hw_number_t hwirq); |
| 225 | 225 | ||
| 226 | /** | ||
| 227 | * irq_create_direct_mapping - Allocate a virq for direct mapping | ||
| 228 | * @host: host to allocate the virq for or NULL for default host | ||
| 229 | * | ||
| 230 | * This routine is used for irq controllers which can choose the hardware | ||
| 231 | * interrupt numbers they generate. In such a case it's simplest to use | ||
| 232 | * the linux virq as the hardware interrupt number. | ||
| 233 | */ | ||
| 234 | extern unsigned int irq_create_direct_mapping(struct irq_host *host); | ||
| 226 | 235 | ||
| 227 | /** | 236 | /** |
| 228 | * irq_radix_revmap - Find a linux virq from a hw irq number. | 237 | * irq_radix_revmap - Find a linux virq from a hw irq number. |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index b0e40ff32ee0..9537fda238b8 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
| @@ -65,10 +65,10 @@ typedef unsigned int kprobe_opcode_t; | |||
| 65 | } else if (name[0] != '.') \ | 65 | } else if (name[0] != '.') \ |
| 66 | addr = *(kprobe_opcode_t **)addr; \ | 66 | addr = *(kprobe_opcode_t **)addr; \ |
| 67 | } else { \ | 67 | } else { \ |
| 68 | char dot_name[KSYM_NAME_LEN+1]; \ | 68 | char dot_name[KSYM_NAME_LEN]; \ |
| 69 | dot_name[0] = '.'; \ | 69 | dot_name[0] = '.'; \ |
| 70 | dot_name[1] = '\0'; \ | 70 | dot_name[1] = '\0'; \ |
| 71 | strncat(dot_name, name, KSYM_NAME_LEN); \ | 71 | strncat(dot_name, name, KSYM_NAME_LEN - 2); \ |
| 72 | addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \ | 72 | addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \ |
| 73 | } \ | 73 | } \ |
| 74 | } | 74 | } |
diff --git a/include/asm-powerpc/lppaca.h b/include/asm-powerpc/lppaca.h index 821ea0c512b4..567ed92cd91f 100644 --- a/include/asm-powerpc/lppaca.h +++ b/include/asm-powerpc/lppaca.h | |||
| @@ -98,7 +98,7 @@ struct lppaca { | |||
| 98 | u64 saved_gpr5; // Saved GPR5 x30-x37 | 98 | u64 saved_gpr5; // Saved GPR5 x30-x37 |
| 99 | 99 | ||
| 100 | u8 reserved4; // Reserved x38-x38 | 100 | u8 reserved4; // Reserved x38-x38 |
| 101 | u8 cpuctls_task_attrs; // Task attributes for cpuctls x39-x39 | 101 | u8 donate_dedicated_cpu; // Donate dedicated CPU cycles x39-x39 |
| 102 | u8 fpregs_in_use; // FP regs in use x3A-x3A | 102 | u8 fpregs_in_use; // FP regs in use x3A-x3A |
| 103 | u8 pmcregs_in_use; // PMC regs in use x3B-x3B | 103 | u8 pmcregs_in_use; // PMC regs in use x3B-x3B |
| 104 | volatile u32 saved_decr; // Saved Decr Value x3C-x3F | 104 | volatile u32 saved_decr; // Saved Decr Value x3C-x3F |
diff --git a/include/asm-powerpc/lv1call.h b/include/asm-powerpc/lv1call.h index f733beeea63a..81713acf7529 100644 --- a/include/asm-powerpc/lv1call.h +++ b/include/asm-powerpc/lv1call.h | |||
| @@ -238,6 +238,7 @@ LV1_CALL(destruct_virtual_address_space, 1, 0, 10 ) | |||
| 238 | LV1_CALL(configure_irq_state_bitmap, 3, 0, 11 ) | 238 | LV1_CALL(configure_irq_state_bitmap, 3, 0, 11 ) |
| 239 | LV1_CALL(connect_irq_plug_ext, 5, 0, 12 ) | 239 | LV1_CALL(connect_irq_plug_ext, 5, 0, 12 ) |
| 240 | LV1_CALL(release_memory, 1, 0, 13 ) | 240 | LV1_CALL(release_memory, 1, 0, 13 ) |
| 241 | LV1_CALL(put_iopte, 5, 0, 15 ) | ||
| 241 | LV1_CALL(disconnect_irq_plug_ext, 3, 0, 17 ) | 242 | LV1_CALL(disconnect_irq_plug_ext, 3, 0, 17 ) |
| 242 | LV1_CALL(construct_event_receive_port, 0, 1, 18 ) | 243 | LV1_CALL(construct_event_receive_port, 0, 1, 18 ) |
| 243 | LV1_CALL(destruct_event_receive_port, 1, 0, 19 ) | 244 | LV1_CALL(destruct_event_receive_port, 1, 0, 19 ) |
| @@ -268,6 +269,8 @@ LV1_CALL(remove_repository_node, 4, 0, 93 ) | |||
| 268 | LV1_CALL(read_htab_entries, 2, 5, 95 ) | 269 | LV1_CALL(read_htab_entries, 2, 5, 95 ) |
| 269 | LV1_CALL(set_dabr, 2, 0, 96 ) | 270 | LV1_CALL(set_dabr, 2, 0, 96 ) |
| 270 | LV1_CALL(get_total_execution_time, 2, 1, 103 ) | 271 | LV1_CALL(get_total_execution_time, 2, 1, 103 ) |
| 272 | LV1_CALL(allocate_io_segment, 3, 1, 116 ) | ||
| 273 | LV1_CALL(release_io_segment, 2, 0, 117 ) | ||
| 271 | LV1_CALL(construct_io_irq_outlet, 1, 1, 120 ) | 274 | LV1_CALL(construct_io_irq_outlet, 1, 1, 120 ) |
| 272 | LV1_CALL(destruct_io_irq_outlet, 1, 0, 121 ) | 275 | LV1_CALL(destruct_io_irq_outlet, 1, 0, 121 ) |
| 273 | LV1_CALL(map_htab, 1, 1, 122 ) | 276 | LV1_CALL(map_htab, 1, 1, 122 ) |
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 6cf1a831f550..71c6e7eb2a26 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
| @@ -218,7 +218,7 @@ struct machdep_calls { | |||
| 218 | int (*pcibios_enable_device_hook)(struct pci_dev *, int initial); | 218 | int (*pcibios_enable_device_hook)(struct pci_dev *, int initial); |
| 219 | 219 | ||
| 220 | /* Called in indirect_* to avoid touching devices */ | 220 | /* Called in indirect_* to avoid touching devices */ |
| 221 | int (*pci_exclude_device)(unsigned char, unsigned char); | 221 | int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char); |
| 222 | 222 | ||
| 223 | /* Called at then very end of pcibios_init() */ | 223 | /* Called at then very end of pcibios_init() */ |
| 224 | void (*pcibios_after_init)(void); | 224 | void (*pcibios_after_init)(void); |
diff --git a/include/asm-powerpc/mmu-8xx.h b/include/asm-powerpc/mmu-8xx.h new file mode 100644 index 000000000000..952bd8899f2f --- /dev/null +++ b/include/asm-powerpc/mmu-8xx.h | |||
| @@ -0,0 +1,147 @@ | |||
| 1 | #ifndef _ASM_POWERPC_MMU_8XX_H_ | ||
| 2 | #define _ASM_POWERPC_MMU_8XX_H_ | ||
| 3 | /* | ||
| 4 | * PPC8xx support | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* Control/status registers for the MPC8xx. | ||
| 8 | * A write operation to these registers causes serialized access. | ||
| 9 | * During software tablewalk, the registers used perform mask/shift-add | ||
| 10 | * operations when written/read. A TLB entry is created when the Mx_RPN | ||
| 11 | * is written, and the contents of several registers are used to | ||
| 12 | * create the entry. | ||
| 13 | */ | ||
| 14 | #define SPRN_MI_CTR 784 /* Instruction TLB control register */ | ||
| 15 | #define MI_GPM 0x80000000 /* Set domain manager mode */ | ||
| 16 | #define MI_PPM 0x40000000 /* Set subpage protection */ | ||
| 17 | #define MI_CIDEF 0x20000000 /* Set cache inhibit when MMU dis */ | ||
| 18 | #define MI_RSV4I 0x08000000 /* Reserve 4 TLB entries */ | ||
| 19 | #define MI_PPCS 0x02000000 /* Use MI_RPN prob/priv state */ | ||
| 20 | #define MI_IDXMASK 0x00001f00 /* TLB index to be loaded */ | ||
| 21 | #define MI_RESETVAL 0x00000000 /* Value of register at reset */ | ||
| 22 | |||
| 23 | /* These are the Ks and Kp from the PowerPC books. For proper operation, | ||
| 24 | * Ks = 0, Kp = 1. | ||
| 25 | */ | ||
| 26 | #define SPRN_MI_AP 786 | ||
| 27 | #define MI_Ks 0x80000000 /* Should not be set */ | ||
| 28 | #define MI_Kp 0x40000000 /* Should always be set */ | ||
| 29 | |||
| 30 | /* The effective page number register. When read, contains the information | ||
| 31 | * about the last instruction TLB miss. When MI_RPN is written, bits in | ||
| 32 | * this register are used to create the TLB entry. | ||
| 33 | */ | ||
| 34 | #define SPRN_MI_EPN 787 | ||
| 35 | #define MI_EPNMASK 0xfffff000 /* Effective page number for entry */ | ||
| 36 | #define MI_EVALID 0x00000200 /* Entry is valid */ | ||
| 37 | #define MI_ASIDMASK 0x0000000f /* ASID match value */ | ||
| 38 | /* Reset value is undefined */ | ||
| 39 | |||
| 40 | /* A "level 1" or "segment" or whatever you want to call it register. | ||
| 41 | * For the instruction TLB, it contains bits that get loaded into the | ||
| 42 | * TLB entry when the MI_RPN is written. | ||
| 43 | */ | ||
| 44 | #define SPRN_MI_TWC 789 | ||
| 45 | #define MI_APG 0x000001e0 /* Access protection group (0) */ | ||
| 46 | #define MI_GUARDED 0x00000010 /* Guarded storage */ | ||
| 47 | #define MI_PSMASK 0x0000000c /* Mask of page size bits */ | ||
| 48 | #define MI_PS8MEG 0x0000000c /* 8M page size */ | ||
| 49 | #define MI_PS512K 0x00000004 /* 512K page size */ | ||
| 50 | #define MI_PS4K_16K 0x00000000 /* 4K or 16K page size */ | ||
| 51 | #define MI_SVALID 0x00000001 /* Segment entry is valid */ | ||
| 52 | /* Reset value is undefined */ | ||
| 53 | |||
| 54 | /* Real page number. Defined by the pte. Writing this register | ||
| 55 | * causes a TLB entry to be created for the instruction TLB, using | ||
| 56 | * additional information from the MI_EPN, and MI_TWC registers. | ||
| 57 | */ | ||
| 58 | #define SPRN_MI_RPN 790 | ||
| 59 | |||
| 60 | /* Define an RPN value for mapping kernel memory to large virtual | ||
| 61 | * pages for boot initialization. This has real page number of 0, | ||
| 62 | * large page size, shared page, cache enabled, and valid. | ||
| 63 | * Also mark all subpages valid and write access. | ||
| 64 | */ | ||
| 65 | #define MI_BOOTINIT 0x000001fd | ||
| 66 | |||
| 67 | #define SPRN_MD_CTR 792 /* Data TLB control register */ | ||
| 68 | #define MD_GPM 0x80000000 /* Set domain manager mode */ | ||
| 69 | #define MD_PPM 0x40000000 /* Set subpage protection */ | ||
| 70 | #define MD_CIDEF 0x20000000 /* Set cache inhibit when MMU dis */ | ||
| 71 | #define MD_WTDEF 0x10000000 /* Set writethrough when MMU dis */ | ||
| 72 | #define MD_RSV4I 0x08000000 /* Reserve 4 TLB entries */ | ||
| 73 | #define MD_TWAM 0x04000000 /* Use 4K page hardware assist */ | ||
| 74 | #define MD_PPCS 0x02000000 /* Use MI_RPN prob/priv state */ | ||
| 75 | #define MD_IDXMASK 0x00001f00 /* TLB index to be loaded */ | ||
| 76 | #define MD_RESETVAL 0x04000000 /* Value of register at reset */ | ||
| 77 | |||
| 78 | #define SPRN_M_CASID 793 /* Address space ID (context) to match */ | ||
| 79 | #define MC_ASIDMASK 0x0000000f /* Bits used for ASID value */ | ||
| 80 | |||
| 81 | |||
| 82 | /* These are the Ks and Kp from the PowerPC books. For proper operation, | ||
| 83 | * Ks = 0, Kp = 1. | ||
| 84 | */ | ||
| 85 | #define SPRN_MD_AP 794 | ||
| 86 | #define MD_Ks 0x80000000 /* Should not be set */ | ||
| 87 | #define MD_Kp 0x40000000 /* Should always be set */ | ||
| 88 | |||
| 89 | /* The effective page number register. When read, contains the information | ||
| 90 | * about the last instruction TLB miss. When MD_RPN is written, bits in | ||
| 91 | * this register are used to create the TLB entry. | ||
| 92 | */ | ||
| 93 | #define SPRN_MD_EPN 795 | ||
| 94 | #define MD_EPNMASK 0xfffff000 /* Effective page number for entry */ | ||
| 95 | #define MD_EVALID 0x00000200 /* Entry is valid */ | ||
| 96 | #define MD_ASIDMASK 0x0000000f /* ASID match value */ | ||
| 97 | /* Reset value is undefined */ | ||
| 98 | |||
| 99 | /* The pointer to the base address of the first level page table. | ||
| 100 | * During a software tablewalk, reading this register provides the address | ||
| 101 | * of the entry associated with MD_EPN. | ||
| 102 | */ | ||
| 103 | #define SPRN_M_TWB 796 | ||
| 104 | #define M_L1TB 0xfffff000 /* Level 1 table base address */ | ||
| 105 | #define M_L1INDX 0x00000ffc /* Level 1 index, when read */ | ||
| 106 | /* Reset value is undefined */ | ||
| 107 | |||
| 108 | /* A "level 1" or "segment" or whatever you want to call it register. | ||
| 109 | * For the data TLB, it contains bits that get loaded into the TLB entry | ||
| 110 | * when the MD_RPN is written. It is also provides the hardware assist | ||
| 111 | * for finding the PTE address during software tablewalk. | ||
| 112 | */ | ||
| 113 | #define SPRN_MD_TWC 797 | ||
| 114 | #define MD_L2TB 0xfffff000 /* Level 2 table base address */ | ||
| 115 | #define MD_L2INDX 0xfffffe00 /* Level 2 index (*pte), when read */ | ||
| 116 | #define MD_APG 0x000001e0 /* Access protection group (0) */ | ||
| 117 | #define MD_GUARDED 0x00000010 /* Guarded storage */ | ||
| 118 | #define MD_PSMASK 0x0000000c /* Mask of page size bits */ | ||
| 119 | #define MD_PS8MEG 0x0000000c /* 8M page size */ | ||
| 120 | #define MD_PS512K 0x00000004 /* 512K page size */ | ||
| 121 | #define MD_PS4K_16K 0x00000000 /* 4K or 16K page size */ | ||
| 122 | #define MD_WT 0x00000002 /* Use writethrough page attribute */ | ||
| 123 | #define MD_SVALID 0x00000001 /* Segment entry is valid */ | ||
| 124 | /* Reset value is undefined */ | ||
| 125 | |||
| 126 | |||
| 127 | /* Real page number. Defined by the pte. Writing this register | ||
| 128 | * causes a TLB entry to be created for the data TLB, using | ||
| 129 | * additional information from the MD_EPN, and MD_TWC registers. | ||
| 130 | */ | ||
| 131 | #define SPRN_MD_RPN 798 | ||
| 132 | |||
| 133 | /* This is a temporary storage register that could be used to save | ||
| 134 | * a processor working register during a tablewalk. | ||
| 135 | */ | ||
| 136 | #define SPRN_M_TW 799 | ||
| 137 | |||
| 138 | #ifndef __ASSEMBLY__ | ||
| 139 | typedef unsigned long phys_addr_t; | ||
| 140 | |||
| 141 | typedef struct { | ||
| 142 | unsigned long id; | ||
| 143 | unsigned long vdso_base; | ||
| 144 | } mm_context_t; | ||
| 145 | #endif /* !__ASSEMBLY__ */ | ||
| 146 | |||
| 147 | #endif /* _ASM_POWERPC_MMU_8XX_H_ */ | ||
diff --git a/include/asm-powerpc/mmu-fsl-booke.h b/include/asm-powerpc/mmu-fsl-booke.h new file mode 100644 index 000000000000..37580004cd7a --- /dev/null +++ b/include/asm-powerpc/mmu-fsl-booke.h | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | #ifndef _ASM_POWERPC_MMU_FSL_BOOKE_H_ | ||
| 2 | #define _ASM_POWERPC_MMU_FSL_BOOKE_H_ | ||
| 3 | /* | ||
| 4 | * Freescale Book-E MMU support | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* Book-E defined page sizes */ | ||
| 8 | #define BOOKE_PAGESZ_1K 0 | ||
| 9 | #define BOOKE_PAGESZ_4K 1 | ||
| 10 | #define BOOKE_PAGESZ_16K 2 | ||
| 11 | #define BOOKE_PAGESZ_64K 3 | ||
| 12 | #define BOOKE_PAGESZ_256K 4 | ||
| 13 | #define BOOKE_PAGESZ_1M 5 | ||
| 14 | #define BOOKE_PAGESZ_4M 6 | ||
| 15 | #define BOOKE_PAGESZ_16M 7 | ||
| 16 | #define BOOKE_PAGESZ_64M 8 | ||
| 17 | #define BOOKE_PAGESZ_256M 9 | ||
| 18 | #define BOOKE_PAGESZ_1GB 10 | ||
| 19 | #define BOOKE_PAGESZ_4GB 11 | ||
| 20 | #define BOOKE_PAGESZ_16GB 12 | ||
| 21 | #define BOOKE_PAGESZ_64GB 13 | ||
| 22 | #define BOOKE_PAGESZ_256GB 14 | ||
| 23 | #define BOOKE_PAGESZ_1TB 15 | ||
| 24 | |||
| 25 | #define MAS0_TLBSEL(x) ((x << 28) & 0x30000000) | ||
| 26 | #define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000) | ||
| 27 | #define MAS0_NV(x) ((x) & 0x00000FFF) | ||
| 28 | |||
| 29 | #define MAS1_VALID 0x80000000 | ||
| 30 | #define MAS1_IPROT 0x40000000 | ||
| 31 | #define MAS1_TID(x) ((x << 16) & 0x3FFF0000) | ||
| 32 | #define MAS1_TS 0x00001000 | ||
| 33 | #define MAS1_TSIZE(x) ((x << 8) & 0x00000F00) | ||
| 34 | |||
| 35 | #define MAS2_EPN 0xFFFFF000 | ||
| 36 | #define MAS2_X0 0x00000040 | ||
| 37 | #define MAS2_X1 0x00000020 | ||
| 38 | #define MAS2_W 0x00000010 | ||
| 39 | #define MAS2_I 0x00000008 | ||
| 40 | #define MAS2_M 0x00000004 | ||
| 41 | #define MAS2_G 0x00000002 | ||
| 42 | #define MAS2_E 0x00000001 | ||
| 43 | |||
| 44 | #define MAS3_RPN 0xFFFFF000 | ||
| 45 | #define MAS3_U0 0x00000200 | ||
| 46 | #define MAS3_U1 0x00000100 | ||
| 47 | #define MAS3_U2 0x00000080 | ||
| 48 | #define MAS3_U3 0x00000040 | ||
| 49 | #define MAS3_UX 0x00000020 | ||
| 50 | #define MAS3_SX 0x00000010 | ||
| 51 | #define MAS3_UW 0x00000008 | ||
| 52 | #define MAS3_SW 0x00000004 | ||
| 53 | #define MAS3_UR 0x00000002 | ||
| 54 | #define MAS3_SR 0x00000001 | ||
| 55 | |||
| 56 | #define MAS4_TLBSELD(x) MAS0_TLBSEL(x) | ||
| 57 | #define MAS4_TIDDSEL 0x000F0000 | ||
| 58 | #define MAS4_TSIZED(x) MAS1_TSIZE(x) | ||
| 59 | #define MAS4_X0D 0x00000040 | ||
| 60 | #define MAS4_X1D 0x00000020 | ||
| 61 | #define MAS4_WD 0x00000010 | ||
| 62 | #define MAS4_ID 0x00000008 | ||
| 63 | #define MAS4_MD 0x00000004 | ||
| 64 | #define MAS4_GD 0x00000002 | ||
| 65 | #define MAS4_ED 0x00000001 | ||
| 66 | |||
| 67 | #define MAS6_SPID0 0x3FFF0000 | ||
| 68 | #define MAS6_SPID1 0x00007FFE | ||
| 69 | #define MAS6_SAS 0x00000001 | ||
| 70 | #define MAS6_SPID MAS6_SPID0 | ||
| 71 | |||
| 72 | #define MAS7_RPN 0xFFFFFFFF | ||
| 73 | |||
| 74 | #ifndef __ASSEMBLY__ | ||
| 75 | |||
| 76 | #ifndef CONFIG_PHYS_64BIT | ||
| 77 | typedef unsigned long phys_addr_t; | ||
| 78 | #else | ||
| 79 | typedef unsigned long long phys_addr_t; | ||
| 80 | #endif | ||
| 81 | |||
| 82 | typedef struct { | ||
| 83 | unsigned long id; | ||
| 84 | unsigned long vdso_base; | ||
| 85 | } mm_context_t; | ||
| 86 | #endif /* !__ASSEMBLY__ */ | ||
| 87 | |||
| 88 | #endif /* _ASM_POWERPC_MMU_FSL_BOOKE_H_ */ | ||
diff --git a/include/asm-powerpc/mmu-hash32.h b/include/asm-powerpc/mmu-hash32.h new file mode 100644 index 000000000000..4bd735be3833 --- /dev/null +++ b/include/asm-powerpc/mmu-hash32.h | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | #ifndef _ASM_POWERPC_MMU_HASH32_H_ | ||
| 2 | #define _ASM_POWERPC_MMU_HASH32_H_ | ||
| 3 | /* | ||
| 4 | * 32-bit hash table MMU support | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* | ||
| 8 | * BATs | ||
| 9 | */ | ||
| 10 | |||
| 11 | /* Block size masks */ | ||
| 12 | #define BL_128K 0x000 | ||
| 13 | #define BL_256K 0x001 | ||
| 14 | #define BL_512K 0x003 | ||
| 15 | #define BL_1M 0x007 | ||
| 16 | #define BL_2M 0x00F | ||
| 17 | #define BL_4M 0x01F | ||
| 18 | #define BL_8M 0x03F | ||
| 19 | #define BL_16M 0x07F | ||
| 20 | #define BL_32M 0x0FF | ||
| 21 | #define BL_64M 0x1FF | ||
| 22 | #define BL_128M 0x3FF | ||
| 23 | #define BL_256M 0x7FF | ||
| 24 | |||
| 25 | /* BAT Access Protection */ | ||
| 26 | #define BPP_XX 0x00 /* No access */ | ||
| 27 | #define BPP_RX 0x01 /* Read only */ | ||
| 28 | #define BPP_RW 0x02 /* Read/write */ | ||
| 29 | |||
| 30 | #ifndef __ASSEMBLY__ | ||
| 31 | struct ppc_bat { | ||
| 32 | struct { | ||
| 33 | unsigned long bepi:15; /* Effective page index (virtual address) */ | ||
| 34 | unsigned long :4; /* Unused */ | ||
| 35 | unsigned long bl:11; /* Block size mask */ | ||
| 36 | unsigned long vs:1; /* Supervisor valid */ | ||
| 37 | unsigned long vp:1; /* User valid */ | ||
| 38 | } batu; /* Upper register */ | ||
| 39 | struct { | ||
| 40 | unsigned long brpn:15; /* Real page index (physical address) */ | ||
| 41 | unsigned long :10; /* Unused */ | ||
| 42 | unsigned long w:1; /* Write-thru cache */ | ||
| 43 | unsigned long i:1; /* Cache inhibit */ | ||
| 44 | unsigned long m:1; /* Memory coherence */ | ||
| 45 | unsigned long g:1; /* Guarded (MBZ in IBAT) */ | ||
| 46 | unsigned long :1; /* Unused */ | ||
| 47 | unsigned long pp:2; /* Page access protections */ | ||
| 48 | } batl; /* Lower register */ | ||
| 49 | }; | ||
| 50 | #endif /* !__ASSEMBLY__ */ | ||
| 51 | |||
| 52 | /* | ||
| 53 | * Hash table | ||
| 54 | */ | ||
| 55 | |||
| 56 | /* Values for PP (assumes Ks=0, Kp=1) */ | ||
| 57 | #define PP_RWXX 0 /* Supervisor read/write, User none */ | ||
| 58 | #define PP_RWRX 1 /* Supervisor read/write, User read */ | ||
| 59 | #define PP_RWRW 2 /* Supervisor read/write, User read/write */ | ||
| 60 | #define PP_RXRX 3 /* Supervisor read, User read */ | ||
| 61 | |||
| 62 | #ifndef __ASSEMBLY__ | ||
| 63 | |||
| 64 | /* Hardware Page Table Entry */ | ||
| 65 | struct hash_pte { | ||
| 66 | unsigned long v:1; /* Entry is valid */ | ||
| 67 | unsigned long vsid:24; /* Virtual segment identifier */ | ||
| 68 | unsigned long h:1; /* Hash algorithm indicator */ | ||
| 69 | unsigned long api:6; /* Abbreviated page index */ | ||
| 70 | unsigned long rpn:20; /* Real (physical) page number */ | ||
| 71 | unsigned long :3; /* Unused */ | ||
| 72 | unsigned long r:1; /* Referenced */ | ||
| 73 | unsigned long c:1; /* Changed */ | ||
| 74 | unsigned long w:1; /* Write-thru cache mode */ | ||
| 75 | unsigned long i:1; /* Cache inhibited */ | ||
| 76 | unsigned long m:1; /* Memory coherence */ | ||
| 77 | unsigned long g:1; /* Guarded */ | ||
| 78 | unsigned long :1; /* Unused */ | ||
| 79 | unsigned long pp:2; /* Page protection */ | ||
| 80 | }; | ||
| 81 | |||
| 82 | typedef struct { | ||
| 83 | unsigned long id; | ||
| 84 | unsigned long vdso_base; | ||
| 85 | } mm_context_t; | ||
| 86 | |||
| 87 | typedef unsigned long phys_addr_t; | ||
| 88 | |||
| 89 | #endif /* !__ASSEMBLY__ */ | ||
| 90 | |||
| 91 | #endif /* _ASM_POWERPC_MMU_HASH32_H_ */ | ||
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h index b8dca30bd0b5..695962f02059 100644 --- a/include/asm-powerpc/mmu-hash64.h +++ b/include/asm-powerpc/mmu-hash64.h | |||
| @@ -94,6 +94,9 @@ extern char initial_stab[]; | |||
| 94 | #define HPTE_R_C ASM_CONST(0x0000000000000080) | 94 | #define HPTE_R_C ASM_CONST(0x0000000000000080) |
| 95 | #define HPTE_R_R ASM_CONST(0x0000000000000100) | 95 | #define HPTE_R_R ASM_CONST(0x0000000000000100) |
| 96 | 96 | ||
| 97 | #define HPTE_V_1TB_SEG ASM_CONST(0x4000000000000000) | ||
| 98 | #define HPTE_V_VRMA_MASK ASM_CONST(0x4001ffffff000000) | ||
| 99 | |||
| 97 | /* Values for PP (assumes Ks=0, Kp=1) */ | 100 | /* Values for PP (assumes Ks=0, Kp=1) */ |
| 98 | /* pp0 will always be 0 for linux */ | 101 | /* pp0 will always be 0 for linux */ |
| 99 | #define PP_RWXX 0 /* Supervisor read/write, User none */ | 102 | #define PP_RWXX 0 /* Supervisor read/write, User none */ |
| @@ -103,12 +106,12 @@ extern char initial_stab[]; | |||
| 103 | 106 | ||
| 104 | #ifndef __ASSEMBLY__ | 107 | #ifndef __ASSEMBLY__ |
| 105 | 108 | ||
| 106 | typedef struct { | 109 | struct hash_pte { |
| 107 | unsigned long v; | 110 | unsigned long v; |
| 108 | unsigned long r; | 111 | unsigned long r; |
| 109 | } hpte_t; | 112 | }; |
| 110 | 113 | ||
| 111 | extern hpte_t *htab_address; | 114 | extern struct hash_pte *htab_address; |
| 112 | extern unsigned long htab_size_bytes; | 115 | extern unsigned long htab_size_bytes; |
| 113 | extern unsigned long htab_hash_mask; | 116 | extern unsigned long htab_hash_mask; |
| 114 | 117 | ||
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h index fe510fff8907..d44d211e7588 100644 --- a/include/asm-powerpc/mmu.h +++ b/include/asm-powerpc/mmu.h | |||
| @@ -5,13 +5,18 @@ | |||
| 5 | #ifdef CONFIG_PPC64 | 5 | #ifdef CONFIG_PPC64 |
| 6 | /* 64-bit classic hash table MMU */ | 6 | /* 64-bit classic hash table MMU */ |
| 7 | # include <asm/mmu-hash64.h> | 7 | # include <asm/mmu-hash64.h> |
| 8 | #elif defined(CONFIG_PPC_STD_MMU) | ||
| 9 | /* 32-bit classic hash table MMU */ | ||
| 10 | # include <asm/mmu-hash32.h> | ||
| 8 | #elif defined(CONFIG_44x) | 11 | #elif defined(CONFIG_44x) |
| 9 | /* 44x-style software loaded TLB */ | 12 | /* 44x-style software loaded TLB */ |
| 10 | # include <asm/mmu-44x.h> | 13 | # include <asm/mmu-44x.h> |
| 11 | #else | 14 | #elif defined(CONFIG_FSL_BOOKE) |
| 12 | /* Other 32-bit. FIXME: split up the other 32-bit MMU types, and | 15 | /* Freescale Book-E software loaded TLB */ |
| 13 | * revise for arch/powerpc */ | 16 | # include <asm/mmu-fsl-booke.h> |
| 14 | # include <asm-ppc/mmu.h> | 17 | #elif defined (CONFIG_PPC_8xx) |
| 18 | /* Motorola/Freescale 8xx software loaded TLB */ | ||
| 19 | # include <asm/mmu-8xx.h> | ||
| 15 | #endif | 20 | #endif |
| 16 | 21 | ||
| 17 | #endif /* __KERNEL__ */ | 22 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h index 40c9e5a13ff1..f863ac21409e 100644 --- a/include/asm-powerpc/mmu_context.h +++ b/include/asm-powerpc/mmu_context.h | |||
| @@ -2,16 +2,210 @@ | |||
| 2 | #define __ASM_POWERPC_MMU_CONTEXT_H | 2 | #define __ASM_POWERPC_MMU_CONTEXT_H |
| 3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
| 4 | 4 | ||
| 5 | #include <asm/mmu.h> | ||
| 6 | #include <asm/cputable.h> | ||
| 7 | #include <asm-generic/mm_hooks.h> | ||
| 8 | |||
| 5 | #ifndef CONFIG_PPC64 | 9 | #ifndef CONFIG_PPC64 |
| 6 | #include <asm-ppc/mmu_context.h> | 10 | #include <asm/atomic.h> |
| 11 | #include <asm/bitops.h> | ||
| 12 | |||
| 13 | /* | ||
| 14 | * On 32-bit PowerPC 6xx/7xx/7xxx CPUs, we use a set of 16 VSIDs | ||
| 15 | * (virtual segment identifiers) for each context. Although the | ||
| 16 | * hardware supports 24-bit VSIDs, and thus >1 million contexts, | ||
| 17 | * we only use 32,768 of them. That is ample, since there can be | ||
| 18 | * at most around 30,000 tasks in the system anyway, and it means | ||
| 19 | * that we can use a bitmap to indicate which contexts are in use. | ||
| 20 | * Using a bitmap means that we entirely avoid all of the problems | ||
| 21 | * that we used to have when the context number overflowed, | ||
| 22 | * particularly on SMP systems. | ||
| 23 | * -- paulus. | ||
| 24 | */ | ||
| 25 | |||
| 26 | /* | ||
| 27 | * This function defines the mapping from contexts to VSIDs (virtual | ||
| 28 | * segment IDs). We use a skew on both the context and the high 4 bits | ||
| 29 | * of the 32-bit virtual address (the "effective segment ID") in order | ||
| 30 | * to spread out the entries in the MMU hash table. Note, if this | ||
| 31 | * function is changed then arch/ppc/mm/hashtable.S will have to be | ||
| 32 | * changed to correspond. | ||
| 33 | */ | ||
| 34 | #define CTX_TO_VSID(ctx, va) (((ctx) * (897 * 16) + ((va) >> 28) * 0x111) \ | ||
| 35 | & 0xffffff) | ||
| 36 | |||
| 37 | /* | ||
| 38 | The MPC8xx has only 16 contexts. We rotate through them on each | ||
| 39 | task switch. A better way would be to keep track of tasks that | ||
| 40 | own contexts, and implement an LRU usage. That way very active | ||
| 41 | tasks don't always have to pay the TLB reload overhead. The | ||
| 42 | kernel pages are mapped shared, so the kernel can run on behalf | ||
| 43 | of any task that makes a kernel entry. Shared does not mean they | ||
| 44 | are not protected, just that the ASID comparison is not performed. | ||
| 45 | -- Dan | ||
| 46 | |||
| 47 | The IBM4xx has 256 contexts, so we can just rotate through these | ||
| 48 | as a way of "switching" contexts. If the TID of the TLB is zero, | ||
| 49 | the PID/TID comparison is disabled, so we can use a TID of zero | ||
| 50 | to represent all kernel pages as shared among all contexts. | ||
| 51 | -- Dan | ||
| 52 | */ | ||
| 53 | |||
| 54 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
| 55 | { | ||
| 56 | } | ||
| 57 | |||
| 58 | #ifdef CONFIG_8xx | ||
| 59 | #define NO_CONTEXT 16 | ||
| 60 | #define LAST_CONTEXT 15 | ||
| 61 | #define FIRST_CONTEXT 0 | ||
| 62 | |||
| 63 | #elif defined(CONFIG_4xx) | ||
| 64 | #define NO_CONTEXT 256 | ||
| 65 | #define LAST_CONTEXT 255 | ||
| 66 | #define FIRST_CONTEXT 1 | ||
| 67 | |||
| 68 | #elif defined(CONFIG_E200) || defined(CONFIG_E500) | ||
| 69 | #define NO_CONTEXT 256 | ||
| 70 | #define LAST_CONTEXT 255 | ||
| 71 | #define FIRST_CONTEXT 1 | ||
| 72 | |||
| 73 | #else | ||
| 74 | |||
| 75 | /* PPC 6xx, 7xx CPUs */ | ||
| 76 | #define NO_CONTEXT ((unsigned long) -1) | ||
| 77 | #define LAST_CONTEXT 32767 | ||
| 78 | #define FIRST_CONTEXT 1 | ||
| 79 | #endif | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Set the current MMU context. | ||
| 83 | * On 32-bit PowerPCs (other than the 8xx embedded chips), this is done by | ||
| 84 | * loading up the segment registers for the user part of the address space. | ||
| 85 | * | ||
| 86 | * Since the PGD is immediately available, it is much faster to simply | ||
| 87 | * pass this along as a second parameter, which is required for 8xx and | ||
| 88 | * can be used for debugging on all processors (if you happen to have | ||
| 89 | * an Abatron). | ||
| 90 | */ | ||
| 91 | extern void set_context(unsigned long contextid, pgd_t *pgd); | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Bitmap of contexts in use. | ||
| 95 | * The size of this bitmap is LAST_CONTEXT + 1 bits. | ||
| 96 | */ | ||
| 97 | extern unsigned long context_map[]; | ||
| 98 | |||
| 99 | /* | ||
| 100 | * This caches the next context number that we expect to be free. | ||
| 101 | * Its use is an optimization only, we can't rely on this context | ||
| 102 | * number to be free, but it usually will be. | ||
| 103 | */ | ||
| 104 | extern unsigned long next_mmu_context; | ||
| 105 | |||
| 106 | /* | ||
| 107 | * If we don't have sufficient contexts to give one to every task | ||
| 108 | * that could be in the system, we need to be able to steal contexts. | ||
| 109 | * These variables support that. | ||
| 110 | */ | ||
| 111 | #if LAST_CONTEXT < 30000 | ||
| 112 | #define FEW_CONTEXTS 1 | ||
| 113 | extern atomic_t nr_free_contexts; | ||
| 114 | extern struct mm_struct *context_mm[LAST_CONTEXT+1]; | ||
| 115 | extern void steal_context(void); | ||
| 116 | #endif | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Get a new mmu context for the address space described by `mm'. | ||
| 120 | */ | ||
| 121 | static inline void get_mmu_context(struct mm_struct *mm) | ||
| 122 | { | ||
| 123 | unsigned long ctx; | ||
| 124 | |||
| 125 | if (mm->context.id != NO_CONTEXT) | ||
| 126 | return; | ||
| 127 | #ifdef FEW_CONTEXTS | ||
| 128 | while (atomic_dec_if_positive(&nr_free_contexts) < 0) | ||
| 129 | steal_context(); | ||
| 130 | #endif | ||
| 131 | ctx = next_mmu_context; | ||
| 132 | while (test_and_set_bit(ctx, context_map)) { | ||
| 133 | ctx = find_next_zero_bit(context_map, LAST_CONTEXT+1, ctx); | ||
| 134 | if (ctx > LAST_CONTEXT) | ||
| 135 | ctx = 0; | ||
| 136 | } | ||
| 137 | next_mmu_context = (ctx + 1) & LAST_CONTEXT; | ||
| 138 | mm->context.id = ctx; | ||
| 139 | #ifdef FEW_CONTEXTS | ||
| 140 | context_mm[ctx] = mm; | ||
| 141 | #endif | ||
| 142 | } | ||
| 143 | |||
| 144 | /* | ||
| 145 | * Set up the context for a new address space. | ||
| 146 | */ | ||
| 147 | static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) | ||
| 148 | { | ||
| 149 | mm->context.id = NO_CONTEXT; | ||
| 150 | mm->context.vdso_base = 0; | ||
| 151 | return 0; | ||
| 152 | } | ||
| 153 | |||
| 154 | /* | ||
| 155 | * We're finished using the context for an address space. | ||
| 156 | */ | ||
| 157 | static inline void destroy_context(struct mm_struct *mm) | ||
| 158 | { | ||
| 159 | preempt_disable(); | ||
| 160 | if (mm->context.id != NO_CONTEXT) { | ||
| 161 | clear_bit(mm->context.id, context_map); | ||
| 162 | mm->context.id = NO_CONTEXT; | ||
| 163 | #ifdef FEW_CONTEXTS | ||
| 164 | atomic_inc(&nr_free_contexts); | ||
| 165 | #endif | ||
| 166 | } | ||
| 167 | preempt_enable(); | ||
| 168 | } | ||
| 169 | |||
| 170 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | ||
| 171 | struct task_struct *tsk) | ||
| 172 | { | ||
| 173 | #ifdef CONFIG_ALTIVEC | ||
| 174 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) | ||
| 175 | asm volatile ("dssall;\n" | ||
| 176 | #ifndef CONFIG_POWER4 | ||
| 177 | "sync;\n" /* G4 needs a sync here, G5 apparently not */ | ||
| 178 | #endif | ||
| 179 | : : ); | ||
| 180 | #endif /* CONFIG_ALTIVEC */ | ||
| 181 | |||
| 182 | tsk->thread.pgdir = next->pgd; | ||
| 183 | |||
| 184 | /* No need to flush userspace segments if the mm doesnt change */ | ||
| 185 | if (prev == next) | ||
| 186 | return; | ||
| 187 | |||
| 188 | /* Setup new userspace context */ | ||
| 189 | get_mmu_context(next); | ||
| 190 | set_context(next->context.id, next->pgd); | ||
| 191 | } | ||
| 192 | |||
| 193 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
| 194 | |||
| 195 | /* | ||
| 196 | * After we have set current->mm to a new value, this activates | ||
| 197 | * the context for the new mm so we see the new mappings. | ||
| 198 | */ | ||
| 199 | #define activate_mm(active_mm, mm) switch_mm(active_mm, mm, current) | ||
| 200 | |||
| 201 | extern void mmu_context_init(void); | ||
| 202 | |||
| 203 | |||
| 7 | #else | 204 | #else |
| 8 | 205 | ||
| 9 | #include <linux/kernel.h> | 206 | #include <linux/kernel.h> |
| 10 | #include <linux/mm.h> | 207 | #include <linux/mm.h> |
| 11 | #include <linux/sched.h> | 208 | #include <linux/sched.h> |
| 12 | #include <asm/mmu.h> | ||
| 13 | #include <asm/cputable.h> | ||
| 14 | #include <asm-generic/mm_hooks.h> | ||
| 15 | 209 | ||
| 16 | /* | 210 | /* |
| 17 | * Copyright (C) 2001 PPC 64 Team, IBM Corp | 211 | * Copyright (C) 2001 PPC 64 Team, IBM Corp |
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h index b85df45b1a84..15f650f987e7 100644 --- a/include/asm-powerpc/mpc86xx.h +++ b/include/asm-powerpc/mpc86xx.h | |||
| @@ -19,12 +19,6 @@ | |||
| 19 | 19 | ||
| 20 | #ifdef CONFIG_PPC_86xx | 20 | #ifdef CONFIG_PPC_86xx |
| 21 | 21 | ||
| 22 | #define _IO_BASE isa_io_base | ||
| 23 | #define _ISA_MEM_BASE isa_mem_base | ||
| 24 | #ifdef CONFIG_PCI | ||
| 25 | #define PCI_DRAM_OFFSET pci_dram_offset | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #define CPU0_BOOT_RELEASE 0x01000000 | 22 | #define CPU0_BOOT_RELEASE 0x01000000 |
| 29 | #define CPU1_BOOT_RELEASE 0x02000000 | 23 | #define CPU1_BOOT_RELEASE 0x02000000 |
| 30 | #define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE) | 24 | #define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE) |
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h index 580371120e1a..2be014b6f57c 100644 --- a/include/asm-powerpc/mpc8xx.h +++ b/include/asm-powerpc/mpc8xx.h | |||
| @@ -23,6 +23,10 @@ | |||
| 23 | #include <platforms/8xx/mpc885ads.h> | 23 | #include <platforms/8xx/mpc885ads.h> |
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_PCMCIA_M8XX | ||
| 27 | extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; | ||
| 28 | #endif | ||
| 29 | |||
| 26 | #endif /* CONFIG_8xx */ | 30 | #endif /* CONFIG_8xx */ |
| 27 | #endif /* __CONFIG_8xx_DEFS */ | 31 | #endif /* __CONFIG_8xx_DEFS */ |
| 28 | #endif /* __KERNEL__ */ | 32 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index d9bf5aba96cb..e72c2a60853c 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
| @@ -2,12 +2,91 @@ | |||
| 2 | #define _ASM_POWERPC_PCI_BRIDGE_H | 2 | #define _ASM_POWERPC_PCI_BRIDGE_H |
| 3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
| 4 | 4 | ||
| 5 | #include <linux/pci.h> | ||
| 6 | #include <linux/list.h> | ||
| 7 | #include <linux/ioport.h> | ||
| 8 | |||
| 5 | #ifndef CONFIG_PPC64 | 9 | #ifndef CONFIG_PPC64 |
| 6 | #include <asm-ppc/pci-bridge.h> | 10 | |
| 11 | struct device_node; | ||
| 12 | struct pci_controller; | ||
| 13 | |||
| 14 | /* | ||
| 15 | * Structure of a PCI controller (host bridge) | ||
| 16 | */ | ||
| 17 | struct pci_controller { | ||
| 18 | struct pci_bus *bus; | ||
| 19 | char is_dynamic; | ||
| 20 | void *arch_data; | ||
| 21 | struct list_head list_node; | ||
| 22 | struct device *parent; | ||
| 23 | |||
| 24 | int first_busno; | ||
| 25 | int last_busno; | ||
| 26 | int self_busno; | ||
| 27 | |||
| 28 | void __iomem *io_base_virt; | ||
| 29 | resource_size_t io_base_phys; | ||
| 30 | |||
| 31 | /* Some machines (PReP) have a non 1:1 mapping of | ||
| 32 | * the PCI memory space in the CPU bus space | ||
| 33 | */ | ||
| 34 | resource_size_t pci_mem_offset; | ||
| 35 | |||
| 36 | struct pci_ops *ops; | ||
| 37 | volatile unsigned int __iomem *cfg_addr; | ||
| 38 | volatile void __iomem *cfg_data; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Used for variants of PCI indirect handling and possible quirks: | ||
| 42 | * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1 | ||
| 43 | * EXT_REG - provides access to PCI-e extended registers | ||
| 44 | * SURPRESS_PRIMARY_BUS - we surpress the setting of PCI_PRIMARY_BUS | ||
| 45 | * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS | ||
| 46 | * to determine which bus number to match on when generating type0 | ||
| 47 | * config cycles | ||
| 48 | */ | ||
| 49 | #define PPC_INDIRECT_TYPE_SET_CFG_TYPE (0x00000001) | ||
| 50 | #define PPC_INDIRECT_TYPE_EXT_REG (0x00000002) | ||
| 51 | #define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004) | ||
| 52 | u32 indirect_type; | ||
| 53 | |||
| 54 | /* Currently, we limit ourselves to 1 IO range and 3 mem | ||
| 55 | * ranges since the common pci_bus structure can't handle more | ||
| 56 | */ | ||
| 57 | struct resource io_resource; | ||
| 58 | struct resource mem_resources[3]; | ||
| 59 | int global_number; /* PCI domain number */ | ||
| 60 | }; | ||
| 61 | |||
| 62 | static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | ||
| 63 | { | ||
| 64 | return bus->sysdata; | ||
| 65 | } | ||
| 66 | |||
| 67 | /* These are used for config access before all the PCI probing | ||
| 68 | has been done. */ | ||
| 69 | int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, | ||
| 70 | int where, u8 *val); | ||
| 71 | int early_read_config_word(struct pci_controller *hose, int bus, int dev_fn, | ||
| 72 | int where, u16 *val); | ||
| 73 | int early_read_config_dword(struct pci_controller *hose, int bus, int dev_fn, | ||
| 74 | int where, u32 *val); | ||
| 75 | int early_write_config_byte(struct pci_controller *hose, int bus, int dev_fn, | ||
| 76 | int where, u8 val); | ||
| 77 | int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn, | ||
| 78 | int where, u16 val); | ||
| 79 | int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn, | ||
| 80 | int where, u32 val); | ||
| 81 | |||
| 82 | extern void setup_indirect_pci_nomap(struct pci_controller* hose, | ||
| 83 | void __iomem *cfg_addr, void __iomem *cfg_data); | ||
| 84 | extern void setup_indirect_pci(struct pci_controller* hose, | ||
| 85 | u32 cfg_addr, u32 cfg_data); | ||
| 86 | extern void setup_grackle(struct pci_controller *hose); | ||
| 87 | |||
| 7 | #else | 88 | #else |
| 8 | 89 | ||
| 9 | #include <linux/pci.h> | ||
| 10 | #include <linux/list.h> | ||
| 11 | 90 | ||
| 12 | /* | 91 | /* |
| 13 | * This program is free software; you can redistribute it and/or | 92 | * This program is free software; you can redistribute it and/or |
| @@ -31,6 +110,7 @@ struct pci_controller { | |||
| 31 | int last_busno; | 110 | int last_busno; |
| 32 | 111 | ||
| 33 | void __iomem *io_base_virt; | 112 | void __iomem *io_base_virt; |
| 113 | void *io_base_alloc; | ||
| 34 | resource_size_t io_base_phys; | 114 | resource_size_t io_base_phys; |
| 35 | 115 | ||
| 36 | /* Some machines have a non 1:1 mapping of | 116 | /* Some machines have a non 1:1 mapping of |
| @@ -48,8 +128,7 @@ struct pci_controller { | |||
| 48 | */ | 128 | */ |
| 49 | struct resource io_resource; | 129 | struct resource io_resource; |
| 50 | struct resource mem_resources[3]; | 130 | struct resource mem_resources[3]; |
| 51 | int global_number; | 131 | int global_number; |
| 52 | int local_number; | ||
| 53 | unsigned long buid; | 132 | unsigned long buid; |
| 54 | unsigned long dma_window_base_cur; | 133 | unsigned long dma_window_base_cur; |
| 55 | unsigned long dma_window_size; | 134 | unsigned long dma_window_size; |
| @@ -70,19 +149,22 @@ struct pci_dn { | |||
| 70 | int devfn; /* pci device and function number */ | 149 | int devfn; /* pci device and function number */ |
| 71 | int class_code; /* pci device class */ | 150 | int class_code; /* pci device class */ |
| 72 | 151 | ||
| 73 | #ifdef CONFIG_PPC_PSERIES | 152 | struct pci_controller *phb; /* for pci devices */ |
| 153 | struct iommu_table *iommu_table; /* for phb's or bridges */ | ||
| 154 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | ||
| 155 | struct device_node *node; /* back-pointer to the device_node */ | ||
| 156 | |||
| 157 | int pci_ext_config_space; /* for pci devices */ | ||
| 158 | |||
| 159 | #ifdef CONFIG_EEH | ||
| 74 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ | 160 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ |
| 75 | int eeh_config_addr; | 161 | int eeh_config_addr; |
| 76 | int eeh_pe_config_addr; /* new-style partition endpoint address */ | 162 | int eeh_pe_config_addr; /* new-style partition endpoint address */ |
| 77 | int eeh_check_count; /* # times driver ignored error */ | 163 | int eeh_check_count; /* # times driver ignored error */ |
| 78 | int eeh_freeze_count; /* # times this device froze up. */ | 164 | int eeh_freeze_count; /* # times this device froze up. */ |
| 79 | #endif | 165 | int eeh_false_positives; /* # times this device reported #ff's */ |
| 80 | int pci_ext_config_space; /* for pci devices */ | ||
| 81 | struct pci_controller *phb; /* for pci devices */ | ||
| 82 | struct iommu_table *iommu_table; /* for phb's or bridges */ | ||
| 83 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | ||
| 84 | struct device_node *node; /* back-pointer to the device_node */ | ||
| 85 | u32 config_space[16]; /* saved PCI config space */ | 166 | u32 config_space[16]; /* saved PCI config space */ |
| 167 | #endif | ||
| 86 | }; | 168 | }; |
| 87 | 169 | ||
| 88 | /* Get the pointer to a device_node's pci_dn */ | 170 | /* Get the pointer to a device_node's pci_dn */ |
| @@ -128,9 +210,6 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) | |||
| 128 | /** Find the bus corresponding to the indicated device node */ | 210 | /** Find the bus corresponding to the indicated device node */ |
| 129 | struct pci_bus * pcibios_find_pci_bus(struct device_node *dn); | 211 | struct pci_bus * pcibios_find_pci_bus(struct device_node *dn); |
| 130 | 212 | ||
| 131 | extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, | ||
| 132 | struct device_node *dev, int primary); | ||
| 133 | |||
| 134 | /** Remove all of the PCI devices under this bus */ | 213 | /** Remove all of the PCI devices under this bus */ |
| 135 | void pcibios_remove_pci_devices(struct pci_bus *bus); | 214 | void pcibios_remove_pci_devices(struct pci_bus *bus); |
| 136 | 215 | ||
| @@ -148,13 +227,38 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | |||
| 148 | return PCI_DN(busdn)->phb; | 227 | return PCI_DN(busdn)->phb; |
| 149 | } | 228 | } |
| 150 | 229 | ||
| 230 | extern void pcibios_free_controller(struct pci_controller *phb); | ||
| 231 | |||
| 232 | extern void isa_bridge_find_early(struct pci_controller *hose); | ||
| 233 | |||
| 234 | extern int pcibios_unmap_io_space(struct pci_bus *bus); | ||
| 235 | extern int pcibios_map_io_space(struct pci_bus *bus); | ||
| 236 | |||
| 237 | /* Return values for ppc_md.pci_probe_mode function */ | ||
| 238 | #define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ | ||
| 239 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ | ||
| 240 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ | ||
| 241 | |||
| 242 | #ifdef CONFIG_NUMA | ||
| 243 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE)) | ||
| 244 | #else | ||
| 245 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1) | ||
| 246 | #endif | ||
| 247 | |||
| 248 | #endif /* CONFIG_PPC64 */ | ||
| 249 | |||
| 250 | /* Get the PCI host controller for an OF device */ | ||
| 151 | extern struct pci_controller* | 251 | extern struct pci_controller* |
| 152 | pci_find_hose_for_OF_device(struct device_node* node); | 252 | pci_find_hose_for_OF_device(struct device_node* node); |
| 153 | 253 | ||
| 254 | /* Fill up host controller resources from the OF node */ | ||
| 255 | extern void | ||
| 256 | pci_process_bridge_OF_ranges(struct pci_controller *hose, | ||
| 257 | struct device_node *dev, int primary); | ||
| 258 | |||
| 259 | /* Allocate a new PCI host bridge structure */ | ||
| 154 | extern struct pci_controller * | 260 | extern struct pci_controller * |
| 155 | pcibios_alloc_controller(struct device_node *dev); | 261 | pcibios_alloc_controller(struct device_node *dev); |
| 156 | extern void pcibios_free_controller(struct pci_controller *phb); | ||
| 157 | |||
| 158 | #ifdef CONFIG_PCI | 262 | #ifdef CONFIG_PCI |
| 159 | extern unsigned long pci_address_to_pio(phys_addr_t address); | 263 | extern unsigned long pci_address_to_pio(phys_addr_t address); |
| 160 | #else | 264 | #else |
| @@ -164,17 +268,7 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address) | |||
| 164 | } | 268 | } |
| 165 | #endif | 269 | #endif |
| 166 | 270 | ||
| 167 | /* Return values for ppc_md.pci_probe_mode function */ | ||
| 168 | #define PCI_PROBE_NONE -1 /* Don't look at this bus at all */ | ||
| 169 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ | ||
| 170 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ | ||
| 171 | 271 | ||
| 172 | #ifdef CONFIG_NUMA | ||
| 173 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE)) | ||
| 174 | #else | ||
| 175 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1) | ||
| 176 | #endif | ||
| 177 | 272 | ||
| 178 | #endif /* CONFIG_PPC64 */ | ||
| 179 | #endif /* __KERNEL__ */ | 273 | #endif /* __KERNEL__ */ |
| 180 | #endif | 274 | #endif |
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h index e16e7bc9ab5c..7b11765c6865 100644 --- a/include/asm-powerpc/pci.h +++ b/include/asm-powerpc/pci.h | |||
| @@ -95,8 +95,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
| 95 | #define get_pci_dma_ops() NULL | 95 | #define get_pci_dma_ops() NULL |
| 96 | #endif | 96 | #endif |
| 97 | 97 | ||
| 98 | extern int pci_domain_nr(struct pci_bus *bus); | ||
| 99 | |||
| 100 | /* Decide whether to display the domain number in /proc */ | 98 | /* Decide whether to display the domain number in /proc */ |
| 101 | extern int pci_proc_domain(struct pci_bus *bus); | 99 | extern int pci_proc_domain(struct pci_bus *bus); |
| 102 | 100 | ||
| @@ -112,9 +110,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
| 112 | } | 110 | } |
| 113 | #endif | 111 | #endif |
| 114 | 112 | ||
| 115 | /* Return the index of the PCI controller for device PDEV. */ | ||
| 116 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | ||
| 117 | |||
| 118 | /* Set the name of the bus as it appears in /proc/bus/pci */ | 113 | /* Set the name of the bus as it appears in /proc/bus/pci */ |
| 119 | static inline int pci_proc_domain(struct pci_bus *bus) | 114 | static inline int pci_proc_domain(struct pci_bus *bus) |
| 120 | { | 115 | { |
| @@ -123,6 +118,8 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
| 123 | 118 | ||
| 124 | #endif /* CONFIG_PPC64 */ | 119 | #endif /* CONFIG_PPC64 */ |
| 125 | 120 | ||
| 121 | extern int pci_domain_nr(struct pci_bus *bus); | ||
| 122 | |||
| 126 | struct vm_area_struct; | 123 | struct vm_area_struct; |
| 127 | /* Map a range of PCI memory or I/O space for a device into user space */ | 124 | /* Map a range of PCI memory or I/O space for a device into user space */ |
| 128 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | 125 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, |
| @@ -202,10 +199,6 @@ static inline struct resource *pcibios_select_root(struct pci_dev *pdev, | |||
| 202 | return root; | 199 | return root; |
| 203 | } | 200 | } |
| 204 | 201 | ||
| 205 | extern int unmap_bus_range(struct pci_bus *bus); | ||
| 206 | |||
| 207 | extern int remap_bus_range(struct pci_bus *bus); | ||
| 208 | |||
| 209 | extern void pcibios_fixup_device_resources(struct pci_dev *dev, | 202 | extern void pcibios_fixup_device_resources(struct pci_dev *dev, |
| 210 | struct pci_bus *bus); | 203 | struct pci_bus *bus); |
| 211 | 204 | ||
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h index 7fb730c62f83..86a54a4a8a2a 100644 --- a/include/asm-powerpc/pgtable-ppc32.h +++ b/include/asm-powerpc/pgtable-ppc32.h | |||
| @@ -6,11 +6,7 @@ | |||
| 6 | #ifndef __ASSEMBLY__ | 6 | #ifndef __ASSEMBLY__ |
| 7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
| 8 | #include <linux/threads.h> | 8 | #include <linux/threads.h> |
| 9 | #include <asm/processor.h> /* For TASK_SIZE */ | ||
| 10 | #include <asm/mmu.h> | ||
| 11 | #include <asm/page.h> | ||
| 12 | #include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */ | 9 | #include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */ |
| 13 | struct mm_struct; | ||
| 14 | 10 | ||
| 15 | extern unsigned long va_to_phys(unsigned long address); | 11 | extern unsigned long va_to_phys(unsigned long address); |
| 16 | extern pte_t *va_to_pte(unsigned long address); | 12 | extern pte_t *va_to_pte(unsigned long address); |
| @@ -488,14 +484,6 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void); | |||
| 488 | #define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\ | 484 | #define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\ |
| 489 | pgprot_val(prot)) | 485 | pgprot_val(prot)) |
| 490 | #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) | 486 | #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) |
| 491 | |||
| 492 | /* | ||
| 493 | * ZERO_PAGE is a global shared page that is always zero: used | ||
| 494 | * for zero-mapped memory areas etc.. | ||
| 495 | */ | ||
| 496 | extern unsigned long empty_zero_page[1024]; | ||
| 497 | #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) | ||
| 498 | |||
| 499 | #endif /* __ASSEMBLY__ */ | 487 | #endif /* __ASSEMBLY__ */ |
| 500 | 488 | ||
| 501 | #define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0) | 489 | #define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0) |
| @@ -512,9 +500,7 @@ extern unsigned long empty_zero_page[1024]; | |||
| 512 | * The following only work if pte_present() is true. | 500 | * The following only work if pte_present() is true. |
| 513 | * Undefined behaviour if not.. | 501 | * Undefined behaviour if not.. |
| 514 | */ | 502 | */ |
| 515 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | ||
| 516 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 503 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
| 517 | static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; } | ||
| 518 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 504 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
| 519 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 505 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 520 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 506 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| @@ -522,21 +508,13 @@ static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | |||
| 522 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } | 508 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } |
| 523 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } | 509 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } |
| 524 | 510 | ||
| 525 | static inline pte_t pte_rdprotect(pte_t pte) { | ||
| 526 | pte_val(pte) &= ~_PAGE_USER; return pte; } | ||
| 527 | static inline pte_t pte_wrprotect(pte_t pte) { | 511 | static inline pte_t pte_wrprotect(pte_t pte) { |
| 528 | pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; } | 512 | pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; } |
| 529 | static inline pte_t pte_exprotect(pte_t pte) { | ||
| 530 | pte_val(pte) &= ~_PAGE_EXEC; return pte; } | ||
| 531 | static inline pte_t pte_mkclean(pte_t pte) { | 513 | static inline pte_t pte_mkclean(pte_t pte) { |
| 532 | pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } | 514 | pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } |
| 533 | static inline pte_t pte_mkold(pte_t pte) { | 515 | static inline pte_t pte_mkold(pte_t pte) { |
| 534 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } | 516 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } |
| 535 | 517 | ||
| 536 | static inline pte_t pte_mkread(pte_t pte) { | ||
| 537 | pte_val(pte) |= _PAGE_USER; return pte; } | ||
| 538 | static inline pte_t pte_mkexec(pte_t pte) { | ||
| 539 | pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; } | ||
| 540 | static inline pte_t pte_mkwrite(pte_t pte) { | 518 | static inline pte_t pte_mkwrite(pte_t pte) { |
| 541 | pte_val(pte) |= _PAGE_RW; return pte; } | 519 | pte_val(pte) |= _PAGE_RW; return pte; } |
| 542 | static inline pte_t pte_mkdirty(pte_t pte) { | 520 | static inline pte_t pte_mkdirty(pte_t pte) { |
| @@ -643,13 +621,6 @@ static inline int __ptep_test_and_clear_young(unsigned int context, unsigned lon | |||
| 643 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ | 621 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ |
| 644 | __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) | 622 | __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) |
| 645 | 623 | ||
| 646 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 647 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, | ||
| 648 | unsigned long addr, pte_t *ptep) | ||
| 649 | { | ||
| 650 | return (pte_update(ptep, (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0; | ||
| 651 | } | ||
| 652 | |||
| 653 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 624 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 654 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | 625 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, |
| 655 | pte_t *ptep) | 626 | pte_t *ptep) |
| @@ -734,10 +705,6 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | |||
| 734 | #define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0) | 705 | #define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0) |
| 735 | #define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1) | 706 | #define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1) |
| 736 | 707 | ||
| 737 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | ||
| 738 | |||
| 739 | extern void paging_init(void); | ||
| 740 | |||
| 741 | /* | 708 | /* |
| 742 | * Encode and decode a swap entry. | 709 | * Encode and decode a swap entry. |
| 743 | * Note that the bits we use in a PTE for representing a swap entry | 710 | * Note that the bits we use in a PTE for representing a swap entry |
| @@ -755,40 +722,6 @@ extern void paging_init(void); | |||
| 755 | #define pte_to_pgoff(pte) (pte_val(pte) >> 3) | 722 | #define pte_to_pgoff(pte) (pte_val(pte) >> 3) |
| 756 | #define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE }) | 723 | #define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE }) |
| 757 | 724 | ||
| 758 | /* CONFIG_APUS */ | ||
| 759 | /* For virtual address to physical address conversion */ | ||
| 760 | extern void cache_clear(__u32 addr, int length); | ||
| 761 | extern void cache_push(__u32 addr, int length); | ||
| 762 | extern int mm_end_of_chunk (unsigned long addr, int len); | ||
| 763 | extern unsigned long iopa(unsigned long addr); | ||
| 764 | extern unsigned long mm_ptov(unsigned long addr) __attribute_const__; | ||
| 765 | |||
| 766 | /* Values for nocacheflag and cmode */ | ||
| 767 | /* These are not used by the APUS kernel_map, but prevents | ||
| 768 | compilation errors. */ | ||
| 769 | #define KERNELMAP_FULL_CACHING 0 | ||
| 770 | #define KERNELMAP_NOCACHE_SER 1 | ||
| 771 | #define KERNELMAP_NOCACHE_NONSER 2 | ||
| 772 | #define KERNELMAP_NO_COPYBACK 3 | ||
| 773 | |||
| 774 | /* | ||
| 775 | * Map some physical address range into the kernel address space. | ||
| 776 | */ | ||
| 777 | extern unsigned long kernel_map(unsigned long paddr, unsigned long size, | ||
| 778 | int nocacheflag, unsigned long *memavailp ); | ||
| 779 | |||
| 780 | /* | ||
| 781 | * Set cache mode of (kernel space) address range. | ||
| 782 | */ | ||
| 783 | extern void kernel_set_cachemode (unsigned long address, unsigned long size, | ||
| 784 | unsigned int cmode); | ||
| 785 | |||
| 786 | /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ | ||
| 787 | #define kern_addr_valid(addr) (1) | ||
| 788 | |||
| 789 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | ||
| 790 | remap_pfn_range(vma, vaddr, pfn, size, prot) | ||
| 791 | |||
| 792 | /* | 725 | /* |
| 793 | * No page table caches to initialise | 726 | * No page table caches to initialise |
| 794 | */ | 727 | */ |
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index 3cfd98f44bfe..300f9a199bf2 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
| @@ -7,11 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #ifndef __ASSEMBLY__ | 8 | #ifndef __ASSEMBLY__ |
| 9 | #include <linux/stddef.h> | 9 | #include <linux/stddef.h> |
| 10 | #include <asm/processor.h> /* For TASK_SIZE */ | ||
| 11 | #include <asm/mmu.h> | ||
| 12 | #include <asm/page.h> | ||
| 13 | #include <asm/tlbflush.h> | 10 | #include <asm/tlbflush.h> |
| 14 | struct mm_struct; | ||
| 15 | #endif /* __ASSEMBLY__ */ | 11 | #endif /* __ASSEMBLY__ */ |
| 16 | 12 | ||
| 17 | #ifdef CONFIG_PPC_64K_PAGES | 13 | #ifdef CONFIG_PPC_64K_PAGES |
| @@ -27,7 +23,7 @@ struct mm_struct; | |||
| 27 | */ | 23 | */ |
| 28 | #define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \ | 24 | #define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \ |
| 29 | PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT) | 25 | PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT) |
| 30 | #define PGTABLE_RANGE (1UL << PGTABLE_EADDR_SIZE) | 26 | #define PGTABLE_RANGE (ASM_CONST(1) << PGTABLE_EADDR_SIZE) |
| 31 | 27 | ||
| 32 | #if TASK_SIZE_USER64 > PGTABLE_RANGE | 28 | #if TASK_SIZE_USER64 > PGTABLE_RANGE |
| 33 | #error TASK_SIZE_USER64 exceeds pagetable range | 29 | #error TASK_SIZE_USER64 exceeds pagetable range |
| @@ -37,19 +33,28 @@ struct mm_struct; | |||
| 37 | #error TASK_SIZE_USER64 exceeds user VSID range | 33 | #error TASK_SIZE_USER64 exceeds user VSID range |
| 38 | #endif | 34 | #endif |
| 39 | 35 | ||
| 36 | |||
| 40 | /* | 37 | /* |
| 41 | * Define the address range of the vmalloc VM area. | 38 | * Define the address range of the vmalloc VM area. |
| 42 | */ | 39 | */ |
| 43 | #define VMALLOC_START ASM_CONST(0xD000000000000000) | 40 | #define VMALLOC_START ASM_CONST(0xD000000000000000) |
| 44 | #define VMALLOC_SIZE ASM_CONST(0x80000000000) | 41 | #define VMALLOC_SIZE (PGTABLE_RANGE >> 1) |
| 45 | #define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) | 42 | #define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) |
| 46 | 43 | ||
| 47 | /* | 44 | /* |
| 48 | * Define the address range of the imalloc VM area. | 45 | * Define the address ranges for MMIO and IO space : |
| 46 | * | ||
| 47 | * ISA_IO_BASE = VMALLOC_END, 64K reserved area | ||
| 48 | * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces | ||
| 49 | * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE | ||
| 49 | */ | 50 | */ |
| 50 | #define PHBS_IO_BASE VMALLOC_END | 51 | #define FULL_IO_SIZE 0x80000000ul |
| 51 | #define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */ | 52 | #define ISA_IO_BASE (VMALLOC_END) |
| 52 | #define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE) | 53 | #define ISA_IO_END (VMALLOC_END + 0x10000ul) |
| 54 | #define PHB_IO_BASE (ISA_IO_END) | ||
| 55 | #define PHB_IO_END (VMALLOC_END + FULL_IO_SIZE) | ||
| 56 | #define IOREMAP_BASE (PHB_IO_END) | ||
| 57 | #define IOREMAP_END (VMALLOC_START + PGTABLE_RANGE) | ||
| 53 | 58 | ||
| 54 | /* | 59 | /* |
| 55 | * Region IDs | 60 | * Region IDs |
| @@ -134,16 +139,6 @@ struct mm_struct; | |||
| 134 | #define __S110 PAGE_SHARED_X | 139 | #define __S110 PAGE_SHARED_X |
| 135 | #define __S111 PAGE_SHARED_X | 140 | #define __S111 PAGE_SHARED_X |
| 136 | 141 | ||
| 137 | #ifndef __ASSEMBLY__ | ||
| 138 | |||
| 139 | /* | ||
| 140 | * ZERO_PAGE is a global shared page that is always zero: used | ||
| 141 | * for zero-mapped memory areas etc.. | ||
| 142 | */ | ||
| 143 | extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)]; | ||
| 144 | #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) | ||
| 145 | #endif /* __ASSEMBLY__ */ | ||
| 146 | |||
| 147 | #ifdef CONFIG_HUGETLB_PAGE | 142 | #ifdef CONFIG_HUGETLB_PAGE |
| 148 | 143 | ||
| 149 | #define HAVE_ARCH_UNMAPPED_AREA | 144 | #define HAVE_ARCH_UNMAPPED_AREA |
| @@ -232,9 +227,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) | |||
| 232 | * The following only work if pte_present() is true. | 227 | * The following only work if pte_present() is true. |
| 233 | * Undefined behaviour if not.. | 228 | * Undefined behaviour if not.. |
| 234 | */ | 229 | */ |
| 235 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER;} | ||
| 236 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;} | 230 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;} |
| 237 | static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC;} | ||
| 238 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} | 231 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} |
| 239 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} | 232 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} |
| 240 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} | 233 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} |
| @@ -242,20 +235,12 @@ static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} | |||
| 242 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } | 235 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } |
| 243 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } | 236 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } |
| 244 | 237 | ||
| 245 | static inline pte_t pte_rdprotect(pte_t pte) { | ||
| 246 | pte_val(pte) &= ~_PAGE_USER; return pte; } | ||
| 247 | static inline pte_t pte_exprotect(pte_t pte) { | ||
| 248 | pte_val(pte) &= ~_PAGE_EXEC; return pte; } | ||
| 249 | static inline pte_t pte_wrprotect(pte_t pte) { | 238 | static inline pte_t pte_wrprotect(pte_t pte) { |
| 250 | pte_val(pte) &= ~(_PAGE_RW); return pte; } | 239 | pte_val(pte) &= ~(_PAGE_RW); return pte; } |
| 251 | static inline pte_t pte_mkclean(pte_t pte) { | 240 | static inline pte_t pte_mkclean(pte_t pte) { |
| 252 | pte_val(pte) &= ~(_PAGE_DIRTY); return pte; } | 241 | pte_val(pte) &= ~(_PAGE_DIRTY); return pte; } |
| 253 | static inline pte_t pte_mkold(pte_t pte) { | 242 | static inline pte_t pte_mkold(pte_t pte) { |
| 254 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } | 243 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } |
| 255 | static inline pte_t pte_mkread(pte_t pte) { | ||
| 256 | pte_val(pte) |= _PAGE_USER; return pte; } | ||
| 257 | static inline pte_t pte_mkexec(pte_t pte) { | ||
| 258 | pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; } | ||
| 259 | static inline pte_t pte_mkwrite(pte_t pte) { | 244 | static inline pte_t pte_mkwrite(pte_t pte) { |
| 260 | pte_val(pte) |= _PAGE_RW; return pte; } | 245 | pte_val(pte) |= _PAGE_RW; return pte; } |
| 261 | static inline pte_t pte_mkdirty(pte_t pte) { | 246 | static inline pte_t pte_mkdirty(pte_t pte) { |
| @@ -307,29 +292,6 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm, | |||
| 307 | __r; \ | 292 | __r; \ |
| 308 | }) | 293 | }) |
| 309 | 294 | ||
| 310 | /* | ||
| 311 | * On RW/DIRTY bit transitions we can avoid flushing the hpte. For the | ||
| 312 | * moment we always flush but we need to fix hpte_update and test if the | ||
| 313 | * optimisation is worth it. | ||
| 314 | */ | ||
| 315 | static inline int __ptep_test_and_clear_dirty(struct mm_struct *mm, | ||
| 316 | unsigned long addr, pte_t *ptep) | ||
| 317 | { | ||
| 318 | unsigned long old; | ||
| 319 | |||
| 320 | if ((pte_val(*ptep) & _PAGE_DIRTY) == 0) | ||
| 321 | return 0; | ||
| 322 | old = pte_update(mm, addr, ptep, _PAGE_DIRTY, 0); | ||
| 323 | return (old & _PAGE_DIRTY) != 0; | ||
| 324 | } | ||
| 325 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 326 | #define ptep_test_and_clear_dirty(__vma, __addr, __ptep) \ | ||
| 327 | ({ \ | ||
| 328 | int __r; \ | ||
| 329 | __r = __ptep_test_and_clear_dirty((__vma)->vm_mm, __addr, __ptep); \ | ||
| 330 | __r; \ | ||
| 331 | }) | ||
| 332 | |||
| 333 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 295 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
| 334 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | 296 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, |
| 335 | pte_t *ptep) | 297 | pte_t *ptep) |
| @@ -357,14 +319,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
| 357 | __young; \ | 319 | __young; \ |
| 358 | }) | 320 | }) |
| 359 | 321 | ||
| 360 | #define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH | ||
| 361 | #define ptep_clear_flush_dirty(__vma, __address, __ptep) \ | ||
| 362 | ({ \ | ||
| 363 | int __dirty = __ptep_test_and_clear_dirty((__vma)->vm_mm, __address, \ | ||
| 364 | __ptep); \ | ||
| 365 | __dirty; \ | ||
| 366 | }) | ||
| 367 | |||
| 368 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 322 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 369 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, | 323 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, |
| 370 | unsigned long addr, pte_t *ptep) | 324 | unsigned long addr, pte_t *ptep) |
| @@ -442,10 +396,6 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | |||
| 442 | #define pgd_ERROR(e) \ | 396 | #define pgd_ERROR(e) \ |
| 443 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) | 397 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) |
| 444 | 398 | ||
| 445 | extern pgd_t swapper_pg_dir[]; | ||
| 446 | |||
| 447 | extern void paging_init(void); | ||
| 448 | |||
| 449 | /* Encode and de-code a swap entry */ | 399 | /* Encode and de-code a swap entry */ |
| 450 | #define __swp_type(entry) (((entry).val >> 1) & 0x3f) | 400 | #define __swp_type(entry) (((entry).val >> 1) & 0x3f) |
| 451 | #define __swp_offset(entry) ((entry).val >> 8) | 401 | #define __swp_offset(entry) ((entry).val >> 8) |
| @@ -456,17 +406,6 @@ extern void paging_init(void); | |||
| 456 | #define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE}) | 406 | #define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE}) |
| 457 | #define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT) | 407 | #define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT) |
| 458 | 408 | ||
| 459 | /* | ||
| 460 | * kern_addr_valid is intended to indicate whether an address is a valid | ||
| 461 | * kernel address. Most 32-bit archs define it as always true (like this) | ||
| 462 | * but most 64-bit archs actually perform a test. What should we do here? | ||
| 463 | * The only use is in fs/ncpfs/dir.c | ||
| 464 | */ | ||
| 465 | #define kern_addr_valid(addr) (1) | ||
| 466 | |||
| 467 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | ||
| 468 | remap_pfn_range(vma, vaddr, pfn, size, prot) | ||
| 469 | |||
| 470 | void pgtable_cache_init(void); | 409 | void pgtable_cache_init(void); |
| 471 | 410 | ||
| 472 | /* | 411 | /* |
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h index 78bf4ae712a6..d18ffe7bc7c4 100644 --- a/include/asm-powerpc/pgtable.h +++ b/include/asm-powerpc/pgtable.h | |||
| @@ -2,6 +2,13 @@ | |||
| 2 | #define _ASM_POWERPC_PGTABLE_H | 2 | #define _ASM_POWERPC_PGTABLE_H |
| 3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
| 4 | 4 | ||
| 5 | #ifndef __ASSEMBLY__ | ||
| 6 | #include <asm/processor.h> /* For TASK_SIZE */ | ||
| 7 | #include <asm/mmu.h> | ||
| 8 | #include <asm/page.h> | ||
| 9 | struct mm_struct; | ||
| 10 | #endif /* !__ASSEMBLY__ */ | ||
| 11 | |||
| 5 | #if defined(CONFIG_PPC64) | 12 | #if defined(CONFIG_PPC64) |
| 6 | # include <asm/pgtable-ppc64.h> | 13 | # include <asm/pgtable-ppc64.h> |
| 7 | #else | 14 | #else |
| @@ -9,6 +16,27 @@ | |||
| 9 | #endif | 16 | #endif |
| 10 | 17 | ||
| 11 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
| 19 | /* | ||
| 20 | * ZERO_PAGE is a global shared page that is always zero: used | ||
| 21 | * for zero-mapped memory areas etc.. | ||
| 22 | */ | ||
| 23 | extern unsigned long empty_zero_page[]; | ||
| 24 | #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) | ||
| 25 | |||
| 26 | extern pgd_t swapper_pg_dir[]; | ||
| 27 | |||
| 28 | extern void paging_init(void); | ||
| 29 | |||
| 30 | /* | ||
| 31 | * kern_addr_valid is intended to indicate whether an address is a valid | ||
| 32 | * kernel address. Most 32-bit archs define it as always true (like this) | ||
| 33 | * but most 64-bit archs actually perform a test. What should we do here? | ||
| 34 | */ | ||
| 35 | #define kern_addr_valid(addr) (1) | ||
| 36 | |||
| 37 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | ||
| 38 | remap_pfn_range(vma, vaddr, pfn, size, prot) | ||
| 39 | |||
| 12 | #include <asm-generic/pgtable.h> | 40 | #include <asm-generic/pgtable.h> |
| 13 | #endif /* __ASSEMBLY__ */ | 41 | #endif /* __ASSEMBLY__ */ |
| 14 | 42 | ||
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h index 8e2005159ffd..b847aa10074b 100644 --- a/include/asm-powerpc/ppc-pci.h +++ b/include/asm-powerpc/ppc-pci.h | |||
| @@ -26,7 +26,7 @@ extern int global_phb_number; | |||
| 26 | 26 | ||
| 27 | extern void find_and_init_phbs(void); | 27 | extern void find_and_init_phbs(void); |
| 28 | 28 | ||
| 29 | extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */ | 29 | extern struct pci_dev *isa_bridge_pcidev; /* may be NULL if no ISA bus */ |
| 30 | 30 | ||
| 31 | /** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */ | 31 | /** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */ |
| 32 | #define BUID_HI(buid) ((buid) >> 32) | 32 | #define BUID_HI(buid) ((buid) >> 32) |
| @@ -47,8 +47,8 @@ extern void init_pci_config_tokens (void); | |||
| 47 | extern unsigned long get_phb_buid (struct device_node *); | 47 | extern unsigned long get_phb_buid (struct device_node *); |
| 48 | extern int rtas_setup_phb(struct pci_controller *phb); | 48 | extern int rtas_setup_phb(struct pci_controller *phb); |
| 49 | 49 | ||
| 50 | /* From pSeries_pci.h */ | 50 | /* From iSeries PCI */ |
| 51 | extern void pSeries_final_fixup(void); | 51 | extern void iSeries_pcibios_init(void); |
| 52 | 52 | ||
| 53 | extern unsigned long pci_probe_only; | 53 | extern unsigned long pci_probe_only; |
| 54 | 54 | ||
| @@ -139,6 +139,9 @@ void eeh_clear_slot (struct device_node *dn, int mode_flag); | |||
| 139 | */ | 139 | */ |
| 140 | struct device_node * find_device_pe(struct device_node *dn); | 140 | struct device_node * find_device_pe(struct device_node *dn); |
| 141 | 141 | ||
| 142 | void eeh_sysfs_add_device(struct pci_dev *pdev); | ||
| 143 | void eeh_sysfs_remove_device(struct pci_dev *pdev); | ||
| 144 | |||
| 142 | #endif /* CONFIG_EEH */ | 145 | #endif /* CONFIG_EEH */ |
| 143 | 146 | ||
| 144 | #else /* CONFIG_PCI */ | 147 | #else /* CONFIG_PCI */ |
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index d947b1609491..e28b10805159 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
| @@ -43,14 +43,6 @@ extern int _chrp_type; | |||
| 43 | /* what kind of prep workstation we are */ | 43 | /* what kind of prep workstation we are */ |
| 44 | extern int _prep_type; | 44 | extern int _prep_type; |
| 45 | 45 | ||
| 46 | /* | ||
| 47 | * This is used to identify the board type from a given PReP board | ||
| 48 | * vendor. Board revision is also made available. This will be moved | ||
| 49 | * elsewhere soon | ||
| 50 | */ | ||
| 51 | extern unsigned char ucBoardRev; | ||
| 52 | extern unsigned char ucBoardRevMaj, ucBoardRevMin; | ||
| 53 | |||
| 54 | #endif /* CONFIG_PPC_PREP */ | 46 | #endif /* CONFIG_PPC_PREP */ |
| 55 | 47 | ||
| 56 | #endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */ | 48 | #endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */ |
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 6845af93ba91..1632baa17dc6 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
| @@ -98,10 +98,19 @@ struct device_node { | |||
| 98 | extern struct device_node *of_chosen; | 98 | extern struct device_node *of_chosen; |
| 99 | 99 | ||
| 100 | /* flag descriptions */ | 100 | /* flag descriptions */ |
| 101 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | 101 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ |
| 102 | #define OF_DETACHED 2 /* node has been detached from the device tree */ | ||
| 103 | |||
| 104 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | ||
| 105 | { | ||
| 106 | return test_bit(flag, &n->_flags); | ||
| 107 | } | ||
| 108 | |||
| 109 | static inline void of_node_set_flag(struct device_node *n, unsigned long flag) | ||
| 110 | { | ||
| 111 | set_bit(flag, &n->_flags); | ||
| 112 | } | ||
| 102 | 113 | ||
| 103 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
| 104 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
| 105 | 114 | ||
| 106 | #define HAVE_ARCH_DEVTREE_FIXUPS | 115 | #define HAVE_ARCH_DEVTREE_FIXUPS |
| 107 | 116 | ||
| @@ -124,6 +133,9 @@ extern struct device_node *of_find_node_by_type(struct device_node *from, | |||
| 124 | dn = of_find_node_by_type(dn, type)) | 133 | dn = of_find_node_by_type(dn, type)) |
| 125 | extern struct device_node *of_find_compatible_node(struct device_node *from, | 134 | extern struct device_node *of_find_compatible_node(struct device_node *from, |
| 126 | const char *type, const char *compat); | 135 | const char *type, const char *compat); |
| 136 | #define for_each_compatible_node(dn, type, compatible) \ | ||
| 137 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ | ||
| 138 | dn = of_find_compatible_node(dn, type, compatible)) | ||
| 127 | extern struct device_node *of_find_node_by_path(const char *path); | 139 | extern struct device_node *of_find_node_by_path(const char *path); |
| 128 | extern struct device_node *of_find_node_by_phandle(phandle handle); | 140 | extern struct device_node *of_find_node_by_phandle(phandle handle); |
| 129 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | 141 | extern struct device_node *of_find_all_nodes(struct device_node *prev); |
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index 1e04651eedc4..a6f3f5ee7ca7 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h | |||
| @@ -35,7 +35,8 @@ union ps3_firmware_version { | |||
| 35 | }; | 35 | }; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | int ps3_get_firmware_version(union ps3_firmware_version *v); | 38 | void ps3_get_firmware_version(union ps3_firmware_version *v); |
| 39 | int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev); | ||
| 39 | 40 | ||
| 40 | /* 'Other OS' area */ | 41 | /* 'Other OS' area */ |
| 41 | 42 | ||
| @@ -48,18 +49,6 @@ enum ps3_param_av_multi_out { | |||
| 48 | 49 | ||
| 49 | enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); | 50 | enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); |
| 50 | 51 | ||
| 51 | /** | ||
| 52 | * struct ps3_device_id - HV bus device identifier from the system repository | ||
| 53 | * @bus_id: HV bus id, {1..} (zero invalid) | ||
| 54 | * @dev_id: HV device id, {0..} | ||
| 55 | */ | ||
| 56 | |||
| 57 | struct ps3_device_id { | ||
| 58 | unsigned int bus_id; | ||
| 59 | unsigned int dev_id; | ||
| 60 | }; | ||
| 61 | |||
| 62 | |||
| 63 | /* dma routines */ | 52 | /* dma routines */ |
| 64 | 53 | ||
| 65 | enum ps3_dma_page_size { | 54 | enum ps3_dma_page_size { |
| @@ -74,6 +63,8 @@ enum ps3_dma_region_type { | |||
| 74 | PS3_DMA_INTERNAL = 2, | 63 | PS3_DMA_INTERNAL = 2, |
| 75 | }; | 64 | }; |
| 76 | 65 | ||
| 66 | struct ps3_dma_region_ops; | ||
| 67 | |||
| 77 | /** | 68 | /** |
| 78 | * struct ps3_dma_region - A per device dma state variables structure | 69 | * struct ps3_dma_region - A per device dma state variables structure |
| 79 | * @did: The HV device id. | 70 | * @did: The HV device id. |
| @@ -81,21 +72,42 @@ enum ps3_dma_region_type { | |||
| 81 | * @region_type: The HV region type. | 72 | * @region_type: The HV region type. |
| 82 | * @bus_addr: The 'translated' bus address of the region. | 73 | * @bus_addr: The 'translated' bus address of the region. |
| 83 | * @len: The length in bytes of the region. | 74 | * @len: The length in bytes of the region. |
| 75 | * @offset: The offset from the start of memory of the region. | ||
| 76 | * @ioid: The IOID of the device who owns this region | ||
| 84 | * @chunk_list: Opaque variable used by the ioc page manager. | 77 | * @chunk_list: Opaque variable used by the ioc page manager. |
| 78 | * @region_ops: struct ps3_dma_region_ops - dma region operations | ||
| 85 | */ | 79 | */ |
| 86 | 80 | ||
| 87 | struct ps3_dma_region { | 81 | struct ps3_dma_region { |
| 88 | struct ps3_device_id did; | 82 | struct ps3_system_bus_device *dev; |
| 83 | /* device variables */ | ||
| 84 | const struct ps3_dma_region_ops *region_ops; | ||
| 85 | unsigned char ioid; | ||
| 89 | enum ps3_dma_page_size page_size; | 86 | enum ps3_dma_page_size page_size; |
| 90 | enum ps3_dma_region_type region_type; | 87 | enum ps3_dma_region_type region_type; |
| 91 | unsigned long bus_addr; | ||
| 92 | unsigned long len; | 88 | unsigned long len; |
| 89 | unsigned long offset; | ||
| 90 | |||
| 91 | /* driver variables (set by ps3_dma_region_create) */ | ||
| 92 | unsigned long bus_addr; | ||
| 93 | struct { | 93 | struct { |
| 94 | spinlock_t lock; | 94 | spinlock_t lock; |
| 95 | struct list_head head; | 95 | struct list_head head; |
| 96 | } chunk_list; | 96 | } chunk_list; |
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | struct ps3_dma_region_ops { | ||
| 100 | int (*create)(struct ps3_dma_region *); | ||
| 101 | int (*free)(struct ps3_dma_region *); | ||
| 102 | int (*map)(struct ps3_dma_region *, | ||
| 103 | unsigned long virt_addr, | ||
| 104 | unsigned long len, | ||
| 105 | unsigned long *bus_addr, | ||
| 106 | u64 iopte_pp); | ||
| 107 | int (*unmap)(struct ps3_dma_region *, | ||
| 108 | unsigned long bus_addr, | ||
| 109 | unsigned long len); | ||
| 110 | }; | ||
| 99 | /** | 111 | /** |
| 100 | * struct ps3_dma_region_init - Helper to initialize structure variables | 112 | * struct ps3_dma_region_init - Helper to initialize structure variables |
| 101 | * | 113 | * |
| @@ -103,18 +115,16 @@ struct ps3_dma_region { | |||
| 103 | * ps3_system_bus_device_register. | 115 | * ps3_system_bus_device_register. |
| 104 | */ | 116 | */ |
| 105 | 117 | ||
| 106 | static inline void ps3_dma_region_init(struct ps3_dma_region *r, | 118 | struct ps3_system_bus_device; |
| 107 | const struct ps3_device_id* did, enum ps3_dma_page_size page_size, | 119 | |
| 108 | enum ps3_dma_region_type region_type) | 120 | int ps3_dma_region_init(struct ps3_system_bus_device *dev, |
| 109 | { | 121 | struct ps3_dma_region *r, enum ps3_dma_page_size page_size, |
| 110 | r->did = *did; | 122 | enum ps3_dma_region_type region_type, void *addr, unsigned long len); |
| 111 | r->page_size = page_size; | ||
| 112 | r->region_type = region_type; | ||
| 113 | } | ||
| 114 | int ps3_dma_region_create(struct ps3_dma_region *r); | 123 | int ps3_dma_region_create(struct ps3_dma_region *r); |
| 115 | int ps3_dma_region_free(struct ps3_dma_region *r); | 124 | int ps3_dma_region_free(struct ps3_dma_region *r); |
| 116 | int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, | 125 | int ps3_dma_map(struct ps3_dma_region *r, unsigned long virt_addr, |
| 117 | unsigned long len, unsigned long *bus_addr); | 126 | unsigned long len, unsigned long *bus_addr, |
| 127 | u64 iopte_pp); | ||
| 118 | int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, | 128 | int ps3_dma_unmap(struct ps3_dma_region *r, unsigned long bus_addr, |
| 119 | unsigned long len); | 129 | unsigned long len); |
| 120 | 130 | ||
| @@ -125,6 +135,7 @@ enum ps3_mmio_page_size { | |||
| 125 | PS3_MMIO_64K = 16U | 135 | PS3_MMIO_64K = 16U |
| 126 | }; | 136 | }; |
| 127 | 137 | ||
| 138 | struct ps3_mmio_region_ops; | ||
| 128 | /** | 139 | /** |
| 129 | * struct ps3_mmio_region - a per device mmio state variables structure | 140 | * struct ps3_mmio_region - a per device mmio state variables structure |
| 130 | * | 141 | * |
| @@ -132,13 +143,18 @@ enum ps3_mmio_page_size { | |||
| 132 | */ | 143 | */ |
| 133 | 144 | ||
| 134 | struct ps3_mmio_region { | 145 | struct ps3_mmio_region { |
| 135 | struct ps3_device_id did; | 146 | struct ps3_system_bus_device *dev; |
| 147 | const struct ps3_mmio_region_ops *mmio_ops; | ||
| 136 | unsigned long bus_addr; | 148 | unsigned long bus_addr; |
| 137 | unsigned long len; | 149 | unsigned long len; |
| 138 | enum ps3_mmio_page_size page_size; | 150 | enum ps3_mmio_page_size page_size; |
| 139 | unsigned long lpar_addr; | 151 | unsigned long lpar_addr; |
| 140 | }; | 152 | }; |
| 141 | 153 | ||
| 154 | struct ps3_mmio_region_ops { | ||
| 155 | int (*create)(struct ps3_mmio_region *); | ||
| 156 | int (*free)(struct ps3_mmio_region *); | ||
| 157 | }; | ||
| 142 | /** | 158 | /** |
| 143 | * struct ps3_mmio_region_init - Helper to initialize structure variables | 159 | * struct ps3_mmio_region_init - Helper to initialize structure variables |
| 144 | * | 160 | * |
| @@ -146,15 +162,9 @@ struct ps3_mmio_region { | |||
| 146 | * ps3_system_bus_device_register. | 162 | * ps3_system_bus_device_register. |
| 147 | */ | 163 | */ |
| 148 | 164 | ||
| 149 | static inline void ps3_mmio_region_init(struct ps3_mmio_region *r, | 165 | int ps3_mmio_region_init(struct ps3_system_bus_device *dev, |
| 150 | const struct ps3_device_id* did, unsigned long bus_addr, | 166 | struct ps3_mmio_region *r, unsigned long bus_addr, unsigned long len, |
| 151 | unsigned long len, enum ps3_mmio_page_size page_size) | 167 | enum ps3_mmio_page_size page_size); |
| 152 | { | ||
| 153 | r->did = *did; | ||
| 154 | r->bus_addr = bus_addr; | ||
| 155 | r->len = len; | ||
| 156 | r->page_size = page_size; | ||
| 157 | } | ||
| 158 | int ps3_mmio_region_create(struct ps3_mmio_region *r); | 168 | int ps3_mmio_region_create(struct ps3_mmio_region *r); |
| 159 | int ps3_free_mmio_region(struct ps3_mmio_region *r); | 169 | int ps3_free_mmio_region(struct ps3_mmio_region *r); |
| 160 | unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr); | 170 | unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr); |
| @@ -187,11 +197,10 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id, | |||
| 187 | unsigned int class, unsigned int *virq); | 197 | unsigned int class, unsigned int *virq); |
| 188 | int ps3_spe_irq_destroy(unsigned int virq); | 198 | int ps3_spe_irq_destroy(unsigned int virq); |
| 189 | 199 | ||
| 190 | int ps3_sb_event_receive_port_setup(enum ps3_cpu_binding cpu, | 200 | int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev, |
| 191 | const struct ps3_device_id *did, unsigned int interrupt_id, | 201 | enum ps3_cpu_binding cpu, unsigned int *virq); |
| 192 | unsigned int *virq); | 202 | int ps3_sb_event_receive_port_destroy(struct ps3_system_bus_device *dev, |
| 193 | int ps3_sb_event_receive_port_destroy(const struct ps3_device_id *did, | 203 | unsigned int virq); |
| 194 | unsigned int interrupt_id, unsigned int virq); | ||
| 195 | 204 | ||
| 196 | /* lv1 result codes */ | 205 | /* lv1 result codes */ |
| 197 | 206 | ||
| @@ -289,11 +298,33 @@ static inline const char* ps3_result(int result) | |||
| 289 | /* system bus routines */ | 298 | /* system bus routines */ |
| 290 | 299 | ||
| 291 | enum ps3_match_id { | 300 | enum ps3_match_id { |
| 292 | PS3_MATCH_ID_EHCI = 1, | 301 | PS3_MATCH_ID_EHCI = 1, |
| 293 | PS3_MATCH_ID_OHCI, | 302 | PS3_MATCH_ID_OHCI = 2, |
| 294 | PS3_MATCH_ID_GELIC, | 303 | PS3_MATCH_ID_GELIC = 3, |
| 295 | PS3_MATCH_ID_AV_SETTINGS, | 304 | PS3_MATCH_ID_AV_SETTINGS = 4, |
| 296 | PS3_MATCH_ID_SYSTEM_MANAGER, | 305 | PS3_MATCH_ID_SYSTEM_MANAGER = 5, |
| 306 | PS3_MATCH_ID_STOR_DISK = 6, | ||
| 307 | PS3_MATCH_ID_STOR_ROM = 7, | ||
| 308 | PS3_MATCH_ID_STOR_FLASH = 8, | ||
| 309 | PS3_MATCH_ID_SOUND = 9, | ||
| 310 | PS3_MATCH_ID_GRAPHICS = 10, | ||
| 311 | }; | ||
| 312 | |||
| 313 | #define PS3_MODULE_ALIAS_EHCI "ps3:1" | ||
| 314 | #define PS3_MODULE_ALIAS_OHCI "ps3:2" | ||
| 315 | #define PS3_MODULE_ALIAS_GELIC "ps3:3" | ||
| 316 | #define PS3_MODULE_ALIAS_AV_SETTINGS "ps3:4" | ||
| 317 | #define PS3_MODULE_ALIAS_SYSTEM_MANAGER "ps3:5" | ||
| 318 | #define PS3_MODULE_ALIAS_STOR_DISK "ps3:6" | ||
| 319 | #define PS3_MODULE_ALIAS_STOR_ROM "ps3:7" | ||
| 320 | #define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8" | ||
| 321 | #define PS3_MODULE_ALIAS_SOUND "ps3:9" | ||
| 322 | #define PS3_MODULE_ALIAS_GRAPHICS "ps3:10" | ||
| 323 | |||
| 324 | enum ps3_system_bus_device_type { | ||
| 325 | PS3_DEVICE_TYPE_IOC0 = 1, | ||
| 326 | PS3_DEVICE_TYPE_SB, | ||
| 327 | PS3_DEVICE_TYPE_VUART, | ||
| 297 | }; | 328 | }; |
| 298 | 329 | ||
| 299 | /** | 330 | /** |
| @@ -302,14 +333,23 @@ enum ps3_match_id { | |||
| 302 | 333 | ||
| 303 | struct ps3_system_bus_device { | 334 | struct ps3_system_bus_device { |
| 304 | enum ps3_match_id match_id; | 335 | enum ps3_match_id match_id; |
| 305 | struct ps3_device_id did; | 336 | enum ps3_system_bus_device_type dev_type; |
| 306 | unsigned int interrupt_id; | 337 | |
| 307 | /* struct iommu_table *iommu_table; -- waiting for Ben's cleanups */ | 338 | unsigned int bus_id; /* SB */ |
| 308 | struct ps3_dma_region *d_region; | 339 | unsigned int dev_id; /* SB */ |
| 309 | struct ps3_mmio_region *m_region; | 340 | unsigned int interrupt_id; /* SB */ |
| 341 | struct ps3_dma_region *d_region; /* SB, IOC0 */ | ||
| 342 | struct ps3_mmio_region *m_region; /* SB, IOC0*/ | ||
| 343 | unsigned int port_number; /* VUART */ | ||
| 344 | |||
| 345 | /* struct iommu_table *iommu_table; -- waiting for BenH's cleanups */ | ||
| 310 | struct device core; | 346 | struct device core; |
| 347 | void *driver_priv; /* private driver variables */ | ||
| 311 | }; | 348 | }; |
| 312 | 349 | ||
| 350 | int ps3_open_hv_device(struct ps3_system_bus_device *dev); | ||
| 351 | int ps3_close_hv_device(struct ps3_system_bus_device *dev); | ||
| 352 | |||
| 313 | /** | 353 | /** |
| 314 | * struct ps3_system_bus_driver - a driver for a device on the system bus | 354 | * struct ps3_system_bus_driver - a driver for a device on the system bus |
| 315 | */ | 355 | */ |
| @@ -319,6 +359,7 @@ struct ps3_system_bus_driver { | |||
| 319 | struct device_driver core; | 359 | struct device_driver core; |
| 320 | int (*probe)(struct ps3_system_bus_device *); | 360 | int (*probe)(struct ps3_system_bus_device *); |
| 321 | int (*remove)(struct ps3_system_bus_device *); | 361 | int (*remove)(struct ps3_system_bus_device *); |
| 362 | int (*shutdown)(struct ps3_system_bus_device *); | ||
| 322 | /* int (*suspend)(struct ps3_system_bus_device *, pm_message_t); */ | 363 | /* int (*suspend)(struct ps3_system_bus_device *, pm_message_t); */ |
| 323 | /* int (*resume)(struct ps3_system_bus_device *); */ | 364 | /* int (*resume)(struct ps3_system_bus_device *); */ |
| 324 | }; | 365 | }; |
| @@ -326,16 +367,24 @@ struct ps3_system_bus_driver { | |||
| 326 | int ps3_system_bus_device_register(struct ps3_system_bus_device *dev); | 367 | int ps3_system_bus_device_register(struct ps3_system_bus_device *dev); |
| 327 | int ps3_system_bus_driver_register(struct ps3_system_bus_driver *drv); | 368 | int ps3_system_bus_driver_register(struct ps3_system_bus_driver *drv); |
| 328 | void ps3_system_bus_driver_unregister(struct ps3_system_bus_driver *drv); | 369 | void ps3_system_bus_driver_unregister(struct ps3_system_bus_driver *drv); |
| 329 | static inline struct ps3_system_bus_driver *to_ps3_system_bus_driver( | 370 | |
| 371 | static inline struct ps3_system_bus_driver *ps3_drv_to_system_bus_drv( | ||
| 330 | struct device_driver *_drv) | 372 | struct device_driver *_drv) |
| 331 | { | 373 | { |
| 332 | return container_of(_drv, struct ps3_system_bus_driver, core); | 374 | return container_of(_drv, struct ps3_system_bus_driver, core); |
| 333 | } | 375 | } |
| 334 | static inline struct ps3_system_bus_device *to_ps3_system_bus_device( | 376 | static inline struct ps3_system_bus_device *ps3_dev_to_system_bus_dev( |
| 335 | struct device *_dev) | 377 | struct device *_dev) |
| 336 | { | 378 | { |
| 337 | return container_of(_dev, struct ps3_system_bus_device, core); | 379 | return container_of(_dev, struct ps3_system_bus_device, core); |
| 338 | } | 380 | } |
| 381 | static inline struct ps3_system_bus_driver * | ||
| 382 | ps3_system_bus_dev_to_system_bus_drv(struct ps3_system_bus_device *_dev) | ||
| 383 | { | ||
| 384 | BUG_ON(!_dev); | ||
| 385 | BUG_ON(!_dev->core.driver); | ||
| 386 | return ps3_drv_to_system_bus_drv(_dev->core.driver); | ||
| 387 | } | ||
| 339 | 388 | ||
| 340 | /** | 389 | /** |
| 341 | * ps3_system_bus_set_drvdata - | 390 | * ps3_system_bus_set_drvdata - |
| @@ -358,32 +407,17 @@ static inline void *ps3_system_bus_get_driver_data( | |||
| 358 | 407 | ||
| 359 | extern struct bus_type ps3_system_bus_type; | 408 | extern struct bus_type ps3_system_bus_type; |
| 360 | 409 | ||
| 361 | /* vuart routines */ | 410 | /* system manager */ |
| 362 | |||
| 363 | struct ps3_vuart_port_priv; | ||
| 364 | |||
| 365 | /** | ||
| 366 | * struct ps3_vuart_port_device - a device on a vuart port | ||
| 367 | */ | ||
| 368 | |||
| 369 | struct ps3_vuart_port_device { | ||
| 370 | enum ps3_match_id match_id; | ||
| 371 | struct device core; | ||
| 372 | struct ps3_vuart_port_priv* priv; /* private driver variables */ | ||
| 373 | 411 | ||
| 412 | struct ps3_sys_manager_ops { | ||
| 413 | struct ps3_system_bus_device *dev; | ||
| 414 | void (*power_off)(struct ps3_system_bus_device *dev); | ||
| 415 | void (*restart)(struct ps3_system_bus_device *dev); | ||
| 374 | }; | 416 | }; |
| 375 | 417 | ||
| 376 | int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev); | 418 | void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops); |
| 377 | |||
| 378 | /* system manager */ | ||
| 379 | |||
| 380 | #ifdef CONFIG_PS3_SYS_MANAGER | ||
| 381 | void ps3_sys_manager_restart(void); | ||
| 382 | void ps3_sys_manager_power_off(void); | 419 | void ps3_sys_manager_power_off(void); |
| 383 | #else | 420 | void ps3_sys_manager_restart(void); |
| 384 | static inline void ps3_sys_manager_restart(void) {} | ||
| 385 | static inline void ps3_sys_manager_power_off(void) {} | ||
| 386 | #endif | ||
| 387 | 421 | ||
| 388 | struct ps3_prealloc { | 422 | struct ps3_prealloc { |
| 389 | const char *name; | 423 | const char *name; |
| @@ -393,5 +427,7 @@ struct ps3_prealloc { | |||
| 393 | }; | 427 | }; |
| 394 | 428 | ||
| 395 | extern struct ps3_prealloc ps3fb_videomemory; | 429 | extern struct ps3_prealloc ps3fb_videomemory; |
| 430 | extern struct ps3_prealloc ps3flash_bounce_buffer; | ||
| 431 | |||
| 396 | 432 | ||
| 397 | #endif | 433 | #endif |
diff --git a/include/asm-powerpc/ps3av.h b/include/asm-powerpc/ps3av.h index 9efc40f1c778..7df4250802de 100644 --- a/include/asm-powerpc/ps3av.h +++ b/include/asm-powerpc/ps3av.h | |||
| @@ -1,20 +1,23 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2006 Sony Computer Entertainment Inc. | 2 | * PS3 AV backend support. |
| 3 | * Copyright 2006, 2007 Sony Corporation | ||
| 4 | * | 3 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it | 4 | * Copyright (C) 2007 Sony Computer Entertainment Inc. |
| 6 | * under the terms of the GNU General Public License as published | 5 | * Copyright 2007 Sony Corp. |
| 7 | * by the Free Software Foundation; version 2 of the License. | ||
| 8 | * | 6 | * |
| 9 | * This program is distributed in the hope that it will be useful, but | 7 | * This program is free software; you can redistribute it and/or modify |
| 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 8 | * it under the terms of the GNU General Public License as published by |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 9 | * the Free Software Foundation; version 2 of the License. |
| 12 | * General Public License for more details. | ||
| 13 | * | 10 | * |
| 14 | * You should have received a copy of the GNU General Public License along | 11 | * This program is distributed in the hope that it will be useful, |
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | */ | 19 | */ |
| 20 | |||
| 18 | #ifndef _ASM_POWERPC_PS3AV_H_ | 21 | #ifndef _ASM_POWERPC_PS3AV_H_ |
| 19 | #define _ASM_POWERPC_PS3AV_H_ | 22 | #define _ASM_POWERPC_PS3AV_H_ |
| 20 | 23 | ||
| @@ -159,6 +162,9 @@ | |||
| 159 | #define PS3AV_CMD_VIDEO_FMT_X8R8G8B8 0x0000 | 162 | #define PS3AV_CMD_VIDEO_FMT_X8R8G8B8 0x0000 |
| 160 | /* video_out_format */ | 163 | /* video_out_format */ |
| 161 | #define PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT 0x0000 | 164 | #define PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT 0x0000 |
| 165 | /* video_cl_cnv */ | ||
| 166 | #define PS3AV_CMD_VIDEO_CL_CNV_ENABLE_LUT 0x0000 | ||
| 167 | #define PS3AV_CMD_VIDEO_CL_CNV_DISABLE_LUT 0x0010 | ||
| 162 | /* video_sync */ | 168 | /* video_sync */ |
| 163 | #define PS3AV_CMD_VIDEO_SYNC_VSYNC 0x0001 | 169 | #define PS3AV_CMD_VIDEO_SYNC_VSYNC 0x0001 |
| 164 | #define PS3AV_CMD_VIDEO_SYNC_CSYNC 0x0004 | 170 | #define PS3AV_CMD_VIDEO_SYNC_CSYNC 0x0004 |
| @@ -311,6 +317,8 @@ | |||
| 311 | #define PS3AV_MODE_MASK 0x000F | 317 | #define PS3AV_MODE_MASK 0x000F |
| 312 | #define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */ | 318 | #define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */ |
| 313 | #define PS3AV_MODE_DITHER 0x0800 | 319 | #define PS3AV_MODE_DITHER 0x0800 |
| 320 | #define PS3AV_MODE_COLOR 0x0400 | ||
| 321 | #define PS3AV_MODE_WHITE 0x0200 | ||
| 314 | #define PS3AV_MODE_FULL 0x0080 | 322 | #define PS3AV_MODE_FULL 0x0080 |
| 315 | #define PS3AV_MODE_DVI 0x0040 | 323 | #define PS3AV_MODE_DVI 0x0040 |
| 316 | #define PS3AV_MODE_RGB 0x0020 | 324 | #define PS3AV_MODE_RGB 0x0020 |
| @@ -529,9 +537,9 @@ struct ps3av_pkt_video_mode { | |||
| 529 | u32 video_out_format; /* in: out format */ | 537 | u32 video_out_format; /* in: out format */ |
| 530 | u32 video_format; /* in: input frame buffer format */ | 538 | u32 video_format; /* in: input frame buffer format */ |
| 531 | u8 reserved3; | 539 | u8 reserved3; |
| 532 | u8 reserved4; | 540 | u8 video_cl_cnv; /* in: color conversion */ |
| 533 | u16 video_order; /* in: input RGB order */ | 541 | u16 video_order; /* in: input RGB order */ |
| 534 | u32 reserved5; | 542 | u32 reserved4; |
| 535 | }; | 543 | }; |
| 536 | 544 | ||
| 537 | /* video: format */ | 545 | /* video: format */ |
| @@ -539,7 +547,8 @@ struct ps3av_pkt_video_format { | |||
| 539 | struct ps3av_send_hdr send_hdr; | 547 | struct ps3av_send_hdr send_hdr; |
| 540 | u32 video_head; /* in: head */ | 548 | u32 video_head; /* in: head */ |
| 541 | u32 video_format; /* in: frame buffer format */ | 549 | u32 video_format; /* in: frame buffer format */ |
| 542 | u16 reserved; | 550 | u8 reserved; |
| 551 | u8 video_cl_cnv; /* in: color conversion */ | ||
| 543 | u16 video_order; /* in: input RGB order */ | 552 | u16 video_order; /* in: input RGB order */ |
| 544 | }; | 553 | }; |
| 545 | 554 | ||
| @@ -698,12 +707,6 @@ static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_ | |||
| 698 | extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, | 707 | extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, |
| 699 | u32); | 708 | u32); |
| 700 | 709 | ||
| 701 | struct ps3_vuart_port_device; | ||
| 702 | extern int ps3av_vuart_write(struct ps3_vuart_port_device *dev, | ||
| 703 | const void *buf, unsigned long size); | ||
| 704 | extern int ps3av_vuart_read(struct ps3_vuart_port_device *dev, void *buf, | ||
| 705 | unsigned long size, int timeout); | ||
| 706 | |||
| 707 | extern int ps3av_set_video_mode(u32, int); | 710 | extern int ps3av_set_video_mode(u32, int); |
| 708 | extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); | 711 | extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); |
| 709 | extern int ps3av_get_auto_mode(int); | 712 | extern int ps3av_get_auto_mode(int); |
| @@ -716,5 +719,8 @@ extern int ps3av_video_mute(int); | |||
| 716 | extern int ps3av_audio_mute(int); | 719 | extern int ps3av_audio_mute(int); |
| 717 | extern int ps3av_dev_open(void); | 720 | extern int ps3av_dev_open(void); |
| 718 | extern int ps3av_dev_close(void); | 721 | extern int ps3av_dev_close(void); |
| 722 | extern void ps3av_register_flip_ctl(void (*flip_ctl)(int on, void *data), | ||
| 723 | void *flip_data); | ||
| 724 | extern void ps3av_flip_ctl(int on); | ||
| 719 | 725 | ||
| 720 | #endif /* _ASM_POWERPC_PS3AV_H_ */ | 726 | #endif /* _ASM_POWERPC_PS3AV_H_ */ |
diff --git a/include/asm-powerpc/ps3fb.h b/include/asm-powerpc/ps3fb.h index ad81cf431964..3f121fe4010d 100644 --- a/include/asm-powerpc/ps3fb.h +++ b/include/asm-powerpc/ps3fb.h | |||
| @@ -41,16 +41,4 @@ struct ps3fb_ioctl_res { | |||
| 41 | __u32 num_frames; /* num of frame buffers */ | 41 | __u32 num_frames; /* num of frame buffers */ |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | #ifdef __KERNEL__ | ||
| 45 | |||
| 46 | #ifdef CONFIG_FB_PS3 | ||
| 47 | extern void ps3fb_flip_ctl(int on); | ||
| 48 | extern void ps3fb_cleanup(void); | ||
| 49 | #else | ||
| 50 | static inline void ps3fb_flip_ctl(int on) {} | ||
| 51 | static inline void ps3fb_cleanup(void) {} | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #endif /* __KERNEL__ */ | ||
| 55 | |||
| 56 | #endif /* _ASM_POWERPC_PS3FB_H_ */ | 44 | #endif /* _ASM_POWERPC_PS3FB_H_ */ |
diff --git a/include/asm-powerpc/ps3stor.h b/include/asm-powerpc/ps3stor.h new file mode 100644 index 000000000000..6fcaf714fa50 --- /dev/null +++ b/include/asm-powerpc/ps3stor.h | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | /* | ||
| 2 | * PS3 Storage Devices | ||
| 3 | * | ||
| 4 | * Copyright (C) 2007 Sony Computer Entertainment Inc. | ||
| 5 | * Copyright 2007 Sony Corp. | ||
| 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 | ||
| 9 | * by the Free Software Foundation; version 2 of the License. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, but | ||
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | * General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License along | ||
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef _ASM_POWERPC_PS3STOR_H_ | ||
| 22 | #define _ASM_POWERPC_PS3STOR_H_ | ||
| 23 | |||
| 24 | #include <linux/interrupt.h> | ||
| 25 | |||
| 26 | #include <asm/ps3.h> | ||
| 27 | |||
| 28 | |||
| 29 | struct ps3_storage_region { | ||
| 30 | unsigned int id; | ||
| 31 | u64 start; | ||
| 32 | u64 size; | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct ps3_storage_device { | ||
| 36 | struct ps3_system_bus_device sbd; | ||
| 37 | |||
| 38 | struct ps3_dma_region dma_region; | ||
| 39 | unsigned int irq; | ||
| 40 | u64 blk_size; | ||
| 41 | |||
| 42 | u64 tag; | ||
| 43 | u64 lv1_status; | ||
| 44 | struct completion done; | ||
| 45 | |||
| 46 | unsigned long bounce_size; | ||
| 47 | void *bounce_buf; | ||
| 48 | u64 bounce_lpar; | ||
| 49 | dma_addr_t bounce_dma; | ||
| 50 | |||
| 51 | unsigned int num_regions; | ||
| 52 | unsigned long accessible_regions; | ||
| 53 | unsigned int region_idx; /* first accessible region */ | ||
| 54 | struct ps3_storage_region regions[0]; /* Must be last */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | static inline struct ps3_storage_device *to_ps3_storage_device(struct device *dev) | ||
| 58 | { | ||
| 59 | return container_of(dev, struct ps3_storage_device, sbd.core); | ||
| 60 | } | ||
| 61 | |||
| 62 | extern int ps3stor_setup(struct ps3_storage_device *dev, | ||
| 63 | irq_handler_t handler); | ||
| 64 | extern void ps3stor_teardown(struct ps3_storage_device *dev); | ||
| 65 | extern u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar, | ||
| 66 | u64 start_sector, u64 sectors, | ||
| 67 | int write); | ||
| 68 | extern u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd, | ||
| 69 | u64 arg1, u64 arg2, u64 arg3, u64 arg4); | ||
| 70 | |||
| 71 | #endif /* _ASM_POWERPC_PS3STOR_H_ */ | ||
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h index 4ad77a13f865..13fccc5a4119 100644 --- a/include/asm-powerpc/ptrace.h +++ b/include/asm-powerpc/ptrace.h | |||
| @@ -92,6 +92,11 @@ extern unsigned long profile_pc(struct pt_regs *regs); | |||
| 92 | set_thread_flag(TIF_NOERROR); \ | 92 | set_thread_flag(TIF_NOERROR); \ |
| 93 | } while(0) | 93 | } while(0) |
| 94 | 94 | ||
| 95 | struct task_struct; | ||
| 96 | extern unsigned long ptrace_get_reg(struct task_struct *task, int regno); | ||
| 97 | extern int ptrace_put_reg(struct task_struct *task, int regno, | ||
| 98 | unsigned long data); | ||
| 99 | |||
| 95 | /* | 100 | /* |
| 96 | * We use the least-significant bit of the trap field to indicate | 101 | * We use the least-significant bit of the trap field to indicate |
| 97 | * whether we have saved the full set of registers, or only a | 102 | * whether we have saved the full set of registers, or only a |
| @@ -158,9 +163,7 @@ do { \ | |||
| 158 | 163 | ||
| 159 | #define PT_NIP 32 | 164 | #define PT_NIP 32 |
| 160 | #define PT_MSR 33 | 165 | #define PT_MSR 33 |
| 161 | #ifdef __KERNEL__ | ||
| 162 | #define PT_ORIG_R3 34 | 166 | #define PT_ORIG_R3 34 |
| 163 | #endif | ||
| 164 | #define PT_CTR 35 | 167 | #define PT_CTR 35 |
| 165 | #define PT_LNK 36 | 168 | #define PT_LNK 36 |
| 166 | #define PT_XER 37 | 169 | #define PT_XER 37 |
| @@ -169,11 +172,12 @@ do { \ | |||
| 169 | #define PT_MQ 39 | 172 | #define PT_MQ 39 |
| 170 | #else | 173 | #else |
| 171 | #define PT_SOFTE 39 | 174 | #define PT_SOFTE 39 |
| 175 | #endif | ||
| 172 | #define PT_TRAP 40 | 176 | #define PT_TRAP 40 |
| 173 | #define PT_DAR 41 | 177 | #define PT_DAR 41 |
| 174 | #define PT_DSISR 42 | 178 | #define PT_DSISR 42 |
| 175 | #define PT_RESULT 43 | 179 | #define PT_RESULT 43 |
| 176 | #endif | 180 | #define PT_REGS_COUNT 44 |
| 177 | 181 | ||
| 178 | #define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */ | 182 | #define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */ |
| 179 | 183 | ||
| @@ -229,7 +233,17 @@ do { \ | |||
| 229 | #define PTRACE_GET_DEBUGREG 25 | 233 | #define PTRACE_GET_DEBUGREG 25 |
| 230 | #define PTRACE_SET_DEBUGREG 26 | 234 | #define PTRACE_SET_DEBUGREG 26 |
| 231 | 235 | ||
| 232 | /* Additional PTRACE requests implemented on PowerPC. */ | 236 | /* (new) PTRACE requests using the same numbers as x86 and the same |
| 237 | * argument ordering. Additionally, they support more registers too | ||
| 238 | */ | ||
| 239 | #define PTRACE_GETREGS 12 | ||
| 240 | #define PTRACE_SETREGS 13 | ||
| 241 | #define PTRACE_GETFPREGS 14 | ||
| 242 | #define PTRACE_SETFPREGS 15 | ||
| 243 | #define PTRACE_GETREGS64 22 | ||
| 244 | #define PTRACE_SETREGS64 23 | ||
| 245 | |||
| 246 | /* (old) PTRACE requests with inverted arguments */ | ||
| 233 | #define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */ | 247 | #define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */ |
| 234 | #define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */ | 248 | #define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */ |
| 235 | #define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ | 249 | #define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ |
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index 749c7f953b58..281011e953ec 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h | |||
| @@ -453,6 +453,8 @@ | |||
| 453 | #define SPRN_MMCRA 0x312 | 453 | #define SPRN_MMCRA 0x312 |
| 454 | #define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ | 454 | #define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ |
| 455 | #define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ | 455 | #define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ |
| 456 | #define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */ | ||
| 457 | #define MMCRA_SLOT_SHIFT 24 | ||
| 456 | #define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ | 458 | #define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ |
| 457 | #define POWER6_MMCRA_SIHV 0x0000040000000000ULL | 459 | #define POWER6_MMCRA_SIHV 0x0000040000000000ULL |
| 458 | #define POWER6_MMCRA_SIPR 0x0000020000000000ULL | 460 | #define POWER6_MMCRA_SIPR 0x0000020000000000ULL |
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 31d5054be20f..eedc828cef2d 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
| @@ -106,6 +106,14 @@ struct spu_context; | |||
| 106 | struct spu_runqueue; | 106 | struct spu_runqueue; |
| 107 | struct device_node; | 107 | struct device_node; |
| 108 | 108 | ||
| 109 | enum spu_utilization_state { | ||
| 110 | SPU_UTIL_SYSTEM, | ||
| 111 | SPU_UTIL_USER, | ||
| 112 | SPU_UTIL_IOWAIT, | ||
| 113 | SPU_UTIL_IDLE, | ||
| 114 | SPU_UTIL_MAX | ||
| 115 | }; | ||
| 116 | |||
| 109 | struct spu { | 117 | struct spu { |
| 110 | const char *name; | 118 | const char *name; |
| 111 | unsigned long local_store_phys; | 119 | unsigned long local_store_phys; |
| @@ -156,6 +164,21 @@ struct spu { | |||
| 156 | u64 shadow_int_mask_RW[3]; | 164 | u64 shadow_int_mask_RW[3]; |
| 157 | 165 | ||
| 158 | struct sys_device sysdev; | 166 | struct sys_device sysdev; |
| 167 | |||
| 168 | struct { | ||
| 169 | /* protected by interrupt reentrancy */ | ||
| 170 | enum spu_utilization_state utilization_state; | ||
| 171 | unsigned long tstamp; /* time of last ctx switch */ | ||
| 172 | unsigned long times[SPU_UTIL_MAX]; | ||
| 173 | unsigned long long vol_ctx_switch; | ||
| 174 | unsigned long long invol_ctx_switch; | ||
| 175 | unsigned long long min_flt; | ||
| 176 | unsigned long long maj_flt; | ||
| 177 | unsigned long long hash_flt; | ||
| 178 | unsigned long long slb_flt; | ||
| 179 | unsigned long long class2_intr; | ||
| 180 | unsigned long long libassist; | ||
| 181 | } stats; | ||
| 159 | }; | 182 | }; |
| 160 | 183 | ||
| 161 | struct spu *spu_alloc(void); | 184 | struct spu *spu_alloc(void); |
| @@ -448,6 +471,7 @@ struct spu_priv1 { | |||
| 448 | #define MFC_STATE1_PROBLEM_STATE_MASK 0x08ull | 471 | #define MFC_STATE1_PROBLEM_STATE_MASK 0x08ull |
| 449 | #define MFC_STATE1_RELOCATE_MASK 0x10ull | 472 | #define MFC_STATE1_RELOCATE_MASK 0x10ull |
| 450 | #define MFC_STATE1_MASTER_RUN_CONTROL_MASK 0x20ull | 473 | #define MFC_STATE1_MASTER_RUN_CONTROL_MASK 0x20ull |
| 474 | #define MFC_STATE1_TABLE_SEARCH_MASK 0x40ull | ||
| 451 | u64 mfc_lpid_RW; /* 0x008 */ | 475 | u64 mfc_lpid_RW; /* 0x008 */ |
| 452 | u64 spu_idr_RW; /* 0x010 */ | 476 | u64 spu_idr_RW; /* 0x010 */ |
| 453 | u64 mfc_vr_RO; /* 0x018 */ | 477 | u64 mfc_vr_RO; /* 0x018 */ |
diff --git a/include/asm-powerpc/syscalls.h b/include/asm-powerpc/syscalls.h index c2fe79d4f90f..b3ca41fc8bb1 100644 --- a/include/asm-powerpc/syscalls.h +++ b/include/asm-powerpc/syscalls.h | |||
| @@ -43,16 +43,9 @@ asmlinkage long ppc_newuname(struct new_utsname __user * name); | |||
| 43 | 43 | ||
| 44 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, | 44 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, |
| 45 | size_t sigsetsize); | 45 | size_t sigsetsize); |
| 46 | |||
| 47 | #ifndef __powerpc64__ | ||
| 48 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, | ||
| 49 | stack_t __user *uoss, int r5, int r6, int r7, int r8, | ||
| 50 | struct pt_regs *regs); | ||
| 51 | #else /* __powerpc64__ */ | ||
| 52 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, | 46 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, |
| 53 | stack_t __user *uoss, unsigned long r5, unsigned long r6, | 47 | stack_t __user *uoss, unsigned long r5, unsigned long r6, |
| 54 | unsigned long r7, unsigned long r8, struct pt_regs *regs); | 48 | unsigned long r7, unsigned long r8, struct pt_regs *regs); |
| 55 | #endif /* __powerpc64__ */ | ||
| 56 | 49 | ||
| 57 | #endif /* __KERNEL__ */ | 50 | #endif /* __KERNEL__ */ |
| 58 | #endif /* __ASM_POWERPC_SYSCALLS_H */ | 51 | #endif /* __ASM_POWERPC_SYSCALLS_H */ |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 09621f611dbc..32aa42b748be 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | #ifdef CONFIG_SMP | 43 | #ifdef CONFIG_SMP |
| 44 | #define smp_mb() mb() | 44 | #define smp_mb() mb() |
| 45 | #define smp_rmb() rmb() | 45 | #define smp_rmb() rmb() |
| 46 | #define smp_wmb() __asm__ __volatile__ ("eieio" : : : "memory") | 46 | #define smp_wmb() eieio() |
| 47 | #define smp_read_barrier_depends() read_barrier_depends() | 47 | #define smp_read_barrier_depends() read_barrier_depends() |
| 48 | #else | 48 | #else |
| 49 | #define smp_mb() barrier() | 49 | #define smp_mb() barrier() |
| @@ -559,5 +559,7 @@ static inline void create_function_call(unsigned long addr, void * func) | |||
| 559 | extern void account_system_vtime(struct task_struct *); | 559 | extern void account_system_vtime(struct task_struct *); |
| 560 | #endif | 560 | #endif |
| 561 | 561 | ||
| 562 | extern struct dentry *powerpc_debugfs_root; | ||
| 563 | |||
| 562 | #endif /* __KERNEL__ */ | 564 | #endif /* __KERNEL__ */ |
| 563 | #endif /* _ASM_POWERPC_SYSTEM_H */ | 565 | #endif /* _ASM_POWERPC_SYSTEM_H */ |
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h index 5e79198f7d18..6698188ca550 100644 --- a/include/asm-powerpc/termbits.h +++ b/include/asm-powerpc/termbits.h | |||
| @@ -152,6 +152,10 @@ struct ktermios { | |||
| 152 | #define B3000000 00034 | 152 | #define B3000000 00034 |
| 153 | #define B3500000 00035 | 153 | #define B3500000 00035 |
| 154 | #define B4000000 00036 | 154 | #define B4000000 00036 |
| 155 | #define BOTHER 00037 | ||
| 156 | |||
| 157 | #define CIBAUD 077600000 | ||
| 158 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
| 155 | 159 | ||
| 156 | #define CSIZE 00001400 | 160 | #define CSIZE 00001400 |
| 157 | #define CS5 00000000 | 161 | #define CS5 00000000 |
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index 3f32ca8bfec9..9d9aeca8ad22 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
| @@ -113,8 +113,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 113 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling | 113 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling |
| 114 | TIF_NEED_RESCHED */ | 114 | TIF_NEED_RESCHED */ |
| 115 | #define TIF_32BIT 5 /* 32 bit binary */ | 115 | #define TIF_32BIT 5 /* 32 bit binary */ |
| 116 | #define TIF_RUNLATCH 6 /* Is the runlatch enabled? */ | 116 | #define TIF_PERFMON_WORK 6 /* work for pfm_handle_work() */ |
| 117 | #define TIF_ABI_PENDING 7 /* 32/64 bit switch needed */ | 117 | #define TIF_PERFMON_CTXSW 7 /* perfmon needs ctxsw calls */ |
| 118 | #define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ | 118 | #define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ |
| 119 | #define TIF_SINGLESTEP 9 /* singlestepping active */ | 119 | #define TIF_SINGLESTEP 9 /* singlestepping active */ |
| 120 | #define TIF_MEMDIE 10 | 120 | #define TIF_MEMDIE 10 |
| @@ -123,6 +123,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 123 | #define TIF_NOERROR 14 /* Force successful syscall return */ | 123 | #define TIF_NOERROR 14 /* Force successful syscall return */ |
| 124 | #define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ | 124 | #define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ |
| 125 | #define TIF_FREEZE 16 /* Freezing for suspend */ | 125 | #define TIF_FREEZE 16 /* Freezing for suspend */ |
| 126 | #define TIF_RUNLATCH 17 /* Is the runlatch enabled? */ | ||
| 127 | #define TIF_ABI_PENDING 18 /* 32/64 bit switch needed */ | ||
| 126 | 128 | ||
| 127 | /* as above, but as bit values */ | 129 | /* as above, but as bit values */ |
| 128 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 130 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| @@ -131,8 +133,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 131 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 133 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
| 132 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 134 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
| 133 | #define _TIF_32BIT (1<<TIF_32BIT) | 135 | #define _TIF_32BIT (1<<TIF_32BIT) |
| 134 | #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) | 136 | #define _TIF_PERFMON_WORK (1<<TIF_PERFMON_WORK) |
| 135 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 137 | #define _TIF_PERFMON_CTXSW (1<<TIF_PERFMON_CTXSW) |
| 136 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 138 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
| 137 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) | 139 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) |
| 138 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 140 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
| @@ -140,6 +142,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 140 | #define _TIF_NOERROR (1<<TIF_NOERROR) | 142 | #define _TIF_NOERROR (1<<TIF_NOERROR) |
| 141 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 143 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
| 142 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 144 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
| 145 | #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) | ||
| 146 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | ||
| 143 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | 147 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) |
| 144 | 148 | ||
| 145 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ | 149 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ |
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index 3fd57c048f59..d7f5ddfbaac7 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
| @@ -232,7 +232,7 @@ extern void account_process_vtime(struct task_struct *tsk); | |||
| 232 | #define account_process_vtime(tsk) do { } while (0) | 232 | #define account_process_vtime(tsk) do { } while (0) |
| 233 | #endif | 233 | #endif |
| 234 | 234 | ||
| 235 | #if defined(CONFIG_VIRT_CPU_ACCOUNTING) && defined(CONFIG_PPC_SPLPAR) | 235 | #if defined(CONFIG_VIRT_CPU_ACCOUNTING) |
| 236 | extern void calculate_steal_time(void); | 236 | extern void calculate_steal_time(void); |
| 237 | extern void snapshot_timebases(void); | 237 | extern void snapshot_timebases(void); |
| 238 | #else | 238 | #else |
| @@ -240,5 +240,7 @@ extern void snapshot_timebases(void); | |||
| 240 | #define snapshot_timebases() do { } while (0) | 240 | #define snapshot_timebases() do { } while (0) |
| 241 | #endif | 241 | #endif |
| 242 | 242 | ||
| 243 | extern void iSeries_time_init_early(void); | ||
| 244 | |||
| 243 | #endif /* __KERNEL__ */ | 245 | #endif /* __KERNEL__ */ |
| 244 | #endif /* __POWERPC_TIME_H */ | 246 | #endif /* __POWERPC_TIME_H */ |
diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h index 86e6266a028b..99a0439baa50 100644 --- a/include/asm-powerpc/tlbflush.h +++ b/include/asm-powerpc/tlbflush.h | |||
| @@ -155,6 +155,11 @@ static inline void flush_tlb_kernel_range(unsigned long start, | |||
| 155 | { | 155 | { |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | /* Private function for use by PCI IO mapping code */ | ||
| 159 | extern void __flush_hash_table_range(struct mm_struct *mm, unsigned long start, | ||
| 160 | unsigned long end); | ||
| 161 | |||
| 162 | |||
| 158 | #endif | 163 | #endif |
| 159 | 164 | ||
| 160 | /* | 165 | /* |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 9d0ce9ff5840..c159315d2c8f 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
| @@ -533,9 +533,7 @@ static inline int pgd_present(pgd_t pgd) { return 1; } | |||
| 533 | * The following only work if pte_present() is true. | 533 | * The following only work if pte_present() is true. |
| 534 | * Undefined behaviour if not.. | 534 | * Undefined behaviour if not.. |
| 535 | */ | 535 | */ |
| 536 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | ||
| 537 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 536 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
| 538 | static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; } | ||
| 539 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 537 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
| 540 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 538 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 541 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 539 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| @@ -543,21 +541,13 @@ static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | |||
| 543 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } | 541 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } |
| 544 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } | 542 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } |
| 545 | 543 | ||
| 546 | static inline pte_t pte_rdprotect(pte_t pte) { | ||
| 547 | pte_val(pte) &= ~_PAGE_USER; return pte; } | ||
| 548 | static inline pte_t pte_wrprotect(pte_t pte) { | 544 | static inline pte_t pte_wrprotect(pte_t pte) { |
| 549 | pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; } | 545 | pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; } |
| 550 | static inline pte_t pte_exprotect(pte_t pte) { | ||
| 551 | pte_val(pte) &= ~_PAGE_EXEC; return pte; } | ||
| 552 | static inline pte_t pte_mkclean(pte_t pte) { | 546 | static inline pte_t pte_mkclean(pte_t pte) { |
| 553 | pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } | 547 | pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } |
| 554 | static inline pte_t pte_mkold(pte_t pte) { | 548 | static inline pte_t pte_mkold(pte_t pte) { |
| 555 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } | 549 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } |
| 556 | 550 | ||
| 557 | static inline pte_t pte_mkread(pte_t pte) { | ||
| 558 | pte_val(pte) |= _PAGE_USER; return pte; } | ||
| 559 | static inline pte_t pte_mkexec(pte_t pte) { | ||
| 560 | pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; } | ||
| 561 | static inline pte_t pte_mkwrite(pte_t pte) { | 551 | static inline pte_t pte_mkwrite(pte_t pte) { |
| 562 | pte_val(pte) |= _PAGE_RW; return pte; } | 552 | pte_val(pte) |= _PAGE_RW; return pte; } |
| 563 | static inline pte_t pte_mkdirty(pte_t pte) { | 553 | static inline pte_t pte_mkdirty(pte_t pte) { |
| @@ -664,13 +654,6 @@ static inline int __ptep_test_and_clear_young(unsigned int context, unsigned lon | |||
| 664 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ | 654 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ |
| 665 | __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) | 655 | __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) |
| 666 | 656 | ||
| 667 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 668 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, | ||
| 669 | unsigned long addr, pte_t *ptep) | ||
| 670 | { | ||
| 671 | return (pte_update(ptep, (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0; | ||
| 672 | } | ||
| 673 | |||
| 674 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 657 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 675 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | 658 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, |
| 676 | pte_t *ptep) | 659 | pte_t *ptep) |
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h index 296f4f1a20e1..7f4ad623f7d5 100644 --- a/include/asm-s390/compat.h +++ b/include/asm-s390/compat.h | |||
| @@ -60,8 +60,10 @@ typedef s32 compat_timer_t; | |||
| 60 | 60 | ||
| 61 | typedef s32 compat_int_t; | 61 | typedef s32 compat_int_t; |
| 62 | typedef s32 compat_long_t; | 62 | typedef s32 compat_long_t; |
| 63 | typedef s64 compat_s64; | ||
| 63 | typedef u32 compat_uint_t; | 64 | typedef u32 compat_uint_t; |
| 64 | typedef u32 compat_ulong_t; | 65 | typedef u32 compat_ulong_t; |
| 66 | typedef u64 compat_u64; | ||
| 65 | 67 | ||
| 66 | struct compat_timespec { | 68 | struct compat_timespec { |
| 67 | compat_time_t tv_sec; | 69 | compat_time_t tv_sec; |
diff --git a/include/asm-s390/dma-mapping.h b/include/asm-s390/dma-mapping.h deleted file mode 100644 index 3f8c12fde0f0..000000000000 --- a/include/asm-s390/dma-mapping.h +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-s390/dma-mapping.h | ||
| 3 | * | ||
| 4 | * S390 version | ||
| 5 | * | ||
| 6 | * This file exists so that #include <dma-mapping.h> doesn't break anything. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _ASM_DMA_MAPPING_H | ||
| 10 | #define _ASM_DMA_MAPPING_H | ||
| 11 | |||
| 12 | #endif /* _ASM_DMA_MAPPING_H */ | ||
diff --git a/include/asm-s390/fb.h b/include/asm-s390/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-s390/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-s390/page.h b/include/asm-s390/page.h index 05ea6f172786..f326451ed6ec 100644 --- a/include/asm-s390/page.h +++ b/include/asm-s390/page.h | |||
| @@ -64,7 +64,8 @@ static inline void copy_page(void *to, void *from) | |||
| 64 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 64 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 65 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 65 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
| 66 | 66 | ||
| 67 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) | 67 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 68 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | ||
| 68 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 69 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 69 | 70 | ||
| 70 | /* | 71 | /* |
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index 0a307bb2f353..3208dc6c412c 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
| @@ -530,14 +530,6 @@ static inline int pte_young(pte_t pte) | |||
| 530 | return 0; | 530 | return 0; |
| 531 | } | 531 | } |
| 532 | 532 | ||
| 533 | static inline int pte_read(pte_t pte) | ||
| 534 | { | ||
| 535 | /* All pages are readable since we don't use the fetch | ||
| 536 | * protection bit in the storage key. | ||
| 537 | */ | ||
| 538 | return 1; | ||
| 539 | } | ||
| 540 | |||
| 541 | /* | 533 | /* |
| 542 | * pgd/pmd/pte modification functions | 534 | * pgd/pmd/pte modification functions |
| 543 | */ | 535 | */ |
| @@ -677,19 +669,6 @@ ptep_clear_flush_young(struct vm_area_struct *vma, | |||
| 677 | return ptep_test_and_clear_young(vma, address, ptep); | 669 | return ptep_test_and_clear_young(vma, address, ptep); |
| 678 | } | 670 | } |
| 679 | 671 | ||
| 680 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | ||
| 681 | { | ||
| 682 | return 0; | ||
| 683 | } | ||
| 684 | |||
| 685 | static inline int | ||
| 686 | ptep_clear_flush_dirty(struct vm_area_struct *vma, | ||
| 687 | unsigned long address, pte_t *ptep) | ||
| 688 | { | ||
| 689 | /* No need to flush TLB; bits are in storage key */ | ||
| 690 | return ptep_test_and_clear_dirty(vma, address, ptep); | ||
| 691 | } | ||
| 692 | |||
| 693 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 672 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
| 694 | { | 673 | { |
| 695 | pte_t pte = *ptep; | 674 | pte_t pte = *ptep; |
| @@ -715,16 +694,19 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep) | |||
| 715 | pte_val(*ptep) = _PAGE_TYPE_EMPTY; | 694 | pte_val(*ptep) = _PAGE_TYPE_EMPTY; |
| 716 | } | 695 | } |
| 717 | 696 | ||
| 718 | static inline pte_t | 697 | static inline void ptep_invalidate(unsigned long address, pte_t *ptep) |
| 719 | ptep_clear_flush(struct vm_area_struct *vma, | ||
| 720 | unsigned long address, pte_t *ptep) | ||
| 721 | { | 698 | { |
| 722 | pte_t pte = *ptep; | ||
| 723 | pte_t *shadow_pte = get_shadow_pte(ptep); | ||
| 724 | |||
| 725 | __ptep_ipte(address, ptep); | 699 | __ptep_ipte(address, ptep); |
| 726 | if (shadow_pte) | 700 | ptep = get_shadow_pte(ptep); |
| 727 | __ptep_ipte(address, shadow_pte); | 701 | if (ptep) |
| 702 | __ptep_ipte(address, ptep); | ||
| 703 | } | ||
| 704 | |||
| 705 | static inline pte_t ptep_clear_flush(struct vm_area_struct *vma, | ||
| 706 | unsigned long address, pte_t *ptep) | ||
| 707 | { | ||
| 708 | pte_t pte = *ptep; | ||
| 709 | ptep_invalidate(address, ptep); | ||
| 728 | return pte; | 710 | return pte; |
| 729 | } | 711 | } |
| 730 | 712 | ||
| @@ -734,21 +716,14 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
| 734 | set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); | 716 | set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); |
| 735 | } | 717 | } |
| 736 | 718 | ||
| 737 | static inline void | 719 | #define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \ |
| 738 | ptep_establish(struct vm_area_struct *vma, | 720 | ({ \ |
| 739 | unsigned long address, pte_t *ptep, | 721 | int __changed = !pte_same(*(__ptep), __entry); \ |
| 740 | pte_t entry) | 722 | if (__changed) { \ |
| 741 | { | 723 | ptep_invalidate(__addr, __ptep); \ |
| 742 | ptep_clear_flush(vma, address, ptep); | 724 | set_pte_at((__vma)->vm_mm, __addr, __ptep, __entry); \ |
| 743 | set_pte(ptep, entry); | 725 | } \ |
| 744 | } | 726 | __changed; \ |
| 745 | |||
| 746 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ | ||
| 747 | ({ \ | ||
| 748 | int __changed = !pte_same(*(__ptep), __entry); \ | ||
| 749 | if (__changed) \ | ||
| 750 | ptep_establish(__vma, __address, __ptep, __entry); \ | ||
| 751 | __changed; \ | ||
| 752 | }) | 727 | }) |
| 753 | 728 | ||
| 754 | /* | 729 | /* |
| @@ -948,12 +923,9 @@ extern int remove_shared_memory(unsigned long start, unsigned long size); | |||
| 948 | #define __HAVE_ARCH_MEMMAP_INIT | 923 | #define __HAVE_ARCH_MEMMAP_INIT |
| 949 | extern void memmap_init(unsigned long, int, unsigned long, unsigned long); | 924 | extern void memmap_init(unsigned long, int, unsigned long, unsigned long); |
| 950 | 925 | ||
| 951 | #define __HAVE_ARCH_PTEP_ESTABLISH | ||
| 952 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 926 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
| 953 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 927 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 954 | #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | 928 | #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH |
| 955 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 956 | #define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH | ||
| 957 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 929 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 958 | #define __HAVE_ARCH_PTEP_CLEAR_FLUSH | 930 | #define __HAVE_ARCH_PTEP_CLEAR_FLUSH |
| 959 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 931 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h index 5a117ec43c77..aeee8da9c54f 100644 --- a/include/asm-sh/bugs.h +++ b/include/asm-sh/bugs.h | |||
| @@ -22,7 +22,7 @@ static void __init check_bugs(void) | |||
| 22 | current_cpu_data.loops_per_jiffy = loops_per_jiffy; | 22 | current_cpu_data.loops_per_jiffy = loops_per_jiffy; |
| 23 | 23 | ||
| 24 | switch (current_cpu_data.type) { | 24 | switch (current_cpu_data.type) { |
| 25 | case CPU_SH7604 ... CPU_SH7619: | 25 | case CPU_SH7619: |
| 26 | *p++ = '2'; | 26 | *p++ = '2'; |
| 27 | break; | 27 | break; |
| 28 | case CPU_SH7206: | 28 | case CPU_SH7206: |
| @@ -35,7 +35,7 @@ static void __init check_bugs(void) | |||
| 35 | case CPU_SH7750 ... CPU_SH4_501: | 35 | case CPU_SH7750 ... CPU_SH4_501: |
| 36 | *p++ = '4'; | 36 | *p++ = '4'; |
| 37 | break; | 37 | break; |
| 38 | case CPU_SH7770 ... CPU_SH7785: | 38 | case CPU_SH7770 ... CPU_SHX3: |
| 39 | *p++ = '4'; | 39 | *p++ = '4'; |
| 40 | *p++ = 'a'; | 40 | *p++ = 'a'; |
| 41 | break; | 41 | break; |
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h index 9a3cb6ba9d15..7a18649d1ccb 100644 --- a/include/asm-sh/cache.h +++ b/include/asm-sh/cache.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #define __ASM_SH_CACHE_H | 9 | #define __ASM_SH_CACHE_H |
| 10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
| 11 | 11 | ||
| 12 | #include <linux/init.h> | ||
| 12 | #include <asm/cpu/cache.h> | 13 | #include <asm/cpu/cache.h> |
| 13 | 14 | ||
| 14 | #define SH_CACHE_VALID 1 | 15 | #define SH_CACHE_VALID 1 |
| @@ -48,6 +49,9 @@ struct cache_info { | |||
| 48 | 49 | ||
| 49 | unsigned long flags; | 50 | unsigned long flags; |
| 50 | }; | 51 | }; |
| 52 | |||
| 53 | int __init detect_cpu_and_cache_system(void); | ||
| 54 | |||
| 51 | #endif /* __ASSEMBLY__ */ | 55 | #endif /* __ASSEMBLY__ */ |
| 52 | #endif /* __KERNEL__ */ | 56 | #endif /* __KERNEL__ */ |
| 53 | #endif /* __ASM_SH_CACHE_H */ | 57 | #endif /* __ASM_SH_CACHE_H */ |
diff --git a/include/asm-sh/cpu-sh2/cache.h b/include/asm-sh/cpu-sh2/cache.h index 20b9796842dc..f02ba7a672b2 100644 --- a/include/asm-sh/cpu-sh2/cache.h +++ b/include/asm-sh/cpu-sh2/cache.h | |||
| @@ -12,23 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #define L1_CACHE_SHIFT 4 | 13 | #define L1_CACHE_SHIFT 4 |
| 14 | 14 | ||
| 15 | #if defined(CONFIG_CPU_SUBTYPE_SH7604) | 15 | #if defined(CONFIG_CPU_SUBTYPE_SH7619) |
| 16 | #define CCR 0xfffffe92 /* Address of Cache Control Register */ | ||
| 17 | |||
| 18 | #define CCR_CACHE_CE 0x01 /* Cache enable */ | ||
| 19 | #define CCR_CACHE_ID 0x02 /* Instruction Replacement disable */ | ||
| 20 | #define CCR_CACHE_OD 0x04 /* Data Replacement disable */ | ||
| 21 | #define CCR_CACHE_TW 0x08 /* Two-way mode */ | ||
| 22 | #define CCR_CACHE_CP 0x10 /* Cache purge */ | ||
| 23 | |||
| 24 | #define CACHE_OC_ADDRESS_ARRAY 0x60000000 | ||
| 25 | |||
| 26 | #define CCR_CACHE_ENABLE CCR_CACHE_CE | ||
| 27 | #define CCR_CACHE_INVALIDATE CCR_CACHE_CP | ||
| 28 | #define CCR_CACHE_ORA CCR_CACHE_TW | ||
| 29 | #define CCR_CACHE_WT 0x00 /* SH-2 is _always_ write-through */ | ||
| 30 | |||
| 31 | #elif defined(CONFIG_CPU_SUBTYPE_SH7619) | ||
| 32 | #define CCR1 0xffffffec | 16 | #define CCR1 0xffffffec |
| 33 | #define CCR CCR1 | 17 | #define CCR CCR1 |
| 34 | 18 | ||
| @@ -49,5 +33,5 @@ | |||
| 49 | #define CCR_CACHE_ENABLE CCR_CACHE_CE | 33 | #define CCR_CACHE_ENABLE CCR_CACHE_CE |
| 50 | #define CCR_CACHE_INVALIDATE CCR_CACHE_CF | 34 | #define CCR_CACHE_INVALIDATE CCR_CACHE_CF |
| 51 | #endif | 35 | #endif |
| 52 | #endif /* __ASM_CPU_SH2_CACHE_H */ | ||
| 53 | 36 | ||
| 37 | #endif /* __ASM_CPU_SH2_CACHE_H */ | ||
diff --git a/include/asm-sh/cpu-sh3/timer.h b/include/asm-sh/cpu-sh3/timer.h index b2394cf76f49..4928b08f9d19 100644 --- a/include/asm-sh/cpu-sh3/timer.h +++ b/include/asm-sh/cpu-sh3/timer.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | #if defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7710) | 31 | #if defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7710) |
| 32 | #define TMU_TSTR 0xa412fe92 /* Byte access */ | 32 | #define TMU_012_TSTR 0xa412fe92 /* Byte access */ |
| 33 | 33 | ||
| 34 | #define TMU0_TCOR 0xa412fe94 /* Long access */ | 34 | #define TMU0_TCOR 0xa412fe94 /* Long access */ |
| 35 | #define TMU0_TCNT 0xa412fe98 /* Long access */ | 35 | #define TMU0_TCNT 0xa412fe98 /* Long access */ |
| @@ -44,7 +44,7 @@ | |||
| 44 | #define TMU2_TCR 0xa412feb4 /* Word access */ | 44 | #define TMU2_TCR 0xa412feb4 /* Word access */ |
| 45 | 45 | ||
| 46 | #else | 46 | #else |
| 47 | #define TMU_TSTR 0xfffffe92 /* Byte access */ | 47 | #define TMU_012_TSTR 0xfffffe92 /* Byte access */ |
| 48 | 48 | ||
| 49 | #define TMU0_TCOR 0xfffffe94 /* Long access */ | 49 | #define TMU0_TCOR 0xfffffe94 /* Long access */ |
| 50 | #define TMU0_TCNT 0xfffffe98 /* Long access */ | 50 | #define TMU0_TCNT 0xfffffe98 /* Long access */ |
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h index 39f41fcd509d..026025b51cea 100644 --- a/include/asm-sh/cpu-sh4/freq.h +++ b/include/asm-sh/cpu-sh4/freq.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #define FRQCR0 0xffc80000 | 22 | #define FRQCR0 0xffc80000 |
| 23 | #define FRQCR1 0xffc80004 | 23 | #define FRQCR1 0xffc80004 |
| 24 | #define FRQMR1 0xffc80014 | 24 | #define FRQMR1 0xffc80014 |
| 25 | #elif defined(CONFIG_CPU_SUBTYPE_SHX3) | ||
| 26 | #define FRQCR 0xffc00014 | ||
| 25 | #else | 27 | #else |
| 26 | #define FRQCR 0xffc00000 | 28 | #define FRQCR 0xffc00000 |
| 27 | #define FRQCR_PSTBY 0x0200 | 29 | #define FRQCR_PSTBY 0x0200 |
diff --git a/include/asm-sh/cpu-sh4/timer.h b/include/asm-sh/cpu-sh4/timer.h index 8a4af126c890..d1e796b96888 100644 --- a/include/asm-sh/cpu-sh4/timer.h +++ b/include/asm-sh/cpu-sh4/timer.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * include/asm-sh/cpu-sh4/timer.h | 2 | * include/asm-sh/cpu-sh4/timer.h |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2004 Lineo Solutions, Inc. | 4 | * Copyright (C) 2004 Lineo Solutions, Inc. |
| 5 | * | 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public | 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 | 7 | * License. See the file "COPYING" in the main directory of this archive |
| @@ -16,36 +16,45 @@ | |||
| 16 | * SH7750S/SH7750R | 16 | * SH7750S/SH7750R |
| 17 | * SH7751/SH7751R | 17 | * SH7751/SH7751R |
| 18 | * SH7760 | 18 | * SH7760 |
| 19 | * SH-X3 | ||
| 19 | * --------------------------------------------------------------------------- | 20 | * --------------------------------------------------------------------------- |
| 20 | */ | 21 | */ |
| 21 | 22 | #ifdef CONFIG_CPU_SUBTYPE_SHX3 | |
| 22 | #if !defined(CONFIG_CPU_SUBTYPE_SH7760) | 23 | #define TMU_012_BASE 0xffc10000 |
| 23 | #define TMU_TOCR 0xffd80000 /* Byte access */ | 24 | #define TMU_345_BASE 0xffc20000 |
| 25 | #else | ||
| 26 | #define TMU_012_BASE 0xffd80000 | ||
| 27 | #define TMU_345_BASE 0xfe100000 | ||
| 24 | #endif | 28 | #endif |
| 25 | #define TMU_TSTR 0xffd80004 /* Byte access */ | ||
| 26 | 29 | ||
| 27 | #define TMU0_TCOR 0xffd80008 /* Long access */ | 30 | #define TMU_TOCR TMU_012_BASE /* Not supported on all CPUs */ |
| 28 | #define TMU0_TCNT 0xffd8000c /* Long access */ | ||
| 29 | #define TMU0_TCR 0xffd80010 /* Word access */ | ||
| 30 | 31 | ||
| 31 | #define TMU1_TCOR 0xffd80014 /* Long access */ | 32 | #define TMU_012_TSTR (TMU_012_BASE + 0x04) |
| 32 | #define TMU1_TCNT 0xffd80018 /* Long access */ | 33 | #define TMU_345_TSTR (TMU_345_BASE + 0x04) |
| 33 | #define TMU1_TCR 0xffd8001c /* Word access */ | ||
| 34 | 34 | ||
| 35 | #define TMU2_TCOR 0xffd80020 /* Long access */ | 35 | #define TMU0_TCOR (TMU_012_BASE + 0x08) |
| 36 | #define TMU2_TCNT 0xffd80024 /* Long access */ | 36 | #define TMU0_TCNT (TMU_012_BASE + 0x0c) |
| 37 | #define TMU2_TCR 0xffd80028 /* Word access */ | 37 | #define TMU0_TCR (TMU_012_BASE + 0x10) |
| 38 | #define TMU2_TCPR 0xffd8002c /* Long access */ | ||
| 39 | 38 | ||
| 40 | #if !defined(CONFIG_CPU_SUBTYPE_SH7760) | 39 | #define TMU1_TCOR (TMU_012_BASE + 0x14) |
| 41 | #define TMU3_TCOR 0xfe100008 /* Long access */ | 40 | #define TMU1_TCNT (TMU_012_BASE + 0x18) |
| 42 | #define TMU3_TCNT 0xfe10000c /* Long access */ | 41 | #define TMU1_TCR (TMU_012_BASE + 0x1c) |
| 43 | #define TMU3_TCR 0xfe100010 /* Word access */ | ||
| 44 | 42 | ||
| 45 | #define TMU4_TCOR 0xfe100014 /* Long access */ | 43 | #define TMU2_TCOR (TMU_012_BASE + 0x20) |
| 46 | #define TMU4_TCNT 0xfe100018 /* Long access */ | 44 | #define TMU2_TCNT (TMU_012_BASE + 0x24) |
| 47 | #define TMU4_TCR 0xfe10001c /* Word access */ | 45 | #define TMU2_TCR (TMU_012_BASE + 0x28) |
| 48 | #endif | 46 | #define TMU2_TCPR (TMU_012_BASE + 0x2c) |
| 49 | 47 | ||
| 50 | #endif /* __ASM_CPU_SH4_TIMER_H */ | 48 | #define TMU3_TCOR (TMU_345_BASE + 0x08) |
| 49 | #define TMU3_TCNT (TMU_345_BASE + 0x0c) | ||
| 50 | #define TMU3_TCR (TMU_345_BASE + 0x10) | ||
| 51 | 51 | ||
| 52 | #define TMU4_TCOR (TMU_345_BASE + 0x14) | ||
| 53 | #define TMU4_TCNT (TMU_345_BASE + 0x18) | ||
| 54 | #define TMU4_TCR (TMU_345_BASE + 0x1c) | ||
| 55 | |||
| 56 | #define TMU5_TCOR (TMU_345_BASE + 0x20) | ||
| 57 | #define TMU5_TCNT (TMU_345_BASE + 0x24) | ||
| 58 | #define TMU5_TCR (TMU_345_BASE + 0x28) | ||
| 59 | |||
| 60 | #endif /* __ASM_CPU_SH4_TIMER_H */ | ||
diff --git a/include/asm-sh/fb.h b/include/asm-sh/fb.h new file mode 100644 index 000000000000..d92e99cd8c8a --- /dev/null +++ b/include/asm-sh/fb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-sh/futex-irq.h b/include/asm-sh/futex-irq.h new file mode 100644 index 000000000000..a9f16a7f9aea --- /dev/null +++ b/include/asm-sh/futex-irq.h | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | #ifndef __ASM_SH_FUTEX_IRQ_H | ||
| 2 | #define __ASM_SH_FUTEX_IRQ_H | ||
| 3 | |||
| 4 | #include <asm/system.h> | ||
| 5 | |||
| 6 | static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr, | ||
| 7 | int *oldval) | ||
| 8 | { | ||
| 9 | unsigned long flags; | ||
| 10 | int ret; | ||
| 11 | |||
| 12 | local_irq_save(flags); | ||
| 13 | |||
| 14 | ret = get_user(*oldval, uaddr); | ||
| 15 | if (!ret) | ||
| 16 | ret = put_user(oparg, uaddr); | ||
| 17 | |||
| 18 | local_irq_restore(flags); | ||
| 19 | |||
| 20 | return ret; | ||
| 21 | } | ||
| 22 | |||
| 23 | static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr, | ||
| 24 | int *oldval) | ||
| 25 | { | ||
| 26 | unsigned long flags; | ||
| 27 | int ret; | ||
| 28 | |||
| 29 | local_irq_save(flags); | ||
| 30 | |||
| 31 | ret = get_user(*oldval, uaddr); | ||
| 32 | if (!ret) | ||
| 33 | ret = put_user(*oldval + oparg, uaddr); | ||
| 34 | |||
| 35 | local_irq_restore(flags); | ||
| 36 | |||
| 37 | return ret; | ||
| 38 | } | ||
| 39 | |||
| 40 | static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr, | ||
| 41 | int *oldval) | ||
| 42 | { | ||
| 43 | unsigned long flags; | ||
| 44 | int ret; | ||
| 45 | |||
| 46 | local_irq_save(flags); | ||
| 47 | |||
| 48 | ret = get_user(*oldval, uaddr); | ||
| 49 | if (!ret) | ||
| 50 | ret = put_user(*oldval | oparg, uaddr); | ||
| 51 | |||
| 52 | local_irq_restore(flags); | ||
| 53 | |||
| 54 | return ret; | ||
| 55 | } | ||
| 56 | |||
| 57 | static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr, | ||
| 58 | int *oldval) | ||
| 59 | { | ||
| 60 | unsigned long flags; | ||
| 61 | int ret; | ||
| 62 | |||
| 63 | local_irq_save(flags); | ||
| 64 | |||
| 65 | ret = get_user(*oldval, uaddr); | ||
| 66 | if (!ret) | ||
| 67 | ret = put_user(*oldval & oparg, uaddr); | ||
| 68 | |||
| 69 | local_irq_restore(flags); | ||
| 70 | |||
| 71 | return ret; | ||
| 72 | } | ||
| 73 | |||
| 74 | static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr, | ||
| 75 | int *oldval) | ||
| 76 | { | ||
| 77 | unsigned long flags; | ||
| 78 | int ret; | ||
| 79 | |||
| 80 | local_irq_save(flags); | ||
| 81 | |||
| 82 | ret = get_user(*oldval, uaddr); | ||
| 83 | if (!ret) | ||
| 84 | ret = put_user(*oldval ^ oparg, uaddr); | ||
| 85 | |||
| 86 | local_irq_restore(flags); | ||
| 87 | |||
| 88 | return ret; | ||
| 89 | } | ||
| 90 | |||
| 91 | static inline int atomic_futex_op_cmpxchg_inatomic(int __user *uaddr, | ||
| 92 | int oldval, int newval) | ||
| 93 | { | ||
| 94 | unsigned long flags; | ||
| 95 | int ret, prev = 0; | ||
| 96 | |||
| 97 | local_irq_save(flags); | ||
| 98 | |||
| 99 | ret = get_user(prev, uaddr); | ||
| 100 | if (!ret && oldval == prev) | ||
| 101 | ret = put_user(newval, uaddr); | ||
| 102 | |||
| 103 | local_irq_restore(flags); | ||
| 104 | |||
| 105 | if (ret) | ||
| 106 | return ret; | ||
| 107 | |||
| 108 | return prev; | ||
| 109 | } | ||
| 110 | |||
| 111 | #endif /* __ASM_SH_FUTEX_IRQ_H */ | ||
diff --git a/include/asm-sh/futex.h b/include/asm-sh/futex.h index 6a332a9f099c..74ed3681d33c 100644 --- a/include/asm-sh/futex.h +++ b/include/asm-sh/futex.h | |||
| @@ -1,6 +1,77 @@ | |||
| 1 | #ifndef _ASM_FUTEX_H | 1 | #ifndef __ASM_SH_FUTEX_H |
| 2 | #define _ASM_FUTEX_H | 2 | #define __ASM_SH_FUTEX_H |
| 3 | 3 | ||
| 4 | #include <asm-generic/futex.h> | 4 | #ifdef __KERNEL__ |
| 5 | 5 | ||
| 6 | #endif | 6 | #include <linux/futex.h> |
| 7 | #include <asm/errno.h> | ||
| 8 | #include <asm/uaccess.h> | ||
| 9 | |||
| 10 | /* XXX: UP variants, fix for SH-4A and SMP.. */ | ||
| 11 | #include <asm/futex-irq.h> | ||
| 12 | |||
| 13 | static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | ||
| 14 | { | ||
| 15 | int op = (encoded_op >> 28) & 7; | ||
| 16 | int cmp = (encoded_op >> 24) & 15; | ||
| 17 | int oparg = (encoded_op << 8) >> 20; | ||
| 18 | int cmparg = (encoded_op << 20) >> 20; | ||
| 19 | int oldval = 0, ret; | ||
| 20 | |||
| 21 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
| 22 | oparg = 1 << oparg; | ||
| 23 | |||
| 24 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | ||
| 25 | return -EFAULT; | ||
| 26 | |||
| 27 | pagefault_disable(); | ||
| 28 | |||
| 29 | switch (op) { | ||
| 30 | case FUTEX_OP_SET: | ||
| 31 | ret = atomic_futex_op_xchg_set(oparg, uaddr, &oldval); | ||
| 32 | break; | ||
| 33 | case FUTEX_OP_ADD: | ||
| 34 | ret = atomic_futex_op_xchg_add(oparg, uaddr, &oldval); | ||
| 35 | break; | ||
| 36 | case FUTEX_OP_OR: | ||
| 37 | ret = atomic_futex_op_xchg_or(oparg, uaddr, &oldval); | ||
| 38 | break; | ||
| 39 | case FUTEX_OP_ANDN: | ||
| 40 | ret = atomic_futex_op_xchg_and(~oparg, uaddr, &oldval); | ||
| 41 | break; | ||
| 42 | case FUTEX_OP_XOR: | ||
| 43 | ret = atomic_futex_op_xchg_xor(oparg, uaddr, &oldval); | ||
| 44 | break; | ||
| 45 | default: | ||
| 46 | ret = -ENOSYS; | ||
| 47 | break; | ||
| 48 | } | ||
| 49 | |||
| 50 | pagefault_enable(); | ||
| 51 | |||
| 52 | if (!ret) { | ||
| 53 | switch (cmp) { | ||
| 54 | case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; | ||
| 55 | case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; | ||
| 56 | case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; | ||
| 57 | case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; | ||
| 58 | case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; | ||
| 59 | case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; | ||
| 60 | default: ret = -ENOSYS; | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | return ret; | ||
| 65 | } | ||
| 66 | |||
| 67 | static inline int | ||
| 68 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | ||
| 69 | { | ||
| 70 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | ||
| 71 | return -EFAULT; | ||
| 72 | |||
| 73 | return atomic_futex_op_cmpxchg_inatomic(uaddr, oldval, newval); | ||
| 74 | } | ||
| 75 | |||
| 76 | #endif /* __KERNEL__ */ | ||
| 77 | #endif /* __ASM_SH_FUTEX_H */ | ||
diff --git a/include/asm-sh/hd64461.h b/include/asm-sh/hd64461.h index 27e5c34e2659..4dd8592ca014 100644 --- a/include/asm-sh/hd64461.h +++ b/include/asm-sh/hd64461.h | |||
| @@ -1,200 +1,241 @@ | |||
| 1 | #ifndef __ASM_SH_HD64461 | 1 | #ifndef __ASM_SH_HD64461 |
| 2 | #define __ASM_SH_HD64461 | 2 | #define __ASM_SH_HD64461 |
| 3 | /* | 3 | /* |
| 4 | * $Id: hd64461.h,v 1.5 2004/03/16 00:07:51 lethal Exp $ | 4 | * Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com> |
| 5 | * Copyright (C) 2004 Paul Mundt | ||
| 5 | * Copyright (C) 2000 YAEGASHI Takeshi | 6 | * Copyright (C) 2000 YAEGASHI Takeshi |
| 6 | * Hitachi HD64461 companion chip support | 7 | * |
| 8 | * Hitachi HD64461 companion chip support | ||
| 9 | * (please note manual reference 0x10000000 = 0xb0000000) | ||
| 7 | */ | 10 | */ |
| 8 | 11 | ||
| 9 | /* Constants for PCMCIA mappings */ | 12 | /* Constants for PCMCIA mappings */ |
| 10 | #define HD64461_PCC_WINDOW 0x01000000 | 13 | #define HD64461_PCC_WINDOW 0x01000000 |
| 11 | 14 | ||
| 12 | #define HD64461_PCC0_BASE 0xb8000000 /* area 6 */ | 15 | /* Area 6 - Slot 0 - memory and/or IO card */ |
| 13 | #define HD64461_PCC0_ATTR (HD64461_PCC0_BASE) | 16 | #define HD64461_PCC0_BASE (CONFIG_HD64461_IOBASE + 0x8000000) |
| 14 | #define HD64461_PCC0_COMM (HD64461_PCC0_BASE+HD64461_PCC_WINDOW) | 17 | #define HD64461_PCC0_ATTR (HD64461_PCC0_BASE) /* 0xb80000000 */ |
| 15 | #define HD64461_PCC0_IO (HD64461_PCC0_BASE+2*HD64461_PCC_WINDOW) | 18 | #define HD64461_PCC0_COMM (HD64461_PCC0_BASE+HD64461_PCC_WINDOW) /* 0xb90000000 */ |
| 16 | 19 | #define HD64461_PCC0_IO (HD64461_PCC0_BASE+2*HD64461_PCC_WINDOW) /* 0xba0000000 */ | |
| 17 | #define HD64461_PCC1_BASE 0xb4000000 /* area 5 */ | 20 | |
| 18 | #define HD64461_PCC1_ATTR (HD64461_PCC1_BASE) | 21 | /* Area 5 - Slot 1 - memory card only */ |
| 19 | #define HD64461_PCC1_COMM (HD64461_PCC1_BASE+HD64461_PCC_WINDOW) | 22 | #define HD64461_PCC1_BASE (CONFIG_HD64461_IOBASE + 0x4000000) |
| 20 | 23 | #define HD64461_PCC1_ATTR (HD64461_PCC1_BASE) /* 0xb4000000 */ | |
| 21 | #define HD64461_STBCR 0x10000 | 24 | #define HD64461_PCC1_COMM (HD64461_PCC1_BASE+HD64461_PCC_WINDOW) /* 0xb5000000 */ |
| 22 | #define HD64461_STBCR_CKIO_STBY 0x2000 | 25 | |
| 23 | #define HD64461_STBCR_SAFECKE_IST 0x1000 | 26 | /* Standby Control Register for HD64461 */ |
| 24 | #define HD64461_STBCR_SLCKE_IST 0x0800 | 27 | #define HD64461_STBCR CONFIG_HD64461_IOBASE |
| 25 | #define HD64461_STBCR_SAFECKE_OST 0x0400 | 28 | #define HD64461_STBCR_CKIO_STBY 0x2000 |
| 26 | #define HD64461_STBCR_SLCKE_OST 0x0200 | 29 | #define HD64461_STBCR_SAFECKE_IST 0x1000 |
| 27 | #define HD64461_STBCR_SMIAST 0x0100 | 30 | #define HD64461_STBCR_SLCKE_IST 0x0800 |
| 28 | #define HD64461_STBCR_SLCDST 0x0080 | 31 | #define HD64461_STBCR_SAFECKE_OST 0x0400 |
| 29 | #define HD64461_STBCR_SPC0ST 0x0040 | 32 | #define HD64461_STBCR_SLCKE_OST 0x0200 |
| 30 | #define HD64461_STBCR_SPC1ST 0x0020 | 33 | #define HD64461_STBCR_SMIAST 0x0100 |
| 31 | #define HD64461_STBCR_SAFEST 0x0010 | 34 | #define HD64461_STBCR_SLCDST 0x0080 |
| 32 | #define HD64461_STBCR_STM0ST 0x0008 | 35 | #define HD64461_STBCR_SPC0ST 0x0040 |
| 33 | #define HD64461_STBCR_STM1ST 0x0004 | 36 | #define HD64461_STBCR_SPC1ST 0x0020 |
| 34 | #define HD64461_STBCR_SIRST 0x0002 | 37 | #define HD64461_STBCR_SAFEST 0x0010 |
| 35 | #define HD64461_STBCR_SURTST 0x0001 | 38 | #define HD64461_STBCR_STM0ST 0x0008 |
| 36 | 39 | #define HD64461_STBCR_STM1ST 0x0004 | |
| 37 | #define HD64461_SYSCR 0x10002 | 40 | #define HD64461_STBCR_SIRST 0x0002 |
| 38 | #define HD64461_SCPUCR 0x10004 | 41 | #define HD64461_STBCR_SURTST 0x0001 |
| 39 | 42 | ||
| 40 | #define HD64461_LCDCBAR 0x11000 | 43 | /* System Configuration Register */ |
| 41 | #define HD64461_LCDCLOR 0x11002 | 44 | #define HD64461_SYSCR (CONFIG_HD64461_IOBASE + 0x02) |
| 42 | #define HD64461_LCDCCR 0x11004 | 45 | |
| 43 | #define HD64461_LCDCCR_STBACK 0x0400 | 46 | /* CPU Data Bus Control Register */ |
| 44 | #define HD64461_LCDCCR_STREQ 0x0100 | 47 | #define HD64461_SCPUCR (CONFIG_HD64461_IOBASE + 0x04) |
| 45 | #define HD64461_LCDCCR_MOFF 0x0080 | 48 | |
| 46 | #define HD64461_LCDCCR_REFSEL 0x0040 | 49 | /* Base Adress Register */ |
| 47 | #define HD64461_LCDCCR_EPON 0x0020 | 50 | #define HD64461_LCDCBAR (CONFIG_HD64461_IOBASE + 0x1000) |
| 48 | #define HD64461_LCDCCR_SPON 0x0010 | 51 | |
| 49 | 52 | /* Line increment adress */ | |
| 50 | #define HD64461_LDR1 0x11010 | 53 | #define HD64461_LCDCLOR (CONFIG_HD64461_IOBASE + 0x1002) |
| 51 | #define HD64461_LDR1_DON 0x01 | 54 | |
| 52 | #define HD64461_LDR1_DINV 0x80 | 55 | /* Controls LCD controller */ |
| 53 | 56 | #define HD64461_LCDCCR (CONFIG_HD64461_IOBASE + 0x1004) | |
| 54 | #define HD64461_LDR2 0x11012 | 57 | |
| 55 | #define HD64461_LDHNCR 0x11014 | 58 | /* LCCDR control bits */ |
| 56 | #define HD64461_LDHNSR 0x11016 | 59 | #define HD64461_LCDCCR_STBACK 0x0400 /* Standby Back */ |
| 57 | #define HD64461_LDVNTR 0x11018 | 60 | #define HD64461_LCDCCR_STREQ 0x0100 /* Standby Request */ |
| 58 | #define HD64461_LDVNDR 0x1101a | 61 | #define HD64461_LCDCCR_MOFF 0x0080 /* Memory Off */ |
| 59 | #define HD64461_LDVSPR 0x1101c | 62 | #define HD64461_LCDCCR_REFSEL 0x0040 /* Refresh Select */ |
| 60 | #define HD64461_LDR3 0x1101e | 63 | #define HD64461_LCDCCR_EPON 0x0020 /* End Power On */ |
| 61 | 64 | #define HD64461_LCDCCR_SPON 0x0010 /* Start Power On */ | |
| 62 | #define HD64461_CPTWAR 0x11030 | 65 | |
| 63 | #define HD64461_CPTWDR 0x11032 | 66 | /* Controls LCD (1) */ |
| 64 | #define HD64461_CPTRAR 0x11034 | 67 | #define HD64461_LDR1 (CONFIG_HD64461_IOBASE + 0x1010) |
| 65 | #define HD64461_CPTRDR 0x11036 | 68 | #define HD64461_LDR1_DON 0x01 /* Display On */ |
| 66 | 69 | #define HD64461_LDR1_DINV 0x80 /* Display Invert */ | |
| 67 | #define HD64461_GRDOR 0x11040 | 70 | |
| 68 | #define HD64461_GRSCR 0x11042 | 71 | /* Controls LCD (2) */ |
| 69 | #define HD64461_GRCFGR 0x11044 | 72 | #define HD64461_LDR2 (CONFIG_HD64461_IOBASE + 0x1012) |
| 70 | #define HD64461_GRCFGR_ACCSTATUS 0x10 | 73 | #define HD64461_LDHNCR (CONFIG_HD64461_IOBASE + 0x1014) /* Number of horizontal characters */ |
| 71 | #define HD64461_GRCFGR_ACCRESET 0x08 | 74 | #define HD64461_LDHNSR (CONFIG_HD64461_IOBASE + 0x1016) /* Specify output start position + width of CL1 */ |
| 72 | #define HD64461_GRCFGR_ACCSTART_BITBLT 0x06 | 75 | #define HD64461_LDVNTR (CONFIG_HD64461_IOBASE + 0x1018) /* Specify total vertical lines */ |
| 73 | #define HD64461_GRCFGR_ACCSTART_LINE 0x04 | 76 | #define HD64461_LDVNDR (CONFIG_HD64461_IOBASE + 0x101a) /* specify number of display vertical lines */ |
| 74 | #define HD64461_GRCFGR_COLORDEPTH16 0x01 | 77 | #define HD64461_LDVSPR (CONFIG_HD64461_IOBASE + 0x101c) /* specify vertical synchronization pos and AC nr */ |
| 75 | 78 | ||
| 76 | #define HD64461_LNSARH 0x11046 | 79 | /* Controls LCD (3) */ |
| 77 | #define HD64461_LNSARL 0x11048 | 80 | #define HD64461_LDR3 (CONFIG_HD64461_IOBASE + 0x101e) |
| 78 | #define HD64461_LNAXLR 0x1104a | 81 | |
| 79 | #define HD64461_LNDGR 0x1104c | 82 | /* Palette Registers */ |
| 80 | #define HD64461_LNAXR 0x1104e | 83 | #define HD64461_CPTWAR (CONFIG_HD64461_IOBASE + 0x1030) /* Color Palette Write Adress Register */ |
| 81 | #define HD64461_LNERTR 0x11050 | 84 | #define HD64461_CPTWDR (CONFIG_HD64461_IOBASE + 0x1032) /* Color Palette Write Data Register */ |
| 82 | #define HD64461_LNMDR 0x11052 | 85 | #define HD64461_CPTRAR (CONFIG_HD64461_IOBASE + 0x1034) /* Color Palette Read Adress Register */ |
| 83 | #define HD64461_BBTSSARH 0x11054 | 86 | #define HD64461_CPTRDR (CONFIG_HD64461_IOBASE + 0x1036) /* Color Palette Read Data Register */ |
| 84 | #define HD64461_BBTSSARL 0x11056 | 87 | |
| 85 | #define HD64461_BBTDSARH 0x11058 | 88 | #define HD64461_GRDOR (CONFIG_HD64461_IOBASE + 0x1040) /* Display Resolution Offset Register */ |
| 86 | #define HD64461_BBTDSARL 0x1105a | 89 | #define HD64461_GRSCR (CONFIG_HD64461_IOBASE + 0x1042) /* Solid Color Register */ |
| 87 | #define HD64461_BBTDWR 0x1105c | 90 | #define HD64461_GRCFGR (CONFIG_HD64461_IOBASE + 0x1044) /* Accelerator Configuration Register */ |
| 88 | #define HD64461_BBTDHR 0x1105e | 91 | |
| 89 | #define HD64461_BBTPARH 0x11060 | 92 | #define HD64461_GRCFGR_ACCSTATUS 0x10 /* Accelerator Status */ |
| 90 | #define HD64461_BBTPARL 0x11062 | 93 | #define HD64461_GRCFGR_ACCRESET 0x08 /* Accelerator Reset */ |
| 91 | #define HD64461_BBTMARH 0x11064 | 94 | #define HD64461_GRCFGR_ACCSTART_BITBLT 0x06 /* Accelerator Start BITBLT */ |
| 92 | #define HD64461_BBTMARL 0x11066 | 95 | #define HD64461_GRCFGR_ACCSTART_LINE 0x04 /* Accelerator Start Line Drawing */ |
| 93 | #define HD64461_BBTROPR 0x11068 | 96 | #define HD64461_GRCFGR_COLORDEPTH16 0x01 /* Sets Colordepth 16 for Accelerator */ |
| 94 | #define HD64461_BBTMDR 0x1106a | 97 | #define HD64461_GRCFGR_COLORDEPTH8 0x01 /* Sets Colordepth 8 for Accelerator */ |
| 98 | |||
| 99 | /* Line Drawing Registers */ | ||
| 100 | #define HD64461_LNSARH (CONFIG_HD64461_IOBASE + 0x1046) /* Line Start Adress Register (H) */ | ||
| 101 | #define HD64461_LNSARL (CONFIG_HD64461_IOBASE + 0x1048) /* Line Start Adress Register (L) */ | ||
| 102 | #define HD64461_LNAXLR (CONFIG_HD64461_IOBASE + 0x104a) /* Axis Pixel Length Register */ | ||
| 103 | #define HD64461_LNDGR (CONFIG_HD64461_IOBASE + 0x104c) /* Diagonal Register */ | ||
| 104 | #define HD64461_LNAXR (CONFIG_HD64461_IOBASE + 0x104e) /* Axial Register */ | ||
| 105 | #define HD64461_LNERTR (CONFIG_HD64461_IOBASE + 0x1050) /* Start Error Term Register */ | ||
| 106 | #define HD64461_LNMDR (CONFIG_HD64461_IOBASE + 0x1052) /* Line Mode Register */ | ||
| 107 | |||
| 108 | /* BitBLT Registers */ | ||
| 109 | #define HD64461_BBTSSARH (CONFIG_HD64461_IOBASE + 0x1054) /* Source Start Adress Register (H) */ | ||
| 110 | #define HD64461_BBTSSARL (CONFIG_HD64461_IOBASE + 0x1056) /* Source Start Adress Register (L) */ | ||
| 111 | #define HD64461_BBTDSARH (CONFIG_HD64461_IOBASE + 0x1058) /* Destination Start Adress Register (H) */ | ||
| 112 | #define HD64461_BBTDSARL (CONFIG_HD64461_IOBASE + 0x105a) /* Destination Start Adress Register (L) */ | ||
| 113 | #define HD64461_BBTDWR (CONFIG_HD64461_IOBASE + 0x105c) /* Destination Block Width Register */ | ||
| 114 | #define HD64461_BBTDHR (CONFIG_HD64461_IOBASE + 0x105e) /* Destination Block Height Register */ | ||
| 115 | #define HD64461_BBTPARH (CONFIG_HD64461_IOBASE + 0x1060) /* Pattern Start Adress Register (H) */ | ||
| 116 | #define HD64461_BBTPARL (CONFIG_HD64461_IOBASE + 0x1062) /* Pattern Start Adress Register (L) */ | ||
| 117 | #define HD64461_BBTMARH (CONFIG_HD64461_IOBASE + 0x1064) /* Mask Start Adress Register (H) */ | ||
| 118 | #define HD64461_BBTMARL (CONFIG_HD64461_IOBASE + 0x1066) /* Mask Start Adress Register (L) */ | ||
| 119 | #define HD64461_BBTROPR (CONFIG_HD64461_IOBASE + 0x1068) /* ROP Register */ | ||
| 120 | #define HD64461_BBTMDR (CONFIG_HD64461_IOBASE + 0x106a) /* BitBLT Mode Register */ | ||
| 95 | 121 | ||
| 96 | /* PC Card Controller Registers */ | 122 | /* PC Card Controller Registers */ |
| 97 | #define HD64461_PCC0ISR 0x12000 /* socket 0 interface status */ | 123 | /* Maps to Physical Area 6 */ |
| 98 | #define HD64461_PCC0GCR 0x12002 /* socket 0 general control */ | 124 | #define HD64461_PCC0ISR (CONFIG_HD64461_IOBASE + 0x2000) /* socket 0 interface status */ |
| 99 | #define HD64461_PCC0CSCR 0x12004 /* socket 0 card status change */ | 125 | #define HD64461_PCC0GCR (CONFIG_HD64461_IOBASE + 0x2002) /* socket 0 general control */ |
| 100 | #define HD64461_PCC0CSCIER 0x12006 /* socket 0 card status change interrupt enable */ | 126 | #define HD64461_PCC0CSCR (CONFIG_HD64461_IOBASE + 0x2004) /* socket 0 card status change */ |
| 101 | #define HD64461_PCC0SCR 0x12008 /* socket 0 software control */ | 127 | #define HD64461_PCC0CSCIER (CONFIG_HD64461_IOBASE + 0x2006) /* socket 0 card status change interrupt enable */ |
| 102 | #define HD64461_PCC1ISR 0x12010 /* socket 1 interface status */ | 128 | #define HD64461_PCC0SCR (CONFIG_HD64461_IOBASE + 0x2008) /* socket 0 software control */ |
| 103 | #define HD64461_PCC1GCR 0x12012 /* socket 1 general control */ | 129 | /* Maps to Physical Area 5 */ |
| 104 | #define HD64461_PCC1CSCR 0x12014 /* socket 1 card status change */ | 130 | #define HD64461_PCC1ISR (CONFIG_HD64461_IOBASE + 0x2010) /* socket 1 interface status */ |
| 105 | #define HD64461_PCC1CSCIER 0x12016 /* socket 1 card status change interrupt enable */ | 131 | #define HD64461_PCC1GCR (CONFIG_HD64461_IOBASE + 0x2012) /* socket 1 general control */ |
| 106 | #define HD64461_PCC1SCR 0x12018 /* socket 1 software control */ | 132 | #define HD64461_PCC1CSCR (CONFIG_HD64461_IOBASE + 0x2014) /* socket 1 card status change */ |
| 133 | #define HD64461_PCC1CSCIER (CONFIG_HD64461_IOBASE + 0x2016) /* socket 1 card status change interrupt enable */ | ||
| 134 | #define HD64461_PCC1SCR (CONFIG_HD64461_IOBASE + 0x2018) /* socket 1 software control */ | ||
| 107 | 135 | ||
| 108 | /* PCC Interface Status Register */ | 136 | /* PCC Interface Status Register */ |
| 109 | #define HD64461_PCCISR_READY 0x80 /* card ready */ | 137 | #define HD64461_PCCISR_READY 0x80 /* card ready */ |
| 110 | #define HD64461_PCCISR_MWP 0x40 /* card write-protected */ | 138 | #define HD64461_PCCISR_MWP 0x40 /* card write-protected */ |
| 111 | #define HD64461_PCCISR_VS2 0x20 /* voltage select pin 2 */ | 139 | #define HD64461_PCCISR_VS2 0x20 /* voltage select pin 2 */ |
| 112 | #define HD64461_PCCISR_VS1 0x10 /* voltage select pin 1 */ | 140 | #define HD64461_PCCISR_VS1 0x10 /* voltage select pin 1 */ |
| 113 | #define HD64461_PCCISR_CD2 0x08 /* card detect 2 */ | 141 | #define HD64461_PCCISR_CD2 0x08 /* card detect 2 */ |
| 114 | #define HD64461_PCCISR_CD1 0x04 /* card detect 1 */ | 142 | #define HD64461_PCCISR_CD1 0x04 /* card detect 1 */ |
| 115 | #define HD64461_PCCISR_BVD2 0x02 /* battery 1 */ | 143 | #define HD64461_PCCISR_BVD2 0x02 /* battery 1 */ |
| 116 | #define HD64461_PCCISR_BVD1 0x01 /* battery 1 */ | 144 | #define HD64461_PCCISR_BVD1 0x01 /* battery 1 */ |
| 117 | 145 | ||
| 118 | #define HD64461_PCCISR_PCD_MASK 0x0c /* card detect */ | 146 | #define HD64461_PCCISR_PCD_MASK 0x0c /* card detect */ |
| 119 | #define HD64461_PCCISR_BVD_MASK 0x03 /* battery voltage */ | 147 | #define HD64461_PCCISR_BVD_MASK 0x03 /* battery voltage */ |
| 120 | #define HD64461_PCCISR_BVD_BATGOOD 0x03 /* battery good */ | 148 | #define HD64461_PCCISR_BVD_BATGOOD 0x03 /* battery good */ |
| 121 | #define HD64461_PCCISR_BVD_BATWARN 0x01 /* battery low warning */ | 149 | #define HD64461_PCCISR_BVD_BATWARN 0x01 /* battery low warning */ |
| 122 | #define HD64461_PCCISR_BVD_BATDEAD1 0x02 /* battery dead */ | 150 | #define HD64461_PCCISR_BVD_BATDEAD1 0x02 /* battery dead */ |
| 123 | #define HD64461_PCCISR_BVD_BATDEAD2 0x00 /* battery dead */ | 151 | #define HD64461_PCCISR_BVD_BATDEAD2 0x00 /* battery dead */ |
| 124 | 152 | ||
| 125 | /* PCC General Control Register */ | 153 | /* PCC General Control Register */ |
| 126 | #define HD64461_PCCGCR_DRVE 0x80 /* output drive */ | 154 | #define HD64461_PCCGCR_DRVE 0x80 /* output drive */ |
| 127 | #define HD64461_PCCGCR_PCCR 0x40 /* PC card reset */ | 155 | #define HD64461_PCCGCR_PCCR 0x40 /* PC card reset */ |
| 128 | #define HD64461_PCCGCR_PCCT 0x20 /* PC card type, 1=IO&mem, 0=mem */ | 156 | #define HD64461_PCCGCR_PCCT 0x20 /* PC card type, 1=IO&mem, 0=mem */ |
| 129 | #define HD64461_PCCGCR_VCC0 0x10 /* voltage control pin VCC0SEL0 */ | 157 | #define HD64461_PCCGCR_VCC0 0x10 /* voltage control pin VCC0SEL0 */ |
| 130 | #define HD64461_PCCGCR_PMMOD 0x08 /* memory mode */ | 158 | #define HD64461_PCCGCR_PMMOD 0x08 /* memory mode */ |
| 131 | #define HD64461_PCCGCR_PA25 0x04 /* pin A25 */ | 159 | #define HD64461_PCCGCR_PA25 0x04 /* pin A25 */ |
| 132 | #define HD64461_PCCGCR_PA24 0x02 /* pin A24 */ | 160 | #define HD64461_PCCGCR_PA24 0x02 /* pin A24 */ |
| 133 | #define HD64461_PCCGCR_REG 0x01 /* pin PCC0REG# */ | 161 | #define HD64461_PCCGCR_REG 0x01 /* pin PCC0REG# */ |
| 134 | 162 | ||
| 135 | /* PCC Card Status Change Register */ | 163 | /* PCC Card Status Change Register */ |
| 136 | #define HD64461_PCCCSCR_SCDI 0x80 /* sw card detect intr */ | 164 | #define HD64461_PCCCSCR_SCDI 0x80 /* sw card detect intr */ |
| 137 | #define HD64461_PCCCSCR_SRV1 0x40 /* reserved */ | 165 | #define HD64461_PCCCSCR_SRV1 0x40 /* reserved */ |
| 138 | #define HD64461_PCCCSCR_IREQ 0x20 /* IREQ intr req */ | 166 | #define HD64461_PCCCSCR_IREQ 0x20 /* IREQ intr req */ |
| 139 | #define HD64461_PCCCSCR_SC 0x10 /* STSCHG (status change) pin */ | 167 | #define HD64461_PCCCSCR_SC 0x10 /* STSCHG (status change) pin */ |
| 140 | #define HD64461_PCCCSCR_CDC 0x08 /* CD (card detect) change */ | 168 | #define HD64461_PCCCSCR_CDC 0x08 /* CD (card detect) change */ |
| 141 | #define HD64461_PCCCSCR_RC 0x04 /* READY change */ | 169 | #define HD64461_PCCCSCR_RC 0x04 /* READY change */ |
| 142 | #define HD64461_PCCCSCR_BW 0x02 /* battery warning change */ | 170 | #define HD64461_PCCCSCR_BW 0x02 /* battery warning change */ |
| 143 | #define HD64461_PCCCSCR_BD 0x01 /* battery dead change */ | 171 | #define HD64461_PCCCSCR_BD 0x01 /* battery dead change */ |
| 144 | 172 | ||
| 145 | /* PCC Card Status Change Interrupt Enable Register */ | 173 | /* PCC Card Status Change Interrupt Enable Register */ |
| 146 | #define HD64461_PCCCSCIER_CRE 0x80 /* change reset enable */ | 174 | #define HD64461_PCCCSCIER_CRE 0x80 /* change reset enable */ |
| 147 | #define HD64461_PCCCSCIER_IREQE_MASK 0x60 /* IREQ enable */ | 175 | #define HD64461_PCCCSCIER_IREQE_MASK 0x60 /* IREQ enable */ |
| 148 | #define HD64461_PCCCSCIER_IREQE_DISABLED 0x00 /* IREQ disabled */ | 176 | #define HD64461_PCCCSCIER_IREQE_DISABLED 0x00 /* IREQ disabled */ |
| 149 | #define HD64461_PCCCSCIER_IREQE_LEVEL 0x20 /* IREQ level-triggered */ | 177 | #define HD64461_PCCCSCIER_IREQE_LEVEL 0x20 /* IREQ level-triggered */ |
| 150 | #define HD64461_PCCCSCIER_IREQE_FALLING 0x40 /* IREQ falling-edge-trig */ | 178 | #define HD64461_PCCCSCIER_IREQE_FALLING 0x40 /* IREQ falling-edge-trig */ |
| 151 | #define HD64461_PCCCSCIER_IREQE_RISING 0x60 /* IREQ rising-edge-trig */ | 179 | #define HD64461_PCCCSCIER_IREQE_RISING 0x60 /* IREQ rising-edge-trig */ |
| 152 | 180 | ||
| 153 | #define HD64461_PCCCSCIER_SCE 0x10 /* status change enable */ | 181 | #define HD64461_PCCCSCIER_SCE 0x10 /* status change enable */ |
| 154 | #define HD64461_PCCCSCIER_CDE 0x08 /* card detect change enable */ | 182 | #define HD64461_PCCCSCIER_CDE 0x08 /* card detect change enable */ |
| 155 | #define HD64461_PCCCSCIER_RE 0x04 /* ready change enable */ | 183 | #define HD64461_PCCCSCIER_RE 0x04 /* ready change enable */ |
| 156 | #define HD64461_PCCCSCIER_BWE 0x02 /* battery warn change enable */ | 184 | #define HD64461_PCCCSCIER_BWE 0x02 /* battery warn change enable */ |
| 157 | #define HD64461_PCCCSCIER_BDE 0x01 /* battery dead change enable*/ | 185 | #define HD64461_PCCCSCIER_BDE 0x01 /* battery dead change enable*/ |
| 158 | 186 | ||
| 159 | /* PCC Software Control Register */ | 187 | /* PCC Software Control Register */ |
| 160 | #define HD64461_PCCSCR_VCC1 0x02 /* voltage control pin 1 */ | 188 | #define HD64461_PCCSCR_VCC1 0x02 /* voltage control pin 1 */ |
| 161 | #define HD64461_PCCSCR_SWP 0x01 /* write protect */ | 189 | #define HD64461_PCCSCR_SWP 0x01 /* write protect */ |
| 162 | 190 | ||
| 163 | #define HD64461_P0OCR 0x1202a | 191 | /* PCC0 Output Pins Control Register */ |
| 164 | #define HD64461_P1OCR 0x1202c | 192 | #define HD64461_P0OCR (CONFIG_HD64461_IOBASE + 0x202a) |
| 165 | #define HD64461_PGCR 0x1202e | 193 | |
| 166 | 194 | /* PCC1 Output Pins Control Register */ | |
| 167 | #define HD64461_GPACR 0x14000 | 195 | #define HD64461_P1OCR (CONFIG_HD64461_IOBASE + 0x202c) |
| 168 | #define HD64461_GPBCR 0x14002 | 196 | |
| 169 | #define HD64461_GPCCR 0x14004 | 197 | /* PC Card General Control Register */ |
| 170 | #define HD64461_GPDCR 0x14006 | 198 | #define HD64461_PGCR (CONFIG_HD64461_IOBASE + 0x202e) |
| 171 | #define HD64461_GPADR 0x14010 | 199 | |
| 172 | #define HD64461_GPBDR 0x14012 | 200 | /* Port Control Registers */ |
| 173 | #define HD64461_GPCDR 0x14014 | 201 | #define HD64461_GPACR (CONFIG_HD64461_IOBASE + 0x4000) /* Port A - Handles IRDA/TIMER */ |
| 174 | #define HD64461_GPDDR 0x14016 | 202 | #define HD64461_GPBCR (CONFIG_HD64461_IOBASE + 0x4002) /* Port B - Handles UART */ |
| 175 | #define HD64461_GPAICR 0x14020 | 203 | #define HD64461_GPCCR (CONFIG_HD64461_IOBASE + 0x4004) /* Port C - Handles PCMCIA 1 */ |
| 176 | #define HD64461_GPBICR 0x14022 | 204 | #define HD64461_GPDCR (CONFIG_HD64461_IOBASE + 0x4006) /* Port D - Handles PCMCIA 1 */ |
| 177 | #define HD64461_GPCICR 0x14024 | 205 | |
| 178 | #define HD64461_GPDICR 0x14026 | 206 | /* Port Control Data Registers */ |
| 179 | #define HD64461_GPAISR 0x14040 | 207 | #define HD64461_GPADR (CONFIG_HD64461_IOBASE + 0x4010) /* A */ |
| 180 | #define HD64461_GPBISR 0x14042 | 208 | #define HD64461_GPBDR (CONFIG_HD64461_IOBASE + 0x4012) /* B */ |
| 181 | #define HD64461_GPCISR 0x14044 | 209 | #define HD64461_GPCDR (CONFIG_HD64461_IOBASE + 0x4014) /* C */ |
| 182 | #define HD64461_GPDISR 0x14046 | 210 | #define HD64461_GPDDR (CONFIG_HD64461_IOBASE + 0x4016) /* D */ |
| 183 | 211 | ||
| 184 | #define HD64461_NIRR 0x15000 | 212 | /* Interrupt Control Registers */ |
| 185 | #define HD64461_NIMR 0x15002 | 213 | #define HD64461_GPAICR (CONFIG_HD64461_IOBASE + 0x4020) /* A */ |
| 186 | 214 | #define HD64461_GPBICR (CONFIG_HD64461_IOBASE + 0x4022) /* B */ | |
| 187 | #define HD64461_IRQBASE OFFCHIP_IRQ_BASE | 215 | #define HD64461_GPCICR (CONFIG_HD64461_IOBASE + 0x4024) /* C */ |
| 188 | #define HD64461_IRQ_NUM 16 | 216 | #define HD64461_GPDICR (CONFIG_HD64461_IOBASE + 0x4026) /* D */ |
| 189 | 217 | ||
| 190 | #define HD64461_IRQ_UART (HD64461_IRQBASE+5) | 218 | /* Interrupt Status Registers */ |
| 191 | #define HD64461_IRQ_IRDA (HD64461_IRQBASE+6) | 219 | #define HD64461_GPAISR (CONFIG_HD64461_IOBASE + 0x4040) /* A */ |
| 192 | #define HD64461_IRQ_TMU1 (HD64461_IRQBASE+9) | 220 | #define HD64461_GPBISR (CONFIG_HD64461_IOBASE + 0x4042) /* B */ |
| 193 | #define HD64461_IRQ_TMU0 (HD64461_IRQBASE+10) | 221 | #define HD64461_GPCISR (CONFIG_HD64461_IOBASE + 0x4044) /* C */ |
| 194 | #define HD64461_IRQ_GPIO (HD64461_IRQBASE+11) | 222 | #define HD64461_GPDISR (CONFIG_HD64461_IOBASE + 0x4046) /* D */ |
| 195 | #define HD64461_IRQ_AFE (HD64461_IRQBASE+12) | 223 | |
| 196 | #define HD64461_IRQ_PCC1 (HD64461_IRQBASE+13) | 224 | /* Interrupt Request Register & Interrupt Mask Register */ |
| 197 | #define HD64461_IRQ_PCC0 (HD64461_IRQBASE+14) | 225 | #define HD64461_NIRR (CONFIG_HD64461_IOBASE + 0x5000) |
| 226 | #define HD64461_NIMR (CONFIG_HD64461_IOBASE + 0x5002) | ||
| 227 | |||
| 228 | #define HD64461_IRQBASE OFFCHIP_IRQ_BASE | ||
| 229 | #define HD64461_IRQ_NUM 16 | ||
| 230 | |||
| 231 | #define HD64461_IRQ_UART (HD64461_IRQBASE+5) | ||
| 232 | #define HD64461_IRQ_IRDA (HD64461_IRQBASE+6) | ||
| 233 | #define HD64461_IRQ_TMU1 (HD64461_IRQBASE+9) | ||
| 234 | #define HD64461_IRQ_TMU0 (HD64461_IRQBASE+10) | ||
| 235 | #define HD64461_IRQ_GPIO (HD64461_IRQBASE+11) | ||
| 236 | #define HD64461_IRQ_AFE (HD64461_IRQBASE+12) | ||
| 237 | #define HD64461_IRQ_PCC1 (HD64461_IRQBASE+13) | ||
| 238 | #define HD64461_IRQ_PCC0 (HD64461_IRQBASE+14) | ||
| 198 | 239 | ||
| 199 | #define __IO_PREFIX hd64461 | 240 | #define __IO_PREFIX hd64461 |
| 200 | #include <asm/io_generic.h> | 241 | #include <asm/io_generic.h> |
diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h index 80ee1cda7498..4ca3f765bacc 100644 --- a/include/asm-sh/hw_irq.h +++ b/include/asm-sh/hw_irq.h | |||
| @@ -5,4 +5,46 @@ | |||
| 5 | 5 | ||
| 6 | extern atomic_t irq_err_count; | 6 | extern atomic_t irq_err_count; |
| 7 | 7 | ||
| 8 | struct intc2_data { | ||
| 9 | unsigned short irq; | ||
| 10 | unsigned char ipr_offset, ipr_shift; | ||
| 11 | unsigned char msk_offset, msk_shift; | ||
| 12 | unsigned char priority; | ||
| 13 | }; | ||
| 14 | |||
| 15 | struct intc2_desc { | ||
| 16 | unsigned long prio_base; | ||
| 17 | unsigned long msk_base; | ||
| 18 | unsigned long mskclr_base; | ||
| 19 | struct intc2_data *intc2_data; | ||
| 20 | unsigned int nr_irqs; | ||
| 21 | struct irq_chip chip; | ||
| 22 | }; | ||
| 23 | |||
| 24 | void register_intc2_controller(struct intc2_desc *); | ||
| 25 | void init_IRQ_intc2(void); | ||
| 26 | |||
| 27 | struct ipr_data { | ||
| 28 | unsigned char irq; | ||
| 29 | unsigned char ipr_idx; /* Index for the IPR registered */ | ||
| 30 | unsigned char shift; /* Number of bits to shift the data */ | ||
| 31 | unsigned char priority; /* The priority */ | ||
| 32 | }; | ||
| 33 | |||
| 34 | struct ipr_desc { | ||
| 35 | unsigned long *ipr_offsets; | ||
| 36 | unsigned int nr_offsets; | ||
| 37 | struct ipr_data *ipr_data; | ||
| 38 | unsigned int nr_irqs; | ||
| 39 | struct irq_chip chip; | ||
| 40 | }; | ||
| 41 | |||
| 42 | void register_ipr_controller(struct ipr_desc *); | ||
| 43 | void init_IRQ_ipr(void); | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Enable individual interrupt mode for external IPR IRQs. | ||
| 47 | */ | ||
| 48 | void ipr_irq_enable_irlm(void); | ||
| 49 | |||
| 8 | #endif /* __ASM_SH_HW_IRQ_H */ | 50 | #endif /* __ASM_SH_HW_IRQ_H */ |
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index e81bf21c801e..c61d902b8bff 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h | |||
| @@ -31,47 +31,7 @@ extern unsigned short *irq_mask_register; | |||
| 31 | * PINT IRQs | 31 | * PINT IRQs |
| 32 | */ | 32 | */ |
| 33 | void init_IRQ_pint(void); | 33 | void init_IRQ_pint(void); |
| 34 | |||
| 35 | /* | ||
| 36 | * The shift value is now the number of bits to shift, not the number of | ||
| 37 | * bits/4. This is to make it easier to read the value directly from the | ||
| 38 | * datasheets. The IPR address, addr, will be set from ipr_idx via the | ||
| 39 | * map_ipridx_to_addr function. | ||
| 40 | */ | ||
| 41 | struct ipr_data { | ||
| 42 | unsigned int irq; | ||
| 43 | int ipr_idx; /* Index for the IPR registered */ | ||
| 44 | int shift; /* Number of bits to shift the data */ | ||
| 45 | int priority; /* The priority */ | ||
| 46 | unsigned int addr; /* Address of Interrupt Priority Register */ | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* | ||
| 50 | * Given an IPR IDX, map the value to an IPR register address. | ||
| 51 | */ | ||
| 52 | unsigned int map_ipridx_to_addr(int idx); | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Enable individual interrupt mode for external IPR IRQs. | ||
| 56 | */ | ||
| 57 | void ipr_irq_enable_irlm(void); | ||
| 58 | |||
| 59 | /* | ||
| 60 | * Function for "on chip support modules". | ||
| 61 | */ | ||
| 62 | void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs); | ||
| 63 | void make_imask_irq(unsigned int irq); | 34 | void make_imask_irq(unsigned int irq); |
| 64 | void init_IRQ_ipr(void); | ||
| 65 | |||
| 66 | struct intc2_data { | ||
| 67 | unsigned short irq; | ||
| 68 | unsigned char ipr_offset, ipr_shift; | ||
| 69 | unsigned char msk_offset, msk_shift; | ||
| 70 | unsigned char priority; | ||
| 71 | }; | ||
| 72 | |||
| 73 | void make_intc2_irq(struct intc2_data *, unsigned int nr_irqs); | ||
| 74 | void init_IRQ_intc2(void); | ||
| 75 | 35 | ||
| 76 | static inline int generic_irq_demux(int irq) | 36 | static inline int generic_irq_demux(int irq) |
| 77 | { | 37 | { |
diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h index 70389b72ffef..088698bacf2f 100644 --- a/include/asm-sh/machvec.h +++ b/include/asm-sh/machvec.h | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/time.h> | 14 | #include <linux/time.h> |
| 15 | #include <asm/machtypes.h> | 15 | #include <asm/machtypes.h> |
| 16 | #include <asm/machvec_init.h> | ||
| 17 | 16 | ||
| 18 | struct device; | 17 | struct device; |
| 19 | 18 | ||
| @@ -68,4 +67,7 @@ extern struct sh_machine_vector sh_mv; | |||
| 68 | 67 | ||
| 69 | #define get_system_type() sh_mv.mv_name | 68 | #define get_system_type() sh_mv.mv_name |
| 70 | 69 | ||
| 70 | #define __initmv \ | ||
| 71 | __attribute_used__ __attribute__((__section__ (".machvec.init"))) | ||
| 72 | |||
| 71 | #endif /* _ASM_SH_MACHVEC_H */ | 73 | #endif /* _ASM_SH_MACHVEC_H */ |
diff --git a/include/asm-sh/machvec_init.h b/include/asm-sh/machvec_init.h deleted file mode 100644 index e397798ebd94..000000000000 --- a/include/asm-sh/machvec_init.h +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-sh/machvec_init.h | ||
| 3 | * | ||
| 4 | * Copyright 2000 Stuart Menefy (stuart.menefy@st.com) | ||
| 5 | * | ||
| 6 | * May be copied or modified under the terms of the GNU General Public | ||
| 7 | * License. See linux/COPYING for more information. | ||
| 8 | * | ||
| 9 | * This file has goodies to help simplify instantiation of machine vectors. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __SH_MACHVEC_INIT_H | ||
| 13 | #define __SH_MACHVEC_INIT_H | ||
| 14 | |||
| 15 | |||
| 16 | /* | ||
| 17 | * In a GENERIC kernel, we have lots of these vectors floating about, | ||
| 18 | * all but one of which we want to go away. In a non-GENERIC kernel, | ||
| 19 | * we want only one, ever. | ||
| 20 | * | ||
| 21 | * Accomplish this in the GENERIC kernel by puting all of the vectors | ||
| 22 | * in the .init.data section where they'll go away. We'll copy the | ||
| 23 | * one we want to the real alpha_mv vector in setup_arch. | ||
| 24 | * | ||
| 25 | * Accomplish this in a non-GENERIC kernel by ifdef'ing out all but | ||
| 26 | * one of the vectors, which will not reside in .init.data. We then | ||
| 27 | * alias this one vector to alpha_mv, so no copy is needed. | ||
| 28 | * | ||
| 29 | * Upshot: set __initdata to nothing for non-GENERIC kernels. | ||
| 30 | * | ||
| 31 | * Note we do the same thing for the UNKNOWN kernel, as we need to write | ||
| 32 | * to the machine vector while setting it up. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_UNKNOWN) | ||
| 36 | #define __initmv __attribute__((unused,__section__ (".machvec.init"))) | ||
| 37 | #define ALIAS_MV(x) | ||
| 38 | #else | ||
| 39 | #define __initmv | ||
| 40 | |||
| 41 | /* GCC actually has a syntax for defining aliases, but is under some | ||
| 42 | delusion that you shouldn't be able to declare it extern somewhere | ||
| 43 | else beforehand. Fine. We'll do it ourselves. */ | ||
| 44 | #if 0 | ||
| 45 | #define ALIAS_MV(system) \ | ||
| 46 | struct sh_machine_vector sh_mv __attribute__((alias("mv_"#system))); | ||
| 47 | #else | ||
| 48 | #define ALIAS_MV(system) \ | ||
| 49 | asm(".global sh_mv\nsh_mv = mv_"#system ); | ||
| 50 | #endif | ||
| 51 | #endif /* GENERIC */ | ||
| 52 | |||
| 53 | #endif /* __SH_MACHVEC_INIT_H */ | ||
diff --git a/include/asm-sh/mmzone.h b/include/asm-sh/mmzone.h new file mode 100644 index 000000000000..7969f381dff2 --- /dev/null +++ b/include/asm-sh/mmzone.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | #ifndef __ASM_SH_MMZONE_H | ||
| 2 | #define __ASM_SH_MMZONE_H | ||
| 3 | |||
| 4 | #ifdef __KERNEL__ | ||
| 5 | |||
| 6 | #ifdef CONFIG_NEED_MULTIPLE_NODES | ||
| 7 | extern struct pglist_data *node_data[]; | ||
| 8 | #define NODE_DATA(nid) (node_data[nid]) | ||
| 9 | |||
| 10 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | ||
| 11 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ | ||
| 12 | NODE_DATA(nid)->node_spanned_pages) | ||
| 13 | |||
| 14 | static inline int pfn_to_nid(unsigned long pfn) | ||
| 15 | { | ||
| 16 | int nid; | ||
| 17 | |||
| 18 | for (nid = 0; nid < MAX_NUMNODES; nid++) | ||
| 19 | if (pfn >= node_start_pfn(nid) && pfn <= node_end_pfn(nid)) | ||
| 20 | break; | ||
| 21 | |||
| 22 | return nid; | ||
| 23 | } | ||
| 24 | |||
| 25 | static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn) | ||
| 26 | { | ||
| 27 | return NODE_DATA(pfn_to_nid(pfn)); | ||
| 28 | } | ||
| 29 | |||
| 30 | /* arch/sh/mm/numa.c */ | ||
| 31 | void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end); | ||
| 32 | #else | ||
| 33 | static inline void | ||
| 34 | setup_bootmem_node(int nid, unsigned long start, unsigned long end) | ||
| 35 | { | ||
| 36 | } | ||
| 37 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ | ||
| 38 | |||
| 39 | /* Platform specific mem init */ | ||
| 40 | void __init plat_mem_setup(void); | ||
| 41 | |||
| 42 | /* arch/sh/kernel/setup.c */ | ||
| 43 | void __init setup_bootmem_allocator(unsigned long start_pfn); | ||
| 44 | |||
| 45 | #endif /* __KERNEL__ */ | ||
| 46 | #endif /* __ASM_SH_MMZONE_H */ | ||
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 7464de4ba07d..6bc9bba10105 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
| @@ -60,6 +60,7 @@ extern void (*copy_page)(void *to, void *from); | |||
| 60 | 60 | ||
| 61 | extern unsigned long shm_align_mask; | 61 | extern unsigned long shm_align_mask; |
| 62 | extern unsigned long max_low_pfn, min_low_pfn; | 62 | extern unsigned long max_low_pfn, min_low_pfn; |
| 63 | extern unsigned long memory_start, memory_end; | ||
| 63 | 64 | ||
| 64 | #ifdef CONFIG_MMU | 65 | #ifdef CONFIG_MMU |
| 65 | extern void clear_page_slow(void *to); | 66 | extern void clear_page_slow(void *to); |
| @@ -134,7 +135,9 @@ typedef struct { unsigned long pgd; } pgd_t; | |||
| 134 | #define PFN_START (__MEMORY_START >> PAGE_SHIFT) | 135 | #define PFN_START (__MEMORY_START >> PAGE_SHIFT) |
| 135 | #define ARCH_PFN_OFFSET (PFN_START) | 136 | #define ARCH_PFN_OFFSET (PFN_START) |
| 136 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 137 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) |
| 138 | #ifdef CONFIG_FLATMEM | ||
| 137 | #define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn) | 139 | #define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn) |
| 140 | #endif | ||
| 138 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 141 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
| 139 | 142 | ||
| 140 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 143 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
| @@ -148,5 +151,12 @@ typedef struct { unsigned long pgd; } pgd_t; | |||
| 148 | #define __HAVE_ARCH_GATE_AREA | 151 | #define __HAVE_ARCH_GATE_AREA |
| 149 | #endif | 152 | #endif |
| 150 | 153 | ||
| 154 | /* | ||
| 155 | * Slub defaults to 8-byte alignment, we're only interested in 4. | ||
| 156 | * Slab defaults to BYTES_PER_WORD, which ends up being the same anyways. | ||
| 157 | */ | ||
| 158 | #define ARCH_KMALLOC_MINALIGN 4 | ||
| 159 | #define ARCH_SLAB_MINALIGN 4 | ||
| 160 | |||
| 151 | #endif /* __KERNEL__ */ | 161 | #endif /* __KERNEL__ */ |
| 152 | #endif /* __ASM_SH_PAGE_H */ | 162 | #endif /* __ASM_SH_PAGE_H */ |
diff --git a/include/asm-sh/parport.h b/include/asm-sh/parport.h new file mode 100644 index 000000000000..f67ba60a2acd --- /dev/null +++ b/include/asm-sh/parport.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk> | ||
| 3 | * | ||
| 4 | * This file should only be included by drivers/parport/parport_pc.c. | ||
| 5 | */ | ||
| 6 | #ifndef __ASM_SH_PARPORT_H | ||
| 7 | #define __ASM_SH_PARPORT_H | ||
| 8 | |||
| 9 | static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); | ||
| 10 | |||
| 11 | static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) | ||
| 12 | { | ||
| 13 | return parport_pc_find_isa_ports(autoirq, autodma); | ||
| 14 | } | ||
| 15 | |||
| 16 | #endif /* __ASM_SH_PARPORT_H */ | ||
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index 5b523c7e7d99..22efffe45019 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
| @@ -402,12 +402,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
| 402 | #define pte_file(pte) (pte_val(pte) & _PAGE_FILE) | 402 | #define pte_file(pte) (pte_val(pte) & _PAGE_FILE) |
| 403 | 403 | ||
| 404 | #ifdef CONFIG_X2TLB | 404 | #ifdef CONFIG_X2TLB |
| 405 | #define pte_read(pte) ((pte).pte_high & _PAGE_EXT_USER_READ) | ||
| 406 | #define pte_exec(pte) ((pte).pte_high & _PAGE_EXT_USER_EXEC) | ||
| 407 | #define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) | 405 | #define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) |
| 408 | #else | 406 | #else |
| 409 | #define pte_read(pte) (pte_val(pte) & _PAGE_USER) | ||
| 410 | #define pte_exec(pte) (pte_val(pte) & _PAGE_USER) | ||
| 411 | #define pte_write(pte) (pte_val(pte) & _PAGE_RW) | 407 | #define pte_write(pte) (pte_val(pte) & _PAGE_RW) |
| 412 | #endif | 408 | #endif |
| 413 | 409 | ||
| @@ -420,20 +416,12 @@ static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; } | |||
| 420 | * individually toggled (and user permissions are entirely decoupled from | 416 | * individually toggled (and user permissions are entirely decoupled from |
| 421 | * kernel permissions), we attempt to couple them a bit more sanely here. | 417 | * kernel permissions), we attempt to couple them a bit more sanely here. |
| 422 | */ | 418 | */ |
| 423 | PTE_BIT_FUNC(high, rdprotect, &= ~_PAGE_EXT_USER_READ); | ||
| 424 | PTE_BIT_FUNC(high, mkread, |= _PAGE_EXT_USER_READ | _PAGE_EXT_KERN_READ); | ||
| 425 | PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE); | 419 | PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE); |
| 426 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); | 420 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); |
| 427 | PTE_BIT_FUNC(high, exprotect, &= ~_PAGE_EXT_USER_EXEC); | ||
| 428 | PTE_BIT_FUNC(high, mkexec, |= _PAGE_EXT_USER_EXEC | _PAGE_EXT_KERN_EXEC); | ||
| 429 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); | 421 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); |
| 430 | #else | 422 | #else |
| 431 | PTE_BIT_FUNC(low, rdprotect, &= ~_PAGE_USER); | ||
| 432 | PTE_BIT_FUNC(low, mkread, |= _PAGE_USER); | ||
| 433 | PTE_BIT_FUNC(low, wrprotect, &= ~_PAGE_RW); | 423 | PTE_BIT_FUNC(low, wrprotect, &= ~_PAGE_RW); |
| 434 | PTE_BIT_FUNC(low, mkwrite, |= _PAGE_RW); | 424 | PTE_BIT_FUNC(low, mkwrite, |= _PAGE_RW); |
| 435 | PTE_BIT_FUNC(low, exprotect, &= ~_PAGE_USER); | ||
| 436 | PTE_BIT_FUNC(low, mkexec, |= _PAGE_USER); | ||
| 437 | PTE_BIT_FUNC(low, mkhuge, |= _PAGE_SZHUGE); | 425 | PTE_BIT_FUNC(low, mkhuge, |= _PAGE_SZHUGE); |
| 438 | #endif | 426 | #endif |
| 439 | 427 | ||
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index d42f68e724fa..2252e75daa26 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | */ | 36 | */ |
| 37 | enum cpu_type { | 37 | enum cpu_type { |
| 38 | /* SH-2 types */ | 38 | /* SH-2 types */ |
| 39 | CPU_SH7604, CPU_SH7619, | 39 | CPU_SH7619, |
| 40 | 40 | ||
| 41 | /* SH-2A types */ | 41 | /* SH-2A types */ |
| 42 | CPU_SH7206, | 42 | CPU_SH7206, |
| @@ -52,7 +52,7 @@ enum cpu_type { | |||
| 52 | CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, | 52 | CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, |
| 53 | 53 | ||
| 54 | /* SH-4A types */ | 54 | /* SH-4A types */ |
| 55 | CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, | 55 | CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, |
| 56 | 56 | ||
| 57 | /* SH4AL-DSP types */ | 57 | /* SH4AL-DSP types */ |
| 58 | CPU_SH73180, CPU_SH7343, CPU_SH7722, | 58 | CPU_SH73180, CPU_SH7343, CPU_SH7722, |
| @@ -228,11 +228,7 @@ static __inline__ void grab_fpu(struct pt_regs *regs) | |||
| 228 | regs->sr &= ~SR_FD; | 228 | regs->sr &= ~SR_FD; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | #ifdef CONFIG_CPU_SH4 | ||
| 232 | extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); | 231 | extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); |
| 233 | #else | ||
| 234 | #define save_fpu(tsk) do { } while (0) | ||
| 235 | #endif | ||
| 236 | 232 | ||
| 237 | #define unlazy_fpu(tsk, regs) do { \ | 233 | #define unlazy_fpu(tsk, regs) do { \ |
| 238 | if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ | 234 | if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ |
diff --git a/include/asm-sh/rwsem.h b/include/asm-sh/rwsem.h index 4931ba817d73..1987f3ea7f1b 100644 --- a/include/asm-sh/rwsem.h +++ b/include/asm-sh/rwsem.h | |||
| @@ -1,11 +1,15 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * include/asm-ppc/rwsem.h: R/W semaphores for SH using the stuff | 2 | * include/asm-sh/rwsem.h: R/W semaphores for SH using the stuff |
| 3 | * in lib/rwsem.c. | 3 | * in lib/rwsem.c. |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #ifndef _ASM_SH_RWSEM_H | 6 | #ifndef _ASM_SH_RWSEM_H |
| 7 | #define _ASM_SH_RWSEM_H | 7 | #define _ASM_SH_RWSEM_H |
| 8 | 8 | ||
| 9 | #ifndef _LINUX_RWSEM_H | ||
| 10 | #error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" | ||
| 11 | #endif | ||
| 12 | |||
| 9 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
| 10 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 11 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
diff --git a/include/asm-sh/saturn/io.h b/include/asm-sh/saturn/io.h deleted file mode 100644 index f1b9b5d633f4..000000000000 --- a/include/asm-sh/saturn/io.h +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-sh/saturn/io.h | ||
| 3 | * | ||
| 4 | * I/O functions for use on the Sega Saturn. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2002 Paul Mundt | ||
| 7 | * | ||
| 8 | * Released under the terms of the GNU GPL v2.0. | ||
| 9 | */ | ||
| 10 | #ifndef __ASM_SH_SATURN_IO_H | ||
| 11 | #define __ASM_SH_SATURN_IO_H | ||
| 12 | |||
| 13 | /* arch/sh/boards/saturn/io.c */ | ||
| 14 | extern unsigned long saturn_isa_port2addr(unsigned long offset); | ||
| 15 | extern void *saturn_ioremap(unsigned long offset, unsigned long size); | ||
| 16 | extern void saturn_iounmap(void *addr); | ||
| 17 | |||
| 18 | #endif /* __ASM_SH_SATURN_IO_H */ | ||
| 19 | |||
diff --git a/include/asm-sh/saturn/smpc.h b/include/asm-sh/saturn/smpc.h deleted file mode 100644 index 5de5c12d6347..000000000000 --- a/include/asm-sh/saturn/smpc.h +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-sh/saturn/smpc.h | ||
| 3 | * | ||
| 4 | * System Manager / Peripheral Control definitions. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2002 Paul Mundt | ||
| 7 | * | ||
| 8 | * Released under the terms of the GNU GPL v2.0. | ||
| 9 | */ | ||
| 10 | #ifndef __ASM_SH_SATURN_SMPC_H | ||
| 11 | #define __ASM_SH_SATURN_SMPC_H | ||
| 12 | |||
| 13 | #include <asm/io.h> | ||
| 14 | |||
| 15 | #define SMPC_COMMAND 0x2010001f /* SMPC command register */ | ||
| 16 | #define SMPC_RESULT 0x2010005f /* SMPC result register */ | ||
| 17 | #define SMPC_STATUS 0x20100063 /* SMPC status register */ | ||
| 18 | |||
| 19 | #define SMPC_CMD_MSHON 0x0001 /* Master SH On */ | ||
| 20 | #define SMPC_CMD_SSHON 0x0002 /* Slave SH On */ | ||
| 21 | #define SMPC_CMD_SSHOFF 0x0003 /* Slave SH Off */ | ||
| 22 | #define SMPC_CMD_SNDON 0x0004 /* Sound On */ | ||
| 23 | #define SMPC_CMD_SNDOFF 0x0005 /* Sound Off */ | ||
| 24 | #define SMPC_CMD_CDON 0x0006 /* CD On */ | ||
| 25 | #define SMPC_CMD_CDOFF 0x0007 /* CD Off */ | ||
| 26 | |||
| 27 | static inline void smpc_barrier(void) | ||
| 28 | { | ||
| 29 | while ((ctrl_inb(SMPC_STATUS) & 0x0001) == 0x0001) | ||
| 30 | ; | ||
| 31 | } | ||
| 32 | |||
| 33 | #endif /* __ASM_SH_SATURN_SMPC_H */ | ||
| 34 | |||
diff --git a/include/asm-sh/sections.h b/include/asm-sh/sections.h index 57abd708b236..2a696b8ee4f5 100644 --- a/include/asm-sh/sections.h +++ b/include/asm-sh/sections.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <asm-generic/sections.h> | 4 | #include <asm-generic/sections.h> |
| 5 | 5 | ||
| 6 | extern char _end[]; | 6 | extern long __machvec_start, __machvec_end; |
| 7 | 7 | ||
| 8 | #endif /* __ASM_SH_SECTIONS_H */ | 8 | #endif /* __ASM_SH_SECTIONS_H */ |
| 9 | 9 | ||
diff --git a/include/asm-sh/setup.h b/include/asm-sh/setup.h index 1583c6b7bdaa..586a9711a75d 100644 --- a/include/asm-sh/setup.h +++ b/include/asm-sh/setup.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 7 | 7 | ||
| 8 | int setup_early_printk(char *); | 8 | int setup_early_printk(char *); |
| 9 | void sh_mv_setup(void); | ||
| 9 | 10 | ||
| 10 | #endif /* __KERNEL__ */ | 11 | #endif /* __KERNEL__ */ |
| 11 | 12 | ||
diff --git a/include/asm-sh/sh03/io.h b/include/asm-sh/sh03/io.h index df3b187ef883..4ff1eb900301 100644 --- a/include/asm-sh/sh03/io.h +++ b/include/asm-sh/sh03/io.h | |||
| @@ -14,22 +14,18 @@ | |||
| 14 | #define INTC_IPRD 0xffd00010UL | 14 | #define INTC_IPRD 0xffd00010UL |
| 15 | 15 | ||
| 16 | #define IRL0_IRQ 2 | 16 | #define IRL0_IRQ 2 |
| 17 | #define IRL0_IPR_ADDR INTC_IPRD | ||
| 18 | #define IRL0_IPR_POS 3 | 17 | #define IRL0_IPR_POS 3 |
| 19 | #define IRL0_PRIORITY 13 | 18 | #define IRL0_PRIORITY 13 |
| 20 | 19 | ||
| 21 | #define IRL1_IRQ 5 | 20 | #define IRL1_IRQ 5 |
| 22 | #define IRL1_IPR_ADDR INTC_IPRD | ||
| 23 | #define IRL1_IPR_POS 2 | 21 | #define IRL1_IPR_POS 2 |
| 24 | #define IRL1_PRIORITY 10 | 22 | #define IRL1_PRIORITY 10 |
| 25 | 23 | ||
| 26 | #define IRL2_IRQ 8 | 24 | #define IRL2_IRQ 8 |
| 27 | #define IRL2_IPR_ADDR INTC_IPRD | ||
| 28 | #define IRL2_IPR_POS 1 | 25 | #define IRL2_IPR_POS 1 |
| 29 | #define IRL2_PRIORITY 7 | 26 | #define IRL2_PRIORITY 7 |
| 30 | 27 | ||
| 31 | #define IRL3_IRQ 11 | 28 | #define IRL3_IRQ 11 |
| 32 | #define IRL3_IPR_ADDR INTC_IPRD | ||
| 33 | #define IRL3_IPR_POS 0 | 29 | #define IRL3_IPR_POS 0 |
| 34 | #define IRL3_PRIORITY 4 | 30 | #define IRL3_PRIORITY 4 |
| 35 | 31 | ||
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h index caa7b93f1bce..b99ca786c0c1 100644 --- a/include/asm-sh/smp.h +++ b/include/asm-sh/smp.h | |||
| @@ -39,4 +39,6 @@ extern struct smp_fn_call_struct smp_fn_call; | |||
| 39 | 39 | ||
| 40 | #endif /* CONFIG_SMP */ | 40 | #endif /* CONFIG_SMP */ |
| 41 | 41 | ||
| 42 | #define hard_smp_processor_id() (0) | ||
| 43 | |||
| 42 | #endif /* __ASM_SH_SMP_H */ | 44 | #endif /* __ASM_SH_SMP_H */ |
diff --git a/include/asm-sh/snapgear.h b/include/asm-sh/snapgear.h index 2d712e72c9e5..3554e3a74e99 100644 --- a/include/asm-sh/snapgear.h +++ b/include/asm-sh/snapgear.h | |||
| @@ -20,22 +20,18 @@ | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #define IRL0_IRQ 2 | 22 | #define IRL0_IRQ 2 |
| 23 | #define IRL0_IPR_ADDR INTC_IPRD | ||
| 24 | #define IRL0_IPR_POS 3 | 23 | #define IRL0_IPR_POS 3 |
| 25 | #define IRL0_PRIORITY 13 | 24 | #define IRL0_PRIORITY 13 |
| 26 | 25 | ||
| 27 | #define IRL1_IRQ 5 | 26 | #define IRL1_IRQ 5 |
| 28 | #define IRL1_IPR_ADDR INTC_IPRD | ||
| 29 | #define IRL1_IPR_POS 2 | 27 | #define IRL1_IPR_POS 2 |
| 30 | #define IRL1_PRIORITY 10 | 28 | #define IRL1_PRIORITY 10 |
| 31 | 29 | ||
| 32 | #define IRL2_IRQ 8 | 30 | #define IRL2_IRQ 8 |
| 33 | #define IRL2_IPR_ADDR INTC_IPRD | ||
| 34 | #define IRL2_IPR_POS 1 | 31 | #define IRL2_IPR_POS 1 |
| 35 | #define IRL2_PRIORITY 7 | 32 | #define IRL2_PRIORITY 7 |
| 36 | 33 | ||
| 37 | #define IRL3_IRQ 11 | 34 | #define IRL3_IRQ 11 |
| 38 | #define IRL3_IPR_ADDR INTC_IPRD | ||
| 39 | #define IRL3_IPR_POS 0 | 35 | #define IRL3_IPR_POS 0 |
| 40 | #define IRL3_PRIORITY 4 | 36 | #define IRL3_PRIORITY 4 |
| 41 | #endif | 37 | #endif |
diff --git a/include/asm-sh/sparsemem.h b/include/asm-sh/sparsemem.h new file mode 100644 index 000000000000..547a540b6667 --- /dev/null +++ b/include/asm-sh/sparsemem.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef __ASM_SH_SPARSEMEM_H | ||
| 2 | #define __ASM_SH_SPARSEMEM_H | ||
| 3 | |||
| 4 | #ifdef __KERNEL__ | ||
| 5 | /* | ||
| 6 | * SECTION_SIZE_BITS 2^N: how big each section will be | ||
| 7 | * MAX_PHYSADDR_BITS 2^N: how much physical address space we have | ||
| 8 | * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space | ||
| 9 | */ | ||
| 10 | #define SECTION_SIZE_BITS 26 | ||
| 11 | #define MAX_PHYSADDR_BITS 32 | ||
| 12 | #define MAX_PHYSMEM_BITS 32 | ||
| 13 | |||
| 14 | #endif | ||
| 15 | |||
| 16 | #endif /* __ASM_SH_SPARSEMEM_H */ | ||
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 82f3e229e621..7c75045ae22b 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
| @@ -8,9 +8,13 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/irqflags.h> | 9 | #include <linux/irqflags.h> |
| 10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
| 11 | #include <linux/linkage.h> | ||
| 11 | #include <asm/types.h> | 12 | #include <asm/types.h> |
| 12 | #include <asm/ptrace.h> | 13 | #include <asm/ptrace.h> |
| 13 | 14 | ||
| 15 | struct task_struct *__switch_to(struct task_struct *prev, | ||
| 16 | struct task_struct *next); | ||
| 17 | |||
| 14 | /* | 18 | /* |
| 15 | * switch_to() should switch tasks to task nr n, first | 19 | * switch_to() should switch tasks to task nr n, first |
| 16 | */ | 20 | */ |
| @@ -122,7 +126,7 @@ static inline void sched_cacheflush(void) | |||
| 122 | #define smp_read_barrier_depends() do { } while(0) | 126 | #define smp_read_barrier_depends() do { } while(0) |
| 123 | #endif | 127 | #endif |
| 124 | 128 | ||
| 125 | #define set_mb(var, value) do { xchg(&var, value); } while (0) | 129 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) |
| 126 | 130 | ||
| 127 | /* | 131 | /* |
| 128 | * Jump to P2 area. | 132 | * Jump to P2 area. |
| @@ -271,6 +275,16 @@ extern unsigned int instruction_size(unsigned int insn); | |||
| 271 | void disable_hlt(void); | 275 | void disable_hlt(void); |
| 272 | void enable_hlt(void); | 276 | void enable_hlt(void); |
| 273 | 277 | ||
| 278 | void default_idle(void); | ||
| 279 | |||
| 280 | asmlinkage void break_point_trap(void); | ||
| 281 | asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5, | ||
| 282 | unsigned long r6, unsigned long r7, | ||
| 283 | struct pt_regs __regs); | ||
| 284 | asmlinkage void bug_trap_handler(unsigned long r4, unsigned long r5, | ||
| 285 | unsigned long r6, unsigned long r7, | ||
| 286 | struct pt_regs __regs); | ||
| 287 | |||
| 274 | #define arch_align_stack(x) (x) | 288 | #define arch_align_stack(x) (x) |
| 275 | 289 | ||
| 276 | #endif | 290 | #endif |
diff --git a/include/asm-sh/topology.h b/include/asm-sh/topology.h index cff001c316fe..f402a3b1cfa4 100644 --- a/include/asm-sh/topology.h +++ b/include/asm-sh/topology.h | |||
| @@ -1,6 +1,36 @@ | |||
| 1 | #ifndef _ASM_SH_TOPOLOGY_H | 1 | #ifndef _ASM_SH_TOPOLOGY_H |
| 2 | #define _ASM_SH_TOPOLOGY_H | 2 | #define _ASM_SH_TOPOLOGY_H |
| 3 | 3 | ||
| 4 | #ifdef CONFIG_NUMA | ||
| 5 | |||
| 6 | /* sched_domains SD_NODE_INIT for sh machines */ | ||
| 7 | #define SD_NODE_INIT (struct sched_domain) { \ | ||
| 8 | .span = CPU_MASK_NONE, \ | ||
| 9 | .parent = NULL, \ | ||
| 10 | .child = NULL, \ | ||
| 11 | .groups = NULL, \ | ||
| 12 | .min_interval = 8, \ | ||
| 13 | .max_interval = 32, \ | ||
| 14 | .busy_factor = 32, \ | ||
| 15 | .imbalance_pct = 125, \ | ||
| 16 | .cache_nice_tries = 2, \ | ||
| 17 | .busy_idx = 3, \ | ||
| 18 | .idle_idx = 2, \ | ||
| 19 | .newidle_idx = 0, \ | ||
| 20 | .wake_idx = 1, \ | ||
| 21 | .forkexec_idx = 1, \ | ||
| 22 | .flags = SD_LOAD_BALANCE \ | ||
| 23 | | SD_BALANCE_FORK \ | ||
| 24 | | SD_BALANCE_EXEC \ | ||
| 25 | | SD_SERIALIZE \ | ||
| 26 | | SD_WAKE_BALANCE, \ | ||
| 27 | .last_balance = jiffies, \ | ||
| 28 | .balance_interval = 1, \ | ||
| 29 | .nr_balance_failed = 0, \ | ||
| 30 | } | ||
| 31 | |||
| 32 | #endif | ||
| 33 | |||
| 4 | #include <asm-generic/topology.h> | 34 | #include <asm-generic/topology.h> |
| 5 | 35 | ||
| 6 | #endif /* _ASM_SH_TOPOLOGY_H */ | 36 | #endif /* _ASM_SH_TOPOLOGY_H */ |
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h index 5c49ed6715f2..f18a1a5c95c0 100644 --- a/include/asm-sh/uaccess.h +++ b/include/asm-sh/uaccess.h | |||
| @@ -61,8 +61,6 @@ static inline void set_fs(mm_segment_t s) | |||
| 61 | */ | 61 | */ |
| 62 | static inline int __access_ok(unsigned long addr, unsigned long size) | 62 | static inline int __access_ok(unsigned long addr, unsigned long size) |
| 63 | { | 63 | { |
| 64 | extern unsigned long memory_start, memory_end; | ||
| 65 | |||
| 66 | return ((addr >= memory_start) && ((addr + size) < memory_end)); | 64 | return ((addr >= memory_start) && ((addr + size) < memory_end)); |
| 67 | } | 65 | } |
| 68 | #else /* CONFIG_MMU */ | 66 | #else /* CONFIG_MMU */ |
| @@ -76,7 +74,7 @@ static inline int __access_ok(unsigned long addr, unsigned long size) | |||
| 76 | * __access_ok: Check if address with size is OK or not. | 74 | * __access_ok: Check if address with size is OK or not. |
| 77 | * | 75 | * |
| 78 | * We do three checks: | 76 | * We do three checks: |
| 79 | * (1) is it user space? | 77 | * (1) is it user space? |
| 80 | * (2) addr + size --> carry? | 78 | * (2) addr + size --> carry? |
| 81 | * (3) addr + size >= 0x80000000 (PAGE_OFFSET) | 79 | * (3) addr + size >= 0x80000000 (PAGE_OFFSET) |
| 82 | * | 80 | * |
| @@ -142,11 +140,12 @@ static inline int access_ok(int type, const void __user *p, unsigned long size) | |||
| 142 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | 140 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) |
| 143 | 141 | ||
| 144 | struct __large_struct { unsigned long buf[100]; }; | 142 | struct __large_struct { unsigned long buf[100]; }; |
| 145 | #define __m(x) (*(struct __large_struct *)(x)) | 143 | #define __m(x) (*(struct __large_struct __user *)(x)) |
| 146 | 144 | ||
| 147 | #define __get_user_size(x,ptr,size,retval) \ | 145 | #define __get_user_size(x,ptr,size,retval) \ |
| 148 | do { \ | 146 | do { \ |
| 149 | retval = 0; \ | 147 | retval = 0; \ |
| 148 | __chk_user_ptr(ptr); \ | ||
| 150 | switch (size) { \ | 149 | switch (size) { \ |
| 151 | case 1: \ | 150 | case 1: \ |
| 152 | __get_user_asm(x, ptr, retval, "b"); \ | 151 | __get_user_asm(x, ptr, retval, "b"); \ |
| @@ -175,6 +174,7 @@ do { \ | |||
| 175 | #define __get_user_check(x,ptr,size) \ | 174 | #define __get_user_check(x,ptr,size) \ |
| 176 | ({ \ | 175 | ({ \ |
| 177 | long __gu_err, __gu_val; \ | 176 | long __gu_err, __gu_val; \ |
| 177 | __chk_user_ptr(ptr); \ | ||
| 178 | switch (size) { \ | 178 | switch (size) { \ |
| 179 | case 1: \ | 179 | case 1: \ |
| 180 | __get_user_1(__gu_val, (ptr), __gu_err); \ | 180 | __get_user_1(__gu_val, (ptr), __gu_err); \ |
| @@ -300,6 +300,7 @@ extern void __get_user_unknown(void); | |||
| 300 | #define __put_user_size(x,ptr,size,retval) \ | 300 | #define __put_user_size(x,ptr,size,retval) \ |
| 301 | do { \ | 301 | do { \ |
| 302 | retval = 0; \ | 302 | retval = 0; \ |
| 303 | __chk_user_ptr(ptr); \ | ||
| 303 | switch (size) { \ | 304 | switch (size) { \ |
| 304 | case 1: \ | 305 | case 1: \ |
| 305 | __put_user_asm(x, ptr, retval, "b"); \ | 306 | __put_user_asm(x, ptr, retval, "b"); \ |
| @@ -328,7 +329,7 @@ do { \ | |||
| 328 | #define __put_user_check(x,ptr,size) \ | 329 | #define __put_user_check(x,ptr,size) \ |
| 329 | ({ \ | 330 | ({ \ |
| 330 | long __pu_err = -EFAULT; \ | 331 | long __pu_err = -EFAULT; \ |
| 331 | __typeof__(*(ptr)) *__pu_addr = (ptr); \ | 332 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
| 332 | \ | 333 | \ |
| 333 | if (__access_ok((unsigned long)__pu_addr,size)) \ | 334 | if (__access_ok((unsigned long)__pu_addr,size)) \ |
| 334 | __put_user_size((x),__pu_addr,(size),__pu_err); \ | 335 | __put_user_size((x),__pu_addr,(size),__pu_err); \ |
| @@ -406,10 +407,10 @@ __asm__ __volatile__( \ | |||
| 406 | #endif | 407 | #endif |
| 407 | 408 | ||
| 408 | extern void __put_user_unknown(void); | 409 | extern void __put_user_unknown(void); |
| 409 | 410 | ||
| 410 | /* Generic arbitrary sized copy. */ | 411 | /* Generic arbitrary sized copy. */ |
| 411 | /* Return the number of bytes NOT copied */ | 412 | /* Return the number of bytes NOT copied */ |
| 412 | extern __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); | 413 | __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); |
| 413 | 414 | ||
| 414 | #define copy_to_user(to,from,n) ({ \ | 415 | #define copy_to_user(to,from,n) ({ \ |
| 415 | void *__copy_to = (void *) (to); \ | 416 | void *__copy_to = (void *) (to); \ |
| @@ -420,14 +421,6 @@ __copy_res = __copy_user(__copy_to, (void *) (from), __copy_size); \ | |||
| 420 | } else __copy_res = __copy_size; \ | 421 | } else __copy_res = __copy_size; \ |
| 421 | __copy_res; }) | 422 | __copy_res; }) |
| 422 | 423 | ||
| 423 | #define __copy_to_user(to,from,n) \ | ||
| 424 | __copy_user((void *)(to), \ | ||
| 425 | (void *)(from), n) | ||
| 426 | |||
| 427 | #define __copy_to_user_inatomic __copy_to_user | ||
| 428 | #define __copy_from_user_inatomic __copy_from_user | ||
| 429 | |||
| 430 | |||
| 431 | #define copy_from_user(to,from,n) ({ \ | 424 | #define copy_from_user(to,from,n) ({ \ |
| 432 | void *__copy_to = (void *) (to); \ | 425 | void *__copy_to = (void *) (to); \ |
| 433 | void *__copy_from = (void *) (from); \ | 426 | void *__copy_from = (void *) (from); \ |
| @@ -438,9 +431,20 @@ __copy_res = __copy_user(__copy_to, __copy_from, __copy_size); \ | |||
| 438 | } else __copy_res = __copy_size; \ | 431 | } else __copy_res = __copy_size; \ |
| 439 | __copy_res; }) | 432 | __copy_res; }) |
| 440 | 433 | ||
| 441 | #define __copy_from_user(to,from,n) \ | 434 | static __always_inline unsigned long |
| 442 | __copy_user((void *)(to), \ | 435 | __copy_from_user(void *to, const void __user *from, unsigned long n) |
| 443 | (void *)(from), n) | 436 | { |
| 437 | return __copy_user(to, (__force void *)from, n); | ||
| 438 | } | ||
| 439 | |||
| 440 | static __always_inline unsigned long __must_check | ||
| 441 | __copy_to_user(void __user *to, const void *from, unsigned long n) | ||
| 442 | { | ||
| 443 | return __copy_user((__force void *)to, from, n); | ||
| 444 | } | ||
| 445 | |||
| 446 | #define __copy_to_user_inatomic __copy_to_user | ||
| 447 | #define __copy_from_user_inatomic __copy_from_user | ||
| 444 | 448 | ||
| 445 | /* | 449 | /* |
| 446 | * Clear the area and return remaining number of bytes | 450 | * Clear the area and return remaining number of bytes |
diff --git a/include/asm-sh/ubc.h b/include/asm-sh/ubc.h index ae9bbdeefbe1..38d46e01b846 100644 --- a/include/asm-sh/ubc.h +++ b/include/asm-sh/ubc.h | |||
| @@ -51,9 +51,14 @@ | |||
| 51 | #define BRCR_UBDE (1 << 0) | 51 | #define BRCR_UBDE (1 << 0) |
| 52 | 52 | ||
| 53 | #ifndef __ASSEMBLY__ | 53 | #ifndef __ASSEMBLY__ |
| 54 | /* arch/sh/kernel/ubc.S */ | 54 | /* arch/sh/kernel/cpu/ubc.S */ |
| 55 | extern void ubc_wakeup(void); | ||
| 56 | extern void ubc_sleep(void); | 55 | extern void ubc_sleep(void); |
| 56 | |||
| 57 | #ifdef CONFIG_UBC_WAKEUP | ||
| 58 | extern void ubc_wakeup(void); | ||
| 59 | #else | ||
| 60 | #define ubc_wakeup() do { } while (0) | ||
| 61 | #endif | ||
| 57 | #endif | 62 | #endif |
| 58 | 63 | ||
| 59 | #endif /* __KERNEL__ */ | 64 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-sh64/fb.h b/include/asm-sh64/fb.h new file mode 100644 index 000000000000..d92e99cd8c8a --- /dev/null +++ b/include/asm-sh64/fb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | |||
| 4 | #include <linux/fb.h> | ||
| 5 | #include <linux/fs.h> | ||
| 6 | #include <asm/page.h> | ||
| 7 | |||
| 8 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 9 | unsigned long off) | ||
| 10 | { | ||
| 11 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h index b875482eb592..3488fe32e436 100644 --- a/include/asm-sh64/pgtable.h +++ b/include/asm-sh64/pgtable.h | |||
| @@ -415,22 +415,15 @@ extern void __handle_bad_pmd_kernel(pmd_t * pmd); | |||
| 415 | /* | 415 | /* |
| 416 | * The following have defined behavior only work if pte_present() is true. | 416 | * The following have defined behavior only work if pte_present() is true. |
| 417 | */ | 417 | */ |
| 418 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_READ; } | ||
| 419 | static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXECUTE; } | ||
| 420 | static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; } | 418 | static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; } |
| 421 | static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; } | 419 | static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; } |
| 422 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 420 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| 423 | static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } | 421 | static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } |
| 424 | 422 | ||
| 425 | static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_READ)); return pte; } | ||
| 426 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } | 423 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } |
| 427 | static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE)); return pte; } | ||
| 428 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | 424 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } |
| 429 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } | 425 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } |
| 430 | |||
| 431 | static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_READ)); return pte; } | ||
| 432 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; } | 426 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; } |
| 433 | static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; } | ||
| 434 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 427 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
| 435 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 428 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
| 436 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } | 429 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } |
diff --git a/include/asm-sparc/fb.h b/include/asm-sparc/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-sparc/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 59229aeba27b..a55f4c3488b0 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h | |||
| @@ -151,7 +151,6 @@ BTFIXUPDEF_CALL_CONST(unsigned long, pgd_page_vaddr, pgd_t) | |||
| 151 | BTFIXUPDEF_SETHI(none_mask) | 151 | BTFIXUPDEF_SETHI(none_mask) |
| 152 | BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t) | 152 | BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t) |
| 153 | BTFIXUPDEF_CALL(void, pte_clear, pte_t *) | 153 | BTFIXUPDEF_CALL(void, pte_clear, pte_t *) |
| 154 | BTFIXUPDEF_CALL(int, pte_read, pte_t) | ||
| 155 | 154 | ||
| 156 | static inline int pte_none(pte_t pte) | 155 | static inline int pte_none(pte_t pte) |
| 157 | { | 156 | { |
| @@ -160,7 +159,6 @@ static inline int pte_none(pte_t pte) | |||
| 160 | 159 | ||
| 161 | #define pte_present(pte) BTFIXUP_CALL(pte_present)(pte) | 160 | #define pte_present(pte) BTFIXUP_CALL(pte_present)(pte) |
| 162 | #define pte_clear(mm,addr,pte) BTFIXUP_CALL(pte_clear)(pte) | 161 | #define pte_clear(mm,addr,pte) BTFIXUP_CALL(pte_clear)(pte) |
| 163 | #define pte_read(pte) BTFIXUP_CALL(pte_read)(pte) | ||
| 164 | 162 | ||
| 165 | BTFIXUPDEF_CALL_CONST(int, pmd_bad, pmd_t) | 163 | BTFIXUPDEF_CALL_CONST(int, pmd_bad, pmd_t) |
| 166 | BTFIXUPDEF_CALL_CONST(int, pmd_present, pmd_t) | 164 | BTFIXUPDEF_CALL_CONST(int, pmd_present, pmd_t) |
diff --git a/include/asm-sparc64/bugs.h b/include/asm-sparc64/bugs.h index bf39d86c0c9e..11ade6841971 100644 --- a/include/asm-sparc64/bugs.h +++ b/include/asm-sparc64/bugs.h | |||
| @@ -4,12 +4,7 @@ | |||
| 4 | */ | 4 | */ |
| 5 | #include <asm/sstate.h> | 5 | #include <asm/sstate.h> |
| 6 | 6 | ||
| 7 | extern unsigned long loops_per_jiffy; | ||
| 8 | |||
| 9 | static void __init check_bugs(void) | 7 | static void __init check_bugs(void) |
| 10 | { | 8 | { |
| 11 | #ifndef CONFIG_SMP | ||
| 12 | cpu_data(0).udelay_val = loops_per_jiffy; | ||
| 13 | #endif | ||
| 14 | sstate_running(); | 9 | sstate_running(); |
| 15 | } | 10 | } |
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index 36511ca51416..01fe6682b405 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h | |||
| @@ -31,8 +31,10 @@ typedef s32 compat_timer_t; | |||
| 31 | 31 | ||
| 32 | typedef s32 compat_int_t; | 32 | typedef s32 compat_int_t; |
| 33 | typedef s32 compat_long_t; | 33 | typedef s32 compat_long_t; |
| 34 | typedef s64 compat_s64; | ||
| 34 | typedef u32 compat_uint_t; | 35 | typedef u32 compat_uint_t; |
| 35 | typedef u32 compat_ulong_t; | 36 | typedef u32 compat_ulong_t; |
| 37 | typedef u64 compat_u64; | ||
| 36 | 38 | ||
| 37 | struct compat_timespec { | 39 | struct compat_timespec { |
| 38 | compat_time_t tv_sec; | 40 | compat_time_t tv_sec; |
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h index 445026fbec35..98a6e609163e 100644 --- a/include/asm-sparc64/cpudata.h +++ b/include/asm-sparc64/cpudata.h | |||
| @@ -19,7 +19,7 @@ typedef struct { | |||
| 19 | unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ | 19 | unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ |
| 20 | unsigned int __pad0; | 20 | unsigned int __pad0; |
| 21 | unsigned long clock_tick; /* %tick's per second */ | 21 | unsigned long clock_tick; /* %tick's per second */ |
| 22 | unsigned long udelay_val; | 22 | unsigned long __pad; |
| 23 | unsigned int __pad1; | 23 | unsigned int __pad1; |
| 24 | unsigned int __pad2; | 24 | unsigned int __pad2; |
| 25 | 25 | ||
| @@ -80,7 +80,8 @@ struct trap_per_cpu { | |||
| 80 | unsigned int dev_mondo_qmask; | 80 | unsigned int dev_mondo_qmask; |
| 81 | unsigned int resum_qmask; | 81 | unsigned int resum_qmask; |
| 82 | unsigned int nonresum_qmask; | 82 | unsigned int nonresum_qmask; |
| 83 | unsigned int __pad2[3]; | 83 | unsigned int __pad2[1]; |
| 84 | void *hdesc; | ||
| 84 | } __attribute__((aligned(64))); | 85 | } __attribute__((aligned(64))); |
| 85 | extern struct trap_per_cpu trap_block[NR_CPUS]; | 86 | extern struct trap_per_cpu trap_block[NR_CPUS]; |
| 86 | extern void init_cur_cpu_trap(struct thread_info *); | 87 | extern void init_cur_cpu_trap(struct thread_info *); |
diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h index a4aae6f80627..a77aa622d762 100644 --- a/include/asm-sparc64/delay.h +++ b/include/asm-sparc64/delay.h | |||
| @@ -1,37 +1,17 @@ | |||
| 1 | /* delay.h: Linux delay routines on sparc64. | 1 | /* delay.h: Linux delay routines on sparc64. |
| 2 | * | 2 | * |
| 3 | * Copyright (C) 1996, 2004 David S. Miller (davem@davemloft.net). | 3 | * Copyright (C) 1996, 2004, 2007 David S. Miller (davem@davemloft.net). |
| 4 | * | ||
| 5 | * Based heavily upon x86 variant which is: | ||
| 6 | * Copyright (C) 1993 Linus Torvalds | ||
| 7 | * | ||
| 8 | * Delay routines calling functions in arch/sparc64/lib/delay.c | ||
| 9 | */ | 4 | */ |
| 10 | 5 | ||
| 11 | #ifndef __SPARC64_DELAY_H | 6 | #ifndef _SPARC64_DELAY_H |
| 12 | #define __SPARC64_DELAY_H | 7 | #define _SPARC64_DELAY_H |
| 13 | |||
| 14 | #include <linux/param.h> | ||
| 15 | #include <asm/cpudata.h> | ||
| 16 | 8 | ||
| 17 | #ifndef __ASSEMBLY__ | 9 | #ifndef __ASSEMBLY__ |
| 18 | 10 | ||
| 19 | extern void __bad_udelay(void); | ||
| 20 | extern void __bad_ndelay(void); | ||
| 21 | |||
| 22 | extern void __udelay(unsigned long usecs); | ||
| 23 | extern void __ndelay(unsigned long nsecs); | ||
| 24 | extern void __const_udelay(unsigned long usecs); | ||
| 25 | extern void __delay(unsigned long loops); | 11 | extern void __delay(unsigned long loops); |
| 26 | 12 | extern void udelay(unsigned long usecs); | |
| 27 | #define udelay(n) (__builtin_constant_p(n) ? \ | 13 | #define mdelay(n) udelay((n) * 1000) |
| 28 | ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \ | ||
| 29 | __udelay(n)) | ||
| 30 | |||
| 31 | #define ndelay(n) (__builtin_constant_p(n) ? \ | ||
| 32 | ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ | ||
| 33 | __ndelay(n)) | ||
| 34 | 14 | ||
| 35 | #endif /* !__ASSEMBLY__ */ | 15 | #endif /* !__ASSEMBLY__ */ |
| 36 | 16 | ||
| 37 | #endif /* defined(__SPARC64_DELAY_H) */ | 17 | #endif /* _SPARC64_DELAY_H */ |
diff --git a/include/asm-sparc64/fb.h b/include/asm-sparc64/fb.h new file mode 100644 index 000000000000..d6cd3a175fc3 --- /dev/null +++ b/include/asm-sparc64/fb.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | #include <linux/fb.h> | ||
| 4 | #include <linux/fs.h> | ||
| 5 | #include <asm/page.h> | ||
| 6 | |||
| 7 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 8 | unsigned long off) | ||
| 9 | { | ||
| 10 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
| 11 | } | ||
| 12 | |||
| 13 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 14 | { | ||
| 15 | return 0; | ||
| 16 | } | ||
| 17 | |||
| 18 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-sparc64/hvtramp.h b/include/asm-sparc64/hvtramp.h new file mode 100644 index 000000000000..c7dd6ad056df --- /dev/null +++ b/include/asm-sparc64/hvtramp.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #ifndef _SPARC64_HVTRAP_H | ||
| 2 | #define _SPARC64_HVTRAP_H | ||
| 3 | |||
| 4 | #ifndef __ASSEMBLY__ | ||
| 5 | |||
| 6 | #include <linux/types.h> | ||
| 7 | |||
| 8 | struct hvtramp_mapping { | ||
| 9 | __u64 vaddr; | ||
| 10 | __u64 tte; | ||
| 11 | }; | ||
| 12 | |||
| 13 | struct hvtramp_descr { | ||
| 14 | __u32 cpu; | ||
| 15 | __u32 num_mappings; | ||
| 16 | __u64 fault_info_va; | ||
| 17 | __u64 fault_info_pa; | ||
| 18 | __u64 thread_reg; | ||
| 19 | struct hvtramp_mapping maps[2]; | ||
| 20 | }; | ||
| 21 | |||
| 22 | extern void hv_cpu_startup(unsigned long hvdescr_pa); | ||
| 23 | |||
| 24 | #endif | ||
| 25 | |||
| 26 | #define HVTRAMP_DESCR_CPU 0x00 | ||
| 27 | #define HVTRAMP_DESCR_NUM_MAPPINGS 0x04 | ||
| 28 | #define HVTRAMP_DESCR_FAULT_INFO_VA 0x08 | ||
| 29 | #define HVTRAMP_DESCR_FAULT_INFO_PA 0x10 | ||
| 30 | #define HVTRAMP_DESCR_THREAD_REG 0x18 | ||
| 31 | #define HVTRAMP_DESCR_MAPS 0x20 | ||
| 32 | |||
| 33 | #define HVTRAMP_MAPPING_VADDR 0x00 | ||
| 34 | #define HVTRAMP_MAPPING_TTE 0x08 | ||
| 35 | #define HVTRAMP_MAPPING_SIZE 0x10 | ||
| 36 | |||
| 37 | #endif /* _SPARC64_HVTRAP_H */ | ||
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h index db2130a95d68..524d49835dfd 100644 --- a/include/asm-sparc64/hypervisor.h +++ b/include/asm-sparc64/hypervisor.h | |||
| @@ -98,7 +98,7 @@ | |||
| 98 | #define HV_FAST_MACH_EXIT 0x00 | 98 | #define HV_FAST_MACH_EXIT 0x00 |
| 99 | 99 | ||
| 100 | #ifndef __ASSEMBLY__ | 100 | #ifndef __ASSEMBLY__ |
| 101 | extern void sun4v_mach_exit(unsigned long exit_core); | 101 | extern void sun4v_mach_exit(unsigned long exit_code); |
| 102 | #endif | 102 | #endif |
| 103 | 103 | ||
| 104 | /* Domain services. */ | 104 | /* Domain services. */ |
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h index 90781e34a95c..e6c436ef9356 100644 --- a/include/asm-sparc64/irq.h +++ b/include/asm-sparc64/irq.h | |||
| @@ -53,6 +53,8 @@ extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, | |||
| 53 | extern void sun4v_destroy_msi(unsigned int virt_irq); | 53 | extern void sun4v_destroy_msi(unsigned int virt_irq); |
| 54 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); | 54 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); |
| 55 | 55 | ||
| 56 | extern void fixup_irqs(void); | ||
| 57 | |||
| 56 | static __inline__ void set_softint(unsigned long bits) | 58 | static __inline__ void set_softint(unsigned long bits) |
| 57 | { | 59 | { |
| 58 | __asm__ __volatile__("wr %0, 0x0, %%set_softint" | 60 | __asm__ __volatile__("wr %0, 0x0, %%set_softint" |
diff --git a/include/asm-sparc64/ldc.h b/include/asm-sparc64/ldc.h new file mode 100644 index 000000000000..bdb524a7b814 --- /dev/null +++ b/include/asm-sparc64/ldc.h | |||
| @@ -0,0 +1,138 @@ | |||
| 1 | #ifndef _SPARC64_LDC_H | ||
| 2 | #define _SPARC64_LDC_H | ||
| 3 | |||
| 4 | #include <asm/hypervisor.h> | ||
| 5 | |||
| 6 | extern int ldom_domaining_enabled; | ||
| 7 | extern void ldom_set_var(const char *var, const char *value); | ||
| 8 | extern void ldom_reboot(const char *boot_command); | ||
| 9 | extern void ldom_power_off(void); | ||
| 10 | |||
| 11 | /* The event handler will be evoked when link state changes | ||
| 12 | * or data becomes available on the receive side. | ||
| 13 | * | ||
| 14 | * For non-RAW links, if the LDC_EVENT_RESET event arrives the | ||
| 15 | * driver should reset all of it's internal state and reinvoke | ||
| 16 | * ldc_connect() to try and bring the link up again. | ||
| 17 | * | ||
| 18 | * For RAW links, ldc_connect() is not used. Instead the driver | ||
| 19 | * just waits for the LDC_EVENT_UP event. | ||
| 20 | */ | ||
| 21 | struct ldc_channel_config { | ||
| 22 | void (*event)(void *arg, int event); | ||
| 23 | |||
| 24 | u32 mtu; | ||
| 25 | unsigned int rx_irq; | ||
| 26 | unsigned int tx_irq; | ||
| 27 | u8 mode; | ||
| 28 | #define LDC_MODE_RAW 0x00 | ||
| 29 | #define LDC_MODE_UNRELIABLE 0x01 | ||
| 30 | #define LDC_MODE_RESERVED 0x02 | ||
| 31 | #define LDC_MODE_STREAM 0x03 | ||
| 32 | |||
| 33 | u8 debug; | ||
| 34 | #define LDC_DEBUG_HS 0x01 | ||
| 35 | #define LDC_DEBUG_STATE 0x02 | ||
| 36 | #define LDC_DEBUG_RX 0x04 | ||
| 37 | #define LDC_DEBUG_TX 0x08 | ||
| 38 | #define LDC_DEBUG_DATA 0x10 | ||
| 39 | }; | ||
| 40 | |||
| 41 | #define LDC_EVENT_RESET 0x01 | ||
| 42 | #define LDC_EVENT_UP 0x02 | ||
| 43 | #define LDC_EVENT_DATA_READY 0x04 | ||
| 44 | |||
| 45 | #define LDC_STATE_INVALID 0x00 | ||
| 46 | #define LDC_STATE_INIT 0x01 | ||
| 47 | #define LDC_STATE_BOUND 0x02 | ||
| 48 | #define LDC_STATE_READY 0x03 | ||
| 49 | #define LDC_STATE_CONNECTED 0x04 | ||
| 50 | |||
| 51 | struct ldc_channel; | ||
| 52 | |||
| 53 | /* Allocate state for a channel. */ | ||
| 54 | extern struct ldc_channel *ldc_alloc(unsigned long id, | ||
| 55 | const struct ldc_channel_config *cfgp, | ||
| 56 | void *event_arg); | ||
| 57 | |||
| 58 | /* Shut down and free state for a channel. */ | ||
| 59 | extern void ldc_free(struct ldc_channel *lp); | ||
| 60 | |||
| 61 | /* Register TX and RX queues of the link with the hypervisor. */ | ||
| 62 | extern int ldc_bind(struct ldc_channel *lp, const char *name); | ||
| 63 | |||
| 64 | /* For non-RAW protocols we need to complete a handshake before | ||
| 65 | * communication can proceed. ldc_connect() does that, if the | ||
| 66 | * handshake completes successfully, an LDC_EVENT_UP event will | ||
| 67 | * be sent up to the driver. | ||
| 68 | */ | ||
| 69 | extern int ldc_connect(struct ldc_channel *lp); | ||
| 70 | extern int ldc_disconnect(struct ldc_channel *lp); | ||
| 71 | |||
| 72 | extern int ldc_state(struct ldc_channel *lp); | ||
| 73 | |||
| 74 | /* Read and write operations. Only valid when the link is up. */ | ||
| 75 | extern int ldc_write(struct ldc_channel *lp, const void *buf, | ||
| 76 | unsigned int size); | ||
| 77 | extern int ldc_read(struct ldc_channel *lp, void *buf, unsigned int size); | ||
| 78 | |||
| 79 | #define LDC_MAP_SHADOW 0x01 | ||
| 80 | #define LDC_MAP_DIRECT 0x02 | ||
| 81 | #define LDC_MAP_IO 0x04 | ||
| 82 | #define LDC_MAP_R 0x08 | ||
| 83 | #define LDC_MAP_W 0x10 | ||
| 84 | #define LDC_MAP_X 0x20 | ||
| 85 | #define LDC_MAP_RW (LDC_MAP_R | LDC_MAP_W) | ||
| 86 | #define LDC_MAP_RWX (LDC_MAP_R | LDC_MAP_W | LDC_MAP_X) | ||
| 87 | #define LDC_MAP_ALL 0x03f | ||
| 88 | |||
| 89 | struct ldc_trans_cookie { | ||
| 90 | u64 cookie_addr; | ||
| 91 | u64 cookie_size; | ||
| 92 | }; | ||
| 93 | |||
| 94 | struct scatterlist; | ||
| 95 | extern int ldc_map_sg(struct ldc_channel *lp, | ||
| 96 | struct scatterlist *sg, int num_sg, | ||
| 97 | struct ldc_trans_cookie *cookies, int ncookies, | ||
| 98 | unsigned int map_perm); | ||
| 99 | |||
| 100 | extern int ldc_map_single(struct ldc_channel *lp, | ||
| 101 | void *buf, unsigned int len, | ||
| 102 | struct ldc_trans_cookie *cookies, int ncookies, | ||
| 103 | unsigned int map_perm); | ||
| 104 | |||
| 105 | extern void ldc_unmap(struct ldc_channel *lp, struct ldc_trans_cookie *cookies, | ||
| 106 | int ncookies); | ||
| 107 | |||
| 108 | extern int ldc_copy(struct ldc_channel *lp, int copy_dir, | ||
| 109 | void *buf, unsigned int len, unsigned long offset, | ||
| 110 | struct ldc_trans_cookie *cookies, int ncookies); | ||
| 111 | |||
| 112 | static inline int ldc_get_dring_entry(struct ldc_channel *lp, | ||
| 113 | void *buf, unsigned int len, | ||
| 114 | unsigned long offset, | ||
| 115 | struct ldc_trans_cookie *cookies, | ||
| 116 | int ncookies) | ||
| 117 | { | ||
| 118 | return ldc_copy(lp, LDC_COPY_IN, buf, len, offset, cookies, ncookies); | ||
| 119 | } | ||
| 120 | |||
| 121 | static inline int ldc_put_dring_entry(struct ldc_channel *lp, | ||
| 122 | void *buf, unsigned int len, | ||
| 123 | unsigned long offset, | ||
| 124 | struct ldc_trans_cookie *cookies, | ||
| 125 | int ncookies) | ||
| 126 | { | ||
| 127 | return ldc_copy(lp, LDC_COPY_OUT, buf, len, offset, cookies, ncookies); | ||
| 128 | } | ||
| 129 | |||
| 130 | extern void *ldc_alloc_exp_dring(struct ldc_channel *lp, unsigned int len, | ||
| 131 | struct ldc_trans_cookie *cookies, | ||
| 132 | int *ncookies, unsigned int map_perm); | ||
| 133 | |||
| 134 | extern void ldc_free_exp_dring(struct ldc_channel *lp, void *buf, | ||
| 135 | unsigned int len, | ||
| 136 | struct ldc_trans_cookie *cookies, int ncookies); | ||
| 137 | |||
| 138 | #endif /* _SPARC64_LDC_H */ | ||
diff --git a/include/asm-sparc64/mdesc.h b/include/asm-sparc64/mdesc.h index c6383982b53d..e97c43133752 100644 --- a/include/asm-sparc64/mdesc.h +++ b/include/asm-sparc64/mdesc.h | |||
| @@ -2,38 +2,66 @@ | |||
| 2 | #define _SPARC64_MDESC_H | 2 | #define _SPARC64_MDESC_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/cpumask.h> | ||
| 5 | #include <asm/prom.h> | 6 | #include <asm/prom.h> |
| 6 | 7 | ||
| 7 | struct mdesc_node; | 8 | struct mdesc_handle; |
| 8 | struct mdesc_arc { | 9 | |
| 9 | const char *name; | 10 | /* Machine description operations are to be surrounded by grab and |
| 10 | struct mdesc_node *arc; | 11 | * release calls. The mdesc_handle returned from the grab is |
| 11 | }; | 12 | * the first argument to all of the operational calls that work |
| 12 | 13 | * on mdescs. | |
| 13 | struct mdesc_node { | 14 | */ |
| 14 | const char *name; | 15 | extern struct mdesc_handle *mdesc_grab(void); |
| 15 | u64 node; | 16 | extern void mdesc_release(struct mdesc_handle *); |
| 16 | unsigned int unique_id; | 17 | |
| 17 | unsigned int num_arcs; | 18 | #define MDESC_NODE_NULL (~(u64)0) |
| 18 | unsigned int irqs[2]; | 19 | |
| 19 | struct property *properties; | 20 | extern u64 mdesc_node_by_name(struct mdesc_handle *handle, |
| 20 | struct mdesc_node *hash_next; | 21 | u64 from_node, const char *name); |
| 21 | struct mdesc_node *allnodes_next; | 22 | #define mdesc_for_each_node_by_name(__hdl, __node, __name) \ |
| 22 | struct mdesc_arc arcs[0]; | 23 | for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \ |
| 23 | }; | 24 | (__node) != MDESC_NODE_NULL; \ |
| 24 | 25 | __node = mdesc_node_by_name(__hdl, __node, __name)) | |
| 25 | extern struct mdesc_node *md_find_node_by_name(struct mdesc_node *from, | 26 | |
| 26 | const char *name); | 27 | /* Access to property values returned from mdesc_get_property() are |
| 27 | #define md_for_each_node_by_name(__mn, __name) \ | 28 | * only valid inside of a mdesc_grab()/mdesc_release() sequence. |
| 28 | for (__mn = md_find_node_by_name(NULL, __name); __mn; \ | 29 | * Once mdesc_release() is called, the memory backed up by these |
| 29 | __mn = md_find_node_by_name(__mn, __name)) | 30 | * pointers may reference freed up memory. |
| 30 | 31 | * | |
| 31 | extern struct property *md_find_property(const struct mdesc_node *mp, | 32 | * Therefore callers must make copies of any property values |
| 32 | const char *name, | 33 | * they need. |
| 33 | int *lenp); | 34 | * |
| 34 | extern const void *md_get_property(const struct mdesc_node *mp, | 35 | * These same rules apply to mdesc_node_name(). |
| 35 | const char *name, | 36 | */ |
| 36 | int *lenp); | 37 | extern const void *mdesc_get_property(struct mdesc_handle *handle, |
| 38 | u64 node, const char *name, int *lenp); | ||
| 39 | extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node); | ||
| 40 | |||
| 41 | /* MD arc iteration, the standard sequence is: | ||
| 42 | * | ||
| 43 | * unsigned long arc; | ||
| 44 | * mdesc_for_each_arc(arc, handle, node, MDESC_ARC_TYPE_{FWD,BACK}) { | ||
| 45 | * unsigned long target = mdesc_arc_target(handle, arc); | ||
| 46 | * ... | ||
| 47 | * } | ||
| 48 | */ | ||
| 49 | |||
| 50 | #define MDESC_ARC_TYPE_FWD "fwd" | ||
| 51 | #define MDESC_ARC_TYPE_BACK "back" | ||
| 52 | |||
| 53 | extern u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from, | ||
| 54 | const char *arc_type); | ||
| 55 | #define mdesc_for_each_arc(__arc, __hdl, __node, __type) \ | ||
| 56 | for (__arc = mdesc_next_arc(__hdl, __node, __type); \ | ||
| 57 | (__arc) != MDESC_NODE_NULL; \ | ||
| 58 | __arc = mdesc_next_arc(__hdl, __arc, __type)) | ||
| 59 | |||
| 60 | extern u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc); | ||
| 61 | |||
| 62 | extern void mdesc_update(void); | ||
| 63 | |||
| 64 | extern void mdesc_fill_in_cpu_data(cpumask_t mask); | ||
| 37 | 65 | ||
| 38 | extern void sun4v_mdesc_init(void); | 66 | extern void sun4v_mdesc_init(void); |
| 39 | 67 | ||
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index 8d129032013e..9fc225ed5500 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h | |||
| @@ -76,6 +76,9 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str | |||
| 76 | unsigned long ctx_valid, flags; | 76 | unsigned long ctx_valid, flags; |
| 77 | int cpu; | 77 | int cpu; |
| 78 | 78 | ||
| 79 | if (unlikely(mm == &init_mm)) | ||
| 80 | return; | ||
| 81 | |||
| 79 | spin_lock_irqsave(&mm->context.lock, flags); | 82 | spin_lock_irqsave(&mm->context.lock, flags); |
| 80 | ctx_valid = CTX_VALID(mm->context); | 83 | ctx_valid = CTX_VALID(mm->context); |
| 81 | if (!ctx_valid) | 84 | if (!ctx_valid) |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 9e80ad43b29c..0393380d754a 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
| @@ -573,24 +573,6 @@ static inline unsigned long pte_exec(pte_t pte) | |||
| 573 | return (pte_val(pte) & mask); | 573 | return (pte_val(pte) & mask); |
| 574 | } | 574 | } |
| 575 | 575 | ||
| 576 | static inline unsigned long pte_read(pte_t pte) | ||
| 577 | { | ||
| 578 | unsigned long mask; | ||
| 579 | |||
| 580 | __asm__ __volatile__( | ||
| 581 | "\n661: mov %1, %0\n" | ||
| 582 | " nop\n" | ||
| 583 | " .section .sun4v_2insn_patch, \"ax\"\n" | ||
| 584 | " .word 661b\n" | ||
| 585 | " sethi %%uhi(%2), %0\n" | ||
| 586 | " sllx %0, 32, %0\n" | ||
| 587 | " .previous\n" | ||
| 588 | : "=r" (mask) | ||
| 589 | : "i" (_PAGE_READ_4U), "i" (_PAGE_READ_4V)); | ||
| 590 | |||
| 591 | return (pte_val(pte) & mask); | ||
| 592 | } | ||
| 593 | |||
| 594 | static inline unsigned long pte_file(pte_t pte) | 576 | static inline unsigned long pte_file(pte_t pte) |
| 595 | { | 577 | { |
| 596 | unsigned long val = pte_val(pte); | 578 | unsigned long val = pte_val(pte); |
diff --git a/include/asm-sparc64/power.h b/include/asm-sparc64/power.h new file mode 100644 index 000000000000..94495c1ac4f6 --- /dev/null +++ b/include/asm-sparc64/power.h | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #ifndef _SPARC64_POWER_H | ||
| 2 | #define _SPARC64_POWER_H | ||
| 3 | |||
| 4 | extern void wake_up_powerd(void); | ||
| 5 | extern int start_powerd(void); | ||
| 6 | |||
| 7 | #endif /* !(_SPARC64_POWER_H) */ | ||
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index 4fb8c4bfb848..e8a96a31761b 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h | |||
| @@ -29,9 +29,6 @@ | |||
| 29 | #include <asm/bitops.h> | 29 | #include <asm/bitops.h> |
| 30 | #include <asm/atomic.h> | 30 | #include <asm/atomic.h> |
| 31 | 31 | ||
| 32 | extern cpumask_t phys_cpu_present_map; | ||
| 33 | #define cpu_possible_map phys_cpu_present_map | ||
| 34 | |||
| 35 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 32 | extern cpumask_t cpu_sibling_map[NR_CPUS]; |
| 36 | extern cpumask_t cpu_core_map[NR_CPUS]; | 33 | extern cpumask_t cpu_core_map[NR_CPUS]; |
| 37 | extern int sparc64_multi_core; | 34 | extern int sparc64_multi_core; |
| @@ -44,7 +41,12 @@ extern int hard_smp_processor_id(void); | |||
| 44 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 41 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
| 45 | 42 | ||
| 46 | extern void smp_fill_in_sib_core_maps(void); | 43 | extern void smp_fill_in_sib_core_maps(void); |
| 47 | extern unsigned char boot_cpu_id; | 44 | extern void cpu_play_dead(void); |
| 45 | |||
| 46 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 47 | extern int __cpu_disable(void); | ||
| 48 | extern void __cpu_die(unsigned int cpu); | ||
| 49 | #endif | ||
| 48 | 50 | ||
| 49 | #endif /* !(__ASSEMBLY__) */ | 51 | #endif /* !(__ASSEMBLY__) */ |
| 50 | 52 | ||
| @@ -52,7 +54,6 @@ extern unsigned char boot_cpu_id; | |||
| 52 | 54 | ||
| 53 | #define hard_smp_processor_id() 0 | 55 | #define hard_smp_processor_id() 0 |
| 54 | #define smp_fill_in_sib_core_maps() do { } while (0) | 56 | #define smp_fill_in_sib_core_maps() do { } while (0) |
| 55 | #define boot_cpu_id (0) | ||
| 56 | 57 | ||
| 57 | #endif /* !(CONFIG_SMP) */ | 58 | #endif /* !(CONFIG_SMP) */ |
| 58 | 59 | ||
diff --git a/include/asm-sparc64/vio.h b/include/asm-sparc64/vio.h new file mode 100644 index 000000000000..83c96422e9d6 --- /dev/null +++ b/include/asm-sparc64/vio.h | |||
| @@ -0,0 +1,404 @@ | |||
| 1 | #ifndef _SPARC64_VIO_H | ||
| 2 | #define _SPARC64_VIO_H | ||
| 3 | |||
| 4 | #include <linux/kernel.h> | ||
| 5 | #include <linux/device.h> | ||
| 6 | #include <linux/mod_devicetable.h> | ||
| 7 | #include <linux/timer.h> | ||
| 8 | #include <linux/spinlock.h> | ||
| 9 | #include <linux/completion.h> | ||
| 10 | #include <linux/list.h> | ||
| 11 | |||
| 12 | #include <asm/ldc.h> | ||
| 13 | #include <asm/mdesc.h> | ||
| 14 | |||
| 15 | struct vio_msg_tag { | ||
| 16 | u8 type; | ||
| 17 | #define VIO_TYPE_CTRL 0x01 | ||
| 18 | #define VIO_TYPE_DATA 0x02 | ||
| 19 | #define VIO_TYPE_ERR 0x04 | ||
| 20 | |||
| 21 | u8 stype; | ||
| 22 | #define VIO_SUBTYPE_INFO 0x01 | ||
| 23 | #define VIO_SUBTYPE_ACK 0x02 | ||
| 24 | #define VIO_SUBTYPE_NACK 0x04 | ||
| 25 | |||
| 26 | u16 stype_env; | ||
| 27 | #define VIO_VER_INFO 0x0001 | ||
| 28 | #define VIO_ATTR_INFO 0x0002 | ||
| 29 | #define VIO_DRING_REG 0x0003 | ||
| 30 | #define VIO_DRING_UNREG 0x0004 | ||
| 31 | #define VIO_RDX 0x0005 | ||
| 32 | #define VIO_PKT_DATA 0x0040 | ||
| 33 | #define VIO_DESC_DATA 0x0041 | ||
| 34 | #define VIO_DRING_DATA 0x0042 | ||
| 35 | #define VNET_MCAST_INFO 0x0101 | ||
| 36 | |||
| 37 | u32 sid; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct vio_rdx { | ||
| 41 | struct vio_msg_tag tag; | ||
| 42 | u64 resv[6]; | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct vio_ver_info { | ||
| 46 | struct vio_msg_tag tag; | ||
| 47 | u16 major; | ||
| 48 | u16 minor; | ||
| 49 | u8 dev_class; | ||
| 50 | #define VDEV_NETWORK 0x01 | ||
| 51 | #define VDEV_NETWORK_SWITCH 0x02 | ||
| 52 | #define VDEV_DISK 0x03 | ||
| 53 | #define VDEV_DISK_SERVER 0x04 | ||
| 54 | |||
| 55 | u8 resv1[3]; | ||
| 56 | u64 resv2[5]; | ||
| 57 | }; | ||
| 58 | |||
| 59 | struct vio_dring_register { | ||
| 60 | struct vio_msg_tag tag; | ||
| 61 | u64 dring_ident; | ||
| 62 | u32 num_descr; | ||
| 63 | u32 descr_size; | ||
| 64 | u16 options; | ||
| 65 | #define VIO_TX_DRING 0x0001 | ||
| 66 | #define VIO_RX_DRING 0x0002 | ||
| 67 | u16 resv; | ||
| 68 | u32 num_cookies; | ||
| 69 | struct ldc_trans_cookie cookies[0]; | ||
| 70 | }; | ||
| 71 | |||
| 72 | struct vio_dring_unregister { | ||
| 73 | struct vio_msg_tag tag; | ||
| 74 | u64 dring_ident; | ||
| 75 | u64 resv[5]; | ||
| 76 | }; | ||
| 77 | |||
| 78 | /* Data transfer modes */ | ||
| 79 | #define VIO_PKT_MODE 0x01 /* Packet based transfer */ | ||
| 80 | #define VIO_DESC_MODE 0x02 /* In-band descriptors */ | ||
| 81 | #define VIO_DRING_MODE 0x03 /* Descriptor rings */ | ||
| 82 | |||
| 83 | struct vio_dring_data { | ||
| 84 | struct vio_msg_tag tag; | ||
| 85 | u64 seq; | ||
| 86 | u64 dring_ident; | ||
| 87 | u32 start_idx; | ||
| 88 | u32 end_idx; | ||
| 89 | u8 state; | ||
| 90 | #define VIO_DRING_ACTIVE 0x01 | ||
| 91 | #define VIO_DRING_STOPPED 0x02 | ||
| 92 | |||
| 93 | u8 __pad1; | ||
| 94 | u16 __pad2; | ||
| 95 | u32 __pad3; | ||
| 96 | u64 __par4[2]; | ||
| 97 | }; | ||
| 98 | |||
| 99 | struct vio_dring_hdr { | ||
| 100 | u8 state; | ||
| 101 | #define VIO_DESC_FREE 0x01 | ||
| 102 | #define VIO_DESC_READY 0x02 | ||
| 103 | #define VIO_DESC_ACCEPTED 0x03 | ||
| 104 | #define VIO_DESC_DONE 0x04 | ||
| 105 | u8 ack; | ||
| 106 | #define VIO_ACK_ENABLE 0x01 | ||
| 107 | #define VIO_ACK_DISABLE 0x00 | ||
| 108 | |||
| 109 | u16 __pad1; | ||
| 110 | u32 __pad2; | ||
| 111 | }; | ||
| 112 | |||
| 113 | /* VIO disk specific structures and defines */ | ||
| 114 | struct vio_disk_attr_info { | ||
| 115 | struct vio_msg_tag tag; | ||
| 116 | u8 xfer_mode; | ||
| 117 | u8 vdisk_type; | ||
| 118 | #define VD_DISK_TYPE_SLICE 0x01 /* Slice in block device */ | ||
| 119 | #define VD_DISK_TYPE_DISK 0x02 /* Entire block device */ | ||
| 120 | u16 resv1; | ||
| 121 | u32 vdisk_block_size; | ||
| 122 | u64 operations; | ||
| 123 | u64 vdisk_size; | ||
| 124 | u64 max_xfer_size; | ||
| 125 | u64 resv2[2]; | ||
| 126 | }; | ||
| 127 | |||
| 128 | struct vio_disk_desc { | ||
| 129 | struct vio_dring_hdr hdr; | ||
| 130 | u64 req_id; | ||
| 131 | u8 operation; | ||
| 132 | #define VD_OP_BREAD 0x01 /* Block read */ | ||
| 133 | #define VD_OP_BWRITE 0x02 /* Block write */ | ||
| 134 | #define VD_OP_FLUSH 0x03 /* Flush disk contents */ | ||
| 135 | #define VD_OP_GET_WCE 0x04 /* Get write-cache status */ | ||
| 136 | #define VD_OP_SET_WCE 0x05 /* Enable/disable write-cache */ | ||
| 137 | #define VD_OP_GET_VTOC 0x06 /* Get VTOC */ | ||
| 138 | #define VD_OP_SET_VTOC 0x07 /* Set VTOC */ | ||
| 139 | #define VD_OP_GET_DISKGEOM 0x08 /* Get disk geometry */ | ||
| 140 | #define VD_OP_SET_DISKGEOM 0x09 /* Set disk geometry */ | ||
| 141 | #define VD_OP_SCSICMD 0x0a /* SCSI control command */ | ||
| 142 | #define VD_OP_GET_DEVID 0x0b /* Get device ID */ | ||
| 143 | #define VD_OP_GET_EFI 0x0c /* Get EFI */ | ||
| 144 | #define VD_OP_SET_EFI 0x0d /* Set EFI */ | ||
| 145 | u8 slice; | ||
| 146 | u16 resv1; | ||
| 147 | u32 status; | ||
| 148 | u64 offset; | ||
| 149 | u64 size; | ||
| 150 | u32 ncookies; | ||
| 151 | u32 resv2; | ||
| 152 | struct ldc_trans_cookie cookies[0]; | ||
| 153 | }; | ||
| 154 | |||
| 155 | #define VIO_DISK_VNAME_LEN 8 | ||
| 156 | #define VIO_DISK_ALABEL_LEN 128 | ||
| 157 | #define VIO_DISK_NUM_PART 8 | ||
| 158 | |||
| 159 | struct vio_disk_vtoc { | ||
| 160 | u8 volume_name[VIO_DISK_VNAME_LEN]; | ||
| 161 | u16 sector_size; | ||
| 162 | u16 num_partitions; | ||
| 163 | u8 ascii_label[VIO_DISK_ALABEL_LEN]; | ||
| 164 | struct { | ||
| 165 | u16 id; | ||
| 166 | u16 perm_flags; | ||
| 167 | u32 resv; | ||
| 168 | u64 start_block; | ||
| 169 | u64 num_blocks; | ||
| 170 | } partitions[VIO_DISK_NUM_PART]; | ||
| 171 | }; | ||
| 172 | |||
| 173 | struct vio_disk_geom { | ||
| 174 | u16 num_cyl; /* Num data cylinders */ | ||
| 175 | u16 alt_cyl; /* Num alternate cylinders */ | ||
| 176 | u16 beg_cyl; /* Cyl off of fixed head area */ | ||
| 177 | u16 num_hd; /* Num heads */ | ||
| 178 | u16 num_sec; /* Num sectors */ | ||
| 179 | u16 ifact; /* Interleave factor */ | ||
| 180 | u16 apc; /* Alts per cylinder (SCSI) */ | ||
| 181 | u16 rpm; /* Revolutions per minute */ | ||
| 182 | u16 phy_cyl; /* Num physical cylinders */ | ||
| 183 | u16 wr_skip; /* Num sects to skip, writes */ | ||
| 184 | u16 rd_skip; /* Num sects to skip, writes */ | ||
| 185 | }; | ||
| 186 | |||
| 187 | struct vio_disk_devid { | ||
| 188 | u16 resv; | ||
| 189 | u16 type; | ||
| 190 | u32 len; | ||
| 191 | char id[0]; | ||
| 192 | }; | ||
| 193 | |||
| 194 | struct vio_disk_efi { | ||
| 195 | u64 lba; | ||
| 196 | u64 len; | ||
| 197 | char data[0]; | ||
| 198 | }; | ||
| 199 | |||
| 200 | /* VIO net specific structures and defines */ | ||
| 201 | struct vio_net_attr_info { | ||
| 202 | struct vio_msg_tag tag; | ||
| 203 | u8 xfer_mode; | ||
| 204 | u8 addr_type; | ||
| 205 | #define VNET_ADDR_ETHERMAC 0x01 | ||
| 206 | u16 ack_freq; | ||
| 207 | u32 resv1; | ||
| 208 | u64 addr; | ||
| 209 | u64 mtu; | ||
| 210 | u64 resv2[3]; | ||
| 211 | }; | ||
| 212 | |||
| 213 | #define VNET_NUM_MCAST 7 | ||
| 214 | |||
| 215 | struct vio_net_mcast_info { | ||
| 216 | struct vio_msg_tag tag; | ||
| 217 | u8 set; | ||
| 218 | u8 count; | ||
| 219 | u8 mcast_addr[VNET_NUM_MCAST * 6]; | ||
| 220 | u32 resv; | ||
| 221 | }; | ||
| 222 | |||
| 223 | struct vio_net_desc { | ||
| 224 | struct vio_dring_hdr hdr; | ||
| 225 | u32 size; | ||
| 226 | u32 ncookies; | ||
| 227 | struct ldc_trans_cookie cookies[0]; | ||
| 228 | }; | ||
| 229 | |||
| 230 | #define VIO_MAX_RING_COOKIES 24 | ||
| 231 | |||
| 232 | struct vio_dring_state { | ||
| 233 | u64 ident; | ||
| 234 | void *base; | ||
| 235 | u64 snd_nxt; | ||
| 236 | u64 rcv_nxt; | ||
| 237 | u32 entry_size; | ||
| 238 | u32 num_entries; | ||
| 239 | u32 prod; | ||
| 240 | u32 cons; | ||
| 241 | u32 pending; | ||
| 242 | int ncookies; | ||
| 243 | struct ldc_trans_cookie cookies[VIO_MAX_RING_COOKIES]; | ||
| 244 | }; | ||
| 245 | |||
| 246 | static inline void *vio_dring_cur(struct vio_dring_state *dr) | ||
| 247 | { | ||
| 248 | return dr->base + (dr->entry_size * dr->prod); | ||
| 249 | } | ||
| 250 | |||
| 251 | static inline void *vio_dring_entry(struct vio_dring_state *dr, | ||
| 252 | unsigned int index) | ||
| 253 | { | ||
| 254 | return dr->base + (dr->entry_size * index); | ||
| 255 | } | ||
| 256 | |||
| 257 | static inline u32 vio_dring_avail(struct vio_dring_state *dr, | ||
| 258 | unsigned int ring_size) | ||
| 259 | { | ||
| 260 | /* Ensure build-time power-of-2. */ | ||
| 261 | BUILD_BUG_ON(ring_size & (ring_size - 1)); | ||
| 262 | |||
| 263 | return (dr->pending - | ||
| 264 | ((dr->prod - dr->cons) & (ring_size - 1))); | ||
| 265 | } | ||
| 266 | |||
| 267 | #define VIO_MAX_TYPE_LEN 64 | ||
| 268 | #define VIO_MAX_COMPAT_LEN 64 | ||
| 269 | |||
| 270 | struct vio_dev { | ||
| 271 | u64 mp; | ||
| 272 | struct device_node *dp; | ||
| 273 | |||
| 274 | char type[VIO_MAX_TYPE_LEN]; | ||
| 275 | char compat[VIO_MAX_COMPAT_LEN]; | ||
| 276 | int compat_len; | ||
| 277 | |||
| 278 | unsigned long channel_id; | ||
| 279 | |||
| 280 | unsigned int tx_irq; | ||
| 281 | unsigned int rx_irq; | ||
| 282 | |||
| 283 | struct device dev; | ||
| 284 | }; | ||
| 285 | |||
| 286 | struct vio_driver { | ||
| 287 | struct list_head node; | ||
| 288 | const struct vio_device_id *id_table; | ||
| 289 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | ||
| 290 | int (*remove)(struct vio_dev *dev); | ||
| 291 | void (*shutdown)(struct vio_dev *dev); | ||
| 292 | unsigned long driver_data; | ||
| 293 | struct device_driver driver; | ||
| 294 | }; | ||
| 295 | |||
| 296 | struct vio_version { | ||
| 297 | u16 major; | ||
| 298 | u16 minor; | ||
| 299 | }; | ||
| 300 | |||
| 301 | struct vio_driver_state; | ||
| 302 | struct vio_driver_ops { | ||
| 303 | int (*send_attr)(struct vio_driver_state *vio); | ||
| 304 | int (*handle_attr)(struct vio_driver_state *vio, void *pkt); | ||
| 305 | void (*handshake_complete)(struct vio_driver_state *vio); | ||
| 306 | }; | ||
| 307 | |||
| 308 | struct vio_completion { | ||
| 309 | struct completion com; | ||
| 310 | int err; | ||
| 311 | int waiting_for; | ||
| 312 | }; | ||
| 313 | |||
| 314 | struct vio_driver_state { | ||
| 315 | /* Protects VIO handshake and, optionally, driver private state. */ | ||
| 316 | spinlock_t lock; | ||
| 317 | |||
| 318 | struct ldc_channel *lp; | ||
| 319 | |||
| 320 | u32 _peer_sid; | ||
| 321 | u32 _local_sid; | ||
| 322 | struct vio_dring_state drings[2]; | ||
| 323 | #define VIO_DRIVER_TX_RING 0 | ||
| 324 | #define VIO_DRIVER_RX_RING 1 | ||
| 325 | |||
| 326 | u8 hs_state; | ||
| 327 | #define VIO_HS_INVALID 0x00 | ||
| 328 | #define VIO_HS_GOTVERS 0x01 | ||
| 329 | #define VIO_HS_GOT_ATTR 0x04 | ||
| 330 | #define VIO_HS_SENT_DREG 0x08 | ||
| 331 | #define VIO_HS_SENT_RDX 0x10 | ||
| 332 | #define VIO_HS_GOT_RDX_ACK 0x20 | ||
| 333 | #define VIO_HS_GOT_RDX 0x40 | ||
| 334 | #define VIO_HS_SENT_RDX_ACK 0x80 | ||
| 335 | #define VIO_HS_COMPLETE (VIO_HS_GOT_RDX_ACK | VIO_HS_SENT_RDX_ACK) | ||
| 336 | |||
| 337 | u8 dev_class; | ||
| 338 | |||
| 339 | u8 dr_state; | ||
| 340 | #define VIO_DR_STATE_TXREG 0x01 | ||
| 341 | #define VIO_DR_STATE_RXREG 0x02 | ||
| 342 | #define VIO_DR_STATE_TXREQ 0x10 | ||
| 343 | #define VIO_DR_STATE_RXREQ 0x20 | ||
| 344 | |||
| 345 | u8 debug; | ||
| 346 | #define VIO_DEBUG_HS 0x01 | ||
| 347 | #define VIO_DEBUG_DATA 0x02 | ||
| 348 | |||
| 349 | void *desc_buf; | ||
| 350 | unsigned int desc_buf_len; | ||
| 351 | |||
| 352 | struct vio_completion *cmp; | ||
| 353 | |||
| 354 | struct vio_dev *vdev; | ||
| 355 | |||
| 356 | struct timer_list timer; | ||
| 357 | |||
| 358 | struct vio_version ver; | ||
| 359 | |||
| 360 | struct vio_version *ver_table; | ||
| 361 | int ver_table_entries; | ||
| 362 | |||
| 363 | char *name; | ||
| 364 | |||
| 365 | struct vio_driver_ops *ops; | ||
| 366 | }; | ||
| 367 | |||
| 368 | #define viodbg(TYPE, f, a...) \ | ||
| 369 | do { if (vio->debug & VIO_DEBUG_##TYPE) \ | ||
| 370 | printk(KERN_INFO "vio: ID[%lu] " f, \ | ||
| 371 | vio->vdev->channel_id, ## a); \ | ||
| 372 | } while (0) | ||
| 373 | |||
| 374 | extern int vio_register_driver(struct vio_driver *drv); | ||
| 375 | extern void vio_unregister_driver(struct vio_driver *drv); | ||
| 376 | |||
| 377 | static inline struct vio_driver *to_vio_driver(struct device_driver *drv) | ||
| 378 | { | ||
| 379 | return container_of(drv, struct vio_driver, driver); | ||
| 380 | } | ||
| 381 | |||
| 382 | static inline struct vio_dev *to_vio_dev(struct device *dev) | ||
| 383 | { | ||
| 384 | return container_of(dev, struct vio_dev, dev); | ||
| 385 | } | ||
| 386 | |||
| 387 | extern int vio_ldc_send(struct vio_driver_state *vio, void *data, int len); | ||
| 388 | extern void vio_link_state_change(struct vio_driver_state *vio, int event); | ||
| 389 | extern void vio_conn_reset(struct vio_driver_state *vio); | ||
| 390 | extern int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt); | ||
| 391 | extern int vio_validate_sid(struct vio_driver_state *vio, | ||
| 392 | struct vio_msg_tag *tp); | ||
| 393 | extern u32 vio_send_sid(struct vio_driver_state *vio); | ||
| 394 | extern int vio_ldc_alloc(struct vio_driver_state *vio, | ||
| 395 | struct ldc_channel_config *base_cfg, void *event_arg); | ||
| 396 | extern void vio_ldc_free(struct vio_driver_state *vio); | ||
| 397 | extern int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev, | ||
| 398 | u8 dev_class, struct vio_version *ver_table, | ||
| 399 | int ver_table_size, struct vio_driver_ops *ops, | ||
| 400 | char *name); | ||
| 401 | |||
| 402 | extern void vio_port_up(struct vio_driver_state *vio); | ||
| 403 | |||
| 404 | #endif /* _SPARC64_VIO_H */ | ||
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index 1b1090a91a58..830fc6e5d49d 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h | |||
| @@ -175,12 +175,6 @@ static inline int pte_none(pte_t pte) | |||
| 175 | * The following only work if pte_present() is true. | 175 | * The following only work if pte_present() is true. |
| 176 | * Undefined behaviour if not.. | 176 | * Undefined behaviour if not.. |
| 177 | */ | 177 | */ |
| 178 | static inline int pte_user(pte_t pte) | ||
| 179 | { | ||
| 180 | return((pte_get_bits(pte, _PAGE_USER)) && | ||
| 181 | !(pte_get_bits(pte, _PAGE_PROTNONE))); | ||
| 182 | } | ||
| 183 | |||
| 184 | static inline int pte_read(pte_t pte) | 178 | static inline int pte_read(pte_t pte) |
| 185 | { | 179 | { |
| 186 | return((pte_get_bits(pte, _PAGE_USER)) && | 180 | return((pte_get_bits(pte, _PAGE_USER)) && |
| @@ -238,18 +232,6 @@ static inline pte_t pte_mknewprot(pte_t pte) | |||
| 238 | return(pte); | 232 | return(pte); |
| 239 | } | 233 | } |
| 240 | 234 | ||
| 241 | static inline pte_t pte_rdprotect(pte_t pte) | ||
| 242 | { | ||
| 243 | pte_clear_bits(pte, _PAGE_USER); | ||
| 244 | return(pte_mknewprot(pte)); | ||
| 245 | } | ||
| 246 | |||
| 247 | static inline pte_t pte_exprotect(pte_t pte) | ||
| 248 | { | ||
| 249 | pte_clear_bits(pte, _PAGE_USER); | ||
| 250 | return(pte_mknewprot(pte)); | ||
| 251 | } | ||
| 252 | |||
| 253 | static inline pte_t pte_mkclean(pte_t pte) | 235 | static inline pte_t pte_mkclean(pte_t pte) |
| 254 | { | 236 | { |
| 255 | pte_clear_bits(pte, _PAGE_DIRTY); | 237 | pte_clear_bits(pte, _PAGE_DIRTY); |
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h index 18a13ba74605..6e5fd5c892d0 100644 --- a/include/asm-um/thread_info.h +++ b/include/asm-um/thread_info.h | |||
| @@ -52,10 +52,21 @@ static inline struct thread_info *current_thread_info(void) | |||
| 52 | return ti; | 52 | return ti; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
| 56 | |||
| 57 | #define alloc_thread_info(tsk) \ | ||
| 58 | ((struct thread_info *) __get_free_pages(GFP_KERNEL | __GFP_ZERO, \ | ||
| 59 | CONFIG_KERNEL_STACK_ORDER)) | ||
| 60 | #else | ||
| 61 | |||
| 55 | /* thread information allocation */ | 62 | /* thread information allocation */ |
| 56 | #define alloc_thread_info(tsk) \ | 63 | #define alloc_thread_info(tsk) \ |
| 57 | ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL)) | 64 | ((struct thread_info *) __get_free_pages(GFP_KERNEL, \ |
| 58 | #define free_thread_info(ti) kfree(ti) | 65 | CONFIG_KERNEL_STACK_ORDER)) |
| 66 | #endif | ||
| 67 | |||
| 68 | #define free_thread_info(ti) \ | ||
| 69 | free_pages((unsigned long)(ti),CONFIG_KERNEL_STACK_ORDER) | ||
| 59 | 70 | ||
| 60 | #endif | 71 | #endif |
| 61 | 72 | ||
diff --git a/include/asm-v850/fb.h b/include/asm-v850/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-v850/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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/ioctls.h b/include/asm-v850/ioctls.h index 05c0dc9ce1ea..5313abd5f388 100644 --- a/include/asm-v850/ioctls.h +++ b/include/asm-v850/ioctls.h | |||
| @@ -46,6 +46,10 @@ | |||
| 46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
| 47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
| 48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 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) | ||
| 49 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
| 50 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
| 51 | 55 | ||
diff --git a/include/asm-v850/termbits.h b/include/asm-v850/termbits.h index 35412f7f3eea..295d7bf69451 100644 --- a/include/asm-v850/termbits.h +++ b/include/asm-v850/termbits.h | |||
| @@ -141,6 +141,7 @@ struct ktermios { | |||
| 141 | #define HUPCL 0002000 | 141 | #define HUPCL 0002000 |
| 142 | #define CLOCAL 0004000 | 142 | #define CLOCAL 0004000 |
| 143 | #define CBAUDEX 0010000 | 143 | #define CBAUDEX 0010000 |
| 144 | #define BOTHER 0010000 | ||
| 144 | #define B57600 0010001 | 145 | #define B57600 0010001 |
| 145 | #define B115200 0010002 | 146 | #define B115200 0010002 |
| 146 | #define B230400 0010003 | 147 | #define B230400 0010003 |
| @@ -156,10 +157,12 @@ struct ktermios { | |||
| 156 | #define B3000000 0010015 | 157 | #define B3000000 0010015 |
| 157 | #define B3500000 0010016 | 158 | #define B3500000 0010016 |
| 158 | #define B4000000 0010017 | 159 | #define B4000000 0010017 |
| 159 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 160 | #define CIBAUD 002003600000 /* input baud rate */ |
| 160 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 161 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
| 161 | #define CRTSCTS 020000000000 /* flow control */ | 162 | #define CRTSCTS 020000000000 /* flow control */ |
| 162 | 163 | ||
| 164 | #define IBSHIFT 16 /* Shifr from CBAUD to CIBAUD */ | ||
| 165 | |||
| 163 | /* c_lflag bits */ | 166 | /* c_lflag bits */ |
| 164 | #define ISIG 0000001 | 167 | #define ISIG 0000001 |
| 165 | #define ICANON 0000002 | 168 | #define ICANON 0000002 |
diff --git a/include/asm-v850/termios.h b/include/asm-v850/termios.h index c2c2b1d58776..fcd171838d9c 100644 --- a/include/asm-v850/termios.h +++ b/include/asm-v850/termios.h | |||
| @@ -80,8 +80,10 @@ struct termio { | |||
| 80 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 80 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
| 81 | }) | 81 | }) |
| 82 | 82 | ||
| 83 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 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 termios)) | 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)) | ||
| 85 | 87 | ||
| 86 | #endif /* __KERNEL__ */ | 88 | #endif /* __KERNEL__ */ |
| 87 | 89 | ||
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h index b37ab8218ef0..53cb96b68a62 100644 --- a/include/asm-x86_64/compat.h +++ b/include/asm-x86_64/compat.h | |||
| @@ -33,8 +33,10 @@ typedef s32 compat_key_t; | |||
| 33 | 33 | ||
| 34 | typedef s32 compat_int_t; | 34 | typedef s32 compat_int_t; |
| 35 | typedef s32 compat_long_t; | 35 | typedef s32 compat_long_t; |
| 36 | typedef s64 __attribute__((aligned(4))) compat_s64; | ||
| 36 | typedef u32 compat_uint_t; | 37 | typedef u32 compat_uint_t; |
| 37 | typedef u32 compat_ulong_t; | 38 | typedef u32 compat_ulong_t; |
| 39 | typedef u64 __attribute__((aligned(4))) compat_u64; | ||
| 38 | 40 | ||
| 39 | struct compat_timespec { | 41 | struct compat_timespec { |
| 40 | compat_time_t tv_sec; | 42 | compat_time_t tv_sec; |
diff --git a/include/asm-x86_64/fb.h b/include/asm-x86_64/fb.h new file mode 100644 index 000000000000..60548e651d12 --- /dev/null +++ b/include/asm-x86_64/fb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #ifndef _ASM_FB_H_ | ||
| 2 | #define _ASM_FB_H_ | ||
| 3 | #include <linux/fb.h> | ||
| 4 | #include <linux/fs.h> | ||
| 5 | #include <asm/page.h> | ||
| 6 | |||
| 7 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
| 8 | unsigned long off) | ||
| 9 | { | ||
| 10 | if (boot_cpu_data.x86 > 3) | ||
| 11 | pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline int fb_is_primary_device(struct fb_info *info) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/include/asm-x86_64/fixmap.h b/include/asm-x86_64/fixmap.h index e90e1677531b..2acb9b7f6418 100644 --- a/include/asm-x86_64/fixmap.h +++ b/include/asm-x86_64/fixmap.h | |||
| @@ -35,6 +35,8 @@ enum fixed_addresses { | |||
| 35 | VSYSCALL_LAST_PAGE, | 35 | VSYSCALL_LAST_PAGE, |
| 36 | VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, | 36 | VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, |
| 37 | VSYSCALL_HPET, | 37 | VSYSCALL_HPET, |
| 38 | FIX_DBGP_BASE, | ||
| 39 | FIX_EARLYCON_MEM_BASE, | ||
| 38 | FIX_HPET_BASE, | 40 | FIX_HPET_BASE, |
| 39 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ | 41 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ |
| 40 | FIX_IO_APIC_BASE_0, | 42 | FIX_IO_APIC_BASE_0, |
| @@ -84,7 +86,7 @@ static __always_inline unsigned long fix_to_virt(const unsigned int idx) | |||
| 84 | if (idx >= __end_of_fixed_addresses) | 86 | if (idx >= __end_of_fixed_addresses) |
| 85 | __this_fixmap_does_not_exist(); | 87 | __this_fixmap_does_not_exist(); |
| 86 | 88 | ||
| 87 | return __fix_to_virt(idx); | 89 | return __fix_to_virt(idx); |
| 88 | } | 90 | } |
| 89 | 91 | ||
| 90 | #endif | 92 | #endif |
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index de2cd9a2303a..7475095c5061 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h | |||
| @@ -144,6 +144,7 @@ extern void early_iounmap(void *addr, unsigned long size); | |||
| 144 | */ | 144 | */ |
| 145 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); | 145 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); |
| 146 | extern void iounmap(volatile void __iomem *addr); | 146 | extern void iounmap(volatile void __iomem *addr); |
| 147 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
| 147 | 148 | ||
| 148 | /* | 149 | /* |
| 149 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 150 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index e327c830da0c..88adf1afb0a2 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h | |||
| @@ -48,7 +48,8 @@ void copy_page(void *, void *); | |||
| 48 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 48 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 49 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 49 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
| 50 | 50 | ||
| 51 | #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) | 51 | #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \ |
| 52 | alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) | ||
| 52 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 53 | #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 53 | /* | 54 | /* |
| 54 | * These are used to make use of C type-checking.. | 55 | * These are used to make use of C type-checking.. |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 0a71e0b9a619..3ba53099297d 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
| @@ -266,21 +266,15 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) | |||
| 266 | * Undefined behaviour if not.. | 266 | * Undefined behaviour if not.. |
| 267 | */ | 267 | */ |
| 268 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) | 268 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) |
| 269 | static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | ||
| 270 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | ||
| 271 | static inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_NX); } | ||
| 272 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 269 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
| 273 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 270 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 274 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 271 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
| 275 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 272 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| 276 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } | 273 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } |
| 277 | 274 | ||
| 278 | static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | ||
| 279 | static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | ||
| 280 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | 275 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } |
| 281 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } | 276 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } |
| 282 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; } | 277 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; } |
| 283 | static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; } | ||
| 284 | static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_NX)); return pte; } | 278 | static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_NX)); return pte; } |
| 285 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 279 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
| 286 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 280 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
| @@ -290,13 +284,6 @@ static inline pte_t pte_clrhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & | |||
| 290 | 284 | ||
| 291 | struct vm_area_struct; | 285 | struct vm_area_struct; |
| 292 | 286 | ||
| 293 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | ||
| 294 | { | ||
| 295 | if (!pte_dirty(*ptep)) | ||
| 296 | return 0; | ||
| 297 | return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte); | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | 287 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) |
| 301 | { | 288 | { |
| 302 | if (!pte_young(*ptep)) | 289 | if (!pte_young(*ptep)) |
| @@ -433,7 +420,6 @@ extern int kern_addr_valid(unsigned long addr); | |||
| 433 | (((o) & (1UL << (__VIRTUAL_MASK_SHIFT-1))) ? ((o) | (~__VIRTUAL_MASK)) : (o)) | 420 | (((o) & (1UL << (__VIRTUAL_MASK_SHIFT-1))) ? ((o) | (~__VIRTUAL_MASK)) : (o)) |
| 434 | 421 | ||
| 435 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 422 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 436 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 437 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 423 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 438 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL | 424 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL |
| 439 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 425 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
diff --git a/include/asm-xtensa/fb.h b/include/asm-xtensa/fb.h new file mode 100644 index 000000000000..c7df38030992 --- /dev/null +++ b/include/asm-xtensa/fb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 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-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h index 2d4b5db6ea63..06850f3b26a7 100644 --- a/include/asm-xtensa/pgtable.h +++ b/include/asm-xtensa/pgtable.h | |||
| @@ -197,16 +197,13 @@ extern pgd_t swapper_pg_dir[PAGE_SIZE/sizeof(pgd_t)]; | |||
| 197 | 197 | ||
| 198 | /* Note: We use the _PAGE_USER bit to indicate write-protect kernel memory */ | 198 | /* Note: We use the _PAGE_USER bit to indicate write-protect kernel memory */ |
| 199 | 199 | ||
| 200 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | ||
| 201 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 200 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
| 202 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 201 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
| 203 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 202 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
| 204 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 203 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
| 205 | static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~(_PAGE_RW | _PAGE_WRENABLE); return pte; } | 204 | static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~(_PAGE_RW | _PAGE_WRENABLE); return pte; } |
| 206 | static inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_USER; return pte; } | ||
| 207 | static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } | 205 | static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; } |
| 208 | static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } | 206 | static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } |
| 209 | static inline pte_t pte_mkread(pte_t pte) { pte_val(pte) |= _PAGE_USER; return pte; } | ||
| 210 | static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } | 207 | static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; } |
| 211 | static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } | 208 | static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; } |
| 212 | static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pte; } | 209 | static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pte; } |
| @@ -270,17 +267,6 @@ ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, | |||
| 270 | return 1; | 267 | return 1; |
| 271 | } | 268 | } |
| 272 | 269 | ||
| 273 | static inline int | ||
| 274 | ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, | ||
| 275 | pte_t *ptep) | ||
| 276 | { | ||
| 277 | pte_t pte = *ptep; | ||
| 278 | if (!pte_dirty(pte)) | ||
| 279 | return 0; | ||
| 280 | update_pte(ptep, pte_mkclean(pte)); | ||
| 281 | return 1; | ||
| 282 | } | ||
| 283 | |||
| 284 | static inline pte_t | 270 | static inline pte_t |
| 285 | ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 271 | ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
| 286 | { | 272 | { |
| @@ -421,7 +407,6 @@ typedef pte_t *pte_addr_t; | |||
| 421 | #endif /* !defined (__ASSEMBLY__) */ | 407 | #endif /* !defined (__ASSEMBLY__) */ |
| 422 | 408 | ||
| 423 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 409 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| 424 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | ||
| 425 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | 410 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR |
| 426 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 411 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
| 427 | #define __HAVE_ARCH_PTEP_MKDIRTY | 412 | #define __HAVE_ARCH_PTEP_MKDIRTY |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 127d2d192b5a..bcf875e844fe 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -247,7 +247,6 @@ unifdef-y += isdn.h | |||
| 247 | unifdef-y += isdnif.h | 247 | unifdef-y += isdnif.h |
| 248 | unifdef-y += isdn_divertif.h | 248 | unifdef-y += isdn_divertif.h |
| 249 | unifdef-y += isdn_ppp.h | 249 | unifdef-y += isdn_ppp.h |
| 250 | unifdef-y += isicom.h | ||
| 251 | unifdef-y += jbd.h | 250 | unifdef-y += jbd.h |
| 252 | unifdef-y += joystick.h | 251 | unifdef-y += joystick.h |
| 253 | unifdef-y += kdev_t.h | 252 | unifdef-y += kdev_t.h |
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h index 93bfb0beb62a..8ff274933948 100644 --- a/include/linux/attribute_container.h +++ b/include/linux/attribute_container.h | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
| 13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
| 14 | #include <linux/klist.h> | 14 | #include <linux/klist.h> |
| 15 | #include <linux/spinlock.h> | ||
| 16 | 15 | ||
| 17 | struct attribute_container { | 16 | struct attribute_container { |
| 18 | struct list_head node; | 17 | struct list_head node; |
diff --git a/include/linux/audit.h b/include/linux/audit.h index fccc6e50298a..8ca7ca0b47f0 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -63,9 +63,12 @@ | |||
| 63 | #define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ | 63 | #define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ |
| 64 | #define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ | 64 | #define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ |
| 65 | #define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ | 65 | #define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ |
| 66 | #define AUDIT_TTY_GET 1014 /* Get TTY auditing status */ | ||
| 67 | #define AUDIT_TTY_SET 1015 /* Set TTY auditing status */ | ||
| 66 | 68 | ||
| 67 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ | 69 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ |
| 68 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ | 70 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ |
| 71 | #define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */ | ||
| 69 | #define AUDIT_LAST_USER_MSG 1199 | 72 | #define AUDIT_LAST_USER_MSG 1199 |
| 70 | #define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ | 73 | #define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ |
| 71 | #define AUDIT_LAST_USER_MSG2 2999 | 74 | #define AUDIT_LAST_USER_MSG2 2999 |
| @@ -92,6 +95,7 @@ | |||
| 92 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ | 95 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ |
| 93 | #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ | 96 | #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ |
| 94 | #define AUDIT_OBJ_PID 1318 /* ptrace target */ | 97 | #define AUDIT_OBJ_PID 1318 /* ptrace target */ |
| 98 | #define AUDIT_TTY 1319 /* Input on an administrative TTY */ | ||
| 95 | 99 | ||
| 96 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 100 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
| 97 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 101 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
| @@ -289,6 +293,10 @@ struct audit_status { | |||
| 289 | __u32 backlog; /* messages waiting in queue */ | 293 | __u32 backlog; /* messages waiting in queue */ |
| 290 | }; | 294 | }; |
| 291 | 295 | ||
| 296 | struct audit_tty_status { | ||
| 297 | __u32 enabled; /* 1 = enabled, 0 = disabled */ | ||
| 298 | }; | ||
| 299 | |||
| 292 | /* audit_rule_data supports filter rules with both integer and string | 300 | /* audit_rule_data supports filter rules with both integer and string |
| 293 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and | 301 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and |
| 294 | * AUDIT_LIST_RULES requests. | 302 | * AUDIT_LIST_RULES requests. |
| @@ -515,11 +523,13 @@ extern void audit_log_d_path(struct audit_buffer *ab, | |||
| 515 | const char *prefix, | 523 | const char *prefix, |
| 516 | struct dentry *dentry, | 524 | struct dentry *dentry, |
| 517 | struct vfsmount *vfsmnt); | 525 | struct vfsmount *vfsmnt); |
| 526 | extern void audit_log_lost(const char *message); | ||
| 518 | /* Private API (for audit.c only) */ | 527 | /* Private API (for audit.c only) */ |
| 519 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); | 528 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); |
| 520 | extern int audit_filter_type(int type); | 529 | extern int audit_filter_type(int type); |
| 521 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 530 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
| 522 | void *data, size_t datasz, uid_t loginuid, u32 sid); | 531 | void *data, size_t datasz, uid_t loginuid, u32 sid); |
| 532 | extern int audit_enabled; | ||
| 523 | #else | 533 | #else |
| 524 | #define audit_log(c,g,t,f,...) do { ; } while (0) | 534 | #define audit_log(c,g,t,f,...) do { ; } while (0) |
| 525 | #define audit_log_start(c,g,t) ({ NULL; }) | 535 | #define audit_log_start(c,g,t) ({ NULL; }) |
| @@ -530,6 +540,7 @@ extern int audit_receive_filter(int type, int pid, int uid, int seq, | |||
| 530 | #define audit_log_untrustedstring(a,s) do { ; } while (0) | 540 | #define audit_log_untrustedstring(a,s) do { ; } while (0) |
| 531 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) | 541 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) |
| 532 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) | 542 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) |
| 543 | #define audit_enabled 0 | ||
| 533 | #endif | 544 | #endif |
| 534 | #endif | 545 | #endif |
| 535 | #endif | 546 | #endif |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index f2542c24b328..7011d6255593 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -93,7 +93,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) | |||
| 93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | 93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); |
| 94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | 94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); |
| 95 | long congestion_wait(int rw, long timeout); | 95 | long congestion_wait(int rw, long timeout); |
| 96 | long congestion_wait_interruptible(int rw, long timeout); | ||
| 97 | void congestion_end(int rw); | 96 | void congestion_end(int rw); |
| 98 | 97 | ||
| 99 | #define bdi_cap_writeback_dirty(bdi) \ | 98 | #define bdi_cap_writeback_dirty(bdi) \ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index fae138bd2207..f78965fc6426 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/bio.h> | 14 | #include <linux/bio.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/stringify.h> | 16 | #include <linux/stringify.h> |
| 17 | #include <linux/bsg.h> | ||
| 17 | 18 | ||
| 18 | #include <asm/scatterlist.h> | 19 | #include <asm/scatterlist.h> |
| 19 | 20 | ||
| @@ -41,6 +42,8 @@ struct elevator_queue; | |||
| 41 | typedef struct elevator_queue elevator_t; | 42 | typedef struct elevator_queue elevator_t; |
| 42 | struct request_pm_state; | 43 | struct request_pm_state; |
| 43 | struct blk_trace; | 44 | struct blk_trace; |
| 45 | struct request; | ||
| 46 | struct sg_io_hdr; | ||
| 44 | 47 | ||
| 45 | #define BLKDEV_MIN_RQ 4 | 48 | #define BLKDEV_MIN_RQ 4 |
| 46 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 49 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
| @@ -314,6 +317,9 @@ struct request { | |||
| 314 | */ | 317 | */ |
| 315 | rq_end_io_fn *end_io; | 318 | rq_end_io_fn *end_io; |
| 316 | void *end_io_data; | 319 | void *end_io_data; |
| 320 | |||
| 321 | /* for bidi */ | ||
| 322 | struct request *next_rq; | ||
| 317 | }; | 323 | }; |
| 318 | 324 | ||
| 319 | /* | 325 | /* |
| @@ -468,6 +474,10 @@ struct request_queue | |||
| 468 | unsigned int bi_size; | 474 | unsigned int bi_size; |
| 469 | 475 | ||
| 470 | struct mutex sysfs_lock; | 476 | struct mutex sysfs_lock; |
| 477 | |||
| 478 | #if defined(CONFIG_BLK_DEV_BSG) | ||
| 479 | struct bsg_class_device bsg_dev; | ||
| 480 | #endif | ||
| 471 | }; | 481 | }; |
| 472 | 482 | ||
| 473 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 483 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
| @@ -479,6 +489,7 @@ struct request_queue | |||
| 479 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 489 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
| 480 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 490 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ |
| 481 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ | 491 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ |
| 492 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ | ||
| 482 | 493 | ||
| 483 | enum { | 494 | enum { |
| 484 | /* | 495 | /* |
| @@ -543,6 +554,7 @@ enum { | |||
| 543 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) | 554 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
| 544 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) | 555 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
| 545 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 556 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
| 557 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | ||
| 546 | 558 | ||
| 547 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) | 559 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
| 548 | 560 | ||
| @@ -607,7 +619,12 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn; | |||
| 607 | #define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) | 619 | #define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) |
| 608 | #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) | 620 | #define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) |
| 609 | 621 | ||
| 610 | #ifdef CONFIG_MMU | 622 | /* |
| 623 | * default timeout for SG_IO if none specified | ||
| 624 | */ | ||
| 625 | #define BLK_DEFAULT_SG_TIMEOUT (60 * HZ) | ||
| 626 | |||
| 627 | #ifdef CONFIG_BOUNCE | ||
| 611 | extern int init_emergency_isa_pool(void); | 628 | extern int init_emergency_isa_pool(void); |
| 612 | extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); | 629 | extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); |
| 613 | #else | 630 | #else |
| @@ -637,7 +654,8 @@ extern void blk_requeue_request(request_queue_t *, struct request *); | |||
| 637 | extern void blk_plug_device(request_queue_t *); | 654 | extern void blk_plug_device(request_queue_t *); |
| 638 | extern int blk_remove_plug(request_queue_t *); | 655 | extern int blk_remove_plug(request_queue_t *); |
| 639 | extern void blk_recount_segments(request_queue_t *, struct bio *); | 656 | extern void blk_recount_segments(request_queue_t *, struct bio *); |
| 640 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); | 657 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, |
| 658 | struct gendisk *, unsigned int, void __user *); | ||
| 641 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | 659 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, |
| 642 | struct gendisk *, struct scsi_ioctl_command __user *); | 660 | struct gendisk *, struct scsi_ioctl_command __user *); |
| 643 | 661 | ||
| @@ -680,6 +698,12 @@ extern int blk_execute_rq(request_queue_t *, struct gendisk *, | |||
| 680 | struct request *, int); | 698 | struct request *, int); |
| 681 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, | 699 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, |
| 682 | struct request *, int, rq_end_io_fn *); | 700 | struct request *, int, rq_end_io_fn *); |
| 701 | extern int blk_fill_sghdr_rq(request_queue_t *, struct request *, | ||
| 702 | struct sg_io_hdr *, int); | ||
| 703 | extern int blk_unmap_sghdr_rq(struct request *, struct sg_io_hdr *); | ||
| 704 | extern int blk_complete_sghdr_rq(struct request *, struct sg_io_hdr *, | ||
| 705 | struct bio *); | ||
| 706 | extern int blk_verify_command(unsigned char *, int); | ||
| 683 | 707 | ||
| 684 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) | 708 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) |
| 685 | { | 709 | { |
diff --git a/include/linux/bsg.h b/include/linux/bsg.h new file mode 100644 index 000000000000..bd998ca6cb2e --- /dev/null +++ b/include/linux/bsg.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | #ifndef BSG_H | ||
| 2 | #define BSG_H | ||
| 3 | |||
| 4 | #define BSG_PROTOCOL_SCSI 0 | ||
| 5 | |||
| 6 | #define BSG_SUB_PROTOCOL_SCSI_CMD 0 | ||
| 7 | #define BSG_SUB_PROTOCOL_SCSI_TMF 1 | ||
| 8 | #define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2 | ||
| 9 | |||
| 10 | struct sg_io_v4 { | ||
| 11 | __s32 guard; /* [i] 'Q' to differentiate from v3 */ | ||
| 12 | __u32 protocol; /* [i] 0 -> SCSI , .... */ | ||
| 13 | __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task | ||
| 14 | management function, .... */ | ||
| 15 | |||
| 16 | __u32 request_len; /* [i] in bytes */ | ||
| 17 | __u64 request; /* [i], [*i] {SCSI: cdb} */ | ||
| 18 | __u32 request_attr; /* [i] {SCSI: task attribute} */ | ||
| 19 | __u32 request_tag; /* [i] {SCSI: task tag (only if flagged)} */ | ||
| 20 | __u32 request_priority; /* [i] {SCSI: task priority} */ | ||
| 21 | __u32 max_response_len; /* [i] in bytes */ | ||
| 22 | __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ | ||
| 23 | |||
| 24 | /* "din_" for data in (from device); "dout_" for data out (to device) */ | ||
| 25 | __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ | ||
| 26 | __u32 din_xfer_len; /* [i] bytes to be transferred from device */ | ||
| 27 | __u64 dout_xferp; /* [i], [*i] */ | ||
| 28 | __u64 din_xferp; /* [i], [*o] */ | ||
| 29 | |||
| 30 | __u32 timeout; /* [i] units: millisecond */ | ||
| 31 | __u32 flags; /* [i] bit mask */ | ||
| 32 | __u64 usr_ptr; /* [i->o] unused internally */ | ||
| 33 | __u32 spare_in; /* [i] */ | ||
| 34 | |||
| 35 | __u32 driver_status; /* [o] 0 -> ok */ | ||
| 36 | __u32 transport_status; /* [o] 0 -> ok */ | ||
| 37 | __u32 device_status; /* [o] {SCSI: command completion status} */ | ||
| 38 | __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */ | ||
| 39 | __u32 info; /* [o] additional information */ | ||
| 40 | __u32 duration; /* [o] time to complete, in milliseconds */ | ||
| 41 | __u32 response_len; /* [o] bytes of response actually written */ | ||
| 42 | __s32 din_resid; /* [o] actual_din_xfer_len - din_xfer_len */ | ||
| 43 | __u32 generated_tag; /* [o] {SCSI: task tag that transport chose} */ | ||
| 44 | __u32 spare_out; /* [o] */ | ||
| 45 | |||
| 46 | __u32 padding; | ||
| 47 | }; | ||
| 48 | |||
| 49 | #ifdef __KERNEL__ | ||
| 50 | |||
| 51 | #if defined(CONFIG_BLK_DEV_BSG) | ||
| 52 | struct bsg_class_device { | ||
| 53 | struct class_device *class_dev; | ||
| 54 | struct device *dev; | ||
| 55 | int minor; | ||
| 56 | struct list_head list; | ||
| 57 | struct request_queue *queue; | ||
| 58 | }; | ||
| 59 | |||
| 60 | extern int bsg_register_queue(struct request_queue *, const char *); | ||
| 61 | extern void bsg_unregister_queue(struct request_queue *); | ||
| 62 | #else | ||
| 63 | struct bsg_class_device { }; | ||
| 64 | #define bsg_register_queue(disk, name) (0) | ||
| 65 | #define bsg_unregister_queue(disk) do { } while (0) | ||
| 66 | #endif | ||
| 67 | |||
| 68 | #endif /* __KERNEL__ */ | ||
| 69 | |||
| 70 | #endif | ||
diff --git a/include/linux/bug.h b/include/linux/bug.h index 42aa0a54b6f4..54398d2c6d8d 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h | |||
| @@ -10,6 +10,8 @@ enum bug_trap_type { | |||
| 10 | BUG_TRAP_TYPE_BUG = 2, | 10 | BUG_TRAP_TYPE_BUG = 2, |
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | struct pt_regs; | ||
| 14 | |||
| 13 | #ifdef CONFIG_GENERIC_BUG | 15 | #ifdef CONFIG_GENERIC_BUG |
| 14 | #include <asm-generic/bug.h> | 16 | #include <asm-generic/bug.h> |
| 15 | 17 | ||
| @@ -20,7 +22,7 @@ static inline int is_warning_bug(const struct bug_entry *bug) | |||
| 20 | 22 | ||
| 21 | const struct bug_entry *find_bug(unsigned long bugaddr); | 23 | const struct bug_entry *find_bug(unsigned long bugaddr); |
| 22 | 24 | ||
| 23 | enum bug_trap_type report_bug(unsigned long bug_addr); | 25 | enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs); |
| 24 | 26 | ||
| 25 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | 27 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, |
| 26 | struct module *); | 28 | struct module *); |
| @@ -31,7 +33,8 @@ int is_valid_bugaddr(unsigned long addr); | |||
| 31 | 33 | ||
| 32 | #else /* !CONFIG_GENERIC_BUG */ | 34 | #else /* !CONFIG_GENERIC_BUG */ |
| 33 | 35 | ||
| 34 | static inline enum bug_trap_type report_bug(unsigned long bug_addr) | 36 | static inline enum bug_trap_type report_bug(unsigned long bug_addr, |
| 37 | struct pt_regs *regs) | ||
| 35 | { | 38 | { |
| 36 | return BUG_TRAP_TYPE_BUG; | 39 | return BUG_TRAP_TYPE_BUG; |
| 37 | } | 40 | } |
diff --git a/include/linux/capability.h b/include/linux/capability.h index bbf8df7de28f..2dfa58555934 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -44,7 +44,6 @@ typedef struct __user_cap_data_struct { | |||
| 44 | 44 | ||
| 45 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
| 46 | 46 | ||
| 47 | #include <linux/spinlock.h> | ||
| 48 | #include <asm/current.h> | 47 | #include <asm/current.h> |
| 49 | 48 | ||
| 50 | /* #define STRICT_CAP_T_TYPECHECKS */ | 49 | /* #define STRICT_CAP_T_TYPECHECKS */ |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index f50f04bdbc16..2b641b176e7f 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
| @@ -414,8 +414,8 @@ struct cdrom_generic_command | |||
| 414 | #define CDO_CHECK_TYPE 0x10 /* check type on open for data */ | 414 | #define CDO_CHECK_TYPE 0x10 /* check type on open for data */ |
| 415 | 415 | ||
| 416 | /* Special codes used when specifying changer slots. */ | 416 | /* Special codes used when specifying changer slots. */ |
| 417 | #define CDSL_NONE ((int) (~0U>>1)-1) | 417 | #define CDSL_NONE (INT_MAX-1) |
| 418 | #define CDSL_CURRENT ((int) (~0U>>1)) | 418 | #define CDSL_CURRENT INT_MAX |
| 419 | 419 | ||
| 420 | /* For partition based multisession access. IDE can handle 64 partitions | 420 | /* For partition based multisession access. IDE can handle 64 partitions |
| 421 | * per drive - SCSI CD-ROM's use minors to differentiate between the | 421 | * per drive - SCSI CD-ROM's use minors to differentiate between the |
diff --git a/include/linux/cobalt-nvram.h b/include/linux/cobalt-nvram.h deleted file mode 100644 index ea429562ff36..000000000000 --- a/include/linux/cobalt-nvram.h +++ /dev/null | |||
| @@ -1,109 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * $Id: cobalt-nvram.h,v 1.20 2001/10/17 23:16:55 thockin Exp $ | ||
| 3 | * cobalt-nvram.h : defines for the various fields in the cobalt NVRAM | ||
| 4 | * | ||
| 5 | * Copyright 2001,2002 Sun Microsystems, Inc. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef COBALT_NVRAM_H | ||
| 9 | #define COBALT_NVRAM_H | ||
| 10 | |||
| 11 | #include <linux/nvram.h> | ||
| 12 | |||
| 13 | #define COBT_CMOS_INFO_MAX 0x7f /* top address allowed */ | ||
| 14 | #define COBT_CMOS_BIOS_DRIVE_INFO 0x12 /* drive info would go here */ | ||
| 15 | |||
| 16 | #define COBT_CMOS_CKS_START NVRAM_OFFSET(0x0e) | ||
| 17 | #define COBT_CMOS_CKS_END NVRAM_OFFSET(0x7f) | ||
| 18 | |||
| 19 | /* flag bytes - 16 flags for now, leave room for more */ | ||
| 20 | #define COBT_CMOS_FLAG_BYTE_0 NVRAM_OFFSET(0x10) | ||
| 21 | #define COBT_CMOS_FLAG_BYTE_1 NVRAM_OFFSET(0x11) | ||
| 22 | |||
| 23 | /* flags in flag bytes - up to 16 */ | ||
| 24 | #define COBT_CMOS_FLAG_MIN 0x0001 | ||
| 25 | #define COBT_CMOS_CONSOLE_FLAG 0x0001 /* console on/off */ | ||
| 26 | #define COBT_CMOS_DEBUG_FLAG 0x0002 /* ROM debug messages */ | ||
| 27 | #define COBT_CMOS_AUTO_PROMPT_FLAG 0x0004 /* boot to ROM prompt? */ | ||
| 28 | #define COBT_CMOS_CLEAN_BOOT_FLAG 0x0008 /* set by a clean shutdown */ | ||
| 29 | #define COBT_CMOS_HW_NOPROBE_FLAG 0x0010 /* go easy on the probing */ | ||
| 30 | #define COBT_CMOS_SYSFAULT_FLAG 0x0020 /* system fault detected */ | ||
| 31 | #define COBT_CMOS_OOPSPANIC_FLAG 0x0040 /* panic on oops */ | ||
| 32 | #define COBT_CMOS_DELAY_CACHE_FLAG 0x0080 /* delay cache initialization */ | ||
| 33 | #define COBT_CMOS_NOLOGO_FLAG 0x0100 /* hide "C" logo @ boot */ | ||
| 34 | #define COBT_CMOS_VERSION_FLAG 0x0200 /* the version field is valid */ | ||
| 35 | #define COBT_CMOS_FLAG_MAX 0x0200 | ||
| 36 | |||
| 37 | /* leave byte 0x12 blank - Linux looks for drive info here */ | ||
| 38 | |||
| 39 | /* CMOS structure version, valid if COBT_CMOS_VERSION_FLAG is true */ | ||
| 40 | #define COBT_CMOS_VERSION NVRAM_OFFSET(0x13) | ||
| 41 | #define COBT_CMOS_VER_BTOCODE 1 /* min. version needed for btocode */ | ||
| 42 | |||
| 43 | /* index of default boot method */ | ||
| 44 | #define COBT_CMOS_BOOT_METHOD NVRAM_OFFSET(0x20) | ||
| 45 | #define COBT_CMOS_BOOT_METHOD_DISK 0 | ||
| 46 | #define COBT_CMOS_BOOT_METHOD_ROM 1 | ||
| 47 | #define COBT_CMOS_BOOT_METHOD_NET 2 | ||
| 48 | |||
| 49 | #define COBT_CMOS_BOOT_DEV_MIN NVRAM_OFFSET(0x21) | ||
| 50 | /* major #, minor # of first through fourth boot device */ | ||
| 51 | #define COBT_CMOS_BOOT_DEV0_MAJ NVRAM_OFFSET(0x21) | ||
| 52 | #define COBT_CMOS_BOOT_DEV0_MIN NVRAM_OFFSET(0x22) | ||
| 53 | #define COBT_CMOS_BOOT_DEV1_MAJ NVRAM_OFFSET(0x23) | ||
| 54 | #define COBT_CMOS_BOOT_DEV1_MIN NVRAM_OFFSET(0x24) | ||
| 55 | #define COBT_CMOS_BOOT_DEV2_MAJ NVRAM_OFFSET(0x25) | ||
| 56 | #define COBT_CMOS_BOOT_DEV2_MIN NVRAM_OFFSET(0x26) | ||
| 57 | #define COBT_CMOS_BOOT_DEV3_MAJ NVRAM_OFFSET(0x27) | ||
| 58 | #define COBT_CMOS_BOOT_DEV3_MIN NVRAM_OFFSET(0x28) | ||
| 59 | #define COBT_CMOS_BOOT_DEV_MAX NVRAM_OFFSET(0x28) | ||
| 60 | |||
| 61 | /* checksum of bytes 0xe-0x7f */ | ||
| 62 | #define COBT_CMOS_CHECKSUM NVRAM_OFFSET(0x2e) | ||
| 63 | |||
| 64 | /* running uptime counter, units of 5 minutes (32 bits =~ 41000 years) */ | ||
| 65 | #define COBT_CMOS_UPTIME_0 NVRAM_OFFSET(0x30) | ||
| 66 | #define COBT_CMOS_UPTIME_1 NVRAM_OFFSET(0x31) | ||
| 67 | #define COBT_CMOS_UPTIME_2 NVRAM_OFFSET(0x32) | ||
| 68 | #define COBT_CMOS_UPTIME_3 NVRAM_OFFSET(0x33) | ||
| 69 | |||
| 70 | /* count of successful boots (32 bits) */ | ||
| 71 | #define COBT_CMOS_BOOTCOUNT_0 NVRAM_OFFSET(0x38) | ||
| 72 | #define COBT_CMOS_BOOTCOUNT_1 NVRAM_OFFSET(0x39) | ||
| 73 | #define COBT_CMOS_BOOTCOUNT_2 NVRAM_OFFSET(0x3a) | ||
| 74 | #define COBT_CMOS_BOOTCOUNT_3 NVRAM_OFFSET(0x3b) | ||
| 75 | |||
| 76 | /* 13 bytes: system serial number, same as on the back of the system */ | ||
| 77 | #define COBT_CMOS_SYS_SERNUM_LEN 13 | ||
| 78 | #define COBT_CMOS_SYS_SERNUM_0 NVRAM_OFFSET(0x40) | ||
| 79 | #define COBT_CMOS_SYS_SERNUM_1 NVRAM_OFFSET(0x41) | ||
| 80 | #define COBT_CMOS_SYS_SERNUM_2 NVRAM_OFFSET(0x42) | ||
| 81 | #define COBT_CMOS_SYS_SERNUM_3 NVRAM_OFFSET(0x43) | ||
| 82 | #define COBT_CMOS_SYS_SERNUM_4 NVRAM_OFFSET(0x44) | ||
| 83 | #define COBT_CMOS_SYS_SERNUM_5 NVRAM_OFFSET(0x45) | ||
| 84 | #define COBT_CMOS_SYS_SERNUM_6 NVRAM_OFFSET(0x46) | ||
| 85 | #define COBT_CMOS_SYS_SERNUM_7 NVRAM_OFFSET(0x47) | ||
| 86 | #define COBT_CMOS_SYS_SERNUM_8 NVRAM_OFFSET(0x48) | ||
| 87 | #define COBT_CMOS_SYS_SERNUM_9 NVRAM_OFFSET(0x49) | ||
| 88 | #define COBT_CMOS_SYS_SERNUM_10 NVRAM_OFFSET(0x4a) | ||
| 89 | #define COBT_CMOS_SYS_SERNUM_11 NVRAM_OFFSET(0x4b) | ||
| 90 | #define COBT_CMOS_SYS_SERNUM_12 NVRAM_OFFSET(0x4c) | ||
| 91 | /* checksum for serial num - 1 byte */ | ||
| 92 | #define COBT_CMOS_SYS_SERNUM_CSUM NVRAM_OFFSET(0x4f) | ||
| 93 | |||
| 94 | #define COBT_CMOS_ROM_REV_MAJ NVRAM_OFFSET(0x50) | ||
| 95 | #define COBT_CMOS_ROM_REV_MIN NVRAM_OFFSET(0x51) | ||
| 96 | #define COBT_CMOS_ROM_REV_REV NVRAM_OFFSET(0x52) | ||
| 97 | |||
| 98 | #define COBT_CMOS_BTO_CODE_0 NVRAM_OFFSET(0x53) | ||
| 99 | #define COBT_CMOS_BTO_CODE_1 NVRAM_OFFSET(0x54) | ||
| 100 | #define COBT_CMOS_BTO_CODE_2 NVRAM_OFFSET(0x55) | ||
| 101 | #define COBT_CMOS_BTO_CODE_3 NVRAM_OFFSET(0x56) | ||
| 102 | |||
| 103 | #define COBT_CMOS_BTO_IP_CSUM NVRAM_OFFSET(0x57) | ||
| 104 | #define COBT_CMOS_BTO_IP_0 NVRAM_OFFSET(0x58) | ||
| 105 | #define COBT_CMOS_BTO_IP_1 NVRAM_OFFSET(0x59) | ||
| 106 | #define COBT_CMOS_BTO_IP_2 NVRAM_OFFSET(0x5a) | ||
| 107 | #define COBT_CMOS_BTO_IP_3 NVRAM_OFFSET(0x5b) | ||
| 108 | |||
| 109 | #endif /* COBALT_NVRAM_H */ | ||
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index fef6f3d0a4a7..8c6967f3fb11 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
| @@ -40,9 +40,9 @@ | |||
| 40 | #include <linux/types.h> | 40 | #include <linux/types.h> |
| 41 | #include <linux/list.h> | 41 | #include <linux/list.h> |
| 42 | #include <linux/kref.h> | 42 | #include <linux/kref.h> |
| 43 | #include <linux/mutex.h> | ||
| 43 | 44 | ||
| 44 | #include <asm/atomic.h> | 45 | #include <asm/atomic.h> |
| 45 | #include <asm/semaphore.h> | ||
| 46 | 46 | ||
| 47 | #define CONFIGFS_ITEM_NAME_LEN 20 | 47 | #define CONFIGFS_ITEM_NAME_LEN 20 |
| 48 | 48 | ||
| @@ -75,7 +75,6 @@ extern void config_item_init(struct config_item *); | |||
| 75 | extern void config_item_init_type_name(struct config_item *item, | 75 | extern void config_item_init_type_name(struct config_item *item, |
| 76 | const char *name, | 76 | const char *name, |
| 77 | struct config_item_type *type); | 77 | struct config_item_type *type); |
| 78 | extern void config_item_cleanup(struct config_item *); | ||
| 79 | 78 | ||
| 80 | extern struct config_item * config_item_get(struct config_item *); | 79 | extern struct config_item * config_item_get(struct config_item *); |
| 81 | extern void config_item_put(struct config_item *); | 80 | extern void config_item_put(struct config_item *); |
| @@ -87,12 +86,10 @@ struct config_item_type { | |||
| 87 | struct configfs_attribute **ct_attrs; | 86 | struct configfs_attribute **ct_attrs; |
| 88 | }; | 87 | }; |
| 89 | 88 | ||
| 90 | |||
| 91 | /** | 89 | /** |
| 92 | * group - a group of config_items of a specific type, belonging | 90 | * group - a group of config_items of a specific type, belonging |
| 93 | * to a specific subsystem. | 91 | * to a specific subsystem. |
| 94 | */ | 92 | */ |
| 95 | |||
| 96 | struct config_group { | 93 | struct config_group { |
| 97 | struct config_item cg_item; | 94 | struct config_item cg_item; |
| 98 | struct list_head cg_children; | 95 | struct list_head cg_children; |
| @@ -100,13 +97,11 @@ struct config_group { | |||
| 100 | struct config_group **default_groups; | 97 | struct config_group **default_groups; |
| 101 | }; | 98 | }; |
| 102 | 99 | ||
| 103 | |||
| 104 | extern void config_group_init(struct config_group *group); | 100 | extern void config_group_init(struct config_group *group); |
| 105 | extern void config_group_init_type_name(struct config_group *group, | 101 | extern void config_group_init_type_name(struct config_group *group, |
| 106 | const char *name, | 102 | const char *name, |
| 107 | struct config_item_type *type); | 103 | struct config_item_type *type); |
| 108 | 104 | ||
| 109 | |||
| 110 | static inline struct config_group *to_config_group(struct config_item *item) | 105 | static inline struct config_group *to_config_group(struct config_item *item) |
| 111 | { | 106 | { |
| 112 | return item ? container_of(item,struct config_group,cg_item) : NULL; | 107 | return item ? container_of(item,struct config_group,cg_item) : NULL; |
| @@ -122,7 +117,8 @@ static inline void config_group_put(struct config_group *group) | |||
| 122 | config_item_put(&group->cg_item); | 117 | config_item_put(&group->cg_item); |
| 123 | } | 118 | } |
| 124 | 119 | ||
| 125 | extern struct config_item *config_group_find_obj(struct config_group *, const char *); | 120 | extern struct config_item *config_group_find_item(struct config_group *, |
| 121 | const char *); | ||
| 126 | 122 | ||
| 127 | 123 | ||
| 128 | struct configfs_attribute { | 124 | struct configfs_attribute { |
| @@ -131,6 +127,22 @@ struct configfs_attribute { | |||
| 131 | mode_t ca_mode; | 127 | mode_t ca_mode; |
| 132 | }; | 128 | }; |
| 133 | 129 | ||
| 130 | /* | ||
| 131 | * Users often need to create attribute structures for their configurable | ||
| 132 | * attributes, containing a configfs_attribute member and function pointers | ||
| 133 | * for the show() and store() operations on that attribute. They can use | ||
| 134 | * this macro (similar to sysfs' __ATTR) to make defining attributes easier. | ||
| 135 | */ | ||
| 136 | #define __CONFIGFS_ATTR(_name, _mode, _show, _store) \ | ||
| 137 | { \ | ||
| 138 | .attr = { \ | ||
| 139 | .ca_name = __stringify(_name), \ | ||
| 140 | .ca_mode = _mode, \ | ||
| 141 | .ca_owner = THIS_MODULE, \ | ||
| 142 | }, \ | ||
| 143 | .show = _show, \ | ||
| 144 | .store = _store, \ | ||
| 145 | } | ||
| 134 | 146 | ||
| 135 | /* | 147 | /* |
| 136 | * If allow_link() exists, the item can symlink(2) out to other | 148 | * If allow_link() exists, the item can symlink(2) out to other |
| @@ -157,12 +169,13 @@ struct configfs_group_operations { | |||
| 157 | struct config_item *(*make_item)(struct config_group *group, const char *name); | 169 | struct config_item *(*make_item)(struct config_group *group, const char *name); |
| 158 | struct config_group *(*make_group)(struct config_group *group, const char *name); | 170 | struct config_group *(*make_group)(struct config_group *group, const char *name); |
| 159 | int (*commit_item)(struct config_item *item); | 171 | int (*commit_item)(struct config_item *item); |
| 172 | void (*disconnect_notify)(struct config_group *group, struct config_item *item); | ||
| 160 | void (*drop_item)(struct config_group *group, struct config_item *item); | 173 | void (*drop_item)(struct config_group *group, struct config_item *item); |
| 161 | }; | 174 | }; |
| 162 | 175 | ||
| 163 | struct configfs_subsystem { | 176 | struct configfs_subsystem { |
| 164 | struct config_group su_group; | 177 | struct config_group su_group; |
| 165 | struct semaphore su_sem; | 178 | struct mutex su_mutex; |
| 166 | }; | 179 | }; |
| 167 | 180 | ||
| 168 | static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group) | 181 | static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group) |
| @@ -175,6 +188,11 @@ static inline struct configfs_subsystem *to_configfs_subsystem(struct config_gro | |||
| 175 | int configfs_register_subsystem(struct configfs_subsystem *subsys); | 188 | int configfs_register_subsystem(struct configfs_subsystem *subsys); |
| 176 | void configfs_unregister_subsystem(struct configfs_subsystem *subsys); | 189 | void configfs_unregister_subsystem(struct configfs_subsystem *subsys); |
| 177 | 190 | ||
| 191 | /* These functions can sleep and can alloc with GFP_KERNEL */ | ||
| 192 | /* WARNING: These cannot be called underneath configfs callbacks!! */ | ||
| 193 | int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target); | ||
| 194 | void configfs_undepend_item(struct configfs_subsystem *subsys, struct config_item *target); | ||
| 195 | |||
| 178 | #endif /* __KERNEL__ */ | 196 | #endif /* __KERNEL__ */ |
| 179 | 197 | ||
| 180 | #endif /* _CONFIGFS_H_ */ | 198 | #endif /* _CONFIGFS_H_ */ |
diff --git a/include/linux/console.h b/include/linux/console.h index 62ef6e11d0d2..56a7bcda49cb 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #define _LINUX_CONSOLE_H_ 1 | 15 | #define _LINUX_CONSOLE_H_ 1 |
| 16 | 16 | ||
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | #include <linux/spinlock.h> | ||
| 19 | 18 | ||
| 20 | struct vc_data; | 19 | struct vc_data; |
| 21 | struct console_font_op; | 20 | struct console_font_op; |
| @@ -99,6 +98,7 @@ struct console { | |||
| 99 | struct tty_driver *(*device)(struct console *, int *); | 98 | struct tty_driver *(*device)(struct console *, int *); |
| 100 | void (*unblank)(void); | 99 | void (*unblank)(void); |
| 101 | int (*setup)(struct console *, char *); | 100 | int (*setup)(struct console *, char *); |
| 101 | int (*early_setup)(void); | ||
| 102 | short flags; | 102 | short flags; |
| 103 | short index; | 103 | short index; |
| 104 | int cflag; | 104 | int cflag; |
| @@ -107,6 +107,7 @@ struct console { | |||
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | extern int add_preferred_console(char *name, int idx, char *options); | 109 | extern int add_preferred_console(char *name, int idx, char *options); |
| 110 | extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); | ||
| 110 | extern void register_console(struct console *); | 111 | extern void register_console(struct console *); |
| 111 | extern int unregister_console(struct console *); | 112 | extern int unregister_console(struct console *); |
| 112 | extern struct console *console_drivers; | 113 | extern struct console *console_drivers; |
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h index 82c9a1f11020..06b2768c603f 100644 --- a/include/linux/consolemap.h +++ b/include/linux/consolemap.h | |||
| @@ -8,9 +8,12 @@ | |||
| 8 | #define IBMPC_MAP 2 | 8 | #define IBMPC_MAP 2 |
| 9 | #define USER_MAP 3 | 9 | #define USER_MAP 3 |
| 10 | 10 | ||
| 11 | #include <linux/types.h> | ||
| 12 | |||
| 11 | struct vc_data; | 13 | struct vc_data; |
| 12 | 14 | ||
| 13 | extern unsigned char inverse_translate(struct vc_data *conp, int glyph); | 15 | extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode); |
| 14 | extern unsigned short *set_translate(int m, struct vc_data *vc); | 16 | extern unsigned short *set_translate(int m, struct vc_data *vc); |
| 15 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); | 17 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); |
| 18 | extern u32 conv_8bit_to_uni(unsigned char c); | ||
| 16 | void console_map_init(void); | 19 | void console_map_init(void); |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 3b2df2523f1d..c2236bbff412 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -120,7 +120,6 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex) | |||
| 120 | 120 | ||
| 121 | #define lock_cpu_hotplug() do { } while (0) | 121 | #define lock_cpu_hotplug() do { } while (0) |
| 122 | #define unlock_cpu_hotplug() do { } while (0) | 122 | #define unlock_cpu_hotplug() do { } while (0) |
| 123 | #define lock_cpu_hotplug_interruptible() 0 | ||
| 124 | #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) | 123 | #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) |
| 125 | #define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) | 124 | #define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) |
| 126 | #define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) | 125 | #define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) |
diff --git a/include/linux/crc7.h b/include/linux/crc7.h new file mode 100644 index 000000000000..1786e772d5c6 --- /dev/null +++ b/include/linux/crc7.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef _LINUX_CRC7_H | ||
| 2 | #define _LINUX_CRC7_H | ||
| 3 | #include <linux/types.h> | ||
| 4 | |||
| 5 | extern const u8 crc7_syndrome_table[256]; | ||
| 6 | |||
| 7 | static inline u8 crc7_byte(u8 crc, u8 data) | ||
| 8 | { | ||
| 9 | return crc7_syndrome_table[(crc << 1) ^ data]; | ||
| 10 | } | ||
| 11 | |||
| 12 | extern u8 crc7(u8 crc, const u8 *buffer, size_t len); | ||
| 13 | |||
| 14 | #endif | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 9a663c6db16a..2dc21cbeb304 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
| @@ -31,7 +31,11 @@ static inline int valid_dma_direction(int dma_direction) | |||
| 31 | (dma_direction == DMA_FROM_DEVICE)); | 31 | (dma_direction == DMA_FROM_DEVICE)); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | #ifdef CONFIG_HAS_DMA | ||
| 34 | #include <asm/dma-mapping.h> | 35 | #include <asm/dma-mapping.h> |
| 36 | #else | ||
| 37 | #include <asm-generic/dma-mapping-broken.h> | ||
| 38 | #endif | ||
| 35 | 39 | ||
| 36 | /* Backwards compat, remove in 2.7.x */ | 40 | /* Backwards compat, remove in 2.7.x */ |
| 37 | #define dma_sync_single dma_sync_single_for_cpu | 41 | #define dma_sync_single dma_sync_single_for_cpu |
diff --git a/include/linux/ds17287rtc.h b/include/linux/ds17287rtc.h index c281ba42e28f..d85d3f497b96 100644 --- a/include/linux/ds17287rtc.h +++ b/include/linux/ds17287rtc.h | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #define __LINUX_DS17287RTC_H | 11 | #define __LINUX_DS17287RTC_H |
| 12 | 12 | ||
| 13 | #include <linux/rtc.h> /* get the user-level API */ | 13 | #include <linux/rtc.h> /* get the user-level API */ |
| 14 | #include <linux/spinlock.h> /* spinlock_t */ | ||
| 15 | #include <linux/mc146818rtc.h> | 14 | #include <linux/mc146818rtc.h> |
| 16 | 15 | ||
| 17 | /* Register A */ | 16 | /* Register A */ |
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index dfed8009ebff..16cb25cbf7c5 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
| @@ -45,6 +45,7 @@ extern efs_block_t efs_map_block(struct inode *, efs_block_t); | |||
| 45 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); | 45 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); |
| 46 | 46 | ||
| 47 | extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); | 47 | extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); |
| 48 | extern struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp); | ||
| 48 | extern struct dentry *efs_get_parent(struct dentry *); | 49 | extern struct dentry *efs_get_parent(struct dentry *); |
| 49 | extern int efs_bmap(struct inode *, int); | 50 | extern int efs_bmap(struct inode *, int); |
| 50 | 51 | ||
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h new file mode 100644 index 000000000000..8872fe8392d6 --- /dev/null +++ b/include/linux/exportfs.h | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | #ifndef LINUX_EXPORTFS_H | ||
| 2 | #define LINUX_EXPORTFS_H 1 | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct dentry; | ||
| 7 | struct super_block; | ||
| 8 | struct vfsmount; | ||
| 9 | |||
| 10 | |||
| 11 | /** | ||
| 12 | * struct export_operations - for nfsd to communicate with file systems | ||
| 13 | * @decode_fh: decode a file handle fragment and return a &struct dentry | ||
| 14 | * @encode_fh: encode a file handle fragment from a dentry | ||
| 15 | * @get_name: find the name for a given inode in a given directory | ||
| 16 | * @get_parent: find the parent of a given directory | ||
| 17 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | ||
| 18 | * @find_exported_dentry: | ||
| 19 | * set by the exporting module to a standard helper function. | ||
| 20 | * | ||
| 21 | * Description: | ||
| 22 | * The export_operations structure provides a means for nfsd to communicate | ||
| 23 | * with a particular exported file system - particularly enabling nfsd and | ||
| 24 | * the filesystem to co-operate when dealing with file handles. | ||
| 25 | * | ||
| 26 | * export_operations contains two basic operation for dealing with file | ||
| 27 | * handles, decode_fh() and encode_fh(), and allows for some other | ||
| 28 | * operations to be defined which standard helper routines use to get | ||
| 29 | * specific information from the filesystem. | ||
| 30 | * | ||
| 31 | * nfsd encodes information use to determine which filesystem a filehandle | ||
| 32 | * applies to in the initial part of the file handle. The remainder, termed | ||
| 33 | * a file handle fragment, is controlled completely by the filesystem. The | ||
| 34 | * standard helper routines assume that this fragment will contain one or | ||
| 35 | * two sub-fragments, one which identifies the file, and one which may be | ||
| 36 | * used to identify the (a) directory containing the file. | ||
| 37 | * | ||
| 38 | * In some situations, nfsd needs to get a dentry which is connected into a | ||
| 39 | * specific part of the file tree. To allow for this, it passes the | ||
| 40 | * function acceptable() together with a @context which can be used to see | ||
| 41 | * if the dentry is acceptable. As there can be multiple dentrys for a | ||
| 42 | * given file, the filesystem should check each one for acceptability before | ||
| 43 | * looking for the next. As soon as an acceptable one is found, it should | ||
| 44 | * be returned. | ||
| 45 | * | ||
| 46 | * decode_fh: | ||
| 47 | * @decode_fh is given a &struct super_block (@sb), a file handle fragment | ||
| 48 | * (@fh, @fh_len) and an acceptability testing function (@acceptable, | ||
| 49 | * @context). It should return a &struct dentry which refers to the same | ||
| 50 | * file that the file handle fragment refers to, and which passes the | ||
| 51 | * acceptability test. If it cannot, it should return a %NULL pointer if | ||
| 52 | * the file was found but no acceptable &dentries were available, or a | ||
| 53 | * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or | ||
| 54 | * %ENOMEM). | ||
| 55 | * | ||
| 56 | * encode_fh: | ||
| 57 | * @encode_fh should store in the file handle fragment @fh (using at most | ||
| 58 | * @max_len bytes) information that can be used by @decode_fh to recover the | ||
| 59 | * file refered to by the &struct dentry @de. If the @connectable flag is | ||
| 60 | * set, the encode_fh() should store sufficient information so that a good | ||
| 61 | * attempt can be made to find not only the file but also it's place in the | ||
| 62 | * filesystem. This typically means storing a reference to de->d_parent in | ||
| 63 | * the filehandle fragment. encode_fh() should return the number of bytes | ||
| 64 | * stored or a negative error code such as %-ENOSPC | ||
| 65 | * | ||
| 66 | * get_name: | ||
| 67 | * @get_name should find a name for the given @child in the given @parent | ||
| 68 | * directory. The name should be stored in the @name (with the | ||
| 69 | * understanding that it is already pointing to a a %NAME_MAX+1 sized | ||
| 70 | * buffer. get_name() should return %0 on success, a negative error code | ||
| 71 | * or error. @get_name will be called without @parent->i_mutex held. | ||
| 72 | * | ||
| 73 | * get_parent: | ||
| 74 | * @get_parent should find the parent directory for the given @child which | ||
| 75 | * is also a directory. In the event that it cannot be found, or storage | ||
| 76 | * space cannot be allocated, a %ERR_PTR should be returned. | ||
| 77 | * | ||
| 78 | * get_dentry: | ||
| 79 | * Given a &super_block (@sb) and a pointer to a file-system specific inode | ||
| 80 | * identifier, possibly an inode number, (@inump) get_dentry() should find | ||
| 81 | * the identified inode and return a dentry for that inode. Any suitable | ||
| 82 | * dentry can be returned including, if necessary, a new dentry created with | ||
| 83 | * d_alloc_root. The caller can then find any other extant dentrys by | ||
| 84 | * following the d_alias links. If a new dentry was created using | ||
| 85 | * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry | ||
| 86 | * should be d_rehash()ed. | ||
| 87 | * | ||
| 88 | * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code | ||
| 89 | * can be returned. The @inump will be whatever was passed to | ||
| 90 | * nfsd_find_fh_dentry() in either the @obj or @parent parameters. | ||
| 91 | * | ||
| 92 | * Locking rules: | ||
| 93 | * get_parent is called with child->d_inode->i_mutex down | ||
| 94 | * get_name is not (which is possibly inconsistent) | ||
| 95 | */ | ||
| 96 | |||
| 97 | struct export_operations { | ||
| 98 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, | ||
| 99 | int fh_len, int fh_type, | ||
| 100 | int (*acceptable)(void *context, struct dentry *de), | ||
| 101 | void *context); | ||
| 102 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | ||
| 103 | int connectable); | ||
| 104 | int (*get_name)(struct dentry *parent, char *name, | ||
| 105 | struct dentry *child); | ||
| 106 | struct dentry * (*get_parent)(struct dentry *child); | ||
| 107 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | ||
| 108 | |||
| 109 | /* This is set by the exporting module to a standard helper */ | ||
| 110 | struct dentry * (*find_exported_dentry)( | ||
| 111 | struct super_block *sb, void *obj, void *parent, | ||
| 112 | int (*acceptable)(void *context, struct dentry *de), | ||
| 113 | void *context); | ||
| 114 | }; | ||
| 115 | |||
| 116 | extern struct dentry *find_exported_dentry(struct super_block *sb, void *obj, | ||
| 117 | void *parent, int (*acceptable)(void *context, struct dentry *de), | ||
| 118 | void *context); | ||
| 119 | |||
| 120 | extern int exportfs_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, | ||
| 121 | int connectable); | ||
| 122 | extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, __u32 *fh, | ||
| 123 | int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *), | ||
| 124 | void *context); | ||
| 125 | |||
| 126 | #endif /* LINUX_EXPORTFS_H */ | ||
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index 4eda0ed76a48..d149f2959e67 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h | |||
| @@ -33,6 +33,8 @@ struct ext2_sb_info { | |||
| 33 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ | 33 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ |
| 34 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ | 34 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ |
| 35 | unsigned long s_groups_count; /* Number of groups in the fs */ | 35 | unsigned long s_groups_count; /* Number of groups in the fs */ |
| 36 | unsigned long s_overhead_last; /* Last calculated overhead */ | ||
| 37 | unsigned long s_blocks_last; /* Last seen block count */ | ||
| 36 | struct buffer_head * s_sbh; /* Buffer containing the super block */ | 38 | struct buffer_head * s_sbh; /* Buffer containing the super block */ |
| 37 | struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ | 39 | struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ |
| 38 | struct buffer_head ** s_group_desc; | 40 | struct buffer_head ** s_group_desc; |
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index f61309c81cc4..d3c08353edf6 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
| @@ -38,6 +38,8 @@ struct ext3_sb_info { | |||
| 38 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ | 38 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ |
| 39 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ | 39 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ |
| 40 | unsigned long s_groups_count; /* Number of groups in the fs */ | 40 | unsigned long s_groups_count; /* Number of groups in the fs */ |
| 41 | unsigned long s_overhead_last; /* Last calculated overhead */ | ||
| 42 | unsigned long s_blocks_last; /* Last seen block count */ | ||
| 41 | struct buffer_head * s_sbh; /* Buffer containing the super block */ | 43 | struct buffer_head * s_sbh; /* Buffer containing the super block */ |
| 42 | struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ | 44 | struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ |
| 43 | struct buffer_head ** s_group_desc; | 45 | struct buffer_head ** s_group_desc; |
diff --git a/include/linux/ext4_fs_sb.h b/include/linux/ext4_fs_sb.h index 691a713139ce..2347557a327a 100644 --- a/include/linux/ext4_fs_sb.h +++ b/include/linux/ext4_fs_sb.h | |||
| @@ -39,6 +39,8 @@ struct ext4_sb_info { | |||
| 39 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ | 39 | unsigned long s_gdb_count; /* Number of group descriptor blocks */ |
| 40 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ | 40 | unsigned long s_desc_per_block; /* Number of group descriptors per block */ |
| 41 | unsigned long s_groups_count; /* Number of groups in the fs */ | 41 | unsigned long s_groups_count; /* Number of groups in the fs */ |
| 42 | unsigned long s_overhead_last; /* Last calculated overhead */ | ||
| 43 | unsigned long s_blocks_last; /* Last seen block count */ | ||
| 42 | struct buffer_head * s_sbh; /* Buffer containing the super block */ | 44 | struct buffer_head * s_sbh; /* Buffer containing the super block */ |
| 43 | struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ | 45 | struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ |
| 44 | struct buffer_head ** s_group_desc; | 46 | struct buffer_head ** s_group_desc; |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 66226824ab68..cec54106aa87 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -119,6 +119,7 @@ struct dentry; | |||
| 119 | #define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ | 119 | #define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ |
| 120 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ | 120 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ |
| 121 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ | 121 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ |
| 122 | #define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */ | ||
| 122 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ | 123 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ |
| 123 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ | 124 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ |
| 124 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ | 125 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ |
| @@ -529,6 +530,8 @@ struct fb_cursor_user { | |||
| 529 | #define FB_EVENT_CONBLANK 0x0C | 530 | #define FB_EVENT_CONBLANK 0x0C |
| 530 | /* Get drawing requirements */ | 531 | /* Get drawing requirements */ |
| 531 | #define FB_EVENT_GET_REQ 0x0D | 532 | #define FB_EVENT_GET_REQ 0x0D |
| 533 | /* Unbind from the console if possible */ | ||
| 534 | #define FB_EVENT_FB_UNBIND 0x0E | ||
| 532 | 535 | ||
| 533 | struct fb_event { | 536 | struct fb_event { |
| 534 | struct fb_info *info; | 537 | struct fb_info *info; |
diff --git a/include/linux/file.h b/include/linux/file.h index a59001e9ea58..0114fbc78061 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
| @@ -73,6 +73,7 @@ extern struct file * FASTCALL(fget_light(unsigned int fd, int *fput_needed)); | |||
| 73 | extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); | 73 | extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); |
| 74 | extern void put_filp(struct file *); | 74 | extern void put_filp(struct file *); |
| 75 | extern int get_unused_fd(void); | 75 | extern int get_unused_fd(void); |
| 76 | extern int get_unused_fd_flags(int flags); | ||
| 76 | extern void FASTCALL(put_unused_fd(unsigned int fd)); | 77 | extern void FASTCALL(put_unused_fd(unsigned int fd)); |
| 77 | struct kmem_cache; | 78 | struct kmem_cache; |
| 78 | 79 | ||
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 4631086f5060..2d38b1a74662 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | /* Freezer declarations */ | 1 | /* Freezer declarations */ |
| 2 | 2 | ||
| 3 | #ifndef FREEZER_H_INCLUDED | ||
| 4 | #define FREEZER_H_INCLUDED | ||
| 5 | |||
| 3 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
| 4 | 7 | ||
| 5 | #ifdef CONFIG_PM | 8 | #ifdef CONFIG_PM |
| @@ -115,6 +118,14 @@ static inline int freezer_should_skip(struct task_struct *p) | |||
| 115 | return !!(p->flags & PF_FREEZER_SKIP); | 118 | return !!(p->flags & PF_FREEZER_SKIP); |
| 116 | } | 119 | } |
| 117 | 120 | ||
| 121 | /* | ||
| 122 | * Tell the freezer that the current task should be frozen by it | ||
| 123 | */ | ||
| 124 | static inline void set_freezable(void) | ||
| 125 | { | ||
| 126 | current->flags &= ~PF_NOFREEZE; | ||
| 127 | } | ||
| 128 | |||
| 118 | #else | 129 | #else |
| 119 | static inline int frozen(struct task_struct *p) { return 0; } | 130 | static inline int frozen(struct task_struct *p) { return 0; } |
| 120 | static inline int freezing(struct task_struct *p) { return 0; } | 131 | static inline int freezing(struct task_struct *p) { return 0; } |
| @@ -130,4 +141,7 @@ static inline int try_to_freeze(void) { return 0; } | |||
| 130 | static inline void freezer_do_not_count(void) {} | 141 | static inline void freezer_do_not_count(void) {} |
| 131 | static inline void freezer_count(void) {} | 142 | static inline void freezer_count(void) {} |
| 132 | static inline int freezer_should_skip(struct task_struct *p) { return 0; } | 143 | static inline int freezer_should_skip(struct task_struct *p) { return 0; } |
| 144 | static inline void set_freezable(void) {} | ||
| 133 | #endif | 145 | #endif |
| 146 | |||
| 147 | #endif /* FREEZER_H_INCLUDED */ | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4f0b3bf5983c..58ce336d4a6b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -44,7 +44,7 @@ extern int get_max_files(void); | |||
| 44 | struct inodes_stat_t { | 44 | struct inodes_stat_t { |
| 45 | int nr_inodes; | 45 | int nr_inodes; |
| 46 | int nr_unused; | 46 | int nr_unused; |
| 47 | int dummy[5]; | 47 | int dummy[5]; /* padding for sysctl ABI compatibility */ |
| 48 | }; | 48 | }; |
| 49 | extern struct inodes_stat_t inodes_stat; | 49 | extern struct inodes_stat_t inodes_stat; |
| 50 | 50 | ||
| @@ -283,11 +283,13 @@ extern int dir_notify_enable; | |||
| 283 | #include <linux/init.h> | 283 | #include <linux/init.h> |
| 284 | #include <linux/pid.h> | 284 | #include <linux/pid.h> |
| 285 | #include <linux/mutex.h> | 285 | #include <linux/mutex.h> |
| 286 | #include <linux/sysctl.h> | ||
| 286 | 287 | ||
| 287 | #include <asm/atomic.h> | 288 | #include <asm/atomic.h> |
| 288 | #include <asm/semaphore.h> | 289 | #include <asm/semaphore.h> |
| 289 | #include <asm/byteorder.h> | 290 | #include <asm/byteorder.h> |
| 290 | 291 | ||
| 292 | struct export_operations; | ||
| 291 | struct hd_geometry; | 293 | struct hd_geometry; |
| 292 | struct iovec; | 294 | struct iovec; |
| 293 | struct nameidata; | 295 | struct nameidata; |
| @@ -820,6 +822,10 @@ struct file_lock { | |||
| 820 | union { | 822 | union { |
| 821 | struct nfs_lock_info nfs_fl; | 823 | struct nfs_lock_info nfs_fl; |
| 822 | struct nfs4_lock_info nfs4_fl; | 824 | struct nfs4_lock_info nfs4_fl; |
| 825 | struct { | ||
| 826 | struct list_head link; /* link in AFS vnode's pending_locks list */ | ||
| 827 | int state; /* state of grant or error if -ve */ | ||
| 828 | } afs; | ||
| 823 | } fl_u; | 829 | } fl_u; |
| 824 | }; | 830 | }; |
| 825 | 831 | ||
| @@ -1273,119 +1279,6 @@ static inline void file_accessed(struct file *file) | |||
| 1273 | 1279 | ||
| 1274 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | 1280 | int sync_inode(struct inode *inode, struct writeback_control *wbc); |
| 1275 | 1281 | ||
| 1276 | /** | ||
| 1277 | * struct export_operations - for nfsd to communicate with file systems | ||
| 1278 | * @decode_fh: decode a file handle fragment and return a &struct dentry | ||
| 1279 | * @encode_fh: encode a file handle fragment from a dentry | ||
| 1280 | * @get_name: find the name for a given inode in a given directory | ||
| 1281 | * @get_parent: find the parent of a given directory | ||
| 1282 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | ||
| 1283 | * @find_exported_dentry: | ||
| 1284 | * set by the exporting module to a standard helper function. | ||
| 1285 | * | ||
| 1286 | * Description: | ||
| 1287 | * The export_operations structure provides a means for nfsd to communicate | ||
| 1288 | * with a particular exported file system - particularly enabling nfsd and | ||
| 1289 | * the filesystem to co-operate when dealing with file handles. | ||
| 1290 | * | ||
| 1291 | * export_operations contains two basic operation for dealing with file | ||
| 1292 | * handles, decode_fh() and encode_fh(), and allows for some other | ||
| 1293 | * operations to be defined which standard helper routines use to get | ||
| 1294 | * specific information from the filesystem. | ||
| 1295 | * | ||
| 1296 | * nfsd encodes information use to determine which filesystem a filehandle | ||
| 1297 | * applies to in the initial part of the file handle. The remainder, termed | ||
| 1298 | * a file handle fragment, is controlled completely by the filesystem. The | ||
| 1299 | * standard helper routines assume that this fragment will contain one or | ||
| 1300 | * two sub-fragments, one which identifies the file, and one which may be | ||
| 1301 | * used to identify the (a) directory containing the file. | ||
| 1302 | * | ||
| 1303 | * In some situations, nfsd needs to get a dentry which is connected into a | ||
| 1304 | * specific part of the file tree. To allow for this, it passes the | ||
| 1305 | * function acceptable() together with a @context which can be used to see | ||
| 1306 | * if the dentry is acceptable. As there can be multiple dentrys for a | ||
| 1307 | * given file, the filesystem should check each one for acceptability before | ||
| 1308 | * looking for the next. As soon as an acceptable one is found, it should | ||
| 1309 | * be returned. | ||
| 1310 | * | ||
| 1311 | * decode_fh: | ||
| 1312 | * @decode_fh is given a &struct super_block (@sb), a file handle fragment | ||
| 1313 | * (@fh, @fh_len) and an acceptability testing function (@acceptable, | ||
| 1314 | * @context). It should return a &struct dentry which refers to the same | ||
| 1315 | * file that the file handle fragment refers to, and which passes the | ||
| 1316 | * acceptability test. If it cannot, it should return a %NULL pointer if | ||
| 1317 | * the file was found but no acceptable &dentries were available, or a | ||
| 1318 | * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or | ||
| 1319 | * %ENOMEM). | ||
| 1320 | * | ||
| 1321 | * encode_fh: | ||
| 1322 | * @encode_fh should store in the file handle fragment @fh (using at most | ||
| 1323 | * @max_len bytes) information that can be used by @decode_fh to recover the | ||
| 1324 | * file refered to by the &struct dentry @de. If the @connectable flag is | ||
| 1325 | * set, the encode_fh() should store sufficient information so that a good | ||
| 1326 | * attempt can be made to find not only the file but also it's place in the | ||
| 1327 | * filesystem. This typically means storing a reference to de->d_parent in | ||
| 1328 | * the filehandle fragment. encode_fh() should return the number of bytes | ||
| 1329 | * stored or a negative error code such as %-ENOSPC | ||
| 1330 | * | ||
| 1331 | * get_name: | ||
| 1332 | * @get_name should find a name for the given @child in the given @parent | ||
| 1333 | * directory. The name should be stored in the @name (with the | ||
| 1334 | * understanding that it is already pointing to a a %NAME_MAX+1 sized | ||
| 1335 | * buffer. get_name() should return %0 on success, a negative error code | ||
| 1336 | * or error. @get_name will be called without @parent->i_mutex held. | ||
| 1337 | * | ||
| 1338 | * get_parent: | ||
| 1339 | * @get_parent should find the parent directory for the given @child which | ||
| 1340 | * is also a directory. In the event that it cannot be found, or storage | ||
| 1341 | * space cannot be allocated, a %ERR_PTR should be returned. | ||
| 1342 | * | ||
| 1343 | * get_dentry: | ||
| 1344 | * Given a &super_block (@sb) and a pointer to a file-system specific inode | ||
| 1345 | * identifier, possibly an inode number, (@inump) get_dentry() should find | ||
| 1346 | * the identified inode and return a dentry for that inode. Any suitable | ||
| 1347 | * dentry can be returned including, if necessary, a new dentry created with | ||
| 1348 | * d_alloc_root. The caller can then find any other extant dentrys by | ||
| 1349 | * following the d_alias links. If a new dentry was created using | ||
| 1350 | * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry | ||
| 1351 | * should be d_rehash()ed. | ||
| 1352 | * | ||
| 1353 | * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code | ||
| 1354 | * can be returned. The @inump will be whatever was passed to | ||
| 1355 | * nfsd_find_fh_dentry() in either the @obj or @parent parameters. | ||
| 1356 | * | ||
| 1357 | * Locking rules: | ||
| 1358 | * get_parent is called with child->d_inode->i_mutex down | ||
| 1359 | * get_name is not (which is possibly inconsistent) | ||
| 1360 | */ | ||
| 1361 | |||
| 1362 | struct export_operations { | ||
| 1363 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type, | ||
| 1364 | int (*acceptable)(void *context, struct dentry *de), | ||
| 1365 | void *context); | ||
| 1366 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | ||
| 1367 | int connectable); | ||
| 1368 | |||
| 1369 | /* the following are only called from the filesystem itself */ | ||
| 1370 | int (*get_name)(struct dentry *parent, char *name, | ||
| 1371 | struct dentry *child); | ||
| 1372 | struct dentry * (*get_parent)(struct dentry *child); | ||
| 1373 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | ||
| 1374 | |||
| 1375 | /* This is set by the exporting module to a standard helper */ | ||
| 1376 | struct dentry * (*find_exported_dentry)( | ||
| 1377 | struct super_block *sb, void *obj, void *parent, | ||
| 1378 | int (*acceptable)(void *context, struct dentry *de), | ||
| 1379 | void *context); | ||
| 1380 | |||
| 1381 | |||
| 1382 | }; | ||
| 1383 | |||
| 1384 | extern struct dentry * | ||
| 1385 | find_exported_dentry(struct super_block *sb, void *obj, void *parent, | ||
| 1386 | int (*acceptable)(void *context, struct dentry *de), | ||
| 1387 | void *context); | ||
| 1388 | |||
| 1389 | struct file_system_type { | 1282 | struct file_system_type { |
| 1390 | const char *name; | 1283 | const char *name; |
| 1391 | int fs_flags; | 1284 | int fs_flags; |
| @@ -1522,7 +1415,7 @@ extern void putname(const char *name); | |||
| 1522 | 1415 | ||
| 1523 | #ifdef CONFIG_BLOCK | 1416 | #ifdef CONFIG_BLOCK |
| 1524 | extern int register_blkdev(unsigned int, const char *); | 1417 | extern int register_blkdev(unsigned int, const char *); |
| 1525 | extern int unregister_blkdev(unsigned int, const char *); | 1418 | extern void unregister_blkdev(unsigned int, const char *); |
| 1526 | extern struct block_device *bdget(dev_t); | 1419 | extern struct block_device *bdget(dev_t); |
| 1527 | extern void bd_set_size(struct block_device *, loff_t size); | 1420 | extern void bd_set_size(struct block_device *, loff_t size); |
| 1528 | extern void bd_forget(struct inode *inode); | 1421 | extern void bd_forget(struct inode *inode); |
| @@ -1610,6 +1503,9 @@ extern int __invalidate_device(struct block_device *); | |||
| 1610 | extern int invalidate_partition(struct gendisk *, int); | 1503 | extern int invalidate_partition(struct gendisk *, int); |
| 1611 | #endif | 1504 | #endif |
| 1612 | extern int invalidate_inodes(struct super_block *); | 1505 | extern int invalidate_inodes(struct super_block *); |
| 1506 | unsigned long __invalidate_mapping_pages(struct address_space *mapping, | ||
| 1507 | pgoff_t start, pgoff_t end, | ||
| 1508 | bool be_atomic); | ||
| 1613 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 1509 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
| 1614 | pgoff_t start, pgoff_t end); | 1510 | pgoff_t start, pgoff_t end); |
| 1615 | 1511 | ||
| @@ -2043,5 +1939,9 @@ static inline void free_secdata(void *secdata) | |||
| 2043 | { } | 1939 | { } |
| 2044 | #endif /* CONFIG_SECURITY */ | 1940 | #endif /* CONFIG_SECURITY */ |
| 2045 | 1941 | ||
| 1942 | int proc_nr_files(ctl_table *table, int write, struct file *filp, | ||
| 1943 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
| 1944 | |||
| 1945 | |||
| 2046 | #endif /* __KERNEL__ */ | 1946 | #endif /* __KERNEL__ */ |
| 2047 | #endif /* _LINUX_FS_H */ | 1947 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 73710d617775..695741b0e420 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
| @@ -112,7 +112,7 @@ struct fsl_usb2_platform_data { | |||
| 112 | struct fsl_spi_platform_data { | 112 | struct fsl_spi_platform_data { |
| 113 | u32 initial_spmode; /* initial SPMODE value */ | 113 | u32 initial_spmode; /* initial SPMODE value */ |
| 114 | u16 bus_num; | 114 | u16 bus_num; |
| 115 | 115 | bool qe_mode; | |
| 116 | /* board specific information */ | 116 | /* board specific information */ |
| 117 | u16 max_chipselect; | 117 | u16 max_chipselect; |
| 118 | void (*activate_cs)(u8 cs, u8 polarity); | 118 | void (*activate_cs)(u8 cs, u8 polarity); |
| @@ -120,5 +120,10 @@ struct fsl_spi_platform_data { | |||
| 120 | u32 sysclk; | 120 | u32 sysclk; |
| 121 | }; | 121 | }; |
| 122 | 122 | ||
| 123 | struct mpc8xx_pcmcia_ops { | ||
| 124 | void(*hw_ctrl)(int slot, int enable); | ||
| 125 | int(*voltage_set)(int slot, int vcc, int vpp); | ||
| 126 | }; | ||
| 127 | |||
| 123 | #endif /* _FSL_DEVICE_H_ */ | 128 | #endif /* _FSL_DEVICE_H_ */ |
| 124 | #endif /* __KERNEL__ */ | 129 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 534744efe30d..9fbe9d258e22 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -339,7 +339,7 @@ struct fuse_dirent { | |||
| 339 | char name[0]; | 339 | char name[0]; |
| 340 | }; | 340 | }; |
| 341 | 341 | ||
| 342 | #define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) | 342 | #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) |
| 343 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) | 343 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) |
| 344 | #define FUSE_DIRENT_SIZE(d) \ | 344 | #define FUSE_DIRENT_SIZE(d) \ |
| 345 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) | 345 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 0d2ef0b082a6..bc68dd9a6d41 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -30,6 +30,9 @@ struct vm_area_struct; | |||
| 30 | * cannot handle allocation failures. | 30 | * cannot handle allocation failures. |
| 31 | * | 31 | * |
| 32 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. | 32 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. |
| 33 | * | ||
| 34 | * __GFP_MOVABLE: Flag that this page will be movable by the page migration | ||
| 35 | * mechanism or reclaimed | ||
| 33 | */ | 36 | */ |
| 34 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ | 37 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ |
| 35 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ | 38 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ |
| @@ -45,6 +48,7 @@ struct vm_area_struct; | |||
| 45 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ | 48 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ |
| 46 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 49 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ |
| 47 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 50 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ |
| 51 | #define __GFP_MOVABLE ((__force gfp_t)0x80000u) /* Page is movable */ | ||
| 48 | 52 | ||
| 49 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 53 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
| 50 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 54 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
| @@ -53,7 +57,8 @@ struct vm_area_struct; | |||
| 53 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 57 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
| 54 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | 58 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ |
| 55 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ | 59 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ |
| 56 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) | 60 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE| \ |
| 61 | __GFP_MOVABLE) | ||
| 57 | 62 | ||
| 58 | /* This equals 0, but use constants in case they ever change */ | 63 | /* This equals 0, but use constants in case they ever change */ |
| 59 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) | 64 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) |
| @@ -65,6 +70,15 @@ struct vm_area_struct; | |||
| 65 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) | 70 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) |
| 66 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ | 71 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ |
| 67 | __GFP_HIGHMEM) | 72 | __GFP_HIGHMEM) |
| 73 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
| 74 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | ||
| 75 | __GFP_MOVABLE) | ||
| 76 | #define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE) | ||
| 77 | #define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
| 78 | __GFP_HARDWALL | __GFP_MOVABLE) | ||
| 79 | #define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
| 80 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | ||
| 81 | __GFP_MOVABLE) | ||
| 68 | 82 | ||
| 69 | #ifdef CONFIG_NUMA | 83 | #ifdef CONFIG_NUMA |
| 70 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 84 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
| @@ -92,6 +106,9 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
| 92 | if (flags & __GFP_DMA32) | 106 | if (flags & __GFP_DMA32) |
| 93 | return ZONE_DMA32; | 107 | return ZONE_DMA32; |
| 94 | #endif | 108 | #endif |
| 109 | if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == | ||
| 110 | (__GFP_HIGHMEM | __GFP_MOVABLE)) | ||
| 111 | return ZONE_MOVABLE; | ||
| 95 | #ifdef CONFIG_HIGHMEM | 112 | #ifdef CONFIG_HIGHMEM |
| 96 | if (flags & __GFP_HIGHMEM) | 113 | if (flags & __GFP_HIGHMEM) |
| 97 | return ZONE_HIGHMEM; | 114 | return ZONE_HIGHMEM; |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 98e2cce996a4..12c5e4e3135a 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
| @@ -73,10 +73,27 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr) | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 75 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
| 76 | /** | ||
| 77 | * __alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA with caller-specified movable GFP flags | ||
| 78 | * @movableflags: The GFP flags related to the pages future ability to move like __GFP_MOVABLE | ||
| 79 | * @vma: The VMA the page is to be allocated for | ||
| 80 | * @vaddr: The virtual address the page will be inserted into | ||
| 81 | * | ||
| 82 | * This function will allocate a page for a VMA but the caller is expected | ||
| 83 | * to specify via movableflags whether the page will be movable in the | ||
| 84 | * future or not | ||
| 85 | * | ||
| 86 | * An architecture may override this function by defining | ||
| 87 | * __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE and providing their own | ||
| 88 | * implementation. | ||
| 89 | */ | ||
| 76 | static inline struct page * | 90 | static inline struct page * |
| 77 | alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) | 91 | __alloc_zeroed_user_highpage(gfp_t movableflags, |
| 92 | struct vm_area_struct *vma, | ||
| 93 | unsigned long vaddr) | ||
| 78 | { | 94 | { |
| 79 | struct page *page = alloc_page_vma(GFP_HIGHUSER, vma, vaddr); | 95 | struct page *page = alloc_page_vma(GFP_HIGHUSER | movableflags, |
| 96 | vma, vaddr); | ||
| 80 | 97 | ||
| 81 | if (page) | 98 | if (page) |
| 82 | clear_user_highpage(page, vaddr); | 99 | clear_user_highpage(page, vaddr); |
| @@ -85,6 +102,36 @@ alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) | |||
| 85 | } | 102 | } |
| 86 | #endif | 103 | #endif |
| 87 | 104 | ||
| 105 | /** | ||
| 106 | * alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA | ||
| 107 | * @vma: The VMA the page is to be allocated for | ||
| 108 | * @vaddr: The virtual address the page will be inserted into | ||
| 109 | * | ||
| 110 | * This function will allocate a page for a VMA that the caller knows will | ||
| 111 | * not be able to move in the future using move_pages() or reclaim. If it | ||
| 112 | * is known that the page can move, use alloc_zeroed_user_highpage_movable | ||
| 113 | */ | ||
| 114 | static inline struct page * | ||
| 115 | alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) | ||
| 116 | { | ||
| 117 | return __alloc_zeroed_user_highpage(0, vma, vaddr); | ||
| 118 | } | ||
| 119 | |||
| 120 | /** | ||
| 121 | * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move | ||
| 122 | * @vma: The VMA the page is to be allocated for | ||
| 123 | * @vaddr: The virtual address the page will be inserted into | ||
| 124 | * | ||
| 125 | * This function will allocate a page for a VMA that the caller knows will | ||
| 126 | * be able to migrate in the future using move_pages() or reclaimed | ||
| 127 | */ | ||
| 128 | static inline struct page * | ||
| 129 | alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma, | ||
| 130 | unsigned long vaddr) | ||
| 131 | { | ||
| 132 | return __alloc_zeroed_user_highpage(__GFP_MOVABLE, vma, vaddr); | ||
| 133 | } | ||
| 134 | |||
| 88 | static inline void clear_highpage(struct page *page) | 135 | static inline void clear_highpage(struct page *page) |
| 89 | { | 136 | { |
| 90 | void *kaddr = kmap_atomic(page, KM_USER0); | 137 | void *kaddr = kmap_atomic(page, KM_USER0); |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 17c29dca8354..540799bc85f8 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -329,12 +329,13 @@ extern void sysrq_timer_list_show(void); | |||
| 329 | #ifdef CONFIG_TIMER_STATS | 329 | #ifdef CONFIG_TIMER_STATS |
| 330 | 330 | ||
| 331 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | 331 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, |
| 332 | void *timerf, char * comm); | 332 | void *timerf, char *comm, |
| 333 | unsigned int timer_flag); | ||
| 333 | 334 | ||
| 334 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | 335 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) |
| 335 | { | 336 | { |
| 336 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | 337 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, |
| 337 | timer->function, timer->start_comm); | 338 | timer->function, timer->start_comm, 0); |
| 338 | } | 339 | } |
| 339 | 340 | ||
| 340 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | 341 | extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 2c13715e9dde..49b7053043ad 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -15,6 +15,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 17 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
| 18 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | ||
| 18 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 19 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
| 19 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); | 20 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); |
| 20 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | 21 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); |
| @@ -29,6 +30,7 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to); | |||
| 29 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 30 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
| 30 | 31 | ||
| 31 | extern unsigned long max_huge_pages; | 32 | extern unsigned long max_huge_pages; |
| 33 | extern unsigned long hugepages_treat_as_movable; | ||
| 32 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 34 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
| 33 | extern int sysctl_hugetlb_shm_group; | 35 | extern int sysctl_hugetlb_shm_group; |
| 34 | 36 | ||
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 52f53e2e70c3..333a370a3bdc 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
| 32 | #include <linux/workqueue.h> /* work_struct */ | 32 | #include <linux/workqueue.h> /* work_struct */ |
| 33 | #include <linux/mempool.h> | 33 | #include <linux/mempool.h> |
| 34 | #include <linux/mutex.h> | ||
| 34 | 35 | ||
| 35 | #include <asm/io.h> | 36 | #include <asm/io.h> |
| 36 | #include <asm/semaphore.h> /* Needed for MUTEX init macros */ | 37 | #include <asm/semaphore.h> /* Needed for MUTEX init macros */ |
| @@ -425,7 +426,7 @@ struct i2o_device { | |||
| 425 | 426 | ||
| 426 | struct device device; | 427 | struct device device; |
| 427 | 428 | ||
| 428 | struct semaphore lock; /* device lock */ | 429 | struct mutex lock; /* device lock */ |
| 429 | }; | 430 | }; |
| 430 | 431 | ||
| 431 | /* | 432 | /* |
| @@ -544,7 +545,7 @@ struct i2o_controller { | |||
| 544 | struct i2o_dma hrt; /* HW Resource Table */ | 545 | struct i2o_dma hrt; /* HW Resource Table */ |
| 545 | i2o_lct *lct; /* Logical Config Table */ | 546 | i2o_lct *lct; /* Logical Config Table */ |
| 546 | struct i2o_dma dlct; /* Temp LCT */ | 547 | struct i2o_dma dlct; /* Temp LCT */ |
| 547 | struct semaphore lct_lock; /* Lock for LCT updates */ | 548 | struct mutex lct_lock; /* Lock for LCT updates */ |
| 548 | struct i2o_dma status_block; /* IOP status block */ | 549 | struct i2o_dma status_block; /* IOP status block */ |
| 549 | 550 | ||
| 550 | struct i2o_io base; /* controller messaging unit */ | 551 | struct i2o_io base; /* controller messaging unit */ |
diff --git a/include/linux/idr.h b/include/linux/idr.h index 915572fa030b..0edda411959c 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
| @@ -78,8 +78,11 @@ void *idr_find(struct idr *idp, int id); | |||
| 78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | 78 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
| 79 | int idr_get_new(struct idr *idp, void *ptr, int *id); | 79 | int idr_get_new(struct idr *idp, void *ptr, int *id); |
| 80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 80 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
| 81 | int idr_for_each(struct idr *idp, | ||
| 82 | int (*fn)(int id, void *p, void *data), void *data); | ||
| 81 | void *idr_replace(struct idr *idp, void *ptr, int id); | 83 | void *idr_replace(struct idr *idp, void *ptr, int id); |
| 82 | void idr_remove(struct idr *idp, int id); | 84 | void idr_remove(struct idr *idp, int id); |
| 85 | void idr_remove_all(struct idr *idp); | ||
| 83 | void idr_destroy(struct idr *idp); | 86 | void idr_destroy(struct idr *idp); |
| 84 | void idr_init(struct idr *idp); | 87 | void idr_init(struct idr *idp); |
| 85 | 88 | ||
diff --git a/include/linux/init.h b/include/linux/init.h index 56ec4c62eee0..5b5285316339 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -171,9 +171,6 @@ struct obs_kernel_param { | |||
| 171 | #define __setup(str, fn) \ | 171 | #define __setup(str, fn) \ |
| 172 | __setup_param(str, fn, fn, 0) | 172 | __setup_param(str, fn, fn, 0) |
| 173 | 173 | ||
| 174 | #define __obsolete_setup(str) \ | ||
| 175 | __setup_null_param(str, __LINE__) | ||
| 176 | |||
| 177 | /* NOTE: fn is as per module_param, not __setup! Emits warning if fn | 174 | /* NOTE: fn is as per module_param, not __setup! Emits warning if fn |
| 178 | * returns non-zero. */ | 175 | * returns non-zero. */ |
| 179 | #define early_param(str, fn) \ | 176 | #define early_param(str, fn) \ |
| @@ -239,7 +236,6 @@ void __init parse_early_param(void); | |||
| 239 | #define __setup_param(str, unique_id, fn) /* nothing */ | 236 | #define __setup_param(str, unique_id, fn) /* nothing */ |
| 240 | #define __setup_null_param(str, unique_id) /* nothing */ | 237 | #define __setup_null_param(str, unique_id) /* nothing */ |
| 241 | #define __setup(str, func) /* nothing */ | 238 | #define __setup(str, func) /* nothing */ |
| 242 | #define __obsolete_setup(str) /* nothing */ | ||
| 243 | #endif | 239 | #endif |
| 244 | 240 | ||
| 245 | /* Data marked not to be saved by software suspend */ | 241 | /* Data marked not to be saved by software suspend */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 276ccaa2670c..cab741c2d603 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
| 9 | #include <linux/ipc.h> | 9 | #include <linux/ipc.h> |
| 10 | #include <linux/pid_namespace.h> | 10 | #include <linux/pid_namespace.h> |
| 11 | #include <linux/user_namespace.h> | ||
| 11 | 12 | ||
| 12 | #define INIT_FDTABLE \ | 13 | #define INIT_FDTABLE \ |
| 13 | { \ | 14 | { \ |
| @@ -78,6 +79,7 @@ extern struct nsproxy init_nsproxy; | |||
| 78 | .uts_ns = &init_uts_ns, \ | 79 | .uts_ns = &init_uts_ns, \ |
| 79 | .mnt_ns = NULL, \ | 80 | .mnt_ns = NULL, \ |
| 80 | INIT_IPC_NS(ipc_ns) \ | 81 | INIT_IPC_NS(ipc_ns) \ |
| 82 | .user_ns = &init_user_ns, \ | ||
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | #define INIT_SIGHAND(sighand) { \ | 85 | #define INIT_SIGHAND(sighand) { \ |
diff --git a/include/linux/io.h b/include/linux/io.h index 8423dd376514..e3b2dda6c8eb 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
| @@ -63,32 +63,7 @@ void __iomem * devm_ioremap(struct device *dev, unsigned long offset, | |||
| 63 | void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, | 63 | void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, |
| 64 | unsigned long size); | 64 | unsigned long size); |
| 65 | void devm_iounmap(struct device *dev, void __iomem *addr); | 65 | void devm_iounmap(struct device *dev, void __iomem *addr); |
| 66 | 66 | int check_signature(const volatile void __iomem *io_addr, | |
| 67 | /** | 67 | const unsigned char *signature, int length); |
| 68 | * check_signature - find BIOS signatures | ||
| 69 | * @io_addr: mmio address to check | ||
| 70 | * @signature: signature block | ||
| 71 | * @length: length of signature | ||
| 72 | * | ||
| 73 | * Perform a signature comparison with the mmio address io_addr. This | ||
| 74 | * address should have been obtained by ioremap. | ||
| 75 | * Returns 1 on a match. | ||
| 76 | */ | ||
| 77 | |||
| 78 | static inline int check_signature(const volatile void __iomem *io_addr, | ||
| 79 | const unsigned char *signature, int length) | ||
| 80 | { | ||
| 81 | int retval = 0; | ||
| 82 | do { | ||
| 83 | if (readb(io_addr) != *signature) | ||
| 84 | goto out; | ||
| 85 | io_addr++; | ||
| 86 | signature++; | ||
| 87 | length--; | ||
| 88 | } while (length); | ||
| 89 | retval = 1; | ||
| 90 | out: | ||
| 91 | return retval; | ||
| 92 | } | ||
| 93 | 68 | ||
| 94 | #endif /* _LINUX_IO_H */ | 69 | #endif /* _LINUX_IO_H */ |
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index 1980867a64a4..3fd3ddd5f0d9 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
| @@ -52,6 +52,7 @@ struct ipc_perm | |||
| 52 | #ifdef __KERNEL__ | 52 | #ifdef __KERNEL__ |
| 53 | 53 | ||
| 54 | #include <linux/kref.h> | 54 | #include <linux/kref.h> |
| 55 | #include <linux/spinlock.h> | ||
| 55 | 56 | ||
| 56 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ | 57 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ |
| 57 | 58 | ||
| @@ -92,6 +93,7 @@ extern struct ipc_namespace init_ipc_ns; | |||
| 92 | 93 | ||
| 93 | #ifdef CONFIG_SYSVIPC | 94 | #ifdef CONFIG_SYSVIPC |
| 94 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | 95 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, |
| 96 | extern void free_ipc_ns(struct kref *kref); | ||
| 95 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 97 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
| 96 | struct ipc_namespace *ns); | 98 | struct ipc_namespace *ns); |
| 97 | #else | 99 | #else |
| @@ -103,13 +105,9 @@ static inline struct ipc_namespace *copy_ipcs(unsigned long flags, | |||
| 103 | } | 105 | } |
| 104 | #endif | 106 | #endif |
| 105 | 107 | ||
| 106 | #ifdef CONFIG_IPC_NS | ||
| 107 | extern void free_ipc_ns(struct kref *kref); | ||
| 108 | #endif | ||
| 109 | |||
| 110 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 108 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
| 111 | { | 109 | { |
| 112 | #ifdef CONFIG_IPC_NS | 110 | #ifdef CONFIG_SYSVIPC |
| 113 | if (ns) | 111 | if (ns) |
| 114 | kref_get(&ns->kref); | 112 | kref_get(&ns->kref); |
| 115 | #endif | 113 | #endif |
| @@ -118,7 +116,7 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | |||
| 118 | 116 | ||
| 119 | static inline void put_ipc_ns(struct ipc_namespace *ns) | 117 | static inline void put_ipc_ns(struct ipc_namespace *ns) |
| 120 | { | 118 | { |
| 121 | #ifdef CONFIG_IPC_NS | 119 | #ifdef CONFIG_SYSVIPC |
| 122 | kref_put(&ns->kref, free_ipc_ns); | 120 | kref_put(&ns->kref, free_ipc_ns); |
| 123 | #endif | 121 | #endif |
| 124 | } | 122 | } |
| @@ -126,5 +124,3 @@ static inline void put_ipc_ns(struct ipc_namespace *ns) | |||
| 126 | #endif /* __KERNEL__ */ | 124 | #endif /* __KERNEL__ */ |
| 127 | 125 | ||
| 128 | #endif /* _LINUX_IPC_H */ | 126 | #endif /* _LINUX_IPC_H */ |
| 129 | |||
| 130 | |||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 1695054e8c63..44657197fcb0 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -161,6 +161,7 @@ struct irq_desc { | |||
| 161 | unsigned int wake_depth; /* nested wake enables */ | 161 | unsigned int wake_depth; /* nested wake enables */ |
| 162 | unsigned int irq_count; /* For detecting broken IRQs */ | 162 | unsigned int irq_count; /* For detecting broken IRQs */ |
| 163 | unsigned int irqs_unhandled; | 163 | unsigned int irqs_unhandled; |
| 164 | unsigned long last_unhandled; /* Aging timer for unhandled count */ | ||
| 164 | spinlock_t lock; | 165 | spinlock_t lock; |
| 165 | #ifdef CONFIG_SMP | 166 | #ifdef CONFIG_SMP |
| 166 | cpumask_t affinity; | 167 | cpumask_t affinity; |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 5f06527dca21..f73de6fb5c68 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | 7 | ||
| 8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
| 9 | 9 | ||
| 10 | #define KSYM_NAME_LEN 127 | 10 | #define KSYM_NAME_LEN 128 |
| 11 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ | 11 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \ |
| 12 | 2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1) | 12 | 2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1) |
| 13 | 13 | ||
| 14 | #ifdef CONFIG_KALLSYMS | 14 | #ifdef CONFIG_KALLSYMS |
| 15 | /* Lookup the address for a symbol. Returns 0 if not found. */ | 15 | /* Lookup the address for a symbol. Returns 0 if not found. */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 7a4852505914..1eb9cde550c4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -210,6 +210,7 @@ extern enum system_states { | |||
| 210 | #define TAINT_MACHINE_CHECK (1<<4) | 210 | #define TAINT_MACHINE_CHECK (1<<4) |
| 211 | #define TAINT_BAD_PAGE (1<<5) | 211 | #define TAINT_BAD_PAGE (1<<5) |
| 212 | #define TAINT_USER (1<<6) | 212 | #define TAINT_USER (1<<6) |
| 213 | #define TAINT_DIE (1<<7) | ||
| 213 | 214 | ||
| 214 | extern void dump_stack(void); | 215 | extern void dump_stack(void); |
| 215 | 216 | ||
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index aea34e74c496..8c4350a9ed87 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h | |||
| @@ -64,7 +64,7 @@ struct capi20_appl { | |||
| 64 | unsigned long nrecvdatapkt; | 64 | unsigned long nrecvdatapkt; |
| 65 | unsigned long nsentctlpkt; | 65 | unsigned long nsentctlpkt; |
| 66 | unsigned long nsentdatapkt; | 66 | unsigned long nsentdatapkt; |
| 67 | struct semaphore recv_sem; | 67 | struct mutex recv_mtx; |
| 68 | struct sk_buff_head recv_queue; | 68 | struct sk_buff_head recv_queue; |
| 69 | struct work_struct recv_work; | 69 | struct work_struct recv_work; |
| 70 | int release_in_progress; | 70 | int release_in_progress; |
diff --git a/include/linux/leds.h b/include/linux/leds.h index 88afceffb7cb..494bed7c2fc1 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #define __LINUX_LEDS_H_INCLUDED | 13 | #define __LINUX_LEDS_H_INCLUDED |
| 14 | 14 | ||
| 15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
| 16 | #include <linux/spinlock.h> | ||
| 17 | 16 | ||
| 18 | struct device; | 17 | struct device; |
| 19 | struct class_device; | 18 | struct class_device; |
diff --git a/include/linux/limits.h b/include/linux/limits.h index eaf2e099f125..2d0f94162fb3 100644 --- a/include/linux/limits.h +++ b/include/linux/limits.h | |||
| @@ -5,8 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ | 6 | #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ |
| 7 | #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ | 7 | #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ |
| 8 | #define CHILD_MAX 999 /* no limit :-) */ | ||
| 9 | #define OPEN_MAX 256 /* # open files a process may have */ | ||
| 10 | #define LINK_MAX 127 /* # links a file may have */ | 8 | #define LINK_MAX 127 /* # links a file may have */ |
| 11 | #define MAX_CANON 255 /* size of the canonical input queue */ | 9 | #define MAX_CANON 255 /* size of the canonical input queue */ |
| 12 | #define MAX_INPUT 255 /* size of the type-ahead buffer */ | 10 | #define MAX_INPUT 255 /* size of the type-ahead buffer */ |
diff --git a/include/linux/linux_logo.h b/include/linux/linux_logo.h index 9c01bde5bf1b..08a92969c76e 100644 --- a/include/linux/linux_logo.h +++ b/include/linux/linux_logo.h | |||
| @@ -33,5 +33,13 @@ struct linux_logo { | |||
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | extern const struct linux_logo *fb_find_logo(int depth); | 35 | extern const struct linux_logo *fb_find_logo(int depth); |
| 36 | #ifdef CONFIG_FB_LOGO_EXTRA | ||
| 37 | extern void fb_append_extra_logo(const struct linux_logo *logo, | ||
| 38 | unsigned int n); | ||
| 39 | #else | ||
| 40 | static inline void fb_append_extra_logo(const struct linux_logo *logo, | ||
| 41 | unsigned int n) | ||
| 42 | {} | ||
| 43 | #endif | ||
| 36 | 44 | ||
| 37 | #endif /* _LINUX_LINUX_LOGO_H */ | 45 | #endif /* _LINUX_LINUX_LOGO_H */ |
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 246de1d84a26..6f1637c61e10 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
| @@ -27,6 +27,7 @@ struct nlmsvc_binding { | |||
| 27 | struct nfs_fh *, | 27 | struct nfs_fh *, |
| 28 | struct file **); | 28 | struct file **); |
| 29 | void (*fclose)(struct file *); | 29 | void (*fclose)(struct file *); |
| 30 | unsigned long (*get_grace_period)(void); | ||
| 30 | }; | 31 | }; |
| 31 | 32 | ||
| 32 | extern struct nlmsvc_binding * nlmsvc_ops; | 33 | extern struct nlmsvc_binding * nlmsvc_ops; |
| @@ -38,4 +39,12 @@ extern int nlmclnt_proc(struct inode *, int, struct file_lock *); | |||
| 38 | extern int lockd_up(int proto); | 39 | extern int lockd_up(int proto); |
| 39 | extern void lockd_down(void); | 40 | extern void lockd_down(void); |
| 40 | 41 | ||
| 42 | unsigned long get_nfs_grace_period(void); | ||
| 43 | |||
| 44 | #ifdef CONFIG_NFSD_V4 | ||
| 45 | unsigned long get_nfs4_grace_period(void); | ||
| 46 | #else | ||
| 47 | static inline unsigned long get_nfs4_grace_period(void) {return 0;} | ||
| 48 | #endif | ||
| 49 | |||
| 41 | #endif /* LINUX_LOCKD_BIND_H */ | 50 | #endif /* LINUX_LOCKD_BIND_H */ |
diff --git a/include/linux/lzo.h b/include/linux/lzo.h index 582d8b711a13..d793497ec1ca 100644 --- a/include/linux/lzo.h +++ b/include/linux/lzo.h | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) | 17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) |
| 18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS | 18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS |
| 19 | 19 | ||
| 20 | #define lzo1x_worst_compress(x) (x + (x / 64) + 16 + 3) | 20 | #define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3) |
| 21 | 21 | ||
| 22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ | 22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ |
| 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, | 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index daabb3aa1ec6..e147cf50529f 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -159,7 +159,7 @@ extern void mpol_fix_fork_child_flag(struct task_struct *p); | |||
| 159 | 159 | ||
| 160 | extern struct mempolicy default_policy; | 160 | extern struct mempolicy default_policy; |
| 161 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 161 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
| 162 | unsigned long addr); | 162 | unsigned long addr, gfp_t gfp_flags); |
| 163 | extern unsigned slab_node(struct mempolicy *policy); | 163 | extern unsigned slab_node(struct mempolicy *policy); |
| 164 | 164 | ||
| 165 | extern enum zone_type policy_zone; | 165 | extern enum zone_type policy_zone; |
| @@ -256,9 +256,9 @@ static inline void mpol_fix_fork_child_flag(struct task_struct *p) | |||
| 256 | #define set_cpuset_being_rebound(x) do {} while (0) | 256 | #define set_cpuset_being_rebound(x) do {} while (0) |
| 257 | 257 | ||
| 258 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 258 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
| 259 | unsigned long addr) | 259 | unsigned long addr, gfp_t gfp_flags) |
| 260 | { | 260 | { |
| 261 | return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER); | 261 | return NODE_DATA(0)->node_zonelists + gfp_zone(gfp_flags); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | static inline int do_migrate_pages(struct mm_struct *mm, | 264 | static inline int do_migrate_pages(struct mm_struct *mm, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1c1207472bb4..a5c451816fdc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #define _LINUX_MM_H | 2 | #define _LINUX_MM_H |
| 3 | 3 | ||
| 4 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
| 5 | #include <linux/capability.h> | ||
| 6 | 5 | ||
| 7 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 8 | 7 | ||
| @@ -27,7 +26,6 @@ extern unsigned long max_mapnr; | |||
| 27 | 26 | ||
| 28 | extern unsigned long num_physpages; | 27 | extern unsigned long num_physpages; |
| 29 | extern void * high_memory; | 28 | extern void * high_memory; |
| 30 | extern unsigned long vmalloc_earlyreserve; | ||
| 31 | extern int page_cluster; | 29 | extern int page_cluster; |
| 32 | 30 | ||
| 33 | #ifdef CONFIG_SYSCTL | 31 | #ifdef CONFIG_SYSCTL |
| @@ -601,6 +599,7 @@ static inline struct address_space *page_mapping(struct page *page) | |||
| 601 | { | 599 | { |
| 602 | struct address_space *mapping = page->mapping; | 600 | struct address_space *mapping = page->mapping; |
| 603 | 601 | ||
| 602 | VM_BUG_ON(PageSlab(page)); | ||
| 604 | if (unlikely(PageSwapCache(page))) | 603 | if (unlikely(PageSwapCache(page))) |
| 605 | mapping = &swapper_space; | 604 | mapping = &swapper_space; |
| 606 | #ifdef CONFIG_SLUB | 605 | #ifdef CONFIG_SLUB |
| @@ -812,27 +811,31 @@ extern unsigned long do_mremap(unsigned long addr, | |||
| 812 | unsigned long flags, unsigned long new_addr); | 811 | unsigned long flags, unsigned long new_addr); |
| 813 | 812 | ||
| 814 | /* | 813 | /* |
| 815 | * Prototype to add a shrinker callback for ageable caches. | 814 | * A callback you can register to apply pressure to ageable caches. |
| 816 | * | ||
| 817 | * These functions are passed a count `nr_to_scan' and a gfpmask. They should | ||
| 818 | * scan `nr_to_scan' objects, attempting to free them. | ||
| 819 | * | 815 | * |
| 820 | * The callback must return the number of objects which remain in the cache. | 816 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should |
| 817 | * look through the least-recently-used 'nr_to_scan' entries and | ||
| 818 | * attempt to free them up. It should return the number of objects | ||
| 819 | * which remain in the cache. If it returns -1, it means it cannot do | ||
| 820 | * any scanning at this time (eg. there is a risk of deadlock). | ||
| 821 | * | 821 | * |
| 822 | * The callback will be passed nr_to_scan == 0 when the VM is querying the | 822 | * The 'gfpmask' refers to the allocation we are currently trying to |
| 823 | * cache size, so a fastpath for that case is appropriate. | 823 | * fulfil. |
| 824 | */ | 824 | * |
| 825 | typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); | 825 | * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is |
| 826 | 826 | * querying the cache size, so a fastpath for that case is appropriate. | |
| 827 | /* | ||
| 828 | * Add an aging callback. The int is the number of 'seeks' it takes | ||
| 829 | * to recreate one of the objects that these functions age. | ||
| 830 | */ | 827 | */ |
| 828 | struct shrinker { | ||
| 829 | int (*shrink)(int nr_to_scan, gfp_t gfp_mask); | ||
| 830 | int seeks; /* seeks to recreate an obj */ | ||
| 831 | 831 | ||
| 832 | #define DEFAULT_SEEKS 2 | 832 | /* These are for internal use */ |
| 833 | struct shrinker; | 833 | struct list_head list; |
| 834 | extern struct shrinker *set_shrinker(int, shrinker_t); | 834 | long nr; /* objs pending delete */ |
| 835 | extern void remove_shrinker(struct shrinker *shrinker); | 835 | }; |
| 836 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ | ||
| 837 | extern void register_shrinker(struct shrinker *); | ||
| 838 | extern void unregister_shrinker(struct shrinker *); | ||
| 836 | 839 | ||
| 837 | /* | 840 | /* |
| 838 | * Some shared mappigns will want the pages marked read-only | 841 | * Some shared mappigns will want the pages marked read-only |
| @@ -1072,6 +1075,10 @@ extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned lo | |||
| 1072 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | 1075 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, |
| 1073 | unsigned long len, unsigned long prot, | 1076 | unsigned long len, unsigned long prot, |
| 1074 | unsigned long flag, unsigned long pgoff); | 1077 | unsigned long flag, unsigned long pgoff); |
| 1078 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | ||
| 1079 | unsigned long len, unsigned long flags, | ||
| 1080 | unsigned int vm_flags, unsigned long pgoff, | ||
| 1081 | int accountable); | ||
| 1075 | 1082 | ||
| 1076 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, | 1083 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, |
| 1077 | unsigned long len, unsigned long prot, | 1084 | unsigned long len, unsigned long prot, |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d09b1345a3a1..da8eb8ad9e9b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -24,6 +24,14 @@ | |||
| 24 | #endif | 24 | #endif |
| 25 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) | 25 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) |
| 26 | 26 | ||
| 27 | /* | ||
| 28 | * PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed | ||
| 29 | * costly to service. That is between allocation orders which should | ||
| 30 | * coelesce naturally under reasonable reclaim pressure and those which | ||
| 31 | * will not. | ||
| 32 | */ | ||
| 33 | #define PAGE_ALLOC_COSTLY_ORDER 3 | ||
| 34 | |||
| 27 | struct free_area { | 35 | struct free_area { |
| 28 | struct list_head free_list; | 36 | struct list_head free_list; |
| 29 | unsigned long nr_free; | 37 | unsigned long nr_free; |
| @@ -146,6 +154,7 @@ enum zone_type { | |||
| 146 | */ | 154 | */ |
| 147 | ZONE_HIGHMEM, | 155 | ZONE_HIGHMEM, |
| 148 | #endif | 156 | #endif |
| 157 | ZONE_MOVABLE, | ||
| 149 | MAX_NR_ZONES | 158 | MAX_NR_ZONES |
| 150 | }; | 159 | }; |
| 151 | 160 | ||
| @@ -167,6 +176,7 @@ enum zone_type { | |||
| 167 | + defined(CONFIG_ZONE_DMA32) \ | 176 | + defined(CONFIG_ZONE_DMA32) \ |
| 168 | + 1 \ | 177 | + 1 \ |
| 169 | + defined(CONFIG_HIGHMEM) \ | 178 | + defined(CONFIG_HIGHMEM) \ |
| 179 | + 1 \ | ||
| 170 | ) | 180 | ) |
| 171 | #if __ZONE_COUNT < 2 | 181 | #if __ZONE_COUNT < 2 |
| 172 | #define ZONES_SHIFT 0 | 182 | #define ZONES_SHIFT 0 |
| @@ -499,10 +509,22 @@ static inline int populated_zone(struct zone *zone) | |||
| 499 | return (!!zone->present_pages); | 509 | return (!!zone->present_pages); |
| 500 | } | 510 | } |
| 501 | 511 | ||
| 512 | extern int movable_zone; | ||
| 513 | |||
| 514 | static inline int zone_movable_is_highmem(void) | ||
| 515 | { | ||
| 516 | #if defined(CONFIG_HIGHMEM) && defined(CONFIG_ARCH_POPULATES_NODE_MAP) | ||
| 517 | return movable_zone == ZONE_HIGHMEM; | ||
| 518 | #else | ||
| 519 | return 0; | ||
| 520 | #endif | ||
| 521 | } | ||
| 522 | |||
| 502 | static inline int is_highmem_idx(enum zone_type idx) | 523 | static inline int is_highmem_idx(enum zone_type idx) |
| 503 | { | 524 | { |
| 504 | #ifdef CONFIG_HIGHMEM | 525 | #ifdef CONFIG_HIGHMEM |
| 505 | return (idx == ZONE_HIGHMEM); | 526 | return (idx == ZONE_HIGHMEM || |
| 527 | (idx == ZONE_MOVABLE && zone_movable_is_highmem())); | ||
| 506 | #else | 528 | #else |
| 507 | return 0; | 529 | return 0; |
| 508 | #endif | 530 | #endif |
| @@ -522,7 +544,9 @@ static inline int is_normal_idx(enum zone_type idx) | |||
| 522 | static inline int is_highmem(struct zone *zone) | 544 | static inline int is_highmem(struct zone *zone) |
| 523 | { | 545 | { |
| 524 | #ifdef CONFIG_HIGHMEM | 546 | #ifdef CONFIG_HIGHMEM |
| 525 | return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; | 547 | int zone_idx = zone - zone->zone_pgdat->node_zones; |
| 548 | return zone_idx == ZONE_HIGHMEM || | ||
| 549 | (zone_idx == ZONE_MOVABLE && zone_movable_is_highmem()); | ||
| 526 | #else | 550 | #else |
| 527 | return 0; | 551 | return 0; |
| 528 | #endif | 552 | #endif |
| @@ -566,6 +590,11 @@ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | |||
| 566 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | 590 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, |
| 567 | struct file *, void __user *, size_t *, loff_t *); | 591 | struct file *, void __user *, size_t *, loff_t *); |
| 568 | 592 | ||
| 593 | extern int numa_zonelist_order_handler(struct ctl_table *, int, | ||
| 594 | struct file *, void __user *, size_t *, loff_t *); | ||
| 595 | extern char numa_zonelist_order[]; | ||
| 596 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ | ||
| 597 | |||
| 569 | #include <linux/topology.h> | 598 | #include <linux/topology.h> |
| 570 | /* Returns the number of the current Node. */ | 599 | /* Returns the number of the current Node. */ |
| 571 | #ifndef numa_node_id | 600 | #ifndef numa_node_id |
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h index 1fa4d9813b31..8eed44f8ca73 100644 --- a/include/linux/mnt_namespace.h +++ b/include/linux/mnt_namespace.h | |||
| @@ -14,7 +14,7 @@ struct mnt_namespace { | |||
| 14 | int event; | 14 | int event; |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | extern struct mnt_namespace *copy_mnt_ns(int, struct mnt_namespace *, | 17 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, |
| 18 | struct fs_struct *); | 18 | struct fs_struct *); |
| 19 | extern void __put_mnt_ns(struct mnt_namespace *ns); | 19 | extern void __put_mnt_ns(struct mnt_namespace *ns); |
| 20 | 20 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index e6e0f86ef5fc..b6a646cea1cb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 | 6 | * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 |
| 7 | * Rewritten again by Rusty Russell, 2002 | 7 | * Rewritten again by Rusty Russell, 2002 |
| 8 | */ | 8 | */ |
| 9 | #include <linux/spinlock.h> | ||
| 10 | #include <linux/list.h> | 9 | #include <linux/list.h> |
| 11 | #include <linux/stat.h> | 10 | #include <linux/stat.h> |
| 12 | #include <linux/compiler.h> | 11 | #include <linux/compiler.h> |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 0e09c005dda8..f950921523f5 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
| @@ -146,7 +146,7 @@ struct fat_boot_fsinfo { | |||
| 146 | }; | 146 | }; |
| 147 | 147 | ||
| 148 | struct msdos_dir_entry { | 148 | struct msdos_dir_entry { |
| 149 | __u8 name[8],ext[3]; /* name and extension */ | 149 | __u8 name[MSDOS_NAME];/* name and extension */ |
| 150 | __u8 attr; /* attribute bits */ | 150 | __u8 attr; /* attribute bits */ |
| 151 | __u8 lcase; /* Case for base and extension */ | 151 | __u8 lcase; /* Case for base and extension */ |
| 152 | __u8 ctime_cs; /* Creation time, centiseconds (0-199) */ | 152 | __u8 ctime_cs; /* Creation time, centiseconds (0-199) */ |
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 83e39eb054d3..88766e43e121 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
| @@ -148,8 +148,6 @@ struct ncp_nls_ioctl | |||
| 148 | #include <linux/ncp_fs_i.h> | 148 | #include <linux/ncp_fs_i.h> |
| 149 | #include <linux/ncp_fs_sb.h> | 149 | #include <linux/ncp_fs_sb.h> |
| 150 | 150 | ||
| 151 | /* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */ | ||
| 152 | #undef PRINTK | ||
| 153 | /* define because it is easy to change PRINTK to {*}PRINTK */ | 151 | /* define because it is easy to change PRINTK to {*}PRINTK */ |
| 154 | #define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) | 152 | #define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) |
| 155 | 153 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 322b5eae57dd..da7a13c97eb8 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -262,8 +262,6 @@ enum netdev_state_t | |||
| 262 | __LINK_STATE_LINKWATCH_PENDING, | 262 | __LINK_STATE_LINKWATCH_PENDING, |
| 263 | __LINK_STATE_DORMANT, | 263 | __LINK_STATE_DORMANT, |
| 264 | __LINK_STATE_QDISC_RUNNING, | 264 | __LINK_STATE_QDISC_RUNNING, |
| 265 | /* Set by the netpoll NAPI code */ | ||
| 266 | __LINK_STATE_POLL_LIST_FROZEN, | ||
| 267 | }; | 265 | }; |
| 268 | 266 | ||
| 269 | 267 | ||
| @@ -1022,14 +1020,6 @@ static inline void netif_rx_complete(struct net_device *dev) | |||
| 1022 | { | 1020 | { |
| 1023 | unsigned long flags; | 1021 | unsigned long flags; |
| 1024 | 1022 | ||
| 1025 | #ifdef CONFIG_NETPOLL | ||
| 1026 | /* Prevent race with netpoll - yes, this is a kludge. | ||
| 1027 | * But at least it doesn't penalize the non-netpoll | ||
| 1028 | * code path. */ | ||
| 1029 | if (test_bit(__LINK_STATE_POLL_LIST_FROZEN, &dev->state)) | ||
| 1030 | return; | ||
| 1031 | #endif | ||
| 1032 | |||
| 1033 | local_irq_save(flags); | 1023 | local_irq_save(flags); |
| 1034 | __netif_rx_complete(dev); | 1024 | __netif_rx_complete(dev); |
| 1035 | local_irq_restore(flags); | 1025 | local_irq_restore(flags); |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 9f62d6182d32..78feb7beff75 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
| @@ -42,6 +42,9 @@ | |||
| 42 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ | 42 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ |
| 43 | #define NFSEXP_ALLFLAGS 0xFE3F | 43 | #define NFSEXP_ALLFLAGS 0xFE3F |
| 44 | 44 | ||
| 45 | /* The flags that may vary depending on security flavor: */ | ||
| 46 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ | ||
| 47 | | NFSEXP_ALLSQUASH) | ||
| 45 | 48 | ||
| 46 | #ifdef __KERNEL__ | 49 | #ifdef __KERNEL__ |
| 47 | 50 | ||
| @@ -64,6 +67,19 @@ struct nfsd4_fs_locations { | |||
| 64 | int migrated; | 67 | int migrated; |
| 65 | }; | 68 | }; |
| 66 | 69 | ||
| 70 | /* | ||
| 71 | * We keep an array of pseudoflavors with the export, in order from most | ||
| 72 | * to least preferred. For the forseeable future, we don't expect more | ||
| 73 | * than the eight pseudoflavors null, unix, krb5, krb5i, krb5p, skpm3, | ||
| 74 | * spkm3i, and spkm3p (and using all 8 at once should be rare). | ||
| 75 | */ | ||
| 76 | #define MAX_SECINFO_LIST 8 | ||
| 77 | |||
| 78 | struct exp_flavor_info { | ||
| 79 | u32 pseudoflavor; | ||
| 80 | u32 flags; | ||
| 81 | }; | ||
| 82 | |||
| 67 | struct svc_export { | 83 | struct svc_export { |
| 68 | struct cache_head h; | 84 | struct cache_head h; |
| 69 | struct auth_domain * ex_client; | 85 | struct auth_domain * ex_client; |
| @@ -76,6 +92,8 @@ struct svc_export { | |||
| 76 | int ex_fsid; | 92 | int ex_fsid; |
| 77 | unsigned char * ex_uuid; /* 16 byte fsid */ | 93 | unsigned char * ex_uuid; /* 16 byte fsid */ |
| 78 | struct nfsd4_fs_locations ex_fslocs; | 94 | struct nfsd4_fs_locations ex_fslocs; |
| 95 | int ex_nflavors; | ||
| 96 | struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST]; | ||
| 79 | }; | 97 | }; |
| 80 | 98 | ||
| 81 | /* an "export key" (expkey) maps a filehandlefragement to an | 99 | /* an "export key" (expkey) maps a filehandlefragement to an |
| @@ -95,10 +113,22 @@ struct svc_expkey { | |||
| 95 | 113 | ||
| 96 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) | 114 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) |
| 97 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) | 115 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) |
| 98 | #define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY) | ||
| 99 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) | 116 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) |
| 100 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) | 117 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) |
| 101 | 118 | ||
| 119 | static inline int EX_RDONLY(struct svc_export *exp, struct svc_rqst *rqstp) | ||
| 120 | { | ||
| 121 | struct exp_flavor_info *f; | ||
| 122 | struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors; | ||
| 123 | |||
| 124 | for (f = exp->ex_flavors; f < end; f++) { | ||
| 125 | if (f->pseudoflavor == rqstp->rq_flavor) | ||
| 126 | return f->flags & NFSEXP_READONLY; | ||
| 127 | } | ||
| 128 | return exp->ex_flags & NFSEXP_READONLY; | ||
| 129 | } | ||
| 130 | |||
| 131 | __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp); | ||
| 102 | 132 | ||
| 103 | /* | 133 | /* |
| 104 | * Function declarations | 134 | * Function declarations |
| @@ -112,13 +142,19 @@ struct svc_export * exp_get_by_name(struct auth_domain *clp, | |||
| 112 | struct vfsmount *mnt, | 142 | struct vfsmount *mnt, |
| 113 | struct dentry *dentry, | 143 | struct dentry *dentry, |
| 114 | struct cache_req *reqp); | 144 | struct cache_req *reqp); |
| 145 | struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, | ||
| 146 | struct vfsmount *, | ||
| 147 | struct dentry *); | ||
| 115 | struct svc_export * exp_parent(struct auth_domain *clp, | 148 | struct svc_export * exp_parent(struct auth_domain *clp, |
| 116 | struct vfsmount *mnt, | 149 | struct vfsmount *mnt, |
| 117 | struct dentry *dentry, | 150 | struct dentry *dentry, |
| 118 | struct cache_req *reqp); | 151 | struct cache_req *reqp); |
| 152 | struct svc_export * rqst_exp_parent(struct svc_rqst *, | ||
| 153 | struct vfsmount *mnt, | ||
| 154 | struct dentry *dentry); | ||
| 119 | int exp_rootfh(struct auth_domain *, | 155 | int exp_rootfh(struct auth_domain *, |
| 120 | char *path, struct knfsd_fh *, int maxsize); | 156 | char *path, struct knfsd_fh *, int maxsize); |
| 121 | __be32 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); | 157 | __be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *); |
| 122 | __be32 nfserrno(int errno); | 158 | __be32 nfserrno(int errno); |
| 123 | 159 | ||
| 124 | extern struct cache_detail svc_export_cache; | 160 | extern struct cache_detail svc_export_cache; |
| @@ -135,6 +171,7 @@ static inline void exp_get(struct svc_export *exp) | |||
| 135 | extern struct svc_export * | 171 | extern struct svc_export * |
| 136 | exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, | 172 | exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, |
| 137 | struct cache_req *reqp); | 173 | struct cache_req *reqp); |
| 174 | struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *); | ||
| 138 | 175 | ||
| 139 | #endif /* __KERNEL__ */ | 176 | #endif /* __KERNEL__ */ |
| 140 | 177 | ||
diff --git a/include/linux/nfsd/interface.h b/include/linux/nfsd/interface.h deleted file mode 100644 index af0979704afb..000000000000 --- a/include/linux/nfsd/interface.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/nfsd/interface.h | ||
| 3 | * | ||
| 4 | * defines interface between nfsd and other bits of | ||
| 5 | * the kernel. Particularly filesystems (eventually). | ||
| 6 | * | ||
| 7 | * Copyright (C) 2000 Neil Brown <neilb@cse.unsw.edu.au> | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef LINUX_NFSD_INTERFACE_H | ||
| 11 | #define LINUX_NFSD_INTERFACE_H | ||
| 12 | |||
| 13 | #endif /* LINUX_NFSD_INTERFACE_H */ | ||
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 72feac581aa3..e452256d3f72 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/nfsd/export.h> | 22 | #include <linux/nfsd/export.h> |
| 23 | #include <linux/nfsd/auth.h> | 23 | #include <linux/nfsd/auth.h> |
| 24 | #include <linux/nfsd/stats.h> | 24 | #include <linux/nfsd/stats.h> |
| 25 | #include <linux/nfsd/interface.h> | ||
| 26 | /* | 25 | /* |
| 27 | * nfsd version | 26 | * nfsd version |
| 28 | */ | 27 | */ |
| @@ -72,6 +71,9 @@ int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, | |||
| 72 | struct svc_export **expp); | 71 | struct svc_export **expp); |
| 73 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, | 72 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, |
| 74 | const char *, int, struct svc_fh *); | 73 | const char *, int, struct svc_fh *); |
| 74 | __be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *, | ||
| 75 | const char *, int, | ||
| 76 | struct svc_export **, struct dentry **); | ||
| 75 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, | 77 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, |
| 76 | struct iattr *, int, time_t); | 78 | struct iattr *, int, time_t); |
| 77 | #ifdef CONFIG_NFSD_V4 | 79 | #ifdef CONFIG_NFSD_V4 |
| @@ -120,7 +122,8 @@ __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, | |||
| 120 | struct kstatfs *); | 122 | struct kstatfs *); |
| 121 | 123 | ||
| 122 | int nfsd_notify_change(struct inode *, struct iattr *); | 124 | int nfsd_notify_change(struct inode *, struct iattr *); |
| 123 | __be32 nfsd_permission(struct svc_export *, struct dentry *, int); | 125 | __be32 nfsd_permission(struct svc_rqst *, struct svc_export *, |
| 126 | struct dentry *, int); | ||
| 124 | int nfsd_sync_dir(struct dentry *dp); | 127 | int nfsd_sync_dir(struct dentry *dp); |
| 125 | 128 | ||
| 126 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) | 129 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) |
| @@ -149,6 +152,7 @@ extern int nfsd_max_blksize; | |||
| 149 | * NFSv4 State | 152 | * NFSv4 State |
| 150 | */ | 153 | */ |
| 151 | #ifdef CONFIG_NFSD_V4 | 154 | #ifdef CONFIG_NFSD_V4 |
| 155 | extern unsigned int max_delegations; | ||
| 152 | void nfs4_state_init(void); | 156 | void nfs4_state_init(void); |
| 153 | int nfs4_state_start(void); | 157 | int nfs4_state_start(void); |
| 154 | void nfs4_state_shutdown(void); | 158 | void nfs4_state_shutdown(void); |
| @@ -236,6 +240,7 @@ void nfsd_lockd_shutdown(void); | |||
| 236 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) | 240 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) |
| 237 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) | 241 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) |
| 238 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) | 242 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) |
| 243 | #define nfserr_wrongsec __constant_htonl(NFSERR_WRONGSEC) | ||
| 239 | #define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) | 244 | #define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) |
| 240 | 245 | ||
| 241 | /* error codes for internal use */ | 246 | /* error codes for internal use */ |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index ab5c236bd9a7..db348f749376 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
| @@ -67,7 +67,7 @@ struct nfs4_cb_recall { | |||
| 67 | int cbr_trunc; | 67 | int cbr_trunc; |
| 68 | stateid_t cbr_stateid; | 68 | stateid_t cbr_stateid; |
| 69 | u32 cbr_fhlen; | 69 | u32 cbr_fhlen; |
| 70 | u32 cbr_fhval[NFS4_FHSIZE]; | 70 | char cbr_fhval[NFS4_FHSIZE]; |
| 71 | struct nfs4_delegation *cbr_dp; | 71 | struct nfs4_delegation *cbr_dp; |
| 72 | }; | 72 | }; |
| 73 | 73 | ||
| @@ -224,6 +224,7 @@ struct nfs4_file { | |||
| 224 | struct inode *fi_inode; | 224 | struct inode *fi_inode; |
| 225 | u32 fi_id; /* used with stateowner->so_id | 225 | u32 fi_id; /* used with stateowner->so_id |
| 226 | * for stateid_hashtbl hash */ | 226 | * for stateid_hashtbl hash */ |
| 227 | bool fi_had_conflict; | ||
| 227 | }; | 228 | }; |
| 228 | 229 | ||
| 229 | /* | 230 | /* |
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index 09799bcee0ac..1b653267133a 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
| @@ -293,6 +293,12 @@ struct nfsd4_rename { | |||
| 293 | struct nfsd4_change_info rn_tinfo; /* response */ | 293 | struct nfsd4_change_info rn_tinfo; /* response */ |
| 294 | }; | 294 | }; |
| 295 | 295 | ||
| 296 | struct nfsd4_secinfo { | ||
| 297 | u32 si_namelen; /* request */ | ||
| 298 | char *si_name; /* request */ | ||
| 299 | struct svc_export *si_exp; /* response */ | ||
| 300 | }; | ||
| 301 | |||
| 296 | struct nfsd4_setattr { | 302 | struct nfsd4_setattr { |
| 297 | stateid_t sa_stateid; /* request */ | 303 | stateid_t sa_stateid; /* request */ |
| 298 | u32 sa_bmval[2]; /* request */ | 304 | u32 sa_bmval[2]; /* request */ |
| @@ -365,6 +371,7 @@ struct nfsd4_op { | |||
| 365 | struct nfsd4_remove remove; | 371 | struct nfsd4_remove remove; |
| 366 | struct nfsd4_rename rename; | 372 | struct nfsd4_rename rename; |
| 367 | clientid_t renew; | 373 | clientid_t renew; |
| 374 | struct nfsd4_secinfo secinfo; | ||
| 368 | struct nfsd4_setattr setattr; | 375 | struct nfsd4_setattr setattr; |
| 369 | struct nfsd4_setclientid setclientid; | 376 | struct nfsd4_setclientid setclientid; |
| 370 | struct nfsd4_setclientid_confirm setclientid_confirm; | 377 | struct nfsd4_setclientid_confirm setclientid_confirm; |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 189e0dc993ab..ce06188b7a56 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
| @@ -28,10 +28,11 @@ struct nsproxy { | |||
| 28 | struct ipc_namespace *ipc_ns; | 28 | struct ipc_namespace *ipc_ns; |
| 29 | struct mnt_namespace *mnt_ns; | 29 | struct mnt_namespace *mnt_ns; |
| 30 | struct pid_namespace *pid_ns; | 30 | struct pid_namespace *pid_ns; |
| 31 | struct user_namespace *user_ns; | ||
| 31 | }; | 32 | }; |
| 32 | extern struct nsproxy init_nsproxy; | 33 | extern struct nsproxy init_nsproxy; |
| 33 | 34 | ||
| 34 | int copy_namespaces(int flags, struct task_struct *tsk); | 35 | int copy_namespaces(unsigned long flags, struct task_struct *tsk); |
| 35 | void get_task_namespaces(struct task_struct *tsk); | 36 | void get_task_namespaces(struct task_struct *tsk); |
| 36 | void free_nsproxy(struct nsproxy *ns); | 37 | void free_nsproxy(struct nsproxy *ns); |
| 37 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, | 38 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 37a71580ad8a..5e84f2e8d54c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -432,6 +432,8 @@ extern struct bus_type pci_bus_type; | |||
| 432 | * code, or pci core code. */ | 432 | * code, or pci core code. */ |
| 433 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ | 433 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ |
| 434 | extern struct list_head pci_devices; /* list of all devices */ | 434 | extern struct list_head pci_devices; /* list of all devices */ |
| 435 | /* Some device drivers need know if pci is initiated */ | ||
| 436 | extern int no_pci_devices(void); | ||
| 435 | 437 | ||
| 436 | void pcibios_fixup_bus(struct pci_bus *); | 438 | void pcibios_fixup_bus(struct pci_bus *); |
| 437 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 439 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
| @@ -724,6 +726,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev * | |||
| 724 | { return NULL; } | 726 | { return NULL; } |
| 725 | 727 | ||
| 726 | #define pci_dev_present(ids) (0) | 728 | #define pci_dev_present(ids) (0) |
| 729 | #define no_pci_devices() (1) | ||
| 727 | #define pci_find_present(ids) (NULL) | 730 | #define pci_find_present(ids) (NULL) |
| 728 | #define pci_dev_put(dev) do { } while (0) | 731 | #define pci_dev_put(dev) do { } while (0) |
| 729 | 732 | ||
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index b72be2f79e6a..926adaae0f96 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef __LINUX_PERCPU_H | 1 | #ifndef __LINUX_PERCPU_H |
| 2 | #define __LINUX_PERCPU_H | 2 | #define __LINUX_PERCPU_H |
| 3 | 3 | ||
| 4 | #include <linux/spinlock.h> /* For preempt_disable() */ | 4 | #include <linux/preempt.h> |
| 5 | #include <linux/slab.h> /* For kmalloc() */ | 5 | #include <linux/slab.h> /* For kmalloc() */ |
| 6 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
| 7 | #include <linux/string.h> /* For memset() */ | 7 | #include <linux/string.h> /* For memset() */ |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index f5aa593ccf32..3d9f70972cdf 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
| 10 | #include <linux/smp.h> | 10 | #include <linux/smp.h> |
| 11 | #include <linux/list.h> | ||
| 11 | #include <linux/threads.h> | 12 | #include <linux/threads.h> |
| 12 | #include <linux/percpu.h> | 13 | #include <linux/percpu.h> |
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| @@ -17,6 +18,9 @@ | |||
| 17 | struct percpu_counter { | 18 | struct percpu_counter { |
| 18 | spinlock_t lock; | 19 | spinlock_t lock; |
| 19 | s64 count; | 20 | s64 count; |
| 21 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 22 | struct list_head list; /* All percpu_counters are on a list */ | ||
| 23 | #endif | ||
| 20 | s32 *counters; | 24 | s32 *counters; |
| 21 | }; | 25 | }; |
| 22 | 26 | ||
| @@ -26,18 +30,8 @@ struct percpu_counter { | |||
| 26 | #define FBC_BATCH (NR_CPUS*4) | 30 | #define FBC_BATCH (NR_CPUS*4) |
| 27 | #endif | 31 | #endif |
| 28 | 32 | ||
| 29 | static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) | 33 | void percpu_counter_init(struct percpu_counter *fbc, s64 amount); |
| 30 | { | 34 | void percpu_counter_destroy(struct percpu_counter *fbc); |
| 31 | spin_lock_init(&fbc->lock); | ||
| 32 | fbc->count = amount; | ||
| 33 | fbc->counters = alloc_percpu(s32); | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | ||
| 37 | { | ||
| 38 | free_percpu(fbc->counters); | ||
| 39 | } | ||
| 40 | |||
| 41 | void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); | 35 | void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); |
| 42 | s64 percpu_counter_sum(struct percpu_counter *fbc); | 36 | s64 percpu_counter_sum(struct percpu_counter *fbc); |
| 43 | 37 | ||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 169c6c24209b..b9a17e08ff0f 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
| @@ -29,7 +29,7 @@ static inline void get_pid_ns(struct pid_namespace *ns) | |||
| 29 | kref_get(&ns->kref); | 29 | kref_get(&ns->kref); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | extern struct pid_namespace *copy_pid_ns(int flags, struct pid_namespace *ns); | 32 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); |
| 33 | extern void free_pid_ns(struct kref *kref); | 33 | extern void free_pid_ns(struct kref *kref); |
| 34 | 34 | ||
| 35 | static inline void put_pid_ns(struct pid_namespace *ns) | 35 | static inline void put_pid_ns(struct pid_namespace *ns) |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index 52a9be41250d..e2eff9079fe9 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
| @@ -59,4 +59,8 @@ | |||
| 59 | # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ | 59 | # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ |
| 60 | # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ | 60 | # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ |
| 61 | 61 | ||
| 62 | /* Get/set process seccomp mode */ | ||
| 63 | #define PR_GET_SECCOMP 21 | ||
| 64 | #define PR_SET_SECCOMP 22 | ||
| 65 | |||
| 62 | #endif /* _LINUX_PRCTL_H */ | 66 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h index fc86f274147f..1adfe668d031 100644 --- a/include/linux/prefetch.h +++ b/include/linux/prefetch.h | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | prefetch(x) - prefetches the cacheline at "x" for read | 28 | prefetch(x) - prefetches the cacheline at "x" for read |
| 29 | prefetchw(x) - prefetches the cacheline at "x" for write | 29 | prefetchw(x) - prefetches the cacheline at "x" for write |
| 30 | spin_lock_prefetch(x) - prefectches the spinlock *x for taking | 30 | spin_lock_prefetch(x) - prefetches the spinlock *x for taking |
| 31 | 31 | ||
| 32 | there is also PREFETCH_STRIDE which is the architecure-prefered | 32 | there is also PREFETCH_STRIDE which is the architecure-prefered |
| 33 | "lookahead" size for prefetching streamed operations. | 33 | "lookahead" size for prefetching streamed operations. |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 3469f96bc8b2..28e3664fdf1b 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include <linux/magic.h> | 7 | #include <linux/magic.h> |
| 8 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
| 9 | 9 | ||
| 10 | struct completion; | ||
| 11 | |||
| 10 | /* | 12 | /* |
| 11 | * The proc filesystem constants/structures | 13 | * The proc filesystem constants/structures |
| 12 | */ | 14 | */ |
| @@ -56,6 +58,14 @@ struct proc_dir_entry { | |||
| 56 | gid_t gid; | 58 | gid_t gid; |
| 57 | loff_t size; | 59 | loff_t size; |
| 58 | const struct inode_operations *proc_iops; | 60 | const struct inode_operations *proc_iops; |
| 61 | /* | ||
| 62 | * NULL ->proc_fops means "PDE is going away RSN" or | ||
| 63 | * "PDE is just created". In either case, e.g. ->read_proc won't be | ||
| 64 | * called because it's too late or too early, respectively. | ||
| 65 | * | ||
| 66 | * If you're allocating ->proc_fops dynamically, save a pointer | ||
| 67 | * somewhere. | ||
| 68 | */ | ||
| 59 | const struct file_operations *proc_fops; | 69 | const struct file_operations *proc_fops; |
| 60 | get_info_t *get_info; | 70 | get_info_t *get_info; |
| 61 | struct module *owner; | 71 | struct module *owner; |
| @@ -66,6 +76,9 @@ struct proc_dir_entry { | |||
| 66 | atomic_t count; /* use count */ | 76 | atomic_t count; /* use count */ |
| 67 | int deleted; /* delete flag */ | 77 | int deleted; /* delete flag */ |
| 68 | void *set; | 78 | void *set; |
| 79 | int pde_users; /* number of callers into module in progress */ | ||
| 80 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | ||
| 81 | struct completion *pde_unload_completion; | ||
| 69 | }; | 82 | }; |
| 70 | 83 | ||
| 71 | struct kcore_list { | 84 | struct kcore_list { |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index eeb1976ef7bf..ae8146abd746 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
| @@ -110,6 +110,8 @@ static inline void ptrace_unlink(struct task_struct *child) | |||
| 110 | __ptrace_unlink(child); | 110 | __ptrace_unlink(child); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data); | ||
| 114 | int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data); | ||
| 113 | 115 | ||
| 114 | #ifndef force_successful_syscall_return | 116 | #ifndef force_successful_syscall_return |
| 115 | /* | 117 | /* |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index dd5a05d03d4f..75e17a05540e 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
| @@ -262,7 +262,7 @@ int bitmap_active(struct bitmap *bitmap); | |||
| 262 | 262 | ||
| 263 | char *file_path(struct file *file, char *buf, int count); | 263 | char *file_path(struct file *file, char *buf, int count); |
| 264 | void bitmap_print_sb(struct bitmap *bitmap); | 264 | void bitmap_print_sb(struct bitmap *bitmap); |
| 265 | int bitmap_update_sb(struct bitmap *bitmap); | 265 | void bitmap_update_sb(struct bitmap *bitmap); |
| 266 | 266 | ||
| 267 | int bitmap_setallbits(struct bitmap *bitmap); | 267 | int bitmap_setallbits(struct bitmap *bitmap); |
| 268 | void bitmap_write_all(struct bitmap *bitmap); | 268 | void bitmap_write_all(struct bitmap *bitmap); |
| @@ -278,8 +278,8 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int d | |||
| 278 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | 278 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); |
| 279 | void bitmap_close_sync(struct bitmap *bitmap); | 279 | void bitmap_close_sync(struct bitmap *bitmap); |
| 280 | 280 | ||
| 281 | int bitmap_unplug(struct bitmap *bitmap); | 281 | void bitmap_unplug(struct bitmap *bitmap); |
| 282 | int bitmap_daemon_work(struct bitmap *bitmap); | 282 | void bitmap_daemon_work(struct bitmap *bitmap); |
| 283 | #endif | 283 | #endif |
| 284 | 284 | ||
| 285 | #endif | 285 | #endif |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index de72c49747c8..28ac632b42dd 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
| @@ -51,7 +51,7 @@ struct mdk_rdev_s | |||
| 51 | 51 | ||
| 52 | sector_t size; /* Device size (in blocks) */ | 52 | sector_t size; /* Device size (in blocks) */ |
| 53 | mddev_t *mddev; /* RAID array if running */ | 53 | mddev_t *mddev; /* RAID array if running */ |
| 54 | unsigned long last_events; /* IO event timestamp */ | 54 | long last_events; /* IO event timestamp */ |
| 55 | 55 | ||
| 56 | struct block_device *bdev; /* block device handle */ | 56 | struct block_device *bdev; /* block device handle */ |
| 57 | 57 | ||
diff --git a/include/linux/rtc/m48t59.h b/include/linux/rtc/m48t59.h new file mode 100644 index 000000000000..e8c7c21ceb1f --- /dev/null +++ b/include/linux/rtc/m48t59.h | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/rtc/m48t59.h | ||
| 3 | * | ||
| 4 | * Definitions for the platform data of m48t59 RTC chip driver. | ||
| 5 | * | ||
| 6 | * Copyright (c) 2007 Wind River Systems, Inc. | ||
| 7 | * | ||
| 8 | * Mark Zhan <rongkai.zhan@windriver.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 version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LINUX_RTC_M48T59_H_ | ||
| 16 | #define _LINUX_RTC_M48T59_H_ | ||
| 17 | |||
| 18 | /* | ||
| 19 | * M48T59 Register Offset | ||
| 20 | */ | ||
| 21 | #define M48T59_YEAR 0x1fff | ||
| 22 | #define M48T59_MONTH 0x1ffe | ||
| 23 | #define M48T59_MDAY 0x1ffd /* Day of Month */ | ||
| 24 | #define M48T59_WDAY 0x1ffc /* Day of Week */ | ||
| 25 | #define M48T59_WDAY_CB 0x20 /* Century Bit */ | ||
| 26 | #define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */ | ||
| 27 | #define M48T59_HOUR 0x1ffb | ||
| 28 | #define M48T59_MIN 0x1ffa | ||
| 29 | #define M48T59_SEC 0x1ff9 | ||
| 30 | #define M48T59_CNTL 0x1ff8 | ||
| 31 | #define M48T59_CNTL_READ 0x40 | ||
| 32 | #define M48T59_CNTL_WRITE 0x80 | ||
| 33 | #define M48T59_WATCHDOG 0x1ff7 | ||
| 34 | #define M48T59_INTR 0x1ff6 | ||
| 35 | #define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */ | ||
| 36 | #define M48T59_INTR_ABE 0x20 | ||
| 37 | #define M48T59_ALARM_DATE 0x1ff5 | ||
| 38 | #define M48T59_ALARM_HOUR 0x1ff4 | ||
| 39 | #define M48T59_ALARM_MIN 0x1ff3 | ||
| 40 | #define M48T59_ALARM_SEC 0x1ff2 | ||
| 41 | #define M48T59_UNUSED 0x1ff1 | ||
| 42 | #define M48T59_FLAGS 0x1ff0 | ||
| 43 | #define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */ | ||
| 44 | #define M48T59_FLAGS_AF 0x40 /* alarm */ | ||
| 45 | #define M48T59_FLAGS_BF 0x10 /* low battery */ | ||
| 46 | |||
| 47 | #define M48T59_NVRAM_SIZE 0x1ff0 | ||
| 48 | |||
| 49 | struct m48t59_plat_data { | ||
| 50 | /* The method to access M48T59 registers, | ||
| 51 | * NOTE: The 'ofs' should be 0x00~0x1fff | ||
| 52 | */ | ||
| 53 | void (*write_byte)(struct device *dev, u32 ofs, u8 val); | ||
| 54 | unsigned char (*read_byte)(struct device *dev, u32 ofs); | ||
| 55 | }; | ||
| 56 | |||
| 57 | #endif /* _LINUX_RTC_M48T59_H_ */ | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index cfb680585ab8..731edaca8ffd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | 26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ |
| 27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ | 27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ |
| 28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ | 28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ |
| 29 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * Scheduling policies | 32 | * Scheduling policies |
| @@ -287,6 +288,7 @@ extern signed long schedule_timeout_uninterruptible(signed long timeout); | |||
| 287 | asmlinkage void schedule(void); | 288 | asmlinkage void schedule(void); |
| 288 | 289 | ||
| 289 | struct nsproxy; | 290 | struct nsproxy; |
| 291 | struct user_namespace; | ||
| 290 | 292 | ||
| 291 | /* Maximum number of active map areas.. This is a random (large) number */ | 293 | /* Maximum number of active map areas.. This is a random (large) number */ |
| 292 | #define DEFAULT_MAX_MAP_COUNT 65536 | 294 | #define DEFAULT_MAX_MAP_COUNT 65536 |
| @@ -529,6 +531,10 @@ struct signal_struct { | |||
| 529 | #ifdef CONFIG_TASKSTATS | 531 | #ifdef CONFIG_TASKSTATS |
| 530 | struct taskstats *stats; | 532 | struct taskstats *stats; |
| 531 | #endif | 533 | #endif |
| 534 | #ifdef CONFIG_AUDIT | ||
| 535 | unsigned audit_tty; | ||
| 536 | struct tty_audit_buf *tty_audit_buf; | ||
| 537 | #endif | ||
| 532 | }; | 538 | }; |
| 533 | 539 | ||
| 534 | /* Context switch must be unlocked if interrupts are to be enabled */ | 540 | /* Context switch must be unlocked if interrupts are to be enabled */ |
| @@ -972,7 +978,8 @@ struct task_struct { | |||
| 972 | unsigned int rt_priority; | 978 | unsigned int rt_priority; |
| 973 | cputime_t utime, stime; | 979 | cputime_t utime, stime; |
| 974 | unsigned long nvcsw, nivcsw; /* context switch counts */ | 980 | unsigned long nvcsw, nivcsw; /* context switch counts */ |
| 975 | struct timespec start_time; | 981 | struct timespec start_time; /* monotonic time */ |
| 982 | struct timespec real_start_time; /* boot based time */ | ||
| 976 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ | 983 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ |
| 977 | unsigned long min_flt, maj_flt; | 984 | unsigned long min_flt, maj_flt; |
| 978 | 985 | ||
| @@ -1403,7 +1410,7 @@ extern struct task_struct *find_task_by_pid_type(int type, int pid); | |||
| 1403 | extern void __set_special_pids(pid_t session, pid_t pgrp); | 1410 | extern void __set_special_pids(pid_t session, pid_t pgrp); |
| 1404 | 1411 | ||
| 1405 | /* per-UID process charging. */ | 1412 | /* per-UID process charging. */ |
| 1406 | extern struct user_struct * alloc_uid(uid_t); | 1413 | extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); |
| 1407 | static inline struct user_struct *get_uid(struct user_struct *u) | 1414 | static inline struct user_struct *get_uid(struct user_struct *u) |
| 1408 | { | 1415 | { |
| 1409 | atomic_inc(&u->__count); | 1416 | atomic_inc(&u->__count); |
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h index 1a82d30c4b17..d2b058130eb1 100644 --- a/include/linux/scx200_gpio.h +++ b/include/linux/scx200_gpio.h | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | #include <linux/spinlock.h> | ||
| 2 | |||
| 3 | u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); | 1 | u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); |
| 4 | 2 | ||
| 5 | extern unsigned scx200_gpio_base; | 3 | extern unsigned scx200_gpio_base; |
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index 3e8b1cf54303..262a8dccfa81 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #ifdef CONFIG_SECCOMP | 5 | #ifdef CONFIG_SECCOMP |
| 6 | 6 | ||
| 7 | #define NR_SECCOMP_MODES 1 | ||
| 8 | |||
| 9 | #include <linux/thread_info.h> | 7 | #include <linux/thread_info.h> |
| 10 | #include <asm/seccomp.h> | 8 | #include <asm/seccomp.h> |
| 11 | 9 | ||
| @@ -18,20 +16,23 @@ static inline void secure_computing(int this_syscall) | |||
| 18 | __secure_computing(this_syscall); | 16 | __secure_computing(this_syscall); |
| 19 | } | 17 | } |
| 20 | 18 | ||
| 21 | static inline int has_secure_computing(struct thread_info *ti) | 19 | extern long prctl_get_seccomp(void); |
| 22 | { | 20 | extern long prctl_set_seccomp(unsigned long); |
| 23 | return unlikely(test_ti_thread_flag(ti, TIF_SECCOMP)); | ||
| 24 | } | ||
| 25 | 21 | ||
| 26 | #else /* CONFIG_SECCOMP */ | 22 | #else /* CONFIG_SECCOMP */ |
| 27 | 23 | ||
| 28 | typedef struct { } seccomp_t; | 24 | typedef struct { } seccomp_t; |
| 29 | 25 | ||
| 30 | #define secure_computing(x) do { } while (0) | 26 | #define secure_computing(x) do { } while (0) |
| 31 | /* static inline to preserve typechecking */ | 27 | |
| 32 | static inline int has_secure_computing(struct thread_info *ti) | 28 | static inline long prctl_get_seccomp(void) |
| 29 | { | ||
| 30 | return -EINVAL; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline long prctl_set_seccomp(unsigned long arg2) | ||
| 33 | { | 34 | { |
| 34 | return 0; | 35 | return -EINVAL; |
| 35 | } | 36 | } |
| 36 | 37 | ||
| 37 | #endif /* CONFIG_SECCOMP */ | 38 | #endif /* CONFIG_SECCOMP */ |
diff --git a/include/linux/serial.h b/include/linux/serial.h index 33fc8cb8ddfb..deb714314fb1 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
| @@ -177,11 +177,5 @@ struct serial_icounter_struct { | |||
| 177 | #ifdef __KERNEL__ | 177 | #ifdef __KERNEL__ |
| 178 | #include <linux/compiler.h> | 178 | #include <linux/compiler.h> |
| 179 | 179 | ||
| 180 | /* Allow architectures to override entries in serial8250_ports[] at run time: */ | ||
| 181 | struct uart_port; /* forward declaration */ | ||
| 182 | extern int early_serial_setup(struct uart_port *port); | ||
| 183 | extern int early_serial_console_init(char *options); | ||
| 184 | extern int serial8250_start_console(struct uart_port *port, char *options); | ||
| 185 | |||
| 186 | #endif /* __KERNEL__ */ | 180 | #endif /* __KERNEL__ */ |
| 187 | #endif /* _LINUX_SERIAL_H */ | 181 | #endif /* _LINUX_SERIAL_H */ |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 71310d80c09a..706ee9a4c80c 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
| @@ -60,4 +60,8 @@ void serial8250_unregister_port(int line); | |||
| 60 | void serial8250_suspend_port(int line); | 60 | void serial8250_suspend_port(int line); |
| 61 | void serial8250_resume_port(int line); | 61 | void serial8250_resume_port(int line); |
| 62 | 62 | ||
| 63 | extern int serial8250_find_port(struct uart_port *p); | ||
| 64 | extern int serial8250_find_port_for_earlycon(void); | ||
| 65 | extern int setup_early_serial8250_console(char *cmdline); | ||
| 66 | |||
| 63 | #endif | 67 | #endif |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 7f2c99d66e9d..9c721cd2c9d6 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -142,6 +142,9 @@ | |||
| 142 | /* Micrel KS8695 */ | 142 | /* Micrel KS8695 */ |
| 143 | #define PORT_KS8695 76 | 143 | #define PORT_KS8695 76 |
| 144 | 144 | ||
| 145 | /* Broadcom SB1250, etc. SOC */ | ||
| 146 | #define PORT_SB1250_DUART 77 | ||
| 147 | |||
| 145 | 148 | ||
| 146 | #ifdef __KERNEL__ | 149 | #ifdef __KERNEL__ |
| 147 | 150 | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index 9a5eac508e5e..ea91abe740da 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
| 8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
| 9 | #include <linux/spinlock.h> | ||
| 10 | 9 | ||
| 11 | /* | 10 | /* |
| 12 | * Real Time signals may be queued. | 11 | * Real Time signals may be queued. |
diff --git a/include/linux/slab.h b/include/linux/slab.h index cebcd3833c76..0e1d0daef6a2 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -14,8 +14,6 @@ | |||
| 14 | #include <linux/gfp.h> | 14 | #include <linux/gfp.h> |
| 15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 16 | 16 | ||
| 17 | typedef struct kmem_cache kmem_cache_t __deprecated; | ||
| 18 | |||
| 19 | /* | 17 | /* |
| 20 | * Flags to pass to kmem_cache_create(). | 18 | * Flags to pass to kmem_cache_create(). |
| 21 | * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. | 19 | * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. |
| @@ -33,6 +31,19 @@ typedef struct kmem_cache kmem_cache_t __deprecated; | |||
| 33 | #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ | 31 | #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ |
| 34 | 32 | ||
| 35 | /* | 33 | /* |
| 34 | * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. | ||
| 35 | * | ||
| 36 | * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault. | ||
| 37 | * | ||
| 38 | * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can. | ||
| 39 | * Both make kfree a no-op. | ||
| 40 | */ | ||
| 41 | #define ZERO_SIZE_PTR ((void *)16) | ||
| 42 | |||
| 43 | #define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) < \ | ||
| 44 | (unsigned long)ZERO_SIZE_PTR) | ||
| 45 | |||
| 46 | /* | ||
| 36 | * struct kmem_cache related prototypes | 47 | * struct kmem_cache related prototypes |
| 37 | */ | 48 | */ |
| 38 | void __init kmem_cache_init(void); | 49 | void __init kmem_cache_init(void); |
| @@ -44,8 +55,6 @@ struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, | |||
| 44 | void (*)(void *, struct kmem_cache *, unsigned long)); | 55 | void (*)(void *, struct kmem_cache *, unsigned long)); |
| 45 | void kmem_cache_destroy(struct kmem_cache *); | 56 | void kmem_cache_destroy(struct kmem_cache *); |
| 46 | int kmem_cache_shrink(struct kmem_cache *); | 57 | int kmem_cache_shrink(struct kmem_cache *); |
| 47 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | ||
| 48 | void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | ||
| 49 | void kmem_cache_free(struct kmem_cache *, void *); | 58 | void kmem_cache_free(struct kmem_cache *, void *); |
| 50 | unsigned int kmem_cache_size(struct kmem_cache *); | 59 | unsigned int kmem_cache_size(struct kmem_cache *); |
| 51 | const char *kmem_cache_name(struct kmem_cache *); | 60 | const char *kmem_cache_name(struct kmem_cache *); |
| @@ -63,16 +72,6 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); | |||
| 63 | sizeof(struct __struct), __alignof__(struct __struct),\ | 72 | sizeof(struct __struct), __alignof__(struct __struct),\ |
| 64 | (__flags), NULL, NULL) | 73 | (__flags), NULL, NULL) |
| 65 | 74 | ||
| 66 | #ifdef CONFIG_NUMA | ||
| 67 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
| 68 | #else | ||
| 69 | static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | ||
| 70 | gfp_t flags, int node) | ||
| 71 | { | ||
| 72 | return kmem_cache_alloc(cachep, flags); | ||
| 73 | } | ||
| 74 | #endif | ||
| 75 | |||
| 76 | /* | 75 | /* |
| 77 | * The largest kmalloc size supported by the slab allocators is | 76 | * The largest kmalloc size supported by the slab allocators is |
| 78 | * 32 megabyte (2^25) or the maximum allocatable page order if that is | 77 | * 32 megabyte (2^25) or the maximum allocatable page order if that is |
| @@ -91,59 +90,50 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | |||
| 91 | /* | 90 | /* |
| 92 | * Common kmalloc functions provided by all allocators | 91 | * Common kmalloc functions provided by all allocators |
| 93 | */ | 92 | */ |
| 94 | void *__kmalloc(size_t, gfp_t); | ||
| 95 | void *__kzalloc(size_t, gfp_t); | ||
| 96 | void * __must_check krealloc(const void *, size_t, gfp_t); | 93 | void * __must_check krealloc(const void *, size_t, gfp_t); |
| 97 | void kfree(const void *); | 94 | void kfree(const void *); |
| 98 | size_t ksize(const void *); | 95 | size_t ksize(const void *); |
| 99 | 96 | ||
| 100 | /** | ||
| 101 | * kcalloc - allocate memory for an array. The memory is set to zero. | ||
| 102 | * @n: number of elements. | ||
| 103 | * @size: element size. | ||
| 104 | * @flags: the type of memory to allocate. | ||
| 105 | */ | ||
| 106 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | ||
| 107 | { | ||
| 108 | if (n != 0 && size > ULONG_MAX / n) | ||
| 109 | return NULL; | ||
| 110 | return __kzalloc(n * size, flags); | ||
| 111 | } | ||
| 112 | |||
| 113 | /* | 97 | /* |
| 114 | * Allocator specific definitions. These are mainly used to establish optimized | 98 | * Allocator specific definitions. These are mainly used to establish optimized |
| 115 | * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by selecting | 99 | * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by |
| 116 | * the appropriate general cache at compile time. | 100 | * selecting the appropriate general cache at compile time. |
| 101 | * | ||
| 102 | * Allocators must define at least: | ||
| 103 | * | ||
| 104 | * kmem_cache_alloc() | ||
| 105 | * __kmalloc() | ||
| 106 | * kmalloc() | ||
| 107 | * | ||
| 108 | * Those wishing to support NUMA must also define: | ||
| 109 | * | ||
| 110 | * kmem_cache_alloc_node() | ||
| 111 | * kmalloc_node() | ||
| 112 | * | ||
| 113 | * See each allocator definition file for additional comments and | ||
| 114 | * implementation notes. | ||
| 117 | */ | 115 | */ |
| 118 | |||
| 119 | #if defined(CONFIG_SLAB) || defined(CONFIG_SLUB) | ||
| 120 | #ifdef CONFIG_SLUB | 116 | #ifdef CONFIG_SLUB |
| 121 | #include <linux/slub_def.h> | 117 | #include <linux/slub_def.h> |
| 118 | #elif defined(CONFIG_SLOB) | ||
| 119 | #include <linux/slob_def.h> | ||
| 122 | #else | 120 | #else |
| 123 | #include <linux/slab_def.h> | 121 | #include <linux/slab_def.h> |
| 124 | #endif /* !CONFIG_SLUB */ | 122 | #endif |
| 125 | #else | ||
| 126 | |||
| 127 | /* | ||
| 128 | * Fallback definitions for an allocator not wanting to provide | ||
| 129 | * its own optimized kmalloc definitions (like SLOB). | ||
| 130 | */ | ||
| 131 | 123 | ||
| 132 | /** | 124 | /** |
| 133 | * kmalloc - allocate memory | 125 | * kcalloc - allocate memory for an array. The memory is set to zero. |
| 134 | * @size: how many bytes of memory are required. | 126 | * @n: number of elements. |
| 127 | * @size: element size. | ||
| 135 | * @flags: the type of memory to allocate. | 128 | * @flags: the type of memory to allocate. |
| 136 | * | 129 | * |
| 137 | * kmalloc is the normal method of allocating memory | ||
| 138 | * in the kernel. | ||
| 139 | * | ||
| 140 | * The @flags argument may be one of: | 130 | * The @flags argument may be one of: |
| 141 | * | 131 | * |
| 142 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | 132 | * %GFP_USER - Allocate memory on behalf of user. May sleep. |
| 143 | * | 133 | * |
| 144 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | 134 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. |
| 145 | * | 135 | * |
| 146 | * %GFP_ATOMIC - Allocation will not sleep. | 136 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. |
| 147 | * For example, use this inside interrupt handlers. | 137 | * For example, use this inside interrupt handlers. |
| 148 | * | 138 | * |
| 149 | * %GFP_HIGHUSER - Allocate pages from high memory. | 139 | * %GFP_HIGHUSER - Allocate pages from high memory. |
| @@ -152,18 +142,22 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
| 152 | * | 142 | * |
| 153 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | 143 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. |
| 154 | * | 144 | * |
| 145 | * %GFP_NOWAIT - Allocation will not sleep. | ||
| 146 | * | ||
| 147 | * %GFP_THISNODE - Allocate node-local memory only. | ||
| 148 | * | ||
| 149 | * %GFP_DMA - Allocation suitable for DMA. | ||
| 150 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
| 151 | * slab created with SLAB_DMA. | ||
| 152 | * | ||
| 155 | * Also it is possible to set different flags by OR'ing | 153 | * Also it is possible to set different flags by OR'ing |
| 156 | * in one or more of the following additional @flags: | 154 | * in one or more of the following additional @flags: |
| 157 | * | 155 | * |
| 158 | * %__GFP_COLD - Request cache-cold pages instead of | 156 | * %__GFP_COLD - Request cache-cold pages instead of |
| 159 | * trying to return cache-warm pages. | 157 | * trying to return cache-warm pages. |
| 160 | * | 158 | * |
| 161 | * %__GFP_DMA - Request memory from the DMA-capable zone. | ||
| 162 | * | ||
| 163 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | 159 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. |
| 164 | * | 160 | * |
| 165 | * %__GFP_HIGHMEM - Allocated memory may be from highmem. | ||
| 166 | * | ||
| 167 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | 161 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail |
| 168 | * (think twice before using). | 162 | * (think twice before using). |
| 169 | * | 163 | * |
| @@ -173,24 +167,29 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
| 173 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | 167 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. |
| 174 | * | 168 | * |
| 175 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | 169 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. |
| 170 | * | ||
| 171 | * There are other flags available as well, but these are not intended | ||
| 172 | * for general use, and so are not documented here. For a full list of | ||
| 173 | * potential flags, always refer to linux/gfp.h. | ||
| 176 | */ | 174 | */ |
| 177 | static inline void *kmalloc(size_t size, gfp_t flags) | 175 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
| 178 | { | 176 | { |
| 179 | return __kmalloc(size, flags); | 177 | if (n != 0 && size > ULONG_MAX / n) |
| 178 | return NULL; | ||
| 179 | return __kmalloc(n * size, flags | __GFP_ZERO); | ||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | #if !defined(CONFIG_NUMA) && !defined(CONFIG_SLOB) | ||
| 182 | /** | 183 | /** |
| 183 | * kzalloc - allocate memory. The memory is set to zero. | 184 | * kmalloc_node - allocate memory from a specific node |
| 184 | * @size: how many bytes of memory are required. | 185 | * @size: how many bytes of memory are required. |
| 185 | * @flags: the type of memory to allocate (see kmalloc). | 186 | * @flags: the type of memory to allocate (see kcalloc). |
| 187 | * @node: node to allocate from. | ||
| 188 | * | ||
| 189 | * kmalloc() for non-local nodes, used to allocate from a specific node | ||
| 190 | * if available. Equivalent to kmalloc() in the non-NUMA single-node | ||
| 191 | * case. | ||
| 186 | */ | 192 | */ |
| 187 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
| 188 | { | ||
| 189 | return __kzalloc(size, flags); | ||
| 190 | } | ||
| 191 | #endif | ||
| 192 | |||
| 193 | #ifndef CONFIG_NUMA | ||
| 194 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 193 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
| 195 | { | 194 | { |
| 196 | return kmalloc(size, flags); | 195 | return kmalloc(size, flags); |
| @@ -200,7 +199,15 @@ static inline void *__kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 200 | { | 199 | { |
| 201 | return __kmalloc(size, flags); | 200 | return __kmalloc(size, flags); |
| 202 | } | 201 | } |
| 203 | #endif /* !CONFIG_NUMA */ | 202 | |
| 203 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | ||
| 204 | |||
| 205 | static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | ||
| 206 | gfp_t flags, int node) | ||
| 207 | { | ||
| 208 | return kmem_cache_alloc(cachep, flags); | ||
| 209 | } | ||
| 210 | #endif /* !CONFIG_NUMA && !CONFIG_SLOB */ | ||
| 204 | 211 | ||
| 205 | /* | 212 | /* |
| 206 | * kmalloc_track_caller is a special version of kmalloc that records the | 213 | * kmalloc_track_caller is a special version of kmalloc that records the |
| @@ -245,6 +252,23 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); | |||
| 245 | 252 | ||
| 246 | #endif /* DEBUG_SLAB */ | 253 | #endif /* DEBUG_SLAB */ |
| 247 | 254 | ||
| 255 | /* | ||
| 256 | * Shortcuts | ||
| 257 | */ | ||
| 258 | static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags) | ||
| 259 | { | ||
| 260 | return kmem_cache_alloc(k, flags | __GFP_ZERO); | ||
| 261 | } | ||
| 262 | |||
| 263 | /** | ||
| 264 | * kzalloc - allocate memory. The memory is set to zero. | ||
| 265 | * @size: how many bytes of memory are required. | ||
| 266 | * @flags: the type of memory to allocate (see kmalloc). | ||
| 267 | */ | ||
| 268 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
| 269 | { | ||
| 270 | return kmalloc(size, flags | __GFP_ZERO); | ||
| 271 | } | ||
| 272 | |||
| 248 | #endif /* __KERNEL__ */ | 273 | #endif /* __KERNEL__ */ |
| 249 | #endif /* _LINUX_SLAB_H */ | 274 | #endif /* _LINUX_SLAB_H */ |
| 250 | |||
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 8d81a60518e4..32bdc2ffd715 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -25,10 +25,17 @@ struct cache_sizes { | |||
| 25 | }; | 25 | }; |
| 26 | extern struct cache_sizes malloc_sizes[]; | 26 | extern struct cache_sizes malloc_sizes[]; |
| 27 | 27 | ||
| 28 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | ||
| 29 | void *__kmalloc(size_t size, gfp_t flags); | ||
| 30 | |||
| 28 | static inline void *kmalloc(size_t size, gfp_t flags) | 31 | static inline void *kmalloc(size_t size, gfp_t flags) |
| 29 | { | 32 | { |
| 30 | if (__builtin_constant_p(size)) { | 33 | if (__builtin_constant_p(size)) { |
| 31 | int i = 0; | 34 | int i = 0; |
| 35 | |||
| 36 | if (!size) | ||
| 37 | return ZERO_SIZE_PTR; | ||
| 38 | |||
| 32 | #define CACHE(x) \ | 39 | #define CACHE(x) \ |
| 33 | if (size <= x) \ | 40 | if (size <= x) \ |
| 34 | goto found; \ | 41 | goto found; \ |
| @@ -51,39 +58,18 @@ found: | |||
| 51 | return __kmalloc(size, flags); | 58 | return __kmalloc(size, flags); |
| 52 | } | 59 | } |
| 53 | 60 | ||
| 54 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
| 55 | { | ||
| 56 | if (__builtin_constant_p(size)) { | ||
| 57 | int i = 0; | ||
| 58 | #define CACHE(x) \ | ||
| 59 | if (size <= x) \ | ||
| 60 | goto found; \ | ||
| 61 | else \ | ||
| 62 | i++; | ||
| 63 | #include "kmalloc_sizes.h" | ||
| 64 | #undef CACHE | ||
| 65 | { | ||
| 66 | extern void __you_cannot_kzalloc_that_much(void); | ||
| 67 | __you_cannot_kzalloc_that_much(); | ||
| 68 | } | ||
| 69 | found: | ||
| 70 | #ifdef CONFIG_ZONE_DMA | ||
| 71 | if (flags & GFP_DMA) | ||
| 72 | return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep, | ||
| 73 | flags); | ||
| 74 | #endif | ||
| 75 | return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags); | ||
| 76 | } | ||
| 77 | return __kzalloc(size, flags); | ||
| 78 | } | ||
| 79 | |||
| 80 | #ifdef CONFIG_NUMA | 61 | #ifdef CONFIG_NUMA |
| 81 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | 62 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 63 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
| 82 | 64 | ||
| 83 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 65 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
| 84 | { | 66 | { |
| 85 | if (__builtin_constant_p(size)) { | 67 | if (__builtin_constant_p(size)) { |
| 86 | int i = 0; | 68 | int i = 0; |
| 69 | |||
| 70 | if (!size) | ||
| 71 | return ZERO_SIZE_PTR; | ||
| 72 | |||
| 87 | #define CACHE(x) \ | 73 | #define CACHE(x) \ |
| 88 | if (size <= x) \ | 74 | if (size <= x) \ |
| 89 | goto found; \ | 75 | goto found; \ |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h new file mode 100644 index 000000000000..a2daf2d418a9 --- /dev/null +++ b/include/linux/slob_def.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | #ifndef __LINUX_SLOB_DEF_H | ||
| 2 | #define __LINUX_SLOB_DEF_H | ||
| 3 | |||
| 4 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
| 5 | |||
| 6 | static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) | ||
| 7 | { | ||
| 8 | return kmem_cache_alloc_node(cachep, flags, -1); | ||
| 9 | } | ||
| 10 | |||
| 11 | void *__kmalloc_node(size_t size, gfp_t flags, int node); | ||
| 12 | |||
| 13 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | ||
| 14 | { | ||
| 15 | return __kmalloc_node(size, flags, node); | ||
| 16 | } | ||
| 17 | |||
| 18 | /** | ||
| 19 | * kmalloc - allocate memory | ||
| 20 | * @size: how many bytes of memory are required. | ||
| 21 | * @flags: the type of memory to allocate (see kcalloc). | ||
| 22 | * | ||
| 23 | * kmalloc is the normal method of allocating memory | ||
| 24 | * in the kernel. | ||
| 25 | */ | ||
| 26 | static inline void *kmalloc(size_t size, gfp_t flags) | ||
| 27 | { | ||
| 28 | return __kmalloc_node(size, flags, -1); | ||
| 29 | } | ||
| 30 | |||
| 31 | static inline void *__kmalloc(size_t size, gfp_t flags) | ||
| 32 | { | ||
| 33 | return kmalloc(size, flags); | ||
| 34 | } | ||
| 35 | |||
| 36 | /** | ||
| 37 | * kzalloc - allocate memory. The memory is set to zero. | ||
| 38 | * @size: how many bytes of memory are required. | ||
| 39 | * @flags: the type of memory to allocate (see kcalloc). | ||
| 40 | */ | ||
| 41 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
| 42 | { | ||
| 43 | return __kzalloc(size, flags); | ||
| 44 | } | ||
| 45 | |||
| 46 | #endif /* __LINUX_SLOB_DEF_H */ | ||
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 6207a3d8da71..07f7e4cbcee3 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -16,7 +16,9 @@ struct kmem_cache_node { | |||
| 16 | unsigned long nr_partial; | 16 | unsigned long nr_partial; |
| 17 | atomic_long_t nr_slabs; | 17 | atomic_long_t nr_slabs; |
| 18 | struct list_head partial; | 18 | struct list_head partial; |
| 19 | #ifdef CONFIG_SLUB_DEBUG | ||
| 19 | struct list_head full; | 20 | struct list_head full; |
| 21 | #endif | ||
| 20 | }; | 22 | }; |
| 21 | 23 | ||
| 22 | /* | 24 | /* |
| @@ -44,7 +46,9 @@ struct kmem_cache { | |||
| 44 | int align; /* Alignment */ | 46 | int align; /* Alignment */ |
| 45 | const char *name; /* Name (only for display!) */ | 47 | const char *name; /* Name (only for display!) */ |
| 46 | struct list_head list; /* List of slab caches */ | 48 | struct list_head list; /* List of slab caches */ |
| 49 | #ifdef CONFIG_SLUB_DEBUG | ||
| 47 | struct kobject kobj; /* For sysfs */ | 50 | struct kobject kobj; /* For sysfs */ |
| 51 | #endif | ||
| 48 | 52 | ||
| 49 | #ifdef CONFIG_NUMA | 53 | #ifdef CONFIG_NUMA |
| 50 | int defrag_ratio; | 54 | int defrag_ratio; |
| @@ -159,17 +163,8 @@ static inline struct kmem_cache *kmalloc_slab(size_t size) | |||
| 159 | #define SLUB_DMA 0 | 163 | #define SLUB_DMA 0 |
| 160 | #endif | 164 | #endif |
| 161 | 165 | ||
| 162 | 166 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | |
| 163 | /* | 167 | void *__kmalloc(size_t size, gfp_t flags); |
| 164 | * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. | ||
| 165 | * | ||
| 166 | * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault. | ||
| 167 | * | ||
| 168 | * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can. | ||
| 169 | * Both make kfree a no-op. | ||
| 170 | */ | ||
| 171 | #define ZERO_SIZE_PTR ((void *)16) | ||
| 172 | |||
| 173 | 168 | ||
| 174 | static inline void *kmalloc(size_t size, gfp_t flags) | 169 | static inline void *kmalloc(size_t size, gfp_t flags) |
| 175 | { | 170 | { |
| @@ -184,21 +179,9 @@ static inline void *kmalloc(size_t size, gfp_t flags) | |||
| 184 | return __kmalloc(size, flags); | 179 | return __kmalloc(size, flags); |
| 185 | } | 180 | } |
| 186 | 181 | ||
| 187 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
| 188 | { | ||
| 189 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | ||
| 190 | struct kmem_cache *s = kmalloc_slab(size); | ||
| 191 | |||
| 192 | if (!s) | ||
| 193 | return ZERO_SIZE_PTR; | ||
| 194 | |||
| 195 | return kmem_cache_zalloc(s, flags); | ||
| 196 | } else | ||
| 197 | return __kzalloc(size, flags); | ||
| 198 | } | ||
| 199 | |||
| 200 | #ifdef CONFIG_NUMA | 182 | #ifdef CONFIG_NUMA |
| 201 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | 183 | void *__kmalloc_node(size_t size, gfp_t flags, int node); |
| 184 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | ||
| 202 | 185 | ||
| 203 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 186 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
| 204 | { | 187 | { |
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index cf715a40d833..58962c51dee1 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #ifdef CONFIG_LOCK_KERNEL | 4 | #ifdef CONFIG_LOCK_KERNEL |
| 5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
| 6 | #include <linux/spinlock.h> | ||
| 7 | 6 | ||
| 8 | #define kernel_locked() (current->lock_depth >= 0) | 7 | #define kernel_locked() (current->lock_depth >= 0) |
| 9 | 8 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index fe195c97a89d..f852e1afd65a 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -253,6 +253,9 @@ struct ucred { | |||
| 253 | 253 | ||
| 254 | #define MSG_EOF MSG_FIN | 254 | #define MSG_EOF MSG_FIN |
| 255 | 255 | ||
| 256 | #define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file | ||
| 257 | descriptor received through | ||
| 258 | SCM_RIGHTS */ | ||
| 256 | #if defined(CONFIG_COMPAT) | 259 | #if defined(CONFIG_COMPAT) |
| 257 | #define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */ | 260 | #define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */ |
| 258 | #else | 261 | #else |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 34d4b075f7b8..40c7b5d993b9 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
| @@ -153,8 +153,6 @@ | |||
| 153 | #define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ | 153 | #define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ |
| 154 | #define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */ | 154 | #define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */ |
| 155 | 155 | ||
| 156 | int sonypi_camera_command(int command, u8 value); | ||
| 157 | |||
| 158 | #endif /* __KERNEL__ */ | 156 | #endif /* __KERNEL__ */ |
| 159 | 157 | ||
| 160 | #endif /* _SONYPI_H_ */ | 158 | #endif /* _SONYPI_H_ */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 1be5ea059477..302b81d1d117 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -76,6 +76,7 @@ struct spi_device { | |||
| 76 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) | 76 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) |
| 77 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ | 77 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ |
| 78 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ | 78 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ |
| 79 | #define SPI_3WIRE 0x10 /* SI/SO signals shared */ | ||
| 79 | u8 bits_per_word; | 80 | u8 bits_per_word; |
| 80 | int irq; | 81 | int irq; |
| 81 | void *controller_state; | 82 | void *controller_state; |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index 9dbca629dcfb..b8db32cea1de 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
| @@ -26,6 +26,7 @@ struct spi_bitbang { | |||
| 26 | struct list_head queue; | 26 | struct list_head queue; |
| 27 | u8 busy; | 27 | u8 busy; |
| 28 | u8 use_dma; | 28 | u8 use_dma; |
| 29 | u8 flags; /* extra spi->mode support */ | ||
| 29 | 30 | ||
| 30 | struct spi_master *master; | 31 | struct spi_master *master; |
| 31 | 32 | ||
diff --git a/include/linux/spi/tle62x0.h b/include/linux/spi/tle62x0.h new file mode 100644 index 000000000000..60b59187e590 --- /dev/null +++ b/include/linux/spi/tle62x0.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * tle62x0.h - platform glue to Infineon TLE62x0 driver chips | ||
| 3 | * | ||
| 4 | * Copyright 2007 Simtec Electronics | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program 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 General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | struct tle62x0_pdata { | ||
| 22 | unsigned int init_state; | ||
| 23 | unsigned int gpio_count; | ||
| 24 | }; | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index a946176db638..c376f3b36c89 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -282,6 +282,13 @@ do { \ | |||
| 282 | 1 : ({ local_irq_restore(flags); 0; }); \ | 282 | 1 : ({ local_irq_restore(flags); 0; }); \ |
| 283 | }) | 283 | }) |
| 284 | 284 | ||
| 285 | #define write_trylock_irqsave(lock, flags) \ | ||
| 286 | ({ \ | ||
| 287 | local_irq_save(flags); \ | ||
| 288 | write_trylock(lock) ? \ | ||
| 289 | 1 : ({ local_irq_restore(flags); 0; }); \ | ||
| 290 | }) | ||
| 291 | |||
| 285 | /* | 292 | /* |
| 286 | * Locks two spinlocks l1 and l2. | 293 | * Locks two spinlocks l1 and l2. |
| 287 | * l1_first indicates if spinlock l1 should be taken first. | 294 | * l1_first indicates if spinlock l1 should be taken first. |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index bbac101ac372..459c5fc11d51 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
| @@ -58,6 +58,7 @@ u32 gss_unwrap( | |||
| 58 | u32 gss_delete_sec_context( | 58 | u32 gss_delete_sec_context( |
| 59 | struct gss_ctx **ctx_id); | 59 | struct gss_ctx **ctx_id); |
| 60 | 60 | ||
| 61 | u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service); | ||
| 61 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); | 62 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); |
| 62 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); | 63 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); |
| 63 | 64 | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 129d50f2225c..8531a70da73d 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -212,6 +212,7 @@ struct svc_rqst { | |||
| 212 | struct svc_pool * rq_pool; /* thread pool */ | 212 | struct svc_pool * rq_pool; /* thread pool */ |
| 213 | struct svc_procedure * rq_procinfo; /* procedure info */ | 213 | struct svc_procedure * rq_procinfo; /* procedure info */ |
| 214 | struct auth_ops * rq_authop; /* authentication flavour */ | 214 | struct auth_ops * rq_authop; /* authentication flavour */ |
| 215 | u32 rq_flavor; /* pseudoflavor */ | ||
| 215 | struct svc_cred rq_cred; /* auth info */ | 216 | struct svc_cred rq_cred; /* auth info */ |
| 216 | struct sk_buff * rq_skbuff; /* fast recv inet buffer */ | 217 | struct sk_buff * rq_skbuff; /* fast recv inet buffer */ |
| 217 | struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ | 218 | struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ |
| @@ -248,6 +249,7 @@ struct svc_rqst { | |||
| 248 | */ | 249 | */ |
| 249 | /* Catering to nfsd */ | 250 | /* Catering to nfsd */ |
| 250 | struct auth_domain * rq_client; /* RPC peer info */ | 251 | struct auth_domain * rq_client; /* RPC peer info */ |
| 252 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | ||
| 251 | struct svc_cacherep * rq_cacherep; /* cache info */ | 253 | struct svc_cacherep * rq_cacherep; /* cache info */ |
| 252 | struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to | 254 | struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to |
| 253 | * determine what device number | 255 | * determine what device number |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index de92619b0826..22e1ef8e200e 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
| @@ -127,6 +127,7 @@ extern struct auth_domain *auth_unix_lookup(struct in_addr addr); | |||
| 127 | extern int auth_unix_forget_old(struct auth_domain *dom); | 127 | extern int auth_unix_forget_old(struct auth_domain *dom); |
| 128 | extern void svcauth_unix_purge(void); | 128 | extern void svcauth_unix_purge(void); |
| 129 | extern void svcauth_unix_info_release(void *); | 129 | extern void svcauth_unix_info_release(void *); |
| 130 | extern int svcauth_unix_set_client(struct svc_rqst *rqstp); | ||
| 130 | 131 | ||
| 131 | static inline unsigned long hash_str(char *name, int bits) | 132 | static inline unsigned long hash_str(char *name, int bits) |
| 132 | { | 133 | { |
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h index 5a5db16ab660..417a1def56db 100644 --- a/include/linux/sunrpc/svcauth_gss.h +++ b/include/linux/sunrpc/svcauth_gss.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | int gss_svc_init(void); | 22 | int gss_svc_init(void); |
| 23 | void gss_svc_shutdown(void); | 23 | void gss_svc_shutdown(void); |
| 24 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); | 24 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); |
| 25 | u32 svcauth_gss_flavor(struct auth_domain *dom); | ||
| 25 | 26 | ||
| 26 | #endif /* __KERNEL__ */ | 27 | #endif /* __KERNEL__ */ |
| 27 | #endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ | 28 | #endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 006868881346..665f85f2a3af 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -188,7 +188,8 @@ extern int rotate_reclaimable_page(struct page *page); | |||
| 188 | extern void swap_setup(void); | 188 | extern void swap_setup(void); |
| 189 | 189 | ||
| 190 | /* linux/mm/vmscan.c */ | 190 | /* linux/mm/vmscan.c */ |
| 191 | extern unsigned long try_to_free_pages(struct zone **, gfp_t); | 191 | extern unsigned long try_to_free_pages(struct zone **zones, int order, |
| 192 | gfp_t gfp_mask); | ||
| 192 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 193 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
| 193 | extern int vm_swappiness; | 194 | extern int vm_swappiness; |
| 194 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 195 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index a46104a28f66..dce1ed204972 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 4 | 34 | #define TASKSTATS_VERSION 5 |
| 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 | ||
| @@ -149,6 +149,9 @@ struct taskstats { | |||
| 149 | __u64 read_bytes; /* bytes of read I/O */ | 149 | __u64 read_bytes; /* bytes of read I/O */ |
| 150 | __u64 write_bytes; /* bytes of write I/O */ | 150 | __u64 write_bytes; /* bytes of write I/O */ |
| 151 | __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ | 151 | __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ |
| 152 | |||
| 153 | __u64 nvcsw; /* voluntary_ctxt_switches */ | ||
| 154 | __u64 nivcsw; /* nonvoluntary_ctxt_switches */ | ||
| 152 | }; | 155 | }; |
| 153 | 156 | ||
| 154 | 157 | ||
diff --git a/include/linux/time.h b/include/linux/time.h index dda9be685ab6..ec3b0ced0afe 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -36,7 +36,8 @@ struct timezone { | |||
| 36 | #define NSEC_PER_SEC 1000000000L | 36 | #define NSEC_PER_SEC 1000000000L |
| 37 | #define FSEC_PER_SEC 1000000000000000L | 37 | #define FSEC_PER_SEC 1000000000000000L |
| 38 | 38 | ||
| 39 | static inline int timespec_equal(struct timespec *a, struct timespec *b) | 39 | static inline int timespec_equal(const struct timespec *a, |
| 40 | const struct timespec *b) | ||
| 40 | { | 41 | { |
| 41 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); | 42 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); |
| 42 | } | 43 | } |
| @@ -116,6 +117,8 @@ extern int do_setitimer(int which, struct itimerval *value, | |||
| 116 | extern unsigned int alarm_setitimer(unsigned int seconds); | 117 | extern unsigned int alarm_setitimer(unsigned int seconds); |
| 117 | extern int do_getitimer(int which, struct itimerval *value); | 118 | extern int do_getitimer(int which, struct itimerval *value); |
| 118 | extern void getnstimeofday(struct timespec *tv); | 119 | extern void getnstimeofday(struct timespec *tv); |
| 120 | extern void getboottime(struct timespec *ts); | ||
| 121 | extern void monotonic_to_bootbased(struct timespec *ts); | ||
| 119 | 122 | ||
| 120 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 123 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
| 121 | extern int timekeeping_is_continuous(void); | 124 | extern int timekeeping_is_continuous(void); |
diff --git a/include/linux/timer.h b/include/linux/timer.h index c661710d3627..78cf899b4409 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
| 5 | #include <linux/ktime.h> | 5 | #include <linux/ktime.h> |
| 6 | #include <linux/spinlock.h> | ||
| 7 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
| 8 | 7 | ||
| 9 | struct tvec_t_base_s; | 8 | struct tvec_t_base_s; |
| @@ -91,16 +90,13 @@ extern unsigned long get_next_timer_interrupt(unsigned long now); | |||
| 91 | */ | 90 | */ |
| 92 | #ifdef CONFIG_TIMER_STATS | 91 | #ifdef CONFIG_TIMER_STATS |
| 93 | 92 | ||
| 93 | #define TIMER_STATS_FLAG_DEFERRABLE 0x1 | ||
| 94 | |||
| 94 | extern void init_timer_stats(void); | 95 | extern void init_timer_stats(void); |
| 95 | 96 | ||
| 96 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | 97 | extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, |
| 97 | void *timerf, char * comm); | 98 | void *timerf, char *comm, |
| 98 | 99 | unsigned int timer_flag); | |
| 99 | static inline void timer_stats_account_timer(struct timer_list *timer) | ||
| 100 | { | ||
| 101 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | ||
| 102 | timer->function, timer->start_comm); | ||
| 103 | } | ||
| 104 | 100 | ||
| 105 | extern void __timer_stats_timer_set_start_info(struct timer_list *timer, | 101 | extern void __timer_stats_timer_set_start_info(struct timer_list *timer, |
| 106 | void *addr); | 102 | void *addr); |
| @@ -119,10 +115,6 @@ static inline void init_timer_stats(void) | |||
| 119 | { | 115 | { |
| 120 | } | 116 | } |
| 121 | 117 | ||
| 122 | static inline void timer_stats_account_timer(struct timer_list *timer) | ||
| 123 | { | ||
| 124 | } | ||
| 125 | |||
| 126 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) | 118 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) |
| 127 | { | 119 | { |
| 128 | } | 120 | } |
diff --git a/include/linux/tty.h b/include/linux/tty.h index bb4576085203..691a1748d9d2 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -178,6 +178,7 @@ struct tty_bufhead { | |||
| 178 | #define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) | 178 | #define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) |
| 179 | 179 | ||
| 180 | struct device; | 180 | struct device; |
| 181 | struct signal_struct; | ||
| 181 | /* | 182 | /* |
| 182 | * Where all of the state associated with a tty is kept while the tty | 183 | * Where all of the state associated with a tty is kept while the tty |
| 183 | * is open. Since the termios state should be kept even if the tty | 184 | * is open. Since the termios state should be kept even if the tty |
| @@ -310,6 +311,7 @@ extern void tty_hangup(struct tty_struct * tty); | |||
| 310 | extern void tty_vhangup(struct tty_struct * tty); | 311 | extern void tty_vhangup(struct tty_struct * tty); |
| 311 | extern void tty_unhangup(struct file *filp); | 312 | extern void tty_unhangup(struct file *filp); |
| 312 | extern int tty_hung_up_p(struct file * filp); | 313 | extern int tty_hung_up_p(struct file * filp); |
| 314 | extern int is_tty(struct file *filp); | ||
| 313 | extern void do_SAK(struct tty_struct *tty); | 315 | extern void do_SAK(struct tty_struct *tty); |
| 314 | extern void __do_SAK(struct tty_struct *tty); | 316 | extern void __do_SAK(struct tty_struct *tty); |
| 315 | extern void disassociate_ctty(int priv); | 317 | extern void disassociate_ctty(int priv); |
| @@ -338,9 +340,46 @@ extern struct tty_struct *get_current_tty(void); | |||
| 338 | 340 | ||
| 339 | extern struct mutex tty_mutex; | 341 | extern struct mutex tty_mutex; |
| 340 | 342 | ||
| 343 | extern void tty_write_unlock(struct tty_struct *tty); | ||
| 344 | extern int tty_write_lock(struct tty_struct *tty, int ndelay); | ||
| 345 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) | ||
| 346 | |||
| 347 | |||
| 348 | |||
| 341 | /* n_tty.c */ | 349 | /* n_tty.c */ |
| 342 | extern struct tty_ldisc tty_ldisc_N_TTY; | 350 | extern struct tty_ldisc tty_ldisc_N_TTY; |
| 343 | 351 | ||
| 352 | /* tty_audit.c */ | ||
| 353 | #ifdef CONFIG_AUDIT | ||
| 354 | extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | ||
| 355 | size_t size); | ||
| 356 | extern void tty_audit_exit(void); | ||
| 357 | extern void tty_audit_fork(struct signal_struct *sig); | ||
| 358 | extern void tty_audit_push(struct tty_struct *tty); | ||
| 359 | extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid); | ||
| 360 | extern void tty_audit_opening(void); | ||
| 361 | #else | ||
| 362 | static inline void tty_audit_add_data(struct tty_struct *tty, | ||
| 363 | unsigned char *data, size_t size) | ||
| 364 | { | ||
| 365 | } | ||
| 366 | static inline void tty_audit_exit(void) | ||
| 367 | { | ||
| 368 | } | ||
| 369 | static inline void tty_audit_fork(struct signal_struct *sig) | ||
| 370 | { | ||
| 371 | } | ||
| 372 | static inline void tty_audit_push(struct tty_struct *tty) | ||
| 373 | { | ||
| 374 | } | ||
| 375 | static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid) | ||
| 376 | { | ||
| 377 | } | ||
| 378 | static inline void tty_audit_opening(void) | ||
| 379 | { | ||
| 380 | } | ||
| 381 | #endif | ||
| 382 | |||
| 344 | /* tty_ioctl.c */ | 383 | /* tty_ioctl.c */ |
| 345 | extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, | 384 | extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, |
| 346 | unsigned int cmd, unsigned long arg); | 385 | unsigned int cmd, unsigned long arg); |
diff --git a/include/linux/uio.h b/include/linux/uio.h index 9af8bbcd8963..b7fe13883bdb 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
| @@ -13,10 +13,6 @@ | |||
| 13 | * 2 of the License, or (at your option) any later version. | 13 | * 2 of the License, or (at your option) any later version. |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | |||
| 17 | /* A word of warning: Our uio structure will clash with the C library one (which is now obsolete). Remove the C | ||
| 18 | library one from sys/uio.h if you have a very old library set */ | ||
| 19 | |||
| 20 | struct iovec | 16 | struct iovec |
| 21 | { | 17 | { |
| 22 | void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ | 18 | void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ |
| @@ -38,11 +34,6 @@ struct kvec { | |||
| 38 | 34 | ||
| 39 | #define UIO_FASTIOV 8 | 35 | #define UIO_FASTIOV 8 |
| 40 | #define UIO_MAXIOV 1024 | 36 | #define UIO_MAXIOV 1024 |
| 41 | #if 0 | ||
| 42 | #define UIO_MAXIOV 16 /* Maximum iovec's in one operation | ||
| 43 | 16 matches BSD */ | ||
| 44 | /* Beg pardon: BSD has 1024 --ANK */ | ||
| 45 | #endif | ||
| 46 | 37 | ||
| 47 | /* | 38 | /* |
| 48 | * Total number of bytes covered by an iovec. | 39 | * Total number of bytes covered by an iovec. |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h new file mode 100644 index 000000000000..bb320573bb9e --- /dev/null +++ b/include/linux/user_namespace.h | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | #ifndef _LINUX_USER_NAMESPACE_H | ||
| 2 | #define _LINUX_USER_NAMESPACE_H | ||
| 3 | |||
| 4 | #include <linux/kref.h> | ||
| 5 | #include <linux/nsproxy.h> | ||
| 6 | #include <linux/sched.h> | ||
| 7 | #include <linux/err.h> | ||
| 8 | |||
| 9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) | ||
| 10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) | ||
| 11 | |||
| 12 | struct user_namespace { | ||
| 13 | struct kref kref; | ||
| 14 | struct list_head uidhash_table[UIDHASH_SZ]; | ||
| 15 | struct user_struct *root_user; | ||
| 16 | }; | ||
| 17 | |||
| 18 | extern struct user_namespace init_user_ns; | ||
| 19 | |||
| 20 | #ifdef CONFIG_USER_NS | ||
| 21 | |||
| 22 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | ||
| 23 | { | ||
| 24 | if (ns) | ||
| 25 | kref_get(&ns->kref); | ||
| 26 | return ns; | ||
| 27 | } | ||
| 28 | |||
| 29 | extern struct user_namespace *copy_user_ns(int flags, | ||
| 30 | struct user_namespace *old_ns); | ||
| 31 | extern void free_user_ns(struct kref *kref); | ||
| 32 | |||
| 33 | static inline void put_user_ns(struct user_namespace *ns) | ||
| 34 | { | ||
| 35 | if (ns) | ||
| 36 | kref_put(&ns->kref, free_user_ns); | ||
| 37 | } | ||
| 38 | |||
| 39 | #else | ||
| 40 | |||
| 41 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | ||
| 42 | { | ||
| 43 | return &init_user_ns; | ||
| 44 | } | ||
| 45 | |||
| 46 | static inline struct user_namespace *copy_user_ns(int flags, | ||
| 47 | struct user_namespace *old_ns) | ||
| 48 | { | ||
| 49 | if (flags & CLONE_NEWUSER) | ||
| 50 | return ERR_PTR(-EINVAL); | ||
| 51 | |||
| 52 | return NULL; | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline void put_user_ns(struct user_namespace *ns) | ||
| 56 | { | ||
| 57 | } | ||
| 58 | |||
| 59 | #endif | ||
| 60 | |||
| 61 | #endif /* _LINUX_USER_H */ | ||
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index f8d3b326e93a..923db99175f2 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
| @@ -48,26 +48,14 @@ static inline void get_uts_ns(struct uts_namespace *ns) | |||
| 48 | kref_get(&ns->kref); | 48 | kref_get(&ns->kref); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | #ifdef CONFIG_UTS_NS | 51 | extern struct uts_namespace *copy_utsname(unsigned long flags, |
| 52 | extern struct uts_namespace *copy_utsname(int flags, struct uts_namespace *ns); | 52 | struct uts_namespace *ns); |
| 53 | extern void free_uts_ns(struct kref *kref); | 53 | extern void free_uts_ns(struct kref *kref); |
| 54 | 54 | ||
| 55 | static inline void put_uts_ns(struct uts_namespace *ns) | 55 | static inline void put_uts_ns(struct uts_namespace *ns) |
| 56 | { | 56 | { |
| 57 | kref_put(&ns->kref, free_uts_ns); | 57 | kref_put(&ns->kref, free_uts_ns); |
| 58 | } | 58 | } |
| 59 | #else | ||
| 60 | static inline struct uts_namespace *copy_utsname(int flags, | ||
| 61 | struct uts_namespace *ns) | ||
| 62 | { | ||
| 63 | return ns; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline void put_uts_ns(struct uts_namespace *ns) | ||
| 67 | { | ||
| 68 | } | ||
| 69 | #endif | ||
| 70 | |||
| 71 | static inline struct new_utsname *utsname(void) | 59 | static inline struct new_utsname *utsname(void) |
| 72 | { | 60 | { |
| 73 | return ¤t->nsproxy->uts_ns->name; | 61 | return ¤t->nsproxy->uts_ns->name; |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 4b7ee83787c1..132b260aef1e 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -65,9 +65,10 @@ extern struct vm_struct *get_vm_area_node(unsigned long size, | |||
| 65 | unsigned long flags, int node, | 65 | unsigned long flags, int node, |
| 66 | gfp_t gfp_mask); | 66 | gfp_t gfp_mask); |
| 67 | extern struct vm_struct *remove_vm_area(void *addr); | 67 | extern struct vm_struct *remove_vm_area(void *addr); |
| 68 | |||
| 68 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 69 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
| 69 | struct page ***pages); | 70 | struct page ***pages); |
| 70 | extern void unmap_vm_area(struct vm_struct *area); | 71 | extern void unmap_kernel_range(unsigned long addr, unsigned long size); |
| 71 | 72 | ||
| 72 | /* | 73 | /* |
| 73 | * Internals. Dont't use.. | 74 | * Internals. Dont't use.. |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index d9325cf8a134..75370ec0923e 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | #define HIGHMEM_ZONE(xx) | 25 | #define HIGHMEM_ZONE(xx) |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) | 28 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE |
| 29 | 29 | ||
| 30 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | 30 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, |
| 31 | FOR_ALL_ZONES(PGALLOC), | 31 | FOR_ALL_ZONES(PGALLOC), |
| @@ -170,7 +170,8 @@ static inline unsigned long node_page_state(int node, | |||
| 170 | #ifdef CONFIG_HIGHMEM | 170 | #ifdef CONFIG_HIGHMEM |
| 171 | zone_page_state(&zones[ZONE_HIGHMEM], item) + | 171 | zone_page_state(&zones[ZONE_HIGHMEM], item) + |
| 172 | #endif | 172 | #endif |
| 173 | zone_page_state(&zones[ZONE_NORMAL], item); | 173 | zone_page_state(&zones[ZONE_NORMAL], item) + |
| 174 | zone_page_state(&zones[ZONE_MOVABLE], item); | ||
| 174 | } | 175 | } |
| 175 | 176 | ||
| 176 | extern void zone_statistics(struct zonelist *, struct zone *); | 177 | extern void zone_statistics(struct zonelist *, struct zone *); |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index d961635d0e61..699b7e9864fa 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
| @@ -75,6 +75,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
| 75 | int vt_waitactive(int vt); | 75 | int vt_waitactive(int vt); |
| 76 | void change_console(struct vc_data *new_vc); | 76 | void change_console(struct vc_data *new_vc); |
| 77 | void reset_vc(struct vc_data *vc); | 77 | void reset_vc(struct vc_data *vc); |
| 78 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | ||
| 79 | int deflt); | ||
| 78 | 80 | ||
| 79 | /* | 81 | /* |
| 80 | * vc_screen.c shares this temporary buffer with the console write code so that | 82 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index ce0719a2cfeb..ce6badc98f6d 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -148,7 +148,7 @@ extern int keventd_up(void); | |||
| 148 | extern void init_workqueues(void); | 148 | extern void init_workqueues(void); |
| 149 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 149 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
| 150 | 150 | ||
| 151 | extern void cancel_work_sync(struct work_struct *work); | 151 | extern int cancel_work_sync(struct work_struct *work); |
| 152 | 152 | ||
| 153 | /* | 153 | /* |
| 154 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 154 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
| @@ -166,14 +166,21 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
| 166 | return ret; | 166 | return ret; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | extern void cancel_rearming_delayed_work(struct delayed_work *work); | 169 | extern int cancel_delayed_work_sync(struct delayed_work *work); |
| 170 | 170 | ||
| 171 | /* Obsolete. use cancel_rearming_delayed_work() */ | 171 | /* Obsolete. use cancel_delayed_work_sync() */ |
| 172 | static inline | 172 | static inline |
| 173 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | 173 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, |
| 174 | struct delayed_work *work) | 174 | struct delayed_work *work) |
| 175 | { | 175 | { |
| 176 | cancel_rearming_delayed_work(work); | 176 | cancel_delayed_work_sync(work); |
| 177 | } | ||
| 178 | |||
| 179 | /* Obsolete. use cancel_delayed_work_sync() */ | ||
| 180 | static inline | ||
| 181 | void cancel_rearming_delayed_work(struct delayed_work *work) | ||
| 182 | { | ||
| 183 | cancel_delayed_work_sync(work); | ||
| 177 | } | 184 | } |
| 178 | 185 | ||
| 179 | #endif | 186 | #endif |
diff --git a/include/net/scm.h b/include/net/scm.h index 5637d5e22d5f..423cb1d5ac25 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | /* Well, we should have at least one descriptor open | 8 | /* Well, we should have at least one descriptor open |
| 9 | * to accept passed FDs 8) | 9 | * to accept passed FDs 8) |
| 10 | */ | 10 | */ |
| 11 | #define SCM_MAX_FD (OPEN_MAX-1) | 11 | #define SCM_MAX_FD 255 |
| 12 | 12 | ||
| 13 | struct scm_fp_list | 13 | struct scm_fp_list |
| 14 | { | 14 | { |
diff --git a/include/video/tgafb.h b/include/video/tgafb.h index 03d0dbe293a8..7bc5e2c14826 100644 --- a/include/video/tgafb.h +++ b/include/video/tgafb.h | |||
| @@ -216,6 +216,7 @@ struct tga_par { | |||
| 216 | u32 pll_freq; /* pixclock in mhz */ | 216 | u32 pll_freq; /* pixclock in mhz */ |
| 217 | u32 bits_per_pixel; /* bits per pixel */ | 217 | u32 bits_per_pixel; /* bits per pixel */ |
| 218 | u32 sync_on_green; /* set if sync is on green */ | 218 | u32 sync_on_green; /* set if sync is on green */ |
| 219 | u32 palette[16]; | ||
| 219 | }; | 220 | }; |
| 220 | 221 | ||
| 221 | 222 | ||
