Commit 552bd976 authored by Anton Burtsev's avatar Anton Burtsev Committed by Vikram Narayanan

ioctl interface to LCD

parent c5748e0c
......@@ -2240,7 +2240,7 @@ int lcd_run(struct lcd *lcd) {
EXPORT_SYMBOL(lcd_run);
int setup_vmlinux(struct lcd *lcd, char *file) {
int lcd_setup_vmlinux(struct lcd *lcd, char *file) {
int ret;
u64 elf_entry;
......
......@@ -92,6 +92,7 @@ void lcd_vmx_exit(void);
int lcd_init_module(void __user * umod, unsigned long len, const char __user * uargs);
//int lcd_load_module(struct load_info *info, const char __user *uargs, int flags);
int lcd_setup_vmlinux(struct lcd *lcd, char *file);
int lcd_load_vmlinux(const char* kfile, struct lcd *lcd, u64 *elf_entry);
......
......@@ -14,7 +14,6 @@
#define LCD_LOAD_PV_KERNEL _IOR(LCD_MINOR, 0x01, struct lcd_pv_kernel_config)
struct lcd_pv_kernel_config {
char file[PATH_MAX];
__u64 length;
char *file;
} __attribute__((packed));
......@@ -3759,7 +3759,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
static int load_lcd(struct load_info *info, const char __user *uargs,
int flags)
{
struct lcd * lcd;
struct lcd * lcd;
struct module *mod;
long err;
......@@ -3865,7 +3865,6 @@ static int load_lcd(struct load_info *info, const char __user *uargs,
lcd_move_module(lcd, mod);
lcd_run(lcd);
return 0;
// return do_init_module(mod);
bug_cleanup:
/* module_bug_cleanup needs module_mutex protection */
......
......@@ -24,20 +24,41 @@ static long lcd_dev_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg)
{
long r = -EINVAL;
struct lcd_pv_kernel_config conf;
switch (ioctl) {
case LCD_LOAD_PV_KERNEL:
//r = copy_from_user(&conf, (int __user *) arg,
// sizeof(struct lcd_pv_kernel_config));
//if (r) {
// r = -EIO;
// goto out;
//}
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;
}
......
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