-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsb_detect.hpp
More file actions
48 lines (35 loc) · 848 Bytes
/
sb_detect.hpp
File metadata and controls
48 lines (35 loc) · 848 Bytes
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
#pragma once
#include <cstddef>
namespace rqdq {
namespace hw {
struct BlasterParams {
BlasterParams(int a=-1, int b=-1, int c=-1, int d=-1)
:ioAddr(a), irqNum(b), dmaLow(c), dmaHigh(d) {}
int ioAddr;
int irqNum;
int dmaLow;
int dmaHigh;
int BestDMA() const {
return dmaHigh != -1 ? dmaHigh : dmaLow; }};
class BlasterSerializer {
public:
BlasterSerializer(const char* data=NULL);
BlasterParams Save() const {
return params_; }
bool IsValid();
private:
void Deserialize(const char* text);
void MaybeSaveCurrentField();
public:
BlasterParams params_;
int valid_;
int curField_;
int ax_;
int base_; };
struct BlasterDetectResult {
BlasterDetectResult(bool a, BlasterParams b) :found(a), value(b) {}
bool found;
BlasterParams value; };
BlasterDetectResult DetectBlaster();
} // namespace hw
} // namespace rqdq