X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Facess.h;h=394f9f1ed7c423e4e79c7eaa80153d37cdb4a70b;hb=fed0a8f469f7b187d26c0c8cb109bfd6930efaee;hp=7afdb5e1adb0782ee726a0ac2ed339342e5f9216;hpb=049de1f2533477716a12a708c097b199eaa8fb6c;p=tpg%2Facess2.git diff --git a/Kernel/include/acess.h b/Kernel/include/acess.h index 7afdb5e1..394f9f1e 100644 --- a/Kernel/include/acess.h +++ b/Kernel/include/acess.h @@ -8,7 +8,7 @@ #define NULL ((void*)0) #define PACKED __attribute__ ((packed)) -#include +//#include #include #include #include "errno.h" @@ -95,9 +95,6 @@ typedef struct sKernelSymbol { */ // === FUNCTIONS === -// --- Core --- -extern void System_Init(char *ArgString); - // --- IRQs --- extern int IRQ_AddHandler(int Num, void (*Callback)(int)); @@ -115,11 +112,12 @@ extern void Log_Debug(char *Ident, char *Message, ...); * \name Debugging and Errors * \{ */ -extern void Panic(char *Msg, ...); -extern void Warning(char *Msg, ...); -extern void Log(char *Fmt, ...); -extern void LogV(char *Fmt, va_list Args); -extern void LogF(char *Fmt, ...); +extern void Debug_KernelPanic(); //!< Initiate a kernel panic +extern void Panic(char *Msg, ...); //!< Print a panic message (initiates a kernel panic) +extern void Warning(char *Msg, ...); //!< Print a warning message +extern void LogF(char *Fmt, ...); //!< Print a log message without a trailing newline +extern void Log(char *Fmt, ...); //!< Print a log message +extern void LogV(char *Fmt, va_list Args); //!< va_list Log message extern void Debug_Enter(char *FuncName, char *ArgTypes, ...); extern void Debug_Log(char *FuncName, char *Fmt, ...); extern void Debug_Leave(char *FuncName, char RetType, ...); @@ -194,12 +192,6 @@ extern int MM_Map(tVAddr VAddr, tPAddr PAddr); * \return Physical page mapped at \a Addr */ extern tPAddr MM_GetPhysAddr(tVAddr Addr); -/** - * \brief Checks is a memory range is user accessable - * \param VAddr Base address to check - * \return 1 if the memory is all user-accessable, 0 otherwise - */ -extern int MM_IsUser(tVAddr VAddr); /** * \brief Set the access flags on a page * \param VAddr Virtual address of the page @@ -207,6 +199,18 @@ extern int MM_IsUser(tVAddr VAddr); * \param Mask Flags to set */ extern void MM_SetFlags(tVAddr VAddr, Uint Flags, Uint Mask); +/** + * \brief Get the flags on a flag + * \param VAddr Virtual address of page + * \return Flags value of the page + */ +extern Uint MM_GetFlags(tVAddr VAddr); +/** + * \brief Checks is a memory range is user accessable + * \param VAddr Base address to check + * \return 1 if the memory is all user-accessable, 0 otherwise + */ +#define MM_IsUser(VAddr) (!(MM_GetFlags((VAddr))&MM_PFLAG_KERNEL)) /** * \brief Temporarily map a page into the address space * \param PAddr Physical addres to map @@ -314,6 +318,7 @@ extern int strcmp(const char *__str1, const char *__str2); extern int strncmp(const char *Str1, const char *Str2, size_t num); extern int strucmp(const char *Str1, const char *Str2); extern char *strdup(const char *Str); +extern char **str_split(const char *__str, char __ch); extern int strpos(const char *Str, char Ch); extern int strpos8(const char *str, Uint32 search); extern void itoa(char *buf, Uint num, int base, int minLength, char pad); @@ -328,6 +333,7 @@ extern Uint8 ByteSum(void *Ptr, int Size); */ extern Uint rand(); +extern int CallWithArgArray(void *Function, int NArgs, Uint *Args); // --- Heap --- /** @@ -398,5 +404,6 @@ extern int DivUp(int num, int dem); #include #include +#include #endif