sys_getcpuinfo()

This commit is contained in:
Tomas Hruby 2010-10-26 21:07:50 +00:00
parent c9bfb13cdb
commit ac780f36a0
3 changed files with 7 additions and 0 deletions

View file

@ -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 */

View file

@ -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)

View file

@ -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;