OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [kernel/] [info.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1634 jcastillo
/*
2
 * linux/kernel/info.c
3
 *
4
 * Copyright (C) 1992 Darren Senn
5
 */
6
 
7
/* This implements the sysinfo() system call */
8
 
9
#include <asm/segment.h>
10
 
11
#include <linux/sched.h>
12
#include <linux/string.h>
13
#include <linux/unistd.h>
14
#include <linux/types.h>
15
#include <linux/mm.h>
16
#include <linux/swap.h>
17
 
18
asmlinkage int sys_sysinfo(struct sysinfo *info)
19
{
20
        int error;
21
        struct sysinfo val;
22
 
23
        error = verify_area(VERIFY_WRITE, info, sizeof(struct sysinfo));
24
        if (error)
25
                return error;
26
        memset((char *)&val, 0, sizeof(struct sysinfo));
27
 
28
        val.uptime = jiffies / HZ;
29
 
30
        val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT);
31
        val.loads[1] = avenrun[1] << (SI_LOAD_SHIFT - FSHIFT);
32
        val.loads[2] = avenrun[2] << (SI_LOAD_SHIFT - FSHIFT);
33
 
34
        val.procs = nr_tasks-1;
35
 
36
        si_meminfo(&val);
37
        si_swapinfo(&val);
38
 
39
        memcpy_tofs(info, &val, sizeof(struct sysinfo));
40
        return 0;
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.