summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2013-07-16 15:29:15 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-09-17 16:45:31 -0500
commit5652d7c0c6a8db05699f2b4334e4615e1ba22127 (patch)
treea04321010213943bc44a908a0de0e88149a7e7de /src/include
parent7c3226b7ef2b3e09bd40823732f05fbf0fe6778f (diff)
downloadtalos-hostboot-5652d7c0c6a8db05699f2b4334e4615e1ba22127.tar.gz
talos-hostboot-5652d7c0c6a8db05699f2b4334e4615e1ba22127.zip
Initial Hostboot Runtime image support.
RTC: 76675 Change-Id: Ibd21cf5b555e6dcee182a2f1a292b47d4f384ba0 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6127 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/builtins.h5
-rw-r--r--src/include/runtime/interface.h79
-rw-r--r--src/include/stdio.h47
-rwxr-xr-xsrc/include/usr/cxxtest/TestSuite.H22
-rw-r--r--src/include/usr/pnor/pnorif.H3
5 files changed, 132 insertions, 24 deletions
diff --git a/src/include/builtins.h b/src/include/builtins.h
index 1c07e8d04..03bf5325a 100644
--- a/src/include/builtins.h
+++ b/src/include/builtins.h
@@ -42,6 +42,11 @@ extern "C"
#define ALWAYS_INLINE __attribute__((always_inline))
/**
+ * Use of this macro will ensure that a function is never inlined.
+ */
+#define NEVER_INLINE __attribute__((noinline))
+
+/**
* Use of this macro will ensure a data structure is aligned on a cacheline boundary
*/
#define ALIGN_CACHELINE __attribute__((aligned (128)))
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
new file mode 100644
index 000000000..fd3e1ba79
--- /dev/null
+++ b/src/include/runtime/interface.h
@@ -0,0 +1,79 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/runtime/interface.h $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __RUNTIME__INTERFACE_H
+#define __RUNTIME__INTERFACE_H
+
+/** @file interface.h
+ * @brief Interfaces between Hostboot Runtime and Sapphire.
+ *
+ * This file has two structures of function pointers: hostInterfaces_t and
+ * runtimeInterfaces_t. hostInterfaces are provided by Sapphire (or a
+ * similar environment, such as Hostboot IPL's CxxTest execution).
+ * runtimeInterfaces are provided by Hostboot Runtime to Sapphire.
+ *
+ * @note This file must be in C rather than C++.
+ */
+
+#include <stdint.h>
+
+/** @typedef hostInterfaces_t
+ * @brief Interfaces provided by the underlying environment (ex. Sapphire).
+ *
+ * @note Some of these functions are not required (marked optional) and
+ * may be NULL.
+ */
+typedef struct hostInterfaces
+{
+ /** Put a string to the console. */
+ void (*puts)(const char*);
+ /** Critical failure in runtime execution. */
+ void (*assert)();
+
+ /** OPTIONAL. Hint to environment that the page may be executed. */
+ int (*set_page_execute)(void*);
+
+ /** malloc */
+ void* (*malloc)(size_t);
+ /** free */
+ void (*free)(void*);
+ /** realloc */
+ void* (*realloc)(void*, size_t);
+
+} hostInterfaces_t;
+
+typedef struct runtimeInterfaces
+{
+ /** Execute CxxTests that may be contained in the image.
+ *
+ * @param[in] - Pointer to CxxTestStats structure for results reporting.
+ */
+ void (*cxxtestExecute)(void*);
+
+} runtimeInterfaces_t;
+
+#ifdef __HOSTBOOT_RUNTIME
+extern hostInterfaces_t* g_hostInterfaces;
+runtimeInterfaces_t* getRuntimeInterfaces();
+#endif
+
+#endif
diff --git a/src/include/stdio.h b/src/include/stdio.h
index abf4c3b72..0e066af3b 100644
--- a/src/include/stdio.h
+++ b/src/include/stdio.h
@@ -1,34 +1,37 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/stdio.h $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/stdio.h $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __STDIO_H
#define __STDIO_H
+#include <stdarg.h>
+
#ifdef __cplusplus
extern "C"
{
#endif
int sprintf(char *str, const char * format, ...);
+int vsprintf(char *str, const char * format, va_list);
#ifdef __cplusplus
diff --git a/src/include/usr/cxxtest/TestSuite.H b/src/include/usr/cxxtest/TestSuite.H
index cfeb76be0..af6b03b50 100755
--- a/src/include/usr/cxxtest/TestSuite.H
+++ b/src/include/usr/cxxtest/TestSuite.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
/* */
/* p1 */
/* */
@@ -110,6 +110,26 @@ extern uint64_t g_ModulesCompleted;
#define TS_FAIL(...) TRACFCOMP( g_trac_test, "!!!TS_FAIL> " __VA_ARGS__); \
CxxTest::doFailTest( __FILE__, __LINE__ )
+// These are all implemented in the cxxtest_data.C that gets put into the base
+// image.
+extern uint64_t g_TotalTests;
+extern uint64_t g_TraceCalls;
+extern uint64_t g_Warnings;
+extern uint64_t g_FailedTests;
+extern uint64_t g_ModulesStarted;
+extern uint64_t g_ModulesCompleted;
+
+// Statistics structure for passing original pointers to the runtime test suite.
+struct CxxTestStats
+{
+ uint64_t* totalTests;
+ uint64_t* traceCalls;
+ uint64_t* warnings;
+ uint64_t* failedTests;
+ uint64_t* modulesStarted;
+ uint64_t* modulesCompleted;
+};
+
}
#endif // __cxxtest__TestSuite_h__
diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H
index 4f3b5d930..bc3594f70 100644
--- a/src/include/usr/pnor/pnorif.H
+++ b/src/include/usr/pnor/pnorif.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* COPYRIGHT International Business Machines Corp. 2011,2013 */
/* */
/* p1 */
/* */
@@ -44,6 +44,7 @@ enum SectionId
SBE_IPL, /**< Self-Boot Engine IPL image */
WINK, /**< Sleep Winkle Reference image */
PAYLOAD, /**< HAL/OPAL */
+ HB_RUNTIME, /**< Hostboot Runtime (for Sapphire) */
HB_DATA, /**< Hostboot Data */
GUARD_DATA, /**< Guard Data */
HB_ERRLOGS, /**< Hostboot Error log Repository */
OpenPOWER on IntegriCloud