benchmark: Define exit points and values

Benchmarking IO port addresses and return values are now defined
through a dedicated header.

Each exit point can have its own IO port address and return value.
With this we are able to discriminate between similar code paths
through the QEMU process return values or between different
code paths by having the QEMU debugexit device monitoring
different IO port addresses.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
diff --git a/benchmark.h b/benchmark.h
new file mode 100644
index 0000000..089c549
--- /dev/null
+++ b/benchmark.h
@@ -0,0 +1,13 @@
+#ifndef BENCHMARK_H
+#define BENCHMARK_H
+
+/* IO ports for different exit points */
+#define LINUX_EXIT_PORT 0xf4
+#define FW_EXIT_PORT    0xf5
+
+/* Exit point values */
+#define FW_START    1
+#define LINUX_START_FWCFG 2
+#define LINUX_START_BOOT  3
+
+#endif
diff --git a/fw_cfg.c b/fw_cfg.c
index 660c00d..f5aac73 100644
--- a/fw_cfg.c
+++ b/fw_cfg.c
@@ -7,6 +7,7 @@
 #include "bswap.h"
 #include "linuxboot.h"
 #include "multiboot.h"
+#include "benchmark.h"
 
 struct fw_cfg_file {
 	uint32_t size;
@@ -174,7 +175,7 @@
 	/* Exit just before getting to vmlinuz, so that it is easy
 	 * to time/profile the firmware.
 	 */
-	outb(0xf4, 1);
+	outb(LINUX_EXIT_PORT, LINUX_START_FWCFG);
 #endif
 
 	fw_cfg_select(FW_CFG_KERNEL_ENTRY);
diff --git a/linuxboot.c b/linuxboot.c
index 65b5936..a5f1c4f 100644
--- a/linuxboot.c
+++ b/linuxboot.c
@@ -3,6 +3,7 @@
 #include "ioport.h"
 #include "string.h"
 #include "stdio.h"
+#include "benchmark.h"
 
 static inline uint16_t lduw_p(void *p)
 {
@@ -116,7 +117,7 @@
 	/* Exit just before getting to vmlinuz, so that it is easy
 	 * to time/profile the firmware.
 	 */
-	outb(0xf4, 1);
+	outb(LINUX_EXIT_PORT, LINUX_START_BOOT);
 #endif
 	asm volatile(
 	    "ljmp $0x18, $pm16_boot_linux - 0xf0000"