[xen master] xen/pdx: Introduce helper to convert MFN <-> PDX

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] xen/pdx: Introduce helper to convert MFN <-> PDX

patchbot
commit 18d12056ccea435dca7fcbe2085fff15bca19046
Author:     Julien Grall <[hidden email]>
AuthorDate: Wed Feb 21 13:46:25 2018 +0000
Commit:     Andrew Cooper <[hidden email]>
CommitDate: Thu Apr 5 18:43:43 2018 +0100

    xen/pdx: Introduce helper to convert MFN <-> PDX
   
    This will avoid use of pfn_to_pdx(mfn_x(mfn)) over the code base.
   
    Signed-off-by: Julien Grall <[hidden email]>
    Reviewed-by: Wei Liu <[hidden email]>
    Acked-by: Andrew Cooper <[hidden email]>
---
 xen/include/xen/pdx.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
index 4c56645c4c..a151aac1a2 100644
--- a/xen/include/xen/pdx.h
+++ b/xen/include/xen/pdx.h
@@ -35,6 +35,9 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
            ((pdx << pfn_pdx_hole_shift) & pfn_top_mask);
 }
 
+#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
+#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
+
 extern void pfn_pdx_hole_setup(unsigned long);
 
 #endif /* HAS_PDX */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog