提交 ca3df95d 编写于 作者: I Igor Mammedov 提交者: Michael S. Tsirkin

acpi: extend aml_or() to accept target argument

Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
上级 a23b8872
...@@ -505,9 +505,9 @@ Aml *aml_and(Aml *arg1, Aml *arg2) ...@@ -505,9 +505,9 @@ Aml *aml_and(Aml *arg1, Aml *arg2)
} }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefOr */ /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefOr */
Aml *aml_or(Aml *arg1, Aml *arg2) Aml *aml_or(Aml *arg1, Aml *arg2, Aml *dst)
{ {
return build_opcode_2arg_dst(0x7D /* OrOp */, arg1, arg2, NULL); return build_opcode_2arg_dst(0x7D /* OrOp */, arg1, arg2, dst);
} }
/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLOr */ /* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLOr */
......
...@@ -278,12 +278,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, ...@@ -278,12 +278,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
aml_name("CTRL"))); aml_name("CTRL")));
ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1)))); ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
aml_append(ifctx1, aml_store(aml_or(aml_name("CDW1"), aml_int(0x08)), aml_append(ifctx1, aml_store(aml_or(aml_name("CDW1"), aml_int(0x08), NULL),
aml_name("CDW1"))); aml_name("CDW1")));
aml_append(ifctx, ifctx1); aml_append(ifctx, ifctx1);
ifctx1 = aml_if(aml_lnot(aml_equal(aml_name("CDW3"), aml_name("CTRL")))); ifctx1 = aml_if(aml_lnot(aml_equal(aml_name("CDW3"), aml_name("CTRL"))));
aml_append(ifctx1, aml_store(aml_or(aml_name("CDW1"), aml_int(0x10)), aml_append(ifctx1, aml_store(aml_or(aml_name("CDW1"), aml_int(0x10), NULL),
aml_name("CDW1"))); aml_name("CDW1")));
aml_append(ifctx, ifctx1); aml_append(ifctx, ifctx1);
...@@ -292,7 +292,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, ...@@ -292,7 +292,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
aml_append(method, ifctx); aml_append(method, ifctx);
elsectx = aml_else(); elsectx = aml_else();
aml_append(elsectx, aml_store(aml_or(aml_name("CDW1"), aml_int(4)), aml_append(elsectx, aml_store(aml_or(aml_name("CDW1"), aml_int(4), NULL),
aml_name("CDW1"))); aml_name("CDW1")));
aml_append(elsectx, aml_return(aml_arg(3))); aml_append(elsectx, aml_return(aml_arg(3)));
aml_append(method, elsectx); aml_append(method, elsectx);
......
...@@ -680,7 +680,8 @@ static Aml *build_prt(void) ...@@ -680,7 +680,8 @@ static Aml *build_prt(void)
/* route[0] = 0x[slot]FFFF */ /* route[0] = 0x[slot]FFFF */
aml_append(while_ctx, aml_append(while_ctx,
aml_store(aml_or(aml_shiftleft(slot, aml_int(16)), aml_int(0xFFFF)), aml_store(aml_or(aml_shiftleft(slot, aml_int(16)), aml_int(0xFFFF),
NULL),
aml_index(route, aml_int(0)))); aml_index(route, aml_int(0))));
/* route[1] = pin & 3 */ /* route[1] = pin & 3 */
aml_append(while_ctx, aml_append(while_ctx,
......
...@@ -252,7 +252,7 @@ Aml *aml_to_hexstring(Aml *src, Aml *dst); ...@@ -252,7 +252,7 @@ Aml *aml_to_hexstring(Aml *src, Aml *dst);
Aml *aml_to_buffer(Aml *src, Aml *dst); Aml *aml_to_buffer(Aml *src, Aml *dst);
Aml *aml_store(Aml *val, Aml *target); Aml *aml_store(Aml *val, Aml *target);
Aml *aml_and(Aml *arg1, Aml *arg2); Aml *aml_and(Aml *arg1, Aml *arg2);
Aml *aml_or(Aml *arg1, Aml *arg2); Aml *aml_or(Aml *arg1, Aml *arg2, Aml *dst);
Aml *aml_lor(Aml *arg1, Aml *arg2); Aml *aml_lor(Aml *arg1, Aml *arg2);
Aml *aml_shiftleft(Aml *arg1, Aml *count); Aml *aml_shiftleft(Aml *arg1, Aml *count);
Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst); Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册