diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-07-19 00:29:40 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-07-19 00:29:40 +0000 |
| commit | a7e483ee146a93ac89357676fdb9af62ac58b4bc (patch) | |
| tree | e1e529344fe6098436d9b176ac58a4554fedff66 /sys/powerpc/include/vm.h | |
| parent | cbd442efe85d9ae371581565670dfc0287afbf8e (diff) | |
vm_phys: Add a sysctl to dump registered fictitious memory ranges
I've wanted this a couple of times in the past. Save the memattr in
the fictitious memory segment structure so that we can report it from
the sysctl handler, and add conversion routines for each platform.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58283
Diffstat (limited to 'sys/powerpc/include/vm.h')
| -rw-r--r-- | sys/powerpc/include/vm.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/powerpc/include/vm.h b/sys/powerpc/include/vm.h index 5c99cda51257..87d0faf44f2e 100644 --- a/sys/powerpc/include/vm.h +++ b/sys/powerpc/include/vm.h @@ -42,4 +42,29 @@ #define VM_MEMATTR_DEVICE VM_MEMATTR_DEFAULT +#ifdef _KERNEL +static inline const char * +vm_memattr_name(vm_memattr_t memattr) +{ + switch (memattr) { + case VM_MEMATTR_DEFAULT: + return ("default"); + case VM_MEMATTR_UNCACHEABLE: + return ("uncacheable"); + case VM_MEMATTR_CACHEABLE: + return ("cacheable"); + case VM_MEMATTR_WRITE_COMBINING: + return ("write-combining"); + case VM_MEMATTR_WRITE_BACK: + return ("write-back"); + case VM_MEMATTR_WRITE_THROUGH: + return ("write-through"); + case VM_MEMATTR_PREFETCHABLE: + return ("prefetchable"); + default: + return (NULL); + } +} +#endif + #endif /* !_MACHINE_VM_H_ */ |
