/** Revoke capabilities from a task (32 bits) * * The calling task must have the CAP_CAP capability or the caller must * attempt to revoke capabilities from itself. * * @param uspace_taskid User-space pointer to destination task ID. * @param caps Capabilities to revoke. * * @return Zero on success or an error code from @ref errno.h. * */ sysarg_t sys_cap_revoke(sysarg64_t *uspace_taskid, cap_t caps) { sysarg64_t taskid; int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(sysarg64_t)); if (rc != 0) return (sysarg_t) rc; return cap_revoke((task_id_t) taskid, caps); }
static void destroy_caps(void) { errval_t err; for (int i=0; i<CAPS_PER_CORE; i++) { err = cap_destroy(retyped_caps[i]); err = cap_revoke(my_caps[i]); if (err_is_fail(err)) { DEBUG_ERR(err, "xcorecap: Retype to frame failed\n"); } } }
static void cleanup_cap(struct capref cap) { errval_t err; err = cap_revoke(cap); if (err_is_fail(err)) { DEBUG_ERR(err, "cap_revoke"); } err = cap_destroy(cap); if (err_is_fail(err)) { DEBUG_ERR(err, "cap_revoke"); } }
static void revoke_cap(struct xcorecap_binding *b) { errval_t err; printf("xcorecapserv do revoke cap\n"); err = cap_revoke(sent_cap); if (err_is_fail(err)) { DEBUG_ERR(err, "xcorecapserv: revoke failed\n"); } printf("xcorecapserv revoked cap\n"); fflush(stdout); b->tx_vtbl.send_done(b, NOP_CONT); }
/** * \brief frees up the resources used by the ring. * * \param ring the descriptor ring to be freed * * \returns SYS_ERR_OK on success */ errval_t xeon_phi_dma_desc_ring_free(struct xdma_ring *ring) { errval_t err; if (capref_is_null(ring->cap)) { return SYS_ERR_OK; } if (ring->vbase) { vspace_unmap(ring->vbase); } err = cap_revoke(ring->cap); if (err_is_fail(err)) { DEBUG_ERR(err, "revokation of ring cap failed\n"); } return cap_destroy(ring->cap); }
/** Revoke capabilities from a task (64 bits) * * The calling task must have the CAP_CAP capability or the caller must * attempt to revoke capabilities from itself. * * @param taskid Destination task ID. * @param caps Capabilities to revoke. * * @return Zero on success or an error code from @ref errno.h. * */ sysarg_t sys_cap_revoke(sysarg_t taskid, cap_t caps) { return cap_revoke((task_id_t) taskid, caps); }