SMBIOS Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
libraries
common
SmbiosWorkaroundImpl.h
Go to the documentation of this file.
1
// vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
2
/*
3
* Copyright (C) 2005 Dell Inc.
4
* by Michael Brown <Michael_E_Brown@dell.com>
5
* Licensed under the Open Software License version 2.1
6
*
7
* Alternatively, you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published
9
* by the Free Software Foundation; either version 2 of the License,
10
* or (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
* See the GNU General Public License for more details.
16
*/
17
18
//
19
#ifndef ISMBIOSWORKAROUND_H_
20
#define ISMBIOSWORKAROUND_H_
21
22
// types.h should be first user-defined header.
23
#include "
smbios/types.h
"
24
#include "
smbios/ISmbios.h
"
25
#include "
FactoryImpl2.h
"
26
27
namespace
smbios
28
{
29
30
// forward decls
31
class
SmbiosWorkaroundTable;
32
struct
Workaround;
33
52
class
SmbiosWorkaroundFactory
:
public
factory::TFactory
<factory::IFactory>
53
{
54
public
:
56
SmbiosWorkaroundFactory
() {};
57
59
65
static
factory::TFactory<smbios::SmbiosWorkaroundFactory>
*
getFactory
();
66
virtual
~SmbiosWorkaroundFactory
() throw();
67
69
76
virtual
SmbiosWorkaroundTable
*
makeNew
( const
ISmbiosTable
*table );
77
78
protected:
79
static
SmbiosWorkaroundTable
*
_tableInstance
;
80
};
81
82
class
SmbiosWorkaroundTable
83
{
84
public
:
85
SmbiosWorkaroundTable(
const
ISmbiosTable
* table,
const
Workaround
**initWorkarounds);
86
virtual
~SmbiosWorkaroundTable();
87
void
fixupItem(
const
ISmbiosItem
*item,
u8
*buffer,
size_t
bufsize )
const
;
88
89
private
:
90
SmbiosWorkaroundTable();
//< not implmented (or legal)
91
void
operator =
(
const
SmbiosWorkaroundTable & );
//< not implmented (or legal)
92
93
int
systemId
;
94
std::string
biosVersion
;
95
const
Workaround
**
workaroundsForThisSystem
;
96
};
97
98
enum
{
TYPE_U8
=1,
TYPE_U16
=2,
TYPE_U32
=4,
TYPE_U64
=8 } ;
99
100
struct
SystemAffected
101
{
102
int
systemId
;
103
const
char
*
biosMinVersion
;
104
const
char
*
biosMaxVersion
;
105
};
106
107
// give data[8] at the beginning to provide the most flexibility for
108
// people trying to initialize static members.
109
union
datatron
110
{
111
u8
data[8];
// can only initialize the first member of a union (ansi)
112
u64
dataU64
;
113
u32
dataU32
;
114
u16
dataU16
;
115
u8
dataU8
;
116
};
117
118
struct
WorkaroundSmbiosItem
119
{
120
int
type
;
121
unsigned
int
fieldOffset
;
122
int
fieldDataType
;
123
datatron
data
;
124
};
125
126
struct
Workaround
127
{
128
const
char
*
name
;
129
const
WorkaroundSmbiosItem
*
symptoms
;
130
const
WorkaroundSmbiosItem
*
fixups
;
131
};
132
133
struct
SystemWorkaround
134
{
135
const
SystemAffected
*
system
;
136
const
Workaround
**
workarounds
;
137
};
138
139
}
140
141
#endif
/* ISMBIOSWORKAROUND_H_ */
Generated on Thu Mar 27 2014 09:27:18 for SMBIOS Library by
1.8.1.2