Commit 6a641548 authored by Charles Jacobsen's avatar Charles Jacobsen Committed by Vikram Narayanan

Fixed some run time errors, still not working.

parent f466992e
......@@ -18,6 +18,10 @@ static void copy_msg_regs(struct lcd *from, struct lcd *to)
int i;
for (i = 0; i < from->utcb.max_valid_reg_idx; i++)
to->utcb.regs[i] = from->utcb.regs[i];
/*
* reset
*/
from->utcb.max_valid_reg_idx = 0;
}
static void copy_msg_cap(struct lcd *from, struct lcd *to,
......@@ -40,6 +44,11 @@ static void copy_msg_caps(struct lcd *from, struct lcd *to)
i < to->utcb.max_valid_in_cap_reg_idx; i++)
copy_msg_cap(from, to, from->utcb.out_cap_regs[i],
to->utcb.in_cap_regs[i]);
/*
* reset
*/
from->utcb.max_valid_out_cap_reg_idx = 0;
to->utcb.max_valid_in_cap_reg_idx = 0;
}
static void copy_call_endpoint(struct lcd *from, struct lcd *to)
......
......@@ -16,14 +16,6 @@ static inline struct lcd * current_lcd(void)
return current->lcd;
}
/* BOOT CPTRS -------------------------------------------------- */
static inline cptr_t lcd_boot_cptr(u8 idx)
{
BUG_ON(idx >= LCD_NUM_BOOT_CPTRS);
return current->lcd->utcb.boot_cptrs[idx];
}
/* GENERAL REGISTERS ---------------------------------------- */
static inline u8 lcd_max_valid_reg_idx(void)
......
......@@ -11,7 +11,7 @@
#include <linux/completion.h>
#include <linux/kthread.h>
#include "../include/common.h"
#include "defs.h"
#include "../api/defs.h"
static inline struct lcd * test_mk_lcd(void)
{
......@@ -118,9 +118,10 @@ static int lcd_boot(void)
ret = lcd_cnode_alloc(dealer_lcd->cspace, &dcptr);
if (ret)
goto clean4;
if (dcptr != 1) {
if (dcptr != 31) {
ret = -1;
LCD_ERR("dealer cptr not 1, so need to change macro first");
LCD_ERR("dealer cptr = %d, so need to change macro first",
dcptr);
goto clean4;
}
ret = __lcd_mk_sync_endpoint(dealer_lcd, dcptr);
......@@ -130,9 +131,10 @@ static int lcd_boot(void)
ret = lcd_cnode_alloc(manufacturer_lcd->cspace, &mcptr);
if (ret)
goto clean5;
if (mcptr != 1) {
if (mcptr != 31) {
ret = -1;
LCD_ERR("mfter cptr not 1, so need to change macro first");
LCD_ERR("mfter cptr = %d, so need to change macro first",
mcptr);
goto clean5;
}
ret = lcd_cnode_grant(dealer_lcd->cspace, manufacturer_lcd->cspace,
......@@ -143,9 +145,10 @@ static int lcd_boot(void)
ret = lcd_cnode_alloc(customer_lcd->cspace, &ccptr);
if (ret)
goto clean5;
if (ccptr != 1) {
if (ccptr != 31) {
ret = -1;
LCD_ERR("customer cptr not 1, so need to change macro first");
LCD_ERR("customer cptr not = %d, so need to change macro first",
ccptr);
goto clean5;
}
ret = lcd_cnode_grant(dealer_lcd->cspace, customer_lcd->cspace,
......@@ -248,9 +251,9 @@ static int __init lcd_boot_init(void)
return lcd_boot();
}
static int __exit lcd_boot_exit(void)
static void __exit lcd_boot_exit(void)
{
return 0;
return;
}
module_init(lcd_boot_init);
......
......@@ -7,6 +7,6 @@
#ifndef LCD_PROTOTYPE_CUSTOMER_IDL_H
#define LCD_PROTOTYPE_CUSTOMER_IDL_H
#define CUSTOMER_DEALER_INTERFACE_CAP 1
#define CUSTOMER_DEALER_INTERFACE_CAP 31
#endif
......@@ -14,6 +14,6 @@ enum dealer_interface {
DEALER_DIE,
};
#define DEALER_DEALER_INTERFACE_CAP 1
#define DEALER_DEALER_INTERFACE_CAP 31
#endif
......@@ -289,7 +289,7 @@ int dealer_register_manufacturer(struct manufacturer_interface *__mi)
* boot cptr = points to end point for dealer interface
*/
lcd_store_r0(DEALER_REGISTER_MANUFACTURER);
ret = lcd_call(lcd_boot_cptr(MANUFACTURER_DEALER_INTERFACE_CAP));
ret = lcd_call(MANUFACTURER_DEALER_INTERFACE_CAP);
if (ret) {
LCD_ERR("call to dealer");
goto fail2;
......
......@@ -16,6 +16,6 @@ enum manufacturer_interface_enum {
};
/* Locations of manufacturer's boot cptrs */
#define MANUFACTURER_DEALER_INTERFACE_CAP 1
#define MANUFACTURER_DEALER_INTERFACE_CAP 31
#endif
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