From 7bca6ad19e54e2edc4ec9cfa10da20a26e294334 Mon Sep 17 00:00:00 2001 From: Pwn20wnd Date: Sat, 9 Mar 2019 23:30:26 +0300 Subject: Merge pwn's changes to support arm64e via rebase --- kernel_call/ipc_port.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 kernel_call/ipc_port.h (limited to 'kernel_call/ipc_port.h') diff --git a/kernel_call/ipc_port.h b/kernel_call/ipc_port.h new file mode 100755 index 0000000..c48e20d --- /dev/null +++ b/kernel_call/ipc_port.h @@ -0,0 +1,52 @@ +/* + * ipc_port.h + * Brandon Azad + */ +#ifndef VOUCHER_SWAP__IPC_PORT_H_ +#define VOUCHER_SWAP__IPC_PORT_H_ + +#include +#include + +// ---- osfmk/kern/waitq.h ------------------------------------------------------------------------ + +#define _EVENT_MASK_BITS ((sizeof(uint32_t) * 8) - 7) + +#define WQT_QUEUE 0x2 + +union waitq_flags { + struct { + uint32_t /* flags */ + waitq_type:2, /* only public field */ + waitq_fifo:1, /* fifo wakeup policy? */ + waitq_prepost:1, /* waitq supports prepost? */ + waitq_irq:1, /* waitq requires interrupts disabled */ + waitq_isvalid:1, /* waitq structure is valid */ + waitq_turnstile_or_port:1, /* waitq is embedded in a turnstile (if irq safe), or port (if not irq safe) */ + waitq_eventmask:_EVENT_MASK_BITS; + }; + uint32_t flags; +}; + +// ---- osfmk/kern/ipc_kobject.h ------------------------------------------------------------------ + +#define IKOT_NONE 0 +#define IKOT_TASK 2 + +// ---- osfmk/ipc/ipc_object.h -------------------------------------------------------------------- + +#define IO_BITS_KOTYPE 0x00000fff /* used by the object */ +#define IO_BITS_ACTIVE 0x80000000 /* is object alive? */ + +#define io_makebits(active, otype, kotype) \ + (((active) ? IO_BITS_ACTIVE : 0) | ((otype) << 16) | (kotype)) + +#define IOT_PORT 0 + +// ---- Custom definitions ------------------------------------------------------------------------ + +#define MACH_HEADER_SIZE_DELTA (2 * (sizeof(uint64_t) - sizeof(uint32_t))) + +// ------------------------------------------------------------------------------------------------ + +#endif -- cgit v1.2.3