diff options
Diffstat (limited to 'include')
78 files changed, 901 insertions, 782 deletions
diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h index e177d4180f83..21816d35ef89 100644 --- a/include/asm-alpha/floppy.h +++ b/include/asm-alpha/floppy.h | |||
@@ -25,9 +25,8 @@ | |||
25 | #define fd_enable_irq() enable_irq(FLOPPY_IRQ) | 25 | #define fd_enable_irq() enable_irq(FLOPPY_IRQ) |
26 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) | 26 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) |
27 | #define fd_cacheflush(addr,size) /* nothing */ | 27 | #define fd_cacheflush(addr,size) /* nothing */ |
28 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ | 28 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\ |
29 | SA_INTERRUPT|SA_SAMPLE_RANDOM, \ | 29 | SA_INTERRUPT, "floppy", NULL) |
30 | "floppy", NULL) | ||
31 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); | 30 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); |
32 | 31 | ||
33 | #ifdef CONFIG_PCI | 32 | #ifdef CONFIG_PCI |
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h index 6ea657c886b9..aa0c8d28d8d9 100644 --- a/include/asm-arm/floppy.h +++ b/include/asm-arm/floppy.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #define fd_inb(port) inb((port)) | 26 | #define fd_inb(port) inb((port)) |
27 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ | 27 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ |
28 | SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL) | 28 | SA_INTERRUPT,"floppy",NULL) |
29 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) | 29 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) |
30 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) | 30 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) |
31 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) | 31 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) |
diff --git a/include/asm-arm26/floppy.h b/include/asm-arm26/floppy.h index 9e090ad7e477..a18af069ca28 100644 --- a/include/asm-arm26/floppy.h +++ b/include/asm-arm26/floppy.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #define fd_inb(port) inb((port)) | 23 | #define fd_inb(port) inb((port)) |
24 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ | 24 | #define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ |
25 | SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL) | 25 | SA_INTERRUPT,"floppy",NULL) |
26 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) | 26 | #define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) |
27 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) | 27 | #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) |
28 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) | 28 | #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 0cd9711895fa..845cb67ad8ea 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -38,4 +38,17 @@ | |||
38 | #endif | 38 | #endif |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #define WARN_ON_ONCE(condition) \ | ||
42 | ({ \ | ||
43 | static int __warn_once = 1; \ | ||
44 | int __ret = 0; \ | ||
45 | \ | ||
46 | if (unlikely((condition) && __warn_once)) { \ | ||
47 | __warn_once = 0; \ | ||
48 | WARN_ON(1); \ | ||
49 | __ret = 1; \ | ||
50 | } \ | ||
51 | __ret; \ | ||
52 | }) | ||
53 | |||
41 | #endif | 54 | #endif |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index c0caf433a7d7..c74521157461 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -14,6 +14,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
14 | /* var is in discarded region: offset to particular copy we want */ | 14 | /* var is in discarded region: offset to particular copy we want */ |
15 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) | 15 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) |
16 | #define __get_cpu_var(var) per_cpu(var, smp_processor_id()) | 16 | #define __get_cpu_var(var) per_cpu(var, smp_processor_id()) |
17 | #define __raw_get_cpu_var(var) per_cpu(var, raw_smp_processor_id()) | ||
17 | 18 | ||
18 | /* A macro to avoid #include hell... */ | 19 | /* A macro to avoid #include hell... */ |
19 | #define percpu_modcopy(pcpudst, src, size) \ | 20 | #define percpu_modcopy(pcpudst, src, size) \ |
@@ -30,6 +31,7 @@ do { \ | |||
30 | 31 | ||
31 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) | 32 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) |
32 | #define __get_cpu_var(var) per_cpu__##var | 33 | #define __get_cpu_var(var) per_cpu__##var |
34 | #define __raw_get_cpu_var(var) per_cpu__##var | ||
33 | 35 | ||
34 | #endif /* SMP */ | 36 | #endif /* SMP */ |
35 | 37 | ||
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index 03403045c182..9cb2793eb211 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h | |||
@@ -147,9 +147,8 @@ static int fd_request_irq(void) | |||
147 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 147 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, |
148 | "floppy", NULL); | 148 | "floppy", NULL); |
149 | else | 149 | else |
150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, |
151 | SA_INTERRUPT|SA_SAMPLE_RANDOM, | 151 | "floppy", NULL); |
152 | "floppy", NULL); | ||
153 | 152 | ||
154 | } | 153 | } |
155 | 154 | ||
diff --git a/include/asm-i386/mach-default/setup_arch_pre.h b/include/asm-i386/mach-default/setup_arch.h index fb42099e7bd4..fb42099e7bd4 100644 --- a/include/asm-i386/mach-default/setup_arch_pre.h +++ b/include/asm-i386/mach-default/setup_arch.h | |||
diff --git a/include/asm-i386/mach-default/setup_arch_post.h b/include/asm-i386/mach-default/setup_arch_post.h deleted file mode 100644 index 2fc4888721f6..000000000000 --- a/include/asm-i386/mach-default/setup_arch_post.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /** | ||
2 | * machine_specific_memory_setup - Hook for machine specific memory setup. | ||
3 | * | ||
4 | * Description: | ||
5 | * This is included late in kernel/setup.c so that it can make | ||
6 | * use of all of the static functions. | ||
7 | **/ | ||
8 | |||
9 | static char * __init machine_specific_memory_setup(void) | ||
10 | { | ||
11 | char *who; | ||
12 | |||
13 | |||
14 | who = "BIOS-e820"; | ||
15 | |||
16 | /* | ||
17 | * Try to copy the BIOS-supplied E820-map. | ||
18 | * | ||
19 | * Otherwise fake a memory map; one section from 0k->640k, | ||
20 | * the next section from 1mb->appropriate_mem_k | ||
21 | */ | ||
22 | sanitize_e820_map(E820_MAP, &E820_MAP_NR); | ||
23 | if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) { | ||
24 | unsigned long mem_size; | ||
25 | |||
26 | /* compare results from other methods and take the greater */ | ||
27 | if (ALT_MEM_K < EXT_MEM_K) { | ||
28 | mem_size = EXT_MEM_K; | ||
29 | who = "BIOS-88"; | ||
30 | } else { | ||
31 | mem_size = ALT_MEM_K; | ||
32 | who = "BIOS-e801"; | ||
33 | } | ||
34 | |||
35 | e820.nr_map = 0; | ||
36 | add_memory_region(0, LOWMEMSIZE(), E820_RAM); | ||
37 | add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM); | ||
38 | } | ||
39 | return who; | ||
40 | } | ||
diff --git a/include/asm-i386/mach-visws/setup_arch_pre.h b/include/asm-i386/mach-visws/setup_arch.h index b92d6d9a4d3c..b92d6d9a4d3c 100644 --- a/include/asm-i386/mach-visws/setup_arch_pre.h +++ b/include/asm-i386/mach-visws/setup_arch.h | |||
diff --git a/include/asm-i386/mach-visws/setup_arch_post.h b/include/asm-i386/mach-visws/setup_arch_post.h deleted file mode 100644 index cdbd895a54b1..000000000000 --- a/include/asm-i386/mach-visws/setup_arch_post.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* Hook for machine specific memory setup. | ||
2 | * | ||
3 | * This is included late in kernel/setup.c so that it can make use of all of | ||
4 | * the static functions. */ | ||
5 | |||
6 | #define MB (1024 * 1024) | ||
7 | |||
8 | unsigned long sgivwfb_mem_phys; | ||
9 | unsigned long sgivwfb_mem_size; | ||
10 | |||
11 | long long mem_size __initdata = 0; | ||
12 | |||
13 | static char * __init machine_specific_memory_setup(void) | ||
14 | { | ||
15 | long long gfx_mem_size = 8 * MB; | ||
16 | |||
17 | mem_size = ALT_MEM_K; | ||
18 | |||
19 | if (!mem_size) { | ||
20 | printk(KERN_WARNING "Bootloader didn't set memory size, upgrade it !\n"); | ||
21 | mem_size = 128 * MB; | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * this hardcodes the graphics memory to 8 MB | ||
26 | * it really should be sized dynamically (or at least | ||
27 | * set as a boot param) | ||
28 | */ | ||
29 | if (!sgivwfb_mem_size) { | ||
30 | printk(KERN_WARNING "Defaulting to 8 MB framebuffer size\n"); | ||
31 | sgivwfb_mem_size = 8 * MB; | ||
32 | } | ||
33 | |||
34 | /* | ||
35 | * Trim to nearest MB | ||
36 | */ | ||
37 | sgivwfb_mem_size &= ~((1 << 20) - 1); | ||
38 | sgivwfb_mem_phys = mem_size - gfx_mem_size; | ||
39 | |||
40 | add_memory_region(0, LOWMEMSIZE(), E820_RAM); | ||
41 | add_memory_region(HIGH_MEMORY, mem_size - sgivwfb_mem_size - HIGH_MEMORY, E820_RAM); | ||
42 | add_memory_region(sgivwfb_mem_phys, sgivwfb_mem_size, E820_RESERVED); | ||
43 | |||
44 | return "PROM"; | ||
45 | |||
46 | /* Remove gcc warnings */ | ||
47 | (void) sanitize_e820_map(NULL, NULL); | ||
48 | (void) copy_e820_map(NULL, 0); | ||
49 | } | ||
diff --git a/include/asm-i386/mach-voyager/setup_arch_pre.h b/include/asm-i386/mach-voyager/setup_arch.h index 48f7e6ff49a5..84d01ad33459 100644 --- a/include/asm-i386/mach-voyager/setup_arch_pre.h +++ b/include/asm-i386/mach-voyager/setup_arch.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | /* Hook to call BIOS initialisation function */ | 4 | /* Hook to call BIOS initialisation function */ |
5 | 5 | ||
6 | /* for voyager, pass the voyager BIOS/SUS info area to the detection | 6 | /* for voyager, pass the voyager BIOS/SUS info area to the detection |
7 | * routines */ | 7 | * routines */ |
8 | 8 | ||
9 | #define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); | 9 | #define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); |
diff --git a/include/asm-i386/mach-voyager/setup_arch_post.h b/include/asm-i386/mach-voyager/setup_arch_post.h deleted file mode 100644 index f6f6c2cbc75c..000000000000 --- a/include/asm-i386/mach-voyager/setup_arch_post.h +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | /* Hook for machine specific memory setup. | ||
2 | * | ||
3 | * This is included late in kernel/setup.c so that it can make use of all of | ||
4 | * the static functions. */ | ||
5 | |||
6 | static char * __init machine_specific_memory_setup(void) | ||
7 | { | ||
8 | char *who; | ||
9 | |||
10 | who = "NOT VOYAGER"; | ||
11 | |||
12 | if(voyager_level == 5) { | ||
13 | __u32 addr, length; | ||
14 | int i; | ||
15 | |||
16 | who = "Voyager-SUS"; | ||
17 | |||
18 | e820.nr_map = 0; | ||
19 | for(i=0; voyager_memory_detect(i, &addr, &length); i++) { | ||
20 | add_memory_region(addr, length, E820_RAM); | ||
21 | } | ||
22 | return who; | ||
23 | } else if(voyager_level == 4) { | ||
24 | __u32 tom; | ||
25 | __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT)<<8; | ||
26 | /* select the DINO config space */ | ||
27 | outb(VOYAGER_DINO, VOYAGER_CAT_CONFIG_PORT); | ||
28 | /* Read DINO top of memory register */ | ||
29 | tom = ((inb(catbase + 0x4) & 0xf0) << 16) | ||
30 | + ((inb(catbase + 0x5) & 0x7f) << 24); | ||
31 | |||
32 | if(inb(catbase) != VOYAGER_DINO) { | ||
33 | printk(KERN_ERR "Voyager: Failed to get DINO for L4, setting tom to EXT_MEM_K\n"); | ||
34 | tom = (EXT_MEM_K)<<10; | ||
35 | } | ||
36 | who = "Voyager-TOM"; | ||
37 | add_memory_region(0, 0x9f000, E820_RAM); | ||
38 | /* map from 1M to top of memory */ | ||
39 | add_memory_region(1*1024*1024, tom - 1*1024*1024, E820_RAM); | ||
40 | /* FIXME: Should check the ASICs to see if I need to | ||
41 | * take out the 8M window. Just do it at the moment | ||
42 | * */ | ||
43 | add_memory_region(8*1024*1024, 8*1024*1024, E820_RESERVED); | ||
44 | return who; | ||
45 | } | ||
46 | |||
47 | who = "BIOS-e820"; | ||
48 | |||
49 | /* | ||
50 | * Try to copy the BIOS-supplied E820-map. | ||
51 | * | ||
52 | * Otherwise fake a memory map; one section from 0k->640k, | ||
53 | * the next section from 1mb->appropriate_mem_k | ||
54 | */ | ||
55 | sanitize_e820_map(E820_MAP, &E820_MAP_NR); | ||
56 | if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) { | ||
57 | unsigned long mem_size; | ||
58 | |||
59 | /* compare results from other methods and take the greater */ | ||
60 | if (ALT_MEM_K < EXT_MEM_K) { | ||
61 | mem_size = EXT_MEM_K; | ||
62 | who = "BIOS-88"; | ||
63 | } else { | ||
64 | mem_size = ALT_MEM_K; | ||
65 | who = "BIOS-e801"; | ||
66 | } | ||
67 | |||
68 | e820.nr_map = 0; | ||
69 | add_memory_region(0, LOWMEMSIZE(), E820_RAM); | ||
70 | add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM); | ||
71 | } | ||
72 | return who; | ||
73 | } | ||
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h index ee941457b55d..f737e423029e 100644 --- a/include/asm-i386/setup.h +++ b/include/asm-i386/setup.h | |||
@@ -59,6 +59,21 @@ extern unsigned char boot_params[PARAM_SIZE]; | |||
59 | #define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) | 59 | #define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) |
60 | #define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) | 60 | #define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) |
61 | 61 | ||
62 | /* | ||
63 | * Do NOT EVER look at the BIOS memory size location. | ||
64 | * It does not work on many machines. | ||
65 | */ | ||
66 | #define LOWMEMSIZE() (0x9f000) | ||
67 | |||
68 | struct e820entry; | ||
69 | |||
70 | char * __init machine_specific_memory_setup(void); | ||
71 | |||
72 | int __init copy_e820_map(struct e820entry * biosmap, int nr_map); | ||
73 | int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map); | ||
74 | void __init add_memory_region(unsigned long long start, | ||
75 | unsigned long long size, int type); | ||
76 | |||
62 | #endif /* __ASSEMBLY__ */ | 77 | #endif /* __ASSEMBLY__ */ |
63 | 78 | ||
64 | #endif /* _i386_SETUP_H */ | 79 | #endif /* _i386_SETUP_H */ |
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h index 8462f8e0e658..54d905ebc63d 100644 --- a/include/asm-i386/uaccess.h +++ b/include/asm-i386/uaccess.h | |||
@@ -390,8 +390,12 @@ unsigned long __must_check __copy_to_user_ll(void __user *to, | |||
390 | const void *from, unsigned long n); | 390 | const void *from, unsigned long n); |
391 | unsigned long __must_check __copy_from_user_ll(void *to, | 391 | unsigned long __must_check __copy_from_user_ll(void *to, |
392 | const void __user *from, unsigned long n); | 392 | const void __user *from, unsigned long n); |
393 | unsigned long __must_check __copy_from_user_ll_nozero(void *to, | ||
394 | const void __user *from, unsigned long n); | ||
393 | unsigned long __must_check __copy_from_user_ll_nocache(void *to, | 395 | unsigned long __must_check __copy_from_user_ll_nocache(void *to, |
394 | const void __user *from, unsigned long n); | 396 | const void __user *from, unsigned long n); |
397 | unsigned long __must_check __copy_from_user_ll_nocache_nozero(void *to, | ||
398 | const void __user *from, unsigned long n); | ||
395 | 399 | ||
396 | /* | 400 | /* |
397 | * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault | 401 | * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault |
@@ -458,10 +462,41 @@ __copy_to_user(void __user *to, const void *from, unsigned long n) | |||
458 | * | 462 | * |
459 | * If some data could not be copied, this function will pad the copied | 463 | * If some data could not be copied, this function will pad the copied |
460 | * data to the requested size using zero bytes. | 464 | * data to the requested size using zero bytes. |
465 | * | ||
466 | * An alternate version - __copy_from_user_inatomic() - may be called from | ||
467 | * atomic context and will fail rather than sleep. In this case the | ||
468 | * uncopied bytes will *NOT* be padded with zeros. See fs/filemap.h | ||
469 | * for explanation of why this is needed. | ||
461 | */ | 470 | */ |
462 | static __always_inline unsigned long | 471 | static __always_inline unsigned long |
463 | __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) | 472 | __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) |
464 | { | 473 | { |
474 | /* Avoid zeroing the tail if the copy fails.. | ||
475 | * If 'n' is constant and 1, 2, or 4, we do still zero on a failure, | ||
476 | * but as the zeroing behaviour is only significant when n is not | ||
477 | * constant, that shouldn't be a problem. | ||
478 | */ | ||
479 | if (__builtin_constant_p(n)) { | ||
480 | unsigned long ret; | ||
481 | |||
482 | switch (n) { | ||
483 | case 1: | ||
484 | __get_user_size(*(u8 *)to, from, 1, ret, 1); | ||
485 | return ret; | ||
486 | case 2: | ||
487 | __get_user_size(*(u16 *)to, from, 2, ret, 2); | ||
488 | return ret; | ||
489 | case 4: | ||
490 | __get_user_size(*(u32 *)to, from, 4, ret, 4); | ||
491 | return ret; | ||
492 | } | ||
493 | } | ||
494 | return __copy_from_user_ll_nozero(to, from, n); | ||
495 | } | ||
496 | static __always_inline unsigned long | ||
497 | __copy_from_user(void *to, const void __user *from, unsigned long n) | ||
498 | { | ||
499 | might_sleep(); | ||
465 | if (__builtin_constant_p(n)) { | 500 | if (__builtin_constant_p(n)) { |
466 | unsigned long ret; | 501 | unsigned long ret; |
467 | 502 | ||
@@ -482,9 +517,10 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) | |||
482 | 517 | ||
483 | #define ARCH_HAS_NOCACHE_UACCESS | 518 | #define ARCH_HAS_NOCACHE_UACCESS |
484 | 519 | ||
485 | static __always_inline unsigned long __copy_from_user_inatomic_nocache(void *to, | 520 | static __always_inline unsigned long __copy_from_user_nocache(void *to, |
486 | const void __user *from, unsigned long n) | 521 | const void __user *from, unsigned long n) |
487 | { | 522 | { |
523 | might_sleep(); | ||
488 | if (__builtin_constant_p(n)) { | 524 | if (__builtin_constant_p(n)) { |
489 | unsigned long ret; | 525 | unsigned long ret; |
490 | 526 | ||
@@ -504,17 +540,9 @@ static __always_inline unsigned long __copy_from_user_inatomic_nocache(void *to, | |||
504 | } | 540 | } |
505 | 541 | ||
506 | static __always_inline unsigned long | 542 | static __always_inline unsigned long |
507 | __copy_from_user(void *to, const void __user *from, unsigned long n) | 543 | __copy_from_user_inatomic_nocache(void *to, const void __user *from, unsigned long n) |
508 | { | 544 | { |
509 | might_sleep(); | 545 | return __copy_from_user_ll_nocache_nozero(to, from, n); |
510 | return __copy_from_user_inatomic(to, from, n); | ||
511 | } | ||
512 | |||
513 | static __always_inline unsigned long | ||
514 | __copy_from_user_nocache(void *to, const void __user *from, unsigned long n) | ||
515 | { | ||
516 | might_sleep(); | ||
517 | return __copy_from_user_inatomic_nocache(to, from, n); | ||
518 | } | 546 | } |
519 | 547 | ||
520 | unsigned long __must_check copy_to_user(void __user *to, | 548 | unsigned long __must_check copy_to_user(void __user *to, |
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h index ae357d504fba..24d898b650c5 100644 --- a/include/asm-ia64/percpu.h +++ b/include/asm-ia64/percpu.h | |||
@@ -42,6 +42,7 @@ DECLARE_PER_CPU(unsigned long, local_per_cpu_offset); | |||
42 | 42 | ||
43 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) | 43 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) |
44 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) | 44 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) |
45 | #define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) | ||
45 | 46 | ||
46 | extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size); | 47 | extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size); |
47 | extern void setup_per_cpu_areas (void); | 48 | extern void setup_per_cpu_areas (void); |
@@ -51,6 +52,7 @@ extern void *per_cpu_init(void); | |||
51 | 52 | ||
52 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) | 53 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) |
53 | #define __get_cpu_var(var) per_cpu__##var | 54 | #define __get_cpu_var(var) per_cpu__##var |
55 | #define __raw_get_cpu_var(var) per_cpu__##var | ||
54 | #define per_cpu_init() (__phys_per_cpu_start) | 56 | #define per_cpu_init() (__phys_per_cpu_start) |
55 | 57 | ||
56 | #endif /* SMP */ | 58 | #endif /* SMP */ |
diff --git a/include/asm-m68k/amigaints.h b/include/asm-m68k/amigaints.h index aa968d014bb6..7c8713468fd2 100644 --- a/include/asm-m68k/amigaints.h +++ b/include/asm-m68k/amigaints.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef _ASMm68k_AMIGAINTS_H_ | 13 | #ifndef _ASMm68k_AMIGAINTS_H_ |
14 | #define _ASMm68k_AMIGAINTS_H_ | 14 | #define _ASMm68k_AMIGAINTS_H_ |
15 | 15 | ||
16 | #include <asm/irq.h> | ||
17 | |||
16 | /* | 18 | /* |
17 | ** Amiga Interrupt sources. | 19 | ** Amiga Interrupt sources. |
18 | ** | 20 | ** |
@@ -23,72 +25,52 @@ | |||
23 | #define CIA_IRQS (5) | 25 | #define CIA_IRQS (5) |
24 | #define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */ | 26 | #define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */ |
25 | 27 | ||
26 | /* vertical blanking interrupt */ | 28 | /* builtin serial port interrupts */ |
27 | #define IRQ_AMIGA_VERTB 0 | 29 | #define IRQ_AMIGA_TBE (IRQ_USER+0) |
30 | #define IRQ_AMIGA_RBF (IRQ_USER+11) | ||
28 | 31 | ||
29 | /* copper interrupt */ | 32 | /* floppy disk interrupts */ |
30 | #define IRQ_AMIGA_COPPER 1 | 33 | #define IRQ_AMIGA_DSKBLK (IRQ_USER+1) |
34 | #define IRQ_AMIGA_DSKSYN (IRQ_USER+12) | ||
31 | 35 | ||
32 | /* Audio interrupts */ | 36 | /* software interrupts */ |
33 | #define IRQ_AMIGA_AUD0 2 | 37 | #define IRQ_AMIGA_SOFT (IRQ_USER+2) |
34 | #define IRQ_AMIGA_AUD1 3 | ||
35 | #define IRQ_AMIGA_AUD2 4 | ||
36 | #define IRQ_AMIGA_AUD3 5 | ||
37 | 38 | ||
38 | /* Blitter done interrupt */ | 39 | /* interrupts from external hardware */ |
39 | #define IRQ_AMIGA_BLIT 6 | 40 | #define IRQ_AMIGA_PORTS IRQ_AUTO_2 |
41 | #define IRQ_AMIGA_EXTER IRQ_AUTO_6 | ||
40 | 42 | ||
41 | /* floppy disk interrupts */ | 43 | /* copper interrupt */ |
42 | #define IRQ_AMIGA_DSKSYN 7 | 44 | #define IRQ_AMIGA_COPPER (IRQ_USER+4) |
43 | #define IRQ_AMIGA_DSKBLK 8 | ||
44 | 45 | ||
45 | /* builtin serial port interrupts */ | 46 | /* vertical blanking interrupt */ |
46 | #define IRQ_AMIGA_RBF 9 | 47 | #define IRQ_AMIGA_VERTB (IRQ_USER+5) |
47 | #define IRQ_AMIGA_TBE 10 | ||
48 | 48 | ||
49 | /* software interrupts */ | 49 | /* Blitter done interrupt */ |
50 | #define IRQ_AMIGA_SOFT 11 | 50 | #define IRQ_AMIGA_BLIT (IRQ_USER+6) |
51 | 51 | ||
52 | /* interrupts from external hardware */ | 52 | /* Audio interrupts */ |
53 | #define IRQ_AMIGA_PORTS 12 | 53 | #define IRQ_AMIGA_AUD0 (IRQ_USER+7) |
54 | #define IRQ_AMIGA_EXTER 13 | 54 | #define IRQ_AMIGA_AUD1 (IRQ_USER+8) |
55 | #define IRQ_AMIGA_AUD2 (IRQ_USER+9) | ||
56 | #define IRQ_AMIGA_AUD3 (IRQ_USER+10) | ||
55 | 57 | ||
56 | /* CIA interrupt sources */ | 58 | /* CIA interrupt sources */ |
57 | #define IRQ_AMIGA_CIAA 14 | 59 | #define IRQ_AMIGA_CIAA (IRQ_USER+14) |
58 | #define IRQ_AMIGA_CIAA_TA 14 | 60 | #define IRQ_AMIGA_CIAA_TA (IRQ_USER+14) |
59 | #define IRQ_AMIGA_CIAA_TB 15 | 61 | #define IRQ_AMIGA_CIAA_TB (IRQ_USER+15) |
60 | #define IRQ_AMIGA_CIAA_ALRM 16 | 62 | #define IRQ_AMIGA_CIAA_ALRM (IRQ_USER+16) |
61 | #define IRQ_AMIGA_CIAA_SP 17 | 63 | #define IRQ_AMIGA_CIAA_SP (IRQ_USER+17) |
62 | #define IRQ_AMIGA_CIAA_FLG 18 | 64 | #define IRQ_AMIGA_CIAA_FLG (IRQ_USER+18) |
63 | #define IRQ_AMIGA_CIAB 19 | 65 | #define IRQ_AMIGA_CIAB (IRQ_USER+19) |
64 | #define IRQ_AMIGA_CIAB_TA 19 | 66 | #define IRQ_AMIGA_CIAB_TA (IRQ_USER+19) |
65 | #define IRQ_AMIGA_CIAB_TB 20 | 67 | #define IRQ_AMIGA_CIAB_TB (IRQ_USER+20) |
66 | #define IRQ_AMIGA_CIAB_ALRM 21 | 68 | #define IRQ_AMIGA_CIAB_ALRM (IRQ_USER+21) |
67 | #define IRQ_AMIGA_CIAB_SP 22 | 69 | #define IRQ_AMIGA_CIAB_SP (IRQ_USER+22) |
68 | #define IRQ_AMIGA_CIAB_FLG 23 | 70 | #define IRQ_AMIGA_CIAB_FLG (IRQ_USER+23) |
69 | |||
70 | /* auto-vector interrupts */ | ||
71 | #define IRQ_AMIGA_AUTO 24 | ||
72 | #define IRQ_AMIGA_AUTO_0 24 /* This is just a dummy */ | ||
73 | #define IRQ_AMIGA_AUTO_1 25 | ||
74 | #define IRQ_AMIGA_AUTO_2 26 | ||
75 | #define IRQ_AMIGA_AUTO_3 27 | ||
76 | #define IRQ_AMIGA_AUTO_4 28 | ||
77 | #define IRQ_AMIGA_AUTO_5 29 | ||
78 | #define IRQ_AMIGA_AUTO_6 30 | ||
79 | #define IRQ_AMIGA_AUTO_7 31 | ||
80 | |||
81 | #define IRQ_FLOPPY IRQ_AMIGA_DSKBLK | ||
82 | 71 | ||
83 | /* INTREQR masks */ | ||
84 | #define IRQ1_MASK 0x0007 /* INTREQR mask for IRQ 1 */ | ||
85 | #define IRQ2_MASK 0x0008 /* INTREQR mask for IRQ 2 */ | ||
86 | #define IRQ3_MASK 0x0070 /* INTREQR mask for IRQ 3 */ | ||
87 | #define IRQ4_MASK 0x0780 /* INTREQR mask for IRQ 4 */ | ||
88 | #define IRQ5_MASK 0x1800 /* INTREQR mask for IRQ 5 */ | ||
89 | #define IRQ6_MASK 0x2000 /* INTREQR mask for IRQ 6 */ | ||
90 | #define IRQ7_MASK 0x4000 /* INTREQR mask for IRQ 7 */ | ||
91 | 72 | ||
73 | /* INTREQR masks */ | ||
92 | #define IF_SETCLR 0x8000 /* set/clr bit */ | 74 | #define IF_SETCLR 0x8000 /* set/clr bit */ |
93 | #define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */ | 75 | #define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */ |
94 | #define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */ | 76 | #define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */ |
@@ -106,9 +88,6 @@ | |||
106 | #define IF_DSKBLK 0x0002 /* diskblock DMA finished */ | 88 | #define IF_DSKBLK 0x0002 /* diskblock DMA finished */ |
107 | #define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */ | 89 | #define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */ |
108 | 90 | ||
109 | extern void amiga_do_irq(int irq, struct pt_regs *fp); | ||
110 | extern void amiga_do_irq_list(int irq, struct pt_regs *fp); | ||
111 | |||
112 | /* CIA interrupt control register bits */ | 91 | /* CIA interrupt control register bits */ |
113 | 92 | ||
114 | #define CIA_ICR_TA 0x01 | 93 | #define CIA_ICR_TA 0x01 |
@@ -125,6 +104,7 @@ extern void amiga_do_irq_list(int irq, struct pt_regs *fp); | |||
125 | 104 | ||
126 | extern struct ciabase ciaa_base, ciab_base; | 105 | extern struct ciabase ciaa_base, ciab_base; |
127 | 106 | ||
107 | extern void cia_init_IRQ(struct ciabase *base); | ||
128 | extern unsigned char cia_set_irq(struct ciabase *base, unsigned char mask); | 108 | extern unsigned char cia_set_irq(struct ciabase *base, unsigned char mask); |
129 | extern unsigned char cia_able_irq(struct ciabase *base, unsigned char mask); | 109 | extern unsigned char cia_able_irq(struct ciabase *base, unsigned char mask); |
130 | 110 | ||
diff --git a/include/asm-m68k/apollohw.h b/include/asm-m68k/apollohw.h index 4304e1c33e17..a1373b9aa281 100644 --- a/include/asm-m68k/apollohw.h +++ b/include/asm-m68k/apollohw.h | |||
@@ -3,6 +3,8 @@ | |||
3 | #ifndef _ASMm68k_APOLLOHW_H_ | 3 | #ifndef _ASMm68k_APOLLOHW_H_ |
4 | #define _ASMm68k_APOLLOHW_H_ | 4 | #define _ASMm68k_APOLLOHW_H_ |
5 | 5 | ||
6 | #include <linux/types.h> | ||
7 | |||
6 | /* | 8 | /* |
7 | apollo models | 9 | apollo models |
8 | */ | 10 | */ |
@@ -101,4 +103,6 @@ extern u_long timer_physaddr; | |||
101 | 103 | ||
102 | #define isaIO2mem(x) (((((x) & 0x3f8) << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE) | 104 | #define isaIO2mem(x) (((((x) & 0x3f8) << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE) |
103 | 105 | ||
106 | #define IRQ_APOLLO IRQ_USER | ||
107 | |||
104 | #endif | 108 | #endif |
diff --git a/include/asm-m68k/atari_stdma.h b/include/asm-m68k/atari_stdma.h index 64f92880ce43..b4eadf852738 100644 --- a/include/asm-m68k/atari_stdma.h +++ b/include/asm-m68k/atari_stdma.h | |||
@@ -3,7 +3,7 @@ | |||
3 | #define _atari_stdma_h | 3 | #define _atari_stdma_h |
4 | 4 | ||
5 | 5 | ||
6 | #include <asm/irq.h> | 6 | #include <linux/interrupt.h> |
7 | 7 | ||
8 | 8 | ||
9 | /***************************** Prototypes *****************************/ | 9 | /***************************** Prototypes *****************************/ |
diff --git a/include/asm-m68k/atariints.h b/include/asm-m68k/atariints.h index 42952c890593..0ed454fc24bb 100644 --- a/include/asm-m68k/atariints.h +++ b/include/asm-m68k/atariints.h | |||
@@ -45,17 +45,6 @@ | |||
45 | #define IRQ_TYPE_FAST 1 | 45 | #define IRQ_TYPE_FAST 1 |
46 | #define IRQ_TYPE_PRIO 2 | 46 | #define IRQ_TYPE_PRIO 2 |
47 | 47 | ||
48 | #define IRQ_SPURIOUS (0) | ||
49 | |||
50 | /* auto-vector interrupts */ | ||
51 | #define IRQ_AUTO_1 (1) | ||
52 | #define IRQ_AUTO_2 (2) | ||
53 | #define IRQ_AUTO_3 (3) | ||
54 | #define IRQ_AUTO_4 (4) | ||
55 | #define IRQ_AUTO_5 (5) | ||
56 | #define IRQ_AUTO_6 (6) | ||
57 | #define IRQ_AUTO_7 (7) | ||
58 | |||
59 | /* ST-MFP interrupts */ | 48 | /* ST-MFP interrupts */ |
60 | #define IRQ_MFP_BUSY (8) | 49 | #define IRQ_MFP_BUSY (8) |
61 | #define IRQ_MFP_DCD (9) | 50 | #define IRQ_MFP_DCD (9) |
diff --git a/include/asm-m68k/bvme6000hw.h b/include/asm-m68k/bvme6000hw.h index 28a859b03959..f40d2f8510ee 100644 --- a/include/asm-m68k/bvme6000hw.h +++ b/include/asm-m68k/bvme6000hw.h | |||
@@ -109,23 +109,23 @@ typedef struct { | |||
109 | 109 | ||
110 | #define BVME_IRQ_TYPE_PRIO 0 | 110 | #define BVME_IRQ_TYPE_PRIO 0 |
111 | 111 | ||
112 | #define BVME_IRQ_PRN 0x54 | 112 | #define BVME_IRQ_PRN (IRQ_USER+20) |
113 | #define BVME_IRQ_I596 0x1a | 113 | #define BVME_IRQ_TIMER (IRQ_USER+25) |
114 | #define BVME_IRQ_SCSI 0x1b | 114 | #define BVME_IRQ_I596 IRQ_AUTO_2 |
115 | #define BVME_IRQ_TIMER 0x59 | 115 | #define BVME_IRQ_SCSI IRQ_AUTO_3 |
116 | #define BVME_IRQ_RTC 0x1e | 116 | #define BVME_IRQ_RTC IRQ_AUTO_6 |
117 | #define BVME_IRQ_ABORT 0x1f | 117 | #define BVME_IRQ_ABORT IRQ_AUTO_7 |
118 | 118 | ||
119 | /* SCC interrupts */ | 119 | /* SCC interrupts */ |
120 | #define BVME_IRQ_SCC_BASE 0x40 | 120 | #define BVME_IRQ_SCC_BASE IRQ_USER |
121 | #define BVME_IRQ_SCCB_TX 0x40 | 121 | #define BVME_IRQ_SCCB_TX IRQ_USER |
122 | #define BVME_IRQ_SCCB_STAT 0x42 | 122 | #define BVME_IRQ_SCCB_STAT (IRQ_USER+2) |
123 | #define BVME_IRQ_SCCB_RX 0x44 | 123 | #define BVME_IRQ_SCCB_RX (IRQ_USER+4) |
124 | #define BVME_IRQ_SCCB_SPCOND 0x46 | 124 | #define BVME_IRQ_SCCB_SPCOND (IRQ_USER+6) |
125 | #define BVME_IRQ_SCCA_TX 0x48 | 125 | #define BVME_IRQ_SCCA_TX (IRQ_USER+8) |
126 | #define BVME_IRQ_SCCA_STAT 0x4a | 126 | #define BVME_IRQ_SCCA_STAT (IRQ_USER+10) |
127 | #define BVME_IRQ_SCCA_RX 0x4c | 127 | #define BVME_IRQ_SCCA_RX (IRQ_USER+12) |
128 | #define BVME_IRQ_SCCA_SPCOND 0x4e | 128 | #define BVME_IRQ_SCCA_SPCOND (IRQ_USER+14) |
129 | 129 | ||
130 | /* Address control registers */ | 130 | /* Address control registers */ |
131 | 131 | ||
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h index 8aba971b1368..24d3ff449135 100644 --- a/include/asm-m68k/cacheflush.h +++ b/include/asm-m68k/cacheflush.h | |||
@@ -3,26 +3,30 @@ | |||
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | 5 | ||
6 | /* cache code */ | ||
7 | #define FLUSH_I_AND_D (0x00000808) | ||
8 | #define FLUSH_I (0x00000008) | ||
9 | |||
6 | /* | 10 | /* |
7 | * Cache handling functions | 11 | * Cache handling functions |
8 | */ | 12 | */ |
9 | 13 | ||
10 | #define flush_icache() \ | 14 | static inline void flush_icache(void) |
11 | ({ \ | 15 | { |
12 | if (CPU_IS_040_OR_060) \ | 16 | if (CPU_IS_040_OR_060) |
13 | __asm__ __volatile__("nop\n\t" \ | 17 | asm volatile ( "nop\n" |
14 | ".chip 68040\n\t" \ | 18 | " .chip 68040\n" |
15 | "cinva %%ic\n\t" \ | 19 | " cpusha %bc\n" |
16 | ".chip 68k" : ); \ | 20 | " .chip 68k"); |
17 | else { \ | 21 | else { |
18 | unsigned long _tmp; \ | 22 | unsigned long tmp; |
19 | __asm__ __volatile__("movec %%cacr,%0\n\t" \ | 23 | asm volatile ( "movec %%cacr,%0\n" |
20 | "orw %1,%0\n\t" \ | 24 | " or.w %1,%0\n" |
21 | "movec %0,%%cacr" \ | 25 | " movec %0,%%cacr" |
22 | : "=&d" (_tmp) \ | 26 | : "=&d" (tmp) |
23 | : "id" (FLUSH_I)); \ | 27 | : "id" (FLUSH_I)); |
24 | } \ | 28 | } |
25 | }) | 29 | } |
26 | 30 | ||
27 | /* | 31 | /* |
28 | * invalidate the cache for the specified memory range. | 32 | * invalidate the cache for the specified memory range. |
@@ -43,10 +47,6 @@ extern void cache_push(unsigned long paddr, int len); | |||
43 | */ | 47 | */ |
44 | extern void cache_push_v(unsigned long vaddr, int len); | 48 | extern void cache_push_v(unsigned long vaddr, int len); |
45 | 49 | ||
46 | /* cache code */ | ||
47 | #define FLUSH_I_AND_D (0x00000808) | ||
48 | #define FLUSH_I (0x00000008) | ||
49 | |||
50 | /* This is needed whenever the virtual mapping of the current | 50 | /* This is needed whenever the virtual mapping of the current |
51 | process changes. */ | 51 | process changes. */ |
52 | #define __flush_cache_all() \ | 52 | #define __flush_cache_all() \ |
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h index dffd59cf1364..cebbb03370ec 100644 --- a/include/asm-m68k/dma-mapping.h +++ b/include/asm-m68k/dma-mapping.h | |||
@@ -1,11 +1,91 @@ | |||
1 | #ifndef _M68K_DMA_MAPPING_H | 1 | #ifndef _M68K_DMA_MAPPING_H |
2 | #define _M68K_DMA_MAPPING_H | 2 | #define _M68K_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <asm/cache.h> | ||
4 | 5 | ||
5 | #ifdef CONFIG_PCI | 6 | struct scatterlist; |
6 | #include <asm-generic/dma-mapping.h> | 7 | |
7 | #else | 8 | static inline int dma_supported(struct device *dev, u64 mask) |
8 | #include <asm-generic/dma-mapping-broken.h> | 9 | { |
9 | #endif | 10 | return 1; |
11 | } | ||
12 | |||
13 | static inline int dma_set_mask(struct device *dev, u64 mask) | ||
14 | { | ||
15 | return 0; | ||
16 | } | ||
17 | |||
18 | static inline int dma_get_cache_alignment(void) | ||
19 | { | ||
20 | return 1 << L1_CACHE_SHIFT; | ||
21 | } | ||
22 | |||
23 | static inline int dma_is_consistent(dma_addr_t dma_addr) | ||
24 | { | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | extern void *dma_alloc_coherent(struct device *, size_t, | ||
29 | dma_addr_t *, int); | ||
30 | extern void dma_free_coherent(struct device *, size_t, | ||
31 | void *, dma_addr_t); | ||
32 | |||
33 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, | ||
34 | dma_addr_t *handle, int flag) | ||
35 | { | ||
36 | return dma_alloc_coherent(dev, size, handle, flag); | ||
37 | } | ||
38 | static inline void dma_free_noncoherent(struct device *dev, size_t size, | ||
39 | void *addr, dma_addr_t handle) | ||
40 | { | ||
41 | dma_free_coherent(dev, size, addr, handle); | ||
42 | } | ||
43 | static inline void dma_cache_sync(void *vaddr, size_t size, | ||
44 | enum dma_data_direction dir) | ||
45 | { | ||
46 | /* we use coherent allocation, so not much to do here. */ | ||
47 | } | ||
48 | |||
49 | extern dma_addr_t dma_map_single(struct device *, void *, size_t, | ||
50 | enum dma_data_direction); | ||
51 | static inline void dma_unmap_single(struct device *dev, dma_addr_t addr, | ||
52 | size_t size, enum dma_data_direction dir) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | extern dma_addr_t dma_map_page(struct device *, struct page *, | ||
57 | unsigned long, size_t size, | ||
58 | enum dma_data_direction); | ||
59 | static inline void dma_unmap_page(struct device *dev, dma_addr_t address, | ||
60 | size_t size, enum dma_data_direction dir) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | extern int dma_map_sg(struct device *, struct scatterlist *, int, | ||
65 | enum dma_data_direction); | ||
66 | static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
67 | int nhwentries, enum dma_data_direction dir) | ||
68 | { | ||
69 | } | ||
70 | |||
71 | extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t, | ||
72 | enum dma_data_direction); | ||
73 | extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int, | ||
74 | enum dma_data_direction); | ||
75 | |||
76 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, | ||
77 | size_t size, enum dma_data_direction dir) | ||
78 | { | ||
79 | } | ||
80 | |||
81 | static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | ||
82 | int nents, enum dma_data_direction dir) | ||
83 | { | ||
84 | } | ||
85 | |||
86 | static inline int dma_mapping_error(dma_addr_t handle) | ||
87 | { | ||
88 | return 0; | ||
89 | } | ||
10 | 90 | ||
11 | #endif /* _M68K_DMA_MAPPING_H */ | 91 | #endif /* _M68K_DMA_MAPPING_H */ |
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 9727ca9d9f26..f4ae7d8feac6 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h | |||
@@ -1,13 +1,9 @@ | |||
1 | #ifndef _M68K_IRQ_H_ | 1 | #ifndef _M68K_IRQ_H_ |
2 | #define _M68K_IRQ_H_ | 2 | #define _M68K_IRQ_H_ |
3 | 3 | ||
4 | #include <linux/interrupt.h> | 4 | #include <linux/linkage.h> |
5 | 5 | #include <linux/hardirq.h> | |
6 | /* | 6 | #include <linux/spinlock_types.h> |
7 | * # of m68k interrupts | ||
8 | */ | ||
9 | |||
10 | #define SYS_IRQS 8 | ||
11 | 7 | ||
12 | /* | 8 | /* |
13 | * This should be the same as the max(NUM_X_SOURCES) for all the | 9 | * This should be the same as the max(NUM_X_SOURCES) for all the |
@@ -15,10 +11,20 @@ | |||
15 | * Currently the Atari has 72 and the Amiga 24, but if both are | 11 | * Currently the Atari has 72 and the Amiga 24, but if both are |
16 | * supported in the kernel it is better to make room for 72. | 12 | * supported in the kernel it is better to make room for 72. |
17 | */ | 13 | */ |
18 | #if defined(CONFIG_ATARI) || defined(CONFIG_MAC) | 14 | #if defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X) |
19 | #define NR_IRQS (72+SYS_IRQS) | 15 | #define NR_IRQS 200 |
16 | #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) | ||
17 | #define NR_IRQS 72 | ||
18 | #elif defined(CONFIG_Q40) | ||
19 | #define NR_IRQS 43 | ||
20 | #elif defined(CONFIG_AMIGA) | ||
21 | #define NR_IRQS 32 | ||
22 | #elif defined(CONFIG_APOLLO) | ||
23 | #define NR_IRQS 24 | ||
24 | #elif defined(CONFIG_HP300) | ||
25 | #define NR_IRQS 8 | ||
20 | #else | 26 | #else |
21 | #define NR_IRQS (24+SYS_IRQS) | 27 | #error unknown nr of irqs |
22 | #endif | 28 | #endif |
23 | 29 | ||
24 | /* | 30 | /* |
@@ -40,53 +46,25 @@ | |||
40 | * that routine requires service. | 46 | * that routine requires service. |
41 | */ | 47 | */ |
42 | 48 | ||
43 | #define IRQ1 (1) /* level 1 interrupt */ | 49 | #define IRQ_SPURIOUS 0 |
44 | #define IRQ2 (2) /* level 2 interrupt */ | ||
45 | #define IRQ3 (3) /* level 3 interrupt */ | ||
46 | #define IRQ4 (4) /* level 4 interrupt */ | ||
47 | #define IRQ5 (5) /* level 5 interrupt */ | ||
48 | #define IRQ6 (6) /* level 6 interrupt */ | ||
49 | #define IRQ7 (7) /* level 7 interrupt (non-maskable) */ | ||
50 | 50 | ||
51 | /* | 51 | #define IRQ_AUTO_1 1 /* level 1 interrupt */ |
52 | * "Generic" interrupt sources | 52 | #define IRQ_AUTO_2 2 /* level 2 interrupt */ |
53 | */ | 53 | #define IRQ_AUTO_3 3 /* level 3 interrupt */ |
54 | 54 | #define IRQ_AUTO_4 4 /* level 4 interrupt */ | |
55 | #define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */ | 55 | #define IRQ_AUTO_5 5 /* level 5 interrupt */ |
56 | #define IRQ_AUTO_6 6 /* level 6 interrupt */ | ||
57 | #define IRQ_AUTO_7 7 /* level 7 interrupt (non-maskable) */ | ||
56 | 58 | ||
57 | static __inline__ int irq_canonicalize(int irq) | 59 | #define IRQ_USER 8 |
58 | { | ||
59 | return irq; | ||
60 | } | ||
61 | |||
62 | /* | ||
63 | * Machine specific interrupt sources. | ||
64 | * | ||
65 | * Adding an interrupt service routine for a source with this bit | ||
66 | * set indicates a special machine specific interrupt source. | ||
67 | * The machine specific files define these sources. | ||
68 | * | ||
69 | * The IRQ_MACHSPEC bit is now gone - the only thing it did was to | ||
70 | * introduce unnecessary overhead. | ||
71 | * | ||
72 | * All interrupt handling is actually machine specific so it is better | ||
73 | * to use function pointers, as used by the Sparc port, and select the | ||
74 | * interrupt handling functions when initializing the kernel. This way | ||
75 | * we save some unnecessary overhead at run-time. | ||
76 | * 01/11/97 - Jes | ||
77 | */ | ||
78 | 60 | ||
79 | extern void (*enable_irq)(unsigned int); | 61 | extern unsigned int irq_canonicalize(unsigned int irq); |
80 | extern void (*disable_irq)(unsigned int); | 62 | extern void enable_irq(unsigned int); |
63 | extern void disable_irq(unsigned int); | ||
81 | #define disable_irq_nosync disable_irq | 64 | #define disable_irq_nosync disable_irq |
82 | 65 | ||
83 | struct pt_regs; | 66 | struct pt_regs; |
84 | 67 | ||
85 | extern int cpu_request_irq(unsigned int, | ||
86 | irqreturn_t (*)(int, void *, struct pt_regs *), | ||
87 | unsigned long, const char *, void *); | ||
88 | extern void cpu_free_irq(unsigned int, void *); | ||
89 | |||
90 | /* | 68 | /* |
91 | * various flags for request_irq() - the Amiga now uses the standard | 69 | * various flags for request_irq() - the Amiga now uses the standard |
92 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ | 70 | * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ |
@@ -105,29 +83,45 @@ extern void cpu_free_irq(unsigned int, void *); | |||
105 | * interrupt source (if it supports chaining). | 83 | * interrupt source (if it supports chaining). |
106 | */ | 84 | */ |
107 | typedef struct irq_node { | 85 | typedef struct irq_node { |
108 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 86 | int (*handler)(int, void *, struct pt_regs *); |
109 | unsigned long flags; | ||
110 | void *dev_id; | 87 | void *dev_id; |
111 | const char *devname; | ||
112 | struct irq_node *next; | 88 | struct irq_node *next; |
89 | unsigned long flags; | ||
90 | const char *devname; | ||
113 | } irq_node_t; | 91 | } irq_node_t; |
114 | 92 | ||
115 | /* | 93 | /* |
116 | * This structure has only 4 elements for speed reasons | 94 | * This structure has only 4 elements for speed reasons |
117 | */ | 95 | */ |
118 | typedef struct irq_handler { | 96 | typedef struct irq_handler { |
119 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 97 | int (*handler)(int, void *, struct pt_regs *); |
120 | unsigned long flags; | 98 | unsigned long flags; |
121 | void *dev_id; | 99 | void *dev_id; |
122 | const char *devname; | 100 | const char *devname; |
123 | } irq_handler_t; | 101 | } irq_handler_t; |
124 | 102 | ||
125 | /* count of spurious interrupts */ | 103 | struct irq_controller { |
126 | extern volatile unsigned int num_spurious; | 104 | const char *name; |
105 | spinlock_t lock; | ||
106 | int (*startup)(unsigned int irq); | ||
107 | void (*shutdown)(unsigned int irq); | ||
108 | void (*enable)(unsigned int irq); | ||
109 | void (*disable)(unsigned int irq); | ||
110 | }; | ||
111 | |||
112 | extern int m68k_irq_startup(unsigned int); | ||
113 | extern void m68k_irq_shutdown(unsigned int); | ||
127 | 114 | ||
128 | /* | 115 | /* |
129 | * This function returns a new irq_node_t | 116 | * This function returns a new irq_node_t |
130 | */ | 117 | */ |
131 | extern irq_node_t *new_irq_node(void); | 118 | extern irq_node_t *new_irq_node(void); |
132 | 119 | ||
120 | extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *)); | ||
121 | extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, | ||
122 | void (*handler)(unsigned int, struct pt_regs *)); | ||
123 | extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int); | ||
124 | |||
125 | asmlinkage void m68k_handle_int(unsigned int, struct pt_regs *); | ||
126 | |||
133 | #endif /* _M68K_IRQ_H_ */ | 127 | #endif /* _M68K_IRQ_H_ */ |
diff --git a/include/asm-m68k/mac_oss.h b/include/asm-m68k/mac_oss.h index 7644a639cd6c..7221f7251934 100644 --- a/include/asm-m68k/mac_oss.h +++ b/include/asm-m68k/mac_oss.h | |||
@@ -69,12 +69,12 @@ | |||
69 | 69 | ||
70 | #define OSS_IRQLEV_DISABLED 0 | 70 | #define OSS_IRQLEV_DISABLED 0 |
71 | #define OSS_IRQLEV_IOPISM 1 /* ADB? */ | 71 | #define OSS_IRQLEV_IOPISM 1 /* ADB? */ |
72 | #define OSS_IRQLEV_SCSI 2 | 72 | #define OSS_IRQLEV_SCSI IRQ_AUTO_2 |
73 | #define OSS_IRQLEV_NUBUS 3 /* keep this on its own level */ | 73 | #define OSS_IRQLEV_NUBUS IRQ_AUTO_3 /* keep this on its own level */ |
74 | #define OSS_IRQLEV_IOPSCC 4 /* matches VIA alternate mapping */ | 74 | #define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 /* matches VIA alternate mapping */ |
75 | #define OSS_IRQLEV_SOUND 5 /* matches VIA alternate mapping */ | 75 | #define OSS_IRQLEV_SOUND IRQ_AUTO_5 /* matches VIA alternate mapping */ |
76 | #define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */ | 76 | #define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */ |
77 | #define OSS_IRQLEV_VIA1 6 /* matches VIA alternate mapping */ | 77 | #define OSS_IRQLEV_VIA1 IRQ_AUTO_6 /* matches VIA alternate mapping */ |
78 | #define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */ | 78 | #define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */ |
79 | 79 | ||
80 | #ifndef __ASSEMBLY__ | 80 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index 7d3fee342369..df898f27e434 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h | |||
@@ -13,14 +13,8 @@ struct buffer_head; | |||
13 | extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)); | 13 | extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)); |
14 | /* machine dependent irq functions */ | 14 | /* machine dependent irq functions */ |
15 | extern void (*mach_init_IRQ) (void); | 15 | extern void (*mach_init_IRQ) (void); |
16 | extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); | ||
17 | extern int (*mach_request_irq) (unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), | ||
18 | unsigned long flags, const char *devname, void *dev_id); | ||
19 | extern void (*mach_free_irq) (unsigned int irq, void *dev_id); | ||
20 | extern void (*mach_get_model) (char *model); | 16 | extern void (*mach_get_model) (char *model); |
21 | extern int (*mach_get_hardware_list) (char *buffer); | 17 | extern int (*mach_get_hardware_list) (char *buffer); |
22 | extern int (*mach_get_irq_list) (struct seq_file *p, void *v); | ||
23 | extern irqreturn_t (*mach_process_int) (int irq, struct pt_regs *fp); | ||
24 | /* machine dependent timer functions */ | 18 | /* machine dependent timer functions */ |
25 | extern unsigned long (*mach_gettimeoffset)(void); | 19 | extern unsigned long (*mach_gettimeoffset)(void); |
26 | extern int (*mach_hwclk)(int, struct rtc_time*); | 20 | extern int (*mach_hwclk)(int, struct rtc_time*); |
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h index 6fc3d19512d1..27d11da2b479 100644 --- a/include/asm-m68k/macintosh.h +++ b/include/asm-m68k/macintosh.h | |||
@@ -11,17 +11,7 @@ | |||
11 | extern void mac_reset(void); | 11 | extern void mac_reset(void); |
12 | extern void mac_poweroff(void); | 12 | extern void mac_poweroff(void); |
13 | extern void mac_init_IRQ(void); | 13 | extern void mac_init_IRQ(void); |
14 | extern int mac_request_irq (unsigned int, irqreturn_t (*)(int, void *, | ||
15 | struct pt_regs *), | ||
16 | unsigned long, const char *, void *); | ||
17 | extern void mac_free_irq(unsigned int, void *); | ||
18 | extern void mac_enable_irq(unsigned int); | ||
19 | extern void mac_disable_irq(unsigned int); | ||
20 | extern int mac_irq_pending(unsigned int); | 14 | extern int mac_irq_pending(unsigned int); |
21 | extern int show_mac_interrupts(struct seq_file *, void *); | ||
22 | #if 0 | ||
23 | extern void mac_default_handler(int irq); | ||
24 | #endif | ||
25 | extern void mac_identify(void); | 15 | extern void mac_identify(void); |
26 | extern void mac_report_hardware(void); | 16 | extern void mac_report_hardware(void); |
27 | extern void mac_debugging_penguin(int); | 17 | extern void mac_debugging_penguin(int); |
diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h index fd8c3a9fea4d..679c48ab4407 100644 --- a/include/asm-m68k/macints.h +++ b/include/asm-m68k/macints.h | |||
@@ -59,17 +59,6 @@ | |||
59 | #define IRQ_SRC(irq) (irq >> 3) | 59 | #define IRQ_SRC(irq) (irq >> 3) |
60 | #define IRQ_IDX(irq) (irq & 7) | 60 | #define IRQ_IDX(irq) (irq & 7) |
61 | 61 | ||
62 | #define IRQ_SPURIOUS (0) | ||
63 | |||
64 | /* auto-vector interrupts */ | ||
65 | #define IRQ_AUTO_1 (1) | ||
66 | #define IRQ_AUTO_2 (2) | ||
67 | #define IRQ_AUTO_3 (3) | ||
68 | #define IRQ_AUTO_4 (4) | ||
69 | #define IRQ_AUTO_5 (5) | ||
70 | #define IRQ_AUTO_6 (6) | ||
71 | #define IRQ_AUTO_7 (7) | ||
72 | |||
73 | /* VIA1 interrupts */ | 62 | /* VIA1 interrupts */ |
74 | #define IRQ_VIA1_0 (8) /* one second int. */ | 63 | #define IRQ_VIA1_0 (8) /* one second int. */ |
75 | #define IRQ_VIA1_1 (9) /* VBlank int. */ | 64 | #define IRQ_VIA1_1 (9) /* VBlank int. */ |
@@ -163,7 +152,4 @@ | |||
163 | #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ | 152 | #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ |
164 | #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ | 153 | #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ |
165 | 154 | ||
166 | extern irq_node_t *mac_irq_list[NUM_MAC_SOURCES]; | ||
167 | extern void mac_do_irq_list(int irq, struct pt_regs *); | ||
168 | |||
169 | #endif /* asm/macints.h */ | 155 | #endif /* asm/macints.h */ |
diff --git a/include/asm-m68k/mvme147hw.h b/include/asm-m68k/mvme147hw.h index f245139f3671..b81043108472 100644 --- a/include/asm-m68k/mvme147hw.h +++ b/include/asm-m68k/mvme147hw.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _MVME147HW_H_ | 1 | #ifndef _MVME147HW_H_ |
2 | #define _MVME147HW_H_ | 2 | #define _MVME147HW_H_ |
3 | 3 | ||
4 | #include <asm/irq.h> | ||
5 | |||
4 | typedef struct { | 6 | typedef struct { |
5 | unsigned char | 7 | unsigned char |
6 | ctrl, | 8 | ctrl, |
@@ -72,39 +74,39 @@ struct pcc_regs { | |||
72 | #define PCC_LEVEL_SCSI_PORT 0x04 | 74 | #define PCC_LEVEL_SCSI_PORT 0x04 |
73 | #define PCC_LEVEL_SCSI_DMA 0x04 | 75 | #define PCC_LEVEL_SCSI_DMA 0x04 |
74 | 76 | ||
75 | #define PCC_IRQ_AC_FAIL 0x40 | 77 | #define PCC_IRQ_AC_FAIL (IRQ_USER+0) |
76 | #define PCC_IRQ_BERR 0x41 | 78 | #define PCC_IRQ_BERR (IRQ_USER+1) |
77 | #define PCC_IRQ_ABORT 0x42 | 79 | #define PCC_IRQ_ABORT (IRQ_USER+2) |
78 | /* #define PCC_IRQ_SERIAL 0x43 */ | 80 | /* #define PCC_IRQ_SERIAL (IRQ_USER+3) */ |
79 | #define PCC_IRQ_PRINTER 0x47 | 81 | #define PCC_IRQ_PRINTER (IRQ_USER+7) |
80 | #define PCC_IRQ_TIMER1 0x48 | 82 | #define PCC_IRQ_TIMER1 (IRQ_USER+8) |
81 | #define PCC_IRQ_TIMER2 0x49 | 83 | #define PCC_IRQ_TIMER2 (IRQ_USER+9) |
82 | #define PCC_IRQ_SOFTWARE1 0x4a | 84 | #define PCC_IRQ_SOFTWARE1 (IRQ_USER+10) |
83 | #define PCC_IRQ_SOFTWARE2 0x4b | 85 | #define PCC_IRQ_SOFTWARE2 (IRQ_USER+11) |
84 | 86 | ||
85 | 87 | ||
86 | #define M147_SCC_A_ADDR 0xfffe3002 | 88 | #define M147_SCC_A_ADDR 0xfffe3002 |
87 | #define M147_SCC_B_ADDR 0xfffe3000 | 89 | #define M147_SCC_B_ADDR 0xfffe3000 |
88 | #define M147_SCC_PCLK 5000000 | 90 | #define M147_SCC_PCLK 5000000 |
89 | 91 | ||
90 | #define MVME147_IRQ_SCSI_PORT 0x45 | 92 | #define MVME147_IRQ_SCSI_PORT (IRQ_USER+0x45) |
91 | #define MVME147_IRQ_SCSI_DMA 0x46 | 93 | #define MVME147_IRQ_SCSI_DMA (IRQ_USER+0x46) |
92 | 94 | ||
93 | /* SCC interrupts, for MVME147 */ | 95 | /* SCC interrupts, for MVME147 */ |
94 | 96 | ||
95 | #define MVME147_IRQ_TYPE_PRIO 0 | 97 | #define MVME147_IRQ_TYPE_PRIO 0 |
96 | #define MVME147_IRQ_SCC_BASE 0x60 | 98 | #define MVME147_IRQ_SCC_BASE (IRQ_USER+32) |
97 | #define MVME147_IRQ_SCCB_TX 0x60 | 99 | #define MVME147_IRQ_SCCB_TX (IRQ_USER+32) |
98 | #define MVME147_IRQ_SCCB_STAT 0x62 | 100 | #define MVME147_IRQ_SCCB_STAT (IRQ_USER+34) |
99 | #define MVME147_IRQ_SCCB_RX 0x64 | 101 | #define MVME147_IRQ_SCCB_RX (IRQ_USER+36) |
100 | #define MVME147_IRQ_SCCB_SPCOND 0x66 | 102 | #define MVME147_IRQ_SCCB_SPCOND (IRQ_USER+38) |
101 | #define MVME147_IRQ_SCCA_TX 0x68 | 103 | #define MVME147_IRQ_SCCA_TX (IRQ_USER+40) |
102 | #define MVME147_IRQ_SCCA_STAT 0x6a | 104 | #define MVME147_IRQ_SCCA_STAT (IRQ_USER+42) |
103 | #define MVME147_IRQ_SCCA_RX 0x6c | 105 | #define MVME147_IRQ_SCCA_RX (IRQ_USER+44) |
104 | #define MVME147_IRQ_SCCA_SPCOND 0x6e | 106 | #define MVME147_IRQ_SCCA_SPCOND (IRQ_USER+46) |
105 | 107 | ||
106 | #define MVME147_LANCE_BASE 0xfffe1800 | 108 | #define MVME147_LANCE_BASE 0xfffe1800 |
107 | #define MVME147_LANCE_IRQ 0x44 | 109 | #define MVME147_LANCE_IRQ (IRQ_USER+4) |
108 | 110 | ||
109 | #define ETHERNET_ADDRESS 0xfffe0778 | 111 | #define ETHERNET_ADDRESS 0xfffe0778 |
110 | 112 | ||
diff --git a/include/asm-m68k/mvme16xhw.h b/include/asm-m68k/mvme16xhw.h index 5d07231d2426..6117f56653d2 100644 --- a/include/asm-m68k/mvme16xhw.h +++ b/include/asm-m68k/mvme16xhw.h | |||
@@ -66,28 +66,28 @@ typedef struct { | |||
66 | 66 | ||
67 | #define MVME162_IRQ_TYPE_PRIO 0 | 67 | #define MVME162_IRQ_TYPE_PRIO 0 |
68 | 68 | ||
69 | #define MVME167_IRQ_PRN 0x54 | 69 | #define MVME167_IRQ_PRN (IRQ_USER+20) |
70 | #define MVME16x_IRQ_I596 0x57 | 70 | #define MVME16x_IRQ_I596 (IRQ_USER+23) |
71 | #define MVME16x_IRQ_SCSI 0x55 | 71 | #define MVME16x_IRQ_SCSI (IRQ_USER+21) |
72 | #define MVME16x_IRQ_FLY 0x7f | 72 | #define MVME16x_IRQ_FLY (IRQ_USER+63) |
73 | #define MVME167_IRQ_SER_ERR 0x5c | 73 | #define MVME167_IRQ_SER_ERR (IRQ_USER+28) |
74 | #define MVME167_IRQ_SER_MODEM 0x5d | 74 | #define MVME167_IRQ_SER_MODEM (IRQ_USER+29) |
75 | #define MVME167_IRQ_SER_TX 0x5e | 75 | #define MVME167_IRQ_SER_TX (IRQ_USER+30) |
76 | #define MVME167_IRQ_SER_RX 0x5f | 76 | #define MVME167_IRQ_SER_RX (IRQ_USER+31) |
77 | #define MVME16x_IRQ_TIMER 0x59 | 77 | #define MVME16x_IRQ_TIMER (IRQ_USER+25) |
78 | #define MVME167_IRQ_ABORT 0x6e | 78 | #define MVME167_IRQ_ABORT (IRQ_USER+46) |
79 | #define MVME162_IRQ_ABORT 0x5e | 79 | #define MVME162_IRQ_ABORT (IRQ_USER+30) |
80 | 80 | ||
81 | /* SCC interrupts, for MVME162 */ | 81 | /* SCC interrupts, for MVME162 */ |
82 | #define MVME162_IRQ_SCC_BASE 0x40 | 82 | #define MVME162_IRQ_SCC_BASE (IRQ_USER+0) |
83 | #define MVME162_IRQ_SCCB_TX 0x40 | 83 | #define MVME162_IRQ_SCCB_TX (IRQ_USER+0) |
84 | #define MVME162_IRQ_SCCB_STAT 0x42 | 84 | #define MVME162_IRQ_SCCB_STAT (IRQ_USER+2) |
85 | #define MVME162_IRQ_SCCB_RX 0x44 | 85 | #define MVME162_IRQ_SCCB_RX (IRQ_USER+4) |
86 | #define MVME162_IRQ_SCCB_SPCOND 0x46 | 86 | #define MVME162_IRQ_SCCB_SPCOND (IRQ_USER+6) |
87 | #define MVME162_IRQ_SCCA_TX 0x48 | 87 | #define MVME162_IRQ_SCCA_TX (IRQ_USER+8) |
88 | #define MVME162_IRQ_SCCA_STAT 0x4a | 88 | #define MVME162_IRQ_SCCA_STAT (IRQ_USER+10) |
89 | #define MVME162_IRQ_SCCA_RX 0x4c | 89 | #define MVME162_IRQ_SCCA_RX (IRQ_USER+12) |
90 | #define MVME162_IRQ_SCCA_SPCOND 0x4e | 90 | #define MVME162_IRQ_SCCA_SPCOND (IRQ_USER+14) |
91 | 91 | ||
92 | /* MVME162 version register */ | 92 | /* MVME162 version register */ |
93 | 93 | ||
diff --git a/include/asm-m68k/scatterlist.h b/include/asm-m68k/scatterlist.h index d7c9b5c5e6c7..8e612266da51 100644 --- a/include/asm-m68k/scatterlist.h +++ b/include/asm-m68k/scatterlist.h | |||
@@ -2,18 +2,17 @@ | |||
2 | #define _M68K_SCATTERLIST_H | 2 | #define _M68K_SCATTERLIST_H |
3 | 3 | ||
4 | struct scatterlist { | 4 | struct scatterlist { |
5 | /* These two are only valid if ADDRESS member of this | ||
6 | * struct is NULL. | ||
7 | */ | ||
8 | struct page *page; | 5 | struct page *page; |
9 | unsigned int offset; | 6 | unsigned int offset; |
10 | |||
11 | unsigned int length; | 7 | unsigned int length; |
12 | 8 | ||
13 | __u32 dvma_address; /* A place to hang host-specific addresses at. */ | 9 | __u32 dma_address; /* A place to hang host-specific addresses at. */ |
14 | }; | 10 | }; |
15 | 11 | ||
16 | /* This is bogus and should go away. */ | 12 | /* This is bogus and should go away. */ |
17 | #define ISA_DMA_THRESHOLD (0x00ffffff) | 13 | #define ISA_DMA_THRESHOLD (0x00ffffff) |
18 | 14 | ||
15 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
16 | #define sg_dma_len(sg) ((sg)->length) | ||
17 | |||
19 | #endif /* !(_M68K_SCATTERLIST_H) */ | 18 | #endif /* !(_M68K_SCATTERLIST_H) */ |
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h index b7b7ea20caab..85037a3d3e8e 100644 --- a/include/asm-m68k/signal.h +++ b/include/asm-m68k/signal.h | |||
@@ -156,13 +156,17 @@ typedef struct sigaltstack { | |||
156 | 156 | ||
157 | static inline void sigaddset(sigset_t *set, int _sig) | 157 | static inline void sigaddset(sigset_t *set, int _sig) |
158 | { | 158 | { |
159 | __asm__("bfset %0{%1,#1}" : "=m" (*set) : "id" ((_sig - 1) ^ 31) | 159 | asm ("bfset %0{%1,#1}" |
160 | : "+od" (*set) | ||
161 | : "id" ((_sig - 1) ^ 31) | ||
160 | : "cc"); | 162 | : "cc"); |
161 | } | 163 | } |
162 | 164 | ||
163 | static inline void sigdelset(sigset_t *set, int _sig) | 165 | static inline void sigdelset(sigset_t *set, int _sig) |
164 | { | 166 | { |
165 | __asm__("bfclr %0{%1,#1}" : "=m"(*set) : "id"((_sig - 1) ^ 31) | 167 | asm ("bfclr %0{%1,#1}" |
168 | : "+od" (*set) | ||
169 | : "id" ((_sig - 1) ^ 31) | ||
166 | : "cc"); | 170 | : "cc"); |
167 | } | 171 | } |
168 | 172 | ||
@@ -175,8 +179,10 @@ static inline int __const_sigismember(sigset_t *set, int _sig) | |||
175 | static inline int __gen_sigismember(sigset_t *set, int _sig) | 179 | static inline int __gen_sigismember(sigset_t *set, int _sig) |
176 | { | 180 | { |
177 | int ret; | 181 | int ret; |
178 | __asm__("bfextu %1{%2,#1},%0" | 182 | asm ("bfextu %1{%2,#1},%0" |
179 | : "=d"(ret) : "m"(*set), "id"((_sig-1) ^ 31)); | 183 | : "=d" (ret) |
184 | : "od" (*set), "id" ((_sig-1) ^ 31) | ||
185 | : "cc"); | ||
180 | return ret; | 186 | return ret; |
181 | } | 187 | } |
182 | 188 | ||
@@ -187,7 +193,10 @@ static inline int __gen_sigismember(sigset_t *set, int _sig) | |||
187 | 193 | ||
188 | static inline int sigfindinword(unsigned long word) | 194 | static inline int sigfindinword(unsigned long word) |
189 | { | 195 | { |
190 | __asm__("bfffo %1{#0,#0},%0" : "=d"(word) : "d"(word & -word) : "cc"); | 196 | asm ("bfffo %1{#0,#0},%0" |
197 | : "=d" (word) | ||
198 | : "d" (word & -word) | ||
199 | : "cc"); | ||
191 | return word ^ 31; | 200 | return word ^ 31; |
192 | } | 201 | } |
193 | 202 | ||
diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h index bd038fccb64b..de91fa071b99 100644 --- a/include/asm-m68k/sun3ints.h +++ b/include/asm-m68k/sun3ints.h | |||
@@ -12,37 +12,25 @@ | |||
12 | #define SUN3INTS_H | 12 | #define SUN3INTS_H |
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/kernel.h> | ||
16 | #include <linux/sched.h> | ||
17 | #include <linux/kernel_stat.h> | ||
18 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
19 | #include <linux/seq_file.h> | ||
20 | #include <asm/segment.h> | ||
21 | #include <asm/intersil.h> | 16 | #include <asm/intersil.h> |
22 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/traps.h> | ||
23 | 19 | ||
24 | #define SUN3_INT_VECS 192 | 20 | #define SUN3_INT_VECS 192 |
25 | 21 | ||
26 | void sun3_enable_irq(unsigned int irq); | 22 | void sun3_enable_irq(unsigned int irq); |
27 | void sun3_disable_irq(unsigned int irq); | 23 | void sun3_disable_irq(unsigned int irq); |
28 | int sun3_request_irq(unsigned int irq, | ||
29 | irqreturn_t (*handler)(int, void *, struct pt_regs *), | ||
30 | unsigned long flags, const char *devname, void *dev_id | ||
31 | ); | ||
32 | extern void sun3_init_IRQ (void); | 24 | extern void sun3_init_IRQ (void); |
33 | extern irqreturn_t (*sun3_default_handler[]) (int, void *, struct pt_regs *); | ||
34 | extern void sun3_free_irq (unsigned int irq, void *dev_id); | ||
35 | extern void sun3_enable_interrupts (void); | 25 | extern void sun3_enable_interrupts (void); |
36 | extern void sun3_disable_interrupts (void); | 26 | extern void sun3_disable_interrupts (void); |
37 | extern int show_sun3_interrupts(struct seq_file *, void *); | ||
38 | extern irqreturn_t sun3_process_int(int, struct pt_regs *); | ||
39 | extern volatile unsigned char* sun3_intreg; | 27 | extern volatile unsigned char* sun3_intreg; |
40 | 28 | ||
41 | /* master list of VME vectors -- don't fuck with this */ | 29 | /* master list of VME vectors -- don't fuck with this */ |
42 | #define SUN3_VEC_FLOPPY 0x40 | 30 | #define SUN3_VEC_FLOPPY (IRQ_USER+0) |
43 | #define SUN3_VEC_VMESCSI0 0x40 | 31 | #define SUN3_VEC_VMESCSI0 (IRQ_USER+0) |
44 | #define SUN3_VEC_VMESCSI1 0x41 | 32 | #define SUN3_VEC_VMESCSI1 (IRQ_USER+1) |
45 | #define SUN3_VEC_CG 0xA8 | 33 | #define SUN3_VEC_CG (IRQ_USER+104) |
46 | 34 | ||
47 | 35 | ||
48 | #endif /* SUN3INTS_H */ | 36 | #endif /* SUN3INTS_H */ |
diff --git a/include/asm-m68k/traps.h b/include/asm-m68k/traps.h index 475056191252..8caef25624c7 100644 --- a/include/asm-m68k/traps.h +++ b/include/asm-m68k/traps.h | |||
@@ -13,8 +13,15 @@ | |||
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | 14 | #ifndef __ASSEMBLY__ |
15 | 15 | ||
16 | #include <linux/linkage.h> | ||
17 | #include <asm/ptrace.h> | ||
18 | |||
16 | typedef void (*e_vector)(void); | 19 | typedef void (*e_vector)(void); |
17 | 20 | ||
21 | asmlinkage void auto_inthandler(void); | ||
22 | asmlinkage void user_inthandler(void); | ||
23 | asmlinkage void bad_inthandler(void); | ||
24 | |||
18 | extern e_vector vectors[]; | 25 | extern e_vector vectors[]; |
19 | 26 | ||
20 | #endif | 27 | #endif |
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index b761ef218cea..88b1f47400e1 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h | |||
@@ -181,144 +181,164 @@ asm volatile ("\n" \ | |||
181 | unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n); | 181 | unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n); |
182 | unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n); | 182 | unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n); |
183 | 183 | ||
184 | #define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\ | ||
185 | asm volatile ("\n" \ | ||
186 | "1: moves."#s1" (%2)+,%3\n" \ | ||
187 | " move."#s1" %3,(%1)+\n" \ | ||
188 | "2: moves."#s2" (%2)+,%3\n" \ | ||
189 | " move."#s2" %3,(%1)+\n" \ | ||
190 | " .ifnc \""#s3"\",\"\"\n" \ | ||
191 | "3: moves."#s3" (%2)+,%3\n" \ | ||
192 | " move."#s3" %3,(%1)+\n" \ | ||
193 | " .endif\n" \ | ||
194 | "4:\n" \ | ||
195 | " .section __ex_table,\"a\"\n" \ | ||
196 | " .align 4\n" \ | ||
197 | " .long 1b,10f\n" \ | ||
198 | " .long 2b,20f\n" \ | ||
199 | " .ifnc \""#s3"\",\"\"\n" \ | ||
200 | " .long 3b,30f\n" \ | ||
201 | " .endif\n" \ | ||
202 | " .previous\n" \ | ||
203 | "\n" \ | ||
204 | " .section .fixup,\"ax\"\n" \ | ||
205 | " .even\n" \ | ||
206 | "10: clr."#s1" (%1)+\n" \ | ||
207 | "20: clr."#s2" (%1)+\n" \ | ||
208 | " .ifnc \""#s3"\",\"\"\n" \ | ||
209 | "30: clr."#s3" (%1)+\n" \ | ||
210 | " .endif\n" \ | ||
211 | " moveq.l #"#n",%0\n" \ | ||
212 | " jra 4b\n" \ | ||
213 | " .previous\n" \ | ||
214 | : "+d" (res), "+&a" (to), "+a" (from), "=&d" (tmp) \ | ||
215 | : : "memory") | ||
216 | |||
184 | static __always_inline unsigned long | 217 | static __always_inline unsigned long |
185 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) | 218 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) |
186 | { | 219 | { |
187 | unsigned long res = 0, tmp; | 220 | unsigned long res = 0, tmp; |
188 | 221 | ||
189 | /* limit the inlined version to 3 moves */ | ||
190 | if (n == 11 || n > 12) | ||
191 | return __generic_copy_from_user(to, from, n); | ||
192 | |||
193 | switch (n) { | 222 | switch (n) { |
194 | case 1: | 223 | case 1: |
195 | __get_user_asm(res, *(u8 *)to, (u8 *)from, u8, b, d, 1); | 224 | __get_user_asm(res, *(u8 *)to, (u8 *)from, u8, b, d, 1); |
196 | return res; | 225 | break; |
197 | case 2: | 226 | case 2: |
198 | __get_user_asm(res, *(u16 *)to, (u16 *)from, u16, w, d, 2); | 227 | __get_user_asm(res, *(u16 *)to, (u16 *)from, u16, w, d, 2); |
199 | return res; | 228 | break; |
229 | case 3: | ||
230 | __constant_copy_from_user_asm(res, to, from, tmp, 3, w, b,); | ||
231 | break; | ||
200 | case 4: | 232 | case 4: |
201 | __get_user_asm(res, *(u32 *)to, (u32 *)from, u32, l, r, 4); | 233 | __get_user_asm(res, *(u32 *)to, (u32 *)from, u32, l, r, 4); |
202 | return res; | 234 | break; |
235 | case 5: | ||
236 | __constant_copy_from_user_asm(res, to, from, tmp, 5, l, b,); | ||
237 | break; | ||
238 | case 6: | ||
239 | __constant_copy_from_user_asm(res, to, from, tmp, 6, l, w,); | ||
240 | break; | ||
241 | case 7: | ||
242 | __constant_copy_from_user_asm(res, to, from, tmp, 7, l, w, b); | ||
243 | break; | ||
244 | case 8: | ||
245 | __constant_copy_from_user_asm(res, to, from, tmp, 8, l, l,); | ||
246 | break; | ||
247 | case 9: | ||
248 | __constant_copy_from_user_asm(res, to, from, tmp, 9, l, l, b); | ||
249 | break; | ||
250 | case 10: | ||
251 | __constant_copy_from_user_asm(res, to, from, tmp, 10, l, l, w); | ||
252 | break; | ||
253 | case 12: | ||
254 | __constant_copy_from_user_asm(res, to, from, tmp, 12, l, l, l); | ||
255 | break; | ||
256 | default: | ||
257 | /* we limit the inlined version to 3 moves */ | ||
258 | return __generic_copy_from_user(to, from, n); | ||
203 | } | 259 | } |
204 | 260 | ||
205 | asm volatile ("\n" | ||
206 | " .ifndef .Lfrom_user\n" | ||
207 | " .set .Lfrom_user,1\n" | ||
208 | " .macro copy_from_user to,from,tmp\n" | ||
209 | " .if .Lcnt >= 4\n" | ||
210 | "1: moves.l (\\from)+,\\tmp\n" | ||
211 | " move.l \\tmp,(\\to)+\n" | ||
212 | " .set .Lcnt,.Lcnt-4\n" | ||
213 | " .elseif .Lcnt & 2\n" | ||
214 | "1: moves.w (\\from)+,\\tmp\n" | ||
215 | " move.w \\tmp,(\\to)+\n" | ||
216 | " .set .Lcnt,.Lcnt-2\n" | ||
217 | " .elseif .Lcnt & 1\n" | ||
218 | "1: moves.b (\\from)+,\\tmp\n" | ||
219 | " move.b \\tmp,(\\to)+\n" | ||
220 | " .set .Lcnt,.Lcnt-1\n" | ||
221 | " .else\n" | ||
222 | " .exitm\n" | ||
223 | " .endif\n" | ||
224 | "\n" | ||
225 | " .section __ex_table,\"a\"\n" | ||
226 | " .align 4\n" | ||
227 | " .long 1b,3f\n" | ||
228 | " .previous\n" | ||
229 | " .endm\n" | ||
230 | " .endif\n" | ||
231 | "\n" | ||
232 | " .set .Lcnt,%c4\n" | ||
233 | " copy_from_user %1,%2,%3\n" | ||
234 | " copy_from_user %1,%2,%3\n" | ||
235 | " copy_from_user %1,%2,%3\n" | ||
236 | "2:\n" | ||
237 | " .section .fixup,\"ax\"\n" | ||
238 | " .even\n" | ||
239 | "3: moveq.l %4,%0\n" | ||
240 | " move.l %5,%1\n" | ||
241 | " .rept %c4 / 4\n" | ||
242 | " clr.l (%1)+\n" | ||
243 | " .endr\n" | ||
244 | " .if %c4 & 2\n" | ||
245 | " clr.w (%1)+\n" | ||
246 | " .endif\n" | ||
247 | " .if %c4 & 1\n" | ||
248 | " clr.b (%1)+\n" | ||
249 | " .endif\n" | ||
250 | " jra 2b\n" | ||
251 | " .previous\n" | ||
252 | : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp) | ||
253 | : "i" (n), "g" (to) | ||
254 | : "memory"); | ||
255 | |||
256 | return res; | 261 | return res; |
257 | } | 262 | } |
258 | 263 | ||
264 | #define __constant_copy_to_user_asm(res, to, from, tmp, n, s1, s2, s3) \ | ||
265 | asm volatile ("\n" \ | ||
266 | " move."#s1" (%2)+,%3\n" \ | ||
267 | "11: moves."#s1" %3,(%1)+\n" \ | ||
268 | "12: move."#s2" (%2)+,%3\n" \ | ||
269 | "21: moves."#s2" %3,(%1)+\n" \ | ||
270 | "22:\n" \ | ||
271 | " .ifnc \""#s3"\",\"\"\n" \ | ||
272 | " move."#s3" (%2)+,%3\n" \ | ||
273 | "31: moves."#s3" %3,(%1)+\n" \ | ||
274 | "32:\n" \ | ||
275 | " .endif\n" \ | ||
276 | "4:\n" \ | ||
277 | "\n" \ | ||
278 | " .section __ex_table,\"a\"\n" \ | ||
279 | " .align 4\n" \ | ||
280 | " .long 11b,5f\n" \ | ||
281 | " .long 12b,5f\n" \ | ||
282 | " .long 21b,5f\n" \ | ||
283 | " .long 22b,5f\n" \ | ||
284 | " .ifnc \""#s3"\",\"\"\n" \ | ||
285 | " .long 31b,5f\n" \ | ||
286 | " .long 32b,5f\n" \ | ||
287 | " .endif\n" \ | ||
288 | " .previous\n" \ | ||
289 | "\n" \ | ||
290 | " .section .fixup,\"ax\"\n" \ | ||
291 | " .even\n" \ | ||
292 | "5: moveq.l #"#n",%0\n" \ | ||
293 | " jra 4b\n" \ | ||
294 | " .previous\n" \ | ||
295 | : "+d" (res), "+a" (to), "+a" (from), "=&d" (tmp) \ | ||
296 | : : "memory") | ||
297 | |||
259 | static __always_inline unsigned long | 298 | static __always_inline unsigned long |
260 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) | 299 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) |
261 | { | 300 | { |
262 | unsigned long res = 0, tmp; | 301 | unsigned long res = 0, tmp; |
263 | 302 | ||
264 | /* limit the inlined version to 3 moves */ | ||
265 | if (n == 11 || n > 12) | ||
266 | return __generic_copy_to_user(to, from, n); | ||
267 | |||
268 | switch (n) { | 303 | switch (n) { |
269 | case 1: | 304 | case 1: |
270 | __put_user_asm(res, *(u8 *)from, (u8 *)to, b, d, 1); | 305 | __put_user_asm(res, *(u8 *)from, (u8 *)to, b, d, 1); |
271 | return res; | 306 | break; |
272 | case 2: | 307 | case 2: |
273 | __put_user_asm(res, *(u16 *)from, (u16 *)to, w, d, 2); | 308 | __put_user_asm(res, *(u16 *)from, (u16 *)to, w, d, 2); |
274 | return res; | 309 | break; |
310 | case 3: | ||
311 | __constant_copy_to_user_asm(res, to, from, tmp, 3, w, b,); | ||
312 | break; | ||
275 | case 4: | 313 | case 4: |
276 | __put_user_asm(res, *(u32 *)from, (u32 *)to, l, r, 4); | 314 | __put_user_asm(res, *(u32 *)from, (u32 *)to, l, r, 4); |
277 | return res; | 315 | break; |
316 | case 5: | ||
317 | __constant_copy_to_user_asm(res, to, from, tmp, 5, l, b,); | ||
318 | break; | ||
319 | case 6: | ||
320 | __constant_copy_to_user_asm(res, to, from, tmp, 6, l, w,); | ||
321 | break; | ||
322 | case 7: | ||
323 | __constant_copy_to_user_asm(res, to, from, tmp, 7, l, w, b); | ||
324 | break; | ||
325 | case 8: | ||
326 | __constant_copy_to_user_asm(res, to, from, tmp, 8, l, l,); | ||
327 | break; | ||
328 | case 9: | ||
329 | __constant_copy_to_user_asm(res, to, from, tmp, 9, l, l, b); | ||
330 | break; | ||
331 | case 10: | ||
332 | __constant_copy_to_user_asm(res, to, from, tmp, 10, l, l, w); | ||
333 | break; | ||
334 | case 12: | ||
335 | __constant_copy_to_user_asm(res, to, from, tmp, 12, l, l, l); | ||
336 | break; | ||
337 | default: | ||
338 | /* limit the inlined version to 3 moves */ | ||
339 | return __generic_copy_to_user(to, from, n); | ||
278 | } | 340 | } |
279 | 341 | ||
280 | asm volatile ("\n" | ||
281 | " .ifndef .Lto_user\n" | ||
282 | " .set .Lto_user,1\n" | ||
283 | " .macro copy_to_user to,from,tmp\n" | ||
284 | " .if .Lcnt >= 4\n" | ||
285 | " move.l (\\from)+,\\tmp\n" | ||
286 | "11: moves.l \\tmp,(\\to)+\n" | ||
287 | "12: .set .Lcnt,.Lcnt-4\n" | ||
288 | " .elseif .Lcnt & 2\n" | ||
289 | " move.w (\\from)+,\\tmp\n" | ||
290 | "11: moves.w \\tmp,(\\to)+\n" | ||
291 | "12: .set .Lcnt,.Lcnt-2\n" | ||
292 | " .elseif .Lcnt & 1\n" | ||
293 | " move.b (\\from)+,\\tmp\n" | ||
294 | "11: moves.b \\tmp,(\\to)+\n" | ||
295 | "12: .set .Lcnt,.Lcnt-1\n" | ||
296 | " .else\n" | ||
297 | " .exitm\n" | ||
298 | " .endif\n" | ||
299 | "\n" | ||
300 | " .section __ex_table,\"a\"\n" | ||
301 | " .align 4\n" | ||
302 | " .long 11b,3f\n" | ||
303 | " .long 12b,3f\n" | ||
304 | " .previous\n" | ||
305 | " .endm\n" | ||
306 | " .endif\n" | ||
307 | "\n" | ||
308 | " .set .Lcnt,%c4\n" | ||
309 | " copy_to_user %1,%2,%3\n" | ||
310 | " copy_to_user %1,%2,%3\n" | ||
311 | " copy_to_user %1,%2,%3\n" | ||
312 | "2:\n" | ||
313 | " .section .fixup,\"ax\"\n" | ||
314 | " .even\n" | ||
315 | "3: moveq.l %4,%0\n" | ||
316 | " jra 2b\n" | ||
317 | " .previous\n" | ||
318 | : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp) | ||
319 | : "i" (n) | ||
320 | : "memory"); | ||
321 | |||
322 | return res; | 342 | return res; |
323 | } | 343 | } |
324 | 344 | ||
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index 986511db54a6..900f472fdd2b 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h | |||
@@ -145,8 +145,5 @@ static inline void __user *compat_alloc_user_space(long len) | |||
145 | 145 | ||
146 | return (void __user *) (regs->regs[29] - len); | 146 | return (void __user *) (regs->regs[29] - len); |
147 | } | 147 | } |
148 | #if defined (__MIPSEL__) | ||
149 | #define __COMPAT_ENDIAN_SWAP__ 1 | ||
150 | #endif | ||
151 | 148 | ||
152 | #endif /* _ASM_COMPAT_H */ | 149 | #endif /* _ASM_COMPAT_H */ |
diff --git a/include/asm-mips/mach-generic/floppy.h b/include/asm-mips/mach-generic/floppy.h index 682a5858f8d7..83cd69e30ec3 100644 --- a/include/asm-mips/mach-generic/floppy.h +++ b/include/asm-mips/mach-generic/floppy.h | |||
@@ -98,7 +98,7 @@ static inline void fd_disable_irq(void) | |||
98 | static inline int fd_request_irq(void) | 98 | static inline int fd_request_irq(void) |
99 | { | 99 | { |
100 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 100 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
101 | SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); | 101 | SA_INTERRUPT, "floppy", NULL); |
102 | } | 102 | } |
103 | 103 | ||
104 | static inline void fd_free_irq(void) | 104 | static inline void fd_free_irq(void) |
diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h index c9dad99b1232..9413117915f4 100644 --- a/include/asm-mips/mach-jazz/floppy.h +++ b/include/asm-mips/mach-jazz/floppy.h | |||
@@ -90,7 +90,7 @@ static inline void fd_disable_irq(void) | |||
90 | static inline int fd_request_irq(void) | 90 | static inline int fd_request_irq(void) |
91 | { | 91 | { |
92 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 92 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
93 | SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); | 93 | SA_INTERRUPT, "floppy", NULL); |
94 | } | 94 | } |
95 | 95 | ||
96 | static inline void fd_free_irq(void) | 96 | static inline void fd_free_irq(void) |
diff --git a/include/asm-parisc/floppy.h b/include/asm-parisc/floppy.h index ca3aed768cdc..458cdb2a7530 100644 --- a/include/asm-parisc/floppy.h +++ b/include/asm-parisc/floppy.h | |||
@@ -159,10 +159,8 @@ static int fd_request_irq(void) | |||
159 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 159 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, |
160 | "floppy", NULL); | 160 | "floppy", NULL); |
161 | else | 161 | else |
162 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 162 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, |
163 | SA_INTERRUPT|SA_SAMPLE_RANDOM, | 163 | "floppy", NULL); |
164 | "floppy", NULL); | ||
165 | |||
166 | } | 164 | } |
167 | 165 | ||
168 | static unsigned long dma_mem_alloc(unsigned long size) | 166 | static unsigned long dma_mem_alloc(unsigned long size) |
diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h index 1ba1f27a0b63..a5e9e656e332 100644 --- a/include/asm-powerpc/backlight.h +++ b/include/asm-powerpc/backlight.h | |||
@@ -2,30 +2,30 @@ | |||
2 | * Routines for handling backlight control on PowerBooks | 2 | * Routines for handling backlight control on PowerBooks |
3 | * | 3 | * |
4 | * For now, implementation resides in | 4 | * For now, implementation resides in |
5 | * arch/powerpc/platforms/powermac/pmac_support.c | 5 | * arch/powerpc/platforms/powermac/backlight.c |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | #ifndef __ASM_POWERPC_BACKLIGHT_H | 8 | #ifndef __ASM_POWERPC_BACKLIGHT_H |
9 | #define __ASM_POWERPC_BACKLIGHT_H | 9 | #define __ASM_POWERPC_BACKLIGHT_H |
10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
11 | 11 | ||
12 | /* Abstract values */ | 12 | #include <linux/fb.h> |
13 | #define BACKLIGHT_OFF 0 | 13 | #include <linux/mutex.h> |
14 | #define BACKLIGHT_MIN 1 | ||
15 | #define BACKLIGHT_MAX 0xf | ||
16 | 14 | ||
17 | struct backlight_controller { | 15 | /* For locking instructions, see the implementation file */ |
18 | int (*set_enable)(int enable, int level, void *data); | 16 | extern struct backlight_device *pmac_backlight; |
19 | int (*set_level)(int level, void *data); | 17 | extern struct mutex pmac_backlight_mutex; |
20 | }; | ||
21 | 18 | ||
22 | extern void register_backlight_controller(struct backlight_controller *ctrler, void *data, char *type); | 19 | extern void pmac_backlight_calc_curve(struct fb_info*); |
23 | extern void unregister_backlight_controller(struct backlight_controller *ctrler, void *data); | 20 | extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); |
24 | 21 | ||
25 | extern int set_backlight_enable(int enable); | 22 | extern int pmac_has_backlight_type(const char *type); |
26 | extern int get_backlight_enable(void); | 23 | |
27 | extern int set_backlight_level(int level); | 24 | extern void pmac_backlight_key_up(void); |
28 | extern int get_backlight_level(void); | 25 | extern void pmac_backlight_key_down(void); |
26 | |||
27 | extern int pmac_backlight_set_legacy_brightness(int brightness); | ||
28 | extern int pmac_backlight_get_legacy_brightness(void); | ||
29 | 29 | ||
30 | #endif /* __KERNEL__ */ | 30 | #endif /* __KERNEL__ */ |
31 | #endif | 31 | #endif |
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h index 7e2d169ee856..9c8d91bf5a0d 100644 --- a/include/asm-powerpc/floppy.h +++ b/include/asm-powerpc/floppy.h | |||
@@ -27,8 +27,7 @@ | |||
27 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) | 27 | #define fd_disable_irq() disable_irq(FLOPPY_IRQ) |
28 | #define fd_cacheflush(addr,size) /* nothing */ | 28 | #define fd_cacheflush(addr,size) /* nothing */ |
29 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ | 29 | #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ |
30 | SA_INTERRUPT|SA_SAMPLE_RANDOM, \ | 30 | SA_INTERRUPT, "floppy", NULL) |
31 | "floppy", NULL) | ||
32 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); | 31 | #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); |
33 | 32 | ||
34 | #ifdef CONFIG_PCI | 33 | #ifdef CONFIG_PCI |
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h index 184a7a4d2fdf..faa1fc703053 100644 --- a/include/asm-powerpc/percpu.h +++ b/include/asm-powerpc/percpu.h | |||
@@ -22,6 +22,7 @@ | |||
22 | /* var is in discarded region: offset to particular copy we want */ | 22 | /* var is in discarded region: offset to particular copy we want */ |
23 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) | 23 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) |
24 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) | 24 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) |
25 | #define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) | ||
25 | 26 | ||
26 | /* A macro to avoid #include hell... */ | 27 | /* A macro to avoid #include hell... */ |
27 | #define percpu_modcopy(pcpudst, src, size) \ | 28 | #define percpu_modcopy(pcpudst, src, size) \ |
@@ -41,6 +42,7 @@ extern void setup_per_cpu_areas(void); | |||
41 | 42 | ||
42 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) | 43 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) |
43 | #define __get_cpu_var(var) per_cpu__##var | 44 | #define __get_cpu_var(var) per_cpu__##var |
45 | #define __raw_get_cpu_var(var) per_cpu__##var | ||
44 | 46 | ||
45 | #endif /* SMP */ | 47 | #endif /* SMP */ |
46 | 48 | ||
diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h index 8ccd4a276fe9..2ba191eba448 100644 --- a/include/asm-ppc/floppy.h +++ b/include/asm-ppc/floppy.h | |||
@@ -99,10 +99,8 @@ static int fd_request_irq(void) | |||
99 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 99 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, |
100 | "floppy", NULL); | 100 | "floppy", NULL); |
101 | else | 101 | else |
102 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 102 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, |
103 | SA_INTERRUPT|SA_SAMPLE_RANDOM, | 103 | "floppy", NULL); |
104 | "floppy", NULL); | ||
105 | |||
106 | } | 104 | } |
107 | 105 | ||
108 | static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) | 106 | static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) |
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h index 436d216601e5..d9a8cca9b653 100644 --- a/include/asm-s390/percpu.h +++ b/include/asm-s390/percpu.h | |||
@@ -40,6 +40,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
40 | __typeof__(type) per_cpu__##name | 40 | __typeof__(type) per_cpu__##name |
41 | 41 | ||
42 | #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) | 42 | #define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) |
43 | #define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) | ||
43 | #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) | 44 | #define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) |
44 | 45 | ||
45 | /* A macro to avoid #include hell... */ | 46 | /* A macro to avoid #include hell... */ |
@@ -57,6 +58,7 @@ do { \ | |||
57 | __typeof__(type) per_cpu__##name | 58 | __typeof__(type) per_cpu__##name |
58 | 59 | ||
59 | #define __get_cpu_var(var) __reloc_hide(var,0) | 60 | #define __get_cpu_var(var) __reloc_hide(var,0) |
61 | #define __raw_get_cpu_var(var) __reloc_hide(var,0) | ||
60 | #define per_cpu(var,cpu) __reloc_hide(var,0) | 62 | #define per_cpu(var,cpu) __reloc_hide(var,0) |
61 | 63 | ||
62 | #endif /* SMP */ | 64 | #endif /* SMP */ |
diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h index 38d7a2942476..307d9ce9f9ed 100644 --- a/include/asm-sh/floppy.h +++ b/include/asm-sh/floppy.h | |||
@@ -147,11 +147,10 @@ static int fd_request_irq(void) | |||
147 | { | 147 | { |
148 | if(can_use_virtual_dma) | 148 | if(can_use_virtual_dma) |
149 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 149 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, |
150 | "floppy", NULL); | 150 | "floppy", NULL); |
151 | else | 151 | else |
152 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 152 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, |
153 | SA_INTERRUPT|SA_SAMPLE_RANDOM, | 153 | "floppy", NULL); |
154 | "floppy", NULL); | ||
155 | 154 | ||
156 | } | 155 | } |
157 | 156 | ||
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h index baef13b58952..a6ece06b83db 100644 --- a/include/asm-sparc64/percpu.h +++ b/include/asm-sparc64/percpu.h | |||
@@ -21,6 +21,7 @@ register unsigned long __local_per_cpu_offset asm("g5"); | |||
21 | /* var is in discarded region: offset to particular copy we want */ | 21 | /* var is in discarded region: offset to particular copy we want */ |
22 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) | 22 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) |
23 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) | 23 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) |
24 | #define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) | ||
24 | 25 | ||
25 | /* A macro to avoid #include hell... */ | 26 | /* A macro to avoid #include hell... */ |
26 | #define percpu_modcopy(pcpudst, src, size) \ | 27 | #define percpu_modcopy(pcpudst, src, size) \ |
@@ -37,6 +38,7 @@ do { \ | |||
37 | 38 | ||
38 | #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) | 39 | #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) |
39 | #define __get_cpu_var(var) per_cpu__##var | 40 | #define __get_cpu_var(var) per_cpu__##var |
41 | #define __raw_get_cpu_var(var) per_cpu__##var | ||
40 | 42 | ||
41 | #endif /* SMP */ | 43 | #endif /* SMP */ |
42 | 44 | ||
diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h index 52825ce689f2..006291e89b4a 100644 --- a/include/asm-x86_64/floppy.h +++ b/include/asm-x86_64/floppy.h | |||
@@ -147,10 +147,8 @@ static int fd_request_irq(void) | |||
147 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, | 147 | return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, |
148 | "floppy", NULL); | 148 | "floppy", NULL); |
149 | else | 149 | else |
150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, |
151 | SA_INTERRUPT|SA_SAMPLE_RANDOM, | 151 | "floppy", NULL); |
152 | "floppy", NULL); | ||
153 | |||
154 | } | 152 | } |
155 | 153 | ||
156 | static unsigned long dma_mem_alloc(unsigned long size) | 154 | static unsigned long dma_mem_alloc(unsigned long size) |
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 7f33aaf9f7b1..549eb929b2c0 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h | |||
@@ -21,6 +21,7 @@ | |||
21 | /* var is in discarded region: offset to particular copy we want */ | 21 | /* var is in discarded region: offset to particular copy we want */ |
22 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) | 22 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) |
23 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) | 23 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) |
24 | #define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) | ||
24 | 25 | ||
25 | /* A macro to avoid #include hell... */ | 26 | /* A macro to avoid #include hell... */ |
26 | #define percpu_modcopy(pcpudst, src, size) \ | 27 | #define percpu_modcopy(pcpudst, src, size) \ |
@@ -40,6 +41,7 @@ extern void setup_per_cpu_areas(void); | |||
40 | 41 | ||
41 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) | 42 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) |
42 | #define __get_cpu_var(var) per_cpu__##var | 43 | #define __get_cpu_var(var) per_cpu__##var |
44 | #define __raw_get_cpu_var(var) per_cpu__##var | ||
43 | 45 | ||
44 | #endif /* SMP */ | 46 | #endif /* SMP */ |
45 | 47 | ||
diff --git a/include/linux/acct.h b/include/linux/acct.h index 3d54fbcf969e..e86bae7324d2 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
@@ -121,13 +121,17 @@ struct vfsmount; | |||
121 | struct super_block; | 121 | struct super_block; |
122 | extern void acct_auto_close_mnt(struct vfsmount *m); | 122 | extern void acct_auto_close_mnt(struct vfsmount *m); |
123 | extern void acct_auto_close(struct super_block *sb); | 123 | extern void acct_auto_close(struct super_block *sb); |
124 | extern void acct_process(long exitcode); | 124 | extern void acct_init_pacct(struct pacct_struct *pacct); |
125 | extern void acct_collect(long exitcode, int group_dead); | ||
126 | extern void acct_process(void); | ||
125 | extern void acct_update_integrals(struct task_struct *tsk); | 127 | extern void acct_update_integrals(struct task_struct *tsk); |
126 | extern void acct_clear_integrals(struct task_struct *tsk); | 128 | extern void acct_clear_integrals(struct task_struct *tsk); |
127 | #else | 129 | #else |
128 | #define acct_auto_close_mnt(x) do { } while (0) | 130 | #define acct_auto_close_mnt(x) do { } while (0) |
129 | #define acct_auto_close(x) do { } while (0) | 131 | #define acct_auto_close(x) do { } while (0) |
130 | #define acct_process(x) do { } while (0) | 132 | #define acct_init_pacct(x) do { } while (0) |
133 | #define acct_collect(x,y) do { } while (0) | ||
134 | #define acct_process() do { } while (0) | ||
131 | #define acct_update_integrals(x) do { } while (0) | 135 | #define acct_update_integrals(x) do { } while (0) |
132 | #define acct_clear_integrals(task) do { } while (0) | 136 | #define acct_clear_integrals(task) do { } while (0) |
133 | #endif | 137 | #endif |
diff --git a/include/linux/bio.h b/include/linux/bio.h index b60ffe32cd21..76bdaeab6f62 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -47,7 +47,7 @@ | |||
47 | #define BIO_BUG_ON | 47 | #define BIO_BUG_ON |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #define BIO_MAX_PAGES (256) | 50 | #define BIO_MAX_PAGES 256 |
51 | #define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT) | 51 | #define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT) |
52 | #define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9) | 52 | #define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9) |
53 | 53 | ||
diff --git a/include/linux/console.h b/include/linux/console.h index 08734e660d41..d0f8a8009490 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -87,6 +87,7 @@ void give_up_console(const struct consw *sw); | |||
87 | #define CON_CONSDEV (2) /* Last on the command line */ | 87 | #define CON_CONSDEV (2) /* Last on the command line */ |
88 | #define CON_ENABLED (4) | 88 | #define CON_ENABLED (4) |
89 | #define CON_BOOT (8) | 89 | #define CON_BOOT (8) |
90 | #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ | ||
90 | 91 | ||
91 | struct console | 92 | struct console |
92 | { | 93 | { |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 9cbb781d6f80..b268a3c0c376 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -317,7 +317,8 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | |||
317 | (cpu) < NR_CPUS; \ | 317 | (cpu) < NR_CPUS; \ |
318 | (cpu) = next_cpu((cpu), (mask))) | 318 | (cpu) = next_cpu((cpu), (mask))) |
319 | #else /* NR_CPUS == 1 */ | 319 | #else /* NR_CPUS == 1 */ |
320 | #define for_each_cpu_mask(cpu, mask) for ((cpu) = 0; (cpu) < 1; (cpu)++) | 320 | #define for_each_cpu_mask(cpu, mask) \ |
321 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
321 | #endif /* NR_CPUS */ | 322 | #endif /* NR_CPUS */ |
322 | 323 | ||
323 | /* | 324 | /* |
@@ -405,7 +406,6 @@ int __any_online_cpu(const cpumask_t *mask); | |||
405 | #define any_online_cpu(mask) 0 | 406 | #define any_online_cpu(mask) 0 |
406 | #endif | 407 | #endif |
407 | 408 | ||
408 | #define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) | ||
409 | #define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) | 409 | #define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) |
410 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) | 410 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) |
411 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | 411 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) |
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 1e4bdfcf83a2..84cfa8bbdc36 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/eventpoll.h ( Efficent event polling implementation ) | 2 | * include/linux/eventpoll.h ( Efficent event polling implementation ) |
3 | * Copyright (C) 2001,...,2003 Davide Libenzi | 3 | * Copyright (C) 2001,...,2006 Davide Libenzi |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 757d54d8f1a5..5607e6457a65 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -710,6 +710,14 @@ struct dir_private_info { | |||
710 | __u32 next_hash; | 710 | __u32 next_hash; |
711 | }; | 711 | }; |
712 | 712 | ||
713 | /* calculate the first block number of the group */ | ||
714 | static inline ext3_fsblk_t | ||
715 | ext3_group_first_block_no(struct super_block *sb, unsigned long group_no) | ||
716 | { | ||
717 | return group_no * (ext3_fsblk_t)EXT3_BLOCKS_PER_GROUP(sb) + | ||
718 | le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block); | ||
719 | } | ||
720 | |||
713 | /* | 721 | /* |
714 | * Special error return code only used by dx_probe() and its callers. | 722 | * Special error return code only used by dx_probe() and its callers. |
715 | */ | 723 | */ |
@@ -730,14 +738,16 @@ struct dir_private_info { | |||
730 | /* balloc.c */ | 738 | /* balloc.c */ |
731 | extern int ext3_bg_has_super(struct super_block *sb, int group); | 739 | extern int ext3_bg_has_super(struct super_block *sb, int group); |
732 | extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); | 740 | extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); |
733 | extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *); | 741 | extern ext3_fsblk_t ext3_new_block (handle_t *handle, struct inode *inode, |
734 | extern int ext3_new_blocks (handle_t *, struct inode *, unsigned long, | 742 | ext3_fsblk_t goal, int *errp); |
735 | unsigned long *, int *); | 743 | extern ext3_fsblk_t ext3_new_blocks (handle_t *handle, struct inode *inode, |
736 | extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long, | 744 | ext3_fsblk_t goal, unsigned long *count, int *errp); |
737 | unsigned long); | 745 | extern void ext3_free_blocks (handle_t *handle, struct inode *inode, |
738 | extern void ext3_free_blocks_sb (handle_t *, struct super_block *, | 746 | ext3_fsblk_t block, unsigned long count); |
739 | unsigned long, unsigned long, int *); | 747 | extern void ext3_free_blocks_sb (handle_t *handle, struct super_block *sb, |
740 | extern unsigned long ext3_count_free_blocks (struct super_block *); | 748 | ext3_fsblk_t block, unsigned long count, |
749 | unsigned long *pdquot_freed_blocks); | ||
750 | extern ext3_fsblk_t ext3_count_free_blocks (struct super_block *); | ||
741 | extern void ext3_check_blocks_bitmap (struct super_block *); | 751 | extern void ext3_check_blocks_bitmap (struct super_block *); |
742 | extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, | 752 | extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, |
743 | unsigned int block_group, | 753 | unsigned int block_group, |
@@ -773,7 +783,8 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned); | |||
773 | 783 | ||
774 | 784 | ||
775 | /* inode.c */ | 785 | /* inode.c */ |
776 | int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); | 786 | int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode, |
787 | struct buffer_head *bh, ext3_fsblk_t blocknr); | ||
777 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | 788 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); |
778 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 789 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
779 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | 790 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, |
@@ -808,7 +819,7 @@ extern int ext3_group_add(struct super_block *sb, | |||
808 | struct ext3_new_group_data *input); | 819 | struct ext3_new_group_data *input); |
809 | extern int ext3_group_extend(struct super_block *sb, | 820 | extern int ext3_group_extend(struct super_block *sb, |
810 | struct ext3_super_block *es, | 821 | struct ext3_super_block *es, |
811 | unsigned long n_blocks_count); | 822 | ext3_fsblk_t n_blocks_count); |
812 | 823 | ||
813 | /* super.c */ | 824 | /* super.c */ |
814 | extern void ext3_error (struct super_block *, const char *, const char *, ...) | 825 | extern void ext3_error (struct super_block *, const char *, const char *, ...) |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 7abf90147180..2f18b9511f21 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -21,9 +21,17 @@ | |||
21 | #include <linux/seqlock.h> | 21 | #include <linux/seqlock.h> |
22 | #include <linux/mutex.h> | 22 | #include <linux/mutex.h> |
23 | 23 | ||
24 | /* data type for block offset of block group */ | ||
25 | typedef int ext3_grpblk_t; | ||
26 | |||
27 | /* data type for filesystem-wide blocks number */ | ||
28 | typedef unsigned long ext3_fsblk_t; | ||
29 | |||
30 | #define E3FSBLK "%lu" | ||
31 | |||
24 | struct ext3_reserve_window { | 32 | struct ext3_reserve_window { |
25 | __u32 _rsv_start; /* First byte reserved */ | 33 | ext3_fsblk_t _rsv_start; /* First byte reserved */ |
26 | __u32 _rsv_end; /* Last byte reserved or 0 */ | 34 | ext3_fsblk_t _rsv_end; /* Last byte reserved or 0 */ |
27 | }; | 35 | }; |
28 | 36 | ||
29 | struct ext3_reserve_window_node { | 37 | struct ext3_reserve_window_node { |
@@ -50,7 +58,7 @@ struct ext3_block_alloc_info { | |||
50 | * allocated to this file. This give us the goal (target) for the next | 58 | * allocated to this file. This give us the goal (target) for the next |
51 | * allocation when we detect linearly ascending requests. | 59 | * allocation when we detect linearly ascending requests. |
52 | */ | 60 | */ |
53 | __u32 last_alloc_physical_block; | 61 | ext3_fsblk_t last_alloc_physical_block; |
54 | }; | 62 | }; |
55 | 63 | ||
56 | #define rsv_start rsv_window._rsv_start | 64 | #define rsv_start rsv_window._rsv_start |
@@ -67,7 +75,7 @@ struct ext3_inode_info { | |||
67 | __u8 i_frag_no; | 75 | __u8 i_frag_no; |
68 | __u8 i_frag_size; | 76 | __u8 i_frag_size; |
69 | #endif | 77 | #endif |
70 | __u32 i_file_acl; | 78 | ext3_fsblk_t i_file_acl; |
71 | __u32 i_dir_acl; | 79 | __u32 i_dir_acl; |
72 | __u32 i_dtime; | 80 | __u32 i_dtime; |
73 | 81 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index 315d89740ddf..f1281687e549 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_FB_H | 1 | #ifndef _LINUX_FB_H |
2 | #define _LINUX_FB_H | 2 | #define _LINUX_FB_H |
3 | 3 | ||
4 | #include <linux/backlight.h> | ||
4 | #include <asm/types.h> | 5 | #include <asm/types.h> |
5 | 6 | ||
6 | /* Definitions of frame buffers */ | 7 | /* Definitions of frame buffers */ |
@@ -366,6 +367,12 @@ struct fb_cursor { | |||
366 | struct fb_image image; /* Cursor image */ | 367 | struct fb_image image; /* Cursor image */ |
367 | }; | 368 | }; |
368 | 369 | ||
370 | #ifdef CONFIG_FB_BACKLIGHT | ||
371 | /* Settings for the generic backlight code */ | ||
372 | #define FB_BACKLIGHT_LEVELS 128 | ||
373 | #define FB_BACKLIGHT_MAX 0xFF | ||
374 | #endif | ||
375 | |||
369 | #ifdef __KERNEL__ | 376 | #ifdef __KERNEL__ |
370 | 377 | ||
371 | #include <linux/fs.h> | 378 | #include <linux/fs.h> |
@@ -756,6 +763,21 @@ struct fb_info { | |||
756 | struct fb_cmap cmap; /* Current cmap */ | 763 | struct fb_cmap cmap; /* Current cmap */ |
757 | struct list_head modelist; /* mode list */ | 764 | struct list_head modelist; /* mode list */ |
758 | struct fb_videomode *mode; /* current mode */ | 765 | struct fb_videomode *mode; /* current mode */ |
766 | |||
767 | #ifdef CONFIG_FB_BACKLIGHT | ||
768 | /* Lock ordering: | ||
769 | * bl_mutex (protects bl_dev and bl_curve) | ||
770 | * bl_dev->sem (backlight class) | ||
771 | */ | ||
772 | struct mutex bl_mutex; | ||
773 | |||
774 | /* assigned backlight device */ | ||
775 | struct backlight_device *bl_dev; | ||
776 | |||
777 | /* Backlight level curve */ | ||
778 | u8 bl_curve[FB_BACKLIGHT_LEVELS]; | ||
779 | #endif | ||
780 | |||
759 | struct fb_ops *fbops; | 781 | struct fb_ops *fbops; |
760 | struct device *device; | 782 | struct device *device; |
761 | struct class_device *class_device; /* sysfs per device attrs */ | 783 | struct class_device *class_device; /* sysfs per device attrs */ |
@@ -895,6 +917,7 @@ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); | |||
895 | extern void framebuffer_release(struct fb_info *info); | 917 | extern void framebuffer_release(struct fb_info *info); |
896 | extern int fb_init_class_device(struct fb_info *fb_info); | 918 | extern int fb_init_class_device(struct fb_info *fb_info); |
897 | extern void fb_cleanup_class_device(struct fb_info *head); | 919 | extern void fb_cleanup_class_device(struct fb_info *head); |
920 | extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); | ||
898 | 921 | ||
899 | /* drivers/video/fbmon.c */ | 922 | /* drivers/video/fbmon.c */ |
900 | #define FB_MAXTIMINGS 0 | 923 | #define FB_MAXTIMINGS 0 |
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index c52a63755fdd..996f5611cd59 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ | 29 | #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ |
30 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of | 30 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of |
31 | unlinking file. */ | 31 | unlinking file. */ |
32 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ | ||
32 | 33 | ||
33 | #ifdef __KERNEL__ | 34 | #ifdef __KERNEL__ |
34 | 35 | ||
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 5425b60021e3..9fc48a674b82 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | FUSE: Filesystem in Userspace | 2 | FUSE: Filesystem in Userspace |
3 | Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu> | 3 | Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> |
4 | 4 | ||
5 | This program can be distributed under the terms of the GNU GPL. | 5 | This program can be distributed under the terms of the GNU GPL. |
6 | See the file COPYING. | 6 | See the file COPYING. |
@@ -9,18 +9,19 @@ | |||
9 | /* This file defines the kernel interface of FUSE */ | 9 | /* This file defines the kernel interface of FUSE */ |
10 | 10 | ||
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <linux/major.h> | ||
12 | 13 | ||
13 | /** Version number of this interface */ | 14 | /** Version number of this interface */ |
14 | #define FUSE_KERNEL_VERSION 7 | 15 | #define FUSE_KERNEL_VERSION 7 |
15 | 16 | ||
16 | /** Minor version number of this interface */ | 17 | /** Minor version number of this interface */ |
17 | #define FUSE_KERNEL_MINOR_VERSION 6 | 18 | #define FUSE_KERNEL_MINOR_VERSION 7 |
18 | 19 | ||
19 | /** The node ID of the root inode */ | 20 | /** The node ID of the root inode */ |
20 | #define FUSE_ROOT_ID 1 | 21 | #define FUSE_ROOT_ID 1 |
21 | 22 | ||
22 | /** The major number of the fuse character device */ | 23 | /** The major number of the fuse character device */ |
23 | #define FUSE_MAJOR 10 | 24 | #define FUSE_MAJOR MISC_MAJOR |
24 | 25 | ||
25 | /** The minor number of the fuse character device */ | 26 | /** The minor number of the fuse character device */ |
26 | #define FUSE_MINOR 229 | 27 | #define FUSE_MINOR 229 |
@@ -58,6 +59,13 @@ struct fuse_kstatfs { | |||
58 | __u32 spare[6]; | 59 | __u32 spare[6]; |
59 | }; | 60 | }; |
60 | 61 | ||
62 | struct fuse_file_lock { | ||
63 | __u64 start; | ||
64 | __u64 end; | ||
65 | __u32 type; | ||
66 | __u32 pid; /* tgid */ | ||
67 | }; | ||
68 | |||
61 | /** | 69 | /** |
62 | * Bitmasks for fuse_setattr_in.valid | 70 | * Bitmasks for fuse_setattr_in.valid |
63 | */ | 71 | */ |
@@ -82,6 +90,7 @@ struct fuse_kstatfs { | |||
82 | * INIT request/reply flags | 90 | * INIT request/reply flags |
83 | */ | 91 | */ |
84 | #define FUSE_ASYNC_READ (1 << 0) | 92 | #define FUSE_ASYNC_READ (1 << 0) |
93 | #define FUSE_POSIX_LOCKS (1 << 1) | ||
85 | 94 | ||
86 | enum fuse_opcode { | 95 | enum fuse_opcode { |
87 | FUSE_LOOKUP = 1, | 96 | FUSE_LOOKUP = 1, |
@@ -112,8 +121,12 @@ enum fuse_opcode { | |||
112 | FUSE_READDIR = 28, | 121 | FUSE_READDIR = 28, |
113 | FUSE_RELEASEDIR = 29, | 122 | FUSE_RELEASEDIR = 29, |
114 | FUSE_FSYNCDIR = 30, | 123 | FUSE_FSYNCDIR = 30, |
124 | FUSE_GETLK = 31, | ||
125 | FUSE_SETLK = 32, | ||
126 | FUSE_SETLKW = 33, | ||
115 | FUSE_ACCESS = 34, | 127 | FUSE_ACCESS = 34, |
116 | FUSE_CREATE = 35 | 128 | FUSE_CREATE = 35, |
129 | FUSE_INTERRUPT = 36, | ||
117 | }; | 130 | }; |
118 | 131 | ||
119 | /* The read buffer is required to be at least 8k, but may be much larger */ | 132 | /* The read buffer is required to be at least 8k, but may be much larger */ |
@@ -199,6 +212,7 @@ struct fuse_flush_in { | |||
199 | __u64 fh; | 212 | __u64 fh; |
200 | __u32 flush_flags; | 213 | __u32 flush_flags; |
201 | __u32 padding; | 214 | __u32 padding; |
215 | __u64 lock_owner; | ||
202 | }; | 216 | }; |
203 | 217 | ||
204 | struct fuse_read_in { | 218 | struct fuse_read_in { |
@@ -247,6 +261,16 @@ struct fuse_getxattr_out { | |||
247 | __u32 padding; | 261 | __u32 padding; |
248 | }; | 262 | }; |
249 | 263 | ||
264 | struct fuse_lk_in { | ||
265 | __u64 fh; | ||
266 | __u64 owner; | ||
267 | struct fuse_file_lock lk; | ||
268 | }; | ||
269 | |||
270 | struct fuse_lk_out { | ||
271 | struct fuse_file_lock lk; | ||
272 | }; | ||
273 | |||
250 | struct fuse_access_in { | 274 | struct fuse_access_in { |
251 | __u32 mask; | 275 | __u32 mask; |
252 | __u32 padding; | 276 | __u32 padding; |
@@ -268,6 +292,10 @@ struct fuse_init_out { | |||
268 | __u32 max_write; | 292 | __u32 max_write; |
269 | }; | 293 | }; |
270 | 294 | ||
295 | struct fuse_interrupt_in { | ||
296 | __u64 unique; | ||
297 | }; | ||
298 | |||
271 | struct fuse_in_header { | 299 | struct fuse_in_header { |
272 | __u32 len; | 300 | __u32 len; |
273 | __u32 opcode; | 301 | __u32 opcode; |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 7d2a1b974c5e..07d7305f131e 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -40,7 +40,6 @@ struct hrtimer_base; | |||
40 | 40 | ||
41 | /** | 41 | /** |
42 | * struct hrtimer - the basic hrtimer structure | 42 | * struct hrtimer - the basic hrtimer structure |
43 | * | ||
44 | * @node: red black tree node for time ordered insertion | 43 | * @node: red black tree node for time ordered insertion |
45 | * @expires: the absolute expiry time in the hrtimers internal | 44 | * @expires: the absolute expiry time in the hrtimers internal |
46 | * representation. The time is related to the clock on | 45 | * representation. The time is related to the clock on |
@@ -59,7 +58,6 @@ struct hrtimer { | |||
59 | 58 | ||
60 | /** | 59 | /** |
61 | * struct hrtimer_sleeper - simple sleeper structure | 60 | * struct hrtimer_sleeper - simple sleeper structure |
62 | * | ||
63 | * @timer: embedded timer structure | 61 | * @timer: embedded timer structure |
64 | * @task: task to wake up | 62 | * @task: task to wake up |
65 | * | 63 | * |
@@ -72,7 +70,6 @@ struct hrtimer_sleeper { | |||
72 | 70 | ||
73 | /** | 71 | /** |
74 | * struct hrtimer_base - the timer base for a specific clock | 72 | * struct hrtimer_base - the timer base for a specific clock |
75 | * | ||
76 | * @index: clock type index for per_cpu support when moving a timer | 73 | * @index: clock type index for per_cpu support when moving a timer |
77 | * to a base on another cpu. | 74 | * to a base on another cpu. |
78 | * @lock: lock protecting the base and associated timers | 75 | * @lock: lock protecting the base and associated timers |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 77e66d055f5b..ef7bef207f48 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -630,6 +630,7 @@ typedef struct ide_drive_s { | |||
630 | unsigned int usage; /* current "open()" count for drive */ | 630 | unsigned int usage; /* current "open()" count for drive */ |
631 | unsigned int failures; /* current failure count */ | 631 | unsigned int failures; /* current failure count */ |
632 | unsigned int max_failures; /* maximum allowed failure count */ | 632 | unsigned int max_failures; /* maximum allowed failure count */ |
633 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | ||
633 | 634 | ||
634 | u64 capacity64; /* total number of sectors */ | 635 | u64 capacity64; /* total number of sectors */ |
635 | 636 | ||
@@ -1005,6 +1006,8 @@ extern ide_hwif_t ide_hwifs[]; /* master data repository */ | |||
1005 | extern int noautodma; | 1006 | extern int noautodma; |
1006 | 1007 | ||
1007 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 1008 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); |
1009 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | ||
1010 | int uptodate, int nr_sectors); | ||
1008 | 1011 | ||
1009 | /* | 1012 | /* |
1010 | * This is used on exit from the driver to designate the next irq handler | 1013 | * This is used on exit from the driver to designate the next irq handler |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 8c21aaa248b4..3c5e4c2e517d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -117,6 +117,8 @@ extern int scnprintf(char * buf, size_t size, const char * fmt, ...) | |||
117 | __attribute__ ((format (printf, 3, 4))); | 117 | __attribute__ ((format (printf, 3, 4))); |
118 | extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) | 118 | extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) |
119 | __attribute__ ((format (printf, 3, 0))); | 119 | __attribute__ ((format (printf, 3, 0))); |
120 | extern char *kasprintf(gfp_t gfp, const char *fmt, ...) | ||
121 | __attribute__ ((format (printf, 2, 3))); | ||
120 | 122 | ||
121 | extern int sscanf(const char *, const char *, ...) | 123 | extern int sscanf(const char *, const char *, ...) |
122 | __attribute__ ((format (scanf, 2, 3))); | 124 | __attribute__ ((format (scanf, 2, 3))); |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index ebdd41fd1082..7cce5dfa092f 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -4,37 +4,19 @@ | |||
4 | #include <linux/err.h> | 4 | #include <linux/err.h> |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | 6 | ||
7 | /** | ||
8 | * kthread_create: create a kthread. | ||
9 | * @threadfn: the function to run until signal_pending(current). | ||
10 | * @data: data ptr for @threadfn. | ||
11 | * @namefmt: printf-style name for the thread. | ||
12 | * | ||
13 | * Description: This helper function creates and names a kernel | ||
14 | * thread. The thread will be stopped: use wake_up_process() to start | ||
15 | * it. See also kthread_run(), kthread_create_on_cpu(). | ||
16 | * | ||
17 | * When woken, the thread will run @threadfn() with @data as its | ||
18 | * argument. @threadfn can either call do_exit() directly if it is a | ||
19 | * standalone thread for which noone will call kthread_stop(), or | ||
20 | * return when 'kthread_should_stop()' is true (which means | ||
21 | * kthread_stop() has been called). The return value should be zero | ||
22 | * or a negative error number: it will be passed to kthread_stop(). | ||
23 | * | ||
24 | * Returns a task_struct or ERR_PTR(-ENOMEM). | ||
25 | */ | ||
26 | struct task_struct *kthread_create(int (*threadfn)(void *data), | 7 | struct task_struct *kthread_create(int (*threadfn)(void *data), |
27 | void *data, | 8 | void *data, |
28 | const char namefmt[], ...); | 9 | const char namefmt[], ...); |
29 | 10 | ||
30 | /** | 11 | /** |
31 | * kthread_run: create and wake a thread. | 12 | * kthread_run - create and wake a thread. |
32 | * @threadfn: the function to run until signal_pending(current). | 13 | * @threadfn: the function to run until signal_pending(current). |
33 | * @data: data ptr for @threadfn. | 14 | * @data: data ptr for @threadfn. |
34 | * @namefmt: printf-style name for the thread. | 15 | * @namefmt: printf-style name for the thread. |
35 | * | 16 | * |
36 | * Description: Convenient wrapper for kthread_create() followed by | 17 | * Description: Convenient wrapper for kthread_create() followed by |
37 | * wake_up_process(). Returns the kthread, or ERR_PTR(-ENOMEM). */ | 18 | * wake_up_process(). Returns the kthread or ERR_PTR(-ENOMEM). |
19 | */ | ||
38 | #define kthread_run(threadfn, data, namefmt, ...) \ | 20 | #define kthread_run(threadfn, data, namefmt, ...) \ |
39 | ({ \ | 21 | ({ \ |
40 | struct task_struct *__k \ | 22 | struct task_struct *__k \ |
@@ -44,50 +26,9 @@ struct task_struct *kthread_create(int (*threadfn)(void *data), | |||
44 | __k; \ | 26 | __k; \ |
45 | }) | 27 | }) |
46 | 28 | ||
47 | /** | ||
48 | * kthread_bind: bind a just-created kthread to a cpu. | ||
49 | * @k: thread created by kthread_create(). | ||
50 | * @cpu: cpu (might not be online, must be possible) for @k to run on. | ||
51 | * | ||
52 | * Description: This function is equivalent to set_cpus_allowed(), | ||
53 | * except that @cpu doesn't need to be online, and the thread must be | ||
54 | * stopped (ie. just returned from kthread_create(). | ||
55 | */ | ||
56 | void kthread_bind(struct task_struct *k, unsigned int cpu); | 29 | void kthread_bind(struct task_struct *k, unsigned int cpu); |
57 | |||
58 | /** | ||
59 | * kthread_stop: stop a thread created by kthread_create(). | ||
60 | * @k: thread created by kthread_create(). | ||
61 | * | ||
62 | * Sets kthread_should_stop() for @k to return true, wakes it, and | ||
63 | * waits for it to exit. Your threadfn() must not call do_exit() | ||
64 | * itself if you use this function! This can also be called after | ||
65 | * kthread_create() instead of calling wake_up_process(): the thread | ||
66 | * will exit without calling threadfn(). | ||
67 | * | ||
68 | * Returns the result of threadfn(), or -EINTR if wake_up_process() | ||
69 | * was never called. */ | ||
70 | int kthread_stop(struct task_struct *k); | 30 | int kthread_stop(struct task_struct *k); |
71 | |||
72 | /** | ||
73 | * kthread_stop_sem: stop a thread created by kthread_create(). | ||
74 | * @k: thread created by kthread_create(). | ||
75 | * @s: semaphore that @k waits on while idle. | ||
76 | * | ||
77 | * Does essentially the same thing as kthread_stop() above, but wakes | ||
78 | * @k by calling up(@s). | ||
79 | * | ||
80 | * Returns the result of threadfn(), or -EINTR if wake_up_process() | ||
81 | * was never called. */ | ||
82 | int kthread_stop_sem(struct task_struct *k, struct semaphore *s); | 31 | int kthread_stop_sem(struct task_struct *k, struct semaphore *s); |
83 | |||
84 | /** | ||
85 | * kthread_should_stop: should this kthread return now? | ||
86 | * | ||
87 | * When someone calls kthread_stop on your kthread, it will be woken | ||
88 | * and this will return true. You should then return, and your return | ||
89 | * value will be passed through to kthread_stop(). | ||
90 | */ | ||
91 | int kthread_should_stop(void); | 32 | int kthread_should_stop(void); |
92 | 33 | ||
93 | #endif /* _LINUX_KTHREAD_H */ | 34 | #endif /* _LINUX_KTHREAD_H */ |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 62bc57580707..ed3396dcc4f7 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -66,7 +66,6 @@ typedef union { | |||
66 | 66 | ||
67 | /** | 67 | /** |
68 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value | 68 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value |
69 | * | ||
70 | * @secs: seconds to set | 69 | * @secs: seconds to set |
71 | * @nsecs: nanoseconds to set | 70 | * @nsecs: nanoseconds to set |
72 | * | 71 | * |
@@ -138,7 +137,6 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) | |||
138 | 137 | ||
139 | /** | 138 | /** |
140 | * ktime_sub - subtract two ktime_t variables | 139 | * ktime_sub - subtract two ktime_t variables |
141 | * | ||
142 | * @lhs: minuend | 140 | * @lhs: minuend |
143 | * @rhs: subtrahend | 141 | * @rhs: subtrahend |
144 | * | 142 | * |
@@ -157,7 +155,6 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) | |||
157 | 155 | ||
158 | /** | 156 | /** |
159 | * ktime_add - add two ktime_t variables | 157 | * ktime_add - add two ktime_t variables |
160 | * | ||
161 | * @add1: addend1 | 158 | * @add1: addend1 |
162 | * @add2: addend2 | 159 | * @add2: addend2 |
163 | * | 160 | * |
@@ -184,7 +181,6 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) | |||
184 | 181 | ||
185 | /** | 182 | /** |
186 | * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable | 183 | * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable |
187 | * | ||
188 | * @kt: addend | 184 | * @kt: addend |
189 | * @nsec: the scalar nsec value to add | 185 | * @nsec: the scalar nsec value to add |
190 | * | 186 | * |
@@ -194,7 +190,6 @@ extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); | |||
194 | 190 | ||
195 | /** | 191 | /** |
196 | * timespec_to_ktime - convert a timespec to ktime_t format | 192 | * timespec_to_ktime - convert a timespec to ktime_t format |
197 | * | ||
198 | * @ts: the timespec variable to convert | 193 | * @ts: the timespec variable to convert |
199 | * | 194 | * |
200 | * Returns a ktime_t variable with the converted timespec value | 195 | * Returns a ktime_t variable with the converted timespec value |
@@ -207,7 +202,6 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts) | |||
207 | 202 | ||
208 | /** | 203 | /** |
209 | * timeval_to_ktime - convert a timeval to ktime_t format | 204 | * timeval_to_ktime - convert a timeval to ktime_t format |
210 | * | ||
211 | * @tv: the timeval variable to convert | 205 | * @tv: the timeval variable to convert |
212 | * | 206 | * |
213 | * Returns a ktime_t variable with the converted timeval value | 207 | * Returns a ktime_t variable with the converted timeval value |
@@ -220,7 +214,6 @@ static inline ktime_t timeval_to_ktime(const struct timeval tv) | |||
220 | 214 | ||
221 | /** | 215 | /** |
222 | * ktime_to_timespec - convert a ktime_t variable to timespec format | 216 | * ktime_to_timespec - convert a ktime_t variable to timespec format |
223 | * | ||
224 | * @kt: the ktime_t variable to convert | 217 | * @kt: the ktime_t variable to convert |
225 | * | 218 | * |
226 | * Returns the timespec representation of the ktime value | 219 | * Returns the timespec representation of the ktime value |
@@ -233,7 +226,6 @@ static inline struct timespec ktime_to_timespec(const ktime_t kt) | |||
233 | 226 | ||
234 | /** | 227 | /** |
235 | * ktime_to_timeval - convert a ktime_t variable to timeval format | 228 | * ktime_to_timeval - convert a ktime_t variable to timeval format |
236 | * | ||
237 | * @kt: the ktime_t variable to convert | 229 | * @kt: the ktime_t variable to convert |
238 | * | 230 | * |
239 | * Returns the timeval representation of the ktime value | 231 | * Returns the timeval representation of the ktime value |
diff --git a/include/linux/list.h b/include/linux/list.h index a02642e4710a..37ca31b21bb7 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -281,16 +281,17 @@ static inline int list_empty(const struct list_head *head) | |||
281 | } | 281 | } |
282 | 282 | ||
283 | /** | 283 | /** |
284 | * list_empty_careful - tests whether a list is | 284 | * list_empty_careful - tests whether a list is empty and not being modified |
285 | * empty _and_ checks that no other CPU might be | 285 | * @head: the list to test |
286 | * in the process of still modifying either member | 286 | * |
287 | * Description: | ||
288 | * tests whether a list is empty _and_ checks that no other CPU might be | ||
289 | * in the process of modifying either member (next or prev) | ||
287 | * | 290 | * |
288 | * NOTE: using list_empty_careful() without synchronization | 291 | * NOTE: using list_empty_careful() without synchronization |
289 | * can only be safe if the only activity that can happen | 292 | * can only be safe if the only activity that can happen |
290 | * to the list entry is list_del_init(). Eg. it cannot be used | 293 | * to the list entry is list_del_init(). Eg. it cannot be used |
291 | * if another CPU could re-list_add() it. | 294 | * if another CPU could re-list_add() it. |
292 | * | ||
293 | * @head: the list to test. | ||
294 | */ | 295 | */ |
295 | static inline int list_empty_careful(const struct list_head *head) | 296 | static inline int list_empty_careful(const struct list_head *head) |
296 | { | 297 | { |
@@ -350,7 +351,7 @@ static inline void list_splice_init(struct list_head *list, | |||
350 | 351 | ||
351 | /** | 352 | /** |
352 | * list_for_each - iterate over a list | 353 | * list_for_each - iterate over a list |
353 | * @pos: the &struct list_head to use as a loop counter. | 354 | * @pos: the &struct list_head to use as a loop cursor. |
354 | * @head: the head for your list. | 355 | * @head: the head for your list. |
355 | */ | 356 | */ |
356 | #define list_for_each(pos, head) \ | 357 | #define list_for_each(pos, head) \ |
@@ -359,7 +360,7 @@ static inline void list_splice_init(struct list_head *list, | |||
359 | 360 | ||
360 | /** | 361 | /** |
361 | * __list_for_each - iterate over a list | 362 | * __list_for_each - iterate over a list |
362 | * @pos: the &struct list_head to use as a loop counter. | 363 | * @pos: the &struct list_head to use as a loop cursor. |
363 | * @head: the head for your list. | 364 | * @head: the head for your list. |
364 | * | 365 | * |
365 | * This variant differs from list_for_each() in that it's the | 366 | * This variant differs from list_for_each() in that it's the |
@@ -372,7 +373,7 @@ static inline void list_splice_init(struct list_head *list, | |||
372 | 373 | ||
373 | /** | 374 | /** |
374 | * list_for_each_prev - iterate over a list backwards | 375 | * list_for_each_prev - iterate over a list backwards |
375 | * @pos: the &struct list_head to use as a loop counter. | 376 | * @pos: the &struct list_head to use as a loop cursor. |
376 | * @head: the head for your list. | 377 | * @head: the head for your list. |
377 | */ | 378 | */ |
378 | #define list_for_each_prev(pos, head) \ | 379 | #define list_for_each_prev(pos, head) \ |
@@ -380,8 +381,8 @@ static inline void list_splice_init(struct list_head *list, | |||
380 | pos = pos->prev) | 381 | pos = pos->prev) |
381 | 382 | ||
382 | /** | 383 | /** |
383 | * list_for_each_safe - iterate over a list safe against removal of list entry | 384 | * list_for_each_safe - iterate over a list safe against removal of list entry |
384 | * @pos: the &struct list_head to use as a loop counter. | 385 | * @pos: the &struct list_head to use as a loop cursor. |
385 | * @n: another &struct list_head to use as temporary storage | 386 | * @n: another &struct list_head to use as temporary storage |
386 | * @head: the head for your list. | 387 | * @head: the head for your list. |
387 | */ | 388 | */ |
@@ -391,7 +392,7 @@ static inline void list_splice_init(struct list_head *list, | |||
391 | 392 | ||
392 | /** | 393 | /** |
393 | * list_for_each_entry - iterate over list of given type | 394 | * list_for_each_entry - iterate over list of given type |
394 | * @pos: the type * to use as a loop counter. | 395 | * @pos: the type * to use as a loop cursor. |
395 | * @head: the head for your list. | 396 | * @head: the head for your list. |
396 | * @member: the name of the list_struct within the struct. | 397 | * @member: the name of the list_struct within the struct. |
397 | */ | 398 | */ |
@@ -402,7 +403,7 @@ static inline void list_splice_init(struct list_head *list, | |||
402 | 403 | ||
403 | /** | 404 | /** |
404 | * list_for_each_entry_reverse - iterate backwards over list of given type. | 405 | * list_for_each_entry_reverse - iterate backwards over list of given type. |
405 | * @pos: the type * to use as a loop counter. | 406 | * @pos: the type * to use as a loop cursor. |
406 | * @head: the head for your list. | 407 | * @head: the head for your list. |
407 | * @member: the name of the list_struct within the struct. | 408 | * @member: the name of the list_struct within the struct. |
408 | */ | 409 | */ |
@@ -412,21 +413,24 @@ static inline void list_splice_init(struct list_head *list, | |||
412 | pos = list_entry(pos->member.prev, typeof(*pos), member)) | 413 | pos = list_entry(pos->member.prev, typeof(*pos), member)) |
413 | 414 | ||
414 | /** | 415 | /** |
415 | * list_prepare_entry - prepare a pos entry for use as a start point in | 416 | * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue |
416 | * list_for_each_entry_continue | ||
417 | * @pos: the type * to use as a start point | 417 | * @pos: the type * to use as a start point |
418 | * @head: the head of the list | 418 | * @head: the head of the list |
419 | * @member: the name of the list_struct within the struct. | 419 | * @member: the name of the list_struct within the struct. |
420 | * | ||
421 | * Prepares a pos entry for use as a start point in list_for_each_entry_continue. | ||
420 | */ | 422 | */ |
421 | #define list_prepare_entry(pos, head, member) \ | 423 | #define list_prepare_entry(pos, head, member) \ |
422 | ((pos) ? : list_entry(head, typeof(*pos), member)) | 424 | ((pos) ? : list_entry(head, typeof(*pos), member)) |
423 | 425 | ||
424 | /** | 426 | /** |
425 | * list_for_each_entry_continue - iterate over list of given type | 427 | * list_for_each_entry_continue - continue iteration over list of given type |
426 | * continuing after existing point | 428 | * @pos: the type * to use as a loop cursor. |
427 | * @pos: the type * to use as a loop counter. | ||
428 | * @head: the head for your list. | 429 | * @head: the head for your list. |
429 | * @member: the name of the list_struct within the struct. | 430 | * @member: the name of the list_struct within the struct. |
431 | * | ||
432 | * Continue to iterate over list of given type, continuing after | ||
433 | * the current position. | ||
430 | */ | 434 | */ |
431 | #define list_for_each_entry_continue(pos, head, member) \ | 435 | #define list_for_each_entry_continue(pos, head, member) \ |
432 | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ | 436 | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ |
@@ -434,11 +438,12 @@ static inline void list_splice_init(struct list_head *list, | |||
434 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 438 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
435 | 439 | ||
436 | /** | 440 | /** |
437 | * list_for_each_entry_from - iterate over list of given type | 441 | * list_for_each_entry_from - iterate over list of given type from the current point |
438 | * continuing from existing point | 442 | * @pos: the type * to use as a loop cursor. |
439 | * @pos: the type * to use as a loop counter. | ||
440 | * @head: the head for your list. | 443 | * @head: the head for your list. |
441 | * @member: the name of the list_struct within the struct. | 444 | * @member: the name of the list_struct within the struct. |
445 | * | ||
446 | * Iterate over list of given type, continuing from current position. | ||
442 | */ | 447 | */ |
443 | #define list_for_each_entry_from(pos, head, member) \ | 448 | #define list_for_each_entry_from(pos, head, member) \ |
444 | for (; prefetch(pos->member.next), &pos->member != (head); \ | 449 | for (; prefetch(pos->member.next), &pos->member != (head); \ |
@@ -446,7 +451,7 @@ static inline void list_splice_init(struct list_head *list, | |||
446 | 451 | ||
447 | /** | 452 | /** |
448 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 453 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
449 | * @pos: the type * to use as a loop counter. | 454 | * @pos: the type * to use as a loop cursor. |
450 | * @n: another type * to use as temporary storage | 455 | * @n: another type * to use as temporary storage |
451 | * @head: the head for your list. | 456 | * @head: the head for your list. |
452 | * @member: the name of the list_struct within the struct. | 457 | * @member: the name of the list_struct within the struct. |
@@ -458,12 +463,14 @@ static inline void list_splice_init(struct list_head *list, | |||
458 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 463 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
459 | 464 | ||
460 | /** | 465 | /** |
461 | * list_for_each_entry_safe_continue - iterate over list of given type | 466 | * list_for_each_entry_safe_continue |
462 | * continuing after existing point safe against removal of list entry | 467 | * @pos: the type * to use as a loop cursor. |
463 | * @pos: the type * to use as a loop counter. | ||
464 | * @n: another type * to use as temporary storage | 468 | * @n: another type * to use as temporary storage |
465 | * @head: the head for your list. | 469 | * @head: the head for your list. |
466 | * @member: the name of the list_struct within the struct. | 470 | * @member: the name of the list_struct within the struct. |
471 | * | ||
472 | * Iterate over list of given type, continuing after current point, | ||
473 | * safe against removal of list entry. | ||
467 | */ | 474 | */ |
468 | #define list_for_each_entry_safe_continue(pos, n, head, member) \ | 475 | #define list_for_each_entry_safe_continue(pos, n, head, member) \ |
469 | for (pos = list_entry(pos->member.next, typeof(*pos), member), \ | 476 | for (pos = list_entry(pos->member.next, typeof(*pos), member), \ |
@@ -472,12 +479,14 @@ static inline void list_splice_init(struct list_head *list, | |||
472 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 479 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
473 | 480 | ||
474 | /** | 481 | /** |
475 | * list_for_each_entry_safe_from - iterate over list of given type | 482 | * list_for_each_entry_safe_from |
476 | * from existing point safe against removal of list entry | 483 | * @pos: the type * to use as a loop cursor. |
477 | * @pos: the type * to use as a loop counter. | ||
478 | * @n: another type * to use as temporary storage | 484 | * @n: another type * to use as temporary storage |
479 | * @head: the head for your list. | 485 | * @head: the head for your list. |
480 | * @member: the name of the list_struct within the struct. | 486 | * @member: the name of the list_struct within the struct. |
487 | * | ||
488 | * Iterate over list of given type from current point, safe against | ||
489 | * removal of list entry. | ||
481 | */ | 490 | */ |
482 | #define list_for_each_entry_safe_from(pos, n, head, member) \ | 491 | #define list_for_each_entry_safe_from(pos, n, head, member) \ |
483 | for (n = list_entry(pos->member.next, typeof(*pos), member); \ | 492 | for (n = list_entry(pos->member.next, typeof(*pos), member); \ |
@@ -485,12 +494,14 @@ static inline void list_splice_init(struct list_head *list, | |||
485 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 494 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
486 | 495 | ||
487 | /** | 496 | /** |
488 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against | 497 | * list_for_each_entry_safe_reverse |
489 | * removal of list entry | 498 | * @pos: the type * to use as a loop cursor. |
490 | * @pos: the type * to use as a loop counter. | ||
491 | * @n: another type * to use as temporary storage | 499 | * @n: another type * to use as temporary storage |
492 | * @head: the head for your list. | 500 | * @head: the head for your list. |
493 | * @member: the name of the list_struct within the struct. | 501 | * @member: the name of the list_struct within the struct. |
502 | * | ||
503 | * Iterate backwards over list of given type, safe against removal | ||
504 | * of list entry. | ||
494 | */ | 505 | */ |
495 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ | 506 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ |
496 | for (pos = list_entry((head)->prev, typeof(*pos), member), \ | 507 | for (pos = list_entry((head)->prev, typeof(*pos), member), \ |
@@ -500,7 +511,7 @@ static inline void list_splice_init(struct list_head *list, | |||
500 | 511 | ||
501 | /** | 512 | /** |
502 | * list_for_each_rcu - iterate over an rcu-protected list | 513 | * list_for_each_rcu - iterate over an rcu-protected list |
503 | * @pos: the &struct list_head to use as a loop counter. | 514 | * @pos: the &struct list_head to use as a loop cursor. |
504 | * @head: the head for your list. | 515 | * @head: the head for your list. |
505 | * | 516 | * |
506 | * This list-traversal primitive may safely run concurrently with | 517 | * This list-traversal primitive may safely run concurrently with |
@@ -518,12 +529,13 @@ static inline void list_splice_init(struct list_head *list, | |||
518 | pos = pos->next) | 529 | pos = pos->next) |
519 | 530 | ||
520 | /** | 531 | /** |
521 | * list_for_each_safe_rcu - iterate over an rcu-protected list safe | 532 | * list_for_each_safe_rcu |
522 | * against removal of list entry | 533 | * @pos: the &struct list_head to use as a loop cursor. |
523 | * @pos: the &struct list_head to use as a loop counter. | ||
524 | * @n: another &struct list_head to use as temporary storage | 534 | * @n: another &struct list_head to use as temporary storage |
525 | * @head: the head for your list. | 535 | * @head: the head for your list. |
526 | * | 536 | * |
537 | * Iterate over an rcu-protected list, safe against removal of list entry. | ||
538 | * | ||
527 | * This list-traversal primitive may safely run concurrently with | 539 | * This list-traversal primitive may safely run concurrently with |
528 | * the _rcu list-mutation primitives such as list_add_rcu() | 540 | * the _rcu list-mutation primitives such as list_add_rcu() |
529 | * as long as the traversal is guarded by rcu_read_lock(). | 541 | * as long as the traversal is guarded by rcu_read_lock(). |
@@ -535,7 +547,7 @@ static inline void list_splice_init(struct list_head *list, | |||
535 | 547 | ||
536 | /** | 548 | /** |
537 | * list_for_each_entry_rcu - iterate over rcu list of given type | 549 | * list_for_each_entry_rcu - iterate over rcu list of given type |
538 | * @pos: the type * to use as a loop counter. | 550 | * @pos: the type * to use as a loop cursor. |
539 | * @head: the head for your list. | 551 | * @head: the head for your list. |
540 | * @member: the name of the list_struct within the struct. | 552 | * @member: the name of the list_struct within the struct. |
541 | * | 553 | * |
@@ -551,11 +563,12 @@ static inline void list_splice_init(struct list_head *list, | |||
551 | 563 | ||
552 | 564 | ||
553 | /** | 565 | /** |
554 | * list_for_each_continue_rcu - iterate over an rcu-protected list | 566 | * list_for_each_continue_rcu |
555 | * continuing after existing point. | 567 | * @pos: the &struct list_head to use as a loop cursor. |
556 | * @pos: the &struct list_head to use as a loop counter. | ||
557 | * @head: the head for your list. | 568 | * @head: the head for your list. |
558 | * | 569 | * |
570 | * Iterate over an rcu-protected list, continuing after current point. | ||
571 | * | ||
559 | * This list-traversal primitive may safely run concurrently with | 572 | * This list-traversal primitive may safely run concurrently with |
560 | * the _rcu list-mutation primitives such as list_add_rcu() | 573 | * the _rcu list-mutation primitives such as list_add_rcu() |
561 | * as long as the traversal is guarded by rcu_read_lock(). | 574 | * as long as the traversal is guarded by rcu_read_lock(). |
@@ -681,11 +694,14 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) | |||
681 | 694 | ||
682 | 695 | ||
683 | /** | 696 | /** |
684 | * hlist_add_head_rcu - adds the specified element to the specified hlist, | 697 | * hlist_add_head_rcu |
685 | * while permitting racing traversals. | ||
686 | * @n: the element to add to the hash list. | 698 | * @n: the element to add to the hash list. |
687 | * @h: the list to add to. | 699 | * @h: the list to add to. |
688 | * | 700 | * |
701 | * Description: | ||
702 | * Adds the specified element to the specified hlist, | ||
703 | * while permitting racing traversals. | ||
704 | * | ||
689 | * The caller must take whatever precautions are necessary | 705 | * The caller must take whatever precautions are necessary |
690 | * (such as holding appropriate locks) to avoid racing | 706 | * (such as holding appropriate locks) to avoid racing |
691 | * with another list-mutation primitive, such as hlist_add_head_rcu() | 707 | * with another list-mutation primitive, such as hlist_add_head_rcu() |
@@ -730,11 +746,14 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
730 | } | 746 | } |
731 | 747 | ||
732 | /** | 748 | /** |
733 | * hlist_add_before_rcu - adds the specified element to the specified hlist | 749 | * hlist_add_before_rcu |
734 | * before the specified node while permitting racing traversals. | ||
735 | * @n: the new element to add to the hash list. | 750 | * @n: the new element to add to the hash list. |
736 | * @next: the existing element to add the new element before. | 751 | * @next: the existing element to add the new element before. |
737 | * | 752 | * |
753 | * Description: | ||
754 | * Adds the specified element to the specified hlist | ||
755 | * before the specified node while permitting racing traversals. | ||
756 | * | ||
738 | * The caller must take whatever precautions are necessary | 757 | * The caller must take whatever precautions are necessary |
739 | * (such as holding appropriate locks) to avoid racing | 758 | * (such as holding appropriate locks) to avoid racing |
740 | * with another list-mutation primitive, such as hlist_add_head_rcu() | 759 | * with another list-mutation primitive, such as hlist_add_head_rcu() |
@@ -755,11 +774,14 @@ static inline void hlist_add_before_rcu(struct hlist_node *n, | |||
755 | } | 774 | } |
756 | 775 | ||
757 | /** | 776 | /** |
758 | * hlist_add_after_rcu - adds the specified element to the specified hlist | 777 | * hlist_add_after_rcu |
759 | * after the specified node while permitting racing traversals. | ||
760 | * @prev: the existing element to add the new element after. | 778 | * @prev: the existing element to add the new element after. |
761 | * @n: the new element to add to the hash list. | 779 | * @n: the new element to add to the hash list. |
762 | * | 780 | * |
781 | * Description: | ||
782 | * Adds the specified element to the specified hlist | ||
783 | * after the specified node while permitting racing traversals. | ||
784 | * | ||
763 | * The caller must take whatever precautions are necessary | 785 | * The caller must take whatever precautions are necessary |
764 | * (such as holding appropriate locks) to avoid racing | 786 | * (such as holding appropriate locks) to avoid racing |
765 | * with another list-mutation primitive, such as hlist_add_head_rcu() | 787 | * with another list-mutation primitive, such as hlist_add_head_rcu() |
@@ -792,8 +814,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
792 | 814 | ||
793 | /** | 815 | /** |
794 | * hlist_for_each_entry - iterate over list of given type | 816 | * hlist_for_each_entry - iterate over list of given type |
795 | * @tpos: the type * to use as a loop counter. | 817 | * @tpos: the type * to use as a loop cursor. |
796 | * @pos: the &struct hlist_node to use as a loop counter. | 818 | * @pos: the &struct hlist_node to use as a loop cursor. |
797 | * @head: the head for your list. | 819 | * @head: the head for your list. |
798 | * @member: the name of the hlist_node within the struct. | 820 | * @member: the name of the hlist_node within the struct. |
799 | */ | 821 | */ |
@@ -804,9 +826,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
804 | pos = pos->next) | 826 | pos = pos->next) |
805 | 827 | ||
806 | /** | 828 | /** |
807 | * hlist_for_each_entry_continue - iterate over a hlist continuing after existing point | 829 | * hlist_for_each_entry_continue - iterate over a hlist continuing after current point |
808 | * @tpos: the type * to use as a loop counter. | 830 | * @tpos: the type * to use as a loop cursor. |
809 | * @pos: the &struct hlist_node to use as a loop counter. | 831 | * @pos: the &struct hlist_node to use as a loop cursor. |
810 | * @member: the name of the hlist_node within the struct. | 832 | * @member: the name of the hlist_node within the struct. |
811 | */ | 833 | */ |
812 | #define hlist_for_each_entry_continue(tpos, pos, member) \ | 834 | #define hlist_for_each_entry_continue(tpos, pos, member) \ |
@@ -816,9 +838,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
816 | pos = pos->next) | 838 | pos = pos->next) |
817 | 839 | ||
818 | /** | 840 | /** |
819 | * hlist_for_each_entry_from - iterate over a hlist continuing from existing point | 841 | * hlist_for_each_entry_from - iterate over a hlist continuing from current point |
820 | * @tpos: the type * to use as a loop counter. | 842 | * @tpos: the type * to use as a loop cursor. |
821 | * @pos: the &struct hlist_node to use as a loop counter. | 843 | * @pos: the &struct hlist_node to use as a loop cursor. |
822 | * @member: the name of the hlist_node within the struct. | 844 | * @member: the name of the hlist_node within the struct. |
823 | */ | 845 | */ |
824 | #define hlist_for_each_entry_from(tpos, pos, member) \ | 846 | #define hlist_for_each_entry_from(tpos, pos, member) \ |
@@ -828,8 +850,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
828 | 850 | ||
829 | /** | 851 | /** |
830 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 852 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
831 | * @tpos: the type * to use as a loop counter. | 853 | * @tpos: the type * to use as a loop cursor. |
832 | * @pos: the &struct hlist_node to use as a loop counter. | 854 | * @pos: the &struct hlist_node to use as a loop cursor. |
833 | * @n: another &struct hlist_node to use as temporary storage | 855 | * @n: another &struct hlist_node to use as temporary storage |
834 | * @head: the head for your list. | 856 | * @head: the head for your list. |
835 | * @member: the name of the hlist_node within the struct. | 857 | * @member: the name of the hlist_node within the struct. |
@@ -842,8 +864,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
842 | 864 | ||
843 | /** | 865 | /** |
844 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 866 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
845 | * @tpos: the type * to use as a loop counter. | 867 | * @tpos: the type * to use as a loop cursor. |
846 | * @pos: the &struct hlist_node to use as a loop counter. | 868 | * @pos: the &struct hlist_node to use as a loop cursor. |
847 | * @head: the head for your list. | 869 | * @head: the head for your list. |
848 | * @member: the name of the hlist_node within the struct. | 870 | * @member: the name of the hlist_node within the struct. |
849 | * | 871 | * |
diff --git a/include/linux/loop.h b/include/linux/loop.h index e76c7611d6cc..bf3d2345ce99 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -59,7 +59,7 @@ struct loop_device { | |||
59 | struct bio *lo_bio; | 59 | struct bio *lo_bio; |
60 | struct bio *lo_biotail; | 60 | struct bio *lo_biotail; |
61 | int lo_state; | 61 | int lo_state; |
62 | struct completion lo_done; | 62 | struct task_struct *lo_thread; |
63 | struct completion lo_bh_done; | 63 | struct completion lo_bh_done; |
64 | struct mutex lo_ctl_mutex; | 64 | struct mutex lo_ctl_mutex; |
65 | int lo_pending; | 65 | int lo_pending; |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 5dba23a1c0d0..48148e0cdbd1 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -16,7 +16,9 @@ extern int fail_migrate_page(struct address_space *, | |||
16 | struct page *, struct page *); | 16 | struct page *, struct page *); |
17 | 17 | ||
18 | extern int migrate_prep(void); | 18 | extern int migrate_prep(void); |
19 | 19 | extern int migrate_vmas(struct mm_struct *mm, | |
20 | const nodemask_t *from, const nodemask_t *to, | ||
21 | unsigned long flags); | ||
20 | #else | 22 | #else |
21 | 23 | ||
22 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | 24 | static inline int isolate_lru_page(struct page *p, struct list_head *list) |
@@ -30,6 +32,13 @@ static inline int migrate_pages_to(struct list_head *pagelist, | |||
30 | 32 | ||
31 | static inline int migrate_prep(void) { return -ENOSYS; } | 33 | static inline int migrate_prep(void) { return -ENOSYS; } |
32 | 34 | ||
35 | static inline int migrate_vmas(struct mm_struct *mm, | ||
36 | const nodemask_t *from, const nodemask_t *to, | ||
37 | unsigned long flags) | ||
38 | { | ||
39 | return -ENOSYS; | ||
40 | } | ||
41 | |||
33 | /* Possible settings for the migrate_page() method in address_operations */ | 42 | /* Possible settings for the migrate_page() method in address_operations */ |
34 | #define migrate_page NULL | 43 | #define migrate_page NULL |
35 | #define fail_migrate_page NULL | 44 | #define fail_migrate_page NULL |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3b09444121d9..a929ea197e48 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -145,7 +145,6 @@ extern unsigned int kobjsize(const void *objp); | |||
145 | 145 | ||
146 | #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ | 146 | #define VM_GROWSDOWN 0x00000100 /* general info on the segment */ |
147 | #define VM_GROWSUP 0x00000200 | 147 | #define VM_GROWSUP 0x00000200 |
148 | #define VM_SHM 0x00000000 /* Means nothing: delete it later */ | ||
149 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ | 148 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
150 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ | 149 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
151 | 150 | ||
@@ -207,6 +206,8 @@ struct vm_operations_struct { | |||
207 | int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); | 206 | int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); |
208 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, | 207 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, |
209 | unsigned long addr); | 208 | unsigned long addr); |
209 | int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from, | ||
210 | const nodemask_t *to, unsigned long flags); | ||
210 | #endif | 211 | #endif |
211 | }; | 212 | }; |
212 | 213 | ||
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index 1d7cdd20b553..e712e7d47cc2 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
@@ -77,11 +77,11 @@ struct nbd_device { | |||
77 | * server. All data are in network byte order. | 77 | * server. All data are in network byte order. |
78 | */ | 78 | */ |
79 | struct nbd_request { | 79 | struct nbd_request { |
80 | __u32 magic; | 80 | __be32 magic; |
81 | __u32 type; /* == READ || == WRITE */ | 81 | __be32 type; /* == READ || == WRITE */ |
82 | char handle[8]; | 82 | char handle[8]; |
83 | __u64 from; | 83 | __be64 from; |
84 | __u32 len; | 84 | __be32 len; |
85 | } | 85 | } |
86 | #ifdef __GNUC__ | 86 | #ifdef __GNUC__ |
87 | __attribute__ ((packed)) | 87 | __attribute__ ((packed)) |
@@ -93,8 +93,8 @@ struct nbd_request { | |||
93 | * it has completed an I/O request (or an error occurs). | 93 | * it has completed an I/O request (or an error occurs). |
94 | */ | 94 | */ |
95 | struct nbd_reply { | 95 | struct nbd_reply { |
96 | __u32 magic; | 96 | __be32 magic; |
97 | __u32 error; /* 0 = ok, else error */ | 97 | __be32 error; /* 0 = ok, else error */ |
98 | char handle[8]; /* handle you got from request */ | 98 | char handle[8]; /* handle you got from request */ |
99 | }; | 99 | }; |
100 | #endif | 100 | #endif |
diff --git a/include/linux/parport.h b/include/linux/parport.h index d42737eeee06..5bf321e82c99 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h | |||
@@ -127,6 +127,10 @@ struct amiga_parport_state { | |||
127 | unsigned char statusdir;/* ciab.ddrb & 7 */ | 127 | unsigned char statusdir;/* ciab.ddrb & 7 */ |
128 | }; | 128 | }; |
129 | 129 | ||
130 | struct ax88796_parport_state { | ||
131 | unsigned char cpr; | ||
132 | }; | ||
133 | |||
130 | struct ip32_parport_state { | 134 | struct ip32_parport_state { |
131 | unsigned int dcr; | 135 | unsigned int dcr; |
132 | unsigned int ecr; | 136 | unsigned int ecr; |
@@ -138,6 +142,7 @@ struct parport_state { | |||
138 | /* ARC has no state. */ | 142 | /* ARC has no state. */ |
139 | struct ax_parport_state ax; | 143 | struct ax_parport_state ax; |
140 | struct amiga_parport_state amiga; | 144 | struct amiga_parport_state amiga; |
145 | struct ax88796_parport_state ax88796; | ||
141 | /* Atari has not state. */ | 146 | /* Atari has not state. */ |
142 | struct ip32_parport_state ip32; | 147 | struct ip32_parport_state ip32; |
143 | void *misc; | 148 | void *misc; |
diff --git a/include/linux/pmu.h b/include/linux/pmu.h index ecce5912f4d6..2ed807ddc08c 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h | |||
@@ -230,4 +230,8 @@ extern int pmu_battery_count; | |||
230 | extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; | 230 | extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; |
231 | extern unsigned int pmu_power_flags; | 231 | extern unsigned int pmu_power_flags; |
232 | 232 | ||
233 | /* Backlight */ | ||
234 | extern int disable_kernel_backlight; | ||
235 | extern void pmu_backlight_init(struct device_node*); | ||
236 | |||
233 | #endif /* __KERNEL__ */ | 237 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 015297ff73fa..1dd1c707311f 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,13 +59,13 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern void kernel_restart_prepare(char *cmd); | ||
63 | extern void kernel_shutdown_prepare(enum system_states state); | 62 | extern void kernel_shutdown_prepare(enum system_states state); |
64 | 63 | ||
65 | extern void kernel_restart(char *cmd); | 64 | extern void kernel_restart(char *cmd); |
66 | extern void kernel_halt(void); | 65 | extern void kernel_halt(void); |
67 | extern void kernel_power_off(void); | 66 | extern void kernel_power_off(void); |
68 | extern void kernel_kexec(void); | 67 | |
68 | void ctrl_alt_del(void); | ||
69 | 69 | ||
70 | /* | 70 | /* |
71 | * Emergency restart, callable from an interrupt handler. | 71 | * Emergency restart, callable from an interrupt handler. |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 21a86cb6acdb..ae13db714742 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | 5 | ||
6 | struct task_struct; | ||
7 | |||
6 | /* | 8 | /* |
7 | * Resource control/accounting header file for linux | 9 | * Resource control/accounting header file for linux |
8 | */ | 10 | */ |
@@ -67,4 +69,6 @@ struct rlimit { | |||
67 | */ | 69 | */ |
68 | #include <asm/resource.h> | 70 | #include <asm/resource.h> |
69 | 71 | ||
72 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); | ||
73 | |||
70 | #endif | 74 | #endif |
diff --git a/include/linux/rtc-v3020.h b/include/linux/rtc-v3020.h new file mode 100644 index 000000000000..bf74e63c98fe --- /dev/null +++ b/include/linux/rtc-v3020.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * v3020.h - Registers definition and platform data structure for the v3020 RTC. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2006, 8D Technologies inc. | ||
9 | */ | ||
10 | #ifndef __LINUX_V3020_H | ||
11 | #define __LINUX_V3020_H | ||
12 | |||
13 | /* The v3020 has only one data pin but which one | ||
14 | * is used depends on the board. */ | ||
15 | struct v3020_platform_data { | ||
16 | int leftshift; /* (1<<(leftshift)) & readl() */ | ||
17 | }; | ||
18 | |||
19 | #define V3020_STATUS_0 0x00 | ||
20 | #define V3020_STATUS_1 0x01 | ||
21 | #define V3020_SECONDS 0x02 | ||
22 | #define V3020_MINUTES 0x03 | ||
23 | #define V3020_HOURS 0x04 | ||
24 | #define V3020_MONTH_DAY 0x05 | ||
25 | #define V3020_MONTH 0x06 | ||
26 | #define V3020_YEAR 0x07 | ||
27 | #define V3020_WEEK_DAY 0x08 | ||
28 | #define V3020_WEEK 0x09 | ||
29 | |||
30 | #define V3020_IS_COMMAND(val) ((val)>=0x0E) | ||
31 | |||
32 | #define V3020_CMD_RAM2CLOCK 0x0E | ||
33 | #define V3020_CMD_CLOCK2RAM 0x0F | ||
34 | |||
35 | #endif /* __LINUX_V3020_H */ | ||
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index ab61cd1199f2..36e2bf4b4315 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -102,6 +102,7 @@ struct rtc_pll_info { | |||
102 | #include <linux/interrupt.h> | 102 | #include <linux/interrupt.h> |
103 | 103 | ||
104 | extern int rtc_month_days(unsigned int month, unsigned int year); | 104 | extern int rtc_month_days(unsigned int month, unsigned int year); |
105 | extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); | ||
105 | extern int rtc_valid_tm(struct rtc_time *tm); | 106 | extern int rtc_valid_tm(struct rtc_time *tm); |
106 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); | 107 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); |
107 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | 108 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); |
@@ -155,6 +156,17 @@ struct rtc_device | |||
155 | struct rtc_task *irq_task; | 156 | struct rtc_task *irq_task; |
156 | spinlock_t irq_task_lock; | 157 | spinlock_t irq_task_lock; |
157 | int irq_freq; | 158 | int irq_freq; |
159 | int max_user_freq; | ||
160 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | ||
161 | struct work_struct uie_task; | ||
162 | struct timer_list uie_timer; | ||
163 | /* Those fields are protected by rtc->irq_lock */ | ||
164 | unsigned int oldsecs; | ||
165 | unsigned int irq_active:1; | ||
166 | unsigned int stop_uie_polling:1; | ||
167 | unsigned int uie_task_active:1; | ||
168 | unsigned int uie_timer_active:1; | ||
169 | #endif | ||
158 | }; | 170 | }; |
159 | #define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) | 171 | #define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) |
160 | 172 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 38b4791e6a5d..8d11d9310db0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -358,6 +358,14 @@ struct sighand_struct { | |||
358 | spinlock_t siglock; | 358 | spinlock_t siglock; |
359 | }; | 359 | }; |
360 | 360 | ||
361 | struct pacct_struct { | ||
362 | int ac_flag; | ||
363 | long ac_exitcode; | ||
364 | unsigned long ac_mem; | ||
365 | cputime_t ac_utime, ac_stime; | ||
366 | unsigned long ac_minflt, ac_majflt; | ||
367 | }; | ||
368 | |||
361 | /* | 369 | /* |
362 | * NOTE! "signal_struct" does not have it's own | 370 | * NOTE! "signal_struct" does not have it's own |
363 | * locking, because a shared signal_struct always | 371 | * locking, because a shared signal_struct always |
@@ -449,6 +457,9 @@ struct signal_struct { | |||
449 | struct key *session_keyring; /* keyring inherited over fork */ | 457 | struct key *session_keyring; /* keyring inherited over fork */ |
450 | struct key *process_keyring; /* keyring private to this process */ | 458 | struct key *process_keyring; /* keyring private to this process */ |
451 | #endif | 459 | #endif |
460 | #ifdef CONFIG_BSD_PROCESS_ACCT | ||
461 | struct pacct_struct pacct; /* per-process accounting information */ | ||
462 | #endif | ||
452 | }; | 463 | }; |
453 | 464 | ||
454 | /* Context switch must be unlocked if interrupts are to be enabled */ | 465 | /* Context switch must be unlocked if interrupts are to be enabled */ |
diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 2993302f7923..0577f5284cbc 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SyncLink Multiprotocol Serial Adapter Driver | 2 | * SyncLink Multiprotocol Serial Adapter Driver |
3 | * | 3 | * |
4 | * $Id: synclink.h,v 3.11 2006/02/06 21:20:29 paulkf Exp $ | 4 | * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $ |
5 | * | 5 | * |
6 | * Copyright (C) 1998-2000 by Microgate Corporation | 6 | * Copyright (C) 1998-2000 by Microgate Corporation |
7 | * | 7 | * |
@@ -97,6 +97,8 @@ | |||
97 | #define HDLC_TXIDLE_ALT_MARK_SPACE 4 | 97 | #define HDLC_TXIDLE_ALT_MARK_SPACE 4 |
98 | #define HDLC_TXIDLE_SPACE 5 | 98 | #define HDLC_TXIDLE_SPACE 5 |
99 | #define HDLC_TXIDLE_MARK 6 | 99 | #define HDLC_TXIDLE_MARK 6 |
100 | #define HDLC_TXIDLE_CUSTOM_8 0x10000000 | ||
101 | #define HDLC_TXIDLE_CUSTOM_16 0x20000000 | ||
100 | 102 | ||
101 | #define HDLC_ENCODING_NRZ 0 | 103 | #define HDLC_ENCODING_NRZ 0 |
102 | #define HDLC_ENCODING_NRZB 1 | 104 | #define HDLC_ENCODING_NRZB 1 |
@@ -170,6 +172,7 @@ typedef struct _MGSL_PARAMS | |||
170 | #define SYNCLINK_GT_DEVICE_ID 0x0070 | 172 | #define SYNCLINK_GT_DEVICE_ID 0x0070 |
171 | #define SYNCLINK_GT4_DEVICE_ID 0x0080 | 173 | #define SYNCLINK_GT4_DEVICE_ID 0x0080 |
172 | #define SYNCLINK_AC_DEVICE_ID 0x0090 | 174 | #define SYNCLINK_AC_DEVICE_ID 0x0090 |
175 | #define SYNCLINK_GT2_DEVICE_ID 0x00A0 | ||
173 | #define MGSL_MAX_SERIAL_NUMBER 30 | 176 | #define MGSL_MAX_SERIAL_NUMBER 30 |
174 | 177 | ||
175 | /* | 178 | /* |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index c7132029af0f..6a60770984e9 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -55,7 +55,7 @@ enum | |||
55 | CTL_KERN=1, /* General kernel info and control */ | 55 | CTL_KERN=1, /* General kernel info and control */ |
56 | CTL_VM=2, /* VM management */ | 56 | CTL_VM=2, /* VM management */ |
57 | CTL_NET=3, /* Networking */ | 57 | CTL_NET=3, /* Networking */ |
58 | CTL_PROC=4, /* Process info */ | 58 | /* was CTL_PROC */ |
59 | CTL_FS=5, /* Filesystems */ | 59 | CTL_FS=5, /* Filesystems */ |
60 | CTL_DEBUG=6, /* Debugging */ | 60 | CTL_DEBUG=6, /* Debugging */ |
61 | CTL_DEV=7, /* Devices */ | 61 | CTL_DEV=7, /* Devices */ |
@@ -767,8 +767,6 @@ enum { | |||
767 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, | 767 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, |
768 | }; | 768 | }; |
769 | 769 | ||
770 | /* CTL_PROC names: */ | ||
771 | |||
772 | /* CTL_FS names: */ | 770 | /* CTL_FS names: */ |
773 | enum | 771 | enum |
774 | { | 772 | { |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 86b5b4271b5a..914f911325be 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -220,6 +220,19 @@ typedef __u16 __bitwise __fs16; | |||
220 | */ | 220 | */ |
221 | #define UFS_MINFREE 5 | 221 | #define UFS_MINFREE 5 |
222 | #define UFS_DEFAULTOPT UFS_OPTTIME | 222 | #define UFS_DEFAULTOPT UFS_OPTTIME |
223 | |||
224 | /* | ||
225 | * Debug code | ||
226 | */ | ||
227 | #ifdef CONFIG_UFS_DEBUG | ||
228 | # define UFSD(f, a...) { \ | ||
229 | printk ("UFSD (%s, %d): %s:", \ | ||
230 | __FILE__, __LINE__, __FUNCTION__); \ | ||
231 | printk (f, ## a); \ | ||
232 | } | ||
233 | #else | ||
234 | # define UFSD(f, a...) /**/ | ||
235 | #endif | ||
223 | 236 | ||
224 | /* | 237 | /* |
225 | * Turn file system block numbers into disk block addresses. | 238 | * Turn file system block numbers into disk block addresses. |
@@ -339,7 +352,22 @@ struct ufs2_csum_total { | |||
339 | }; | 352 | }; |
340 | 353 | ||
341 | /* | 354 | /* |
355 | * File system flags | ||
356 | */ | ||
357 | #define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */ | ||
358 | #define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */ | ||
359 | #define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */ | ||
360 | #define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */ | ||
361 | #define UFS_ACLS 0x10 /* file system has ACLs enabled */ | ||
362 | #define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */ | ||
363 | #define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */ | ||
364 | |||
365 | #if 0 | ||
366 | /* | ||
342 | * This is the actual superblock, as it is laid out on the disk. | 367 | * This is the actual superblock, as it is laid out on the disk. |
368 | * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and | ||
369 | * it may occupy several blocks, use | ||
370 | * struct ufs_super_block_(first,second,third) instead. | ||
343 | */ | 371 | */ |
344 | struct ufs_super_block { | 372 | struct ufs_super_block { |
345 | __fs32 fs_link; /* UNUSED */ | 373 | __fs32 fs_link; /* UNUSED */ |
@@ -416,7 +444,7 @@ struct ufs_super_block { | |||
416 | __s8 fs_fmod; /* super block modified flag */ | 444 | __s8 fs_fmod; /* super block modified flag */ |
417 | __s8 fs_clean; /* file system is clean flag */ | 445 | __s8 fs_clean; /* file system is clean flag */ |
418 | __s8 fs_ronly; /* mounted read-only flag */ | 446 | __s8 fs_ronly; /* mounted read-only flag */ |
419 | __s8 fs_flags; /* currently unused flag */ | 447 | __s8 fs_flags; |
420 | union { | 448 | union { |
421 | struct { | 449 | struct { |
422 | __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ | 450 | __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ |
@@ -485,6 +513,7 @@ struct ufs_super_block { | |||
485 | __fs32 fs_magic; /* magic number */ | 513 | __fs32 fs_magic; /* magic number */ |
486 | __u8 fs_space[1]; /* list of blocks for each rotation */ | 514 | __u8 fs_space[1]; /* list of blocks for each rotation */ |
487 | }; | 515 | }; |
516 | #endif/*struct ufs_super_block*/ | ||
488 | 517 | ||
489 | /* | 518 | /* |
490 | * Preference for optimization. | 519 | * Preference for optimization. |
@@ -666,7 +695,7 @@ struct ufs_buffer_head { | |||
666 | }; | 695 | }; |
667 | 696 | ||
668 | struct ufs_cg_private_info { | 697 | struct ufs_cg_private_info { |
669 | struct ufs_cylinder_group ucg; | 698 | struct ufs_buffer_head c_ubh; |
670 | __u32 c_cgx; /* number of cylidner group */ | 699 | __u32 c_cgx; /* number of cylidner group */ |
671 | __u16 c_ncyl; /* number of cyl's this cg */ | 700 | __u16 c_ncyl; /* number of cyl's this cg */ |
672 | __u16 c_niblk; /* number of inode blocks this cg */ | 701 | __u16 c_niblk; /* number of inode blocks this cg */ |
@@ -686,6 +715,7 @@ struct ufs_cg_private_info { | |||
686 | 715 | ||
687 | struct ufs_sb_private_info { | 716 | struct ufs_sb_private_info { |
688 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ | 717 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ |
718 | struct ufs2_csum_total cs_total; | ||
689 | __u32 s_sblkno; /* offset of super-blocks in filesys */ | 719 | __u32 s_sblkno; /* offset of super-blocks in filesys */ |
690 | __u32 s_cblkno; /* offset of cg-block in filesys */ | 720 | __u32 s_cblkno; /* offset of cg-block in filesys */ |
691 | __u32 s_iblkno; /* offset of inode-blocks in filesys */ | 721 | __u32 s_iblkno; /* offset of inode-blocks in filesys */ |
@@ -824,16 +854,54 @@ struct ufs_super_block_first { | |||
824 | }; | 854 | }; |
825 | 855 | ||
826 | struct ufs_super_block_second { | 856 | struct ufs_super_block_second { |
827 | __s8 fs_fsmnt[212]; | 857 | union { |
828 | __fs32 fs_cgrotor; | 858 | struct { |
829 | __fs32 fs_csp[UFS_MAXCSBUFS]; | 859 | __s8 fs_fsmnt[212]; |
830 | __fs32 fs_maxcluster; | 860 | __fs32 fs_cgrotor; |
831 | __fs32 fs_cpc; | 861 | __fs32 fs_csp[UFS_MAXCSBUFS]; |
832 | __fs16 fs_opostbl[82]; | 862 | __fs32 fs_maxcluster; |
833 | }; | 863 | __fs32 fs_cpc; |
864 | __fs16 fs_opostbl[82]; | ||
865 | } fs_u1; | ||
866 | struct { | ||
867 | __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212]; | ||
868 | __u8 fs_volname[UFS2_MAXVOLLEN]; | ||
869 | __fs64 fs_swuid; | ||
870 | __fs32 fs_pad; | ||
871 | __fs32 fs_cgrotor; | ||
872 | __fs32 fs_ocsp[UFS2_NOCSPTRS]; | ||
873 | __fs32 fs_contigdirs; | ||
874 | __fs32 fs_csp; | ||
875 | __fs32 fs_maxcluster; | ||
876 | __fs32 fs_active; | ||
877 | __fs32 fs_old_cpc; | ||
878 | __fs32 fs_maxbsize; | ||
879 | __fs64 fs_sparecon64[17]; | ||
880 | __fs64 fs_sblockloc; | ||
881 | __fs64 cs_ndir; | ||
882 | __fs64 cs_nbfree; | ||
883 | } fs_u2; | ||
884 | } fs_un; | ||
885 | }; | ||
834 | 886 | ||
835 | struct ufs_super_block_third { | 887 | struct ufs_super_block_third { |
836 | __fs16 fs_opostbl[46]; | 888 | union { |
889 | struct { | ||
890 | __fs16 fs_opostbl[46]; | ||
891 | } fs_u1; | ||
892 | struct { | ||
893 | __fs64 cs_nifree; /* number of free inodes */ | ||
894 | __fs64 cs_nffree; /* number of free frags */ | ||
895 | __fs64 cs_numclusters; /* number of free clusters */ | ||
896 | __fs64 cs_spare[3]; /* future expansion */ | ||
897 | struct ufs_timeval fs_time; /* last time written */ | ||
898 | __fs64 fs_size; /* number of blocks in fs */ | ||
899 | __fs64 fs_dsize; /* number of data blocks in fs */ | ||
900 | __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ | ||
901 | __fs64 fs_pendingblocks;/* blocks in process of being freed */ | ||
902 | __fs32 fs_pendinginodes;/*inodes in process of being freed */ | ||
903 | } fs_u2; | ||
904 | } fs_un1; | ||
837 | union { | 905 | union { |
838 | struct { | 906 | struct { |
839 | __fs32 fs_sparecon[53];/* reserved for future constants */ | 907 | __fs32 fs_sparecon[53];/* reserved for future constants */ |
@@ -861,7 +929,7 @@ struct ufs_super_block_third { | |||
861 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | 929 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ |
862 | __fs32 fs_state; /* file system state time stamp */ | 930 | __fs32 fs_state; /* file system state time stamp */ |
863 | } fs_44; | 931 | } fs_44; |
864 | } fs_u2; | 932 | } fs_un2; |
865 | __fs32 fs_postblformat; | 933 | __fs32 fs_postblformat; |
866 | __fs32 fs_nrpos; | 934 | __fs32 fs_nrpos; |
867 | __fs32 fs_postbloff; | 935 | __fs32 fs_postbloff; |
@@ -875,7 +943,8 @@ struct ufs_super_block_third { | |||
875 | /* balloc.c */ | 943 | /* balloc.c */ |
876 | extern void ufs_free_fragments (struct inode *, unsigned, unsigned); | 944 | extern void ufs_free_fragments (struct inode *, unsigned, unsigned); |
877 | extern void ufs_free_blocks (struct inode *, unsigned, unsigned); | 945 | extern void ufs_free_blocks (struct inode *, unsigned, unsigned); |
878 | extern unsigned ufs_new_fragments (struct inode *, __fs32 *, unsigned, unsigned, unsigned, int *); | 946 | extern unsigned ufs_new_fragments(struct inode *, __fs32 *, unsigned, unsigned, |
947 | unsigned, int *, struct page *); | ||
879 | 948 | ||
880 | /* cylinder.c */ | 949 | /* cylinder.c */ |
881 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); | 950 | extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); |
@@ -886,11 +955,12 @@ extern struct inode_operations ufs_dir_inode_operations; | |||
886 | extern int ufs_add_link (struct dentry *, struct inode *); | 955 | extern int ufs_add_link (struct dentry *, struct inode *); |
887 | extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); | 956 | extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); |
888 | extern int ufs_make_empty(struct inode *, struct inode *); | 957 | extern int ufs_make_empty(struct inode *, struct inode *); |
889 | extern struct ufs_dir_entry * ufs_find_entry (struct dentry *, struct buffer_head **); | 958 | extern struct ufs_dir_entry *ufs_find_entry(struct inode *, struct dentry *, struct page **); |
890 | extern int ufs_delete_entry (struct inode *, struct ufs_dir_entry *, struct buffer_head *); | 959 | extern int ufs_delete_entry(struct inode *, struct ufs_dir_entry *, struct page *); |
891 | extern int ufs_empty_dir (struct inode *); | 960 | extern int ufs_empty_dir (struct inode *); |
892 | extern struct ufs_dir_entry * ufs_dotdot (struct inode *, struct buffer_head **); | 961 | extern struct ufs_dir_entry *ufs_dotdot(struct inode *, struct page **); |
893 | extern void ufs_set_link(struct inode *, struct ufs_dir_entry *, struct buffer_head *, struct inode *); | 962 | extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, |
963 | struct page *page, struct inode *inode); | ||
894 | 964 | ||
895 | /* file.c */ | 965 | /* file.c */ |
896 | extern struct inode_operations ufs_file_inode_operations; | 966 | extern struct inode_operations ufs_file_inode_operations; |
@@ -903,13 +973,11 @@ extern void ufs_free_inode (struct inode *inode); | |||
903 | extern struct inode * ufs_new_inode (struct inode *, int); | 973 | extern struct inode * ufs_new_inode (struct inode *, int); |
904 | 974 | ||
905 | /* inode.c */ | 975 | /* inode.c */ |
906 | extern u64 ufs_frag_map (struct inode *, sector_t); | ||
907 | extern void ufs_read_inode (struct inode *); | 976 | extern void ufs_read_inode (struct inode *); |
908 | extern void ufs_put_inode (struct inode *); | 977 | extern void ufs_put_inode (struct inode *); |
909 | extern int ufs_write_inode (struct inode *, int); | 978 | extern int ufs_write_inode (struct inode *, int); |
910 | extern int ufs_sync_inode (struct inode *); | 979 | extern int ufs_sync_inode (struct inode *); |
911 | extern void ufs_delete_inode (struct inode *); | 980 | extern void ufs_delete_inode (struct inode *); |
912 | extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *); | ||
913 | extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); | 981 | extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); |
914 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); | 982 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); |
915 | 983 | ||
diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h index 21665a953978..f50ce3b0cd52 100644 --- a/include/linux/ufs_fs_i.h +++ b/include/linux/ufs_fs_i.h | |||
@@ -27,6 +27,7 @@ struct ufs_inode_info { | |||
27 | __u32 i_oeftflag; | 27 | __u32 i_oeftflag; |
28 | __u16 i_osync; | 28 | __u16 i_osync; |
29 | __u32 i_lastfrag; | 29 | __u32 i_lastfrag; |
30 | __u32 i_dir_start_lookup; | ||
30 | struct inode vfs_inode; | 31 | struct inode vfs_inode; |
31 | }; | 32 | }; |
32 | 33 | ||