#ifndef _ASM_X86_MC146818RTC_H
#define _ASM_X86_MC146818RTC_H
#include <asm/io.h>
#include <asm/processor.h>
#ifndef RTC_PORT
#define RTC_PORT(x) …
#define RTC_ALWAYS_BCD …
#endif
#if defined(CONFIG_X86_32)
#include <linux/smp.h>
extern volatile unsigned long cmos_lock;
static inline void lock_cmos(unsigned char reg)
{
unsigned long new;
new = ((smp_processor_id() + 1) << 8) | reg;
for (;;) {
if (cmos_lock) {
cpu_relax();
continue;
}
if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0)
return;
}
}
static inline void unlock_cmos(void)
{
cmos_lock = 0;
}
static inline int do_i_have_lock_cmos(void)
{
return (cmos_lock >> 8) == (smp_processor_id() + 1);
}
static inline unsigned char current_lock_cmos_reg(void)
{
return cmos_lock & 0xff;
}
#define lock_cmos_prefix …
#define lock_cmos_suffix …
#else
#define lock_cmos_prefix(reg) …
#define lock_cmos_suffix(reg) …
#define lock_cmos(reg) …
#define unlock_cmos() …
#define do_i_have_lock_cmos() …
#define current_lock_cmos_reg() …
#endif
#define CMOS_READ(addr) …
#define CMOS_WRITE(val, addr) …
unsigned char rtc_cmos_read(unsigned char addr);
void rtc_cmos_write(unsigned char val, unsigned char addr);
extern int mach_set_cmos_time(const struct timespec64 *now);
extern void mach_get_cmos_time(struct timespec64 *now);
#define RTC_IRQ …
#endif