45#define RTC_MAX_WAIT_MS 100
48#define RTC_CHECK_COUNT 3
64#define rtc_flag __use_text16 ( rtc_flag )
78 "movb $0x01, %%cs:rtc_flag\n\t"
86 "movb $0x20, %%al\n\t"
87 "outb %%al, $0xa0\n\t"
88 "outb %%al, $0x20\n\t"
163 unsigned int count = 0;
187 DBGC ( &
rtc_flag,
"RTC timed out waiting for interrupt %d/%d\n",
213 DBGC ( &
rtc_flag,
"RTC had IRQ%d %sabled, interrupt %sabled\n",
277 "movb %b2, %%cs:rtc_flag\n\t"
279 "xchgb %b2, %%cs:rtc_flag\n\t"
288 "movb %b2, %%cs:rtc_flag\n\t"
290 "xchgb %b2, %%cs:rtc_flag\n\t"
struct arbelprm_rc_send_wqe rc
__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))
#define assert(condition)
Assert a condition at run-time.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
void x86_features(struct x86_features *features)
Get x86 CPU features.
x86 CPU feature detection
#define CPUID_FEATURES_INTEL_EDX_TSC
TSC is present.
uint32_t features
Supported features.
#define ENTROPY_NORMAL
Normal entropy source.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ETIMEDOUT
Connection timed out.
#define ENOTSUP
Operation not supported.
static void entropy_init(struct entropy_source *source, min_entropy_t min_entropy_per_sample)
Initialise entropy source.
#define MIN_ENTROPY(bits)
Construct a min-entropy fixed-point value.
uint8_t noise_sample_t
A noise sample.
#define __entropy_source(order)
Declare an entropy source.
#define outb(data, io_addr)
#define REAL_CODE(asm_code_str)
#define TEXT16_CODE(asm_code_str)
#define __text16(variable)
__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")
CMOS Real-Time Clock (RTC)
#define RTC_STATUS_C
RTC status register C.
#define CMOS_DATA
CMOS/RTC data register.
#define CMOS_DISABLE_NMI
NMI disable bit.
#define RTC_INT
RTC interrupt vector.
#define RTC_STATUS_B
RTC status register B.
#define CMOS_DEFAULT_ADDRESS
CMOS default address.
#define CMOS_ADDRESS
CMOS/RTC address (and NMI) register.
#define RTC_STATUS_B_PIE
RTC Periodic Interrupt Enabled bit.
static int rtc_entropy_check(void)
Check that entropy gathering is functional.
#define RTC_CHECK_COUNT
Number of RTC interrupts to check for.
static int rtc_entropy_enable(void)
Enable entropy gathering.
static void rtc_hook_isr(void)
Hook RTC interrupt handler.
static struct segoff rtc_old_handler
Previous RTC interrupt handler.
static void rtc_unhook_isr(void)
Unhook RTC interrupt handler.
#define RTC_MAX_WAIT_MS
Maximum time to wait for an RTC interrupt, in milliseconds.
static uint8_t rtc_int_enabled
Previous RTC periodic interrupt enabled state.
static void rtc_disable_int(void)
Disable RTC interrupts.
static void rtc_entropy_disable(void)
Disable entropy gathering.
static uint8_t rtc_irq_enabled
Previous RTC interrupt enabled state.
void rtc_isr(void)
RTC interrupt handler.
static int rtc_get_noise(noise_sample_t *noise)
Get noise sample.
static int rtc_enable_int(void)
Enable RTC interrupts.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
int32_t after
Final microcode version.
int32_t before
Initial microcode version.