mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
hw_x86_64: Set EFLAGS IF, IOPL bits in Cpu::init_thread
Enable interrupts for all threads, set I/O privilege level (IOPL) to 3 for core threads to allow UART access.
This commit is contained in:
parent
7ce8464b3a
commit
69a58c4bd5
@ -275,6 +275,13 @@ class Genode::Cpu
|
||||
Kernel::Call_arg user_arg_6() const { return r10; }
|
||||
Kernel::Call_arg user_arg_7() const { return r11; }
|
||||
|
||||
/* Constants to handle thread-specific IF, IOPL values */
|
||||
enum {
|
||||
CORE_PD_ID = 1,
|
||||
EFLAGS_IF_SET = 1 << 9,
|
||||
EFLAGS_IOPL_3 = 3 << 12,
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize thread context
|
||||
*
|
||||
@ -287,6 +294,16 @@ class Genode::Cpu
|
||||
translation_table(table);
|
||||
|
||||
Gdt::load(Cpu::exception_entry);
|
||||
|
||||
/*
|
||||
* Enable interrupts for all threads, set I/O privilege level
|
||||
* (IOPL) to 3 for core threads to allow UART access.
|
||||
*/
|
||||
eflags = EFLAGS_IF_SET;
|
||||
if (pd_id == CORE_PD_ID)
|
||||
{
|
||||
eflags |= EFLAGS_IOPL_3;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -203,9 +203,6 @@
|
||||
mov $_mt_buffer+BUFFER_SIZE, %rsp
|
||||
pushq $0x23
|
||||
pushq SP_OFFSET(%rax)
|
||||
|
||||
/* Set I/O privilege level to 3 and enable interrupts */
|
||||
orq $0x3200, FLAGS_OFFSET(%rax)
|
||||
pushq FLAGS_OFFSET(%rax)
|
||||
|
||||
pushq $0x1b
|
||||
|
Loading…
x
Reference in New Issue
Block a user