29#ifndef __DEV_8254_HH__
30#define __DEV_8254_HH__
39#include "debug/Intel8254Timer.hh"
115 void setTo(
int clocks);
175 void setRW(
int rw_val);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Event for counter interrupt.
Counter * counter
Pointer back to Counter.
virtual const char * description() const
Event description.
void process()
Event process.
uint16_t initial_count
Initial count value.
uint8_t read()
Read a count byte.
void setMode(int mode_val)
Set operational mode.
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
uint16_t period
Interrupt period.
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.
uint16_t latched_count
Latched count.
unsigned int index() const
uint8_t read_byte
Determine which byte of a 16-bit count value to read/write.
Intel8254Timer * parent
Pointer to container.
bool output_high
Output goes high when the counter reaches zero.
void setBCD(int bcd_val)
Set count encoding.
const std::string & name() const
void startup()
Start ticking.
bool latch_on
State of the count latch.
void latchCount()
Latch the current count (if one is not already latched)
bool outputHigh()
Is the output high?
uint8_t mode
Current mode of operation.
bool running
True after startup is called.
Tick offset
When to start ticking.
int currentCount()
Get the current count for this counter.
void setRW(int rw_val)
Set the read/write mode.
void write(const uint8_t data)
Write a count byte.
Programmable Interval Timer (Intel 8254)
bool outputHigh(unsigned int num)
void writeCounter(unsigned int num, const uint8_t data)
const std::string & name() const
Intel8254Timer(EventManager *em, const std::string &name)
virtual void counterInterrupt(unsigned int num)
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
std::array< Counter, 3 > counters
PIT has three seperate counters.
void startup()
Start ticking.
BitUnion8(CtrlReg) Bitfield< 7
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.
uint8_t readCounter(unsigned int num)
virtual ~Intel8254Timer()
void writeControl(const CtrlReg data)
Write control word.
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
#define SubBitUnion(name, first, last)
Regular bitfields These define macros for read/write regular bitfield based subbitfields.
#define EndSubBitUnion(name)
This closes off the union created above and gives it a name.
double Counter
All counters are of 64-bit values.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.