MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ff_mem_virt2phy

Function ff_mem_virt2phy

lib/ff_memory.c:285–298  ·  view source on GitHub ↗

* Get physical address of any mapped virtual address in the current process. */

Source from the content-addressed store, hash-verified

283 * Get physical address of any mapped virtual address in the current process.
284 */
285static inline uint64_t ff_mem_virt2phy(const void* virtaddr)
286{
287 uint64_t addr = 0;
288 uint32_t pages = 0;
289
290 pages = (((uint64_t)virtaddr - (uint64_t)ff_page_start)>>PAGE_SHIFT);
291 if (pages >= (uint32_t)stklist_size(&ff_mpage_ctl)){
292 rte_panic("ff_mbuf_virt2phy get invalid pages %d.", pages);
293 return -1;
294 }
295
296 addr = ff_mpage_phy[pages] + ((const uint64_t)virtaddr & PAGE_MASK);
297 return addr;
298}
299
300void *ff_mem_get_page()
301{

Callers 1

ff_bsd_to_rteFunction · 0.85

Calls 1

stklist_sizeFunction · 0.85

Tested by

no test coverage detected