hw_x86_64: Make Tss member functions non-static

Add appropriate Tss object to Genode::Cpu class.
This commit is contained in:
Reto Buerki 2015-02-26 20:41:32 +01:00 committed by Christian Helmuth
parent ec028ea06f
commit 34a25d3160
4 changed files with 10 additions and 17 deletions

View File

@ -42,6 +42,7 @@ class Genode::Cpu
{
private:
Idt *_idt;
Tss _tss;
public:
@ -51,11 +52,10 @@ class Genode::Cpu
if (primary_id() == executing_id()) {
_idt = new (&_mt_idt) Idt();
_idt->setup();
Tss::setup();
_tss.load();
}
_idt->load(Cpu::exception_entry);
Tss::load();
_tss.setup();
}
static constexpr addr_t exception_entry = 0x0; /* XXX */

View File

@ -31,22 +31,17 @@ class Genode::Tss
uint16_t : 16;
uint16_t iomap_base;
/**
* TSS
*/
static Tss _tss asm ("_tss");
public:
/**
* Setup TSS.
*/
static void setup();
void setup();
/**
* Load TSS into TR.
*/
static void load();
void load();
}__attribute__((packed));

View File

@ -281,9 +281,9 @@
/* GDTE_LONG | GDTE_PRESENT | GDTE_TYPE_DATA_A | GDTE_TYPE_DATA_W | GDTE_NON_SYSTEM */
.long 0x20f300
/* Task segment descriptor */
.long 0x01000068
.long 0x35b10068
/* GDTE_PRESENT | GDTE_SYS_TSS */
.long 0x893a
.long 0x8929
.long 0
.long 0
_gdt_end:

View File

@ -4,13 +4,11 @@ using namespace Genode;
extern char kernel_stack[];
__attribute__((aligned(8))) Tss Tss::_tss;
void Tss::setup()
{
_tss.rsp0 = (addr_t)kernel_stack;
_tss.rsp1 = (addr_t)kernel_stack;
_tss.rsp2 = (addr_t)kernel_stack;
this->rsp0 = (addr_t)kernel_stack;
this->rsp1 = (addr_t)kernel_stack;
this->rsp2 = (addr_t)kernel_stack;
}