class DeviceBuilder

Defined at line 95 of file ../../src/devices/board/lib/acpi/device-builder.h

Represents a device that's been discovered inside the ACPI tree.

Public Methods

void DeviceBuilder (std::string name, ACPI_HANDLE handle, DeviceBuilder * parent, uint64_t state, uint32_t device_id)

Defined at line 97 of file ../../src/devices/board/lib/acpi/device-builder.h

DeviceBuilder MakeRootDevice (ACPI_HANDLE handle, zx_device_t * acpi_root)

Defined at line 107 of file ../../src/devices/board/lib/acpi/device-builder.h

void SetBusType (BusType t)

Set the bus type of this device. A device can only have a single bus type.

Defined at line 117 of file ../../src/devices/board/lib/acpi/device-builder.h

void SetBusId (uint32_t id)

Set the ID of this bus. For instance, a board might have 3 I2C buses with IDs 0, 1, and 2.

Must call SetBusType first.

Defined at line 124 of file ../../src/devices/board/lib/acpi/device-builder.h

const DeviceChildData & GetBusChildren ()

Defined at line 133 of file ../../src/devices/board/lib/acpi/device-builder.h

bool HasBusChildren ()

Returns true if this bus has any children.

Defined at line 135 of file ../../src/devices/board/lib/acpi/device-builder.h

const char * name ()

Defined at line 137 of file ../../src/devices/board/lib/acpi/device-builder.h

ACPI_HANDLE handle ()

Defined at line 138 of file ../../src/devices/board/lib/acpi/device-builder.h

bool built ()

Defined at line 139 of file ../../src/devices/board/lib/acpi/device-builder.h

DeviceBuilder * parent ()

Defined at line 140 of file ../../src/devices/board/lib/acpi/device-builder.h

zx::result<zx_device_t *> Build (acpi::Manager * acpi, async_dispatcher_t * device_dispatcher)

Creates an actual device from this DeviceBuilder, returning a pointer to its zx_device_t.

Defined at line 186 of file ../../src/devices/board/lib/acpi/device-builder.cc

size_t AddBusChild (DeviceChildEntry d)

Add a |DeviceChildEntry| containing information used for this bus to identify its child.

For instance, on PCI this is the topology, and on I2C this is the address.

Returns the index of the newly added device in the children array.

Defined at line 253 of file ../../src/devices/board/lib/acpi/device-builder.cc

acpi::status<> GatherResources (acpi::Acpi * acpi, acpi::Manager * manager, GatherResourcesCallback callback)

Defined at line 69 of file ../../src/devices/board/lib/acpi/device-builder.cc

BusType GetBusType ()

Defined at line 151 of file ../../src/devices/board/lib/acpi/device-builder.h

uint32_t GetBusId ()

Defined at line 152 of file ../../src/devices/board/lib/acpi/device-builder.h

bool HasBusId ()

Defined at line 153 of file ../../src/devices/board/lib/acpi/device-builder.h

std::vector<OwnedStringProp> & GetStrProps ()

For unit test use only.

Defined at line 156 of file ../../src/devices/board/lib/acpi/device-builder.h

uint32_t device_id ()

Defined at line 158 of file ../../src/devices/board/lib/acpi/device-builder.h