📄 tss.hxx
字号:
#ifndef __TSS_HXX__#define __TSS_HXX__/* * Copyright (C) 1998, 1999, Jonathan S. Shapiro. * * This file is part of the EROS Operating System. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#include "Segment.hxx"/* Intel Task State Segment structure - all the zeros are here to * conform to the layout of the TSS as specified in the architecture. * By conforming, we get to make use of the hardware context switch * mechanisms, and it doesn't do any harm... */struct i386TSS { uint32_t backLink; /* unused */ uint32_t esp0; uint32_t ss0; uint32_t esp1; uint32_t ss1; uint32_t esp2; uint32_t ss2; uint32_t cr3; /* cr3 in 386 manual - what's going on? */ uint32_t eip; uint32_t eflags; uint32_t eax; uint32_t ecx; uint32_t edx; uint32_t ebx; uint32_t esp; uint32_t ebp; uint32_t esi; uint32_t edi; uint32_t es; uint32_t cs; uint32_t ss; uint32_t ds; uint32_t fs; uint32_t gs; uint32_t ldtr; /* local descriptor table segment */ uint16_t trapOnSwitch; /* must be 0 or 1. */ uint16_t ioMapBase; /* should be == sizeof(i386TSS) */} ;class TSS { static i386TSS TaskTable; static void ltss(Selector::Name);public: static void Init(); static void SetEntrySP(kva_t sp0) { TaskTable.esp0 = sp0; } static void SetMappingTable(uint32_t cr3) { TaskTable.cr3 = cr3; }};#endif /* __TSS_HXX__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -