NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Rtc146818 Class Reference

Device model for the MC146818 realtime clock. More...

Inheritance diagram for Rtc146818:
StaticReceiver< Rtc146818 > Device

Public Member Functions

void reset (MessageTime &time)
bool receive (MessageIOIn &msg)
bool receive (MessageIOOut &msg)
bool receive (MessageIrqNotify &msg)
bool receive (MessageTimeout &msg)
 Rtc146818 (DBus< MessageTimer > &bus_timer, DBus< MessageIrqLines > &bus_irqlines, Clock *clock, unsigned timer, unsigned short iobase, unsigned irq)
- Public Member Functions inherited from StaticReceiver< Rtc146818 >
 StaticReceiver ()
- Public Member Functions inherited from Device
void debug_dump ()
 Device (const char *debug_name)

Private Types

enum  { FREQ = 32768, tBUC = 8, tUC = 65 }
 Timing: More...

Private Member Functions

unsigned char convert_bcd (unsigned char value)
unsigned char ram (unsigned char index)
 Read values from RAM and convert time information from BCD and 12h format.
int get_divider ()
timevalue get_counter ()
unsigned get_periodic_tics ()
void set_irqflags (unsigned char value)
 Set the IRQ flags and raise an IRQ if needed.
timevalue get_ram_time ()
 Return the time from the RAM locations.
void update_ram (timevalue seconds)
 Update the time with the given seconds.
timevalue next_alarm (timevalue seconds)
 Returns the time of the next alarm in seconds.
unsigned update_cycle (timevalue now)
 Performs an update cycle and updates the time in the RAM.
void update_timer (timevalue last_seconds, timevalue now)
 Reprogram the next timer.

Private Attributes

DBus< MessageTimer > & _bus_timer
DBus< MessageIrqLines > & _bus_irqlines
Clock_clock
unsigned _timer
unsigned short _iobase
unsigned _irq
unsigned char _index
unsigned char _ram [128]
timevalue _offset
timevalue _last

Friends

class RtcTest

Additional Inherited Members

- Static Public Member Functions inherited from StaticReceiver< Rtc146818 >
static bool receive_static (Device *o, M &msg)

Detailed Description

Device model for the MC146818 realtime clock.

State: testing Features: 128byte RAM, gettime, updatetime, UIE, alarm, periodic-irqs, divider Missing: daylight-saving Unused: sqw-output Documentation: rtc82885.pdf, MC146818AS.pdf, Intel ICH{3-7} documentation

Member Enumeration Documentation

anonymous enum
private

Timing:

  1. seconds are updated at us == 0
  2. UIP is set from [FREQ-tBUC-tUC, FREQ-1]
  3. the update happens from [FREQ-tUC, FREQ-1]
  4. the periodic IRQ happens at (period/2, 3*period/2,) ...
Enumerator:
FREQ 
tBUC 
tUC 

Constructor & Destructor Documentation

Rtc146818::Rtc146818 ( DBus< MessageTimer > &  bus_timer,
DBus< MessageIrqLines > &  bus_irqlines,
Clock clock,
unsigned  timer,
unsigned short  iobase,
unsigned  irq 
)
inline

Member Function Documentation

unsigned char Rtc146818::convert_bcd ( unsigned char  value)
inlineprivate
timevalue Rtc146818::get_counter ( )
inlineprivate
int Rtc146818::get_divider ( )
inlineprivate
unsigned Rtc146818::get_periodic_tics ( )
inlineprivate
timevalue Rtc146818::get_ram_time ( )
inlineprivate

Return the time from the RAM locations.

timevalue Rtc146818::next_alarm ( timevalue  seconds)
inlineprivate

Returns the time of the next alarm in seconds.

unsigned char Rtc146818::ram ( unsigned char  index)
inlineprivate

Read values from RAM and convert time information from BCD and 12h format.

bool Rtc146818::receive ( MessageIOIn msg)
inline
bool Rtc146818::receive ( MessageIOOut msg)
inline
bool Rtc146818::receive ( MessageIrqNotify msg)
inline
bool Rtc146818::receive ( MessageTimeout msg)
inline
void Rtc146818::reset ( MessageTime time)
inline
void Rtc146818::set_irqflags ( unsigned char  value)
inlineprivate

Set the IRQ flags and raise an IRQ if needed.

unsigned Rtc146818::update_cycle ( timevalue  now)
inlineprivate

Performs an update cycle and updates the time in the RAM.

void Rtc146818::update_ram ( timevalue  seconds)
inlineprivate

Update the time with the given seconds.

void Rtc146818::update_timer ( timevalue  last_seconds,
timevalue  now 
)
inlineprivate

Reprogram the next timer.

Friends And Related Function Documentation

friend class RtcTest
friend

Member Data Documentation

DBus<MessageIrqLines>& Rtc146818::_bus_irqlines
private
DBus<MessageTimer>& Rtc146818::_bus_timer
private
Clock* Rtc146818::_clock
private
unsigned char Rtc146818::_index
private
unsigned short Rtc146818::_iobase
private
unsigned Rtc146818::_irq
private
timevalue Rtc146818::_last
private
timevalue Rtc146818::_offset
private
unsigned char Rtc146818::_ram[128]
private
unsigned Rtc146818::_timer
private

The documentation for this class was generated from the following file: