aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-16 23:36:18 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-02-16 23:37:08 +0100
commit768a7d4a989d95e22e1249c36c57655665975918 (patch)
tree1556560f1bebf7fe21606798ee401308075134d2 /include
parent6ac0b3e58152e1ecd9851dec6f05d33f123dc198 (diff)
downloadgnumach-768a7d4a989d95e22e1249c36c57655665975918.tar.gz
gnumach-768a7d4a989d95e22e1249c36c57655665975918.tar.bz2
gnumach-768a7d4a989d95e22e1249c36c57655665975918.zip
io_map: Fix using physical addresses
Diffstat (limited to 'include')
-rw-r--r--include/mach/vm_param.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mach/vm_param.h b/include/mach/vm_param.h
index cdccce82..4cbd0eca 100644
--- a/include/mach/vm_param.h
+++ b/include/mach/vm_param.h
@@ -88,11 +88,15 @@
#define round_page(x) ((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) & ~PAGE_MASK))
#define trunc_page(x) ((vm_offset_t)(((vm_offset_t)(x)) & ~PAGE_MASK))
+#define round_phys(x) ((phys_addr_t)((((phys_addr_t)(x)) + PAGE_MASK) & ~PAGE_MASK))
+#define trunc_phys(x) ((phys_addr_t)(((phys_addr_t)(x)) & ~PAGE_MASK))
+
/*
* Determine whether an address is page-aligned, or a count is
* an exact page multiple.
*/
#define page_aligned(x) ((((vm_offset_t) (x)) & PAGE_MASK) == 0)
+#define phys_aligned(x) ((((phys_addr_t) (x)) & PAGE_MASK) == 0)
#endif /* _MACH_VM_PARAM_H_ */