diff options
Diffstat (limited to 'drivers/misc/sgi-gru/grukservices.c')
-rw-r--r-- | drivers/misc/sgi-gru/grukservices.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c index 766e21e15574..d2b149facda1 100644 --- a/drivers/misc/sgi-gru/grukservices.c +++ b/drivers/misc/sgi-gru/grukservices.c | |||
@@ -858,6 +858,29 @@ EXPORT_SYMBOL_GPL(gru_get_next_message); | |||
858 | /* ---------------------- GRU DATA COPY FUNCTIONS ---------------------------*/ | 858 | /* ---------------------- GRU DATA COPY FUNCTIONS ---------------------------*/ |
859 | 859 | ||
860 | /* | 860 | /* |
861 | * Load a DW from a global GPA. The GPA can be a memory or MMR address. | ||
862 | */ | ||
863 | int gru_read_gpa(unsigned long *value, unsigned long gpa) | ||
864 | { | ||
865 | void *cb; | ||
866 | void *dsr; | ||
867 | int ret, iaa; | ||
868 | |||
869 | STAT(read_gpa); | ||
870 | if (gru_get_cpu_resources(GRU_NUM_KERNEL_DSR_BYTES, &cb, &dsr)) | ||
871 | return MQE_BUG_NO_RESOURCES; | ||
872 | iaa = gpa >> 62; | ||
873 | gru_vload_phys(cb, gpa, gru_get_tri(dsr), iaa, IMA); | ||
874 | ret = gru_wait(cb); | ||
875 | if (ret == CBS_IDLE) | ||
876 | *value = *(unsigned long *)dsr; | ||
877 | gru_free_cpu_resources(cb, dsr); | ||
878 | return ret; | ||
879 | } | ||
880 | EXPORT_SYMBOL_GPL(gru_read_gpa); | ||
881 | |||
882 | |||
883 | /* | ||
861 | * Copy a block of data using the GRU resources | 884 | * Copy a block of data using the GRU resources |
862 | */ | 885 | */ |
863 | int gru_copy_gpa(unsigned long dest_gpa, unsigned long src_gpa, | 886 | int gru_copy_gpa(unsigned long dest_gpa, unsigned long src_gpa, |