[CRIU] [PATCH 02/13] cpu: Add code to fetch/test cpuinfo data
Cyrill Gorcunov
gorcunov at openvz.org
Fri Dec 14 09:19:24 EST 2012
This patch add ability to test /proc/cpuinfo data
we're interested in at the moment.
The code provides the following functionality
- cpu_init, to parse cpuinfo and check if the
host cpu we're running on is suitable enough
for FPU checkpoint/restore
- cpu_set_feature/cpu_has_feature helpers which
provides to test certain bits and set them where
needed (we need to set bits when parse cpuinfo)
Note, we reserve space for all cpuinfo bits known
by the kernel at moment, while use only three FPU
related bits for a while. This is done because we might
need to use or find out other features in future.
After all it's just 40 bytes of memory needed to keep
all possible bits.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
Makefile | 1 +
cpu.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++
include/cpu.h | 23 +++++++++++++++++
include/proc_parse.h | 1 +
proc_parse.c | 32 +++++++++++++++++++++++
5 files changed, 130 insertions(+)
create mode 100644 cpu.c
create mode 100644 include/cpu.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-cpu-Add-code-to-fetch-test-cpuinfo-data.patch
Type: text/x-patch
Size: 4184 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20121214/df8d6e09/attachment.bin>
More information about the CRIU
mailing list