Helper functions adapted from the ixy driver More...
#include <enso/consts.h>#include <enso/ixy_helpers.h>#include <fcntl.h>#include <sys/mman.h>#include <unistd.h>#include <cstdint>#include <cstdio>#include <iostream>#include <string>Go to the source code of this file.
Functions | |
| uint64_t | enso::virt_to_phys (void *virt) |
| void * | enso::get_huge_page (const std::string &path, size_t size=0, bool mirror=false) |
Helper functions adapted from the ixy driver
Definition in file ixy_helpers.cpp.
| void * enso::get_huge_page | ( | const std::string & | path, |
| size_t | size = 0, |
||
| bool | mirror = false |
||
| ) |
Allocates a huge page and returns a pointer to it.
Huge pages are allocated to be kBufPageSize bytes in size.
| path | Path to huge page file. |
| size | The size of the huge page to be allocated. If 0, defaults to kBufPageSize. |
| mirror | Whether to mirror the huge page or not. Mirroring means that the same page is mapped again right after the allocated memory. This is useful to handle wrap-around in the buffers. Defaults to false. |
Definition at line 82 of file ixy_helpers.cpp.
| uint64_t enso::virt_to_phys | ( | void * | virt | ) |
Converts a virtual address to a physical address.
| virt | The virtual address to convert. |
Definition at line 51 of file ixy_helpers.cpp.