-/* $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>
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);
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;
}
{
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;
}
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; */
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;
}