grandcentral: use MeshStub on machines without MESH.
This commit is contained in:
parent
a0e56aa4cf
commit
28e7a806b4
|
@ -109,6 +109,16 @@ enum SeqState : uint32_t {
|
|||
|
||||
}; // namespace MeshScsi
|
||||
|
||||
class MeshStub : public HWComponent {
|
||||
public:
|
||||
MeshStub() = default;
|
||||
~MeshStub() = default;
|
||||
|
||||
// registers access
|
||||
uint8_t read(uint8_t reg_offset) { return 0; };
|
||||
void write(uint8_t reg_offset, uint8_t value) {};
|
||||
};
|
||||
|
||||
class MeshController : public HWComponent {
|
||||
public:
|
||||
MeshController(uint8_t mesh_id) {
|
||||
|
|
|
@ -70,7 +70,9 @@ GrandCentral::GrandCentral() : PCIDevice("mac-io/grandcentral"), InterruptCtrl()
|
|||
// connect MESH (internal SCSI)
|
||||
this->mesh = dynamic_cast<MeshController*>(gMachineObj->get_comp_by_name("MeshTnt"));
|
||||
if (this->mesh == nullptr) {
|
||||
LOG_F(WARNING, "%s: Mesh not found, install MeshStub", this->name.c_str());
|
||||
LOG_F(WARNING, "%s: Mesh not found, using MeshStub instead", this->name.c_str());
|
||||
this->mesh_stub = std::unique_ptr<MeshStub>(new MeshStub());
|
||||
this->mesh = dynamic_cast<MeshController*>(this->mesh_stub.get());
|
||||
} else {
|
||||
this->mesh_dma = std::unique_ptr<DMAChannel> (new DMAChannel());
|
||||
this->mesh_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCSI_MESH));
|
||||
|
|
|
@ -135,6 +135,7 @@ private:
|
|||
|
||||
// subdevice objects
|
||||
std::unique_ptr<AwacsScreamer> awacs; // AWACS audio codec instance
|
||||
std::unique_ptr<MeshStub> mesh_stub = nullptr;
|
||||
|
||||
NVram* nvram; // NVRAM module
|
||||
MaceController* mace;
|
||||
|
|
Loading…
Reference in New Issue