NeKernel dev
Loading...
Searching...
No Matches
ddk.h File Reference
#include <DriverKit/macros.h>

Go to the source code of this file.

Classes

struct  DDK_FINAL
 Object handle manifest. More...

Typedefs

typedef void * ptr_t

Functions

DDK_EXTERN void * ke_call_dispatch (const char *name, int32_t cnt, void *dat, size_t sz)
 Call Kernel procedure.
DDK_EXTERN void ke_set_syscall (const int32_t slot, void(*slotFn)(void *a0))
 add a system call.
DDK_EXTERN void * kalloc (size_t sz)
 Allocates an heap ptr.
DDK_EXTERN void kfree (void *the_ptr)
 Frees an heap ptr.
DDK_EXTERN struct DDK_OBJECT_MANIFEST * ke_get_obj (const int slot, const char *name)
 Gets a Kernel object.
DDK_EXTERN void * ke_set_obj (const int32_t slot, const struct DDK_OBJECT_MANIFEST *ddk_pr)
 Set a Kernel object.

Variables

DDK_EXTERN uint32_t kApiVersionHighest
 The highest API version of the DDK.
DDK_EXTERN uint32_t kApiVersionLowest
 The lowest API version of the DDK.
DDK_EXTERN uint32_t kApiVersion
 API version in BCD.

Typedef Documentation

◆ ptr_t

typedef void* ptr_t

Function Documentation

◆ kalloc()

DDK_EXTERN void * kalloc ( size_t sz)

Allocates an heap ptr.

Parameters
szsize of the allocated struct/type.
Returns
the pointer allocated or nil.

Allocates an heap ptr.

Parameters
szthe size of the heap block.
Returns
the newly allocated pointer.

◆ ke_call_dispatch()

DDK_EXTERN void * ke_call_dispatch ( const char * name,
int32_t cnt,
void * data,
size_t sz )

Call Kernel procedure.

Parameters
namethe procedure name.
cntnumber of elements in dat
datdata argument pointer.
szsz of whole data argument pointer.
Returns
result of call

Call Kernel procedure.

Parameters
nameRPC name
cntnumber of elements in data pointer.
datadata pointer.
szThe size of the whole data pointer.
Return values
void*Kernel call was successful.
nilKernel call failed, call KernelLastError(void)

◆ ke_get_obj()

DDK_EXTERN struct DDK_OBJECT_MANIFEST * ke_get_obj ( const int slot,
const char * name )

Gets a Kernel object.

Parameters
slotobject id (can be 0)
namethe property's name.
Returns
DDK_OBJECT_MANIFEST.

Gets a Kernel object.

Parameters
slotproperty id (always 0)
namethe object's name.
Returns
Object manifest.

◆ ke_set_obj()

DDK_EXTERN void * ke_set_obj ( const int32_t slot,
const struct DDK_OBJECT_MANIFEST * ddk_pr )

Set a Kernel object.

Parameters
slotobject id (can be 0)
namethe property's name.
ddk_prpointer to a object's DDK_OBJECT_MANIFEST.
Returns
returned object.

◆ ke_set_syscall()

DDK_EXTERN void ke_set_syscall ( const int32_t slot,
void(* slotFn )(void *a0) )

add a system call.

Parameters
slotsystem call slot id.
slotFn,syscallslot.

◆ kfree()

DDK_EXTERN void kfree ( void * ptr)

Frees an heap ptr.

Parameters
pointerkernel pointer to free.

Frees an heap ptr.

Parameters
ptrthe pointer to free.

Variable Documentation

◆ kApiVersion

DDK_EXTERN uint32_t kApiVersion

API version in BCD.

◆ kApiVersionHighest

DDK_EXTERN uint32_t kApiVersionHighest

The highest API version of the DDK.

◆ kApiVersionLowest

DDK_EXTERN uint32_t kApiVersionLowest

The lowest API version of the DDK.