svm_genassym.c revision 249967
10SN/A/*- 28418SN/A * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) 30SN/A * All rights reserved. 40SN/A * 50SN/A * Redistribution and use in source and binary forms, with or without 60SN/A * modification, are permitted provided that the following conditions 70SN/A * are met: 80SN/A * 1. Redistributions of source code must retain the above copyright 90SN/A * notice unmodified, this list of conditions, and the following 100SN/A * disclaimer. 110SN/A * 2. Redistributions in binary form must reproduce the above copyright 120SN/A * notice, this list of conditions and the following disclaimer in the 130SN/A * documentation and/or other materials provided with the distribution. 140SN/A * 150SN/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 160SN/A * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 170SN/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 180SN/A * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 191472SN/A * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 201472SN/A * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 211472SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 220SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 230SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 240SN/A * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 258418SN/A */ 260SN/A 278418SN/A#include <sys/cdefs.h> 288418SN/A__FBSDID("$FreeBSD: projects/bhyve_svm/sys/amd64/vmm/amd/svm_genassym.c 249967 2013-04-27 04:49:51Z neel $"); 296024SN/A 308418SN/A#include <sys/param.h> 318418SN/A#include <sys/assym.h> 328418SN/A 338418SN/A#include "svm.h" 348418SN/A 358418SN/AASSYM(SCTX_RBX, offsetof(struct svm_regctx, sctx_rbx)); 368418SN/AASSYM(SCTX_RCX, offsetof(struct svm_regctx, sctx_rcx)); 370SN/AASSYM(SCTX_RBP, offsetof(struct svm_regctx, sctx_rbp)); 380SN/A 390SN/AASSYM(SCTX_R8, offsetof(struct svm_regctx, sctx_r8)); 40152SN/AASSYM(SCTX_R9, offsetof(struct svm_regctx, sctx_r9)); 41152SN/AASSYM(SCTX_R10, offsetof(struct svm_regctx, sctx_r10)); 42152SN/AASSYM(SCTX_R11, offsetof(struct svm_regctx, sctx_r11)); 43152SN/AASSYM(SCTX_R12, offsetof(struct svm_regctx, sctx_r12)); 44152SN/AASSYM(SCTX_R13, offsetof(struct svm_regctx, sctx_r13)); 45152SN/AASSYM(SCTX_R14, offsetof(struct svm_regctx, sctx_r14)); 46152SN/AASSYM(SCTX_R15, offsetof(struct svm_regctx, sctx_r15)); 47152SN/A 48152SN/A/* Guest only registers. */ 490SN/AASSYM(SCTX_GUEST_RDX, offsetof(struct svm_regctx, e.g.sctx_rdx)); 500SN/AASSYM(SCTX_GUEST_RDI, offsetof(struct svm_regctx, e.g.sctx_rdi)); 510SN/AASSYM(SCTX_GUEST_RSI, offsetof(struct svm_regctx, e.g.sctx_rsi)); 520SN/AASSYM(SCTX_GUEST_HCTX_BASE, offsetof(struct svm_regctx, e.g.sctx_hostctx_base)); 530SN/A 540SN/A/* Host only registers. */ 550SN/AASSYM(SCTX_HOST_GS, offsetof(struct svm_regctx, e.h.sctx_gs)); 560SN/AASSYM(SCTX_HOST_FS, offsetof(struct svm_regctx, e.h.sctx_fs)); 570SN/AASSYM(SCTX_HOST_RSP, offsetof(struct svm_regctx, e.h.sctx_rsp)); 580SN/A