]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ppc64: clean up virtual <-> absolute code
authorAndrew Morton <akpm@osdl.org>
Wed, 31 Mar 2004 00:34:59 +0000 (16:34 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 31 Mar 2004 00:34:59 +0000 (16:34 -0800)
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.

19 files changed:
arch/ppc64/kernel/HvCall.c
arch/ppc64/kernel/iSeries_VpdInfo.c
arch/ppc64/kernel/iSeries_iommu.c
arch/ppc64/kernel/iSeries_pci.c
arch/ppc64/kernel/iSeries_setup.c
arch/ppc64/kernel/mf.c
arch/ppc64/kernel/pSeries_iommu.c
arch/ppc64/kernel/pSeries_lpar.c
arch/ppc64/kernel/pci_dma_direct.c
arch/ppc64/kernel/pmac_iommu.c
arch/ppc64/kernel/prom.c
arch/ppc64/kernel/rtas.c
arch/ppc64/kernel/smp.c
arch/ppc64/mm/hash_utils.c
arch/ppc64/mm/init.c
include/asm-ppc64/abs_addr.h
include/asm-ppc64/iSeries/HvCallEvent.h
include/asm-ppc64/iSeries/iSeries_pci.h
include/asm-ppc64/page.h

index 4ef173f1500428dcd659d225f48e4e99da06c46c..b772e65b57a27373b92db7959486be9142125b64 100644 (file)
@@ -19,7 +19,7 @@ void HvCall_writeLogBuffer(const void *buffer, u64 len)
 {
        struct HvLpBufferList hv_buf;
        u64 left_this_page;
-       u64 cur = virt_to_absolute((unsigned long)buffer);
+       u64 cur = virt_to_abs(buffer);
 
        while (len) {
                hv_buf.addr = cur;
@@ -29,7 +29,7 @@ void HvCall_writeLogBuffer(const void *buffer, u64 len)
                hv_buf.len = left_this_page;
                len -= left_this_page;
                HvCall2(HvCallBaseWriteLogBuffer,
-                               virt_to_absolute((unsigned long)&hv_buf),
+                               virt_to_abs(&hv_buf),
                                left_this_page);
                cur = (cur & PAGE_MASK) + PAGE_SIZE;
        }
index 0138f8a257e6ed577960595be324f84adaff3482..b6d4b9308469df9ccc7515be02ffcefcd9db67f5 100644 (file)
@@ -293,7 +293,8 @@ void iSeries_Get_Location_Code(struct iSeries_Device_Node *DevNode)
                return;
        }
        BusVpdLen = HvCallPci_getBusVpd(ISERIES_BUS(DevNode),
-                       REALADDR(BusVpdPtr), BUS_VPDSIZE);
+                                       ISERIES_HV_ADDR(BusVpdPtr),
+                                       BUS_VPDSIZE);
        if (BusVpdLen == 0) {
                kfree(BusVpdPtr);
                printk("PCI: Bus VPD Buffer zero length.\n");
index 087bc10169ef6cba6364b25f22c34c2558fb866f..1922af2dbd431e8eb292284e64e1045ffbb77237 100644 (file)
@@ -76,7 +76,7 @@ static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
        
        while (npages--) {
                tce.te_word = 0;
-               tce.te_bits.tb_rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT;
+               tce.te_bits.tb_rpn = virt_to_abs(uaddr) >> PAGE_SHIFT;
 
                if (tbl->it_type == TCE_VB) {
                        /* Virtual Bus */
@@ -130,7 +130,7 @@ void __init iommu_vio_init(void)
        cb.itc_busno = 255;    /* Bus 255 is the virtual bus */
        cb.itc_virtbus = 0xff; /* Ask for virtual bus */
        
-       cbp = virt_to_absolute((unsigned long)&cb);
+       cbp = virt_to_abs(&cb);
        HvCallXm_getTceTableParms(cbp);
        
        veth_iommu_table.it_size        = cb.itc_size / 2;
@@ -209,7 +209,7 @@ static void iommu_table_getparms(struct iSeries_Device_Node* dn,
        parms->itc_slotno  = dn->LogicalSlot;
        parms->itc_virtbus = 0;
 
-       HvCallXm_getTceTableParms(REALADDR(parms));
+       HvCallXm_getTceTableParms(ISERIES_HV_ADDR(parms));
 
        if (parms->itc_size == 0)
                panic("PCI_DMA: parms->size is zero, parms is 0x%p", parms);
index a0182d16b1470b070888d6d3fd6108b5c23f0077..3472d188e29a2cd33c7de54e684ff2b53d941078 100644 (file)
@@ -277,7 +277,7 @@ static void iSeries_Scan_PHBs_Slots(struct pci_controller *Phb)
         */
        for (IdSel = 1; IdSel < MaxAgents; ++IdSel) {
                HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel,
-                               REALADDR(DevInfo),
+                               ISERIES_HV_ADDR(DevInfo),
                                sizeof(struct HvCallPci_DeviceInfo));
                if (HvRc == 0) {
                        if (DevInfo->deviceType == HvCallPci_NodeDevice)
@@ -318,7 +318,7 @@ static void iSeries_Scan_EADs_Bridge(HvBusNumber bus, HvSubBusNumber SubBus,
                                        "PCI:Connect EADs: 0x%02X.%02X.%02X\n",
                                        bus, SubBus, AgentId);
                        HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId,
-                                       REALADDR(BridgeInfo),
+                                       ISERIES_HV_ADDR(BridgeInfo),
                                        sizeof(struct HvCallPci_BridgeInfo));
                        if (HvRc == 0) {
                                printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n",
index f15d180a87bd71a24968b9136ecf27b37bd29da4..f2271fdbba444f60711a634052b13885e1632278 100644 (file)
@@ -658,8 +658,7 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
                        HvCallHpt_setPp(slot, PP_RWXX);
                } else
                        /* No HPTE exists, so create a new bolted one */
-                       iSeries_make_pte(va, (unsigned long)__v2a(ea),
-                                       mode_rw);
+                       iSeries_make_pte(va, phys_to_abs(pa), mode_rw);
        }
 }
 
index 7e256301027cebbb8f06a41a0b054bec6e6fe71e..dd30aaad9d8c1e7b2999560ea74897f4abde93fc 100644 (file)
@@ -763,14 +763,10 @@ void mf_getSrcHistory(char *buffer, int size)
        ev->event.data.vsp_cmd.lp_index = HvLpConfig_getLpIndex();
        ev->event.data.vsp_cmd.result_code = 0xFF;
        ev->event.data.vsp_cmd.reserved = 0;
-       ev->event.data.vsp_cmd.sub_data.page[0] =
-               (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[0]));
-       ev->event.data.vsp_cmd.sub_data.page[1] =
-               (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[1]));
-       ev->event.data.vsp_cmd.sub_data.page[2] =
-               (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[2]));
-       ev->event.data.vsp_cmd.sub_data.page[3] =
-               (0x8000000000000000ULL | virt_to_absolute((unsigned long)pages[3]));
+       ev->event.data.vsp_cmd.sub_data.page[0] = ISERIES_HV_ADDR(pages[0]);
+       ev->event.data.vsp_cmd.sub_data.page[1] = ISERIES_HV_ADDR(pages[1]);
+       ev->event.data.vsp_cmd.sub_data.page[2] = ISERIES_HV_ADDR(pages[2]);
+       ev->event.data.vsp_cmd.sub_data.page[3] = ISERIES_HV_ADDR(pages[3]);
        mb();
        if (signal_event(ev) != 0)
                return;
index 72c6726f5a07c60766679d676f515c6ee91755cc..cfa278643ab51fbac9cca6319c363dc3a93ec150 100644 (file)
@@ -61,7 +61,7 @@ static void tce_build_pSeries(struct iommu_table *tbl, long index,
 
        while (npages--) {
                /* can't move this out since we might cross LMB boundary */
-               t.te_rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT;
+               t.te_rpn = (virt_to_abs(uaddr)) >> PAGE_SHIFT;
        
                tp->te_word = t.te_word;
 
index b419eb3f1682f813194b63253718e5f82ea9afd0..d1a28982f378d472952fe5b394fef0e5e91d6e1d 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/tlb.h>
 #include <asm/hvcall.h>
 #include <asm/prom.h>
+#include <asm/abs_addr.h>
 
 /* in pSeries_hvCall.S */
 EXPORT_SYMBOL(plpar_hcall);
@@ -135,7 +136,7 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum, long npage
        union tce_entry tce;
 
        tce.te_word = 0;
-       tce.te_rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT;
+       tce.te_rpn = (virt_to_abs(uaddr)) >> PAGE_SHIFT;
        tce.te_rdwr = 1;
        if (direction != PCI_DMA_TODEVICE)
                tce.te_pciwr = 1;
index d978b65233987863530c1f99f36c02d8aad6f2b0..1cd843237ed9abce1f6849c6611bde67b78cde73 100644 (file)
@@ -37,7 +37,7 @@ static void *pci_direct_alloc_consistent(struct pci_dev *hwdev, size_t size,
        ret = (void *)__get_free_pages(GFP_ATOMIC, get_order(size));
        if (ret != NULL) {
                memset(ret, 0, size);
-               *dma_handle = virt_to_absolute((unsigned long)ret);
+               *dma_handle = virt_to_abs(ret);
        }
        return ret;
 }
@@ -51,7 +51,7 @@ static void pci_direct_free_consistent(struct pci_dev *hwdev, size_t size,
 static dma_addr_t pci_direct_map_single(struct pci_dev *hwdev, void *ptr,
                                  size_t size, int direction)
 {
-       return virt_to_absolute((unsigned long)ptr);
+       return virt_to_abs(ptr);
 }
 
 static void pci_direct_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
index e3c181c116b9d324a8271808ba6cac7fb1191f82..e04c344c127e6245a20ae5171730e98c718321da 100644 (file)
@@ -154,7 +154,7 @@ static void dart_build_pmac(struct iommu_table *tbl, long index,
         * out of the loop.
         */
        while (npages--) {
-               rpn = (virt_to_absolute(uaddr)) >> PAGE_SHIFT;
+               rpn = virt_to_abs(uaddr) >> PAGE_SHIFT;
 
                *(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK);
 
@@ -210,7 +210,7 @@ static int dart_init(struct device_node *dart_node)
        if (tmp == 0)
                panic("U3-DART: Cannot allocate spare page !");
        dart_emptyval = DARTMAP_VALID |
-               ((virt_to_absolute(tmp) >> PAGE_SHIFT) & DARTMAP_RPNMASK);
+               ((virt_to_abs(tmp) >> PAGE_SHIFT) & DARTMAP_RPNMASK);
 
        /* Map in DART registers. FIXME: Use device node to get base address */
        dart = ioremap(DART_BASE, 0x7000);
@@ -225,7 +225,7 @@ static int dart_init(struct device_node *dart_node)
                (((dart_tablesize >> PAGE_SHIFT) & DARTCNTL_SIZE_MASK)
                                 << DARTCNTL_SIZE_SHIFT);
        p = virt_to_page(dart_tablebase);
-       dart_vbase = ioremap(virt_to_absolute(dart_tablebase), dart_tablesize);
+       dart_vbase = ioremap(virt_to_abs(dart_tablebase), dart_tablesize);
 
        /* Fill initial table */
        for (i = 0; i < dart_tablesize/4; i++)
index a374d3d709c78ea8a1821026b990679f658a857c..4ea470d122afe4e9fffc781d1489cedd1fec6258 100644 (file)
@@ -900,7 +900,7 @@ prom_initialize_tce_table(void)
                        prom_panic(RELOC("ERROR, cannot find space for TCE table.\n"));
                }
 
-               vbase = absolute_to_virt(base);
+               vbase = (unsigned long)abs_to_virt(base);
 
                /* Save away the TCE table attributes for later use. */
                prom_tce_table[table].node = node;
@@ -1007,9 +1007,12 @@ prom_hold_cpus(unsigned long mem)
        extern void __secondary_hold(void);
         extern unsigned long __secondary_hold_spinloop;
         extern unsigned long __secondary_hold_acknowledge;
-        unsigned long *spinloop     = __v2a(&__secondary_hold_spinloop);
-        unsigned long *acknowledge  = __v2a(&__secondary_hold_acknowledge);
-        unsigned long secondary_hold = (unsigned long)__v2a(*PTRRELOC((unsigned long *)__secondary_hold));
+        unsigned long *spinloop
+               = (void *)virt_to_abs(&__secondary_hold_spinloop);
+        unsigned long *acknowledge
+               = (void *)virt_to_abs(&__secondary_hold_acknowledge);
+        unsigned long secondary_hold
+               = virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold));
         struct systemcfg *_systemcfg = RELOC(systemcfg);
        struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
        struct prom_t *_prom = PTRRELOC(&prom);
index dd7df2bcc8708aa65331b75f4631df9bbbf8a356..143b2f7ce5e777ae33121ac23629d78c7dfe66cb 100644 (file)
@@ -361,7 +361,7 @@ rtas_flash_firmware(void)
         */
        rtas_firmware_flash_list.num_blocks = 0;
        flist = (struct flash_block_list *)&rtas_firmware_flash_list;
-       rtas_block_list = virt_to_absolute((unsigned long)flist);
+       rtas_block_list = virt_to_abs(flist);
        if (rtas_block_list >= (4UL << 20)) {
                printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
                return;
@@ -373,13 +373,13 @@ rtas_flash_firmware(void)
        for (f = flist; f; f = next) {
                /* Translate data addrs to absolute */
                for (i = 0; i < f->num_blocks; i++) {
-                       f->blocks[i].data = (char *)virt_to_absolute((unsigned long)f->blocks[i].data);
+                       f->blocks[i].data = (char *)virt_to_abs(f->blocks[i].data);
                        image_size += f->blocks[i].length;
                }
                next = f->next;
                /* Don't translate NULL pointer for last entry */
-               if(f->next)
-                       f->next = (struct flash_block_list *)virt_to_absolute((unsigned long)f->next);
+               if (f->next)
+                       f->next = (struct flash_block_list *)virt_to_abs(f->next);
                else
                        f->next = 0LL;
                /* make num_blocks into the version/length field */
index 9c0be158e52117c3f0712f6a1ce8e541698966e5..f671515c0676e61064ae414273fa4546d0c04938 100644 (file)
@@ -629,7 +629,7 @@ int __devinit __cpu_up(unsigned int cpu)
                tmp = &stab_array[PAGE_SIZE * cpu];
                memset(tmp, 0, PAGE_SIZE); 
                paca[cpu].xStab_data.virt = (unsigned long)tmp;
-               paca[cpu].xStab_data.real = (unsigned long)__v2a(tmp);
+               paca[cpu].xStab_data.real = virt_to_abs(tmp);
        }
 
        /* create a process for the processor */
index 666044187c4c77560adc03a6f997978c5fa20418..1df6d97e25da57d7e278ccc02307d0e9a45ac9cc 100644 (file)
@@ -48,6 +48,8 @@
 #include <asm/tlb.h>
 #include <asm/cacheflush.h>
 #include <asm/cputable.h>
+#include <asm/abs_addr.h>
+
 /*
  * Note:  pte   --> Linux PTE
  *        HPTE  --> PowerPC Hashed Page Table Entry
@@ -107,11 +109,11 @@ static inline void create_pte_mapping(unsigned long start, unsigned long end,
 
                if (systemcfg->platform == PLATFORM_PSERIES_LPAR)
                        ret = pSeries_lpar_hpte_insert(hpteg, va,
-                               (unsigned long)__v2a(addr) >> PAGE_SHIFT,
+                               virt_to_abs(addr) >> PAGE_SHIFT,
                                0, mode, 1, large);
                else
                        ret = pSeries_hpte_insert(hpteg, va,
-                               (unsigned long)__v2a(addr) >> PAGE_SHIFT,
+                               virt_to_abs(addr) >> PAGE_SHIFT,
                                0, mode, 1, large);
 
                if (ret == -1) {
@@ -154,7 +156,7 @@ void __init htab_initialize(void)
                        ppc64_terminate_msg(0x20, "hpt space");
                        loop_forever();
                }
-               htab_data.htab = (HPTE *)__a2v(table);
+               htab_data.htab = abs_to_virt(table);
 
                /* htab absolute addr + encoded htabsize */
                _SDR1 = table + __ilog2(pteg_count) - 11;
index 5af1387329693d436cc89c772277942fd27db39f..61708dc2dd50c3b45438509a2a3b3f0a6dcbcde2 100644 (file)
@@ -60,6 +60,7 @@
 #include <asm/sections.h>
 #include <asm/system.h>
 #include <asm/iommu.h>
+#include <asm/abs_addr.h>
 
 
 struct mmu_context_queue_t mmu_context_queue;
@@ -153,7 +154,7 @@ static void map_io_page(unsigned long ea, unsigned long pa, int flags)
                pmdp = pmd_alloc(&ioremap_mm, pgdp, ea);
                ptep = pte_alloc_kernel(&ioremap_mm, pmdp, ea);
 
-               pa = absolute_to_phys(pa);
+               pa = abs_to_phys(pa);
                set_pte(ptep, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags)));
                spin_unlock(&ioremap_mm.page_table_lock);
        } else {
@@ -539,7 +540,7 @@ void __init do_init_bootmem(void)
         */
        bootmap_pages = bootmem_bootmap_pages(total_pages);
 
-       start = (unsigned long)__a2p(lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE));
+       start = abs_to_phys(lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE));
        BUG_ON(!start);
 
        boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
index 28500d63679341a01098848ac5e201ca3f55e907..6d4e8e787058e8253a66ee5265270abcd5b92740 100644 (file)
@@ -71,26 +71,22 @@ abs_chunk(unsigned long pchunk)
        return PTRRELOC(_msChunks->abs)[pchunk];
 }
 
-
-static inline unsigned long
-phys_to_absolute(unsigned long pa)
-{
-       return chunk_to_addr(abs_chunk(addr_to_chunk(pa))) + chunk_offset(pa);
-}
+/* A macro so it can take pointers or unsigned long. */
+#define phys_to_abs(pa)                                                     \
+       ({ unsigned long _pa = (unsigned long)(pa);                          \
+          chunk_to_addr(abs_chunk(addr_to_chunk(_pa))) + chunk_offset(_pa); \
+       })
 
 static inline unsigned long
 physRpn_to_absRpn(unsigned long rpn)
 {
        unsigned long pa = rpn << PAGE_SHIFT;
-       unsigned long aa = phys_to_absolute(pa);
+       unsigned long aa = phys_to_abs(pa);
        return (aa >> PAGE_SHIFT);
 }
 
-static inline unsigned long
-absolute_to_phys(unsigned long aa)
-{
-       return lmb_abs_to_phys(aa);
-}
+/* A macro so it can take pointers or unsigned long. */
+#define abs_to_phys(aa) lmb_abs_to_phys((unsigned long)(aa))
 
 #else  /* !CONFIG_MSCHUNKS */
 
@@ -99,23 +95,14 @@ absolute_to_phys(unsigned long aa)
 #define chunk_offset(addr) (0)
 #define abs_chunk(pchunk) (pchunk)
 
-#define phys_to_absolute(pa) (pa)
+#define phys_to_abs(pa) (pa)
 #define physRpn_to_absRpn(rpn) (rpn)
-#define absolute_to_phys(aa) (aa)
+#define abs_to_phys(aa) (aa)
 
 #endif /* !CONFIG_MSCHUNKS */
 
-
-static inline unsigned long
-virt_to_absolute(unsigned long ea)
-{
-       return phys_to_absolute(__pa(ea));
-}
-
-static inline unsigned long
-absolute_to_virt(unsigned long aa)
-{
-       return (unsigned long)__va(absolute_to_phys(aa));
-}
+/* Convenience macros */
+#define virt_to_abs(va) phys_to_abs(__pa(va))
+#define abs_to_virt(aa) __va(abs_to_phys(aa))
 
 #endif /* _ABS_ADDR_H */
index 947800ef397ef5ae382ffc258cadde15e2c2918f..191ddce0c2c6528316587d2ffbc5929365c6b066 100644 (file)
@@ -100,7 +100,7 @@ static inline void HvCallEvent_setLpEventStack(u8 queueIndex,
 {
        u64 abs_addr;
 
-       abs_addr = virt_to_absolute((unsigned long)eventStackAddr);
+       abs_addr = virt_to_abs(eventStackAddr);
        HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr,
                        eventStackSize);
        // getPaca()->adjustHmtForNoOfSpinLocksHeld();
@@ -123,7 +123,7 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event)
        printk("HvCallEvent_signalLpEvent: *event = %016lx\n ",
                        (unsigned long)event);
 #endif
-       abs_addr = virt_to_absolute((unsigned long)event);
+       abs_addr = virt_to_abs(event);
        retVal = (HvLpEvent_Rc)HvCall1(HvCallEventSignalLpEvent, abs_addr);
        // getPaca()->adjustHmtForNoOfSpinLocksHeld();
        return retVal;
@@ -164,7 +164,7 @@ static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)
        u64 abs_addr;
        HvLpEvent_Rc retVal;
 
-       abs_addr = virt_to_absolute((unsigned long)event);
+       abs_addr = virt_to_abs(event);
        retVal = (HvLpEvent_Rc)HvCall1(HvCallEventAckLpEvent, abs_addr);
        // getPaca()->adjustHmtForNoOfSpinLocksHeld();
        return retVal;
@@ -175,7 +175,7 @@ static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event)
        u64 abs_addr;
        HvLpEvent_Rc retVal;
 
-       abs_addr = virt_to_absolute((unsigned long)event);
+       abs_addr = virt_to_abs(event);
        retVal = (HvLpEvent_Rc)HvCall1(HvCallEventCancelLpEvent, abs_addr);
        // getPaca()->adjustHmtForNoOfSpinLocksHeld();
        return retVal;
@@ -286,7 +286,7 @@ static inline HvLpDma_Rc HvCallEvent_dmaToSp(void* local, u32 remote,
        u64 abs_addr;
        HvLpDma_Rc retVal;
 
-       abs_addr = virt_to_absolute((unsigned long)local);
+       abs_addr = virt_to_abs(local);
        retVal = (HvLpDma_Rc)HvCall4(HvCallEventDmaToSp, abs_addr, remote,
                        length, dir);
        // getPaca()->adjustHmtForNoOfSpinLocksHeld();
index 1125fda8aafb9a5d5233404476c9ba8a57e0a445..aa174cec6f717d3cd2ee2e4bf534f18e1009dd5b 100644 (file)
@@ -31,6 +31,7 @@
 /************************************************************************/
 
 #include <asm/iSeries/HvCallPci.h>
+#include <asm/abs_addr.h>
 
 struct pci_dev;                                /* For Forward Reference        */
 struct iSeries_Device_Node;
@@ -71,7 +72,7 @@ struct iSeries_Device_Node;
 /* Converts Virtual Address to Real Address for Hypervisor calls        */
 /************************************************************************/
 
-#define REALADDR(virtaddr)  (0x8000000000000000 | (virt_to_absolute((u64)virtaddr) ))
+#define ISERIES_HV_ADDR(virtaddr)  (0x8000000000000000 | virt_to_abs(virtaddr))
 
 /************************************************************************/
 /* iSeries Device Information                                           */
index dd2c424fbef9d88c0b9c45e8f2606e37a450bc9e..6e32a197dba4dfa5945e2434f079a437b4f20098 100644 (file)
@@ -212,19 +212,6 @@ extern int page_is_ram(unsigned long physaddr);
 
 #define __va(x) ((void *)((unsigned long)(x) + KERNELBASE))
 
-/* Given that physical addresses do not map 1-1 to absolute addresses, we
- * use these macros to better specify exactly what we want to do.
- * The only restriction on their use is that the absolute address
- * macros cannot be used until after the LMB structure has been
- * initialized in prom.c.  -Peter
- */
-#define __v2p(x) ((void *) __pa(x))
-#define __v2a(x) ((void *) phys_to_absolute(__pa(x)))
-#define __p2a(x) ((void *) phys_to_absolute(x))
-#define __p2v(x) ((void *) __va(x))
-#define __a2p(x) ((void *) absolute_to_phys(x))
-#define __a2v(x) ((void *) __va(absolute_to_phys(x)))
-
 #ifdef CONFIG_DISCONTIGMEM
 #define page_to_pfn(page)      discontigmem_page_to_pfn(page)
 #define pfn_to_page(pfn)       discontigmem_pfn_to_page(pfn)