获取物理地址

#include <sys/ioctl.h>
#include <linux/android_pmem.h>

    int32_t phy_addr;

     ssize_t offset = 0;
         size_t size = 0;
         sp<IMemoryHeap> heap = frame->getMemory(&offset, &size);
     int fd = heap->getHeapID();    
     struct pmem_region region;
     ::ioctl(fd,PMEM_GET_PHYS,&region);
     phy_addr = region.offset+offset;                                


你可能感兴趣的:(struct,include)