summaryrefslogtreecommitdiffstats
path: root/c/src/libchip
diff options
context:
space:
mode:
authorThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2008-09-22 11:45:25 +0000
committerThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2008-09-22 11:45:25 +0000
commit31c14d9043a3a06ba49a71f17786b2d007d89f71 (patch)
tree9b2de4f759e97bde420e44a7e6639349480baaff /c/src/libchip
parentcorrect DEC clock rate for non-U-Boot case (diff)
downloadrtems-31c14d9043a3a06ba49a71f17786b2d007d89f71.tar.bz2
Include required header files. Some internal functions have now static linkage type. Added constant qualifier to operations table and read-only function parameters.
Diffstat (limited to 'c/src/libchip')
-rw-r--r--c/src/libchip/rtc/icm7170.c8
-rw-r--r--c/src/libchip/rtc/m48t08.c8
-rw-r--r--c/src/libchip/rtc/rtc.h13
3 files changed, 16 insertions, 13 deletions
diff --git a/c/src/libchip/rtc/icm7170.c b/c/src/libchip/rtc/icm7170.c
index 1c7827b7ae..f5b69c82d6 100644
--- a/c/src/libchip/rtc/icm7170.c
+++ b/c/src/libchip/rtc/icm7170.c
@@ -37,7 +37,7 @@
* icm7170_initialize
*/
-void icm7170_initialize(
+static void icm7170_initialize(
int minor
)
{
@@ -60,7 +60,7 @@ void icm7170_initialize(
* icm7170_get_time
*/
-int icm7170_get_time(
+static int icm7170_get_time(
int minor,
rtems_time_of_day *time
)
@@ -113,9 +113,9 @@ int icm7170_get_time(
* icm7170_set_time
*/
-int icm7170_set_time(
+static int icm7170_set_time(
int minor,
- rtems_time_of_day *time
+ const rtems_time_of_day *time
)
{
uint32_t icm7170;
diff --git a/c/src/libchip/rtc/m48t08.c b/c/src/libchip/rtc/m48t08.c
index b8412611b2..128f8c775a 100644
--- a/c/src/libchip/rtc/m48t08.c
+++ b/c/src/libchip/rtc/m48t08.c
@@ -39,7 +39,7 @@
* m48t08_initialize
*/
-void m48t08_initialize(
+static void m48t08_initialize(
int minor
)
{
@@ -52,7 +52,7 @@ void m48t08_initialize(
#define From_BCD( _x ) ((((_x) >> 4) * 10) + ((_x) & 0x0F))
#define To_BCD( _x ) ((((_x) / 10) << 4) + ((_x) % 10))
-int m48t08_get_time(
+static int m48t08_get_time(
int minor,
rtems_time_of_day *time
)
@@ -112,9 +112,9 @@ int m48t08_get_time(
* m48t08_set_time
*/
-int m48t08_set_time(
+static int m48t08_set_time(
int minor,
- rtems_time_of_day *time
+ const rtems_time_of_day *time
)
{
uint32_t m48t08;
diff --git a/c/src/libchip/rtc/rtc.h b/c/src/libchip/rtc/rtc.h
index f044721bec..106533dd3b 100644
--- a/c/src/libchip/rtc/rtc.h
+++ b/c/src/libchip/rtc/rtc.h
@@ -15,6 +15,11 @@
#ifndef __LIBCHIP_RTC_h
#define __LIBCHIP_RTC_h
+#include <stdbool.h>
+#include <stdint.h>
+
+#include <rtems.h>
+
/*
* Types for get and set register routines
*/
@@ -26,7 +31,7 @@ typedef void (*setRegister_f)(
typedef struct _rtc_fns {
void (*deviceInitialize)(int minor);
int (*deviceGetTime)(int minor, rtems_time_of_day *time);
- int (*deviceSetTime)(int minor, rtems_time_of_day *time);
+ int (*deviceSetTime)(int minor, const rtems_time_of_day *time);
} rtc_fns;
typedef enum {
@@ -50,8 +55,6 @@ typedef enum {
*
* ulCtrlPort1 This is the primary control port number for the device.
*
- * ulCtrlPort2 This is the secondary control port number.
- *
* ulDataPort This is the port number for the data port of the device
*
* getRegister This is the routine used to read register values.
@@ -60,9 +63,9 @@ typedef enum {
*/
typedef struct _rtc_tbl {
- char *sDeviceName;
+ const char *sDeviceName;
rtc_devs deviceType;
- rtc_fns *pDeviceFns;
+ const rtc_fns *pDeviceFns;
bool (*deviceProbe)(int minor);
void *pDeviceParams;
uint32_t ulCtrlPort1;