summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice/extinitsvc/extinitsvc.H
blob: a50b790eda1e8cd3db989053fff1ae4a8dc2f27c (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
122
123
124
125
126
127
128
#ifndef __EXTINITSVC_EXTINITSVC_H
#define __EXTINITSVC_EXTINITSVC_H
/**
 *  @file extinitsvc.H
 *
 *  Extended initialization service, inherited from initservice base class
 *  perform extended init service functions in the extended image.
 *  launched by initservice.
 *
 */


/******************************************************************************/
// Includes
/******************************************************************************/
#include <stdint.h>
#include <util/singleton.H>
#include <sys/vfs.h>            // VFS_MODULE_NAME_MAX

#include <errl/errlentry.H>
#include <initservice/taskargs.H>
#include <initservice/initsvcreasoncodes.H>

#include "../baseinitsvc/initservice.H"

namespace   INITSERVICE
{

/******************************************************************************/
// Globals/Constants
/******************************************************************************/

/******************************************************************************/
// Typedef/Enumerations
/******************************************************************************/
/**
 * @enum ShutdownStatus
 */
enum ShutdownStatus
{
    SHUTDOWN_STATUS_GOOD         = 0x01230000,
    SHUTDOWN_STATUS_UT_FAILED    = 0x01230001,
    SHUTDOWN_STATUS_ISTEP_FAILED = 0x01230002,
};

/******************************************************************************/
// ExtInitSvc Class
/******************************************************************************/

// Singleton definition
class ExtInitSvc;
typedef Singleton<ExtInitSvc> theExtInitSvc;

/**
 *  @class  ExtInitSvc Singleton Class
 *
 *  This extended image module is launched by InitService
 *
 */
class ExtInitSvc  : public InitService
{

public:

    friend  class ExtInitSvcTest;

    /**
     * @brief Get singleton instance of this class.
     *
     *  @return the (one and only) instance of InitService
     */
    static ExtInitSvc& getTheInstance();

    /**
     *  @brief  Provide an entry function into the class, called from _start()
     *
     *  @param[in]  i_args    pointer to any arguments passed in from
     *                      _start() and by extension the kernel,
     *                      currently this is NULL .
     *
     */
    void            init( void *i_args);


    /**
     * @todo    ExtInitSvcTest should be able to find protected functions.
     */
    // $$protected:

    /**
     * @brief   start a extended image task.
     *
     *  @param[in]      i_ptask     pointer to a TaskInfo struct
     *  @param[in]      i_pargs     pointer to args struct
     *  @param[inout]   i_rerrl     reference to an errorlog handle.
     *                              errorlog will be filled out if error,
     *                              otherwise untouched.
     *
     *  @return NULL if success, errorlog handle for failure
     *
     */
    errlHndl_t     startTask(   const TaskInfo *i_ptask,
                                TaskArgs::TaskArgs *i_pargs,
                                errlHndl_t &i_rerrl ) const;


protected:
    /**
     * @brief Constructor for the InitService object.
     */
    ExtInitSvc();

    /**
     * @brief Destructor for the InitService object.
     */
    ~ExtInitSvc();



private:



};  //  class ExtInitSvc

} // namespace EXTINITSVC

#endif
OpenPOWER on IntegriCloud