48 #include "debug/Pl050.hh"
56 rawInterrupts(0), ackNext(false), shiftDown(false),
57 vnc(p->vnc), driverInitialized(false), intEvent(this)
78 DPRINTF(
Pl050,
"Read Commmand: %#x\n", (uint32_t)control);
110 data = pkt->
get<uint32_t>();
114 warn(
"Tried to read PL050 at offset %#x that doesn't exist\n", daddr);
129 panic(
"KMI read size too big?\n");
145 assert(pkt->
getSize() ==
sizeof(uint8_t));
150 DPRINTF(
Pl050,
"Write Commmand: %#x\n", (uint32_t)pkt->
get<uint8_t>());
151 control = pkt->
get<uint8_t>();
163 warn(
"Tried to write PL050 at offset %#x that doesn't exist\n", daddr);
231 panic(
"Unknown byte received: %d\n", byte);
244 rawInterrupts.rx = 1;
246 rawInterrupts.rx = 0;
258 DPRINTF(
Pl050,
"Generate Interrupt: rawInt=%#x ctrl=%#x int=%#x\n",
315 uint8_t ctrlreg = control;
322 uint8_t raw_ints = rawInterrupts;
347 rawInterrupts = raw_ints;
359 Pl050Params::create()
361 return new Pl050(
this);
Implementiation of a PL050 KMI.
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
virtual void clearInt(uint32_t num)=0
Clear an interrupt from a device that is connected to the GIC.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool scheduled() const
Determine if the current event is scheduled.
bool shiftDown
is the shift key currently down
AmbaPioDeviceParams Params
const Params * params() const
static const int kmiClkDiv
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
int ackNext
If the controller should ignore the next data byte and acknowledge it.
std::list< uint8_t > rxQueue
Receive queue.
#define UNSERIALIZE_SCALAR(scalar)
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
#define SERIALIZE_CONTAINER(member)
Tick curTick()
The current simulated tick.
Addr pioSize
Size that the device's address range.
VncInput * vnc
The vnc server we're connected to (if any)
void updateIntStatus()
Update the status of the interrupt registers and schedule an interrupt if required.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
This is a base class for AMBA devices that have to respond to Device and Implementer ID calls...
virtual void sendInt(uint32_t num)=0
Post an interrupt from a device that is connected to the GIC.
void makeAtomicResponse()
uint64_t Tick
Tick count type.
void generateInterrupt()
Function to generate interrupt.
#define UNSERIALIZE_CONTAINER(member)
bool readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void keyPress(uint32_t key, bool down) override
Called when the vnc server receives a key press event from the client.
InterruptReg getInterrupt() const
Get interrupt value.
#define SERIALIZE_SCALAR(scalar)
EventWrapper< Pl050,&Pl050::generateInterrupt > intEvent
Wrapper to create an event out of the thing.
Declaration of the Packet class.
std::ostream CheckpointOut
void processCommand(uint8_t byte)
Handle a command sent to the kmi and respond appropriately.
Tick pioDelay
Delay that the device experinces on an access.
uint8_t clkdiv
clock divisor register This register is just kept around to satisfy reads after driver does writes...
void schedule(Event &event, Tick when)
bool driverInitialized
If the linux driver has initialized the device yet and thus can we send mouse data.
bool bool std::list< uint8_t > & keys
void keySymToPs2(uint32_t key, bool down, bool &cur_shift, std::list< uint8_t > &keys)
Addr pioAddr
Address that the device listens to.
if(it_gpu==gpuTypeMap.end())
void mouseAt(uint16_t x, uint16_t y, uint8_t buttons) override
called whenever the mouse moves or it's button state changes buttons is a simple mask with each butto...