Skip to content

Commit

Permalink
Remove reserved bit
Browse files Browse the repository at this point in the history
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>
  • Loading branch information
tsoutsman committed Sep 7, 2023
1 parent 1a32546 commit 53c2206
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions kernel/context_switch_regular/src/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,9 @@ impl ContextRegular {
/// Task containing it to begin its execution at the given `rip`.
pub fn new(rip: usize) -> ContextRegular {
ContextRegular {
// From Intel Manual Volume 1, Chapter 3.4.3:
//
// > Following initialization of the processor the state of the
// > EFLAGS register is 00000002H.
//
// Technically speaking, I don't think it's strictly necessary to
// set the first bit, because `popfq` will ignore reserved bits
// anyway, but it doesn't hurt.
//
// The ninth bit is the interrupt enable flag.
rflags: 1 << 1 | 1 << 9,
// The ninth bit is the interrupt enable flag. When a task is first
// run, interrupts should already be enabled.
rflags: 1 << 9,
r15: 0,
r14: 0,
r13: 0,
Expand Down

0 comments on commit 53c2206

Please sign in to comment.