|
struct passargs32 {
int len;
caddr32_t addr;
};
struct passargs {
int len;
caddr_t addr;
};
xxioctl(dev_t dev, int cmd, intptr_t arg, int mode,
cred_t *credp, int *rvalp) {
struct passargs pa;
switch (ddi_model_convert_from(mode & FMODELS)) {
case DDI_MODEL_ILP32:
{
struct passargs32 pa32;
ddi_copyin(arg, &pa32, sizeof (struct passargs32), mode);
pa.len = pa32.len;
pa.address = pa32.address;
break;
}
case DDI_MODEL_NONE:
ddi_copyin(arg, &pa, sizeof (struct passargs), mode);
break;
}
do_ioctl(&pa);
....
}
|