Commit 7847ab98 authored by Vikram Narayanan's avatar Vikram Narayanan

lcd: Remove redundant files

Remove leftover files during merge that are not needed/compiled anymore.
parent ef639a11
/* Author: Anton Burtsev
* Copyright: University of Utah */
#ifndef __LCD_CAP_H__
#define __LCD_CAP_H__
#include <linux/types.h>
#include <linux/spinlock.h>
#include "cap-cache.h"
#include <uapi/linux/lcd-cap.h>
#define LCD_MAX_CAPS 32
#define CAP_IDENTIFIER_BITS 2
#define TABLE_IDENTIFIER_BITS 1
// should always be 2^CAP_IDENTIFIER_BITS
#define MAX_CAP_SLOTS 4
// should always be 2^TABLE_IDENTIFIER_BITS
#define MAX_TABLE_ID_SLOTS 2
// should always be 2^CAP_IDENTIFIER_BITS + 2^TABLE_IDENTIFIER_BITS
#define MAX_SLOTS_PER_TABLE 6
struct cdt_root_node;
struct cnode;
struct cspace;
extern struct cdt_root_node * get_cdt_root(void);
extern void free_cdt_root(struct cdt_root_node *cdt_node);
enum lcd_cap_type
{
LCD_CAP_TYPE_INVALID,
LCD_CAP_TYPE_FREE,
LCD_CAP_TYPE_SYNC_EP,
LCD_CAP_TYPE_CNODE
};
enum allocation_state {
ALLOCATION_INVALID,
ALLOCATION_VALID,
ALLOCATION_MARKED_FOR_DELETE,
ALLOCATION_REMOVED
};
struct cdt_root_node {
spinlock_t lock;
struct cnode *cnode;
unsigned long node_count;
enum allocation_state state;
};
struct cnode {
enum lcd_cap_type type;
void *object;
spinlock_t lock;
struct cdt_root_node *cdt_root;
struct cnode *parent, *child, *prev, *next;
capability_t cap;
struct cspace *cspace;
};
struct cnode_table {
struct cnode cnode[MAX_SLOTS_PER_TABLE];
uint8_t table_level;
};
struct cspace {
spinlock_t lock;
enum allocation_state state;
struct cnode_table *cnode_table;
struct kmem_cache *cnode_table_cache;
struct cap_cache cap_cache;
};
bool _get_level_bits(int table_level, capability_t cap, capability_t *levelId);
bool _lcd_delete_node (struct cnode *cnode);
int _lcd_delete_table(struct cspace *cspace, struct cnode_table *table);
int lcd_cap_init_cspace(struct cspace *cspace);
struct cnode *lcd_cnode_lookup(struct cspace *cspace, capability_t cap, bool alloc);
int lcd_cap_insert(struct cspace *cspace, capability_t cap,
void *object, enum lcd_cap_type type);
void lcd_cap_delete(struct cspace *cspace, capability_t cap);
int lcd_cap_grant(struct cspace *cspacesrc, capability_t capsrc, struct cspace *cspacedst, capability_t capdst);
int lcd_cap_revoke(struct cspace *cspace, capability_t cap);
int lcd_cap_destroy_cspace(struct cspace *cspace);
#endif
#ifndef HOST_IPC_H
#define HOST_IPC_H
#include <uapi/linux/lcd-ipc.h>
#include <lcd/cap.h>
struct sync_ipc {
struct list_head senders;
struct list_head receivers;
spinlock_t lock;
};
/* Per thread kernel stack unified on a single page. */
union utcb_union {
struct utcb utcb;
char kstack[PAGE_SIZE];
};
struct sync_ipc * alloc_sync_ipc(void);
int lcd_ipc_init(void);
int lcd_ipc_exit(void);
#endif
/*
* Author: Charles Jacobsen <charlesj@cs.utah.edu>
* Copyright: University of Utah
*/
#ifndef LCD_LCD_H
#define LCD_LCD_H
#define LCD_NUM_REGS 8
#define LCD_NUM_OUT_CAP_REGS 8
#define LCD_NUM_IN_CAP_REGS LCD_NUM_OUT_CAP_REGS
#define LCD_NUM_BOOT_CPTRS 8
struct cspace;
typedef u64 cptr_t;
struct lcd {
/*
* Not accessible in lcd
*/
struct task_struct *parent;
u64 badge;
struct cspace *cspace;
struct list_head senders;
struct list_head receivers;
int making_call;
/*
* Accessible in lcd
*/
struct {
cptr_t boot_cptrs[LCD_NUM_BOOT_CPTRS];
u64 regs[LCD_NUM_REGS];
cptr_t out_cap_regs[LCD_NUM_OUT_CAP_REGS];
cptr_t in_cap_regs[LCD_NUM_IN_CAP_REGS];
u8 max_valid_reg_idx;
u8 max_valid_out_cap_reg_idx;
u8 max_valid_in_cap_reg_idx;
cptr_t call_endpoint_cap;
cptr_t reply_endpoint_cap;
} utcb;
};
#endif /* LCD_LCD_H */
......@@ -184,8 +184,6 @@ KASAN_SANITIZE_stackdepot.o := n
libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \
fdt_empty_tree.o
obj-$(CONFIG_LCD_ASYNC) += thc/
$(foreach file, $(libfdt_files), \
$(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
lib-$(CONFIG_LIBFDT) += $(libfdt_files)
......
#
# LCD ASYNC
#
config LAZY_THC
bool "CONFIG LAZY THC"
default y
---help---
LAZY ASYNC Implementation
obj-$(CONFIG_LAZY_THC) += async.o
async-y := main.o thc.o thcsync.o
/*
* main.c
*
* Authors: Anton Burtsev <aburtsev@flux.utah.edu>
* Muktesh Khole <muktesh.khole@utah.edu>
* Copyright: University of Utah
*/
#include <linux/init.h>
#include <linux/module.h>
#include <lcd-domains/thc.h>
#include <lcd-domains/thcinternal.h>
#include <lcd-domains/thcsync.h>
void foo1(void);
void foo2(void);
bool testFlag = false;
void foo1(void) {
printk(KERN_ERR "lcd async entering foo1");
while (testFlag == false) {
printk(KERN_ERR "lcd async yielding to foo2");
THCYield();
}
printk(KERN_ERR "lcd async foo1 complete");
}
void foo2(void) {
printk(KERN_ERR "lcd async entering foo2");
testFlag = true;
}
static int __init api_init(void)
{
DO_FINISH(ASYNC(foo1();foo2();););
printk(KERN_ERR "lcd async entering module");
return 0;
}
static void __exit api_exit(void)
{
printk(KERN_ERR "lcd async exiting module");
return;
}
module_init(api_init);
module_exit(api_exit);
This diff is collapsed.
This diff is collapsed.
......@@ -2,4 +2,3 @@
# Makefile for the virtualization
#
obj-y += lib/
obj-$(CONFIG_LCD_DOMAINS) += lcd-domains/
#
# Modules for testing
#
export LIBLCD = ../../../../liblcd/lib.a
obj-$(CONFIG_LCD_TEST_MOD_LOAD) += load/
obj-$(CONFIG_LCD_TEST_MOD_IPC1) += ipc1/
obj-$(CONFIG_LCD_TEST_MOD_IPC2) += ipc2/
obj-$(CONFIG_LCD_TEST_MOD_LIBLCD_TESTS) += liblcd-tests/
obj-$(CONFIG_LCD_TEST_MOD_CREATE_KLCD) += create-klcd/
obj-$(CONFIG_LCD_TEST_MOD_PMFS) += pmfs/
obj-$(CONFIG_LCD_TEST_MOD_GLUE_EXAMPLE) += glue-example/
/**
* lcd.c - Main file for the LCD module
*
*
* Authors:
* Anton Burtsev <aburtsev@flux.utah.edu>
*/
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
#include <linux/compat.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/slab.h>
#include <lcd/lcd.h>
#include <lcd/cap.h>
#include <lcd/api.h>
#include <lcd/boot.h>
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("LCD driver");
struct lcd_api lcd_api;
struct lcd_api *lcd_get_api(void) {
return &lcd_api;
};
EXPORT_SYMBOL(lcd_get_api);
int lcd_enter(void) {
int ret;
current->utcb = kmalloc(sizeof(struct utcb), GFP_KERNEL);
if (!current->utcb)
return -ENOMEM;
ret = lcd_init_list_cache(&current->cap_cache, LCD_MAX_CAPS);
if (ret) {
printk(KERN_ERR "Failed to initialize cap cache:%d\n", ret);
return ret;
}
ret = lcd_init_cspace(&current->cspace);
if(ret) {
printk(KERN_ERR "Failed to init cspace:%d\n", ret);
return ret;
};
return 0;
};
EXPORT_SYMBOL(lcd_enter);
int lcd_api_connect(struct lcd_api *api) {
capability_t reply_cap;
capability_t api_cap;
/* Frist: we take an existing endpoint for the API and insert it into
* the connecting cspace */
ret = lcd_alloc_cap(&current->cap_cache, &api_cap);
if(ret) {
printk(KERN_ERR "Failed to allocate free capability\n");
kfree(rvp);
return -ENOSPC;
};
ret = lcd_cap_insert_object(&current->cspace, api_cap, api->ep, LCD_TYPE_SYNC_EP);
if(ret) {
printk(KERN_ERR "Failed to insert endpoint into the cspace:%d\n", ret);
kfree(rvp);
return -ENOSPC;
};
/* Second: make a new endpoint so the connecting cspace can use call/reply
* primitives */
ret = lcd_make_sync_endpoint(&current->cspace, &current->cap_cache, &reply_cap);
if(ret) {
printk(KERN_ERR "Failed to create API endpoint:%d\n", ret);
return ret;
};
current->utcb->boot_info.boot_caps[LCD_BOOT_API_CAP] = api_cap;
current->utcb->boot_info.boot_caps[LCD_BOOT_REPLY_CAP] = reply_cap;
return 0;
};
EXPORT_SYMBOL(lcd_api_connect);
int lcd_init_current(void) {
int ret;
struct cnode *cnode;
ret = lcd_enter();
if (ret) {
printk(KERN_ERR "Failed to enter LCD environment\n");
return ret;
};
ret = lcd_api_connect(lcd_get_api());
if (ret) {
printk(KERN_ERR "Failed to connect to LCD API\n");
return ret;
};
return 0;
};
EXPORT_SYMBOL(lcd_init_current);
struct task_struct *lcd_create_as_module(char *name) {
return NULL;
};
static long lcd_dev_ioctl(struct file *filp ,
unsigned int ioctl, unsigned long arg)
{
long r = -EINVAL;
switch (ioctl) {
case LCD_LOAD_PV_KERNEL:
{
int error;
struct lcd *lcd;
struct filename *filename;
struct lcd_pv_kernel_config conf;
r = copy_from_user(&conf, (int __user *) arg,
sizeof(conf));
if (r) {
r = -EIO;
goto out;
}
/* create LCD with a PV Linux kernel */
lcd = lcd_create();
if (!lcd) {
r = -ENOMEM;
goto out;
}
filename = getname((const char __user *) conf.file);
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
lcd_setup_vmlinux(lcd, filename->name);
putname(filename);
lcd_run(lcd);
break;
}
default:
return -ENOTTY;
}
out:
return r;
}
static const struct file_operations lcd_chardev_ops = {
.owner = THIS_MODULE,
.unlocked_ioctl = lcd_dev_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = lcd_dev_ioctl,
#endif
.llseek = noop_llseek,
};
static struct miscdevice lcd_dev = {
LCD_MINOR,
"lcd",
&lcd_chardev_ops,
};
static int __init lcd_init(void)
{
int r = 0;
r = lcd_cap_init();
if(r)
return r;
r = lcd_ipc_init();
if(r)
return r;
r = lcd_api_init(&lcd_api);
if(r)
return r;
#if 0
printk(KERN_ERR "LCD module loaded\n");
if ((r = lcd_vmx_init())) {
printk(KERN_ERR "lcd: failed to initialize vmx\n");
return r;
}
r = misc_register(&lcd_dev);
if (r) {
printk(KERN_ERR "lcd: misc device register failed\n");
}
#endif
return r;
}
static void __exit lcd_exit(void)
{
lcd_cap_exit();
lcd_api_exit(&lcd_api);
#if 0
misc_deregister(&lcd_dev);
lcd_vmx_exit();
#endif
return;
}
module_init(lcd_init);
module_exit(lcd_exit);
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