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
const std::string & name() 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.
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?
Counter(Intel8254Timer *p, const std::string &name, unsigned int num)
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)
EndBitUnion(CtrlReg) BitUnion8(ReadBackCommandVal) Bitfield< 4 > status
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.
const std::string & name() const
uint8_t readCounter(unsigned int num)
virtual ~Intel8254Timer()
void writeControl(const CtrlReg data)
Write control word.
SubBitUnion(select, 3, 1) Bitfield< 3 > cnt2
EndSubBitUnion(select) EndBitUnion(ReadBackCommandVal) enum SelectVal
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::ostream CheckpointOut
uint64_t Tick
Tick count type.