Pass the filesystem time to clock drivers in the todr_chip_handle, so that
vax, and pmax can use it.
This commit is contained in:
parent
ca09b578d0
commit
06522e0f81
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: clock.c,v 1.45 2006/09/05 19:32:57 matt Exp $ */
|
||||
/* $NetBSD: clock.c,v 1.46 2006/09/16 00:50:52 gdamore Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.45 2006/09/05 19:32:57 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.46 2006/09/16 00:50:52 gdamore Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
|
@ -140,6 +140,7 @@ cpu_initclocks(void)
|
|||
int
|
||||
vax_gettime(todr_chip_handle_t handle, volatile struct timeval *tvp)
|
||||
{
|
||||
tvp->tv_sec = handle->base_time;
|
||||
return (*dep_call->cpu_gettime)(tvp);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: clock_subr.h,v 1.18 2006/09/10 14:06:54 gavan Exp $ */
|
||||
/* $NetBSD: clock_subr.h,v 1.19 2006/09/16 00:50:52 gdamore Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
|
@ -82,6 +82,7 @@ void clock_secs_to_ymdhms(time_t, struct clock_ymdhms *);
|
|||
struct todr_chip_handle {
|
||||
void *cookie; /* Device specific data */
|
||||
void *bus_cookie; /* Bus specific data */
|
||||
time_t base_time; /* Base time (e.g. rootfs time) */
|
||||
|
||||
int (*todr_gettime)(struct todr_chip_handle *,
|
||||
volatile struct timeval *);
|
||||
|
@ -92,6 +93,7 @@ struct todr_chip_handle {
|
|||
int (*todr_settime_ymdhms)(struct todr_chip_handle *,
|
||||
struct clock_ymdhms *);
|
||||
int (*todr_setwen)(struct todr_chip_handle *, int);
|
||||
|
||||
};
|
||||
typedef struct todr_chip_handle *todr_chip_handle_t;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_todr.c,v 1.21 2006/09/12 21:38:55 gdamore Exp $ */
|
||||
/* $NetBSD: kern_todr.c,v 1.22 2006/09/16 00:50:52 gdamore Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -76,7 +76,7 @@
|
|||
* @(#)clock.c 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.21 2006/09/12 21:38:55 gdamore Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.22 2006/09/16 00:50:52 gdamore Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
|
@ -141,8 +141,8 @@ inittodr(time_t base)
|
|||
/*
|
||||
* Some ports need to be supplied base in order to fabricate a time_t.
|
||||
*/
|
||||
tv.tv_sec = base;
|
||||
tv.tv_usec = 0;
|
||||
if (todr_handle)
|
||||
todr_handle->base_time = base;
|
||||
|
||||
if ((todr_handle == NULL) ||
|
||||
(todr_gettime(todr_handle, &tv) != 0) ||
|
||||
|
|
Loading…
Reference in New Issue