MonkOS  v0.1
A simple 64-bit operating system (x86_64)
cpu.h File Reference

x86 CPU-specific function implementations. More...

#include <core.h>
#include "cpu_inl.h"

Go to the source code of this file.

Data Structures

struct  registers_t
 A record describing all 64-bit general-purpose registers. More...
 
struct  registers4_t
 A record describing the first 4 general-purpose registers. More...
 

Macros

#define CPU_EFLAGS_CARRY   (1 << 0)
 
#define CPU_EFLAGS_PARITY   (1 << 2)
 
#define CPU_EFLAGS_ADJUST   (1 << 4)
 
#define CPU_EFLAGS_ZERO   (1 << 6)
 
#define CPU_EFLAGS_SIGN   (1 << 7)
 
#define CPU_EFLAGS_TRAP   (1 << 8)
 
#define CPU_EFLAGS_INTERRUPT   (1 << 9)
 
#define CPU_EFLAGS_DIRECTION   (1 << 10)
 
#define CPU_EFLAGS_OVERFLOW   (1 << 11)
 
#define CPU_EFLAGS_IOPL1   (1 << 12)
 
#define CPU_EFLAGS_IOPL0   (1 << 13)
 
#define CPU_EFLAGS_NESTED   (1 << 14)
 
#define CPU_EFLAGS_RESUME   (1 << 16)
 
#define CPU_EFLAGS_V8086   (1 << 17)
 
#define CPU_EFLAGS_ALIGNCHECK   (1 << 18)
 
#define CPU_EFLAGS_VINTERRUPT   (1 << 19)
 
#define CPU_EFLAGS_VPENDING   (1 << 20)
 
#define CPU_EFLAGS_CPUID   (1 << 21)
 

Detailed Description

x86 CPU-specific function implementations.

Definition in file cpu.h.


Data Structure Documentation

struct registers_t

A record describing all 64-bit general-purpose registers.

Definition at line 38 of file cpu.h.

Data Fields
uint64_t rax
uint64_t rbx
uint64_t rcx
uint64_t rdx
uint64_t rsi
uint64_t rdi
uint64_t rbp
uint64_t r8
uint64_t r9
uint64_t r10
uint64_t r11
uint64_t r12
uint64_t r13
uint64_t r14
uint64_t r15
struct registers4_t

A record describing the first 4 general-purpose registers.

Definition at line 61 of file cpu.h.

Data Fields
uint64_t rax
uint64_t rbx
uint64_t rcx
uint64_t rdx

Macro Definition Documentation

#define CPU_EFLAGS_CARRY   (1 << 0)

Definition at line 15 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_PARITY   (1 << 2)

Definition at line 16 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_ADJUST   (1 << 4)

Definition at line 17 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_ZERO   (1 << 6)

Definition at line 18 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_SIGN   (1 << 7)

Definition at line 19 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_TRAP   (1 << 8)

Definition at line 20 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_INTERRUPT   (1 << 9)

Definition at line 21 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_DIRECTION   (1 << 10)

Definition at line 22 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_OVERFLOW   (1 << 11)

Definition at line 23 of file cpu.h.

Referenced by dump_cpuflags().

#define CPU_EFLAGS_IOPL1   (1 << 12)

Definition at line 24 of file cpu.h.

#define CPU_EFLAGS_IOPL0   (1 << 13)

Definition at line 25 of file cpu.h.

#define CPU_EFLAGS_NESTED   (1 << 14)

Definition at line 26 of file cpu.h.

#define CPU_EFLAGS_RESUME   (1 << 16)

Definition at line 27 of file cpu.h.

#define CPU_EFLAGS_V8086   (1 << 17)

Definition at line 28 of file cpu.h.

#define CPU_EFLAGS_ALIGNCHECK   (1 << 18)

Definition at line 29 of file cpu.h.

#define CPU_EFLAGS_VINTERRUPT   (1 << 19)

Definition at line 30 of file cpu.h.

#define CPU_EFLAGS_VPENDING   (1 << 20)

Definition at line 31 of file cpu.h.

#define CPU_EFLAGS_CPUID   (1 << 21)

Definition at line 32 of file cpu.h.