|
PatchworkOS
a7b3d61
A non-POSIX operating system.
|
Statement Opcodes Encoding. More...
Statement Opcodes Encoding.
Functions | |
| uint64_t | aml_predicate_read (aml_term_list_ctx_t *ctx, aml_uint_t *out) |
| Reads a Predicate structure from the AML byte stream. | |
| uint64_t | aml_def_else_read (aml_term_list_ctx_t *ctx, bool shouldExecute) |
| Reads a DefElse structure from the AML byte stream. | |
| uint64_t | aml_def_if_else_read (aml_term_list_ctx_t *ctx) |
| Reads an DefIfElse structure from the AML byte stream. | |
| uint64_t | aml_def_noop_read (aml_term_list_ctx_t *ctx) |
| Reads a DefNoop structure from the AML byte stream. | |
| aml_object_t * | aml_arg_object_read (aml_term_list_ctx_t *ctx) |
| Reads an ArgObject structure from the AML byte stream. | |
| uint64_t | aml_def_return_read (aml_term_list_ctx_t *ctx) |
| Reads a DefReturn structure from the AML byte stream. | |
| uint64_t | aml_def_break_read (aml_term_list_ctx_t *ctx) |
| Reads a DefBreak structure from the AML byte stream. | |
| uint64_t | aml_def_continue_read (aml_term_list_ctx_t *ctx) |
| Reads a DefContinue structure from the AML byte stream. | |
| uint64_t | aml_def_release_read (aml_term_list_ctx_t *ctx) |
| Reads a DefRelease structure from the AML byte stream. | |
| uint64_t | aml_def_while_read (aml_term_list_ctx_t *ctx) |
| Reads a DefWhile structure from the AML byte stream. | |
| uint64_t | aml_statement_opcode_read (aml_term_list_ctx_t *ctx) |
| Reads an StatementOpcode structure from the AML byte stream. | |
| uint64_t aml_predicate_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_uint_t * | out | ||
| ) |
Reads a Predicate structure from the AML byte stream.
A Predicate structure is defined as Predicate := TermArg => Integer.
| ctx | The context of the TermList that this structure is part of. |
| out | The destination buffer to store the integer value of the Predicate. |
0. On failure, ERR and errno is set. Definition at line 12 of file statement.c.
| uint64_t aml_def_else_read | ( | aml_term_list_ctx_t * | ctx, |
| bool | shouldExecute | ||
| ) |
Reads a DefElse structure from the AML byte stream.
A DefElse structure is defined as DefElse := Nothing | <elseop pkglength termlist>.
| ctx | The context of the TermList that this structure is part of. |
| shouldExecute | Whether the TermList should be executed or skipped. |
0. On failure, ERR and errno is set. Definition at line 22 of file statement.c.
| uint64_t aml_def_if_else_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads an DefIfElse structure from the AML byte stream.
A DefIfElse structure is defined as DefIfElse := IfOp PkgLength Predicate TermList DefElse.
Note that the the DefIfElse structure is also used for normal If statements, just without a "Else" part, this is because the DefElse part is optional.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 56 of file statement.c.
| uint64_t aml_def_noop_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefNoop structure from the AML byte stream.
A DefNoop structure is defined as DefNoop := NoopOp.
A Noop does nothing.
| state | Pointer to the current AML state. |
0. On failure, ERR and errno is set. Definition at line 117 of file statement.c.
| aml_object_t * aml_arg_object_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads an ArgObject structure from the AML byte stream.
An ArgObject structure is defined as ArgObject := TermArg => DataRefObject.
| ctx | The context of the TermList that this structure is part of. |
NULL and errno is set. Definition at line 128 of file statement.c.
| uint64_t aml_def_return_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefReturn structure from the AML byte stream.
A DefReturn structure is defined as DefReturn := ReturnOp ArgObject.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 140 of file statement.c.
| uint64_t aml_def_break_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefBreak structure from the AML byte stream.
A DefBreak structure is defined as DefBreak := BreakOp.
| state | Pointer to the current AML state. |
0. On failure, ERR and errno is set. Definition at line 189 of file statement.c.
| uint64_t aml_def_continue_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefContinue structure from the AML byte stream.
A DefContinue structure is defined as DefContinue := ContinueOp.
| state | Pointer to the current AML state. |
0. On failure, ERR and errno is set. Definition at line 201 of file statement.c.
| uint64_t aml_def_release_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefRelease structure from the AML byte stream.
A DefRelease structure is defined as DefRelease := ReleaseOp MutexObject.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 162 of file statement.c.
| uint64_t aml_def_while_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefWhile structure from the AML byte stream.
A DefWhile structure is defined as DefWhile := WhileOp PkgLength Predicate TermList.
The While statement works by evaluating the Predicate, if it is a non-zero integer, the TermList following the Predicate is executed, then the Predicate is evaluated again, this continues until the Predicate evaluates to zero.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 213 of file statement.c.
| uint64_t aml_statement_opcode_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads an StatementOpcode structure from the AML byte stream.
A StatementOpcode structure is defined as StatementOpcode := DefBreak | DefBreakPoint | DefContinue | DefFatal | DefIfElse | DefNoop | DefNotify | DefRelease | DefReset | DefReturn | DefSignal | DefSleep | DefStall | DefWhile.
Currently unimplemented Opcodes are:
DefBreakPointDefFatalDefNotifyDefResetDefSignalDefSleepDefStall| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 285 of file statement.c.