original files of m241
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
/* vbFrameSchedIntHook.h - VB frame scheduler start and end interrupt hook */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01a,11jun10,l_z Written.
|
||||
*/
|
||||
|
||||
#ifndef __INCvbFrameSchedIntHookh
|
||||
#define __INCvbFrameSchedIntHookh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* defines */
|
||||
|
||||
/* typedefs */
|
||||
|
||||
/* the frame schedule interrupt type */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VB_FRAME_START = 0,
|
||||
VB_FRAME_END = 1
|
||||
} VB_FRAME_SCHED_INT_TYPE;
|
||||
|
||||
/* Enable VB schedule interrupts */
|
||||
|
||||
STATUS vbFrameSchedIntEnable (VB_FRAME_SCHED_INT_TYPE, FUNCPTR, int);
|
||||
|
||||
/* Disable VB schedule interrupts */
|
||||
|
||||
STATUS vbFrameSchedIntDisable (VB_FRAME_SCHED_INT_TYPE);
|
||||
|
||||
/* Initializes the VB scheduler interrupt vector */
|
||||
|
||||
void vbFrameSchedIntInit (void);
|
||||
|
||||
/* Connects the VB scheuler interrupts */
|
||||
|
||||
void vbFrameSchedIntInit2 (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCvbFrameSchedIntHookh */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
/* vbiArch.h - vbi architecture specific definitions */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01m,28sep10,rab add arm support
|
||||
01m,29apr10,pad Moved extern C statement after include statements.
|
||||
01l,23sep09,d_c Defect WIND00183017 Fix WIND00183019 - sync with 18-Sep HV
|
||||
DVD
|
||||
01k,25jun09,to cleanup for VxWorks 6.8
|
||||
01j,26may09,md adapted for VxWorks 6.7
|
||||
01i,25may09,md add endian order type defines
|
||||
01h,17mar09,mpk Cavium OCTEON MIPS64 port for hypervisor
|
||||
01g,29jan09,mmi add vbi/ to the header files path
|
||||
01f,28jan09,mmi check PENTIUM4 and PENTIUM, consider error case
|
||||
01e,06feb09,to test CPU_FAMILY to include arch specific file
|
||||
01d,29jan09,rec merge in from vxWorks6.6.
|
||||
01c,27jan09,dtr Build for PENTIUM4.
|
||||
01b,26jan09,dtr Check all CPUs.
|
||||
01a,21jan08,mmi written.
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiArchh
|
||||
#define __INCvbiArchh
|
||||
|
||||
#include <vxWorks.h>
|
||||
|
||||
/* endian types selectable by the arch specific header files */
|
||||
|
||||
#define __VBI_LITTLE_ENDIAN 1234 /* least-significant byte first */
|
||||
#define __VBI_BIG_ENDIAN 4321 /* most-significant byte first */
|
||||
#define __VBI_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||
|
||||
/* include the appropriate arch specific header file */
|
||||
|
||||
#include <wrhv/vbiTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if (CPU == MIPSI64R2)
|
||||
# include <wrhv/vbiMips64Arch.h>
|
||||
#elif (CPU_FAMILY == PPC)
|
||||
# include <wrhv/vbiPpcArch.h>
|
||||
#elif (CPU_FAMILY == I80X86)
|
||||
# include <wrhv/vbiX86Arch.h>
|
||||
#elif (CPU_FAMILY == ARM)
|
||||
# include <wrhv/vbiArmArch.h>
|
||||
#else
|
||||
# error "no arch header file included"
|
||||
#endif
|
||||
|
||||
/* ensure the arch has specified a byte ordering */
|
||||
|
||||
#if !defined(__VBI_BYTE_ORDER)
|
||||
# error Architecture has not defined a byte order!
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCvbiArchh */
|
||||
@@ -0,0 +1,712 @@
|
||||
/* vbiArmArch.h - ARM architecture specific definitions */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2012 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01f,20jan12,m_h WIND00290890 Fix Warnings
|
||||
01e,26apr11,m_h Support for wrload
|
||||
01d,04apr11,jlv Sync with HV 1.3 01-Apr-11(WIND00265419)
|
||||
01c,11mar11,rab add VBI_INT_VCORE_LOCK/UNLOCK/STATE_GET macros
|
||||
01b,11feb11,rab sync with latest hv-1.3
|
||||
01a,28sep10,rab created
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiArmArchh
|
||||
#define __INCvbiArmArchh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
|
||||
/* For now restrict operation to little endian. */
|
||||
/* Later this should come from the build system. */
|
||||
|
||||
#define __VBI_BYTE_ORDER __VBI_LITTLE_ENDIAN
|
||||
|
||||
#define WRHV_13_LATEST /* RAB - undef to build for HV-1.3 EAR DVD */
|
||||
|
||||
/* VIOAPIC number of entries */
|
||||
|
||||
#define VB_VIOAPIC_ENTRIES_SIZE 64
|
||||
|
||||
#define _WRHV_ARCH_HAS_STATUS_REGS 1
|
||||
#define _WRHV_ARCH_HAS_CTRL_REGS 1
|
||||
|
||||
#define VB_STATUS_REGS_OFFSET_BASE 0
|
||||
#define VB_STATUS_MODE (4 * (VB_STATUS_REGS_OFFSET_BASE + 0))
|
||||
#define VB_STATUS_DFSR (4 * (VB_STATUS_REGS_OFFSET_BASE + 1))
|
||||
#define VB_STATUS_IFSR (4 * (VB_STATUS_REGS_OFFSET_BASE + 2))
|
||||
#define VB_STATUS_DFAR (4 * (VB_STATUS_REGS_OFFSET_BASE + 3))
|
||||
#define VB_STATUS_IFAR (4 * (VB_STATUS_REGS_OFFSET_BASE + 4))
|
||||
#define VB_STATUS_INTVECTOR (4 * (VB_STATUS_REGS_OFFSET_BASE + 5))
|
||||
#define VB_STATUS_COPROC_RIGHTS (4 * (VB_STATUS_REGS_OFFSET_BASE + 6))
|
||||
#define VB_STATUS_COPROC_GRANTS (4 * (VB_STATUS_REGS_OFFSET_BASE + 7))
|
||||
#define VB_STATUS_BANKED_REGS (4 * (VB_STATUS_REGS_OFFSET_BASE + 8))
|
||||
/* (SPSR, SP, LR) * 16 = 48 */
|
||||
|
||||
#define VB_STATUS_REG_STRUCT_END (4 * (VB_STATUS_REGS_OFFSET_BASE + 56))
|
||||
|
||||
#if 0
|
||||
/* Bit Mask definitions for VB_STATUS_INT_PENDING */
|
||||
|
||||
#define VB_STATUS_INT_PENDING_INT 1 /* Interrupt controller */
|
||||
#define VB_STATUS_INT_PENDING_TICK 2 /* Tick interrupt */
|
||||
#endif
|
||||
|
||||
#define VB_CONTROL_REGS_OFFSET_BASE 0
|
||||
|
||||
#define VB_CONTROL_CPSR (4 * (VB_CONTROL_REGS_OFFSET_BASE + 0))
|
||||
#define VB_CONTROL_SPSR (4 * (VB_CONTROL_REGS_OFFSET_BASE + 1))
|
||||
#define VB_CONTROL_R0 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 2))
|
||||
#define VB_CONTROL_R1 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 3))
|
||||
#define VB_CONTROL_R2 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 4))
|
||||
#define VB_CONTROL_R3 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 5))
|
||||
#define VB_CONTROL_R4 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 6))
|
||||
#define VB_CONTROL_R5 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 7))
|
||||
#define VB_CONTROL_R6 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 8))
|
||||
#define VB_CONTROL_R7 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 9))
|
||||
#define VB_CONTROL_R8 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 10))
|
||||
#define VB_CONTROL_R9 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 11))
|
||||
#define VB_CONTROL_R10 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 12))
|
||||
#define VB_CONTROL_R11 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 13))
|
||||
#define VB_CONTROL_R12 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 14))
|
||||
#define VB_CONTROL_R13 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 15))
|
||||
#define VB_CONTROL_R14 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 16))
|
||||
#define VB_CONTROL_R15 (4 * (VB_CONTROL_REGS_OFFSET_BASE + 17))
|
||||
#define VB_CONTROL_SP VB_CONTROL_R13
|
||||
#define VB_CONTROL_LR VB_CONTROL_R14
|
||||
#define VB_CONTROL_PC VB_CONTROL_R15
|
||||
|
||||
#define VB_CONTROL_REG_STRUCT_END (4 * (VB_CONTROL_REGS_OFFSET_BASE + 18))
|
||||
|
||||
/* status register size for arm */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
#define VB_STATUS_REGS_ACCESS(base, field) \
|
||||
base->vbStatusRegs.field
|
||||
|
||||
#define VB_CONTROL_REGS_ACCESS(base, field) \
|
||||
base->vbControlRegs.field
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VB_ARCH_CONTROL_REGS - Virtual core ARM control structure
|
||||
*
|
||||
* Virtual board emulated control registers. These registers are used
|
||||
* by a guest running on hypervisor to configure the virtual CPU register.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
* ARM Control structure graphical illustration
|
||||
*\cs
|
||||
#if 0
|
||||
* _______________
|
||||
* | PC |
|
||||
* |---------------|
|
||||
* | MSR |
|
||||
* |---------------|
|
||||
* | CR |
|
||||
* |---------------|
|
||||
* | |
|
||||
* |general purpose|
|
||||
* | r[0:13] |
|
||||
* | |
|
||||
* |---------------|
|
||||
* |emulated MSR |
|
||||
* |---------------|
|
||||
* | dbsr |
|
||||
* |---------------|
|
||||
* | dbcr[0:2] |
|
||||
* |---------------|
|
||||
* |IAC[1:2] |
|
||||
* |---------------|
|
||||
* |DAC[1:2] |
|
||||
* |---------------|
|
||||
* |reserved[0:9] |
|
||||
* |---------------|
|
||||
#endif
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* Virtual core's control C data structure type definition
|
||||
*
|
||||
*\cs
|
||||
* VB_STATUS structure definition
|
||||
*
|
||||
* typedef struct vbArchControlRegs
|
||||
* {
|
||||
*
|
||||
* /@ Registers to be restored by the VDK_SYS_ctx_load fast system call @/
|
||||
*
|
||||
#if 0
|
||||
* uint32_t srr0; /@ 0: PC @/
|
||||
* uint32_t srr1; /@ 1: MSR @/
|
||||
* uint32_t cr; /@ 2: condition registers @/
|
||||
* uint32_t r0; /@ 3: General register R0 @/
|
||||
* uint32_t sp; /@ 4: General register R1 (stack pointer) @/
|
||||
* uint32_t r2; /@ 5: General register R2 @/
|
||||
* uint32_t r3; /@ 6: General register R3 @/
|
||||
* uint32_t r4; /@ 7: General register R4 @/
|
||||
* uint32_t r5; /@ 8: General register R5 @/
|
||||
* uint32_t r6; /@ 9: General register R6 @/
|
||||
* uint32_t r7; /@ 10: General register R7 @/
|
||||
* uint32_t r8; /@ 11: General register R8 @/
|
||||
* uint32_t r9; /@ 12: General register R9 @/
|
||||
* uint32_t r10; /@ 13: General register R10 @/
|
||||
* uint32_t r11; /@ 14: General register R11 @/
|
||||
* uint32_t r12; /@ 15: General register R12 @/
|
||||
* uint32_t r13; /@ 16: General register R13 @/
|
||||
*
|
||||
* /@ emulated registers used by the VDK_SYS_ctx_load_vmmu system call @/
|
||||
*
|
||||
* uint32_t emsr; /@ 17: emulated MSR register @/
|
||||
*
|
||||
* /@ Debug control registers @/
|
||||
*
|
||||
* uint32_t dbsr; /@ 18 - debug status register @/
|
||||
*
|
||||
* /@ Debug control registers @/
|
||||
*
|
||||
* uint32_t dbcr0; /@ 19 - debug control register 0 @/
|
||||
* uint32_t dbcr1; /@ 20 - debug control register 1 @/
|
||||
* uint32_t dbcr2; /@ 21 - debug control register 2 @/
|
||||
*
|
||||
* /@ instruction address compare registers IAC1-IAC2 @/
|
||||
*
|
||||
* uint32_t iac1; /@ 22 - instructions access control 1 @/
|
||||
* uint32_t iac2; /@ 23 - instructions access control 2 @/
|
||||
*
|
||||
* /@ data address compare registers DAC1-DAC2. @/
|
||||
*
|
||||
* uint32_t dac1; /@ 24 - instructions access control 3 @/
|
||||
* uint32_t dac2; /@ 25 - instructions access control 4 @/
|
||||
*
|
||||
* /@ reserved fields for future use @/
|
||||
*
|
||||
* uint32_t reserved[10]; /@ 26: Reserved @/
|
||||
#endif
|
||||
* } VB_ARCH_CONTROL_REGS;
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* SEE ALSO: VB_ARCH_CONTROL_REGS, architecture supplement document
|
||||
*\COMMAND
|
||||
*/
|
||||
|
||||
typedef struct vbArchControlRegs
|
||||
{
|
||||
unsigned long cpsr; /* saved CPSR */
|
||||
unsigned long spsr; /* saved SPSR */
|
||||
|
||||
/* registers that can be restored by a sys_ret fast system call */
|
||||
|
||||
unsigned long r0; /* general purpose register R0 */
|
||||
unsigned long r1; /* general purpose register R1 */
|
||||
unsigned long r2; /* general purpose register R2 */
|
||||
unsigned long r3; /* general purpose register R3 */
|
||||
unsigned long r4; /* general purpose register R4 */
|
||||
unsigned long r5; /* general purpose register R5 */
|
||||
unsigned long r6; /* general purpose register R6 */
|
||||
unsigned long r7; /* general purpose register R7 */
|
||||
unsigned long r8; /* general purpose register R8 */
|
||||
unsigned long r9; /* general purpose register R9 */
|
||||
unsigned long r10; /* general purpose register R10 */
|
||||
unsigned long r11; /* general purpose register R11 */
|
||||
unsigned long r12; /* general purpose register R12 */
|
||||
unsigned long sp; /* r13 */
|
||||
unsigned long lr; /* r14 */
|
||||
unsigned long pc; /* r15 */
|
||||
|
||||
#ifdef WRHV_13_LATEST
|
||||
unsigned long asid; /* Virtual ASID */
|
||||
unsigned long vmmuHandle; /* VMMU Handle returned from vbiVmmuCreate */
|
||||
#endif /* WRHV_13_LATEST */
|
||||
|
||||
} VB_ARCH_CONTROL_REGS;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VB_ARCH_STATUS_REGS - Virtual core emulated status registers
|
||||
*
|
||||
* Virtual board emulated CPU status registers
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
* PPC Status structure graphical illustration
|
||||
*\cs
|
||||
#if 0
|
||||
* _______________ ---------------------------
|
||||
* | SRR0 |
|
||||
* |---------------|
|
||||
* | SRR1 | Registers save by WRHV
|
||||
* |---------------| before injecting an exception/interrupt
|
||||
* | CR |
|
||||
* |---------------|
|
||||
* | LR |
|
||||
* |---------------|
|
||||
* | r3 |
|
||||
* |---------------|
|
||||
* | r4 |
|
||||
* |---------------| ---------------------------
|
||||
* | mcsrr0 |
|
||||
* |---------------| Registers saved duing exception handling
|
||||
* | mcssr1 |
|
||||
* |---------------|
|
||||
* | esr |
|
||||
* |---------------|
|
||||
* | mcsr |
|
||||
* |---------------|
|
||||
* | mcar |
|
||||
* |---------------|
|
||||
* | dear |
|
||||
* |---------------|
|
||||
* | emsr |
|
||||
* |---------------|
|
||||
* | esrr0 |
|
||||
* |---------------|
|
||||
* | esrr1 |
|
||||
* |---------------| -------------------------
|
||||
* | reserved[8] | 8 x 32bits for future enhencements
|
||||
* |---------------| -------------------------
|
||||
* | svr |
|
||||
* |---------------|
|
||||
* | pir |
|
||||
* |---------------|
|
||||
* | pvr | Configuration registers updated
|
||||
* |---------------| upon board creation
|
||||
* | hid0 |
|
||||
* |---------------|
|
||||
* | hid1 |
|
||||
* |---------------|
|
||||
* | buscr |
|
||||
* |---------------|
|
||||
* | l1csr0 |
|
||||
* |---------------|
|
||||
* | l1csr1 |
|
||||
* |---------------| --------------------------
|
||||
* | reserved[0:8] | 9x 32bit
|
||||
* |---------------|
|
||||
#endif
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* Virtual core's status C data structure type definition
|
||||
*
|
||||
*\cs
|
||||
* VB_ARCH_STATUS_REGS structure definition
|
||||
*
|
||||
* typedef struct archStatusRegs
|
||||
* {
|
||||
*
|
||||
* /@
|
||||
* @ registers saved by WRHV for all interrupts exceptions
|
||||
* @ before setting the PC in the virtual board to the exception/interrupt
|
||||
* @ vector address
|
||||
* @/
|
||||
*
|
||||
#if 0
|
||||
* uint32_t srr0; /@ 0: PC at time of the interrupt @/
|
||||
* uint32_t srr1; /@ 1: MSR at time of the interrupt @/
|
||||
* uint32_t cr; /@ 2: Condition registers at time of the interrupt @/
|
||||
* uint32_t lr; /@ 3: Link register at time of the interrupt @/
|
||||
* uint32_t r3; /@ 4: R3 at time of the interrupt @/
|
||||
* uint32_t r4; /@ 5: R4 at time of the interrupt @/
|
||||
*
|
||||
* /@ Registers saved by WRHV during exception processing only @/
|
||||
*
|
||||
* uint32_t mcsrr0; /@ 6: @/
|
||||
* uint32_t mcsrr1; /@ 7: @/
|
||||
* uint32_t esr; /@ 8: @/
|
||||
* uint32_t mcsr; /@ 9: @/
|
||||
* uint32_t mcar; /@ 10 @/
|
||||
* uint32_t dear; /@ 11: @/
|
||||
* uint32_t emsr; /@ 12: @/
|
||||
* uint32_t esrr0; /@ 13: @/
|
||||
* uint32_t esrr1; /@ 14: @/
|
||||
*
|
||||
* /@ reserved fields for future use @/
|
||||
*
|
||||
* uint32_t reserved1[8]; /@ 15 - 22 @/
|
||||
*
|
||||
* /@ Configuration registers (only updated upon board creation @/
|
||||
*
|
||||
* uint32_t svr; /@ 23 @/
|
||||
* uint32_t pir; /@ 24 @/
|
||||
* uint32_t pvr; /@ 25 @/
|
||||
* uint32_t hid0; /@ 26 @/
|
||||
* uint32_t hid1; /@ 27 @/
|
||||
* uint32_t bucsr; /@ 28 @/
|
||||
* uint32_t l1csr0; /@ 29 @/
|
||||
* uint32_t l1csr1; /@ 30 @/
|
||||
*
|
||||
* /@ reserved fields for future use @/
|
||||
*
|
||||
* uint32_t reserved2[9]; /@ 31 - 39 @/
|
||||
#endif
|
||||
*
|
||||
* } VB_ARCH_STATUS_REGS;
|
||||
*
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* SEE ALSO: VB_STATUS
|
||||
*\COMMAND
|
||||
*/
|
||||
|
||||
typedef struct archStatusRegs
|
||||
{
|
||||
/*
|
||||
* registers saved by Razor for all interrupts exceptions
|
||||
* before setting the PC in the virtual board to the exception/interrupt
|
||||
* vector address
|
||||
*/
|
||||
|
||||
unsigned long mode;
|
||||
|
||||
unsigned long dfsr; /* cp15 c5, Data Fault Status Register */
|
||||
unsigned long ifsr; /* cp15 c5, Instruction Fault Status Register */
|
||||
unsigned long dfar; /* like cp15 c6, Fault Address Register */
|
||||
unsigned long ifar; /* like cp15 c6, Fault Address Register */
|
||||
unsigned long intVector; /* vector index indicating highest pri pending */
|
||||
|
||||
/* bit0 = cp0, ..., bit13 = cp13; 1 = grant, 0 = deny */
|
||||
unsigned long coprocRights; /* CP access rights for this VB [13:0] */
|
||||
|
||||
/* CPs that have been granted user-mode access by the VB [13:0] */
|
||||
/* coprocGrants is changed in sync with regs->coprocAccess */
|
||||
unsigned long coprocGrants;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned long spsr; /* mode specific SPSR */
|
||||
unsigned long sp; /* mode specific r13 (stack pointer) */
|
||||
unsigned long lr; /* mode specific r14 (link register) */
|
||||
} modeSpecificReg[16];
|
||||
|
||||
} VB_ARCH_STATUS_REGS;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VBI_HREG_SET - hardware register set, for read/write
|
||||
*
|
||||
* Used by vbiVbRegisterRead/vbiVbRegisterWrite to read/write registers in
|
||||
* another VB
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
* VB hardware register set C data structure type definition
|
||||
*
|
||||
*\cs
|
||||
*
|
||||
* typedef struct
|
||||
* {
|
||||
#if 0
|
||||
* uint32_t gpr[GREG_NUM]; /@ general purpose registers @/
|
||||
* uint32_t msr; /@ machine state register @/
|
||||
* uint32_t lr; /@ link register @/
|
||||
* uint32_t ctr; /@ count register @/
|
||||
* uint32_t pc; /@ program counter @/
|
||||
* uint32_t cr; /@ condition register @/
|
||||
* uint32_t xer; /@ fixed-point exception register @/
|
||||
* uint32_t spefscr; /@ SPE floating-point status & ctrl reg @/
|
||||
* uint32_t casid; /@ PPC405, Book E PID and PPC860 M_CASID @/
|
||||
#endif
|
||||
* } VBI_HREG_SET;
|
||||
*
|
||||
*
|
||||
*\ce
|
||||
* SEE ALSO: NONE
|
||||
*
|
||||
*/
|
||||
|
||||
#define VBI_GREG_NUM 13 /* has 32 32/64-bit data registers */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t r[VBI_GREG_NUM]; /* general purpose registers 0-12 */
|
||||
|
||||
INSTR * pc; /* program counter. aka r[15] */
|
||||
|
||||
uint32_t cpsr;
|
||||
|
||||
uint32_t sp_usr; /* or sys mode. aka r[13] */
|
||||
uint32_t lr_usr; /* or sys mode. aka r[14] */
|
||||
|
||||
} VBI_HREG_SET;
|
||||
|
||||
|
||||
/* complex register set definition */
|
||||
|
||||
typedef union
|
||||
{
|
||||
VBI_HREG_SET hreg32; /* 32 bit register set */
|
||||
} VBI_HREG_SET_CMPLX;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vbiRegSet_t vbiRegType;
|
||||
VBI_HREG_SET_CMPLX vbiRegSet;
|
||||
} VBI_HREG_SET_CMPLX_QUALIFIED;
|
||||
|
||||
/* common system wide message header structure */
|
||||
|
||||
typedef struct vbi_msg_header {
|
||||
uint32_t msgId; /* message type identification */
|
||||
uint32_t msgArg; /* argument associated with message type */
|
||||
} VBI_MSG_HEADER;
|
||||
|
||||
/* request message */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
VBI_MSG_HEADER hdr; /* message header */
|
||||
uint32_t request; /* request type */
|
||||
|
||||
} VBI_BSP_MSG;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
VBI_MSG_HEADER hdr; /* message header */
|
||||
uint32_t status; /* request completion status */
|
||||
uint32_t dataVal;
|
||||
} VBI_BSP_MSG_REPLY;
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* wrhvAmpCpuHreg32Set - Init the guestOS of VBI_HREG_SET_CMPLX_QUALIFIED data
|
||||
* structure.
|
||||
*
|
||||
* This function sets the specific parameters which are CPU/Arch dependent
|
||||
* and it will be called by wrhvAmpCpuEnable before resuming the Virtual Board
|
||||
* during the GuestOS wrload operation. Note that the register-width is assumed
|
||||
* to be 32bits.
|
||||
*
|
||||
* ERRNO: - N/A
|
||||
* RETURNS:None
|
||||
* \NOMANUAL
|
||||
*
|
||||
*/
|
||||
|
||||
_WRS_INLINE void wrhvAmpCpuHreg32Set
|
||||
(
|
||||
VBI_HREG_SET_CMPLX_QUALIFIED * pRegSet,
|
||||
FUNCPTR entryPt,
|
||||
vbiGuestPhysAddr_t cfgAddr
|
||||
)
|
||||
{
|
||||
/* Set PC and Arguments in target VB hardware register set */
|
||||
|
||||
pRegSet->vbiRegSet.hreg32.pc = (INSTR *) entryPt;
|
||||
pRegSet->vbiRegSet.hreg32.r[0] = (uint32_t) cfgAddr;
|
||||
}
|
||||
|
||||
#else /*_ASMLANGUAGE */
|
||||
|
||||
#define ARM_IMM #
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* VBI_INT_VCORE_LOCK - lock a core's interrupts macro
|
||||
*
|
||||
* This macro disables the currently running core interrupts and returns the
|
||||
* previous state.
|
||||
*
|
||||
* A hypercall is not needed to perform this operation.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*\cs
|
||||
*
|
||||
* VBI ARM Architecture Supplements
|
||||
*
|
||||
* VBI_INT_VCORE_LOCK (REG0);
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* RETURNS: nonzero if interrupts were locked, otherwise zero
|
||||
*
|
||||
* ERROR CODES: N/A
|
||||
*
|
||||
* SEE ALSO: vbiIntVCoreLock(), vbiIntVCoreUnlock(), vbiIntVCoreStateGet(),
|
||||
* VBI_INT_VCORE_UNLOCK(), VBI_INT_VCORE_STATE_GET()
|
||||
*/
|
||||
|
||||
#define VBI_INT_VCORE_LOCK(reg0, reg1, reg2) \
|
||||
mrs reg0, cpsr; \
|
||||
and reg0, reg0, ARM_IMM (I_BIT | F_BIT); \
|
||||
cpsid if
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VBI_INT_VCORE_UNLOCK - unlock a core's interrupts
|
||||
*
|
||||
* This macro enables a core's interrupts.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*\cs
|
||||
*
|
||||
* VBI ARM Architecture Supplements
|
||||
*
|
||||
* VBI_INT_VCORE_UNLOCK (REG0);
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* RETURNS: N/A
|
||||
*
|
||||
* ERROR CODES: N/A
|
||||
*
|
||||
* SEE ALSO: vbiIntVCoreLock(), vbiIntVCoreUnlock(), vbiIntVCoreStateGet(),
|
||||
* VBI_INT_VCORE_LOCK(), VBI_INT_VCORE_STATE_GET()
|
||||
*/
|
||||
|
||||
#define VBI_INT_VCORE_UNLOCK(reg0, reg1); \
|
||||
cpsie if
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VBI_INT_VCORE_STATE_GET - Get interrupts state
|
||||
*
|
||||
* This macro reads the interrupt state of the currently running core. It uses
|
||||
* a passed in general purpose register to store the current state of interrupts.
|
||||
* The status is nonzero if locked or 0 if not locked.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*\cs
|
||||
*
|
||||
* VBI ARM Architecture Supplements
|
||||
*
|
||||
* VBI_INT_VCORE_STATE_GET (REG0);
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* RETURNS: nonzero if interrupts are locked otherwise zero
|
||||
*
|
||||
* ERROR CODES: N/A
|
||||
*
|
||||
* SEE ALSO: vbiIntVCoreLock(), vbiIntVCoreUnlock(), vbiIntVCoreStateGet(),
|
||||
* VBI_INT_VCORE_LOCK(), VBI_INT_VCORE_UNLOCK()
|
||||
*/
|
||||
|
||||
#define VBI_INT_VCORE_STATE_GET(reg0) \
|
||||
mrs reg0, cpsr; \
|
||||
and reg0, reg0, ARM_IMM (I_BIT | F_BIT)
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VBI_CONFIG_ADDR_GET - Get virtual core configuration structure base address
|
||||
*
|
||||
* This macro returns the base address of the configuration structure of the
|
||||
* running core.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
*\cs
|
||||
*
|
||||
* C Preprocessor Macro for PPC assembly code
|
||||
*
|
||||
* VB_CONFIG * VBI_CONFIG_ADDR_GET (void)
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* RETURNS: virtual core configuration structure base address
|
||||
*
|
||||
* ERROR CODES: N/A
|
||||
*
|
||||
* SEE ALSO:
|
||||
*/
|
||||
|
||||
#define VBI_CONFIG_ADDR_GET(reg) \
|
||||
ldr reg, =wrhvVbConfig; \
|
||||
ldr reg, [reg]
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VBI_CNTRL_ADDR_GET - Get virtual core control structure base address
|
||||
*
|
||||
* This macro returns the base address of the running virtual core's control
|
||||
* structure.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
*\cs
|
||||
*
|
||||
* C Preprocessor Macro
|
||||
*
|
||||
* VB_CONTROL * VBI_CNTRL_ADDR_GET (void)
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* RETURNS: N/A
|
||||
*
|
||||
* ERROR CODES: N/A
|
||||
*
|
||||
* SEE ALSO:
|
||||
*/
|
||||
|
||||
#define VBI_CNTRL_ADDR_GET(reg) \
|
||||
ldr reg, =wrhvVbControl; \
|
||||
ldr reg, [reg]
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VBI_STATUS_ADDR_GET - Get virtual core status structure address
|
||||
*
|
||||
* This macro returns the base address of the status structure of currently
|
||||
* running core. This structure is read-only and contains a description of
|
||||
* the running virtual core. Hypervisor uses this data to inform the
|
||||
* virtual board time variant data that may be updated during hypervisor context
|
||||
* Switch. Typical that are available in the status structure are:
|
||||
*
|
||||
*\ms
|
||||
*\m -
|
||||
*Timer tick counter
|
||||
*\m -
|
||||
*Pending interrupt state
|
||||
*\m -
|
||||
*The interrupt state before this core was schedule
|
||||
*\m -
|
||||
*VMMU configuration
|
||||
*\m -
|
||||
*Virtual core registers state
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
*\cs
|
||||
*
|
||||
* C Preprocessor Macro
|
||||
*
|
||||
* VB_STATUS * VBI_STATUS_ADDR_GET(void)
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* RETURNS: virtual core configuration structure base address
|
||||
*
|
||||
* ERROR CODES: N/A
|
||||
*
|
||||
* SEE ALSO:
|
||||
*/
|
||||
|
||||
#define VBI_STATUS_ADDR_GET(reg) \
|
||||
ldr reg, =wrhvVbStatus; \
|
||||
ldr reg, [reg]
|
||||
|
||||
#endif /*_ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __INCvbiPpcArchh */
|
||||
@@ -0,0 +1,83 @@
|
||||
/* vbiCoreSet.h - macros to manipulate vbiCoreSet_t type */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01a,09jun09,mmi written
|
||||
*/
|
||||
|
||||
#ifndef __INCvbivbiCoreSeth
|
||||
#define __INCvbivbiCoreSeth
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
# /* __cplusplus */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
/* set of macros to manipulate the coreset_t type */
|
||||
|
||||
#define CORESET_COPY(coreSetDst, coreSetSrc) (coreSetDst = coreSetSrc)
|
||||
#define CORESET_ISZERO(coreset) (coreset == 0 ? TRUE : FALSE)
|
||||
#define CORESET_SET(coreset, n) (coreset |= (1 << n))
|
||||
#define CORESET_ISSET(coreset, n) (coreset & (1 << n))
|
||||
#define CORESET_CLR(coreset, n) (coreset &= ~(1 << n))
|
||||
#define CORESET_ZERO(coreset) (coreset = 0)
|
||||
|
||||
#define CORESET_FIRST_SET(coreset) ((int)coreset & (int)-coreset)
|
||||
#define CORESET_FIRST_INDEX(coreset) (FFS_LSB (coreset) - 1)
|
||||
#define CORESET_ADD(coresetAugend,coresetAddend) (coresetAugend |= coresetAddend)
|
||||
#define CORESET_SUB(coresetMinuend,coresetSubtrahend) \
|
||||
(coresetMinuend &= ~coresetSubtrahend)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCvbivbiCoreSeth */
|
||||
@@ -0,0 +1,54 @@
|
||||
/* vbiDeviceConfig.h - Device Configuration VBI */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01d,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
01c,01jun10,mmi fix file name
|
||||
01b,21may10,mpk add DeviceTreeSource VBI calls
|
||||
01a,12apr10,mpk created
|
||||
*/
|
||||
|
||||
/* DESCRIPTION
|
||||
*
|
||||
* VBI calls used by Guest OSs to discover Guest Devices
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiDeviceConfigh
|
||||
#define __INCvbiDeviceConfigh
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
extern uint32_t vbiDeviceCount (void);
|
||||
extern status_t vbiDeviceGet (uint32_t deviceIndex, VB_DEV_INFO **vbiDevInfo);
|
||||
extern vbiStatus_t vbiDeviceInterruptGet (uint32_t deviceIndex,
|
||||
uint32_t intIndex,
|
||||
VB_DEV_INT_INFO **vbiIntDetails);
|
||||
extern vbiStatus_t vbiDeviceRegisterSetGet (uint32_t deviceIndex,
|
||||
uint32_t regSetIndex,
|
||||
VB_DEV_REGSET_INFO **vbiRegSetDetails);
|
||||
extern vbiStatus_t vbiDeviceDeviceTreeSourceGet (uint32_t deviceIndex,
|
||||
uint32_t deviceTreeSourceIndex,
|
||||
VB_DEV_DEVICETREESOURCE_INFO **vbiDeviceTreeSourceDetails);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCvbiDeviceConfigh */
|
||||
@@ -0,0 +1,102 @@
|
||||
/* vbiDynamicVb.h - Dynamic VB VBI interface */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01d,11nov11,c_t sync with HV2.0 23-sept-11 DVD.
|
||||
01c,21sep11,c_t mod for VBI subset for Cert Profile.
|
||||
01b,08feb11,jlv Sync with HV 1.3 04-Feb-11
|
||||
01a,12nov10,dtr written
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiDynamicVbh
|
||||
#define __INCvbiDynamicVbh
|
||||
|
||||
#include <wrhv/vbiTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
/* Cert Profile does not support dynamic VB. */
|
||||
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) &&\
|
||||
!defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
|
||||
#ifndef VB_ALIGN_FIELD_64
|
||||
#if defined(_WRS_CONFIG_LP64)
|
||||
# define VB_ALIGN_FIELD_64(decl_var, pad_var) \
|
||||
__attribute__(( aligned(8) )) \
|
||||
decl_var
|
||||
#else
|
||||
# if (__VBI_BYTE_ORDER == __VBI_LITTLE_ENDIAN)
|
||||
# define VB_ALIGN_FIELD_64(decl_var, pad_var) \
|
||||
__attribute__(( aligned(8) )) \
|
||||
decl_var; \
|
||||
uint32_t pad_var
|
||||
# else
|
||||
# define VB_ALIGN_FIELD_64(decl_var, pad_var) \
|
||||
__attribute__(( aligned(8) )) \
|
||||
uint32_t pad_var; \
|
||||
decl_var
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef uint64_t virtAddr_t;
|
||||
typedef vbPciDevice_t vbiPciDevice_t;
|
||||
|
||||
/* This returns only the simple contiguous data */
|
||||
vbiStatus_t vbiBoardSimpleConfigGet (vbiVb_t vbId,
|
||||
vbSimpleInformation_t *pVbInfo);
|
||||
|
||||
/* this returns also the complex data that has variable sixe e.g.device list */
|
||||
vbiStatus_t vbiBoardConfigGet (vbiVb_t vbId,
|
||||
vbInformation_t *pVbInfo);
|
||||
|
||||
vbiVb_t vbiVbCreate(vbInformation_t *pVbInfo, uint32_t options);
|
||||
vbiStatus_t vbiVbDelete(vbiVb_t vbId);
|
||||
|
||||
/* Additive/Subtractive - i.e. not in zombie configuration */
|
||||
vbiStatus_t vbiVbSharedMemoryAlloc(vbiVb_t vbId, vbiName_t smRegionName,
|
||||
virtAddr_t *va, size_t size);
|
||||
vbiStatus_t vbiVbSharedMemoryFree(vbiVb_t vbId, vbiName_t smRegionName,
|
||||
virtAddr_t va);
|
||||
vbiStatus_t vbiVbRamAlloc(vbiVb_t vbId, virtAddr_t *va, size_t size);
|
||||
vbiStatus_t vbiVbRamFree(vbiVb_t vbId, virtAddr_t va);
|
||||
|
||||
/* Vb Core Migration */
|
||||
|
||||
/* Information can be optained for the Virtual boards such as prio and
|
||||
* present Cpu using vbiBoardConfigGet() */
|
||||
vbiStatus_t vbiVbMove(vbiVb_t vbId, uint32_t *pCpuList,
|
||||
uint32_t options);
|
||||
|
||||
#define VBIMOVE_OPTION_RESUME 0
|
||||
#define VBIMOVE_OPTION_NO_RESUME 1
|
||||
|
||||
vbiStatus_t vbiVbPrioritySet(vbiVb_t vbId, uint32_t *pCpuPriorityList,
|
||||
uint32_t options);
|
||||
|
||||
#define VBIPRIOSET_OPTION_RESUME 0
|
||||
#define VBIPRIOSET_OPTION_NO_RESUME 1
|
||||
|
||||
#endif /* _WRS_CONFIG_WRHV_GUEST_CERT & DEBUG */
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
/* vbiErrors.h - vbi errors */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009-2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01f,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
01e,26may10,jl Sync with HV 1.2 25-May-10
|
||||
01d,29apr10,pad Moved extern C statement after include statements.
|
||||
01c,16jul09,to not used for VBI 1.0
|
||||
add vbi memory errors
|
||||
01b,13jul09,to add vbMgmt error numbers from v01d for HV 1.1
|
||||
01a,29jun09,to created from vbiErrors.h, v01c for HV 1.1
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiErrorsh
|
||||
#define __INCvbiErrorsh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
#include <wrhv/vbiVersion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define VBI_ERRORS_START (0)
|
||||
|
||||
/* generic vbi errors */
|
||||
|
||||
#define VBI_INVALID_VERSION (VBI_ERRORS_START + (-1))
|
||||
#define VBI_INVALID_IRQ (VBI_ERRORS_START + (-2))
|
||||
#define VBI_INVALID_SHMEM (VBI_ERRORS_START + (-3))
|
||||
#define VBI_INVALID_MEM (VBI_ERRORS_START + (-4))
|
||||
|
||||
/* vbi Exceptions error */
|
||||
|
||||
#define VBI_EXC_ERROR_START (VBI_ERRORS_START + (-1000))
|
||||
#define VBI_EXCBASE_SET_ERROR (VBI_EXC_ERROR_START + (-1))
|
||||
|
||||
/* VIOAPIC errors */
|
||||
|
||||
#define VBI_VIOAPIC_ERROR_START (VBI_EXC_ERROR_START + (-100))
|
||||
#define VBI_VIOAPIC_NULL (VBI_VIOAPIC_ERROR_START + (-1))
|
||||
#define VBI_VIOAPIC_IRQ_OUTBOUND (VBI_VIOAPIC_ERROR_START + (-2))
|
||||
#define VBI_VIOAPIC_IRQ_INVALID_DIR (VBI_VIOAPIC_ERROR_START + (-3))
|
||||
#define VBI_VIOAPIC_UNAVAIL (VBI_VIOAPIC_ERROR_START + (-4))
|
||||
|
||||
/* VB MANAGEMENT errors */
|
||||
|
||||
#define VBI_VBMGMT_ERROR_START (VBI_VIOAPIC_ERROR_START + (-100))
|
||||
#define VBI_ERR_VBMGMT_VB_INVALID (VBI_VBMGMT_ERROR_START + (-1))
|
||||
#define VBI_ERR_VBMGMT_INVALID_ARG (VBI_VBMGMT_ERROR_START + (-2))
|
||||
#define VBI_ERR_VBMGMT_RESET_FAILED (VBI_VBMGMT_ERROR_START + (-3))
|
||||
#define VBI_ERR_VBMGMT_CTX_INVALID (VBI_VBMGMT_ERROR_START + (-4))
|
||||
|
||||
/* VB Device Driver errors */
|
||||
|
||||
#define VBI_DEVDRV_ERROR_START (VBI_VBMGMT_ERROR_START + (-100))
|
||||
#define VBI_ERR_ADD_RETRY (VBI_DEVDRV_ERROR_START + (-1))
|
||||
#define VBI_ERR_DEVDRV_NULL_NAME (VBI_DEVDRV_ERROR_START + (-2))
|
||||
#define VBI_ERR_DEVDRV_NULL_HANDLE (VBI_DEVDRV_ERROR_START + (-3))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCvbiVersionh */
|
||||
@@ -0,0 +1,47 @@
|
||||
/* vbiInterrupt.h - WR Hypervisor virtual interrupt utility functions */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2010 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01i,35may10,jl Remove vbiVersion=1 interface
|
||||
01h,29apr10,pad Moved extern C statement after include statements.
|
||||
01g,15jul09,to fix VBI 1.0 support
|
||||
01f,30jun09,to VBI 2.0 support
|
||||
01e,16dec08,to modified for vxWorks
|
||||
01d,20nov08,mmi adopt new naming convention
|
||||
01c,04sep08,dcc modified vbiIntConnect() signature
|
||||
01b,27nov07,foo fix parameter
|
||||
01a,25may07,foo written
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiInterrupth
|
||||
#define __INCvbiInterrupth
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
#include <wrhv/vbiVersion.h>
|
||||
#include <wrhv/vbInterface.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
extern vbiIrq_t vbiIntVecFind (char * intName, int32_t intDirection);
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCvbiInterrupth */
|
||||
@@ -0,0 +1,279 @@
|
||||
/* vbiPdc.h - Process Data Channel definitions */
|
||||
|
||||
/*
|
||||
* Copyright 2009-2012 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01g,17feb12,c_t Sync with HV 2.0 27-Jan-12 DVD
|
||||
01f,16jun11,jlv WIND00282402 revert deviceChannel vbi change
|
||||
01e,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
01d,03nov10,rab workaround 6.9 compiler alignment problem
|
||||
01c,20apr10,mpk add documentation for device driver api
|
||||
01b,18dec09,mpk remove device specific info from IDC
|
||||
01a,15sep09,mpk created
|
||||
*/
|
||||
|
||||
/* DESCRIPTION
|
||||
*
|
||||
* Message format for Process Data Channel (PDC)
|
||||
* from Stub Device Driver (SDD)
|
||||
* to Actual Device Driver Guest Interface (ADD-GI)
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiPdch
|
||||
#define __INCvbiPdch
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
typedef void * VOID_PTR;
|
||||
|
||||
typedef VBI_NS_HANDLE VBI_PDC_HANDLE;
|
||||
|
||||
typedef struct vbi_msg_hdr
|
||||
{
|
||||
uint32_t msgId; /* message type identification */
|
||||
uint32_t msgArg; /* argument associated with message type */
|
||||
} VBI_MSG_HDR;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MSG_PDC - process data channel PDC message format
|
||||
*
|
||||
* MSG_PDC is a C data type structure that provides the definition of the
|
||||
* message format used to communicate between the stub device driver (SDD)
|
||||
* and the Actual Device Driver (ADD).
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
*\cs
|
||||
* typedef struct
|
||||
* {
|
||||
* MSG_HEADER hdr; /@ message header @/
|
||||
* VB_ALIGN_FIELD_64 (void *buf, pad1);
|
||||
* VB_ALIGN_FIELD_64 (size_t buflen, pad2);
|
||||
* uint16_t request; /@ request type @/
|
||||
* uint16_t op; /@ request type @/
|
||||
* #ifdef DEV_ASYNC_IOCTL
|
||||
* VB_ALIGN_FIELD_64 (uint64_t token, pad3); /@ token @/
|
||||
* #endif
|
||||
* } MSG_PDC;
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
* The type of operations supported are
|
||||
*
|
||||
*
|
||||
*\cs
|
||||
*
|
||||
* * PDC_REQUEST_IOCTL
|
||||
*
|
||||
* * PDC_REQUEST_READ
|
||||
*
|
||||
* * PDC_REQUEST_WRITE
|
||||
*
|
||||
* * PDC_REQUEST_INIT
|
||||
*
|
||||
*\ce
|
||||
*
|
||||
*
|
||||
* SEE ALSO:
|
||||
*\COMMAND
|
||||
* This is a hypervisor PRIVATE data structure, hence marking it as
|
||||
* NOMANUAL to drop it from BSP guide documentation.
|
||||
*
|
||||
* \NOMANUAL
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
VBI_MSG_HDR hdr; /* message header */
|
||||
VB_ALIGN_FIELD_64 (VOID_PTR buf, pad1);
|
||||
VB_ALIGN_FIELD_64 (size_t buflen, pad2);
|
||||
uint16_t request; /* request type */
|
||||
uint16_t op; /* request type */
|
||||
#ifdef DEV_ASYNC_IOCTL
|
||||
VB_ALIGN_FIELD_64 (uint64_t token, pad3); /* token */
|
||||
#endif
|
||||
} MSG_PDC;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MSG_PDC_REPLY - process data channel PDC message reply format
|
||||
*
|
||||
* MSG_PDC is a C data type structure that provides the definition of the
|
||||
* message reply format used to communicate to the stub device driver (SDD)
|
||||
* from the Actual Device Driver (ADD).
|
||||
*
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
*\cs
|
||||
*
|
||||
* typedef struct
|
||||
* {
|
||||
* MSG_HEADER hdr; /@ message header @/
|
||||
* uint32_t status; /@ request completion status @/
|
||||
* uint32_t dataVal;
|
||||
* } MSG_PDC_REPLY;
|
||||
*\ce
|
||||
*
|
||||
* SEE ALSO:
|
||||
*\COMMAND
|
||||
* This is a hypervisor PRIVATE data structure, hence marking it as
|
||||
* NOMANUAL to drop it from BSP guide documentation.
|
||||
*
|
||||
* \NOMANUAL
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
VBI_MSG_HDR hdr; /* message header */
|
||||
uint32_t status; /* request completion status */
|
||||
uint32_t dataVal;
|
||||
} MSG_PDC_REPLY;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* intrDeviceChannelBuffer - IDC Buffer
|
||||
*
|
||||
* IDC Buffer is a C data type structure that provides the definition of the
|
||||
* interrupt device channel used by Hypervisor to pass information back to
|
||||
* Stub device driver as a result of interrupt operation.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
*
|
||||
*\cs
|
||||
*
|
||||
* #ifdef DEV_ASYNC_IOCTL
|
||||
* typedef struct
|
||||
* {
|
||||
* void * buf;
|
||||
* uint64_t token;
|
||||
* VB_ALIGN_FIELD_64 (uint32_t op, pad7);
|
||||
* } ioctlOp;
|
||||
* #endif /@ DEV_ASYNC_IOCTL @/
|
||||
*
|
||||
* typedef struct intrDeviceChannelBuffer_
|
||||
* {
|
||||
* VB_ALIGN_FIELD_64 (void *rxBuf, pad1); /@ rx buffer to receive @/
|
||||
* VB_ALIGN_FIELD_64 (size_t rxBufLen, pad2); /@ rx buffer length @/
|
||||
* VB_ALIGN_FIELD_64 (void *txBuf, pad3); /@ tx buffer to transmit @/
|
||||
* VB_ALIGN_FIELD_64 (size_t txBufLen, pad4); /@ tx buffer length @/
|
||||
* uint32_t rxBufRdPtr; /@ rx buffer read pointer @/
|
||||
* uint32_t rxBufWrPtr; /@ rx buffer write pointer @/
|
||||
* uint32_t txBufRdPtr; /@ tx buffer read pointer @/
|
||||
* uint32_t txBufWrPtr; /@ tx buffer write pointer @/
|
||||
* uint32_t intStatus; /@ intStatus, or what intr @/
|
||||
* #ifdef DEV_ASYNC_IOCTL
|
||||
* VB_ALIGN_FIELD_64 (ioctlOp *ioctlBuf, pad5); /@ ioctl buffer to receive @/
|
||||
* VB_ALIGN_FIELD_64 (size_t ioctlBufLen, pad6); /@ ioctl buffer length @/
|
||||
* uint64_t ioctlBufRdPtr; /@ ioctl buffer read pointer @/
|
||||
* uint64_t ioctlBufWrPtr; /@ ioctl buffer write pointer @/
|
||||
* #endif
|
||||
* } intrDeviceChannelBuffer;
|
||||
*\ce
|
||||
*
|
||||
* RETURNS: N/A
|
||||
*
|
||||
* SEE ALSO:
|
||||
*\COMMAND
|
||||
*/
|
||||
|
||||
#ifdef DEV_ASYNC_IOCTL
|
||||
typedef struct
|
||||
{
|
||||
VOID_PTR buf;
|
||||
uint64_t token;
|
||||
VB_ALIGN_FIELD_64 (uint32_t op, pad7);
|
||||
} ioctlOp;
|
||||
#endif /* DEV_ASYNC_IOCTL */
|
||||
|
||||
typedef struct intrDeviceChannelBuffer_
|
||||
{
|
||||
/*
|
||||
* From here down to intStatus things have to be the same as those of
|
||||
* intrDeviceChannelBuffer in HY wrhvDevCore.h.
|
||||
* One same struct may be read, shared in both VB and HY.
|
||||
*/
|
||||
VB_ALIGN_FIELD_64 (VOID_PTR rxBuf, pad1); /* rx buffer to receive */
|
||||
VB_ALIGN_FIELD_64 (size_t rxBufLen, pad2); /* rx buffer length */
|
||||
VB_ALIGN_FIELD_64 (VOID_PTR txBuf, pad3); /* tx buffer to transmit */
|
||||
VB_ALIGN_FIELD_64 (size_t txBufLen, pad4); /* tx buffer length */
|
||||
uint32_t rxBufRdPtr; /* rx buffer read pointer */
|
||||
uint32_t rxBufWrPtr; /* rx buffer write pointer */
|
||||
uint32_t txBufRdPtr; /* tx buffer read pointer */
|
||||
uint32_t txBufWrPtr; /* tx buffer write pointer */
|
||||
uint32_t intStatus; /* intStatus, or what intr */
|
||||
#ifdef DEV_ASYNC_IOCTL
|
||||
VB_ALIGN_FIELD_64 (ioctlOp *ioctlBuf, pad5); /* ioctl buffer to receive */
|
||||
VB_ALIGN_FIELD_64 (size_t ioctlBufLen, pad6); /* ioctl buffer length */
|
||||
uint64_t ioctlBufRdPtr; /* ioctl buffer read pointer */
|
||||
uint64_t ioctlBufWrPtr; /* ioctl buffer write pointer */
|
||||
#endif
|
||||
} intrDeviceChannelBuffer;
|
||||
|
||||
typedef struct pdc_buf_set
|
||||
{
|
||||
uint64_t gpaBufBase;
|
||||
uint64_t gpaBufLen;
|
||||
} PDC_BUF_SET;
|
||||
|
||||
#define SYS_PDC_REQUEST_OK 0
|
||||
#define SYS_PDC_REQUEST_FAILED -1
|
||||
|
||||
#define PDC_IOCTL_SIO_BAUD_SET 1
|
||||
#define PDC_IOCTL_SIO_MODE_SET 2
|
||||
#define PDC_IOCTL_SIO_HW_OPTS_SET 3
|
||||
#define PDC_IOCTL_SIO_HUP 4
|
||||
#define PDC_IOCTL_SIO_OPEN 5
|
||||
#define PDC_IOCTL_BUF_GPA_GET 10
|
||||
#define PDC_IOCTL_BUF_GPA_SET 11
|
||||
#define PDC_IOCTL_BUF_SIZE_GET 12
|
||||
|
||||
#define PDC_IOCTL_AMIO_CHANNEL_SET 20
|
||||
|
||||
#define PDC_IOCTL_SIO_REQUEST_RESPONSE 0x8000
|
||||
#define PDC_IOCTL_SIO_GET_IER (PDC_IOCTL_SIO_REQUEST_RESPONSE | 2)
|
||||
|
||||
|
||||
typedef enum vbiPdcRequest {
|
||||
PDC_REQUEST_MIN = 1,
|
||||
PDC_REQUEST_IOCTL = 1,
|
||||
PDC_REQUEST_READ = 2,
|
||||
PDC_REQUEST_WRITE = 3,
|
||||
PDC_REQUEST_INIT = 4,
|
||||
PDC_REQUEST_ATTACH_GUEST = 5,
|
||||
PDC_REQUEST_DETACH_GUEST = 6,
|
||||
PDC_REQUEST_CORE_MSG = 7,
|
||||
PDC_REQUEST_MAX = 7
|
||||
} VBI_PDC_REQUEST_TYPE;
|
||||
|
||||
extern vbiStatus_t vbiPdcOp (VBI_PDC_HANDLE pdcHandle,
|
||||
VBI_PDC_REQUEST_TYPE requestType,
|
||||
uint32_t ioctlOp,
|
||||
void *bufferPtr,
|
||||
size_t bufferLen,
|
||||
uint64_t token);
|
||||
|
||||
extern vbiStatus_t vbiPdcInit(const char *instanceName,
|
||||
VBI_PDC_HANDLE *pPdcHandle);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCvbipdch */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,100 @@
|
||||
/* vbiPrv.h - virtual board interface private definitions */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009-2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01g,18apr11,wqi VBI subset for CERT hypervisor.
|
||||
01f,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
01e,24may10,jl Sync with HV 1.2 25-May-10
|
||||
01d,03mar10,rgo Add vbiVbRemote prototype
|
||||
01c,22sep09,d_c Defect WIND00183017 Fix WIND00183019 - sync with 18-Sep HV
|
||||
DVD
|
||||
01b,13jul09,to changes from v01b for HV 1.1
|
||||
01a,03jul09,mmi written
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiPrvh
|
||||
#define __INCvbiPrvh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
#include <wrhv/vbiVersion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
_WRS_INLINE vbiStatus_t _vbiStrncmp
|
||||
(
|
||||
const char * s1,
|
||||
const char * s2,
|
||||
size_t n
|
||||
)
|
||||
{
|
||||
if (n == 0)
|
||||
return (0);
|
||||
|
||||
while (*s1++ == *s2++)
|
||||
{
|
||||
if ((s1 [-1] == EOS) || (--n == 0))
|
||||
return (0);
|
||||
}
|
||||
|
||||
return ((s1 [-1]) - (s2 [-1]));
|
||||
}
|
||||
|
||||
/* private ioapic operator */
|
||||
|
||||
extern vbiStatus_t vbiIoapicOp (uint32_t ioctl, vbiIrq_t irq, uint32_t filter,
|
||||
vbiVb_t vbId);
|
||||
|
||||
/* private interrupt redirection operator */
|
||||
|
||||
extern vbiStatus_t vbiVcoreIntRed_op (vbiIrq_t irq, vbiCore_t CoreId);
|
||||
|
||||
/* Name service private operator */
|
||||
|
||||
extern vbiStatus_t vbiNsOp (uint32_t op, char* name, uint32_t rev,
|
||||
VBI_NS_HANDLE *handle, uint32_t timeout,
|
||||
uint32_t options);
|
||||
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) && !defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
|
||||
/* Message receive private operator */
|
||||
|
||||
extern vbiStatus_t vbiReceiveOp
|
||||
(
|
||||
void *rmsg, /* pointer to message to receive */
|
||||
uint32_t rlen, /* length of message to receive */
|
||||
VBI_MSG_INFO *info, /* status info structure pointer */
|
||||
VBI_MSG_CTL *ctl /* control data structure pointer */
|
||||
);
|
||||
|
||||
/* Remote VB private operator */
|
||||
|
||||
extern vbiStatus_t vbiVbRemote
|
||||
(
|
||||
uint32_t op, /* VB Remote operation */
|
||||
vbiVb_t boardID, /* Board ID */
|
||||
vbiCore_t coreID, /* Core ID */
|
||||
vbiGuestPhysAddr_t * out /* Pointer to store return value */
|
||||
);
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT && !_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG */
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCvbiPrvh */
|
||||
@@ -0,0 +1,118 @@
|
||||
/* vbiShmem.h - Virtual Interface memory utility functions */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2012 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01o,16aug12,c_t delete vbiVbRamSizeFind for safety profile.WIND00369921
|
||||
01n,07may12,c_t Add support for 64bit MIPC 3.0.
|
||||
01m,28mar11,jlv Add new prototype for WIND00262654
|
||||
01l,24may10,jl Sync with HV 1.2 25-May-10
|
||||
01k,29apr10,pad Moved extern C statement after include statements.
|
||||
01j,03mar10,rgo sync with hv1.2 3/3/10
|
||||
01i,18aug09,d_c Sync with HV 1.1 14-Aug-09 DVD
|
||||
HV 01g,14jul09,mmi update with vbiStatus_t return type
|
||||
01h,17jul09,to change return type for VBI 2.0 (from v01g for HV 1.1)
|
||||
01g,13jul09,to add private memory function (from v01f for HV 1.1)
|
||||
01f,16dec08,to modified for vxWorks
|
||||
01e,12dec08,mmi replace razor with wrhv
|
||||
01d,11dec08,mmi use typedef's instead natives
|
||||
01c,20nov08,mmi adopt new naming convention
|
||||
01b,26nov07,foo update prototype
|
||||
01a,25may07,foo written
|
||||
*/
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
|
||||
This header file declares the vbi API for managing memory regions
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiShmemh
|
||||
#define __INCvbiShmemh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
#include <wrhv/vbiVersion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
/* type defines */
|
||||
|
||||
typedef struct vbiShmemMapInfo
|
||||
{
|
||||
void* gpa; /* guest physical address */
|
||||
void* gva; /* guest virtual address */
|
||||
uint64_t length; /* memory region length */
|
||||
} VBI_SHMEM_MAP_INFO;
|
||||
|
||||
/* externs */
|
||||
|
||||
extern void vbiShmemInfoInit (void);
|
||||
|
||||
extern vbiStatus_t vbiShmemInfoRec
|
||||
(
|
||||
void * gpa, /* start guest physical address */
|
||||
void * gva, /* start guest virtual address */
|
||||
uint32_t length /* region length */
|
||||
);
|
||||
|
||||
extern vbiStatus_t vbiShmemFindGVAByGPA
|
||||
(
|
||||
void * gpa, /* guest physical address */
|
||||
void ** gva /* guest virtual address,output */
|
||||
);
|
||||
|
||||
extern vbiStatus_t vbiShmemRegionFind
|
||||
(
|
||||
int8_t * smName, /* String name of the region */
|
||||
void * * addr, /* Location - OUT */
|
||||
uint32_t * length, /* Length - OUT */
|
||||
uint32_t * attr /* MMU Attributes - OUT */
|
||||
);
|
||||
|
||||
extern vbiStatus_t vbiMemRegionFind
|
||||
(
|
||||
int8_t * name, /* String name of the region */
|
||||
void * * addr, /* Location - OUT */
|
||||
uint32_t * length, /* Length - OUT */
|
||||
uint32_t * attr /* MMU Attributes - OUT */
|
||||
);
|
||||
|
||||
/* find the base address and length of a core's private memory */
|
||||
|
||||
extern vbiStatus_t vbiCorePrvMemFind (void * * addr, size_t * length);
|
||||
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) && \
|
||||
!defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
extern vbiStatus_t vbiVbRamSizeFind
|
||||
(
|
||||
vbiVb_t boardID,
|
||||
size_t * physicalMemorySize
|
||||
);
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT && !_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG */
|
||||
|
||||
/* convert WRHV MMU attributes to vmLib vxWorks attributes */
|
||||
|
||||
extern UINT vbiWrhvMmuAttrToVmLibAttr (uint32_t attr);
|
||||
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCvbiShmemh */
|
||||
@@ -0,0 +1,303 @@
|
||||
/* vbiSyscall.h - hypervisor system calls */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2012 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
02z,17feb12,c_t sync with HV 2.0 27-jan-12 DVD
|
||||
02y,18sep11,wqi VBI subset for CERT hypervisor.
|
||||
02x,07sep11,m_h Sync with HV 1.3.1.1 02-Sept-11 DVD
|
||||
02w,04apr11,jlv Sync with HV 1.3 01-Apr-11 (WIND00265419)
|
||||
02v,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
02u,27jan11,jlv Fix apigen issues
|
||||
02t,03nov10,rab workaround 6.9 compiler alignment issue
|
||||
02s,24may10,jl Sync with HV 1.2 25-May-10
|
||||
02r,29apr10,pad Moved extern C statement after include statements.
|
||||
02q,22mar10,wap Add vbiDirectInterruptEOI() for direct interrupt support
|
||||
02p,03mar10,rgo Sync-up with hv1.2 view on 3/3/10.
|
||||
02o,30nov09,jl Sync with HV 1.1 04-Dec-09 DVD
|
||||
02n,23oct09,jl Sync with HV 1.1 30-Oct-09 DVD
|
||||
02m,22sep09,d_c Defect WIND00183017 Fix WIND00183019 - sync with 18-Sep HV
|
||||
DVD
|
||||
02l,18aug09,d_c Sync with HV 1.1 14-Aug-09 DVD
|
||||
HV vbiSyscall.h version 02p,12aug09,dtr
|
||||
Update vbiHyIoctl API to add additional argument.
|
||||
02k,02aug09,jl support vbi register read, write
|
||||
02k,22jul09,d_c Add prototype for vbiKputc
|
||||
02j,13jul09,to changes from v02n for HV 1.1
|
||||
02i,01jul09,to VBI 2.0 APIs from vbiSyscall.h, v02m for HV 1.1
|
||||
02h,25feb09,mmi keep hypervisor definitions in a separate header file
|
||||
02g,05feb09,to vbiMgmt to vbiVbMgmt
|
||||
02f,29jan09,rec add MDIO macro definitions
|
||||
02e,17dec08,to modified for vxWorks
|
||||
02d,12dec08,md rename header files
|
||||
02c,05dec08,mes Removed shelf macros, added vbMgmt macros
|
||||
02b,01dec08,md add VBI_IOAPICIOCTL_SEND options
|
||||
02a,21nov08,md remove port and ED&R syscalls
|
||||
01z,20nov08,mmi adtopt new naming convention
|
||||
01y,31oct08,dbt Added vdkVtlbMmuOp hypercall.
|
||||
01x,16jun08,mmi fix vdkBspIoctl prototype
|
||||
01w,19may08,gws add vIoapicIoctl
|
||||
01v,18apr08,md add extra arg to vdkHyioctl
|
||||
01u,11apr08,md add EOI ioctl
|
||||
01t,06mar08,md add debug shell ioctl
|
||||
01s,06dec07,foo update hw ints
|
||||
01r,23nov07,foo fix prototype, use basic types
|
||||
01q,25oct07,foo updated with new vdk functions
|
||||
01p,27sep07,md added exception profiling fields
|
||||
01o,26sep07,md added profiling statistics and stats ioctl
|
||||
01n,10sep07,md re-number hypervisor system calls
|
||||
01m,21aug07,md added VDK_SYS_ctx_load_vmmu
|
||||
01l,05jul07,foo added bspIoctl calls and defines
|
||||
01k,04jun07,md added ctxctl and mmu system calls
|
||||
01j,17may07,ymz added port syscall.
|
||||
01i,28may07,foo update vdkInt prototype
|
||||
01h,18may07,md add hypervisor ioctl
|
||||
01g,20apr07,md add vmmu system calls
|
||||
01f,18apr07,md renamed to vdk
|
||||
01e,10apr07,md replace kprintf syscall with kputs and kputc
|
||||
01d,19mar07,foo fix macro
|
||||
01c,17mar07,foo modify definitions to all start with HY
|
||||
01b,15mar07,md added interrupt system calls
|
||||
01a,09mar07,md written
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiSyscallh
|
||||
#define __INCvbiSyscallh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
#include <wrhv/vbiVersion.h>
|
||||
#include <wrhv/vbiTypes.h>
|
||||
#include <wrhv/wrhvHypercalls.h>
|
||||
#include <wrhv/vbiArch.h>
|
||||
#include <wrhv/vbInterface.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
typedef void * VOID_PTR;
|
||||
|
||||
/* Forward declaration */
|
||||
struct vmmuConfig;
|
||||
#ifndef __cplusplus
|
||||
struct VB_ARCH_CONTROL_REGS;
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* information about incoming message */
|
||||
|
||||
typedef struct vbiMsgInfo {
|
||||
vbiCtx_t id; /* context id of sender */
|
||||
uint32_t type; /* message type (msg/event) */
|
||||
uint64_t slen; /* length of sent buffer */
|
||||
uint64_t rlen; /* length of received buffer */
|
||||
uint16_t status; /* message status information */
|
||||
uint16_t error; /* extended error status */
|
||||
uint64_t timestamp; /* time message was sent */
|
||||
uint32_t nmsg; /* number of queued msgs remaining */
|
||||
} __attribute__((packed)) VBI_MSG_INFO;
|
||||
|
||||
/* message status bits as reported in the "status" field */
|
||||
|
||||
#define VBI_MSG_STATUS_OK 0 /* message was transferred ok */
|
||||
#define VBI_MSG_STATUS_TRUNCATED 1 /* message was truncated */
|
||||
#define VBI_MSG_STATUS_COPY_ERROR 2 /* message wasn't able to be copied */
|
||||
|
||||
/* extended error codes reported in "error" field */
|
||||
|
||||
#define VBI_MSG_ERROR_INTLEVEL 1 /* operation not allowed at int lvl */
|
||||
#define VBI_MSG_ERROR_BAD_ID 2 /* bad context id specified */
|
||||
#define VBI_MSG_ERROR_ABORTED 3 /* operation aborted */
|
||||
#define VBI_MSG_ERROR_TIMEOUT 4 /* operation timed out */
|
||||
#define VBI_MSG_ERROR_XCALL 5 /* cross call to remote cpu failed */
|
||||
#define VBI_MSG_ERROR_UNSUPPORTED 6 /* the operation not allowed */
|
||||
|
||||
/* message types as reported in the "type" field */
|
||||
|
||||
#define VBI_MSG_TYPE_REGULAR 1 /* regular message */
|
||||
#define VBI_MSG_TYPE_EVENT 2 /* event message */
|
||||
#define VBI_MSG_TYPE_REPLY 3 /* reply message */
|
||||
|
||||
/* modifiers for message processing */
|
||||
|
||||
typedef struct vbiMsgCtl {
|
||||
uint32_t flags; /* operation flags */
|
||||
uint32_t ordering; /* order to receive messages */
|
||||
uint64_t timeout; /* receive timeout */
|
||||
} __attribute__((packed)) VBI_MSG_CTL;
|
||||
|
||||
/* message control flags */
|
||||
#define VBI_MSG_CTL_FLAG_RETRY 1
|
||||
|
||||
/* memory read/write control structure */
|
||||
|
||||
typedef struct vbiMemCtl
|
||||
{
|
||||
VB_ALIGN_FIELD_64 (VOID_PTR pBuffer, pad1); /* address of target context */
|
||||
VB_ALIGN_FIELD_64 (VOID_PTR pAddress, pad2);/* address of calling context */
|
||||
uint64_t sizeIn; /* number of bytes to be read */
|
||||
uint64_t sizeOut; /* number of bytes successfully read */
|
||||
uint32_t flags; /* data/instruction flush option */
|
||||
} VBI_MEM_CTL;
|
||||
|
||||
#define VBI_DCACHE_FLUSH 0x0001
|
||||
#define VBI_ICACHE_INV 0x0002
|
||||
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) && \
|
||||
!defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
/* system call prototypes for use within a context */
|
||||
|
||||
extern int vbiHyIoctl (unsigned ioctl, void *arg1, void *arg2, void *arg3,
|
||||
void *arg4);
|
||||
extern int vbiIoapicIoctl (unsigned ioctl, unsigned arg1, unsigned arg2);
|
||||
extern int vbiCtxctl (unsigned operation, unsigned arg1, unsigned arg2);
|
||||
extern int32_t vbiVbMgmt (uint32_t cmd, uint32_t boardId, int32_t *outError,
|
||||
uint32_t flags, void * ctl);
|
||||
extern int vbiVtlbOp (unsigned int op, unsigned long arg1,
|
||||
unsigned long arg2, unsigned long arg3);
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT && !_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG */
|
||||
|
||||
/* name server options and timeouts */
|
||||
|
||||
#define VBI_NS_NOVERSION 0xffffffff /* no specific service version */
|
||||
#define VBI_NS_ANYVERSION 0xffffffff /* match any service version */
|
||||
#define VBI_NS_OPTION_NONE 0x0000 /* no options */
|
||||
#define VBI_NS_OPTION_LOOKUP_WAIT 0x0001 /* wait for name registration */
|
||||
#define VBI_NS_NO_TIMEOUT 0x0000 /* wait forever */
|
||||
|
||||
/*
|
||||
* Modified APIs for VBI 2.0
|
||||
*/
|
||||
|
||||
/* Message send */
|
||||
|
||||
extern vbiStatus_t vbiSend (vbiCtx_t id,
|
||||
void *smsg,
|
||||
size_t slen,
|
||||
void *rmsg,
|
||||
size_t rlen,
|
||||
VBI_MSG_INFO *info,
|
||||
VBI_MSG_CTL *ctl);
|
||||
/* message receive */
|
||||
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) && \
|
||||
!defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
|
||||
|
||||
extern vbiStatus_t vbiReceive (void *rmsg,
|
||||
uint32_t rlen,
|
||||
VBI_MSG_INFO *info,
|
||||
VBI_MSG_CTL *ctl);
|
||||
/* message reply */
|
||||
|
||||
extern int32_t vbiReply (vbiCtx_t id,
|
||||
void *smsg,
|
||||
size_t slen,
|
||||
VBI_MSG_CTL *ctl);
|
||||
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT && !_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG */
|
||||
extern vbiStatus_t vbiPanic (const char *msg);
|
||||
extern vbiStatus_t vbiDcacheFlush (void *saddr, size_t size);
|
||||
extern vbiStatus_t vbiIcacheFlush (void *saddr, size_t size);
|
||||
|
||||
#ifndef _WRS_CONFIG_WRHV_GUEST_CERT
|
||||
extern vbiStatus_t vbiKputs (const char *s);
|
||||
extern vbiStatus_t vbiKputc (int c);
|
||||
|
||||
extern vbiStatus_t vbiVmmuConfig (struct vmmuConfig * config);
|
||||
extern vbiStatus_t vbiVmmuCreate (struct vmmuConfig * config);
|
||||
extern vbiStatus_t vbiVmmuDelete (struct vmmuConfig * config);
|
||||
extern vbiStatus_t vbiVmmuEnable (uint32_t vmmu_num);
|
||||
extern vbiStatus_t vbiVmmuDisable (uint32_t vmmu_num);
|
||||
extern vbiStatus_t vbiVmmuTlbFlush (struct vmmuConfig * config, void *addr, size_t len);
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT */
|
||||
extern vbiStatus_t vbiNsRegister (char *name, uint32_t revision);
|
||||
extern vbiStatus_t vbiNsUnregister (char *name, uint32_t revision);
|
||||
extern vbiStatus_t vbiNsLookupOld (char *name, uint32_t rev,
|
||||
VBI_NS_HANDLE *pHandle);
|
||||
extern vbiStatus_t vbiNsLookup (char *name, uint32_t rev,
|
||||
VBI_NS_HANDLE *pHandle, uint32_t timeout,
|
||||
uint32_t options);
|
||||
|
||||
/* Prior to vbi 2.0 these api were vbiMmuAttrSet/Get */
|
||||
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) &&\
|
||||
!defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
|
||||
extern vbiStatus_t vbiMemAttrSet (void *vaddr, size_t len, vbiMemAttr_t attr);
|
||||
extern vbiStatus_t vbiMemAttrGet (void *vaddr, vbiMemAttr_t * attr);
|
||||
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT && !_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG */
|
||||
|
||||
/*
|
||||
* START: New APIs introduced for vbi 2.0
|
||||
*/
|
||||
|
||||
extern void vbiIntVCoreUnlock (void);
|
||||
extern vbiIntState_t vbiIntVCoreLock (void);
|
||||
extern vbiStatus_t vbiCacheTextUpdate (void *saddr, size_t size);
|
||||
extern vbiStatus_t vbiExcBaseSet (void * excTblBase);
|
||||
|
||||
/* interrupt handling APIs */
|
||||
|
||||
extern void vbiDirectInterruptEOI (void);
|
||||
|
||||
/* virtual board management APIs */
|
||||
|
||||
extern vbiStatus_t vbiVbReset (vbiVb_t id, vbiCore_t core, uint32_t options);
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) && \
|
||||
!defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
|
||||
extern vbiStatus_t vbiVbSuspend (vbiVb_t id, vbiCore_t core);
|
||||
extern vbiStatus_t vbiVbRestart (vbiVb_t id, vbiCore_t core);
|
||||
extern vbiStatus_t vbiVbResume (vbiVb_t id, vbiCore_t core);
|
||||
|
||||
/* read remote vb's memory */
|
||||
|
||||
extern vbiStatus_t vbiVbMemoryRead (VBI_MEM_CTL *memCtl, vbiVb_t targetBoard);
|
||||
extern vbiStatus_t vbiVbMemoryWrite (VBI_MEM_CTL *memCtl, vbiVb_t targetBoard);
|
||||
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT && !_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG */
|
||||
#ifndef _WRS_CONFIG_WRHV_GUEST_CERT
|
||||
extern void vbiDebugShellStart (uint32_t flags);
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT */
|
||||
|
||||
/* read/write remote vb's registers */
|
||||
|
||||
#if !defined(_WRS_CONFIG_WRHV_GUEST_CERT) &&\
|
||||
!defined(_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG)
|
||||
|
||||
extern vbiStatus_t vbiVbRegisterRead (VBI_HREG_SET_CMPLX_QUALIFIED *regSet,
|
||||
vbiVb_t targetBoard,
|
||||
vbiCore_t core);
|
||||
extern vbiStatus_t vbiVbRegisterWrite (VBI_HREG_SET_CMPLX_QUALIFIED *regSet,
|
||||
vbiVb_t targetBoard,
|
||||
vbiCore_t core);
|
||||
|
||||
#endif /* !_WRS_CONFIG_WRHV_GUEST_CERT && !_WRS_CONFIG_WRHV_GUEST_CERT_DEBUG */
|
||||
|
||||
extern vbiStatus_t vbiBspIoctl(unsigned, int, int, int, int, int, int, int);
|
||||
|
||||
/*
|
||||
* END: New APIs introduced for vbi 2.0
|
||||
*/
|
||||
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCvbiSyscallh */
|
||||
@@ -0,0 +1,81 @@
|
||||
/* vbiTypes.h - virtual board interfaces types definitions */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01m,01feb12,c_t fix C++ compile problem(WIND00311202)
|
||||
01l,25aug11,c_t Sync with HV 2.0
|
||||
01k,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
01j,24may10,jl Sync with HV 1.2 25-May-10
|
||||
01i,29apr10,pad Moved extern C statement after include statements.
|
||||
01h,20may10,rgo fix unresolved _RType
|
||||
01g,03mar10,rgo sync-up with hv1.2 view on 3/3/10
|
||||
01f,23oct09,jl Sync with HV 1.1 30-Oct-09 DVD
|
||||
01e,22sep09,d_c Defect WIND00183017 Fix WIND00183019 - sync with 18-Sep HV
|
||||
DVD
|
||||
01d,13aug09,d_c Sync with HV 1.1 14-Aug-09 DVD
|
||||
HV vbiTypes.h 01d 12aug09,dtr ADd vbiGuestPhysAddr type.
|
||||
Add definition of MSG_HEADER type from HV sys/wrhvMsg.h
|
||||
Add definition of vb_t type from HV sys/types.h
|
||||
01c,02jul09,mmi fixe vbiIrq_t and vbiVector_t types
|
||||
01b,11jun09,mmi add vbiIntState_t, vbiMemAttr_t, etc..
|
||||
01a,09jun09,mmi written
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiTypesh
|
||||
#define __INCvbiTypesh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
typedef uint32_t vbiVb_t;
|
||||
typedef int32_t vbiCore_t;
|
||||
typedef uint32_t vbiCtx_t;
|
||||
typedef uint64_t vbiPhysAddr_t;
|
||||
typedef void * vbiGuestPhysAddr_t;
|
||||
typedef int32_t vbiStatus_t;
|
||||
typedef int32_t vbiIntState_t;
|
||||
typedef int32_t vbiMemAttr_t;
|
||||
typedef int32_t vbiVector_t;
|
||||
typedef int32_t vbiIrq_t;
|
||||
typedef uint32_t vbiCoreSet_t;
|
||||
typedef uint32_t vbiRegSet_t;
|
||||
typedef int32_t status_t;
|
||||
typedef uint64_t vbiRType64_t;
|
||||
typedef uint32_t vbiRType32_t;
|
||||
typedef uint16_t vbiRType16_t;
|
||||
typedef uint64_t vbiTimeout_t;
|
||||
typedef uint64_t vbiTicks_t;
|
||||
typedef union vbiRegisterType
|
||||
{
|
||||
vbiRType64_t reg64;
|
||||
vbiRType32_t reg32;
|
||||
vbiRType16_t reg16;
|
||||
} vbiRType_t;
|
||||
|
||||
#define NAME_LENGTH 64
|
||||
#define BOOTLINE_LENGTH 256
|
||||
|
||||
typedef char vbiName_t[NAME_LENGTH];
|
||||
typedef char vbiBootline_t[BOOTLINE_LENGTH];
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCvbiTypesh */
|
||||
@@ -0,0 +1,67 @@
|
||||
/* vbiVersion.h - vbi version information */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009-2011 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01c,07sep11,m_h Sync with HV 1.3.1.1 02-Sept-11 DVD
|
||||
01b,29apr10,pad Moved extern C statement after include statements.
|
||||
01a,29jun09,to created from vbiVersion.h, v01b for HV 1.1
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiVersionh
|
||||
#define __INCvbiVersionh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _WRS_CONFIG_VBI_VER_2_0
|
||||
|
||||
#define VBI_VERSION_MAJOR 2
|
||||
|
||||
/*
|
||||
* Release identification, major, minor, and maintenance numbers.
|
||||
*
|
||||
* Current vbi release number
|
||||
*/
|
||||
|
||||
#define VBI_RUNTIME_NAME "Wind River Hypervisor Virtual board interface"
|
||||
#define VBI_RUNTIME_VERSION "2.2.1"
|
||||
|
||||
/* textual description of this product version */
|
||||
|
||||
#define VBI_VERSION VBI_RUNTIME_NAME " " VBI_RUNTIME_VERSION
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
extern const char *vbiCreationDate;
|
||||
extern const char *vbiRuntimeVersion;
|
||||
extern const char *vbiRuntimeName;
|
||||
extern const char *vbiVersion;
|
||||
|
||||
extern const uint32_t vbiVersionMajor;
|
||||
extern const uint32_t vbiVersionMinor;
|
||||
extern const uint32_t vbiVersionMaint;
|
||||
#endif
|
||||
|
||||
#else /* _WRS_CONFIG_VBI_VER_1_0 */
|
||||
|
||||
#define VBI_VERSION_MAJOR 1
|
||||
|
||||
#endif /* _WRS_CONFIG_VBI_VER_ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCvbiVersionh */
|
||||
@@ -0,0 +1,241 @@
|
||||
/* vbiX86Arch.h - x86 architecture specific definitions */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01q,26apr12,jjk WIND00344535 - Fix build warnings
|
||||
01q,17feb12,c_t sync with HV 2.0 27-jan-12 DVD
|
||||
01p,04apr11,jlv Sync with HV 1.3 01-Apr-11(WIND00265419)
|
||||
01o,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
01n,28dec10,jlv Fix compiler warning with 64-bit build
|
||||
01m,28sep10,jl add inline wrhvAmpCpuHreg32Set
|
||||
01l,24may10,jl Sync with HV 1.2 25-May-10
|
||||
01k,20may10,rgo fix unresolved _RType
|
||||
01j,03mar10,rgo sync-up with hv1.2 view on 3/3/10
|
||||
01i,31aug09,mmi move VBI_HREG_SET to vbiX86Arch.h
|
||||
01h,26aug09,mmi fix WIND00178026: update file name
|
||||
01g,17aug09,md fix comments
|
||||
01f,14aug09,md update to match hypervisor version
|
||||
01e,28jul09,mpk add hardware register set to vbi
|
||||
01d,08jun09,md add define for maximum number of cores
|
||||
01c,25may09,md add byte order define
|
||||
01b,06feb09,mmi add MAX interrupts definition
|
||||
01a,14jan09,mmi created
|
||||
*/
|
||||
|
||||
#ifndef __INCvbiX86Archh
|
||||
#define __INCvbiX86Archh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
/* structure of the system descriptor table registers (VBI_GDTR, VBI_IDTR, VBI_LDTR) */
|
||||
|
||||
struct VBI_XDTR64
|
||||
{
|
||||
uint16_t limit; /* maximum size of the DT */
|
||||
uint64_t base; /* address of DT */
|
||||
uint16_t pad[3];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct VBI_XDTR32
|
||||
{
|
||||
uint16_t limit;
|
||||
uint32_t base;
|
||||
uint16_t pad;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
typedef struct VBI_XDTR64 VBI_GDTR;
|
||||
typedef struct VBI_XDTR64 VBI_IDTR;
|
||||
typedef struct VBI_XDTR64 VBI_LDTR;
|
||||
|
||||
typedef struct VBI_XDTR32 VBI_GDTR32;
|
||||
typedef struct VBI_XDTR32 VBI_IDTR32;
|
||||
typedef struct VBI_XDTR32 VBI_LDTR32;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VBI_HREG_SET - hardware register set, for read/write
|
||||
*
|
||||
* Used by vbiVbRegisterRead/vbiVbRegisterWrite to read/write registers in
|
||||
* another VB
|
||||
*
|
||||
* SYNOPSIS
|
||||
*
|
||||
* VB hardware register set C data structure type definition
|
||||
*
|
||||
*\cs
|
||||
* typedef struct /@ VB_REG_SET - used for sys_regsRead/Write @/
|
||||
* {
|
||||
* vbiRType32_t eax; /@ 00: general register @/
|
||||
* vbiRType32_t ebx; /@ 04: general register @/
|
||||
* vbiRType32_t ecx; /@ 08: general register @/
|
||||
* vbiRType32_t edx; /@ 0C: general register @/
|
||||
* vbiRType32_t esi; /@ 10: general register @/
|
||||
* vbiRType32_t edi; /@ 14: general register @/
|
||||
* vbiRType32_t eip; /@ 18: program counter @/
|
||||
* vbiRType32_t ebp; /@ 1C: frame pointer register @/
|
||||
* vbiRType32_t esp; /@ 20: stack pointer register @/
|
||||
* vbiRType32_t eflags; /@ 24: status register @/
|
||||
* vbiRType32_t cr0; /@ 28: control register 0 @/
|
||||
* vbiRType32_t cr3; /@ 2C: control register 3 @/
|
||||
* vbiRType32_t cr4; /@ 30: control register 4 @/
|
||||
* vbiRType32_t idtr; /@ 34: IDT task register @/
|
||||
* vbiRType32_t gdtr; /@ 38: GDT task register @/
|
||||
* vbiRType32_t ldtr; /@ 3C: LDT task register @/
|
||||
* vbiRType32_t cs; /@ 40: code segment @/
|
||||
* vbiRType32_t ss; /@ 44: stack segment @/
|
||||
* vbiRType32_t ds; /@ 48: data segment @/
|
||||
* vbiRType32_t es; /@ 4C: E segment @/
|
||||
* vbiRType32_t fs; /@ 50: F segment @/
|
||||
* vbiRType32_t gs; /@ 54: G segment @/
|
||||
* vbiRType32_t tr; /@ 58: task register @/
|
||||
* } VBI_HREG_SET;
|
||||
*
|
||||
*\ce
|
||||
* SEE ALSO: NONE
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct /* VBI_REG_SET - used for sys_regsRead/Write */
|
||||
{
|
||||
vbiRType32_t eax; /* 00: general register */
|
||||
vbiRType32_t ebx; /* 04: general register */
|
||||
vbiRType32_t ecx; /* 08: general register */
|
||||
vbiRType32_t edx; /* 0C: general register */
|
||||
vbiRType32_t esi; /* 10: general register */
|
||||
vbiRType32_t edi; /* 14: general register */
|
||||
vbiRType32_t eip; /* 18: program counter */
|
||||
vbiRType32_t ebp; /* 1C: frame pointer register */
|
||||
vbiRType32_t esp; /* 20: stack pointer register */
|
||||
vbiRType32_t eflags; /* 24: status register */
|
||||
vbiRType32_t cr0; /* 28: control register 0 */
|
||||
vbiRType32_t cr3; /* 2C: control register 3 */
|
||||
vbiRType32_t cr4; /* 30: control register 4 */
|
||||
VBI_IDTR32 idtr; /* 34: IDT task register */
|
||||
VBI_GDTR32 gdtr; /* 3C: GDT task register */
|
||||
VBI_LDTR32 ldtr; /* 44: LDT task register */
|
||||
vbiRType32_t cs; /* 4C: code segment */
|
||||
vbiRType32_t ss; /* 50: stack segment */
|
||||
vbiRType32_t ds; /* 54: data segment */
|
||||
vbiRType32_t es; /* 58: E segment */
|
||||
vbiRType32_t fs; /* 5C: F segment */
|
||||
vbiRType32_t gs; /* 60: G segment */
|
||||
vbiRType32_t tr; /* 64: task register */
|
||||
} VBI_HREG_SET;
|
||||
|
||||
typedef struct /* REG_SET - x86 register set */
|
||||
{
|
||||
vbiRType64_t rax; /* 00: general register */
|
||||
vbiRType64_t rbx; /* 08: general register */
|
||||
vbiRType64_t rcx; /* 10: general register */
|
||||
vbiRType64_t rdx; /* 18: general register */
|
||||
vbiRType64_t rsp; /* 20: stack pointer register */
|
||||
vbiRType64_t rbp; /* 28: frame pointer register */
|
||||
vbiRType64_t rsi; /* 30: general register */
|
||||
vbiRType64_t rdi; /* 38: general register */
|
||||
vbiRType64_t r8; /* 40: general register */
|
||||
vbiRType64_t r9; /* 48: general register */
|
||||
vbiRType64_t r10; /* 50: general register */
|
||||
vbiRType64_t r11; /* 58: general register */
|
||||
vbiRType64_t r12; /* 60: general register */
|
||||
vbiRType64_t r13; /* 68: general register */
|
||||
vbiRType64_t r14; /* 70: general register */
|
||||
vbiRType64_t r15; /* 78: general register */
|
||||
vbiRType64_t rip; /* 80: program counter */
|
||||
vbiRType64_t rflags; /* 88: status register */
|
||||
vbiRType64_t cr0; /* 90: control register 0 */
|
||||
vbiRType64_t cr2; /* 98: control register 2 */
|
||||
vbiRType64_t cr3; /* 100: control register 3 */
|
||||
vbiRType64_t cr4; /* 108: control register 4 */
|
||||
VBI_IDTR idtr; /* 110: IDT task register */
|
||||
VBI_GDTR gdtr; /* 11a: GDT task register */
|
||||
VBI_LDTR ldtr; /* 136: LDT task register */
|
||||
vbiRType64_t cs; /* 140: code segment */
|
||||
vbiRType64_t ds; /* 148: data segment */
|
||||
vbiRType64_t ss; /* 150: stack segment */
|
||||
vbiRType64_t es; /* 158: E segment */
|
||||
vbiRType64_t fs; /* 160: F segment */
|
||||
vbiRType64_t gs; /* 168: G segment */
|
||||
vbiRType64_t tr; /* 170: Task register */
|
||||
/* xxx(gws): excluding FP support */
|
||||
} VBI_HREG_SET_64;
|
||||
|
||||
|
||||
|
||||
/* complex register set definition */
|
||||
|
||||
typedef union
|
||||
{
|
||||
VBI_HREG_SET hreg32; /* 32 bit register set */
|
||||
VBI_HREG_SET_64 hreg64; /* 64 bit register set */
|
||||
} VBI_HREG_SET_CMPLX;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vbiRegSet_t vbiRegType; /* 00: register set to use */
|
||||
uint32_t qualifier; /* 04: optional field, used for alignment */
|
||||
|
||||
VBI_HREG_SET_CMPLX vbiRegSet;
|
||||
} VBI_HREG_SET_CMPLX_QUALIFIED;
|
||||
|
||||
#ifndef _WRS_CONFIG_LP64
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* wrhvAmpCpuHreg32Set - Init the guestOS of VBI_HREG_SET_CMPLX_QUALIFIED data
|
||||
* structure.
|
||||
*
|
||||
* This function sets the specific parameters which are CPU/Arch dependent
|
||||
* and it will be called by wrhvAmpCpuEnable before resuming the Virtual Board
|
||||
* during the GuestOS wrload operation. Note that the register-width is assumed
|
||||
* to be 32bits.
|
||||
*
|
||||
* ERRNO: - N/A
|
||||
* RETURNS:None
|
||||
* \NOMANUAL
|
||||
*
|
||||
*/
|
||||
|
||||
_WRS_INLINE void wrhvAmpCpuHreg32Set
|
||||
(
|
||||
VBI_HREG_SET_CMPLX_QUALIFIED * pRegSet,
|
||||
FUNCPTR entryPt,
|
||||
vbiGuestPhysAddr_t cfgAddr
|
||||
)
|
||||
{
|
||||
|
||||
/* IP and eax parameters are set */
|
||||
|
||||
pRegSet->vbiRegSet.hreg32.eip = (vbiRType32_t) entryPt;
|
||||
pRegSet->vbiRegSet.hreg32.eax = (vbiRType32_t) cfgAddr;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* _WRS_CONFIG_LP64 */
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
/* x86 uses little endian byte ordering */
|
||||
|
||||
#define __VBI_BYTE_ORDER __VBI_LITTLE_ENDIAN
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __INCVbiX86Archh */
|
||||
@@ -0,0 +1,534 @@
|
||||
/* wrhvHypercalls.h - hypervisor system calls */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007-2012 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
03d,02aug12,c_t Sync with HV 2.0 Jul03rd DVD
|
||||
03f,17feb12,c_t Sync with HV 2.0 Jan27th DVD
|
||||
03e,25aug11,c_t Sync with HV 2.0
|
||||
03d,18apr11,wqi Updated for e300 guest OS.
|
||||
03c,04apr11,jlv Sync with HV 1.3 01-Apr-11(WIND00265419)
|
||||
03b,08feb11,jlv Sync with HV 1.3 04-Feb-11 DVD
|
||||
03a,24may10,jl Sync with HV 1.2 25-May-10
|
||||
02z,29apr10,pad Moved extern C statement after include statements.
|
||||
02y,03mar10,rgo sync-up with hv1.2 3/3/10
|
||||
02x,21jan10,rgo assign a HV system-call to vbiVbRemote
|
||||
02w,23oct09,jl Sync with HV 1.1 30-Oct-09 DVD
|
||||
02v,22sep09,d_c Defect WIND00183017 Fix WIND00183019 - sync with 18-Sep HV
|
||||
DVD
|
||||
02u,12aug09,dtr Add defines for additional arg to vbiHyIoctl.
|
||||
02t,13jul09,dbt stop using long for VTLB VBI system calls
|
||||
02s,16jul09,mmi change NO_RESET to RESET and NO_DOWNLOAD to DOWNLOAD
|
||||
02r,13jul09,mmi fix reset flag reset
|
||||
02q,13jul09,mmi add VBI_VBMGMT_RESET_DOWNLOAD
|
||||
02p,06jul09,mmi add vb managment syscall numbers
|
||||
02o,02jul09,mmi update the interrupt sending options, fix textUpdate
|
||||
fast syscall number
|
||||
02n,23jun09,mmi add VBI_VBMGM_RESTART
|
||||
02m,10jun09,mmi add cache text update fast system call
|
||||
02l,29may09,mes Fixed VBI_CTX_STATS to match HY_CTX_STATS
|
||||
02k,27apr09,mpk Supervisor Syscall Interface for Privileged Guest OS
|
||||
02j,19mar09,mes Fixed type of VBI_ERROR_CODE
|
||||
02i,02feb09,mmi add name service system call
|
||||
02h,02mar09,mmi fix header name define
|
||||
02g,24feb09,mmi decouple vbi definitions from internal data, add vbMgmt API
|
||||
02f,19jan09,mmi update msg API prototypes
|
||||
02e,12jan09,dtr Add driver ioctl calls, remove legacy interrupt defns.
|
||||
02d,12dec08,md rename header files
|
||||
02c,05dec08,mes Removed shelf macros, added vbMgmt macros
|
||||
02b,01dec08,md add VBI_IOAPICIOCTL_SEND options
|
||||
02a,21nov08,md remove port and ED&R syscalls
|
||||
01z,20nov08,mmi adtopt new naming convention
|
||||
01y,31oct08,dbt Added vdkVtlbMmuOp hypercall.
|
||||
01x,16jun08,mmi fix vdkBspIoctl prototype
|
||||
01w,19may08,gws add vIoapicIoctl
|
||||
01v,18apr08,md add extra arg to vdkHyioctl
|
||||
01u,11apr08,md add EOI ioctl
|
||||
01t,06mar08,md add debug shell ioctl
|
||||
01s,06dec07,foo update hw ints
|
||||
01r,23nov07,foo fix prototype, use basic types
|
||||
01q,25oct07,foo updated with new vdk functions
|
||||
01p,27sep07,md added exception profiling fields
|
||||
01o,26sep07,md added profiling statistics and stats ioctl
|
||||
01n,10sep07,md re-number hypervisor system calls
|
||||
01m,21aug07,md added VDK_SYS_ctx_load_vmmu
|
||||
01l,05jul07,foo added bspIoctl calls and defines
|
||||
01k,04jun07,md added ctxctl and mmu system calls
|
||||
01j,17may07,ymz added port syscall.
|
||||
01i,28may07,foo update vdkInt prototype
|
||||
01h,18may07,md add hypervisor ioctl
|
||||
01g,20apr07,md add vmmu system calls
|
||||
01f,18apr07,md renamed to vdk
|
||||
01e,10apr07,md replace kprintf syscall with kputs and kputc
|
||||
01d,19mar07,foo fix macro
|
||||
01c,17mar07,foo modify definitions to all start with HY
|
||||
01b,15mar07,md added interrupt system calls
|
||||
01a,09mar07,md written
|
||||
*/
|
||||
|
||||
#ifndef __INCwrhvHypercallsh
|
||||
#define __INCwrhvHypercallsh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
#include <wrhv/vbiVersion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* System call number encoding:
|
||||
*
|
||||
* 31 0
|
||||
*
|
||||
* | | | | | |
|
||||
* +---------------+---------------+ +---------------+---------------+
|
||||
* | | | | | | | | | | | | | | | | | ...... | | | | | | | | | | | | | | | | |
|
||||
* +---------------+---------------+ +---------------+---------------+
|
||||
* ^ ^ ^ ^ ^ ^ ^
|
||||
* | | \--------/ | \----------------------------------------------------/
|
||||
* | | | | |
|
||||
* | | | | |
|
||||
* | | | | +-- System call number
|
||||
* | | | |
|
||||
* | | | +-- Size override
|
||||
* | | |
|
||||
* | | +-- Fast hypervisor system call number
|
||||
* | |
|
||||
* | +--------- Hypervisor system call
|
||||
* |
|
||||
* +----------- Fast hypervisor system call
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* fast system call numbers handled by assembler code */
|
||||
|
||||
#define HY_FAST_SYSCALL_MASK 0x3f000000
|
||||
#define HY_FAST_SYSCALL_SHIFT 24
|
||||
#define HY_FAST_SYSCALL_BIT 0x80000000
|
||||
#define HY_FAST_SYSCALL(x) \
|
||||
((((x) << HY_FAST_SYSCALL_SHIFT) & HY_FAST_SYSCALL_MASK) | \
|
||||
HY_FAST_SYSCALL_BIT)
|
||||
|
||||
/* C driven system calls */
|
||||
|
||||
#define HY_SYSCALL_MASK 0x007fffff
|
||||
#define HY_SYSCALL_SHIFT 0
|
||||
#define HY_SYSCALL_BIT 0x40000000
|
||||
#define HY_SYSCALL(x) \
|
||||
((((x) << HY_SYSCALL_SHIFT) & HY_SYSCALL_MASK) | HY_SYSCALL_BIT)
|
||||
|
||||
#define HY_SIZE_OVERRIDE 0x00800000
|
||||
|
||||
/* fast system calls */
|
||||
|
||||
#define VBI_SYS_tlb_flush HY_FAST_SYSCALL(1) /* TLB flush */
|
||||
#define VBI_SYS_icache_flush HY_FAST_SYSCALL(2) /* instruction cache flush */
|
||||
#define VBI_SYS_dcache_flush HY_FAST_SYSCALL(3) /* data cache flush */
|
||||
#define VBI_SYS_ctx_load HY_FAST_SYSCALL(4) /* context load */
|
||||
#define VBI_SYS_int_enable HY_FAST_SYSCALL(5) /* int enable */
|
||||
#define VBI_SYS_cache_text_update \
|
||||
HY_FAST_SYSCALL(6) /* cache text update */
|
||||
#define VBI_SYS_pic_EOI HY_FAST_SYSCALL(7) /* mpic EOI */
|
||||
#ifdef _WRS_CONFIG_HV_VER_1_3
|
||||
#define VBI_SYS_spefscr_update \
|
||||
HY_FAST_SYSCALL(8) /* update spefscr */
|
||||
#else /* HV2.0 */
|
||||
#define VBI_SYS_fp_enable HY_FAST_SYSCALL(8) /* Enable floating point */
|
||||
#define VBI_SYS_trace_enable HY_FAST_SYSCALL(9) /* Enable trace */
|
||||
#endif /* _WRS_CONFIG_HV_VER_1_3 */
|
||||
|
||||
/* hypervisor services */
|
||||
|
||||
#define VBI_SYS_hyIoctl HY_SYSCALL(1) /* hypervisor ioctl */
|
||||
#define VBI_SYS_vmContextCreate HY_SYSCALL(2) /* context create */
|
||||
#define VBI_SYS_send HY_SYSCALL(3) /* send a messages */
|
||||
#define VBI_SYS_receive HY_SYSCALL(4) /* receive a messages */
|
||||
#define VBI_SYS_reply HY_SYSCALL(5) /* reply to a messages */
|
||||
#define VBI_SYS_panic HY_SYSCALL(6) /* halt the system */
|
||||
#define VBI_SYS_int HY_SYSCALL(7) /* deliver an interrupt */
|
||||
#define VBI_SYS_int_controller_done HY_SYSCALL(8)/* done interrupt processing*/
|
||||
#define VBI_SYS_ctxctl HY_SYSCALL(9) /* context control operation */
|
||||
|
||||
/* VMMU operations */
|
||||
|
||||
#define VBI_SYS_vmmu_config HY_SYSCALL(10) /* configure the virtual MMU */
|
||||
#define VBI_SYS_vmmu_enable HY_SYSCALL(11) /* enable the virtual MMU */
|
||||
#define VBI_SYS_vmmu_disable HY_SYSCALL(12) /* disable the virtual MMU */
|
||||
#define VBI_SYS_vmmu_tlbload HY_SYSCALL(13) /* load a VMMU TLB entry */
|
||||
#define VBI_SYS_vmmu_tlbflush HY_SYSCALL(14) /* flush a VMMU TLB entry */
|
||||
|
||||
/* MMU operations */
|
||||
|
||||
#define VBI_SYS_mmu_attr_set HY_SYSCALL(16) /* set physical memory attr */
|
||||
#define VBI_SYS_mmu_attr_get HY_SYSCALL(17) /* get physical memory attr */
|
||||
|
||||
/* BSP specific interface */
|
||||
|
||||
#define VBI_SYS_bspIoctl HY_SYSCALL(18) /* BSP specific opreration */
|
||||
|
||||
/* vbMgmt services */
|
||||
|
||||
#define VBI_SYS_vbMgmt HY_SYSCALL(20) /* keep back compatibility */
|
||||
|
||||
/* Virtual IO APIC services */
|
||||
|
||||
#define VBI_SYS_vIoapicIoctl HY_SYSCALL(21)
|
||||
|
||||
#define VBI_SYS_vbReset HY_SYSCALL(22) /* reset vcores */
|
||||
#define VBI_SYS_vbRestart HY_SYSCALL(23) /* restart vcores */
|
||||
#define VBI_SYS_vbSuspend HY_SYSCALL(24) /* suspend vcores */
|
||||
#define VBI_SYS_vbResume HY_SYSCALL(25) /* Resume vcores */
|
||||
#define VBI_SYS_vbRemote HY_SYSCALL(26) /* Get info of board */
|
||||
#define VBI_SYS_schedControl HY_SYSCALL(27) /* scheduler control */
|
||||
#define VBI_SYS_port HY_SYSCALL(28) /* port send and receive */
|
||||
|
||||
/* Additional VMMU calls */
|
||||
#define VBI_SYS_vmmu_create HY_SYSCALL(30) /* configure the virtual MMU */
|
||||
#define VBI_SYS_vmmu_delete HY_SYSCALL(31) /* configure the virtual MMU */
|
||||
#define VBI_SYS_vmmu_maxAsid HY_SYSCALL(32) /* get max asid available */
|
||||
|
||||
#define VBI_SYS_intRedirect HY_SYSCALL(40) /* vcores int redirect */
|
||||
|
||||
/* debug facilities */
|
||||
|
||||
#define VBI_SYS_kputs HY_SYSCALL(50) /* print a string to the cons*/
|
||||
#define VBI_SYS_kputc HY_SYSCALL(51) /* print a char to the cons */
|
||||
#ifdef _WRS_CONFIG_HV_VER_1_3
|
||||
#define VBI_SYS_ps HY_SYSCALL(52) /* process status display */
|
||||
#endif /* _WRS_CONFIG_HV_VER_1_3 */
|
||||
#define VBI_SYS_dbgShStart HY_SYSCALL(53) /* start debug shell */
|
||||
|
||||
/* VTLB MMU operations */
|
||||
|
||||
#define VBI_SYS_vtlb_op HY_SYSCALL(55) /* VTLB operation */
|
||||
|
||||
/* Name services */
|
||||
|
||||
#define VBI_SYS_ns_op HY_SYSCALL(60) /* Name service operation */
|
||||
|
||||
/* remote board memory services */
|
||||
|
||||
#define VBI_SYS_memWrite_op HY_SYSCALL(70) /* memory write service operation */
|
||||
#define VBI_SYS_memRead_op HY_SYSCALL(71) /* memory read service operation */
|
||||
|
||||
/* remote board memory services */
|
||||
|
||||
#define VBI_SYS_RegsWrite_op HY_SYSCALL(72) /* regs write service operation */
|
||||
#define VBI_SYS_RegsRead_op HY_SYSCALL(73) /* regs service operation */
|
||||
|
||||
#define VBI_SYS_Pstate_set HY_SYSCALL(74) /* set core P state */
|
||||
#define VBI_SYS_Cstate_set HY_SYSCALL(75) /* set core C state */
|
||||
|
||||
|
||||
/* Dynamic VB create/delete and VB Migration */
|
||||
|
||||
#define VBI_SYS_vbCreate HY_SYSCALL(80) /* create virtual board */
|
||||
#define VBI_SYS_vbDelete HY_SYSCALL(81) /* delete virtual board */
|
||||
#define VBI_SYS_vbBoardSimpleConfigGet \
|
||||
HY_SYSCALL(82) /* get board configuration*/
|
||||
#define VBI_SYS_vbBoardConfigGet HY_SYSCALL(83) /* get board configuration*/
|
||||
#define VBI_SYS_vbMove HY_SYSCALL(84) /* move virtual board */
|
||||
#define VBI_SYS_vbPrioSet HY_SYSCALL(85) /* set VB priority */
|
||||
|
||||
/* Dynamic modification of VB */
|
||||
|
||||
#define VBI_SYS_vbSharedMemoryAlloc HY_SYSCALL(90) /* allocate shared memory */
|
||||
#define VBI_SYS_vbSharedMemoryFree HY_SYSCALL(91) /* free shared memory */
|
||||
#define VBI_SYS_vbRamAlloc HY_SYSCALL(92) /* allocate extra ram */
|
||||
#define VBI_SYS_vbRamFree HY_SYSCALL(93) /* free extra ram */
|
||||
|
||||
/* Max number of syscalls*/
|
||||
#define VBI_SYS_max (101 + 1)
|
||||
|
||||
/* hyIoctl system call supported ioctl's */
|
||||
|
||||
#define VBI_HYIOCTL_GETPID 1 /* get context's pid */
|
||||
#define VBI_HYIOCTL_GETPRIORITY 2 /* get context's priority */
|
||||
#define VBI_HYIOCTL_PSDISPLAY 3 /* print context list on console*/
|
||||
#define VBI_HYIOCTL_EXCBASE 4 /* exception vector base addr */
|
||||
#define VBI_HYIOCTL_INTBASE 5 /* interrupt vector base addr */
|
||||
#define VBI_HYIOCTL_GETSTATS 6 /* get context statistics */
|
||||
#define VBI_HYIOCTL_DEBUG_SHELL 7 /* start the debug shell */
|
||||
#define VBI_HYIOCTL_PADDR 9 /* translate to physical address*/
|
||||
#define VBI_HYIOCTL_EXCOFFSETS_SET 10 /* set exc vector offsets for the VB*/
|
||||
#define VBI_HYIOCTL_EXCOFFSETS_GET 11 /* get exc vector offsets for the VB*/
|
||||
#define VBI_HYIOCTL_GETCONFIG 12 /* get config page address */
|
||||
|
||||
/* vIoapicIoctl system call supported ioctl's */
|
||||
|
||||
#define VBI_IOAPICIOCTL_UNMASK 1 /* unmask v io apic interrupt src */
|
||||
#define VBI_IOAPICIOCTL_SEND 2 /* inject a v io apic interrupt */
|
||||
#define VBI_IOAPICIOCTL_EOI 3 /* end of interrupt acknowledge */
|
||||
#define VBI_IOAPICIOCTL_VCORE_SEND 4 /* Send an irq to a core */
|
||||
/* remove this after vbControl is working, we don't need a hypercall for it: */
|
||||
#define VBI_IOAPICIOCTL_MASK 10 /* mask v io apic interrupt src */
|
||||
|
||||
/* VBI_IOAPICIOCTL_SEND options */
|
||||
|
||||
#define VBI_IOAPICSEND_ALL 0 /* send interrupt to all incl self */
|
||||
#define VBI_IOAPICSEND_OTHERS 1 /* send interrupt to all except self */
|
||||
#define VBI_IOAPICSEND_SELF 2 /* send interrupt to self only */
|
||||
#define VBI_IOAPICSEND_UNICAST 3 /* send interrupt to a only one vb*/
|
||||
#define VBI_IOAPICSEND_NONE 4 /* ignore this call */
|
||||
|
||||
/* sent interrupt to a virtual flags */
|
||||
|
||||
#define VBI_IOAPICSEND_VCORE_NONE 0 /* there no option available for now */
|
||||
|
||||
/* hyCtxctl system call supported operations */
|
||||
|
||||
#define VBI_CTXCTL_IDLE 1 /* make current context idle */
|
||||
|
||||
/* remote VB syscall call supported operations */
|
||||
|
||||
#define VBI_VBREMOTE_BOARDCONFIG 1 /* get guest addr of VBCONFIG */
|
||||
#define VBI_VBREMOTE_RAMSIZE 2 /* get memory size */
|
||||
|
||||
/* MMU protection attributes */
|
||||
|
||||
/* For backwards compatibility, these are preserved: */
|
||||
#define VBI_MMU_PROT_READ 0x00000001 /* read allowed */
|
||||
#define VBI_MMU_PROT_WRITE 0x00000002 /* write allowed */
|
||||
#define VBI_MMU_PROT_EXECUTE 0x00000004 /* execute allowed */
|
||||
|
||||
/* Newer vbiMemAttrSet/Get interface: */
|
||||
|
||||
#define VBI_MMU_PROT_USER_READ 0x00000001 /* user read */
|
||||
#define VBI_MMU_PROT_USER_WRITE 0x00000002 /* user write */
|
||||
#define VBI_MMU_PROT_USER_EXECUTE 0x00000004 /* user execute */
|
||||
#define VBI_MMU_PROT_SUPV_READ 0x00000008 /* supervisor read */
|
||||
#define VBI_MMU_PROT_SUPV_WRITE 0x00000010 /* supervisor write */
|
||||
#define VBI_MMU_PROT_SUPV_EXECUTE 0x00000020 /* supervisor execute */
|
||||
|
||||
/* attributes passed to guest besides protection */
|
||||
|
||||
#define VBI_MMU_ATTR_GUEST_MEM 0x80000000 /* accessible by guest */
|
||||
|
||||
/* ETSEC MDIO supported ioctl's */
|
||||
#define VBI_BSPIOCTL_DRV_MDIO 1 /* mdio messages */
|
||||
|
||||
/* system clock frequency query */
|
||||
#define VBI_BSPIOCTL_SYS_CLK 2 /* system clock frequency query */
|
||||
#define VBI_BSPIOCTL_CLK_FREQ 2 /* Request system clk freq */
|
||||
|
||||
/* return physical cpu number given virtual number
|
||||
* - UP should always be 0
|
||||
* - SMP any vcore in the system
|
||||
*/
|
||||
#define VBI_BSPIOCTL_VIRT_TO_PHYS_CPU_NUM 3
|
||||
|
||||
/* Get CPU Processor Version Register content */
|
||||
|
||||
#define VBI_BSPIOCTL_PVR_GET 4
|
||||
|
||||
/* Get CPU System Version Register content */
|
||||
|
||||
#define VBI_BSPIOCTL_SVR_GET 5
|
||||
|
||||
#define MDIO_READ 1
|
||||
#define MDIO_WRITE 2
|
||||
#define MDIO_INT_ENABLE 3
|
||||
#define MDIO_INT_DISABLE 4
|
||||
|
||||
/* vbiHyIoctl for PADDR */
|
||||
#define VBI_HYIOCTL_PADDR_DMA 0x0 /* Default used for DMA */
|
||||
#define VBI_HYIOCTL_PADDR_PHYS 0x1 /* When absolute phys addr needed */
|
||||
|
||||
/* vbMgmt commands */
|
||||
#define VBI_VBMGMT_ATTACH 1 /* Attach to VB for control */
|
||||
#define VBI_VBMGMT_DETACH 2 /* Detech from VB */
|
||||
#define VBI_VBMGMT_SUSPEND 3 /* Suspend/halt VB */
|
||||
#define VBI_VBMGMT_RESUME 4 /* Resume/start a VB */
|
||||
#define VBI_VBMGMT_RESET 5 /* Reset VB */
|
||||
#define VBI_VBMGMT_RESTART 6 /* Restart a VB */
|
||||
|
||||
/* vbMgmt error codes */
|
||||
#define VBI_ERROR_CODE int32_t
|
||||
#define VBI_ERR_GENERAL -101 /* General error */
|
||||
#define VBI_ERR_INVALID_ARG -102 /* General error */
|
||||
|
||||
/* vbMgmt reset macros */
|
||||
#define VBI_VBMGMT_RESET_NON_CORE0 0x00000000 /* APs dont clear mem */
|
||||
#define VBI_VBMGMT_RESET_DOWNLOAD 0x00000001 /* reload ELF image */
|
||||
#define VBI_VBMGMT_RESET_CLEAR 0x00000002 /* clear memory */
|
||||
#define VBI_VBMGMT_RESET_AND_START_CORE0 0x00000004
|
||||
|
||||
/* target vb options */
|
||||
|
||||
#define VBI_VB_CORES_ALL (0x80000000)
|
||||
#define VBI_VB_CORES_OTHERS (0x40000000)
|
||||
|
||||
/* VTLB operation command and flags (intel-vt specific) */
|
||||
|
||||
#define VBI_VTLB_OP_UPDATE_PMD 1 /* 32-bit: L1 */
|
||||
#define VBI_VTLB_OP_UPDATE_PTE 2 /* 32-bit: L2, 64-bit: L4 */
|
||||
#define VBI_VTLB_OP_DELETE_PMD 3 /* 32-bit: L1 */
|
||||
#define VBI_VTLB_OP_SET_PTE_AT 4
|
||||
#define VBI_VTLB_OP_SET_PTE 5
|
||||
#define VBI_VTLB_OP_FLUSH_OPS 6
|
||||
#define VBI_VTLB_OP_INIT 7
|
||||
|
||||
#define VBI_VTLB_OP_INIT64 10
|
||||
#define VBI_VTLB_OP_UPDATE_PML4 11 /* 64-bit: L1 */
|
||||
#define VBI_VTLB_OP_UPDATE_PDP 12 /* 64-bit: L2 */
|
||||
#define VBI_VTLB_OP_UPDATE_PDE 13 /* 64-bit: L3 */
|
||||
#define VBI_VTLB_OP_UPDATE_PTE 2 /* 64-bit: L4 */
|
||||
#define VBI_VTLB_OP_DELETE_PML4 15 /* 64-bit: L1 */
|
||||
#define VBI_VTLB_OP_DELETE_PDP 16 /* 64-bit: L2 */
|
||||
#define VBI_VTLB_OP_DELETE_PDE 17 /* 64-bit: L3 */
|
||||
|
||||
/* VTLB macros */
|
||||
|
||||
#define VBI_VTLB_OP_MAX_OPS 100
|
||||
#define VBI_VTLB_OP_CR3_CACHE_ENTRIES 4
|
||||
|
||||
/* VTLB optimization supported options */
|
||||
|
||||
#define VBI_VTLB_OPTIM_ENABLED 1
|
||||
#define VBI_VTLB_CR3_CACHE_ENABLED 2
|
||||
#define VBI_VTLB_OPS_CACHE_ENABLED 4
|
||||
#define VBI_VTLB_DIRTY_BIT_SUPPORT_ENABLED 8
|
||||
|
||||
/* vbiNsOp system call supported operations */
|
||||
|
||||
#define VBI_NS_REGISTER 1 /* register service name */
|
||||
#define VBI_NS_UNREGISTER 2 /* unregister service name */
|
||||
#define VBI_NS_LOOKUP_OLD 3 /* look up service name */
|
||||
#define VBI_NS_LOOKUP 4 /* look up service name w/options */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
/* statistics structure returned by VBI_HYIOCTL_GETSTATS ioctl */
|
||||
|
||||
#ifdef _WRS_CONFIG_HV_VER_1_3
|
||||
typedef struct {
|
||||
unsigned long ctx_type; /* type of context (user, supv, etc) */
|
||||
unsigned long switchin; /* number of times switched in */
|
||||
unsigned long pended; /* number of times in pend state */
|
||||
unsigned long tsCtxSwitchOutH; /* timestamp: context switch (high) */
|
||||
unsigned long tsCtxSwitchOutL; /* timestamp: context switch (low) */
|
||||
unsigned long tsCtxSwitchInH; /* timestamp: context switch (high) */
|
||||
unsigned long tsCtxSwitchInL; /* timestamp: context switch (low) */
|
||||
unsigned long tsCtxExcInH; /* timestamp: exception entry (high) */
|
||||
unsigned long tsCtxExcInL; /* timestamp: exception entry (low) */
|
||||
unsigned long reset; /* number of times context reset */
|
||||
} VBI_CTX_STATS;
|
||||
#else /* 2.0 changed to always 32bit */
|
||||
typedef struct {
|
||||
uint32_t ctx_type; /* type of context (user, supv, etc) */
|
||||
uint32_t switchin; /* number of times switched in */
|
||||
uint32_t pended; /* number of times in pend state */
|
||||
uint32_t tsCtxSwitchOutH; /* timestamp: context switch (high) */
|
||||
uint32_t tsCtxSwitchOutL; /* timestamp: context switch (low) */
|
||||
uint32_t tsCtxSwitchInH; /* timestamp: context switch (high) */
|
||||
uint32_t tsCtxSwitchInL; /* timestamp: context switch (low) */
|
||||
uint32_t tsCtxExcInH; /* timestamp: exception entry (high) */
|
||||
uint32_t tsCtxExcInL; /* timestamp: exception entry (low) */
|
||||
uint32_t reset; /* number of times context reset */
|
||||
} VBI_CTX_STATS;
|
||||
#endif /* _WRS_CONFIG_HV_VER_1_3 */
|
||||
|
||||
/* VTLB operation structures (x86 specific) */
|
||||
|
||||
typedef struct vbi_vtlb_op /* VTLB operation */
|
||||
{
|
||||
uint32_t op; /* VTLB operation id */
|
||||
uint32_t arg1; /* VTLB operation arg 1 */
|
||||
uint32_t arg2; /* VTLB operation arg 2 */
|
||||
uint32_t arg3; /* VTLB operation arg 3 */
|
||||
} VBI_VTLB_OP;
|
||||
|
||||
typedef struct vbi_vtlb_cr3_cache
|
||||
{
|
||||
uint32_t guest_cr3; /* Guest CR3 register */
|
||||
uint32_t host_cr3; /* Host CR3 register */
|
||||
} VBI_VTLB_CR3_CACHE;
|
||||
|
||||
typedef struct vbi_vtlb_control
|
||||
{
|
||||
uint32_t size; /* VTLB Control structure size */
|
||||
uint32_t mode; /* VTLB module */
|
||||
uint32_t vtlb_ops_ix; /* VTLB operation index */
|
||||
VBI_VTLB_OP vtlb_ops[VBI_VTLB_OP_MAX_OPS]; /* VTLB ops array */
|
||||
uint32_t cr3_cache_ix; /* CR3 cache index */
|
||||
VBI_VTLB_CR3_CACHE cr3_cache[VBI_VTLB_OP_CR3_CACHE_ENTRIES]; /* cr3 cache*/
|
||||
} VBI_VTLB_CONTROL; /* VBI VTLB control */
|
||||
|
||||
/* VTLB operation structures (x86 specific, 64-bit version) */
|
||||
|
||||
typedef struct vbi_vtlb_op64 /* VTLB operation */
|
||||
{
|
||||
uint32_t op; /* VTLB operation id */
|
||||
uint64_t arg1; /* VTLB operation arg 1 */
|
||||
uint64_t arg2; /* VTLB operation arg 2 */
|
||||
uint64_t arg3; /* VTLB operation arg 3 */
|
||||
} VBI_VTLB_OP64;
|
||||
|
||||
typedef struct vbi_vtlb_cr3_cache64
|
||||
{
|
||||
uint64_t guest_cr3; /* Guest CR3 register */
|
||||
uint64_t host_cr3; /* Host CR3 register */
|
||||
} VBI_VTLB_CR3_CACHE64;
|
||||
|
||||
typedef struct vbi_vtlb_control64
|
||||
{
|
||||
uint32_t size; /* VTLB Control structure size */
|
||||
uint32_t mode; /* VTLB module */
|
||||
uint32_t vtlb_ops_ix; /* VTLB operation index */
|
||||
/* VTLB ops array */
|
||||
VBI_VTLB_OP64 vtlb_ops[VBI_VTLB_OP_MAX_OPS];
|
||||
uint32_t cr3_cache_ix; /* CR3 cache and index */
|
||||
VBI_VTLB_CR3_CACHE64 cr3_cache[VBI_VTLB_OP_CR3_CACHE_ENTRIES];
|
||||
} VBI_VTLB_CONTROL64; /* VBI VTLB control */
|
||||
|
||||
/*
|
||||
* Control structure used by vbiVbMgmt for commands memory read, memory write,
|
||||
* register read, and register write.
|
||||
*/
|
||||
|
||||
typedef struct vbMgmtCtl
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t *pBuffer; /* address of target context */
|
||||
uint32_t *pAddress; /* address of calling context */
|
||||
uint32_t size; /* number of total bytes */
|
||||
uint32_t width; /* bus width in bytes */
|
||||
} vbMgmtMem;
|
||||
struct
|
||||
{
|
||||
uint32_t *pBuffer; /* address of target context */
|
||||
uint32_t regSet; /* register set */
|
||||
uint32_t reg; /* macro to specify register */
|
||||
uint32_t size; /* number of total bytes */
|
||||
} vbMgmtReg;
|
||||
} data;
|
||||
} VBMGMT_CTL;
|
||||
|
||||
typedef uint32_t VBMGMT_HANDLE;
|
||||
typedef uint32_t VBI_NS_HANDLE;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCwrhvHypercallsh */
|
||||
Reference in New Issue
Block a user