summaryrefslogtreecommitdiffstats
path: root/src/usr/isteps/istep1.C
blob: 9d1e311b15a14b0f92b2ad4f42e2171f390fdcc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//  IBM_PROLOG_BEGIN_TAG
//  This is an automatically generated prolog.
//
//  $Source: src/usr/isteps/istep1.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
/**
 *  @file isteps.C
 *
 *  Collection of IStep modules
 *
 */


/******************************************************************************/
// Includes
/******************************************************************************/
#include    <stdint.h>
#include    <stdio.h>
#include    <string.h>

#include    <sys/task.h>

#include    <trace/interface.H>         //  trace support
#include    <errl/errlentry.H>          //  errlHndl_t
#include    <errl/errlmanager.H>
#include    <initservice/taskargs.H>       //  task args

//  pull in stuff to run HW procedure - from Andrew's hwpf testcase 2
//  NOTE:  there are extra include paths in isteps/makefile to find the fapi includes:
//      EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
//      EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi
//      EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat

#include <fapi.H>
#include <fapiPlatHwpInvoker.H>
#include <fapiPlatHwpInvoker.H>
#include <targeting/targetservice.H>

using namespace fapi;
using namespace TARGETING;

namespace   ISTEPS
{

/******************************************************************************/
// Globals/Constants
/******************************************************************************/
trace_desc_t *g_trac_istep1 = NULL;
TRAC_INIT(&g_trac_istep1, "ISTEP1", 4096);

extern  "C"
void    IStep1( void * io_pArgs )
{
    INITSERVICE::TaskArgs::TaskArgs *pTaskArgs  =
            reinterpret_cast<INITSERVICE::TaskArgs::TaskArgs *>(io_pArgs);
    errlHndl_t l_err = NULL;
    uint64_t    command     =   pTaskArgs->getCommand();
    uint64_t    returncode  =   pTaskArgs->getReturnCode();


    // print out stuff from taskargs
    TRACFCOMP( g_trac_istep1,
            "starting IStep 1, command=0x%llx, returncode=0x%llx",
            command, returncode );
    //  -----   start ISTEP --------------------------------------------------


    // Set processor chip to the master
     TARGETING::Target* l_testTarget = MASTER_PROCESSOR_CHIP_TARGET_SENTINEL;

    l_err = invokeHwpInitialTest(l_testTarget);
    if (l_err)
    {
        TRACFCOMP( g_trac_istep1,
                "IStep1 failed, posting error code 1");

        // Commit/delete error
        errlCommit(l_err);

        pTaskArgs->postReturnCode( 1 );
    }
    else
    {
        TRACFCOMP( g_trac_istep1,
                "ISTep1 finished successfully.");

        pTaskArgs->postReturnCode( 0 );
    }


//  -----   end ISTEP   ------------------------------------------------------
    TRACFCOMP( g_trac_istep1,
            EXIT_MRK "ending  IStep 1");

    if  ( pTaskArgs )
    {
        pTaskArgs->waitChildSync();
    }

    task_end();
}


} // namespace
OpenPOWER on IntegriCloud