summaryrefslogtreecommitdiff
path: root/kernel/syscalls.c
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-22 16:35:12 +0200
committerMiguel <m.i@gmx.at>2018-08-22 16:35:12 +0200
commit98bf7b67543b36b6fe49f2b68c115ebeaf630603 (patch)
treeaad818381dfc42c4158b923d588bbe8d34f51e51 /kernel/syscalls.c
parent323fb9d3e09903d6fa43ef7e1f0cc8934414c8d4 (diff)
cleanup logging
Diffstat (limited to 'kernel/syscalls.c')
-rw-r--r--kernel/syscalls.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/kernel/syscalls.c b/kernel/syscalls.c
index 25e41e6..9f8d136 100644
--- a/kernel/syscalls.c
+++ b/kernel/syscalls.c
@@ -31,7 +31,7 @@ int syscall_unhandled(int nr)
{
char msg[256];
tfp_sprintf(msg, "unhandled syscall : %d",nr);
- panic(FOOLOS_MODULE_NAME,msg);
+ kpanic(msg);
}
int syscall_gettimeofday(struct timeval *tv, struct timezone *tz)
@@ -55,10 +55,10 @@ int syscall_gettimeofday(struct timeval *tv, struct timezone *tz)
int syscall_lseek(int file,int ptr,int dir)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"lseek (file=%d, ptr=%d, dir=%d)", file,ptr,dir);
+ klog("lseek (file=%d, ptr=%d, dir=%d)", file,ptr,dir);
#endif
- panic(FOOLOS_MODULE_NAME,"unhandled syscall: lseek");
+ kpanic("unhandled syscall: lseek");
return 0;
}
@@ -67,7 +67,7 @@ int syscall_lseek(int file,int ptr,int dir)
int syscall_write(int file, char *buf, int len)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"[%d] write(file=%d, buf=0x%08X, len=%d)", task_get_current_pid(),file,buf,len);
+ klog("[%d] write(file=%d, buf=0x%08X, len=%d)", task_get_current_pid(),file,buf,len);
#endif
for(int i=0;i<len;i++)
@@ -81,7 +81,7 @@ int syscall_write(int file, char *buf, int len)
int syscall_read(int file, char *buf, int len)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"read(file=%d, buf=0x%08X, len=%d)", file,buf,len);
+ klog("read(file=%d, buf=0x%08X, len=%d)", file,buf,len);
#endif
//file 0 = stdin , file 1 = stdout , file 2 = stderr
@@ -106,7 +106,7 @@ int syscall_read(int file, char *buf, int len)
int syscall_readdir(const char *name,fs_dirent *dirs,int max)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"readdir(name=0x%08X, dirs=0x%08X, %d)", name,dirs,max);
+ klog("readdir(name=0x%08X, dirs=0x%08X, %d)", name,dirs,max);
#endif
return fs_readdir(name,dirs,max);
@@ -117,7 +117,7 @@ int syscall_poll(int file)
{
file=2; //workaround
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"has data waiting?");
+ klog("has data waiting?");
#endif
return fd_has(&fds[file]);
@@ -127,7 +127,7 @@ int syscall_poll(int file)
int syscall_tune(int v1,int v2, int v3)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"tuning request");
+ klog("tuning request");
#endif
// osbolete
@@ -149,15 +149,15 @@ int syscall_tune(int v1,int v2, int v3)
int copy_args(char **in, char **out)
{
- //log(FOOLOS_MODULE_NAME,5,"copy_args(0x%08x, 0x%08X)",in,out);
+ //klog("copy_args(0x%08x, 0x%08X)",in,out);
int count=0;
while(in[count]!=NULL)
{
-// log(FOOLOS_MODULE_NAME,5,"args(0x%08x: %s)",in[count],out);
+// klog("args(0x%08x: %s)",in[count],out);
count++;
};
- // log(FOOLOS_MODULE_NAME,5,"copy_args : count: %d",count);
+ // klog("copy_args : count: %d",count);
char **pos=out;
pos+=sizeof(char **)*(count+1);
@@ -179,7 +179,7 @@ int copy_args(char **in, char **out)
int syscall_execve(char *name, char **argv, char **env)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"execve (name=0x%08X(%s), argvs=0x%08X, env=0x%08X)", name,name,argv,env);
+ klog("execve (name=0x%08X(%s), argvs=0x%08X, env=0x%08X)", name,name,argv,env);
#endif
int arg_count=0;
@@ -211,14 +211,14 @@ int syscall_execve(char *name, char **argv, char **env)
if(!entry_global)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"execve: bailing out!");
+ klog("execve: bailing out!");
#endif
return -1; // errror loading
}
/* try to move this to asm */
// asm volatile("jmp ."); // loop forever
- //log(FOOLOS_MODULE_NAME,5,"returning to jump addy (0x%08X)", entry_global);
+ //klog("returning to jump addy (0x%08X)", entry_global);
asm volatile("mov $0x8fff000,%esp"); // set stack at high end of process image
@@ -247,10 +247,10 @@ int get_max_fd()
int syscall_open(char *name, int flags, int mode)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"open (name=0x%08X(\"%s\"), flags=%d, mode=%d)",name, name,flags,mode);
+ klog("open (name=0x%08X(\"%s\"), flags=%d, mode=%d)",name, name,flags,mode);
#endif
- if( next_fifo>=MAX_FIFOS || next_fd>=MAX_FD)panic(FOOLOS_MODULE_NAME,"we ran out of fd's or fifo's");
+ if( next_fifo>=MAX_FIFOS || next_fd>=MAX_FD)kpanic("we ran out of fd's or fifo's");
if(0!=strcmp(name,"term"))
{
@@ -286,11 +286,11 @@ int syscall_open(char *name, int flags, int mode)
int syscall_close(int file,int none1,int none2)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"close (file=%d)", file);
+ klog("close (file=%d)", file);
#endif
//if(file!=0&&file!=1&&file!=2)
- // panic(FOOLOS_MODULE_NAME,"unhandled syscall: close");
+ // kpanic("unhandled syscall: close");
return -1;
}
@@ -299,7 +299,7 @@ int syscall_close(int file,int none1,int none2)
int syscall_isatty(int file,int none1,int none2)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"isatty (file=%d)", file);
+ klog("isatty (file=%d)", file);
#endif
return 1;
@@ -317,7 +317,7 @@ uint32_t syscall_sbrk(int incr, int none1, int none2)
task_set_brk(alloc);
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"sbrk (incr=%d) = 0x%08X", incr,oldalloc);
+ klog("sbrk (incr=%d) = 0x%08X", incr,oldalloc);
#endif
return oldalloc;
@@ -327,7 +327,7 @@ uint32_t syscall_sbrk(int incr, int none1, int none2)
int syscall_stat(const char *path, struct stat *st,int none)
{
#ifdef LOG_SYSCALLS
- log(FOOLOS_MODULE_NAME,5,"stat (path=0x%08X,stat=0x%08X)", path,st);
+ klog("stat (path=0x%08X,stat=0x%08X)", path,st);
#endif
st->st_mode = S_IFCHR;