/* * Copyright 2010 Stefan Lankes, Chair for Operating Systems, * RWTH Aachen University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is part of MetalSVM. */ /** * @author Stefan Lankes * @file arch/x86/include/asm/tss.h * @brief Task state segment structure definition */ #ifndef __ARCH_TSS_H__ #define __ARCH_TSS_H__ #include #ifdef __cplusplus extern "C" { #endif /** @brief The tast state segment structure */ typedef struct { #ifdef CONFIG_X86_32 uint16_t backlink, __blh; uint32_t esp0; uint16_t ss0, __ss0h; uint32_t esp1; uint16_t ss1, __ss1h; uint32_t esp2; uint16_t ss2, __ss2h; uint32_t cr3; uint32_t eip; uint32_t eflags; uint32_t eax, ecx, edx, ebx; uint32_t esp, ebp, esi, edi; uint16_t es, __esh; uint16_t cs, __csh; uint16_t ss, __ssh; uint16_t ds, __dsh; uint16_t fs, __fsh; uint16_t gs, __gsh; uint16_t ldt, __ldth; uint16_t trace, bitmap; #endif #ifdef CONFIG_X86_64 uint16_t res0, res1; // reserved entries uint64_t rsp0; uint64_t rsp1; uint64_t rsp2; uint32_t res2, res3; // reserved entries uint64_t ist_rsp1; uint64_t ist_rsp2; uint64_t ist_rsp3; uint64_t ist_rsp4; uint64_t ist_rsp5; uint64_t ist_rsp6; uint64_t ist_rsp7; uint32_t res4, res5; // reserved entries uint16_t res6, bitmap; #endif } __attribute__ ((packed)) tss_t; #ifdef __cplusplus } #endif #endif