From f00bbd8da79e4c99bbc96efdf80805e16cf90ecc Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Mon, 3 Dec 2018 16:50:47 +0100 Subject: [PATCH] benchmark: add more trace point --- Makefile | 2 +- benchmark.h | 3 +++ main.c | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 937b277..47e93ea 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ obj-y += pci.o all-y = bios.bin all: $(all-y) -CFLAGS := -O2 -g +CFLAGS := -O2 -g -DBENCHMARK_HACK BIOS_CFLAGS += $(autodepend-flags) -Wall BIOS_CFLAGS += -m32 diff --git a/benchmark.h b/benchmark.h index 089c549..372a26b 100644 --- a/benchmark.h +++ b/benchmark.h @@ -9,5 +9,8 @@ #define FW_START 1 #define LINUX_START_FWCFG 2 #define LINUX_START_BOOT 3 +#define FW_DO_BOOT 4 +#define LINUX_START_KERNEL 5 +#define LINUX_START_USER 6 #endif diff --git a/main.c b/main.c index 699cc1a..0bc3707 100644 --- a/main.c +++ b/main.c @@ -91,7 +91,7 @@ static bool detect_cbfs_and_boot(void) int __attribute__ ((section (".text.startup"))) main(void) { #ifdef BENCHMARK_HACK - outb(FW_EXIT_PORT, FW_START); + outb(FW_EXIT_PORT, FW_START); #endif setup_hw(); @@ -106,6 +106,9 @@ int __attribute__ ((section (".text.startup"))) main(void) extract_acpi(); extract_e820(); // extract_smbios(); +#ifdef BENCHMARK_HACK + outb(FW_EXIT_PORT, FW_DO_BOOT); +#endif if (!detect_cbfs_and_boot()) boot_from_fwcfg(); panic(); -- 2.19.2