class Device

Defined at line 24 of file ../../src/devices/board/lib/acpi/test/device.h

Public Methods

Device * FindByPath (std::string_view path)

Find a device by path. This implements the rules specified in the ACPI spec, v6.4, section 5.3,

with the exception of searching parents for single-component paths.

Defined at line 18 of file ../../src/devices/board/lib/acpi/test/device.cc

void Device (std::string name)

Defined at line 29 of file ../../src/devices/board/lib/acpi/test/device.h

void SetAdr (uint64_t val)

Defined at line 33 of file ../../src/devices/board/lib/acpi/test/device.h

void SetHid (std::string hid)

Defined at line 34 of file ../../src/devices/board/lib/acpi/test/device.h

void SetCids (std::initializer_list<std::string> cids)

Defined at line 35 of file ../../src/devices/board/lib/acpi/test/device.h

void SetSta (uint64_t val)

Defined at line 36 of file ../../src/devices/board/lib/acpi/test/device.h

void AddDsd (const acpi::Uuid & uuid, ACPI_OBJECT value)

Defined at line 37 of file ../../src/devices/board/lib/acpi/test/device.h

void SetGlk (bool val)

Defined at line 40 of file ../../src/devices/board/lib/acpi/test/device.h

void AddChild (std::unique_ptr<Device> c)

Add a child to this device.

Defined at line 45 of file ../../src/devices/board/lib/acpi/test/device.h

void AddMethodCallback (const std::optional<std::string> & name, EvaluateObjectCallback cb)

Defined at line 50 of file ../../src/devices/board/lib/acpi/test/device.h

void AddResource (ACPI_RESOURCE r)

Add a resource to this device.

Defined at line 57 of file ../../src/devices/board/lib/acpi/test/device.h

const std::vector<std::unique_ptr<Device>> & children ()

Defined at line 66 of file ../../src/devices/board/lib/acpi/test/device.h

const std::vector<ACPI_RESOURCE> & resources ()

Defined at line 67 of file ../../src/devices/board/lib/acpi/test/device.h

const std::optional<std::string> & hid ()

Defined at line 68 of file ../../src/devices/board/lib/acpi/test/device.h

std::optional<uint64_t> adr ()

Defined at line 69 of file ../../src/devices/board/lib/acpi/test/device.h

const std::vector<std::string> & cids ()

Defined at line 70 of file ../../src/devices/board/lib/acpi/test/device.h

const std::unordered_map<acpi::Uuid, std::vector<ACPI_OBJECT>> & dsd ()

Defined at line 71 of file ../../src/devices/board/lib/acpi/test/device.h

uint64_t sta ()

Defined at line 72 of file ../../src/devices/board/lib/acpi/test/device.h

void SetPowerResourceMethods (uint8_t system_level, uint16_t resource_order)

Defined at line 223 of file ../../src/devices/board/lib/acpi/test/device.cc

std::string GetAbsolutePath ()

Return this device's absolute path.

Defined at line 73 of file ../../src/devices/board/lib/acpi/test/device.cc

void Notify (uint32_t value)

Defined at line 78 of file ../../src/devices/board/lib/acpi/test/device.h

acpi::status<acpi::UniquePtr<ACPI_OBJECT>> EvaluateObject (std::optional<std::string> pathname, std::optional<std::vector<ACPI_OBJECT>> args)

Equivalent of AcpiEvaluateObject.

Defined at line 89 of file ../../src/devices/board/lib/acpi/test/device.cc

bool HasNotifyHandler ()

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

uint32_t fourcc_name ()

ACPI names are all four characters long.

In practice this means that they're represented as uint32_t where each byte

corresponds to a letter. Names less than four characters long are padded with '_'.

This function takes the name_ of a device and returns one of the "fourcc" codes described

above.

https://en.wikipedia.org/wiki/FourCC

Defined at line 104 of file ../../src/devices/board/lib/acpi/test/device.h

ACPI_HANDLE parent ()

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

acpi::status<> InstallNotifyHandler (Acpi::NotifyHandlerCallable callback, void * context, uint32_t raw_mode)

Device Object Notifications. Note that we only support a single handler per device.

Defined at line 157 of file ../../src/devices/board/lib/acpi/test/device.cc

acpi::status<> RemoveNotifyHandler (Acpi::NotifyHandlerCallable callback, uint32_t raw_mode)

Defined at line 172 of file ../../src/devices/board/lib/acpi/test/device.cc

acpi::status<> AddAddressSpaceHandler (ACPI_ADR_SPACE_TYPE type, Acpi::AddressSpaceHandler handler, void * context)

Defined at line 184 of file ../../src/devices/board/lib/acpi/test/device.cc

acpi::status<> RemoveAddressSpaceHandler (ACPI_ADR_SPACE_TYPE type, Acpi::AddressSpaceHandler handler)

Defined at line 194 of file ../../src/devices/board/lib/acpi/test/device.cc

acpi::status<> AddressSpaceOp (ACPI_ADR_SPACE_TYPE space, uint32_t function, ACPI_PHYSICAL_ADDRESS address, uint32_t bit_width, UINT64 * value)

Defined at line 211 of file ../../src/devices/board/lib/acpi/test/device.cc