Introduce generic memory access functions

This is version # 2 of introducing generic memory access functions via an extendable structure, access_context_t. Currently LibVMI supports read/write accesses via 3 distinct mechanism: physical addresses, virtual addresses via PID and kernel virtual addresses via symbols. As there is need of adding a new set of functions where the DTB can be directly supplied for virtual address translation, this PR consolidates the code-base to support this feature with the minimal amount of code-duplication.
Yea, making comments about the fall-throughs being intentional makes sense,
added them.


On Tue, Jul 1, 2014 at 8:28 PM, Steve Maresca <notifications@github.com>
wrote:

> In libvmi/read.c:
>
> > +vmi_read_addr(
> > +    vmi_instance_t vmi,
> > +    access_context_t *ctx,
> > +    addr_t *value)
> > +{
> > +    status_t ret = VMI_FAILURE;
> > +
> > +    switch (vmi->page_mode) {
> > +        case VMI_PM_IA32E:
> > +            ret = vmi_read_X(vmi, ctx, value, 8);
> > +        case VMI_PM_LEGACY:
> > +        case VMI_PM_PAE: {
> > +            uint32_t tmp = 0;
> > +            ret = vmi_read_X(vmi, ctx, &tmp, 4);
> > +            *value = (uint64_t) tmp;
> > +        }
>
> Re: forgotten break statements - - recommend use of -Wimplicit-fallthrough
> with clang, which will be noisy about it. Certainly we have intentional
> fall-through on occasion -- we should probably stick a comment in each case
> to reassure future versions of ourselves.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/bdpayne/libvmi/pull/168/files#r14420994>.
>