More work on x86_64 build, error handling and IDT
[tpg/acess2.git] / Kernel / include / acess.h
index db2dd96..394f9f1 100644 (file)
@@ -8,7 +8,7 @@
 #define NULL   ((void*)0)
 #define PACKED __attribute__ ((packed))
 
-#include <stdint.h>
+//#include <stdint.h>
 #include <arch.h>
 #include <stdarg.h>
 #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);

UCC git Repository :: git.ucc.asn.au