summaryrefslogtreecommitdiff
path: root/kern/ipc_kobject.h
diff options
context:
space:
mode:
authorMichael Kelly <mike@weatherwax.co.uk>2025-08-31 23:21:54 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-08-31 23:21:54 +0200
commitfdfca0e86009c5a7b188fa39e939de800a73391d (patch)
treed590b5ebe43d1ed21fd5dbae75240031e99b34a8 /kern/ipc_kobject.h
parenteec7037c885f6e54bf8f22d421d6abc55a2cd667 (diff)
Add mach_port_set_ktype RPC to set ktype of a user port
For now, we only allow a newly-introduced MACH_PORT_KTYPE_USER_DEVICE type that makes ipc_kmsg_copyin_body use page lists, which keep them in a busy state that prevents them from being paged out.
Diffstat (limited to 'kern/ipc_kobject.h')
-rw-r--r--kern/ipc_kobject.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/kern/ipc_kobject.h b/kern/ipc_kobject.h
index 606a66a9..63ad87c5 100644
--- a/kern/ipc_kobject.h
+++ b/kern/ipc_kobject.h
@@ -77,9 +77,10 @@ typedef unsigned int ipc_kobject_type_t;
#define IKOT_CLOCK 25
#define IKOT_CLOCK_CTRL 26
#define IKOT_PAGER_PROXY 27
+#define IKOT_USER_DEVICE 28
/* << new entries here */
-#define IKOT_UNKNOWN 28 /* magic catchall */
-#define IKOT_MAX_TYPE 29 /* # of IKOT_ types */
+#define IKOT_UNKNOWN 29 /* magic catchall */
+#define IKOT_MAX_TYPE 30 /* # of IKOT_ types */
/* Please keep ipc/ipc_object.c:ikot_print_array up to date */
#define is_ipc_kobject(ikot) (ikot != IKOT_NONE)
@@ -90,7 +91,9 @@ typedef unsigned int ipc_kobject_type_t;
*/
#define ipc_kobject_vm_page_list(ikot) \
- ((ikot == IKOT_PAGING_REQUEST) || (ikot == IKOT_DEVICE))
+ ((ikot == IKOT_PAGING_REQUEST) || \
+ (ikot == IKOT_DEVICE) || \
+ (ikot == IKOT_USER_DEVICE))
#define ipc_kobject_vm_page_steal(ikot) (ikot == IKOT_PAGING_REQUEST)