Browse Source

add mach_port_deallocate - frees the port from mach_make_memory_entry()

Beau McCartney 11 months ago
parent
commit
db8950922c
1 changed files with 8 additions and 0 deletions
  1. 8 0
      core/sys/darwin/mach_darwin.odin

+ 8 - 0
core/sys/darwin/mach_darwin.odin

@@ -17,6 +17,7 @@ thread_act_t :: distinct u64
 mach_port_t :: distinct c.uint
 vm_map_t :: mach_port_t
 mem_entry_name_port_t :: mach_port_t
+ipc_space_t :: mach_port_t
 
 vm_size_t :: distinct c.uintptr_t
 
@@ -29,6 +30,8 @@ vm_prot_t :: distinct c.int
 
 vm_inherit_t :: distinct c.uint
 
+mach_port_name_t :: distinct c.uint
+
 @(default_calling_convention="c")
 foreign mach {
 	mach_task_self :: proc() -> task_t ---
@@ -69,6 +72,11 @@ foreign mach {
 		parent_entry  : mem_entry_name_port_t,
 	) -> kern_return_t ---
 
+	mach_port_deallocate :: proc (
+		task: ipc_space_t,
+		name: mach_port_name_t,
+	) -> kern_return_t ---
+
 	vm_page_size : vm_size_t
 }