pintos/src/devices/rtc.c File Reference

#include "devices/rtc.h"
#include <stdio.h>
#include "threads/io.h"

Go to the source code of this file.

Defines

#define CMOS_REG_SET   0x70
#define CMOS_REG_IO   0x71
#define RTC_REG_SEC   0
#define RTC_REG_MIN   2
#define RTC_REG_HOUR   4
#define RTC_REG_MDAY   7
#define RTC_REG_MON   8
#define RTC_REG_YEAR   9
#define RTC_REG_A   0x0a
#define RTC_REG_B   0x0b
#define RTC_REG_C   0x0c
#define RTC_REG_D   0x0d
#define RTCSA_UIP   0x80
#define RTCSB_SET   0x80
#define RTCSB_DM   0x04
#define RTCSB_24HR   0x02

Functions

static int bcd_to_bin (uint8_t)
static uint8_t cmos_read (uint8_t index)
time_t rtc_get_time (void)


Define Documentation

#define CMOS_REG_IO   0x71

Definition at line 12 of file rtc.c.

Referenced by cmos_read().

#define CMOS_REG_SET   0x70

Definition at line 11 of file rtc.c.

Referenced by cmos_read().

#define RTC_REG_A   0x0a

Definition at line 25 of file rtc.c.

#define RTC_REG_B   0x0b

Definition at line 26 of file rtc.c.

#define RTC_REG_C   0x0c

Definition at line 27 of file rtc.c.

#define RTC_REG_D   0x0d

Definition at line 28 of file rtc.c.

#define RTC_REG_HOUR   4

Definition at line 19 of file rtc.c.

Referenced by rtc_get_time().

#define RTC_REG_MDAY   7

Definition at line 20 of file rtc.c.

Referenced by rtc_get_time().

#define RTC_REG_MIN   2

Definition at line 18 of file rtc.c.

Referenced by rtc_get_time().

#define RTC_REG_MON   8

Definition at line 21 of file rtc.c.

Referenced by rtc_get_time().

#define RTC_REG_SEC   0

Definition at line 17 of file rtc.c.

Referenced by rtc_get_time().

#define RTC_REG_YEAR   9

Definition at line 22 of file rtc.c.

Referenced by rtc_get_time().

#define RTCSA_UIP   0x80

Definition at line 31 of file rtc.c.

#define RTCSB_24HR   0x02

Definition at line 36 of file rtc.c.

#define RTCSB_DM   0x04

Definition at line 35 of file rtc.c.

#define RTCSB_SET   0x80

Definition at line 34 of file rtc.c.


Function Documentation

static int bcd_to_bin ( uint8_t  x  )  [static]

Definition at line 101 of file rtc.c.

Referenced by rtc_get_time().

static uint8_t cmos_read ( uint8_t  index  )  [static]

Definition at line 109 of file rtc.c.

References CMOS_REG_IO, CMOS_REG_SET, inb(), and outb().

Referenced by rtc_get_time().

time_t rtc_get_time ( void   ) 

Definition at line 44 of file rtc.c.

References bcd_to_bin(), cmos_read(), RTC_REG_HOUR, RTC_REG_MDAY, RTC_REG_MIN, RTC_REG_MON, RTC_REG_SEC, and RTC_REG_YEAR.

Referenced by parse_options().


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6