summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice/common/initsvcstructs.H
blob: f78c093b80fc7c33289fc42720677061772f0933 (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
/****************************************************************************
 * $IBMCopyrightBlock:
 * 
 *  IBM Confidential
 * 
 *  Licensed Internal Code Source Materials
 * 
 *  IBM Flexible Support Processor Licensed Internal Code
 * 
 *  (C) Copyright IBM Corp. 2011
 * 
 *  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.
 * $
****************************************************************************/

#ifndef __COMMON_INITSVCSTRUCTS_H
#define __COMMON_INITSVCSTRUCTS_H
/**
 *  @file initsvcstructs.H
 *
 *  common structs for initservice, extinitsvc, istepdispatcher
 */

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

namespace   INITSERVICE
{

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


/******************************************************************************/
// Typedef/Enumerations
/******************************************************************************/

/**
 * @enum    TaskType
 *  - NONE          ==  placeholder, no task
 *  - START_TASK   ==   task with _start() function entry point
 *  - START_FN      ==  task with function pointer entry point
 *  - BARRIER       ==  set barrier for next N tasks.
 *  - STOP_TASK     ==  Execute the destructor on the task in extended image.
 *                      ( not implemented yet)
 *  - END_TASK_LIST ==  last entry in the task list.
 */
enum    TaskType
{
    UNDEFINED_TT    =   0,
    NONE,
    START_TASK,
    START_FN,
    BARRIER,
    STOP_TASK,
    END_TASK_LIST,
};


/**
 * @enum    ModuleType
 *  -   BASE_IMAGE == module in the base image
 *  -   EXT_IMAGE == module in the extended image
 */
enum    ModuleType
{
    UNDEFINED_MT    =   0,
    BASE_IMAGE,
    EXT_IMAGE,
};


/**
 * @struct  TaskFlags
 *
 *  - run _start() function on start
 *  - module type, BASE_MODULE or EXT_MODULE
 *  - module_id for errorlog if task fails
 *
 */
struct  TaskFlags
{
    TaskType            task_type;          // this is a task, run _start() function
    ModuleType          module_type;        // BASE_IMAGE or EXT_IMAGE
    InitServiceModuleID module_id;          // module id for errorlog
};


/**
 * @struct  TaskInfo
 *
 * Holds information on each task in the system.
 *      - taskname
 *      - execution flags, see TaskFlags above
 *
 */
struct  TaskInfo
{
    const   char        taskname[VFS_MODULE_NAME_MAX];
    void                (*taskfn)(void *ptr);
    const   TaskFlags   taskflags;

};

} // namespace

#endif
OpenPOWER on IntegriCloud