PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
named.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <stdbool.h>
7
8typedef struct aml_object aml_object_t;
9typedef struct aml_opregion aml_opregion_t;
10typedef struct aml_field_unit aml_field_unit_t;
11typedef struct aml_term_list_ctx aml_term_list_ctx_t;
12
13/**
14 * @brief Named Objects Encoding
15 * @defgroup modules_acpi_aml_encoding_name Named Objects
16 * @ingroup modules_acpi_aml
17 *
18 * Not to be confused with "ACPI AML Name Objects Encoding".
19 *
20 * @see Section 20.2.5.2 of the ACPI specification for more details.
21 *
22 * @{
23 */
24
25/**
26 * @brief Region Space Encoding
27 * @enum aml_region_space_t
28 */
45
46/**
47 * @brief Enum for all field access types, bits 0-3 of FieldFlags.
48 * @enum aml_access_type_t
49 */
59
60/**
61 * @brief Enum for all field lock rules, bit 4 of FieldFlags.
62 * @enum aml_lock_rule_t
63 */
69
70/**
71 * @brief Enum for all field update rules, bits 5-6 of FieldFlags.
72 * @enum aml_update_rule_t
73 */
80
81/**
82 * @brief FieldFlags structure.
83 * @struct aml_field_flags_t
84 */
91
92/**
93 * @brief Enum for all FieldList types.
94 * @enum aml_field_list_type_t
95 */
96typedef enum
97{
98 AML_FIELD_LIST_TYPE_FIELD, ///< FieldList is part of a DefField.
99 AML_FIELD_LIST_TYPE_INDEX_FIELD, ///< FieldList is part of an IndexField.
100 AML_FIELD_LIST_TYPE_BANK_FIELD, ///< FieldList is part of a BankField.
102
103/**
104 * @brief Context passed to lower functions by `aml_field_list_read()`.
105 * @struct aml_field_list_ctx_t
106 */
107typedef struct
108{
109 aml_field_list_type_t type; ///< The type of FieldList.
110 aml_field_flags_t flags; ///< The flags of the FieldList.
111 aml_bit_size_t currentOffset; ///< The current offset within the opregion.
112 union {
113 struct
114 {
117 struct
118 {
121 } index;
122 struct
123 {
124 aml_opregion_t* opregion;
127 } bank;
128 };
130
131/**
132 * @brief SyncLevel Encoding
133 * @enum aml_sync_level_t
134 */
136
137/**
138 * @brief MethodFlags structure.
139 * @struct aml_method_flags_t
140 */
141typedef struct
142{
143 uint8_t argCount; ///< Amount of arguments (0-7)
144 bool isSerialized; ///< true if method is serialized, false if not
145 aml_sync_level_t syncLevel; ///< Synchronization level (0-15)
147
148/**
149 * @brief ProcID structure, deprecated in version 6.4 of the ACPI specification.
150 */
152
153/**
154 * @brief PblkAddr structure, deprecated in version 6.4 of the ACPI specification.
155 */
157
158/**
159 * @brief PblkLen structure, deprecated in version 6.4 of the ACPI specification.
160 */
162
163/**
164 * @brief SystemLevel structure.
165 */
167
168/**
169 * @brief ResourceOrder structure.
170 */
172
173/**
174 * @brief Reads a BankValue structure from the AML byte stream.
175 *
176 * A BankValue structure is defined as `BankValue := TermArg => Integer`.
177 *
178 * @param ctx The context of the TermList that this structure is part of.
179 * @param out The output buffer to store the bank value.
180 * @return On success, `0`. On failure, `ERR` and `errno` is set.
181 */
183
184/**
185 * @brief Reads a RegionSpace structure from the AML byte stream.
186 *
187 * A RegionSpace structure is defined as `RegionSpace := ByteData`.
188 *
189 * @param ctx The context of the TermList that this structure is part of.
190 * @param out The output buffer to store the region space.
191 * @return On success, `0`. On failure, `ERR` and `errno` is set.
192 */
194
195/**
196 * @brief Reads a RegionOffset structure from the AML byte stream.
197 *
198 * A RegionOffset structure is defined as `RegionOffset := TermArg => Integer`.
199 *
200 * @param ctx The context of the TermList that this structure is part of.
201 * @param out The output buffer to store the RegionOffset.
202 * @return On success, `0`. On failure, `ERR` and `errno` is set.
203 */
205
206/**
207 * @brief Reads a RegionLen structure from the AML byte stream.
208 *
209 * A RegionLen structure is defined as `RegionLen := TermArg => Integer`.
210 *
211 * @param ctx The context of the TermList that this structure is part of.
212 * @param out The output buffer to store the region length.
213 * @return On success, `0`. On failure, `ERR` and `errno` is set.
214 */
216
217/**
218 * @brief Reads a DefOpRegion structure from the AML byte stream.
219 *
220 * A DefOpRegion structure is defined as `DefOpRegion := OpRegionOp NameString RegionSpace RegionOffset RegionLen`.
221 *
222 * @see Section 19.6.100 of the ACPI specification for more details.
223 *
224 * @param ctx The context of the TermList that this structure is part of.
225 * @return On success, `0`. On failure, `ERR` and `errno` is set.
226 */
228
229/**
230 * @brief Reads a FieldFlags structure from the AML byte stream.
231 *
232 * Clean up definition.
233 *
234 * A FieldFlags structure is defined as `FieldFlags := ByteData`, where
235 * - bit 0-3: AccessType
236 * - 0 AnyAcc
237 * - 1 ByteAcc
238 * - 2 WordAcc
239 * - 3 DWordAcc
240 * - 4 QWordAcc
241 * - 5 BufferAcc
242 * - 6 Reserved
243 *
244 * - bits 7-15 Reserved
245 *
246 * - bit 4: LockRule
247 * - 0 NoLock
248 * - 1 Lock
249 *
250 * - bit 5-6: UpdateRule
251 * - 0 Preserve
252 * - 1 WriteAsOnes
253 * - 2 WriteAsZeros
254 *
255 * - bit 7: Reserved (must be 0)
256 *
257 * @param ctx The context of the TermList that this structure is part of.
258 * @param out The buffer to store the FieldFlags structure.
259 * @return On success, `0`. On failure, `ERR` and `errno` is set.
260 */
262
263/**
264 * @brief Reads a NamedField structure from the AML byte stream.
265 *
266 * A NamedField structure is defined as `NamedField := NameSeg PkgLength`
267 *
268 * @see Section 19.6.48 of the ACPI specification for more details about the Field Operation.
269 *
270 * @param ctx The context of the TermList that this structure is part of.
271 * @param fieldCtx The AML field list context.
272 * @return On success, `0`. On failure, `ERR` and `errno` is set.
273 */
275
276/**
277 * @brief Reads a ReservedField structure from the AML byte stream.
278 *
279 * A ReservedField structure is defined as `ReservedField := 0x00 PkgLength`.
280 *
281 * @see Section 19.6.48 of the ACPI specification for more details about the Field Operation.
282 *
283 * @param ctx The context of the TermList that this structure is part of.
284 * @param fieldCtx The AML field list context.
285 * @return On success, `0`. On failure, `ERR` and `errno` is set.
286 */
288
289/**
290 * @brief Reads a FieldElement structure from the AML byte stream.
291 *
292 * The FieldElement structure is defined as `FieldElement := NamedField | ReservedField | AccessField |
293 * ExtendedAccessField | ConnectField`.
294 *
295 * @see Section 19.6.48 of the ACPI specification for more details about the Field Operation.
296 *
297 * @param ctx The context of the TermList that this structure is part of.
298 * @param fieldCtx The AML field list context.
299 * @return On success, `0`. On failure, `ERR` and `errno` is set.
300 */
302
303/**
304 * @brief Reads a FieldList structure from the AML byte stream.
305 *
306 * The FieldList structure is defined as `FieldList := Nothing | <fieldelement fieldlist>`.
307 *
308 * @see Section 19.6.48 of the ACPI specification for more details about the Field Operation.
309 *
310 * @param ctx The context of the TermList that this structure is part of.
311 * @param fieldCtx The AML field list context.
312 * @param end The index at which the FieldList ends.
313 * @return On success, `0`. On failure, `ERR` and `errno` is set.
314 */
316
317/**
318 * @brief Reads a DefField structure from the AML byte stream.
319 *
320 * The DefField structure is defined as `DefField := FieldOp PkgLength NameString FieldFlags FieldList`.
321 *
322 * @param ctx The context of the TermList that this structure is part of.
323 * @return On success, `0`. On failure, `ERR` and `errno` is set.
324 */
326
327/**
328 * @brief Reads a DefIndexField structure from the AML byte stream.
329 *
330 * The DefIndexField structure is defined as `DefIndexField := IndexFieldOp PkgLength NameString NameString FieldFlags
331 * FieldList`.
332 *
333 * IndexFields can be a bit confusing, but the basic idea is that you have two fields, one for the index and one for the
334 * data. The index field in this case can be thought of as a "selector", and the data field is where we find the actual
335 * data we "selected". For example, to perform a read, we first write an index to the index field, and then read the
336 * data from the data field. The index is typically an offset into an array or table, and the data is the value at that
337 * offset.
338 *
339 * @see Section 19.6.64 of the ACPI specification for more details.
340 *
341 * @param ctx The context of the TermList that this structure is part of.
342 * @return On success, `0`. On failure, `ERR` and `errno` is set.
343 */
345
346/**
347 * @brief Reads a DefBankField structure from the AML byte stream.
348 *
349 * The DefBankField structure is defined as `DefBankField := BankFieldOp PkgLength NameString NameString BankValue
350 * FieldFlags FieldList`.
351 *
352 * BankFields can be even more confusing then IndexFields. A BankField allows for the same opregion to be accessed using
353 * different field configurations, by switching between different banks. Each BankField as an ID, the BankValue, and you
354 * have some object, pointed to by the second NameString, such that when you read from a BankField, the BankValue is
355 * first written to the object to select the bank structure associated with that BankField.
356 *
357 * Basically you can change the structure of an opregion by selecting different banks.
358 *
359 * @see Section 19.6.7 of the ACPI specification for more details.
360 *
361 * @param ctx The context of the TermList that this structure is part of.
362 * @return On success, `0`. On failure, `ERR` and `errno` is set.
363 */
365
366/**
367 * @brief Reads a MethodFlags structure from the AML byte stream.
368 *
369 * A MethodFlags structure is defined as `MethodFlags := ByteData`, where
370 * - bit 0-2: ArgCount (0-7)
371 * - bit 3:
372 * - 0: NotSerialized
373 * - 1: Serialized
374 * - bit 4-7: SyncLevel (0x00-0x0F)
375 *
376 * @param ctx The context of the TermList that this structure is part of.
377 * @param out The output buffer to store the MethodFlags structure.
378 * @return On success, `0`. On failure, `ERR` and `errno` is set.
379 */
381
382/**
383 * @brief Reads a DefMethod structure from the AML byte stream.
384 *
385 * The DefField structure is defined as `DefMethod := MethodOp PkgLength NameString MethodFlags TermList`.
386 *
387 * @see Section 19.6.85 of the ACPI specification for more details.
388 *
389 * @param ctx The context of the TermList that this structure is part of.
390 * @return On success, `0`. On failure, `ERR` and `errno` is set.
391 */
393
394/**
395 * @brief Reads a DefDevice structure from the AML byte stream.
396 *
397 * The DefDevice structure is defined as `DefDevice := DeviceOp PkgLength NameString TermList`.
398 *
399 * @see Section 19.6.31 of the ACPI specification for more details.
400 *
401 * @param ctx The context of the TermList that this structure is part of.
402 * @return On success, `0`. On failure, `ERR` and `errno` is set.
403 */
405
406/**
407 * @brief Reads a SyncFlags structure from the AML byte stream.
408 *
409 * A SyncFlags structure is defined as `SyncFlags := ByteData`, where
410 * - bit 0-3: SyncLevel (0x00-0x0F)
411 * - bit 4-7: Reserved (must be 0)
412 *
413 * @param ctx The context of the TermList that this structure is part of.
414 * @param out The output buffer to store the SyncFlags structure.
415 * @return On success, `0`. On failure, `ERR` and `errno` is set.
416 */
418
419/**
420 * @brief Reads a DefMutex structure from the AML byte stream.
421 *
422 * The DefMutex structure is defined as `DefMutex := MutexOp NameString SyncFlags`.
423 *
424 * @see Section 19.6.89 of the ACPI specification for more details.
425 *
426 * @param ctx The context of the TermList that this structure is part of.
427 * @return On success, `0`. On failure, `ERR` and `errno` is set.
428 */
430
431/**
432 * @brief Reads a ProcID structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
433 *
434 * A ProcID structure is defined as `ProcID := ByteData`.
435 *
436 * @param ctx The context of the TermList that this structure is part of.
437 * @param out The output buffer to store the processor ID.
438 * @return On success, `0`. On failure, `ERR` and `errno` is set.
439 */
441
442/**
443 * @brief Reads a PblkAddr structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
444 *
445 * A PblkAddr structure is defined as `PblkAddr := DWordData`.
446 *
447 * @param ctx The context of the TermList that this structure is part of.
448 * @param out The output buffer to store the Pblk address.
449 * @return On success, `0`. On failure, `ERR` and `errno` is set.
450 */
452
453/**
454 * @brief Reads a PblkLen structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
455 *
456 * A PblkLen structure is defined as `PblkLen := ByteData`.
457 *
458 * @param ctx The context of the TermList that this structure is part of.
459 * @param out The output buffer to store the Pblk length.
460 * @return On success, `0`. On failure, `ERR` and `errno` is set.
461 */
463
464/**
465 * @brief Reads a DefProcessor structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
466 *
467 * The DefProcessor structure is defined as `DefProcessor := ProcessorOp PkgLength NameString ProcID PblkAddr PblkLen
468 * TermList`.
469 *
470 * @see Section 20.2.7 of version 6.3 Errata A of the ACPI specification for more details on the grammar and
471 * section 19.6.108 of the same for more details about its behavior.
472 *
473 * @param ctx The context of the TermList that this structure is part of.
474 * @return On success, `0`. On failure, `ERR` and `errno` is set.
475 */
477
478/**
479 * @brief Reads a SourceBuff structure from the AML byte stream.
480 *
481 * A SourceBuff structure is defined as `SourceBuff := TermArg => Buffer`.
482 *
483 * SourceBuff must evaluate to a ObjectReference that refers to a Buffer object.
484 *
485 * @param ctx The context of the TermList that this structure is part of.
486 * @return On success, the buffer object. On failure, `NULL` and `errno` is set.
487 */
489
490/**
491 * @brief Reads a BitIndex structure from the AML byte stream.
492 *
493 * A BitIndex structure is defined as `BitIndex := TermArg => Integer`.
494 *
495 * @param ctx The context of the TermList that this structure is part of.
496 * @param out The destination buffer to store the BitIndex.
497 * @return On success, `0`. On failure, `ERR` and `errno` is set.
498 */
500
501/**
502 * @brief Reads a ByteIndex structure from the AML byte stream.
503 *
504 * A ByteIndex structure is defined as `ByteIndex := TermArg => Integer`.
505 *
506 * @param ctx The context of the TermList that this structure is part of.
507 * @param out The destination buffer to store the ByteIndex.
508 * @return On success, `0`. On failure, `ERR` and `errno` is set.
509 */
511
512/**
513 * @brief Reads a DefCreateBitField structure from the AML byte stream.
514 *
515 * The DefCreateBitField structure is defined as `DefCreateBitField := CreateBitFieldOp SourceBuff BitIndex NameString`.
516 *
517 * A CreateBitField operation creates a field, with the name stored in the NameString, that accesses the single bit with
518 * the index BitIndex within the SourceBuff.
519 *
520 * So if BitIndex is 6 and SourceBuff is a buffer with the value 0b10101010, then reading the created bit field will
521 * return 1, and writing 0 to it will change SourceBuff to 0b10101000.
522 *
523 * The other CreateXField operations work similarly, but for different sizes of fields and use byte indices instead of
524 * bit indices.
525 *
526 * @see Section 19.6.18 of the ACPI specification for more details.
527 *
528 * @param ctx The context of the TermList that this structure is part of.
529 * @return On success, `0`. On failure, `ERR` and `errno` is set.
530 */
532
533/**
534 * @brief Reads a DefCreateByteField structure from the AML byte stream.
535 *
536 * The DefCreateByteField structure is defined as `DefCreateByteField := CreateByteFieldOp SourceBuff ByteIndex
537 * NameString`.
538 *
539 * A CreateByteField operation creates a field, with the name stored in the NameString, that accesses the byte (8 bits)
540 * starting at the index ByteIndex within the SourceBuff.
541 *
542 * @see Section 19.6.19 of the ACPI specification for more details.
543 *
544 * @param ctx The context of the TermList that this structure is part of.
545 * @return On success, `0`. On failure, `ERR` and `errno` is set.
546 */
548
549/**
550 * @brief Reads a DefCreateWordField structure from the AML byte stream.
551 *
552 * The DefCreateWordField structure is defined as `DefCreateWordField := CreateWordFieldOp SourceBuff ByteIndex
553 * NameString`.
554 *
555 * A CreateWordField operation creates a field, with the name stored in the NameString, that accesses the word (16 bits)
556 * starting at the index ByteIndex within the SourceBuff.
557 *
558 * @see Section 19.6.23 of the ACPI specification for more details.
559 *
560 * @param ctx The context of the TermList that this structure is part of.
561 * @return On success, `0`. On failure, `ERR` and `errno` is set.
562 */
564
565/**
566 * @brief Reads a DefCreateDWordField structure from the AML byte stream.
567 *
568 * The DefCreateDWordField structure is defined as `DefCreateDWordField := CreateDWordFieldOp SourceBuff ByteIndex
569 * NameString`.
570 *
571 * A CreateDWordField operation creates a field, with the name stored in the NameString, that accesses the double word
572 * (32 bits) starting at the index ByteIndex within the SourceBuff.
573 *
574 * @see Section 19.6.20 of the ACPI specification for more details.
575 *
576 * @param ctx The context of the TermList that this structure is part of.
577 * @return On success, `0`. On failure, `ERR` and `errno` is set.
578 */
580
581/**
582 * @brief Reads a DefCreateQWordField structure from the AML byte stream.
583 *
584 * The DefCreateQWordField structure is defined as `DefCreateQWordField := CreateQWordFieldOp SourceBuff ByteIndex
585 * NameString`.
586 *
587 * A CreateQWordField operation creates a field, with the name stored in the NameString, that accesses the quad word (64
588 * bits) starting at the index ByteIndex within the SourceBuff.
589 *
590 * @see Section 19.6.22 of the ACPI specification for more details.
591 *
592 * @param ctx The context of the TermList that this structure is part of.
593 * @return On success, `0`. On failure, `ERR` and `errno` is set.
594 */
596
597/**
598 * @brief Reads a DefEvent structure from the AML byte stream.
599 *
600 * The DefEvent structure is defined as `DefEvent := EventOp NameString`.
601 *
602 * @see Section 19.6.42 of the ACPI specification for more details.
603 *
604 * @param ctx The context of the TermList that this structure is part of.
605 * @return On success, `0`. On failure, `ERR` and `errno` is set.
606 */
608
609/**
610 * @brief Reads a DefThermalZone structure from the AML byte stream.
611 *
612 * The DefThermalZone structure is defined as `DefThermalZone := ThermalZoneOp PkgLength NameString TermList`.
613 *
614 * @see Section 19.6.135 of the ACPI specification for more details.
615 *
616 * @param ctx The context of the TermList that this structure is part of.
617 * @return On success, `0`. On failure, `ERR` and `errno` is set.
618 */
620
621/**
622 * @brief Reads a SystemLevel structure from the AML byte stream.
623 *
624 * A SystemLevel structure is defined as `SystemLevel := ByteData`.
625 *
626 * @param ctx The context of the TermList that this structure is part of.
627 * @param out The output buffer to store the system level.
628 * @return On success, `0`. On failure, `ERR` and `errno` is set.
629 */
631
632/**
633 * @brief Reads a ResourceOrder structure from the AML byte stream.
634 *
635 * A ResourceOrder structure is defined as `ResourceOrder := WordData`.
636 *
637 * @param ctx The context of the TermList that this structure is part of.
638 * @param out The output buffer to store the resource order.
639 * @return On success, `0`. On failure, `ERR` and `errno` is set.
640 */
642
643/**
644 * @brief Reads a DefPowerRes structure from the AML byte stream.
645 *
646 * The DefPowerRes structure is defined as `DefPowerRes := PowerResOp PkgLength NameString SystemLevel ResourceOrder
647 * TermList`.
648 *
649 * @see Section 19.6.108 of the ACPI specification for more details.
650 *
651 * @param ctx The context of the TermList that this structure is part of.
652 * @return On success, `0`. On failure, `ERR` and `errno` is set.
653 */
655
656/**
657 * @brief Reads a NumBits structure from the AML byte stream.
658 *
659 * A NumBits structure is defined as `NumBits := TermArg => Integer`.
660 *
661 * @param ctx The context of the TermList that this structure is part of.
662 * @param out The output buffer to store the number of bits.
663 * @return On success, `0`. On failure, `ERR` and `errno` is set.
664 */
666
667/**
668 * @brief Reads a DefCreateField structure from the AML byte stream.
669 *
670 * The DefCreateField structure is defined as `DefDataRegion := CreateFieldOp SourceBuff BitIndex NumBits NameString`.
671 *
672 * @see Section 19.6.21 of the ACPI specification for more details.
673 *
674 * @param ctx The context of the TermList that this structure is part of.
675 * @return On success, `0`. On failure, `ERR` and `errno` is set.
676 */
678
679/**
680 * @brief Reads a DefCreateField structure from the AML byte stream.
681 *
682 * The DefCreateField structure is defined as `DefCreateField := CreateFieldOp SourceBuff BitIndex FieldFlags
683 * NameString`.
684 *
685 * A CreateField operation creates a field, with the name stored in the NameString, that accesses a field of arbitrary
686 * size and alignment within the SourceBuff, starting at the bit index BitIndex, and with the access properties defined
687 * by FieldFlags.
688 *
689 * @see Section 19.6.21 of the ACPI specification for more details.
690 *
691 * @param ctx The context of the TermList that this structure is part of.
692 * @return On success, `0`. On failure, `ERR` and `errno` is set.
693 */
695
696/**
697 * @brief Reads a DefDataRegion structure from the AML byte stream.
698 *
699 * The DefDataRegion structure is defined as `DefDataRegion := DataRegionOp NameString TermArg TermArg TermArg`.
700 *
701 * Despite the name the DefDataRegion structure is used to implement the DataTableRegion ASL operation.
702 *
703 * All it does is that it allows a System Descriptor Table to be accessed as an opregion.
704 *
705 * @see Section 19.6.25 of the ACPI specification for more details.
706 *
707 * @param ctx The context of the TermList that this structure is part of.
708 * @return On success, `0`. On failure, `ERR` and `errno` is set.
709 */
711
712/**
713 * @brief Reads a NamedObj structure from the AML byte stream.
714 *
715 * Version 6.6 of the ACPI specification has a few mistakes in the definition of the NamedObj structure,
716 * its supposed to contain several stuctures that it does not. If you check version 4.0 of the specification
717 * section 19.2.5.2 you can confirm that that these structures are supposed to be there but have, somehow, been
718 * forgotten.
719 *
720 * The forgotten structures are:
721 * - `DefField`
722 * - `DefMethod`
723 * - `DefMutex`
724 * - `DefIndexField`
725 * - `DefDevice`
726 * - `DefEvent`
727 * - `Maybe even more?`
728 *
729 * We add all missing structures to our definition of NamedObj. I have no idea how there are this many
730 * mistakes in the latest version of the ACPI specification.
731 *
732 * The DefProcessor structure was deprecated in version 6.4 of the ACPI specification, but we still support it.
733 *
734 * The NamedObj structure is defined as `NamedObj := DefBankField | DefCreateBitField | DefCreateByteField |
735 * DefCreateDWordField | DefCreateField | DefCreateQWordField | DefCreateWordField | DefDataRegion | DefExternal |
736 * DefOpRegion | DefPowerRes | DefThermalZone | DefField | DefMethod | DefDevice | DefMutex | DefProcessor |
737 * DefIndexField | DefEvent`.
738 *
739 * Currently unimplemented Opcodes are:
740 * - `DefExternal`
741 *
742 * @param ctx The context of the TermList that this structure is part of.
743 * @return On success, `0`. On failure, `ERR` and `errno` is set.
744 */
746
747/** @} */
uint64_t aml_bit_size_t
Represents a size in bits within an opregion.
uint64_t aml_def_create_field_read(aml_term_list_ctx_t *ctx)
Reads a DefCreateField structure from the AML byte stream.
Definition named.c:1133
uint64_t aml_byte_index_read(aml_term_list_ctx_t *ctx, aml_uint_t *out)
Reads a ByteIndex structure from the AML byte stream.
Definition named.c:826
uint64_t aml_def_opregion_read(aml_term_list_ctx_t *ctx)
Reads a DefOpRegion structure from the AML byte stream.
Definition named.c:68
uint8_t aml_proc_id_t
ProcID structure, deprecated in version 6.4 of the ACPI specification.
Definition named.h:151
uint64_t aml_def_device_read(aml_term_list_ctx_t *ctx)
Reads a DefDevice structure from the AML byte stream.
Definition named.c:593
uint64_t aml_field_flags_read(aml_term_list_ctx_t *ctx, aml_field_flags_t *out)
Reads a FieldFlags structure from the AML byte stream.
Definition named.c:122
uint64_t aml_reserved_field_read(aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx)
Reads a ReservedField structure from the AML byte stream.
Definition named.c:258
uint32_t aml_pblk_addr_t
PblkAddr structure, deprecated in version 6.4 of the ACPI specification.
Definition named.h:156
uint64_t aml_def_index_field_read(aml_term_list_ctx_t *ctx)
Reads a DefIndexField structure from the AML byte stream.
Definition named.c:380
uint64_t aml_region_offset_read(aml_term_list_ctx_t *ctx, aml_uint_t *out)
Reads a RegionOffset structure from the AML byte stream.
Definition named.c:46
uint64_t aml_def_field_read(aml_term_list_ctx_t *ctx)
Reads a DefField structure from the AML byte stream.
Definition named.c:323
uint64_t aml_region_len_read(aml_term_list_ctx_t *ctx, aml_uint_t *out)
Reads a RegionLen structure from the AML byte stream.
Definition named.c:57
uint64_t aml_bank_value_read(aml_term_list_ctx_t *ctx, aml_uint_t *out)
Reads a BankValue structure from the AML byte stream.
Definition named.c:15
aml_access_type_t
Enum for all field access types, bits 0-3 of FieldFlags.
Definition named.h:51
uint64_t aml_def_create_byte_field_read(aml_term_list_ctx_t *ctx)
Reads a DefCreateByteField structure from the AML byte stream.
Definition named.c:936
uint64_t aml_def_bank_field_read(aml_term_list_ctx_t *ctx)
Reads a DefBankField structure from the AML byte stream.
Definition named.c:451
uint64_t aml_field_element_read(aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx)
Reads a FieldElement structure from the AML byte stream.
Definition named.c:277
uint64_t aml_sync_flags_read(aml_term_list_ctx_t *ctx, aml_sync_level_t *out)
Reads a SyncFlags structure from the AML byte stream.
Definition named.c:643
uint64_t aml_def_thermal_zone_read(aml_term_list_ctx_t *ctx)
Reads a DefThermalZone structure from the AML byte stream.
Definition named.c:988
aml_lock_rule_t
Enum for all field lock rules, bit 4 of FieldFlags.
Definition named.h:65
uint64_t aml_region_space_read(aml_term_list_ctx_t *ctx, aml_region_space_t *out)
Reads a RegionSpace structure from the AML byte stream.
Definition named.c:26
uint64_t aml_def_create_dword_field_read(aml_term_list_ctx_t *ctx)
Reads a DefCreateDWordField structure from the AML byte stream.
Definition named.c:946
uint64_t aml_def_data_region_read(aml_term_list_ctx_t *ctx)
Reads a DefDataRegion structure from the AML byte stream.
Definition named.c:1189
aml_update_rule_t
Enum for all field update rules, bits 5-6 of FieldFlags.
Definition named.h:75
uint64_t aml_def_create_word_field_read(aml_term_list_ctx_t *ctx)
Reads a DefCreateWordField structure from the AML byte stream.
Definition named.c:941
uint64_t aml_num_bits_read(aml_term_list_ctx_t *ctx, aml_uint_t *out)
Reads a NumBits structure from the AML byte stream.
Definition named.c:1122
uint64_t aml_def_create_qword_field_read(aml_term_list_ctx_t *ctx)
Reads a DefCreateQWordField structure from the AML byte stream.
Definition named.c:951
aml_field_list_type_t
Enum for all FieldList types.
Definition named.h:97
uint64_t aml_name_field_read(aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx)
Reads a NamedField structure from the AML byte stream.
Definition named.c:155
uint64_t aml_system_level_read(aml_term_list_ctx_t *ctx, aml_system_level_t *out)
Reads a SystemLevel structure from the AML byte stream.
Definition named.c:1038
uint64_t aml_def_create_bit_field_read(aml_term_list_ctx_t *ctx)
Reads a DefCreateBitField structure from the AML byte stream.
Definition named.c:837
uint8_t aml_system_level_t
SystemLevel structure.
Definition named.h:166
uint64_t aml_def_method_read(aml_term_list_ctx_t *ctx)
Reads a DefMethod structure from the AML byte stream.
Definition named.c:540
uint64_t aml_def_event_read(aml_term_list_ctx_t *ctx)
Reads a DefEvent structure from the AML byte stream.
Definition named.c:956
uint64_t aml_named_obj_read(aml_term_list_ctx_t *ctx)
Reads a NamedObj structure from the AML byte stream.
Definition named.c:1296
uint8_t aml_pblk_len_t
PblkLen structure, deprecated in version 6.4 of the ACPI specification.
Definition named.h:161
uint64_t aml_def_mutex_read(aml_term_list_ctx_t *ctx)
Reads a DefMutex structure from the AML byte stream.
Definition named.c:663
uint8_t aml_sync_level_t
Definition named.h:135
uint64_t aml_proc_id_read(aml_term_list_ctx_t *ctx, aml_proc_id_t *out)
Reads a ProcID structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
Definition named.c:702
uint64_t aml_def_processor_read(aml_term_list_ctx_t *ctx)
Reads a DefProcessor structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
Definition named.c:732
aml_object_t * aml_source_buff_read(aml_term_list_ctx_t *ctx)
Reads a SourceBuff structure from the AML byte stream.
Definition named.c:803
uint64_t aml_bit_index_read(aml_term_list_ctx_t *ctx, aml_uint_t *out)
Reads a BitIndex structure from the AML byte stream.
Definition named.c:815
uint64_t aml_pblk_len_read(aml_term_list_ctx_t *ctx, aml_pblk_len_t *out)
Reads a PblkLen structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
Definition named.c:722
aml_region_space_t
Region Space Encoding.
Definition named.h:30
uint64_t aml_resource_order_read(aml_term_list_ctx_t *ctx, aml_resource_order_t *out)
Reads a ResourceOrder structure from the AML byte stream.
Definition named.c:1048
uint64_t aml_method_flags_read(aml_term_list_ctx_t *ctx, aml_method_flags_t *out)
Reads a MethodFlags structure from the AML byte stream.
Definition named.c:518
uint16_t aml_resource_order_t
ResourceOrder structure.
Definition named.h:171
uint64_t aml_def_power_res_read(aml_term_list_ctx_t *ctx)
Reads a DefPowerRes structure from the AML byte stream.
Definition named.c:1058
uint64_t aml_field_list_read(aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx, const uint8_t *end)
Reads a FieldList structure from the AML byte stream.
Definition named.c:308
uint64_t aml_pblk_addr_read(aml_term_list_ctx_t *ctx, aml_pblk_addr_t *out)
Reads a PblkAddr structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
Definition named.c:712
@ AML_ACCESS_TYPE_DWORD
Definition named.h:55
@ AML_ACCESS_TYPE_ANY
Definition named.h:52
@ AML_ACCESS_TYPE_QWORD
Definition named.h:56
@ AML_ACCESS_TYPE_BYTE
Definition named.h:53
@ AML_ACCESS_TYPE_BUFFER
Definition named.h:57
@ AML_ACCESS_TYPE_WORD
Definition named.h:54
@ AML_LOCK_RULE_NO_LOCK
Definition named.h:66
@ AML_LOCK_RULE_LOCK
Definition named.h:67
@ AML_UPDATE_RULE_PRESERVE
Definition named.h:76
@ AML_UPDATE_RULE_WRITE_AS_ZEROS
Definition named.h:78
@ AML_UPDATE_RULE_WRITE_AS_ONES
Definition named.h:77
@ AML_FIELD_LIST_TYPE_FIELD
FieldList is part of a DefField.
Definition named.h:98
@ AML_FIELD_LIST_TYPE_BANK_FIELD
FieldList is part of a BankField.
Definition named.h:100
@ AML_FIELD_LIST_TYPE_INDEX_FIELD
FieldList is part of an IndexField.
Definition named.h:99
@ AML_REGION_PCC
Definition named.h:41
@ AML_REGION_IPMI
Definition named.h:38
@ AML_REGION_PCI_CONFIG
Definition named.h:33
@ AML_REGION_SYSTEM_IO
Definition named.h:32
@ AML_REGION_GENERIC_SERIAL_BUS
Definition named.h:40
@ AML_REGION_PCI_BAR_TARGET
Definition named.h:37
@ AML_REGION_OEM_MIN
Definition named.h:42
@ AML_REGION_SM_BUS
Definition named.h:35
@ AML_REGION_GENERAL_PURPOSE_IO
Definition named.h:39
@ AML_REGION_EMBEDDED_CONTROL
Definition named.h:34
@ AML_REGION_SYSTEM_MEMORY
Definition named.h:31
@ AML_REGION_OEM_MAX
Definition named.h:43
@ AML_REGION_SYSTEM_CMOS
Definition named.h:36
uint64_t aml_uint_t
AML Integer type.
Definition integer.h:20
static block_t field[FIELD_HEIGHT][FIELD_WIDTH]
Definition main.c:131
__UINT32_TYPE__ uint32_t
Definition stdint.h:15
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINT8_TYPE__ uint8_t
Definition stdint.h:11
__UINT16_TYPE__ uint16_t
Definition stdint.h:13
FieldFlags structure.
Definition named.h:86
aml_lock_rule_t lockRule
Definition named.h:88
aml_access_type_t accessType
Definition named.h:87
aml_update_rule_t updateRule
Definition named.h:89
Context passed to lower functions by aml_field_list_read().
Definition named.h:108
aml_field_unit_t * index
Definition named.h:119
aml_field_flags_t flags
The flags of the FieldList.
Definition named.h:110
aml_field_unit_t * bank
Definition named.h:125
aml_field_unit_t * data
Definition named.h:120
aml_bit_size_t currentOffset
The current offset within the opregion.
Definition named.h:111
aml_uint_t bankValue
Definition named.h:126
aml_opregion_t * opregion
Definition named.h:115
aml_field_list_type_t type
The type of FieldList.
Definition named.h:109
Data for a field unit object.
Definition object.h:268
MethodFlags structure.
Definition named.h:142
bool isSerialized
true if method is serialized, false if not
Definition named.h:144
uint8_t argCount
Amount of arguments (0-7)
Definition named.h:143
aml_sync_level_t syncLevel
Synchronization level (0-15)
Definition named.h:145
ACPI object.
Definition object.h:447
Data for an operation region object.
Definition object.h:345
Context for reading a TermList.
Definition term.h:37