forked from open-power/pdbg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake2-backend.dts.m4
104 lines (89 loc) · 2.1 KB
/
fake2-backend.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
102
103
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], [addr])
dnl
define(`dump_processor_pre',
`define(`pib_addr', eval(`$2+100'))dnl
fsi@$2 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "ibm,fake-fsi";
system-path = "/proc$1/fsi";
reg = <0x0 0x0>;
index = <0x$1>;
CONCAT(pib@,pib_addr) {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "ibm,fake-pib";
system-path = "/proc$1/pib";
reg = <CONCAT(0x,pib_addr) 0x0>;
index = <0x$1>;')
dnl
dnl dump_processor_post()
dnl
define(`dump_processor_post', ` };
};
')dnl
dnl
dnl dump_processor([index], [addr], [num_cores], [num_threads])
dnl
define(`dump_processor',dnl
`dump_processor_pre(`$1', `$2')
forloop(`i', `0', eval(`$3-1'), `dump_core(i, eval(10000+(i+1)*10), $4)')
dump_processor_post()')
dnl
dnl dump_system([num_processors], [num_cores], [num_threads])
dnl
define(`dump_system',
`forloop(`i', `0', eval(`$1-1'), `dump_processor(i, eval(20000+i*1000), $2, $3)')
')
divert`'dnl
/dts-v1/;
/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
dump_system(8, 4, 2)
};