33 #ifndef __DEV_8254_HH__
34 #define __DEV_8254_HH__
42 #include "debug/Intel8254Timer.hh"
102 void setTo(
int clocks);
160 void setRW(
int rw_val);
263 #endif // __DEV_8254_HH__
void setBCD(int bcd_val)
Set count encoding.
EndBitUnion(CtrlReg) enum SelectVal
virtual ~Intel8254Timer()
void writeControl(const CtrlReg data)
Write control word.
uint16_t initial_count
Initial count value.
const std::string & name() const
Programmable Interval Timer (Intel 8254)
Intel8254Timer * parent
Pointer to container.
Intel8254Timer(EventManager *em, const std::string &name, Counter *counter0, Counter *counter1, Counter *counter2)
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
Counter * counter
Pointer back to Counter.
void latchCount()
Latch the current count (if one is not already latched)
uint8_t readCounter(unsigned int num)
void setRW(int rw_val)
Set the read/write mode.
BitUnion8(CtrlReg) Bitfield<7
void writeCounter(unsigned int num, const uint8_t data)
void startup()
Start ticking.
void startup()
Start ticking.
bool outputHigh(unsigned int num)
bool running
True after startup is called.
virtual void counterInterrupt(unsigned int num)
uint8_t mode
Current mode of operation.
bool output_high
Output goes high when the counter reaches zero.
uint64_t Tick
Tick count type.
uint8_t read_byte
Determine which byte of a 16-bit count value to read/write.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
virtual const char * description() const
Event description.
int64_t Counter
Statistics counter type.
void setMode(int mode_val)
Set operational mode.
bool latch_on
State of the count latch.
Counter(Intel8254Timer *p, const std::string &name, unsigned int num)
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.
bool outputHigh()
Is the output high?
void process()
Event process.
const std::string & name() const
std::ostream CheckpointOut
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
Counter * counter[3]
PIT has three seperate counters.
int currentCount()
Get the current count for this counter.
Event for counter interrupt.
uint16_t latched_count
Latched count.
uint8_t read()
Read a count byte.
void write(const uint8_t data)
Write a count byte.
uint16_t period
Interrupt period.
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.
Tick offset
When to start ticking.