| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef SRC_ACPI_MULTIPLY_ACPI_MULTIPLY_H_ |
| #define SRC_ACPI_MULTIPLY_ACPI_MULTIPLY_H_ |
| |
| #include <fidl/examples.acpi.multiply/cpp/wire.h> |
| #include <lib/driver2/driver2_cpp.h> |
| #include <lib/driver_compat/compat.h> |
| #include <lib/driver_compat/context.h> |
| |
| #include "multiplier.h" |
| |
| namespace acpi_multiply { |
| |
| // Sample driver for a virtual "multiplier" device described using ACPI. |
| class AcpiMultiplyDriver : public driver::DriverBase { |
| public: |
| AcpiMultiplyDriver(driver::DriverStartArgs start_args, fdf::UnownedDispatcher driver_dispatcher) |
| : driver::DriverBase("acpi-multiply", std::move(start_args), std::move(driver_dispatcher)) {} |
| |
| virtual ~AcpiMultiplyDriver() = default; |
| |
| zx::result<> Start() override; |
| |
| private: |
| void InitializeCompatService(zx::result<std::shared_ptr<compat::Context>> result); |
| |
| std::shared_ptr<compat::Context> compat_context_; |
| std::shared_ptr<AcpiMultiplier> multiplier_; |
| }; |
| |
| } // namespace acpi_multiply |
| |
| #endif /* SRC_ACPI_MULTIPLY_ACPI_MULTIPLY_H_ */ |