Added ProcDev/SysFS + Cleanup
[tpg/acess2.git] / Kernel / include / common.h
index 154ad0d..7888a7a 100644 (file)
@@ -36,6 +36,7 @@ enum eConfigTypes {
 enum eConfigs {
        CFG_VFS_CWD,
        CFG_VFS_MAXFILES,
+       CFG_VFS_CHROOT,
        NUM_CFG_ENTRIES
 };
 #define CFGINT(id)     (*Threads_GetCfgPtr(id))
@@ -101,10 +102,14 @@ extern void       Debug_HexDump(char *Header, void *Data, Uint Length);
 # 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
 /**
  * \}
@@ -160,10 +165,9 @@ extern tPAddr      MM_GetPhysAddr(tVAddr VAddr);
 /**
  * \brief Checks is a memory range is user accessable
  * \param VAddr        Base address to check
- * \param Length       Number of bytes to check
  * \return 1 if the memory is all user-accessable, 0 otherwise
  */
-extern int     MM_IsUser(tVAddr VAddr, int Length);
+extern int     MM_IsUser(tVAddr VAddr);
 /**
  * \brief Set the access flags on a page
  * \param VAddr        Virtual address of the page
@@ -238,6 +242,15 @@ extern void *memcpy(void *dest, const void *src, Uint count);
 extern void *memcpyd(void *dest, const void *src, Uint count);
 extern void *memset(void *dest, int val, Uint count);
 extern void *memsetd(void *dest, Uint val, Uint count);
+/**
+ * \}
+ */
+/**
+ * \name Memory Validation
+ * \{
+ */
+extern int     CheckString(char *String);
+extern int     CheckMem(void *Mem, int Num);
 /**
  * \}
  */
@@ -271,6 +284,7 @@ extern int  strpos8(const char *str, Uint32 search);
 extern void    itoa(char *buf, Uint num, int base, int minLength, char pad);
 extern int     ReadUTF8(Uint8 *str, Uint32 *Val);
 extern int     WriteUTF8(Uint8 *str, Uint32 Val);
+extern int     LookupString(char **Array, char *Needle);
 /**
  * \}
  */

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