/* * Freescale hypervisor call interface * * Copyright 2008-2010 Freescale Semiconductor, Inc. * * Author: Timur Tabi <timur@freescale.com> * * This file is provided under a dual BSD/GPL license. When using or * redistributing this file, you may do so under either license. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Freescale Semiconductor nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * * ALTERNATIVELY, this software may be distributed under the terms of the * GNU General Public License ("GPL") as published by the Free Software * Foundation, either version 2 of that License or (at your option) any * later version. * * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor 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.
*/
/* * We use "uintptr_t" to define a register because it's guaranteed to be a * 32-bit integer on a 32-bit platform, and a 64-bit integer on a 64-bit * platform. * * All registers are either input/output or output only. Registers that are * initialized before making the hypercall are input/output. All * input/output registers are represented with "+r". Output-only registers * are represented with "=r". Do not specify any unused registers. The * clobber list will tell the compiler that the hypercall modifies those * registers, which is good enough.
*/
/** * fh_send_nmi - send NMI to virtual cpu(s). * @vcpu_mask: send NMI to virtual cpu(s) specified by this mask. * * Returns 0 for success, or EINVAL for invalid vcpu_mask.
*/ staticinlineunsignedint fh_send_nmi(unsignedint vcpu_mask)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3");
/* Arbitrary limits to avoid excessive memory allocation in hypervisor */ #define FH_DTPROP_MAX_PATHLEN 4096 #define FH_DTPROP_MAX_PROPLEN 32768
/** * fh_partition_get_dtprop - get a property from a guest device tree. * @handle: handle of partition whose device tree is to be accessed * @dtpath_addr: physical address of device tree path to access * @propname_addr: physical address of name of property * @propvalue_addr: physical address of property value buffer * @propvalue_len: length of buffer on entry, length of property on return * * Returns zero on success, non-zero on error.
*/ staticinlineunsignedint fh_partition_get_dtprop(int handle,
uint64_t dtpath_addr,
uint64_t propname_addr,
uint64_t propvalue_addr,
uint32_t *propvalue_len)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5"); register uintptr_t r6 __asm__("r6"); register uintptr_t r7 __asm__("r7"); register uintptr_t r8 __asm__("r8"); register uintptr_t r9 __asm__("r9"); register uintptr_t r10 __asm__("r10");
/** * fh_partition_restart - reboot the current partition * @partition: partition ID * * Returns an error code if reboot failed. Does not return if it succeeds.
*/ staticinlineunsignedint fh_partition_restart(unsignedint partition)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3");
/** * fh_partition_get_status - gets the status of a partition * @partition: partition ID * @status: returned status code * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_partition_get_status(unsignedint partition, unsignedint *status)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4");
/** * fh_partition_start - boots and starts execution of the specified partition * @partition: partition ID * @entry_point: guest physical address to start execution * * The hypervisor creates a 1-to-1 virtual/physical IMA mapping, so at boot * time, guest physical address are the same as guest virtual addresses. * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_partition_start(unsignedint partition,
uint32_t entry_point, int load)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5");
/** * struct fh_sg_list: definition of the fh_partition_memcpy S/G list * @source: guest physical address to copy from * @target: guest physical address to copy to * @size: number of bytes to copy * @reserved: reserved, must be zero * * The scatter/gather list for fh_partition_memcpy() is an array of these * structures. The array must be guest physically contiguous. * * This structure must be aligned on 32-byte boundary, so that no single * strucuture can span two pages.
*/ struct fh_sg_list {
uint64_t source; /**< guest physical address to copy from */
uint64_t target; /**< guest physical address to copy to */
uint64_t size; /**< number of bytes to copy */
uint64_t reserved; /**< reserved, must be zero */
} __attribute__ ((aligned(32)));
/** * fh_partition_memcpy - copies data from one guest to another * @source: the ID of the partition to copy from * @target: the ID of the partition to copy to * @sg_list: guest physical address of an array of &fh_sg_list structures * @count: the number of entries in @sg_list * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_partition_memcpy(unsignedint source, unsignedint target, phys_addr_t sg_list, unsignedint count)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4"); register uintptr_t r5 __asm__("r5"); register uintptr_t r6 __asm__("r6"); register uintptr_t r7 __asm__("r7");
/** * fh_dma_enable - enable DMA for the specified device * @liodn: the LIODN of the I/O device for which to enable DMA * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_dma_enable(unsignedint liodn)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3");
/** * fh_dma_disable - disable DMA for the specified device * @liodn: the LIODN of the I/O device for which to disable DMA * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_dma_disable(unsignedint liodn)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3");
/** * fh_get_core_state - get the state of a vcpu * * @handle: handle of partition containing the vcpu * @vcpu: vcpu number within the partition * @state:the current state of the vcpu, see FH_VCPU_* * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_get_core_state(unsignedint handle, unsignedint vcpu, unsignedint *state)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4");
/** * fh_enter_nap - enter nap on a vcpu * * Note that though the API supports entering nap on a vcpu other * than the caller, this may not be implmented and may return EINVAL. * * @handle: handle of partition containing the vcpu * @vcpu: vcpu number within the partition * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_enter_nap(unsignedint handle, unsignedint vcpu)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4");
/** * fh_exit_nap - exit nap on a vcpu * @handle: handle of partition containing the vcpu * @vcpu: vcpu number within the partition * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_exit_nap(unsignedint handle, unsignedint vcpu)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3"); register uintptr_t r4 __asm__("r4");
/** * Run deferred DMA disabling on a partition's private devices * * This applies to devices which a partition owns either privately, * or which are claimable and still actively owned by that partition, * and which do not have the no-dma-disable property. * * @handle: partition (must be stopped) whose DMA is to be disabled * * Returns 0 for success, or an error code.
*/ staticinlineunsignedint fh_partition_stop_dma(unsignedint handle)
{ register uintptr_t r11 __asm__("r11"); register uintptr_t r3 __asm__("r3");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.