Deleted Added
sdiff udiff text old ( 12653:4f6b6c1a8e2f ) new ( 12656:335489e574f3 )
full compact
1/*
2 * Copyright (c) 2017-2018 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 31 unchanged lines hidden (view full) ---

40 * Authors: Gabe Black
41 * Andreas Sandberg
42 */
43
44#ifndef __DEV_PS2_DEVICE_HH__
45#define __DEV_PS2_DEVICE_HH__
46
47#include <deque>
48
49#include "sim/sim_object.hh"
50
51struct PS2DeviceParams;
52
53class PS2Device : public SimObject
54{
55 public:

--- 31 unchanged lines hidden (view full) ---

87 *
88 * @param c Received data.
89 */
90 void hostWrite(uint8_t c);
91
92 protected: /* Device interface */
93 /**
94 * Data received from host.
95 */
96 virtual void recv(uint8_t data) = 0;
97
98 /**
99 * Send data from a PS/2 device to a host
100 *
101 * @param data Pointer to data array
102 * @param size Size of the data array
103 */
104 void send(const uint8_t *data, size_t size);

--- 18 unchanged lines hidden (view full) ---

123 * output buffer to do rate limiting.
124 */
125 size_t sendPending() const { return outBuffer.size(); }
126
127 private:
128 /** Device -> host FIFO */
129 std::deque<uint8_t> outBuffer;
130
131 std::function<void()> dataAvailableCallback;
132};
133
134#endif // __DEV_PS2_HOUSE_HH__