45 #define RTC_MAX_WAIT_MS 100 48 #define RTC_CHECK_COUNT 3 58 #define rtc_flag __use_text16 ( rtc_flag ) 72 "movb $0x01, %%cs:rtc_flag\n\t" 80 "movb $0x20, %%al\n\t" 81 "outb %%al, $0xa0\n\t" 82 "outb %%al, $0x20\n\t" 153 unsigned int count = 0;
177 DBGC ( &
rtc_flag,
"RTC timed out waiting for interrupt %d/%d\n",
260 "movb %b2, %%cs:rtc_flag\n\t" 262 "xchgb %b2, %%cs:rtc_flag\n\t" 271 "movb %b2, %%cs:rtc_flag\n\t" 273 "xchgb %b2, %%cs:rtc_flag\n\t" struct arbelprm_rc_send_wqe rc
CMOS Real-Time Clock (RTC)
#define CMOS_DEFAULT_ADDRESS
CMOS default address.
#define ENTROPY_NORMAL
Normal entropy source.
int32_t before
Initial microcode version.
void x86_features(struct x86_features *features)
Get x86 CPU features.
#define RTC_STATUS_B
RTC status register B.
#define ENOTSUP
Operation not supported.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
void rtc_isr(void)
RTC interrupt handler.
struct entropy_source rtc_entropy __entropy_source(ENTROPY_NORMAL)
RTC entropy source.
static struct segoff rtc_old_handler
Previous RTC interrupt handler.
#define CMOS_DATA
CMOS/RTC data register.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
static void rtc_enable_int(void)
Enable RTC interrupts.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
uint16_t count
Number of entries.
#define RTC_CHECK_COUNT
Number of RTC interrupts to check for.
static int rtc_entropy_enable(void)
Enable entropy gathering.
x86 CPU feature detection
uint32_t features
Supported features.
static void rtc_hook_isr(void)
Hook RTC interrupt handler.
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
uint8_t inb(volatile uint8_t *io_addr)
Read byte from I/O-mapped device.
#define RTC_INT
RTC interrupt vector.
#define MIN_ENTROPY(bits)
Construct a min-entropy fixed-point value.
static int rtc_entropy_check(void)
Check that entropy gathering is functional.
#define RTC_MAX_WAIT_MS
Maximum time to wait for an RTC interrupt, in milliseconds.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
#define outb(data, io_addr)
static void rtc_disable_int(void)
Disable RTC interrupts.
int32_t after
Final microcode version.
#define RTC_STATUS_C
RTC status register C.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint8_t noise_sample_t
A noise sample.
static void rtc_unhook_isr(void)
Unhook RTC interrupt handler.
#define CMOS_ADDRESS
CMOS/RTC address (and NMI) register.
#define CPUID_FEATURES_INTEL_EDX_TSC
TSC is present.
static void entropy_init(struct entropy_source *source, min_entropy_t min_entropy_per_sample)
Initialise entropy source.
#define REAL_CODE(asm_code_str)
volatile uint8_t __text16(rtc_flag)
Flag set by RTC interrupt handler.
#define ETIMEDOUT
Connection timed out.
static int rtc_get_noise(noise_sample_t *noise)
Get noise sample.
static void rtc_entropy_disable(void)
Disable entropy gathering.
#define TEXT16_CODE(asm_code_str)
#define CMOS_DISABLE_NMI
NMI disable bit.
#define RTC_STATUS_B_PIE
RTC Periodic Interrupt Enabled bit.