2022-07-13 00:52:12 +03:00
|
|
|
/*
|
|
|
|
* Arm PrimeCell PL050 Keyboard / Mouse Interface
|
|
|
|
*
|
|
|
|
* Copyright (c) 2006-2007 CodeSourcery.
|
|
|
|
* Written by Paul Brook
|
|
|
|
*
|
|
|
|
* This code is licensed under the GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_PL050_H
|
|
|
|
#define HW_PL050_H
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#include "migration/vmstate.h"
|
|
|
|
#include "hw/input/ps2.h"
|
|
|
|
#include "hw/irq.h"
|
|
|
|
|
2022-07-13 00:52:18 +03:00
|
|
|
struct PL050DeviceClass {
|
|
|
|
SysBusDeviceClass parent_class;
|
|
|
|
|
|
|
|
DeviceRealize parent_realize;
|
|
|
|
};
|
|
|
|
|
2022-07-13 00:52:12 +03:00
|
|
|
#define TYPE_PL050 "pl050"
|
2022-07-13 00:52:18 +03:00
|
|
|
OBJECT_DECLARE_TYPE(PL050State, PL050DeviceClass, PL050)
|
2022-07-13 00:52:12 +03:00
|
|
|
|
|
|
|
struct PL050State {
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
MemoryRegion iomem;
|
2022-07-13 00:52:14 +03:00
|
|
|
PS2State *ps2dev;
|
2022-07-13 00:52:12 +03:00
|
|
|
uint32_t cr;
|
|
|
|
uint32_t clk;
|
|
|
|
uint32_t last;
|
|
|
|
int pending;
|
|
|
|
qemu_irq irq;
|
|
|
|
bool is_mouse;
|
|
|
|
};
|
|
|
|
|
2022-07-13 00:52:15 +03:00
|
|
|
#define TYPE_PL050_KBD_DEVICE "pl050_keyboard"
|
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(PL050KbdState, PL050_KBD_DEVICE)
|
|
|
|
|
|
|
|
struct PL050KbdState {
|
|
|
|
PL050State parent_obj;
|
2022-07-13 00:52:21 +03:00
|
|
|
|
|
|
|
PS2KbdState kbd;
|
2022-07-13 00:52:15 +03:00
|
|
|
};
|
|
|
|
|
2022-07-13 00:52:16 +03:00
|
|
|
#define TYPE_PL050_MOUSE_DEVICE "pl050_mouse"
|
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(PL050MouseState, PL050_MOUSE_DEVICE)
|
|
|
|
|
|
|
|
struct PL050MouseState {
|
|
|
|
PL050State parent_obj;
|
2022-07-13 00:52:22 +03:00
|
|
|
|
|
|
|
PS2MouseState mouse;
|
2022-07-13 00:52:16 +03:00
|
|
|
};
|
|
|
|
|
2022-07-13 00:52:12 +03:00
|
|
|
#endif
|