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

lcd-create-v2: Simplify LCD create/boot data, layout new create logic.

parent 39dfe81c
/*
* module_load.c
*
* For creating an empty LCD and loading a kernel
* module in it.
*
* Copyright: University of Utah
*/
int lcd_create_module_lcd(char *mdir, char *mname, cptr_t *lcd,
struct lcd_create_ctx **ctx)
{
int ret;
void *m_init_bits, *m_core_bits;
gva_t m_init_link_addr, m_core_link_addr;
/*
* Load kernel module
*/
/*
* Initialize empty LCD
*/
/*
* Initialize create context
*/
/*
* Set up physical address space
*/
/*
* Set up virtual address space
*/
/*
* Return context
*/
}
......@@ -12,13 +12,16 @@
#include <libcap.h>
#include <lcd-domains/types.h>
struct lcd_boot_info_for_page {
cptr_t my_cptr;
gpa_t page_gpa;
};
#define LCD_NUM_BOOT_CPTRS 8
struct lcd_boot_cptrs {
cptr_t module_init_cptr;
cptr_t module_core_cptr;
cptr_t stack_cptr;
cptr_t gv_pgd_cptr;
cptr_t gv_pud_cptr;
};
struct lcd_boot_info {
/*
* Bootstrap cptr cache
......@@ -27,11 +30,7 @@ struct lcd_boot_info {
/*
* Capabilities to memory objects
*/
cptr_t module_init_cptr;
cptr_t module_core_cptr;
cptr_t stack_cptr;
cptr_t gv_pgd_cptr;
cptr_t gv_pud_cptr;
struct lcd_boot_cptrs lcd_boot_cptrs;
/*
* Other capabilities (e.g., endpoints)
*/
......
......@@ -26,6 +26,7 @@
#include <linux/list.h>
#include <libcap.h>
#include <lcd-domains/types.h>
#include <lcd-domains/liblcd/boot_info.h>
/* LOW-LEVEL CREATE, CONFIG, RUN ---------------------------------------- */
......@@ -113,8 +114,6 @@ int lcd_run(cptr_t lcd);
/* HIGHER-LEVEL LCD CREATE FROM KERNEL MODULE ------------------------------ */
struct lcd_boot_info;
/**
* This context is used during LCD creation / destruction.
*/
......@@ -124,37 +123,14 @@ struct lcd_create_ctx {
*/
char mname[LCD_MODULE_NAME_MAX];
/*
* Where to point the program counter to run the module's init
*/
gva_t init;
/*
* List of the module's pages
*/
struct list_head mpages_list;
/*
* Temporary cptr cache for properly setting up the LCD's cspace
*/
struct cptr_cache *cache;
/*
* Pointer to beginning of boot pages
*/
char *boot_page_base;
/*
* Boot mem page infos
*/
struct list_head boot_mem_list;
/*
* Stack page infos
*/
struct list_head stack_mem_list;
/*
* Paging mem page infos
* cptr's to capabilities in *creator's* cspace for
* memory allocated for new LCD
*/
struct list_head paging_mem_list;
struct lcd_boot_cptrs creator_cptrs;
/*
* Free mem page infos
* Pointer to struct lcd_boot_info pages on host
*/
struct list_head free_mem_list;
struct lcd_boot_info *lcd_boot_info;
};
/**
......@@ -195,7 +171,7 @@ int lcd_create_module_lcd(char *mdir, char *mname, cptr_t *lcd,
*/
static inline struct lcd_boot_info * to_boot_info(struct lcd_create_ctx *ctx)
{
return (struct lcd_boot_info *)ctx->boot_page_base;
return cxt->lcd_boot_info;
}
/**
......
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