Commit f66d7821 authored by Charles Jacobsen's avatar Charles Jacobsen Committed by Vikram Narayanan

Fixed some bugs, still not working yet.

parent 6066c27c
......@@ -813,8 +813,7 @@ int customer_start(void);
static int test08_manufacturer(void *unused)
{
struct test08_info i;
int ret;
struct test08_info *i;
i = (struct test08_info *)unused;
i->ret_val = manufacturer_start();
......@@ -824,8 +823,7 @@ static int test08_manufacturer(void *unused)
static int test08_dealer(void *unused)
{
struct test08_info i;
int ret;
struct test08_info *i;
i = (struct test08_info *)unused;
i->ret_val = dealer_start();
......@@ -836,8 +834,7 @@ static int test08_dealer(void *unused)
static int test08_customer(void *unused)
{
struct test08_info i;
int ret;
struct test08_info *i;
i = (struct test08_info *)unused;
i->ret_val = customer_start();
......@@ -847,6 +844,7 @@ static int test08_customer(void *unused)
static int test08(void)
{
int ret = -1;
struct lcd *manufacturer_lcd;
struct lcd *dealer_lcd;
struct lcd *customer_lcd;
......
......@@ -8,6 +8,7 @@
#ifndef LCD_PROTOTYPE_DSTORE_H
#define LCD_PROTOTYPE_DSTORE_H
#include <linux/kernel.h>
#include <lcd-prototype/lcd.h>
#include "utcb.h"
#include "api-internal.h"
......
......@@ -8,6 +8,7 @@
#ifndef LCD_PROTOTYPE_UTCB_H
#define LCD_PROTOTYPE_UTCB_H
#include <linux/sched.h>
#include <lcd-prototype/lcd.h>
static inline struct lcd * current_lcd(void)
......@@ -38,13 +39,13 @@ static inline void lcd_update_max_valid_reg_idx(u8 idx)
static inline u64 lcd_r##idx(void) \
{ \
BUILD_BUG_ON(idx >= LCD_NUM_REGS); \
return current->lcd.utcb.regs[idx]; \
return current->lcd->utcb.regs[idx]; \
} \
static inline void lcd_store_r##idx(u64 val) \
{ \
BUILD_BUG_ON(idx >= LCD_NUM_REGS); \
lcd_update_max_valid_reg_idx(idx); \
current->lcd.utcb.regs[idx] = val; \
current->lcd->utcb.regs[idx] = val; \
}
LCD_MK_REG_ACCESS(0);
LCD_MK_REG_ACCESS(1);
......@@ -70,13 +71,13 @@ static inline void lcd_update_max_valid_out_cap_reg_idx(u8 idx)
static inline u64 lcd_out_cap##idx(void) \
{ \
BUILD_BUG_ON(idx >= LCD_NUM_OUT_CAP_REGS); \
return current->lcd.utcb.out_cap_regs[idx]; \
}
return current->lcd->utcb.out_cap_regs[idx]; \
} \
static inline void lcd_store_out_cap##idx(cptr_t val) \
{ \
BUILD_BUG_ON(idx >= LCD_NUM_OUT_CAP_REGS); \
lcd_update_max_valid_out_cap_reg_idx(idx); \
current->lcd.utcb.out_cap_regs[idx] = val; \
current->lcd->utcb.out_cap_regs[idx] = val; \
}
LCD_MK_OUT_CAP_REG_ACCESS(0);
LCD_MK_OUT_CAP_REG_ACCESS(1);
......@@ -102,13 +103,13 @@ static inline void lcd_update_max_valid_in_cap_reg_idx(u8 idx)
static inline u64 lcd_in_cap##idx(void) \
{ \
BUILD_BUG_ON(idx >= LCD_NUM_IN_CAP_REGS); \
return current->lcd.utcb.in_cap_regs[idx]; \
}
return current->lcd->utcb.in_cap_regs[idx]; \
} \
static inline void lcd_store_in_cap##idx(cptr_t val) \
{ \
BUILD_BUG_ON(idx >= LCD_NUM_IN_CAP_REGS); \
lcd_update_max_valid_in_cap_reg_idx(idx); \
current->lcd.utcb.in_cap_regs[idx] = val; \
current->lcd->utcb.in_cap_regs[idx] = val; \
}
LCD_MK_IN_CAP_REG_ACCESS(0);
LCD_MK_IN_CAP_REG_ACCESS(1);
......
......@@ -9,7 +9,6 @@
int lcd_ds_store(void *object, u64 badge, dsptr_t *out)
{
struct cnode *cnode;
struct cspace *cspace;
int ret;
......@@ -27,11 +26,7 @@ int lcd_ds_store(void *object, u64 badge, dsptr_t *out)
goto fail2;
fail2:
ret = lcd_cap_lock();
if (ret)
return ret;
__lcd_cnode_free(cspace, *out);
lcd_cap_unlock();
/* XXX: no way to de-alloc cnodes */
fail1:
return ret;
}
......@@ -93,7 +88,7 @@ static void * __lcd_ds_read(u64 badge, dsptr_t ptr)
return cnode->object;
}
void * lcd_ds_read(u64 badge, dsptr_t out)
void * lcd_ds_read(u64 badge, dsptr_t ptr)
{
int ret;
void *obj;
......@@ -109,4 +104,3 @@ void * lcd_ds_read(u64 badge, dsptr_t out)
return obj;
}
#endif /* LCD_PROTOTYPE_DSTORE_H */
obj-$(CONFIG_LCD_PROTOTYPE_TEST_CUSTOMER) += lcd-prototype-customer.o
obj-$(CONFIG_LCD_PROTOTYPE_TEST_CUSTOMER) += lcd-prototype-test-customer.o
lcd-prototype-test-customer-y += customer.o customer-idl.o
obj-$(CONFIG_LCD_PROTOTYPE_TEST_DEALER) += lcd-prototype-dealer.o
obj-$(CONFIG_LCD_PROTOTYPE_TEST_DEALER) += lcd-prototype-test-dealer.o
lcd-prototype-test-dealer-y += dealer.o dealer-idl.o
obj-$(CONFIG_LCD_PROTOTYPE_TEST_MANUFACTURER) += lcd-prototype-manufacturer.o
obj-$(CONFIG_LCD_PROTOTYPE_TEST_MANUFACTURER) += lcd-prototype-test-manufacturer.o
lcd-prototype-test-manufacturer-y += manufacturer.o manufacturer-idl.o
......@@ -11,7 +11,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include "common.h"
#include "../include/common.h"
#include "dealer.h"
#ifdef CONFIG_LCD_PROTOTYPE_TEST_IN_LCD
......
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