summaryrefslogtreecommitdiffstats
path: root/qemu/roms/openbios/arch/ppc/mol/tree.fs
blob: 228163ffc32bf0903cb09ff2ce61d57440d56a8f (plain)
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
: int-property ( val name -- )
	rot encode-int 2swap property
;


\ -------------------------------------------------------------
\ device-tree
\ -------------------------------------------------------------

" /" find-device

  " device-tree" device-name
	" bootrom" device-type

\ -------------------------------------------------------------
\ /memory
\ -------------------------------------------------------------

new-device
  " memory" device-name
	\ 12230 encode-int " reg" property
	external
	: open true ;
	: close ;
	\ claim ( phys size align -- base )
	\ release ( phys size -- )
finish-device

\ -------------------------------------------------------------
\ /mol/
\ -------------------------------------------------------------

new-device
	" mol" device-name
	1 " #address-cells" int-property
	0 " #size-cells" int-property

	external
	: open true ;
	: close ;

new-device
  " test" device-name

	external
  : open
		." /mol/test opened" cr
		" argument-str" " ipose" find-package drop interpose
		true
  ;
finish-device
finish-device

\ -------------------------------------------------------------
\ /cpus/
\ -------------------------------------------------------------

new-device
	" cpus" device-name
	1 " #address-cells" int-property
	0 " #size-cells" int-property

	external
	: open true ;
	: close ;
	: decode-unit parse-hex ;

finish-device

\ -------------------------------------------------------------
\ /packages
\ -------------------------------------------------------------

" /packages" find-device

	" packages" device-name
	external
	\ allow packages to be opened with open-dev
	: open true ;
	: close ;

\ /packages/mol-stdout
new-device
	" mol-stdout" device-name
	external
	: open true ;
	: close ;
	: write ( addr len -- actual )
		dup -rot type
	;
finish-device

\ XXXXXXXXXXXXXXXXXXXXXXX TESTING
" /" find-device
new-device
  " test" device-name
finish-device

\ -------------------------------------------------------------
\ The END
\ -------------------------------------------------------------
device-end