diff options
Diffstat (limited to 'include')
110 files changed, 2059 insertions, 1542 deletions
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h index bae7f05716d4..8cc97bfd3789 100644 --- a/include/asm-alpha/page.h +++ b/include/asm-alpha/page.h | |||
@@ -3,11 +3,12 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/const.h> | ||
6 | #include <asm/pal.h> | 7 | #include <asm/pal.h> |
7 | 8 | ||
8 | /* PAGE_SHIFT determines the page size */ | 9 | /* PAGE_SHIFT determines the page size */ |
9 | #define PAGE_SHIFT 13 | 10 | #define PAGE_SHIFT 13 |
10 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 11 | #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) |
11 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 12 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
12 | 13 | ||
13 | #ifndef __ASSEMBLY__ | 14 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-alpha/ptrace.h b/include/asm-alpha/ptrace.h index 9933b8b3612e..32c7a5cddd59 100644 --- a/include/asm-alpha/ptrace.h +++ b/include/asm-alpha/ptrace.h | |||
@@ -68,8 +68,6 @@ struct switch_stack { | |||
68 | 68 | ||
69 | #ifdef __KERNEL__ | 69 | #ifdef __KERNEL__ |
70 | 70 | ||
71 | #define __ARCH_SYS_PTRACE 1 | ||
72 | |||
73 | #define user_mode(regs) (((regs)->ps & 8) != 0) | 71 | #define user_mode(regs) (((regs)->ps & 8) != 0) |
74 | #define instruction_pointer(regs) ((regs)->pc) | 72 | #define instruction_pointer(regs) ((regs)->pc) |
75 | #define profile_pc(regs) instruction_pointer(regs) | 73 | #define profile_pc(regs) instruction_pointer(regs) |
diff --git a/include/asm-arm/arch-imx/imxfb.h b/include/asm-arm/arch-imx/imxfb.h index 7dbc7bbba65d..3ed9ec8b9f00 100644 --- a/include/asm-arm/arch-imx/imxfb.h +++ b/include/asm-arm/arch-imx/imxfb.h | |||
@@ -7,6 +7,7 @@ struct imxfb_mach_info { | |||
7 | u_short xres; | 7 | u_short xres; |
8 | u_short yres; | 8 | u_short yres; |
9 | 9 | ||
10 | u_int nonstd; | ||
10 | u_char bpp; | 11 | u_char bpp; |
11 | u_char hsync_len; | 12 | u_char hsync_len; |
12 | u_char left_margin; | 13 | u_char left_margin; |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 67f53e07db86..bb68b598c436 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1823,6 +1823,7 @@ | |||
1823 | #define LCCR1 __REG(0x44000004) /* LCD Controller Control Register 1 */ | 1823 | #define LCCR1 __REG(0x44000004) /* LCD Controller Control Register 1 */ |
1824 | #define LCCR2 __REG(0x44000008) /* LCD Controller Control Register 2 */ | 1824 | #define LCCR2 __REG(0x44000008) /* LCD Controller Control Register 2 */ |
1825 | #define LCCR3 __REG(0x4400000C) /* LCD Controller Control Register 3 */ | 1825 | #define LCCR3 __REG(0x4400000C) /* LCD Controller Control Register 3 */ |
1826 | #define LCCR4 __REG(0x44000010) /* LCD Controller Control Register 3 */ | ||
1826 | #define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */ | 1827 | #define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */ |
1827 | #define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */ | 1828 | #define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */ |
1828 | #define LCSR __REG(0x44000038) /* LCD Controller Status Register */ | 1829 | #define LCSR __REG(0x44000038) /* LCD Controller Status Register */ |
@@ -1836,6 +1837,16 @@ | |||
1836 | #define LCCR3_8BPP (3 << 24) | 1837 | #define LCCR3_8BPP (3 << 24) |
1837 | #define LCCR3_16BPP (4 << 24) | 1838 | #define LCCR3_16BPP (4 << 24) |
1838 | 1839 | ||
1840 | #define LCCR3_PDFOR_0 (0 << 30) | ||
1841 | #define LCCR3_PDFOR_1 (1 << 30) | ||
1842 | #define LCCR3_PDFOR_2 (2 << 30) | ||
1843 | #define LCCR3_PDFOR_3 (3 << 30) | ||
1844 | |||
1845 | #define LCCR4_PAL_FOR_0 (0 << 15) | ||
1846 | #define LCCR4_PAL_FOR_1 (1 << 15) | ||
1847 | #define LCCR4_PAL_FOR_2 (2 << 15) | ||
1848 | #define LCCR4_PAL_FOR_MASK (3 << 15) | ||
1849 | |||
1839 | #define FDADR0 __REG(0x44000200) /* DMA Channel 0 Frame Descriptor Address Register */ | 1850 | #define FDADR0 __REG(0x44000200) /* DMA Channel 0 Frame Descriptor Address Register */ |
1840 | #define FSADR0 __REG(0x44000204) /* DMA Channel 0 Frame Source Address Register */ | 1851 | #define FSADR0 __REG(0x44000204) /* DMA Channel 0 Frame Source Address Register */ |
1841 | #define FIDR0 __REG(0x44000208) /* DMA Channel 0 Frame ID Register */ | 1852 | #define FIDR0 __REG(0x44000208) /* DMA Channel 0 Frame ID Register */ |
diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h index 81c3928d608c..ea2336aa70e4 100644 --- a/include/asm-arm/arch-pxa/pxafb.h +++ b/include/asm-arm/arch-pxa/pxafb.h | |||
@@ -70,7 +70,12 @@ struct pxafb_mach_info { | |||
70 | * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp | 70 | * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp |
71 | */ | 71 | */ |
72 | u_int lccr3; | 72 | u_int lccr3; |
73 | 73 | /* The following should be defined in LCCR4 | |
74 | * LCCR4_PAL_FOR_0 or LCCR4_PAL_FOR_1 or LCCR4_PAL_FOR_2 | ||
75 | * | ||
76 | * All other bits in LCCR4 should be left alone. | ||
77 | */ | ||
78 | u_int lccr4; | ||
74 | void (*pxafb_backlight_power)(int); | 79 | void (*pxafb_backlight_power)(int); |
75 | void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *); | 80 | void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *); |
76 | 81 | ||
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h index 93a58e7862b0..5d0262601a7e 100644 --- a/include/asm-arm/arch-s3c2410/fb.h +++ b/include/asm-arm/arch-s3c2410/fb.h | |||
@@ -14,12 +14,6 @@ | |||
14 | 14 | ||
15 | #include <asm/arch/regs-lcd.h> | 15 | #include <asm/arch/regs-lcd.h> |
16 | 16 | ||
17 | struct s3c2410fb_val { | ||
18 | unsigned int defval; | ||
19 | unsigned int min; | ||
20 | unsigned int max; | ||
21 | }; | ||
22 | |||
23 | struct s3c2410fb_hw { | 17 | struct s3c2410fb_hw { |
24 | unsigned long lcdcon1; | 18 | unsigned long lcdcon1; |
25 | unsigned long lcdcon2; | 19 | unsigned long lcdcon2; |
@@ -28,23 +22,37 @@ struct s3c2410fb_hw { | |||
28 | unsigned long lcdcon5; | 22 | unsigned long lcdcon5; |
29 | }; | 23 | }; |
30 | 24 | ||
31 | struct s3c2410fb_mach_info { | 25 | /* LCD description */ |
32 | unsigned char fixed_syncs; /* do not update sync/border */ | 26 | struct s3c2410fb_display { |
33 | 27 | /* LCD type */ | |
34 | /* LCD types */ | 28 | unsigned type; |
35 | int type; | ||
36 | 29 | ||
37 | /* Screen size */ | 30 | /* Screen size */ |
38 | int width; | 31 | unsigned short width; |
39 | int height; | 32 | unsigned short height; |
40 | 33 | ||
41 | /* Screen info */ | 34 | /* Screen info */ |
42 | struct s3c2410fb_val xres; | 35 | unsigned short xres; |
43 | struct s3c2410fb_val yres; | 36 | unsigned short yres; |
44 | struct s3c2410fb_val bpp; | 37 | unsigned short bpp; |
38 | |||
39 | unsigned pixclock; /* pixclock in picoseconds */ | ||
40 | unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */ | ||
41 | unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */ | ||
42 | unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */ | ||
43 | unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */ | ||
44 | unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */ | ||
45 | unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */ | ||
45 | 46 | ||
46 | /* lcd configuration registers */ | 47 | /* lcd configuration registers */ |
47 | struct s3c2410fb_hw regs; | 48 | unsigned long lcdcon5; |
49 | }; | ||
50 | |||
51 | struct s3c2410fb_mach_info { | ||
52 | |||
53 | struct s3c2410fb_display *displays; /* attached diplays info */ | ||
54 | unsigned num_displays; /* number of defined displays */ | ||
55 | unsigned default_display; | ||
48 | 56 | ||
49 | /* GPIOs */ | 57 | /* GPIOs */ |
50 | 58 | ||
diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h index 7f54e2b15d13..fd7e99046b2f 100644 --- a/include/asm-avr32/kdebug.h +++ b/include/asm-avr32/kdebug.h | |||
@@ -1,26 +1,10 @@ | |||
1 | #ifndef __ASM_AVR32_KDEBUG_H | 1 | #ifndef __ASM_AVR32_KDEBUG_H |
2 | #define __ASM_AVR32_KDEBUG_H | 2 | #define __ASM_AVR32_KDEBUG_H |
3 | 3 | ||
4 | #include <linux/notifier.h> | ||
5 | |||
6 | /* Grossly misnamed. */ | 4 | /* Grossly misnamed. */ |
7 | enum die_val { | 5 | enum die_val { |
8 | DIE_BREAKPOINT, | 6 | DIE_BREAKPOINT, |
9 | DIE_SSTEP, | 7 | DIE_SSTEP, |
10 | }; | 8 | }; |
11 | 9 | ||
12 | /* | ||
13 | * These are only here because kprobes.c wants them to implement a | ||
14 | * blatant layering violation. Will hopefully go away soon once all | ||
15 | * architectures are updated. | ||
16 | */ | ||
17 | static inline int register_page_fault_notifier(struct notifier_block *nb) | ||
18 | { | ||
19 | return 0; | ||
20 | } | ||
21 | static inline int unregister_page_fault_notifier(struct notifier_block *nb) | ||
22 | { | ||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | #endif /* __ASM_AVR32_KDEBUG_H */ | 10 | #endif /* __ASM_AVR32_KDEBUG_H */ |
diff --git a/include/asm-avr32/kprobes.h b/include/asm-avr32/kprobes.h index 190a6377c809..996cb656474e 100644 --- a/include/asm-avr32/kprobes.h +++ b/include/asm-avr32/kprobes.h | |||
@@ -17,7 +17,7 @@ typedef u16 kprobe_opcode_t; | |||
17 | #define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */ | 17 | #define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */ |
18 | #define MAX_INSN_SIZE 2 | 18 | #define MAX_INSN_SIZE 2 |
19 | 19 | ||
20 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | 20 | #define kretprobe_blacklist_size 0 |
21 | 21 | ||
22 | #define arch_remove_kprobe(p) do { } while (0) | 22 | #define arch_remove_kprobe(p) do { } while (0) |
23 | 23 | ||
diff --git a/include/asm-blackfin/mach-bf548/bf54x-lq043.h b/include/asm-blackfin/mach-bf548/bf54x-lq043.h new file mode 100644 index 000000000000..9c7ca62a45eb --- /dev/null +++ b/include/asm-blackfin/mach-bf548/bf54x-lq043.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef BF54X_LQ043_H | ||
2 | #define BF54X_LQ043_H | ||
3 | |||
4 | struct bfin_bf54xfb_val { | ||
5 | unsigned int defval; | ||
6 | unsigned int min; | ||
7 | unsigned int max; | ||
8 | }; | ||
9 | |||
10 | struct bfin_bf54xfb_mach_info { | ||
11 | unsigned char fixed_syncs; /* do not update sync/border */ | ||
12 | |||
13 | /* LCD types */ | ||
14 | int type; | ||
15 | |||
16 | /* Screen size */ | ||
17 | int width; | ||
18 | int height; | ||
19 | |||
20 | /* Screen info */ | ||
21 | struct bfin_bf54xfb_val xres; | ||
22 | struct bfin_bf54xfb_val yres; | ||
23 | struct bfin_bf54xfb_val bpp; | ||
24 | |||
25 | /* GPIOs */ | ||
26 | unsigned short disp; | ||
27 | |||
28 | }; | ||
29 | |||
30 | #endif /* BF54X_LQ043_H */ | ||
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h index cc5433e78b52..348b8f1df17e 100644 --- a/include/asm-frv/thread_info.h +++ b/include/asm-frv/thread_info.h | |||
@@ -88,9 +88,8 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
88 | ({ \ | 88 | ({ \ |
89 | struct thread_info *ret; \ | 89 | struct thread_info *ret; \ |
90 | \ | 90 | \ |
91 | ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \ | 91 | ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \ |
92 | if (ret) \ | 92 | \ |
93 | memset(ret, 0, THREAD_SIZE); \ | ||
94 | ret; \ | 93 | ret; \ |
95 | }) | 94 | }) |
96 | #else | 95 | #else |
diff --git a/include/asm-frv/tlbflush.h b/include/asm-frv/tlbflush.h index da3a3179a85d..8370f97e41ee 100644 --- a/include/asm-frv/tlbflush.h +++ b/include/asm-frv/tlbflush.h | |||
@@ -57,8 +57,7 @@ do { \ | |||
57 | #define __flush_tlb_global() flush_tlb_all() | 57 | #define __flush_tlb_global() flush_tlb_all() |
58 | #define flush_tlb() flush_tlb_all() | 58 | #define flush_tlb() flush_tlb_all() |
59 | #define flush_tlb_kernel_range(start, end) flush_tlb_all() | 59 | #define flush_tlb_kernel_range(start, end) flush_tlb_all() |
60 | #define flush_tlb_pgtables(mm,start,end) \ | 60 | #define flush_tlb_pgtables(mm,start,end) do { } while(0) |
61 | asm volatile("movgs %0,scr0 ! movgs %0,scr1" :: "r"(ULONG_MAX) : "memory"); | ||
62 | 61 | ||
63 | #else | 62 | #else |
64 | 63 | ||
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index 30d8d33491dd..52226e14bd7d 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h | |||
@@ -46,6 +46,12 @@ | |||
46 | __pgdat->node_start_pfn; \ | 46 | __pgdat->node_start_pfn; \ |
47 | }) | 47 | }) |
48 | 48 | ||
49 | #elif defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
50 | |||
51 | /* memmap is virtually contigious. */ | ||
52 | #define __pfn_to_page(pfn) (vmemmap + (pfn)) | ||
53 | #define __page_to_pfn(page) ((page) - vmemmap) | ||
54 | |||
49 | #elif defined(CONFIG_SPARSEMEM) | 55 | #elif defined(CONFIG_SPARSEMEM) |
50 | /* | 56 | /* |
51 | * Note: section's mem_map is encorded to reflect its start_pfn. | 57 | * Note: section's mem_map is encorded to reflect its start_pfn. |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 5f0d797d33fd..44ef329531c3 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -125,10 +125,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
125 | #define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) | 125 | #define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) |
126 | #endif | 126 | #endif |
127 | 127 | ||
128 | #ifndef __HAVE_ARCH_LAZY_MMU_PROT_UPDATE | ||
129 | #define lazy_mmu_prot_update(pte) do { } while (0) | ||
130 | #endif | ||
131 | |||
132 | #ifndef __HAVE_ARCH_MOVE_PTE | 128 | #ifndef __HAVE_ARCH_MOVE_PTE |
133 | #define move_pte(pte, prot, old_addr, new_addr) (pte) | 129 | #define move_pte(pte, prot, old_addr, new_addr) (pte) |
134 | #endif | 130 | #endif |
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h index 320cd8e754ea..35e49407d06c 100644 --- a/include/asm-ia64/kdebug.h +++ b/include/asm-ia64/kdebug.h | |||
@@ -26,21 +26,6 @@ | |||
26 | * 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more | 26 | * 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more |
27 | * events. | 27 | * events. |
28 | */ | 28 | */ |
29 | #include <linux/notifier.h> | ||
30 | |||
31 | /* | ||
32 | * These are only here because kprobes.c wants them to implement a | ||
33 | * blatant layering violation. Will hopefully go away soon once all | ||
34 | * architectures are updated. | ||
35 | */ | ||
36 | static inline int register_page_fault_notifier(struct notifier_block *nb) | ||
37 | { | ||
38 | return 0; | ||
39 | } | ||
40 | static inline int unregister_page_fault_notifier(struct notifier_block *nb) | ||
41 | { | ||
42 | return 0; | ||
43 | } | ||
44 | 29 | ||
45 | enum die_val { | 30 | enum die_val { |
46 | DIE_BREAK = 1, | 31 | DIE_BREAK = 1, |
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index 067d9dea68f9..a93ce9ef07ff 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h | |||
@@ -83,7 +83,7 @@ struct kprobe_ctlblk { | |||
83 | }; | 83 | }; |
84 | 84 | ||
85 | #define ARCH_SUPPORTS_KRETPROBES | 85 | #define ARCH_SUPPORTS_KRETPROBES |
86 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | 86 | #define kretprobe_blacklist_size 0 |
87 | 87 | ||
88 | #define SLOT0_OPCODE_SHIFT (37) | 88 | #define SLOT0_OPCODE_SHIFT (37) |
89 | #define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) | 89 | #define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index de6d01e24dd0..0971ec90807e 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
@@ -223,12 +223,6 @@ ia64_phys_addr_valid (unsigned long addr) | |||
223 | * page table. | 223 | * page table. |
224 | */ | 224 | */ |
225 | 225 | ||
226 | /* | ||
227 | * On some architectures, special things need to be done when setting | ||
228 | * the PTE in a page table. Nothing special needs to be on IA-64. | ||
229 | */ | ||
230 | #define set_pte(ptep, pteval) (*(ptep) = (pteval)) | ||
231 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | ||
232 | 226 | ||
233 | #define VMALLOC_START (RGN_BASE(RGN_GATE) + 0x200000000UL) | 227 | #define VMALLOC_START (RGN_BASE(RGN_GATE) + 0x200000000UL) |
234 | #ifdef CONFIG_VIRTUAL_MEM_MAP | 228 | #ifdef CONFIG_VIRTUAL_MEM_MAP |
@@ -236,8 +230,14 @@ ia64_phys_addr_valid (unsigned long addr) | |||
236 | # define VMALLOC_END vmalloc_end | 230 | # define VMALLOC_END vmalloc_end |
237 | extern unsigned long vmalloc_end; | 231 | extern unsigned long vmalloc_end; |
238 | #else | 232 | #else |
233 | #if defined(CONFIG_SPARSEMEM) && defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
234 | /* SPARSEMEM_VMEMMAP uses half of vmalloc... */ | ||
235 | # define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 10))) | ||
236 | # define vmemmap ((struct page *)VMALLOC_END) | ||
237 | #else | ||
239 | # define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9))) | 238 | # define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9))) |
240 | #endif | 239 | #endif |
240 | #endif | ||
241 | 241 | ||
242 | /* fs/proc/kcore.c */ | 242 | /* fs/proc/kcore.c */ |
243 | #define kc_vaddr_to_offset(v) ((v) - RGN_BASE(RGN_GATE)) | 243 | #define kc_vaddr_to_offset(v) ((v) - RGN_BASE(RGN_GATE)) |
@@ -315,6 +315,36 @@ ia64_phys_addr_valid (unsigned long addr) | |||
315 | #define pte_mkhuge(pte) (__pte(pte_val(pte))) | 315 | #define pte_mkhuge(pte) (__pte(pte_val(pte))) |
316 | 316 | ||
317 | /* | 317 | /* |
318 | * Because ia64's Icache and Dcache is not coherent (on a cpu), we need to | ||
319 | * sync icache and dcache when we insert *new* executable page. | ||
320 | * __ia64_sync_icache_dcache() check Pg_arch_1 bit and flush icache | ||
321 | * if necessary. | ||
322 | * | ||
323 | * set_pte() is also called by the kernel, but we can expect that the kernel | ||
324 | * flushes icache explicitly if necessary. | ||
325 | */ | ||
326 | #define pte_present_exec_user(pte)\ | ||
327 | ((pte_val(pte) & (_PAGE_P | _PAGE_PL_MASK | _PAGE_AR_RX)) == \ | ||
328 | (_PAGE_P | _PAGE_PL_3 | _PAGE_AR_RX)) | ||
329 | |||
330 | extern void __ia64_sync_icache_dcache(pte_t pteval); | ||
331 | static inline void set_pte(pte_t *ptep, pte_t pteval) | ||
332 | { | ||
333 | /* page is present && page is user && page is executable | ||
334 | * && (page swapin or new page or page migraton | ||
335 | * || copy_on_write with page copying.) | ||
336 | */ | ||
337 | if (pte_present_exec_user(pteval) && | ||
338 | (!pte_present(*ptep) || | ||
339 | pte_pfn(*ptep) != pte_pfn(pteval))) | ||
340 | /* load_module() calles flush_icache_range() explicitly*/ | ||
341 | __ia64_sync_icache_dcache(pteval); | ||
342 | *ptep = pteval; | ||
343 | } | ||
344 | |||
345 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | ||
346 | |||
347 | /* | ||
318 | * Make page protection values cacheable, uncacheable, or write- | 348 | * Make page protection values cacheable, uncacheable, or write- |
319 | * combining. Note that "protection" is really a misnomer here as the | 349 | * combining. Note that "protection" is really a misnomer here as the |
320 | * protection value contains the memory attribute bits, dirty bits, and | 350 | * protection value contains the memory attribute bits, dirty bits, and |
@@ -483,12 +513,6 @@ extern struct page *zero_page_memmap_ptr; | |||
483 | #define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1)) | 513 | #define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1)) |
484 | #endif | 514 | #endif |
485 | 515 | ||
486 | /* | ||
487 | * IA-64 doesn't have any external MMU info: the page tables contain all the necessary | ||
488 | * information. However, we use this routine to take care of any (delayed) i-cache | ||
489 | * flushing that may be necessary. | ||
490 | */ | ||
491 | extern void lazy_mmu_prot_update (pte_t pte); | ||
492 | 516 | ||
493 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 517 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
494 | /* | 518 | /* |
@@ -578,7 +602,7 @@ extern void lazy_mmu_prot_update (pte_t pte); | |||
578 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT | 602 | #define __HAVE_ARCH_PTEP_SET_WRPROTECT |
579 | #define __HAVE_ARCH_PTE_SAME | 603 | #define __HAVE_ARCH_PTE_SAME |
580 | #define __HAVE_ARCH_PGD_OFFSET_GATE | 604 | #define __HAVE_ARCH_PGD_OFFSET_GATE |
581 | #define __HAVE_ARCH_LAZY_MMU_PROT_UPDATE | 605 | |
582 | 606 | ||
583 | #ifndef CONFIG_PGTABLE_4 | 607 | #ifndef CONFIG_PGTABLE_4 |
584 | #include <asm-generic/pgtable-nopud.h> | 608 | #include <asm-generic/pgtable-nopud.h> |
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h index 6314b29e8c4d..1703c9d885bd 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h | |||
@@ -58,7 +58,7 @@ extern char no_int_routing __devinitdata; | |||
58 | 58 | ||
59 | extern cpumask_t cpu_online_map; | 59 | extern cpumask_t cpu_online_map; |
60 | extern cpumask_t cpu_core_map[NR_CPUS]; | 60 | extern cpumask_t cpu_core_map[NR_CPUS]; |
61 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 61 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
62 | extern int smp_num_siblings; | 62 | extern int smp_num_siblings; |
63 | extern int smp_num_cpucores; | 63 | extern int smp_num_cpucores; |
64 | extern void __iomem *ipi_base_addr; | 64 | extern void __iomem *ipi_base_addr; |
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 233f1caae048..2d67b72b18d0 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h | |||
@@ -112,7 +112,7 @@ void build_cpu_to_node_map(void); | |||
112 | #define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id) | 112 | #define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id) |
113 | #define topology_core_id(cpu) (cpu_data(cpu)->core_id) | 113 | #define topology_core_id(cpu) (cpu_data(cpu)->core_id) |
114 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) | 114 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) |
115 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 115 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) |
116 | #define smt_capable() (smp_num_siblings > 1) | 116 | #define smt_capable() (smp_num_siblings > 1) |
117 | #endif | 117 | #endif |
118 | 118 | ||
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 632b4ce4269a..a0755b982028 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -120,7 +120,10 @@ struct pt_regs { | |||
120 | 120 | ||
121 | #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ | 121 | #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ |
122 | 122 | ||
123 | #define __ARCH_SYS_PTRACE 1 | 123 | struct task_struct; |
124 | extern void init_debug_traps(struct task_struct *); | ||
125 | #define arch_ptrace_attach(child) \ | ||
126 | init_debug_traps(child) | ||
124 | 127 | ||
125 | #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) | 128 | #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) |
126 | #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0) | 129 | #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0) |
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h index b7ccc3e68604..c039820dba7c 100644 --- a/include/asm-m32r/thread_info.h +++ b/include/asm-m32r/thread_info.h | |||
@@ -100,9 +100,8 @@ static inline struct thread_info *current_thread_info(void) | |||
100 | ({ \ | 100 | ({ \ |
101 | struct thread_info *ret; \ | 101 | struct thread_info *ret; \ |
102 | \ | 102 | \ |
103 | ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \ | 103 | ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \ |
104 | if (ret) \ | 104 | \ |
105 | memset(ret, 0, THREAD_SIZE); \ | ||
106 | ret; \ | 105 | ret; \ |
107 | }) | 106 | }) |
108 | #else | 107 | #else |
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 5da43a5d12a3..1bd1142685e1 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h | |||
@@ -253,8 +253,7 @@ cmpxchg(volatile int *p, int old, int new) | |||
253 | "); \ | 253 | "); \ |
254 | }) | 254 | }) |
255 | #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ | 255 | #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ |
256 | defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ | 256 | defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA) |
257 | defined(CONFIG_CLEOPATRA) | ||
258 | #define HARD_RESET_NOW() ({ \ | 257 | #define HARD_RESET_NOW() ({ \ |
259 | asm(" \ | 258 | asm(" \ |
260 | movew #0x2700, %sr; \ | 259 | movew #0x2700, %sr; \ |
diff --git a/include/asm-mips/xxs1500.h b/include/asm-mips/xxs1500.h deleted file mode 100644 index 4d84a90b0f20..000000000000 --- a/include/asm-mips/xxs1500.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * MyCable XXS1500 Referrence Board | ||
3 | * | ||
4 | * Copyright 2003 MontaVista Software Inc. | ||
5 | * Author: Pete Popov, MontaVista Software, Inc. | ||
6 | * ppopov@mvista.com or source@mvista.com | ||
7 | * | ||
8 | * ######################################################################## | ||
9 | * | ||
10 | * This program is free software; you can distribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License (Version 2) as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
17 | * for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
22 | * | ||
23 | * ######################################################################## | ||
24 | * | ||
25 | * | ||
26 | */ | ||
27 | #ifndef __ASM_XXS1500_H | ||
28 | #define __ASM_XXS1500_H | ||
29 | |||
30 | /* PCMCIA XXS1500 specific defines */ | ||
31 | #define PCMCIA_MAX_SOCK 0 | ||
32 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1) | ||
33 | #define PCMCIA_IRQ AU1000_GPIO_4 | ||
34 | |||
35 | #endif /* __ASM_XXS1500_ */ | ||
diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h index 295f0162c608..ae6d206728af 100644 --- a/include/asm-powerpc/kdebug.h +++ b/include/asm-powerpc/kdebug.h | |||
@@ -2,25 +2,6 @@ | |||
2 | #define _ASM_POWERPC_KDEBUG_H | 2 | #define _ASM_POWERPC_KDEBUG_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | /* nearly identical to x86_64/i386 code */ | ||
6 | |||
7 | #include <linux/notifier.h> | ||
8 | |||
9 | /* | ||
10 | * These are only here because kprobes.c wants them to implement a | ||
11 | * blatant layering violation. Will hopefully go away soon once all | ||
12 | * architectures are updated. | ||
13 | */ | ||
14 | static inline int register_page_fault_notifier(struct notifier_block *nb) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | static inline int unregister_page_fault_notifier(struct notifier_block *nb) | ||
19 | { | ||
20 | return 0; | ||
21 | } | ||
22 | extern struct atomic_notifier_head powerpc_die_chain; | ||
23 | |||
24 | /* Grossly misnamed. */ | 5 | /* Grossly misnamed. */ |
25 | enum die_val { | 6 | enum die_val { |
26 | DIE_OOPS = 1, | 7 | DIE_OOPS = 1, |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 8b08b447d6f3..afabad230dbb 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -81,8 +81,8 @@ typedef unsigned int kprobe_opcode_t; | |||
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #define ARCH_SUPPORTS_KRETPROBES | 83 | #define ARCH_SUPPORTS_KRETPROBES |
84 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | ||
85 | #define flush_insn_slot(p) do { } while (0) | 84 | #define flush_insn_slot(p) do { } while (0) |
85 | #define kretprobe_blacklist_size 0 | ||
86 | 86 | ||
87 | void kretprobe_trampoline(void); | 87 | void kretprobe_trampoline(void); |
88 | extern void arch_remove_kprobe(struct kprobe *p); | 88 | extern void arch_remove_kprobe(struct kprobe *p); |
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index 300f9a199bf2..dd4c26dc57d2 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
@@ -68,6 +68,14 @@ | |||
68 | #define USER_REGION_ID (0UL) | 68 | #define USER_REGION_ID (0UL) |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * Defines the address of the vmemap area, in the top 16th of the | ||
72 | * kernel region. | ||
73 | */ | ||
74 | #define VMEMMAP_BASE (ASM_CONST(CONFIG_KERNEL_START) + \ | ||
75 | (0xfUL << (REGION_SHIFT - 4))) | ||
76 | #define vmemmap ((struct page *)VMEMMAP_BASE) | ||
77 | |||
78 | /* | ||
71 | * Common bits in a linux-style PTE. These match the bits in the | 79 | * Common bits in a linux-style PTE. These match the bits in the |
72 | * (hardware-defined) PowerPC PTE as closely as possible. Additional | 80 | * (hardware-defined) PowerPC PTE as closely as possible. Additional |
73 | * bits may be defined in pgtable-*.h | 81 | * bits may be defined in pgtable-*.h |
diff --git a/include/asm-powerpc/ps3av.h b/include/asm-powerpc/ps3av.h index 7df4250802de..967930b82ed3 100644 --- a/include/asm-powerpc/ps3av.h +++ b/include/asm-powerpc/ps3av.h | |||
@@ -283,7 +283,7 @@ | |||
283 | #define PS3AV_CMD_VIDEO_CS_YUV422 0x0002 | 283 | #define PS3AV_CMD_VIDEO_CS_YUV422 0x0002 |
284 | #define PS3AV_CMD_VIDEO_CS_YUV444 0x0003 | 284 | #define PS3AV_CMD_VIDEO_CS_YUV444 0x0003 |
285 | 285 | ||
286 | /* for automode */ | 286 | /* for broadcast automode */ |
287 | #define PS3AV_RESBIT_720x480P 0x0003 /* 0x0001 | 0x0002 */ | 287 | #define PS3AV_RESBIT_720x480P 0x0003 /* 0x0001 | 0x0002 */ |
288 | #define PS3AV_RESBIT_720x576P 0x0003 /* 0x0001 | 0x0002 */ | 288 | #define PS3AV_RESBIT_720x576P 0x0003 /* 0x0001 | 0x0002 */ |
289 | #define PS3AV_RESBIT_1280x720P 0x0004 | 289 | #define PS3AV_RESBIT_1280x720P 0x0004 |
@@ -298,13 +298,22 @@ | |||
298 | | PS3AV_RESBIT_1920x1080I \ | 298 | | PS3AV_RESBIT_1920x1080I \ |
299 | | PS3AV_RESBIT_1920x1080P) | 299 | | PS3AV_RESBIT_1920x1080P) |
300 | 300 | ||
301 | /* for VESA automode */ | ||
302 | #define PS3AV_RESBIT_VGA 0x0001 | ||
303 | #define PS3AV_RESBIT_WXGA 0x0002 | ||
304 | #define PS3AV_RESBIT_SXGA 0x0004 | ||
305 | #define PS3AV_RESBIT_WUXGA 0x0008 | ||
306 | #define PS3AV_RES_MASK_VESA (PS3AV_RESBIT_WXGA |\ | ||
307 | PS3AV_RESBIT_SXGA |\ | ||
308 | PS3AV_RESBIT_WUXGA) | ||
309 | |||
301 | #define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */ | 310 | #define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */ |
302 | #define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */ | 311 | #define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */ |
303 | #define PS3AV_DEFAULT_HDMI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480P | 312 | |
304 | #define PS3AV_DEFAULT_AVMULTI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480I | 313 | #define PS3AV_DEFAULT_HDMI_MODE_ID_REG_60 2 /* 480p */ |
305 | #define PS3AV_DEFAULT_HDMI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576P | 314 | #define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60 1 /* 480i */ |
306 | #define PS3AV_DEFAULT_AVMULTI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576I | 315 | #define PS3AV_DEFAULT_HDMI_MODE_ID_REG_50 7 /* 576p */ |
307 | #define PS3AV_DEFAULT_DVI_VID PS3AV_CMD_VIDEO_VID_480P | 316 | #define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50 6 /* 576i */ |
308 | 317 | ||
309 | #define PS3AV_REGION_60 0x01 | 318 | #define PS3AV_REGION_60 0x01 |
310 | #define PS3AV_REGION_50 0x02 | 319 | #define PS3AV_REGION_50 0x02 |
@@ -697,20 +706,12 @@ extern int ps3av_cmd_audio_mute(int, u32 *, u32); | |||
697 | extern int ps3av_cmd_audio_active(int, u32); | 706 | extern int ps3av_cmd_audio_active(int, u32); |
698 | extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32); | 707 | extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32); |
699 | extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *); | 708 | extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *); |
700 | #ifdef PS3AV_DEBUG | ||
701 | extern void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *); | ||
702 | extern void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *); | ||
703 | #else | ||
704 | static inline void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) {} | ||
705 | static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) {} | ||
706 | #endif | ||
707 | extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, | 709 | extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, |
708 | u32); | 710 | u32); |
709 | 711 | ||
710 | extern int ps3av_set_video_mode(u32, int); | 712 | extern int ps3av_set_video_mode(u32); |
711 | extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); | 713 | extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); |
712 | extern int ps3av_get_auto_mode(int); | 714 | extern int ps3av_get_auto_mode(void); |
713 | extern int ps3av_set_mode(u32, int); | ||
714 | extern int ps3av_get_mode(void); | 715 | extern int ps3av_get_mode(void); |
715 | extern int ps3av_get_scanmode(int); | 716 | extern int ps3av_get_scanmode(int); |
716 | extern int ps3av_get_refresh_rate(int); | 717 | extern int ps3av_get_refresh_rate(int); |
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h index 19102bfc14ca..505f35bacaa9 100644 --- a/include/asm-powerpc/smp.h +++ b/include/asm-powerpc/smp.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #ifdef CONFIG_PPC64 | 26 | #ifdef CONFIG_PPC64 |
27 | #include <asm/paca.h> | 27 | #include <asm/paca.h> |
28 | #endif | 28 | #endif |
29 | #include <asm/percpu.h> | ||
29 | 30 | ||
30 | extern int boot_cpuid; | 31 | extern int boot_cpuid; |
31 | 32 | ||
@@ -58,7 +59,7 @@ extern int smp_hw_index[]; | |||
58 | (smp_hw_index[(cpu)] = (phys)) | 59 | (smp_hw_index[(cpu)] = (phys)) |
59 | #endif | 60 | #endif |
60 | 61 | ||
61 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 62 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
62 | 63 | ||
63 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. | 64 | /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. |
64 | * | 65 | * |
@@ -77,6 +78,7 @@ void smp_init_pSeries(void); | |||
77 | void smp_init_cell(void); | 78 | void smp_init_cell(void); |
78 | void smp_init_celleb(void); | 79 | void smp_init_celleb(void); |
79 | void smp_setup_cpu_maps(void); | 80 | void smp_setup_cpu_maps(void); |
81 | void smp_setup_cpu_sibling_map(void); | ||
80 | 82 | ||
81 | extern int __cpu_disable(void); | 83 | extern int __cpu_disable(void); |
82 | extern void __cpu_die(unsigned int cpu); | 84 | extern void __cpu_die(unsigned int cpu); |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 0ad21a849b5f..ca23b681ad05 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -108,7 +108,7 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev, | |||
108 | #ifdef CONFIG_PPC64 | 108 | #ifdef CONFIG_PPC64 |
109 | #include <asm/smp.h> | 109 | #include <asm/smp.h> |
110 | 110 | ||
111 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 111 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) |
112 | #endif | 112 | #endif |
113 | #endif | 113 | #endif |
114 | 114 | ||
diff --git a/include/asm-s390/kdebug.h b/include/asm-s390/kdebug.h index 04418af08f85..40db27cd6e60 100644 --- a/include/asm-s390/kdebug.h +++ b/include/asm-s390/kdebug.h | |||
@@ -4,24 +4,9 @@ | |||
4 | /* | 4 | /* |
5 | * Feb 2006 Ported to s390 <grundym@us.ibm.com> | 5 | * Feb 2006 Ported to s390 <grundym@us.ibm.com> |
6 | */ | 6 | */ |
7 | #include <linux/notifier.h> | ||
8 | 7 | ||
9 | struct pt_regs; | 8 | struct pt_regs; |
10 | 9 | ||
11 | /* | ||
12 | * These are only here because kprobes.c wants them to implement a | ||
13 | * blatant layering violation. Will hopefully go away soon once all | ||
14 | * architectures are updated. | ||
15 | */ | ||
16 | static inline int register_page_fault_notifier(struct notifier_block *nb) | ||
17 | { | ||
18 | return 0; | ||
19 | } | ||
20 | static inline int unregister_page_fault_notifier(struct notifier_block *nb) | ||
21 | { | ||
22 | return 0; | ||
23 | } | ||
24 | |||
25 | enum die_val { | 10 | enum die_val { |
26 | DIE_OOPS = 1, | 11 | DIE_OOPS = 1, |
27 | DIE_BPT, | 12 | DIE_BPT, |
diff --git a/include/asm-s390/kprobes.h b/include/asm-s390/kprobes.h index 340ba10446ea..948db3d0d05c 100644 --- a/include/asm-s390/kprobes.h +++ b/include/asm-s390/kprobes.h | |||
@@ -47,7 +47,7 @@ typedef u16 kprobe_opcode_t; | |||
47 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) | 47 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) |
48 | 48 | ||
49 | #define ARCH_SUPPORTS_KRETPROBES | 49 | #define ARCH_SUPPORTS_KRETPROBES |
50 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | 50 | #define kretprobe_blacklist_size 0 |
51 | 51 | ||
52 | #define KPROBE_SWAP_INST 0x10 | 52 | #define KPROBE_SWAP_INST 0x10 |
53 | 53 | ||
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h index 382cfc7deb73..49cd69051a88 100644 --- a/include/asm-sh/kdebug.h +++ b/include/asm-sh/kdebug.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __ASM_SH_KDEBUG_H | 1 | #ifndef __ASM_SH_KDEBUG_H |
2 | #define __ASM_SH_KDEBUG_H | 2 | #define __ASM_SH_KDEBUG_H |
3 | 3 | ||
4 | #include <linux/notifier.h> | ||
5 | |||
6 | /* Grossly misnamed. */ | 4 | /* Grossly misnamed. */ |
7 | enum die_val { | 5 | enum die_val { |
8 | DIE_TRAP, | 6 | DIE_TRAP, |
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h index 9974c7b0aebc..f905b773235a 100644 --- a/include/asm-sparc64/kdebug.h +++ b/include/asm-sparc64/kdebug.h | |||
@@ -1,26 +1,8 @@ | |||
1 | #ifndef _SPARC64_KDEBUG_H | 1 | #ifndef _SPARC64_KDEBUG_H |
2 | #define _SPARC64_KDEBUG_H | 2 | #define _SPARC64_KDEBUG_H |
3 | 3 | ||
4 | /* Nearly identical to x86_64/i386 code. */ | ||
5 | |||
6 | #include <linux/notifier.h> | ||
7 | |||
8 | struct pt_regs; | 4 | struct pt_regs; |
9 | 5 | ||
10 | /* | ||
11 | * These are only here because kprobes.c wants them to implement a | ||
12 | * blatant layering violation. Will hopefully go away soon once all | ||
13 | * architectures are updated. | ||
14 | */ | ||
15 | static inline int register_page_fault_notifier(struct notifier_block *nb) | ||
16 | { | ||
17 | return 0; | ||
18 | } | ||
19 | static inline int unregister_page_fault_notifier(struct notifier_block *nb) | ||
20 | { | ||
21 | return 0; | ||
22 | } | ||
23 | |||
24 | extern void bad_trap(struct pt_regs *, long); | 6 | extern void bad_trap(struct pt_regs *, long); |
25 | 7 | ||
26 | /* Grossly misnamed. */ | 8 | /* Grossly misnamed. */ |
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index 7f6774dca5f4..5020eaf67c29 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h | |||
@@ -10,8 +10,9 @@ typedef u32 kprobe_opcode_t; | |||
10 | #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ | 10 | #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ |
11 | #define MAX_INSN_SIZE 2 | 11 | #define MAX_INSN_SIZE 2 |
12 | 12 | ||
13 | #define kretprobe_blacklist_size 0 | ||
14 | |||
13 | #define arch_remove_kprobe(p) do {} while (0) | 15 | #define arch_remove_kprobe(p) do {} while (0) |
14 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | ||
15 | 16 | ||
16 | #define flush_insn_slot(p) \ | 17 | #define flush_insn_slot(p) \ |
17 | do { flushi(&(p)->ainsn.insn[0]); \ | 18 | do { flushi(&(p)->ainsn.insn[0]); \ |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 0393380d754a..3167ccff64f8 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -42,6 +42,9 @@ | |||
42 | #define HI_OBP_ADDRESS _AC(0x0000000100000000,UL) | 42 | #define HI_OBP_ADDRESS _AC(0x0000000100000000,UL) |
43 | #define VMALLOC_START _AC(0x0000000100000000,UL) | 43 | #define VMALLOC_START _AC(0x0000000100000000,UL) |
44 | #define VMALLOC_END _AC(0x0000000200000000,UL) | 44 | #define VMALLOC_END _AC(0x0000000200000000,UL) |
45 | #define VMEMMAP_BASE _AC(0x0000000200000000,UL) | ||
46 | |||
47 | #define vmemmap ((struct page *)VMEMMAP_BASE) | ||
45 | 48 | ||
46 | /* XXX All of this needs to be rethought so we can take advantage | 49 | /* XXX All of this needs to be rethought so we can take advantage |
47 | * XXX cheetah's full 64-bit virtual address space, ie. no more hole | 50 | * XXX cheetah's full 64-bit virtual address space, ie. no more hole |
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index e8a96a31761b..42c09949526c 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h | |||
@@ -28,8 +28,9 @@ | |||
28 | 28 | ||
29 | #include <asm/bitops.h> | 29 | #include <asm/bitops.h> |
30 | #include <asm/atomic.h> | 30 | #include <asm/atomic.h> |
31 | #include <asm/percpu.h> | ||
31 | 32 | ||
32 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 33 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
33 | extern cpumask_t cpu_core_map[NR_CPUS]; | 34 | extern cpumask_t cpu_core_map[NR_CPUS]; |
34 | extern int sparc64_multi_core; | 35 | extern int sparc64_multi_core; |
35 | 36 | ||
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h index 290ac75f385b..c6b557034f68 100644 --- a/include/asm-sparc64/topology.h +++ b/include/asm-sparc64/topology.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id) | 5 | #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id) |
6 | #define topology_core_id(cpu) (cpu_data(cpu).core_id) | 6 | #define topology_core_id(cpu) (cpu_data(cpu).core_id) |
7 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) | 7 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) |
8 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 8 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) |
9 | #define mc_capable() (sparc64_multi_core) | 9 | #define mc_capable() (sparc64_multi_core) |
10 | #define smt_capable() (sparc64_multi_core) | 10 | #define smt_capable() (sparc64_multi_core) |
11 | #endif /* CONFIG_SMP */ | 11 | #endif /* CONFIG_SMP */ |
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h index 78bc9eed26b2..9281dd8eb334 100644 --- a/include/asm-um/a.out.h +++ b/include/asm-um/a.out.h | |||
@@ -1,8 +1,12 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
1 | #ifndef __UM_A_OUT_H | 6 | #ifndef __UM_A_OUT_H |
2 | #define __UM_A_OUT_H | 7 | #define __UM_A_OUT_H |
3 | 8 | ||
4 | #include "asm/arch/a.out.h" | 9 | #include "asm/arch/a.out.h" |
5 | #include "choose-mode.h" | ||
6 | 10 | ||
7 | #undef STACK_TOP | 11 | #undef STACK_TOP |
8 | #undef STACK_TOP_MAX | 12 | #undef STACK_TOP_MAX |
@@ -13,10 +17,8 @@ extern unsigned long host_task_size; | |||
13 | 17 | ||
14 | #define STACK_ROOM (stacksizelim) | 18 | #define STACK_ROOM (stacksizelim) |
15 | 19 | ||
16 | extern int honeypot; | 20 | #define STACK_TOP task_size |
17 | #define STACK_TOP \ | ||
18 | CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size) | ||
19 | 21 | ||
20 | #define STACK_TOP_MAX STACK_TOP | 22 | #define STACK_TOP_MAX STACK_TOP |
21 | 23 | ||
22 | #endif | 24 | #endif |
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h index 9bab712dc5c0..ca94a136dfe8 100644 --- a/include/asm-um/elf-i386.h +++ b/include/asm-um/elf-i386.h | |||
@@ -5,7 +5,8 @@ | |||
5 | #ifndef __UM_ELF_I386_H | 5 | #ifndef __UM_ELF_I386_H |
6 | #define __UM_ELF_I386_H | 6 | #define __UM_ELF_I386_H |
7 | 7 | ||
8 | #include <asm/user.h> | 8 | #include <linux/sched.h> |
9 | #include "skas.h" | ||
9 | 10 | ||
10 | #define R_386_NONE 0 | 11 | #define R_386_NONE 0 |
11 | #define R_386_32 1 | 12 | #define R_386_32 1 |
@@ -75,6 +76,15 @@ typedef struct user_i387_struct elf_fpregset_t; | |||
75 | pr_reg[16] = PT_REGS_SS(regs); \ | 76 | pr_reg[16] = PT_REGS_SS(regs); \ |
76 | } while(0); | 77 | } while(0); |
77 | 78 | ||
79 | static inline int elf_core_copy_fpregs(struct task_struct *t, | ||
80 | elf_fpregset_t *fpu) | ||
81 | { | ||
82 | int cpu = ((struct thread_info *) t->stack)->cpu; | ||
83 | return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu); | ||
84 | } | ||
85 | |||
86 | #define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) | ||
87 | |||
78 | extern long elf_aux_hwcap; | 88 | extern long elf_aux_hwcap; |
79 | #define ELF_HWCAP (elf_aux_hwcap) | 89 | #define ELF_HWCAP (elf_aux_hwcap) |
80 | 90 | ||
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h index 857471c49dac..3c9d543eb61e 100644 --- a/include/asm-um/elf-x86_64.h +++ b/include/asm-um/elf-x86_64.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2003 PathScale, Inc. | 2 | * Copyright 2003 PathScale, Inc. |
3 | * Copyright (C) 2003 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * | 4 | * |
4 | * Licensed under the GPL | 5 | * Licensed under the GPL |
5 | */ | 6 | */ |
@@ -36,7 +37,7 @@ typedef unsigned long elf_greg_t; | |||
36 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | 37 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) |
37 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | 38 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
38 | 39 | ||
39 | typedef struct { } elf_fpregset_t; | 40 | typedef struct user_i387_struct elf_fpregset_t; |
40 | 41 | ||
41 | /* | 42 | /* |
42 | * This is used to ensure we don't load something for the wrong architecture. | 43 | * This is used to ensure we don't load something for the wrong architecture. |
@@ -67,27 +68,27 @@ typedef struct { } elf_fpregset_t; | |||
67 | } while (0) | 68 | } while (0) |
68 | 69 | ||
69 | #define ELF_CORE_COPY_REGS(pr_reg, regs) \ | 70 | #define ELF_CORE_COPY_REGS(pr_reg, regs) \ |
70 | (pr_reg)[0] = (regs)->regs.skas.regs[0]; \ | 71 | (pr_reg)[0] = (regs)->regs.gp[0]; \ |
71 | (pr_reg)[1] = (regs)->regs.skas.regs[1]; \ | 72 | (pr_reg)[1] = (regs)->regs.gp[1]; \ |
72 | (pr_reg)[2] = (regs)->regs.skas.regs[2]; \ | 73 | (pr_reg)[2] = (regs)->regs.gp[2]; \ |
73 | (pr_reg)[3] = (regs)->regs.skas.regs[3]; \ | 74 | (pr_reg)[3] = (regs)->regs.gp[3]; \ |
74 | (pr_reg)[4] = (regs)->regs.skas.regs[4]; \ | 75 | (pr_reg)[4] = (regs)->regs.gp[4]; \ |
75 | (pr_reg)[5] = (regs)->regs.skas.regs[5]; \ | 76 | (pr_reg)[5] = (regs)->regs.gp[5]; \ |
76 | (pr_reg)[6] = (regs)->regs.skas.regs[6]; \ | 77 | (pr_reg)[6] = (regs)->regs.gp[6]; \ |
77 | (pr_reg)[7] = (regs)->regs.skas.regs[7]; \ | 78 | (pr_reg)[7] = (regs)->regs.gp[7]; \ |
78 | (pr_reg)[8] = (regs)->regs.skas.regs[8]; \ | 79 | (pr_reg)[8] = (regs)->regs.gp[8]; \ |
79 | (pr_reg)[9] = (regs)->regs.skas.regs[9]; \ | 80 | (pr_reg)[9] = (regs)->regs.gp[9]; \ |
80 | (pr_reg)[10] = (regs)->regs.skas.regs[10]; \ | 81 | (pr_reg)[10] = (regs)->regs.gp[10]; \ |
81 | (pr_reg)[11] = (regs)->regs.skas.regs[11]; \ | 82 | (pr_reg)[11] = (regs)->regs.gp[11]; \ |
82 | (pr_reg)[12] = (regs)->regs.skas.regs[12]; \ | 83 | (pr_reg)[12] = (regs)->regs.gp[12]; \ |
83 | (pr_reg)[13] = (regs)->regs.skas.regs[13]; \ | 84 | (pr_reg)[13] = (regs)->regs.gp[13]; \ |
84 | (pr_reg)[14] = (regs)->regs.skas.regs[14]; \ | 85 | (pr_reg)[14] = (regs)->regs.gp[14]; \ |
85 | (pr_reg)[15] = (regs)->regs.skas.regs[15]; \ | 86 | (pr_reg)[15] = (regs)->regs.gp[15]; \ |
86 | (pr_reg)[16] = (regs)->regs.skas.regs[16]; \ | 87 | (pr_reg)[16] = (regs)->regs.gp[16]; \ |
87 | (pr_reg)[17] = (regs)->regs.skas.regs[17]; \ | 88 | (pr_reg)[17] = (regs)->regs.gp[17]; \ |
88 | (pr_reg)[18] = (regs)->regs.skas.regs[18]; \ | 89 | (pr_reg)[18] = (regs)->regs.gp[18]; \ |
89 | (pr_reg)[19] = (regs)->regs.skas.regs[19]; \ | 90 | (pr_reg)[19] = (regs)->regs.gp[19]; \ |
90 | (pr_reg)[20] = (regs)->regs.skas.regs[20]; \ | 91 | (pr_reg)[20] = (regs)->regs.gp[20]; \ |
91 | (pr_reg)[21] = current->thread.arch.fs; \ | 92 | (pr_reg)[21] = current->thread.arch.fs; \ |
92 | (pr_reg)[22] = 0; \ | 93 | (pr_reg)[22] = 0; \ |
93 | (pr_reg)[23] = 0; \ | 94 | (pr_reg)[23] = 0; \ |
@@ -122,14 +123,3 @@ extern long elf_aux_hwcap; | |||
122 | #define SET_PERSONALITY(ex, ibcs2) do ; while(0) | 123 | #define SET_PERSONALITY(ex, ibcs2) do ; while(0) |
123 | 124 | ||
124 | #endif | 125 | #endif |
125 | |||
126 | /* | ||
127 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
128 | * Emacs will notice this stuff at the end of the file and automatically | ||
129 | * adjust the settings for this buffer only. This must remain at the end | ||
130 | * of the file. | ||
131 | * --------------------------------------------------------------------------- | ||
132 | * Local variables: | ||
133 | * c-file-style: "linux" | ||
134 | * End: | ||
135 | */ | ||
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h index 96f82a456ce6..b2553f3e87eb 100644 --- a/include/asm-um/ldt.h +++ b/include/asm-um/ldt.h | |||
@@ -11,11 +11,7 @@ | |||
11 | #include "asm/semaphore.h" | 11 | #include "asm/semaphore.h" |
12 | #include "asm/host_ldt.h" | 12 | #include "asm/host_ldt.h" |
13 | 13 | ||
14 | struct mmu_context_skas; | ||
15 | extern void ldt_host_info(void); | 14 | extern void ldt_host_info(void); |
16 | extern long init_new_ldt(struct mmu_context_skas * to_mm, | ||
17 | struct mmu_context_skas * from_mm); | ||
18 | extern void free_ldt(struct mmu_context_skas * mm); | ||
19 | 15 | ||
20 | #define LDT_PAGES_MAX \ | 16 | #define LDT_PAGES_MAX \ |
21 | ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) | 17 | ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) |
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h index 9aa4b44e8cc1..5f3b863aef9a 100644 --- a/include/asm-um/mmu_context.h +++ b/include/asm-um/mmu_context.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -9,7 +9,6 @@ | |||
9 | #include <asm-generic/mm_hooks.h> | 9 | #include <asm-generic/mm_hooks.h> |
10 | 10 | ||
11 | #include "linux/sched.h" | 11 | #include "linux/sched.h" |
12 | #include "choose-mode.h" | ||
13 | #include "um_mmu.h" | 12 | #include "um_mmu.h" |
14 | 13 | ||
15 | #define get_mmu_context(task) do ; while(0) | 14 | #define get_mmu_context(task) do ; while(0) |
@@ -30,8 +29,7 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) | |||
30 | * possible. | 29 | * possible. |
31 | */ | 30 | */ |
32 | if (old != new && (current->flags & PF_BORROWED_MM)) | 31 | if (old != new && (current->flags & PF_BORROWED_MM)) |
33 | CHOOSE_MODE(force_flush_all(), | 32 | __switch_mm(&new->context.id); |
34 | switch_mm_skas(&new->context.skas.id)); | ||
35 | } | 33 | } |
36 | 34 | ||
37 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | 35 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, |
@@ -43,8 +41,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
43 | cpu_clear(cpu, prev->cpu_vm_mask); | 41 | cpu_clear(cpu, prev->cpu_vm_mask); |
44 | cpu_set(cpu, next->cpu_vm_mask); | 42 | cpu_set(cpu, next->cpu_vm_mask); |
45 | if(next != &init_mm) | 43 | if(next != &init_mm) |
46 | CHOOSE_MODE((void) 0, | 44 | __switch_mm(&next->context.id); |
47 | switch_mm_skas(&next->context.skas.id)); | ||
48 | } | 45 | } |
49 | } | 46 | } |
50 | 47 | ||
@@ -53,38 +50,8 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, | |||
53 | { | 50 | { |
54 | } | 51 | } |
55 | 52 | ||
56 | extern int init_new_context_skas(struct task_struct *task, | 53 | extern int init_new_context(struct task_struct *task, struct mm_struct *mm); |
57 | struct mm_struct *mm); | ||
58 | 54 | ||
59 | static inline int init_new_context_tt(struct task_struct *task, | 55 | extern void destroy_context(struct mm_struct *mm); |
60 | struct mm_struct *mm) | ||
61 | { | ||
62 | return(0); | ||
63 | } | ||
64 | |||
65 | static inline int init_new_context(struct task_struct *task, | ||
66 | struct mm_struct *mm) | ||
67 | { | ||
68 | return(CHOOSE_MODE_PROC(init_new_context_tt, init_new_context_skas, | ||
69 | task, mm)); | ||
70 | } | ||
71 | |||
72 | extern void destroy_context_skas(struct mm_struct *mm); | ||
73 | |||
74 | static inline void destroy_context(struct mm_struct *mm) | ||
75 | { | ||
76 | CHOOSE_MODE((void) 0, destroy_context_skas(mm)); | ||
77 | } | ||
78 | 56 | ||
79 | #endif | 57 | #endif |
80 | |||
81 | /* | ||
82 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
83 | * Emacs will notice this stuff at the end of the file and automatically | ||
84 | * adjust the settings for this buffer only. This must remain at the end | ||
85 | * of the file. | ||
86 | * --------------------------------------------------------------------------- | ||
87 | * Local variables: | ||
88 | * c-file-style: "linux" | ||
89 | * End: | ||
90 | */ | ||
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 8e310d81e5b4..4b424c75fca5 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | struct page; | 10 | struct page; |
11 | 11 | ||
12 | #include <linux/types.h> | ||
12 | #include <asm/vm-flags.h> | 13 | #include <asm/vm-flags.h> |
13 | 14 | ||
14 | /* PAGE_SHIFT determines the page size */ | 15 | /* PAGE_SHIFT determines the page size */ |
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h index 34ab268ef40e..14904876e8fb 100644 --- a/include/asm-um/pgalloc.h +++ b/include/asm-um/pgalloc.h | |||
@@ -42,7 +42,7 @@ static inline void pte_free(struct page *pte) | |||
42 | 42 | ||
43 | #ifdef CONFIG_3_LEVEL_PGTABLES | 43 | #ifdef CONFIG_3_LEVEL_PGTABLES |
44 | 44 | ||
45 | extern __inline__ void pmd_free(pmd_t *pmd) | 45 | static inline void pmd_free(pmd_t *pmd) |
46 | { | 46 | { |
47 | free_page((unsigned long)pmd); | 47 | free_page((unsigned long)pmd); |
48 | } | 48 | } |
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h index ca0c2a92a112..aa82b88db805 100644 --- a/include/asm-um/pgtable-3level.h +++ b/include/asm-um/pgtable-3level.h | |||
@@ -69,7 +69,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
69 | return pmd; | 69 | return pmd; |
70 | } | 70 | } |
71 | 71 | ||
72 | extern inline void pud_clear (pud_t *pud) | 72 | static inline void pud_clear (pud_t *pud) |
73 | { | 73 | { |
74 | set_pud(pud, __pud(0)); | 74 | set_pud(pud, __pud(0)); |
75 | } | 75 | } |
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h index d99bbddffdb9..78c0599cc80c 100644 --- a/include/asm-um/processor-generic.h +++ b/include/asm-um/processor-generic.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -11,44 +11,32 @@ struct pt_regs; | |||
11 | struct task_struct; | 11 | struct task_struct; |
12 | 12 | ||
13 | #include "asm/ptrace.h" | 13 | #include "asm/ptrace.h" |
14 | #include "choose-mode.h" | ||
15 | #include "registers.h" | 14 | #include "registers.h" |
16 | #include "sysdep/archsetjmp.h" | 15 | #include "sysdep/archsetjmp.h" |
17 | 16 | ||
18 | struct mm_struct; | 17 | struct mm_struct; |
19 | 18 | ||
20 | struct thread_struct { | 19 | struct thread_struct { |
21 | /* This flag is set to 1 before calling do_fork (and analyzed in | 20 | struct task_struct *saved_task; |
21 | /* | ||
22 | * This flag is set to 1 before calling do_fork (and analyzed in | ||
22 | * copy_thread) to mark that we are begin called from userspace (fork / | 23 | * copy_thread) to mark that we are begin called from userspace (fork / |
23 | * vfork / clone), and reset to 0 after. It is left to 0 when called | 24 | * vfork / clone), and reset to 0 after. It is left to 0 when called |
24 | * from kernelspace (i.e. kernel_thread() or fork_idle(), as of 2.6.11). */ | 25 | * from kernelspace (i.e. kernel_thread() or fork_idle(), |
25 | struct task_struct *saved_task; | 26 | * as of 2.6.11). |
27 | */ | ||
26 | int forking; | 28 | int forking; |
27 | int nsyscalls; | 29 | int nsyscalls; |
28 | struct pt_regs regs; | 30 | struct pt_regs regs; |
29 | int singlestep_syscall; | 31 | int singlestep_syscall; |
30 | void *fault_addr; | 32 | void *fault_addr; |
31 | void *fault_catcher; | 33 | jmp_buf *fault_catcher; |
32 | struct task_struct *prev_sched; | 34 | struct task_struct *prev_sched; |
33 | unsigned long temp_stack; | 35 | unsigned long temp_stack; |
34 | void *exec_buf; | 36 | jmp_buf *exec_buf; |
35 | struct arch_thread arch; | 37 | struct arch_thread arch; |
36 | union { | 38 | jmp_buf switch_buf; |
37 | #ifdef CONFIG_MODE_TT | 39 | int mm_count; |
38 | struct { | ||
39 | int extern_pid; | ||
40 | int tracing; | ||
41 | int switch_pipe[2]; | ||
42 | int vm_seq; | ||
43 | } tt; | ||
44 | #endif | ||
45 | #ifdef CONFIG_MODE_SKAS | ||
46 | struct { | ||
47 | jmp_buf switch_buf; | ||
48 | int mm_count; | ||
49 | } skas; | ||
50 | #endif | ||
51 | } mode; | ||
52 | struct { | 40 | struct { |
53 | int op; | 41 | int op; |
54 | union { | 42 | union { |
@@ -71,7 +59,7 @@ struct thread_struct { | |||
71 | { \ | 59 | { \ |
72 | .forking = 0, \ | 60 | .forking = 0, \ |
73 | .nsyscalls = 0, \ | 61 | .nsyscalls = 0, \ |
74 | .regs = EMPTY_REGS, \ | 62 | .regs = EMPTY_REGS, \ |
75 | .fault_addr = NULL, \ | 63 | .fault_addr = NULL, \ |
76 | .prev_sched = NULL, \ | 64 | .prev_sched = NULL, \ |
77 | .temp_stack = 0, \ | 65 | .temp_stack = 0, \ |
@@ -86,7 +74,10 @@ typedef struct { | |||
86 | 74 | ||
87 | extern struct task_struct *alloc_task_struct(void); | 75 | extern struct task_struct *alloc_task_struct(void); |
88 | 76 | ||
89 | extern void release_thread(struct task_struct *); | 77 | static inline void release_thread(struct task_struct *task) |
78 | { | ||
79 | } | ||
80 | |||
90 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | 81 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); |
91 | 82 | ||
92 | static inline void prepare_to_copy(struct task_struct *tsk) | 83 | static inline void prepare_to_copy(struct task_struct *tsk) |
@@ -136,12 +127,7 @@ extern struct cpuinfo_um cpu_data[]; | |||
136 | #endif | 127 | #endif |
137 | 128 | ||
138 | 129 | ||
139 | #ifdef CONFIG_MODE_SKAS | 130 | #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf) |
140 | #define KSTK_REG(tsk, reg) \ | ||
141 | get_thread_reg(reg, &tsk->thread.mode.skas.switch_buf) | ||
142 | #else | ||
143 | #define KSTK_REG(tsk, reg) (0xbadbabe) | ||
144 | #endif | ||
145 | #define get_wchan(p) (0) | 131 | #define get_wchan(p) (0) |
146 | 132 | ||
147 | #endif | 133 | #endif |
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h index 31c2d4d685bd..d946bf2d334a 100644 --- a/include/asm-um/processor-x86_64.h +++ b/include/asm-um/processor-x86_64.h | |||
@@ -18,7 +18,7 @@ struct arch_thread { | |||
18 | }; | 18 | }; |
19 | 19 | ||
20 | /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ | 20 | /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ |
21 | extern inline void rep_nop(void) | 21 | static inline void rep_nop(void) |
22 | { | 22 | { |
23 | __asm__ __volatile__("rep;nop": : :"memory"); | 23 | __asm__ __volatile__("rep;nop": : :"memory"); |
24 | } | 24 | } |
diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h index 99c87c5ce994..6aefcd32fc61 100644 --- a/include/asm-um/ptrace-generic.h +++ b/include/asm-um/ptrace-generic.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -9,10 +9,11 @@ | |||
9 | #ifndef __ASSEMBLY__ | 9 | #ifndef __ASSEMBLY__ |
10 | 10 | ||
11 | #include "asm/arch/ptrace-abi.h" | 11 | #include "asm/arch/ptrace-abi.h" |
12 | #include <asm/user.h> | ||
12 | #include "sysdep/ptrace.h" | 13 | #include "sysdep/ptrace.h" |
13 | 14 | ||
14 | struct pt_regs { | 15 | struct pt_regs { |
15 | union uml_pt_regs regs; | 16 | struct uml_pt_regs regs; |
16 | }; | 17 | }; |
17 | 18 | ||
18 | #define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS } | 19 | #define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS } |
@@ -35,16 +36,18 @@ struct pt_regs { | |||
35 | 36 | ||
36 | struct task_struct; | 37 | struct task_struct; |
37 | 38 | ||
39 | extern long subarch_ptrace(struct task_struct *child, long request, long addr, | ||
40 | long data); | ||
38 | extern unsigned long getreg(struct task_struct *child, int regno); | 41 | extern unsigned long getreg(struct task_struct *child, int regno); |
39 | extern int putreg(struct task_struct *child, int regno, unsigned long value); | 42 | extern int putreg(struct task_struct *child, int regno, unsigned long value); |
40 | extern int get_fpregs(unsigned long buf, struct task_struct *child); | 43 | extern int get_fpregs(struct user_i387_struct __user *buf, |
41 | extern int set_fpregs(unsigned long buf, struct task_struct *child); | 44 | struct task_struct *child); |
42 | extern int get_fpxregs(unsigned long buf, struct task_struct *child); | 45 | extern int set_fpregs(struct user_i387_struct __user *buf, |
43 | extern int set_fpxregs(unsigned long buf, struct task_struct *tsk); | 46 | struct task_struct *child); |
44 | 47 | ||
45 | extern void show_regs(struct pt_regs *regs); | 48 | extern void show_regs(struct pt_regs *regs); |
46 | 49 | ||
47 | extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, | 50 | extern void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs, |
48 | int error_code); | 51 | int error_code); |
49 | 52 | ||
50 | extern int arch_copy_tls(struct task_struct *new); | 53 | extern int arch_copy_tls(struct task_struct *new); |
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h index 6e2528bb0083..b2d24c5ea2c3 100644 --- a/include/asm-um/ptrace-i386.h +++ b/include/asm-um/ptrace-i386.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -9,10 +9,9 @@ | |||
9 | #define HOST_AUDIT_ARCH AUDIT_ARCH_I386 | 9 | #define HOST_AUDIT_ARCH AUDIT_ARCH_I386 |
10 | 10 | ||
11 | #include "linux/compiler.h" | 11 | #include "linux/compiler.h" |
12 | #include "sysdep/ptrace.h" | ||
13 | #include "asm/ptrace-generic.h" | 12 | #include "asm/ptrace-generic.h" |
14 | #include "asm/host_ldt.h" | 13 | #include <asm/user.h> |
15 | #include "choose-mode.h" | 14 | #include "sysdep/ptrace.h" |
16 | 15 | ||
17 | #define PT_REGS_EAX(r) UPT_EAX(&(r)->regs) | 16 | #define PT_REGS_EAX(r) UPT_EAX(&(r)->regs) |
18 | #define PT_REGS_EBX(r) UPT_EBX(&(r)->regs) | 17 | #define PT_REGS_EBX(r) UPT_EBX(&(r)->regs) |
@@ -41,34 +40,21 @@ | |||
41 | 40 | ||
42 | #define user_mode(r) UPT_IS_USER(&(r)->regs) | 41 | #define user_mode(r) UPT_IS_USER(&(r)->regs) |
43 | 42 | ||
43 | /* | ||
44 | * Forward declaration to avoid including sysdep/tls.h, which causes a | ||
45 | * circular include, and compilation failures. | ||
46 | */ | ||
47 | struct user_desc; | ||
48 | |||
49 | extern int get_fpxregs(struct user_fxsr_struct __user *buf, | ||
50 | struct task_struct *child); | ||
51 | extern int set_fpxregs(struct user_fxsr_struct __user *buf, | ||
52 | struct task_struct *tsk); | ||
53 | |||
44 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, | 54 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, |
45 | struct user_desc __user *user_desc); | 55 | struct user_desc __user *user_desc); |
46 | 56 | ||
47 | extern int ptrace_set_thread_area(struct task_struct *child, int idx, | 57 | extern int ptrace_set_thread_area(struct task_struct *child, int idx, |
48 | struct user_desc __user *user_desc); | 58 | struct user_desc __user *user_desc); |
49 | 59 | ||
50 | extern int do_set_thread_area_skas(struct user_desc *info); | ||
51 | extern int do_get_thread_area_skas(struct user_desc *info); | ||
52 | |||
53 | extern int do_set_thread_area_tt(struct user_desc *info); | ||
54 | extern int do_get_thread_area_tt(struct user_desc *info); | ||
55 | |||
56 | extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to); | ||
57 | extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to); | ||
58 | |||
59 | extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to); | ||
60 | extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to); | ||
61 | |||
62 | static inline int do_get_thread_area(struct user_desc *info) | ||
63 | { | ||
64 | return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info); | ||
65 | } | ||
66 | |||
67 | static inline int do_set_thread_area(struct user_desc *info) | ||
68 | { | ||
69 | return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info); | ||
70 | } | ||
71 | |||
72 | struct task_struct; | ||
73 | |||
74 | #endif | 60 | #endif |
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h index bf61d17de3f7..4c475350dcf0 100644 --- a/include/asm-um/ptrace-x86_64.h +++ b/include/asm-um/ptrace-x86_64.h | |||
@@ -76,15 +76,6 @@ static inline int ptrace_set_thread_area(struct task_struct *child, int idx, | |||
76 | return -ENOSYS; | 76 | return -ENOSYS; |
77 | } | 77 | } |
78 | 78 | ||
79 | static inline void arch_switch_to_tt(struct task_struct *from, | 79 | extern long arch_prctl(struct task_struct *task, int code, |
80 | struct task_struct *to) | 80 | unsigned long __user *addr); |
81 | { | ||
82 | } | ||
83 | |||
84 | extern void arch_switch_to_skas(struct task_struct *from, | ||
85 | struct task_struct *to); | ||
86 | |||
87 | extern long arch_prctl_skas(struct task_struct *task, int code, | ||
88 | unsigned long __user *addr); | ||
89 | |||
90 | #endif | 81 | #endif |
diff --git a/include/asm-um/smp.h b/include/asm-um/smp.h index 84f8cf29324e..f27a96313174 100644 --- a/include/asm-um/smp.h +++ b/include/asm-um/smp.h | |||
@@ -18,7 +18,7 @@ extern int hard_smp_processor_id(void); | |||
18 | extern int ncpus; | 18 | extern int ncpus; |
19 | 19 | ||
20 | 20 | ||
21 | extern inline void smp_cpus_done(unsigned int maxcpus) | 21 | static inline void smp_cpus_done(unsigned int maxcpus) |
22 | { | 22 | { |
23 | } | 23 | } |
24 | 24 | ||
diff --git a/include/asm-um/tlbflush.h b/include/asm-um/tlbflush.h index e78c28c1f350..9d647c55350b 100644 --- a/include/asm-um/tlbflush.h +++ b/include/asm-um/tlbflush.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -7,7 +7,6 @@ | |||
7 | #define __UM_TLBFLUSH_H | 7 | #define __UM_TLBFLUSH_H |
8 | 8 | ||
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include "choose-mode.h" | ||
11 | 10 | ||
12 | /* | 11 | /* |
13 | * TLB flushing: | 12 | * TLB flushing: |
@@ -25,19 +24,7 @@ extern void flush_tlb_all(void); | |||
25 | extern void flush_tlb_mm(struct mm_struct *mm); | 24 | extern void flush_tlb_mm(struct mm_struct *mm); |
26 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | 25 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, |
27 | unsigned long end); | 26 | unsigned long end); |
28 | extern void flush_tlb_page_skas(struct vm_area_struct *vma, | 27 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long address); |
29 | unsigned long address); | ||
30 | |||
31 | static inline void flush_tlb_page(struct vm_area_struct *vma, | ||
32 | unsigned long address) | ||
33 | { | ||
34 | address &= PAGE_MASK; | ||
35 | |||
36 | CHOOSE_MODE(flush_tlb_range(vma, address, address + PAGE_SIZE), | ||
37 | flush_tlb_page_skas(vma, address)); | ||
38 | } | ||
39 | |||
40 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); | ||
41 | extern void flush_tlb_kernel_vm(void); | 28 | extern void flush_tlb_kernel_vm(void); |
42 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); | 29 | extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); |
43 | extern void __flush_tlb_one(unsigned long addr); | 30 | extern void __flush_tlb_one(unsigned long addr); |
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index 16c734af9193..077032d4fc47 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h | |||
@@ -80,7 +80,7 @@ | |||
80 | __put_user(x, private_ptr) : -EFAULT); \ | 80 | __put_user(x, private_ptr) : -EFAULT); \ |
81 | }) | 81 | }) |
82 | 82 | ||
83 | #define strlen_user(str) strnlen_user(str, ~0UL >> 1) | 83 | #define strlen_user(str) strnlen_user(str, ~0U >> 1) |
84 | 84 | ||
85 | struct exception_table_entry | 85 | struct exception_table_entry |
86 | { | 86 | { |
diff --git a/include/asm-x86/cpufeature_32.h b/include/asm-x86/cpufeature_32.h index 7b3aa28ebc6e..f17e688dfb05 100644 --- a/include/asm-x86/cpufeature_32.h +++ b/include/asm-x86/cpufeature_32.h | |||
@@ -92,6 +92,7 @@ | |||
92 | #define X86_FEATURE_CID (4*32+10) /* Context ID */ | 92 | #define X86_FEATURE_CID (4*32+10) /* Context ID */ |
93 | #define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ | 93 | #define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ |
94 | #define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ | 94 | #define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ |
95 | #define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */ | ||
95 | 96 | ||
96 | /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ | 97 | /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ |
97 | #define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ | 98 | #define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ |
diff --git a/include/asm-x86/kdebug_32.h b/include/asm-x86/kdebug_32.h index a185b5f73e7f..181d437eef4b 100644 --- a/include/asm-x86/kdebug_32.h +++ b/include/asm-x86/kdebug_32.h | |||
@@ -5,14 +5,9 @@ | |||
5 | * Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com> | 5 | * Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com> |
6 | * from x86_64 architecture. | 6 | * from x86_64 architecture. |
7 | */ | 7 | */ |
8 | #include <linux/notifier.h> | ||
9 | 8 | ||
10 | struct pt_regs; | 9 | struct pt_regs; |
11 | 10 | ||
12 | extern int register_page_fault_notifier(struct notifier_block *); | ||
13 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
14 | |||
15 | |||
16 | /* Grossly misnamed. */ | 11 | /* Grossly misnamed. */ |
17 | enum die_val { | 12 | enum die_val { |
18 | DIE_OOPS = 1, | 13 | DIE_OOPS = 1, |
@@ -27,7 +22,6 @@ enum die_val { | |||
27 | DIE_GPF, | 22 | DIE_GPF, |
28 | DIE_CALL, | 23 | DIE_CALL, |
29 | DIE_NMI_IPI, | 24 | DIE_NMI_IPI, |
30 | DIE_PAGE_FAULT, | ||
31 | }; | 25 | }; |
32 | 26 | ||
33 | #endif | 27 | #endif |
diff --git a/include/asm-x86/kdebug_64.h b/include/asm-x86/kdebug_64.h index d7e2bcf49e4f..df413e05375e 100644 --- a/include/asm-x86/kdebug_64.h +++ b/include/asm-x86/kdebug_64.h | |||
@@ -1,13 +1,10 @@ | |||
1 | #ifndef _X86_64_KDEBUG_H | 1 | #ifndef _X86_64_KDEBUG_H |
2 | #define _X86_64_KDEBUG_H 1 | 2 | #define _X86_64_KDEBUG_H 1 |
3 | 3 | ||
4 | #include <linux/notifier.h> | 4 | #include <linux/compiler.h> |
5 | 5 | ||
6 | struct pt_regs; | 6 | struct pt_regs; |
7 | 7 | ||
8 | extern int register_page_fault_notifier(struct notifier_block *); | ||
9 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
10 | |||
11 | /* Grossly misnamed. */ | 8 | /* Grossly misnamed. */ |
12 | enum die_val { | 9 | enum die_val { |
13 | DIE_OOPS = 1, | 10 | DIE_OOPS = 1, |
@@ -22,7 +19,6 @@ enum die_val { | |||
22 | DIE_GPF, | 19 | DIE_GPF, |
23 | DIE_CALL, | 20 | DIE_CALL, |
24 | DIE_NMI_IPI, | 21 | DIE_NMI_IPI, |
25 | DIE_PAGE_FAULT, | ||
26 | }; | 22 | }; |
27 | 23 | ||
28 | extern void printk_address(unsigned long address); | 24 | extern void printk_address(unsigned long address); |
diff --git a/include/asm-x86/kprobes_32.h b/include/asm-x86/kprobes_32.h index 06f7303c30ca..b772d5b38685 100644 --- a/include/asm-x86/kprobes_32.h +++ b/include/asm-x86/kprobes_32.h | |||
@@ -43,9 +43,10 @@ typedef u8 kprobe_opcode_t; | |||
43 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) | 43 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) |
44 | 44 | ||
45 | #define ARCH_SUPPORTS_KRETPROBES | 45 | #define ARCH_SUPPORTS_KRETPROBES |
46 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | ||
47 | #define flush_insn_slot(p) do { } while (0) | 46 | #define flush_insn_slot(p) do { } while (0) |
48 | 47 | ||
48 | extern const int kretprobe_blacklist_size; | ||
49 | |||
49 | void arch_remove_kprobe(struct kprobe *p); | 50 | void arch_remove_kprobe(struct kprobe *p); |
50 | void kretprobe_trampoline(void); | 51 | void kretprobe_trampoline(void); |
51 | 52 | ||
@@ -89,4 +90,5 @@ static inline void restore_interrupts(struct pt_regs *regs) | |||
89 | 90 | ||
90 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 91 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
91 | unsigned long val, void *data); | 92 | unsigned long val, void *data); |
93 | extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); | ||
92 | #endif /* _ASM_KPROBES_H */ | 94 | #endif /* _ASM_KPROBES_H */ |
diff --git a/include/asm-x86/kprobes_64.h b/include/asm-x86/kprobes_64.h index 7db825403e01..53f4d8507354 100644 --- a/include/asm-x86/kprobes_64.h +++ b/include/asm-x86/kprobes_64.h | |||
@@ -42,7 +42,7 @@ typedef u8 kprobe_opcode_t; | |||
42 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) | 42 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) |
43 | 43 | ||
44 | #define ARCH_SUPPORTS_KRETPROBES | 44 | #define ARCH_SUPPORTS_KRETPROBES |
45 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | 45 | extern const int kretprobe_blacklist_size; |
46 | 46 | ||
47 | void kretprobe_trampoline(void); | 47 | void kretprobe_trampoline(void); |
48 | extern void arch_remove_kprobe(struct kprobe *p); | 48 | extern void arch_remove_kprobe(struct kprobe *p); |
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h index 88adf1afb0a2..c3b52bcb171e 100644 --- a/include/asm-x86/page_64.h +++ b/include/asm-x86/page_64.h | |||
@@ -134,6 +134,7 @@ extern unsigned long __phys_addr(unsigned long); | |||
134 | VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 134 | VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
135 | 135 | ||
136 | #define __HAVE_ARCH_GATE_AREA 1 | 136 | #define __HAVE_ARCH_GATE_AREA 1 |
137 | #define vmemmap ((struct page *)VMEMMAP_START) | ||
137 | 138 | ||
138 | #include <asm-generic/memory_model.h> | 139 | #include <asm-generic/memory_model.h> |
139 | #include <asm-generic/page.h> | 140 | #include <asm-generic/page.h> |
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h index 57dd6b3107ea..a79f5355e3b0 100644 --- a/include/asm-x86/pgtable_64.h +++ b/include/asm-x86/pgtable_64.h | |||
@@ -137,6 +137,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long | |||
137 | #define MAXMEM _AC(0x3fffffffffff, UL) | 137 | #define MAXMEM _AC(0x3fffffffffff, UL) |
138 | #define VMALLOC_START _AC(0xffffc20000000000, UL) | 138 | #define VMALLOC_START _AC(0xffffc20000000000, UL) |
139 | #define VMALLOC_END _AC(0xffffe1ffffffffff, UL) | 139 | #define VMALLOC_END _AC(0xffffe1ffffffffff, UL) |
140 | #define VMEMMAP_START _AC(0xffffe20000000000, UL) | ||
140 | #define MODULES_VADDR _AC(0xffffffff88000000, UL) | 141 | #define MODULES_VADDR _AC(0xffffffff88000000, UL) |
141 | #define MODULES_END _AC(0xfffffffffff00000, UL) | 142 | #define MODULES_END _AC(0xfffffffffff00000, UL) |
142 | #define MODULES_LEN (MODULES_END - MODULES_VADDR) | 143 | #define MODULES_LEN (MODULES_END - MODULES_VADDR) |
diff --git a/include/asm-x86/smp_32.h b/include/asm-x86/smp_32.h index 1f73bde165b1..955dd7c8538f 100644 --- a/include/asm-x86/smp_32.h +++ b/include/asm-x86/smp_32.h | |||
@@ -30,8 +30,8 @@ | |||
30 | extern void smp_alloc_memory(void); | 30 | extern void smp_alloc_memory(void); |
31 | extern int pic_mode; | 31 | extern int pic_mode; |
32 | extern int smp_num_siblings; | 32 | extern int smp_num_siblings; |
33 | extern cpumask_t cpu_sibling_map[]; | 33 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
34 | extern cpumask_t cpu_core_map[]; | 34 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); |
35 | 35 | ||
36 | extern void (*mtrr_hook) (void); | 36 | extern void (*mtrr_hook) (void); |
37 | extern void zap_low_mappings (void); | 37 | extern void zap_low_mappings (void); |
diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h index 3f303d2365ed..f5bcee1c0927 100644 --- a/include/asm-x86/smp_64.h +++ b/include/asm-x86/smp_64.h | |||
@@ -38,8 +38,15 @@ extern void unlock_ipi_call_lock(void); | |||
38 | extern int smp_num_siblings; | 38 | extern int smp_num_siblings; |
39 | extern void smp_send_reschedule(int cpu); | 39 | extern void smp_send_reschedule(int cpu); |
40 | 40 | ||
41 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 41 | /* |
42 | extern cpumask_t cpu_core_map[NR_CPUS]; | 42 | * cpu_sibling_map and cpu_core_map now live |
43 | * in the per cpu area | ||
44 | * | ||
45 | * extern cpumask_t cpu_sibling_map[NR_CPUS]; | ||
46 | * extern cpumask_t cpu_core_map[NR_CPUS]; | ||
47 | */ | ||
48 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | ||
49 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); | ||
43 | extern u8 cpu_llc_id[NR_CPUS]; | 50 | extern u8 cpu_llc_id[NR_CPUS]; |
44 | 51 | ||
45 | #define SMP_TRAMPOLINE_BASE 0x6000 | 52 | #define SMP_TRAMPOLINE_BASE 0x6000 |
diff --git a/include/asm-x86/topology_32.h b/include/asm-x86/topology_32.h index 19b2dafd0c81..ae1074603c4b 100644 --- a/include/asm-x86/topology_32.h +++ b/include/asm-x86/topology_32.h | |||
@@ -30,8 +30,8 @@ | |||
30 | #ifdef CONFIG_X86_HT | 30 | #ifdef CONFIG_X86_HT |
31 | #define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) | 31 | #define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) |
32 | #define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) | 32 | #define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) |
33 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) | 33 | #define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu)) |
34 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 34 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #ifdef CONFIG_NUMA | 37 | #ifdef CONFIG_NUMA |
diff --git a/include/asm-x86/topology_64.h b/include/asm-x86/topology_64.h index 36e52fba7960..848c17f92226 100644 --- a/include/asm-x86/topology_64.h +++ b/include/asm-x86/topology_64.h | |||
@@ -58,8 +58,8 @@ extern int __node_distance(int, int); | |||
58 | #ifdef CONFIG_SMP | 58 | #ifdef CONFIG_SMP |
59 | #define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) | 59 | #define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) |
60 | #define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) | 60 | #define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) |
61 | #define topology_core_siblings(cpu) (cpu_core_map[cpu]) | 61 | #define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu)) |
62 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | 62 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) |
63 | #define mc_capable() (boot_cpu_data.x86_max_cores > 1) | 63 | #define mc_capable() (boot_cpu_data.x86_max_cores > 1) |
64 | #define smt_capable() (smp_num_siblings > 1) | 64 | #define smt_capable() (smp_num_siblings > 1) |
65 | #endif | 65 | #endif |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 638165f571da..b9fb8ee3308b 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -8,6 +8,12 @@ | |||
8 | */ | 8 | */ |
9 | #include <asm/bitops.h> | 9 | #include <asm/bitops.h> |
10 | 10 | ||
11 | #define for_each_bit(bit, addr, size) \ | ||
12 | for ((bit) = find_first_bit((addr), (size)); \ | ||
13 | (bit) < (size); \ | ||
14 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | ||
15 | |||
16 | |||
11 | static __inline__ int get_bitmask_order(unsigned int count) | 17 | static __inline__ int get_bitmask_order(unsigned int count) |
12 | { | 18 | { |
13 | int order; | 19 | int order; |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 35cadad84b14..da0d83fbadc0 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -203,10 +203,20 @@ void block_invalidatepage(struct page *page, unsigned long offset); | |||
203 | int block_write_full_page(struct page *page, get_block_t *get_block, | 203 | int block_write_full_page(struct page *page, get_block_t *get_block, |
204 | struct writeback_control *wbc); | 204 | struct writeback_control *wbc); |
205 | int block_read_full_page(struct page*, get_block_t*); | 205 | int block_read_full_page(struct page*, get_block_t*); |
206 | int block_write_begin(struct file *, struct address_space *, | ||
207 | loff_t, unsigned, unsigned, | ||
208 | struct page **, void **, get_block_t*); | ||
209 | int block_write_end(struct file *, struct address_space *, | ||
210 | loff_t, unsigned, unsigned, | ||
211 | struct page *, void *); | ||
212 | int generic_write_end(struct file *, struct address_space *, | ||
213 | loff_t, unsigned, unsigned, | ||
214 | struct page *, void *); | ||
215 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); | ||
206 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); | 216 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); |
207 | int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, | 217 | int cont_write_begin(struct file *, struct address_space *, loff_t, |
208 | loff_t *); | 218 | unsigned, unsigned, struct page **, void **, |
209 | int generic_cont_expand(struct inode *inode, loff_t size); | 219 | get_block_t *, loff_t *); |
210 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | 220 | int generic_cont_expand_simple(struct inode *inode, loff_t size); |
211 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 221 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
212 | int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, | 222 | int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, |
@@ -216,9 +226,13 @@ sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | |||
216 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); | 226 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); |
217 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 227 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
218 | int file_fsync(struct file *, struct dentry *, int); | 228 | int file_fsync(struct file *, struct dentry *, int); |
219 | int nobh_prepare_write(struct page*, unsigned, unsigned, get_block_t*); | 229 | int nobh_write_begin(struct file *, struct address_space *, |
220 | int nobh_commit_write(struct file *, struct page *, unsigned, unsigned); | 230 | loff_t, unsigned, unsigned, |
221 | int nobh_truncate_page(struct address_space *, loff_t); | 231 | struct page **, void **, get_block_t*); |
232 | int nobh_write_end(struct file *, struct address_space *, | ||
233 | loff_t, unsigned, unsigned, | ||
234 | struct page *, void *); | ||
235 | int nobh_truncate_page(struct address_space *, loff_t, get_block_t *); | ||
222 | int nobh_writepage(struct page *page, get_block_t *get_block, | 236 | int nobh_writepage(struct page *page, get_block_t *get_block, |
223 | struct writeback_control *wbc); | 237 | struct writeback_control *wbc); |
224 | 238 | ||
diff --git a/include/linux/connector.h b/include/linux/connector.h index b62f823e90cf..13fc4541bf23 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -36,14 +36,15 @@ | |||
36 | #define CN_VAL_CIFS 0x1 | 36 | #define CN_VAL_CIFS 0x1 |
37 | #define CN_W1_IDX 0x3 /* w1 communication */ | 37 | #define CN_W1_IDX 0x3 /* w1 communication */ |
38 | #define CN_W1_VAL 0x1 | 38 | #define CN_W1_VAL 0x1 |
39 | #define CN_IDX_V86D 0x4 | ||
40 | #define CN_VAL_V86D_UVESAFB 0x1 | ||
39 | 41 | ||
40 | 42 | #define CN_NETLINK_USERS 5 | |
41 | #define CN_NETLINK_USERS 4 | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * Maximum connector's message size. | 45 | * Maximum connector's message size. |
45 | */ | 46 | */ |
46 | #define CONNECTOR_MAX_MSG_SIZE 1024 | 47 | #define CONNECTOR_MAX_MSG_SIZE 16384 |
47 | 48 | ||
48 | /* | 49 | /* |
49 | * idx and val are unique identifiers which | 50 | * idx and val are unique identifiers which |
diff --git a/include/linux/console.h b/include/linux/console.h index 56a7bcda49cb..0a4542ddb73d 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -45,7 +45,8 @@ struct consw { | |||
45 | int (*con_font_get)(struct vc_data *, struct console_font *); | 45 | int (*con_font_get)(struct vc_data *, struct console_font *); |
46 | int (*con_font_default)(struct vc_data *, struct console_font *, char *); | 46 | int (*con_font_default)(struct vc_data *, struct console_font *, char *); |
47 | int (*con_font_copy)(struct vc_data *, int); | 47 | int (*con_font_copy)(struct vc_data *, int); |
48 | int (*con_resize)(struct vc_data *, unsigned int, unsigned int); | 48 | int (*con_resize)(struct vc_data *, unsigned int, unsigned int, |
49 | unsigned int); | ||
49 | int (*con_set_palette)(struct vc_data *, unsigned char *); | 50 | int (*con_set_palette)(struct vc_data *, unsigned char *); |
50 | int (*con_scrolldelta)(struct vc_data *, int); | 51 | int (*con_scrolldelta)(struct vc_data *, int); |
51 | int (*con_set_origin)(struct vc_data *); | 52 | int (*con_set_origin)(struct vc_data *); |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index dc77fed7b285..d71f7c0f931b 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -100,6 +100,7 @@ struct vc_data { | |||
100 | unsigned char vc_G1_charset; | 100 | unsigned char vc_G1_charset; |
101 | unsigned char vc_saved_G0; | 101 | unsigned char vc_saved_G0; |
102 | unsigned char vc_saved_G1; | 102 | unsigned char vc_saved_G1; |
103 | unsigned int vc_resize_user; /* resize request from user */ | ||
103 | unsigned int vc_bell_pitch; /* Console bell pitch */ | 104 | unsigned int vc_bell_pitch; /* Console bell pitch */ |
104 | unsigned int vc_bell_duration; /* Console bell duration */ | 105 | unsigned int vc_bell_duration; /* Console bell duration */ |
105 | struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ | 106 | struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 826b15e914e2..9e633ea103ce 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -93,7 +93,7 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) | |||
93 | return node_possible_map; | 93 | return node_possible_map; |
94 | } | 94 | } |
95 | 95 | ||
96 | #define cpuset_current_mems_allowed (node_online_map) | 96 | #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) |
97 | static inline void cpuset_init_current_mems_allowed(void) {} | 97 | static inline void cpuset_init_current_mems_allowed(void) {} |
98 | static inline void cpuset_update_task_memory_state(void) {} | 98 | static inline void cpuset_update_task_memory_state(void) {} |
99 | #define cpuset_nodes_subset_current_mems_allowed(nodes) (1) | 99 | #define cpuset_nodes_subset_current_mems_allowed(nodes) (1) |
diff --git a/include/linux/dca.h b/include/linux/dca.h new file mode 100644 index 000000000000..83eaecc6f8ab --- /dev/null +++ b/include/linux/dca.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef DCA_H | ||
2 | #define DCA_H | ||
3 | /* DCA Provider API */ | ||
4 | |||
5 | /* DCA Notifier Interface */ | ||
6 | void dca_register_notify(struct notifier_block *nb); | ||
7 | void dca_unregister_notify(struct notifier_block *nb); | ||
8 | |||
9 | #define DCA_PROVIDER_ADD 0x0001 | ||
10 | #define DCA_PROVIDER_REMOVE 0x0002 | ||
11 | |||
12 | struct dca_provider { | ||
13 | struct dca_ops *ops; | ||
14 | struct class_device *cd; | ||
15 | int id; | ||
16 | }; | ||
17 | |||
18 | struct dca_ops { | ||
19 | int (*add_requester) (struct dca_provider *, struct device *); | ||
20 | int (*remove_requester) (struct dca_provider *, struct device *); | ||
21 | u8 (*get_tag) (struct dca_provider *, int cpu); | ||
22 | }; | ||
23 | |||
24 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); | ||
25 | void free_dca_provider(struct dca_provider *dca); | ||
26 | int register_dca_provider(struct dca_provider *dca, struct device *dev); | ||
27 | void unregister_dca_provider(struct dca_provider *dca); | ||
28 | |||
29 | static inline void *dca_priv(struct dca_provider *dca) | ||
30 | { | ||
31 | return (void *)dca + sizeof(struct dca_provider); | ||
32 | } | ||
33 | |||
34 | /* Requester API */ | ||
35 | int dca_add_requester(struct device *dev); | ||
36 | int dca_remove_requester(struct device *dev); | ||
37 | u8 dca_get_tag(int cpu); | ||
38 | |||
39 | /* internal stuff */ | ||
40 | int __init dca_sysfs_init(void); | ||
41 | void __exit dca_sysfs_exit(void); | ||
42 | int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev); | ||
43 | void dca_sysfs_remove_provider(struct dca_provider *dca); | ||
44 | int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot); | ||
45 | void dca_sysfs_remove_req(struct dca_provider *dca, int slot); | ||
46 | |||
47 | #endif /* DCA_H */ | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2dc21cbeb304..0ebfafbd338c 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -24,6 +24,8 @@ enum dma_data_direction { | |||
24 | #define DMA_28BIT_MASK 0x000000000fffffffULL | 24 | #define DMA_28BIT_MASK 0x000000000fffffffULL |
25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL | 25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL |
26 | 26 | ||
27 | #define DMA_MASK_NONE 0x0ULL | ||
28 | |||
27 | static inline int valid_dma_direction(int dma_direction) | 29 | static inline int valid_dma_direction(int dma_direction) |
28 | { | 30 | { |
29 | return ((dma_direction == DMA_BIDIRECTIONAL) || | 31 | return ((dma_direction == DMA_BIDIRECTIONAL) || |
@@ -31,6 +33,11 @@ static inline int valid_dma_direction(int dma_direction) | |||
31 | (dma_direction == DMA_FROM_DEVICE)); | 33 | (dma_direction == DMA_FROM_DEVICE)); |
32 | } | 34 | } |
33 | 35 | ||
36 | static inline int is_device_dma_capable(struct device *dev) | ||
37 | { | ||
38 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; | ||
39 | } | ||
40 | |||
34 | #ifdef CONFIG_HAS_DMA | 41 | #ifdef CONFIG_HAS_DMA |
35 | #include <asm/dma-mapping.h> | 42 | #include <asm/dma-mapping.h> |
36 | #else | 43 | #else |
diff --git a/include/linux/fb.h b/include/linux/fb.h index cec54106aa87..58c57a33e5dd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -180,6 +180,7 @@ struct fb_bitfield { | |||
180 | }; | 180 | }; |
181 | 181 | ||
182 | #define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */ | 182 | #define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */ |
183 | #define FB_NONSTD_REV_PIX_IN_B 2 /* order of pixels in each byte is reversed */ | ||
183 | 184 | ||
184 | #define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/ | 185 | #define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/ |
185 | #define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */ | 186 | #define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */ |
@@ -206,6 +207,7 @@ struct fb_bitfield { | |||
206 | #define FB_VMODE_NONINTERLACED 0 /* non interlaced */ | 207 | #define FB_VMODE_NONINTERLACED 0 /* non interlaced */ |
207 | #define FB_VMODE_INTERLACED 1 /* interlaced */ | 208 | #define FB_VMODE_INTERLACED 1 /* interlaced */ |
208 | #define FB_VMODE_DOUBLE 2 /* double scan */ | 209 | #define FB_VMODE_DOUBLE 2 /* double scan */ |
210 | #define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first */ | ||
209 | #define FB_VMODE_MASK 255 | 211 | #define FB_VMODE_MASK 255 |
210 | 212 | ||
211 | #define FB_VMODE_YWRAP 256 /* ywrap instead of panning */ | 213 | #define FB_VMODE_YWRAP 256 /* ywrap instead of panning */ |
@@ -1054,6 +1056,7 @@ struct fb_videomode { | |||
1054 | u32 flag; | 1056 | u32 flag; |
1055 | }; | 1057 | }; |
1056 | 1058 | ||
1059 | extern const char *fb_mode_option; | ||
1057 | extern const struct fb_videomode vesa_modes[]; | 1060 | extern const struct fb_videomode vesa_modes[]; |
1058 | 1061 | ||
1059 | struct fb_modelist { | 1062 | struct fb_modelist { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4a6a21077bae..f70d52c46617 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -381,7 +381,7 @@ struct iattr { | |||
381 | * trying again. The aop will be taking reasonable | 381 | * trying again. The aop will be taking reasonable |
382 | * precautions not to livelock. If the caller held a page | 382 | * precautions not to livelock. If the caller held a page |
383 | * reference, it should drop it before retrying. Returned | 383 | * reference, it should drop it before retrying. Returned |
384 | * by readpage(), prepare_write(), and commit_write(). | 384 | * by readpage(). |
385 | * | 385 | * |
386 | * address_space_operation functions return these large constants to indicate | 386 | * address_space_operation functions return these large constants to indicate |
387 | * special semantics to the caller. These are much larger than the bytes in a | 387 | * special semantics to the caller. These are much larger than the bytes in a |
@@ -394,6 +394,9 @@ enum positive_aop_returns { | |||
394 | AOP_TRUNCATED_PAGE = 0x80001, | 394 | AOP_TRUNCATED_PAGE = 0x80001, |
395 | }; | 395 | }; |
396 | 396 | ||
397 | #define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ | ||
398 | #define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ | ||
399 | |||
397 | /* | 400 | /* |
398 | * oh the beauties of C type declarations. | 401 | * oh the beauties of C type declarations. |
399 | */ | 402 | */ |
@@ -401,6 +404,39 @@ struct page; | |||
401 | struct address_space; | 404 | struct address_space; |
402 | struct writeback_control; | 405 | struct writeback_control; |
403 | 406 | ||
407 | struct iov_iter { | ||
408 | const struct iovec *iov; | ||
409 | unsigned long nr_segs; | ||
410 | size_t iov_offset; | ||
411 | size_t count; | ||
412 | }; | ||
413 | |||
414 | size_t iov_iter_copy_from_user_atomic(struct page *page, | ||
415 | struct iov_iter *i, unsigned long offset, size_t bytes); | ||
416 | size_t iov_iter_copy_from_user(struct page *page, | ||
417 | struct iov_iter *i, unsigned long offset, size_t bytes); | ||
418 | void iov_iter_advance(struct iov_iter *i, size_t bytes); | ||
419 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); | ||
420 | size_t iov_iter_single_seg_count(struct iov_iter *i); | ||
421 | |||
422 | static inline void iov_iter_init(struct iov_iter *i, | ||
423 | const struct iovec *iov, unsigned long nr_segs, | ||
424 | size_t count, size_t written) | ||
425 | { | ||
426 | i->iov = iov; | ||
427 | i->nr_segs = nr_segs; | ||
428 | i->iov_offset = 0; | ||
429 | i->count = count + written; | ||
430 | |||
431 | iov_iter_advance(i, written); | ||
432 | } | ||
433 | |||
434 | static inline size_t iov_iter_count(struct iov_iter *i) | ||
435 | { | ||
436 | return i->count; | ||
437 | } | ||
438 | |||
439 | |||
404 | struct address_space_operations { | 440 | struct address_space_operations { |
405 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 441 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
406 | int (*readpage)(struct file *, struct page *); | 442 | int (*readpage)(struct file *, struct page *); |
@@ -421,6 +457,14 @@ struct address_space_operations { | |||
421 | */ | 457 | */ |
422 | int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); | 458 | int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); |
423 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | 459 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); |
460 | |||
461 | int (*write_begin)(struct file *, struct address_space *mapping, | ||
462 | loff_t pos, unsigned len, unsigned flags, | ||
463 | struct page **pagep, void **fsdata); | ||
464 | int (*write_end)(struct file *, struct address_space *mapping, | ||
465 | loff_t pos, unsigned len, unsigned copied, | ||
466 | struct page *page, void *fsdata); | ||
467 | |||
424 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 468 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
425 | sector_t (*bmap)(struct address_space *, sector_t); | 469 | sector_t (*bmap)(struct address_space *, sector_t); |
426 | void (*invalidatepage) (struct page *, unsigned long); | 470 | void (*invalidatepage) (struct page *, unsigned long); |
@@ -435,6 +479,18 @@ struct address_space_operations { | |||
435 | int (*launder_page) (struct page *); | 479 | int (*launder_page) (struct page *); |
436 | }; | 480 | }; |
437 | 481 | ||
482 | /* | ||
483 | * pagecache_write_begin/pagecache_write_end must be used by general code | ||
484 | * to write into the pagecache. | ||
485 | */ | ||
486 | int pagecache_write_begin(struct file *, struct address_space *mapping, | ||
487 | loff_t pos, unsigned len, unsigned flags, | ||
488 | struct page **pagep, void **fsdata); | ||
489 | |||
490 | int pagecache_write_end(struct file *, struct address_space *mapping, | ||
491 | loff_t pos, unsigned len, unsigned copied, | ||
492 | struct page *page, void *fsdata); | ||
493 | |||
438 | struct backing_dev_info; | 494 | struct backing_dev_info; |
439 | struct address_space { | 495 | struct address_space { |
440 | struct inode *host; /* owner: inode, block_device */ | 496 | struct inode *host; /* owner: inode, block_device */ |
@@ -697,16 +753,14 @@ struct fown_struct { | |||
697 | * Track a single file's readahead state | 753 | * Track a single file's readahead state |
698 | */ | 754 | */ |
699 | struct file_ra_state { | 755 | struct file_ra_state { |
700 | pgoff_t start; /* where readahead started */ | 756 | pgoff_t start; /* where readahead started */ |
701 | unsigned long size; /* # of readahead pages */ | 757 | unsigned int size; /* # of readahead pages */ |
702 | unsigned long async_size; /* do asynchronous readahead when | 758 | unsigned int async_size; /* do asynchronous readahead when |
703 | there are only # of pages ahead */ | 759 | there are only # of pages ahead */ |
704 | 760 | ||
705 | unsigned long ra_pages; /* Maximum readahead window */ | 761 | unsigned int ra_pages; /* Maximum readahead window */ |
706 | unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ | 762 | int mmap_miss; /* Cache miss stat for mmap accesses */ |
707 | unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ | 763 | loff_t prev_pos; /* Cache last read() position */ |
708 | unsigned long prev_index; /* Cache last read() position */ | ||
709 | unsigned int prev_offset; /* Offset where last read() ended in a page */ | ||
710 | }; | 764 | }; |
711 | 765 | ||
712 | /* | 766 | /* |
@@ -1835,6 +1889,12 @@ extern int simple_prepare_write(struct file *file, struct page *page, | |||
1835 | unsigned offset, unsigned to); | 1889 | unsigned offset, unsigned to); |
1836 | extern int simple_commit_write(struct file *file, struct page *page, | 1890 | extern int simple_commit_write(struct file *file, struct page *page, |
1837 | unsigned offset, unsigned to); | 1891 | unsigned offset, unsigned to); |
1892 | extern int simple_write_begin(struct file *file, struct address_space *mapping, | ||
1893 | loff_t pos, unsigned len, unsigned flags, | ||
1894 | struct page **pagep, void **fsdata); | ||
1895 | extern int simple_write_end(struct file *file, struct address_space *mapping, | ||
1896 | loff_t pos, unsigned len, unsigned copied, | ||
1897 | struct page *page, void *fsdata); | ||
1838 | 1898 | ||
1839 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); | 1899 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); |
1840 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 1900 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index bc68dd9a6d41..7e93a9ae7064 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -48,18 +48,12 @@ struct vm_area_struct; | |||
48 | #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 */ |
49 | #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 */ |
50 | #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 */ | 51 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ |
52 | #define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */ | ||
52 | 53 | ||
53 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 54 | #define __GFP_BITS_SHIFT 21 /* Room for 21 __GFP_FOO bits */ |
54 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 55 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
55 | 56 | ||
56 | /* if you forget to add the bitmask here kernel will crash, period */ | ||
57 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | ||
58 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | ||
59 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ | ||
60 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE| \ | ||
61 | __GFP_MOVABLE) | ||
62 | |||
63 | /* This equals 0, but use constants in case they ever change */ | 57 | /* This equals 0, but use constants in case they ever change */ |
64 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) | 58 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) |
65 | /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ | 59 | /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ |
@@ -67,6 +61,8 @@ struct vm_area_struct; | |||
67 | #define GFP_NOIO (__GFP_WAIT) | 61 | #define GFP_NOIO (__GFP_WAIT) |
68 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) | 62 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) |
69 | #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) | 63 | #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) |
64 | #define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
65 | __GFP_RECLAIMABLE) | ||
70 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) | 66 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) |
71 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ | 67 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ |
72 | __GFP_HIGHMEM) | 68 | __GFP_HIGHMEM) |
@@ -86,6 +82,19 @@ struct vm_area_struct; | |||
86 | #define GFP_THISNODE ((__force gfp_t)0) | 82 | #define GFP_THISNODE ((__force gfp_t)0) |
87 | #endif | 83 | #endif |
88 | 84 | ||
85 | /* This mask makes up all the page movable related flags */ | ||
86 | #define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE) | ||
87 | |||
88 | /* Control page allocator reclaim behavior */ | ||
89 | #define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ | ||
90 | __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ | ||
91 | __GFP_NORETRY|__GFP_NOMEMALLOC) | ||
92 | |||
93 | /* Control allocation constraints */ | ||
94 | #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) | ||
95 | |||
96 | /* Do not use these with a slab allocator */ | ||
97 | #define GFP_SLAB_BUG_MASK (__GFP_DMA32|__GFP_HIGHMEM|~__GFP_BITS_MASK) | ||
89 | 98 | ||
90 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some | 99 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some |
91 | platforms, used as appropriate on others */ | 100 | platforms, used as appropriate on others */ |
@@ -95,25 +104,50 @@ struct vm_area_struct; | |||
95 | /* 4GB DMA on some platforms */ | 104 | /* 4GB DMA on some platforms */ |
96 | #define GFP_DMA32 __GFP_DMA32 | 105 | #define GFP_DMA32 __GFP_DMA32 |
97 | 106 | ||
107 | /* Convert GFP flags to their corresponding migrate type */ | ||
108 | static inline int allocflags_to_migratetype(gfp_t gfp_flags) | ||
109 | { | ||
110 | WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK); | ||
111 | |||
112 | if (unlikely(page_group_by_mobility_disabled)) | ||
113 | return MIGRATE_UNMOVABLE; | ||
114 | |||
115 | /* Group based on mobility */ | ||
116 | return (((gfp_flags & __GFP_MOVABLE) != 0) << 1) | | ||
117 | ((gfp_flags & __GFP_RECLAIMABLE) != 0); | ||
118 | } | ||
98 | 119 | ||
99 | static inline enum zone_type gfp_zone(gfp_t flags) | 120 | static inline enum zone_type gfp_zone(gfp_t flags) |
100 | { | 121 | { |
122 | int base = 0; | ||
123 | |||
124 | #ifdef CONFIG_NUMA | ||
125 | if (flags & __GFP_THISNODE) | ||
126 | base = MAX_NR_ZONES; | ||
127 | #endif | ||
128 | |||
101 | #ifdef CONFIG_ZONE_DMA | 129 | #ifdef CONFIG_ZONE_DMA |
102 | if (flags & __GFP_DMA) | 130 | if (flags & __GFP_DMA) |
103 | return ZONE_DMA; | 131 | return base + ZONE_DMA; |
104 | #endif | 132 | #endif |
105 | #ifdef CONFIG_ZONE_DMA32 | 133 | #ifdef CONFIG_ZONE_DMA32 |
106 | if (flags & __GFP_DMA32) | 134 | if (flags & __GFP_DMA32) |
107 | return ZONE_DMA32; | 135 | return base + ZONE_DMA32; |
108 | #endif | 136 | #endif |
109 | if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == | 137 | if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == |
110 | (__GFP_HIGHMEM | __GFP_MOVABLE)) | 138 | (__GFP_HIGHMEM | __GFP_MOVABLE)) |
111 | return ZONE_MOVABLE; | 139 | return base + ZONE_MOVABLE; |
112 | #ifdef CONFIG_HIGHMEM | 140 | #ifdef CONFIG_HIGHMEM |
113 | if (flags & __GFP_HIGHMEM) | 141 | if (flags & __GFP_HIGHMEM) |
114 | return ZONE_HIGHMEM; | 142 | return base + ZONE_HIGHMEM; |
115 | #endif | 143 | #endif |
116 | return ZONE_NORMAL; | 144 | return base + ZONE_NORMAL; |
145 | } | ||
146 | |||
147 | static inline gfp_t set_migrateflags(gfp_t gfp, gfp_t migrate_flags) | ||
148 | { | ||
149 | BUG_ON((gfp & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK); | ||
150 | return (gfp & ~(GFP_MOVABLE_MASK)) | migrate_flags; | ||
117 | } | 151 | } |
118 | 152 | ||
119 | /* | 153 | /* |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 3a19b032c0eb..ea0f50bfbe03 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -33,6 +33,7 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | |||
33 | 33 | ||
34 | extern unsigned long max_huge_pages; | 34 | extern unsigned long max_huge_pages; |
35 | extern unsigned long hugepages_treat_as_movable; | 35 | extern unsigned long hugepages_treat_as_movable; |
36 | extern int hugetlb_dynamic_pool; | ||
36 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 37 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
37 | extern int sysctl_hugetlb_shm_group; | 38 | extern int sysctl_hugetlb_shm_group; |
38 | 39 | ||
diff --git a/include/linux/init.h b/include/linux/init.h index f8d9d0b5cffc..9b7a2ba8237e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -67,8 +67,10 @@ | |||
67 | 67 | ||
68 | /* For assembly routines */ | 68 | /* For assembly routines */ |
69 | #define __INIT .section ".init.text","ax" | 69 | #define __INIT .section ".init.text","ax" |
70 | #define __INIT_REFOK .section ".text.init.refok","ax" | ||
70 | #define __FINIT .previous | 71 | #define __FINIT .previous |
71 | #define __INITDATA .section ".init.data","aw" | 72 | #define __INITDATA .section ".init.data","aw" |
73 | #define __INITDATA_REFOK .section ".data.init.refok","aw" | ||
72 | 74 | ||
73 | #ifndef __ASSEMBLY__ | 75 | #ifndef __ASSEMBLY__ |
74 | /* | 76 | /* |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5523f19d88d2..8e5f289052a2 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -205,6 +205,15 @@ static inline int disable_irq_wake(unsigned int irq) | |||
205 | enable_irq(irq) | 205 | enable_irq(irq) |
206 | # endif | 206 | # endif |
207 | 207 | ||
208 | static inline int enable_irq_wake(unsigned int irq) | ||
209 | { | ||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | static inline int disable_irq_wake(unsigned int irq) | ||
214 | { | ||
215 | return 0; | ||
216 | } | ||
208 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 217 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
209 | 218 | ||
210 | #ifndef __ARCH_SET_SOFTIRQ_PENDING | 219 | #ifndef __ARCH_SET_SOFTIRQ_PENDING |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 71ea92319241..6187a8567bc7 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -110,9 +110,6 @@ extern int allocate_resource(struct resource *root, struct resource *new, | |||
110 | int adjust_resource(struct resource *res, resource_size_t start, | 110 | int adjust_resource(struct resource *res, resource_size_t start, |
111 | resource_size_t size); | 111 | resource_size_t size); |
112 | 112 | ||
113 | /* get registered SYSTEM_RAM resources in specified area */ | ||
114 | extern int find_next_system_ram(struct resource *res); | ||
115 | |||
116 | /* Convenience shorthand with allocation */ | 113 | /* Convenience shorthand with allocation */ |
117 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) | 114 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) |
118 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) | 115 | #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) |
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index d5dda4b643ac..d0ecc8eebfbf 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -167,6 +167,7 @@ typedef struct { | |||
167 | #include <linux/etherdevice.h> | 167 | #include <linux/etherdevice.h> |
168 | #include <linux/skbuff.h> | 168 | #include <linux/skbuff.h> |
169 | #include <linux/tcp.h> | 169 | #include <linux/tcp.h> |
170 | #include <linux/mutex.h> | ||
170 | 171 | ||
171 | #define ISDN_TTY_MAJOR 43 | 172 | #define ISDN_TTY_MAJOR 43 |
172 | #define ISDN_TTYAUX_MAJOR 44 | 173 | #define ISDN_TTYAUX_MAJOR 44 |
@@ -616,7 +617,7 @@ typedef struct isdn_devt { | |||
616 | int v110emu[ISDN_MAX_CHANNELS]; /* V.110 emulator-mode 0=none */ | 617 | int v110emu[ISDN_MAX_CHANNELS]; /* V.110 emulator-mode 0=none */ |
617 | atomic_t v110use[ISDN_MAX_CHANNELS]; /* Usage-Semaphore for stream */ | 618 | atomic_t v110use[ISDN_MAX_CHANNELS]; /* Usage-Semaphore for stream */ |
618 | isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ | 619 | isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ |
619 | struct semaphore sem; /* serialize list access*/ | 620 | struct mutex mtx; /* serialize list access*/ |
620 | unsigned long global_features; | 621 | unsigned long global_features; |
621 | } isdn_dev; | 622 | } isdn_dev; |
622 | 623 | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 700a93b79189..72f522372924 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -372,6 +372,7 @@ struct jbd_revoke_table_s; | |||
372 | * @h_sync: flag for sync-on-close | 372 | * @h_sync: flag for sync-on-close |
373 | * @h_jdata: flag to force data journaling | 373 | * @h_jdata: flag to force data journaling |
374 | * @h_aborted: flag indicating fatal error on handle | 374 | * @h_aborted: flag indicating fatal error on handle |
375 | * @h_lockdep_map: lockdep info for debugging lock problems | ||
375 | **/ | 376 | **/ |
376 | 377 | ||
377 | /* Docbook can't yet cope with the bit fields, but will leave the documentation | 378 | /* Docbook can't yet cope with the bit fields, but will leave the documentation |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index e757a74b9d17..8b080024bbc1 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -148,6 +148,8 @@ static inline u64 get_jiffies_64(void) | |||
148 | */ | 148 | */ |
149 | #define MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1) | 149 | #define MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1) |
150 | 150 | ||
151 | extern unsigned long preset_lpj; | ||
152 | |||
151 | /* | 153 | /* |
152 | * We want to do realistic conversions of time so we need to use the same | 154 | * We want to do realistic conversions of time so we need to use the same |
153 | * values the update wall clock code uses as the jiffies size. This value | 155 | * values the update wall clock code uses as the jiffies size. This value |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d9725a28a265..5fdbc814c2eb 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -35,6 +35,7 @@ extern const char linux_proc_banner[]; | |||
35 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | 35 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) |
36 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | 36 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) |
37 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) | 37 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) |
38 | #define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0) | ||
38 | 39 | ||
39 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | 40 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) |
40 | 41 | ||
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 51464d12a4e5..81891581e89b 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -166,6 +166,12 @@ struct kretprobe_instance { | |||
166 | struct task_struct *task; | 166 | struct task_struct *task; |
167 | }; | 167 | }; |
168 | 168 | ||
169 | struct kretprobe_blackpoint { | ||
170 | const char *name; | ||
171 | void *addr; | ||
172 | }; | ||
173 | extern struct kretprobe_blackpoint kretprobe_blacklist[]; | ||
174 | |||
169 | static inline void kretprobe_assert(struct kretprobe_instance *ri, | 175 | static inline void kretprobe_assert(struct kretprobe_instance *ri, |
170 | unsigned long orig_ret_address, unsigned long trampoline_address) | 176 | unsigned long orig_ret_address, unsigned long trampoline_address) |
171 | { | 177 | { |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 7b54666cea8e..8fee7a45736b 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/mmzone.h> | 4 | #include <linux/mmzone.h> |
5 | #include <linux/spinlock.h> | 5 | #include <linux/spinlock.h> |
6 | #include <linux/mmzone.h> | ||
7 | #include <linux/notifier.h> | 6 | #include <linux/notifier.h> |
8 | 7 | ||
9 | struct page; | 8 | struct page; |
@@ -59,11 +58,21 @@ extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); | |||
59 | extern void online_page(struct page *page); | 58 | extern void online_page(struct page *page); |
60 | /* VM interface that may be used by firmware interface */ | 59 | /* VM interface that may be used by firmware interface */ |
61 | extern int online_pages(unsigned long, unsigned long); | 60 | extern int online_pages(unsigned long, unsigned long); |
61 | extern void __offline_isolated_pages(unsigned long, unsigned long); | ||
62 | extern int offline_pages(unsigned long, unsigned long, unsigned long); | ||
62 | 63 | ||
63 | /* reasonably generic interface to expand the physical pages in a zone */ | 64 | /* reasonably generic interface to expand the physical pages in a zone */ |
64 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, | 65 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, |
65 | unsigned long nr_pages); | 66 | unsigned long nr_pages); |
66 | 67 | ||
68 | /* | ||
69 | * Walk thorugh all memory which is registered as resource. | ||
70 | * arg is (start_pfn, nr_pages, private_arg_pointer) | ||
71 | */ | ||
72 | extern int walk_memory_resource(unsigned long start_pfn, | ||
73 | unsigned long nr_pages, void *arg, | ||
74 | int (*func)(unsigned long, unsigned long, void *)); | ||
75 | |||
67 | #ifdef CONFIG_NUMA | 76 | #ifdef CONFIG_NUMA |
68 | extern int memory_add_physaddr_to_nid(u64 start); | 77 | extern int memory_add_physaddr_to_nid(u64 start); |
69 | #else | 78 | #else |
@@ -161,13 +170,6 @@ static inline int mhp_notimplemented(const char *func) | |||
161 | } | 170 | } |
162 | 171 | ||
163 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 172 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
164 | static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | ||
165 | unsigned long nr_pages) | ||
166 | { | ||
167 | printk(KERN_WARNING "%s() called, not yet supported\n", __FUNCTION__); | ||
168 | dump_stack(); | ||
169 | return -ENOSYS; | ||
170 | } | ||
171 | 173 | ||
172 | extern int add_memory(int nid, u64 start, u64 size); | 174 | extern int add_memory(int nid, u64 start, u64 size); |
173 | extern int arch_add_memory(int nid, u64 start, u64 size); | 175 | extern int arch_add_memory(int nid, u64 start, u64 size); |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index a020eb2d4e2a..38c04d61ee06 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -19,6 +19,7 @@ | |||
19 | /* Flags for get_mem_policy */ | 19 | /* Flags for get_mem_policy */ |
20 | #define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ | 20 | #define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ |
21 | #define MPOL_F_ADDR (1<<1) /* look up vma using address */ | 21 | #define MPOL_F_ADDR (1<<1) /* look up vma using address */ |
22 | #define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */ | ||
22 | 23 | ||
23 | /* Flags for mbind */ | 24 | /* Flags for mbind */ |
24 | #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ | 25 | #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ |
@@ -143,7 +144,6 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, | |||
143 | 144 | ||
144 | extern void numa_default_policy(void); | 145 | extern void numa_default_policy(void); |
145 | extern void numa_policy_init(void); | 146 | extern void numa_policy_init(void); |
146 | extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new); | ||
147 | extern void mpol_rebind_task(struct task_struct *tsk, | 147 | extern void mpol_rebind_task(struct task_struct *tsk, |
148 | const nodemask_t *new); | 148 | const nodemask_t *new); |
149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); | 149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); |
@@ -235,11 +235,6 @@ static inline void numa_default_policy(void) | |||
235 | { | 235 | { |
236 | } | 236 | } |
237 | 237 | ||
238 | static inline void mpol_rebind_policy(struct mempolicy *pol, | ||
239 | const nodemask_t *new) | ||
240 | { | ||
241 | } | ||
242 | |||
243 | static inline void mpol_rebind_task(struct task_struct *tsk, | 238 | static inline void mpol_rebind_task(struct task_struct *tsk, |
244 | const nodemask_t *new) | 239 | const nodemask_t *new) |
245 | { | 240 | { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1692dd6cb915..7e87e1b1662e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -50,69 +50,6 @@ extern int sysctl_legacy_va_layout; | |||
50 | * mmap() functions). | 50 | * mmap() functions). |
51 | */ | 51 | */ |
52 | 52 | ||
53 | /* | ||
54 | * This struct defines a memory VMM memory area. There is one of these | ||
55 | * per VM-area/task. A VM area is any part of the process virtual memory | ||
56 | * space that has a special rule for the page-fault handlers (ie a shared | ||
57 | * library, the executable area etc). | ||
58 | */ | ||
59 | struct vm_area_struct { | ||
60 | struct mm_struct * vm_mm; /* The address space we belong to. */ | ||
61 | unsigned long vm_start; /* Our start address within vm_mm. */ | ||
62 | unsigned long vm_end; /* The first byte after our end address | ||
63 | within vm_mm. */ | ||
64 | |||
65 | /* linked list of VM areas per task, sorted by address */ | ||
66 | struct vm_area_struct *vm_next; | ||
67 | |||
68 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ | ||
69 | unsigned long vm_flags; /* Flags, listed below. */ | ||
70 | |||
71 | struct rb_node vm_rb; | ||
72 | |||
73 | /* | ||
74 | * For areas with an address space and backing store, | ||
75 | * linkage into the address_space->i_mmap prio tree, or | ||
76 | * linkage to the list of like vmas hanging off its node, or | ||
77 | * linkage of vma in the address_space->i_mmap_nonlinear list. | ||
78 | */ | ||
79 | union { | ||
80 | struct { | ||
81 | struct list_head list; | ||
82 | void *parent; /* aligns with prio_tree_node parent */ | ||
83 | struct vm_area_struct *head; | ||
84 | } vm_set; | ||
85 | |||
86 | struct raw_prio_tree_node prio_tree_node; | ||
87 | } shared; | ||
88 | |||
89 | /* | ||
90 | * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma | ||
91 | * list, after a COW of one of the file pages. A MAP_SHARED vma | ||
92 | * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack | ||
93 | * or brk vma (with NULL file) can only be in an anon_vma list. | ||
94 | */ | ||
95 | struct list_head anon_vma_node; /* Serialized by anon_vma->lock */ | ||
96 | struct anon_vma *anon_vma; /* Serialized by page_table_lock */ | ||
97 | |||
98 | /* Function pointers to deal with this struct. */ | ||
99 | struct vm_operations_struct * vm_ops; | ||
100 | |||
101 | /* Information about our backing store: */ | ||
102 | unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE | ||
103 | units, *not* PAGE_CACHE_SIZE */ | ||
104 | struct file * vm_file; /* File we map to (can be NULL). */ | ||
105 | void * vm_private_data; /* was vm_pte (shared mem) */ | ||
106 | unsigned long vm_truncate_count;/* truncate_count or restart_addr */ | ||
107 | |||
108 | #ifndef CONFIG_MMU | ||
109 | atomic_t vm_usage; /* refcount (VMAs shared if !MMU) */ | ||
110 | #endif | ||
111 | #ifdef CONFIG_NUMA | ||
112 | struct mempolicy *vm_policy; /* NUMA policy for the VMA */ | ||
113 | #endif | ||
114 | }; | ||
115 | |||
116 | extern struct kmem_cache *vm_area_cachep; | 53 | extern struct kmem_cache *vm_area_cachep; |
117 | 54 | ||
118 | /* | 55 | /* |
@@ -631,10 +568,6 @@ static inline struct address_space *page_mapping(struct page *page) | |||
631 | VM_BUG_ON(PageSlab(page)); | 568 | VM_BUG_ON(PageSlab(page)); |
632 | if (unlikely(PageSwapCache(page))) | 569 | if (unlikely(PageSwapCache(page))) |
633 | mapping = &swapper_space; | 570 | mapping = &swapper_space; |
634 | #ifdef CONFIG_SLUB | ||
635 | else if (unlikely(PageSlab(page))) | ||
636 | mapping = NULL; | ||
637 | #endif | ||
638 | else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) | 571 | else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) |
639 | mapping = NULL; | 572 | mapping = NULL; |
640 | return mapping; | 573 | return mapping; |
@@ -715,9 +648,6 @@ static inline int page_mapped(struct page *page) | |||
715 | extern void show_free_areas(void); | 648 | extern void show_free_areas(void); |
716 | 649 | ||
717 | #ifdef CONFIG_SHMEM | 650 | #ifdef CONFIG_SHMEM |
718 | int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new); | ||
719 | struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, | ||
720 | unsigned long addr); | ||
721 | int shmem_lock(struct file *file, int lock, struct user_struct *user); | 651 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
722 | #else | 652 | #else |
723 | static inline int shmem_lock(struct file *file, int lock, | 653 | static inline int shmem_lock(struct file *file, int lock, |
@@ -725,18 +655,6 @@ static inline int shmem_lock(struct file *file, int lock, | |||
725 | { | 655 | { |
726 | return 0; | 656 | return 0; |
727 | } | 657 | } |
728 | |||
729 | static inline int shmem_set_policy(struct vm_area_struct *vma, | ||
730 | struct mempolicy *new) | ||
731 | { | ||
732 | return 0; | ||
733 | } | ||
734 | |||
735 | static inline struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, | ||
736 | unsigned long addr) | ||
737 | { | ||
738 | return NULL; | ||
739 | } | ||
740 | #endif | 658 | #endif |
741 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); | 659 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); |
742 | 660 | ||
@@ -779,8 +697,6 @@ void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, | |||
779 | unsigned long floor, unsigned long ceiling); | 697 | unsigned long floor, unsigned long ceiling); |
780 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | 698 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, |
781 | struct vm_area_struct *vma); | 699 | struct vm_area_struct *vma); |
782 | int zeromap_page_range(struct vm_area_struct *vma, unsigned long from, | ||
783 | unsigned long size, pgprot_t prot); | ||
784 | void unmap_mapping_range(struct address_space *mapping, | 700 | void unmap_mapping_range(struct address_space *mapping, |
785 | loff_t const holebegin, loff_t const holelen, int even_cows); | 701 | loff_t const holebegin, loff_t const holelen, int even_cows); |
786 | 702 | ||
@@ -1106,8 +1022,6 @@ int write_one_page(struct page *page, int wait); | |||
1106 | /* readahead.c */ | 1022 | /* readahead.c */ |
1107 | #define VM_MAX_READAHEAD 128 /* kbytes */ | 1023 | #define VM_MAX_READAHEAD 128 /* kbytes */ |
1108 | #define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ | 1024 | #define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ |
1109 | #define VM_MAX_CACHE_HIT 256 /* max pages in a row in cache before | ||
1110 | * turning readahead off */ | ||
1111 | 1025 | ||
1112 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | 1026 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, |
1113 | pgoff_t offset, unsigned long nr_to_read); | 1027 | pgoff_t offset, unsigned long nr_to_read); |
@@ -1218,5 +1132,16 @@ extern int randomize_va_space; | |||
1218 | 1132 | ||
1219 | const char * arch_vma_name(struct vm_area_struct *vma); | 1133 | const char * arch_vma_name(struct vm_area_struct *vma); |
1220 | 1134 | ||
1135 | struct page *sparse_mem_map_populate(unsigned long pnum, int nid); | ||
1136 | pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); | ||
1137 | pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node); | ||
1138 | pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); | ||
1139 | pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); | ||
1140 | void *vmemmap_alloc_block(unsigned long size, int node); | ||
1141 | void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); | ||
1142 | int vmemmap_populate_basepages(struct page *start_page, | ||
1143 | unsigned long pages, int node); | ||
1144 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | ||
1145 | |||
1221 | #endif /* __KERNEL__ */ | 1146 | #endif /* __KERNEL__ */ |
1222 | #endif /* _LINUX_MM_H */ | 1147 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index d5bb1796e12b..877667918452 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -1,13 +1,26 @@ | |||
1 | #ifndef _LINUX_MM_TYPES_H | 1 | #ifndef _LINUX_MM_TYPES_H |
2 | #define _LINUX_MM_TYPES_H | 2 | #define _LINUX_MM_TYPES_H |
3 | 3 | ||
4 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | ||
4 | #include <linux/types.h> | 5 | #include <linux/types.h> |
5 | #include <linux/threads.h> | 6 | #include <linux/threads.h> |
6 | #include <linux/list.h> | 7 | #include <linux/list.h> |
7 | #include <linux/spinlock.h> | 8 | #include <linux/spinlock.h> |
9 | #include <linux/prio_tree.h> | ||
10 | #include <linux/rbtree.h> | ||
11 | #include <linux/rwsem.h> | ||
12 | #include <linux/completion.h> | ||
13 | #include <asm/page.h> | ||
14 | #include <asm/mmu.h> | ||
8 | 15 | ||
9 | struct address_space; | 16 | struct address_space; |
10 | 17 | ||
18 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
19 | typedef atomic_long_t mm_counter_t; | ||
20 | #else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | ||
21 | typedef unsigned long mm_counter_t; | ||
22 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | ||
23 | |||
11 | /* | 24 | /* |
12 | * Each physical page in the system has a struct page associated with | 25 | * Each physical page in the system has a struct page associated with |
13 | * it to keep track of whatever it is we are using the page for at the | 26 | * it to keep track of whatever it is we are using the page for at the |
@@ -24,10 +37,7 @@ struct page { | |||
24 | * to show when page is mapped | 37 | * to show when page is mapped |
25 | * & limit reverse map searches. | 38 | * & limit reverse map searches. |
26 | */ | 39 | */ |
27 | struct { /* SLUB uses */ | 40 | unsigned int inuse; /* SLUB: Nr of objects */ |
28 | short unsigned int inuse; | ||
29 | short unsigned int offset; | ||
30 | }; | ||
31 | }; | 41 | }; |
32 | union { | 42 | union { |
33 | struct { | 43 | struct { |
@@ -49,13 +59,8 @@ struct page { | |||
49 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 59 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS |
50 | spinlock_t ptl; | 60 | spinlock_t ptl; |
51 | #endif | 61 | #endif |
52 | struct { /* SLUB uses */ | 62 | struct kmem_cache *slab; /* SLUB: Pointer to slab */ |
53 | void **lockless_freelist; | 63 | struct page *first_page; /* Compound tail pages */ |
54 | struct kmem_cache *slab; /* Pointer to slab */ | ||
55 | }; | ||
56 | struct { | ||
57 | struct page *first_page; /* Compound pages */ | ||
58 | }; | ||
59 | }; | 64 | }; |
60 | union { | 65 | union { |
61 | pgoff_t index; /* Our offset within mapping. */ | 66 | pgoff_t index; /* Our offset within mapping. */ |
@@ -80,4 +85,135 @@ struct page { | |||
80 | #endif /* WANT_PAGE_VIRTUAL */ | 85 | #endif /* WANT_PAGE_VIRTUAL */ |
81 | }; | 86 | }; |
82 | 87 | ||
88 | /* | ||
89 | * This struct defines a memory VMM memory area. There is one of these | ||
90 | * per VM-area/task. A VM area is any part of the process virtual memory | ||
91 | * space that has a special rule for the page-fault handlers (ie a shared | ||
92 | * library, the executable area etc). | ||
93 | */ | ||
94 | struct vm_area_struct { | ||
95 | struct mm_struct * vm_mm; /* The address space we belong to. */ | ||
96 | unsigned long vm_start; /* Our start address within vm_mm. */ | ||
97 | unsigned long vm_end; /* The first byte after our end address | ||
98 | within vm_mm. */ | ||
99 | |||
100 | /* linked list of VM areas per task, sorted by address */ | ||
101 | struct vm_area_struct *vm_next; | ||
102 | |||
103 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ | ||
104 | unsigned long vm_flags; /* Flags, listed below. */ | ||
105 | |||
106 | struct rb_node vm_rb; | ||
107 | |||
108 | /* | ||
109 | * For areas with an address space and backing store, | ||
110 | * linkage into the address_space->i_mmap prio tree, or | ||
111 | * linkage to the list of like vmas hanging off its node, or | ||
112 | * linkage of vma in the address_space->i_mmap_nonlinear list. | ||
113 | */ | ||
114 | union { | ||
115 | struct { | ||
116 | struct list_head list; | ||
117 | void *parent; /* aligns with prio_tree_node parent */ | ||
118 | struct vm_area_struct *head; | ||
119 | } vm_set; | ||
120 | |||
121 | struct raw_prio_tree_node prio_tree_node; | ||
122 | } shared; | ||
123 | |||
124 | /* | ||
125 | * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma | ||
126 | * list, after a COW of one of the file pages. A MAP_SHARED vma | ||
127 | * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack | ||
128 | * or brk vma (with NULL file) can only be in an anon_vma list. | ||
129 | */ | ||
130 | struct list_head anon_vma_node; /* Serialized by anon_vma->lock */ | ||
131 | struct anon_vma *anon_vma; /* Serialized by page_table_lock */ | ||
132 | |||
133 | /* Function pointers to deal with this struct. */ | ||
134 | struct vm_operations_struct * vm_ops; | ||
135 | |||
136 | /* Information about our backing store: */ | ||
137 | unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE | ||
138 | units, *not* PAGE_CACHE_SIZE */ | ||
139 | struct file * vm_file; /* File we map to (can be NULL). */ | ||
140 | void * vm_private_data; /* was vm_pte (shared mem) */ | ||
141 | unsigned long vm_truncate_count;/* truncate_count or restart_addr */ | ||
142 | |||
143 | #ifndef CONFIG_MMU | ||
144 | atomic_t vm_usage; /* refcount (VMAs shared if !MMU) */ | ||
145 | #endif | ||
146 | #ifdef CONFIG_NUMA | ||
147 | struct mempolicy *vm_policy; /* NUMA policy for the VMA */ | ||
148 | #endif | ||
149 | }; | ||
150 | |||
151 | struct mm_struct { | ||
152 | struct vm_area_struct * mmap; /* list of VMAs */ | ||
153 | struct rb_root mm_rb; | ||
154 | struct vm_area_struct * mmap_cache; /* last find_vma result */ | ||
155 | unsigned long (*get_unmapped_area) (struct file *filp, | ||
156 | unsigned long addr, unsigned long len, | ||
157 | unsigned long pgoff, unsigned long flags); | ||
158 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | ||
159 | unsigned long mmap_base; /* base of mmap area */ | ||
160 | unsigned long task_size; /* size of task vm space */ | ||
161 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | ||
162 | unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ | ||
163 | pgd_t * pgd; | ||
164 | atomic_t mm_users; /* How many users with user space? */ | ||
165 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | ||
166 | int map_count; /* number of VMAs */ | ||
167 | struct rw_semaphore mmap_sem; | ||
168 | spinlock_t page_table_lock; /* Protects page tables and some counters */ | ||
169 | |||
170 | struct list_head mmlist; /* List of maybe swapped mm's. These are globally strung | ||
171 | * together off init_mm.mmlist, and are protected | ||
172 | * by mmlist_lock | ||
173 | */ | ||
174 | |||
175 | /* Special counters, in some configurations protected by the | ||
176 | * page_table_lock, in other configurations by being atomic. | ||
177 | */ | ||
178 | mm_counter_t _file_rss; | ||
179 | mm_counter_t _anon_rss; | ||
180 | |||
181 | unsigned long hiwater_rss; /* High-watermark of RSS usage */ | ||
182 | unsigned long hiwater_vm; /* High-water virtual memory usage */ | ||
183 | |||
184 | unsigned long total_vm, locked_vm, shared_vm, exec_vm; | ||
185 | unsigned long stack_vm, reserved_vm, def_flags, nr_ptes; | ||
186 | unsigned long start_code, end_code, start_data, end_data; | ||
187 | unsigned long start_brk, brk, start_stack; | ||
188 | unsigned long arg_start, arg_end, env_start, env_end; | ||
189 | |||
190 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | ||
191 | |||
192 | cpumask_t cpu_vm_mask; | ||
193 | |||
194 | /* Architecture-specific MM context */ | ||
195 | mm_context_t context; | ||
196 | |||
197 | /* Swap token stuff */ | ||
198 | /* | ||
199 | * Last value of global fault stamp as seen by this process. | ||
200 | * In other words, this value gives an indication of how long | ||
201 | * it has been since this task got the token. | ||
202 | * Look at mm/thrash.c | ||
203 | */ | ||
204 | unsigned int faultstamp; | ||
205 | unsigned int token_priority; | ||
206 | unsigned int last_interval; | ||
207 | |||
208 | unsigned long flags; /* Must use atomic bitops to access the bits */ | ||
209 | |||
210 | /* coredumping support */ | ||
211 | int core_waiters; | ||
212 | struct completion *core_startup_done, core_done; | ||
213 | |||
214 | /* aio bits */ | ||
215 | rwlock_t ioctx_list_lock; | ||
216 | struct kioctx *ioctx_list; | ||
217 | }; | ||
218 | |||
83 | #endif /* _LINUX_MM_TYPES_H */ | 219 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 4e5627379b09..f4bfe824834f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/seqlock.h> | 14 | #include <linux/seqlock.h> |
15 | #include <linux/nodemask.h> | 15 | #include <linux/nodemask.h> |
16 | #include <linux/pageblock-flags.h> | ||
16 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
17 | #include <asm/page.h> | 18 | #include <asm/page.h> |
18 | 19 | ||
@@ -32,8 +33,29 @@ | |||
32 | */ | 33 | */ |
33 | #define PAGE_ALLOC_COSTLY_ORDER 3 | 34 | #define PAGE_ALLOC_COSTLY_ORDER 3 |
34 | 35 | ||
36 | #define MIGRATE_UNMOVABLE 0 | ||
37 | #define MIGRATE_RECLAIMABLE 1 | ||
38 | #define MIGRATE_MOVABLE 2 | ||
39 | #define MIGRATE_RESERVE 3 | ||
40 | #define MIGRATE_ISOLATE 4 /* can't allocate from here */ | ||
41 | #define MIGRATE_TYPES 5 | ||
42 | |||
43 | #define for_each_migratetype_order(order, type) \ | ||
44 | for (order = 0; order < MAX_ORDER; order++) \ | ||
45 | for (type = 0; type < MIGRATE_TYPES; type++) | ||
46 | |||
47 | extern int page_group_by_mobility_disabled; | ||
48 | |||
49 | static inline int get_pageblock_migratetype(struct page *page) | ||
50 | { | ||
51 | if (unlikely(page_group_by_mobility_disabled)) | ||
52 | return MIGRATE_UNMOVABLE; | ||
53 | |||
54 | return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end); | ||
55 | } | ||
56 | |||
35 | struct free_area { | 57 | struct free_area { |
36 | struct list_head free_list; | 58 | struct list_head free_list[MIGRATE_TYPES]; |
37 | unsigned long nr_free; | 59 | unsigned long nr_free; |
38 | }; | 60 | }; |
39 | 61 | ||
@@ -222,6 +244,14 @@ struct zone { | |||
222 | #endif | 244 | #endif |
223 | struct free_area free_area[MAX_ORDER]; | 245 | struct free_area free_area[MAX_ORDER]; |
224 | 246 | ||
247 | #ifndef CONFIG_SPARSEMEM | ||
248 | /* | ||
249 | * Flags for a pageblock_nr_pages block. See pageblock-flags.h. | ||
250 | * In SPARSEMEM, this map is stored in struct mem_section | ||
251 | */ | ||
252 | unsigned long *pageblock_flags; | ||
253 | #endif /* CONFIG_SPARSEMEM */ | ||
254 | |||
225 | 255 | ||
226 | ZONE_PADDING(_pad1_) | 256 | ZONE_PADDING(_pad1_) |
227 | 257 | ||
@@ -324,6 +354,17 @@ struct zone { | |||
324 | #define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES) | 354 | #define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES) |
325 | 355 | ||
326 | #ifdef CONFIG_NUMA | 356 | #ifdef CONFIG_NUMA |
357 | |||
358 | /* | ||
359 | * The NUMA zonelists are doubled becausse we need zonelists that restrict the | ||
360 | * allocations to a single node for GFP_THISNODE. | ||
361 | * | ||
362 | * [0 .. MAX_NR_ZONES -1] : Zonelists with fallback | ||
363 | * [MAZ_NR_ZONES ... MAZ_ZONELISTS -1] : No fallback (GFP_THISNODE) | ||
364 | */ | ||
365 | #define MAX_ZONELISTS (2 * MAX_NR_ZONES) | ||
366 | |||
367 | |||
327 | /* | 368 | /* |
328 | * We cache key information from each zonelist for smaller cache | 369 | * We cache key information from each zonelist for smaller cache |
329 | * footprint when scanning for free pages in get_page_from_freelist(). | 370 | * footprint when scanning for free pages in get_page_from_freelist(). |
@@ -389,6 +430,7 @@ struct zonelist_cache { | |||
389 | unsigned long last_full_zap; /* when last zap'd (jiffies) */ | 430 | unsigned long last_full_zap; /* when last zap'd (jiffies) */ |
390 | }; | 431 | }; |
391 | #else | 432 | #else |
433 | #define MAX_ZONELISTS MAX_NR_ZONES | ||
392 | struct zonelist_cache; | 434 | struct zonelist_cache; |
393 | #endif | 435 | #endif |
394 | 436 | ||
@@ -455,7 +497,7 @@ extern struct page *mem_map; | |||
455 | struct bootmem_data; | 497 | struct bootmem_data; |
456 | typedef struct pglist_data { | 498 | typedef struct pglist_data { |
457 | struct zone node_zones[MAX_NR_ZONES]; | 499 | struct zone node_zones[MAX_NR_ZONES]; |
458 | struct zonelist node_zonelists[MAX_NR_ZONES]; | 500 | struct zonelist node_zonelists[MAX_ZONELISTS]; |
459 | int nr_zones; | 501 | int nr_zones; |
460 | #ifdef CONFIG_FLAT_NODE_MEM_MAP | 502 | #ifdef CONFIG_FLAT_NODE_MEM_MAP |
461 | struct page *node_mem_map; | 503 | struct page *node_mem_map; |
@@ -708,6 +750,9 @@ extern struct zone *next_zone(struct zone *zone); | |||
708 | #define PAGES_PER_SECTION (1UL << PFN_SECTION_SHIFT) | 750 | #define PAGES_PER_SECTION (1UL << PFN_SECTION_SHIFT) |
709 | #define PAGE_SECTION_MASK (~(PAGES_PER_SECTION-1)) | 751 | #define PAGE_SECTION_MASK (~(PAGES_PER_SECTION-1)) |
710 | 752 | ||
753 | #define SECTION_BLOCKFLAGS_BITS \ | ||
754 | ((1UL << (PFN_SECTION_SHIFT - pageblock_order)) * NR_PAGEBLOCK_BITS) | ||
755 | |||
711 | #if (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS | 756 | #if (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS |
712 | #error Allocator MAX_ORDER exceeds SECTION_SIZE | 757 | #error Allocator MAX_ORDER exceeds SECTION_SIZE |
713 | #endif | 758 | #endif |
@@ -727,6 +772,9 @@ struct mem_section { | |||
727 | * before using it wrong. | 772 | * before using it wrong. |
728 | */ | 773 | */ |
729 | unsigned long section_mem_map; | 774 | unsigned long section_mem_map; |
775 | |||
776 | /* See declaration of similar field in struct zone */ | ||
777 | unsigned long *pageblock_flags; | ||
730 | }; | 778 | }; |
731 | 779 | ||
732 | #ifdef CONFIG_SPARSEMEM_EXTREME | 780 | #ifdef CONFIG_SPARSEMEM_EXTREME |
@@ -771,12 +819,17 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section) | |||
771 | return (struct page *)map; | 819 | return (struct page *)map; |
772 | } | 820 | } |
773 | 821 | ||
774 | static inline int valid_section(struct mem_section *section) | 822 | static inline int present_section(struct mem_section *section) |
775 | { | 823 | { |
776 | return (section && (section->section_mem_map & SECTION_MARKED_PRESENT)); | 824 | return (section && (section->section_mem_map & SECTION_MARKED_PRESENT)); |
777 | } | 825 | } |
778 | 826 | ||
779 | static inline int section_has_mem_map(struct mem_section *section) | 827 | static inline int present_section_nr(unsigned long nr) |
828 | { | ||
829 | return present_section(__nr_to_section(nr)); | ||
830 | } | ||
831 | |||
832 | static inline int valid_section(struct mem_section *section) | ||
780 | { | 833 | { |
781 | return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP)); | 834 | return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP)); |
782 | } | 835 | } |
@@ -798,6 +851,13 @@ static inline int pfn_valid(unsigned long pfn) | |||
798 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); | 851 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); |
799 | } | 852 | } |
800 | 853 | ||
854 | static inline int pfn_present(unsigned long pfn) | ||
855 | { | ||
856 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) | ||
857 | return 0; | ||
858 | return present_section(__nr_to_section(pfn_to_section_nr(pfn))); | ||
859 | } | ||
860 | |||
801 | /* | 861 | /* |
802 | * These are _only_ used during initialisation, therefore they | 862 | * These are _only_ used during initialisation, therefore they |
803 | * can use __initdata ... They could have names to indicate | 863 | * can use __initdata ... They could have names to indicate |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 5cd192469096..bcb7abafbca9 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -127,17 +127,9 @@ void nfsd_export_shutdown(void); | |||
127 | void nfsd_export_flush(void); | 127 | void nfsd_export_flush(void); |
128 | void exp_readlock(void); | 128 | void exp_readlock(void); |
129 | void exp_readunlock(void); | 129 | void exp_readunlock(void); |
130 | struct svc_export * exp_get_by_name(struct auth_domain *clp, | ||
131 | struct vfsmount *mnt, | ||
132 | struct dentry *dentry, | ||
133 | struct cache_req *reqp); | ||
134 | struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, | 130 | struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, |
135 | struct vfsmount *, | 131 | struct vfsmount *, |
136 | struct dentry *); | 132 | struct dentry *); |
137 | struct svc_export * exp_parent(struct auth_domain *clp, | ||
138 | struct vfsmount *mnt, | ||
139 | struct dentry *dentry, | ||
140 | struct cache_req *reqp); | ||
141 | struct svc_export * rqst_exp_parent(struct svc_rqst *, | 133 | struct svc_export * rqst_exp_parent(struct svc_rqst *, |
142 | struct vfsmount *mnt, | 134 | struct vfsmount *mnt, |
143 | struct dentry *dentry); | 135 | struct dentry *dentry); |
@@ -157,9 +149,6 @@ static inline void exp_get(struct svc_export *exp) | |||
157 | { | 149 | { |
158 | cache_get(&exp->h); | 150 | cache_get(&exp->h); |
159 | } | 151 | } |
160 | extern struct svc_export * | ||
161 | exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, | ||
162 | struct cache_req *reqp); | ||
163 | struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *); | 152 | struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *); |
164 | 153 | ||
165 | #endif /* __KERNEL__ */ | 154 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 52c54a5720f3..905e18f4b412 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -338,31 +338,88 @@ static inline void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp, | |||
338 | #endif /* MAX_NUMNODES */ | 338 | #endif /* MAX_NUMNODES */ |
339 | 339 | ||
340 | /* | 340 | /* |
341 | * Bitmasks that are kept for all the nodes. | ||
342 | */ | ||
343 | enum node_states { | ||
344 | N_POSSIBLE, /* The node could become online at some point */ | ||
345 | N_ONLINE, /* The node is online */ | ||
346 | N_NORMAL_MEMORY, /* The node has regular memory */ | ||
347 | #ifdef CONFIG_HIGHMEM | ||
348 | N_HIGH_MEMORY, /* The node has regular or high memory */ | ||
349 | #else | ||
350 | N_HIGH_MEMORY = N_NORMAL_MEMORY, | ||
351 | #endif | ||
352 | N_CPU, /* The node has one or more cpus */ | ||
353 | NR_NODE_STATES | ||
354 | }; | ||
355 | |||
356 | /* | ||
341 | * The following particular system nodemasks and operations | 357 | * The following particular system nodemasks and operations |
342 | * on them manage all possible and online nodes. | 358 | * on them manage all possible and online nodes. |
343 | */ | 359 | */ |
344 | 360 | ||
345 | extern nodemask_t node_online_map; | 361 | extern nodemask_t node_states[NR_NODE_STATES]; |
346 | extern nodemask_t node_possible_map; | ||
347 | 362 | ||
348 | #if MAX_NUMNODES > 1 | 363 | #if MAX_NUMNODES > 1 |
349 | #define num_online_nodes() nodes_weight(node_online_map) | 364 | static inline int node_state(int node, enum node_states state) |
350 | #define num_possible_nodes() nodes_weight(node_possible_map) | 365 | { |
351 | #define node_online(node) node_isset((node), node_online_map) | 366 | return node_isset(node, node_states[state]); |
352 | #define node_possible(node) node_isset((node), node_possible_map) | 367 | } |
353 | #define first_online_node first_node(node_online_map) | 368 | |
354 | #define next_online_node(nid) next_node((nid), node_online_map) | 369 | static inline void node_set_state(int node, enum node_states state) |
370 | { | ||
371 | __node_set(node, &node_states[state]); | ||
372 | } | ||
373 | |||
374 | static inline void node_clear_state(int node, enum node_states state) | ||
375 | { | ||
376 | __node_clear(node, &node_states[state]); | ||
377 | } | ||
378 | |||
379 | static inline int num_node_state(enum node_states state) | ||
380 | { | ||
381 | return nodes_weight(node_states[state]); | ||
382 | } | ||
383 | |||
384 | #define for_each_node_state(__node, __state) \ | ||
385 | for_each_node_mask((__node), node_states[__state]) | ||
386 | |||
387 | #define first_online_node first_node(node_states[N_ONLINE]) | ||
388 | #define next_online_node(nid) next_node((nid), node_states[N_ONLINE]) | ||
389 | |||
355 | extern int nr_node_ids; | 390 | extern int nr_node_ids; |
356 | #else | 391 | #else |
357 | #define num_online_nodes() 1 | 392 | |
358 | #define num_possible_nodes() 1 | 393 | static inline int node_state(int node, enum node_states state) |
359 | #define node_online(node) ((node) == 0) | 394 | { |
360 | #define node_possible(node) ((node) == 0) | 395 | return node == 0; |
396 | } | ||
397 | |||
398 | static inline void node_set_state(int node, enum node_states state) | ||
399 | { | ||
400 | } | ||
401 | |||
402 | static inline void node_clear_state(int node, enum node_states state) | ||
403 | { | ||
404 | } | ||
405 | |||
406 | static inline int num_node_state(enum node_states state) | ||
407 | { | ||
408 | return 1; | ||
409 | } | ||
410 | |||
411 | #define for_each_node_state(node, __state) \ | ||
412 | for ( (node) = 0; (node) == 0; (node) = 1) | ||
413 | |||
361 | #define first_online_node 0 | 414 | #define first_online_node 0 |
362 | #define next_online_node(nid) (MAX_NUMNODES) | 415 | #define next_online_node(nid) (MAX_NUMNODES) |
363 | #define nr_node_ids 1 | 416 | #define nr_node_ids 1 |
417 | |||
364 | #endif | 418 | #endif |
365 | 419 | ||
420 | #define node_online_map node_states[N_ONLINE] | ||
421 | #define node_possible_map node_states[N_POSSIBLE] | ||
422 | |||
366 | #define any_online_node(mask) \ | 423 | #define any_online_node(mask) \ |
367 | ({ \ | 424 | ({ \ |
368 | int node; \ | 425 | int node; \ |
@@ -372,10 +429,15 @@ extern int nr_node_ids; | |||
372 | node; \ | 429 | node; \ |
373 | }) | 430 | }) |
374 | 431 | ||
375 | #define node_set_online(node) set_bit((node), node_online_map.bits) | 432 | #define num_online_nodes() num_node_state(N_ONLINE) |
376 | #define node_set_offline(node) clear_bit((node), node_online_map.bits) | 433 | #define num_possible_nodes() num_node_state(N_POSSIBLE) |
434 | #define node_online(node) node_state((node), N_ONLINE) | ||
435 | #define node_possible(node) node_state((node), N_POSSIBLE) | ||
436 | |||
437 | #define node_set_online(node) node_set_state((node), N_ONLINE) | ||
438 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) | ||
377 | 439 | ||
378 | #define for_each_node(node) for_each_node_mask((node), node_possible_map) | 440 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) |
379 | #define for_each_online_node(node) for_each_node_mask((node), node_online_map) | 441 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) |
380 | 442 | ||
381 | #endif /* __LINUX_NODEMASK_H */ | 443 | #endif /* __LINUX_NODEMASK_H */ |
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h new file mode 100644 index 000000000000..051c1b1ede4e --- /dev/null +++ b/include/linux/page-isolation.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef __LINUX_PAGEISOLATION_H | ||
2 | #define __LINUX_PAGEISOLATION_H | ||
3 | |||
4 | /* | ||
5 | * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE. | ||
6 | * If specified range includes migrate types other than MOVABLE, | ||
7 | * this will fail with -EBUSY. | ||
8 | * | ||
9 | * For isolating all pages in the range finally, the caller have to | ||
10 | * free all pages in the range. test_page_isolated() can be used for | ||
11 | * test it. | ||
12 | */ | ||
13 | extern int | ||
14 | start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); | ||
15 | |||
16 | /* | ||
17 | * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. | ||
18 | * target range is [start_pfn, end_pfn) | ||
19 | */ | ||
20 | extern int | ||
21 | undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn); | ||
22 | |||
23 | /* | ||
24 | * test all pages in [start_pfn, end_pfn)are isolated or not. | ||
25 | */ | ||
26 | extern int | ||
27 | test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); | ||
28 | |||
29 | /* | ||
30 | * Internal funcs.Changes pageblock's migrate type. | ||
31 | * Please use make_pagetype_isolated()/make_pagetype_movable(). | ||
32 | */ | ||
33 | extern int set_migratetype_isolate(struct page *page); | ||
34 | extern void unset_migratetype_isolate(struct page *page); | ||
35 | |||
36 | |||
37 | #endif | ||
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h new file mode 100644 index 000000000000..e875905f7b12 --- /dev/null +++ b/include/linux/pageblock-flags.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * Macros for manipulating and testing flags related to a | ||
3 | * pageblock_nr_pages number of pages. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation version 2 of the License | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | * | ||
18 | * Copyright (C) IBM Corporation, 2006 | ||
19 | * | ||
20 | * Original author, Mel Gorman | ||
21 | * Major cleanups and reduction of bit operations, Andy Whitcroft | ||
22 | */ | ||
23 | #ifndef PAGEBLOCK_FLAGS_H | ||
24 | #define PAGEBLOCK_FLAGS_H | ||
25 | |||
26 | #include <linux/types.h> | ||
27 | |||
28 | /* Macro to aid the definition of ranges of bits */ | ||
29 | #define PB_range(name, required_bits) \ | ||
30 | name, name ## _end = (name + required_bits) - 1 | ||
31 | |||
32 | /* Bit indices that affect a whole block of pages */ | ||
33 | enum pageblock_bits { | ||
34 | PB_range(PB_migrate, 3), /* 3 bits required for migrate types */ | ||
35 | NR_PAGEBLOCK_BITS | ||
36 | }; | ||
37 | |||
38 | #ifdef CONFIG_HUGETLB_PAGE | ||
39 | |||
40 | #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE | ||
41 | |||
42 | /* Huge page sizes are variable */ | ||
43 | extern int pageblock_order; | ||
44 | |||
45 | #else /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */ | ||
46 | |||
47 | /* Huge pages are a constant size */ | ||
48 | #define pageblock_order HUGETLB_PAGE_ORDER | ||
49 | |||
50 | #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */ | ||
51 | |||
52 | #else /* CONFIG_HUGETLB_PAGE */ | ||
53 | |||
54 | /* If huge pages are not used, group by MAX_ORDER_NR_PAGES */ | ||
55 | #define pageblock_order (MAX_ORDER-1) | ||
56 | |||
57 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
58 | |||
59 | #define pageblock_nr_pages (1UL << pageblock_order) | ||
60 | |||
61 | /* Forward declaration */ | ||
62 | struct page; | ||
63 | |||
64 | /* Declarations for getting and setting flags. See mm/page_alloc.c */ | ||
65 | unsigned long get_pageblock_flags_group(struct page *page, | ||
66 | int start_bitidx, int end_bitidx); | ||
67 | void set_pageblock_flags_group(struct page *page, unsigned long flags, | ||
68 | int start_bitidx, int end_bitidx); | ||
69 | |||
70 | #define get_pageblock_flags(page) \ | ||
71 | get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) | ||
72 | #define set_pageblock_flags(page) \ | ||
73 | set_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) | ||
74 | |||
75 | #endif /* PAGEBLOCK_FLAGS_H */ | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 8a83537d6978..db8a410ae9e1 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -84,11 +84,11 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x) | |||
84 | typedef int filler_t(void *, struct page *); | 84 | typedef int filler_t(void *, struct page *); |
85 | 85 | ||
86 | extern struct page * find_get_page(struct address_space *mapping, | 86 | extern struct page * find_get_page(struct address_space *mapping, |
87 | unsigned long index); | 87 | pgoff_t index); |
88 | extern struct page * find_lock_page(struct address_space *mapping, | 88 | extern struct page * find_lock_page(struct address_space *mapping, |
89 | unsigned long index); | 89 | pgoff_t index); |
90 | extern struct page * find_or_create_page(struct address_space *mapping, | 90 | extern struct page * find_or_create_page(struct address_space *mapping, |
91 | unsigned long index, gfp_t gfp_mask); | 91 | pgoff_t index, gfp_t gfp_mask); |
92 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, | 92 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, |
93 | unsigned int nr_pages, struct page **pages); | 93 | unsigned int nr_pages, struct page **pages); |
94 | unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, | 94 | unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, |
@@ -96,44 +96,47 @@ unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, | |||
96 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, | 96 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, |
97 | int tag, unsigned int nr_pages, struct page **pages); | 97 | int tag, unsigned int nr_pages, struct page **pages); |
98 | 98 | ||
99 | struct page *__grab_cache_page(struct address_space *mapping, pgoff_t index); | ||
100 | |||
99 | /* | 101 | /* |
100 | * Returns locked page at given index in given cache, creating it if needed. | 102 | * Returns locked page at given index in given cache, creating it if needed. |
101 | */ | 103 | */ |
102 | static inline struct page *grab_cache_page(struct address_space *mapping, unsigned long index) | 104 | static inline struct page *grab_cache_page(struct address_space *mapping, |
105 | pgoff_t index) | ||
103 | { | 106 | { |
104 | return find_or_create_page(mapping, index, mapping_gfp_mask(mapping)); | 107 | return find_or_create_page(mapping, index, mapping_gfp_mask(mapping)); |
105 | } | 108 | } |
106 | 109 | ||
107 | extern struct page * grab_cache_page_nowait(struct address_space *mapping, | 110 | extern struct page * grab_cache_page_nowait(struct address_space *mapping, |
108 | unsigned long index); | 111 | pgoff_t index); |
109 | extern struct page * read_cache_page_async(struct address_space *mapping, | 112 | extern struct page * read_cache_page_async(struct address_space *mapping, |
110 | unsigned long index, filler_t *filler, | 113 | pgoff_t index, filler_t *filler, |
111 | void *data); | 114 | void *data); |
112 | extern struct page * read_cache_page(struct address_space *mapping, | 115 | extern struct page * read_cache_page(struct address_space *mapping, |
113 | unsigned long index, filler_t *filler, | 116 | pgoff_t index, filler_t *filler, |
114 | void *data); | 117 | void *data); |
115 | extern int read_cache_pages(struct address_space *mapping, | 118 | extern int read_cache_pages(struct address_space *mapping, |
116 | struct list_head *pages, filler_t *filler, void *data); | 119 | struct list_head *pages, filler_t *filler, void *data); |
117 | 120 | ||
118 | static inline struct page *read_mapping_page_async( | 121 | static inline struct page *read_mapping_page_async( |
119 | struct address_space *mapping, | 122 | struct address_space *mapping, |
120 | unsigned long index, void *data) | 123 | pgoff_t index, void *data) |
121 | { | 124 | { |
122 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | 125 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; |
123 | return read_cache_page_async(mapping, index, filler, data); | 126 | return read_cache_page_async(mapping, index, filler, data); |
124 | } | 127 | } |
125 | 128 | ||
126 | static inline struct page *read_mapping_page(struct address_space *mapping, | 129 | static inline struct page *read_mapping_page(struct address_space *mapping, |
127 | unsigned long index, void *data) | 130 | pgoff_t index, void *data) |
128 | { | 131 | { |
129 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | 132 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; |
130 | return read_cache_page(mapping, index, filler, data); | 133 | return read_cache_page(mapping, index, filler, data); |
131 | } | 134 | } |
132 | 135 | ||
133 | int add_to_page_cache(struct page *page, struct address_space *mapping, | 136 | int add_to_page_cache(struct page *page, struct address_space *mapping, |
134 | unsigned long index, gfp_t gfp_mask); | 137 | pgoff_t index, gfp_t gfp_mask); |
135 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | 138 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, |
136 | unsigned long index, gfp_t gfp_mask); | 139 | pgoff_t index, gfp_t gfp_mask); |
137 | extern void remove_from_page_cache(struct page *page); | 140 | extern void remove_from_page_cache(struct page *page); |
138 | extern void __remove_from_page_cache(struct page *page); | 141 | extern void __remove_from_page_cache(struct page *page); |
139 | 142 | ||
@@ -218,6 +221,9 @@ static inline int fault_in_pages_writeable(char __user *uaddr, int size) | |||
218 | { | 221 | { |
219 | int ret; | 222 | int ret; |
220 | 223 | ||
224 | if (unlikely(size == 0)) | ||
225 | return 0; | ||
226 | |||
221 | /* | 227 | /* |
222 | * Writing zeroes into userspace here is OK, because we know that if | 228 | * Writing zeroes into userspace here is OK, because we know that if |
223 | * the zero gets there, we'll be overwriting it. | 229 | * the zero gets there, we'll be overwriting it. |
@@ -237,19 +243,23 @@ static inline int fault_in_pages_writeable(char __user *uaddr, int size) | |||
237 | return ret; | 243 | return ret; |
238 | } | 244 | } |
239 | 245 | ||
240 | static inline void fault_in_pages_readable(const char __user *uaddr, int size) | 246 | static inline int fault_in_pages_readable(const char __user *uaddr, int size) |
241 | { | 247 | { |
242 | volatile char c; | 248 | volatile char c; |
243 | int ret; | 249 | int ret; |
244 | 250 | ||
251 | if (unlikely(size == 0)) | ||
252 | return 0; | ||
253 | |||
245 | ret = __get_user(c, uaddr); | 254 | ret = __get_user(c, uaddr); |
246 | if (ret == 0) { | 255 | if (ret == 0) { |
247 | const char __user *end = uaddr + size - 1; | 256 | const char __user *end = uaddr + size - 1; |
248 | 257 | ||
249 | if (((unsigned long)uaddr & PAGE_MASK) != | 258 | if (((unsigned long)uaddr & PAGE_MASK) != |
250 | ((unsigned long)end & PAGE_MASK)) | 259 | ((unsigned long)end & PAGE_MASK)) |
251 | __get_user(c, end); | 260 | ret = __get_user(c, end); |
252 | } | 261 | } |
262 | return ret; | ||
253 | } | 263 | } |
254 | 264 | ||
255 | #endif /* _LINUX_PAGEMAP_H */ | 265 | #endif /* _LINUX_PAGEMAP_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2c49561f9b45..df948b44edad 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1995,6 +1995,8 @@ | |||
1995 | #define PCI_VENDOR_ID_TOPIC 0x151f | 1995 | #define PCI_VENDOR_ID_TOPIC 0x151f |
1996 | #define PCI_DEVICE_ID_TOPIC_TP560 0x0000 | 1996 | #define PCI_DEVICE_ID_TOPIC_TP560 0x0000 |
1997 | 1997 | ||
1998 | #define PCI_VENDOR_ID_MAINPINE 0x1522 | ||
1999 | #define PCI_DEVICE_ID_MAINPINE_PBRIDGE 0x0100 | ||
1998 | #define PCI_VENDOR_ID_ENE 0x1524 | 2000 | #define PCI_VENDOR_ID_ENE 0x1524 |
1999 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 | 2001 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 |
2000 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 | 2002 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 |
@@ -2324,6 +2326,8 @@ | |||
2324 | #define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 | 2326 | #define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 |
2325 | #define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a | 2327 | #define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a |
2326 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e | 2328 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e |
2329 | #define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b | ||
2330 | #define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff | ||
2327 | #define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031 | 2331 | #define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031 |
2328 | #define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032 | 2332 | #define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032 |
2329 | #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 | 2333 | #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index f9e77d2ee320..b6116b4445c7 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -26,28 +26,31 @@ | |||
26 | #include <linux/rcupdate.h> | 26 | #include <linux/rcupdate.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * A direct pointer (root->rnode pointing directly to a data item, | 29 | * An indirect pointer (root->rnode pointing to a radix_tree_node, rather |
30 | * rather than another radix_tree_node) is signalled by the low bit | 30 | * than a data item) is signalled by the low bit set in the root->rnode |
31 | * set in the root->rnode pointer. | 31 | * pointer. |
32 | * | 32 | * |
33 | * In this case root->height is also NULL, but the direct pointer tests are | 33 | * In this case root->height is > 0, but the indirect pointer tests are |
34 | * needed for RCU lookups when root->height is unreliable. | 34 | * needed for RCU lookups (because root->height is unreliable). The only |
35 | * time callers need worry about this is when doing a lookup_slot under | ||
36 | * RCU. | ||
35 | */ | 37 | */ |
36 | #define RADIX_TREE_DIRECT_PTR 1 | 38 | #define RADIX_TREE_INDIRECT_PTR 1 |
39 | #define RADIX_TREE_RETRY ((void *)-1UL) | ||
37 | 40 | ||
38 | static inline void *radix_tree_ptr_to_direct(void *ptr) | 41 | static inline void *radix_tree_ptr_to_indirect(void *ptr) |
39 | { | 42 | { |
40 | return (void *)((unsigned long)ptr | RADIX_TREE_DIRECT_PTR); | 43 | return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR); |
41 | } | 44 | } |
42 | 45 | ||
43 | static inline void *radix_tree_direct_to_ptr(void *ptr) | 46 | static inline void *radix_tree_indirect_to_ptr(void *ptr) |
44 | { | 47 | { |
45 | return (void *)((unsigned long)ptr & ~RADIX_TREE_DIRECT_PTR); | 48 | return (void *)((unsigned long)ptr & ~RADIX_TREE_INDIRECT_PTR); |
46 | } | 49 | } |
47 | 50 | ||
48 | static inline int radix_tree_is_direct_ptr(void *ptr) | 51 | static inline int radix_tree_is_indirect_ptr(void *ptr) |
49 | { | 52 | { |
50 | return (int)((unsigned long)ptr & RADIX_TREE_DIRECT_PTR); | 53 | return (int)((unsigned long)ptr & RADIX_TREE_INDIRECT_PTR); |
51 | } | 54 | } |
52 | 55 | ||
53 | /*** radix-tree API starts here ***/ | 56 | /*** radix-tree API starts here ***/ |
@@ -130,7 +133,10 @@ do { \ | |||
130 | */ | 133 | */ |
131 | static inline void *radix_tree_deref_slot(void **pslot) | 134 | static inline void *radix_tree_deref_slot(void **pslot) |
132 | { | 135 | { |
133 | return radix_tree_direct_to_ptr(*pslot); | 136 | void *ret = *pslot; |
137 | if (unlikely(radix_tree_is_indirect_ptr(ret))) | ||
138 | ret = RADIX_TREE_RETRY; | ||
139 | return ret; | ||
134 | } | 140 | } |
135 | /** | 141 | /** |
136 | * radix_tree_replace_slot - replace item in a slot | 142 | * radix_tree_replace_slot - replace item in a slot |
@@ -142,10 +148,8 @@ static inline void *radix_tree_deref_slot(void **pslot) | |||
142 | */ | 148 | */ |
143 | static inline void radix_tree_replace_slot(void **pslot, void *item) | 149 | static inline void radix_tree_replace_slot(void **pslot, void *item) |
144 | { | 150 | { |
145 | BUG_ON(radix_tree_is_direct_ptr(item)); | 151 | BUG_ON(radix_tree_is_indirect_ptr(item)); |
146 | rcu_assign_pointer(*pslot, | 152 | rcu_assign_pointer(*pslot, item); |
147 | (void *)((unsigned long)item | | ||
148 | ((unsigned long)*pslot & RADIX_TREE_DIRECT_PTR))); | ||
149 | } | 153 | } |
150 | 154 | ||
151 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | 155 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); |
@@ -155,6 +159,8 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |||
155 | unsigned int | 159 | unsigned int |
156 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 160 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
157 | unsigned long first_index, unsigned int max_items); | 161 | unsigned long first_index, unsigned int max_items); |
162 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, | ||
163 | unsigned long index, unsigned long max_scan); | ||
158 | int radix_tree_preload(gfp_t gfp_mask); | 164 | int radix_tree_preload(gfp_t gfp_mask); |
159 | void radix_tree_init(void); | 165 | void radix_tree_init(void); |
160 | void *radix_tree_tag_set(struct radix_tree_root *root, | 166 | void *radix_tree_tag_set(struct radix_tree_root *root, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 228e0a8ce248..592e3a55f818 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _LINUX_SCHED_H | 1 | #ifndef _LINUX_SCHED_H |
2 | #define _LINUX_SCHED_H | 2 | #define _LINUX_SCHED_H |
3 | 3 | ||
4 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | ||
5 | |||
6 | /* | 4 | /* |
7 | * cloning flags: | 5 | * cloning flags: |
8 | */ | 6 | */ |
@@ -58,12 +56,12 @@ struct sched_param { | |||
58 | #include <linux/cpumask.h> | 56 | #include <linux/cpumask.h> |
59 | #include <linux/errno.h> | 57 | #include <linux/errno.h> |
60 | #include <linux/nodemask.h> | 58 | #include <linux/nodemask.h> |
59 | #include <linux/mm_types.h> | ||
61 | 60 | ||
62 | #include <asm/system.h> | 61 | #include <asm/system.h> |
63 | #include <asm/semaphore.h> | 62 | #include <asm/semaphore.h> |
64 | #include <asm/page.h> | 63 | #include <asm/page.h> |
65 | #include <asm/ptrace.h> | 64 | #include <asm/ptrace.h> |
66 | #include <asm/mmu.h> | ||
67 | #include <asm/cputime.h> | 65 | #include <asm/cputime.h> |
68 | 66 | ||
69 | #include <linux/smp.h> | 67 | #include <linux/smp.h> |
@@ -319,7 +317,6 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
319 | #define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member) | 317 | #define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member) |
320 | #define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) | 318 | #define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) |
321 | #define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) | 319 | #define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) |
322 | typedef atomic_long_t mm_counter_t; | ||
323 | 320 | ||
324 | #else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 321 | #else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ |
325 | /* | 322 | /* |
@@ -331,7 +328,6 @@ typedef atomic_long_t mm_counter_t; | |||
331 | #define add_mm_counter(mm, member, value) (mm)->_##member += (value) | 328 | #define add_mm_counter(mm, member, value) (mm)->_##member += (value) |
332 | #define inc_mm_counter(mm, member) (mm)->_##member++ | 329 | #define inc_mm_counter(mm, member) (mm)->_##member++ |
333 | #define dec_mm_counter(mm, member) (mm)->_##member-- | 330 | #define dec_mm_counter(mm, member) (mm)->_##member-- |
334 | typedef unsigned long mm_counter_t; | ||
335 | 331 | ||
336 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 332 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ |
337 | 333 | ||
@@ -368,74 +364,6 @@ extern int get_dumpable(struct mm_struct *mm); | |||
368 | #define MMF_DUMP_FILTER_DEFAULT \ | 364 | #define MMF_DUMP_FILTER_DEFAULT \ |
369 | ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED)) | 365 | ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED)) |
370 | 366 | ||
371 | struct mm_struct { | ||
372 | struct vm_area_struct * mmap; /* list of VMAs */ | ||
373 | struct rb_root mm_rb; | ||
374 | struct vm_area_struct * mmap_cache; /* last find_vma result */ | ||
375 | unsigned long (*get_unmapped_area) (struct file *filp, | ||
376 | unsigned long addr, unsigned long len, | ||
377 | unsigned long pgoff, unsigned long flags); | ||
378 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | ||
379 | unsigned long mmap_base; /* base of mmap area */ | ||
380 | unsigned long task_size; /* size of task vm space */ | ||
381 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | ||
382 | unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ | ||
383 | pgd_t * pgd; | ||
384 | atomic_t mm_users; /* How many users with user space? */ | ||
385 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | ||
386 | int map_count; /* number of VMAs */ | ||
387 | struct rw_semaphore mmap_sem; | ||
388 | spinlock_t page_table_lock; /* Protects page tables and some counters */ | ||
389 | |||
390 | struct list_head mmlist; /* List of maybe swapped mm's. These are globally strung | ||
391 | * together off init_mm.mmlist, and are protected | ||
392 | * by mmlist_lock | ||
393 | */ | ||
394 | |||
395 | /* Special counters, in some configurations protected by the | ||
396 | * page_table_lock, in other configurations by being atomic. | ||
397 | */ | ||
398 | mm_counter_t _file_rss; | ||
399 | mm_counter_t _anon_rss; | ||
400 | |||
401 | unsigned long hiwater_rss; /* High-watermark of RSS usage */ | ||
402 | unsigned long hiwater_vm; /* High-water virtual memory usage */ | ||
403 | |||
404 | unsigned long total_vm, locked_vm, shared_vm, exec_vm; | ||
405 | unsigned long stack_vm, reserved_vm, def_flags, nr_ptes; | ||
406 | unsigned long start_code, end_code, start_data, end_data; | ||
407 | unsigned long start_brk, brk, start_stack; | ||
408 | unsigned long arg_start, arg_end, env_start, env_end; | ||
409 | |||
410 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | ||
411 | |||
412 | cpumask_t cpu_vm_mask; | ||
413 | |||
414 | /* Architecture-specific MM context */ | ||
415 | mm_context_t context; | ||
416 | |||
417 | /* Swap token stuff */ | ||
418 | /* | ||
419 | * Last value of global fault stamp as seen by this process. | ||
420 | * In other words, this value gives an indication of how long | ||
421 | * it has been since this task got the token. | ||
422 | * Look at mm/thrash.c | ||
423 | */ | ||
424 | unsigned int faultstamp; | ||
425 | unsigned int token_priority; | ||
426 | unsigned int last_interval; | ||
427 | |||
428 | unsigned long flags; /* Must use atomic bitops to access the bits */ | ||
429 | |||
430 | /* coredumping support */ | ||
431 | int core_waiters; | ||
432 | struct completion *core_startup_done, core_done; | ||
433 | |||
434 | /* aio bits */ | ||
435 | rwlock_t ioctx_list_lock; | ||
436 | struct kioctx *ioctx_list; | ||
437 | }; | ||
438 | |||
439 | struct sighand_struct { | 367 | struct sighand_struct { |
440 | atomic_t count; | 368 | atomic_t count; |
441 | struct k_sigaction action[_NSIG]; | 369 | struct k_sigaction action[_NSIG]; |
@@ -801,9 +729,6 @@ struct sched_domain { | |||
801 | #endif | 729 | #endif |
802 | }; | 730 | }; |
803 | 731 | ||
804 | extern int partition_sched_domains(cpumask_t *partition1, | ||
805 | cpumask_t *partition2); | ||
806 | |||
807 | #endif /* CONFIG_SMP */ | 732 | #endif /* CONFIG_SMP */ |
808 | 733 | ||
809 | /* | 734 | /* |
diff --git a/include/linux/selection.h b/include/linux/selection.h index f9457861937c..8cdaa1151d2e 100644 --- a/include/linux/selection.h +++ b/include/linux/selection.h | |||
@@ -13,6 +13,7 @@ | |||
13 | struct tty_struct; | 13 | struct tty_struct; |
14 | 14 | ||
15 | extern struct vc_data *sel_cons; | 15 | extern struct vc_data *sel_cons; |
16 | struct tty_struct; | ||
16 | 17 | ||
17 | extern void clear_selection(void); | 18 | extern void clear_selection(void); |
18 | extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty); | 19 | extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 09d17b06bf02..4db77249281c 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -291,7 +291,8 @@ struct uart_port { | |||
291 | resource_size_t mapbase; /* for ioremap */ | 291 | resource_size_t mapbase; /* for ioremap */ |
292 | struct device *dev; /* parent device */ | 292 | struct device *dev; /* parent device */ |
293 | unsigned char hub6; /* this should be in the 8250 driver */ | 293 | unsigned char hub6; /* this should be in the 8250 driver */ |
294 | unsigned char unused[3]; | 294 | unsigned char suspended; |
295 | unsigned char unused[2]; | ||
295 | void *private_data; /* generic platform data pointer */ | 296 | void *private_data; /* generic platform data pointer */ |
296 | }; | 297 | }; |
297 | 298 | ||
diff --git a/include/linux/slab.h b/include/linux/slab.h index d859354b9e51..3a5bad3ad126 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -24,12 +24,14 @@ | |||
24 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ | 24 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ |
25 | #define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ | 25 | #define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ |
26 | #define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ | 26 | #define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ |
27 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ | ||
28 | #define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ | 27 | #define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ |
29 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ | 28 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ |
30 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ | 29 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ |
31 | #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ | 30 | #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ |
32 | 31 | ||
32 | /* The following flags affect the page allocator grouping pages by mobility */ | ||
33 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ | ||
34 | #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ | ||
33 | /* | 35 | /* |
34 | * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. | 36 | * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. |
35 | * | 37 | * |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 74962077f632..d65159d1d4f5 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -11,6 +11,14 @@ | |||
11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
13 | 13 | ||
14 | struct kmem_cache_cpu { | ||
15 | void **freelist; | ||
16 | struct page *page; | ||
17 | int node; | ||
18 | unsigned int offset; | ||
19 | unsigned int objsize; | ||
20 | }; | ||
21 | |||
14 | struct kmem_cache_node { | 22 | struct kmem_cache_node { |
15 | spinlock_t list_lock; /* Protect partial list and nr_partial */ | 23 | spinlock_t list_lock; /* Protect partial list and nr_partial */ |
16 | unsigned long nr_partial; | 24 | unsigned long nr_partial; |
@@ -54,7 +62,11 @@ struct kmem_cache { | |||
54 | int defrag_ratio; | 62 | int defrag_ratio; |
55 | struct kmem_cache_node *node[MAX_NUMNODES]; | 63 | struct kmem_cache_node *node[MAX_NUMNODES]; |
56 | #endif | 64 | #endif |
57 | struct page *cpu_slab[NR_CPUS]; | 65 | #ifdef CONFIG_SMP |
66 | struct kmem_cache_cpu *cpu_slab[NR_CPUS]; | ||
67 | #else | ||
68 | struct kmem_cache_cpu cpu_slab; | ||
69 | #endif | ||
58 | }; | 70 | }; |
59 | 71 | ||
60 | /* | 72 | /* |
@@ -72,7 +84,7 @@ struct kmem_cache { | |||
72 | * We keep the general caches in an array of slab caches that are used for | 84 | * We keep the general caches in an array of slab caches that are used for |
73 | * 2^x bytes of allocations. | 85 | * 2^x bytes of allocations. |
74 | */ | 86 | */ |
75 | extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; | 87 | extern struct kmem_cache kmalloc_caches[PAGE_SHIFT]; |
76 | 88 | ||
77 | /* | 89 | /* |
78 | * Sorry that the following has to be that ugly but some versions of GCC | 90 | * Sorry that the following has to be that ugly but some versions of GCC |
@@ -83,9 +95,6 @@ static __always_inline int kmalloc_index(size_t size) | |||
83 | if (!size) | 95 | if (!size) |
84 | return 0; | 96 | return 0; |
85 | 97 | ||
86 | if (size > KMALLOC_MAX_SIZE) | ||
87 | return -1; | ||
88 | |||
89 | if (size <= KMALLOC_MIN_SIZE) | 98 | if (size <= KMALLOC_MIN_SIZE) |
90 | return KMALLOC_SHIFT_LOW; | 99 | return KMALLOC_SHIFT_LOW; |
91 | 100 | ||
@@ -102,6 +111,10 @@ static __always_inline int kmalloc_index(size_t size) | |||
102 | if (size <= 512) return 9; | 111 | if (size <= 512) return 9; |
103 | if (size <= 1024) return 10; | 112 | if (size <= 1024) return 10; |
104 | if (size <= 2 * 1024) return 11; | 113 | if (size <= 2 * 1024) return 11; |
114 | /* | ||
115 | * The following is only needed to support architectures with a larger page | ||
116 | * size than 4k. | ||
117 | */ | ||
105 | if (size <= 4 * 1024) return 12; | 118 | if (size <= 4 * 1024) return 12; |
106 | if (size <= 8 * 1024) return 13; | 119 | if (size <= 8 * 1024) return 13; |
107 | if (size <= 16 * 1024) return 14; | 120 | if (size <= 16 * 1024) return 14; |
@@ -109,13 +122,9 @@ static __always_inline int kmalloc_index(size_t size) | |||
109 | if (size <= 64 * 1024) return 16; | 122 | if (size <= 64 * 1024) return 16; |
110 | if (size <= 128 * 1024) return 17; | 123 | if (size <= 128 * 1024) return 17; |
111 | if (size <= 256 * 1024) return 18; | 124 | if (size <= 256 * 1024) return 18; |
112 | if (size <= 512 * 1024) return 19; | 125 | if (size <= 512 * 1024) return 19; |
113 | if (size <= 1024 * 1024) return 20; | 126 | if (size <= 1024 * 1024) return 20; |
114 | if (size <= 2 * 1024 * 1024) return 21; | 127 | if (size <= 2 * 1024 * 1024) return 21; |
115 | if (size <= 4 * 1024 * 1024) return 22; | ||
116 | if (size <= 8 * 1024 * 1024) return 23; | ||
117 | if (size <= 16 * 1024 * 1024) return 24; | ||
118 | if (size <= 32 * 1024 * 1024) return 25; | ||
119 | return -1; | 128 | return -1; |
120 | 129 | ||
121 | /* | 130 | /* |
@@ -140,19 +149,6 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size) | |||
140 | if (index == 0) | 149 | if (index == 0) |
141 | return NULL; | 150 | return NULL; |
142 | 151 | ||
143 | /* | ||
144 | * This function only gets expanded if __builtin_constant_p(size), so | ||
145 | * testing it here shouldn't be needed. But some versions of gcc need | ||
146 | * help. | ||
147 | */ | ||
148 | if (__builtin_constant_p(size) && index < 0) { | ||
149 | /* | ||
150 | * Generate a link failure. Would be great if we could | ||
151 | * do something to stop the compile here. | ||
152 | */ | ||
153 | extern void __kmalloc_size_too_large(void); | ||
154 | __kmalloc_size_too_large(); | ||
155 | } | ||
156 | return &kmalloc_caches[index]; | 152 | return &kmalloc_caches[index]; |
157 | } | 153 | } |
158 | 154 | ||
@@ -168,15 +164,21 @@ void *__kmalloc(size_t size, gfp_t flags); | |||
168 | 164 | ||
169 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 165 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
170 | { | 166 | { |
171 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | 167 | if (__builtin_constant_p(size)) { |
172 | struct kmem_cache *s = kmalloc_slab(size); | 168 | if (size > PAGE_SIZE / 2) |
169 | return (void *)__get_free_pages(flags | __GFP_COMP, | ||
170 | get_order(size)); | ||
173 | 171 | ||
174 | if (!s) | 172 | if (!(flags & SLUB_DMA)) { |
175 | return ZERO_SIZE_PTR; | 173 | struct kmem_cache *s = kmalloc_slab(size); |
176 | 174 | ||
177 | return kmem_cache_alloc(s, flags); | 175 | if (!s) |
178 | } else | 176 | return ZERO_SIZE_PTR; |
179 | return __kmalloc(size, flags); | 177 | |
178 | return kmem_cache_alloc(s, flags); | ||
179 | } | ||
180 | } | ||
181 | return __kmalloc(size, flags); | ||
180 | } | 182 | } |
181 | 183 | ||
182 | #ifdef CONFIG_NUMA | 184 | #ifdef CONFIG_NUMA |
@@ -185,15 +187,16 @@ void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | |||
185 | 187 | ||
186 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 188 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
187 | { | 189 | { |
188 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | 190 | if (__builtin_constant_p(size) && |
189 | struct kmem_cache *s = kmalloc_slab(size); | 191 | size <= PAGE_SIZE / 2 && !(flags & SLUB_DMA)) { |
192 | struct kmem_cache *s = kmalloc_slab(size); | ||
190 | 193 | ||
191 | if (!s) | 194 | if (!s) |
192 | return ZERO_SIZE_PTR; | 195 | return ZERO_SIZE_PTR; |
193 | 196 | ||
194 | return kmem_cache_alloc_node(s, flags, node); | 197 | return kmem_cache_alloc_node(s, flags, node); |
195 | } else | 198 | } |
196 | return __kmalloc_node(size, flags, node); | 199 | return __kmalloc_node(size, flags, node); |
197 | } | 200 | } |
198 | #endif | 201 | #endif |
199 | 202 | ||
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h index 014e73b31fc0..df7620dd8f31 100644 --- a/include/linux/sm501-regs.h +++ b/include/linux/sm501-regs.h | |||
@@ -15,6 +15,24 @@ | |||
15 | 15 | ||
16 | /* config 1 */ | 16 | /* config 1 */ |
17 | #define SM501_SYSTEM_CONTROL (0x000000) | 17 | #define SM501_SYSTEM_CONTROL (0x000000) |
18 | |||
19 | #define SM501_SYSCTRL_PANEL_TRISTATE (1<<0) | ||
20 | #define SM501_SYSCTRL_MEM_TRISTATE (1<<1) | ||
21 | #define SM501_SYSCTRL_CRT_TRISTATE (1<<2) | ||
22 | |||
23 | #define SM501_SYSCTRL_PCI_SLAVE_BURST_MASK (3<<4) | ||
24 | #define SM501_SYSCTRL_PCI_SLAVE_BURST_1 (0<<4) | ||
25 | #define SM501_SYSCTRL_PCI_SLAVE_BURST_2 (1<<4) | ||
26 | #define SM501_SYSCTRL_PCI_SLAVE_BURST_4 (2<<4) | ||
27 | #define SM501_SYSCTRL_PCI_SLAVE_BURST_8 (3<<4) | ||
28 | |||
29 | #define SM501_SYSCTRL_PCI_CLOCK_RUN_EN (1<<6) | ||
30 | #define SM501_SYSCTRL_PCI_RETRY_DISABLE (1<<7) | ||
31 | #define SM501_SYSCTRL_PCI_SUBSYS_LOCK (1<<11) | ||
32 | #define SM501_SYSCTRL_PCI_BURST_READ_EN (1<<15) | ||
33 | |||
34 | /* miscellaneous control */ | ||
35 | |||
18 | #define SM501_MISC_CONTROL (0x000004) | 36 | #define SM501_MISC_CONTROL (0x000004) |
19 | 37 | ||
20 | #define SM501_MISC_BUS_SH (0x0) | 38 | #define SM501_MISC_BUS_SH (0x0) |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 002a3cddbdd5..387e428f1cdf 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -195,7 +195,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
195 | 195 | ||
196 | /** | 196 | /** |
197 | * struct spi_master - interface to SPI master controller | 197 | * struct spi_master - interface to SPI master controller |
198 | * @cdev: class interface to this driver | 198 | * @dev: device interface to this driver |
199 | * @bus_num: board-specific (and often SOC-specific) identifier for a | 199 | * @bus_num: board-specific (and often SOC-specific) identifier for a |
200 | * given SPI controller. | 200 | * given SPI controller. |
201 | * @num_chipselect: chipselects are used to distinguish individual | 201 | * @num_chipselect: chipselects are used to distinguish individual |
@@ -222,7 +222,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
222 | * message's completion function when the transaction completes. | 222 | * message's completion function when the transaction completes. |
223 | */ | 223 | */ |
224 | struct spi_master { | 224 | struct spi_master { |
225 | struct class_device cdev; | 225 | struct device dev; |
226 | 226 | ||
227 | /* other than negative (== assign one dynamically), bus_num is fully | 227 | /* other than negative (== assign one dynamically), bus_num is fully |
228 | * board-specific. usually that simplifies to being SOC-specific. | 228 | * board-specific. usually that simplifies to being SOC-specific. |
@@ -268,17 +268,17 @@ struct spi_master { | |||
268 | 268 | ||
269 | static inline void *spi_master_get_devdata(struct spi_master *master) | 269 | static inline void *spi_master_get_devdata(struct spi_master *master) |
270 | { | 270 | { |
271 | return class_get_devdata(&master->cdev); | 271 | return dev_get_drvdata(&master->dev); |
272 | } | 272 | } |
273 | 273 | ||
274 | static inline void spi_master_set_devdata(struct spi_master *master, void *data) | 274 | static inline void spi_master_set_devdata(struct spi_master *master, void *data) |
275 | { | 275 | { |
276 | class_set_devdata(&master->cdev, data); | 276 | dev_set_drvdata(&master->dev, data); |
277 | } | 277 | } |
278 | 278 | ||
279 | static inline struct spi_master *spi_master_get(struct spi_master *master) | 279 | static inline struct spi_master *spi_master_get(struct spi_master *master) |
280 | { | 280 | { |
281 | if (!master || !class_device_get(&master->cdev)) | 281 | if (!master || !get_device(&master->dev)) |
282 | return NULL; | 282 | return NULL; |
283 | return master; | 283 | return master; |
284 | } | 284 | } |
@@ -286,7 +286,7 @@ static inline struct spi_master *spi_master_get(struct spi_master *master) | |||
286 | static inline void spi_master_put(struct spi_master *master) | 286 | static inline void spi_master_put(struct spi_master *master) |
287 | { | 287 | { |
288 | if (master) | 288 | if (master) |
289 | class_device_put(&master->cdev); | 289 | put_device(&master->dev); |
290 | } | 290 | } |
291 | 291 | ||
292 | 292 | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 46705e91573d..c1527c2ef3cb 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -481,7 +481,7 @@ static inline void *get_gadget_data (struct usb_gadget *gadget) | |||
481 | 481 | ||
482 | /** | 482 | /** |
483 | * gadget_is_dualspeed - return true iff the hardware handles high speed | 483 | * gadget_is_dualspeed - return true iff the hardware handles high speed |
484 | * @gadget: controller that might support both high and full speeds | 484 | * @g: controller that might support both high and full speeds |
485 | */ | 485 | */ |
486 | static inline int gadget_is_dualspeed(struct usb_gadget *g) | 486 | static inline int gadget_is_dualspeed(struct usb_gadget *g) |
487 | { | 487 | { |
@@ -497,7 +497,7 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g) | |||
497 | 497 | ||
498 | /** | 498 | /** |
499 | * gadget_is_otg - return true iff the hardware is OTG-ready | 499 | * gadget_is_otg - return true iff the hardware is OTG-ready |
500 | * @gadget: controller that might have a Mini-AB connector | 500 | * @g: controller that might have a Mini-AB connector |
501 | * | 501 | * |
502 | * This is a runtime test, since kernels with a USB-OTG stack sometimes | 502 | * This is a runtime test, since kernels with a USB-OTG stack sometimes |
503 | * run on boards which only have a Mini-B (or Mini-A) connector. | 503 | * run on boards which only have a Mini-B (or Mini-A) connector. |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 90ef552c42dd..f047a1fd64f8 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -184,6 +184,7 @@ struct pcmcia_device { | |||
184 | 184 | ||
185 | char * prod_id[4]; | 185 | char * prod_id[4]; |
186 | 186 | ||
187 | u64 dma_mask; | ||
187 | struct device dev; | 188 | struct device dev; |
188 | 189 | ||
189 | #ifdef CONFIG_PCMCIA_IOCTL | 190 | #ifdef CONFIG_PCMCIA_IOCTL |
diff --git a/include/video/Kbuild b/include/video/Kbuild index a14f9c045b8c..53a6c7310e61 100644 --- a/include/video/Kbuild +++ b/include/video/Kbuild | |||
@@ -1 +1 @@ | |||
unifdef-y += sisfb.h | unifdef-y += sisfb.h uvesafb.h | ||
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h index 20b9002712ef..ea18961fc5e7 100644 --- a/include/video/mbxfb.h +++ b/include/video/mbxfb.h | |||
@@ -29,18 +29,18 @@ struct mbxfb_platform_data { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | /* planar */ | 31 | /* planar */ |
32 | #define MBXFB_FMT_YUV12 0 | 32 | #define MBXFB_FMT_YUV16 0 |
33 | #define MBXFB_FMT_YUV12 1 | ||
33 | 34 | ||
34 | /* packed */ | 35 | /* packed */ |
35 | #define MBXFB_FMT_UY0VY1 1 | 36 | #define MBXFB_FMT_UY0VY1 2 |
36 | #define MBXFB_FMT_VY0UY1 2 | 37 | #define MBXFB_FMT_VY0UY1 3 |
37 | #define MBXFB_FMT_Y0UY1V 3 | 38 | #define MBXFB_FMT_Y0UY1V 4 |
38 | #define MBXFB_FMT_Y0VY1U 4 | 39 | #define MBXFB_FMT_Y0VY1U 5 |
39 | struct mbxfb_overlaySetup { | 40 | struct mbxfb_overlaySetup { |
40 | __u32 enable; | 41 | __u32 enable; |
41 | __u32 x, y; | 42 | __u32 x, y; |
42 | __u32 width, height; | 43 | __u32 width, height; |
43 | __u32 alpha; | ||
44 | __u32 fmt; | 44 | __u32 fmt; |
45 | __u32 mem_offset; | 45 | __u32 mem_offset; |
46 | __u32 scaled_width; | 46 | __u32 scaled_width; |
@@ -54,6 +54,45 @@ struct mbxfb_overlaySetup { | |||
54 | __u16 UV_stride; | 54 | __u16 UV_stride; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | #define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup) | 57 | #define MBXFB_ALPHABLEND_NONE 0 |
58 | #define MBXFB_ALPHABLEND_GLOBAL 1 | ||
59 | #define MBXFB_ALPHABLEND_PIXEL 2 | ||
60 | |||
61 | #define MBXFB_COLORKEY_DISABLED 0 | ||
62 | #define MBXFB_COLORKEY_PREVIOUS 1 | ||
63 | #define MBXFB_COLORKEY_CURRENT 2 | ||
64 | struct mbxfb_alphaCtl { | ||
65 | __u8 overlay_blend_mode; | ||
66 | __u8 overlay_colorkey_mode; | ||
67 | __u8 overlay_global_alpha; | ||
68 | __u32 overlay_colorkey; | ||
69 | __u32 overlay_colorkey_mask; | ||
70 | |||
71 | __u8 graphics_blend_mode; | ||
72 | __u8 graphics_colorkey_mode; | ||
73 | __u8 graphics_global_alpha; | ||
74 | __u32 graphics_colorkey; | ||
75 | __u32 graphics_colorkey_mask; | ||
76 | }; | ||
77 | |||
78 | #define MBXFB_PLANE_GRAPHICS 0 | ||
79 | #define MBXFB_PLANE_VIDEO 1 | ||
80 | struct mbxfb_planeorder { | ||
81 | __u8 bottom; | ||
82 | __u8 top; | ||
83 | }; | ||
84 | |||
85 | struct mbxfb_reg { | ||
86 | __u32 addr; /* offset from 0x03fe 0000 */ | ||
87 | __u32 val; /* value */ | ||
88 | __u32 mask; /* which bits to touch (for write) */ | ||
89 | }; | ||
90 | |||
91 | #define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup) | ||
92 | #define MBXFB_IOCG_ALPHA _IOR(0xF4, 0x01,struct mbxfb_alphaCtl) | ||
93 | #define MBXFB_IOCS_ALPHA _IOW(0xF4, 0x02,struct mbxfb_alphaCtl) | ||
94 | #define MBXFB_IOCS_PLANEORDER _IOR(0xF4, 0x03,struct mbxfb_planeorder) | ||
95 | #define MBXFB_IOCS_REG _IOW(0xF4, 0x04,struct mbxfb_reg) | ||
96 | #define MBXFB_IOCX_REG _IOWR(0xF4, 0x05,struct mbxfb_reg) | ||
58 | 97 | ||
59 | #endif /* __MBX_FB_H */ | 98 | #endif /* __MBX_FB_H */ |
diff --git a/include/video/permedia2.h b/include/video/permedia2.h index 9e49c9571ec3..9ce9adbfda2b 100644 --- a/include/video/permedia2.h +++ b/include/video/permedia2.h | |||
@@ -58,7 +58,14 @@ | |||
58 | #define PM2R_RD_PALETTE_DATA 0x4008 | 58 | #define PM2R_RD_PALETTE_DATA 0x4008 |
59 | #define PM2R_RD_PIXEL_MASK 0x4010 | 59 | #define PM2R_RD_PIXEL_MASK 0x4010 |
60 | #define PM2R_RD_PALETTE_READ_ADDRESS 0x4018 | 60 | #define PM2R_RD_PALETTE_READ_ADDRESS 0x4018 |
61 | #define PM2R_RD_CURSOR_COLOR_ADDRESS 0x4020 | ||
62 | #define PM2R_RD_CURSOR_COLOR_DATA 0x4028 | ||
61 | #define PM2R_RD_INDEXED_DATA 0x4050 | 63 | #define PM2R_RD_INDEXED_DATA 0x4050 |
64 | #define PM2R_RD_CURSOR_DATA 0x4058 | ||
65 | #define PM2R_RD_CURSOR_X_LSB 0x4060 | ||
66 | #define PM2R_RD_CURSOR_X_MSB 0x4068 | ||
67 | #define PM2R_RD_CURSOR_Y_LSB 0x4070 | ||
68 | #define PM2R_RD_CURSOR_Y_MSB 0x4078 | ||
62 | 69 | ||
63 | #define PM2R_START_X_DOM 0x8000 | 70 | #define PM2R_START_X_DOM 0x8000 |
64 | #define PM2R_D_X_DOM 0x8008 | 71 | #define PM2R_D_X_DOM 0x8008 |
@@ -68,11 +75,14 @@ | |||
68 | #define PM2R_D_Y 0x8028 | 75 | #define PM2R_D_Y 0x8028 |
69 | #define PM2R_COUNT 0x8030 | 76 | #define PM2R_COUNT 0x8030 |
70 | #define PM2R_RENDER 0x8038 | 77 | #define PM2R_RENDER 0x8038 |
78 | #define PM2R_BIT_MASK_PATTERN 0x8068 | ||
71 | #define PM2R_RASTERIZER_MODE 0x80a0 | 79 | #define PM2R_RASTERIZER_MODE 0x80a0 |
72 | #define PM2R_RECTANGLE_ORIGIN 0x80d0 | 80 | #define PM2R_RECTANGLE_ORIGIN 0x80d0 |
73 | #define PM2R_RECTANGLE_SIZE 0x80d8 | 81 | #define PM2R_RECTANGLE_SIZE 0x80d8 |
74 | #define PM2R_PACKED_DATA_LIMITS 0x8150 | 82 | #define PM2R_PACKED_DATA_LIMITS 0x8150 |
75 | #define PM2R_SCISSOR_MODE 0x8180 | 83 | #define PM2R_SCISSOR_MODE 0x8180 |
84 | #define PM2R_SCISSOR_MIN_XY 0x8188 | ||
85 | #define PM2R_SCISSOR_MAX_XY 0x8190 | ||
76 | #define PM2R_SCREEN_SIZE 0x8198 | 86 | #define PM2R_SCREEN_SIZE 0x8198 |
77 | #define PM2R_AREA_STIPPLE_MODE 0x81a0 | 87 | #define PM2R_AREA_STIPPLE_MODE 0x81a0 |
78 | #define PM2R_WINDOW_ORIGIN 0x81c8 | 88 | #define PM2R_WINDOW_ORIGIN 0x81c8 |
@@ -83,7 +93,9 @@ | |||
83 | #define PM2R_TEXEL_LUT_MODE 0x8678 | 93 | #define PM2R_TEXEL_LUT_MODE 0x8678 |
84 | #define PM2R_TEXTURE_COLOR_MODE 0x8680 | 94 | #define PM2R_TEXTURE_COLOR_MODE 0x8680 |
85 | #define PM2R_FOG_MODE 0x8690 | 95 | #define PM2R_FOG_MODE 0x8690 |
96 | #define PM2R_TEXEL0 0x8760 | ||
86 | #define PM2R_COLOR_DDA_MODE 0x87e0 | 97 | #define PM2R_COLOR_DDA_MODE 0x87e0 |
98 | #define PM2R_CONSTANT_COLOR 0x87e8 | ||
87 | #define PM2R_ALPHA_BLEND_MODE 0x8810 | 99 | #define PM2R_ALPHA_BLEND_MODE 0x8810 |
88 | #define PM2R_DITHER_MODE 0x8818 | 100 | #define PM2R_DITHER_MODE 0x8818 |
89 | #define PM2R_FB_SOFT_WRITE_MASK 0x8820 | 101 | #define PM2R_FB_SOFT_WRITE_MASK 0x8820 |
@@ -148,6 +160,7 @@ | |||
148 | #define PM2VI_RD_CURSOR_Y_HIGH 0x00A | 160 | #define PM2VI_RD_CURSOR_Y_HIGH 0x00A |
149 | #define PM2VI_RD_CURSOR_X_HOT 0x00B | 161 | #define PM2VI_RD_CURSOR_X_HOT 0x00B |
150 | #define PM2VI_RD_CURSOR_Y_HOT 0x00C | 162 | #define PM2VI_RD_CURSOR_Y_HOT 0x00C |
163 | #define PM2VI_RD_OVERLAY_KEY 0x00D | ||
151 | #define PM2VI_RD_CLK0_PRESCALE 0x201 | 164 | #define PM2VI_RD_CLK0_PRESCALE 0x201 |
152 | #define PM2VI_RD_CLK0_FEEDBACK 0x202 | 165 | #define PM2VI_RD_CLK0_FEEDBACK 0x202 |
153 | #define PM2VI_RD_CLK0_POSTSCALE 0x203 | 166 | #define PM2VI_RD_CLK0_POSTSCALE 0x203 |
@@ -169,6 +182,8 @@ | |||
169 | #define PM2F_RENDER_TRAPEZOID (1L<<6) | 182 | #define PM2F_RENDER_TRAPEZOID (1L<<6) |
170 | #define PM2F_RENDER_POINT (2L<<6) | 183 | #define PM2F_RENDER_POINT (2L<<6) |
171 | #define PM2F_RENDER_RECTANGLE (3L<<6) | 184 | #define PM2F_RENDER_RECTANGLE (3L<<6) |
185 | #define PM2F_RENDER_SYNC_ON_BIT_MASK (1L<<11) | ||
186 | #define PM2F_RENDER_TEXTURE_ENABLE (1L<<13) | ||
172 | #define PM2F_SYNCHRONIZATION (1L<<10) | 187 | #define PM2F_SYNCHRONIZATION (1L<<10) |
173 | #define PM2F_PLL_LOCKED 0x10 | 188 | #define PM2F_PLL_LOCKED 0x10 |
174 | #define PM2F_BEING_RESET (1L<<31) | 189 | #define PM2F_BEING_RESET (1L<<31) |
@@ -224,6 +239,8 @@ | |||
224 | #define PM2F_APERTURE_STANDARD 0 | 239 | #define PM2F_APERTURE_STANDARD 0 |
225 | #define PM2F_APERTURE_BYTESWAP 1 | 240 | #define PM2F_APERTURE_BYTESWAP 1 |
226 | #define PM2F_APERTURE_HALFWORDSWAP 2 | 241 | #define PM2F_APERTURE_HALFWORDSWAP 2 |
242 | #define PM2F_CURSORMODE_CURSOR_ENABLE (1 << 0) | ||
243 | #define PM2F_CURSORMODE_TYPE_X (1 << 4) | ||
227 | 244 | ||
228 | typedef enum { | 245 | typedef enum { |
229 | PM2_TYPE_PERMEDIA2, | 246 | PM2_TYPE_PERMEDIA2, |
diff --git a/include/video/pm3fb.h b/include/video/pm3fb.h index d52e45a1e9b8..2b85134fe96f 100644 --- a/include/video/pm3fb.h +++ b/include/video/pm3fb.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/video/pm3fb.h -- 3DLabs Permedia3 frame buffer device | 2 | * linux/drivers/video/pm3fb.h -- 3DLabs Permedia3 frame buffer device |
3 | * | 3 | * |
4 | * Copyright (C) 2001 Romain Dolbeau <dolbeau@irisa.fr> | 4 | * Copyright (C) 2001 Romain Dolbeau <dolbeau@irisa.fr> |
5 | * Copyright (C) 2001 Sven Luther, <luther@dpt-info.u-strasbg.fr> | 5 | * Copyright (C) 2001 Sven Luther, <luther@dpt-info.u-strasbg.fr> |
6 | * | 6 | * |
@@ -51,37 +51,36 @@ | |||
51 | * GLINT Permedia3 Region 0 Bypass Controls * | 51 | * GLINT Permedia3 Region 0 Bypass Controls * |
52 | ***********************************************/ | 52 | ***********************************************/ |
53 | #define PM3ByAperture1Mode 0x0300 | 53 | #define PM3ByAperture1Mode 0x0300 |
54 | #define PM3ByApertureMode_BYTESWAP_ABCD (0<<0) | 54 | #define PM3ByApertureMode_BYTESWAP_ABCD (0 << 0) |
55 | #define PM3ByApertureMode_BYTESWAP_BADC (1<<0) | 55 | #define PM3ByApertureMode_BYTESWAP_BADC (1 << 0) |
56 | #define PM3ByApertureMode_BYTESWAP_CDAB (2<<0) | 56 | #define PM3ByApertureMode_BYTESWAP_CDAB (2 << 0) |
57 | #define PM3ByApertureMode_BYTESWAP_DCBA (3<<0) | 57 | #define PM3ByApertureMode_BYTESWAP_DCBA (3 << 0) |
58 | #define PM3ByApertureMode_PATCH_DISABLE (0<<2) | 58 | #define PM3ByApertureMode_PATCH_ENABLE (1 << 2) |
59 | #define PM3ByApertureMode_PATCH_ENABLE (1<<2) | 59 | #define PM3ByApertureMode_FORMAT_RAW (0 << 3) |
60 | #define PM3ByApertureMode_FORMAT_RAW (0<<3) | 60 | #define PM3ByApertureMode_FORMAT_YUYV (1 << 3) |
61 | #define PM3ByApertureMode_FORMAT_YUYV (1<<3) | 61 | #define PM3ByApertureMode_FORMAT_UYVY (2 << 3) |
62 | #define PM3ByApertureMode_FORMAT_UYVY (2<<3) | 62 | #define PM3ByApertureMode_PIXELSIZE_8BIT (0 << 5) |
63 | #define PM3ByApertureMode_PIXELSIZE_8BIT (0<<5) | 63 | #define PM3ByApertureMode_PIXELSIZE_16BIT (1 << 5) |
64 | #define PM3ByApertureMode_PIXELSIZE_16BIT (1<<5) | 64 | #define PM3ByApertureMode_PIXELSIZE_32BIT (2 << 5) |
65 | #define PM3ByApertureMode_PIXELSIZE_32BIT (2<<5) | 65 | #define PM3ByApertureMode_PIXELSIZE_MASK (3 << 5) |
66 | #define PM3ByApertureMode_PIXELSIZE_MASK (3<<5) | 66 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_1024 (0 << 7) |
67 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_1024 (0<<7) | 67 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_2048 (1 << 7) |
68 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_2048 (1<<7) | 68 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_4096 (2 << 7) |
69 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_4096 (2<<7) | 69 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_8192 (3 << 7) |
70 | #define PM3ByApertureMode_EFFECTIVE_STRIDE_8192 (3<<7) | 70 | #define PM3ByApertureMode_PATCH_OFFSET_X(off) (((off) & 0x7f) << 9) |
71 | #define PM3ByApertureMode_PATCH_OFFSET_X(off) (((off)&7f)<<9) | 71 | #define PM3ByApertureMode_PATCH_OFFSET_Y(off) (((off) & 0x7f) << 16) |
72 | #define PM3ByApertureMode_PATCH_OFFSET_Y(off) (((off)&7f)<<16) | 72 | #define PM3ByApertureMode_FRAMEBUFFER (0 << 21) |
73 | #define PM3ByApertureMode_FRAMEBUFFER (0<<21) | 73 | #define PM3ByApertureMode_LOCALBUFFER (1 << 21) |
74 | #define PM3ByApertureMode_LOCALBUFFER (1<<21) | 74 | #define PM3ByApertureMode_DOUBLE_WRITE_OFF (0 << 22) |
75 | #define PM3ByApertureMode_DOUBLE_WRITE_OFF (0<<22) | 75 | #define PM3ByApertureMode_DOUBLE_WRITE_1MB (1 << 22) |
76 | #define PM3ByApertureMode_DOUBLE_WRITE_1MB (1<<22) | 76 | #define PM3ByApertureMode_DOUBLE_WRITE_2MB (2 << 22) |
77 | #define PM3ByApertureMode_DOUBLE_WRITE_2MB (2<<22) | 77 | #define PM3ByApertureMode_DOUBLE_WRITE_4MB (3 << 22) |
78 | #define PM3ByApertureMode_DOUBLE_WRITE_4MB (3<<22) | 78 | #define PM3ByApertureMode_DOUBLE_WRITE_8MB (4 << 22) |
79 | #define PM3ByApertureMode_DOUBLE_WRITE_8MB (4<<22) | 79 | #define PM3ByApertureMode_DOUBLE_WRITE_16MB (5 << 22) |
80 | #define PM3ByApertureMode_DOUBLE_WRITE_16MB (5<<22) | 80 | #define PM3ByApertureMode_DOUBLE_WRITE_32MB (6 << 22) |
81 | #define PM3ByApertureMode_DOUBLE_WRITE_32MB (6<<22) | ||
82 | 81 | ||
83 | #define PM3ByAperture2Mode 0x0328 | 82 | #define PM3ByAperture2Mode 0x0328 |
84 | 83 | ||
85 | /********************************************** | 84 | /********************************************** |
86 | * GLINT Permedia3 Memory Control (0x1000) * | 85 | * GLINT Permedia3 Memory Control (0x1000) * |
87 | ***********************************************/ | 86 | ***********************************************/ |
@@ -89,7 +88,7 @@ | |||
89 | #define PM3MemBypassWriteMask 0x1008 | 88 | #define PM3MemBypassWriteMask 0x1008 |
90 | #define PM3MemScratch 0x1010 | 89 | #define PM3MemScratch 0x1010 |
91 | #define PM3LocalMemCaps 0x1018 | 90 | #define PM3LocalMemCaps 0x1018 |
92 | #define PM3LocalMemCaps_NoWriteMask (1 << 28) | 91 | #define PM3LocalMemCaps_NoWriteMask (1 << 28) |
93 | #define PM3LocalMemTimings 0x1020 | 92 | #define PM3LocalMemTimings 0x1020 |
94 | #define PM3LocalMemControl 0x1028 | 93 | #define PM3LocalMemControl 0x1028 |
95 | #define PM3LocalMemRefresh 0x1030 | 94 | #define PM3LocalMemRefresh 0x1030 |
@@ -112,45 +111,41 @@ | |||
112 | #define PM3VsStart 0x3048 | 111 | #define PM3VsStart 0x3048 |
113 | #define PM3VsEnd 0x3050 | 112 | #define PM3VsEnd 0x3050 |
114 | #define PM3VideoControl 0x3058 | 113 | #define PM3VideoControl 0x3058 |
115 | #define PM3VideoControl_DISABLE (0<<0) | 114 | #define PM3VideoControl_ENABLE (1 << 0) |
116 | #define PM3VideoControl_ENABLE (1<<0) | 115 | #define PM3VideoControl_BLANK_ACTIVE_HIGH (0 << 1) |
117 | #define PM3VideoControl_BLANK_ACTIVE_HIGH (0<<1) | 116 | #define PM3VideoControl_BLANK_ACTIVE_LOW (1 << 1) |
118 | #define PM3VideoControl_BLANK_ACTIVE_LOW (1<<1) | 117 | #define PM3VideoControl_LINE_DOUBLE_OFF (0 << 2) |
119 | #define PM3VideoControl_LINE_DOUBLE_OFF (0<<2) | 118 | #define PM3VideoControl_LINE_DOUBLE_ON (1 << 2) |
120 | #define PM3VideoControl_LINE_DOUBLE_ON (1<<2) | 119 | #define PM3VideoControl_HSYNC_FORCE_HIGH (0 << 3) |
121 | #define PM3VideoControl_HSYNC_FORCE_HIGH (0<<3) | 120 | #define PM3VideoControl_HSYNC_ACTIVE_HIGH (1 << 3) |
122 | #define PM3VideoControl_HSYNC_ACTIVE_HIGH (1<<3) | 121 | #define PM3VideoControl_HSYNC_FORCE_LOW (2 << 3) |
123 | #define PM3VideoControl_HSYNC_FORCE_LOW (2<<3) | 122 | #define PM3VideoControl_HSYNC_ACTIVE_LOW (3 << 3) |
124 | #define PM3VideoControl_HSYNC_ACTIVE_LOW (3<<3) | 123 | #define PM3VideoControl_HSYNC_MASK (3 << 3) |
125 | #define PM3VideoControl_HSYNC_MASK (3<<3) | 124 | #define PM3VideoControl_VSYNC_FORCE_HIGH (0 << 5) |
126 | #define PM3VideoControl_VSYNC_FORCE_HIGH (0<<5) | 125 | #define PM3VideoControl_VSYNC_ACTIVE_HIGH (1 << 5) |
127 | #define PM3VideoControl_VSYNC_ACTIVE_HIGH (1<<5) | 126 | #define PM3VideoControl_VSYNC_FORCE_LOW (2 << 5) |
128 | #define PM3VideoControl_VSYNC_FORCE_LOW (2<<5) | 127 | #define PM3VideoControl_VSYNC_ACTIVE_LOW (3 << 5) |
129 | #define PM3VideoControl_VSYNC_ACTIVE_LOW (3<<5) | 128 | #define PM3VideoControl_VSYNC_MASK (3 << 5) |
130 | #define PM3VideoControl_VSYNC_MASK (3<<5) | 129 | #define PM3VideoControl_BYTE_DOUBLE_OFF (0 << 7) |
131 | #define PM3VideoControl_BYTE_DOUBLE_OFF (0<<7) | 130 | #define PM3VideoControl_BYTE_DOUBLE_ON (1 << 7) |
132 | #define PM3VideoControl_BYTE_DOUBLE_ON (1<<7) | 131 | #define PM3VideoControl_BUFFER_SWAP_SYNCON_FRAMEBLANK (0 << 9) |
133 | #define PM3VideoControl_BUFFER_SWAP_SYNCON_FRAMEBLANK (0<<9) | 132 | #define PM3VideoControl_BUFFER_SWAP_FREE_RUNNING (1 << 9) |
134 | #define PM3VideoControl_BUFFER_SWAP_FREE_RUNNING (1<<9) | 133 | #define PM3VideoControl_BUFFER_SWAP_LIMITETO_FRAMERATE (2 << 9) |
135 | #define PM3VideoControl_BUFFER_SWAP_LIMITETO_FRAMERATE (2<<9) | 134 | #define PM3VideoControl_STEREO_ENABLE (1 << 11) |
136 | #define PM3VideoControl_STEREO_DISABLE (0<<11) | 135 | #define PM3VideoControl_RIGHT_EYE_ACTIVE_HIGH (0 << 12) |
137 | #define PM3VideoControl_STEREO_ENABLE (1<<11) | 136 | #define PM3VideoControl_RIGHT_EYE_ACTIVE_LOW (1 << 12) |
138 | #define PM3VideoControl_RIGHT_EYE_ACTIVE_HIGH (0<<12) | 137 | #define PM3VideoControl_VIDEO_EXT_LOW (0 << 14) |
139 | #define PM3VideoControl_RIGHT_EYE_ACTIVE_LOW (1<<12) | 138 | #define PM3VideoControl_VIDEO_EXT_HIGH (1 << 14) |
140 | #define PM3VideoControl_VIDEO_EXT_LOW (0<<14) | 139 | #define PM3VideoControl_SYNC_MODE_INDEPENDENT (0 << 16) |
141 | #define PM3VideoControl_VIDEO_EXT_HIGH (1<<14) | 140 | #define PM3VideoControl_SYNC_MODE_SYNCTO_VSA (1 << 16) |
142 | #define PM3VideoControl_SYNC_MODE_INDEPENDENT (0<<16) | 141 | #define PM3VideoControl_SYNC_MODE_SYNCTO_VSB (2 << 16) |
143 | #define PM3VideoControl_SYNC_MODE_SYNCTO_VSA (1<<16) | 142 | #define PM3VideoControl_PATCH_ENABLE (1 << 18) |
144 | #define PM3VideoControl_SYNC_MODE_SYNCTO_VSB (2<<16) | 143 | #define PM3VideoControl_PIXELSIZE_8BIT (0 << 19) |
145 | #define PM3VideoControl_PATCH_DISABLE (0<<18) | 144 | #define PM3VideoControl_PIXELSIZE_16BIT (1 << 19) |
146 | #define PM3VideoControl_PATCH_ENABLE (1<<18) | 145 | #define PM3VideoControl_PIXELSIZE_32BIT (2 << 19) |
147 | #define PM3VideoControl_PIXELSIZE_8BIT (0<<19) | 146 | #define PM3VideoControl_DISPLAY_ENABLE (1 << 21) |
148 | #define PM3VideoControl_PIXELSIZE_16BIT (1<<19) | 147 | #define PM3VideoControl_PATCH_OFFSET_X(off) (((off) & 0x3f) << 22) |
149 | #define PM3VideoControl_PIXELSIZE_32BIT (2<<19) | 148 | #define PM3VideoControl_PATCH_OFFSET_Y(off) (((off) & 0x3f) << 28) |
150 | #define PM3VideoControl_DISPLAY_DISABLE (0<<21) | ||
151 | #define PM3VideoControl_DISPLAY_ENABLE (1<<21) | ||
152 | #define PM3VideoControl_PATCH_OFFSET_X(off) (((off)&0x3f)<<22) | ||
153 | #define PM3VideoControl_PATCH_OFFSET_Y(off) (((off)&0x3f)<<28) | ||
154 | #define PM3InterruptLine 0x3060 | 149 | #define PM3InterruptLine 0x3060 |
155 | #define PM3DisplayData 0x3068 | 150 | #define PM3DisplayData 0x3068 |
156 | #define PM3VerticalLineCount 0x3070 | 151 | #define PM3VerticalLineCount 0x3070 |
@@ -159,80 +154,93 @@ | |||
159 | #define PM3MiscControl 0x3088 | 154 | #define PM3MiscControl 0x3088 |
160 | 155 | ||
161 | #define PM3VideoOverlayUpdate 0x3100 | 156 | #define PM3VideoOverlayUpdate 0x3100 |
162 | #define PM3VideoOverlayUpdate_DISABLE (0<<0) | 157 | #define PM3VideoOverlayUpdate_ENABLE (1 << 0) |
163 | #define PM3VideoOverlayUpdate_ENABLE (1<<0) | ||
164 | #define PM3VideoOverlayMode 0x3108 | 158 | #define PM3VideoOverlayMode 0x3108 |
165 | #define PM3VideoOverlayMode_DISABLE (0<<0) | 159 | #define PM3VideoOverlayMode_ENABLE (1 << 0) |
166 | #define PM3VideoOverlayMode_ENABLE (1<<0) | 160 | #define PM3VideoOverlayMode_BUFFERSYNC_MANUAL (0 << 1) |
167 | #define PM3VideoOverlayMode_BUFFERSYNC_MANUAL (0<<1) | 161 | #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMA (1 << 1) |
168 | #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMA (1<<1) | 162 | #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMB (2 << 1) |
169 | #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMB (2<<1) | 163 | #define PM3VideoOverlayMode_FIELDPOLARITY_NORMAL (0 << 4) |
170 | #define PM3VideoOverlayMode_FIELDPOLARITY_NORMAL (0<<4) | 164 | #define PM3VideoOverlayMode_FIELDPOLARITY_INVERT (1 << 4) |
171 | #define PM3VideoOverlayMode_FIELDPOLARITY_INVERT (1<<4) | 165 | #define PM3VideoOverlayMode_PIXELSIZE_8BIT (0 << 5) |
172 | #define PM3VideoOverlayMode_PIXELSIZE_8BIT (0<<5) | 166 | #define PM3VideoOverlayMode_PIXELSIZE_16BIT (1 << 5) |
173 | #define PM3VideoOverlayMode_PIXELSIZE_16BIT (1<<5) | 167 | #define PM3VideoOverlayMode_PIXELSIZE_32BIT (2 << 5) |
174 | #define PM3VideoOverlayMode_PIXELSIZE_32BIT (2<<5) | 168 | #define PM3VideoOverlayMode_COLORFORMAT_RGB8888 \ |
175 | #define PM3VideoOverlayMode_COLORFORMAT_RGB8888 ((0<<7)|(1<<12)|(2<<5)) | 169 | ((0 << 7)|(1 << 12)|(2 << 5)) |
176 | #define PM3VideoOverlayMode_COLORFORMAT_RGB4444 ((1<<7)|(1<<12)|(1<<5)) | 170 | #define PM3VideoOverlayMode_COLORFORMAT_RGB4444 \ |
177 | #define PM3VideoOverlayMode_COLORFORMAT_RGB5551 ((2<<7)|(1<<12)|(1<<5)) | 171 | ((1 << 7)|(1 << 12)|(1 << 5)) |
178 | #define PM3VideoOverlayMode_COLORFORMAT_RGB565 ((3<<7)|(1<<12)|(1<<5)) | 172 | #define PM3VideoOverlayMode_COLORFORMAT_RGB5551 \ |
179 | #define PM3VideoOverlayMode_COLORFORMAT_RGB332 ((4<<7)|(1<<12)|(0<<5)) | 173 | ((2 << 7)|(1 << 12)|(1 << 5)) |
180 | #define PM3VideoOverlayMode_COLORFORMAT_BGR8888 ((0<<7)|(2<<5)) | 174 | #define PM3VideoOverlayMode_COLORFORMAT_RGB565 \ |
181 | #define PM3VideoOverlayMode_COLORFORMAT_BGR4444 ((1<<7)|(1<<5)) | 175 | ((3 << 7)|(1 << 12)|(1 << 5)) |
182 | #define PM3VideoOverlayMode_COLORFORMAT_BGR5551 ((2<<7)|(1<<5)) | 176 | #define PM3VideoOverlayMode_COLORFORMAT_RGB332 \ |
183 | #define PM3VideoOverlayMode_COLORFORMAT_BGR565 ((3<<7)|(1<<5)) | 177 | ((4 << 7)|(1 << 12)|(0 << 5)) |
184 | #define PM3VideoOverlayMode_COLORFORMAT_BGR332 ((4<<7)|(0<<5)) | 178 | #define PM3VideoOverlayMode_COLORFORMAT_BGR8888 \ |
185 | #define PM3VideoOverlayMode_COLORFORMAT_CI8 ((5<<7)|(1<<12)|(0<<5)) | 179 | ((0 << 7)|(2 << 5)) |
186 | #define PM3VideoOverlayMode_COLORFORMAT_VUY444 ((2<<10)|(1<<12)|(2<<5)) | 180 | #define PM3VideoOverlayMode_COLORFORMAT_BGR4444 \ |
187 | #define PM3VideoOverlayMode_COLORFORMAT_YUV444 ((2<<10)|(2<<5)) | 181 | ((1 << 7)|(1 << 5)) |
188 | #define PM3VideoOverlayMode_COLORFORMAT_VUY422 ((1<<10)|(1<<12)|(1<<5)) | 182 | #define PM3VideoOverlayMode_COLORFORMAT_BGR5551 \ |
189 | #define PM3VideoOverlayMode_COLORFORMAT_YUV422 ((1<<10)|(1<<5)) | 183 | ((2 << 7)|(1 << 5)) |
190 | #define PM3VideoOverlayMode_COLORORDER_BGR (0<<12) | 184 | #define PM3VideoOverlayMode_COLORFORMAT_BGR565 \ |
191 | #define PM3VideoOverlayMode_COLORORDER_RGB (1<<12) | 185 | ((3 << 7)|(1 << 5)) |
192 | #define PM3VideoOverlayMode_LINEARCOLOREXT_OFF (0<<13) | 186 | #define PM3VideoOverlayMode_COLORFORMAT_BGR332 \ |
193 | #define PM3VideoOverlayMode_LINEARCOLOREXT_ON (1<<13) | 187 | ((4 << 7)|(0 << 5)) |
194 | #define PM3VideoOverlayMode_FILTER_MASK (3<<14) | 188 | #define PM3VideoOverlayMode_COLORFORMAT_CI8 \ |
195 | #define PM3VideoOverlayMode_FILTER_OFF (0<<14) | 189 | ((5 << 7)|(1 << 12)|(0 << 5)) |
196 | #define PM3VideoOverlayMode_FILTER_FULL (1<<14) | 190 | #define PM3VideoOverlayMode_COLORFORMAT_VUY444 \ |
197 | #define PM3VideoOverlayMode_FILTER_PARTIAL (2<<14) | 191 | ((2 << 10)|(1 << 12)|(2 << 5)) |
198 | #define PM3VideoOverlayMode_DEINTERLACE_OFF (0<<16) | 192 | #define PM3VideoOverlayMode_COLORFORMAT_YUV444 \ |
199 | #define PM3VideoOverlayMode_DEINTERLACE_BOB (1<<16) | 193 | ((2 << 10)|(2 << 5)) |
200 | #define PM3VideoOverlayMode_PATCHMODE_OFF (0<<18) | 194 | #define PM3VideoOverlayMode_COLORFORMAT_VUY422 \ |
201 | #define PM3VideoOverlayMode_PATCHMODE_ON (1<<18) | 195 | ((1 << 10)|(1 << 12)|(1 << 5)) |
202 | #define PM3VideoOverlayMode_FLIP_VIDEO (0<<20) | 196 | #define PM3VideoOverlayMode_COLORFORMAT_YUV422 \ |
203 | #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMA (1<<20) | 197 | ((1 << 10)|(1 << 5)) |
204 | #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMB (2<<20) | 198 | #define PM3VideoOverlayMode_COLORORDER_BGR (0 << 12) |
205 | #define PM3VideoOverlayMode_MIRROR_MASK (3<<23) | 199 | #define PM3VideoOverlayMode_COLORORDER_RGB (1 << 12) |
206 | #define PM3VideoOverlayMode_MIRRORX_OFF (0<<23) | 200 | #define PM3VideoOverlayMode_LINEARCOLOREXT_OFF (0 << 13) |
207 | #define PM3VideoOverlayMode_MIRRORX_ON (1<<23) | 201 | #define PM3VideoOverlayMode_LINEARCOLOREXT_ON (1 << 13) |
208 | #define PM3VideoOverlayMode_MIRRORY_OFF (0<<24) | 202 | #define PM3VideoOverlayMode_FILTER_MASK (3 << 14) |
209 | #define PM3VideoOverlayMode_MIRRORY_ON (1<<24) | 203 | #define PM3VideoOverlayMode_FILTER_OFF (0 << 14) |
204 | #define PM3VideoOverlayMode_FILTER_FULL (1 << 14) | ||
205 | #define PM3VideoOverlayMode_FILTER_PARTIAL (2 << 14) | ||
206 | #define PM3VideoOverlayMode_DEINTERLACE_OFF (0 << 16) | ||
207 | #define PM3VideoOverlayMode_DEINTERLACE_BOB (1 << 16) | ||
208 | #define PM3VideoOverlayMode_PATCHMODE_OFF (0 << 18) | ||
209 | #define PM3VideoOverlayMode_PATCHMODE_ON (1 << 18) | ||
210 | #define PM3VideoOverlayMode_FLIP_VIDEO (0 << 20) | ||
211 | #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMA (1 << 20) | ||
212 | #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMB (2 << 20) | ||
213 | #define PM3VideoOverlayMode_MIRROR_MASK (3 << 23) | ||
214 | #define PM3VideoOverlayMode_MIRRORX_OFF (0 << 23) | ||
215 | #define PM3VideoOverlayMode_MIRRORX_ON (1 << 23) | ||
216 | #define PM3VideoOverlayMode_MIRRORY_OFF (0 << 24) | ||
217 | #define PM3VideoOverlayMode_MIRRORY_ON (1 << 24) | ||
210 | #define PM3VideoOverlayFifoControl 0x3110 | 218 | #define PM3VideoOverlayFifoControl 0x3110 |
211 | #define PM3VideoOverlayIndex 0x3118 | 219 | #define PM3VideoOverlayIndex 0x3118 |
212 | #define PM3VideoOverlayBase0 0x3120 | 220 | #define PM3VideoOverlayBase0 0x3120 |
213 | #define PM3VideoOverlayBase1 0x3128 | 221 | #define PM3VideoOverlayBase1 0x3128 |
214 | #define PM3VideoOverlayBase2 0x3130 | 222 | #define PM3VideoOverlayBase2 0x3130 |
215 | #define PM3VideoOverlayStride 0x3138 | 223 | #define PM3VideoOverlayStride 0x3138 |
216 | #define PM3VideoOverlayStride_STRIDE(s) (((s)&0xfff)<<0) | 224 | #define PM3VideoOverlayStride_STRIDE(s) (((s) & 0xfff) << 0) |
217 | #define PM3VideoOverlayWidth 0x3140 | 225 | #define PM3VideoOverlayWidth 0x3140 |
218 | #define PM3VideoOverlayWidth_WIDTH(w) (((w)&0xfff)<<0) | 226 | #define PM3VideoOverlayWidth_WIDTH(w) (((w) & 0xfff) << 0) |
219 | #define PM3VideoOverlayHeight 0x3148 | 227 | #define PM3VideoOverlayHeight 0x3148 |
220 | #define PM3VideoOverlayHeight_HEIGHT(h) (((h)&0xfff)<<0) | 228 | #define PM3VideoOverlayHeight_HEIGHT(h) (((h) & 0xfff) << 0) |
221 | #define PM3VideoOverlayOrigin 0x3150 | 229 | #define PM3VideoOverlayOrigin 0x3150 |
222 | #define PM3VideoOverlayOrigin_XORIGIN(x) (((x)&0xfff)<<0) | 230 | #define PM3VideoOverlayOrigin_XORIGIN(x) (((x) & 0xfff) << 0) |
223 | #define PM3VideoOverlayOrigin_YORIGIN(y) (((y)&0xfff)<<16) | 231 | #define PM3VideoOverlayOrigin_YORIGIN(y) (((y) & 0xfff) << 16) |
224 | #define PM3VideoOverlayShrinkXDelta 0x3158 | 232 | #define PM3VideoOverlayShrinkXDelta 0x3158 |
225 | #define PM3VideoOverlayShrinkXDelta_NONE (1<<16) | 233 | #define PM3VideoOverlayShrinkXDelta_NONE (1 << 16) |
226 | #define PM3VideoOverlayShrinkXDelta_DELTA(s,d) \ | 234 | #define PM3VideoOverlayShrinkXDelta_DELTA(s,d) \ |
227 | ((((s)<<16)/(d))&0x0ffffff0) | 235 | ((((s) << 16)/(d)) & 0x0ffffff0) |
228 | #define PM3VideoOverlayZoomXDelta 0x3160 | 236 | #define PM3VideoOverlayZoomXDelta 0x3160 |
229 | #define PM3VideoOverlayZoomXDelta_NONE (1<<16) | 237 | #define PM3VideoOverlayZoomXDelta_NONE (1 << 16) |
230 | #define PM3VideoOverlayZoomXDelta_DELTA(s,d) \ | 238 | #define PM3VideoOverlayZoomXDelta_DELTA(s,d) \ |
231 | ((((s)<<16)/(d))&0x0001fff0) | 239 | ((((s) << 16)/(d)) & 0x0001fff0) |
232 | #define PM3VideoOverlayYDelta 0x3168 | 240 | #define PM3VideoOverlayYDelta 0x3168 |
233 | #define PM3VideoOverlayYDelta_NONE (1<<16) | 241 | #define PM3VideoOverlayYDelta_NONE (1 << 16) |
234 | #define PM3VideoOverlayYDelta_DELTA(s,d) \ | 242 | #define PM3VideoOverlayYDelta_DELTA(s,d) \ |
235 | ((((s)<<16)/(d))&0x0ffffff0) | 243 | ((((s) << 16)/(d)) & 0x0ffffff0) |
236 | #define PM3VideoOverlayFieldOffset 0x3170 | 244 | #define PM3VideoOverlayFieldOffset 0x3170 |
237 | #define PM3VideoOverlayStatus 0x3178 | 245 | #define PM3VideoOverlayStatus 0x3178 |
238 | 246 | ||
@@ -249,102 +257,82 @@ | |||
249 | #define PM3RD_IndexHigh 0x4028 | 257 | #define PM3RD_IndexHigh 0x4028 |
250 | #define PM3RD_IndexedData 0x4030 | 258 | #define PM3RD_IndexedData 0x4030 |
251 | #define PM3RD_IndexControl 0x4038 | 259 | #define PM3RD_IndexControl 0x4038 |
252 | #define PM3RD_IndexControl_AUTOINCREMENT_ENABLE (1<<0) | 260 | #define PM3RD_IndexControl_AUTOINCREMENT_ENABLE (1 << 0) |
253 | #define PM3RD_IndexControl_AUTOINCREMENT_DISABLE (0<<0) | ||
254 | 261 | ||
255 | /* Indirect Registers */ | 262 | /* Indirect Registers */ |
256 | #define PM3RD_MiscControl 0x000 | 263 | #define PM3RD_MiscControl 0x000 |
257 | #define PM3RD_MiscControl_HIGHCOLOR_RES_DISABLE (0<<0) | 264 | #define PM3RD_MiscControl_HIGHCOLOR_RES_ENABLE (1 << 0) |
258 | #define PM3RD_MiscControl_HIGHCOLOR_RES_ENABLE (1<<0) | 265 | #define PM3RD_MiscControl_PIXELDOUBLE_ENABLE (1 << 1) |
259 | #define PM3RD_MiscControl_PIXELDOUBLE_DISABLE (0<<1) | 266 | #define PM3RD_MiscControl_LASTREAD_ADDR_ENABLE (1 << 2) |
260 | #define PM3RD_MiscControl_PIXELDOUBLE_ENABLE (1<<1) | 267 | #define PM3RD_MiscControl_DIRECTCOLOR_ENABLE (1 << 3) |
261 | #define PM3RD_MiscControl_LASTREAD_ADDR_DISABLE (0<<2) | 268 | #define PM3RD_MiscControl_OVERLAY_ENABLE (1 << 4) |
262 | #define PM3RD_MiscControl_LASTREAD_ADDR_ENABLE (1<<2) | 269 | #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_ENABLE (1 << 5) |
263 | #define PM3RD_MiscControl_DIRECTCOLOR_DISABLE (0<<3) | 270 | #define PM3RD_MiscControl_VSB_OUTPUT_ENABLE (1 << 6) |
264 | #define PM3RD_MiscControl_DIRECTCOLOR_ENABLE (1<<3) | 271 | #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_ENABLE (1 << 7) |
265 | #define PM3RD_MiscControl_OVERLAY_DISABLE (0<<4) | ||
266 | #define PM3RD_MiscControl_OVERLAY_ENABLE (1<<4) | ||
267 | #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_DISABLE (0<<5) | ||
268 | #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_ENABLE (1<<5) | ||
269 | #define PM3RD_MiscControl_VSB_OUTPUT_DISABLE (0<<6) | ||
270 | #define PM3RD_MiscControl_VSB_OUTPUT_ENABLE (1<<6) | ||
271 | #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_DISABLE (0<<7) | ||
272 | #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_ENABLE (1<<7) | ||
273 | #define PM3RD_SyncControl 0x001 | 272 | #define PM3RD_SyncControl 0x001 |
274 | #define PM3RD_SyncControl_HSYNC_ACTIVE_LOW (0<<0) | 273 | #define PM3RD_SyncControl_HSYNC_ACTIVE_LOW (0 << 0) |
275 | #define PM3RD_SyncControl_HSYNC_ACTIVE_HIGH (1<<0) | 274 | #define PM3RD_SyncControl_HSYNC_ACTIVE_HIGH (1 << 0) |
276 | #define PM3RD_SyncControl_HSYNC_FORCE_ACTIVE (3<<0) | 275 | #define PM3RD_SyncControl_HSYNC_FORCE_ACTIVE (3 << 0) |
277 | #define PM3RD_SyncControl_HSYNC_FORCE_INACTIVE (4<<0) | 276 | #define PM3RD_SyncControl_HSYNC_FORCE_INACTIVE (4 << 0) |
278 | #define PM3RD_SyncControl_HSYNC_TRI_STATE (2<<0) | 277 | #define PM3RD_SyncControl_HSYNC_TRI_STATE (2 << 0) |
279 | #define PM3RD_SyncControl_VSYNC_ACTIVE_LOW (0<<3) | 278 | #define PM3RD_SyncControl_VSYNC_ACTIVE_LOW (0 << 3) |
280 | #define PM3RD_SyncControl_VSYNC_ACTIVE_HIGH (1<<3) | 279 | #define PM3RD_SyncControl_VSYNC_ACTIVE_HIGH (1 << 3) |
281 | #define PM3RD_SyncControl_VSYNC_TRI_STATE (2<<3) | 280 | #define PM3RD_SyncControl_VSYNC_TRI_STATE (2 << 3) |
282 | #define PM3RD_SyncControl_VSYNC_FORCE_ACTIVE (3<<3) | 281 | #define PM3RD_SyncControl_VSYNC_FORCE_ACTIVE (3 << 3) |
283 | #define PM3RD_SyncControl_VSYNC_FORCE_INACTIVE (4<<3) | 282 | #define PM3RD_SyncControl_VSYNC_FORCE_INACTIVE (4 << 3) |
284 | #define PM3RD_SyncControl_HSYNC_OVERRIDE_SETBY_HSYNC (0<<6) | 283 | #define PM3RD_SyncControl_HSYNC_OVERRIDE_SETBY_HSYNC (0 << 6) |
285 | #define PM3RD_SyncControl_HSYNC_OVERRIDE_FORCE_HIGH (1<<6) | 284 | #define PM3RD_SyncControl_HSYNC_OVERRIDE_FORCE_HIGH (1 << 6) |
286 | #define PM3RD_SyncControl_VSYNC_OVERRIDE_SETBY_VSYNC (0<<7) | 285 | #define PM3RD_SyncControl_VSYNC_OVERRIDE_SETBY_VSYNC (0 << 7) |
287 | #define PM3RD_SyncControl_VSYNC_OVERRIDE_FORCE_HIGH (1<<7) | 286 | #define PM3RD_SyncControl_VSYNC_OVERRIDE_FORCE_HIGH (1 << 7) |
288 | #define PM3RD_DACControl 0x002 | 287 | #define PM3RD_DACControl 0x002 |
289 | #define PM3RD_DACControl_DAC_POWER_ON (0<<0) | 288 | #define PM3RD_DACControl_DAC_POWER_ON (0 << 0) |
290 | #define PM3RD_DACControl_DAC_POWER_OFF (1<<0) | 289 | #define PM3RD_DACControl_DAC_POWER_OFF (1 << 0) |
291 | #define PM3RD_DACControl_SYNC_ON_GREEN_DISABLE (0<<3) | 290 | #define PM3RD_DACControl_SYNC_ON_GREEN_ENABLE (1 << 3) |
292 | #define PM3RD_DACControl_SYNC_ON_GREEN_ENABLE (1<<3) | 291 | #define PM3RD_DACControl_BLANK_RED_DAC_ENABLE (1 << 4) |
293 | #define PM3RD_DACControl_BLANK_RED_DAC_DISABLE (0<<4) | 292 | #define PM3RD_DACControl_BLANK_GREEN_DAC_ENABLE (1 << 5) |
294 | #define PM3RD_DACControl_BLANK_RED_DAC_ENABLE (1<<4) | 293 | #define PM3RD_DACControl_BLANK_BLUE_DAC_ENABLE (1 << 6) |
295 | #define PM3RD_DACControl_BLANK_GREEN_DAC_DISABLE (0<<5) | 294 | #define PM3RD_DACControl_BLANK_PEDESTAL_ENABLE (1 << 7) |
296 | #define PM3RD_DACControl_BLANK_GREEN_DAC_ENABLE (1<<5) | ||
297 | #define PM3RD_DACControl_BLANK_BLUE_DAC_DISABLE (0<<6) | ||
298 | #define PM3RD_DACControl_BLANK_BLUE_DAC_ENABLE (1<<6) | ||
299 | #define PM3RD_DACControl_BLANK_PEDESTAL_DISABLE (0<<7) | ||
300 | #define PM3RD_DACControl_BLANK_PEDESTAL_ENABLE (1<<7) | ||
301 | #define PM3RD_PixelSize 0x003 | 295 | #define PM3RD_PixelSize 0x003 |
302 | #define PM3RD_PixelSize_24_BIT_PIXELS (4<<0) | 296 | #define PM3RD_PixelSize_24_BIT_PIXELS (4 << 0) |
303 | #define PM3RD_PixelSize_32_BIT_PIXELS (2<<0) | 297 | #define PM3RD_PixelSize_32_BIT_PIXELS (2 << 0) |
304 | #define PM3RD_PixelSize_16_BIT_PIXELS (1<<0) | 298 | #define PM3RD_PixelSize_16_BIT_PIXELS (1 << 0) |
305 | #define PM3RD_PixelSize_8_BIT_PIXELS (0<<0) | 299 | #define PM3RD_PixelSize_8_BIT_PIXELS (0 << 0) |
306 | #define PM3RD_ColorFormat 0x004 | 300 | #define PM3RD_ColorFormat 0x004 |
307 | #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_ENABLE (1<<6) | 301 | #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_ENABLE (1 << 6) |
308 | #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_DISABLE (0<<6) | 302 | #define PM3RD_ColorFormat_COLOR_ORDER_BLUE_LOW (1 << 5) |
309 | #define PM3RD_ColorFormat_COLOR_ORDER_BLUE_LOW (1<<5) | 303 | #define PM3RD_ColorFormat_COLOR_ORDER_RED_LOW (0 << 5) |
310 | #define PM3RD_ColorFormat_COLOR_ORDER_RED_LOW (0<<5) | 304 | #define PM3RD_ColorFormat_COLOR_FORMAT_MASK (0x1f << 0) |
311 | #define PM3RD_ColorFormat_COLOR_FORMAT_MASK (0x1f<<0) | 305 | #define PM3RD_ColorFormat_8888_COLOR (0 << 0) |
312 | #define PM3RD_ColorFormat_8888_COLOR (0<<0) | 306 | #define PM3RD_ColorFormat_5551_FRONT_COLOR (1 << 0) |
313 | #define PM3RD_ColorFormat_5551_FRONT_COLOR (1<<0) | 307 | #define PM3RD_ColorFormat_4444_COLOR (2 << 0) |
314 | #define PM3RD_ColorFormat_4444_COLOR (2<<0) | 308 | #define PM3RD_ColorFormat_332_FRONT_COLOR (5 << 0) |
315 | #define PM3RD_ColorFormat_332_FRONT_COLOR (5<<0) | 309 | #define PM3RD_ColorFormat_332_BACK_COLOR (6 << 0) |
316 | #define PM3RD_ColorFormat_332_BACK_COLOR (6<<0) | 310 | #define PM3RD_ColorFormat_2321_FRONT_COLOR (9 << 0) |
317 | #define PM3RD_ColorFormat_2321_FRONT_COLOR (9<<0) | 311 | #define PM3RD_ColorFormat_2321_BACK_COLOR (10 << 0) |
318 | #define PM3RD_ColorFormat_2321_BACK_COLOR (10<<0) | 312 | #define PM3RD_ColorFormat_232_FRONTOFF_COLOR (11 << 0) |
319 | #define PM3RD_ColorFormat_232_FRONTOFF_COLOR (11<<0) | 313 | #define PM3RD_ColorFormat_232_BACKOFF_COLOR (12 << 0) |
320 | #define PM3RD_ColorFormat_232_BACKOFF_COLOR (12<<0) | 314 | #define PM3RD_ColorFormat_5551_BACK_COLOR (13 << 0) |
321 | #define PM3RD_ColorFormat_5551_BACK_COLOR (13<<0) | 315 | #define PM3RD_ColorFormat_CI8_COLOR (14 << 0) |
322 | #define PM3RD_ColorFormat_CI8_COLOR (14<<0) | 316 | #define PM3RD_ColorFormat_565_FRONT_COLOR (16 << 0) |
323 | #define PM3RD_ColorFormat_565_FRONT_COLOR (16<<0) | 317 | #define PM3RD_ColorFormat_565_BACK_COLOR (17 << 0) |
324 | #define PM3RD_ColorFormat_565_BACK_COLOR (17<<0) | ||
325 | #define PM3RD_CursorMode 0x005 | 318 | #define PM3RD_CursorMode 0x005 |
326 | #define PM3RD_CursorMode_CURSOR_DISABLE (0<<0) | 319 | #define PM3RD_CursorMode_CURSOR_ENABLE (1 << 0) |
327 | #define PM3RD_CursorMode_CURSOR_ENABLE (1<<0) | 320 | #define PM3RD_CursorMode_FORMAT_64x64_2BPE_P0123 (0 << 2) |
328 | #define PM3RD_CursorMode_FORMAT_64x64_2BPE_P0123 (0<<2) | 321 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P0 (1 << 2) |
329 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P0 (1<<2) | 322 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P1 (2 << 2) |
330 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P1 (2<<2) | 323 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P2 (3 << 2) |
331 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P2 (3<<2) | 324 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P3 (4 << 2) |
332 | #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P3 (4<<2) | 325 | #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P01 (5 << 2) |
333 | #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P01 (5<<2) | 326 | #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P23 (6 << 2) |
334 | #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P23 (6<<2) | 327 | #define PM3RD_CursorMode_TYPE_MS (0 << 4) |
335 | #define PM3RD_CursorMode_TYPE_MS (0<<4) | 328 | #define PM3RD_CursorMode_TYPE_X (1 << 4) |
336 | #define PM3RD_CursorMode_TYPE_X (1<<4) | 329 | #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_ENABLE (1 << 6) |
337 | #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_DISABLE (0<<6) | 330 | #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_3_COLOR (2 << 6) |
338 | #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_ENABLE (1<<6) | 331 | #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_15_COLOR (3 << 6) |
339 | #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_3_COLOR (2<<6) | ||
340 | #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_15_COLOR (3<<6) | ||
341 | #define PM3RD_CursorControl 0x006 | 332 | #define PM3RD_CursorControl 0x006 |
342 | #define PM3RD_CursorControl_DOUBLE_X_DISABLED (0<<0) | 333 | #define PM3RD_CursorControl_DOUBLE_X_ENABLED (1 << 0) |
343 | #define PM3RD_CursorControl_DOUBLE_X_ENABLED (1<<0) | 334 | #define PM3RD_CursorControl_DOUBLE_Y_ENABLED (1 << 1) |
344 | #define PM3RD_CursorControl_DOUBLE_Y_DISABLED (0<<1) | 335 | #define PM3RD_CursorControl_READBACK_POS_ENABLED (1 << 2) |
345 | #define PM3RD_CursorControl_DOUBLE_Y_ENABLED (1<<1) | ||
346 | #define PM3RD_CursorControl_READBACK_POS_DISABLED (0<<2) | ||
347 | #define PM3RD_CursorControl_READBACK_POS_ENABLED (1<<2) | ||
348 | 336 | ||
349 | #define PM3RD_CursorXLow 0x007 | 337 | #define PM3RD_CursorXLow 0x007 |
350 | #define PM3RD_CursorXHigh 0x008 | 338 | #define PM3RD_CursorXHigh 0x008 |
@@ -354,17 +342,13 @@ | |||
354 | #define PM3RD_CursorHotSpotY 0x00c | 342 | #define PM3RD_CursorHotSpotY 0x00c |
355 | #define PM3RD_OverlayKey 0x00d | 343 | #define PM3RD_OverlayKey 0x00d |
356 | #define PM3RD_Pan 0x00e | 344 | #define PM3RD_Pan 0x00e |
357 | #define PM3RD_Pan_DISABLE (0<<0) | 345 | #define PM3RD_Pan_ENABLE (1 << 0) |
358 | #define PM3RD_Pan_ENABLE (1<<0) | 346 | #define PM3RD_Pan_GATE_ENABLE (1 << 1) |
359 | #define PM3RD_Pan_GATE_DISABLE (0<<1) | ||
360 | #define PM3RD_Pan_GATE_ENABLE (1<<1) | ||
361 | #define PM3RD_Sense 0x00f | 347 | #define PM3RD_Sense 0x00f |
362 | 348 | ||
363 | #define PM3RD_CheckControl 0x018 | 349 | #define PM3RD_CheckControl 0x018 |
364 | #define PM3RD_CheckControl_PIXEL_DISABLED (0<<0) | 350 | #define PM3RD_CheckControl_PIXEL_ENABLED (1 << 0) |
365 | #define PM3RD_CheckControl_PIXEL_ENABLED (1<<0) | 351 | #define PM3RD_CheckControl_LUT_ENABLED (1 << 1) |
366 | #define PM3RD_CheckControl_LUT_DISABLED (0<<1) | ||
367 | #define PM3RD_CheckControl_LUT_ENABLED (1<<1) | ||
368 | #define PM3RD_CheckPixelRed 0x019 | 352 | #define PM3RD_CheckPixelRed 0x019 |
369 | #define PM3RD_CheckPixelGreen 0x01a | 353 | #define PM3RD_CheckPixelGreen 0x01a |
370 | #define PM3RD_CheckPixelBlue 0x01b | 354 | #define PM3RD_CheckPixelBlue 0x01b |
@@ -374,19 +358,17 @@ | |||
374 | #define PM3RD_Scratch 0x01f | 358 | #define PM3RD_Scratch 0x01f |
375 | 359 | ||
376 | #define PM3RD_VideoOverlayControl 0x020 | 360 | #define PM3RD_VideoOverlayControl 0x020 |
377 | #define PM3RD_VideoOverlayControl_DISABLE (0<<0) | 361 | #define PM3RD_VideoOverlayControl_ENABLE (1 << 0) |
378 | #define PM3RD_VideoOverlayControl_ENABLE (1<<0) | 362 | #define PM3RD_VideoOverlayControl_MODE_MASK (3 << 1) |
379 | #define PM3RD_VideoOverlayControl_MODE_MASK (3<<1) | 363 | #define PM3RD_VideoOverlayControl_MODE_MAINKEY (0 << 1) |
380 | #define PM3RD_VideoOverlayControl_MODE_MAINKEY (0<<1) | 364 | #define PM3RD_VideoOverlayControl_MODE_OVERLAYKEY (1 << 1) |
381 | #define PM3RD_VideoOverlayControl_MODE_OVERLAYKEY (1<<1) | 365 | #define PM3RD_VideoOverlayControl_MODE_ALWAYS (2 << 1) |
382 | #define PM3RD_VideoOverlayControl_MODE_ALWAYS (2<<1) | 366 | #define PM3RD_VideoOverlayControl_MODE_BLEND (3 << 1) |
383 | #define PM3RD_VideoOverlayControl_MODE_BLEND (3<<1) | 367 | #define PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED (1 << 3) |
384 | #define PM3RD_VideoOverlayControl_DIRECTCOLOR_DISABLED (0<<3) | 368 | #define PM3RD_VideoOverlayControl_BLENDSRC_MAIN (0 << 4) |
385 | #define PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED (1<<3) | 369 | #define PM3RD_VideoOverlayControl_BLENDSRC_REGISTER (1 << 4) |
386 | #define PM3RD_VideoOverlayControl_BLENDSRC_MAIN (0<<4) | 370 | #define PM3RD_VideoOverlayControl_KEY_COLOR (0 << 5) |
387 | #define PM3RD_VideoOverlayControl_BLENDSRC_REGISTER (1<<4) | 371 | #define PM3RD_VideoOverlayControl_KEY_ALPHA (1 << 5) |
388 | #define PM3RD_VideoOverlayControl_KEY_COLOR (0<<5) | ||
389 | #define PM3RD_VideoOverlayControl_KEY_ALPHA (1<<5) | ||
390 | #define PM3RD_VideoOverlayXStartLow 0x021 | 372 | #define PM3RD_VideoOverlayXStartLow 0x021 |
391 | #define PM3RD_VideoOverlayXStartHigh 0x022 | 373 | #define PM3RD_VideoOverlayXStartHigh 0x022 |
392 | #define PM3RD_VideoOverlayYStartLow 0x023 | 374 | #define PM3RD_VideoOverlayYStartLow 0x023 |
@@ -399,10 +381,10 @@ | |||
399 | #define PM3RD_VideoOverlayKeyG 0x02a | 381 | #define PM3RD_VideoOverlayKeyG 0x02a |
400 | #define PM3RD_VideoOverlayKeyB 0x02b | 382 | #define PM3RD_VideoOverlayKeyB 0x02b |
401 | #define PM3RD_VideoOverlayBlend 0x02c | 383 | #define PM3RD_VideoOverlayBlend 0x02c |
402 | #define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT (0<<6) | 384 | #define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT (0 << 6) |
403 | #define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT (1<<6) | 385 | #define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT (1 << 6) |
404 | #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (2<<6) | 386 | #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (2 << 6) |
405 | #define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT (3<<6) | 387 | #define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT (3 << 6) |
406 | 388 | ||
407 | #define PM3RD_DClkSetup1 0x1f0 | 389 | #define PM3RD_DClkSetup1 0x1f0 |
408 | #define PM3RD_DClkSetup2 0x1f1 | 390 | #define PM3RD_DClkSetup2 0x1f1 |
@@ -410,21 +392,20 @@ | |||
410 | #define PM3RD_KClkSetup2 0x1f3 | 392 | #define PM3RD_KClkSetup2 0x1f3 |
411 | 393 | ||
412 | #define PM3RD_DClkControl 0x200 | 394 | #define PM3RD_DClkControl 0x200 |
413 | #define PM3RD_DClkControl_SOURCE_PLL (0<<4) | 395 | #define PM3RD_DClkControl_SOURCE_PLL (0 << 4) |
414 | #define PM3RD_DClkControl_SOURCE_VSA (1<<4) | 396 | #define PM3RD_DClkControl_SOURCE_VSA (1 << 4) |
415 | #define PM3RD_DClkControl_SOURCE_VSB (2<<4) | 397 | #define PM3RD_DClkControl_SOURCE_VSB (2 << 4) |
416 | #define PM3RD_DClkControl_SOURCE_EXT (3<<4) | 398 | #define PM3RD_DClkControl_SOURCE_EXT (3 << 4) |
417 | #define PM3RD_DClkControl_STATE_RUN (2<<2) | 399 | #define PM3RD_DClkControl_STATE_RUN (2 << 2) |
418 | #define PM3RD_DClkControl_STATE_HIGH (1<<2) | 400 | #define PM3RD_DClkControl_STATE_HIGH (1 << 2) |
419 | #define PM3RD_DClkControl_STATE_LOW (0<<2) | 401 | #define PM3RD_DClkControl_STATE_LOW (0 << 2) |
420 | #define PM3RD_DClkControl_LOCKED (1<<1) | 402 | #define PM3RD_DClkControl_LOCKED (1 << 1) |
421 | #define PM3RD_DClkControl_NOT_LOCKED (0<<1) | 403 | #define PM3RD_DClkControl_NOT_LOCKED (0 << 1) |
422 | #define PM3RD_DClkControl_ENABLE (1<<0) | 404 | #define PM3RD_DClkControl_ENABLE (1 << 0) |
423 | #define PM3RD_DClkControl_DISABLE (0<<0) | ||
424 | #define PM3RD_DClk0PreScale 0x201 | 405 | #define PM3RD_DClk0PreScale 0x201 |
425 | #define PM3RD_DClk0FeedbackScale 0x202 | 406 | #define PM3RD_DClk0FeedbackScale 0x202 |
426 | #define PM3RD_DClk0PostScale 0x203 | 407 | #define PM3RD_DClk0PostScale 0x203 |
427 | #define PM3_REF_CLOCK 14318 | 408 | #define PM3_REF_CLOCK 14318 |
428 | #define PM3RD_DClk1PreScale 0x204 | 409 | #define PM3RD_DClk1PreScale 0x204 |
429 | #define PM3RD_DClk1FeedbackScale 0x205 | 410 | #define PM3RD_DClk1FeedbackScale 0x205 |
430 | #define PM3RD_DClk1PostScale 0x206 | 411 | #define PM3RD_DClk1PostScale 0x206 |
@@ -435,59 +416,56 @@ | |||
435 | #define PM3RD_DClk3FeedbackScale 0x20b | 416 | #define PM3RD_DClk3FeedbackScale 0x20b |
436 | #define PM3RD_DClk3PostScale 0x20c | 417 | #define PM3RD_DClk3PostScale 0x20c |
437 | #define PM3RD_KClkControl 0x20d | 418 | #define PM3RD_KClkControl 0x20d |
438 | #define PM3RD_KClkControl_DISABLE (0<<0) | 419 | #define PM3RD_KClkControl_ENABLE (1 << 0) |
439 | #define PM3RD_KClkControl_ENABLE (1<<0) | 420 | #define PM3RD_KClkControl_NOT_LOCKED (0 << 1) |
440 | #define PM3RD_KClkControl_NOT_LOCKED (0<<1) | 421 | #define PM3RD_KClkControl_LOCKED (1 << 1) |
441 | #define PM3RD_KClkControl_LOCKED (1<<1) | 422 | #define PM3RD_KClkControl_STATE_LOW (0 << 2) |
442 | #define PM3RD_KClkControl_STATE_LOW (0<<2) | 423 | #define PM3RD_KClkControl_STATE_HIGH (1 << 2) |
443 | #define PM3RD_KClkControl_STATE_HIGH (1<<2) | 424 | #define PM3RD_KClkControl_STATE_RUN (2 << 2) |
444 | #define PM3RD_KClkControl_STATE_RUN (2<<2) | 425 | #define PM3RD_KClkControl_STATE_LOW_POWER (3 << 2) |
445 | #define PM3RD_KClkControl_STATE_LOW_POWER (3<<2) | 426 | #define PM3RD_KClkControl_SOURCE_PCLK (0 << 4) |
446 | #define PM3RD_KClkControl_SOURCE_PCLK (0<<4) | 427 | #define PM3RD_KClkControl_SOURCE_HALF_PCLK (1 << 4) |
447 | #define PM3RD_KClkControl_SOURCE_HALF_PCLK (1<<4) | 428 | #define PM3RD_KClkControl_SOURCE_PLL (2 << 4) |
448 | #define PM3RD_KClkControl_SOURCE_PLL (2<<4) | ||
449 | #define PM3RD_KClkPreScale 0x20e | 429 | #define PM3RD_KClkPreScale 0x20e |
450 | #define PM3RD_KClkFeedbackScale 0x20f | 430 | #define PM3RD_KClkFeedbackScale 0x20f |
451 | #define PM3RD_KClkPostScale 0x210 | 431 | #define PM3RD_KClkPostScale 0x210 |
452 | #define PM3RD_MClkControl 0x211 | 432 | #define PM3RD_MClkControl 0x211 |
453 | #define PM3RD_MClkControl_DISABLE (0<<0) | 433 | #define PM3RD_MClkControl_ENABLE (1 << 0) |
454 | #define PM3RD_MClkControl_ENABLE (1<<0) | 434 | #define PM3RD_MClkControl_NOT_LOCKED (0 << 1) |
455 | #define PM3RD_MClkControl_NOT_LOCKED (0<<1) | 435 | #define PM3RD_MClkControl_LOCKED (1 << 1) |
456 | #define PM3RD_MClkControl_LOCKED (1<<1) | 436 | #define PM3RD_MClkControl_STATE_LOW (0 << 2) |
457 | #define PM3RD_MClkControl_STATE_LOW (0<<2) | 437 | #define PM3RD_MClkControl_STATE_HIGH (1 << 2) |
458 | #define PM3RD_MClkControl_STATE_HIGH (1<<2) | 438 | #define PM3RD_MClkControl_STATE_RUN (2 << 2) |
459 | #define PM3RD_MClkControl_STATE_RUN (2<<2) | 439 | #define PM3RD_MClkControl_STATE_LOW_POWER (3 << 2) |
460 | #define PM3RD_MClkControl_STATE_LOW_POWER (3<<2) | 440 | #define PM3RD_MClkControl_SOURCE_PCLK (0 << 4) |
461 | #define PM3RD_MClkControl_SOURCE_PCLK (0<<4) | 441 | #define PM3RD_MClkControl_SOURCE_HALF_PCLK (1 << 4) |
462 | #define PM3RD_MClkControl_SOURCE_HALF_PCLK (1<<4) | 442 | #define PM3RD_MClkControl_SOURCE_HALF_EXT (3 << 4) |
463 | #define PM3RD_MClkControl_SOURCE_HALF_EXT (3<<4) | 443 | #define PM3RD_MClkControl_SOURCE_EXT (4 << 4) |
464 | #define PM3RD_MClkControl_SOURCE_EXT (4<<4) | 444 | #define PM3RD_MClkControl_SOURCE_HALF_KCLK (5 << 4) |
465 | #define PM3RD_MClkControl_SOURCE_HALF_KCLK (5<<4) | 445 | #define PM3RD_MClkControl_SOURCE_KCLK (6 << 4) |
466 | #define PM3RD_MClkControl_SOURCE_KCLK (6<<4) | ||
467 | #define PM3RD_MClkPreScale 0x212 | 446 | #define PM3RD_MClkPreScale 0x212 |
468 | #define PM3RD_MClkFeedbackScale 0x213 | 447 | #define PM3RD_MClkFeedbackScale 0x213 |
469 | #define PM3RD_MClkPostScale 0x214 | 448 | #define PM3RD_MClkPostScale 0x214 |
470 | #define PM3RD_SClkControl 0x215 | 449 | #define PM3RD_SClkControl 0x215 |
471 | #define PM3RD_SClkControl_DISABLE (0<<0) | 450 | #define PM3RD_SClkControl_ENABLE (1 << 0) |
472 | #define PM3RD_SClkControl_ENABLE (1<<0) | 451 | #define PM3RD_SClkControl_NOT_LOCKED (0 << 1) |
473 | #define PM3RD_SClkControl_NOT_LOCKED (0<<1) | 452 | #define PM3RD_SClkControl_LOCKED (1 << 1) |
474 | #define PM3RD_SClkControl_LOCKED (1<<1) | 453 | #define PM3RD_SClkControl_STATE_LOW (0 << 2) |
475 | #define PM3RD_SClkControl_STATE_LOW (0<<2) | 454 | #define PM3RD_SClkControl_STATE_HIGH (1 << 2) |
476 | #define PM3RD_SClkControl_STATE_HIGH (1<<2) | 455 | #define PM3RD_SClkControl_STATE_RUN (2 << 2) |
477 | #define PM3RD_SClkControl_STATE_RUN (2<<2) | 456 | #define PM3RD_SClkControl_STATE_LOW_POWER (3 << 2) |
478 | #define PM3RD_SClkControl_STATE_LOW_POWER (3<<2) | 457 | #define PM3RD_SClkControl_SOURCE_PCLK (0 << 4) |
479 | #define PM3RD_SClkControl_SOURCE_PCLK (0<<4) | 458 | #define PM3RD_SClkControl_SOURCE_HALF_PCLK (1 << 4) |
480 | #define PM3RD_SClkControl_SOURCE_HALF_PCLK (1<<4) | 459 | #define PM3RD_SClkControl_SOURCE_HALF_EXT (3 << 4) |
481 | #define PM3RD_SClkControl_SOURCE_HALF_EXT (3<<4) | 460 | #define PM3RD_SClkControl_SOURCE_EXT (4 << 4) |
482 | #define PM3RD_SClkControl_SOURCE_EXT (4<<4) | 461 | #define PM3RD_SClkControl_SOURCE_HALF_KCLK (5 << 4) |
483 | #define PM3RD_SClkControl_SOURCE_HALF_KCLK (5<<4) | 462 | #define PM3RD_SClkControl_SOURCE_KCLK (6 << 4) |
484 | #define PM3RD_SClkControl_SOURCE_KCLK (6<<4) | ||
485 | #define PM3RD_SClkPreScale 0x216 | 463 | #define PM3RD_SClkPreScale 0x216 |
486 | #define PM3RD_SClkFeedbackScale 0x217 | 464 | #define PM3RD_SClkFeedbackScale 0x217 |
487 | #define PM3RD_SClkPostScale 0x218 | 465 | #define PM3RD_SClkPostScale 0x218 |
488 | 466 | ||
489 | #define PM3RD_CursorPalette(p) (0x303+(p)) | 467 | #define PM3RD_CursorPalette(p) (0x303 + (p)) |
490 | #define PM3RD_CursorPattern(p) (0x400+(p)) | 468 | #define PM3RD_CursorPattern(p) (0x400 + (p)) |
491 | /****************************************************** | 469 | /****************************************************** |
492 | * GLINT Permedia3 Video Streaming Registers (0x5000) * | 470 | * GLINT Permedia3 Video Streaming Registers (0x5000) * |
493 | *******************************************************/ | 471 | *******************************************************/ |
@@ -521,10 +499,10 @@ | |||
521 | #define PM3ColorDDAModeOr 0xabe8 | 499 | #define PM3ColorDDAModeOr 0xabe8 |
522 | #define PM3CommandInterrupt 0xa990 | 500 | #define PM3CommandInterrupt 0xa990 |
523 | #define PM3ConstantColorDDA 0xafb0 | 501 | #define PM3ConstantColorDDA 0xafb0 |
524 | #define PM3ConstantColorDDA_R(r) ((r)&0xff) | 502 | #define PM3ConstantColorDDA_R(r) ((r) & 0xff) |
525 | #define PM3ConstantColorDDA_G(g) (((g)&0xff)<<8) | 503 | #define PM3ConstantColorDDA_G(g) (((g) & 0xff) << 8) |
526 | #define PM3ConstantColorDDA_B(b) (((b)&0xff)<<16) | 504 | #define PM3ConstantColorDDA_B(b) (((b) & 0xff) << 16) |
527 | #define PM3ConstantColorDDA_A(a) (((a)&0xff)<<24) | 505 | #define PM3ConstantColorDDA_A(a) (((a) & 0xff) << 24) |
528 | #define PM3ContextData 0x8dd0 | 506 | #define PM3ContextData 0x8dd0 |
529 | #define PM3ContextDump 0x8dc0 | 507 | #define PM3ContextDump 0x8dc0 |
530 | #define PM3ContextRestore 0x8dc8 | 508 | #define PM3ContextRestore 0x8dc8 |
@@ -568,59 +546,59 @@ | |||
568 | #define PM3FBDestReadBufferOffset1 0xaea8 | 546 | #define PM3FBDestReadBufferOffset1 0xaea8 |
569 | #define PM3FBDestReadBufferOffset2 0xaeb0 | 547 | #define PM3FBDestReadBufferOffset2 0xaeb0 |
570 | #define PM3FBDestReadBufferOffset3 0xaeb8 | 548 | #define PM3FBDestReadBufferOffset3 0xaeb8 |
571 | #define PM3FBDestReadBufferOffset_XOffset(x) ((x)&0xffff) | 549 | #define PM3FBDestReadBufferOffset_XOffset(x) ((x) & 0xffff) |
572 | #define PM3FBDestReadBufferOffset_YOffset(y) (((y)&0xffff)<<16) | 550 | #define PM3FBDestReadBufferOffset_YOffset(y) (((y) & 0xffff) << 16) |
573 | #define PM3FBDestReadBufferWidth0 0xaec0 | 551 | #define PM3FBDestReadBufferWidth0 0xaec0 |
574 | #define PM3FBDestReadBufferWidth1 0xaec8 | 552 | #define PM3FBDestReadBufferWidth1 0xaec8 |
575 | #define PM3FBDestReadBufferWidth2 0xaed0 | 553 | #define PM3FBDestReadBufferWidth2 0xaed0 |
576 | #define PM3FBDestReadBufferWidth3 0xaed8 | 554 | #define PM3FBDestReadBufferWidth3 0xaed8 |
577 | #define PM3FBDestReadBufferWidth_Width(w) ((w)&0x0fff) | 555 | #define PM3FBDestReadBufferWidth_Width(w) ((w) & 0x0fff) |
578 | 556 | ||
579 | #define PM3FBDestReadEnables 0xaee8 | 557 | #define PM3FBDestReadEnables 0xaee8 |
580 | #define PM3FBDestReadEnablesAnd 0xad20 | 558 | #define PM3FBDestReadEnablesAnd 0xad20 |
581 | #define PM3FBDestReadEnablesOr 0xad28 | 559 | #define PM3FBDestReadEnablesOr 0xad28 |
582 | #define PM3FBDestReadEnables_E(e) ((e)&0xff) | 560 | #define PM3FBDestReadEnables_E(e) ((e) & 0xff) |
583 | #define PM3FBDestReadEnables_E0 1<<0 | 561 | #define PM3FBDestReadEnables_E0 (1 << 0) |
584 | #define PM3FBDestReadEnables_E1 1<<1 | 562 | #define PM3FBDestReadEnables_E1 (1 << 1) |
585 | #define PM3FBDestReadEnables_E2 1<<2 | 563 | #define PM3FBDestReadEnables_E2 (1 << 2) |
586 | #define PM3FBDestReadEnables_E3 1<<3 | 564 | #define PM3FBDestReadEnables_E3 (1 << 3) |
587 | #define PM3FBDestReadEnables_E4 1<<4 | 565 | #define PM3FBDestReadEnables_E4 (1 << 4) |
588 | #define PM3FBDestReadEnables_E5 1<<5 | 566 | #define PM3FBDestReadEnables_E5 (1 << 5) |
589 | #define PM3FBDestReadEnables_E6 1<<6 | 567 | #define PM3FBDestReadEnables_E6 (1 << 6) |
590 | #define PM3FBDestReadEnables_E7 1<<7 | 568 | #define PM3FBDestReadEnables_E7 (1 << 7) |
591 | #define PM3FBDestReadEnables_R(r) (((r)&0xff)<<8) | 569 | #define PM3FBDestReadEnables_R(r) (((r) & 0xff) << 8) |
592 | #define PM3FBDestReadEnables_R0 1<<8 | 570 | #define PM3FBDestReadEnables_R0 (1 << 8) |
593 | #define PM3FBDestReadEnables_R1 1<<9 | 571 | #define PM3FBDestReadEnables_R1 (1 << 9) |
594 | #define PM3FBDestReadEnables_R2 1<<10 | 572 | #define PM3FBDestReadEnables_R2 (1 << 10) |
595 | #define PM3FBDestReadEnables_R3 1<<11 | 573 | #define PM3FBDestReadEnables_R3 (1 << 11) |
596 | #define PM3FBDestReadEnables_R4 1<<12 | 574 | #define PM3FBDestReadEnables_R4 (1 << 12) |
597 | #define PM3FBDestReadEnables_R5 1<<13 | 575 | #define PM3FBDestReadEnables_R5 (1 << 13) |
598 | #define PM3FBDestReadEnables_R6 1<<14 | 576 | #define PM3FBDestReadEnables_R6 (1 << 14) |
599 | #define PM3FBDestReadEnables_R7 1<<15 | 577 | #define PM3FBDestReadEnables_R7 (1 << 15) |
600 | #define PM3FBDestReadEnables_ReferenceAlpha(a) (((a)&0xff)<<24) | 578 | #define PM3FBDestReadEnables_ReferenceAlpha(a) (((a) & 0xff) << 24) |
601 | 579 | ||
602 | #define PM3FBDestReadMode 0xaee0 | 580 | #define PM3FBDestReadMode 0xaee0 |
603 | #define PM3FBDestReadModeAnd 0xac90 | 581 | #define PM3FBDestReadModeAnd 0xac90 |
604 | #define PM3FBDestReadModeOr 0xac98 | 582 | #define PM3FBDestReadModeOr 0xac98 |
605 | #define PM3FBDestReadMode_ReadDisable 0<<0 | 583 | #define PM3FBDestReadMode_ReadDisable (0 << 0) |
606 | #define PM3FBDestReadMode_ReadEnable 1<<0 | 584 | #define PM3FBDestReadMode_ReadEnable (1 << 0) |
607 | #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2) | 585 | #define PM3FBDestReadMode_StripePitch(sp) (((sp) & 0x7) << 2) |
608 | #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7) | 586 | #define PM3FBDestReadMode_StripeHeight(sh) (((sh) & 0x7) << 7) |
609 | #define PM3FBDestReadMode_Enable0 1<<8 | 587 | #define PM3FBDestReadMode_Enable0 (1 << 8) |
610 | #define PM3FBDestReadMode_Enable1 1<<9 | 588 | #define PM3FBDestReadMode_Enable1 (1 << 9) |
611 | #define PM3FBDestReadMode_Enable2 1<<10 | 589 | #define PM3FBDestReadMode_Enable2 (1 << 10) |
612 | #define PM3FBDestReadMode_Enable3 1<<11 | 590 | #define PM3FBDestReadMode_Enable3 (1 << 11) |
613 | #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12) | 591 | #define PM3FBDestReadMode_Layout0(l) (((l) & 0x3) << 12) |
614 | #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14) | 592 | #define PM3FBDestReadMode_Layout1(l) (((l) & 0x3) << 14) |
615 | #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16) | 593 | #define PM3FBDestReadMode_Layout2(l) (((l) & 0x3) << 16) |
616 | #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18) | 594 | #define PM3FBDestReadMode_Layout3(l) (((l) & 0x3) << 18) |
617 | #define PM3FBDestReadMode_Origin0 1<<20 | 595 | #define PM3FBDestReadMode_Origin0 (1 << 20) |
618 | #define PM3FBDestReadMode_Origin1 1<<21 | 596 | #define PM3FBDestReadMode_Origin1 (1 << 21) |
619 | #define PM3FBDestReadMode_Origin2 1<<22 | 597 | #define PM3FBDestReadMode_Origin2 (1 << 22) |
620 | #define PM3FBDestReadMode_Origin3 1<<23 | 598 | #define PM3FBDestReadMode_Origin3 (1 << 23) |
621 | #define PM3FBDestReadMode_Blocking 1<<24 | 599 | #define PM3FBDestReadMode_Blocking (1 << 24) |
622 | #define PM3FBDestReadMode_UseReadEnabled 1<<26 | 600 | #define PM3FBDestReadMode_UseReadEnabled (1 << 26) |
623 | #define PM3FBDestReadMode_AlphaFiltering 1<<27 | 601 | #define PM3FBDestReadMode_AlphaFiltering (1 << 27) |
624 | 602 | ||
625 | #define PM3FBHardwareWriteMask 0x8ac0 | 603 | #define PM3FBHardwareWriteMask 0x8ac0 |
626 | #define PM3FBSoftwareWriteMask 0x8820 | 604 | #define PM3FBSoftwareWriteMask 0x8820 |
@@ -628,65 +606,65 @@ | |||
628 | #define PM3FBSourceData 0x8aa8 | 606 | #define PM3FBSourceData 0x8aa8 |
629 | #define PM3FBSourceReadBufferAddr 0xaf08 | 607 | #define PM3FBSourceReadBufferAddr 0xaf08 |
630 | #define PM3FBSourceReadBufferOffset 0xaf10 | 608 | #define PM3FBSourceReadBufferOffset 0xaf10 |
631 | #define PM3FBSourceReadBufferOffset_XOffset(x) ((x)&0xffff) | 609 | #define PM3FBSourceReadBufferOffset_XOffset(x) ((x) & 0xffff) |
632 | #define PM3FBSourceReadBufferOffset_YOffset(y) (((y)&0xffff)<<16) | 610 | #define PM3FBSourceReadBufferOffset_YOffset(y) (((y) & 0xffff) << 16) |
633 | #define PM3FBSourceReadBufferWidth 0xaf18 | 611 | #define PM3FBSourceReadBufferWidth 0xaf18 |
634 | #define PM3FBSourceReadBufferWidth_Width(w) ((w)&0x0fff) | 612 | #define PM3FBSourceReadBufferWidth_Width(w) ((w) & 0x0fff) |
635 | #define PM3FBSourceReadMode 0xaf00 | 613 | #define PM3FBSourceReadMode 0xaf00 |
636 | #define PM3FBSourceReadModeAnd 0xaca0 | 614 | #define PM3FBSourceReadModeAnd 0xaca0 |
637 | #define PM3FBSourceReadModeOr 0xaca8 | 615 | #define PM3FBSourceReadModeOr 0xaca8 |
638 | #define PM3FBSourceReadMode_ReadDisable (0<<0) | 616 | #define PM3FBSourceReadMode_ReadDisable (0 << 0) |
639 | #define PM3FBSourceReadMode_ReadEnable (1<<0) | 617 | #define PM3FBSourceReadMode_ReadEnable (1 << 0) |
640 | #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2) | 618 | #define PM3FBSourceReadMode_StripePitch(sp) (((sp) & 0x7) << 2) |
641 | #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7) | 619 | #define PM3FBSourceReadMode_StripeHeight(sh) (((sh) & 0x7) << 7) |
642 | #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8) | 620 | #define PM3FBSourceReadMode_Layout(l) (((l) & 0x3) << 8) |
643 | #define PM3FBSourceReadMode_Origin 1<<10 | 621 | #define PM3FBSourceReadMode_Origin (1 << 10) |
644 | #define PM3FBSourceReadMode_Blocking 1<<11 | 622 | #define PM3FBSourceReadMode_Blocking (1 << 11) |
645 | #define PM3FBSourceReadMode_UserTexelCoord 1<<13 | 623 | #define PM3FBSourceReadMode_UserTexelCoord (1 << 13) |
646 | #define PM3FBSourceReadMode_WrapXEnable 1<<14 | 624 | #define PM3FBSourceReadMode_WrapXEnable (1 << 14) |
647 | #define PM3FBSourceReadMode_WrapYEnable 1<<15 | 625 | #define PM3FBSourceReadMode_WrapYEnable (1 << 15) |
648 | #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16) | 626 | #define PM3FBSourceReadMode_WrapX(w) (((w) & 0xf) << 16) |
649 | #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20) | 627 | #define PM3FBSourceReadMode_WrapY(w) (((w) & 0xf) << 20) |
650 | #define PM3FBSourceReadMode_ExternalSourceData 1<<24 | 628 | #define PM3FBSourceReadMode_ExternalSourceData (1 << 24) |
651 | #define PM3FBWriteBufferAddr0 0xb000 | 629 | #define PM3FBWriteBufferAddr0 0xb000 |
652 | #define PM3FBWriteBufferAddr1 0xb008 | 630 | #define PM3FBWriteBufferAddr1 0xb008 |
653 | #define PM3FBWriteBufferAddr2 0xb010 | 631 | #define PM3FBWriteBufferAddr2 0xb010 |
654 | #define PM3FBWriteBufferAddr3 0xb018 | 632 | #define PM3FBWriteBufferAddr3 0xb018 |
655 | 633 | ||
656 | #define PM3FBWriteBufferOffset0 0xb020 | 634 | #define PM3FBWriteBufferOffset0 0xb020 |
657 | #define PM3FBWriteBufferOffset1 0xb028 | 635 | #define PM3FBWriteBufferOffset1 0xb028 |
658 | #define PM3FBWriteBufferOffset2 0xb030 | 636 | #define PM3FBWriteBufferOffset2 0xb030 |
659 | #define PM3FBWriteBufferOffset3 0xb038 | 637 | #define PM3FBWriteBufferOffset3 0xb038 |
660 | #define PM3FBWriteBufferOffset_XOffset(x) ((x)&0xffff) | 638 | #define PM3FBWriteBufferOffset_XOffset(x) ((x) & 0xffff) |
661 | #define PM3FBWriteBufferOffset_YOffset(y) (((y)&0xffff)<<16) | 639 | #define PM3FBWriteBufferOffset_YOffset(y) (((y) & 0xffff) << 16) |
662 | 640 | ||
663 | #define PM3FBWriteBufferWidth0 0xb040 | 641 | #define PM3FBWriteBufferWidth0 0xb040 |
664 | #define PM3FBWriteBufferWidth1 0xb048 | 642 | #define PM3FBWriteBufferWidth1 0xb048 |
665 | #define PM3FBWriteBufferWidth2 0xb050 | 643 | #define PM3FBWriteBufferWidth2 0xb050 |
666 | #define PM3FBWriteBufferWidth3 0xb058 | 644 | #define PM3FBWriteBufferWidth3 0xb058 |
667 | #define PM3FBWriteBufferWidth_Width(w) ((w)&0x0fff) | 645 | #define PM3FBWriteBufferWidth_Width(w) ((w) & 0x0fff) |
668 | 646 | ||
669 | #define PM3FBWriteMode 0x8ab8 | 647 | #define PM3FBWriteMode 0x8ab8 |
670 | #define PM3FBWriteModeAnd 0xacf0 | 648 | #define PM3FBWriteModeAnd 0xacf0 |
671 | #define PM3FBWriteModeOr 0xacf8 | 649 | #define PM3FBWriteModeOr 0xacf8 |
672 | #define PM3FBWriteMode_WriteDisable 0<<0 | 650 | #define PM3FBWriteMode_WriteDisable (0 << 0) |
673 | #define PM3FBWriteMode_WriteEnable 1<<0 | 651 | #define PM3FBWriteMode_WriteEnable (1 << 0) |
674 | #define PM3FBWriteMode_Replicate 1<<4 | 652 | #define PM3FBWriteMode_Replicate (1 << 4) |
675 | #define PM3FBWriteMode_OpaqueSpan 1<<5 | 653 | #define PM3FBWriteMode_OpaqueSpan (1 << 5) |
676 | #define PM3FBWriteMode_StripePitch(p) (((p)&0x7)<<6) | 654 | #define PM3FBWriteMode_StripePitch(p) (((p) & 0x7) << 6) |
677 | #define PM3FBWriteMode_StripeHeight(h) (((h)&0x7)<<9) | 655 | #define PM3FBWriteMode_StripeHeight(h) (((h) & 0x7) << 9) |
678 | #define PM3FBWriteMode_Enable0 1<<12 | 656 | #define PM3FBWriteMode_Enable0 (1 << 12) |
679 | #define PM3FBWriteMode_Enable1 1<<13 | 657 | #define PM3FBWriteMode_Enable1 (1 << 13) |
680 | #define PM3FBWriteMode_Enable2 1<<14 | 658 | #define PM3FBWriteMode_Enable2 (1 << 14) |
681 | #define PM3FBWriteMode_Enable3 1<<15 | 659 | #define PM3FBWriteMode_Enable3 (1 << 15) |
682 | #define PM3FBWriteMode_Layout0(l) (((l)&0x3)<<16) | 660 | #define PM3FBWriteMode_Layout0(l) (((l) & 0x3) << 16) |
683 | #define PM3FBWriteMode_Layout1(l) (((l)&0x3)<<18) | 661 | #define PM3FBWriteMode_Layout1(l) (((l) & 0x3) << 18) |
684 | #define PM3FBWriteMode_Layout2(l) (((l)&0x3)<<20) | 662 | #define PM3FBWriteMode_Layout2(l) (((l) & 0x3) << 20) |
685 | #define PM3FBWriteMode_Layout3(l) (((l)&0x3)<<22) | 663 | #define PM3FBWriteMode_Layout3(l) (((l) & 0x3) << 22) |
686 | #define PM3FBWriteMode_Origin0 1<<24 | 664 | #define PM3FBWriteMode_Origin0 (1 << 24) |
687 | #define PM3FBWriteMode_Origin1 1<<25 | 665 | #define PM3FBWriteMode_Origin1 (1 << 25) |
688 | #define PM3FBWriteMode_Origin2 1<<26 | 666 | #define PM3FBWriteMode_Origin2 (1 << 26) |
689 | #define PM3FBWriteMode_Origin3 1<<27 | 667 | #define PM3FBWriteMode_Origin3 (1 << 27) |
690 | #define PM3ForegroundColor 0xb0c0 | 668 | #define PM3ForegroundColor 0xb0c0 |
691 | /* ... */ | 669 | /* ... */ |
692 | #define PM3GIDMode 0xb538 | 670 | #define PM3GIDMode 0xb538 |
@@ -701,55 +679,55 @@ | |||
701 | #define PM3LBDestReadMode 0xb500 | 679 | #define PM3LBDestReadMode 0xb500 |
702 | #define PM3LBDestReadModeAnd 0xb580 | 680 | #define PM3LBDestReadModeAnd 0xb580 |
703 | #define PM3LBDestReadModeOr 0xb588 | 681 | #define PM3LBDestReadModeOr 0xb588 |
704 | #define PM3LBDestReadMode_Disable 0<<0 | 682 | #define PM3LBDestReadMode_Disable (0 << 0) |
705 | #define PM3LBDestReadMode_Enable 1<<0 | 683 | #define PM3LBDestReadMode_Enable (1 << 0) |
706 | #define PM3LBDestReadMode_StripePitch(p) (((p)&0x7)<<2) | 684 | #define PM3LBDestReadMode_StripePitch(p) (((p) & 0x7) << 2) |
707 | #define PM3LBDestReadMode_StripeHeight(h) (((h)&0x7)<<5) | 685 | #define PM3LBDestReadMode_StripeHeight(h) (((h) & 0x7) << 5) |
708 | #define PM3LBDestReadMode_Layout 1<<8 | 686 | #define PM3LBDestReadMode_Layout (1 << 8) |
709 | #define PM3LBDestReadMode_Origin 1<<9 | 687 | #define PM3LBDestReadMode_Origin (1 << 9) |
710 | #define PM3LBDestReadMode_UserReadEnables 1<<10 | 688 | #define PM3LBDestReadMode_UserReadEnables (1 << 10) |
711 | #define PM3LBDestReadMode_Packed16 1<<11 | 689 | #define PM3LBDestReadMode_Packed16 (1 << 11) |
712 | #define PM3LBDestReadMode_Width(w) (((w)&0xfff)<<12) | 690 | #define PM3LBDestReadMode_Width(w) (((w) & 0xfff) << 12) |
713 | #define PM3LBReadFormat 0x8888 | 691 | #define PM3LBReadFormat 0x8888 |
714 | #define PM3LBReadFormat_DepthWidth(w) (((w)&0x3)<<0) | 692 | #define PM3LBReadFormat_DepthWidth(w) (((w) & 0x3) << 0) |
715 | #define PM3LBReadFormat_StencilWidth(w) (((w)&0xf)<<2) | 693 | #define PM3LBReadFormat_StencilWidth(w) (((w) & 0xf) << 2) |
716 | #define PM3LBReadFormat_StencilPosition(p) (((p)&0x1f)<<6) | 694 | #define PM3LBReadFormat_StencilPosition(p) (((p) & 0x1f) << 6) |
717 | #define PM3LBReadFormat_FCPWidth(w) (((w)&0xf)<<11) | 695 | #define PM3LBReadFormat_FCPWidth(w) (((w) & 0xf) << 11) |
718 | #define PM3LBReadFormat_FCPPosition(p) (((p)&0x1f)<<15) | 696 | #define PM3LBReadFormat_FCPPosition(p) (((p) & 0x1f) << 15) |
719 | #define PM3LBReadFormat_GIDWidth(w) (((w)&0x7)<<20) | 697 | #define PM3LBReadFormat_GIDWidth(w) (((w) & 0x7) << 20) |
720 | #define PM3LBReadFormat_GIDPosition(p) (((p)&0x1f)<<23) | 698 | #define PM3LBReadFormat_GIDPosition(p) (((p) & 0x1f) << 23) |
721 | #define PM3LBSourceReadBufferAddr 0xb528 | 699 | #define PM3LBSourceReadBufferAddr 0xb528 |
722 | #define PM3LBSourceReadBufferOffset 0xb530 | 700 | #define PM3LBSourceReadBufferOffset 0xb530 |
723 | #define PM3LBSourceReadMode 0xb520 | 701 | #define PM3LBSourceReadMode 0xb520 |
724 | #define PM3LBSourceReadModeAnd 0xb5a0 | 702 | #define PM3LBSourceReadModeAnd 0xb5a0 |
725 | #define PM3LBSourceReadModeOr 0xb5a8 | 703 | #define PM3LBSourceReadModeOr 0xb5a8 |
726 | #define PM3LBSourceReadMode_Enable 1<<0 | 704 | #define PM3LBSourceReadMode_Enable (1 << 0) |
727 | #define PM3LBSourceReadMode_StripePitch(p) (((p)&0x7)<<2) | 705 | #define PM3LBSourceReadMode_StripePitch(p) (((p) & 0x7) << 2) |
728 | #define PM3LBSourceReadMode_StripeHeight(h) (((h)&0x7)<<5) | 706 | #define PM3LBSourceReadMode_StripeHeight(h) (((h) & 0x7) << 5) |
729 | #define PM3LBSourceReadMode_Layout 1<<8 | 707 | #define PM3LBSourceReadMode_Layout (1 << 8) |
730 | #define PM3LBSourceReadMode_Origin 1<<9 | 708 | #define PM3LBSourceReadMode_Origin (1 << 9) |
731 | #define PM3LBSourceReadMode_Packed16 1<<10 | 709 | #define PM3LBSourceReadMode_Packed16 (1 << 10) |
732 | #define PM3LBSourceReadMode_Width(w) (((w)&0xfff)<<11) | 710 | #define PM3LBSourceReadMode_Width(w) (((w) & 0xfff) << 11) |
733 | #define PM3LBStencil 0x88a8 | 711 | #define PM3LBStencil 0x88a8 |
734 | #define PM3LBWriteBufferAddr 0xb540 | 712 | #define PM3LBWriteBufferAddr 0xb540 |
735 | #define PM3LBWriteBufferOffset 0xb548 | 713 | #define PM3LBWriteBufferOffset 0xb548 |
736 | #define PM3LBWriteFormat 0x88c8 | 714 | #define PM3LBWriteFormat 0x88c8 |
737 | #define PM3LBWriteFormat_DepthWidth(w) (((w)&0x3)<<0) | 715 | #define PM3LBWriteFormat_DepthWidth(w) (((w) & 0x3) << 0) |
738 | #define PM3LBWriteFormat_StencilWidth(w) (((w)&0xf)<<2) | 716 | #define PM3LBWriteFormat_StencilWidth(w) (((w) & 0xf) << 2) |
739 | #define PM3LBWriteFormat_StencilPosition(p) (((p)&0x1f)<<6) | 717 | #define PM3LBWriteFormat_StencilPosition(p) (((p) & 0x1f) << 6) |
740 | #define PM3LBWriteFormat_GIDWidth(w) (((w)&0x7)<<20) | 718 | #define PM3LBWriteFormat_GIDWidth(w) (((w) & 0x7) << 20) |
741 | #define PM3LBWriteFormat_GIDPosition(p) (((p)&0x1f)<<23) | 719 | #define PM3LBWriteFormat_GIDPosition(p) (((p) & 0x1f) << 23) |
742 | #define PM3LBWriteMode 0x88c0 | 720 | #define PM3LBWriteMode 0x88c0 |
743 | #define PM3LBWriteModeAnd 0xac80 | 721 | #define PM3LBWriteModeAnd 0xac80 |
744 | #define PM3LBWriteModeOr 0xac88 | 722 | #define PM3LBWriteModeOr 0xac88 |
745 | #define PM3LBWriteMode_WriteDisable 0<<0 | 723 | #define PM3LBWriteMode_WriteDisable (0 << 0) |
746 | #define PM3LBWriteMode_WriteEnable 1<<0 | 724 | #define PM3LBWriteMode_WriteEnable (1 << 0) |
747 | #define PM3LBWriteMode_StripePitch(p) (((p)&0x7)<<3) | 725 | #define PM3LBWriteMode_StripePitch(p) (((p) & 0x7) << 3) |
748 | #define PM3LBWriteMode_StripeHeight(h) (((h)&0x7)<<6) | 726 | #define PM3LBWriteMode_StripeHeight(h) (((h) & 0x7) << 6) |
749 | #define PM3LBWriteMode_Layout 1<<9 | 727 | #define PM3LBWriteMode_Layout (1 << 9) |
750 | #define PM3LBWriteMode_Origin 1<<10 | 728 | #define PM3LBWriteMode_Origin (1 << 10) |
751 | #define PM3LBWriteMode_Packed16 1<<11 | 729 | #define PM3LBWriteMode_Packed16 (1 << 11) |
752 | #define PM3LBWriteMode_Width(w) (((w)&0xfff)<<12) | 730 | #define PM3LBWriteMode_Width(w) (((w) & 0xfff) << 12) |
753 | /* ... */ | 731 | /* ... */ |
754 | #define PM3LineStippleMode 0x81a8 | 732 | #define PM3LineStippleMode 0x81a8 |
755 | #define PM3LineStippleModeAnd 0xabc0 | 733 | #define PM3LineStippleModeAnd 0xabc0 |
@@ -759,19 +737,16 @@ | |||
759 | #define PM3LogicalOpMode 0x8828 | 737 | #define PM3LogicalOpMode 0x8828 |
760 | #define PM3LogicalOpModeAnd 0xace0 | 738 | #define PM3LogicalOpModeAnd 0xace0 |
761 | #define PM3LogicalOpModeOr 0xace8 | 739 | #define PM3LogicalOpModeOr 0xace8 |
762 | #define PM3LogicalOpMode_Disable (0<<0) | 740 | #define PM3LogicalOpMode_Disable (0 << 0) |
763 | #define PM3LogicalOpMode_Enable (1<<0) | 741 | #define PM3LogicalOpMode_Enable (1 << 0) |
764 | #define PM3LogicalOpMode_LogicOp(op) (((op)&0xf)<<1) | 742 | #define PM3LogicalOpMode_LogicOp(op) (((op) & 0xf) << 1) |
765 | #define PM3LogicalOpMode_UseConstantWriteData_Disable (0<<5) | 743 | #define PM3LogicalOpMode_UseConstantWriteData_Disable (0 << 5) |
766 | #define PM3LogicalOpMode_UseConstantWriteData_Enable (1<<5) | 744 | #define PM3LogicalOpMode_UseConstantWriteData_Enable (1 << 5) |
767 | #define PM3LogicalOpMode_Background_Disable (0<<6) | 745 | #define PM3LogicalOpMode_Background_Disable (0 << 6) |
768 | #define PM3LogicalOpMode_Background_Enable (1<<6) | 746 | #define PM3LogicalOpMode_Background_Enable (1 << 6) |
769 | #define PM3LogicalOpMode_Background_LogicOp(op) (((op)&0xf)<<7) | 747 | #define PM3LogicalOpMode_Background_LogicOp(op) (((op) & 0xf) << 7) |
770 | #define PM3LogicalOpMode_UseConstantSource_Disable (0<<11) | 748 | #define PM3LogicalOpMode_UseConstantSource_Disable (0 << 11) |
771 | #define PM3LogicalOpMode_UseConstantSource_Enable (1<<11) | 749 | #define PM3LogicalOpMode_UseConstantSource_Enable (1 << 11) |
772 | |||
773 | /* ... */ | ||
774 | #define PM3LUT 0x8e80 | ||
775 | /* ... */ | 750 | /* ... */ |
776 | #define PM3LUT 0x8e80 | 751 | #define PM3LUT 0x8e80 |
777 | #define PM3LUTAddress 0x84d0 | 752 | #define PM3LUTAddress 0x84d0 |
@@ -783,75 +758,74 @@ | |||
783 | #define PM3LUTTransfer 0x84d8 | 758 | #define PM3LUTTransfer 0x84d8 |
784 | /* ... */ | 759 | /* ... */ |
785 | #define PM3PixelSize 0x80c0 | 760 | #define PM3PixelSize 0x80c0 |
786 | #define PM3PixelSize_GLOBAL_32BIT (0<<0) | 761 | #define PM3PixelSize_GLOBAL_32BIT (0 << 0) |
787 | #define PM3PixelSize_GLOBAL_16BIT (1<<0) | 762 | #define PM3PixelSize_GLOBAL_16BIT (1 << 0) |
788 | #define PM3PixelSize_GLOBAL_8BIT (2<<0) | 763 | #define PM3PixelSize_GLOBAL_8BIT (2 << 0) |
789 | #define PM3PixelSize_RASTERIZER_32BIT (0<<2) | 764 | #define PM3PixelSize_RASTERIZER_32BIT (0 << 2) |
790 | #define PM3PixelSize_RASTERIZER_16BIT (1<<2) | 765 | #define PM3PixelSize_RASTERIZER_16BIT (1 << 2) |
791 | #define PM3PixelSize_RASTERIZER_8BIT (2<<2) | 766 | #define PM3PixelSize_RASTERIZER_8BIT (2 << 2) |
792 | #define PM3PixelSize_SCISSOR_AND_STIPPLE_32BIT (0<<4) | 767 | #define PM3PixelSize_SCISSOR_AND_STIPPLE_32BIT (0 << 4) |
793 | #define PM3PixelSize_SCISSOR_AND_STIPPLE_16BIT (1<<4) | 768 | #define PM3PixelSize_SCISSOR_AND_STIPPLE_16BIT (1 << 4) |
794 | #define PM3PixelSize_SCISSOR_AND_STIPPLE_8BIT (2<<4) | 769 | #define PM3PixelSize_SCISSOR_AND_STIPPLE_8BIT (2 << 4) |
795 | #define PM3PixelSize_TEXTURE_32BIT (0<<6) | 770 | #define PM3PixelSize_TEXTURE_32BIT (0 << 6) |
796 | #define PM3PixelSize_TEXTURE_16BIT (1<<6) | 771 | #define PM3PixelSize_TEXTURE_16BIT (1 << 6) |
797 | #define PM3PixelSize_TEXTURE_8BIT (2<<6) | 772 | #define PM3PixelSize_TEXTURE_8BIT (2 << 6) |
798 | #define PM3PixelSize_LUT_32BIT (0<<8) | 773 | #define PM3PixelSize_LUT_32BIT (0 << 8) |
799 | #define PM3PixelSize_LUT_16BIT (1<<8) | 774 | #define PM3PixelSize_LUT_16BIT (1 << 8) |
800 | #define PM3PixelSize_LUT_8BIT (2<<8) | 775 | #define PM3PixelSize_LUT_8BIT (2 << 8) |
801 | #define PM3PixelSize_FRAMEBUFFER_32BIT (0<<10) | 776 | #define PM3PixelSize_FRAMEBUFFER_32BIT (0 << 10) |
802 | #define PM3PixelSize_FRAMEBUFFER_16BIT (1<<10) | 777 | #define PM3PixelSize_FRAMEBUFFER_16BIT (1 << 10) |
803 | #define PM3PixelSize_FRAMEBUFFER_8BIT (2<<10) | 778 | #define PM3PixelSize_FRAMEBUFFER_8BIT (2 << 10) |
804 | #define PM3PixelSize_LOGICAL_OP_32BIT (0<<12) | 779 | #define PM3PixelSize_LOGICAL_OP_32BIT (0 << 12) |
805 | #define PM3PixelSize_LOGICAL_OP_16BIT (1<<12) | 780 | #define PM3PixelSize_LOGICAL_OP_16BIT (1 << 12) |
806 | #define PM3PixelSize_LOGICAL_OP_8BIT (2<<12) | 781 | #define PM3PixelSize_LOGICAL_OP_8BIT (2 << 12) |
807 | #define PM3PixelSize_LOCALBUFFER_32BIT (0<<14) | 782 | #define PM3PixelSize_LOCALBUFFER_32BIT (0 << 14) |
808 | #define PM3PixelSize_LOCALBUFFER_16BIT (1<<14) | 783 | #define PM3PixelSize_LOCALBUFFER_16BIT (1 << 14) |
809 | #define PM3PixelSize_LOCALBUFFER_8BIT (2<<14) | 784 | #define PM3PixelSize_LOCALBUFFER_8BIT (2 << 14) |
810 | #define PM3PixelSize_SETUP_32BIT (0<<16) | 785 | #define PM3PixelSize_SETUP_32BIT (0 << 16) |
811 | #define PM3PixelSize_SETUP_16BIT (1<<16) | 786 | #define PM3PixelSize_SETUP_16BIT (1 << 16) |
812 | #define PM3PixelSize_SETUP_8BIT (2<<16) | 787 | #define PM3PixelSize_SETUP_8BIT (2 << 16) |
813 | #define PM3PixelSize_GLOBAL (0<<31) | 788 | #define PM3PixelSize_GLOBAL (0 << 31) |
814 | #define PM3PixelSize_INDIVIDUAL (1<<31) | 789 | #define PM3PixelSize_INDIVIDUAL (1 << 31) |
815 | /* ... */ | 790 | /* ... */ |
816 | #define PM3Render 0x8038 | 791 | #define PM3Render 0x8038 |
817 | #define PM3Render_AreaStipple_Disable (0<<0) | 792 | #define PM3Render_AreaStipple_Disable (0 << 0) |
818 | #define PM3Render_AreaStipple_Enable (1<<0) | 793 | #define PM3Render_AreaStipple_Enable (1 << 0) |
819 | #define PM3Render_LineStipple_Disable (0<<1) | 794 | #define PM3Render_LineStipple_Disable (0 << 1) |
820 | #define PM3Render_LineStipple_Enable (1<<1) | 795 | #define PM3Render_LineStipple_Enable (1 << 1) |
821 | #define PM3Render_ResetLine_Disable (0<<2) | 796 | #define PM3Render_ResetLine_Disable (0 << 2) |
822 | #define PM3Render_ResetLine_Enable (1<<2) | 797 | #define PM3Render_ResetLine_Enable (1 << 2) |
823 | #define PM3Render_FastFill_Disable (0<<3) | 798 | #define PM3Render_FastFill_Disable (0 << 3) |
824 | #define PM3Render_FastFill_Enable (1<<3) | 799 | #define PM3Render_FastFill_Enable (1 << 3) |
825 | #define PM3Render_Primitive_Line (0<<6) | 800 | #define PM3Render_Primitive_Line (0 << 6) |
826 | #define PM3Render_Primitive_Trapezoid (1<<6) | 801 | #define PM3Render_Primitive_Trapezoid (1 << 6) |
827 | #define PM3Render_Primitive_Point (2<<6) | 802 | #define PM3Render_Primitive_Point (2 << 6) |
828 | #define PM3Render_Antialias_Disable (0<<8) | 803 | #define PM3Render_Antialias_Disable (0 << 8) |
829 | #define PM3Render_Antialias_Enable (1<<8) | 804 | #define PM3Render_Antialias_Enable (1 << 8) |
830 | #define PM3Render_Antialias_SubPixelRes_4x4 (0<<9) | 805 | #define PM3Render_Antialias_SubPixelRes_4x4 (0 << 9) |
831 | #define PM3Render_Antialias_SubPixelRes_8x8 (1<<9) | 806 | #define PM3Render_Antialias_SubPixelRes_8x8 (1 << 9) |
832 | #define PM3Render_UsePointTable_Disable (0<<10) | 807 | #define PM3Render_UsePointTable_Disable (0 << 10) |
833 | #define PM3Render_UsePointTable_Enable (1<<10) | 808 | #define PM3Render_UsePointTable_Enable (1 << 10) |
834 | #define PM3Render_SyncOnbitMask_Disable (0<<11) | 809 | #define PM3Render_SyncOnbitMask_Disable (0 << 11) |
835 | #define PM3Render_SyncOnBitMask_Enable (1<<11) | 810 | #define PM3Render_SyncOnBitMask_Enable (1 << 11) |
836 | #define PM3Render_SyncOnHostData_Disable (0<<12) | 811 | #define PM3Render_SyncOnHostData_Disable (0 << 12) |
837 | #define PM3Render_SyncOnHostData_Enable (1<<12) | 812 | #define PM3Render_SyncOnHostData_Enable (1 << 12) |
838 | #define PM3Render_Texture_Disable (0<<13) | 813 | #define PM3Render_Texture_Disable (0 << 13) |
839 | #define PM3Render_Texture_Enable (1<<13) | 814 | #define PM3Render_Texture_Enable (1 << 13) |
840 | #define PM3Render_Fog_Disable (0<<14) | 815 | #define PM3Render_Fog_Disable (0 << 14) |
841 | #define PM3Render_Fog_Enable (1<<14) | 816 | #define PM3Render_Fog_Enable (1 << 14) |
842 | #define PM3Render_Coverage_Disable (0<<15) | 817 | #define PM3Render_Coverage_Disable (0 << 15) |
843 | #define PM3Render_Coverage_Enable (1<<15) | 818 | #define PM3Render_Coverage_Enable (1 << 15) |
844 | #define PM3Render_SubPixelCorrection_Disable (0<<16) | 819 | #define PM3Render_SubPixelCorrection_Disable (0 << 16) |
845 | #define PM3Render_SubPixelCorrection_Enable (1<<16) | 820 | #define PM3Render_SubPixelCorrection_Enable (1 << 16) |
846 | #define PM3Render_SpanOperation_Disable (0<<18) | 821 | #define PM3Render_SpanOperation_Disable (0 << 18) |
847 | #define PM3Render_SpanOperation_Enable (1<<18) | 822 | #define PM3Render_SpanOperation_Enable (1 << 18) |
848 | #define PM3Render_FBSourceRead_Disable (0<<27) | 823 | #define PM3Render_FBSourceRead_Disable (0 << 27) |
849 | #define PM3Render_FBSourceRead_Enable (1<<27) | 824 | #define PM3Render_FBSourceRead_Enable (1 << 27) |
850 | #define PM3RasterizerMode 0x80a0 | 825 | #define PM3RasterizerMode 0x80a0 |
851 | #define PM3RasterizerModeAnd 0xaba0 | 826 | #define PM3RasterizerModeAnd 0xaba0 |
852 | #define PM3RasterizerModeOr 0xabb8 | 827 | #define PM3RasterizerModeOr 0xaba8 |
853 | #define PM3RectangleHeight 0x94e0 | 828 | #define PM3RectangleHeight 0x94e0 |
854 | #define PM3Render 0x8038 | ||
855 | #define PM3RepeatLine 0x9328 | 829 | #define PM3RepeatLine 0x9328 |
856 | #define PM3ResetPickResult 0x8c20 | 830 | #define PM3ResetPickResult 0x8c20 |
857 | #define PM3RLEMask 0x8c48 | 831 | #define PM3RLEMask 0x8c48 |
@@ -918,31 +892,31 @@ | |||
918 | #define PM3TextureIndexMode1And 0xb3d0 | 892 | #define PM3TextureIndexMode1And 0xb3d0 |
919 | #define PM3TextureIndexMode1Or 0xb3d8 | 893 | #define PM3TextureIndexMode1Or 0xb3d8 |
920 | /* ... */ | 894 | /* ... */ |
921 | #define PM3TextureMapSize 0xb428 | 895 | #define PM3TextureMapSize 0xb428 |
922 | #define PM3TextureMapWidth0 0x8580 | 896 | #define PM3TextureMapWidth0 0x8580 |
923 | #define PM3TextureMapWidth1 0x8588 | 897 | #define PM3TextureMapWidth1 0x8588 |
924 | #define PM3TextureMapWidth_Width(w) ((w&0xfff)<<0) | 898 | #define PM3TextureMapWidth_Width(w) (((w) & 0xfff) << 0) |
925 | #define PM3TextureMapWidth_BorderLayout (1<<12) | 899 | #define PM3TextureMapWidth_BorderLayout (1 << 12) |
926 | #define PM3TextureMapWidth_Layout_Linear (0<<13) | 900 | #define PM3TextureMapWidth_Layout_Linear (0 << 13) |
927 | #define PM3TextureMapWidth_Layout_Patch64 (1<<13) | 901 | #define PM3TextureMapWidth_Layout_Patch64 (1 << 13) |
928 | #define PM3TextureMapWidth_Layout_Patch32_2 (2<<13) | 902 | #define PM3TextureMapWidth_Layout_Patch32_2 (2 << 13) |
929 | #define PM3TextureMapWidth_Layout_Patch2 (3<<13) | 903 | #define PM3TextureMapWidth_Layout_Patch2 (3 << 13) |
930 | #define PM3TextureMapWidth_HostTexture (1<<15) | 904 | #define PM3TextureMapWidth_HostTexture (1 << 15) |
931 | #define PM3TextureReadMode0 0xb400 | 905 | #define PM3TextureReadMode0 0xb400 |
932 | #define PM3TextureReadMode0And 0xac30 | 906 | #define PM3TextureReadMode0And 0xac30 |
933 | #define PM3TextureReadMode0Or 0xac38 | 907 | #define PM3TextureReadMode0Or 0xac38 |
934 | #define PM3TextureReadMode1 0xb408 | 908 | #define PM3TextureReadMode1 0xb408 |
935 | #define PM3TextureReadMode1And 0xad40 | 909 | #define PM3TextureReadMode1And 0xad40 |
936 | #define PM3TextureReadMode1Or 0xad48 | 910 | #define PM3TextureReadMode1Or 0xad48 |
937 | /* ... */ | 911 | /* ... */ |
938 | #define PM3WaitForCompletion 0x80b8 | 912 | #define PM3WaitForCompletion 0x80b8 |
939 | #define PM3Window 0x8980 | 913 | #define PM3Window 0x8980 |
940 | #define PM3Window_ForceLBUpdate 1<<3 | 914 | #define PM3Window_ForceLBUpdate (1 << 3) |
941 | #define PM3Window_LBUpdateSource 1<<4 | 915 | #define PM3Window_LBUpdateSource (1 << 4) |
942 | #define PM3Window_FrameCount(c) (((c)&0xff)<<9) | 916 | #define PM3Window_FrameCount(c) (((c) & 0xff) << 9) |
943 | #define PM3Window_StencilFCP 1<<17 | 917 | #define PM3Window_StencilFCP (1 << 17) |
944 | #define PM3Window_DepthFCP 1<<18 | 918 | #define PM3Window_DepthFCP (1 << 18) |
945 | #define PM3Window_OverrideWriteFiltering 1<<19 | 919 | #define PM3Window_OverrideWriteFiltering (1 << 19) |
946 | #define PM3WindowAnd 0xab80 | 920 | #define PM3WindowAnd 0xab80 |
947 | #define PM3WindowOr 0xab88 | 921 | #define PM3WindowOr 0xab88 |
948 | #define PM3WindowOrigin 0x81c8 | 922 | #define PM3WindowOrigin 0x81c8 |
@@ -957,169 +931,131 @@ | |||
957 | 931 | ||
958 | 932 | ||
959 | /********************************************** | 933 | /********************************************** |
960 | * GLINT Permedia3 2D setup Unit * | 934 | * GLINT Permedia3 2D setup Unit * |
961 | ***********************************************/ | 935 | ***********************************************/ |
962 | #define PM3Config2D 0xb618 | 936 | #define PM3Config2D 0xb618 |
963 | #define PM3Config2D_OpaqueSpan 1<<0 | 937 | #define PM3Config2D_OpaqueSpan (1 << 0) |
964 | #define PM3Config2D_MultiRXBlit 1<<1 | 938 | #define PM3Config2D_MultiRXBlit (1 << 1) |
965 | #define PM3Config2D_UserScissorEnable 1<<2 | 939 | #define PM3Config2D_UserScissorEnable (1 << 2) |
966 | #define PM3Config2D_FBDestReadEnable 1<<3 | 940 | #define PM3Config2D_FBDestReadEnable (1 << 3) |
967 | #define PM3Config2D_AlphaBlendEnable 1<<4 | 941 | #define PM3Config2D_AlphaBlendEnable (1 << 4) |
968 | #define PM3Config2D_DitherEnable 1<<5 | 942 | #define PM3Config2D_DitherEnable (1 << 5) |
969 | #define PM3Config2D_ForegroundROPEnable 1<<6 | 943 | #define PM3Config2D_ForegroundROPEnable (1 << 6) |
970 | #define PM3Config2D_ForegroundROP(rop) (((rop)&0xf)<<7) | 944 | #define PM3Config2D_ForegroundROP(rop) (((rop) & 0xf) << 7) |
971 | #define PM3Config2D_BackgroundROPEnable 1<<11 | 945 | #define PM3Config2D_BackgroundROPEnable (1 << 11) |
972 | #define PM3Config2D_BackgroundROP(rop) (((rop)&0xf)<<12) | 946 | #define PM3Config2D_BackgroundROP(rop) (((rop) & 0xf) << 12) |
973 | #define PM3Config2D_UseConstantSource 1<<16 | 947 | #define PM3Config2D_UseConstantSource (1 << 16) |
974 | #define PM3Config2D_FBWriteEnable 1<<17 | 948 | #define PM3Config2D_FBWriteEnable (1 << 17) |
975 | #define PM3Config2D_Blocking 1<<18 | 949 | #define PM3Config2D_Blocking (1 << 18) |
976 | #define PM3Config2D_ExternalSourceData 1<<19 | 950 | #define PM3Config2D_ExternalSourceData (1 << 19) |
977 | #define PM3Config2D_LUTModeEnable 1<<20 | 951 | #define PM3Config2D_LUTModeEnable (1 << 20) |
978 | #define PM3DownloadGlyphwidth 0xb658 | 952 | #define PM3DownloadGlyphwidth 0xb658 |
979 | #define PM3DownloadGlyphwidth_GlyphWidth(gw) ((gw)&0xffff) | 953 | #define PM3DownloadGlyphwidth_GlyphWidth(gw) ((gw) & 0xffff) |
980 | #define PM3DownloadTarget 0xb650 | 954 | #define PM3DownloadTarget 0xb650 |
981 | #define PM3DownloadTarget_TagName(tag) ((tag)&0x1fff) | 955 | #define PM3DownloadTarget_TagName(tag) ((tag) & 0x1fff) |
982 | #define PM3GlyphData 0xb660 | 956 | #define PM3GlyphData 0xb660 |
983 | #define PM3GlyphPosition 0xb608 | 957 | #define PM3GlyphPosition 0xb608 |
984 | #define PM3GlyphPosition_XOffset(x) ((x)&0xffff) | 958 | #define PM3GlyphPosition_XOffset(x) ((x) & 0xffff) |
985 | #define PM3GlyphPosition_YOffset(y) (((y)&0xffff)<<16) | 959 | #define PM3GlyphPosition_YOffset(y) (((y) & 0xffff) << 16) |
986 | #define PM3Packed4Pixels 0xb668 | 960 | #define PM3Packed4Pixels 0xb668 |
987 | #define PM3Packed8Pixels 0xb630 | 961 | #define PM3Packed8Pixels 0xb630 |
988 | #define PM3Packed16Pixels 0xb638 | 962 | #define PM3Packed16Pixels 0xb638 |
989 | #define PM3RectanglePosition 0xb600 | 963 | #define PM3RectanglePosition 0xb600 |
990 | #define PM3RectanglePosition_XOffset(x) ((x)&0xffff) | 964 | #define PM3RectanglePosition_XOffset(x) ((x) & 0xffff) |
991 | #define PM3RectanglePosition_YOffset(y) (((y)&0xffff)<<16) | 965 | #define PM3RectanglePosition_YOffset(y) (((y) & 0xffff) << 16) |
992 | #define PM3Render2D 0xb640 | 966 | #define PM3Render2D 0xb640 |
993 | #define PM3Render2D_Width(w) ((w)&0x0fff) | 967 | #define PM3Render2D_Width(w) ((w) & 0x0fff) |
994 | #define PM3Render2D_Operation_Normal 0<<12 | 968 | #define PM3Render2D_Operation_Normal (0 << 12) |
995 | #define PM3Render2D_Operation_SyncOnHostData 1<<12 | 969 | #define PM3Render2D_Operation_SyncOnHostData (1 << 12) |
996 | #define PM3Render2D_Operation_SyncOnBitMask 2<<12 | 970 | #define PM3Render2D_Operation_SyncOnBitMask (2 << 12) |
997 | #define PM3Render2D_Operation_PatchOrderRendering 3<<12 | 971 | #define PM3Render2D_Operation_PatchOrderRendering (3 << 12) |
998 | #define PM3Render2D_FBSourceReadEnable 1<<14 | 972 | #define PM3Render2D_FBSourceReadEnable (1 << 14) |
999 | #define PM3Render2D_SpanOperation 1<<15 | 973 | #define PM3Render2D_SpanOperation (1 << 15) |
1000 | #define PM3Render2D_Height(h) (((h)&0x0fff)<<16) | 974 | #define PM3Render2D_Height(h) (((h) & 0x0fff) << 16) |
1001 | #define PM3Render2D_XPositive 1<<28 | 975 | #define PM3Render2D_XPositive (1 << 28) |
1002 | #define PM3Render2D_YPositive 1<<29 | 976 | #define PM3Render2D_YPositive (1 << 29) |
1003 | #define PM3Render2D_AreaStippleEnable 1<<30 | 977 | #define PM3Render2D_AreaStippleEnable (1 << 30) |
1004 | #define PM3Render2D_TextureEnable 1<<31 | 978 | #define PM3Render2D_TextureEnable (1 << 31) |
1005 | #define PM3Render2DGlyph 0xb648 | 979 | #define PM3Render2DGlyph 0xb648 |
1006 | #define PM3Render2DGlyph_Width(w) ((w)&0x7f) | 980 | #define PM3Render2DGlyph_Width(w) ((w) & 0x7f) |
1007 | #define PM3Render2DGlyph_Height(h) (((h)&0x7f)<<7) | 981 | #define PM3Render2DGlyph_Height(h) (((h) & 0x7f) << 7) |
1008 | #define PM3Render2DGlyph_XOffset(x) (((x)&0x1ff)<<14) | 982 | #define PM3Render2DGlyph_XOffset(x) (((x) & 0x1ff) << 14) |
1009 | #define PM3Render2DGlyph_YOffset(y) (((y)&0x1ff)<<23) | 983 | #define PM3Render2DGlyph_YOffset(y) (((y) & 0x1ff) << 23) |
1010 | #define PM3RenderPatchOffset 0xb610 | 984 | #define PM3RenderPatchOffset 0xb610 |
1011 | #define PM3RenderPatchOffset_XOffset(x) ((x)&0xffff) | 985 | #define PM3RenderPatchOffset_XOffset(x) ((x) & 0xffff) |
1012 | #define PM3RenderPatchOffset_YOffset(y) (((y)&0xffff)<<16) | 986 | #define PM3RenderPatchOffset_YOffset(y) (((y) & 0xffff) << 16) |
1013 | #define PM3RLCount 0xb678 | 987 | #define PM3RLCount 0xb678 |
1014 | #define PM3RLCount_Count(c) ((c)&0x0fff) | 988 | #define PM3RLCount_Count(c) ((c) & 0x0fff) |
1015 | #define PM3RLData 0xb670 | 989 | #define PM3RLData 0xb670 |
1016 | 990 | ||
1017 | /********************************************** | 991 | /********************************************** |
1018 | * GLINT Permedia3 Alias Register * | 992 | * GLINT Permedia3 Alias Register * |
1019 | ***********************************************/ | 993 | ***********************************************/ |
1020 | #define PM3FillBackgroundColor 0x8330 | 994 | #define PM3FillBackgroundColor 0x8330 |
1021 | #define PM3FillConfig2D0 0x8338 | 995 | #define PM3FillConfig2D0 0x8338 |
1022 | #define PM3FillConfig2D1 0x8360 | 996 | #define PM3FillConfig2D1 0x8360 |
1023 | #define PM3FillConfig2D_OpaqueSpan 1<<0 | 997 | #define PM3FillConfig2D_OpaqueSpan (1 << 0) |
1024 | #define PM3FillConfig2D_MultiRXBlit 1<<1 | 998 | #define PM3FillConfig2D_MultiRXBlit (1 << 1) |
1025 | #define PM3FillConfig2D_UserScissorEnable 1<<2 | 999 | #define PM3FillConfig2D_UserScissorEnable (1 << 2) |
1026 | #define PM3FillConfig2D_FBDestReadEnable 1<<3 | 1000 | #define PM3FillConfig2D_FBDestReadEnable (1 << 3) |
1027 | #define PM3FillConfig2D_AlphaBlendEnable 1<<4 | 1001 | #define PM3FillConfig2D_AlphaBlendEnable (1 << 4) |
1028 | #define PM3FillConfig2D_DitherEnable 1<<5 | 1002 | #define PM3FillConfig2D_DitherEnable (1 << 5) |
1029 | #define PM3FillConfig2D_ForegroundROPEnable 1<<6 | 1003 | #define PM3FillConfig2D_ForegroundROPEnable (1 << 6) |
1030 | #define PM3FillConfig2D_ForegroundROP(rop) (((rop)&0xf)<<7) | 1004 | #define PM3FillConfig2D_ForegroundROP(rop) (((rop) & 0xf) << 7) |
1031 | #define PM3FillConfig2D_BackgroundROPEnable 1<<11 | 1005 | #define PM3FillConfig2D_BackgroundROPEnable (1 << 11) |
1032 | #define PM3FillConfig2D_BackgroundROP(rop) (((rop)&0xf)<<12) | 1006 | #define PM3FillConfig2D_BackgroundROP(rop) (((rop) & 0xf) << 12) |
1033 | #define PM3FillConfig2D_UseConstantSource 1<<16 | 1007 | #define PM3FillConfig2D_UseConstantSource (1 << 16) |
1034 | #define PM3FillConfig2D_FBWriteEnable 1<<17 | 1008 | #define PM3FillConfig2D_FBWriteEnable (1 << 17) |
1035 | #define PM3FillConfig2D_Blocking 1<<18 | 1009 | #define PM3FillConfig2D_Blocking (1 << 18) |
1036 | #define PM3FillConfig2D_ExternalSourceData 1<<19 | 1010 | #define PM3FillConfig2D_ExternalSourceData (1 << 19) |
1037 | #define PM3FillConfig2D_LUTModeEnable 1<<20 | 1011 | #define PM3FillConfig2D_LUTModeEnable (1 << 20) |
1038 | #define PM3FillFBDestReadBufferAddr 0x8310 | 1012 | #define PM3FillFBDestReadBufferAddr 0x8310 |
1039 | #define PM3FillFBSourceReadBufferAddr 0x8308 | 1013 | #define PM3FillFBSourceReadBufferAddr 0x8308 |
1040 | #define PM3FillFBSourceReadBufferOffset 0x8340 | 1014 | #define PM3FillFBSourceReadBufferOffset 0x8340 |
1041 | #define PM3FillFBSourceReadBufferOffset_XOffset(x) ((x)&0xffff) | 1015 | #define PM3FillFBSourceReadBufferOffset_XOffset(x) ((x) & 0xffff) |
1042 | #define PM3FillFBSourceReadBufferOffset_YOffset(y) (((y)&0xffff)<<16) | 1016 | #define PM3FillFBSourceReadBufferOffset_YOffset(y) \ |
1043 | #define PM3FillFBWriteBufferAddr 0x8300 | 1017 | (((y) & 0xffff) << 16) |
1044 | #define PM3FillForegroundColor0 0x8328 | 1018 | #define PM3FillFBWriteBufferAddr 0x8300 |
1045 | #define PM3FillForegroundColor1 0x8358 | 1019 | #define PM3FillForegroundColor0 0x8328 |
1046 | #define PM3FillGlyphPosition 0x8368 | 1020 | #define PM3FillForegroundColor1 0x8358 |
1047 | #define PM3FillGlyphPosition_XOffset(x) ((x)&0xffff) | 1021 | #define PM3FillGlyphPosition 0x8368 |
1048 | #define PM3FillGlyphPosition_YOffset(y) (((y)&0xffff)<<16) | 1022 | #define PM3FillGlyphPosition_XOffset(x) ((x) & 0xffff) |
1049 | #define PM3FillRectanglePosition 0x8348 | 1023 | #define PM3FillGlyphPosition_YOffset(y) (((y) & 0xffff) << 16) |
1050 | #define PM3FillRectanglePosition_XOffset(x) ((x)&0xffff) | 1024 | #define PM3FillRectanglePosition 0x8348 |
1051 | #define PM3FillRectanglePosition_YOffset(y) (((y)&0xffff)<<16) | 1025 | #define PM3FillRectanglePosition_XOffset(x) ((x) & 0xffff) |
1026 | #define PM3FillRectanglePosition_YOffset(y) (((y) & 0xffff) << 16) | ||
1052 | 1027 | ||
1053 | #define PM3_REGS_SIZE 0x10000 | ||
1054 | #define PM3_MAX_PIXCLOCK 300000 | ||
1055 | /* a few more useful registers & regs value... */ | 1028 | /* a few more useful registers & regs value... */ |
1056 | #define PM3Sync 0x8c40 | 1029 | #define PM3Sync 0x8c40 |
1057 | #define PM3Sync_Tag 0x188 | 1030 | #define PM3Sync_Tag 0x188 |
1058 | #define PM3FilterMode 0x8c00 | 1031 | #define PM3FilterMode 0x8c00 |
1059 | #define PM3FilterModeSync 0x400 | 1032 | #define PM3FilterModeSync 0x400 |
1060 | #define PM3OutputFifo 0x2000 | 1033 | #define PM3OutputFifo 0x2000 |
1061 | #define PM3StatisticMode 0x8c08 | 1034 | #define PM3StatisticMode 0x8c08 |
1062 | #define PM3AreaStippleMode 0x81a0 | 1035 | #define PM3AreaStippleMode 0x81a0 |
1063 | #define AreaStipplePattern0 (0x8200) | 1036 | #define AreaStipplePattern_indexed(i) (0x8200 + ((i) * 0x8)) |
1064 | #define AreaStipplePattern1 (0x8208) | ||
1065 | #define AreaStipplePattern2 (0x8210) | ||
1066 | #define AreaStipplePattern3 (0x8218) | ||
1067 | #define AreaStipplePattern4 (0x8220) | ||
1068 | #define AreaStipplePattern5 (0x8228) | ||
1069 | #define AreaStipplePattern6 (0x8230) | ||
1070 | #define AreaStipplePattern7 (0x8238) | ||
1071 | #define AreaStipplePattern8 (0x8240) | ||
1072 | #define AreaStipplePattern9 (0x8248) | ||
1073 | #define AreaStipplePattern10 (0x8250) | ||
1074 | #define AreaStipplePattern11 (0x8258) | ||
1075 | #define AreaStipplePattern12 (0x8260) | ||
1076 | #define AreaStipplePattern13 (0x8268) | ||
1077 | #define AreaStipplePattern14 (0x8270) | ||
1078 | #define AreaStipplePattern15 (0x8278) | ||
1079 | #define AreaStipplePattern16 (0x8280) | ||
1080 | #define AreaStipplePattern17 (0x8288) | ||
1081 | #define AreaStipplePattern18 (0x8290) | ||
1082 | #define AreaStipplePattern19 (0x8298) | ||
1083 | #define AreaStipplePattern20 (0x82a0) | ||
1084 | #define AreaStipplePattern21 (0x82a8) | ||
1085 | #define AreaStipplePattern22 (0x82b0) | ||
1086 | #define AreaStipplePattern23 (0x82b8) | ||
1087 | #define AreaStipplePattern24 (0x82c0) | ||
1088 | #define AreaStipplePattern25 (0x82c8) | ||
1089 | #define AreaStipplePattern26 (0x82d0) | ||
1090 | #define AreaStipplePattern27 (0x82d8) | ||
1091 | #define AreaStipplePattern28 (0x82eo) | ||
1092 | #define AreaStipplePattern29 (0x82e8) | ||
1093 | #define AreaStipplePattern30 (0x82f0) | ||
1094 | #define AreaStipplePattern31 (0x82f8) | ||
1095 | #define AreaStipplePattern_indexed(i) (0x8200 + ((i) * 0x8)) | ||
1096 | 1037 | ||
1097 | #define PM3DepthMode 0x89a0 | 1038 | #define PM3DepthMode 0x89a0 |
1098 | #define PM3StencilMode 0x8988 | 1039 | #define PM3StencilMode 0x8988 |
1099 | #define PM3StencilData 0x8990 | 1040 | #define PM3StencilData 0x8990 |
1100 | #define PM3TextureReadMode 0x8670 | 1041 | #define PM3TextureReadMode 0x8670 |
1101 | #define PM3FogMode 0x8690 | 1042 | #define PM3FogMode 0x8690 |
1102 | #define PM3ChromaTestMode 0x8f18 | 1043 | #define PM3ChromaTestMode 0x8f18 |
1103 | #define PM3YUVMode 0x8f00 | 1044 | #define PM3YUVMode 0x8f00 |
1104 | #define PM3BitMaskPattern 0x8068 | 1045 | #define PM3BitMaskPattern 0x8068 |
1105 | 1046 | ||
1106 | /* ***************************** */ | 1047 | /* ***************************** */ |
1107 | /* ***** pm3fb IOCTL const ***** */ | 1048 | /* ***** pm3fb IOCTL const ***** */ |
1108 | /* ***************************** */ | 1049 | /* ***************************** */ |
1109 | /* debug-only IOCTL */ | 1050 | #define PM3FBIO_RESETCHIP 0x504D33FF /* 'PM3\377' */ |
1110 | #define PM3FBIO_CLEARMEMORY 0x504D3300 /* 'PM3\000' */ | ||
1111 | #define PM3FBIO_CLEARCMAP 0x504D3301 /* 'PM3\001' */ | ||
1112 | /* common use IOCTL */ | ||
1113 | #define PM3FBIO_RESETCHIP 0x504D33FF /* 'PM3\377' */ | ||
1114 | 1051 | ||
1115 | /* ***************************************** */ | 1052 | /* ***************************************** */ |
1116 | /* ***** pm3fb useful define and macro ***** */ | 1053 | /* ***** pm3fb useful define and macro ***** */ |
1117 | /* ***************************************** */ | 1054 | /* ***************************************** */ |
1118 | 1055 | ||
1119 | /* max size of options */ | 1056 | /* fifo size in chip */ |
1120 | #define PM3_OPTIONS_SIZE 256 | 1057 | #define PM3_FIFO_SIZE 120 |
1121 | 1058 | #define PM3_REGS_SIZE 0x10000 | |
1122 | /* max size of font name */ | 1059 | #define PM3_MAX_PIXCLOCK 300000 |
1123 | #define PM3_FONTNAME_SIZE 40 | ||
1124 | 1060 | ||
1125 | #endif /* PM3FB_H */ | 1061 | #endif /* PM3FB_H */ |
diff --git a/include/video/tdfx.h b/include/video/tdfx.h index c1cc94ba3fdd..05b63c2a5abc 100644 --- a/include/video/tdfx.h +++ b/include/video/tdfx.h | |||
@@ -2,140 +2,140 @@ | |||
2 | #define _TDFX_H | 2 | #define _TDFX_H |
3 | 3 | ||
4 | /* membase0 register offsets */ | 4 | /* membase0 register offsets */ |
5 | #define STATUS 0x00 | 5 | #define STATUS 0x00 |
6 | #define PCIINIT0 0x04 | 6 | #define PCIINIT0 0x04 |
7 | #define SIPMONITOR 0x08 | 7 | #define SIPMONITOR 0x08 |
8 | #define LFBMEMORYCONFIG 0x0c | 8 | #define LFBMEMORYCONFIG 0x0c |
9 | #define MISCINIT0 0x10 | 9 | #define MISCINIT0 0x10 |
10 | #define MISCINIT1 0x14 | 10 | #define MISCINIT1 0x14 |
11 | #define DRAMINIT0 0x18 | 11 | #define DRAMINIT0 0x18 |
12 | #define DRAMINIT1 0x1c | 12 | #define DRAMINIT1 0x1c |
13 | #define AGPINIT 0x20 | 13 | #define AGPINIT 0x20 |
14 | #define TMUGBEINIT 0x24 | 14 | #define TMUGBEINIT 0x24 |
15 | #define VGAINIT0 0x28 | 15 | #define VGAINIT0 0x28 |
16 | #define VGAINIT1 0x2c | 16 | #define VGAINIT1 0x2c |
17 | #define DRAMCOMMAND 0x30 | 17 | #define DRAMCOMMAND 0x30 |
18 | #define DRAMDATA 0x34 | 18 | #define DRAMDATA 0x34 |
19 | /* reserved 0x38 */ | 19 | /* reserved 0x38 */ |
20 | /* reserved 0x3c */ | 20 | /* reserved 0x3c */ |
21 | #define PLLCTRL0 0x40 | 21 | #define PLLCTRL0 0x40 |
22 | #define PLLCTRL1 0x44 | 22 | #define PLLCTRL1 0x44 |
23 | #define PLLCTRL2 0x48 | 23 | #define PLLCTRL2 0x48 |
24 | #define DACMODE 0x4c | 24 | #define DACMODE 0x4c |
25 | #define DACADDR 0x50 | 25 | #define DACADDR 0x50 |
26 | #define DACDATA 0x54 | 26 | #define DACDATA 0x54 |
27 | #define RGBMAXDELTA 0x58 | 27 | #define RGBMAXDELTA 0x58 |
28 | #define VIDPROCCFG 0x5c | 28 | #define VIDPROCCFG 0x5c |
29 | #define HWCURPATADDR 0x60 | 29 | #define HWCURPATADDR 0x60 |
30 | #define HWCURLOC 0x64 | 30 | #define HWCURLOC 0x64 |
31 | #define HWCURC0 0x68 | 31 | #define HWCURC0 0x68 |
32 | #define HWCURC1 0x6c | 32 | #define HWCURC1 0x6c |
33 | #define VIDINFORMAT 0x70 | 33 | #define VIDINFORMAT 0x70 |
34 | #define VIDINSTATUS 0x74 | 34 | #define VIDINSTATUS 0x74 |
35 | #define VIDSERPARPORT 0x78 | 35 | #define VIDSERPARPORT 0x78 |
36 | #define VIDINXDELTA 0x7c | 36 | #define VIDINXDELTA 0x7c |
37 | #define VIDININITERR 0x80 | 37 | #define VIDININITERR 0x80 |
38 | #define VIDINYDELTA 0x84 | 38 | #define VIDINYDELTA 0x84 |
39 | #define VIDPIXBUFTHOLD 0x88 | 39 | #define VIDPIXBUFTHOLD 0x88 |
40 | #define VIDCHRMIN 0x8c | 40 | #define VIDCHRMIN 0x8c |
41 | #define VIDCHRMAX 0x90 | 41 | #define VIDCHRMAX 0x90 |
42 | #define VIDCURLIN 0x94 | 42 | #define VIDCURLIN 0x94 |
43 | #define VIDSCREENSIZE 0x98 | 43 | #define VIDSCREENSIZE 0x98 |
44 | #define VIDOVRSTARTCRD 0x9c | 44 | #define VIDOVRSTARTCRD 0x9c |
45 | #define VIDOVRENDCRD 0xa0 | 45 | #define VIDOVRENDCRD 0xa0 |
46 | #define VIDOVRDUDX 0xa4 | 46 | #define VIDOVRDUDX 0xa4 |
47 | #define VIDOVRDUDXOFF 0xa8 | 47 | #define VIDOVRDUDXOFF 0xa8 |
48 | #define VIDOVRDVDY 0xac | 48 | #define VIDOVRDVDY 0xac |
49 | /* ... */ | 49 | /* ... */ |
50 | #define VIDOVRDVDYOFF 0xe0 | 50 | #define VIDOVRDVDYOFF 0xe0 |
51 | #define VIDDESKSTART 0xe4 | 51 | #define VIDDESKSTART 0xe4 |
52 | #define VIDDESKSTRIDE 0xe8 | 52 | #define VIDDESKSTRIDE 0xe8 |
53 | #define VIDINADDR0 0xec | 53 | #define VIDINADDR0 0xec |
54 | #define VIDINADDR1 0xf0 | 54 | #define VIDINADDR1 0xf0 |
55 | #define VIDINADDR2 0xf4 | 55 | #define VIDINADDR2 0xf4 |
56 | #define VIDINSTRIDE 0xf8 | 56 | #define VIDINSTRIDE 0xf8 |
57 | #define VIDCUROVRSTART 0xfc | 57 | #define VIDCUROVRSTART 0xfc |
58 | 58 | ||
59 | #define INTCTRL (0x00100000 + 0x04) | 59 | #define INTCTRL (0x00100000 + 0x04) |
60 | #define CLIP0MIN (0x00100000 + 0x08) | 60 | #define CLIP0MIN (0x00100000 + 0x08) |
61 | #define CLIP0MAX (0x00100000 + 0x0c) | 61 | #define CLIP0MAX (0x00100000 + 0x0c) |
62 | #define DSTBASE (0x00100000 + 0x10) | 62 | #define DSTBASE (0x00100000 + 0x10) |
63 | #define DSTFORMAT (0x00100000 + 0x14) | 63 | #define DSTFORMAT (0x00100000 + 0x14) |
64 | #define SRCBASE (0x00100000 + 0x34) | 64 | #define SRCBASE (0x00100000 + 0x34) |
65 | #define COMMANDEXTRA_2D (0x00100000 + 0x38) | 65 | #define COMMANDEXTRA_2D (0x00100000 + 0x38) |
66 | #define CLIP1MIN (0x00100000 + 0x4c) | 66 | #define CLIP1MIN (0x00100000 + 0x4c) |
67 | #define CLIP1MAX (0x00100000 + 0x50) | 67 | #define CLIP1MAX (0x00100000 + 0x50) |
68 | #define SRCFORMAT (0x00100000 + 0x54) | 68 | #define SRCFORMAT (0x00100000 + 0x54) |
69 | #define SRCSIZE (0x00100000 + 0x58) | 69 | #define SRCSIZE (0x00100000 + 0x58) |
70 | #define SRCXY (0x00100000 + 0x5c) | 70 | #define SRCXY (0x00100000 + 0x5c) |
71 | #define COLORBACK (0x00100000 + 0x60) | 71 | #define COLORBACK (0x00100000 + 0x60) |
72 | #define COLORFORE (0x00100000 + 0x64) | 72 | #define COLORFORE (0x00100000 + 0x64) |
73 | #define DSTSIZE (0x00100000 + 0x68) | 73 | #define DSTSIZE (0x00100000 + 0x68) |
74 | #define DSTXY (0x00100000 + 0x6c) | 74 | #define DSTXY (0x00100000 + 0x6c) |
75 | #define COMMAND_2D (0x00100000 + 0x70) | 75 | #define COMMAND_2D (0x00100000 + 0x70) |
76 | #define LAUNCH_2D (0x00100000 + 0x80) | 76 | #define LAUNCH_2D (0x00100000 + 0x80) |
77 | 77 | ||
78 | #define COMMAND_3D (0x00200000 + 0x120) | 78 | #define COMMAND_3D (0x00200000 + 0x120) |
79 | 79 | ||
80 | /* register bitfields (not all, only as needed) */ | 80 | /* register bitfields (not all, only as needed) */ |
81 | 81 | ||
82 | #define BIT(x) (1UL << (x)) | 82 | #define BIT(x) (1UL << (x)) |
83 | 83 | ||
84 | /* COMMAND_2D reg. values */ | 84 | /* COMMAND_2D reg. values */ |
85 | #define TDFX_ROP_COPY 0xcc // src | 85 | #define TDFX_ROP_COPY 0xcc /* src */ |
86 | #define TDFX_ROP_INVERT 0x55 // NOT dst | 86 | #define TDFX_ROP_INVERT 0x55 /* NOT dst */ |
87 | #define TDFX_ROP_XOR 0x66 // src XOR dst | 87 | #define TDFX_ROP_XOR 0x66 /* src XOR dst */ |
88 | 88 | ||
89 | #define AUTOINC_DSTX BIT(10) | 89 | #define AUTOINC_DSTX BIT(10) |
90 | #define AUTOINC_DSTY BIT(11) | 90 | #define AUTOINC_DSTY BIT(11) |
91 | #define COMMAND_2D_FILLRECT 0x05 | 91 | #define COMMAND_2D_FILLRECT 0x05 |
92 | #define COMMAND_2D_S2S_BITBLT 0x01 // screen to screen | 92 | #define COMMAND_2D_S2S_BITBLT 0x01 /* screen to screen */ |
93 | #define COMMAND_2D_H2S_BITBLT 0x03 // host to screen | 93 | #define COMMAND_2D_H2S_BITBLT 0x03 /* host to screen */ |
94 | 94 | ||
95 | #define COMMAND_3D_NOP 0x00 | 95 | #define COMMAND_3D_NOP 0x00 |
96 | #define STATUS_RETRACE BIT(6) | 96 | #define STATUS_RETRACE BIT(6) |
97 | #define STATUS_BUSY BIT(9) | 97 | #define STATUS_BUSY BIT(9) |
98 | #define MISCINIT1_CLUT_INV BIT(0) | 98 | #define MISCINIT1_CLUT_INV BIT(0) |
99 | #define MISCINIT1_2DBLOCK_DIS BIT(15) | 99 | #define MISCINIT1_2DBLOCK_DIS BIT(15) |
100 | #define DRAMINIT0_SGRAM_NUM BIT(26) | 100 | #define DRAMINIT0_SGRAM_NUM BIT(26) |
101 | #define DRAMINIT0_SGRAM_TYPE BIT(27) | 101 | #define DRAMINIT0_SGRAM_TYPE BIT(27) |
102 | #define DRAMINIT0_SGRAM_TYPE_MASK (BIT(27)|BIT(28)|BIT(29)) | 102 | #define DRAMINIT0_SGRAM_TYPE_MASK (BIT(27) | BIT(28) | BIT(29)) |
103 | #define DRAMINIT0_SGRAM_TYPE_SHIFT 27 | 103 | #define DRAMINIT0_SGRAM_TYPE_SHIFT 27 |
104 | #define DRAMINIT1_MEM_SDRAM BIT(30) | 104 | #define DRAMINIT1_MEM_SDRAM BIT(30) |
105 | #define VGAINIT0_VGA_DISABLE BIT(0) | 105 | #define VGAINIT0_VGA_DISABLE BIT(0) |
106 | #define VGAINIT0_EXT_TIMING BIT(1) | 106 | #define VGAINIT0_EXT_TIMING BIT(1) |
107 | #define VGAINIT0_8BIT_DAC BIT(2) | 107 | #define VGAINIT0_8BIT_DAC BIT(2) |
108 | #define VGAINIT0_EXT_ENABLE BIT(6) | 108 | #define VGAINIT0_EXT_ENABLE BIT(6) |
109 | #define VGAINIT0_WAKEUP_3C3 BIT(8) | 109 | #define VGAINIT0_WAKEUP_3C3 BIT(8) |
110 | #define VGAINIT0_LEGACY_DISABLE BIT(9) | 110 | #define VGAINIT0_LEGACY_DISABLE BIT(9) |
111 | #define VGAINIT0_ALT_READBACK BIT(10) | 111 | #define VGAINIT0_ALT_READBACK BIT(10) |
112 | #define VGAINIT0_FAST_BLINK BIT(11) | 112 | #define VGAINIT0_FAST_BLINK BIT(11) |
113 | #define VGAINIT0_EXTSHIFTOUT BIT(12) | 113 | #define VGAINIT0_EXTSHIFTOUT BIT(12) |
114 | #define VGAINIT0_DECODE_3C6 BIT(13) | 114 | #define VGAINIT0_DECODE_3C6 BIT(13) |
115 | #define VGAINIT0_SGRAM_HBLANK_DISABLE BIT(22) | 115 | #define VGAINIT0_SGRAM_HBLANK_DISABLE BIT(22) |
116 | #define VGAINIT1_MASK 0x1fffff | 116 | #define VGAINIT1_MASK 0x1fffff |
117 | #define VIDCFG_VIDPROC_ENABLE BIT(0) | 117 | #define VIDCFG_VIDPROC_ENABLE BIT(0) |
118 | #define VIDCFG_CURS_X11 BIT(1) | 118 | #define VIDCFG_CURS_X11 BIT(1) |
119 | #define VIDCFG_INTERLACE BIT(3) | 119 | #define VIDCFG_INTERLACE BIT(3) |
120 | #define VIDCFG_HALF_MODE BIT(4) | 120 | #define VIDCFG_HALF_MODE BIT(4) |
121 | #define VIDCFG_DESK_ENABLE BIT(7) | 121 | #define VIDCFG_DESK_ENABLE BIT(7) |
122 | #define VIDCFG_CLUT_BYPASS BIT(10) | 122 | #define VIDCFG_CLUT_BYPASS BIT(10) |
123 | #define VIDCFG_2X BIT(26) | 123 | #define VIDCFG_2X BIT(26) |
124 | #define VIDCFG_HWCURSOR_ENABLE BIT(27) | 124 | #define VIDCFG_HWCURSOR_ENABLE BIT(27) |
125 | #define VIDCFG_PIXFMT_SHIFT 18 | 125 | #define VIDCFG_PIXFMT_SHIFT 18 |
126 | #define DACMODE_2X BIT(0) | 126 | #define DACMODE_2X BIT(0) |
127 | 127 | ||
128 | /* VGA rubbish, need to change this for multihead support */ | 128 | /* VGA rubbish, need to change this for multihead support */ |
129 | #define MISC_W 0x3c2 | 129 | #define MISC_W 0x3c2 |
130 | #define MISC_R 0x3cc | 130 | #define MISC_R 0x3cc |
131 | #define SEQ_I 0x3c4 | 131 | #define SEQ_I 0x3c4 |
132 | #define SEQ_D 0x3c5 | 132 | #define SEQ_D 0x3c5 |
133 | #define CRT_I 0x3d4 | 133 | #define CRT_I 0x3d4 |
134 | #define CRT_D 0x3d5 | 134 | #define CRT_D 0x3d5 |
135 | #define ATT_IW 0x3c0 | 135 | #define ATT_IW 0x3c0 |
136 | #define IS1_R 0x3da | 136 | #define IS1_R 0x3da |
137 | #define GRA_I 0x3ce | 137 | #define GRA_I 0x3ce |
138 | #define GRA_D 0x3cf | 138 | #define GRA_D 0x3cf |
139 | 139 | ||
140 | #ifdef __KERNEL__ | 140 | #ifdef __KERNEL__ |
141 | 141 | ||
@@ -143,9 +143,9 @@ struct banshee_reg { | |||
143 | /* VGA rubbish */ | 143 | /* VGA rubbish */ |
144 | unsigned char att[21]; | 144 | unsigned char att[21]; |
145 | unsigned char crt[25]; | 145 | unsigned char crt[25]; |
146 | unsigned char gra[ 9]; | 146 | unsigned char gra[9]; |
147 | unsigned char misc[1]; | 147 | unsigned char misc[1]; |
148 | unsigned char seq[ 5]; | 148 | unsigned char seq[5]; |
149 | 149 | ||
150 | /* Banshee extensions */ | 150 | /* Banshee extensions */ |
151 | unsigned char ext[2]; | 151 | unsigned char ext[2]; |
@@ -167,8 +167,6 @@ struct banshee_reg { | |||
167 | unsigned long clip0max; | 167 | unsigned long clip0max; |
168 | unsigned long clip1min; | 168 | unsigned long clip1min; |
169 | unsigned long clip1max; | 169 | unsigned long clip1max; |
170 | unsigned long srcbase; | ||
171 | unsigned long dstbase; | ||
172 | unsigned long miscinit0; | 170 | unsigned long miscinit0; |
173 | }; | 171 | }; |
174 | 172 | ||
@@ -177,18 +175,10 @@ struct tdfx_par { | |||
177 | u32 palette[16]; | 175 | u32 palette[16]; |
178 | void __iomem *regbase_virt; | 176 | void __iomem *regbase_virt; |
179 | unsigned long iobase; | 177 | unsigned long iobase; |
180 | u32 baseline; | 178 | int mtrr_handle; |
181 | |||
182 | struct { | ||
183 | int w,u,d; | ||
184 | unsigned long enable,disable; | ||
185 | struct timer_list timer; | ||
186 | } hwcursor; | ||
187 | |||
188 | spinlock_t DAClock; | ||
189 | }; | 179 | }; |
190 | 180 | ||
191 | #endif /* __KERNEL__ */ | 181 | #endif /* __KERNEL__ */ |
192 | 182 | ||
193 | #endif /* _TDFX_H */ | 183 | #endif /* _TDFX_H */ |
194 | 184 | ||
diff --git a/include/video/uvesafb.h b/include/video/uvesafb.h new file mode 100644 index 000000000000..95bcef193954 --- /dev/null +++ b/include/video/uvesafb.h | |||
@@ -0,0 +1,193 @@ | |||
1 | #ifndef _UVESAFB_H | ||
2 | #define _UVESAFB_H | ||
3 | |||
4 | struct v86_regs { | ||
5 | __u32 ebx; | ||
6 | __u32 ecx; | ||
7 | __u32 edx; | ||
8 | __u32 esi; | ||
9 | __u32 edi; | ||
10 | __u32 ebp; | ||
11 | __u32 eax; | ||
12 | __u32 eip; | ||
13 | __u32 eflags; | ||
14 | __u32 esp; | ||
15 | __u16 cs; | ||
16 | __u16 ss; | ||
17 | __u16 es; | ||
18 | __u16 ds; | ||
19 | __u16 fs; | ||
20 | __u16 gs; | ||
21 | }; | ||
22 | |||
23 | /* Task flags */ | ||
24 | #define TF_VBEIB 0x01 | ||
25 | #define TF_BUF_ESDI 0x02 | ||
26 | #define TF_BUF_ESBX 0x04 | ||
27 | #define TF_BUF_RET 0x08 | ||
28 | #define TF_EXIT 0x10 | ||
29 | |||
30 | struct uvesafb_task { | ||
31 | __u8 flags; | ||
32 | int buf_len; | ||
33 | struct v86_regs regs; | ||
34 | }; | ||
35 | |||
36 | /* Constants for the capabilities field | ||
37 | * in vbe_ib */ | ||
38 | #define VBE_CAP_CAN_SWITCH_DAC 0x01 | ||
39 | #define VBE_CAP_VGACOMPAT 0x02 | ||
40 | |||
41 | /* The VBE Info Block */ | ||
42 | struct vbe_ib { | ||
43 | char vbe_signature[4]; | ||
44 | __u16 vbe_version; | ||
45 | __u32 oem_string_ptr; | ||
46 | __u32 capabilities; | ||
47 | __u32 mode_list_ptr; | ||
48 | __u16 total_memory; | ||
49 | __u16 oem_software_rev; | ||
50 | __u32 oem_vendor_name_ptr; | ||
51 | __u32 oem_product_name_ptr; | ||
52 | __u32 oem_product_rev_ptr; | ||
53 | __u8 reserved[222]; | ||
54 | char oem_data[256]; | ||
55 | char misc_data[512]; | ||
56 | } __attribute__ ((packed)); | ||
57 | |||
58 | #ifdef __KERNEL__ | ||
59 | |||
60 | /* VBE CRTC Info Block */ | ||
61 | struct vbe_crtc_ib { | ||
62 | u16 horiz_total; | ||
63 | u16 horiz_start; | ||
64 | u16 horiz_end; | ||
65 | u16 vert_total; | ||
66 | u16 vert_start; | ||
67 | u16 vert_end; | ||
68 | u8 flags; | ||
69 | u32 pixel_clock; | ||
70 | u16 refresh_rate; | ||
71 | u8 reserved[40]; | ||
72 | } __attribute__ ((packed)); | ||
73 | |||
74 | #define VBE_MODE_VGACOMPAT 0x20 | ||
75 | #define VBE_MODE_COLOR 0x08 | ||
76 | #define VBE_MODE_SUPPORTEDHW 0x01 | ||
77 | #define VBE_MODE_GRAPHICS 0x10 | ||
78 | #define VBE_MODE_LFB 0x80 | ||
79 | |||
80 | #define VBE_MODE_MASK (VBE_MODE_COLOR | VBE_MODE_SUPPORTEDHW | \ | ||
81 | VBE_MODE_GRAPHICS | VBE_MODE_LFB) | ||
82 | |||
83 | /* VBE Mode Info Block */ | ||
84 | struct vbe_mode_ib { | ||
85 | /* for all VBE revisions */ | ||
86 | u16 mode_attr; | ||
87 | u8 winA_attr; | ||
88 | u8 winB_attr; | ||
89 | u16 win_granularity; | ||
90 | u16 win_size; | ||
91 | u16 winA_seg; | ||
92 | u16 winB_seg; | ||
93 | u32 win_func_ptr; | ||
94 | u16 bytes_per_scan_line; | ||
95 | |||
96 | /* for VBE 1.2+ */ | ||
97 | u16 x_res; | ||
98 | u16 y_res; | ||
99 | u8 x_char_size; | ||
100 | u8 y_char_size; | ||
101 | u8 planes; | ||
102 | u8 bits_per_pixel; | ||
103 | u8 banks; | ||
104 | u8 memory_model; | ||
105 | u8 bank_size; | ||
106 | u8 image_pages; | ||
107 | u8 reserved1; | ||
108 | |||
109 | /* Direct color fields for direct/6 and YUV/7 memory models. */ | ||
110 | /* Offsets are bit positions of lsb in the mask. */ | ||
111 | u8 red_len; | ||
112 | u8 red_off; | ||
113 | u8 green_len; | ||
114 | u8 green_off; | ||
115 | u8 blue_len; | ||
116 | u8 blue_off; | ||
117 | u8 rsvd_len; | ||
118 | u8 rsvd_off; | ||
119 | u8 direct_color_info; /* direct color mode attributes */ | ||
120 | |||
121 | /* for VBE 2.0+ */ | ||
122 | u32 phys_base_ptr; | ||
123 | u8 reserved2[6]; | ||
124 | |||
125 | /* for VBE 3.0+ */ | ||
126 | u16 lin_bytes_per_scan_line; | ||
127 | u8 bnk_image_pages; | ||
128 | u8 lin_image_pages; | ||
129 | u8 lin_red_len; | ||
130 | u8 lin_red_off; | ||
131 | u8 lin_green_len; | ||
132 | u8 lin_green_off; | ||
133 | u8 lin_blue_len; | ||
134 | u8 lin_blue_off; | ||
135 | u8 lin_rsvd_len; | ||
136 | u8 lin_rsvd_off; | ||
137 | u32 max_pixel_clock; | ||
138 | u16 mode_id; | ||
139 | u8 depth; | ||
140 | } __attribute__ ((packed)); | ||
141 | |||
142 | #define UVESAFB_DEFAULT_MODE "640x480-16" | ||
143 | |||
144 | /* How long to wait for a reply from userspace [ms] */ | ||
145 | #define UVESAFB_TIMEOUT 5000 | ||
146 | |||
147 | /* Max number of concurrent tasks */ | ||
148 | #define UVESAFB_TASKS_MAX 16 | ||
149 | |||
150 | #define dac_reg (0x3c8) | ||
151 | #define dac_val (0x3c9) | ||
152 | |||
153 | struct uvesafb_pal_entry { | ||
154 | u_char blue, green, red, pad; | ||
155 | } __attribute__ ((packed)); | ||
156 | |||
157 | struct uvesafb_ktask { | ||
158 | struct uvesafb_task t; | ||
159 | void *buf; | ||
160 | struct completion *done; | ||
161 | u32 ack; | ||
162 | }; | ||
163 | |||
164 | static int uvesafb_exec(struct uvesafb_ktask *tsk); | ||
165 | |||
166 | #define UVESAFB_EXACT_RES 1 | ||
167 | #define UVESAFB_EXACT_DEPTH 2 | ||
168 | |||
169 | struct uvesafb_par { | ||
170 | struct vbe_ib vbe_ib; /* VBE Info Block */ | ||
171 | struct vbe_mode_ib *vbe_modes; /* list of supported VBE modes */ | ||
172 | int vbe_modes_cnt; | ||
173 | |||
174 | u8 nocrtc; | ||
175 | u8 ypan; /* 0 - nothing, 1 - ypan, 2 - ywrap */ | ||
176 | u8 pmi_setpal; /* PMI for palette changes */ | ||
177 | u16 *pmi_base; /* protected mode interface location */ | ||
178 | void *pmi_start; | ||
179 | void *pmi_pal; | ||
180 | u8 *vbe_state_orig; /* | ||
181 | * original hardware state, before the | ||
182 | * driver was loaded | ||
183 | */ | ||
184 | u8 *vbe_state_saved; /* state saved by fb_save_state */ | ||
185 | int vbe_state_size; | ||
186 | atomic_t ref_count; | ||
187 | |||
188 | int mode_idx; | ||
189 | struct vbe_crtc_ib crtc; | ||
190 | }; | ||
191 | |||
192 | #endif /* __KERNEL__ */ | ||
193 | #endif /* _UVESAFB_H */ | ||