mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-23 06:31:28 +00:00
MPC106: self-registration with the device registry.
This commit is contained in:
parent
cb68b70d52
commit
97b3b9a6f8
@ -23,6 +23,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include <devices/common/hwcomponent.h>
|
||||
#include <devices/common/mmiodevice.h>
|
||||
#include <devices/deviceregistry.h>
|
||||
#include <devices/memctrl/memctrlbase.h>
|
||||
#include <devices/memctrl/mpc106.h>
|
||||
#include <memaccess.h>
|
||||
@ -233,3 +234,9 @@ void MPC106::setup_ram() {
|
||||
LOG_F(ERROR, "MPC106 RAM allocation failed! \n");
|
||||
}
|
||||
}
|
||||
|
||||
static const DeviceDescription Grackle_Descriptor = {
|
||||
MPC106::create, {}, {}
|
||||
};
|
||||
|
||||
REGISTER_DEVICE(Grackle, Grackle_Descriptor);
|
||||
|
@ -40,14 +40,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#include <devices/memctrl/memctrlbase.h>
|
||||
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
class MPC106 : public MemCtrlBase, public PCIDevice, public PCIHost {
|
||||
public:
|
||||
MPC106();
|
||||
~MPC106() = default;
|
||||
|
||||
static std::unique_ptr<HWComponent> create() {
|
||||
return std::unique_ptr<MPC106>(new MPC106());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user