blob: 914335ed22a4ddcde79553195d8fee8227a16a4f (
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
|
// IBM_PROLOG_BEGIN_TAG
// This is an automatically generated prolog.
//
// $Source: src/usr/pore/poreve/model/porestate.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 other-
// wise divested of its trade secrets, irrespective of what has
// been deposited with the U.S. Copyright Office.
//
// Origin: 30
//
// IBM_PROLOG_END
#ifndef __VSBE_PORE_STATE_H
#define __VSBE_PORE_STATE_H
// $Id: porestate.H,v 1.1 2011/06/12 13:14:03 bcbrock Exp $
/// \file porestate.H
/// \brief A structure defining the state of a PORE engine for
/// checkpoint/restart purposes.
#include "poreinterface.H"
namespace vsbe {
class PoreState;
};
/// The state of a PORE engine
///
/// The PoreState class represents the state of the PORE engine for
/// checkpoint/restore purposes. The state is stored as an endian-neutral
/// checkpoint of the register space of the PORE engine, therefore the object
/// can be saved and restored to/from a file regardless of the endianess of
/// the save and restore hosts. Methods are provided to access the hardware
/// register images using the PoreRegisterOffset enumeration offsets.
///
/// This object is used as a parameter of the PoreInterface::extractState()
/// and poreInterface::installState() methods. Please see the documentation
/// of those methods for information on how the PoreState is checkpointed and
/// restored.
class
vsbe::PoreState {
public:
////////////////////////////// Creators //////////////////////////////
PoreState();
virtual ~PoreState();
///////////////////////////// Accessors //////////////////////////////
/// Get a register image from the state
///
/// \param[in] i_offset The PoreRegisterOffset of the requested register.
///
/// \param[out] o_reg The requested register value obtained from the state.
///
/// \retval me Either 0 for success, or a ModelError error code.
virtual ModelError
get(const PoreRegisterOffset i_offset, uint64_t& o_reg) const;
///////////////////////////// Manipulators ///////////////////////////
/// Put a register image into the state
///
/// \param[in] i_offset The PoreRegisterOffset of the requested register.
///
/// \param[in] i_reg The new value of the requested register to store in
/// the state. value.
///
/// \retval me Either 0 for success, or a ModelError error code.
virtual ModelError
put(const PoreRegisterOffset i_offset, const uint64_t i_reg);
////////////////////////// Implementation ////////////////////////////
protected:
/// The register state
uint8_t state[SIZEOF_PORE_STATE];
///////////////////////////// Safety //////////////////////////////////
private:
PoreState(const PoreState& rhs);
PoreState& operator=(const PoreState& rhs);
};
#endif // __VSBE_PORE_STATE
|