MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / platform_virt_to_phys

Function platform_virt_to_phys

loader/linux/src/platform.c:196–209  ·  view source on GitHub ↗

* <!-- description --> * @brief Given a virtual address, this function returns the virtual * address's physical address. Returns NULLPTR if the conversion failed. * * <!-- inputs/outputs --> * @param virt the virtual address to convert to a physical address * @return Given a virtual address, this function returns the virtual * address's physical address. Returns NULLPTR if the

Source from the content-addressed store, hash-verified

194 * address's physical address. Returns NULLPTR if the conversion failed.
195 */
196NODISCARD uintptr_t
197platform_virt_to_phys(void const *const virt) NOEXCEPT
198{
199 uintptr_t mut_ret;
200
201 if (is_vmalloc_addr(virt)) {
202 mut_ret = page_to_phys(vmalloc_to_page(virt));
203 }
204 else {
205 mut_ret = virt_to_phys((void *)virt);
206 }
207
208 return mut_ret;
209}
210
211/**
212 * <!-- description -->

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected