* Acess2 IDE Harddisk Driver
* drv/ide.c
*/
+#define DEBUG 0
#include <common.h>
#include <modules.h>
#include <vfs.h>
extern void Debug_Log(char *FuncName, char *Fmt, ...);
extern void Debug_Leave(char *FuncName, char RetType, ...);
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)
+#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)
+#else
+# define ENTER(...)
+# define LOG(...)
+# define LEAVE(...)
+#endif
// --- IO ---
extern void outb(Uint16 Port, Uint8 Data);
extern void outw(Uint16 Port, Uint16 Data);
return 0;
}
- LOG("info = %p\n", info);
- Debug_HexDump("info", info, 6*4);
-
// Check magic number
if(info->Magic != MODULE_MAGIC)
{
/*
+ * Acess2 VFS
+ * - Directory Management Functions
*/
-#include "vfs.h"
-#include "vfs_int.h"
+#define DEBUG 0
+#include <common.h>
+#include <vfs.h>
+#include <vfs_int.h>
// === IMPORTS ===
extern tVFS_Mount *gRootMount;
tVFS_Node *parent;
int ret;
- Debug_Enter("VFS_MkNod", "sPath xFlags", Path, Flags);
+ ENTER("sPath xFlags", Path, Flags);
absPath = VFS_GetAbsPath(Path);
if( !VFS_CheckACL(parent, VFS_PERM_EXECUTE|VFS_PERM_WRITE) ) {
if(parent->Close) parent->Close( parent );
free(absPath);
- Debug_Leave("VFS_MkNod", 'i', -1);
+ LEAVE('i', -1);
return -1;
}
- Debug_Log("VFS_MkNod", "parent = %p\n", parent);
+ LOG("parent = %p\n", parent);
if(parent->MkNod == NULL) {
Warning("VFS_MkNod - Directory has no MkNod method");
- Debug_Leave("VFS_MkNod", 'i', -1);
+ LEAVE('i', -1);
return -1;
}
if(parent->Close) parent->Close( parent );
// Error Check
- if(ret == 0) return -1;
+ if(ret == 0) {
+ LEAVE('i', -1);
+ return -1;
+ }
- Debug_Leave("VFS_MkNod", 'i', 0);
+ LEAVE('i', 0);
return 0;
}
int fp;
tVFS_Node *destNode;
- //LogF("vfs_symlink: (name='%s', link='%s')\n", name, link);
+ //ENTER("sName sLink", Name, Link);
// Get absolue path name
Link = VFS_GetAbsPath( Link );
tRamFS_File *child = parent->Data.FirstChild;
tRamFS_File *prev = (tRamFS_File *) &parent->Data.FirstChild;
- Log("Root_MkNod: (Node=%p, Name='%s', Flags=0x%x)", Node, Name, Flags);
+ ENTER("pNode sName xFlags", Node, Name, Flags);
// Find last child, while we're at it, check for duplication
for( ; child; prev = child, child = child->Next )
{
- if(strcmp(child->Name, Name) == 0) return 0;
+ if(strcmp(child->Name, Name) == 0) {
+ LEAVE('i', 0);
+ return 0;
+ }
}
child = Root_int_AllocFile();
parent->Node.Size ++;
+ LEAVE('i', 1);
return 1;
}
{
void *tmp = realloc( file->Data.Bytes, Offset + Length );
if(tmp == NULL) {
- Warning("Root_Write - Increasing buffer size failed\n");
+ Warning("Root_Write - Increasing buffer size failed");
return -1;
}
file->Data.Bytes = tmp;
Node->Size = Offset + Length;
- Log(" Root_Write: Expanded buffer to %i bytes\n", Node->Size);
+ //LOG("Expanded buffer to %i bytes", Node->Size);
}
memcpy(file->Data.Bytes+Offset, Buffer, Length);