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

Go to the source code of this file.

Classes

struct  DDK_FINAL
 Object handle manifest. More...

Functions

DDK_EXTERN void * ke_call (const char *name, int32_t cnt, void *dat, size_t sz)
 Call Kernel procedure.
DDK_EXTERN void ke_add_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 int32_t kApiVersionHighest
 The highest API version of the DDK.
DDK_EXTERN int32_t kApiVersionLowest
 The lowest API version of the DDK.
DDK_EXTERN int32_t kApiVersion
 API version in BCD.

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_add_syscall()

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

add a system call.

Parameters
slotsystem call slot id.
slotFn,syscallslot.

◆ ke_call()

DDK_EXTERN void * ke_call ( const char * name,
int32_t cnt,
void * dat,
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

◆ 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.

◆ 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 int32_t kApiVersion

API version in BCD.

◆ kApiVersionHighest

DDK_EXTERN int32_t kApiVersionHighest

The highest API version of the DDK.

◆ kApiVersionLowest

DDK_EXTERN int32_t kApiVersionLowest

The lowest API version of the DDK.