-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsyntax_test.asl
416 lines (396 loc) · 14.6 KB
/
syntax_test.asl
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
// SYNTAX TEST "Packages/sublime-text-coreboot-syntax/coreboot-asl.sublime-syntax"
/* Block Comment */
/**
* Block Comment
*/
#include <soc/iomap.h>
// <- keyword.control.import.include.asl
// ^ string.quoted.double punctuation.definition.string.begin.asl
// ^^^^^^^^^^^^ string.quoted.double
// ^
#include "soc/iomap.h"
// <- keyword.control.import.include.asl
// ^ string.quoted.double punctuation.definition.string.begin.asl
// ^^^^^^^^^^^^ string.quoted.double
// ^
External (\_SB.DPTF.TCHG, DeviceObj)
// <- keyword.other.asl
// ^ meta.parens.asl punctuation.section.parens.begin.asl
// ^^^^^^^^^^^^^^ meta.path.asl
// ^ punctuation.root.asl
// ^^^ variable.language.asl
// ^ punctuation.accessor
// ^^^^ variable.other.asl
// ^ punctuation.accessor
// ^^^^ variable.other.asl
// ^ punctuation.separator.asl
// ^^^^^^^^^^ meta.parens.asl
Scope (\_SB.PCI0.GP14)
// ^^ keyword.other.asl
// ^ meta.parens.asl punctuation.section.parens.begin.asl
// ^^^^^^^^^^^^^^^ meta.parens.asl
{
Device (NVME)
// <-storage.type.asl
// ^^^^ entity.name.other.asl
{
Name (_ADR, 0x0000000000000000) // _ADR: Address
// <- storage.type.asl
// ^^^^ variable.language.asl
// ^^^^^^^^^^^^^^^^^^ constant.numeric.integer.hexadecimal
Method (_STA, 0, NotSerialized) // _STA: Status
// <- storage.type.asl
// ^^^^ variable.language.asl
// ^ constant.numeric.integer.decimal.asl
// ^^^^^^^^^^^^^ keyword.other.asl
{
Return (0x0F)
// <- keyword.other.asl
// ^^^^ constant.numeric.integer.hexadecimal
}
Name (_DSD, Package (0x02) // _DSD: Device-Specific Data
// <- storage.type.asl
// ^^^^ variable.language.asl
// ^^^^^^^ keyword.other.asl
// ^^^^ constant.numeric.integer.hexadecimal
{
ToUUID ("5025030f-842f-4ab4-a561-99a5189762d0"),
// <- keyword.other.asl
// ^ string.quoted.double punctuation.definition.string.begin.asl
Package (0x01)
// <- keyword.other.asl
// ^^^^ constant.numeric.integer.hexadecimal
{
Package (0x02)
//<- keyword.other.asl
// ^^^^ constant.numeric.integer.hexadecimal
{
"StorageD3Enable",
// <- punctuation.definition.string.begin.asl
One
// <- constant.numeric.asl
}
}
})
}
}
Device (\_SB.PCI0.GP15.SDHC)
// ^^^ storage.type.asl
// ^ meta.parens.asl punctuation.section.parens.begin.asl
// ^ punctuation.root.asl
// ^^^ variable.language.asl
// ^ punctuation.accessor
// ^^^^ variable.other.asl
// ^ punctuation.accessor
// ^^^^ variable.other.asl
// ^ punctuation.accessor
// ^^^^ entity.name.other.asl
// ^ meta.parens.asl punctuation.section.parens.end.asl
{
// <- meta.block punctuation.section.block.begin
Name (_ADR, 0x0000000000000000) // _ADR: Address
// ^^^^ storage.type.asl
// ^ punctuation.section.parens.begin.asl
// ^^^^ variable.language.asl
// ^ punctuation.separator.asl
// ^^^^^^^^^^^^^^^^^^ constant.numeric.integer.hexadecimal
// ^ punctuation.section.parens.end.asl
Method (_STA, 0, NotSerialized) // _STA: Status
// ^^^^ variable.language.asl
// ^^^^^^^^^^^^^ keyword.other.asl
{
Return (0x0F)
// ^^^^^^ keyword.other.asl
}
Method (STA, 1, Serialized)
// ^^^ entity.name.other.asl
// ^^^^^^^^^^ keyword.other.asl
{
Local0 = \_SB.PCI0.LPCB.EC0.TSRD (TMPS)
// ^^^^^^ variable.language.asl
// ^ keyword.operator.assignment.asl
// ^ meta.path.asl punctuation.root.asl
// ^^^ meta.path.asl variable.language.asl
// ^ meta.path.asl punctuation.accessor
// ^^^^ meta.path.asl variable.other.asl
// ^ punctuation.accessor
Return (Local4)
// ^^^^^^ variable.language.asl
\_SB.PCI0.LPCB.EC0.TSRD (TMPS)
// ^ meta.path.asl punctuation.root.asl
// ^^^ meta.path.asl variable.language.asl
// ^ meta.path.asl punctuation.accessor
// ^^^^ meta.path.asl variable.other.asl
// ^ punctuation.accessor
Return (\PPKG (Local1))
// ^ punctuation.root.asl
// ^^^^ meta.path.asl variable.other.asl
// ^ meta.parens.asl punctuation.section.parens.begin.asl
// ^^^^^^ variable.language.asl
// ^ meta.parens.asl punctuation.section.parens.end.asl
// ^ meta.parens.asl punctuation.section.parens.end.asl
}
Method (_Q01, 0, NotSerialized)
// ^^^^^^ meta.block storage.type.asl
// ^ meta.parens.asl punctuation.section.parens.begin.asl
// ^^^^ variable.language.asl
// ^ punctuation.separator.asl
// ^ constant.numeric.integer.decimal.asl
// ^ punctuation.separator.asl
// ^^^^^^^^^^^^^ keyword.other.asl
// ^ punctuation.section.parens.end.asl
{
// ^ meta.block meta.block punctuation.section.block.begin
Store ("EC: LID CLOSE", Debug)
Store (LIDS, \LIDS)
// ^^^^^ keyword.other.asl
// ^^^^ variable.other.asl
// ^ meta.path.asl punctuation.root.asl
// ^^^^ meta.path.asl variable.other.asl
#ifdef EC_ENABLE_LID_SWITCH
// <- keyword.control.import.asl
// ^^^^^^^^^^^^^^^^^^^^ constant.other.macro.asl
Notify (LID0, 0x80)
// ^^^^^^ keyword.other.asl
// ^^^^ meta.path.asl variable.other.asl
// ^^^^ constant.numeric.integer.hexadecimal.asl
#endif
// <- keyword.control.import.asl
}
Method (_CRS, 0) {
// ^ meta.block punctuation.section.block.begin.asl
Local0 = ResourceTemplate() {
// ^^^^^^ variable.language.asl
// ^ keyword.operator.assignment.asl
// ^^^^^^^^^^^^^^^^ meta.block keyword.other.asl
// ^ meta.parens.asl punctuation.section.parens.begin.asl
// ^ meta.parens.asl punctuation.section.parens.end.asl
// ^ meta.block punctuation.section.block.begin.asl
Interrupt (
// ^^^^^^^^^ keyword.other.asl
ResourceConsumer,
// ^^^^^^^^^^^^^^^^ keyword.other.asl
// ^ punctuation.separator.asl
Level,
ActiveLow,
Shared, , , IRQR
// ^^^^^^ keyword.other.asl
// ^^^^ entity.name.other.asl
)
{ 0 }
Memory32Fixed (ReadWrite, ACPIMMIO_GPIO0_BASE, 0x400)
// ^^^^^^^^^^^^^ keyword.other.asl
// ^^^^^^^^^ keyword.other.asl
// ^^^^^^^^^^^^^^^^^^^ constant.other.macro.asl
// ^^^^^ constant.numeric.integer.hexadecimal
}
CreateDWordField (Local0, IRQR._INT, IRQN)
// ^^^^^^^^^^^^^^^^ keyword.other.asl
// ^^^^^^ variable.language.asl
// ^ punctuation.separator.asl
// ^^^^ meta.path.asl variable.other.asl
// ^ meta.path.asl punctuation.accessor
// ^^^^ meta.path.asl variable.language.asl
// ^ punctuation.separator.asl
// ^^^^ entity.name.other.asl
If (PICM) {
// ^^ keyword.control.conditional.asl
// ^^^^ variable.other.asl
IRQN = IGPI
// ^^^^ variable.other.asl
// ^^^^ variable.other.asl
} Else {
// ^^^^ keyword.control.conditional.asl
IRQN = PGPI
// ^^^^ variable.other.asl
// ^^^^ variable.other.asl
}
Return (Local0)
}
Method (ARTH, 0) {
Z = X + Y
// ^ keyword.operator.arithmetic.asl
Add (X, Y, Z)
// ^^^keyword.operator.word.asl
Z = X / Y
// ^ keyword.operator.arithmetic.asl
Divide (X, Y, , Z)
// ^^^^^^ keyword.operator.word.asl
Z = X % Y
// ^ keyword.operator.arithmetic.asl
Mod (X, Y, Z)
// ^^^keyword.operator.word.asl
Z = X * Y
// ^ keyword.operator.arithmetic.asl
Multiply (X, Y, Z)
// ^^^^^^^^keyword.operator.word.asl
Z = X - Y
// ^ keyword.operator.arithmetic.asl
Subtract (X, Y, Z)
// ^^^^^^^^keyword.operator.word.asl
Z = X << Y
// ^^ keyword.operator.arithmetic.asl
ShiftLeft (X, Y, Z)
// ^^^^^^^^^ keyword.operator.word.asl
Z = X >> Y
// ^^ keyword.operator.arithmetic.asl
ShiftRight (X, Y, Z)
// ^^^^^^^^^^ keyword.operator.word.asl
Z = X & Y
// ^ keyword.operator.arithmetic.asl
And (X, Y, Z)
// ^^^ keyword.operator.word.asl
Z = X | Y
// ^ keyword.operator.arithmetic.asl
Or (X, Y, Z)
// ^^ keyword.operator.word.asl
Z = X ^ Y
// ^ keyword.operator.arithmetic.asl
Xor (X, Y, Z)
// ^^^ keyword.operator.word.asl
Z = ~X
// ^ keyword.operator.arithmetic.asl
Not (X, Z)
// ^^^ keyword.operator.word.asl
X++
// ^^ keyword.operator.arithmetic.asl
Increment (X)
// ^^^^^^^^^ keyword.operator.word.asl
X--
// ^^ keyword.operator.arithmetic.asl
Decrement (X)
// ^^^^^^^^^ keyword.operator.word.asl
}
Method (LOPS, 0) {
(X == Y)
// ^^ keyword.operator.assignment.asl
LEqual (X, Y)
// ^ keyword.operator.word.asl
(X != Y)
// ^^ keyword.operator.comparison.asl
LNotEqual (X, Y)
// ^ keyword.operator.word.asl
(X < Y)
// ^ keyword.operator.comparison.asl
LLess (X, Y)
// ^ keyword.operator.word.asl
(X > Y)
// ^ keyword.operator.comparison.asl
LGreater (X, Y)
// ^ keyword.operator.word.asl
(X <= Y)
// ^^ keyword.operator.comparison.asl
LLessEqual (X, Y)
// ^ keyword.operator.word.asl
(X >= Y)
// ^^ keyword.operator.comparison.asl
LGreaterEqual (X, Y)
// ^ keyword.operator.word.asl
(X && Y)
// ^^ keyword.operator.logical.asl
LAnd (X, Y)
// ^ keyword.operator.word.asl
(X || Y)
// ^^ keyword.operator.logical.asl
LOr (X, Y)
// ^ keyword.operator.word.asl
!X
// ^ keyword.operator.logical.asl
LNot (X)
// ^ keyword.operator.word.asl
}
Method (COMP, 0) {
X = Y
Store (Y, X)
X += Y
Add (X, Y, X)
X /= Y
Divide (X, Y, , X)
X %= Y
Mod (X, Y, X)
X *= Y
Multiply (X, Y, X)
X -= Y
Subtract (X, Y, X)
X <<= Y
ShiftLeft (X, Y, X)
X >>= Y
ShiftRight (X, Y, X)
X &= Y
And (X, Y, X)
X |= Y
Or (X, Y, X)
X ^= Y
Xor (X, Y, X)
}
Name (_AEI, ResourceTemplate () {
GpioInt(Edge, ActiveLow, ExclusiveAndWake, PullNone, 0x0000, "\\_SB.GPIO", 0x00, ResourceConsumer, , ) {22} /* lpc_pme_l_agpio22 */
})
OperationRegion(OOPR, SystemMemory, 0xDEADBEEF, 0x100)
// ^^^^^^^^^^^^^^^ storage.type.asl
// ^^^^ meta.entity-path.asl entity.name.other.asl
// ^^^^^^^^^^^^ keyword.other.asl
// ^^^^^^^^^^ constant.numeric.integer.hexadecimal.asl
// ^^^^^ constant.numeric.integer.hexadecimal.asl
Field(OOPR, AnyAcc, NoLock, Preserve) {
// ^^^^^ keyword.other.field.asl
// ^^^^ variable.other.asl
// ^^^^^^ keyword.other.asl
// ^^^^^^ keyword.other.asl
// ^^^^^^^^ keyword.other.asl
// ^ meta.block.field.asl punctuation.section.block.begin.asl
Offset (0x4),
// ^^^^^^ keyword.other.offset.asl
// ^^^ constant.numeric.integer.hexadecimal.asl
// ^ punctuation.separator.asl
FAAD, 2,
// ^^^^ entity.name.field.asl
// ^ punctuation.separator.asl
// ^ constant.numeric.integer.decimal.asl
// ^ punctuation.separator.asl
Offset (0x22),
// ^^^^^^ keyword.other.offset.asl
// ^^^^ constant.numeric.integer.hexadecimal.asl
// ^ punctuation.separator.asl
BARR, 16,
// ^^^^ entity.name.field.asl
// ^^ constant.numeric.integer.decimal.asl
Offset (0xF0),
// ^^^^^^ keyword.other.offset.asl
// ^^^^ constant.numeric.integer.hexadecimal.asl
ABCD,1,
// ^^^^ entity.name.field.asl
// ^ constant.numeric.integer.decimal.asl
, 2,
// ^ punctuation.separator.asl
// ^ constant.numeric.integer.decimal.asl
BAED,1,
// ^^^^ entity.name.field.asl
// ^ constant.numeric.integer.decimal.asl
}
// ^ meta.block meta.block.field.asl punctuation.section.block.end.asl
}
// <- meta.block punctuation.section.block.end.asl
#if CONFIG(HELLO_WORLD)
// <- keyword.control.import.asl
// ^^^^^^ constant.other.macro.asl
// ^^^^^^^^^^^ constant.other.macro.asl
#endif
// <- keyword.control.import.asl
ThermalZone (THRM) {
// <- storage.type.asl
// ^^^^ entity.name.other.asl
}
#define AOAC_DEVICE(DEV_ID, SX) \
// <- meta.preprocessor.define.asl keyword.control.import.define.asl
// ^^^^^^^^^^^ meta.preprocessor.define.asl entity.name.function.asl
PowerResource(AOAC, SX, 0) { \
}
#define HELLO 33
// <- keyword.control.import.define.asl
// ^^^^^ entity.name.asl
// ^^ constant.numeric.integer.decimal.asl
#define HELLO_WORLD 33
// <- keyword.control.import.define.asl
// ^^^^^^^^^^^ entity.name.asl
// ^^ constant.numeric.integer.decimal.asl