1 /* 2 * Copyright (c) 2009 Corey Tabaka 3 * Copyright (c) 2015-2018 Intel Corporation 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining 6 * a copy of this software and associated documentation files 7 * (the "Software"), to deal in the Software without restriction, 8 * including without limitation the rights to use, copy, modify, merge, 9 * publish, distribute, sublicense, and/or sell copies of the Software, 10 * and to permit persons to whom the Software is furnished to do so, 11 * subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be 14 * included in all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 */ 24 #pragma once 25 26 #include <sys/types.h> 27 28 #define IF_MASK 0x0200 29 #define IOPL_MASK 0x3000 30 #define RSVD 0x0002 31 32 /* 0x3202 */ 33 #define USER_EFLAGS (IF_MASK|IOPL_MASK|RSVD) 34 35 /* SYSCALL Handling */ 36 #define SYSENTER_CS_MSR 0x174 37 #define SYSENTER_ESP_MSR 0x175 38 #define SYSENTER_EIP_MSR 0x176 39 40 struct arch_thread { 41 vaddr_t sp; 42 vaddr_t fs_base; 43 #if X86_WITH_FPU 44 vaddr_t *fpu_states; 45 uint8_t fpu_buffer[512 + 16]; 46 #endif 47 }; 48 49