Last change
on this file since 361d58e was
361d58e,
checked in by cvs2git <rtems-devel@…>, on 10/11/04 at 20:13:32
|
This commit was manufactured by cvs2svn to create branch 'rtems-4-6-branch'.
Cherrypick from master 2004-10-11 20:13:31 UTC Eric Norum <WENorum@…> 'Don't get duplication rtc_probe() definitions.':
c/src/lib/libbsp/i386/pc386/clock/todcfg.c
c/src/libchip/rtc/README.mc146818a
c/src/libchip/rtc/mc146818a.c
c/src/libchip/rtc/mc146818a.h
c/src/libchip/rtc/mc146818a_ioreg.c
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * This file contains a typical set of register access routines which may be |
---|
3 | * used with the MC146818A chip if accesses to the chip are as follows: |
---|
4 | * |
---|
5 | * + registers are in I/O space |
---|
6 | * + registers are accessed as bytes |
---|
7 | * + registers are only byte-aligned (no address gaps) |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-1997. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #include <rtems.h> |
---|
20 | #include <bsp.h> |
---|
21 | |
---|
22 | unsigned32 mc146818a_get_register( |
---|
23 | unsigned32 ulCtrlPort, |
---|
24 | unsigned8 ucRegNum |
---|
25 | ) |
---|
26 | { |
---|
27 | unsigned8 val; |
---|
28 | unsigned8 tmp; |
---|
29 | |
---|
30 | outport_byte( ulCtrlPort, ucRegNum ); |
---|
31 | inport_byte( 0x84, tmp ); /* Hack a delay to give chip time to settle */ |
---|
32 | inport_byte( ulCtrlPort+1, val ); |
---|
33 | inport_byte( 0x84, tmp ); /* Hack a delay to give chip time to settle */ |
---|
34 | return val; |
---|
35 | } |
---|
36 | |
---|
37 | void mc146818a_set_register( |
---|
38 | unsigned32 ulCtrlPort, |
---|
39 | unsigned8 ucRegNum, |
---|
40 | unsigned32 ucData |
---|
41 | ) |
---|
42 | { |
---|
43 | outport_byte( ulCtrlPort, ucRegNum ); |
---|
44 | outport_byte( ulCtrlPort+1, (unsigned8)ucData ); |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.