summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2023-09-03 00:15:47 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2023-09-03 00:15:47 +0000
commitb111708cf045507dbca15cf59ec778f041f47063 (patch)
tree01109734b213b3895ed72ca125809fb66fb8dc8c /sys
parent63d54e0c9062f0eb8dc1e6302357590d456bdf57 (diff)
Inline PTED_* functions and actually use PTED_WIRED()
As noted by drahn@ the compiler did inline said functions, but it also provided them as unused symbols. ok miod@ mlarkin@ kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/riscv64/riscv64/pmap.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/sys/arch/riscv64/riscv64/pmap.c b/sys/arch/riscv64/riscv64/pmap.c
index 069dfac8cf1..148314da56e 100644
--- a/sys/arch/riscv64/riscv64/pmap.c
+++ b/sys/arch/riscv64/riscv64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.31 2023/09/03 00:03:30 jca Exp $ */
+/* $OpenBSD: pmap.c,v 1.32 2023/09/03 00:15:46 jca Exp $ */
/*
* Copyright (c) 2019-2020 Brian Bamsch <bbamsch@google.com>
@@ -431,23 +431,19 @@ pmap_vp_page_free(struct pool *pp, void *v)
km_free(v, pp->pr_pgsize, &kv_any, &kp_dirty);
}
-u_int32_t PTED_MANAGED(struct pte_desc *pted);
-u_int32_t PTED_WIRED(struct pte_desc *pted);
-u_int32_t PTED_VALID(struct pte_desc *pted);
-
-u_int32_t
+static inline u_int32_t
PTED_MANAGED(struct pte_desc *pted)
{
return (pted->pted_va & PTED_VA_MANAGED_M);
}
-u_int32_t
+static inline u_int32_t
PTED_WIRED(struct pte_desc *pted)
{
return (pted->pted_va & PTED_VA_WIRED_M);
}
-u_int32_t
+static inline u_int32_t
PTED_VALID(struct pte_desc *pted)
{
return (pted->pted_pte != 0);
@@ -608,7 +604,7 @@ pmap_remove(pmap_t pm, vaddr_t sva, vaddr_t eva)
if (pted == NULL)
continue;
- if (pted->pted_va & PTED_VA_WIRED_M) {
+ if (PTED_WIRED(pted)) {
pm->pm_stats.wired_count--;
pted->pted_va &= ~PTED_VA_WIRED_M;
}
@@ -627,7 +623,7 @@ pmap_remove_pted(pmap_t pm, struct pte_desc *pted)
{
pm->pm_stats.resident_count--;
- if (pted->pted_va & PTED_VA_WIRED_M) {
+ if (PTED_WIRED(pted)) {
pm->pm_stats.wired_count--;
pted->pted_va &= ~PTED_VA_WIRED_M;
}
@@ -747,7 +743,7 @@ pmap_kremove_pg(vaddr_t va)
if (PTED_MANAGED(pted))
pmap_remove_pv(pted);
- if (pted->pted_va & PTED_VA_WIRED_M)
+ if (PTED_WIRED(pted))
pm->pm_stats.wired_count--;
/* invalidate pted; */
@@ -1869,7 +1865,7 @@ pmap_unwire(pmap_t pm, vaddr_t va)
pmap_lock(pm);
pted = pmap_vp_lookup(pm, va, NULL);
- if ((pted != NULL) && (pted->pted_va & PTED_VA_WIRED_M)) {
+ if (pted != NULL && PTED_WIRED(pted)) {
pm->pm_stats.wired_count--;
pted->pted_va &= ~PTED_VA_WIRED_M;
}