| // 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. |
| library fuchsia.driver.host; |
| |
| using fuchsia.driver.framework; |
| using fuchsia.ldsvc; |
| using zx; |
| |
| /// Protocol through which a driver's lifecycle can be managed. |
| /// |
| /// The Driver Runner will call Stop() on this protocol to indicate that the |
| /// Driver Host should stop the Driver. The Driver Host should close the |
| /// server end of the channel with an epitath to signal that the driver has |
| /// been stopped. |
| /// |
| /// EPITAPH |
| /// |
| /// This protocol sends a FIDL epitaph to indicate that the driver instance |
| /// has been terminated correctly. The Driver Host must send an epitaph of |
| /// ZX_OK in order to indicate the Driver was Stopped correctly. |
| /// Not sending an epitaph, or sending an error, will cause Driver Runner |
| /// to log an error. |
| closed protocol Driver { |
| |
| /// Request that the Driver is Stopped. |
| /// |
| /// After stopping the driver instance, the server should close this |
| /// connection with an epitath. This signals that the Driver has been |
| /// stopped. |
| strict Stop(); |
| }; |
| |
| /// Information about the driver host. Used for debugging. |
| type ProcessInfo = struct { |
| job_koid uint64; |
| process_koid uint64; |
| }; |
| |
| /// Protocol through which a driver host can be managed. |
| @discoverable |
| closed protocol DriverHost { |
| /// Start a driver within a driver host. |
| strict Start(resource struct { |
| start_args fuchsia.driver.framework.DriverStartArgs; |
| driver server_end:Driver; |
| }) -> () error zx.Status; |
| |
| /// Returns the job and process KOIDs of the driver host. |
| strict GetProcessInfo() -> (ProcessInfo) error zx.Status; |
| |
| /// Provides a loader service which should be installed via |
| /// `dl_set_loader_service`. |
| strict InstallLoader(resource struct { |
| loader client_end:fuchsia.ldsvc.Loader; |
| }); |
| }; |