devmap_dup - device mapping duplication entry point
#include <sys/ddi.h> #include <sys/sunddi.h int prefixdevmap_dup(devmap_cookie_t dhp, void *pvtp, devmap_cookie_t new_dhp, void **new_pvtp);
Solaris DDI specific (Solaris DDI).
dhp
pvtp
new_dhp
new_pvtp
The system calls devmap_dup() when a device mapping is duplicated, such as during the execution of the fork(2) system call. The system expects devmap_dup() to generate new driver private data for the new mapping, and to set new_pvtp to point to it. new_dhp is the handle of the new mapped object.
A non-zero return value from devmap_dup() will cause a corresponding operation such as fork() to fail.
devmap_dup() returns the following values:
0
Non-zero
static int xxdevmap_dup(devmap_cookie_t dhp, void *pvtp, \ devmap_cookie_t new_dhp, void **new_pvtp) { struct xxpvtdata *prvtdata; struct xxpvtdata *p = (struct xxpvtdata *)pvtp; struct xx_softc *softc = p->softc; mutex_enter(&softc->mutex); /* Allocate a new private data structure */ prvtdata = kmem_alloc(sizeof (struct xxpvtdata), KM_SLEEP); /* Return the new data */ prvtdata->off = p->off; prvtdata->len = p->len; prvtdata->ctx = p->ctx; prvtdata->dhp = new_dhp; prvtdata->softc = p->softc; *new_pvtp = prvtdata; mutex_exit(&softc->mutex); return (0); }
fork(2), devmap_callback_ctl(9S)
Writing Device Drivers
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |