tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: compat_netbsd32 swapctl



On Wed, Jan 29, 2014 at 11:54:29AM +0100, Martin Husemann wrote:
> You could define swapent32 with se_dev split into two 32bit halves and
> do full conversion back and forth, but better check what alignment
> mips and sparc would require here first.

I verified i386 uses 4 byte, sparc uses 8 byte.
I have no mips handy to test, anyone can run the attached program there?

Martin
#include <stdio.h>
#include <inttypes.h>

struct test {
        uint64_t val;
        int dummy;
        char tag;
};

struct container {
        char a;
        struct test t;
};

int main(int argc, char **argv)
{
        struct container c;

        printf("offset of struct test: %lx\n", (long)((char*)&c.t - (char*)&c));
        return 0;
}



Home | Main Index | Thread Index | Old Index