/*-
* Copyright (c) 2011 Doug Rabson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/*
* USERBOOT interface versions
*/
/*
* Version 4 added more generic callbacks for setting up
* registers and descriptors. The callback structure is
* backward compatible (new callbacks have been added at
* the tail end).
*/
/*
* Exit codes from the loader
*/
struct loader_callbacks {
/*
* Console i/o
*/
/*
* Wait until a key is pressed on the console and then return it
*/
/*
* Write the character ch to the console
*/
/*
* Return non-zero if a key can be read from the console
*/
/*
* Host filesystem i/o
*/
/*
* Open a file in the host filesystem
*/
/*
* Close a file
*/
/*
* Return non-zero if the file is a directory
*/
/*
* Read size bytes from a file. The number of bytes remaining
* in dst after reading is returned in *resid_return
*/
/*
* Read an entry from a directory. The entry's inode number is
* returned in *fileno_return, its type in *type_return and
* the name length in *namelen_return. The name itself is
* copied to the buffer name which must be at least PATH_MAX
* in size.
*/
/*
* Seek to a location within an open file
*/
int whence);
/*
* Return some stat(2) related information about the file
*/
/*
* Disk image i/o
*/
/*
* Read from a disk image at the given offset
*/
/*
* Guest virtual machine i/o
*/
/*
* Copy to the guest address space
*/
/*
* Copy from the guest address space
*/
/*
* Set a guest register value
*/
/*
* Set a guest MSR value
*/
/*
* Set a guest CR value
*/
/*
* Set the guest GDT address
*/
/*
* Transfer control to the guest at the given address
*/
/*
* Misc
*/
/*
* Sleep for usec microseconds
*/
/*
* Exit with the given exit code
*/
/*
* Return guest physical memory map details
*/
/*
* ioctl interface to the disk device
*/
void *data);
/*
* Returns an environment variable in the form "name=value".
*
* If there are no more variables that need to be set in the
* loader environment then return NULL.
*
* 'num' is used as a handle for the callback to identify which
* environment variable to return next. It will begin at 0 and
* each invocation will add 1 to the previous value of 'num'.
*/
/*
* Version 4 additions.
*/
};