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

lcd-create-v2: Add module load to liblcd interface.

parent cf3f9e4c
/*
* module_load.h
*
* For loading a kernel module from disk.
*
* Copyright: University of Utah
*/
#include <libcap.h>
/**
* lcd_load_module -- Load a kernel module from disk
* @mdir: the directory on the host file system that contains the module
* @mname: the name of the module (e.g. mname=foo for module foo.ko)
* @m_init_bits: out param, points to module's init code in caller's
* virtual address space
* @m_init_pages: cptr to memory object capability for init bits
* @m_init_link_addr: the address that the module's init code was linked for
*
* The *_core_* out params have similar meaning.
*
* You can access the module's program bits via the virtual addresses
* passed via the *_bits variables.
*
* You can grant other LCDs access to the module code and data via
* the *_pages cptr's.
*
* You can use the *_link_addr to know where the module bits should be
* mapped so that you can execute the code in the module.
*/
int lcd_load_module(char *mdir, char *mname,
void **m_init_bits,
void **m_core_bits,
cptr_t *m_init_pages,
cptr_t *m_core_pages,
gva_t *m_init_link_addr,
gva_t *m_core_link_addr);
/**
* lcd_release_module -- Unmap module bits and cap delete the pages
* @m_init_bits: virtual address of pages that contain module's init
* @m_core_bits: similar
*
* Frees module code and data from caller's address space, and deletes
* capabilities to the bits. If you didn't grant anyone else access
* to the pages (or you revoked access), they will be reclaimed in
* the host. (Hence the name "release" - the module won't necessarily
* be completely freed.)
*/
void lcd_release_module(void *m_init_bits, void *m_core_bits);
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