Commit 7f6512ec authored by Charles Jacobsen's avatar Charles Jacobsen Committed by Vikram Narayanan

Fixed build errors, api runs.

parent d4a334cb
......@@ -5,9 +5,6 @@
config LCD_PROTOTYPE
bool "LCD Prototype"
default y
select LCD_PROTOTYPE_API
select LCD_PROTOTYPE_LIBLCD
select LCD_PROTOTYPE_TEST
---help---
Prototype for Lightweight Capability Domains system.
......@@ -19,15 +16,15 @@ config LCD_PROTOTYPE_API
The kernel prototype for the LCD system.
config LCD_PROTOTYPE_LIBLCD
bool "LCD Prototype LibLCD"
default y
tristate "LCD Prototype LibLCD"
default m
depends on LCD_PROTOTYPE
---help---
Routines used by test modules.
config LCD_PROTOTYPE_TEST
bool "LCD Prototype Test"
default y
tristate "LCD Prototype Test"
default m
depends on LCD_PROTOTYPE_API
depends on LCD_PROTOTYPE_LIBLCD
select LCD_PROTOTYPE_TEST_CUSTOMER
......
......@@ -16,4 +16,5 @@ static int api_tests(void)
if (test01())
return -1;
LCD_MSG("all api tests passed!");
return 0;
}
......@@ -9,7 +9,6 @@
int lcd_mk_cspace(struct cspace **cspace_ptr)
{
struct cspace *cspace;
int i;
/*
* Allocate cspace
*/
......
......@@ -15,6 +15,7 @@
#define LCD_PROTOTYPE_API_DEFS_H
#include <linux/mutex.h>
#include <linux/sched.h>
#include <lcd-prototype/lcd.h>
/* CAPABILITIES -------------------------------------------------- */
......@@ -54,11 +55,11 @@ int lcd_mk_cspace(struct cspace **cspace_ptr);
*/
static inline int lcd_lock_cspace(struct cspace *cspace)
{
return mutex_lock_interruptible(cspace->lock);
return mutex_lock_interruptible(&cspace->lock);
}
static inline void lcd_unlock_cspace(struct cspace *cspace)
{
mutex_unlock(cspace->lock);
mutex_unlock(&cspace->lock);
}
/**
* (SAFE) Allocates an empty cnode slot, and returns a cptr to it. Returns
......@@ -79,8 +80,8 @@ static inline int lcd_cap_alloc(struct cspace *cspace, cptr_t *cptr)
/**
* (SAFE) Insert object into cspace.
*/
static inline int lcd_cap_insert(struct cspace *cspace, cptr_t cptr,
void *object, enum lcd_cap_type type);
int lcd_cap_insert(struct cspace *cspace, cptr_t cptr,
void *object, enum lcd_cap_type type);
/**
* (UNSAFE) Look up cnode in cspace at cptr.
*/
......@@ -89,7 +90,7 @@ static inline struct cnode *__lcd_cnode_lookup(struct cspace *cspace,
{
BUG_ON(cspace->free_slot > LCD_NUM_CAPS);
if (cptr < cspace->free_slot)
return cspace->cnodes[cptr];
return &cspace->cnodes[cptr];
else
return NULL;
}
......@@ -119,14 +120,18 @@ int lcd_cap_grant(struct cspace *src_cspace, struct cspace *dest_cspace,
/**
* (SAFE) Get capability type.
*/
static inline enum lcd_cap_type lcd_cap_type(struct cspace *cspace, cptr_t cptr)
static inline int lcd_cap_type(struct cspace *cspace, cptr_t cptr, int *out)
{
struct cnode *cnode;
enum lcd_cap_type type;
if (lcd_cnode_lookup(cspace, cptr, &cnode) || !cnode)
return LCD_CAP_TYPE_INVALID;
else
return cnode->type;
int ret = lcd_cnode_lookup(cspace, cptr, &cnode);
if (ret)
return ret;
if (!cnode)
return -EINVAL;
else {
*out = cnode->type;
return 0;
}
}
static inline int __lcd_cap_can_read(struct cnode *cnode)
{
......
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