X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Facess.h;h=24148e149d02ac6e3fbbb6df3f3307ea7267265e;hb=547e8535ec9bd84f3508182618319155e69572f8;hp=41854a961bd1fda74180913039c7b5548b54836a;hpb=d0b4559f2936f6d9f06be0f7c3c51527a480ec0d;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/acess.h b/KernelLand/Kernel/include/acess.h index 41854a96..24148e14 100644 --- a/KernelLand/Kernel/include/acess.h +++ b/KernelLand/Kernel/include/acess.h @@ -9,8 +9,9 @@ * \brief Acess2 Kernel API Core */ -//! NULL Pointer -#define NULL ((void*)0) +#include +#include + //! Pack a structure #define PACKED __attribute__((packed)) //! Mark a function as not returning @@ -21,8 +22,6 @@ #define DEPRECATED __attribute__((deprecated)) //! Mark a parameter as unused #define UNUSED(x) UNUSED_##x __attribute__((unused)) -//! Get the offset of a member in a structure -#define offsetof(st, m) ((Uint)((char *)&((st *)(0))->m - (char *)0 )) /** * \name Boolean constants @@ -34,7 +33,6 @@ * \} */ -#include #include #include "errno.h" @@ -144,60 +142,7 @@ extern void IRQ_RemHandler(int Handle); * \} */ -// --- Logging --- -/** - * \name Logging to kernel ring buffer - * \{ - */ -extern void Log_KernelPanic(const char *Ident, const char *Message, ...); -extern void Log_Panic(const char *Ident, const char *Message, ...); -extern void Log_Error(const char *Ident, const char *Message, ...); -extern void Log_Warning(const char *Ident, const char *Message, ...); -extern void Log_Notice(const char *Ident, const char *Message, ...); -extern void Log_Log(const char *Ident, const char *Message, ...); -extern void Log_Debug(const char *Ident, const char *Message, ...); -/** - * \} - */ - -// --- Debug --- -/** - * \name Debugging and Errors - * \{ - */ -extern void Debug_KernelPanic(void); //!< Initiate a kernel panic -extern void Panic(const char *Msg, ...); //!< Print a panic message (initiates a kernel panic) -extern void Warning(const char *Msg, ...); //!< Print a warning message -extern void LogF(const char *Fmt, ...); //!< Print a log message without a trailing newline -extern void Log(const char *Fmt, ...); //!< Print a log message -extern void Debug(const char *Fmt, ...); //!< Print a debug message (doesn't go to KTerm) -extern void LogV(const char *Fmt, va_list Args); //!< va_list Log message -extern void Debug_Enter(const char *FuncName, const char *ArgTypes, ...); -extern void Debug_Log(const char *FuncName, const char *Fmt, ...); -extern void Debug_Leave(const char *FuncName, char RetType, ...); -extern void Debug_HexDump(const char *Header, const void *Data, Uint Length); -#define UNIMPLEMENTED() Warning("'%s' unimplemented", __func__) -#if DEBUG -# define ENTER(_types...) Debug_Enter((char*)__func__, _types) -# define LOG(_fmt...) Debug_Log((char*)__func__, _fmt) -# define LEAVE(_t...) Debug_Leave((char*)__func__, _t) -# define LEAVE_RET(_t,_v...) do{LEAVE(_t,_v);return _v;}while(0) -# define LEAVE_RET0() do{LEAVE('-');return;}while(0) -#else -# define ENTER(...) -# define LOG(...) -# define LEAVE(...) -# define LEAVE_RET(_t,_v...) return (_v) -# define LEAVE_RET0() return -#endif -#if SANITY -# define ASSERT(expr) do{if(!(expr))Panic("%s:%i - %s: Assertion '"#expr"' failed",__FILE__,__LINE__,(char*)__func__);}while(0) -#else -# define ASSERT(expr) -#endif -/** - * \} - */ +#include "logdebug.h" // --- IO --- #if NO_IO_BUS