From: Tomas Hruby Date: Tue, 26 Oct 2010 21:07:50 +0000 (+0000) Subject: sys_getcpuinfo() X-Git-Tag: v3.2.0~763 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doxygen.png?a=commitdiff_plain;h=ac780f36a03b7e1c5329fd5902fc3addb84dab95;p=minix.git sys_getcpuinfo() --- diff --git a/include/minix/com.h b/include/minix/com.h index b452f136c..dc3d48a00 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -491,6 +491,7 @@ # define GET_RANDOMNESS_BIN 20 /* get one randomness bin */ # define GET_IDLETSC 21 /* get cumulative idle time stamp counter */ # define GET_AOUTHEADER 22 /* get a.out headers from the boot image */ +# define GET_CPUINFO 23 /* get information about cpus */ #define I_ENDPT m7_i4 /* calling process (may only be SELF) */ #define I_VAL_PTR m7_p1 /* virtual address at caller */ #define I_VAL_LEN m7_i1 /* max length of value */ diff --git a/include/minix/syslib.h b/include/minix/syslib.h index 12850f4c7..f47d82b7e 100644 --- a/include/minix/syslib.h +++ b/include/minix/syslib.h @@ -183,6 +183,7 @@ _PROTOTYPE(int sys_segctl, (int *index, u16_t *seg, vir_bytes *off, #define sys_getkinfo(dst) sys_getinfo(GET_KINFO, dst, 0,0,0) #define sys_getloadinfo(dst) sys_getinfo(GET_LOADINFO, dst, 0,0,0) #define sys_getmachine(dst) sys_getinfo(GET_MACHINE, dst, 0,0,0) +#define sys_getcpuinfo(dst) sys_getinfo(GET_CPUINFO, dst, 0,0,0) #define sys_getproctab(dst) sys_getinfo(GET_PROCTAB, dst, 0,0,0) #define sys_getprivtab(dst) sys_getinfo(GET_PRIVTAB, dst, 0,0,0) #define sys_getproc(dst,nr) sys_getinfo(GET_PROC, dst, 0,0, nr) diff --git a/kernel/system/do_getinfo.c b/kernel/system/do_getinfo.c index e640a8bcb..c5e23b51a 100644 --- a/kernel/system/do_getinfo.c +++ b/kernel/system/do_getinfo.c @@ -63,6 +63,11 @@ PUBLIC int do_getinfo(struct proc * caller, message * m_ptr) src_vir = (vir_bytes) &kloadinfo; break; } + case GET_CPUINFO: { + length = sizeof(cpu_info); + src_vir = (vir_bytes) &cpu_info; + break; + } case GET_HZ: { length = sizeof(system_hz); src_vir = (vir_bytes) &system_hz;