tech-kern archive

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

ioctl VNDIOCSET vs netbsd32



Hey folks,

I am trying to use vnconfig on an evbmip64-eb machine (ERLITE), with
a netbsd32 userland.

The ioctl conversion for VNDIOCSET fails, due to a size mismatch:

ioctl(0xc0284600 != c0244600 [VNDIOCSET32])

If I decode that correctly all is fine but the size of the argument structure,
which is 0x28 in userland and 0x24 in the kernel.

/*
 * The next two structures are marked "__packed" as they normally end up
 * being padded in 64-bit mode.
 */
struct netbsd32_vnd_ioctl {
        netbsd32_charp  vnd_file;       /* pathname of file to mount */  
        int             vnd_flags;      /* flags; see below */   
        struct vndgeom  vnd_geom;       /* geometry to emulate */
        unsigned int    vnd_osize;      /* (returned) size of disk */
        uint64_t        vnd_size;       /* (returned) size of disk */
} __packed;

where the __packed makes the bogus difference.

I don't understand the comment. Of course they end up being padded
(2 bytes after vnd_flags, 2 bytes after vnd_osize), but that applies to
both the 64bit and the 32bit ABI.

For which architectures is this __packed important? We need to somehow
conditionalize it. Or am I missing something?

Martin


Home | Main Index | Thread Index | Old Index