diff --git a/sys/compat/linuxkpi/common/include/linux/mmu_notifier.h b/sys/compat/linuxkpi/common/include/linux/mmu_notifier.h --- a/sys/compat/linuxkpi/common/include/linux/mmu_notifier.h +++ b/sys/compat/linuxkpi/common/include/linux/mmu_notifier.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 2017 Mark Johnston + * Copyright (c) 2026 The FreeBSD Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,9 +26,68 @@ */ #ifndef _LINUXKPI_LINUX_MMU_NOTIFIER_H_ -#define _LINUXKPI_LINUX_MMU_NOTIFIER_H_ +#define _LINUXKPI_LINUX_MMU_NOTIFIER_H_ + + +#include + +/* + * XXX: These functions are stubbed out. This is a temporary placeholder + * to allow compilation. Note that these functions have no implementation; + * using them will result in silent failure, memory corruption, or system + * instability. +*/ + +struct mm_struct; +struct mmu_notifier; + +struct mmu_notifier_ops { + void (*release)(struct mmu_notifier *mn, struct mm_struct *mm); + struct mmu_notifier *(*alloc_notifier)(struct mm_struct *mm); + void (*free_notifier)(struct mmu_notifier *mn); + void (*invalidate_range_start)(struct mmu_notifier *mn, const void *range); + void (*invalidate_range_end)(struct mmu_notifier *mn, const void *range); +}; struct mmu_notifier { + const struct mmu_notifier_ops *ops; }; + +static inline int +mmu_notifier_register(__unused struct mmu_notifier *mn, __unused struct mm_struct *mm) +{ + pr_debug("%s TODO\n", __func__); + return (-EINVAL); +} + +static inline void +mmu_notifier_unregister(__unused struct mmu_notifier *mn, __unused struct mm_struct *mm) +{ + pr_debug("%s TODO\n", __func__); +} + +static inline struct mmu_notifier * +mmu_notifier_get(const struct mmu_notifier_ops *ops, struct mm_struct *mm) +{ + pr_debug("%s TODO\n", __func__); + if (ops != NULL && ops->alloc_notifier != NULL) + return (ops->alloc_notifier(mm)); + return (ERR_PTR(-EINVAL)); +} + +static inline void +mmu_notifier_put(struct mmu_notifier *mn) +{ + pr_debug("%s TODO\n", __func__); + if (mn != NULL && mn->ops != NULL && mn->ops->free_notifier != NULL) + mn->ops->free_notifier(mn); +} + +static inline void +mmu_notifier_synchronize(void) +{ + pr_debug("%s TODO\n", __func__); +} + #endif /* _LINUXKPI_LINUX_MMU_NOTIFIER_H_ */