gem5  v20.1.0.0
types.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011, 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
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef __DEV_PS2_HH__
39 #define __DEV_PS2_HH__
40 
41 #include <stdint.h>
42 
43 #include <list>
44 #include <vector>
45 
46 #include "base/bitunion.hh"
47 
52 namespace Ps2 {
53 
54 enum {
55  SelfTestPass = 0xAA,
56  ReadID = 0xF2,
57  Enable = 0xF4,
58  Disable = 0xF5,
60  SelfTestFail = 0xFC,
61  Ack = 0xFA,
62  Resend = 0xFE,
63  Reset = 0xFF,
64 };
65 
66 namespace Keyboard {
67 
68 enum {
69  LEDWrite = 0xED,
72  TypematicInfo = 0xF3,
75  AllKeysToMake = 0xF9,
79  KeyToMakeOnly = 0xFD,
80 };
81 
82 extern const std::vector<uint8_t> ID;
83 
84 };
85 
86 namespace Mouse {
87 
88 enum {
89  Scale1to1 = 0xE6,
90  Scale2to1 = 0xE7,
91  SetResolution = 0xE8,
92  GetStatus = 0xE9,
93  ReadData = 0xEB,
94  ResetWrapMode = 0xEC,
95  WrapMode = 0xEE,
96  RemoteMode = 0xF0,
97  SampleRate = 0xF3,
98 };
99 
100 extern const std::vector<uint8_t> ID;
101 
102 };
103 
106 BitUnion8(Ps2MouseMovement)
107  Bitfield<0> leftButton;
108  Bitfield<1> rightButton;
109  Bitfield<2> middleButton;
110  Bitfield<3> one;
111  Bitfield<4> xSign;
112  Bitfield<5> ySign;
113  Bitfield<6> xOverflow;
114  Bitfield<7> yOverflow;
115 EndBitUnion(Ps2MouseMovement)
116 
117 
123 void keySymToPs2(uint32_t key, bool down, bool &cur_shift,
124  std::list<uint8_t> &keys);
125 
126 } /* namespace Ps2 */
127 #endif // __DEV_PS2_HH__
Ps2::Keyboard::KeyToMakeRelease
@ KeyToMakeRelease
Definition: types.hh:78
Ps2::Mouse::SetResolution
@ SetResolution
Definition: types.hh:91
Ps2::Keyboard::AlternateScanCodes
@ AlternateScanCodes
Definition: types.hh:71
Ps2::Keyboard::AllKeysToMakeRelease
@ AllKeysToMakeRelease
Definition: types.hh:74
Ps2::SelfTestFail
@ SelfTestFail
Definition: types.hh:60
Ps2::xSign
Bitfield< 4 > xSign
Definition: types.hh:111
Ps2::DefaultsAndDisable
@ DefaultsAndDisable
Definition: types.hh:59
Ps2::SelfTestPass
@ SelfTestPass
Definition: types.hh:55
Ps2::Ack
@ Ack
Definition: types.hh:61
Ps2::Enable
@ Enable
Definition: types.hh:57
sc_dt::list
static scfx_rep_node * list
Definition: scfx_rep.cc:368
Ps2::Mouse::WrapMode
@ WrapMode
Definition: types.hh:95
Ps2::Mouse::GetStatus
@ GetStatus
Definition: types.hh:92
Ps2::Keyboard::AllKeysToTypematic
@ AllKeysToTypematic
Definition: types.hh:73
Ps2::Mouse::SampleRate
@ SampleRate
Definition: types.hh:97
std::vector< uint8_t >
Ps2::ySign
Bitfield< 5 > ySign
Definition: types.hh:112
Ps2::Resend
@ Resend
Definition: types.hh:62
Ps2::Keyboard::AllKeysToTypematicMakeRelease
@ AllKeysToTypematicMakeRelease
Definition: types.hh:76
Ps2::Mouse::ResetWrapMode
@ ResetWrapMode
Definition: types.hh:94
Ps2::yOverflow
Bitfield< 7 > yOverflow
Definition: types.hh:114
Ps2::Keyboard::DiagnosticEcho
@ DiagnosticEcho
Definition: types.hh:70
Ps2::BitUnion8
BitUnion8(Ps2MouseMovement) Bitfield< 0 > leftButton
A bitfield that represents the first byte of a mouse movement packet.
Ps2::one
Bitfield< 3 > one
Definition: types.hh:110
Ps2
Definition: types.cc:48
Ps2::keySymToPs2
void keySymToPs2(uint32_t key, bool down, bool &cur_shift, std::list< uint8_t > &keys)
Definition: types.cc:83
Ps2::Keyboard::LEDWrite
@ LEDWrite
Definition: types.hh:69
bitunion.hh
Ps2::Keyboard::TypematicInfo
@ TypematicInfo
Definition: types.hh:72
Ps2::ReadID
@ ReadID
Definition: types.hh:56
Ps2::Mouse::Scale1to1
@ Scale1to1
Definition: types.hh:89
Ps2::cur_shift
bool bool & cur_shift
Definition: types.hh:123
Ps2::Disable
@ Disable
Definition: types.hh:58
Ps2::Keyboard::ID
const std::vector< uint8_t > ID
Definition: types.cc:45
Ps2::Mouse::Scale2to1
@ Scale2to1
Definition: types.hh:90
Ps2::down
bool down
Definition: types.hh:123
Ps2::xOverflow
Bitfield< 6 > xOverflow
Definition: types.hh:113
Ps2::Keyboard::KeyToTypematic
@ KeyToTypematic
Definition: types.hh:77
Ps2::Keyboard::AllKeysToMake
@ AllKeysToMake
Definition: types.hh:75
Ps2::EndBitUnion
EndBitUnion(Ps2MouseMovement) void keySymToPs2(uint32_t key
Convert an x11 key symbol into a set of ps2 charecters.
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
Ps2::middleButton
Bitfield< 2 > middleButton
Definition: types.hh:109
Ps2::Keyboard::KeyToMakeOnly
@ KeyToMakeOnly
Definition: types.hh:79
Ps2::Mouse::RemoteMode
@ RemoteMode
Definition: types.hh:96
Ps2::rightButton
Bitfield< 1 > rightButton
Definition: types.hh:108
Ps2::Reset
@ Reset
Definition: types.hh:63
Ps2::Mouse::ID
const std::vector< uint8_t > ID
Definition: types.cc:46
Ps2::Mouse::ReadData
@ ReadData
Definition: types.hh:93
Ps2::keys
bool bool std::list< uint8_t > & keys
Definition: types.hh:124

Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17