summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMissy Connell <missyc@us.ibm.com>2012-10-22 16:25:14 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-24 15:43:41 -0500
commitad829721422d652ea89123c6e4c8aecdee0144af (patch)
treebcf03c419c8aa87e8c235355cd5c2440a3c7266f /src
parent799ce7095b6a019d4103685ae85558418b9368c7 (diff)
downloadtalos-hostboot-ad829721422d652ea89123c6e4c8aecdee0144af.tar.gz
talos-hostboot-ad829721422d652ea89123c6e4c8aecdee0144af.zip
Terminate Immediate Structure defintion
- Add include files into the fsp.tar Change-Id: I12a50f7e09f70b1bc6acf436d896b6f3747a7507 RTC:50578 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2115 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/build/mkrules/dist_targets.mk4
-rwxr-xr-xsrc/build/mkrules/hbfw/fsp/makefile3
-rw-r--r--src/include/kernel/hbdescriptor.H38
-rw-r--r--src/include/kernel/hbterminatetypes.H68
-rw-r--r--src/include/kernel/terminate.H45
-rw-r--r--src/kernel.ld47
-rw-r--r--src/kernel/forceattn_p8.S41
-rw-r--r--src/kernel/makefile30
-rw-r--r--src/kernel/start.S10
-rw-r--r--src/kernel/terminate.C56
-rw-r--r--src/kernel/terminate.S40
-rw-r--r--src/lib/assert.C51
-rw-r--r--src/makefile2
13 files changed, 332 insertions, 103 deletions
diff --git a/src/build/mkrules/dist_targets.mk b/src/build/mkrules/dist_targets.mk
index 23f1767d2..97e5a8efd 100644
--- a/src/build/mkrules/dist_targets.mk
+++ b/src/build/mkrules/dist_targets.mk
@@ -171,7 +171,9 @@ fsp.tar_CONTENTS = \
$(addsuffix :hwas/,\
$(call ROOTPATH_WILDCARD_RECURSIVE,src/include/usr/hwas/common)) \
$(addsuffix :pnor/,\
- $(call ROOTPATH_WILDCARD_RECURSIVE,src/usr/pnor/common))
+ $(call ROOTPATH_WILDCARD_RECURSIVE,src/usr/pnor/common)) \
+ src/include/kernel/hbdescriptor.H \
+ src/include/kernel/hbterminatetypes.H \
#
# Portions of the FSP sandbox which must be rebuilt based on file changes.
diff --git a/src/build/mkrules/hbfw/fsp/makefile b/src/build/mkrules/hbfw/fsp/makefile
index 2e948cca7..2b2845ddb 100755
--- a/src/build/mkrules/hbfw/fsp/makefile
+++ b/src/build/mkrules/hbfw/fsp/makefile
@@ -39,6 +39,9 @@ EXPSHLIB_SUBDIRS += targeting
STANDARD_SUBDIRS += targeting
RUNBVT_SUBDIRS +=
+INCLUDES = hbdescriptor.H \
+ hbterminatetypes.H \
+
.elseif(${CONTEXT} == "x86.nfp")
.include "makefile.nfp"
diff --git a/src/include/kernel/hbdescriptor.H b/src/include/kernel/hbdescriptor.H
new file mode 100644
index 000000000..e90861a48
--- /dev/null
+++ b/src/include/kernel/hbdescriptor.H
@@ -0,0 +1,38 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/kernel/hbdescriptor.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* 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 */
+
+/** @file hbdescriptor.H
+ * @brief Defines hostboot data area
+ */
+
+#ifndef __KERNEL_HBDESCRIPTOR_H
+#define __KERNEL_HBDESCRIPTOR_H
+
+struct HB_TI_DataArea;
+
+struct HB_Descriptor
+{
+ HB_TI_DataArea *TI_DataAreaPtr; // ptr to the TI data area structure
+};
+
+#endif /* __KERNEL_HBDESCRIPTOR_H */
diff --git a/src/include/kernel/hbterminatetypes.H b/src/include/kernel/hbterminatetypes.H
new file mode 100644
index 000000000..353dea06f
--- /dev/null
+++ b/src/include/kernel/hbterminatetypes.H
@@ -0,0 +1,68 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/kernel/terminatetypes.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* 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 */
+/** @file terminate.H
+ * @brief Defines kernel information about the TI data area
+ */
+#ifndef __KERNEL_HBTERMINATETYPES_H
+#define __KERNEL_HBTERMINATETYPES_H
+#include <stdint.h>
+
+
+
+/** @struct TI_DataArea
+ * @brief Defines the data space used to store the src or PLID regarding a
+ * Terminate Immediate request
+ */
+struct HB_TI_DataArea
+{
+
+ union{
+ struct {
+ uint64_t type:16; /**< indicates either plid or src */
+ uint64_t source:16; /**< Caller of the TI */
+ uint64_t reserved2:16; /**< Reserved space */
+ uint64_t reserved3:16; /**< Reserved space */
+ };
+ uint64_t flag; /**< Full Dword0 */
+ };
+ uint64_t src[4];
+ uint64_t plid;
+};
+
+// Enum indicating whether a SRC or PLID is stored
+enum hb_terminate_type
+{
+ TI_WITH_PLID = 0x0001,
+ TI_WITH_SRC = 0x0002,
+};
+
+// Enum used in the flag indicating who initiated the TI
+enum hb_terminate_source
+{
+ TI_KERNAL_ASSERT = 0x0001,
+ TI_CRIT_ASSERT = 0x0002,
+ TI_SHUTDOWN = 0x0003,
+};
+
+
+#endif
diff --git a/src/include/kernel/terminate.H b/src/include/kernel/terminate.H
new file mode 100644
index 000000000..db93a1b0b
--- /dev/null
+++ b/src/include/kernel/terminate.H
@@ -0,0 +1,45 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/kernel/terminate.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* 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 */
+/** @file terminate.H
+ * @brief Defines kernel information about the TI data area
+ */
+#ifndef __KERNEL_TERMINATE_H
+#define __KERNEL_TERMINATE_H
+
+#include <kernel/types.h>
+
+/** @fn terminateAndUpdateSaveArea
+ * Update TI data area with src or PLID and force a TI
+ * @param[in] i_type : indicates if an src or plid is stored
+ * @param[in] i_source: indicates what type of fail forced the TI
+ * @param[in] *i_src: SRC to be stored
+ * @param[in] i_plid: plid to be stored
+ * @param[out] NONE:
+ */
+void terminateAndUpdateSaveArea(uint16_t i_type,
+ uint16_t i_source,
+ uint64_t *i_src,
+ uint64_t plid = 0);
+
+
+#endif
diff --git a/src/kernel.ld b/src/kernel.ld
index 3f9060548..d55da99de 100644
--- a/src/kernel.ld
+++ b/src/kernel.ld
@@ -1,28 +1,27 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/kernel.ld $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2010-2012
- *
- * 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_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/kernel.ld $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2010,2012 */
+/* */
+/* 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 */
base_load_address = 0x00000000;
-text_load_address = 0x00003000;
+text_load_address = 0x00002000;
SECTIONS
{
diff --git a/src/kernel/forceattn_p8.S b/src/kernel/forceattn_p8.S
new file mode 100644
index 000000000..6e60ca43a
--- /dev/null
+++ b/src/kernel/forceattn_p8.S
@@ -0,0 +1,41 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/kernel/forceattn_p8.S $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* */
+/* 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 */
+.include "kernel/ppcconsts.S"
+
+
+.global p8_force_attn
+p8_force_attn:
+ li r0, 1
+ mfspr r9, HID0
+ insrdi r9,r0,1,31 /* Turn on bit 31. */
+ sync
+ mtspr HID0,r9 /* Enable attentions */
+ mfspr r9, HID0
+ mfspr r9, HID0
+ mfspr r9, HID0
+ mfspr r9, HID0
+ mfspr r9, HID0
+ mfspr r9, HID0
+ isync
+ attn
+ b 0
diff --git a/src/kernel/makefile b/src/kernel/makefile
index b448e9d68..67766b2b8 100644
--- a/src/kernel/makefile
+++ b/src/kernel/makefile
@@ -1,25 +1,25 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/kernel/makefile $
+# $Source: src/kernel/makefile $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2010-2012
+# COPYRIGHT International Business Machines Corp. 2010,2012
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# 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.
+# 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
+# Origin: 30
#
-# IBM_PROLOG_END_TAG
+# IBM_PROLOG_END_TAG
ROOTPATH = ../..
OBJS = start.o kernel.o console.o pagemgr.o heapmgr.o taskmgr.o cpumgr.o
@@ -27,7 +27,7 @@ OBJS += syscall.o scheduler.o spinlock.o exception.o vmmmgr.o timemgr.o
OBJS += futexmgr.o ptmgr.o segmentmgr.o devicesegment.o basesegment.o
OBJS += block.o cpuid.o misc.o msghandler.o blockmsghdlr.o stacksegment.o
OBJS += softpatch_p7.o barrier.o idebug.o intmsghandler.o deferred.o
-OBJS += shutdown.o
+OBJS += shutdown.o forceattn_p8.o terminate.o
include ${ROOTPATH}/config.mk
diff --git a/src/kernel/start.S b/src/kernel/start.S
index 41a35735c..2cd97d816 100644
--- a/src/kernel/start.S
+++ b/src/kernel/start.S
@@ -243,6 +243,16 @@ softpatch_stub:
STD_INTERRUPT_NOADDR(softpatch)
.section .text.kernelasm
+
+;// Hostboot descriptor pointer.
+;//
+;// This must be the first entry in the .text.kernelasm section so that it
+;// ends up at 0x2000 in our kernel image.
+kernel_descriptor:
+ .byte 'H', 'O', 'S', 'T', 'B', 'O', 'O', 'T'
+ .quad kernel_hbDescriptor
+
+
;// _main:
;// Set up stack and TOC and call kernel's main.
_main:
diff --git a/src/kernel/terminate.C b/src/kernel/terminate.C
new file mode 100644
index 000000000..b5834a7b3
--- /dev/null
+++ b/src/kernel/terminate.C
@@ -0,0 +1,56 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/kernel/terminate.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* 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 */
+
+#include <kernel/hbdescriptor.H>
+#include <kernel/hbterminatetypes.H>
+#include <kernel/terminate.H>
+#include <stdint.h>
+#include <kernel/console.H>
+
+#include <builtins.h>
+
+extern "C" void p8_force_attn() NO_RETURN;
+
+
+/* Instance of the TI Data Area */
+HB_TI_DataArea kernel_TIDataArea;
+
+/* Instance of the HB desriptor struct */
+HB_Descriptor kernel_hbDescriptor = {&kernel_TIDataArea};
+
+void terminateAndUpdateSaveArea(uint16_t i_type, uint16_t i_source, uint64_t *i_src, uint64_t
+ plid)
+{
+
+printk("Inside terminateandupdateSaveArea!!!!!!!!!!!!!!! \n");
+ kernel_TIDataArea.type = i_type;
+ kernel_TIDataArea.source = i_source;
+ memcpy(i_src, kernel_TIDataArea.src, sizeof (kernel_TIDataArea.src));
+ kernel_TIDataArea.plid = plid;
+
+
+printk("Calling p8_force_attn!!! dying.... \n");
+ // After the data is set up .. call the function that actually executes the TI.
+ p8_force_attn();
+
+}
diff --git a/src/kernel/terminate.S b/src/kernel/terminate.S
deleted file mode 100644
index 29d7bc9ce..000000000
--- a/src/kernel/terminate.S
+++ /dev/null
@@ -1,40 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/kernel/terminate.S $
-//
-// 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
-.include "kernel/ppcconsts.S"
-
-.global hal_p7_terminate_immediate
-hal_p7_terminate_immediate:
- li r0, 1
- mfspr r9, HID0
- insrdi r9,r0,1,31 /* Turn on bit 31. */
- sync
- mtspr HID0,r9 /* Enable attentions */
- mfspr r9, HID0
- mfspr r9, HID0
- mfspr r9, HID0
- mfspr r9, HID0
- mfspr r9, HID0
- mfspr r9, HID0
- isync
- attn
- b 0
diff --git a/src/lib/assert.C b/src/lib/assert.C
index 7b8318ae3..dbfd8ed6a 100644
--- a/src/lib/assert.C
+++ b/src/lib/assert.C
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/lib/assert.C $
-//
-// 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/lib/assert.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* */
+/* 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 */
/** @file assert.C
* @brief Common handling functions for assert paths.
*/
@@ -30,6 +30,9 @@
#include <sys/task.h>
#include <arch/ppc.H>
+#include <kernel/hbterminatetypes.H>
+#include <kernel/terminate.H>
+
/** Hook location for trace module to set up when loaded. */
namespace TRACE { void (*traceCallback)(void*, size_t) = NULL; };
@@ -63,6 +66,10 @@ extern "C" void __assert(AssertBehavior i_assertb, int i_line)
case ASSERT_KERNEL: // Kernel assert called.
printk("Assertion failed @%p on line %d.\n",
linkRegister(), i_line);
+
+ // Create and src
+ // Call function to save SRC and perform a TI
+ //terminateAndUpdateSaveArea(TI_WITH_SRC, TI_KERNAL_ASSERT, NULL);
break;
}
diff --git a/src/makefile b/src/makefile
index 1da89aa4d..da8fe7dcb 100644
--- a/src/makefile
+++ b/src/makefile
@@ -44,7 +44,7 @@ DIRECT_BOOT_OBJECTS = start.o kernel.o taskmgr.o cpumgr.o syscall.o \
ptmgr.o segmentmgr.o basesegment.o devicesegment.o \
block.o cxxtest_data.o cpuid.o misc.o msghandler.o \
blockmsghdlr.o stacksegment.o softpatch_p7.o \
- shutdown.o
+ shutdown.o forceattn_p8.o terminate.o
BASE_MODULES = trace errl devicefw scom xscom initservice \
pnor vfs
OpenPOWER on IntegriCloud