Deleted Added
full compact
rtc.c (330449) rtc.c (336161)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2011 NetApp, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2011 NetApp, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: stable/11/usr.sbin/bhyve/rtc.c 330449 2018-03-05 07:26:05Z eadler $
28 * $FreeBSD: stable/11/usr.sbin/bhyve/rtc.c 336161 2018-07-10 04:26:32Z araujo $
29 */
30
31#include <sys/cdefs.h>
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: stable/11/usr.sbin/bhyve/rtc.c 330449 2018-03-05 07:26:05Z eadler $");
32__FBSDID("$FreeBSD: stable/11/usr.sbin/bhyve/rtc.c 336161 2018-07-10 04:26:32Z araujo $");
33
34#include <sys/types.h>
35
36#include <time.h>
37#include <assert.h>
38
39#include <machine/vmm.h>
40#include <vmmapi.h>

--- 5 unchanged lines hidden (view full) ---

46#define IO_RTC 0x70
47
48#define RTC_LMEM_LSB 0x34
49#define RTC_LMEM_MSB 0x35
50#define RTC_HMEM_LSB 0x5b
51#define RTC_HMEM_SB 0x5c
52#define RTC_HMEM_MSB 0x5d
53
33
34#include <sys/types.h>
35
36#include <time.h>
37#include <assert.h>
38
39#include <machine/vmm.h>
40#include <vmmapi.h>

--- 5 unchanged lines hidden (view full) ---

46#define IO_RTC 0x70
47
48#define RTC_LMEM_LSB 0x34
49#define RTC_LMEM_MSB 0x35
50#define RTC_HMEM_LSB 0x5b
51#define RTC_HMEM_SB 0x5c
52#define RTC_HMEM_MSB 0x5d
53
54#define m_64KB (64*1024)
54#define m_64KB (64*1024)
55#define m_16MB (16*1024*1024)
56#define m_4GB (4ULL*1024*1024*1024)
57
58/*
59 * Returns the current RTC time as number of seconds since 00:00:00 Jan 1, 1970
60 */
61static time_t
62rtc_time(struct vmctx *ctx, int use_localtime)

--- 69 unchanged lines hidden ---
55#define m_16MB (16*1024*1024)
56#define m_4GB (4ULL*1024*1024*1024)
57
58/*
59 * Returns the current RTC time as number of seconds since 00:00:00 Jan 1, 1970
60 */
61static time_t
62rtc_time(struct vmctx *ctx, int use_localtime)

--- 69 unchanged lines hidden ---