\r
fileName = (char*)(tmpPath+dirLen);\r
// Read Directory Content\r
- while( (fp = readdir(dp, fileName)) )\r
+ while( (fp = SysReadDir(dp, fileName)) )\r
{\r
if(fp < 0)\r
{\r
fprintf(stderr, "Unable to open directory '%s'\n", Directory);
}
- while( readdir(dp, filename) )
+ while( SysReadDir(dp, filename) )
{
if( filename[0] == '.' ) continue ;
if( strcmp(filename, "lo") == 0 ) continue ;
dp = open(IPSTACK_ROOT, OPENFLAG_READ);
- while( readdir(dp, filename) )
+ while( SysReadDir(dp, filename) )
{
if(filename[0] == '.') continue;
DumpInterface(filename);
printf("Type\tNetwork \tGateway \tMetric\tIFace\n");
- while( readdir(dp, filename) )
+ while( SysReadDir(dp, filename) )
{
if(filename[0] == '.') continue;
DumpRoute(filename);
}
// Traverse Directory
- while( (tmp = readdir(fd, buf)) > 0 )
+ while( (tmp = SysReadDir(fd, buf)) > 0 )
{
// Error check
if(tmp < 0) {
$(_BIN): $(OBJ) $(_LIBS)
@mkdir -p $(dir $(_BIN))
@echo [LD] -o $(BIN) $(OBJ)
- $(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name)
+ @$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name)
@$(DISASM) -S $(_BIN) > $(_OBJPREFIX)$(BIN).dsm
$(_OBJPREFIX)%.o: %.c
SYSCALL4(seek, SYS_SEEK) // int, uint64_t, int
SYSCALL1(tell, SYS_TELL) // int
SYSCALL3(finfo, SYS_FINFO) // int, void*, int
-SYSCALL2(readdir, SYS_READDIR) // int, char*
+SYSCALL2(SysReadDir, SYS_READDIR) // int, char*
SYSCALL2(_SysGetACL,SYS_GETACL) // int, void*
SYSCALL1(chdir, SYS_CHDIR) // char*
SYSCALL3(ioctl, SYS_IOCTL) // int, int, void*
#define STR(x) _STR(x)
#define EXP(sym) {&sym, STR(sym)}
+#define SYSCALL0(name,num) EXP(name),
+#define SYSCALL1(name,num) EXP(name),
+#define SYSCALL2(name,num) EXP(name),
+#define SYSCALL3(name,num) EXP(name),
+#define SYSCALL4(name,num) EXP(name),
+#define SYSCALL5(name,num) EXP(name),
+#define SYSCALL6(name,num) EXP(name),
+
// === CONSTANTS ===
const struct {
void *Value;
char *Name;
} caLocalExports[] = {
EXP(gLoadedLibraries),
- EXP(_exit),
EXP(_errno),
- EXP(clone),
- EXP(kill),
- EXP(yield),
- EXP(sleep),
- EXP(_SysWaitEvent),
- EXP(waittid),
- EXP(gettid),
- EXP(getpid),
- EXP(getuid),
- EXP(getgid),
-
- EXP(setuid),
- EXP(setgid),
-
- EXP(SysSetName),
- //EXP(SysGetName),
-
- EXP(_SysTimestamp),
-
- //EXP(SysSetPri),
-
- EXP(SysSendMessage),
- EXP(SysGetMessage),
-
- EXP(_SysSpawn),
- EXP(execve),
- EXP(SysLoadBin),
- EXP(SysUnloadBin),
-
- EXP(_SysSetFaultHandler),
- EXP(open),
- EXP(reopen),
- EXP(close),
- EXP(read),
- EXP(write),
- EXP(seek),
- EXP(tell),
- EXP(finfo),
- EXP(readdir),
- EXP(_SysGetACL),
- EXP(chdir),
- EXP(ioctl),
- EXP(_SysMount),
- EXP(_SysSelect),
-
- EXP(_SysOpenChild),
-
- EXP(_SysGetPhys),
- EXP(_SysAllocate),
- EXP(_SysDebug),
-
+ #define __ASSEMBLER__
+ #include "arch/syscalls.s.h"
+ #undef __ASSEMBLER__
#if 0
EXP(__umoddi3),
EXP(__udivdi3),
extern int getpid(void);
extern int _SysSetFaultHandler(int (*Handler)(int));
extern void SysSetName(const char *Name);
-//extern int SysGetName(const char *Name);
+extern int SysGetName(char *NameDest);
+extern int SysSetPri(int Priority);
extern int64_t _SysTimestamp(void);
// --- Permissions ---
extern uint64_t tell(int fd);
extern int ioctl(int fd, int id, void *data);
extern int finfo(int fd, t_sysFInfo *info, int maxacls);
-extern int readdir(int fd, char *dest);
-extern int _SysOpenChild(int fd, char *name, int flags);
+extern int SysReadDir(int fd, char *dest);
+extern int _SysOpenChild(int fd, const char *name, int flags);
extern int _SysGetACL(int fd, t_sysACL *dest);
extern int _SysMount(const char *Device, const char *Directory, const char *Type, const char *Options);
extern int _SysSelect(int nfds, fd_set *read, fd_set *write, fd_set *err, int64_t *timeout, unsigned int extraevents);
void Heap_Dump(void)\r
{\r
heap_head *cur = _heap_start;\r
- while( cur < _heap_end )\r
+ while( cur < (heap_head*)_heap_end )\r
{\r
switch( cur->magic )\r
{\r