Commit 31d6991f authored by Charlie Jacobsen's avatar Charlie Jacobsen Committed by Vikram Narayanan
Browse files

libcap-integration: Add revoke syscall, update syscall ids.

Revoke wasn't available before. Put it in there for completeness.
parent bbc8ed92
/*
* syscall.h
* syscall.h -- Syscall IDs
*
* Author: Charles Jacobsen <charlesj@cs.utah.edu>
* Copyright: University of Utah
*
*/
#ifndef LCD_DOMAINS_SYSCALL_H
#define LCD_DOMAINS_SYSCALL_H
#define LCD_SYSCALL_EXIT 0
#define LCD_SYSCALL_SEND 1
#define LCD_SYSCALL_RECV 2
#define LCD_SYSCALL_CALL 3
#define LCD_SYSCALL_REPLY 4
#define LCD_SYSCALL_PUTCHAR 5
#define LCD_SYSCALL_PAGE_ALLOC 6
#define LCD_SYSCALL_PAGE_MAP 7
#define LCD_SYSCALL_PAGE_UNMAP 8
#define LCD_SYSCALL_CAP_DELETE 9
#define LCD_SYSCALL_SYNC_EP 10
enum lcd_syscall {
LCD_SYSCALL_EXIT,
LCD_SYSCALL_PUTCHAR,
LCD_SYSCALL_SEND,
LCD_SYSCALL_RECV,
LCD_SYSCALL_CALL,
LCD_SYSCALL_REPLY,
LCD_SYSCALL_CREATE_SYNC_EP,
LCD_SYSCALL_PAGES_ALLOC_EXACT_NODE,
LCD_SYSCALL_PAGES_ALLOC,
LCD_SYSCALL_MMAP,
LCD_SYSCALL_MUNMAP,
LCD_SYSCALL_CAP_DELETE,
LCD_SYSCALL_CAP_REVOKE,
};
#endif /* LCD_DOMAINS_SYSCALL_H */
......@@ -24,6 +24,19 @@ static int handle_syscall_create_sync_ep(struct lcd *lcd)
return __lcd_create_sync_endpoint(lcd, slot);
}
static int handle_syscall_cap_revoke(struct lcd *lcd)
{
cptr_t object;
/*
* Get object cptr
*/
object = __cptr(lcd_arch_get_syscall_arg0(lcd->lcd_arch));
/*
* Do revoke
*/
return cap_revoke(lcd->cspace, object);
}
static int handle_syscall_cap_delete(struct lcd *lcd)
{
cptr_t object;
......@@ -201,6 +214,9 @@ static int handle_syscall(struct lcd *lcd, int *lcd_ret)
case LCD_SYSCALL_REPLY:
ret = handle_syscall_reply(lcd);
break;
case LCD_SYSCALL_CREATE_SYNC_EP:
ret = handle_syscall_create_sync_ep(lcd);
break;
case LCD_SYSCALL_PAGES_ALLOC_EXACT_NODE:
ret = handle_syscall_pages_alloc_exact_node(lcd);
break;
......@@ -216,8 +232,8 @@ static int handle_syscall(struct lcd *lcd, int *lcd_ret)
case LCD_SYSCALL_CAP_DELETE:
ret = handle_syscall_cap_delete(lcd);
break;
case LCD_SYSCALL_CREATE_SYNC_EP:
ret = handle_syscall_create_sync_ep(lcd);
case LCD_SYSCALL_CAP_REVOKE:
ret = handle_syscall_cap_revoke(lcd);
break;
default:
LCD_ERR("unimplemented syscall %d", syscall_id);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment