darling-newlkm/darling/syscall_args.h
Ariel Abreu 93c52c0986
It links! (with Clang); definitely check the description...
Major changes:
  * We now use BSD `proc` and `uthread` structures
  * We now use XNU's own pthread interface
    * This is done to increase compatibility with XNU code and make it easier to include XNU code that depends on it
    * This is pretty easy due to Apple having modularized the pthread implementation into a kext: all we have to do is pretend to be that kext
  * We compile the Blocks runtime (libclosure)
    * GCC doesn't support blocks, so the LKM only compiles with Clang at the moment
    * Unfortunately, Apple has decided to use them in the Mach code of XNU now.
      I didn't look into just how much they use them and how easy/difficult it would be to remove them,
      but that's the current situation.
  * We compile and use(?) IPC importance code

Other than that, there were many more small changes that needed to be made (which was to be expected; we jumped from XNU-3000-ish to XNU-6153).

This code has *not* been tested to run yet, and probably won't run successfully without further modifications.
2020-09-16 16:46:27 -04:00

70 lines
1.2 KiB
C

#ifndef _DARLING_LKM_SYSCALL_ARGS_H_
#define _DARLING_LKM_SYSCALL_ARGS_H_
#include <darling/api.h> // for most of the arg structures...
// ...and now let's define the rest (the ones that the outside world doesn't need to use)
struct bsdthread_register_args {
uint64_t threadstart;
uint64_t wqthread;
uint32_t flags;
uint64_t stack_addr_hint;
uint64_t targetconc_ptr;
uint32_t dispatchqueue_offset;
uint32_t tsd_offset;
};
struct bsdthread_create_args {
uint64_t func;
uint64_t func_arg;
uint64_t stack;
uint64_t pthread;
uint32_t flags;
};
struct psynch_rw_longrdlock_args {
uint64_t rwlock;
uint32_t lgenval;
uint32_t ugenval;
uint32_t rw_wc;
int flags;
};
struct psynch_rw_unlock2_args {
uint64_t rwlock;
uint32_t lgenval;
uint32_t ugenval;
uint32_t rw_wc;
int flags;
};
struct psynch_rw_yieldwrlock_args {
uint64_t rwlock;
uint32_t lgenval;
uint32_t ugenval;
uint32_t rw_wc;
int flags;
};
struct psynch_rw_upgrade_args {
uint64_t rwlock;
uint32_t lgenval;
uint32_t ugenval;
uint32_t rw_wc;
int flags;
};
struct psynch_rw_downgrade_args {
uint64_t rwlock;
uint32_t lgenval;
uint32_t ugenval;
uint32_t rw_wc;
int flags;
};
// void?
struct thread_selfid_args;
#endif // _DARLING_LKM_SYSCALL_ARGS_H_