StuBS
lapic_timer.cc File Reference
#include "types.h"
#include "machine/lapic.h"
#include "machine/lapic_registers.h"
#include "machine/core.h"
Include dependency graph for lapic_timer.cc:

Classes

struct  LAPIC::Timer::ControlRegister.__unnamed45__
 

Namespaces

namespace  LAPIC
 Abstracts the local APIC (which is integrated into every CPU core)
 
namespace  LAPIC::Timer
 Local Timer (for each LAPIC / CPU)
 

Enumerations

enum  LAPIC::Timer::DeliveryStatus {
  LAPIC::Timer::IDLE = 0 ,
  LAPIC::Timer::SEND_PENDING = 1
}
 Timer Delivery Status. More...
 
enum  LAPIC::Timer::TimerMode {
  LAPIC::Timer::ONE_SHOT = 0 ,
  LAPIC::Timer::PERIODIC = 1 ,
  LAPIC::Timer::DEADLINE = 2
}
 Timer Mode. More...
 
enum  LAPIC::Timer::Mask {
  LAPIC::Timer::NOT_MASKED = 0 ,
  LAPIC::Timer::MASKED = 1
}
 Timer Mask. More...
 

Functions

Register LAPIC::Timer::getClockDiv (uint8_t div)
 Calculate the bit mask for the LAPIC-timer divider.
 
uint32_t LAPIC::Timer::ticks (void)
 Determines the LAPIC timer frequency.
 
void LAPIC::Timer::set (uint32_t counter, uint8_t divide, uint8_t vector, bool periodic, bool masked=false)
 Set the LAPIC timer.
 

Constants

static const Register LAPIC::Timer::INVALID_DIV = 0xff
 
static const Register LAPIC::Timer::div_masks []
 LAPIC timer divider table.
 

Class Documentation

◆ LAPIC::Timer::ControlRegister.__unnamed45__

struct LAPIC::Timer::ControlRegister.__unnamed45__
Class Members
uint32_t vector: 8 Vector.
uint32_t __pad0__: 4
DeliveryStatus delivery_status: 1 Delivery Status.
uint32_t __pad1__: 3
Mask masked: 1 Interrupt Mask (if set, interrupt will not trigger)
TimerMode timer_mode: 2 Timer Mode.
uint32_t __pad2__: 13