Xyris  0.5
Arch::CPU Namespace Reference

Functions

void init ()
 
void interruptsDisable ()
 
void interruptsEnable ()
 
template<typename Function >
void criticalRegion (Function critWork)
 
const char * vendor ()
 
const char * model ()
 

Function Documentation

◆ criticalRegion()

template<typename Function >
void Arch::CPU::criticalRegion ( Function  critWork)

Definition at line 82 of file Arch.hpp.

83 {
85  critWork();
87 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

void Arch::CPU::init ( )

Definition at line 110 of file Arch.i686.cpp.

111 {
112  criticalRegion([]() {
113  GDT::init(); // Initialize the Global Descriptor Table
114  Interrupts::init(); // Initialize Interrupt Service Requests
115  timer_init(1000); // Programmable Interrupt Timer (1ms)
116  });
117 }
+ Here is the call graph for this function:

◆ interruptsDisable()

void Arch::CPU::interruptsDisable ( )

Definition at line 119 of file Arch.i686.cpp.

119  {
120  asm volatile("cli");
121 }
+ Here is the caller graph for this function:

◆ interruptsEnable()

void Arch::CPU::interruptsEnable ( )

Definition at line 123 of file Arch.i686.cpp.

123  {
124  asm volatile("sti");
125 }
+ Here is the caller graph for this function:

◆ model()

const char * Arch::CPU::model ( )

Definition at line 134 of file Arch.i686.cpp.

135 {
136  static int model[12];
137  __cpuid(0x80000002, model[0], model[1], model[2], model[3]);
138  __cpuid(0x80000003, model[4], model[5], model[6], model[7]);
139  __cpuid(0x80000004, model[8], model[9], model[10], model[11]);
140  return (char*)model;
141 }

◆ vendor()

const char * Arch::CPU::vendor ( )

Definition at line 127 of file Arch.i686.cpp.

128 {
129  static int vendor[4];
130  __cpuid(0, vendor[0], vendor[1], vendor[2], vendor[3]);
131  return (char*)vendor;
132 }
Interrupts::init
void init()
Definition: isr.cpp:70
Arch::CPU::criticalRegion
void criticalRegion(Function critWork)
Definition: Arch.hpp:82
Arch::CPU::vendor
const char * vendor()
Definition: Arch.i686.cpp:127
Arch::CPU::interruptsEnable
void interruptsEnable()
Definition: Arch.i686.cpp:123
timer_init
void timer_init(uint32_t freq)
Initialize the CPU timer with the given frequency.
Definition: timer.cpp:31
Arch::CPU::interruptsDisable
void interruptsDisable()
Definition: Arch.i686.cpp:119
Arch::CPU::model
const char * model()
Definition: Arch.i686.cpp:134
GDT::init
void init()
Setup and install the GDT onto the system.
Definition: gdt.cpp:22