sc53c94: self-registration with the device registry.

This commit is contained in:
Maxim Poliakovski 2022-07-17 05:37:15 +02:00
parent 5f8a927846
commit 2dfc160e30
2 changed files with 14 additions and 2 deletions

View File

@ -25,6 +25,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <devices/common/hwcomponent.h>
#include <devices/common/hwinterrupt.h>
#include <devices/common/scsi/sc53c94.h>
#include <devices/deviceregistry.h>
#include <loguru.hpp>
#include <machines/machinebase.h>
@ -358,3 +359,9 @@ void Sc53C94::notify(ScsiMsg msg_type, int param)
LOG_F(WARNING, "SC53C94: ignore notification message, type: %d", msg_type);
}
}
static const DeviceDescription Sc53C94_Descriptor = {
Sc53C94::create, {}, {}
};
REGISTER_DEVICE(Sc53C94, Sc53C94_Descriptor);

View File

@ -29,10 +29,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#ifndef SC_53C94_H
#define SC_53C94_H
#include "scsi.h"
#include "devices/common/hwinterrupt.h"
#include <devices/common/scsi/scsi.h>
#include <devices/common/hwinterrupt.h>
#include <cinttypes>
#include <memory>
/** 53C94 read registers */
namespace Read {
@ -128,6 +129,10 @@ public:
Sc53C94(uint8_t chip_id=12, uint8_t my_id=7);
~Sc53C94() = default;
static std::unique_ptr<HWComponent> create() {
return std::unique_ptr<Sc53C94>(new Sc53C94());
}
// HWComponent methods
int device_postinit();