Add CPU feature detection (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 29 Feb 2016 20:45:13 +0000 (15:45 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 29 Feb 2016 21:56:00 +0000 (16:56 -0500)
commit5f18d6ac184f7f7d0edd53d67cfab75d7395b649
tree3466801f376e75c3c05600d0f5598a59a79933a9
parent96691769ab669002d9fb730002d91970e558693b
Add CPU feature detection (XCC)

Userspace, Glibc, and the kernel can now query whether the CPU has certain
features with

bool cpu_has_feat(int feature);

Some CPU features are architecture independent, such as the support for
virtual machines.  Most others will be architecture dependent.  I added a
few feature bits as an example, though they are not used yet.

To use within the kernel:

#include <cpu_feat.h>

To use within glibc:

#include <kernel-features.h>

To use in generic userspace (e.g. user/*, tests/*, etc):

#include <parlib/cpu_feat.h>

Reinstall your kernel headers to use the features.  Rebuild glibc to make
sure I didn't mess anything up.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/riscv/ros/cpu_feat.h [new file with mode: 0644]
kern/arch/x86/ros/cpu_feat.h [new file with mode: 0644]
kern/include/cpu_feat.h [new file with mode: 0644]
kern/include/ros/cpu_feat.h [new file with mode: 0644]
kern/include/ros/procinfo.h
tools/compilers/gcc-glibc/glibc-2.19-akaros/sysdeps/akaros/kernel-features.h
user/parlib/include/parlib/cpu_feat.h [new file with mode: 0644]