* <!-- 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
| 194 | * address's physical address. Returns NULLPTR if the conversion failed. |
| 195 | */ |
| 196 | NODISCARD uintptr_t |
| 197 | platform_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 --> |
nothing calls this directly
no outgoing calls
no test coverage detected