forked from open-power/pdbg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake.dts.m4
101 lines (88 loc) · 1.92 KB
/
fake.dts.m4
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
define(`CONCAT', `$1$2')dnl
dnl
dnl forloop([var], [start], [end], [iterator])
dnl
divert(`-1')
define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')')
define(`_forloop',
`$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')')
dnl
dnl dump_thread([index])
dnl
define(`dump_thread',
`
thread@$1 {
#address-cells = <0x0>;
#size-cells = <0x0>;
compatible = "ibm,fake-thread";
reg = <0x$1 0x0>;
index = <0x$1>;
};
')dnl
dnl
dnl dump_core_pre([index], [addr])
dnl
define(`dump_core_pre',
`
core@$2 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "ibm,fake-core";
reg = <0x$2 0x0>;
index = <0x$1>;')
dnl
dnl dump_core_post()
dnl
define(`dump_core_post', ` };
')dnl
dnl
dnl dump_core([index], [addr], [num_threads])
dnl
define(`dump_core',
`dump_core_pre(`$1', `$2')
forloop(`i', `0', eval(`$3-1'), `dump_thread(i)')
dump_core_post()')
dnl
dnl dump_processor_pre([index])
dnl
define(`dump_processor_pre',`dnl
pib {
#address-cells = <0x1>;
#size-cells = <0x1>;
ATTR2 = "processor$1";')
dnl
dnl dump_processor_post()
dnl
define(`dump_processor_post', ` };
')dnl
dnl
dnl dump_processor([index], [num_cores], [num_threads])
dnl
define(`dump_processor',dnl
`dump_processor_pre(`$1')
forloop(`i', `0', eval(`$2-1'), `dump_core(i, eval(10000+(i+1)*10), $3)')
dump_processor_post()')
dnl
dnl dump_system([num_processors], [num_cores], [num_threads])
dnl
define(`dump_system',
`forloop(`i', `0', eval(`$1-1'),dnl
`
CONCAT(proc,i) {
index = < CONCAT(0x,i) >;
compatible = "ibm,fake-proc";
dump_processor(i, $2, $3)
};
')')
divert`'dnl
/dts-v1/;
/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
ATTR1 = [ 00 ];
ATTR2 = [ 00 00 ];
ATTR4 = <0x0>;
ATTR8 = <0x0 0x0>;
ATTR16 = <0x0 0x0 0x0 0x0>;
dump_system(8, 4, 2)
};