1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
TP-Link_Archer-XR500v/EN7526G_3.18Kernel_SDK/bootrom/bootram/include/asm/virtconvert.h
2024-07-22 01:58:46 -03:00

39 lines
792 B
C
Executable File

#ifndef __MIPSNOMMU_VIRT_CONVERT__
#define __MIPSNOMMU_VIRT_CONVERT__
#ifdef __KERNEL__
#include <asm/addrspace.h>
//lobo add
#include <asm/page.h>
/*
* Change virtual addresses to physical addresses and vv.
* These are trivial on the 1:1 Linux/MIPS mapping
*/
extern inline unsigned long virt_to_phys(volatile void * address)
{
return (unsigned long)(address-PAGE_OFFSET) ;
}
extern inline void * phys_to_virt(unsigned long address)
{
return (void *)(address +PAGE_OFFSET);
}
/*
* IO bus memory addresses are also 1:1 with the physical address
*/
extern inline unsigned long virt_to_bus(volatile void * address)
{
return (unsigned long)(address-PAGE_OFFSET) ;
}
extern inline void * bus_to_virt(unsigned long address)
{
return (void *)(address +PAGE_OFFSET);
}
#endif
#endif