1b18ac2d8SNeel Natu /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 3ebc3c37cSMarcelo Araujo * 4b18ac2d8SNeel Natu * Copyright (c) 2013 Anish Gupta (akgupt3@gmail.com) 5b18ac2d8SNeel Natu * All rights reserved. 6b18ac2d8SNeel Natu * 7b18ac2d8SNeel Natu * Redistribution and use in source and binary forms, with or without 8b18ac2d8SNeel Natu * modification, are permitted provided that the following conditions 9b18ac2d8SNeel Natu * are met: 10b18ac2d8SNeel Natu * 1. Redistributions of source code must retain the above copyright 11b18ac2d8SNeel Natu * notice unmodified, this list of conditions, and the following 12b18ac2d8SNeel Natu * disclaimer. 13b18ac2d8SNeel Natu * 2. Redistributions in binary form must reproduce the above copyright 14b18ac2d8SNeel Natu * notice, this list of conditions and the following disclaimer in the 15b18ac2d8SNeel Natu * documentation and/or other materials provided with the distribution. 16b18ac2d8SNeel Natu * 17b18ac2d8SNeel Natu * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18b18ac2d8SNeel Natu * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19b18ac2d8SNeel Natu * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20b18ac2d8SNeel Natu * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21b18ac2d8SNeel Natu * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22b18ac2d8SNeel Natu * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23b18ac2d8SNeel Natu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24b18ac2d8SNeel Natu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25b18ac2d8SNeel Natu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26b18ac2d8SNeel Natu * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27b18ac2d8SNeel Natu */ 28b18ac2d8SNeel Natu 29b18ac2d8SNeel Natu #include <sys/param.h> 30b18ac2d8SNeel Natu #include <sys/assym.h> 3190e528f8SNeel Natu #include <x86/specialreg.h> 32b18ac2d8SNeel Natu 33b18ac2d8SNeel Natu #include "svm.h" 34b18ac2d8SNeel Natu 35b18ac2d8SNeel Natu ASSYM(SCTX_RBX, offsetof(struct svm_regctx, sctx_rbx)); 36b18ac2d8SNeel Natu ASSYM(SCTX_RCX, offsetof(struct svm_regctx, sctx_rcx)); 37b18ac2d8SNeel Natu ASSYM(SCTX_RBP, offsetof(struct svm_regctx, sctx_rbp)); 3830571674SNeel Natu ASSYM(SCTX_RDX, offsetof(struct svm_regctx, sctx_rdx)); 3930571674SNeel Natu ASSYM(SCTX_RDI, offsetof(struct svm_regctx, sctx_rdi)); 4030571674SNeel Natu ASSYM(SCTX_RSI, offsetof(struct svm_regctx, sctx_rsi)); 41b18ac2d8SNeel Natu ASSYM(SCTX_R8, offsetof(struct svm_regctx, sctx_r8)); 42b18ac2d8SNeel Natu ASSYM(SCTX_R9, offsetof(struct svm_regctx, sctx_r9)); 43b18ac2d8SNeel Natu ASSYM(SCTX_R10, offsetof(struct svm_regctx, sctx_r10)); 44b18ac2d8SNeel Natu ASSYM(SCTX_R11, offsetof(struct svm_regctx, sctx_r11)); 45b18ac2d8SNeel Natu ASSYM(SCTX_R12, offsetof(struct svm_regctx, sctx_r12)); 46b18ac2d8SNeel Natu ASSYM(SCTX_R13, offsetof(struct svm_regctx, sctx_r13)); 47b18ac2d8SNeel Natu ASSYM(SCTX_R14, offsetof(struct svm_regctx, sctx_r14)); 48b18ac2d8SNeel Natu ASSYM(SCTX_R15, offsetof(struct svm_regctx, sctx_r15)); 4990e528f8SNeel Natu ASSYM(MSR_GSBASE, MSR_GSBASE); 50