macio: self-registration with the device registry.

This commit is contained in:
Maxim Poliakovski 2022-07-15 20:52:13 +02:00
parent ca51c34157
commit 9056d53474
3 changed files with 30 additions and 0 deletions

View File

@ -20,6 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <cpu/ppc/ppcemu.h>
#include <devices/deviceregistry.h>
#include <devices/common/scsi/sc53c94.h>
#include <devices/ethernet/mace.h>
#include <devices/floppy/swim3.h>
@ -270,3 +271,13 @@ void GrandCentral::ack_dma_int(uint32_t irq_id, uint8_t irq_line_state)
{
ABORT_F("GC: ack_dma_int() not implemened");
}
static const vector<string> GCSubdevices = {
"Swim3", "Escc"
};
static const DeviceDescription GC_Descriptor = {
GrandCentral::create, GCSubdevices, {}
};
REGISTER_DEVICE(GrandCentral, GC_Descriptor);

View File

@ -20,6 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <cpu/ppc/ppcemu.h>
#include <devices/deviceregistry.h>
#include <devices/common/dbdma.h>
#include <devices/common/hwcomponent.h>
#include <devices/common/viacuda.h>
@ -356,3 +357,13 @@ void HeathrowIC::ack_int(uint32_t irq_id, uint8_t irq_line_state)
void HeathrowIC::ack_dma_int(uint32_t irq_id, uint8_t irq_line_state)
{
}
static const vector<string> Heathrow_Subdevices = {
"Swim3", "Escc"
};
static const DeviceDescription Heathrow_Descriptor = {
HeathrowIC::create, Heathrow_Subdevices, {}
};
REGISTER_DEVICE(Heathrow, Heathrow_Descriptor);

View File

@ -89,6 +89,10 @@ public:
GrandCentral();
~GrandCentral() = default;
static std::unique_ptr<HWComponent> create() {
return std::unique_ptr<GrandCentral>(new GrandCentral());
}
// MMIO device methods
uint32_t read(uint32_t reg_start, uint32_t offset, int size);
void write(uint32_t reg_start, uint32_t offset, uint32_t value, int size);
@ -153,6 +157,10 @@ public:
HeathrowIC();
~HeathrowIC() = default;
static std::unique_ptr<HWComponent> create() {
return std::unique_ptr<HeathrowIC>(new HeathrowIC());
}
// MMIO device methods
uint32_t read(uint32_t reg_start, uint32_t offset, int size);
void write(uint32_t reg_start, uint32_t offset, uint32_t value, int size);