Include required header files. Some internal functions have now static linkage type. Added constant qualifier to operations table and read-only function parameters.

This commit is contained in:
Thomas Doerfler
2008-09-22 11:45:25 +00:00
parent 8efda6a196
commit 31c14d9043
3 changed files with 16 additions and 13 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;