linux/arch/x86/lib/kaslr.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Entropy functions used on early boot for KASLR base and memory
 * randomization. The base randomization is done in the compressed
 * kernel and memory randomization is done early when the regular
 * kernel starts. This file is included in the compressed kernel and
 * normally linked in the regular.
 */
#include <asm/asm.h>
#include <asm/kaslr.h>
#include <asm/msr.h>
#include <asm/archrandom.h>
#include <asm/e820/api.h>
#include <asm/shared/io.h>

/*
 * When built for the regular kernel, several functions need to be stubbed out
 * or changed to their regular kernel equivalent.
 */
#ifndef KASLR_COMPRESSED_BOOT
#include <asm/cpufeature.h>
#include <asm/setup.h>

#define debug_putstr(v)
#define has_cpuflag(f)
#define get_boot_seed()
#endif

#define I8254_PORT_CONTROL
#define I8254_PORT_COUNTER0
#define I8254_CMD_READBACK
#define I8254_SELECT_COUNTER0
#define I8254_STATUS_NOTREADY
static inline u16 i8254(void)
{}

unsigned long kaslr_get_random_long(const char *purpose)
{}