diff options
Diffstat (limited to 'include/asm-ia64/sn/xp.h')
-rw-r--r-- | include/asm-ia64/sn/xp.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/asm-ia64/sn/xp.h b/include/asm-ia64/sn/xp.h index 9bd2f9bf329b..6f807e0193b7 100644 --- a/include/asm-ia64/sn/xp.h +++ b/include/asm-ia64/sn/xp.h | |||
@@ -60,23 +60,37 @@ | |||
60 | * the bte_copy() once in the hope that the failure was due to a temporary | 60 | * the bte_copy() once in the hope that the failure was due to a temporary |
61 | * aberration (i.e., the link going down temporarily). | 61 | * aberration (i.e., the link going down temporarily). |
62 | * | 62 | * |
63 | * See bte_copy for definition of the input parameters. | 63 | * src - physical address of the source of the transfer. |
64 | * vdst - virtual address of the destination of the transfer. | ||
65 | * len - number of bytes to transfer from source to destination. | ||
66 | * mode - see bte_copy() for definition. | ||
67 | * notification - see bte_copy() for definition. | ||
64 | * | 68 | * |
65 | * Note: xp_bte_copy() should never be called while holding a spinlock. | 69 | * Note: xp_bte_copy() should never be called while holding a spinlock. |
66 | */ | 70 | */ |
67 | static inline bte_result_t | 71 | static inline bte_result_t |
68 | xp_bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) | 72 | xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification) |
69 | { | 73 | { |
70 | bte_result_t ret; | 74 | bte_result_t ret; |
75 | u64 pdst = ia64_tpa(vdst); | ||
71 | 76 | ||
72 | 77 | ||
73 | ret = bte_copy(src, dest, len, mode, notification); | 78 | /* |
79 | * Ensure that the physically mapped memory is contiguous. | ||
80 | * | ||
81 | * We do this by ensuring that the memory is from region 7 only. | ||
82 | * If the need should arise to use memory from one of the other | ||
83 | * regions, then modify the BUG_ON() statement to ensure that the | ||
84 | * memory from that region is always physically contiguous. | ||
85 | */ | ||
86 | BUG_ON(REGION_NUMBER(vdst) != RGN_KERNEL); | ||
74 | 87 | ||
88 | ret = bte_copy(src, pdst, len, mode, notification); | ||
75 | if (ret != BTE_SUCCESS) { | 89 | if (ret != BTE_SUCCESS) { |
76 | if (!in_interrupt()) { | 90 | if (!in_interrupt()) { |
77 | cond_resched(); | 91 | cond_resched(); |
78 | } | 92 | } |
79 | ret = bte_copy(src, dest, len, mode, notification); | 93 | ret = bte_copy(src, pdst, len, mode, notification); |
80 | } | 94 | } |
81 | 95 | ||
82 | return ret; | 96 | return ret; |