[FREELDR] Cache INT13h drive data in pcdisk.c (#2097)
[reactos.git] / boot / freeldr / freeldr / include / conversion.h
1 /*
2 * PROJECT: EFI Windows Loader
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: boot/freeldr/freeldr/windows/conversion.c
5 * PURPOSE: Physical <-> Virtual addressing mode conversions (arch-specific)
6 * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org)
7 */
8
9 #pragma once
10
11 #ifndef _ZOOM2_
12 /* Arch-specific addresses translation implementation */
13 FORCEINLINE
14 PVOID
15 VaToPa(PVOID Va)
16 {
17 return (PVOID)((ULONG_PTR)Va & ~KSEG0_BASE);
18 }
19
20 FORCEINLINE
21 PVOID
22 PaToVa(PVOID Pa)
23 {
24 return (PVOID)((ULONG_PTR)Pa | KSEG0_BASE);
25 }
26 #else
27 FORCEINLINE
28 PVOID
29 VaToPa(PVOID Va)
30 {
31 return Va;
32 }
33
34 FORCEINLINE
35 PVOID
36 PaToVa(PVOID Pa)
37 {
38 return Pa;
39 }
40 #endif