• Andrew Morton's avatar
    [PATCH] ppc64: clean up virtual <-> absolute code · 807b9692
    Andrew Morton authored
    From: Anton Blanchard <anton@samba.org>
          Rusty Russell <rusty@rustcorp.com.au>
    
    The iSeries has an arch-specific mapping from physical <-> absolute
    addresses.  Fortunately this is only used in a few places.  However, the
    following arch-specific macros/functions are provided in addition to the
    standard macros:
    
    	__a2p()
    	__a2v()
    	__p2a()
    	__p2v()
    	__v2a()
    	__v2p()
    	absolute_to_phys()
    	phys_to_absolute()
    	virt_to_absolute()
    	absolute_to_virt()
    
    Reduce them to these, with slightly shorter names, and taking either pointers
    or unsigned long (as per __va and __pa) rather than making the caller cast:
    
    	abs_to_phys()
    	phys_to_abs()
    
    And helper macros:
    
    	virt_to_abs()
    	abs_to_virt()
    
    As is standard, virtual addresses are returned as void *, physical and
    absolute as unsigned long.
    
    Note that the change the iSeries_setup is a little subtle: ea is set to
    __va(pa) above, so "phys_to_abs(pa)" is the same as "virt_to_abs(ea)".
    
    Also, REALADDR is renamed to ISERIES_HV_ADDR and used in a couple of places
    where appropriate.
    807b9692
pSeries_iommu.c 7.68 KB