-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdevpi.h
60 lines (51 loc) · 817 Bytes
/
devpi.h
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
#ifndef DEVPI_H
#define DEVPI_H
int __init init_module(void);
void __exit cleanup_module(void);
#define PI_MODE_MIN 0
#define PI_MODE_MAX 2
enum pi_mode {
HEX = 0,
DECIMAL = 1,
STRING = 2,
};
const char* pi_mode_map[] = {
[0] = "hex",
[1] = "decimal",
[2] = "pie",
};
struct pi_status {
size_t bytes_read;
enum pi_mode mode;
};
#define NUM_PIES 11
const char* pies[NUM_PIES] = {
"apple",
"pumpkin",
"cherry",
"banana cream",
"blueberry",
"raspberry",
"lemon meringue",
"shepherd's",
"meat",
"strawberry rhubarb",
"pecan",
};
size_t pie_sizes[NUM_PIES] = {
5,
7,
6,
12,
9,
9,
14,
10,
4,
18,
5,
};
#define PI_MAJOR 235
#define PI_CLASSNAME "pi"
#define PI_DEVNAME "pi"
#endif /* DEVPI_H */