libchip/rtc/mc146818a*: Fix prototypes to use uintptr_t and fix set but unused warning

This commit is contained in:
Joel Sherrill
2014-10-09 10:01:34 -05:00
parent a3ae261a14
commit 79f093bdd1
2 changed files with 17 additions and 11 deletions

View File

@@ -54,12 +54,12 @@ bool mc146818a_probe(
* Default register access routines
*/
uint32_t mc146818a_get_register(
uint32_t ulCtrlPort,
uintptr_t ulCtrlPort,
uint8_t ucRegNum
);
void mc146818a_set_register(
uint32_t ulCtrlPort,
uintptr_t ulCtrlPort,
uint8_t ucRegNum,
uint32_t ucData
);

View File

@@ -5,7 +5,9 @@
* + registers are in I/O space
* + registers are accessed as bytes
* + registers are only byte-aligned (no address gaps)
*
*/
/*
* COPYRIGHT (c) 1989-1997.
* On-Line Applications Research Corporation (OAR).
*
@@ -16,6 +18,8 @@
#include <rtems.h>
#include <bsp.h>
#include <libchip/rtc.h>
#include <libchip/mc146818a.h>
/*
* At this point, not all CPUs or BSPs have defined in/out port routines.
@@ -23,13 +27,15 @@
#if defined(__i386__) || defined(__PPC__)
#if defined(inport_byte)
uint32_t mc146818a_get_register(
uint32_t ulCtrlPort,
uintptr_t ulCtrlPort,
uint8_t ucRegNum
)
{
uint8_t val;
uint8_t tmp;
(void) tmp; /* eliminate warning for set but not used */
outport_byte( ulCtrlPort, ucRegNum );
inport_byte( 0x84, tmp ); /* Hack a delay to give chip time to settle */
inport_byte( ulCtrlPort+1, val );
@@ -38,7 +44,7 @@ uint32_t mc146818a_get_register(
}
void mc146818a_set_register(
uint32_t ulCtrlPort,
uintptr_t ulCtrlPort,
uint8_t ucRegNum,
uint32_t ucData
)