interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / omega / platform / readback.om

110 lines · 1977 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note Spark DSDT resource reader. No AML evaluator, mapping, register access or writes.
3note Single consumer; transport supplies an acknowledged READ, never an arbitrary address.
4note State: pending,sequence,space,address,bits,raw,valid,last-sequence.
5global Pl ulong 8
6
7fn pladdr zone ulong to ulong
8if eq zone 0
9ret 472090648
10end
11if lt zone 7
12ret add 472090652 mul zone 4
13end
14ret 0
15end
16
17note CPPC fields are Linux cppc_regs indexes, excluding every writable control.
18fn ploff field ulong to ulong
19if lt field 5
20ret mul field 4
21end
22if eq field 10
23ret 40
24end
25if eq field 13
26ret 44
27end
28if and ge field 18 le field 20
29ret add 88 mul sub field 18 4
30end
31ret 4294967295
32end
33
34note kind 0 thermal, kind 1 CPPC; space 0 SystemMemory, space 127 FFixedHW.
35note Return 0 ready, 1 unsupported, 2 pending, 3 invalid sequence or ACK, 4 I/O failure.
36fn plstart kind ulong unit ulong field ulong seq ulong to uint
37if ne get Pl 0 0
38ret 2
39end
40put Pl 5 0
41put Pl 6 0
42if or eq seq 0 le seq get Pl 7
43ret 3
44end
45addr = ulong 0
46space = ulong 0
47bits = ulong 32
48if eq kind 0
49if ne field 0
50ret 1
51end
52addr = pladdr unit
53if eq addr 0
54ret 1
55end
56else
57if ne kind 1
58ret 1
59end
60if ge unit 20
61ret 1
62end
63if or eq field 11 eq field 12
64space = 127
65bits = 64
66addr = sub 12 field
67else
68off = ploff field
69if eq off 4294967295
70ret 1
71end
72addr = add add 85771268 mul unit 232 off
73end
74end
75put Pl 0 1
76put Pl 1 seq
77put Pl 2 space
78put Pl 3 addr
79put Pl 4 bits
80put Pl 7 seq
81ret 0
82end
83
84note ACK must match the complete outstanding READ descriptor. A bad ACK consumes it.
85note raw is an unsigned native word; 32-bit reads cannot smuggle high bits.
86fn plack seq ulong space ulong addr ulong bits ulong raw ulong ok ulong to uint
87put Pl 5 0
88put Pl 6 0
89if eq get Pl 0 0
90ret 3
91end
92put Pl 0 0
93if or ne seq get Pl 1 ne space get Pl 2
94ret 3
95end
96if or ne addr get Pl 3 ne bits get Pl 4
97ret 3
98end
99if ne ok 1
100ret 4
101end
102if eq bits 32
103if gt raw 4294967295
104ret 3
105end
106end
107put Pl 5 raw
108put Pl 6 1
109ret 0
110end