#include "drmP.h"
-#ifndef DRIVER_ALTERNATE_CONTEXT
/******************************************************************/
/** \name Context bitmap support */
/*@{*/
return 0;
}
-#endif
-
-extern drm_ioctl_desc_t DRM(ioctls)[];
-void DRM(context_add_ioctls)(void)
-{
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)].func = DRM(setsareactx);
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)].auth_needed = 1;
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)].root_only = 1;
-
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)].func = DRM(getsareactx);
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)].auth_needed = 1;
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)].root_only = 0;
-}
/*@}*/
[DRM_IOCTL_NR(DRM_IOCTL_BLOCK)] = { DRM(noop), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)] = { DRM(noop), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = { DRM(authmagic), 1, 1 },
-
+
[DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { DRM(addmap), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_RM_MAP)] = { DRM(rmmap), 1, 0 },
+ [DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)] = { DRM(setsareactx), 1, 1 },
+ [DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)] = { DRM(getsareactx), 1, 0 },
+
[DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = { DRM(addctx), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = { DRM(rmctx), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] = { DRM(modctx), 1, 1 },
DRM(driver_register_fns)(dev);
- /* if we have CTX_BITMAP add the ioctls */
- DRM(context_add_ioctls)();
-
if (dev->fn_tbl.preinit)
if ((retcode = dev->fn_tbl.preinit(dev, ent->driver_data)))
goto error_out_unreg;
#include "drmP.h"
-#ifndef DRIVER_ALTERNATE_CONTEXT
/******************************************************************/
/** \name Context bitmap support */
/*@{*/
return 0;
}
-#endif
-
-extern drm_ioctl_desc_t DRM(ioctls)[];
-void DRM(context_add_ioctls)(void)
-{
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)].func = DRM(setsareactx);
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)].auth_needed = 1;
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)].root_only = 1;
-
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)].func = DRM(getsareactx);
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)].auth_needed = 1;
- DRM(ioctls)[DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)].root_only = 0;
-}
/*@}*/
[DRM_IOCTL_NR(DRM_IOCTL_BLOCK)] = { DRM(noop), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)] = { DRM(noop), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = { DRM(authmagic), 1, 1 },
-
+
[DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { DRM(addmap), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_RM_MAP)] = { DRM(rmmap), 1, 0 },
+ [DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)] = { DRM(setsareactx), 1, 1 },
+ [DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)] = { DRM(getsareactx), 1, 0 },
+
[DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = { DRM(addctx), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = { DRM(rmctx), 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] = { DRM(modctx), 1, 1 },
DRM(driver_register_fns)(dev);
- /* if we have CTX_BITMAP add the ioctls */
- DRM(context_add_ioctls)();
-
if (dev->fn_tbl.preinit)
if ((retcode = dev->fn_tbl.preinit(dev, ent->driver_data)))
goto error_out_unreg;