diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/alpha | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/alpha')
44 files changed, 357 insertions, 545 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 443448154f32..75291fdd379f 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -9,6 +9,8 @@ config ALPHA | |||
9 | select HAVE_IDE | 9 | select HAVE_IDE |
10 | select HAVE_OPROFILE | 10 | select HAVE_OPROFILE |
11 | select HAVE_SYSCALL_WRAPPERS | 11 | select HAVE_SYSCALL_WRAPPERS |
12 | select HAVE_PERF_EVENTS | ||
13 | select HAVE_DMA_ATTRS | ||
12 | help | 14 | help |
13 | The Alpha is a 64-bit general-purpose processor designed and | 15 | The Alpha is a 64-bit general-purpose processor designed and |
14 | marketed by the Digital Equipment Corporation of blessed memory, | 16 | marketed by the Digital Equipment Corporation of blessed memory, |
@@ -57,6 +59,9 @@ config ZONE_DMA | |||
57 | bool | 59 | bool |
58 | default y | 60 | default y |
59 | 61 | ||
62 | config NEED_DMA_MAP_STATE | ||
63 | def_bool y | ||
64 | |||
60 | config GENERIC_ISA_DMA | 65 | config GENERIC_ISA_DMA |
61 | bool | 66 | bool |
62 | default y | 67 | default y |
diff --git a/arch/alpha/boot/bootp.c b/arch/alpha/boot/bootp.c index 3af21c789339..be61670d4096 100644 --- a/arch/alpha/boot/bootp.c +++ b/arch/alpha/boot/bootp.c | |||
@@ -8,8 +8,9 @@ | |||
8 | * based significantly on the arch/alpha/boot/main.c of Linus Torvalds | 8 | * based significantly on the arch/alpha/boot/main.c of Linus Torvalds |
9 | */ | 9 | */ |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/slab.h> | ||
11 | #include <linux/string.h> | 12 | #include <linux/string.h> |
12 | #include <linux/utsrelease.h> | 13 | #include <generated/utsrelease.h> |
13 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
14 | 15 | ||
15 | #include <asm/system.h> | 16 | #include <asm/system.h> |
diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c index 1036b515e20c..c98865f21423 100644 --- a/arch/alpha/boot/bootpz.c +++ b/arch/alpha/boot/bootpz.c | |||
@@ -10,8 +10,9 @@ | |||
10 | * and the decompression code from MILO. | 10 | * and the decompression code from MILO. |
11 | */ | 11 | */ |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/slab.h> | ||
13 | #include <linux/string.h> | 14 | #include <linux/string.h> |
14 | #include <linux/utsrelease.h> | 15 | #include <generated/utsrelease.h> |
15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
16 | 17 | ||
17 | #include <asm/system.h> | 18 | #include <asm/system.h> |
diff --git a/arch/alpha/boot/main.c b/arch/alpha/boot/main.c index 89f3be071ae5..ded57d9a80e1 100644 --- a/arch/alpha/boot/main.c +++ b/arch/alpha/boot/main.c | |||
@@ -6,8 +6,9 @@ | |||
6 | * This file is the bootloader for the Linux/AXP kernel | 6 | * This file is the bootloader for the Linux/AXP kernel |
7 | */ | 7 | */ |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/slab.h> | ||
9 | #include <linux/string.h> | 10 | #include <linux/string.h> |
10 | #include <linux/utsrelease.h> | 11 | #include <generated/utsrelease.h> |
11 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
12 | 13 | ||
13 | #include <asm/system.h> | 14 | #include <asm/system.h> |
diff --git a/arch/alpha/boot/misc.c b/arch/alpha/boot/misc.c index 3047a1b3a517..3ff9a957a25c 100644 --- a/arch/alpha/boot/misc.c +++ b/arch/alpha/boot/misc.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/slab.h> | ||
22 | 23 | ||
23 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
24 | 25 | ||
diff --git a/arch/alpha/include/asm/asm-offsets.h b/arch/alpha/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/alpha/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/alpha/include/asm/bug.h b/arch/alpha/include/asm/bug.h index 1720c8ad86fe..f091682e3cc8 100644 --- a/arch/alpha/include/asm/bug.h +++ b/arch/alpha/include/asm/bug.h | |||
@@ -13,7 +13,8 @@ | |||
13 | "call_pal %0 # bugchk\n\t" \ | 13 | "call_pal %0 # bugchk\n\t" \ |
14 | ".long %1\n\t.8byte %2" \ | 14 | ".long %1\n\t.8byte %2" \ |
15 | : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ | 15 | : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ |
16 | for ( ; ; ); } while (0) | 16 | unreachable(); \ |
17 | } while (0) | ||
17 | 18 | ||
18 | #define HAVE_ARCH_BUG | 19 | #define HAVE_ARCH_BUG |
19 | #endif | 20 | #endif |
diff --git a/arch/alpha/include/asm/cacheflush.h b/arch/alpha/include/asm/cacheflush.h index b686cc7fc44e..01d71e1c8a9e 100644 --- a/arch/alpha/include/asm/cacheflush.h +++ b/arch/alpha/include/asm/cacheflush.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define flush_cache_dup_mm(mm) do { } while (0) | 9 | #define flush_cache_dup_mm(mm) do { } while (0) |
10 | #define flush_cache_range(vma, start, end) do { } while (0) | 10 | #define flush_cache_range(vma, start, end) do { } while (0) |
11 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) | 11 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) |
12 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 | ||
12 | #define flush_dcache_page(page) do { } while (0) | 13 | #define flush_dcache_page(page) do { } while (0) |
13 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 14 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
14 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 15 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
diff --git a/arch/alpha/include/asm/core_marvel.h b/arch/alpha/include/asm/core_marvel.h index 30d55fe7aaf6..dad300fa14ce 100644 --- a/arch/alpha/include/asm/core_marvel.h +++ b/arch/alpha/include/asm/core_marvel.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #define __ALPHA_MARVEL__H__ | 12 | #define __ALPHA_MARVEL__H__ |
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/pci.h> | ||
16 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
17 | 16 | ||
18 | #include <asm/compiler.h> | 17 | #include <asm/compiler.h> |
diff --git a/arch/alpha/include/asm/core_mcpcia.h b/arch/alpha/include/asm/core_mcpcia.h index acf55b483472..21ac53383b37 100644 --- a/arch/alpha/include/asm/core_mcpcia.h +++ b/arch/alpha/include/asm/core_mcpcia.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #define MCPCIA_ONE_HAE_WINDOW 1 | 6 | #define MCPCIA_ONE_HAE_WINDOW 1 |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/pci.h> | ||
10 | #include <asm/compiler.h> | 9 | #include <asm/compiler.h> |
11 | 10 | ||
12 | /* | 11 | /* |
diff --git a/arch/alpha/include/asm/core_t2.h b/arch/alpha/include/asm/core_t2.h index 46bfff58f670..471c07292e0b 100644 --- a/arch/alpha/include/asm/core_t2.h +++ b/arch/alpha/include/asm/core_t2.h | |||
@@ -435,7 +435,7 @@ extern inline void t2_outl(u32 b, unsigned long addr) | |||
435 | set_hae(msb); \ | 435 | set_hae(msb); \ |
436 | } | 436 | } |
437 | 437 | ||
438 | extern spinlock_t t2_hae_lock; | 438 | extern raw_spinlock_t t2_hae_lock; |
439 | 439 | ||
440 | /* | 440 | /* |
441 | * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since | 441 | * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since |
@@ -448,12 +448,12 @@ __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) | |||
448 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 448 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
449 | unsigned long result, msb; | 449 | unsigned long result, msb; |
450 | unsigned long flags; | 450 | unsigned long flags; |
451 | spin_lock_irqsave(&t2_hae_lock, flags); | 451 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
452 | 452 | ||
453 | t2_set_hae; | 453 | t2_set_hae; |
454 | 454 | ||
455 | result = *(vip) ((addr << 5) + T2_SPARSE_MEM + 0x00); | 455 | result = *(vip) ((addr << 5) + T2_SPARSE_MEM + 0x00); |
456 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 456 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
457 | return __kernel_extbl(result, addr & 3); | 457 | return __kernel_extbl(result, addr & 3); |
458 | } | 458 | } |
459 | 459 | ||
@@ -462,12 +462,12 @@ __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr) | |||
462 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 462 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
463 | unsigned long result, msb; | 463 | unsigned long result, msb; |
464 | unsigned long flags; | 464 | unsigned long flags; |
465 | spin_lock_irqsave(&t2_hae_lock, flags); | 465 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
466 | 466 | ||
467 | t2_set_hae; | 467 | t2_set_hae; |
468 | 468 | ||
469 | result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08); | 469 | result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08); |
470 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 470 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
471 | return __kernel_extwl(result, addr & 3); | 471 | return __kernel_extwl(result, addr & 3); |
472 | } | 472 | } |
473 | 473 | ||
@@ -480,12 +480,12 @@ __EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr) | |||
480 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 480 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
481 | unsigned long result, msb; | 481 | unsigned long result, msb; |
482 | unsigned long flags; | 482 | unsigned long flags; |
483 | spin_lock_irqsave(&t2_hae_lock, flags); | 483 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
484 | 484 | ||
485 | t2_set_hae; | 485 | t2_set_hae; |
486 | 486 | ||
487 | result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18); | 487 | result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18); |
488 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 488 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
489 | return result & 0xffffffffUL; | 489 | return result & 0xffffffffUL; |
490 | } | 490 | } |
491 | 491 | ||
@@ -494,14 +494,14 @@ __EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr) | |||
494 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 494 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
495 | unsigned long r0, r1, work, msb; | 495 | unsigned long r0, r1, work, msb; |
496 | unsigned long flags; | 496 | unsigned long flags; |
497 | spin_lock_irqsave(&t2_hae_lock, flags); | 497 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
498 | 498 | ||
499 | t2_set_hae; | 499 | t2_set_hae; |
500 | 500 | ||
501 | work = (addr << 5) + T2_SPARSE_MEM + 0x18; | 501 | work = (addr << 5) + T2_SPARSE_MEM + 0x18; |
502 | r0 = *(vuip)(work); | 502 | r0 = *(vuip)(work); |
503 | r1 = *(vuip)(work + (4 << 5)); | 503 | r1 = *(vuip)(work + (4 << 5)); |
504 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 504 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
505 | return r1 << 32 | r0; | 505 | return r1 << 32 | r0; |
506 | } | 506 | } |
507 | 507 | ||
@@ -510,13 +510,13 @@ __EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr) | |||
510 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 510 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
511 | unsigned long msb, w; | 511 | unsigned long msb, w; |
512 | unsigned long flags; | 512 | unsigned long flags; |
513 | spin_lock_irqsave(&t2_hae_lock, flags); | 513 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
514 | 514 | ||
515 | t2_set_hae; | 515 | t2_set_hae; |
516 | 516 | ||
517 | w = __kernel_insbl(b, addr & 3); | 517 | w = __kernel_insbl(b, addr & 3); |
518 | *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = w; | 518 | *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = w; |
519 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 519 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
520 | } | 520 | } |
521 | 521 | ||
522 | __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr) | 522 | __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr) |
@@ -524,13 +524,13 @@ __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr) | |||
524 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 524 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
525 | unsigned long msb, w; | 525 | unsigned long msb, w; |
526 | unsigned long flags; | 526 | unsigned long flags; |
527 | spin_lock_irqsave(&t2_hae_lock, flags); | 527 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
528 | 528 | ||
529 | t2_set_hae; | 529 | t2_set_hae; |
530 | 530 | ||
531 | w = __kernel_inswl(b, addr & 3); | 531 | w = __kernel_inswl(b, addr & 3); |
532 | *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08) = w; | 532 | *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08) = w; |
533 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 533 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
534 | } | 534 | } |
535 | 535 | ||
536 | /* | 536 | /* |
@@ -542,12 +542,12 @@ __EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr) | |||
542 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 542 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
543 | unsigned long msb; | 543 | unsigned long msb; |
544 | unsigned long flags; | 544 | unsigned long flags; |
545 | spin_lock_irqsave(&t2_hae_lock, flags); | 545 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
546 | 546 | ||
547 | t2_set_hae; | 547 | t2_set_hae; |
548 | 548 | ||
549 | *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b; | 549 | *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b; |
550 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 550 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
551 | } | 551 | } |
552 | 552 | ||
553 | __EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr) | 553 | __EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr) |
@@ -555,14 +555,14 @@ __EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr) | |||
555 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; | 555 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
556 | unsigned long msb, work; | 556 | unsigned long msb, work; |
557 | unsigned long flags; | 557 | unsigned long flags; |
558 | spin_lock_irqsave(&t2_hae_lock, flags); | 558 | raw_spin_lock_irqsave(&t2_hae_lock, flags); |
559 | 559 | ||
560 | t2_set_hae; | 560 | t2_set_hae; |
561 | 561 | ||
562 | work = (addr << 5) + T2_SPARSE_MEM + 0x18; | 562 | work = (addr << 5) + T2_SPARSE_MEM + 0x18; |
563 | *(vuip)work = b; | 563 | *(vuip)work = b; |
564 | *(vuip)(work + (4 << 5)) = b >> 32; | 564 | *(vuip)(work + (4 << 5)) = b >> 32; |
565 | spin_unlock_irqrestore(&t2_hae_lock, flags); | 565 | raw_spin_unlock_irqrestore(&t2_hae_lock, flags); |
566 | } | 566 | } |
567 | 567 | ||
568 | __EXTERN_INLINE void __iomem *t2_ioportmap(unsigned long addr) | 568 | __EXTERN_INLINE void __iomem *t2_ioportmap(unsigned long addr) |
diff --git a/arch/alpha/include/asm/core_titan.h b/arch/alpha/include/asm/core_titan.h index a17f6f33b68e..8cf79d1219e1 100644 --- a/arch/alpha/include/asm/core_titan.h +++ b/arch/alpha/include/asm/core_titan.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define __ALPHA_TITAN__H__ | 2 | #define __ALPHA_TITAN__H__ |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/pci.h> | ||
6 | #include <asm/compiler.h> | 5 | #include <asm/compiler.h> |
7 | 6 | ||
8 | /* | 7 | /* |
diff --git a/arch/alpha/include/asm/core_tsunami.h b/arch/alpha/include/asm/core_tsunami.h index 58d4fe48742c..8e39ecf09419 100644 --- a/arch/alpha/include/asm/core_tsunami.h +++ b/arch/alpha/include/asm/core_tsunami.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define __ALPHA_TSUNAMI__H__ | 2 | #define __ALPHA_TSUNAMI__H__ |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/pci.h> | ||
6 | #include <asm/compiler.h> | 5 | #include <asm/compiler.h> |
7 | 6 | ||
8 | /* | 7 | /* |
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index 04eb5681448c..1bce8169733c 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h | |||
@@ -1,71 +1,49 @@ | |||
1 | #ifndef _ALPHA_DMA_MAPPING_H | 1 | #ifndef _ALPHA_DMA_MAPPING_H |
2 | #define _ALPHA_DMA_MAPPING_H | 2 | #define _ALPHA_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <linux/dma-attrs.h> | ||
4 | 5 | ||
5 | #ifdef CONFIG_PCI | 6 | extern struct dma_map_ops *dma_ops; |
6 | 7 | ||
7 | #include <linux/pci.h> | 8 | static inline struct dma_map_ops *get_dma_ops(struct device *dev) |
9 | { | ||
10 | return dma_ops; | ||
11 | } | ||
8 | 12 | ||
9 | #define dma_map_single(dev, va, size, dir) \ | 13 | #include <asm-generic/dma-mapping-common.h> |
10 | pci_map_single(alpha_gendev_to_pci(dev), va, size, dir) | ||
11 | #define dma_unmap_single(dev, addr, size, dir) \ | ||
12 | pci_unmap_single(alpha_gendev_to_pci(dev), addr, size, dir) | ||
13 | #define dma_alloc_coherent(dev, size, addr, gfp) \ | ||
14 | __pci_alloc_consistent(alpha_gendev_to_pci(dev), size, addr, gfp) | ||
15 | #define dma_free_coherent(dev, size, va, addr) \ | ||
16 | pci_free_consistent(alpha_gendev_to_pci(dev), size, va, addr) | ||
17 | #define dma_map_page(dev, page, off, size, dir) \ | ||
18 | pci_map_page(alpha_gendev_to_pci(dev), page, off, size, dir) | ||
19 | #define dma_unmap_page(dev, addr, size, dir) \ | ||
20 | pci_unmap_page(alpha_gendev_to_pci(dev), addr, size, dir) | ||
21 | #define dma_map_sg(dev, sg, nents, dir) \ | ||
22 | pci_map_sg(alpha_gendev_to_pci(dev), sg, nents, dir) | ||
23 | #define dma_unmap_sg(dev, sg, nents, dir) \ | ||
24 | pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir) | ||
25 | #define dma_supported(dev, mask) \ | ||
26 | pci_dma_supported(alpha_gendev_to_pci(dev), mask) | ||
27 | #define dma_mapping_error(dev, addr) \ | ||
28 | pci_dma_mapping_error(alpha_gendev_to_pci(dev), addr) | ||
29 | 14 | ||
30 | #else /* no PCI - no IOMMU. */ | 15 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
16 | dma_addr_t *dma_handle, gfp_t gfp) | ||
17 | { | ||
18 | return get_dma_ops(dev)->alloc_coherent(dev, size, dma_handle, gfp); | ||
19 | } | ||
31 | 20 | ||
32 | #include <asm/io.h> /* for virt_to_phys() */ | 21 | static inline void dma_free_coherent(struct device *dev, size_t size, |
22 | void *vaddr, dma_addr_t dma_handle) | ||
23 | { | ||
24 | get_dma_ops(dev)->free_coherent(dev, size, vaddr, dma_handle); | ||
25 | } | ||
33 | 26 | ||
34 | struct scatterlist; | 27 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
35 | void *dma_alloc_coherent(struct device *dev, size_t size, | 28 | { |
36 | dma_addr_t *dma_handle, gfp_t gfp); | 29 | return get_dma_ops(dev)->mapping_error(dev, dma_addr); |
37 | int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | 30 | } |
38 | enum dma_data_direction direction); | ||
39 | 31 | ||
40 | #define dma_free_coherent(dev, size, va, addr) \ | 32 | static inline int dma_supported(struct device *dev, u64 mask) |
41 | free_pages((unsigned long)va, get_order(size)) | 33 | { |
42 | #define dma_supported(dev, mask) (mask < 0x00ffffffUL ? 0 : 1) | 34 | return get_dma_ops(dev)->dma_supported(dev, mask); |
43 | #define dma_map_single(dev, va, size, dir) virt_to_phys(va) | 35 | } |
44 | #define dma_map_page(dev, page, off, size, dir) (page_to_pa(page) + off) | ||
45 | 36 | ||
46 | #define dma_unmap_single(dev, addr, size, dir) ((void)0) | 37 | static inline int dma_set_mask(struct device *dev, u64 mask) |
47 | #define dma_unmap_page(dev, addr, size, dir) ((void)0) | 38 | { |
48 | #define dma_unmap_sg(dev, sg, nents, dir) ((void)0) | 39 | return get_dma_ops(dev)->set_dma_mask(dev, mask); |
49 | 40 | } | |
50 | #define dma_mapping_error(dev, addr) (0) | ||
51 | |||
52 | #endif /* !CONFIG_PCI */ | ||
53 | 41 | ||
54 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 42 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
55 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 43 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
56 | #define dma_is_consistent(d, h) (1) | 44 | #define dma_is_consistent(d, h) (1) |
57 | 45 | ||
58 | int dma_set_mask(struct device *dev, u64 mask); | ||
59 | |||
60 | #define dma_sync_single_for_cpu(dev, addr, size, dir) ((void)0) | ||
61 | #define dma_sync_single_for_device(dev, addr, size, dir) ((void)0) | ||
62 | #define dma_sync_single_range(dev, addr, off, size, dir) ((void)0) | ||
63 | #define dma_sync_sg_for_cpu(dev, sg, nents, dir) ((void)0) | ||
64 | #define dma_sync_sg_for_device(dev, sg, nents, dir) ((void)0) | ||
65 | #define dma_cache_sync(dev, va, size, dir) ((void)0) | 46 | #define dma_cache_sync(dev, va, size, dir) ((void)0) |
66 | #define dma_sync_single_range_for_cpu(dev, addr, offset, size, dir) ((void)0) | ||
67 | #define dma_sync_single_range_for_device(dev, addr, offset, size, dir) ((void)0) | ||
68 | |||
69 | #define dma_get_cache_alignment() L1_CACHE_BYTES | 47 | #define dma_get_cache_alignment() L1_CACHE_BYTES |
70 | 48 | ||
71 | #endif /* _ALPHA_DMA_MAPPING_H */ | 49 | #endif /* _ALPHA_DMA_MAPPING_H */ |
diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h index 5c75c1b2352a..9baae8afe8a3 100644 --- a/arch/alpha/include/asm/elf.h +++ b/arch/alpha/include/asm/elf.h | |||
@@ -81,7 +81,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |||
81 | #define ELF_DATA ELFDATA2LSB | 81 | #define ELF_DATA ELFDATA2LSB |
82 | #define ELF_ARCH EM_ALPHA | 82 | #define ELF_ARCH EM_ALPHA |
83 | 83 | ||
84 | #define USE_ELF_CORE_DUMP | ||
85 | #define ELF_EXEC_PAGESIZE 8192 | 84 | #define ELF_EXEC_PAGESIZE 8192 |
86 | 85 | ||
87 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | 86 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical |
diff --git a/arch/alpha/include/asm/fcntl.h b/arch/alpha/include/asm/fcntl.h index 25da0017ec87..70145cbb21cb 100644 --- a/arch/alpha/include/asm/fcntl.h +++ b/arch/alpha/include/asm/fcntl.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ALPHA_FCNTL_H | 1 | #ifndef _ALPHA_FCNTL_H |
2 | #define _ALPHA_FCNTL_H | 2 | #define _ALPHA_FCNTL_H |
3 | 3 | ||
4 | /* open/fcntl - O_SYNC is only implemented on blocks devices and on files | ||
5 | located on an ext2 file system */ | ||
6 | #define O_CREAT 01000 /* not fcntl */ | 4 | #define O_CREAT 01000 /* not fcntl */ |
7 | #define O_TRUNC 02000 /* not fcntl */ | 5 | #define O_TRUNC 02000 /* not fcntl */ |
8 | #define O_EXCL 04000 /* not fcntl */ | 6 | #define O_EXCL 04000 /* not fcntl */ |
@@ -10,13 +8,28 @@ | |||
10 | 8 | ||
11 | #define O_NONBLOCK 00004 | 9 | #define O_NONBLOCK 00004 |
12 | #define O_APPEND 00010 | 10 | #define O_APPEND 00010 |
13 | #define O_SYNC 040000 | 11 | #define O_DSYNC 040000 /* used to be O_SYNC, see below */ |
14 | #define O_DIRECTORY 0100000 /* must be a directory */ | 12 | #define O_DIRECTORY 0100000 /* must be a directory */ |
15 | #define O_NOFOLLOW 0200000 /* don't follow links */ | 13 | #define O_NOFOLLOW 0200000 /* don't follow links */ |
16 | #define O_LARGEFILE 0400000 /* will be set by the kernel on every open */ | 14 | #define O_LARGEFILE 0400000 /* will be set by the kernel on every open */ |
17 | #define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */ | 15 | #define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */ |
18 | #define O_NOATIME 04000000 | 16 | #define O_NOATIME 04000000 |
19 | #define O_CLOEXEC 010000000 /* set close_on_exec */ | 17 | #define O_CLOEXEC 010000000 /* set close_on_exec */ |
18 | /* | ||
19 | * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using | ||
20 | * the O_SYNC flag. We continue to use the existing numerical value | ||
21 | * for O_DSYNC semantics now, but using the correct symbolic name for it. | ||
22 | * This new value is used to request true Posix O_SYNC semantics. It is | ||
23 | * defined in this strange way to make sure applications compiled against | ||
24 | * new headers get at least O_DSYNC semantics on older kernels. | ||
25 | * | ||
26 | * This has the nice side-effect that we can simply test for O_DSYNC | ||
27 | * wherever we do not care if O_DSYNC or O_SYNC is used. | ||
28 | * | ||
29 | * Note: __O_SYNC must never be used directly. | ||
30 | */ | ||
31 | #define __O_SYNC 020000000 | ||
32 | #define O_SYNC (__O_SYNC|O_DSYNC) | ||
20 | 33 | ||
21 | #define F_GETLK 7 | 34 | #define F_GETLK 7 |
22 | #define F_SETLK 8 | 35 | #define F_SETLK 8 |
diff --git a/arch/alpha/include/asm/local.h b/arch/alpha/include/asm/local.h index 6ad3ea696421..b9e3e3318371 100644 --- a/arch/alpha/include/asm/local.h +++ b/arch/alpha/include/asm/local.h | |||
@@ -98,21 +98,4 @@ static __inline__ long local_sub_return(long i, local_t * l) | |||
98 | #define __local_add(i,l) ((l)->a.counter+=(i)) | 98 | #define __local_add(i,l) ((l)->a.counter+=(i)) |
99 | #define __local_sub(i,l) ((l)->a.counter-=(i)) | 99 | #define __local_sub(i,l) ((l)->a.counter-=(i)) |
100 | 100 | ||
101 | /* Use these for per-cpu local_t variables: on some archs they are | ||
102 | * much more efficient than these naive implementations. Note they take | ||
103 | * a variable, not an address. | ||
104 | */ | ||
105 | #define cpu_local_read(l) local_read(&__get_cpu_var(l)) | ||
106 | #define cpu_local_set(l, i) local_set(&__get_cpu_var(l), (i)) | ||
107 | |||
108 | #define cpu_local_inc(l) local_inc(&__get_cpu_var(l)) | ||
109 | #define cpu_local_dec(l) local_dec(&__get_cpu_var(l)) | ||
110 | #define cpu_local_add(i, l) local_add((i), &__get_cpu_var(l)) | ||
111 | #define cpu_local_sub(i, l) local_sub((i), &__get_cpu_var(l)) | ||
112 | |||
113 | #define __cpu_local_inc(l) __local_inc(&__get_cpu_var(l)) | ||
114 | #define __cpu_local_dec(l) __local_dec(&__get_cpu_var(l)) | ||
115 | #define __cpu_local_add(i, l) __local_add((i), &__get_cpu_var(l)) | ||
116 | #define __cpu_local_sub(i, l) __local_sub((i), &__get_cpu_var(l)) | ||
117 | |||
118 | #endif /* _ALPHA_LOCAL_H */ | 101 | #endif /* _ALPHA_LOCAL_H */ |
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h index dd8dcabf160f..28d0497fd3c7 100644 --- a/arch/alpha/include/asm/pci.h +++ b/arch/alpha/include/asm/pci.h | |||
@@ -70,142 +70,11 @@ extern inline void pcibios_penalize_isa_irq(int irq, int active) | |||
70 | decisions. */ | 70 | decisions. */ |
71 | #define PCI_DMA_BUS_IS_PHYS 0 | 71 | #define PCI_DMA_BUS_IS_PHYS 0 |
72 | 72 | ||
73 | /* Allocate and map kernel buffer using consistent mode DMA for PCI | 73 | #ifdef CONFIG_PCI |
74 | device. Returns non-NULL cpu-view pointer to the buffer if | ||
75 | successful and sets *DMA_ADDRP to the pci side dma address as well, | ||
76 | else DMA_ADDRP is undefined. */ | ||
77 | |||
78 | extern void *__pci_alloc_consistent(struct pci_dev *, size_t, | ||
79 | dma_addr_t *, gfp_t); | ||
80 | static inline void * | ||
81 | pci_alloc_consistent(struct pci_dev *dev, size_t size, dma_addr_t *dma) | ||
82 | { | ||
83 | return __pci_alloc_consistent(dev, size, dma, GFP_ATOMIC); | ||
84 | } | ||
85 | |||
86 | /* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must | ||
87 | be values that were returned from pci_alloc_consistent. SIZE must | ||
88 | be the same as what as passed into pci_alloc_consistent. | ||
89 | References to the memory and mappings associated with CPU_ADDR or | ||
90 | DMA_ADDR past this call are illegal. */ | ||
91 | |||
92 | extern void pci_free_consistent(struct pci_dev *, size_t, void *, dma_addr_t); | ||
93 | |||
94 | /* Map a single buffer of the indicate size for PCI DMA in streaming mode. | ||
95 | The 32-bit PCI bus mastering address to use is returned. Once the device | ||
96 | is given the dma address, the device owns this memory until either | ||
97 | pci_unmap_single or pci_dma_sync_single_for_cpu is performed. */ | ||
98 | |||
99 | extern dma_addr_t pci_map_single(struct pci_dev *, void *, size_t, int); | ||
100 | |||
101 | /* Likewise, but for a page instead of an address. */ | ||
102 | extern dma_addr_t pci_map_page(struct pci_dev *, struct page *, | ||
103 | unsigned long, size_t, int); | ||
104 | |||
105 | /* Test for pci_map_single or pci_map_page having generated an error. */ | ||
106 | |||
107 | static inline int | ||
108 | pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr) | ||
109 | { | ||
110 | return dma_addr == 0; | ||
111 | } | ||
112 | |||
113 | /* Unmap a single streaming mode DMA translation. The DMA_ADDR and | ||
114 | SIZE must match what was provided for in a previous pci_map_single | ||
115 | call. All other usages are undefined. After this call, reads by | ||
116 | the cpu to the buffer are guaranteed to see whatever the device | ||
117 | wrote there. */ | ||
118 | |||
119 | extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int); | ||
120 | extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int); | ||
121 | |||
122 | /* pci_unmap_{single,page} is not a nop, thus... */ | ||
123 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | ||
124 | dma_addr_t ADDR_NAME; | ||
125 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | ||
126 | __u32 LEN_NAME; | ||
127 | #define pci_unmap_addr(PTR, ADDR_NAME) \ | ||
128 | ((PTR)->ADDR_NAME) | ||
129 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
130 | (((PTR)->ADDR_NAME) = (VAL)) | ||
131 | #define pci_unmap_len(PTR, LEN_NAME) \ | ||
132 | ((PTR)->LEN_NAME) | ||
133 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
134 | (((PTR)->LEN_NAME) = (VAL)) | ||
135 | |||
136 | /* Map a set of buffers described by scatterlist in streaming mode for | ||
137 | PCI DMA. This is the scatter-gather version of the above | ||
138 | pci_map_single interface. Here the scatter gather list elements | ||
139 | are each tagged with the appropriate PCI dma address and length. | ||
140 | They are obtained via sg_dma_{address,length}(SG). | ||
141 | |||
142 | NOTE: An implementation may be able to use a smaller number of DMA | ||
143 | address/length pairs than there are SG table elements. (for | ||
144 | example via virtual mapping capabilities) The routine returns the | ||
145 | number of addr/length pairs actually used, at most nents. | ||
146 | |||
147 | Device ownership issues as mentioned above for pci_map_single are | ||
148 | the same here. */ | ||
149 | |||
150 | extern int pci_map_sg(struct pci_dev *, struct scatterlist *, int, int); | ||
151 | |||
152 | /* Unmap a set of streaming mode DMA translations. Again, cpu read | ||
153 | rules concerning calls here are the same as for pci_unmap_single() | ||
154 | above. */ | ||
155 | |||
156 | extern void pci_unmap_sg(struct pci_dev *, struct scatterlist *, int, int); | ||
157 | |||
158 | /* Make physical memory consistent for a single streaming mode DMA | ||
159 | translation after a transfer and device currently has ownership | ||
160 | of the buffer. | ||
161 | |||
162 | If you perform a pci_map_single() but wish to interrogate the | ||
163 | buffer using the cpu, yet do not wish to teardown the PCI dma | ||
164 | mapping, you must call this function before doing so. At the next | ||
165 | point you give the PCI dma address back to the card, you must first | ||
166 | perform a pci_dma_sync_for_device, and then the device again owns | ||
167 | the buffer. */ | ||
168 | |||
169 | static inline void | ||
170 | pci_dma_sync_single_for_cpu(struct pci_dev *dev, dma_addr_t dma_addr, | ||
171 | long size, int direction) | ||
172 | { | ||
173 | /* Nothing to do. */ | ||
174 | } | ||
175 | |||
176 | static inline void | ||
177 | pci_dma_sync_single_for_device(struct pci_dev *dev, dma_addr_t dma_addr, | ||
178 | size_t size, int direction) | ||
179 | { | ||
180 | /* Nothing to do. */ | ||
181 | } | ||
182 | |||
183 | /* Make physical memory consistent for a set of streaming mode DMA | ||
184 | translations after a transfer. The same as pci_dma_sync_single_* | ||
185 | but for a scatter-gather list, same rules and usage. */ | ||
186 | |||
187 | static inline void | ||
188 | pci_dma_sync_sg_for_cpu(struct pci_dev *dev, struct scatterlist *sg, | ||
189 | int nents, int direction) | ||
190 | { | ||
191 | /* Nothing to do. */ | ||
192 | } | ||
193 | |||
194 | static inline void | ||
195 | pci_dma_sync_sg_for_device(struct pci_dev *dev, struct scatterlist *sg, | ||
196 | int nents, int direction) | ||
197 | { | ||
198 | /* Nothing to do. */ | ||
199 | } | ||
200 | |||
201 | /* Return whether the given PCI device DMA address mask can | ||
202 | be supported properly. For example, if your device can | ||
203 | only drive the low 24-bits during PCI bus mastering, then | ||
204 | you would pass 0x00ffffff as the mask to this function. */ | ||
205 | 74 | ||
206 | extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask); | 75 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ |
76 | #include <asm-generic/pci-dma-compat.h> | ||
207 | 77 | ||
208 | #ifdef CONFIG_PCI | ||
209 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | 78 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, |
210 | enum pci_dma_burst_strategy *strat, | 79 | enum pci_dma_burst_strategy *strat, |
211 | unsigned long *strategy_parameter) | 80 | unsigned long *strategy_parameter) |
@@ -244,8 +113,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
244 | return hose->need_domain_info; | 113 | return hose->need_domain_info; |
245 | } | 114 | } |
246 | 115 | ||
247 | struct pci_dev *alpha_gendev_to_pci(struct device *dev); | ||
248 | |||
249 | #endif /* __KERNEL__ */ | 116 | #endif /* __KERNEL__ */ |
250 | 117 | ||
251 | /* Values for the `which' argument to sys_pciconfig_iobase. */ | 118 | /* Values for the `which' argument to sys_pciconfig_iobase. */ |
diff --git a/arch/alpha/include/asm/perf_event.h b/arch/alpha/include/asm/perf_event.h new file mode 100644 index 000000000000..3bef8522017c --- /dev/null +++ b/arch/alpha/include/asm/perf_event.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef __ASM_ALPHA_PERF_EVENT_H | ||
2 | #define __ASM_ALPHA_PERF_EVENT_H | ||
3 | |||
4 | /* Alpha only supports software events through this interface. */ | ||
5 | static inline void set_perf_event_pending(void) { } | ||
6 | |||
7 | #define PERF_EVENT_INDEX_OFFSET 0 | ||
8 | |||
9 | #endif /* __ASM_ALPHA_PERF_EVENT_H */ | ||
diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h index 3f0c59f6d8aa..71a243294142 100644 --- a/arch/alpha/include/asm/pgtable.h +++ b/arch/alpha/include/asm/pgtable.h | |||
@@ -329,7 +329,7 @@ extern pgd_t swapper_pg_dir[1024]; | |||
329 | * tables contain all the necessary information. | 329 | * tables contain all the necessary information. |
330 | */ | 330 | */ |
331 | extern inline void update_mmu_cache(struct vm_area_struct * vma, | 331 | extern inline void update_mmu_cache(struct vm_area_struct * vma, |
332 | unsigned long address, pte_t pte) | 332 | unsigned long address, pte_t *ptep) |
333 | { | 333 | { |
334 | } | 334 | } |
335 | 335 | ||
diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h index 32c7a5cddd59..65cf3e28e2f4 100644 --- a/arch/alpha/include/asm/ptrace.h +++ b/arch/alpha/include/asm/ptrace.h | |||
@@ -68,6 +68,7 @@ struct switch_stack { | |||
68 | 68 | ||
69 | #ifdef __KERNEL__ | 69 | #ifdef __KERNEL__ |
70 | 70 | ||
71 | #define arch_has_single_step() (1) | ||
71 | #define user_mode(regs) (((regs)->ps & 8) != 0) | 72 | #define user_mode(regs) (((regs)->ps & 8) != 0) |
72 | #define instruction_pointer(regs) ((regs)->pc) | 73 | #define instruction_pointer(regs) ((regs)->pc) |
73 | #define profile_pc(regs) instruction_pointer(regs) | 74 | #define profile_pc(regs) instruction_pointer(regs) |
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h index 26773e3246e2..06edfefc3373 100644 --- a/arch/alpha/include/asm/socket.h +++ b/arch/alpha/include/asm/socket.h | |||
@@ -67,6 +67,8 @@ | |||
67 | #define SO_TIMESTAMPING 37 | 67 | #define SO_TIMESTAMPING 37 |
68 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 68 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
69 | 69 | ||
70 | #define SO_RXQ_OVFL 40 | ||
71 | |||
70 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | 72 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we |
71 | * have to define SOCK_NONBLOCK to a different value here. | 73 | * have to define SOCK_NONBLOCK to a different value here. |
72 | */ | 74 | */ |
diff --git a/arch/alpha/include/asm/spinlock.h b/arch/alpha/include/asm/spinlock.h index e38fb95cb335..d0faca1e992d 100644 --- a/arch/alpha/include/asm/spinlock.h +++ b/arch/alpha/include/asm/spinlock.h | |||
@@ -12,18 +12,18 @@ | |||
12 | * We make no fairness assumptions. They have a cost. | 12 | * We make no fairness assumptions. They have a cost. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 15 | #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) |
16 | #define __raw_spin_is_locked(x) ((x)->lock != 0) | 16 | #define arch_spin_is_locked(x) ((x)->lock != 0) |
17 | #define __raw_spin_unlock_wait(x) \ | 17 | #define arch_spin_unlock_wait(x) \ |
18 | do { cpu_relax(); } while ((x)->lock) | 18 | do { cpu_relax(); } while ((x)->lock) |
19 | 19 | ||
20 | static inline void __raw_spin_unlock(raw_spinlock_t * lock) | 20 | static inline void arch_spin_unlock(arch_spinlock_t * lock) |
21 | { | 21 | { |
22 | mb(); | 22 | mb(); |
23 | lock->lock = 0; | 23 | lock->lock = 0; |
24 | } | 24 | } |
25 | 25 | ||
26 | static inline void __raw_spin_lock(raw_spinlock_t * lock) | 26 | static inline void arch_spin_lock(arch_spinlock_t * lock) |
27 | { | 27 | { |
28 | long tmp; | 28 | long tmp; |
29 | 29 | ||
@@ -43,24 +43,24 @@ static inline void __raw_spin_lock(raw_spinlock_t * lock) | |||
43 | : "m"(lock->lock) : "memory"); | 43 | : "m"(lock->lock) : "memory"); |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) | 46 | static inline int arch_spin_trylock(arch_spinlock_t *lock) |
47 | { | 47 | { |
48 | return !test_and_set_bit(0, &lock->lock); | 48 | return !test_and_set_bit(0, &lock->lock); |
49 | } | 49 | } |
50 | 50 | ||
51 | /***********************************************************/ | 51 | /***********************************************************/ |
52 | 52 | ||
53 | static inline int __raw_read_can_lock(raw_rwlock_t *lock) | 53 | static inline int arch_read_can_lock(arch_rwlock_t *lock) |
54 | { | 54 | { |
55 | return (lock->lock & 1) == 0; | 55 | return (lock->lock & 1) == 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline int __raw_write_can_lock(raw_rwlock_t *lock) | 58 | static inline int arch_write_can_lock(arch_rwlock_t *lock) |
59 | { | 59 | { |
60 | return lock->lock == 0; | 60 | return lock->lock == 0; |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline void __raw_read_lock(raw_rwlock_t *lock) | 63 | static inline void arch_read_lock(arch_rwlock_t *lock) |
64 | { | 64 | { |
65 | long regx; | 65 | long regx; |
66 | 66 | ||
@@ -80,7 +80,7 @@ static inline void __raw_read_lock(raw_rwlock_t *lock) | |||
80 | : "m" (*lock) : "memory"); | 80 | : "m" (*lock) : "memory"); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline void __raw_write_lock(raw_rwlock_t *lock) | 83 | static inline void arch_write_lock(arch_rwlock_t *lock) |
84 | { | 84 | { |
85 | long regx; | 85 | long regx; |
86 | 86 | ||
@@ -100,7 +100,7 @@ static inline void __raw_write_lock(raw_rwlock_t *lock) | |||
100 | : "m" (*lock) : "memory"); | 100 | : "m" (*lock) : "memory"); |
101 | } | 101 | } |
102 | 102 | ||
103 | static inline int __raw_read_trylock(raw_rwlock_t * lock) | 103 | static inline int arch_read_trylock(arch_rwlock_t * lock) |
104 | { | 104 | { |
105 | long regx; | 105 | long regx; |
106 | int success; | 106 | int success; |
@@ -122,7 +122,7 @@ static inline int __raw_read_trylock(raw_rwlock_t * lock) | |||
122 | return success; | 122 | return success; |
123 | } | 123 | } |
124 | 124 | ||
125 | static inline int __raw_write_trylock(raw_rwlock_t * lock) | 125 | static inline int arch_write_trylock(arch_rwlock_t * lock) |
126 | { | 126 | { |
127 | long regx; | 127 | long regx; |
128 | int success; | 128 | int success; |
@@ -144,7 +144,7 @@ static inline int __raw_write_trylock(raw_rwlock_t * lock) | |||
144 | return success; | 144 | return success; |
145 | } | 145 | } |
146 | 146 | ||
147 | static inline void __raw_read_unlock(raw_rwlock_t * lock) | 147 | static inline void arch_read_unlock(arch_rwlock_t * lock) |
148 | { | 148 | { |
149 | long regx; | 149 | long regx; |
150 | __asm__ __volatile__( | 150 | __asm__ __volatile__( |
@@ -160,17 +160,17 @@ static inline void __raw_read_unlock(raw_rwlock_t * lock) | |||
160 | : "m" (*lock) : "memory"); | 160 | : "m" (*lock) : "memory"); |
161 | } | 161 | } |
162 | 162 | ||
163 | static inline void __raw_write_unlock(raw_rwlock_t * lock) | 163 | static inline void arch_write_unlock(arch_rwlock_t * lock) |
164 | { | 164 | { |
165 | mb(); | 165 | mb(); |
166 | lock->lock = 0; | 166 | lock->lock = 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | 169 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
170 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | 170 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
171 | 171 | ||
172 | #define _raw_spin_relax(lock) cpu_relax() | 172 | #define arch_spin_relax(lock) cpu_relax() |
173 | #define _raw_read_relax(lock) cpu_relax() | 173 | #define arch_read_relax(lock) cpu_relax() |
174 | #define _raw_write_relax(lock) cpu_relax() | 174 | #define arch_write_relax(lock) cpu_relax() |
175 | 175 | ||
176 | #endif /* _ALPHA_SPINLOCK_H */ | 176 | #endif /* _ALPHA_SPINLOCK_H */ |
diff --git a/arch/alpha/include/asm/spinlock_types.h b/arch/alpha/include/asm/spinlock_types.h index 8141eb5ebf0d..54c2afce0a1d 100644 --- a/arch/alpha/include/asm/spinlock_types.h +++ b/arch/alpha/include/asm/spinlock_types.h | |||
@@ -7,14 +7,14 @@ | |||
7 | 7 | ||
8 | typedef struct { | 8 | typedef struct { |
9 | volatile unsigned int lock; | 9 | volatile unsigned int lock; |
10 | } raw_spinlock_t; | 10 | } arch_spinlock_t; |
11 | 11 | ||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } | 12 | #define __ARCH_SPIN_LOCK_UNLOCKED { 0 } |
13 | 13 | ||
14 | typedef struct { | 14 | typedef struct { |
15 | volatile unsigned int lock; | 15 | volatile unsigned int lock; |
16 | } raw_rwlock_t; | 16 | } arch_rwlock_t; |
17 | 17 | ||
18 | #define __RAW_RW_LOCK_UNLOCKED { 0 } | 18 | #define __ARCH_RW_LOCK_UNLOCKED { 0 } |
19 | 19 | ||
20 | #endif | 20 | #endif |
diff --git a/arch/alpha/include/asm/topology.h b/arch/alpha/include/asm/topology.h index 36b3a30ba0e5..9251e13e144f 100644 --- a/arch/alpha/include/asm/topology.h +++ b/arch/alpha/include/asm/topology.h | |||
@@ -28,6 +28,9 @@ static const struct cpumask *cpumask_of_node(int node) | |||
28 | { | 28 | { |
29 | int cpu; | 29 | int cpu; |
30 | 30 | ||
31 | if (node == -1) | ||
32 | return cpu_all_mask; | ||
33 | |||
31 | cpumask_clear(&node_to_cpumask_map[node]); | 34 | cpumask_clear(&node_to_cpumask_map[node]); |
32 | 35 | ||
33 | for_each_online_cpu(cpu) { | 36 | for_each_online_cpu(cpu) { |
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index 5b5c17485942..804e5311c841 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h | |||
@@ -247,6 +247,7 @@ | |||
247 | #define __IGNORE_pause | 247 | #define __IGNORE_pause |
248 | #define __IGNORE_time | 248 | #define __IGNORE_time |
249 | #define __IGNORE_utime | 249 | #define __IGNORE_utime |
250 | #define __IGNORE_umount2 | ||
250 | 251 | ||
251 | /* | 252 | /* |
252 | * Linux-specific system calls begin at 300 | 253 | * Linux-specific system calls begin at 300 |
@@ -433,10 +434,25 @@ | |||
433 | #define __NR_signalfd 476 | 434 | #define __NR_signalfd 476 |
434 | #define __NR_timerfd 477 | 435 | #define __NR_timerfd 477 |
435 | #define __NR_eventfd 478 | 436 | #define __NR_eventfd 478 |
437 | #define __NR_recvmmsg 479 | ||
438 | #define __NR_fallocate 480 | ||
439 | #define __NR_timerfd_create 481 | ||
440 | #define __NR_timerfd_settime 482 | ||
441 | #define __NR_timerfd_gettime 483 | ||
442 | #define __NR_signalfd4 484 | ||
443 | #define __NR_eventfd2 485 | ||
444 | #define __NR_epoll_create1 486 | ||
445 | #define __NR_dup3 487 | ||
446 | #define __NR_pipe2 488 | ||
447 | #define __NR_inotify_init1 489 | ||
448 | #define __NR_preadv 490 | ||
449 | #define __NR_pwritev 491 | ||
450 | #define __NR_rt_tgsigqueueinfo 492 | ||
451 | #define __NR_perf_event_open 493 | ||
436 | 452 | ||
437 | #ifdef __KERNEL__ | 453 | #ifdef __KERNEL__ |
438 | 454 | ||
439 | #define NR_SYSCALLS 479 | 455 | #define NR_SYSCALLS 494 |
440 | 456 | ||
441 | #define __ARCH_WANT_IPC_PARSE_VERSION | 457 | #define __ARCH_WANT_IPC_PARSE_VERSION |
442 | #define __ARCH_WANT_OLD_READDIR | 458 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/alpha/kernel/core_t2.c b/arch/alpha/kernel/core_t2.c index d9980d47ab81..e6d90568b65d 100644 --- a/arch/alpha/kernel/core_t2.c +++ b/arch/alpha/kernel/core_t2.c | |||
@@ -74,7 +74,7 @@ | |||
74 | # define DBG(args) | 74 | # define DBG(args) |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | DEFINE_SPINLOCK(t2_hae_lock); | 77 | DEFINE_RAW_SPINLOCK(t2_hae_lock); |
78 | 78 | ||
79 | static volatile unsigned int t2_mcheck_any_expected; | 79 | static volatile unsigned int t2_mcheck_any_expected; |
80 | static volatile unsigned int t2_mcheck_last_taken; | 80 | static volatile unsigned int t2_mcheck_last_taken; |
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index c0de072b8305..7f912ba3d9ad 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
19 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/slab.h> | ||
22 | #include <linux/random.h> | 21 | #include <linux/random.h> |
23 | #include <linux/init.h> | 22 | #include <linux/init.h> |
24 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
@@ -81,7 +80,7 @@ show_interrupts(struct seq_file *p, void *v) | |||
81 | #endif | 80 | #endif |
82 | 81 | ||
83 | if (irq < ACTUAL_NR_IRQS) { | 82 | if (irq < ACTUAL_NR_IRQS) { |
84 | spin_lock_irqsave(&irq_desc[irq].lock, flags); | 83 | raw_spin_lock_irqsave(&irq_desc[irq].lock, flags); |
85 | action = irq_desc[irq].action; | 84 | action = irq_desc[irq].action; |
86 | if (!action) | 85 | if (!action) |
87 | goto unlock; | 86 | goto unlock; |
@@ -105,7 +104,7 @@ show_interrupts(struct seq_file *p, void *v) | |||
105 | 104 | ||
106 | seq_putc(p, '\n'); | 105 | seq_putc(p, '\n'); |
107 | unlock: | 106 | unlock: |
108 | spin_unlock_irqrestore(&irq_desc[irq].lock, flags); | 107 | raw_spin_unlock_irqrestore(&irq_desc[irq].lock, flags); |
109 | } else if (irq == ACTUAL_NR_IRQS) { | 108 | } else if (irq == ACTUAL_NR_IRQS) { |
110 | #ifdef CONFIG_SMP | 109 | #ifdef CONFIG_SMP |
111 | seq_puts(p, "IPI: "); | 110 | seq_puts(p, "IPI: "); |
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 9a3334ae282e..de9d39717808 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/syscalls.h> | 20 | #include <linux/syscalls.h> |
21 | #include <linux/unistd.h> | 21 | #include <linux/unistd.h> |
22 | #include <linux/ptrace.h> | 22 | #include <linux/ptrace.h> |
23 | #include <linux/slab.h> | ||
24 | #include <linux/user.h> | 23 | #include <linux/user.h> |
25 | #include <linux/utsname.h> | 24 | #include <linux/utsname.h> |
26 | #include <linux/time.h> | 25 | #include <linux/time.h> |
@@ -37,6 +36,7 @@ | |||
37 | #include <linux/uio.h> | 36 | #include <linux/uio.h> |
38 | #include <linux/vfs.h> | 37 | #include <linux/vfs.h> |
39 | #include <linux/rcupdate.h> | 38 | #include <linux/rcupdate.h> |
39 | #include <linux/slab.h> | ||
40 | 40 | ||
41 | #include <asm/fpu.h> | 41 | #include <asm/fpu.h> |
42 | #include <asm/io.h> | 42 | #include <asm/io.h> |
@@ -178,25 +178,18 @@ SYSCALL_DEFINE6(osf_mmap, unsigned long, addr, unsigned long, len, | |||
178 | unsigned long, prot, unsigned long, flags, unsigned long, fd, | 178 | unsigned long, prot, unsigned long, flags, unsigned long, fd, |
179 | unsigned long, off) | 179 | unsigned long, off) |
180 | { | 180 | { |
181 | struct file *file = NULL; | 181 | unsigned long ret = -EINVAL; |
182 | unsigned long ret = -EBADF; | ||
183 | 182 | ||
184 | #if 0 | 183 | #if 0 |
185 | if (flags & (_MAP_HASSEMAPHORE | _MAP_INHERIT | _MAP_UNALIGNED)) | 184 | if (flags & (_MAP_HASSEMAPHORE | _MAP_INHERIT | _MAP_UNALIGNED)) |
186 | printk("%s: unimplemented OSF mmap flags %04lx\n", | 185 | printk("%s: unimplemented OSF mmap flags %04lx\n", |
187 | current->comm, flags); | 186 | current->comm, flags); |
188 | #endif | 187 | #endif |
189 | if (!(flags & MAP_ANONYMOUS)) { | 188 | if ((off + PAGE_ALIGN(len)) < off) |
190 | file = fget(fd); | 189 | goto out; |
191 | if (!file) | 190 | if (off & ~PAGE_MASK) |
192 | goto out; | 191 | goto out; |
193 | } | 192 | ret = sys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT); |
194 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
195 | down_write(¤t->mm->mmap_sem); | ||
196 | ret = do_mmap(file, addr, len, prot, flags, off); | ||
197 | up_write(¤t->mm->mmap_sem); | ||
198 | if (file) | ||
199 | fput(file); | ||
200 | out: | 193 | out: |
201 | return ret; | 194 | return ret; |
202 | } | 195 | } |
@@ -368,7 +361,7 @@ osf_procfs_mount(char *dirname, struct procfs_args __user *args, int flags) | |||
368 | SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, | 361 | SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, |
369 | int, flag, void __user *, data) | 362 | int, flag, void __user *, data) |
370 | { | 363 | { |
371 | int retval = -EINVAL; | 364 | int retval; |
372 | char *name; | 365 | char *name; |
373 | 366 | ||
374 | name = getname(path); | 367 | name = getname(path); |
@@ -386,6 +379,7 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, | |||
386 | retval = osf_procfs_mount(name, data, flag); | 379 | retval = osf_procfs_mount(name, data, flag); |
387 | break; | 380 | break; |
388 | default: | 381 | default: |
382 | retval = -EINVAL; | ||
389 | printk("osf_mount(%ld, %x)\n", typenr, flag); | 383 | printk("osf_mount(%ld, %x)\n", typenr, flag); |
390 | } | 384 | } |
391 | putname(name); | 385 | putname(name); |
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c index c19a376520f4..246100ef07c2 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/pci.h> | 7 | #include <linux/pci.h> |
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/bootmem.h> | 9 | #include <linux/bootmem.h> |
10 | #include <linux/gfp.h> | ||
10 | #include <linux/capability.h> | 11 | #include <linux/capability.h> |
11 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
12 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
@@ -106,58 +107,8 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, | |||
106 | return -ENODEV; | 107 | return -ENODEV; |
107 | } | 108 | } |
108 | 109 | ||
109 | /* Stubs for the routines in pci_iommu.c: */ | 110 | static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, |
110 | 111 | dma_addr_t *dma_handle, gfp_t gfp) | |
111 | void * | ||
112 | __pci_alloc_consistent(struct pci_dev *pdev, size_t size, | ||
113 | dma_addr_t *dma_addrp, gfp_t gfp) | ||
114 | { | ||
115 | return NULL; | ||
116 | } | ||
117 | |||
118 | void | ||
119 | pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr, | ||
120 | dma_addr_t dma_addr) | ||
121 | { | ||
122 | } | ||
123 | |||
124 | dma_addr_t | ||
125 | pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, | ||
126 | int direction) | ||
127 | { | ||
128 | return (dma_addr_t) 0; | ||
129 | } | ||
130 | |||
131 | void | ||
132 | pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | ||
133 | int direction) | ||
134 | { | ||
135 | } | ||
136 | |||
137 | int | ||
138 | pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | ||
139 | int direction) | ||
140 | { | ||
141 | return 0; | ||
142 | } | ||
143 | |||
144 | void | ||
145 | pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | ||
146 | int direction) | ||
147 | { | ||
148 | } | ||
149 | |||
150 | int | ||
151 | pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask) | ||
152 | { | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | /* Generic DMA mapping functions: */ | ||
157 | |||
158 | void * | ||
159 | dma_alloc_coherent(struct device *dev, size_t size, | ||
160 | dma_addr_t *dma_handle, gfp_t gfp) | ||
161 | { | 112 | { |
162 | void *ret; | 113 | void *ret; |
163 | 114 | ||
@@ -171,11 +122,22 @@ dma_alloc_coherent(struct device *dev, size_t size, | |||
171 | return ret; | 122 | return ret; |
172 | } | 123 | } |
173 | 124 | ||
174 | EXPORT_SYMBOL(dma_alloc_coherent); | 125 | static void alpha_noop_free_coherent(struct device *dev, size_t size, |
126 | void *cpu_addr, dma_addr_t dma_addr) | ||
127 | { | ||
128 | free_pages((unsigned long)cpu_addr, get_order(size)); | ||
129 | } | ||
130 | |||
131 | static dma_addr_t alpha_noop_map_page(struct device *dev, struct page *page, | ||
132 | unsigned long offset, size_t size, | ||
133 | enum dma_data_direction dir, | ||
134 | struct dma_attrs *attrs) | ||
135 | { | ||
136 | return page_to_pa(page) + offset; | ||
137 | } | ||
175 | 138 | ||
176 | int | 139 | static int alpha_noop_map_sg(struct device *dev, struct scatterlist *sgl, int nents, |
177 | dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents, | 140 | enum dma_data_direction dir, struct dma_attrs *attrs) |
178 | enum dma_data_direction direction) | ||
179 | { | 141 | { |
180 | int i; | 142 | int i; |
181 | struct scatterlist *sg; | 143 | struct scatterlist *sg; |
@@ -192,19 +154,37 @@ dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents, | |||
192 | return nents; | 154 | return nents; |
193 | } | 155 | } |
194 | 156 | ||
195 | EXPORT_SYMBOL(dma_map_sg); | 157 | static int alpha_noop_mapping_error(struct device *dev, dma_addr_t dma_addr) |
158 | { | ||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static int alpha_noop_supported(struct device *dev, u64 mask) | ||
163 | { | ||
164 | return mask < 0x00ffffffUL ? 0 : 1; | ||
165 | } | ||
196 | 166 | ||
197 | int | 167 | static int alpha_noop_set_mask(struct device *dev, u64 mask) |
198 | dma_set_mask(struct device *dev, u64 mask) | ||
199 | { | 168 | { |
200 | if (!dev->dma_mask || !dma_supported(dev, mask)) | 169 | if (!dev->dma_mask || !dma_supported(dev, mask)) |
201 | return -EIO; | 170 | return -EIO; |
202 | 171 | ||
203 | *dev->dma_mask = mask; | 172 | *dev->dma_mask = mask; |
204 | |||
205 | return 0; | 173 | return 0; |
206 | } | 174 | } |
207 | EXPORT_SYMBOL(dma_set_mask); | 175 | |
176 | struct dma_map_ops alpha_noop_ops = { | ||
177 | .alloc_coherent = alpha_noop_alloc_coherent, | ||
178 | .free_coherent = alpha_noop_free_coherent, | ||
179 | .map_page = alpha_noop_map_page, | ||
180 | .map_sg = alpha_noop_map_sg, | ||
181 | .mapping_error = alpha_noop_mapping_error, | ||
182 | .dma_supported = alpha_noop_supported, | ||
183 | .set_dma_mask = alpha_noop_set_mask, | ||
184 | }; | ||
185 | |||
186 | struct dma_map_ops *dma_ops = &alpha_noop_ops; | ||
187 | EXPORT_SYMBOL(dma_ops); | ||
208 | 188 | ||
209 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | 189 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) |
210 | { | 190 | { |
diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c index 6ea822e7f724..d979e7c7bc4b 100644 --- a/arch/alpha/kernel/pci-sysfs.c +++ b/arch/alpha/kernel/pci-sysfs.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/slab.h> | ||
13 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
14 | 15 | ||
15 | static int hose_mmap_page_range(struct pci_controller *hose, | 16 | static int hose_mmap_page_range(struct pci_controller *hose, |
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index a91ba28999b5..c9ab94ee1ca8 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -126,8 +126,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final); | |||
126 | #define MB (1024*KB) | 126 | #define MB (1024*KB) |
127 | #define GB (1024*MB) | 127 | #define GB (1024*MB) |
128 | 128 | ||
129 | void | 129 | resource_size_t |
130 | pcibios_align_resource(void *data, struct resource *res, | 130 | pcibios_align_resource(void *data, const struct resource *res, |
131 | resource_size_t size, resource_size_t align) | 131 | resource_size_t size, resource_size_t align) |
132 | { | 132 | { |
133 | struct pci_dev *dev = data; | 133 | struct pci_dev *dev = data; |
@@ -184,7 +184,7 @@ pcibios_align_resource(void *data, struct resource *res, | |||
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
187 | res->start = start; | 187 | return start; |
188 | } | 188 | } |
189 | #undef KB | 189 | #undef KB |
190 | #undef MB | 190 | #undef MB |
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 8449504f5e0b..d1dbd9acd1df 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/pci.h> | 7 | #include <linux/pci.h> |
8 | #include <linux/slab.h> | 8 | #include <linux/gfp.h> |
9 | #include <linux/bootmem.h> | 9 | #include <linux/bootmem.h> |
10 | #include <linux/scatterlist.h> | 10 | #include <linux/scatterlist.h> |
11 | #include <linux/log2.h> | 11 | #include <linux/log2.h> |
@@ -216,10 +216,30 @@ iommu_arena_free(struct pci_iommu_arena *arena, long ofs, long n) | |||
216 | for (i = 0; i < n; ++i) | 216 | for (i = 0; i < n; ++i) |
217 | p[i] = 0; | 217 | p[i] = 0; |
218 | } | 218 | } |
219 | 219 | ||
220 | /* True if the machine supports DAC addressing, and DEV can | 220 | /* |
221 | make use of it given MASK. */ | 221 | * True if the machine supports DAC addressing, and DEV can |
222 | static int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask); | 222 | * make use of it given MASK. |
223 | */ | ||
224 | static int pci_dac_dma_supported(struct pci_dev *dev, u64 mask) | ||
225 | { | ||
226 | dma64_addr_t dac_offset = alpha_mv.pci_dac_offset; | ||
227 | int ok = 1; | ||
228 | |||
229 | /* If this is not set, the machine doesn't support DAC at all. */ | ||
230 | if (dac_offset == 0) | ||
231 | ok = 0; | ||
232 | |||
233 | /* The device has to be able to address our DAC bit. */ | ||
234 | if ((dac_offset & dev->dma_mask) != dac_offset) | ||
235 | ok = 0; | ||
236 | |||
237 | /* If both conditions above are met, we are fine. */ | ||
238 | DBGA("pci_dac_dma_supported %s from %p\n", | ||
239 | ok ? "yes" : "no", __builtin_return_address(0)); | ||
240 | |||
241 | return ok; | ||
242 | } | ||
223 | 243 | ||
224 | /* Map a single buffer of the indicated size for PCI DMA in streaming | 244 | /* Map a single buffer of the indicated size for PCI DMA in streaming |
225 | mode. The 32-bit PCI bus mastering address to use is returned. | 245 | mode. The 32-bit PCI bus mastering address to use is returned. |
@@ -301,23 +321,36 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size, | |||
301 | return ret; | 321 | return ret; |
302 | } | 322 | } |
303 | 323 | ||
304 | dma_addr_t | 324 | /* Helper for generic DMA-mapping functions. */ |
305 | pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int dir) | 325 | static struct pci_dev *alpha_gendev_to_pci(struct device *dev) |
306 | { | 326 | { |
307 | int dac_allowed; | 327 | if (dev && dev->bus == &pci_bus_type) |
328 | return to_pci_dev(dev); | ||
308 | 329 | ||
309 | if (dir == PCI_DMA_NONE) | 330 | /* Assume that non-PCI devices asking for DMA are either ISA or EISA, |
310 | BUG(); | 331 | BUG() otherwise. */ |
332 | BUG_ON(!isa_bridge); | ||
311 | 333 | ||
312 | dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; | 334 | /* Assume non-busmaster ISA DMA when dma_mask is not set (the ISA |
313 | return pci_map_single_1(pdev, cpu_addr, size, dac_allowed); | 335 | bridge is bus master then). */ |
336 | if (!dev || !dev->dma_mask || !*dev->dma_mask) | ||
337 | return isa_bridge; | ||
338 | |||
339 | /* For EISA bus masters, return isa_bridge (it might have smaller | ||
340 | dma_mask due to wiring limitations). */ | ||
341 | if (*dev->dma_mask >= isa_bridge->dma_mask) | ||
342 | return isa_bridge; | ||
343 | |||
344 | /* This assumes ISA bus master with dma_mask 0xffffff. */ | ||
345 | return NULL; | ||
314 | } | 346 | } |
315 | EXPORT_SYMBOL(pci_map_single); | ||
316 | 347 | ||
317 | dma_addr_t | 348 | static dma_addr_t alpha_pci_map_page(struct device *dev, struct page *page, |
318 | pci_map_page(struct pci_dev *pdev, struct page *page, unsigned long offset, | 349 | unsigned long offset, size_t size, |
319 | size_t size, int dir) | 350 | enum dma_data_direction dir, |
351 | struct dma_attrs *attrs) | ||
320 | { | 352 | { |
353 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | ||
321 | int dac_allowed; | 354 | int dac_allowed; |
322 | 355 | ||
323 | if (dir == PCI_DMA_NONE) | 356 | if (dir == PCI_DMA_NONE) |
@@ -327,7 +360,6 @@ pci_map_page(struct pci_dev *pdev, struct page *page, unsigned long offset, | |||
327 | return pci_map_single_1(pdev, (char *)page_address(page) + offset, | 360 | return pci_map_single_1(pdev, (char *)page_address(page) + offset, |
328 | size, dac_allowed); | 361 | size, dac_allowed); |
329 | } | 362 | } |
330 | EXPORT_SYMBOL(pci_map_page); | ||
331 | 363 | ||
332 | /* Unmap a single streaming mode DMA translation. The DMA_ADDR and | 364 | /* Unmap a single streaming mode DMA translation. The DMA_ADDR and |
333 | SIZE must match what was provided for in a previous pci_map_single | 365 | SIZE must match what was provided for in a previous pci_map_single |
@@ -335,16 +367,17 @@ EXPORT_SYMBOL(pci_map_page); | |||
335 | the cpu to the buffer are guaranteed to see whatever the device | 367 | the cpu to the buffer are guaranteed to see whatever the device |
336 | wrote there. */ | 368 | wrote there. */ |
337 | 369 | ||
338 | void | 370 | static void alpha_pci_unmap_page(struct device *dev, dma_addr_t dma_addr, |
339 | pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | 371 | size_t size, enum dma_data_direction dir, |
340 | int direction) | 372 | struct dma_attrs *attrs) |
341 | { | 373 | { |
342 | unsigned long flags; | 374 | unsigned long flags; |
375 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | ||
343 | struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose; | 376 | struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose; |
344 | struct pci_iommu_arena *arena; | 377 | struct pci_iommu_arena *arena; |
345 | long dma_ofs, npages; | 378 | long dma_ofs, npages; |
346 | 379 | ||
347 | if (direction == PCI_DMA_NONE) | 380 | if (dir == PCI_DMA_NONE) |
348 | BUG(); | 381 | BUG(); |
349 | 382 | ||
350 | if (dma_addr >= __direct_map_base | 383 | if (dma_addr >= __direct_map_base |
@@ -393,25 +426,16 @@ pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | |||
393 | DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %p\n", | 426 | DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %p\n", |
394 | dma_addr, size, npages, __builtin_return_address(0)); | 427 | dma_addr, size, npages, __builtin_return_address(0)); |
395 | } | 428 | } |
396 | EXPORT_SYMBOL(pci_unmap_single); | ||
397 | |||
398 | void | ||
399 | pci_unmap_page(struct pci_dev *pdev, dma_addr_t dma_addr, | ||
400 | size_t size, int direction) | ||
401 | { | ||
402 | pci_unmap_single(pdev, dma_addr, size, direction); | ||
403 | } | ||
404 | EXPORT_SYMBOL(pci_unmap_page); | ||
405 | 429 | ||
406 | /* Allocate and map kernel buffer using consistent mode DMA for PCI | 430 | /* Allocate and map kernel buffer using consistent mode DMA for PCI |
407 | device. Returns non-NULL cpu-view pointer to the buffer if | 431 | device. Returns non-NULL cpu-view pointer to the buffer if |
408 | successful and sets *DMA_ADDRP to the pci side dma address as well, | 432 | successful and sets *DMA_ADDRP to the pci side dma address as well, |
409 | else DMA_ADDRP is undefined. */ | 433 | else DMA_ADDRP is undefined. */ |
410 | 434 | ||
411 | void * | 435 | static void *alpha_pci_alloc_coherent(struct device *dev, size_t size, |
412 | __pci_alloc_consistent(struct pci_dev *pdev, size_t size, | 436 | dma_addr_t *dma_addrp, gfp_t gfp) |
413 | dma_addr_t *dma_addrp, gfp_t gfp) | ||
414 | { | 437 | { |
438 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | ||
415 | void *cpu_addr; | 439 | void *cpu_addr; |
416 | long order = get_order(size); | 440 | long order = get_order(size); |
417 | 441 | ||
@@ -439,13 +463,12 @@ try_again: | |||
439 | gfp |= GFP_DMA; | 463 | gfp |= GFP_DMA; |
440 | goto try_again; | 464 | goto try_again; |
441 | } | 465 | } |
442 | 466 | ||
443 | DBGA2("pci_alloc_consistent: %zx -> [%p,%llx] from %p\n", | 467 | DBGA2("pci_alloc_consistent: %zx -> [%p,%llx] from %p\n", |
444 | size, cpu_addr, *dma_addrp, __builtin_return_address(0)); | 468 | size, cpu_addr, *dma_addrp, __builtin_return_address(0)); |
445 | 469 | ||
446 | return cpu_addr; | 470 | return cpu_addr; |
447 | } | 471 | } |
448 | EXPORT_SYMBOL(__pci_alloc_consistent); | ||
449 | 472 | ||
450 | /* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must | 473 | /* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must |
451 | be values that were returned from pci_alloc_consistent. SIZE must | 474 | be values that were returned from pci_alloc_consistent. SIZE must |
@@ -453,17 +476,16 @@ EXPORT_SYMBOL(__pci_alloc_consistent); | |||
453 | References to the memory and mappings associated with CPU_ADDR or | 476 | References to the memory and mappings associated with CPU_ADDR or |
454 | DMA_ADDR past this call are illegal. */ | 477 | DMA_ADDR past this call are illegal. */ |
455 | 478 | ||
456 | void | 479 | static void alpha_pci_free_coherent(struct device *dev, size_t size, |
457 | pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr, | 480 | void *cpu_addr, dma_addr_t dma_addr) |
458 | dma_addr_t dma_addr) | ||
459 | { | 481 | { |
482 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | ||
460 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); | 483 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); |
461 | free_pages((unsigned long)cpu_addr, get_order(size)); | 484 | free_pages((unsigned long)cpu_addr, get_order(size)); |
462 | 485 | ||
463 | DBGA2("pci_free_consistent: [%llx,%zx] from %p\n", | 486 | DBGA2("pci_free_consistent: [%llx,%zx] from %p\n", |
464 | dma_addr, size, __builtin_return_address(0)); | 487 | dma_addr, size, __builtin_return_address(0)); |
465 | } | 488 | } |
466 | EXPORT_SYMBOL(pci_free_consistent); | ||
467 | 489 | ||
468 | /* Classify the elements of the scatterlist. Write dma_address | 490 | /* Classify the elements of the scatterlist. Write dma_address |
469 | of each element with: | 491 | of each element with: |
@@ -626,23 +648,21 @@ sg_fill(struct device *dev, struct scatterlist *leader, struct scatterlist *end, | |||
626 | return 1; | 648 | return 1; |
627 | } | 649 | } |
628 | 650 | ||
629 | int | 651 | static int alpha_pci_map_sg(struct device *dev, struct scatterlist *sg, |
630 | pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | 652 | int nents, enum dma_data_direction dir, |
631 | int direction) | 653 | struct dma_attrs *attrs) |
632 | { | 654 | { |
655 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | ||
633 | struct scatterlist *start, *end, *out; | 656 | struct scatterlist *start, *end, *out; |
634 | struct pci_controller *hose; | 657 | struct pci_controller *hose; |
635 | struct pci_iommu_arena *arena; | 658 | struct pci_iommu_arena *arena; |
636 | dma_addr_t max_dma; | 659 | dma_addr_t max_dma; |
637 | int dac_allowed; | 660 | int dac_allowed; |
638 | struct device *dev; | ||
639 | 661 | ||
640 | if (direction == PCI_DMA_NONE) | 662 | if (dir == PCI_DMA_NONE) |
641 | BUG(); | 663 | BUG(); |
642 | 664 | ||
643 | dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; | 665 | dac_allowed = dev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; |
644 | |||
645 | dev = pdev ? &pdev->dev : NULL; | ||
646 | 666 | ||
647 | /* Fast path single entry scatterlists. */ | 667 | /* Fast path single entry scatterlists. */ |
648 | if (nents == 1) { | 668 | if (nents == 1) { |
@@ -699,19 +719,19 @@ pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | |||
699 | /* Some allocation failed while mapping the scatterlist | 719 | /* Some allocation failed while mapping the scatterlist |
700 | entries. Unmap them now. */ | 720 | entries. Unmap them now. */ |
701 | if (out > start) | 721 | if (out > start) |
702 | pci_unmap_sg(pdev, start, out - start, direction); | 722 | pci_unmap_sg(pdev, start, out - start, dir); |
703 | return 0; | 723 | return 0; |
704 | } | 724 | } |
705 | EXPORT_SYMBOL(pci_map_sg); | ||
706 | 725 | ||
707 | /* Unmap a set of streaming mode DMA translations. Again, cpu read | 726 | /* Unmap a set of streaming mode DMA translations. Again, cpu read |
708 | rules concerning calls here are the same as for pci_unmap_single() | 727 | rules concerning calls here are the same as for pci_unmap_single() |
709 | above. */ | 728 | above. */ |
710 | 729 | ||
711 | void | 730 | static void alpha_pci_unmap_sg(struct device *dev, struct scatterlist *sg, |
712 | pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | 731 | int nents, enum dma_data_direction dir, |
713 | int direction) | 732 | struct dma_attrs *attrs) |
714 | { | 733 | { |
734 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | ||
715 | unsigned long flags; | 735 | unsigned long flags; |
716 | struct pci_controller *hose; | 736 | struct pci_controller *hose; |
717 | struct pci_iommu_arena *arena; | 737 | struct pci_iommu_arena *arena; |
@@ -719,7 +739,7 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | |||
719 | dma_addr_t max_dma; | 739 | dma_addr_t max_dma; |
720 | dma_addr_t fbeg, fend; | 740 | dma_addr_t fbeg, fend; |
721 | 741 | ||
722 | if (direction == PCI_DMA_NONE) | 742 | if (dir == PCI_DMA_NONE) |
723 | BUG(); | 743 | BUG(); |
724 | 744 | ||
725 | if (! alpha_mv.mv_pci_tbi) | 745 | if (! alpha_mv.mv_pci_tbi) |
@@ -783,15 +803,13 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, | |||
783 | 803 | ||
784 | DBGA("pci_unmap_sg: %ld entries\n", nents - (end - sg)); | 804 | DBGA("pci_unmap_sg: %ld entries\n", nents - (end - sg)); |
785 | } | 805 | } |
786 | EXPORT_SYMBOL(pci_unmap_sg); | ||
787 | |||
788 | 806 | ||
789 | /* Return whether the given PCI device DMA address mask can be | 807 | /* Return whether the given PCI device DMA address mask can be |
790 | supported properly. */ | 808 | supported properly. */ |
791 | 809 | ||
792 | int | 810 | static int alpha_pci_supported(struct device *dev, u64 mask) |
793 | pci_dma_supported(struct pci_dev *pdev, u64 mask) | ||
794 | { | 811 | { |
812 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | ||
795 | struct pci_controller *hose; | 813 | struct pci_controller *hose; |
796 | struct pci_iommu_arena *arena; | 814 | struct pci_iommu_arena *arena; |
797 | 815 | ||
@@ -818,7 +836,6 @@ pci_dma_supported(struct pci_dev *pdev, u64 mask) | |||
818 | 836 | ||
819 | return 0; | 837 | return 0; |
820 | } | 838 | } |
821 | EXPORT_SYMBOL(pci_dma_supported); | ||
822 | 839 | ||
823 | 840 | ||
824 | /* | 841 | /* |
@@ -918,66 +935,32 @@ iommu_unbind(struct pci_iommu_arena *arena, long pg_start, long pg_count) | |||
918 | return 0; | 935 | return 0; |
919 | } | 936 | } |
920 | 937 | ||
921 | /* True if the machine supports DAC addressing, and DEV can | 938 | static int alpha_pci_mapping_error(struct device *dev, dma_addr_t dma_addr) |
922 | make use of it given MASK. */ | ||
923 | |||
924 | static int | ||
925 | pci_dac_dma_supported(struct pci_dev *dev, u64 mask) | ||
926 | { | ||
927 | dma64_addr_t dac_offset = alpha_mv.pci_dac_offset; | ||
928 | int ok = 1; | ||
929 | |||
930 | /* If this is not set, the machine doesn't support DAC at all. */ | ||
931 | if (dac_offset == 0) | ||
932 | ok = 0; | ||
933 | |||
934 | /* The device has to be able to address our DAC bit. */ | ||
935 | if ((dac_offset & dev->dma_mask) != dac_offset) | ||
936 | ok = 0; | ||
937 | |||
938 | /* If both conditions above are met, we are fine. */ | ||
939 | DBGA("pci_dac_dma_supported %s from %p\n", | ||
940 | ok ? "yes" : "no", __builtin_return_address(0)); | ||
941 | |||
942 | return ok; | ||
943 | } | ||
944 | |||
945 | /* Helper for generic DMA-mapping functions. */ | ||
946 | |||
947 | struct pci_dev * | ||
948 | alpha_gendev_to_pci(struct device *dev) | ||
949 | { | 939 | { |
950 | if (dev && dev->bus == &pci_bus_type) | 940 | return dma_addr == 0; |
951 | return to_pci_dev(dev); | ||
952 | |||
953 | /* Assume that non-PCI devices asking for DMA are either ISA or EISA, | ||
954 | BUG() otherwise. */ | ||
955 | BUG_ON(!isa_bridge); | ||
956 | |||
957 | /* Assume non-busmaster ISA DMA when dma_mask is not set (the ISA | ||
958 | bridge is bus master then). */ | ||
959 | if (!dev || !dev->dma_mask || !*dev->dma_mask) | ||
960 | return isa_bridge; | ||
961 | |||
962 | /* For EISA bus masters, return isa_bridge (it might have smaller | ||
963 | dma_mask due to wiring limitations). */ | ||
964 | if (*dev->dma_mask >= isa_bridge->dma_mask) | ||
965 | return isa_bridge; | ||
966 | |||
967 | /* This assumes ISA bus master with dma_mask 0xffffff. */ | ||
968 | return NULL; | ||
969 | } | 941 | } |
970 | EXPORT_SYMBOL(alpha_gendev_to_pci); | ||
971 | 942 | ||
972 | int | 943 | static int alpha_pci_set_mask(struct device *dev, u64 mask) |
973 | dma_set_mask(struct device *dev, u64 mask) | ||
974 | { | 944 | { |
975 | if (!dev->dma_mask || | 945 | if (!dev->dma_mask || |
976 | !pci_dma_supported(alpha_gendev_to_pci(dev), mask)) | 946 | !pci_dma_supported(alpha_gendev_to_pci(dev), mask)) |
977 | return -EIO; | 947 | return -EIO; |
978 | 948 | ||
979 | *dev->dma_mask = mask; | 949 | *dev->dma_mask = mask; |
980 | |||
981 | return 0; | 950 | return 0; |
982 | } | 951 | } |
983 | EXPORT_SYMBOL(dma_set_mask); | 952 | |
953 | struct dma_map_ops alpha_pci_ops = { | ||
954 | .alloc_coherent = alpha_pci_alloc_coherent, | ||
955 | .free_coherent = alpha_pci_free_coherent, | ||
956 | .map_page = alpha_pci_map_page, | ||
957 | .unmap_page = alpha_pci_unmap_page, | ||
958 | .map_sg = alpha_pci_map_sg, | ||
959 | .unmap_sg = alpha_pci_unmap_sg, | ||
960 | .mapping_error = alpha_pci_mapping_error, | ||
961 | .dma_supported = alpha_pci_supported, | ||
962 | .set_dma_mask = alpha_pci_set_mask, | ||
963 | }; | ||
964 | |||
965 | struct dma_map_ops *dma_ops = &alpha_pci_ops; | ||
966 | EXPORT_SYMBOL(dma_ops); | ||
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 289039bb6bb2..395a464353b8 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/stddef.h> | 17 | #include <linux/stddef.h> |
18 | #include <linux/unistd.h> | 18 | #include <linux/unistd.h> |
19 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
20 | #include <linux/slab.h> | ||
21 | #include <linux/user.h> | 20 | #include <linux/user.h> |
22 | #include <linux/time.h> | 21 | #include <linux/time.h> |
23 | #include <linux/major.h> | 22 | #include <linux/major.h> |
@@ -28,6 +27,7 @@ | |||
28 | #include <linux/reboot.h> | 27 | #include <linux/reboot.h> |
29 | #include <linux/tty.h> | 28 | #include <linux/tty.h> |
30 | #include <linux/console.h> | 29 | #include <linux/console.h> |
30 | #include <linux/slab.h> | ||
31 | 31 | ||
32 | #include <asm/reg.h> | 32 | #include <asm/reg.h> |
33 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index e072041d19f8..baa903602f6a 100644 --- a/arch/alpha/kernel/ptrace.c +++ b/arch/alpha/kernel/ptrace.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
12 | #include <linux/ptrace.h> | 12 | #include <linux/ptrace.h> |
13 | #include <linux/user.h> | 13 | #include <linux/user.h> |
14 | #include <linux/slab.h> | ||
15 | #include <linux/security.h> | 14 | #include <linux/security.h> |
16 | #include <linux/signal.h> | 15 | #include <linux/signal.h> |
17 | 16 | ||
@@ -249,6 +248,17 @@ ptrace_cancel_bpt(struct task_struct * child) | |||
249 | return (nsaved != 0); | 248 | return (nsaved != 0); |
250 | } | 249 | } |
251 | 250 | ||
251 | void user_enable_single_step(struct task_struct *child) | ||
252 | { | ||
253 | /* Mark single stepping. */ | ||
254 | task_thread_info(child)->bpt_nsaved = -1; | ||
255 | } | ||
256 | |||
257 | void user_disable_single_step(struct task_struct *child) | ||
258 | { | ||
259 | ptrace_cancel_bpt(child); | ||
260 | } | ||
261 | |||
252 | /* | 262 | /* |
253 | * Called by kernel/ptrace.c when detaching.. | 263 | * Called by kernel/ptrace.c when detaching.. |
254 | * | 264 | * |
@@ -256,7 +266,7 @@ ptrace_cancel_bpt(struct task_struct * child) | |||
256 | */ | 266 | */ |
257 | void ptrace_disable(struct task_struct *child) | 267 | void ptrace_disable(struct task_struct *child) |
258 | { | 268 | { |
259 | ptrace_cancel_bpt(child); | 269 | user_disable_single_step(child); |
260 | } | 270 | } |
261 | 271 | ||
262 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 272 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
@@ -295,52 +305,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
295 | DBG(DBG_MEM, ("poke $%ld<-%#lx\n", addr, data)); | 305 | DBG(DBG_MEM, ("poke $%ld<-%#lx\n", addr, data)); |
296 | ret = put_reg(child, addr, data); | 306 | ret = put_reg(child, addr, data); |
297 | break; | 307 | break; |
298 | |||
299 | case PTRACE_SYSCALL: | ||
300 | /* continue and stop at next (return from) syscall */ | ||
301 | case PTRACE_CONT: /* restart after signal. */ | ||
302 | ret = -EIO; | ||
303 | if (!valid_signal(data)) | ||
304 | break; | ||
305 | if (request == PTRACE_SYSCALL) | ||
306 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
307 | else | ||
308 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
309 | child->exit_code = data; | ||
310 | /* make sure single-step breakpoint is gone. */ | ||
311 | ptrace_cancel_bpt(child); | ||
312 | wake_up_process(child); | ||
313 | ret = 0; | ||
314 | break; | ||
315 | |||
316 | /* | ||
317 | * Make the child exit. Best I can do is send it a sigkill. | ||
318 | * perhaps it should be put in the status that it wants to | ||
319 | * exit. | ||
320 | */ | ||
321 | case PTRACE_KILL: | ||
322 | ret = 0; | ||
323 | if (child->exit_state == EXIT_ZOMBIE) | ||
324 | break; | ||
325 | child->exit_code = SIGKILL; | ||
326 | /* make sure single-step breakpoint is gone. */ | ||
327 | ptrace_cancel_bpt(child); | ||
328 | wake_up_process(child); | ||
329 | break; | ||
330 | |||
331 | case PTRACE_SINGLESTEP: /* execute single instruction. */ | ||
332 | ret = -EIO; | ||
333 | if (!valid_signal(data)) | ||
334 | break; | ||
335 | /* Mark single stepping. */ | ||
336 | task_thread_info(child)->bpt_nsaved = -1; | ||
337 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
338 | child->exit_code = data; | ||
339 | wake_up_process(child); | ||
340 | /* give it a chance to run. */ | ||
341 | ret = 0; | ||
342 | break; | ||
343 | |||
344 | default: | 308 | default: |
345 | ret = ptrace_request(child, request, addr, data); | 309 | ret = ptrace_request(child, request, addr, data); |
346 | break; | 310 | break; |
diff --git a/arch/alpha/kernel/smc37c669.c b/arch/alpha/kernel/smc37c669.c index bca5bda90cde..0435921d41c6 100644 --- a/arch/alpha/kernel/smc37c669.c +++ b/arch/alpha/kernel/smc37c669.c | |||
@@ -3,7 +3,6 @@ | |||
3 | */ | 3 | */ |
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | 5 | ||
6 | #include <linux/slab.h> | ||
7 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
8 | #include <linux/init.h> | 7 | #include <linux/init.h> |
9 | #include <linux/delay.h> | 8 | #include <linux/delay.h> |
diff --git a/arch/alpha/kernel/smc37c93x.c b/arch/alpha/kernel/smc37c93x.c index 2636cc028d06..3e6a2893af9f 100644 --- a/arch/alpha/kernel/smc37c93x.c +++ b/arch/alpha/kernel/smc37c93x.c | |||
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | 6 | ||
7 | #include <linux/slab.h> | ||
8 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
9 | #include <linux/init.h> | 8 | #include <linux/init.h> |
10 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c index d12af472e1c0..4afc1a1e2e5a 100644 --- a/arch/alpha/kernel/srm_env.c +++ b/arch/alpha/kernel/srm_env.c | |||
@@ -30,9 +30,11 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
33 | #include <linux/gfp.h> | ||
33 | #include <linux/module.h> | 34 | #include <linux/module.h> |
34 | #include <linux/init.h> | 35 | #include <linux/init.h> |
35 | #include <linux/proc_fs.h> | 36 | #include <linux/proc_fs.h> |
37 | #include <linux/seq_file.h> | ||
36 | #include <asm/console.h> | 38 | #include <asm/console.h> |
37 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
38 | #include <asm/machvec.h> | 40 | #include <asm/machvec.h> |
@@ -79,42 +81,41 @@ static srm_env_t srm_named_entries[] = { | |||
79 | static srm_env_t srm_numbered_entries[256]; | 81 | static srm_env_t srm_numbered_entries[256]; |
80 | 82 | ||
81 | 83 | ||
82 | static int | 84 | static int srm_env_proc_show(struct seq_file *m, void *v) |
83 | srm_env_read(char *page, char **start, off_t off, int count, int *eof, | ||
84 | void *data) | ||
85 | { | 85 | { |
86 | int nbytes; | ||
87 | unsigned long ret; | 86 | unsigned long ret; |
88 | srm_env_t *entry; | 87 | srm_env_t *entry; |
88 | char *page; | ||
89 | 89 | ||
90 | if (off != 0) { | 90 | entry = (srm_env_t *)m->private; |
91 | *eof = 1; | 91 | page = (char *)__get_free_page(GFP_USER); |
92 | return 0; | 92 | if (!page) |
93 | } | 93 | return -ENOMEM; |
94 | 94 | ||
95 | entry = (srm_env_t *) data; | 95 | ret = callback_getenv(entry->id, page, PAGE_SIZE); |
96 | ret = callback_getenv(entry->id, page, count); | ||
97 | 96 | ||
98 | if ((ret >> 61) == 0) { | 97 | if ((ret >> 61) == 0) { |
99 | nbytes = (int) ret; | 98 | seq_write(m, page, ret); |
100 | *eof = 1; | 99 | ret = 0; |
101 | } else | 100 | } else |
102 | nbytes = -EFAULT; | 101 | ret = -EFAULT; |
102 | free_page((unsigned long)page); | ||
103 | return ret; | ||
104 | } | ||
103 | 105 | ||
104 | return nbytes; | 106 | static int srm_env_proc_open(struct inode *inode, struct file *file) |
107 | { | ||
108 | return single_open(file, srm_env_proc_show, PDE(inode)->data); | ||
105 | } | 109 | } |
106 | 110 | ||
107 | static int | 111 | static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer, |
108 | srm_env_write(struct file *file, const char __user *buffer, unsigned long count, | 112 | size_t count, loff_t *pos) |
109 | void *data) | ||
110 | { | 113 | { |
111 | int res; | 114 | int res; |
112 | srm_env_t *entry; | 115 | srm_env_t *entry = PDE(file->f_path.dentry->d_inode)->data; |
113 | char *buf = (char *) __get_free_page(GFP_USER); | 116 | char *buf = (char *) __get_free_page(GFP_USER); |
114 | unsigned long ret1, ret2; | 117 | unsigned long ret1, ret2; |
115 | 118 | ||
116 | entry = (srm_env_t *) data; | ||
117 | |||
118 | if (!buf) | 119 | if (!buf) |
119 | return -ENOMEM; | 120 | return -ENOMEM; |
120 | 121 | ||
@@ -140,6 +141,15 @@ srm_env_write(struct file *file, const char __user *buffer, unsigned long count, | |||
140 | return res; | 141 | return res; |
141 | } | 142 | } |
142 | 143 | ||
144 | static const struct file_operations srm_env_proc_fops = { | ||
145 | .owner = THIS_MODULE, | ||
146 | .open = srm_env_proc_open, | ||
147 | .read = seq_read, | ||
148 | .llseek = seq_lseek, | ||
149 | .release = single_release, | ||
150 | .write = srm_env_proc_write, | ||
151 | }; | ||
152 | |||
143 | static void | 153 | static void |
144 | srm_env_cleanup(void) | 154 | srm_env_cleanup(void) |
145 | { | 155 | { |
@@ -245,15 +255,10 @@ srm_env_init(void) | |||
245 | */ | 255 | */ |
246 | entry = srm_named_entries; | 256 | entry = srm_named_entries; |
247 | while (entry->name && entry->id) { | 257 | while (entry->name && entry->id) { |
248 | entry->proc_entry = create_proc_entry(entry->name, | 258 | entry->proc_entry = proc_create_data(entry->name, 0644, named_dir, |
249 | 0644, named_dir); | 259 | &srm_env_proc_fops, entry); |
250 | if (!entry->proc_entry) | 260 | if (!entry->proc_entry) |
251 | goto cleanup; | 261 | goto cleanup; |
252 | |||
253 | entry->proc_entry->data = (void *) entry; | ||
254 | entry->proc_entry->read_proc = srm_env_read; | ||
255 | entry->proc_entry->write_proc = srm_env_write; | ||
256 | |||
257 | entry++; | 262 | entry++; |
258 | } | 263 | } |
259 | 264 | ||
@@ -264,15 +269,12 @@ srm_env_init(void) | |||
264 | entry = &srm_numbered_entries[var_num]; | 269 | entry = &srm_numbered_entries[var_num]; |
265 | entry->name = number[var_num]; | 270 | entry->name = number[var_num]; |
266 | 271 | ||
267 | entry->proc_entry = create_proc_entry(entry->name, | 272 | entry->proc_entry = proc_create_data(entry->name, 0644, numbered_dir, |
268 | 0644, numbered_dir); | 273 | &srm_env_proc_fops, entry); |
269 | if (!entry->proc_entry) | 274 | if (!entry->proc_entry) |
270 | goto cleanup; | 275 | goto cleanup; |
271 | 276 | ||
272 | entry->id = var_num; | 277 | entry->id = var_num; |
273 | entry->proc_entry->data = (void *) entry; | ||
274 | entry->proc_entry->read_proc = srm_env_read; | ||
275 | entry->proc_entry->write_proc = srm_env_write; | ||
276 | } | 278 | } |
277 | 279 | ||
278 | printk(KERN_INFO "%s: version %s loaded successfully\n", NAME, | 280 | printk(KERN_INFO "%s: version %s loaded successfully\n", NAME, |
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index d64e1e497e76..4026502ab707 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c | |||
@@ -224,7 +224,7 @@ static void | |||
224 | dp264_device_interrupt(unsigned long vector) | 224 | dp264_device_interrupt(unsigned long vector) |
225 | { | 225 | { |
226 | #if 1 | 226 | #if 1 |
227 | printk("dp264_device_interrupt: NOT IMPLEMENTED YET!! \n"); | 227 | printk("dp264_device_interrupt: NOT IMPLEMENTED YET!!\n"); |
228 | #else | 228 | #else |
229 | unsigned long pld; | 229 | unsigned long pld; |
230 | unsigned int i; | 230 | unsigned int i; |
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 288053342c83..9008d0f20c53 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c | |||
@@ -171,7 +171,7 @@ titan_set_irq_affinity(unsigned int irq, const struct cpumask *affinity) | |||
171 | static void | 171 | static void |
172 | titan_device_interrupt(unsigned long vector) | 172 | titan_device_interrupt(unsigned long vector) |
173 | { | 173 | { |
174 | printk("titan_device_interrupt: NOT IMPLEMENTED YET!! \n"); | 174 | printk("titan_device_interrupt: NOT IMPLEMENTED YET!!\n"); |
175 | } | 175 | } |
176 | 176 | ||
177 | static void | 177 | static void |
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index 95c9aef1c106..09acb786e72b 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S | |||
@@ -495,8 +495,23 @@ sys_call_table: | |||
495 | .quad sys_epoll_pwait | 495 | .quad sys_epoll_pwait |
496 | .quad sys_utimensat /* 475 */ | 496 | .quad sys_utimensat /* 475 */ |
497 | .quad sys_signalfd | 497 | .quad sys_signalfd |
498 | .quad sys_ni_syscall | 498 | .quad sys_ni_syscall /* sys_timerfd */ |
499 | .quad sys_eventfd | 499 | .quad sys_eventfd |
500 | .quad sys_recvmmsg | ||
501 | .quad sys_fallocate /* 480 */ | ||
502 | .quad sys_timerfd_create | ||
503 | .quad sys_timerfd_settime | ||
504 | .quad sys_timerfd_gettime | ||
505 | .quad sys_signalfd4 | ||
506 | .quad sys_eventfd2 /* 485 */ | ||
507 | .quad sys_epoll_create1 | ||
508 | .quad sys_dup3 | ||
509 | .quad sys_pipe2 | ||
510 | .quad sys_inotify_init1 | ||
511 | .quad sys_preadv /* 490 */ | ||
512 | .quad sys_pwritev | ||
513 | .quad sys_rt_tgsigqueueinfo | ||
514 | .quad sys_perf_event_open | ||
500 | 515 | ||
501 | .size sys_call_table, . - sys_call_table | 516 | .size sys_call_table, . - sys_call_table |
502 | .type sys_call_table, @object | 517 | .type sys_call_table, @object |
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 6ee7655b7568..b14f015008ad 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/kallsyms.h> | 19 | #include <linux/kallsyms.h> |
20 | #include <linux/ratelimit.h> | ||
20 | 21 | ||
21 | #include <asm/gentrap.h> | 22 | #include <asm/gentrap.h> |
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
@@ -771,8 +772,7 @@ asmlinkage void | |||
771 | do_entUnaUser(void __user * va, unsigned long opcode, | 772 | do_entUnaUser(void __user * va, unsigned long opcode, |
772 | unsigned long reg, struct pt_regs *regs) | 773 | unsigned long reg, struct pt_regs *regs) |
773 | { | 774 | { |
774 | static int cnt = 0; | 775 | static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); |
775 | static unsigned long last_time; | ||
776 | 776 | ||
777 | unsigned long tmp1, tmp2, tmp3, tmp4; | 777 | unsigned long tmp1, tmp2, tmp3, tmp4; |
778 | unsigned long fake_reg, *reg_addr = &fake_reg; | 778 | unsigned long fake_reg, *reg_addr = &fake_reg; |
@@ -783,15 +783,11 @@ do_entUnaUser(void __user * va, unsigned long opcode, | |||
783 | with the unaliged access. */ | 783 | with the unaliged access. */ |
784 | 784 | ||
785 | if (!test_thread_flag (TIF_UAC_NOPRINT)) { | 785 | if (!test_thread_flag (TIF_UAC_NOPRINT)) { |
786 | if (cnt >= 5 && time_after(jiffies, last_time + 5 * HZ)) { | 786 | if (__ratelimit(&ratelimit)) { |
787 | cnt = 0; | ||
788 | } | ||
789 | if (++cnt < 5) { | ||
790 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", | 787 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", |
791 | current->comm, task_pid_nr(current), | 788 | current->comm, task_pid_nr(current), |
792 | regs->pc - 4, va, opcode, reg); | 789 | regs->pc - 4, va, opcode, reg); |
793 | } | 790 | } |
794 | last_time = jiffies; | ||
795 | } | 791 | } |
796 | if (test_thread_flag (TIF_UAC_SIGBUS)) | 792 | if (test_thread_flag (TIF_UAC_SIGBUS)) |
797 | goto give_sigbus; | 793 | goto give_sigbus; |
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c index a0902c20d677..86425ab53bf5 100644 --- a/arch/alpha/mm/init.c +++ b/arch/alpha/mm/init.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/bootmem.h> /* max_low_pfn */ | 21 | #include <linux/bootmem.h> /* max_low_pfn */ |
22 | #include <linux/vmalloc.h> | 22 | #include <linux/vmalloc.h> |
23 | #include <linux/gfp.h> | ||
23 | 24 | ||
24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c index 10b403554b65..7b2c56d8f930 100644 --- a/arch/alpha/mm/numa.c +++ b/arch/alpha/mm/numa.c | |||
@@ -197,7 +197,7 @@ setup_memory_node(int nid, void *kernel_end) | |||
197 | } | 197 | } |
198 | 198 | ||
199 | if (bootmap_start == -1) | 199 | if (bootmap_start == -1) |
200 | panic("couldn't find a contigous place for the bootmap"); | 200 | panic("couldn't find a contiguous place for the bootmap"); |
201 | 201 | ||
202 | /* Allocate the bootmap and mark the whole MM as reserved. */ | 202 | /* Allocate the bootmap and mark the whole MM as reserved. */ |
203 | bootmap_size = init_bootmem_node(NODE_DATA(nid), bootmap_start, | 203 | bootmap_size = init_bootmem_node(NODE_DATA(nid), bootmap_start, |