mirror of https://github.com/xemu-project/xemu.git
acpi: add aml_create_qword_field()
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
This commit is contained in:
parent
6e1db3f263
commit
7e192a383b
|
@ -910,17 +910,30 @@ Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule)
|
|||
return var;
|
||||
}
|
||||
|
||||
/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefCreateDWordField */
|
||||
Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name)
|
||||
static
|
||||
Aml *create_field_common(int opcode, Aml *srcbuf, Aml *index, const char *name)
|
||||
{
|
||||
Aml *var = aml_alloc();
|
||||
build_append_byte(var->buf, 0x8A); /* CreateDWordFieldOp */
|
||||
Aml *var = aml_opcode(opcode);
|
||||
aml_append(var, srcbuf);
|
||||
aml_append(var, index);
|
||||
build_append_namestring(var->buf, "%s", name);
|
||||
return var;
|
||||
}
|
||||
|
||||
/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefCreateDWordField */
|
||||
Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name)
|
||||
{
|
||||
return create_field_common(0x8A /* CreateDWordFieldOp */,
|
||||
srcbuf, index, name);
|
||||
}
|
||||
|
||||
/* ACPI 2.0a: 17.2.4.2 Named Objects Encoding: DefCreateQWordField */
|
||||
Aml *aml_create_qword_field(Aml *srcbuf, Aml *index, const char *name)
|
||||
{
|
||||
return create_field_common(0x8F /* CreateQWordFieldOp */,
|
||||
srcbuf, index, name);
|
||||
}
|
||||
|
||||
/* ACPI 1.0b: 16.2.3 Data Objects Encoding: String */
|
||||
Aml *aml_string(const char *name_format, ...)
|
||||
{
|
||||
|
|
|
@ -308,6 +308,7 @@ Aml *aml_mutex(const char *name, uint8_t sync_level);
|
|||
Aml *aml_acquire(Aml *mutex, uint16_t timeout);
|
||||
Aml *aml_release(Aml *mutex);
|
||||
Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name);
|
||||
Aml *aml_create_qword_field(Aml *srcbuf, Aml *index, const char *name);
|
||||
Aml *aml_varpackage(uint32_t num_elements);
|
||||
Aml *aml_touuid(const char *uuid);
|
||||
Aml *aml_unicode(const char *str);
|
||||
|
|
Loading…
Reference in New Issue