Subversion Repositories HelenOS-historic

Rev

Rev 1317 | Rev 1321 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1317 Rev 1318
Line 1... Line 1...
1
#include <sysinfo/sysinfo.h>
1
#include <sysinfo/sysinfo.h>
2
#include <mm/slab.h>
2
#include <mm/slab.h>
3
#include <print.h>
3
#include <print.h>
-
 
4
#include <syscall/copy.h>
4
 
5
 
5
sysinfo_item_t *_root=NULL;
6
sysinfo_item_t *_root=NULL;
6
 
7
 
7
 
8
 
8
static sysinfo_item_t* sysinfo_find_item(const char *name,sysinfo_item_t *subtree)
9
static sysinfo_item_t* sysinfo_find_item(const char *name,sysinfo_item_t *subtree)
Line 218... Line 219...
218
            ret.val=item -> val.val;
219
            ret.val=item -> val.val;
219
        else ret.val=((sysinfo_val_fn_t)(item->val.fn))(item);
220
        else ret.val=((sysinfo_val_fn_t)(item->val.fn))(item);
220
    }
221
    }
221
    return ret;
222
    return ret;
222
}
223
}
-
 
224
 
-
 
225
__native sys_sysinfo_valid(__native ptr,__native len)
-
 
226
{
-
 
227
    char *str;
-
 
228
    sysinfo_rettype_t ret;
-
 
229
    str=malloc(len+1,0);
-
 
230
    ASSERT(str);
-
 
231
    copy_from_uspace(str,(void *)ptr,len+1);
-
 
232
    if(str[len]) return 0;          /*This is not len lenght C string*/
-
 
233
    ret=sysinfo_get_val(str,NULL);
-
 
234
    free(str);
-
 
235
    return ret.valid;
-
 
236
}
-
 
237
 
-
 
238
__native sys_sysinfo_value(__native ptr,__native len)
-
 
239
{
-
 
240
    char *str;
-
 
241
    sysinfo_rettype_t ret;
-
 
242
    str=malloc(len+1,0);
-
 
243
    ASSERT(str);
-
 
244
    copy_from_uspace(str,(void *)ptr,len+1);
-
 
245
    if(str[len]) return 0;          /*This is not len lenght C string*/
-
 
246
    ret=sysinfo_get_val(str,NULL);
-
 
247
    free(str);
-
 
248
    return ret.val;
-
 
249
}
-
 
250
 
-
 
251