2009-05-03 Joel Sherrill <joel.sherrill@oarcorp.com>

* libchip/rtc/ds1375.c, libchip/rtc/mc146818a.c: Fix warnings. Reformat
	as needed.
This commit is contained in:
Joel Sherrill
2009-05-04 00:53:45 +00:00
parent 81fb3d3646
commit 9c2eacafea
3 changed files with 255 additions and 236 deletions

View File

@@ -1,3 +1,8 @@
2009-05-03 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/rtc/ds1375.c, libchip/rtc/mc146818a.c: Fix warnings. Reformat
as needed.
2009-04-29 Chris Johns <chrisj@rtems.org>
* libchip/ide/ata.c: Remove a detection test that fails in qemu.

View File

@@ -103,8 +103,6 @@ uint8_t h = x/10;
* starting at the seconds (for the 1375 both,
* _REG and _OFF happen to be identical).
*/
#define DS1375_SEC_REG 0x0
#define DS1375_SEC_OFF (DS1375_SEC_REG-DS1375_SEC_REG)
/* Extract seconds and convert to binary */
@@ -165,16 +163,24 @@ uint8_t h = x/10;
/* Access Primitives */
STATIC int
rd_bytes( int fd, uint32_t off, uint8_t *buf, int len )
STATIC int rd_bytes(
int fd,
uint32_t off,
uint8_t *buf,
int len
)
{
uint8_t ptr = off;
return 1 == write( fd, &ptr, 1 ) && len == read( fd, buf, len ) ? 0 : -1;
}
STATIC int
wr_bytes( int fd, uint32_t off, uint8_t *buf, int len )
STATIC int wr_bytes(
int fd,
uint32_t off,
uint8_t *buf,
int len
)
{
uint8_t d[ len + 1 ];
@@ -193,16 +199,18 @@ uint8_t d[ len + 1 ];
/* Helpers */
static int
getfd( int minor )
static int getfd(
int minor
)
{
return open( (const char *)RTC_Table[minor].ulCtrlPort1, O_RDWR );
}
/* Driver Access Functions */
STATIC void
ds1375_initialize( int minor )
STATIC void ds1375_initialize(
int minor
)
{
int fd;
uint8_t cr;
@@ -220,8 +228,10 @@ uint8_t cr;
}
STATIC int
ds1375_get_time( int minor, rtems_time_of_day *time )
STATIC int ds1375_get_time(
int minor,
rtems_time_of_day *time
)
{
int rval = -1;
int fd;
@@ -252,8 +262,10 @@ uint8_t buf[DS1375_YR_REG + 1 - DS1375_SEC_REG];
return rval;
}
STATIC int
ds1375_set_time( int minor, rtems_time_of_day *time )
STATIC int ds1375_set_time(
int minor,
const rtems_time_of_day *time
)
{
int rval = -1;
int fd = -1;
@@ -261,6 +273,7 @@ time_t secs;
struct tm tm;
uint8_t buf[DS1375_YR_REG + 1 - DS1375_SEC_REG];
uint8_t cr = 0xff;
/*
* The clock hardware maintains the day-of-week as a separate counter
* so we must compute it ourselves (rtems_time_of_day doesn't come
@@ -412,8 +425,9 @@ uint8_t v = value;
}
bool
rtc_ds1375_device_probe( int minor )
bool rtc_ds1375_device_probe(
int minor
)
{
int fd;

View File

@@ -135,7 +135,7 @@ int mc146818a_get_time(
*/
int mc146818a_set_time(
int minor,
rtems_time_of_day *time
const rtems_time_of_day *time
)
{
uint32_t mc146818a;