UnnamedOS
cpu_state_t Struct Reference

The CPU's state when an interrupt occurs. More...

#include <isr.h>

+ Collaboration diagram for cpu_state_t:

Data Fields

uint16_t gs
 GS segment register.
 
uint16_t fs
 FS segment register.
 
uint16_t es
 ES segment register.
 
uint16_t ds
 DS segment register.
 
uint16_t isr_registers_t r: 16
 The general purpose registers. More...
 
uint32_t intr
 the interrupt vector of the fired interrupt
 
uint32_t error
 hold an error code if an error occured, otherwise 0
 
uint32_t eip
 the instruction to return to after the interrupt
 
uint16_t cs
 the code segment to return to after the interrupt
 
uint16_t isr_eflags_t eflags: 16
 the EFLAGS register before the interrupt was fired
 
uint32_t user_esp
 stack pointer (only pushed and popped in user space)
 
uint32_t user_ss
 stack segment (only pushed and popped in user space)
 
uint16_t vm86_es
 ES register (only pushed and popped in VM86 mode)
 
uint16_t vm86_ds
 DS register (only pushed and popped in VM86 mode)
 
uint16_t vm86_fs
 FS register (only pushed and popped in VM86 mode)
 
uint16_t vm86_gs
 GS register (only pushed and popped in VM86 mode)
 

Detailed Description

The CPU's state when an interrupt occurs.

For every task, it is saved on a separate stack and restored when that particular task is switched to.

See also
isr_common in isr_asm.S

Definition at line 58 of file isr.h.

Field Documentation

uint16_t isr_registers_t cpu_state_t::r

The general purpose registers.

We do not use the ESP pushed here by pusha at all because popa ignores it.

Definition at line 60 of file isr.h.


The documentation for this struct was generated from the following file: