| // Copyright 2019 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 MSD_IMG_DRIVER_H |
| #define MSD_IMG_DRIVER_H |
| |
| #include <memory> |
| |
| #include "magma_util/macros.h" |
| #include "msd.h" |
| |
| class MsdImgDriver : public msd_driver_t |
| { |
| public: |
| virtual ~MsdImgDriver(); |
| |
| static std::unique_ptr<MsdImgDriver> Create(); |
| static void Destroy(MsdImgDriver* drv); |
| |
| static MsdImgDriver* cast(msd_driver_t* drv) |
| { |
| DASSERT(drv); |
| DASSERT(drv->magic_ == kMagic); |
| return static_cast<MsdImgDriver*>(drv); |
| } |
| |
| void configure(uint32_t flags) { configure_flags_ = flags; } |
| |
| uint32_t configure_flags() { return configure_flags_; } |
| |
| private: |
| MsdImgDriver(); |
| |
| static const uint32_t kMagic = 0x64726976; //"driv" |
| |
| uint32_t configure_flags_ = 0; |
| }; |
| |
| #endif // MSD_IMG_DRIVER_H |