payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX)
This patch is a raw application of find payloads/ -type f | \ xargs sed -i -e 's/IS_ENABLED\s*(CONFIG_/CONFIG(/g' Change-Id: I883b03b189f59b5d998a09a2596b0391a2d5cf33 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31775 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
b431833c12
commit
eab2a29c8b
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_BOOTLOG)
|
#if CONFIG(MODULE_BOOTLOG)
|
||||||
|
|
||||||
#define LINES_SHOWN 19
|
#define LINES_SHOWN 19
|
||||||
#define TAB_WIDTH 2
|
#define TAB_WIDTH 2
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
#include "endian.h"
|
#include "endian.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_CBFS)
|
#if CONFIG(MODULE_CBFS)
|
||||||
|
|
||||||
#define FILES_VISIBLE 19
|
#define FILES_VISIBLE 19
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
#include <coreboot_tables.h>
|
#include <coreboot_tables.h>
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_COREBOOT)
|
#if CONFIG(MODULE_COREBOOT)
|
||||||
|
|
||||||
#define MAX_MEMORY_COUNT 5
|
#define MAX_MEMORY_COUNT 5
|
||||||
|
|
||||||
|
|
|
@ -28,34 +28,34 @@ extern struct coreinfo_module cbfs_module;
|
||||||
extern struct coreinfo_module timestamps_module;
|
extern struct coreinfo_module timestamps_module;
|
||||||
|
|
||||||
struct coreinfo_module *system_modules[] = {
|
struct coreinfo_module *system_modules[] = {
|
||||||
#if IS_ENABLED(CONFIG_MODULE_CPUINFO)
|
#if CONFIG(MODULE_CPUINFO)
|
||||||
&cpuinfo_module,
|
&cpuinfo_module,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_MODULE_PCI)
|
#if CONFIG(MODULE_PCI)
|
||||||
&pci_module,
|
&pci_module,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_MODULE_NVRAM)
|
#if CONFIG(MODULE_NVRAM)
|
||||||
&nvram_module,
|
&nvram_module,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_MODULE_RAMDUMP)
|
#if CONFIG(MODULE_RAMDUMP)
|
||||||
&ramdump_module,
|
&ramdump_module,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct coreinfo_module *firmware_modules[] = {
|
struct coreinfo_module *firmware_modules[] = {
|
||||||
#if IS_ENABLED(CONFIG_MODULE_COREBOOT)
|
#if CONFIG(MODULE_COREBOOT)
|
||||||
&coreboot_module,
|
&coreboot_module,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_MODULE_MULTIBOOT)
|
#if CONFIG(MODULE_MULTIBOOT)
|
||||||
&multiboot_module,
|
&multiboot_module,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_MODULE_BOOTLOG)
|
#if CONFIG(MODULE_BOOTLOG)
|
||||||
&bootlog_module,
|
&bootlog_module,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_MODULE_CBFS)
|
#if CONFIG(MODULE_CBFS)
|
||||||
&cbfs_module,
|
&cbfs_module,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_MODULE_TIMESTAMPS)
|
#if CONFIG(MODULE_TIMESTAMPS)
|
||||||
×tamps_module,
|
×tamps_module,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -114,7 +114,7 @@ static void print_submenu(struct coreinfo_cat *cat)
|
||||||
mvwprintw(menuwin, 0, 0, menu);
|
mvwprintw(menuwin, 0, 0, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
|
#if CONFIG(SHOW_DATE_TIME)
|
||||||
static void print_time_and_date(void)
|
static void print_time_and_date(void)
|
||||||
{
|
{
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
|
@ -149,7 +149,7 @@ static void print_menu(void)
|
||||||
|
|
||||||
mvwprintw(menuwin, 1, 0, menu);
|
mvwprintw(menuwin, 1, 0, menu);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
|
#if CONFIG(SHOW_DATE_TIME)
|
||||||
print_time_and_date();
|
print_time_and_date();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ static void loop(void)
|
||||||
while (1) {
|
while (1) {
|
||||||
int ch = -1;
|
int ch = -1;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_SHOW_DATE_TIME)
|
#if CONFIG(SHOW_DATE_TIME)
|
||||||
print_time_and_date();
|
print_time_and_date();
|
||||||
wrefresh(menuwin);
|
wrefresh(menuwin);
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,7 +291,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LP_USB))
|
if (CONFIG(LP_USB))
|
||||||
usb_initialize();
|
usb_initialize();
|
||||||
|
|
||||||
initscr();
|
initscr();
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_CPUINFO)
|
#if CONFIG(MODULE_CPUINFO)
|
||||||
#include <arch/rdtsc.h>
|
#include <arch/rdtsc.h>
|
||||||
|
|
||||||
#define VENDOR_INTEL 0x756e6547
|
#define VENDOR_INTEL 0x756e6547
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <multiboot_tables.h>
|
#include <multiboot_tables.h>
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_MULTIBOOT)
|
#if CONFIG(MODULE_MULTIBOOT)
|
||||||
|
|
||||||
#define MAX_MEMORY_COUNT 10
|
#define MAX_MEMORY_COUNT 10
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_NVRAM)
|
#if CONFIG(MODULE_NVRAM)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dump 256 bytes of NVRAM.
|
* Dump 256 bytes of NVRAM.
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include <libpayload.h>
|
#include <libpayload.h>
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_PCI)
|
#if CONFIG(MODULE_PCI)
|
||||||
|
|
||||||
struct pci_devices {
|
struct pci_devices {
|
||||||
pcidev_t device;
|
pcidev_t device;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_RAMDUMP)
|
#if CONFIG(MODULE_RAMDUMP)
|
||||||
|
|
||||||
static s64 cursor = 0;
|
static s64 cursor = 0;
|
||||||
static s64 cursor_max = (1 * 1024 * 1024 * 1024); /* Max. 1 GB RAM for now. */
|
static s64 cursor_max = (1 * 1024 * 1024 * 1024); /* Max. 1 GB RAM for now. */
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "coreinfo.h"
|
#include "coreinfo.h"
|
||||||
#include <commonlib/timestamp_serialized.h>
|
#include <commonlib/timestamp_serialized.h>
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MODULE_TIMESTAMPS)
|
#if CONFIG(MODULE_TIMESTAMPS)
|
||||||
|
|
||||||
#define LINES_SHOWN 19
|
#define LINES_SHOWN 19
|
||||||
#define TAB_WIDTH 2
|
#define TAB_WIDTH 2
|
||||||
|
|
|
@ -371,7 +371,7 @@ diff -rupN tint-0.04+nmu1/tint.c tint/tint.c
|
||||||
int ch;
|
int ch;
|
||||||
engine_t engine;
|
engine_t engine;
|
||||||
/* Initialize */
|
/* Initialize */
|
||||||
+ if (IS_ENABLED(CONFIG_LP_USB))
|
+ if (CONFIG(LP_USB))
|
||||||
+ usb_initialize();
|
+ usb_initialize();
|
||||||
rand_init (); /* must be called before engine_init () */
|
rand_init (); /* must be called before engine_init () */
|
||||||
engine_init (&engine,score_function); /* must be called before using engine.curshape */
|
engine_init (&engine,score_function); /* must be called before using engine.curshape */
|
||||||
|
|
|
@ -48,7 +48,7 @@ void start_main(void)
|
||||||
lib_get_sysinfo();
|
lib_get_sysinfo();
|
||||||
|
|
||||||
/* Optionally set up the consoles. */
|
/* Optionally set up the consoles. */
|
||||||
#if !IS_ENABLED(CONFIG_LP_SKIP_CONSOLE_INIT)
|
#if !CONFIG(LP_SKIP_CONSOLE_INIT)
|
||||||
console_init();
|
console_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ void start_main(void)
|
||||||
|
|
||||||
post_sysinfo_scan_mmu_setup();
|
post_sysinfo_scan_mmu_setup();
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_LP_SKIP_CONSOLE_INIT)
|
#if !CONFIG(LP_SKIP_CONSOLE_INIT)
|
||||||
console_init();
|
console_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ void start_main(void)
|
||||||
lib_get_sysinfo();
|
lib_get_sysinfo();
|
||||||
|
|
||||||
/* Optionally set up the consoles. */
|
/* Optionally set up the consoles. */
|
||||||
#if !IS_ENABLED(CONFIG_LP_SKIP_CONSOLE_INIT)
|
#if !CONFIG(LP_SKIP_CONSOLE_INIT)
|
||||||
console_init();
|
console_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ void arch_ndelay(uint64_t ns)
|
||||||
if (ns > APIC_INTERRUPT_LATENCY_NS)
|
if (ns > APIC_INTERRUPT_LATENCY_NS)
|
||||||
apic_us = (ns - APIC_INTERRUPT_LATENCY_NS) / NSECS_PER_USEC;
|
apic_us = (ns - APIC_INTERRUPT_LATENCY_NS) / NSECS_PER_USEC;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LP_ENABLE_APIC) && apic_initialized() && apic_us)
|
if (CONFIG(LP_ENABLE_APIC) && apic_initialized() && apic_us)
|
||||||
apic_delay(apic_us);
|
apic_delay(apic_us);
|
||||||
|
|
||||||
if (delta > PAUSE_THRESHOLD_TICKS)
|
if (delta > PAUSE_THRESHOLD_TICKS)
|
||||||
|
|
|
@ -173,10 +173,10 @@ void exception_dispatch(void)
|
||||||
handlers[vec](vec);
|
handlers[vec](vec);
|
||||||
goto success;
|
goto success;
|
||||||
} else if (vec >= EXC_COUNT
|
} else if (vec >= EXC_COUNT
|
||||||
&& IS_ENABLED(CONFIG_LP_IGNORE_UNKNOWN_INTERRUPTS)) {
|
&& CONFIG(LP_IGNORE_UNKNOWN_INTERRUPTS)) {
|
||||||
goto success;
|
goto success;
|
||||||
} else if (vec >= EXC_COUNT
|
} else if (vec >= EXC_COUNT
|
||||||
&& IS_ENABLED(CONFIG_LP_LOG_UNKNOWN_INTERRUPTS)) {
|
&& CONFIG(LP_LOG_UNKNOWN_INTERRUPTS)) {
|
||||||
printf("Ignoring interrupt vector %u\n", vec);
|
printf("Ignoring interrupt vector %u\n", vec);
|
||||||
goto success;
|
goto success;
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ void exception_dispatch(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
success:
|
success:
|
||||||
if (IS_ENABLED(CONFIG_LP_ENABLE_APIC))
|
if (CONFIG(LP_ENABLE_APIC))
|
||||||
apic_eoi(vec);
|
apic_eoi(vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,13 +52,13 @@ int start_main(void)
|
||||||
lib_get_sysinfo();
|
lib_get_sysinfo();
|
||||||
|
|
||||||
/* Optionally set up the consoles. */
|
/* Optionally set up the consoles. */
|
||||||
#if !IS_ENABLED(CONFIG_LP_SKIP_CONSOLE_INIT)
|
#if !CONFIG(LP_SKIP_CONSOLE_INIT)
|
||||||
console_init();
|
console_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
exception_init();
|
exception_init();
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LP_ENABLE_APIC)) {
|
if (CONFIG(LP_ENABLE_APIC)) {
|
||||||
apic_init();
|
apic_init();
|
||||||
|
|
||||||
enable_interrupts();
|
enable_interrupts();
|
||||||
|
|
|
@ -40,7 +40,7 @@ static int mb_add_memrange(struct sysinfo_t *info, unsigned long long base,
|
||||||
if (info->n_memranges >= SYSINFO_MAX_MEM_RANGES)
|
if (info->n_memranges >= SYSINFO_MAX_MEM_RANGES)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_MEMMAP_RAM_ONLY)
|
#if CONFIG(LP_MEMMAP_RAM_ONLY)
|
||||||
/* 1 == normal RAM. Ignore everything else for now */
|
/* 1 == normal RAM. Ignore everything else for now */
|
||||||
if (type != 1)
|
if (type != 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -83,7 +83,7 @@ int init_x86rom_cbfs_media(struct cbfs_media *media) {
|
||||||
struct cbfs_header *header = (struct cbfs_header*)
|
struct cbfs_header *header = (struct cbfs_header*)
|
||||||
*(uint32_t*)(0xfffffffc);
|
*(uint32_t*)(0xfffffffc);
|
||||||
if (CBFS_HEADER_MAGIC != ntohl(header->magic)) {
|
if (CBFS_HEADER_MAGIC != ntohl(header->magic)) {
|
||||||
#if IS_ENABLED(CONFIG_LP_ROM_SIZE)
|
#if CONFIG(LP_ROM_SIZE)
|
||||||
printk(BIOS_ERR, "Invalid CBFS master header at %p\n", header);
|
printk(BIOS_ERR, "Invalid CBFS master header at %p\n", header);
|
||||||
media->context = (void*)CONFIG_LP_ROM_SIZE;
|
media->context = (void*)CONFIG_LP_ROM_SIZE;
|
||||||
#else
|
#else
|
||||||
|
@ -92,7 +92,7 @@ int init_x86rom_cbfs_media(struct cbfs_media *media) {
|
||||||
} else {
|
} else {
|
||||||
uint32_t romsize = ntohl(header->romsize);
|
uint32_t romsize = ntohl(header->romsize);
|
||||||
media->context = (void*)romsize;
|
media->context = (void*)romsize;
|
||||||
#if IS_ENABLED(CONFIG_LP_ROM_SIZE)
|
#if CONFIG(LP_ROM_SIZE)
|
||||||
if (CONFIG_LP_ROM_SIZE != romsize)
|
if (CONFIG_LP_ROM_SIZE != romsize)
|
||||||
printk(BIOS_INFO, "Warning: rom size unmatch (%d/%d)\n",
|
printk(BIOS_INFO, "Warning: rom size unmatch (%d/%d)\n",
|
||||||
CONFIG_LP_ROM_SIZE, romsize);
|
CONFIG_LP_ROM_SIZE, romsize);
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
*/
|
*/
|
||||||
struct sysinfo_t lib_sysinfo = {
|
struct sysinfo_t lib_sysinfo = {
|
||||||
.cpu_khz = CPU_KHZ_DEFAULT,
|
.cpu_khz = CPU_KHZ_DEFAULT,
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
.ser_ioport = CONFIG_LP_SERIAL_IOBASE,
|
.ser_ioport = CONFIG_LP_SERIAL_IOBASE,
|
||||||
#else
|
#else
|
||||||
.ser_ioport = 0x3f8,
|
.ser_ioport = 0x3f8,
|
||||||
|
@ -51,7 +51,7 @@ int lib_get_sysinfo(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_MULTIBOOT)
|
#if CONFIG(LP_MULTIBOOT)
|
||||||
/* Get the information from the multiboot tables,
|
/* Get the information from the multiboot tables,
|
||||||
* if they exist */
|
* if they exist */
|
||||||
get_multiboot_info(&lib_sysinfo);
|
get_multiboot_info(&lib_sysinfo);
|
||||||
|
|
|
@ -30,7 +30,7 @@ typedef unsigned int u_int;
|
||||||
|
|
||||||
/* Moved from libpayload.h */
|
/* Moved from libpayload.h */
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
|
#if CONFIG(LP_LITTLE_ENDIAN)
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
#define BYTE_ORDER LITTLE_ENDIAN
|
||||||
#else
|
#else
|
||||||
#define BYTE_ORDER BIG_ENDIAN
|
#define BYTE_ORDER BIG_ENDIAN
|
||||||
|
|
|
@ -45,7 +45,7 @@ static int _halfdelay = 0;
|
||||||
|
|
||||||
/* ============== Serial ==================== */
|
/* ============== Serial ==================== */
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
/* We treat serial like a vt100 terminal. For now we
|
/* We treat serial like a vt100 terminal. For now we
|
||||||
do the cooking in here, but we should probably eventually
|
do the cooking in here, but we should probably eventually
|
||||||
pass it to dedicated vt100 code */
|
pass it to dedicated vt100 code */
|
||||||
|
@ -146,13 +146,13 @@ static int cook_serial(unsigned char ch)
|
||||||
|
|
||||||
static int curses_getchar(int _delay)
|
static int curses_getchar(int _delay)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_HID) || IS_ENABLED(CONFIG_LP_PC_KEYBOARD) || \
|
#if CONFIG(LP_USB_HID) || CONFIG(LP_PC_KEYBOARD) || \
|
||||||
IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
CONFIG(LP_SERIAL_CONSOLE)
|
||||||
unsigned short c;
|
unsigned short c;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
do {
|
do {
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_HID)
|
#if CONFIG(LP_USB_HID)
|
||||||
usb_poll();
|
usb_poll();
|
||||||
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
||||||
usbhid_havechar()) {
|
usbhid_havechar()) {
|
||||||
|
@ -160,7 +160,7 @@ static int curses_getchar(int _delay)
|
||||||
if (c != 0) return c;
|
if (c != 0) return c;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD)
|
#if CONFIG(LP_PC_KEYBOARD)
|
||||||
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
||||||
keyboard_havechar()) {
|
keyboard_havechar()) {
|
||||||
c = keyboard_getchar();
|
c = keyboard_getchar();
|
||||||
|
@ -168,7 +168,7 @@ static int curses_getchar(int _delay)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if ((curses_flags & F_ENABLE_SERIAL) &&
|
if ((curses_flags & F_ENABLE_SERIAL) &&
|
||||||
serial_havechar()) {
|
serial_havechar()) {
|
||||||
c = serial_getchar();
|
c = serial_getchar();
|
||||||
|
@ -226,7 +226,7 @@ int nocbreak(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_VGA_VIDEO_CONSOLE)
|
#if CONFIG(LP_VGA_VIDEO_CONSOLE)
|
||||||
void curses_enable_vga(int state)
|
void curses_enable_vga(int state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
|
@ -244,7 +244,7 @@ void curses_enable_vga(int state) { }
|
||||||
int curses_vga_enabled(void) { return 0; }
|
int curses_vga_enabled(void) { return 0; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
void curses_enable_serial(int state)
|
void curses_enable_serial(int state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
|
|
|
@ -70,13 +70,13 @@
|
||||||
|
|
||||||
/* Flags used to determine what output methods are available */
|
/* Flags used to determine what output methods are available */
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
#define F_ENABLE_CONSOLE 0x01
|
#define F_ENABLE_CONSOLE 0x01
|
||||||
#else
|
#else
|
||||||
#define F_ENABLE_CONSOLE 0x00
|
#define F_ENABLE_CONSOLE 0x00
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
#define F_ENABLE_SERIAL 0x02
|
#define F_ENABLE_SERIAL 0x02
|
||||||
#else
|
#else
|
||||||
#define F_ENABLE_SERIAL 0x00
|
#define F_ENABLE_SERIAL 0x00
|
||||||
|
|
|
@ -66,8 +66,8 @@ chtype fallback_acs_map[128] =
|
||||||
'|', '<', '>', '*', '!', 'f', 'o', ' ',
|
'|', '<', '>', '*', '!', 'f', 'o', ' ',
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_ACS_FALLBACK)
|
#if CONFIG(LP_SERIAL_ACS_FALLBACK)
|
||||||
chtype serial_acs_map[128];
|
chtype serial_acs_map[128];
|
||||||
#else
|
#else
|
||||||
/* See acsc of vt100. */
|
/* See acsc of vt100. */
|
||||||
|
@ -93,7 +93,7 @@ chtype serial_acs_map[128] =
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
/* See acsc of linux. */
|
/* See acsc of linux. */
|
||||||
chtype console_acs_map[128] =
|
chtype console_acs_map[128] =
|
||||||
{
|
{
|
||||||
|
@ -122,10 +122,10 @@ void PDC_gotoyx(int row, int col)
|
||||||
{
|
{
|
||||||
PDC_LOG(("PDC_gotoyx() - called: row %d col %d\n", row, col));
|
PDC_LOG(("PDC_gotoyx() - called: row %d col %d\n", row, col));
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
serial_set_cursor(col, row);
|
serial_set_cursor(col, row);
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
video_console_set_cursor(col, row);
|
video_console_set_cursor(col, row);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
|
||||||
|
|
||||||
PDC_LOG(("PDC_transform_line() - called: line %d, len %d, curses_flags %d\n", lineno, len, curses_flags));
|
PDC_LOG(("PDC_transform_line() - called: line %d, len %d, curses_flags %d\n", lineno, len, curses_flags));
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
int serial_is_bold = 0;
|
int serial_is_bold = 0;
|
||||||
int serial_is_reverse = 0;
|
int serial_is_reverse = 0;
|
||||||
int serial_is_altcharset = 0;
|
int serial_is_altcharset = 0;
|
||||||
|
@ -157,7 +157,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
|
||||||
{
|
{
|
||||||
ch = srcp[j];
|
ch = srcp[j];
|
||||||
attr = ch;
|
attr = ch;
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_SERIAL) {
|
if (curses_flags & F_ENABLE_SERIAL) {
|
||||||
if (attr & A_BOLD) {
|
if (attr & A_BOLD) {
|
||||||
if (!serial_is_bold) {
|
if (!serial_is_bold) {
|
||||||
|
@ -222,7 +222,7 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
unsigned char c = pdc_atrtab[srcp[j] >> PDC_ATTR_SHIFT];
|
unsigned char c = pdc_atrtab[srcp[j] >> PDC_ATTR_SHIFT];
|
||||||
|
|
||||||
if (curses_flags & F_ENABLE_CONSOLE) {
|
if (curses_flags & F_ENABLE_CONSOLE) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
unsigned long pdc_key_modifiers = 0L;
|
unsigned long pdc_key_modifiers = 0L;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
/* We treat serial like a vt100 terminal. For now we
|
/* We treat serial like a vt100 terminal. For now we
|
||||||
do the cooking in here, but we should probably eventually
|
do the cooking in here, but we should probably eventually
|
||||||
pass it to dedicated vt100 code */
|
pass it to dedicated vt100 code */
|
||||||
|
@ -108,7 +108,7 @@ void PDC_set_keyboard_binary(bool on)
|
||||||
|
|
||||||
bool PDC_check_key(void)
|
bool PDC_check_key(void)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_HID)
|
#if CONFIG(LP_USB_HID)
|
||||||
usb_poll();
|
usb_poll();
|
||||||
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
||||||
usbhid_havechar()) {
|
usbhid_havechar()) {
|
||||||
|
@ -116,14 +116,14 @@ bool PDC_check_key(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD)
|
#if CONFIG(LP_PC_KEYBOARD)
|
||||||
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
||||||
keyboard_havechar()) {
|
keyboard_havechar()) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if ((curses_flags & F_ENABLE_SERIAL) &&
|
if ((curses_flags & F_ENABLE_SERIAL) &&
|
||||||
serial_havechar()) {
|
serial_havechar()) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -139,7 +139,7 @@ int PDC_get_key(void)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_HID)
|
#if CONFIG(LP_USB_HID)
|
||||||
usb_poll();
|
usb_poll();
|
||||||
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
||||||
usbhid_havechar()) {
|
usbhid_havechar()) {
|
||||||
|
@ -147,14 +147,14 @@ int PDC_get_key(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD)
|
#if CONFIG(LP_PC_KEYBOARD)
|
||||||
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
if ((curses_flags & F_ENABLE_CONSOLE) &&
|
||||||
keyboard_havechar() && (c == 0)) {
|
keyboard_havechar() && (c == 0)) {
|
||||||
c = keyboard_getchar();
|
c = keyboard_getchar();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if ((curses_flags & F_ENABLE_SERIAL) &&
|
if ((curses_flags & F_ENABLE_SERIAL) &&
|
||||||
serial_havechar() && (c == 0)) {
|
serial_havechar() && (c == 0)) {
|
||||||
c = cook_serial(serial_getchar());
|
c = cook_serial(serial_getchar());
|
||||||
|
|
|
@ -72,7 +72,7 @@ int PDC_scr_open(int argc, char **argv)
|
||||||
SP->lines = PDC_get_rows();
|
SP->lines = PDC_get_rows();
|
||||||
SP->cols = PDC_get_columns();
|
SP->cols = PDC_get_columns();
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SPEAKER)
|
#if CONFIG(LP_SPEAKER)
|
||||||
SP->audible = TRUE;
|
SP->audible = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,12 @@ int PDC_curs_set(int visibility)
|
||||||
ret_vis = SP->visibility;
|
ret_vis = SP->visibility;
|
||||||
SP->visibility = visibility;
|
SP->visibility = visibility;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_SERIAL) {
|
if (curses_flags & F_ENABLE_SERIAL) {
|
||||||
serial_cursor_enable(visibility);
|
serial_cursor_enable(visibility);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_CONSOLE) {
|
if (curses_flags & F_ENABLE_CONSOLE) {
|
||||||
video_console_cursor_enable(visibility);
|
video_console_cursor_enable(visibility);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ void PDC_beep(void)
|
||||||
{
|
{
|
||||||
PDC_LOG(("PDC_beep() - called\n"));
|
PDC_LOG(("PDC_beep() - called\n"));
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SPEAKER)
|
#if CONFIG(LP_SPEAKER)
|
||||||
speaker_tone(1760, 500); /* 1760 == note A6 */
|
speaker_tone(1760, 500); /* 1760 == note A6 */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,8 +111,8 @@ chtype fallback_acs_map[128] =
|
||||||
'|', '<', '>', '*', '!', 'f', 'o', ' ',
|
'|', '<', '>', '*', '!', 'f', 'o', ' ',
|
||||||
};
|
};
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_ACS_FALLBACK)
|
#if CONFIG(LP_SERIAL_ACS_FALLBACK)
|
||||||
chtype serial_acs_map[128];
|
chtype serial_acs_map[128];
|
||||||
#else
|
#else
|
||||||
/* See acsc of vt100. */
|
/* See acsc of vt100. */
|
||||||
|
@ -138,7 +138,7 @@ chtype serial_acs_map[128] =
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
/* See acsc of linux. */
|
/* See acsc of linux. */
|
||||||
chtype console_acs_map[128] =
|
chtype console_acs_map[128] =
|
||||||
{
|
{
|
||||||
|
@ -191,7 +191,7 @@ NCURSES_CH_T _nc_render(WINDOW *win, NCURSES_CH_T ch)
|
||||||
int beep(void)
|
int beep(void)
|
||||||
{
|
{
|
||||||
/* TODO: Flash the screen if beeping fails? */
|
/* TODO: Flash the screen if beeping fails? */
|
||||||
#if IS_ENABLED(CONFIG_LP_SPEAKER)
|
#if CONFIG(LP_SPEAKER)
|
||||||
speaker_tone(1760, 500); /* 1760 == note A6 */
|
speaker_tone(1760, 500); /* 1760 == note A6 */
|
||||||
#endif
|
#endif
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -202,12 +202,12 @@ int cbreak(void) { /* TODO */ return 0; }
|
||||||
// int color_content(short color, short *r, short *g, short *b) {}
|
// int color_content(short color, short *r, short *g, short *b) {}
|
||||||
int curs_set(int on)
|
int curs_set(int on)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_SERIAL) {
|
if (curses_flags & F_ENABLE_SERIAL) {
|
||||||
serial_cursor_enable(on);
|
serial_cursor_enable(on);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_CONSOLE) {
|
if (curses_flags & F_ENABLE_CONSOLE) {
|
||||||
video_console_cursor_enable(on);
|
video_console_cursor_enable(on);
|
||||||
}
|
}
|
||||||
|
@ -315,12 +315,12 @@ WINDOW *initscr(void)
|
||||||
|
|
||||||
for (i = 0; i < 128; i++)
|
for (i = 0; i < 128; i++)
|
||||||
acs_map[i] = (chtype) i | A_ALTCHARSET;
|
acs_map[i] = (chtype) i | A_ALTCHARSET;
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_SERIAL) {
|
if (curses_flags & F_ENABLE_SERIAL) {
|
||||||
serial_clear();
|
serial_clear();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_CONSOLE) {
|
if (curses_flags & F_ENABLE_CONSOLE) {
|
||||||
/* Clear the screen and kill the cursor */
|
/* Clear the screen and kill the cursor */
|
||||||
|
|
||||||
|
@ -724,7 +724,7 @@ int whline(WINDOW *win, chtype ch, int n)
|
||||||
(((c) & 0x4400) >> 2) | ((c) & 0xAA00) | (((c) & 0x1100) << 2)
|
(((c) & 0x4400) >> 2) | ((c) & 0xAA00) | (((c) & 0x1100) << 2)
|
||||||
int wnoutrefresh(WINDOW *win)
|
int wnoutrefresh(WINDOW *win)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
// FIXME.
|
// FIXME.
|
||||||
int serial_is_bold = 0;
|
int serial_is_bold = 0;
|
||||||
int serial_is_reverse = 0;
|
int serial_is_reverse = 0;
|
||||||
|
@ -737,7 +737,7 @@ int wnoutrefresh(WINDOW *win)
|
||||||
int x, y;
|
int x, y;
|
||||||
chtype ch;
|
chtype ch;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
serial_end_bold();
|
serial_end_bold();
|
||||||
serial_end_altcharset();
|
serial_end_altcharset();
|
||||||
#endif
|
#endif
|
||||||
|
@ -749,7 +749,7 @@ int wnoutrefresh(WINDOW *win)
|
||||||
|
|
||||||
/* Position the serial cursor */
|
/* Position the serial cursor */
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_SERIAL)
|
if (curses_flags & F_ENABLE_SERIAL)
|
||||||
serial_set_cursor(win->_begy + y, win->_begx +
|
serial_set_cursor(win->_begy + y, win->_begx +
|
||||||
win->_line[y].firstchar);
|
win->_line[y].firstchar);
|
||||||
|
@ -758,7 +758,7 @@ int wnoutrefresh(WINDOW *win)
|
||||||
for (x = win->_line[y].firstchar; x <= win->_line[y].lastchar; x++) {
|
for (x = win->_line[y].firstchar; x <= win->_line[y].lastchar; x++) {
|
||||||
attr_t attr = win->_line[y].text[x].attr;
|
attr_t attr = win->_line[y].text[x].attr;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_SERIAL) {
|
if (curses_flags & F_ENABLE_SERIAL) {
|
||||||
ch = win->_line[y].text[x].chars[0];
|
ch = win->_line[y].text[x].chars[0];
|
||||||
|
|
||||||
|
@ -824,7 +824,7 @@ int wnoutrefresh(WINDOW *win)
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
unsigned int c =
|
unsigned int c =
|
||||||
((int)color_pairs[PAIR_NUMBER(attr)]) << 8;
|
((int)color_pairs[PAIR_NUMBER(attr)]) << 8;
|
||||||
|
|
||||||
|
@ -865,12 +865,12 @@ int wnoutrefresh(WINDOW *win)
|
||||||
win->_line[y].lastchar = _NOCHANGE;
|
win->_line[y].lastchar = _NOCHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_SERIAL)
|
if (curses_flags & F_ENABLE_SERIAL)
|
||||||
serial_set_cursor(win->_begy + win->_cury, win->_begx + win->_curx);
|
serial_set_cursor(win->_begy + win->_cury, win->_begx + win->_curx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
if (curses_flags & F_ENABLE_CONSOLE)
|
if (curses_flags & F_ENABLE_CONSOLE)
|
||||||
video_console_set_cursor(win->_begx + win->_curx, win->_begy + win->_cury);
|
video_console_set_cursor(win->_begx + win->_curx, win->_begy + win->_cury);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -229,7 +229,7 @@ u8 i8042_probe(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test secondary port */
|
/* Test secondary port */
|
||||||
if (IS_ENABLED(CONFIG_LP_PC_MOUSE)) {
|
if (CONFIG(LP_PC_MOUSE)) {
|
||||||
if (i8042_cmd_with_response(I8042_CMD_AUX_TEST) == 0)
|
if (i8042_cmd_with_response(I8042_CMD_AUX_TEST) == 0)
|
||||||
aux_fifo = fifo_init(4 * 32);
|
aux_fifo = fifo_init(4 * 32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ static struct layout_maps *map;
|
||||||
static int modifier = 0;
|
static int modifier = 0;
|
||||||
|
|
||||||
static struct layout_maps keyboard_layouts[] = {
|
static struct layout_maps keyboard_layouts[] = {
|
||||||
#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD_LAYOUT_US)
|
#if CONFIG(LP_PC_KEYBOARD_LAYOUT_US)
|
||||||
{ .country = "us", .map = {
|
{ .country = "us", .map = {
|
||||||
{ /* No modifier */
|
{ /* No modifier */
|
||||||
0x00, 0x1B, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
|
0x00, 0x1B, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
|
||||||
|
@ -101,7 +101,7 @@ static struct layout_maps keyboard_layouts[] = {
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD_LAYOUT_DE)
|
#if CONFIG(LP_PC_KEYBOARD_LAYOUT_DE)
|
||||||
{ .country = "de", .map = {
|
{ .country = "de", .map = {
|
||||||
{ /* No modifier */
|
{ /* No modifier */
|
||||||
0x00, 0x1B, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
|
0x00, 0x1B, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
|
||||||
|
@ -309,16 +309,16 @@ void keyboard_init(void)
|
||||||
|
|
||||||
/* Set scancode set 1 */
|
/* Set scancode set 1 */
|
||||||
ret = keyboard_cmd(I8042_KBCMD_SET_SCANCODE);
|
ret = keyboard_cmd(I8042_KBCMD_SET_SCANCODE);
|
||||||
if (!ret && !IS_ENABLED(CONFIG_LP_PC_KEYBOARD_IGNORE_INIT_FAILURE))
|
if (!ret && !CONFIG(LP_PC_KEYBOARD_IGNORE_INIT_FAILURE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ret = keyboard_cmd(I8042_SCANCODE_SET_1);
|
ret = keyboard_cmd(I8042_SCANCODE_SET_1);
|
||||||
if (!ret && !IS_ENABLED(CONFIG_LP_PC_KEYBOARD_IGNORE_INIT_FAILURE))
|
if (!ret && !CONFIG(LP_PC_KEYBOARD_IGNORE_INIT_FAILURE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Enable scanning */
|
/* Enable scanning */
|
||||||
ret = keyboard_cmd(I8042_KBCMD_EN);
|
ret = keyboard_cmd(I8042_KBCMD_EN);
|
||||||
if (!ret && !IS_ENABLED(CONFIG_LP_PC_KEYBOARD_IGNORE_INIT_FAILURE))
|
if (!ret && !CONFIG(LP_PC_KEYBOARD_IGNORE_INIT_FAILURE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
console_add_input_driver(&cons);
|
console_add_input_driver(&cons);
|
||||||
|
|
|
@ -60,7 +60,7 @@ void mouse_cursor_add_input_driver(struct mouse_cursor_input_driver *const in)
|
||||||
/** Init enabled mouse cursor drivers */
|
/** Init enabled mouse cursor drivers */
|
||||||
void mouse_cursor_init(void)
|
void mouse_cursor_init(void)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_PC_MOUSE)
|
#if CONFIG(LP_PC_MOUSE)
|
||||||
i8042_mouse_init();
|
i8042_mouse_init();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
* doesn't try to do this on its own.
|
* doesn't try to do this on its own.
|
||||||
*/
|
*/
|
||||||
#define RTC_PORT_STANDARD 0x70
|
#define RTC_PORT_STANDARD 0x70
|
||||||
#if IS_ENABLED(CONFIG_LP_RTC_PORT_EXTENDED_VIA)
|
#if CONFIG(LP_RTC_PORT_EXTENDED_VIA)
|
||||||
#define RTC_PORT_EXTENDED 0x74
|
#define RTC_PORT_EXTENDED 0x74
|
||||||
#else
|
#else
|
||||||
#define RTC_PORT_EXTENDED 0x72
|
#define RTC_PORT_EXTENDED 0x72
|
||||||
|
|
|
@ -41,7 +41,7 @@ static uint8_t serial_read_reg(int offset)
|
||||||
{
|
{
|
||||||
offset *= lib_sysinfo.serial->regwidth;
|
offset *= lib_sysinfo.serial->regwidth;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE)
|
#if CONFIG(LP_IO_ADDRESS_SPACE)
|
||||||
if (!serial_is_mem_mapped)
|
if (!serial_is_mem_mapped)
|
||||||
return inb(IOBASE + offset);
|
return inb(IOBASE + offset);
|
||||||
else
|
else
|
||||||
|
@ -56,7 +56,7 @@ static void serial_write_reg(uint8_t val, int offset)
|
||||||
{
|
{
|
||||||
offset *= lib_sysinfo.serial->regwidth;
|
offset *= lib_sysinfo.serial->regwidth;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE)
|
#if CONFIG(LP_IO_ADDRESS_SPACE)
|
||||||
if (!serial_is_mem_mapped)
|
if (!serial_is_mem_mapped)
|
||||||
outb(val, IOBASE + offset);
|
outb(val, IOBASE + offset);
|
||||||
else
|
else
|
||||||
|
@ -67,13 +67,13 @@ static void serial_write_reg(uint8_t val, int offset)
|
||||||
writeb(val, MEMBASE + offset);
|
writeb(val, MEMBASE + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_SET_SPEED)
|
#if CONFIG(LP_SERIAL_SET_SPEED)
|
||||||
static void serial_hardware_init(int speed, int word_bits,
|
static void serial_hardware_init(int speed, int word_bits,
|
||||||
int parity, int stop_bits)
|
int parity, int stop_bits)
|
||||||
{
|
{
|
||||||
unsigned char reg;
|
unsigned char reg;
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_LP_PL011_SERIAL_CONSOLE)
|
#if !CONFIG(LP_PL011_SERIAL_CONSOLE)
|
||||||
/* Disable interrupts. */
|
/* Disable interrupts. */
|
||||||
serial_write_reg(0, 0x01);
|
serial_write_reg(0, 0x01);
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void serial_init(void)
|
||||||
(lib_sysinfo.serial->type == CB_SERIAL_TYPE_MEMORY_MAPPED);
|
(lib_sysinfo.serial->type == CB_SERIAL_TYPE_MEMORY_MAPPED);
|
||||||
|
|
||||||
if (!serial_is_mem_mapped) {
|
if (!serial_is_mem_mapped) {
|
||||||
#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE)
|
#if CONFIG(LP_IO_ADDRESS_SPACE)
|
||||||
if ((inb(IOBASE + 0x05) == 0xFF) &&
|
if ((inb(IOBASE + 0x05) == 0xFF) &&
|
||||||
(inb(IOBASE + 0x06) == 0xFF)) {
|
(inb(IOBASE + 0x06) == 0xFF)) {
|
||||||
printf("IO space mapped serial not present.");
|
printf("IO space mapped serial not present.");
|
||||||
|
@ -126,7 +126,7 @@ void serial_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_SET_SPEED)
|
#if CONFIG(LP_SERIAL_SET_SPEED)
|
||||||
serial_hardware_init(CONFIG_LP_SERIAL_BAUD_RATE, 8, 0, 1);
|
serial_hardware_init(CONFIG_LP_SERIAL_BAUD_RATE, 8, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ void serial_putchar(unsigned int c)
|
||||||
{
|
{
|
||||||
if (!serial_hardware_is_present)
|
if (!serial_hardware_is_present)
|
||||||
return;
|
return;
|
||||||
#if !IS_ENABLED(CONFIG_LP_PL011_SERIAL_CONSOLE)
|
#if !CONFIG(LP_PL011_SERIAL_CONSOLE)
|
||||||
while ((serial_read_reg(0x05) & 0x20) == 0) ;
|
while ((serial_read_reg(0x05) & 0x20) == 0) ;
|
||||||
#endif
|
#endif
|
||||||
serial_write_reg(c, 0x00);
|
serial_write_reg(c, 0x00);
|
||||||
|
|
|
@ -153,7 +153,7 @@ static int ahci_dev_init(hba_ctrl_t *const ctrl,
|
||||||
switch (port->signature) {
|
switch (port->signature) {
|
||||||
case HBA_PxSIG_ATA:
|
case HBA_PxSIG_ATA:
|
||||||
printf("ahci: ATA drive on port #%d.\n", portnum);
|
printf("ahci: ATA drive on port #%d.\n", portnum);
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_ATA)
|
#if CONFIG(LP_STORAGE_ATA)
|
||||||
dev->ata_dev.identify = ahci_identify_device;
|
dev->ata_dev.identify = ahci_identify_device;
|
||||||
dev->ata_dev.read_sectors = ahci_ata_read_sectors;
|
dev->ata_dev.read_sectors = ahci_ata_read_sectors;
|
||||||
return ata_attach_device(&dev->ata_dev, PORT_TYPE_SATA);
|
return ata_attach_device(&dev->ata_dev, PORT_TYPE_SATA);
|
||||||
|
@ -161,7 +161,7 @@ static int ahci_dev_init(hba_ctrl_t *const ctrl,
|
||||||
break;
|
break;
|
||||||
case HBA_PxSIG_ATAPI:
|
case HBA_PxSIG_ATAPI:
|
||||||
printf("ahci: ATAPI drive on port #%d.\n", portnum);
|
printf("ahci: ATAPI drive on port #%d.\n", portnum);
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_ATAPI)
|
#if CONFIG(LP_STORAGE_ATAPI)
|
||||||
dev->atapi_dev.identify = ahci_identify_device;
|
dev->atapi_dev.identify = ahci_identify_device;
|
||||||
dev->atapi_dev.packet_read_cmd = ahci_packet_read_cmd;
|
dev->atapi_dev.packet_read_cmd = ahci_packet_read_cmd;
|
||||||
return atapi_attach_device(&dev->atapi_dev, PORT_TYPE_SATA);
|
return atapi_attach_device(&dev->atapi_dev, PORT_TYPE_SATA);
|
||||||
|
@ -218,7 +218,7 @@ static void ahci_port_probe(hba_ctrl_t *const ctrl,
|
||||||
ahci_dev_init(ctrl, port, portnum);
|
ahci_dev_init(ctrl, port, portnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_AHCI_ONLY_TESTED)
|
#if CONFIG(LP_STORAGE_AHCI_ONLY_TESTED)
|
||||||
static u32 working_controllers[] = {
|
static u32 working_controllers[] = {
|
||||||
0x8086 | 0x2929 << 16, /* Mobile ICH9 */
|
0x8086 | 0x2929 << 16, /* Mobile ICH9 */
|
||||||
0x8086 | 0x1c03 << 16, /* Mobile Cougar Point PCH */
|
0x8086 | 0x1c03 << 16, /* Mobile Cougar Point PCH */
|
||||||
|
@ -236,7 +236,7 @@ static void ahci_init_pci(pcidev_t dev)
|
||||||
const u16 vendor = pci_read_config16(dev, 0x00);
|
const u16 vendor = pci_read_config16(dev, 0x00);
|
||||||
const u16 device = pci_read_config16(dev, 0x02);
|
const u16 device = pci_read_config16(dev, 0x02);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_AHCI_ONLY_TESTED)
|
#if CONFIG(LP_STORAGE_AHCI_ONLY_TESTED)
|
||||||
const u32 vendor_device = pci_read_config32(dev, 0x0);
|
const u32 vendor_device = pci_read_config32(dev, 0x0);
|
||||||
for (i = 0; i < ARRAY_SIZE(working_controllers); ++i)
|
for (i = 0; i < ARRAY_SIZE(working_controllers); ++i)
|
||||||
if (vendor_device == working_controllers[i])
|
if (vendor_device == working_controllers[i])
|
||||||
|
|
|
@ -56,7 +56,7 @@ ssize_t ahci_ata_read_sectors(ata_dev_t *const ata_dev,
|
||||||
printf("ahci: Sector count too high (max. 256).\n");
|
printf("ahci: Sector count too high (max. 256).\n");
|
||||||
count = 256;
|
count = 256;
|
||||||
}
|
}
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_64BIT_LBA)
|
#if CONFIG(LP_STORAGE_64BIT_LBA)
|
||||||
} else if (ata_dev->read_cmd == ATA_READ_DMA_EXT) {
|
} else if (ata_dev->read_cmd == ATA_READ_DMA_EXT) {
|
||||||
if (start >= (1ULL << 48)) {
|
if (start >= (1ULL << 48)) {
|
||||||
printf("ahci: Sector is not 48-bit addressable.\n");
|
printf("ahci: Sector is not 48-bit addressable.\n");
|
||||||
|
@ -84,7 +84,7 @@ ssize_t ahci_ata_read_sectors(ata_dev_t *const ata_dev,
|
||||||
dev->cmdtable->fis[ 6] = (start >> 16) & 0xff;
|
dev->cmdtable->fis[ 6] = (start >> 16) & 0xff;
|
||||||
dev->cmdtable->fis[ 7] = FIS_H2D_DEV_LBA;
|
dev->cmdtable->fis[ 7] = FIS_H2D_DEV_LBA;
|
||||||
dev->cmdtable->fis[ 8] = (start >> 24) & 0xff;
|
dev->cmdtable->fis[ 8] = (start >> 24) & 0xff;
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_64BIT_LBA)
|
#if CONFIG(LP_STORAGE_64BIT_LBA)
|
||||||
if (ata_dev->read_cmd == ATA_READ_DMA_EXT) {
|
if (ata_dev->read_cmd == ATA_READ_DMA_EXT) {
|
||||||
dev->cmdtable->fis[ 9] = (start >> 32) & 0xff;
|
dev->cmdtable->fis[ 9] = (start >> 32) & 0xff;
|
||||||
dev->cmdtable->fis[10] = (start >> 40) & 0xff;
|
dev->cmdtable->fis[10] = (start >> 40) & 0xff;
|
||||||
|
|
|
@ -212,7 +212,7 @@ int ata_attach_device(ata_dev_t *const dev, const storage_port_t port_type)
|
||||||
ata_strncpy(model, id + 27, sizeof(model));
|
ata_strncpy(model, id + 27, sizeof(model));
|
||||||
printf("ata: Identified %s [%s]\n", model, fw);
|
printf("ata: Identified %s [%s]\n", model, fw);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_64BIT_LBA)
|
#if CONFIG(LP_STORAGE_64BIT_LBA)
|
||||||
if (id[ATA_CMDS_AND_FEATURE_SETS + 1] & (1 << 10)) {
|
if (id[ATA_CMDS_AND_FEATURE_SETS + 1] & (1 << 10)) {
|
||||||
printf("ata: Support for LBA-48 enabled.\n");
|
printf("ata: Support for LBA-48 enabled.\n");
|
||||||
dev->read_cmd = ATA_READ_DMA_EXT;
|
dev->read_cmd = ATA_READ_DMA_EXT;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libpayload.h>
|
#include <libpayload.h>
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_AHCI)
|
#if CONFIG(LP_STORAGE_AHCI)
|
||||||
# include <storage/ahci.h>
|
# include <storage/ahci.h>
|
||||||
#endif
|
#endif
|
||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
|
@ -110,7 +110,7 @@ ssize_t storage_read_blocks512(const size_t dev_num,
|
||||||
*/
|
*/
|
||||||
void storage_initialize(void)
|
void storage_initialize(void)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_STORAGE_AHCI)
|
#if CONFIG(LP_STORAGE_AHCI)
|
||||||
ahci_initialize();
|
ahci_initialize();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,7 +850,7 @@ ehci_init (unsigned long physical_bar)
|
||||||
return controller;
|
return controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
hci_t *
|
hci_t *
|
||||||
ehci_pci_init (pcidev_t addr)
|
ehci_pci_init (pcidev_t addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,7 +102,7 @@ ehci_rh_scanport (usbdev_t *dev, int port)
|
||||||
/* device connected, handle */
|
/* device connected, handle */
|
||||||
if (RH_INST(dev)->ports[port] & P_CURR_CONN_STATUS) {
|
if (RH_INST(dev)->ports[port] & P_CURR_CONN_STATUS) {
|
||||||
mdelay(100); // usb20 spec 9.1.2
|
mdelay(100); // usb20 spec 9.1.2
|
||||||
if (!IS_ENABLED(CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT) &&
|
if (!CONFIG(LP_USB_EHCI_HOSTPC_ROOT_HUB_TT) &&
|
||||||
(RH_INST(dev)->ports[port] & P_LINE_STATUS) ==
|
(RH_INST(dev)->ports[port] & P_LINE_STATUS) ==
|
||||||
P_LINE_STATUS_LOWSPEED) {
|
P_LINE_STATUS_LOWSPEED) {
|
||||||
ehci_rh_hand_over_port(dev, port);
|
ehci_rh_hand_over_port(dev, port);
|
||||||
|
@ -138,7 +138,7 @@ ehci_rh_scanport (usbdev_t *dev, int port)
|
||||||
ehci_rh_hand_over_port(dev, port);
|
ehci_rh_hand_over_port(dev, port);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (IS_ENABLED(CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT)) {
|
if (CONFIG(LP_USB_EHCI_HOSTPC_ROOT_HUB_TT)) {
|
||||||
port_speed = (usb_speed)
|
port_speed = (usb_speed)
|
||||||
((EHCI_INST(dev->controller)->operation->hostpc
|
((EHCI_INST(dev->controller)->operation->hostpc
|
||||||
>> 25) & 0x03);
|
>> 25) & 0x03);
|
||||||
|
|
|
@ -247,7 +247,7 @@ ohci_init (unsigned long physical_bar)
|
||||||
return controller;
|
return controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
hci_t *
|
hci_t *
|
||||||
ohci_pci_init (pcidev_t addr)
|
ohci_pci_init (pcidev_t addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -563,7 +563,7 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr)
|
||||||
break;
|
break;
|
||||||
case hid_device:
|
case hid_device:
|
||||||
usb_debug ("HID\n");
|
usb_debug ("HID\n");
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_HID)
|
#if CONFIG(LP_USB_HID)
|
||||||
dev->init = usb_hid_init;
|
dev->init = usb_hid_init;
|
||||||
return dev->address;
|
return dev->address;
|
||||||
#else
|
#else
|
||||||
|
@ -581,7 +581,7 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr)
|
||||||
break;
|
break;
|
||||||
case msc_device:
|
case msc_device:
|
||||||
usb_debug ("MSC\n");
|
usb_debug ("MSC\n");
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_MSC)
|
#if CONFIG(LP_USB_MSC)
|
||||||
dev->init = usb_msc_init;
|
dev->init = usb_msc_init;
|
||||||
return dev->address;
|
return dev->address;
|
||||||
#else
|
#else
|
||||||
|
@ -590,7 +590,7 @@ set_address (hci_t *controller, usb_speed speed, int hubport, int hubaddr)
|
||||||
break;
|
break;
|
||||||
case hub_device:
|
case hub_device:
|
||||||
usb_debug ("hub\n");
|
usb_debug ("hub\n");
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_HUB)
|
#if CONFIG(LP_USB_HUB)
|
||||||
dev->init = usb_hub_init;
|
dev->init = usb_hub_init;
|
||||||
return dev->address;
|
return dev->address;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -142,7 +142,7 @@ struct layout_maps {
|
||||||
static const struct layout_maps *map;
|
static const struct layout_maps *map;
|
||||||
|
|
||||||
static const struct layout_maps keyboard_layouts[] = {
|
static const struct layout_maps keyboard_layouts[] = {
|
||||||
// #if IS_ENABLED(CONFIG_LP_PC_KEYBOARD_LAYOUT_US)
|
// #if CONFIG(LP_PC_KEYBOARD_LAYOUT_US)
|
||||||
{ .country = "us", .map = {
|
{ .country = "us", .map = {
|
||||||
{ /* No modifier */
|
{ /* No modifier */
|
||||||
-1, -1, -1, -1, 'a', 'b', 'c', 'd',
|
-1, -1, -1, -1, 'a', 'b', 'c', 'd',
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "dwc2.h"
|
#include "dwc2.h"
|
||||||
#include <usb/usbdisk.h>
|
#include <usb/usbdisk.h>
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
/**
|
/**
|
||||||
* Initializes USB controller attached to PCI
|
* Initializes USB controller attached to PCI
|
||||||
*
|
*
|
||||||
|
@ -72,7 +72,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
|
||||||
pciid >> 16, pciid & 0xFFFF, func);
|
pciid >> 16, pciid & 0xFFFF, func);
|
||||||
switch (prog_if) {
|
switch (prog_if) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_UHCI)
|
#if CONFIG(LP_USB_UHCI)
|
||||||
usb_debug("UHCI controller\n");
|
usb_debug("UHCI controller\n");
|
||||||
uhci_pci_init (pci_device);
|
uhci_pci_init (pci_device);
|
||||||
#else
|
#else
|
||||||
|
@ -81,7 +81,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x10:
|
case 0x10:
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_OHCI)
|
#if CONFIG(LP_USB_OHCI)
|
||||||
usb_debug("OHCI controller\n");
|
usb_debug("OHCI controller\n");
|
||||||
ohci_pci_init(pci_device);
|
ohci_pci_init(pci_device);
|
||||||
#else
|
#else
|
||||||
|
@ -90,7 +90,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x20:
|
case 0x20:
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_EHCI)
|
#if CONFIG(LP_USB_EHCI)
|
||||||
usb_debug("EHCI controller\n");
|
usb_debug("EHCI controller\n");
|
||||||
ehci_pci_init(pci_device);
|
ehci_pci_init(pci_device);
|
||||||
#else
|
#else
|
||||||
|
@ -99,7 +99,7 @@ static int usb_controller_initialize(int bus, int dev, int func)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x30:
|
case 0x30:
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_XHCI)
|
#if CONFIG(LP_USB_XHCI)
|
||||||
usb_debug("xHCI controller\n");
|
usb_debug("xHCI controller\n");
|
||||||
xhci_pci_init(pci_device);
|
xhci_pci_init(pci_device);
|
||||||
#else
|
#else
|
||||||
|
@ -166,7 +166,7 @@ static void usb_scan_pci_bus(int bus)
|
||||||
*/
|
*/
|
||||||
int usb_initialize(void)
|
int usb_initialize(void)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
usb_scan_pci_bus(0);
|
usb_scan_pci_bus(0);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -175,19 +175,19 @@ int usb_initialize(void)
|
||||||
hci_t *usb_add_mmio_hc(hc_type type, void *bar)
|
hci_t *usb_add_mmio_hc(hc_type type, void *bar)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_OHCI)
|
#if CONFIG(LP_USB_OHCI)
|
||||||
case OHCI:
|
case OHCI:
|
||||||
return ohci_init((unsigned long)bar);
|
return ohci_init((unsigned long)bar);
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_EHCI)
|
#if CONFIG(LP_USB_EHCI)
|
||||||
case EHCI:
|
case EHCI:
|
||||||
return ehci_init((unsigned long)bar);
|
return ehci_init((unsigned long)bar);
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_DWC2)
|
#if CONFIG(LP_USB_DWC2)
|
||||||
case DWC2:
|
case DWC2:
|
||||||
return dwc2_init(bar);
|
return dwc2_init(bar);
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_XHCI)
|
#if CONFIG(LP_USB_XHCI)
|
||||||
case XHCI:
|
case XHCI:
|
||||||
return xhci_init((unsigned long)bar);
|
return xhci_init((unsigned long)bar);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -88,7 +88,7 @@ xhci_init_cycle_ring(transfer_ring_t *const tr, const size_t ring_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On Panther Point: switch ports shared with EHCI to xHCI */
|
/* On Panther Point: switch ports shared with EHCI to xHCI */
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
static void
|
static void
|
||||||
xhci_switch_ppt_ports(pcidev_t addr)
|
xhci_switch_ppt_ports(pcidev_t addr)
|
||||||
{
|
{
|
||||||
|
@ -112,7 +112,7 @@ xhci_switch_ppt_ports(pcidev_t addr)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
/* On Panther Point: switch all ports back to EHCI */
|
/* On Panther Point: switch all ports back to EHCI */
|
||||||
static void
|
static void
|
||||||
xhci_switchback_ppt_ports(pcidev_t addr)
|
xhci_switchback_ppt_ports(pcidev_t addr)
|
||||||
|
@ -297,7 +297,7 @@ _free_xhci:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
hci_t *
|
hci_t *
|
||||||
xhci_pci_init (pcidev_t addr)
|
xhci_pci_init (pcidev_t addr)
|
||||||
{
|
{
|
||||||
|
@ -336,7 +336,7 @@ xhci_reset(hci_t *const controller)
|
||||||
* Without this delay, the subsequent HC register access,
|
* Without this delay, the subsequent HC register access,
|
||||||
* may result in a system hang very rarely.
|
* may result in a system hang very rarely.
|
||||||
*/
|
*/
|
||||||
if (IS_ENABLED(CONFIG_LP_ARCH_X86))
|
if (CONFIG(LP_ARCH_X86))
|
||||||
mdelay(1);
|
mdelay(1);
|
||||||
|
|
||||||
xhci_debug("Resetting controller... ");
|
xhci_debug("Resetting controller... ");
|
||||||
|
@ -426,7 +426,7 @@ xhci_shutdown(hci_t *const controller)
|
||||||
xhci_t *const xhci = XHCI_INST(controller);
|
xhci_t *const xhci = XHCI_INST(controller);
|
||||||
xhci_stop(controller);
|
xhci_stop(controller);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_USB_PCI)
|
#if CONFIG(LP_USB_PCI)
|
||||||
if (controller->pcidev)
|
if (controller->pcidev)
|
||||||
xhci_switchback_ppt_ports(controller->pcidev);
|
xhci_switchback_ppt_ports(controller->pcidev);
|
||||||
#endif
|
#endif
|
||||||
|
@ -563,7 +563,7 @@ xhci_enqueue_td(transfer_ring_t *const tr, const int ep, const size_t mps,
|
||||||
cur_length = length;
|
cur_length = length;
|
||||||
packets = 0;
|
packets = 0;
|
||||||
length = 0;
|
length = 0;
|
||||||
} else if (!IS_ENABLED(CONFIG_LP_USB_XHCI_MTK_QUIRK)) {
|
} else if (!CONFIG(LP_USB_XHCI_MTK_QUIRK)) {
|
||||||
packets -= (residue + cur_length) / mps;
|
packets -= (residue + cur_length) / mps;
|
||||||
residue = (residue + cur_length) % mps;
|
residue = (residue + cur_length) % mps;
|
||||||
length -= cur_length;
|
length -= cur_length;
|
||||||
|
@ -576,7 +576,7 @@ xhci_enqueue_td(transfer_ring_t *const tr, const int ep, const size_t mps,
|
||||||
TRB_SET(TDS, trb, MIN(TRB_MAX_TD_SIZE, packets));
|
TRB_SET(TDS, trb, MIN(TRB_MAX_TD_SIZE, packets));
|
||||||
TRB_SET(CH, trb, 1);
|
TRB_SET(CH, trb, 1);
|
||||||
|
|
||||||
if (length && IS_ENABLED(CONFIG_LP_USB_XHCI_MTK_QUIRK)) {
|
if (length && CONFIG(LP_USB_XHCI_MTK_QUIRK)) {
|
||||||
/*
|
/*
|
||||||
* For MTK's xHCI controller, TDS defines a number of
|
* For MTK's xHCI controller, TDS defines a number of
|
||||||
* packets that remain to be transferred for a TD after
|
* packets that remain to be transferred for a TD after
|
||||||
|
|
|
@ -353,7 +353,7 @@ xhci_finish_ep_config(const endpoint_t *const ep, inputctx_t *const ic)
|
||||||
EC_SET(AVRTRB, epctx, avrtrb);
|
EC_SET(AVRTRB, epctx, avrtrb);
|
||||||
EC_SET(MXESIT, epctx, EC_GET(MPS, epctx) * EC_GET(MBS, epctx));
|
EC_SET(MXESIT, epctx, EC_GET(MPS, epctx) * EC_GET(MBS, epctx));
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LP_USB_XHCI_MTK_QUIRK)) {
|
if (CONFIG(LP_USB_XHCI_MTK_QUIRK)) {
|
||||||
/* The MTK xHCI defines some extra SW parameters which are
|
/* The MTK xHCI defines some extra SW parameters which are
|
||||||
* put into reserved DWs in Slot and Endpoint Contexts for
|
* put into reserved DWs in Slot and Endpoint Contexts for
|
||||||
* synchronous endpoints. But for non-isochronous transfers,
|
* synchronous endpoints. But for non-isochronous transfers,
|
||||||
|
|
|
@ -122,7 +122,7 @@ xhci_rh_reset_port(usbdev_t *const dev, const int port)
|
||||||
static int
|
static int
|
||||||
xhci_rh_enable_port(usbdev_t *const dev, int port)
|
xhci_rh_enable_port(usbdev_t *const dev, int port)
|
||||||
{
|
{
|
||||||
if (IS_ENABLED(CONFIG_LP_USB_XHCI_MTK_QUIRK)) {
|
if (CONFIG(LP_USB_XHCI_MTK_QUIRK)) {
|
||||||
xhci_t *const xhci = XHCI_INST(dev->controller);
|
xhci_t *const xhci = XHCI_INST(dev->controller);
|
||||||
volatile u32 *const portsc =
|
volatile u32 *const portsc =
|
||||||
&xhci->opreg->prs[port - 1].portsc;
|
&xhci->opreg->prs[port - 1].portsc;
|
||||||
|
|
|
@ -31,27 +31,27 @@
|
||||||
#include <libpayload.h>
|
#include <libpayload.h>
|
||||||
#include <video_console.h>
|
#include <video_console.h>
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_GEODELX_VIDEO_CONSOLE)
|
#if CONFIG(LP_GEODELX_VIDEO_CONSOLE)
|
||||||
extern struct video_console geodelx_video_console;
|
extern struct video_console geodelx_video_console;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CONSOLE)
|
#if CONFIG(LP_COREBOOT_VIDEO_CONSOLE)
|
||||||
extern struct video_console coreboot_video_console;
|
extern struct video_console coreboot_video_console;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_VGA_VIDEO_CONSOLE)
|
#if CONFIG(LP_VGA_VIDEO_CONSOLE)
|
||||||
extern struct video_console vga_video_console;
|
extern struct video_console vga_video_console;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct video_console *console_list[] =
|
static struct video_console *console_list[] =
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_GEODELX_VIDEO_CONSOLE)
|
#if CONFIG(LP_GEODELX_VIDEO_CONSOLE)
|
||||||
&geodelx_video_console,
|
&geodelx_video_console,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CONSOLE)
|
#if CONFIG(LP_COREBOOT_VIDEO_CONSOLE)
|
||||||
&coreboot_video_console,
|
&coreboot_video_console,
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_VGA_VIDEO_CONSOLE)
|
#if CONFIG(LP_VGA_VIDEO_CONSOLE)
|
||||||
&vga_video_console,
|
&vga_video_console,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,7 +53,7 @@ static inline uint64_t swap_bytes64(uint64_t in)
|
||||||
|
|
||||||
/* Endian functions from glibc 2.9 / BSD "endian.h" */
|
/* Endian functions from glibc 2.9 / BSD "endian.h" */
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_BIG_ENDIAN)
|
#if CONFIG(LP_BIG_ENDIAN)
|
||||||
|
|
||||||
#define htobe16(in) (in)
|
#define htobe16(in) (in)
|
||||||
#define htobe32(in) (in)
|
#define htobe32(in) (in)
|
||||||
|
@ -63,7 +63,7 @@ static inline uint64_t swap_bytes64(uint64_t in)
|
||||||
#define htole32(in) swap_bytes32(in)
|
#define htole32(in) swap_bytes32(in)
|
||||||
#define htole64(in) swap_bytes64(in)
|
#define htole64(in) swap_bytes64(in)
|
||||||
|
|
||||||
#elif IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
|
#elif CONFIG(LP_LITTLE_ENDIAN)
|
||||||
|
|
||||||
#define htobe16(in) swap_bytes16(in)
|
#define htobe16(in) swap_bytes16(in)
|
||||||
#define htobe32(in) swap_bytes32(in)
|
#define htobe32(in) swap_bytes32(in)
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
* @defgroup malloc Memory allocation functions
|
* @defgroup malloc Memory allocation functions
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC) && !defined(IN_MALLOC_C)
|
#if CONFIG(LP_DEBUG_MALLOC) && !defined(IN_MALLOC_C)
|
||||||
#define free(p) \
|
#define free(p) \
|
||||||
({ \
|
({ \
|
||||||
extern void print_malloc_map(void); \
|
extern void print_malloc_map(void); \
|
||||||
|
@ -222,7 +222,7 @@ void gdb_exit(s8 exit_status);
|
||||||
void halt(void) __attribute__((noreturn));
|
void halt(void) __attribute__((noreturn));
|
||||||
void exit(int status) __attribute__((noreturn));
|
void exit(int status) __attribute__((noreturn));
|
||||||
#define abort() halt() /**< Alias for the halt() function */
|
#define abort() halt() /**< Alias for the halt() function */
|
||||||
#if IS_ENABLED(CONFIG_LP_REMOTEGDB)
|
#if CONFIG(LP_REMOTEGDB)
|
||||||
/* Override abort()/halt() to trap into GDB if it is enabled. */
|
/* Override abort()/halt() to trap into GDB if it is enabled. */
|
||||||
#define halt() do { gdb_enter(); halt(); } while (0)
|
#define halt() do { gdb_enter(); halt(); } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_LP_STORAGE_64BIT_LBA)
|
#if !CONFIG(LP_STORAGE_64BIT_LBA)
|
||||||
typedef u32 lba_t;
|
typedef u32 lba_t;
|
||||||
#else
|
#else
|
||||||
typedef u64 lba_t;
|
typedef u64 lba_t;
|
||||||
|
|
|
@ -98,7 +98,7 @@ struct sysinfo_t {
|
||||||
void *vboot_handoff;
|
void *vboot_handoff;
|
||||||
u32 vboot_handoff_size;
|
u32 vboot_handoff_size;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_ARCH_X86)
|
#if CONFIG(LP_ARCH_X86)
|
||||||
int x86_rom_var_mtrr_index;
|
int x86_rom_var_mtrr_index;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <libpayload-config.h>
|
#include <libpayload-config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
|
#if !CONFIG(LP_LITTLE_ENDIAN)
|
||||||
#error this code is for little endian only
|
#error this code is for little endian only
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -102,16 +102,16 @@ int console_remove_output_driver(void *function)
|
||||||
|
|
||||||
void console_init(void)
|
void console_init(void)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_VIDEO_CONSOLE)
|
#if CONFIG(LP_VIDEO_CONSOLE)
|
||||||
video_console_init();
|
video_console_init();
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_SERIAL_CONSOLE)
|
#if CONFIG(LP_SERIAL_CONSOLE)
|
||||||
serial_console_init();
|
serial_console_init();
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD)
|
#if CONFIG(LP_PC_KEYBOARD)
|
||||||
keyboard_init();
|
keyboard_init();
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_CBMEM_CONSOLE)
|
#if CONFIG(LP_CBMEM_CONSOLE)
|
||||||
cbmem_console_init();
|
cbmem_console_init();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ int puts(const char *s)
|
||||||
|
|
||||||
int havekey(void)
|
int havekey(void)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_USB)
|
#if CONFIG(LP_USB)
|
||||||
usb_poll();
|
usb_poll();
|
||||||
#endif
|
#endif
|
||||||
struct console_input_driver *in;
|
struct console_input_driver *in;
|
||||||
|
@ -164,7 +164,7 @@ int havekey(void)
|
||||||
int getchar(void)
|
int getchar(void)
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
#if IS_ENABLED(CONFIG_LP_USB)
|
#if CONFIG(LP_USB)
|
||||||
usb_poll();
|
usb_poll();
|
||||||
#endif
|
#endif
|
||||||
struct console_input_driver *in;
|
struct console_input_driver *in;
|
||||||
|
|
|
@ -56,7 +56,7 @@ static void cb_parse_memory(void *ptr, struct sysinfo_t *info)
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
struct cb_memory_range *range = MEM_RANGE_PTR(mem, i);
|
struct cb_memory_range *range = MEM_RANGE_PTR(mem, i);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_MEMMAP_RAM_ONLY)
|
#if CONFIG(LP_MEMMAP_RAM_ONLY)
|
||||||
if (range->type != CB_MEM_RAM)
|
if (range->type != CB_MEM_RAM)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
@ -155,7 +155,7 @@ static void cb_parse_sku_id(unsigned char *ptr, struct sysinfo_t *info)
|
||||||
info->sku_id = sku_id->id_code;
|
info->sku_id = sku_id->id_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_NVRAM)
|
#if CONFIG(LP_NVRAM)
|
||||||
static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info)
|
static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info)
|
||||||
{
|
{
|
||||||
/* ptr points to a coreboot table entry and is already virtual */
|
/* ptr points to a coreboot table entry and is already virtual */
|
||||||
|
@ -171,7 +171,7 @@ static void cb_parse_checksum(void *ptr, struct sysinfo_t *info)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CONSOLE)
|
#if CONFIG(LP_COREBOOT_VIDEO_CONSOLE)
|
||||||
static void cb_parse_framebuffer(void *ptr, struct sysinfo_t *info)
|
static void cb_parse_framebuffer(void *ptr, struct sysinfo_t *info)
|
||||||
{
|
{
|
||||||
/* ptr points to a coreboot table entry and is already virtual */
|
/* ptr points to a coreboot table entry and is already virtual */
|
||||||
|
@ -232,7 +232,7 @@ static void cb_parse_vpd(void *ptr, struct sysinfo_t *info)
|
||||||
info->chromeos_vpd = phys_to_virt(cbmem->cbmem_tab);
|
info->chromeos_vpd = phys_to_virt(cbmem->cbmem_tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_TIMER_RDTSC)
|
#if CONFIG(LP_TIMER_RDTSC)
|
||||||
static void cb_parse_tsc_info(void *ptr, struct sysinfo_t *info)
|
static void cb_parse_tsc_info(void *ptr, struct sysinfo_t *info)
|
||||||
{
|
{
|
||||||
const struct cb_tsc_info *tsc_info = ptr;
|
const struct cb_tsc_info *tsc_info = ptr;
|
||||||
|
@ -328,7 +328,7 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||||
case CB_TAG_ASSEMBLER:
|
case CB_TAG_ASSEMBLER:
|
||||||
cb_parse_string(ptr, &info->assembler);
|
cb_parse_string(ptr, &info->assembler);
|
||||||
break;
|
break;
|
||||||
#if IS_ENABLED(CONFIG_LP_NVRAM)
|
#if CONFIG(LP_NVRAM)
|
||||||
case CB_TAG_CMOS_OPTION_TABLE:
|
case CB_TAG_CMOS_OPTION_TABLE:
|
||||||
cb_parse_optiontable(ptr, info);
|
cb_parse_optiontable(ptr, info);
|
||||||
break;
|
break;
|
||||||
|
@ -336,7 +336,7 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||||
cb_parse_checksum(ptr, info);
|
cb_parse_checksum(ptr, info);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CONSOLE)
|
#if CONFIG(LP_COREBOOT_VIDEO_CONSOLE)
|
||||||
// FIXME we should warn on serial if coreboot set up a
|
// FIXME we should warn on serial if coreboot set up a
|
||||||
// framebuffer buf the payload does not know about it.
|
// framebuffer buf the payload does not know about it.
|
||||||
case CB_TAG_FRAMEBUFFER:
|
case CB_TAG_FRAMEBUFFER:
|
||||||
|
@ -394,7 +394,7 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||||
case CB_TAG_BOOT_MEDIA_PARAMS:
|
case CB_TAG_BOOT_MEDIA_PARAMS:
|
||||||
cb_parse_boot_media_params(ptr, info);
|
cb_parse_boot_media_params(ptr, info);
|
||||||
break;
|
break;
|
||||||
#if IS_ENABLED(CONFIG_LP_TIMER_RDTSC)
|
#if CONFIG(LP_TIMER_RDTSC)
|
||||||
case CB_TAG_TSC_INFO:
|
case CB_TAG_TSC_INFO:
|
||||||
cb_parse_tsc_info(ptr, info);
|
cb_parse_tsc_info(ptr, info);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <libpayload-config.h>
|
#include <libpayload-config.h>
|
||||||
#include <libpayload.h>
|
#include <libpayload.h>
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_ARCH_X86)
|
#if CONFIG(LP_ARCH_X86)
|
||||||
extern void i386_do_exec(long addr, int argc, char **argv, int *ret);
|
extern void i386_do_exec(long addr, int argc, char **argv, int *ret);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ int exec(long addr, int argc, char **argv)
|
||||||
{
|
{
|
||||||
int val = -1;
|
int val = -1;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_ARCH_X86)
|
#if CONFIG(LP_ARCH_X86)
|
||||||
i386_do_exec(addr, argc, argv, &val);
|
i386_do_exec(addr, argc, argv, &val);
|
||||||
#endif
|
#endif
|
||||||
return val;
|
return val;
|
||||||
|
|
|
@ -47,7 +47,7 @@ struct memory_type {
|
||||||
void *start;
|
void *start;
|
||||||
void *end;
|
void *end;
|
||||||
struct align_region_t* align_regions;
|
struct align_region_t* align_regions;
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
int magic_initialized;
|
int magic_initialized;
|
||||||
size_t minimal_free;
|
size_t minimal_free;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
@ -58,7 +58,7 @@ extern char _heap, _eheap; /* Defined in the ldscript. */
|
||||||
|
|
||||||
static struct memory_type default_type =
|
static struct memory_type default_type =
|
||||||
{ (void *)&_heap, (void *)&_eheap, NULL
|
{ (void *)&_heap, (void *)&_eheap, NULL
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
, 0, 0, "HEAP"
|
, 0, 0, "HEAP"
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -104,7 +104,7 @@ void init_dma_memory(void *start, u32 size)
|
||||||
dma->end = start + size;
|
dma->end = start + size;
|
||||||
dma->align_regions = NULL;
|
dma->align_regions = NULL;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
dma->minimal_free = 0;
|
dma->minimal_free = 0;
|
||||||
dma->magic_initialized = 0;
|
dma->magic_initialized = 0;
|
||||||
dma->name = "DMA";
|
dma->name = "DMA";
|
||||||
|
@ -139,7 +139,7 @@ static void *alloc(int len, struct memory_type *type)
|
||||||
if (!HAS_MAGIC(*ptr)) {
|
if (!HAS_MAGIC(*ptr)) {
|
||||||
size_t size = (type->end - type->start) - HDRSIZE;
|
size_t size = (type->end - type->start) - HDRSIZE;
|
||||||
*ptr = FREE_BLOCK(size);
|
*ptr = FREE_BLOCK(size);
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
type->magic_initialized = 1;
|
type->magic_initialized = 1;
|
||||||
type->minimal_free = size;
|
type->minimal_free = size;
|
||||||
#endif
|
#endif
|
||||||
|
@ -356,7 +356,7 @@ static struct align_region_t *allocate_region(int alignment, int num_elements,
|
||||||
struct align_region_t *r;
|
struct align_region_t *r;
|
||||||
size_t extra_space;
|
size_t extra_space;
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
printf("%s(old align_regions=%p, alignment=%u, num_elements=%u, size=%zu)\n",
|
printf("%s(old align_regions=%p, alignment=%u, num_elements=%u, size=%zu)\n",
|
||||||
__func__, type->align_regions, alignment, num_elements, size);
|
__func__, type->align_regions, alignment, num_elements, size);
|
||||||
#endif
|
#endif
|
||||||
|
@ -479,7 +479,7 @@ look_further:
|
||||||
{
|
{
|
||||||
if ((reg->alignment == align) && (reg->free >= (size + align - 1)/align))
|
if ((reg->alignment == align) && (reg->free >= (size + align - 1)/align))
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
printf(" found memalign region. %x free, %x required\n", reg->free, (size + align - 1)/align);
|
printf(" found memalign region. %x free, %x required\n", reg->free, (size + align - 1)/align);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -488,12 +488,12 @@ look_further:
|
||||||
}
|
}
|
||||||
if (reg == 0)
|
if (reg == 0)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
printf(" need to allocate a new memalign region\n");
|
printf(" need to allocate a new memalign region\n");
|
||||||
#endif
|
#endif
|
||||||
/* get align regions */
|
/* get align regions */
|
||||||
reg = allocate_region(align, large_request/align, size, type);
|
reg = allocate_region(align, large_request/align, size, type);
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
printf(" ... returned %p\n", reg);
|
printf(" ... returned %p\n", reg);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -539,7 +539,7 @@ void *dma_memalign(size_t align, size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is for debugging purposes. */
|
/* This is for debugging purposes. */
|
||||||
#if IS_ENABLED(CONFIG_LP_DEBUG_MALLOC)
|
#if CONFIG(LP_DEBUG_MALLOC)
|
||||||
void print_malloc_map(void)
|
void print_malloc_map(void)
|
||||||
{
|
{
|
||||||
struct memory_type *type = heap;
|
struct memory_type *type = heap;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
#include <libpayload-config.h>
|
#include <libpayload-config.h>
|
||||||
#include <libpayload.h>
|
#include <libpayload.h>
|
||||||
#if IS_ENABLED(CONFIG_LP_ARCH_X86) && IS_ENABLED(CONFIG_LP_NVRAM)
|
#if CONFIG(LP_ARCH_X86) && CONFIG(LP_NVRAM)
|
||||||
#include <arch/rdtsc.h>
|
#include <arch/rdtsc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ static void update_clock(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_LP_NVRAM)
|
#if CONFIG(LP_NVRAM)
|
||||||
|
|
||||||
static unsigned int day_of_year(int mon, int day, int year)
|
static unsigned int day_of_year(int mon, int day, int year)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
|
|
||||||
#ifdef LIBPAYLOAD
|
#ifdef LIBPAYLOAD
|
||||||
# include <libpayload-config.h>
|
# include <libpayload-config.h>
|
||||||
# if IS_ENABLED(CONFIG_LP_LZMA)
|
# if CONFIG(LP_LZMA)
|
||||||
# include <lzma.h>
|
# include <lzma.h>
|
||||||
# define CBFS_CORE_WITH_LZMA
|
# define CBFS_CORE_WITH_LZMA
|
||||||
# endif
|
# endif
|
||||||
# if IS_ENABLED(CONFIG_LP_LZ4)
|
# if CONFIG(LP_LZ4)
|
||||||
# include <lz4.h>
|
# include <lz4.h>
|
||||||
# define CBFS_CORE_WITH_LZ4
|
# define CBFS_CORE_WITH_LZ4
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -119,7 +119,7 @@ static int get_cbfs_range(uint32_t *offset, uint32_t *cbfs_end,
|
||||||
// Logical offset (for source media) of first file.
|
// Logical offset (for source media) of first file.
|
||||||
*offset = ntohl(header->offset);
|
*offset = ntohl(header->offset);
|
||||||
*cbfs_end = ntohl(header->romsize);
|
*cbfs_end = ntohl(header->romsize);
|
||||||
#if IS_ENABLED(CONFIG_LP_ARCH_X86)
|
#if CONFIG(LP_ARCH_X86)
|
||||||
// resolve actual length of ROM used for CBFS components
|
// resolve actual length of ROM used for CBFS components
|
||||||
// the bootblock size was not taken into account
|
// the bootblock size was not taken into account
|
||||||
*cbfs_end -= ntohl(header->bootblocksize);
|
*cbfs_end -= ntohl(header->bootblocksize);
|
||||||
|
|
|
@ -176,7 +176,7 @@ int main(void)
|
||||||
int ch, done;
|
int ch, done;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_LP_USB))
|
if (CONFIG(LP_USB))
|
||||||
usb_initialize();
|
usb_initialize();
|
||||||
|
|
||||||
/* coreboot data structures */
|
/* coreboot data structures */
|
||||||
|
|
Loading…
Reference in New Issue