Main Page | Class List | Directories | File List | Class Members | File Members

vm.h File Reference

CKPM virtual machine definitions. More...


Defines

#define VM_VERSION   0x00000001
#define VM_MEM_DEFAULT   4
#define VM_MEM_MAX   64
#define VM_MEM_T_SIZE   (sizeof(vm_mem_t) - 1)

Typedefs

typedef unsigned int vm_addr_t
typedef unsigned int vm_size_t
typedef _vm_mem_t vm_mem_t
 virtual machine memory This structure describes the memory layout of the CKPMvm virtual machine

Functions

vm_mem_tload_file (int verbose, int argc, char **argv, char *file_name, vm_size_t mem_size)
 load a virtual machine executable
int run_vm (int verbose, vm_mem_t *vm_memory)
 run the loaded executable
void shutdown_vm (int verbose, vm_mem_t *vm_memory)
 shut down the virtual machine


Detailed Description

CKPM virtual machine definitions.


Define Documentation

#define VM_MEM_DEFAULT   4
 

default size of virtual machine memory in MB

#define VM_MEM_MAX   64
 

maximum size of virtual machine memory in MB

#define VM_MEM_T_SIZE   (sizeof(vm_mem_t) - 1)
 

size of vm_mem_t without allocated memory for mem

#define VM_VERSION   0x00000001
 

version of the virtual machine


Typedef Documentation

typedef unsigned int vm_addr_t
 

virtual machine addresses

typedef unsigned int vm_size_t
 

virtual machine size type


Function Documentation

vm_mem_t* load_file int  verbose,
int  argc,
char **  argv,
char *  file_name,
vm_size_t  mem_size
 

load a virtual machine executable

Parameters:
verbose if != 0 this function will provide verbose output
argc argument counter, contains the number of entries in argv
argv argument vector
file_name the file name of the VM executable to be loaded
mem_size the requested size in MB of the VM memory
Returns:
the pointer to the VM memory on success, NULL otherwise
This function allocates the requested size of memory for the virtual machine and loads a virtual machine executable into this memory. Additionally, it initialises the virtual machine registers.

int run_vm int  verbose,
vm_mem_t vm
 

run the loaded executable

Parameters:
verbose if != 0 this function will provide verbose output
vm the pointer to the virtual machine memory
Returns:
0 on success, 1 otherwise
This function executes the instructions as provided in vm_memory.

void shutdown_vm int  verbose,
vm_mem_t vm_memory
 

shut down the virtual machine

Parameters:
verbose if != 0 this function will provide verbose output
vm_memory the pointer to the virtual machine memory
This function shuts down the virtual machine. Actually, this function does nothing.


Generated on Thu Jul 13 03:56:37 2006 for CKPMcc by  doxygen 1.4.4