pc: acpi: fix WindowsXP BSOD when memory hotplug is enabled

ACPI parser in XP considers PNP0A06 devices of CPU and
memory hotplug as duplicates. Adding unique _UID
to CPU hotplug device fixes BSOD.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: acpi: decribe bridge device as not hotpluggable

when bridge hotplug is disabled, i.e. for machine
types less then 2.0, bridge device was created as
hotpluggable by mistake since commit 133a2da.

Fix it by just creating it as a present device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: acpi-build: cleanup AcpiPmInfo initialization

zero initialize AcpiPmInfo struct to reduce code bloat
a little bit.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: build_append_nameseg(): add padding if necessary

According to ACPI spec NameSeg shorter than 4 characters
must be padded up to 4 characters with "_" symbol.
ACPI 5.0:  20.2.2 "Name Objects Encoding"

Do it in build_append_nameseg() so that caller shouldn't know
or care about it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
  * simplify padding, suggested by: "Michael S. Tsirkin" <mst@redhat.com>
acpi: move generic aml building helpers into dedictated file

the will be later used for composing AML primitives
and all that could be reused later for ARM machines
as well.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
PS: there is no functional change
acpi: add build_append_namestring() helper

Use build_append_namestring() instead of build_append_nameseg()
So user won't have to care whether name is NameSeg, NamePath or
NameString.

See for refernce ACPI 5.0: 20.2.2 Name Objects Encoding

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: drop min-bytes in build_package()

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: acpi-build: simplify PCI bus tree generation

it basicaly does the same as original approach,
* just without bus/notify tables tracking (less obscure)
  which is easier to follow.
* drops unnecessary loops and bitmaps,
  creating devices and notification method in the same loop.
* saves us ~100LOC

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v3:
  * use hotpluggable device object instead of not hotpluggable
    for non present devices, and add it only when bus itself is
    hotpluggable
acpi: introduce AML composer aml_append()

Adds for dynamic AML creation, which will be used
for piecing ASL/AML primitives together and hiding
from user/caller details about how nested context
should be closed/packed leaving less space for
mistakes and necessity to know how AML should be
encoded, allowing user to concentrate on ASL
representation instead.

For example it will allow to create AML like this:

AcpiAml scope = acpi_scope("PCI0")
AcpiAml dev = acpi_device("PM")
    aml_append(&dev, acpi_name_decl("_ADR", acpi_int(addr)))
aml_append(&scope, dev);

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_scope() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_device() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_method() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_if() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_name() & acpi_name_decl() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: factor out ACPI const int packing out build_append_value()

it will be reused for adding a plain integer
value into AML.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: extend build_append_{value|int}() to support 64-bit values

it will be used for generating 64bit _CRS entries

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_int() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_return() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_arg0(), acpi_arg1(), acpi_arg2(), acpi_arg3() terms

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: add acpi_store() term

Signed-off-by: Igor Mammedov <imammedo@redhat.com>