From 63b344dd0fcbd2318a8fd46978970a08f3eb9ca9 Mon Sep 17 00:00:00 2001 From: Missy Connell Date: Wed, 20 Feb 2013 16:30:51 -0600 Subject: Call Dump Collect from call_host_mpipl_service Change-Id: I4c449177618f00d64b90b81403144649d0df756f RTC:46996 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3339 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/include/usr/dump/dumpif.H | 168 +++++++++++++++++++++++++++++++++ src/include/usr/dump/dumpreasoncodes.H | 1 + 2 files changed, 169 insertions(+) create mode 100644 src/include/usr/dump/dumpif.H (limited to 'src/include/usr/dump') diff --git a/src/include/usr/dump/dumpif.H b/src/include/usr/dump/dumpif.H new file mode 100644 index 000000000..21d50f677 --- /dev/null +++ b/src/include/usr/dump/dumpif.H @@ -0,0 +1,168 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/dump/dumpif.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,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 __DUMPIF_H +#define __DUMPIF_H + +/** @file dumpif.H + * @brief Provides the external interfaces for dump. + * - copy dump data from src to destination + * - Send Mbox Msg for dump status + */ + +namespace DUMP +{ + + + /** + * @brief DUMP Message Types + */ + + enum DUMP_MSG_TYPE + { + DUMP_MSG_START_MSG_TYPE = 0x000000B1, + DUMP_MSG_END_MSG_TYPE = 0x000000B2, + DUMP_MSG_ERROR_MSG_TYPE = 0x000000B3, + + }; + + // The following are #defines needed for Dump Testing.. These are the + // default memory locations for MDST, MDDT, MDRT when running withoutPHYPab + // The data range is defined in vmmconst.h so this test space is saved. + + /* Chunk of physical memory used for Dump Source Table */ + #define DUMP_TEST_SRC_MEM_ADDR DUMP_TEST_MEMORY_ADDR + #define DUMP_TEST_SRC_MEM_SIZE MEGABYTE + + /* Chunk of physical memory used for Dump Destination Table */ + #define DUMP_TEST_DST_MEM_ADDR (DUMP_TEST_SRC_MEM_ADDR + \ + DUMP_TEST_SRC_MEM_SIZE) + + + #define DUMP_TEST_DST_MEM_SIZE MEGABYTE + + /* Chunk of physical memory used for Dump Results Table */ + #define DUMP_TEST_RESULTS_MEM_ADDR (DUMP_TEST_DST_MEM_ADDR + \ + DUMP_TEST_DST_MEM_SIZE) + + + #define DUMP_TEST_RESULTS_MEM_SIZE MEGABYTE + + // Data location where the src, destination tables point to. (The actual + // data) + #define DUMP_TEST_SRC_DATA_AREA (DUMP_TEST_RESULTS_MEM_ADDR + \ + DUMP_TEST_RESULTS_MEM_SIZE) + + + #define DUMP_TEST_DST_DATA_AREA (DUMP_TEST_SRC_DATA_AREA + \ + DUMP_TEST_DATA_SIZE) + + #define DUMP_TEST_DATA_SIZE MEGABYTE + + // default enums to point out the start and end of the DUMP Tables in memory + #define DUMP_TEST_TABLE_START DUMP_TEST_SRC_MEM_ADDR + #define DUMP_TEST_TABLE_SIZE (DUMP_TEST_SRC_MEM_SIZE + \ + DUMP_TEST_DST_MEM_SIZE + DUMP_TEST_RESULTS_MEM_SIZE) + + + #define DUMP_TEST_TABLE_END (DUMP_TEST_TABLE_START + DUMP_TEST_TABLE_SIZE) + + // In addition to the dump table locations we have scratch data area that is + // used to put the SRC data that the MDST will point to. + + // This is the size of all the Data used for Dump testing + #define DUMP_TEST_ALL_SIZE (DUMP_TEST_TABLE_SIZE + (2*MEGABYTE)) + + // This is the ending address of test Data area + #define DUMP_TEST_ALL_END (DUMP_TEST_TABLE_START + DUMP_TEST_ALL_SIZE) + + + //These structures are defined in the HDAT spec + //The MDST and MDDT have this format. + struct dumpEntry + { + uint64_t dataAddr; + uint64_t dataSize; + }; + + //The MDRT has this format. + struct resultsEntry + { + uint64_t srcAddr; + uint64_t destAddr; + uint64_t dataSize; + }; + + + /** + * @brief This function is a wrapper function that calls + * getHostDataPtrs to get the MDDT, MDST, MDRT pointers + * and then passes those values to the copySrcToDest + * routine that performs the copy + * + * @param[in] void + * + * @return errlHndl_t + */ + errlHndl_t doDumpCollect(void); + + /** + * @brief This function copies the data and sizes retrieved from the + * MDST(source table) to the addresses indicated by the MDDT(destination + * table). Each write is then logged in the MDRT (results table) with + * source addr, destination addr and size + * + * @param[in] srcTableEntry Ptr to the first MDST entry + * @param[in] srcTableSize Size of the entire MDST + * + * @param[in] destTableAddr Ptr to the first MDDT entry + * @param[in] destTableSize Size of the entire MDDT + * + * @param[in] resultsTableAddr Ptr to the first MDRT entry + * @param[in] resultsTableSize Size of the entire MDRT + * + * @return errlHndl_t + */ + errlHndl_t copySrcToDest(dumpEntry *srcTableEntry, uint64_t srcTableSize, + dumpEntry *destTableEntry, uint64_t destTableSize, + resultsEntry *resultsTableEntry, + uint64_t resultsTableSize); + + /** + * @brief This function handles sending the mailbox message to the Fsp to + * notify of Dump Status. Start, error or complete. If Error or + * complete types are requested, the dump results table is passed + * to the FSP. + * + * @param[in] i_type - The type of DUMP msg being written. + * + * @return errlHndl_t - NULL if successful, otherwise a pointer to the error + * log. + */ + errlHndl_t sendMboxMsg (DUMP_MSG_TYPE i_type); + + + +} // end of namespace + + +#endif diff --git a/src/include/usr/dump/dumpreasoncodes.H b/src/include/usr/dump/dumpreasoncodes.H index 9f1da4353..1bd2aaf11 100644 --- a/src/include/usr/dump/dumpreasoncodes.H +++ b/src/include/usr/dump/dumpreasoncodes.H @@ -31,6 +31,7 @@ namespace DUMP { DUMP_COLLECT_INVALID = 0x00, DUMP_COLLECT = 0x01, + DUMP_SEND_MBOX_MSG = 0x02, }; enum dumpReasonCode -- cgit v1.2.3