From: Anton Blanchard From: Rusty Russell 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. --- 25-akpm/arch/ppc64/kernel/HvCall.c | 4 +- 25-akpm/arch/ppc64/kernel/iSeries_VpdInfo.c | 3 + 25-akpm/arch/ppc64/kernel/iSeries_iommu.c | 6 +-- 25-akpm/arch/ppc64/kernel/iSeries_pci.c | 4 +- 25-akpm/arch/ppc64/kernel/iSeries_setup.c | 3 - 25-akpm/arch/ppc64/kernel/mf.c | 12 ++----- 25-akpm/arch/ppc64/kernel/pSeries_iommu.c | 2 - 25-akpm/arch/ppc64/kernel/pSeries_lpar.c | 3 + 25-akpm/arch/ppc64/kernel/pci_dma_direct.c | 4 +- 25-akpm/arch/ppc64/kernel/pmac_iommu.c | 6 +-- 25-akpm/arch/ppc64/kernel/prom.c | 11 ++++-- 25-akpm/arch/ppc64/kernel/rtas.c | 8 ++-- 25-akpm/arch/ppc64/kernel/smp.c | 2 - 25-akpm/arch/ppc64/mm/hash_utils.c | 8 +++- 25-akpm/arch/ppc64/mm/init.c | 5 +-- 25-akpm/include/asm-ppc64/abs_addr.h | 39 ++++++++---------------- 25-akpm/include/asm-ppc64/iSeries/HvCallEvent.h | 10 +++--- 25-akpm/include/asm-ppc64/iSeries/iSeries_pci.h | 3 + 25-akpm/include/asm-ppc64/page.h | 13 -------- 19 files changed, 62 insertions(+), 84 deletions(-) diff -puN arch/ppc64/kernel/HvCall.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/HvCall.c --- 25/arch/ppc64/kernel/HvCall.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/HvCall.c Tue Mar 30 15:45:59 2004 @@ -19,7 +19,7 @@ void HvCall_writeLogBuffer(const void *b { 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 *b 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; } diff -puN arch/ppc64/kernel/iSeries_iommu.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/iSeries_iommu.c --- 25/arch/ppc64/kernel/iSeries_iommu.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/iSeries_iommu.c Tue Mar 30 15:45:59 2004 @@ -76,7 +76,7 @@ static void tce_build_iSeries(struct iom 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 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); diff -puN arch/ppc64/kernel/iSeries_pci.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/iSeries_pci.c --- 25/arch/ppc64/kernel/iSeries_pci.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/iSeries_pci.c Tue Mar 30 15:45:59 2004 @@ -277,7 +277,7 @@ static void iSeries_Scan_PHBs_Slots(stru */ 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(HvB "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", diff -puN arch/ppc64/kernel/iSeries_setup.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/iSeries_setup.c --- 25/arch/ppc64/kernel/iSeries_setup.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/iSeries_setup.c Tue Mar 30 15:45:59 2004 @@ -658,8 +658,7 @@ static void __init iSeries_bolt_kernel(u 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); } } diff -puN arch/ppc64/kernel/iSeries_VpdInfo.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/iSeries_VpdInfo.c --- 25/arch/ppc64/kernel/iSeries_VpdInfo.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/iSeries_VpdInfo.c Tue Mar 30 15:45:59 2004 @@ -293,7 +293,8 @@ void iSeries_Get_Location_Code(struct iS 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"); diff -puN arch/ppc64/kernel/mf.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/mf.c --- 25/arch/ppc64/kernel/mf.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/mf.c Tue Mar 30 15:45:59 2004 @@ -763,14 +763,10 @@ void mf_getSrcHistory(char *buffer, int 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; diff -puN arch/ppc64/kernel/pci_dma_direct.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/pci_dma_direct.c --- 25/arch/ppc64/kernel/pci_dma_direct.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/pci_dma_direct.c Tue Mar 30 15:45:59 2004 @@ -37,7 +37,7 @@ static void *pci_direct_alloc_consistent 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(s 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, diff -puN arch/ppc64/kernel/pmac_iommu.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/pmac_iommu.c --- 25/arch/ppc64/kernel/pmac_iommu.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/pmac_iommu.c Tue Mar 30 15:45:59 2004 @@ -154,7 +154,7 @@ static void dart_build_pmac(struct iommu * 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 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_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++) diff -puN arch/ppc64/kernel/prom.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/prom.c --- 25/arch/ppc64/kernel/prom.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/prom.c Tue Mar 30 15:45:59 2004 @@ -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); diff -puN arch/ppc64/kernel/pSeries_iommu.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/pSeries_iommu.c --- 25/arch/ppc64/kernel/pSeries_iommu.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/pSeries_iommu.c Tue Mar 30 15:45:59 2004 @@ -61,7 +61,7 @@ static void tce_build_pSeries(struct iom 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; diff -puN arch/ppc64/kernel/pSeries_lpar.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/pSeries_lpar.c --- 25/arch/ppc64/kernel/pSeries_lpar.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/pSeries_lpar.c Tue Mar 30 15:45:59 2004 @@ -36,6 +36,7 @@ #include #include #include +#include /* in pSeries_hvCall.S */ EXPORT_SYMBOL(plpar_hcall); @@ -135,7 +136,7 @@ static void tce_build_pSeriesLP(struct i 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; diff -puN arch/ppc64/kernel/rtas.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/rtas.c --- 25/arch/ppc64/kernel/rtas.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/rtas.c Tue Mar 30 15:45:59 2004 @@ -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 */ diff -puN arch/ppc64/kernel/smp.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/kernel/smp.c --- 25/arch/ppc64/kernel/smp.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/kernel/smp.c Tue Mar 30 15:45:59 2004 @@ -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 */ diff -puN arch/ppc64/mm/hash_utils.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/mm/hash_utils.c --- 25/arch/ppc64/mm/hash_utils.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/mm/hash_utils.c Tue Mar 30 15:45:59 2004 @@ -48,6 +48,8 @@ #include #include #include +#include + /* * Note: pte --> Linux PTE * HPTE --> PowerPC Hashed Page Table Entry @@ -107,11 +109,11 @@ static inline void create_pte_mapping(un 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; diff -puN arch/ppc64/mm/init.c~ppc64-cleanup-virtual-absolute-code arch/ppc64/mm/init.c --- 25/arch/ppc64/mm/init.c~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/arch/ppc64/mm/init.c Tue Mar 30 15:45:59 2004 @@ -60,6 +60,7 @@ #include #include #include +#include struct mmu_context_queue_t mmu_context_queue; @@ -153,7 +154,7 @@ static void map_io_page(unsigned long ea 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, total_pages); diff -puN include/asm-ppc64/abs_addr.h~ppc64-cleanup-virtual-absolute-code include/asm-ppc64/abs_addr.h --- 25/include/asm-ppc64/abs_addr.h~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/include/asm-ppc64/abs_addr.h Tue Mar 30 15:45:59 2004 @@ -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 */ diff -puN include/asm-ppc64/iSeries/HvCallEvent.h~ppc64-cleanup-virtual-absolute-code include/asm-ppc64/iSeries/HvCallEvent.h --- 25/include/asm-ppc64/iSeries/HvCallEvent.h~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/include/asm-ppc64/iSeries/HvCallEvent.h Tue Mar 30 15:45:59 2004 @@ -100,7 +100,7 @@ static inline void HvCallEvent_setLpEven { 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_s 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_a 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_c 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_dma 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(); diff -puN include/asm-ppc64/iSeries/iSeries_pci.h~ppc64-cleanup-virtual-absolute-code include/asm-ppc64/iSeries/iSeries_pci.h --- 25/include/asm-ppc64/iSeries/iSeries_pci.h~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/include/asm-ppc64/iSeries/iSeries_pci.h Tue Mar 30 15:45:59 2004 @@ -31,6 +31,7 @@ /************************************************************************/ #include +#include 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 */ diff -puN include/asm-ppc64/page.h~ppc64-cleanup-virtual-absolute-code include/asm-ppc64/page.h --- 25/include/asm-ppc64/page.h~ppc64-cleanup-virtual-absolute-code Tue Mar 30 15:45:59 2004 +++ 25-akpm/include/asm-ppc64/page.h Tue Mar 30 15:45:59 2004 @@ -212,19 +212,6 @@ extern int page_is_ram(unsigned long phy #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) _