Index: kernel/generic/src/security/cap.c
===================================================================
--- kernel/generic/src/security/cap.c	(revision 96b02eb9b2f96f3843b8275c254c43a9cb6c8c88)
+++ kernel/generic/src/security/cap.c	(revision eb522e89bed31febf22a3d81923e99a4a8ff9513)
@@ -41,5 +41,4 @@
 #include <proc/task.h>
 #include <synch/spinlock.h>
-#include <syscall/sysarg64.h>
 #include <syscall/copy.h>
 #include <arch.h>
@@ -79,22 +78,17 @@
  * The calling task must have the CAP_CAP capability.
  *
- * @param uspace_taskid_arg Userspace structure holding destination task ID.
- * @param caps Capabilities to grant.
- *
- * @return Zero on success or an error code from @ref errno.h.
- *
- */
-sysarg_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps)
+ * @param taskid Destination task ID.
+ * @param caps   Capabilities to grant.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+static sysarg_t cap_grant(task_id_t taskid, cap_t caps)
 {
 	if (!(cap_get(TASK) & CAP_CAP))
 		return (sysarg_t) EPERM;
 	
-	sysarg64_t taskid_arg;
-	int rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
-	if (rc != 0)
-		return (sysarg_t) rc;
-	
 	irq_spinlock_lock(&tasks_lock, true);
-	task_t *task = task_find_by_id((task_id_t) taskid_arg.value);
+	task_t *task = task_find_by_id(taskid);
 	
 	if ((!task) || (!context_check(CONTEXT, task->context))) {
@@ -116,20 +110,15 @@
  * attempt to revoke capabilities from itself.
  *
- * @param uspace_taskid_arg Userspace structure holding 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_arg, cap_t caps)
-{
-	sysarg64_t taskid_arg;
-	int rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
-	if (rc != 0)
-		return (sysarg_t) rc;
-	
+ * @param taskid Destination task ID.
+ * @param caps   Capabilities to revoke.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+static sysarg_t cap_revoke(task_id_t taskid, cap_t caps)
+{
 	irq_spinlock_lock(&tasks_lock, true);
 	
-	task_t *task = task_find_by_id((task_id_t) taskid_arg.value);
+	task_t *task = task_find_by_id(taskid);
 	if ((!task) || (!context_check(CONTEXT, task->context))) {
 		irq_spinlock_unlock(&tasks_lock, true);
@@ -157,4 +146,84 @@
 }
 
+#ifdef __32_BITS__
+
+/** Grant capabilities to a task (32 bits)
+ *
+ * The calling task must have the CAP_CAP capability.
+ *
+ * @param uspace_taskid User-space pointer to destination task ID.
+ * @param caps          Capabilities to grant.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+sysarg_t sys_cap_grant(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_grant((task_id_t) taskid, caps);
+}
+
+/** 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);
+}
+
+#endif  /* __32_BITS__ */
+
+#ifdef __64_BITS__
+
+/** Grant capabilities to a task (64 bits)
+ *
+ * The calling task must have the CAP_CAP capability.
+ *
+ * @param taskid Destination task ID.
+ * @param caps   Capabilities to grant.
+ *
+ * @return Zero on success or an error code from @ref errno.h.
+ *
+ */
+sysarg_t sys_cap_grant(sysarg_t taskid, cap_t caps)
+{
+	return cap_grant((task_id_t) taskid, caps);
+}
+
+/** 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);
+}
+
+#endif  /* __64_BITS__ */
+
 /** @}
  */
