/kernel/trunk/generic/include/sysinfo/sysinfo.h |
---|
51,3 → 51,7 |
sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root); |
__native sys_sysinfo_valid(__native ptr,__native len); |
__native sys_sysinfo_value(__native ptr,__native len); |
/kernel/trunk/generic/include/syscall/syscall.h |
---|
58,6 → 58,8 |
SYS_MAP_PHYSMEM, |
SYS_IOSPACE_ENABLE, |
SYS_PREEMPT_CONTROL, |
SYS_SYSINFO_VALID, |
SYS_SYSINFO_VALUE, |
SYSCALL_END |
} syscall_t; |
/kernel/trunk/generic/src/sysinfo/sysinfo.c |
---|
1,6 → 1,7 |
#include <sysinfo/sysinfo.h> |
#include <mm/slab.h> |
#include <print.h> |
#include <syscall/copy.h> |
sysinfo_item_t *_root=NULL; |
220,3 → 221,31 |
} |
return ret; |
} |
__native sys_sysinfo_valid(__native ptr,__native len) |
{ |
char *str; |
sysinfo_rettype_t ret; |
str=malloc(len+1,0); |
ASSERT(str); |
copy_from_uspace(str,(void *)ptr,len+1); |
if(str[len]) return 0; /*This is not len lenght C string*/ |
ret=sysinfo_get_val(str,NULL); |
free(str); |
return ret.valid; |
} |
__native sys_sysinfo_value(__native ptr,__native len) |
{ |
char *str; |
sysinfo_rettype_t ret; |
str=malloc(len+1,0); |
ASSERT(str); |
copy_from_uspace(str,(void *)ptr,len+1); |
if(str[len]) return 0; /*This is not len lenght C string*/ |
ret=sysinfo_get_val(str,NULL); |
free(str); |
return ret.val; |
} |
/kernel/trunk/generic/src/syscall/syscall.c |
---|
45,6 → 45,7 |
#include <ddi/ddi.h> |
#include <security/cap.h> |
#include <syscall/copy.h> |
#include <sysinfo/sysinfo.h> |
static __native sys_io(int fd, const void * buf, size_t count) { |
108,5 → 109,9 |
/* DDI related syscalls. */ |
sys_physmem_map, |
sys_iospace_enable, |
sys_preempt_control |
sys_preempt_control, |
/* Sysinfo syscalls */ |
sys_sysinfo_valid, |
sys_sysinfo_value |
}; |