bdpayne/libvmi — pull request #135 by tklengyel (2014-02-24 16:25:13+00:00)
Title: RFC: Introduce arch_interface to abstract interface specific functions away

This PR contains a variety of changes in preparation to support the ARM architecture in the future. Most importantly this PR introduces the arch_interface to abstract v2p and get_va_pages routines away from the rest of the library. The interface is setup similar to the os interface and the driver interface.

The functions from memory.c had been split into intel.c and amd64.c within the arch folder respective to which page mode they are involved in. A couple functions that were shared between x86 and x86_64 are converted into macros within arch/x86.h

Another set of functions from memory.c had been placed into accessors.c as that is a more logical place to keep them as they aren't architecture specific.

Furthermore, this PR also introduces libvmi_extra.h, which is targeted to be used in applications already linking with GLib, so that LibVMI may return GLib structures in functions exposed through that header (currently only vmi_get_va_pages is in there).

What has not been touched is stuff in SHM_SNAPSHOT, specifically in the KVM driver, where those functions are performing architecture specific address translations. I really do think SHM_SNAPSHOT needs a heavy cleanup, as the KVM driver doesn't look like the right place to keep those routines.

I tested the PR so far only with Win7 SP1 x64 on Xen, there may be dragons with file mode that I'm anticipating.

RFC