sgi-xp: create a common xp_remote_memcpy() function
Create a common remote memcpy function that maps to what the hardware booted supports. Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
bc63d387e4
commit
908787db9b
@@ -17,7 +17,6 @@
|
||||
#include <linux/hardirq.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <asm/sn/types.h>
|
||||
#include <asm/sn/bte.h>
|
||||
#ifdef CONFIG_IA64
|
||||
#include <asm/sn/arch.h>
|
||||
#endif
|
||||
@@ -71,46 +70,6 @@
|
||||
#define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8)
|
||||
#define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64)
|
||||
|
||||
/*
|
||||
* Wrapper for bte_copy() that should it return a failure status will retry
|
||||
* the bte_copy() once in the hope that the failure was due to a temporary
|
||||
* aberration (i.e., the link going down temporarily).
|
||||
*
|
||||
* src - physical address of the source of the transfer.
|
||||
* vdst - virtual address of the destination of the transfer.
|
||||
* len - number of bytes to transfer from source to destination.
|
||||
* mode - see bte_copy() for definition.
|
||||
* notification - see bte_copy() for definition.
|
||||
*
|
||||
* Note: xp_bte_copy() should never be called while holding a spinlock.
|
||||
*/
|
||||
static inline bte_result_t
|
||||
xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification)
|
||||
{
|
||||
bte_result_t ret;
|
||||
u64 pdst = ia64_tpa(vdst);
|
||||
|
||||
/*
|
||||
* Ensure that the physically mapped memory is contiguous.
|
||||
*
|
||||
* We do this by ensuring that the memory is from region 7 only.
|
||||
* If the need should arise to use memory from one of the other
|
||||
* regions, then modify the BUG_ON() statement to ensure that the
|
||||
* memory from that region is always physically contiguous.
|
||||
*/
|
||||
BUG_ON(REGION_NUMBER(vdst) != RGN_KERNEL);
|
||||
|
||||
ret = bte_copy(src, pdst, len, mode, notification);
|
||||
if ((ret != BTE_SUCCESS) && BTE_ERROR_RETRY(ret)) {
|
||||
if (!in_interrupt())
|
||||
cond_resched();
|
||||
|
||||
ret = bte_copy(src, pdst, len, mode, notification);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPC establishes channel connections between the local partition and any
|
||||
* other partition that is currently up. Over these channels, kernel-level
|
||||
@@ -408,6 +367,8 @@ xpc_partid_to_nasids(short partid, void *nasids)
|
||||
|
||||
extern short xp_max_npartitions;
|
||||
|
||||
extern enum xp_retval (*xp_remote_memcpy) (void *, const void *, size_t);
|
||||
|
||||
extern u64 xp_nofault_PIOR_target;
|
||||
extern int xp_nofault_PIOR(void *);
|
||||
extern int xp_error_PIOR(void);
|
||||
|
Reference in New Issue
Block a user