linux/arch/x86/kernel/rtc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * RTC related functions
 */
#include <linux/platform_device.h>
#include <linux/mc146818rtc.h>
#include <linux/export.h>
#include <linux/pnp.h>

#include <asm/vsyscall.h>
#include <asm/x86_init.h>
#include <asm/time.h>
#include <asm/setup.h>

#ifdef CONFIG_X86_32
/*
 * This is a special lock that is owned by the CPU and holds the index
 * register we are working with.  It is required for NMI access to the
 * CMOS/RTC registers.  See arch/x86/include/asm/mc146818rtc.h for details.
 */
volatile unsigned long cmos_lock;
EXPORT_SYMBOL(cmos_lock);
#endif /* CONFIG_X86_32 */

DEFINE_SPINLOCK();
EXPORT_SYMBOL();

/*
 * In order to set the CMOS clock precisely, mach_set_cmos_time has to be
 * called 500 ms after the second nowtime has started, because when
 * nowtime is written into the registers of the CMOS clock, it will
 * jump to the next second precisely 500 ms later. Check the Motorola
 * MC146818A or Dallas DS12887 data sheet for details.
 */
int mach_set_cmos_time(const struct timespec64 *now)
{}

void mach_get_cmos_time(struct timespec64 *now)
{}

/* Routines for accessing the CMOS RAM/RTC. */
unsigned char rtc_cmos_read(unsigned char addr)
{}
EXPORT_SYMBOL();

void rtc_cmos_write(unsigned char val, unsigned char addr)
{}
EXPORT_SYMBOL();

int update_persistent_clock64(struct timespec64 now)
{}

/* not static: needed by APM */
void read_persistent_clock64(struct timespec64 *ts)
{}


static struct resource rtc_resources[] =;

static struct platform_device rtc_device =;

static __init int add_rtc_cmos(void)
{}
device_initcall(add_rtc_cmos);