gem5  v20.1.0.0
Namespaces | Enumerations | Functions | Variables
Ps2 Namespace Reference

Namespaces

 Keyboard
 
 Mouse
 

Enumerations

enum  {
  SelfTestPass = 0xAA, ReadID = 0xF2, Enable = 0xF4, Disable = 0xF5,
  DefaultsAndDisable = 0xF6, SelfTestFail = 0xFC, Ack = 0xFA, Resend = 0xFE,
  Reset = 0xFF
}
 

Functions

void keySymToPs2 (uint32_t key, bool down, bool &cur_shift, std::list< uint8_t > &keys)
 
 BitUnion8 (Ps2MouseMovement) Bitfield< 0 > leftButton
 A bitfield that represents the first byte of a mouse movement packet. More...
 
 EndBitUnion (Ps2MouseMovement) void keySymToPs2(uint32_t key
 Convert an x11 key symbol into a set of ps2 charecters. More...
 

Variables

static const uint16_t keySymToPs2Byte [128]
 Table to convert simple key symbols (0x00XX) into ps2 bytes. More...
 
const uint8_t ShiftKey = 0x12
 
const uint8_t BreakKey = 0xf0
 
const uint8_t ExtendedKey = 0xe0
 
const uint32_t UpperKeys = 0xff00
 
Bitfield< 1 > rightButton
 
Bitfield< 2 > middleButton
 
Bitfield< 3 > one
 
Bitfield< 4 > xSign
 
Bitfield< 5 > ySign
 
Bitfield< 6 > xOverflow
 
Bitfield< 7 > yOverflow
 
bool down
 
bool bool & cur_shift
 
bool bool std::list< uint8_t > & keys
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SelfTestPass 
ReadID 
Enable 
Disable 
DefaultsAndDisable 
SelfTestFail 
Ack 
Resend 
Reset 

Definition at line 54 of file types.hh.

Function Documentation

◆ BitUnion8()

Ps2::BitUnion8 ( Ps2MouseMovement  )

A bitfield that represents the first byte of a mouse movement packet.

◆ EndBitUnion()

Ps2::EndBitUnion ( Ps2MouseMovement  )

Convert an x11 key symbol into a set of ps2 charecters.

Parameters
keyx11 key symbol
downif the key is being pressed or released
cur_shiftif device has already sent a shift
keyslist of keys command to send to emulate the x11 key symbol

◆ keySymToPs2()

void Ps2::keySymToPs2 ( uint32_t  key,
bool  down,
bool &  cur_shift,
std::list< uint8_t > &  keys 
)

Definition at line 83 of file types.cc.

References BreakKey, cur_shift, down, ExtendedKey, keys, keySymToPs2Byte, ArmISA::shift, ShiftKey, UpperKeys, and warn.

Referenced by PS2Keyboard::keyPress().

Variable Documentation

◆ BreakKey

const uint8_t Ps2::BreakKey = 0xf0

Definition at line 78 of file types.cc.

Referenced by keySymToPs2().

◆ cur_shift

bool bool& Ps2::cur_shift

Definition at line 123 of file types.hh.

Referenced by keySymToPs2().

◆ down

bool Ps2::down

Definition at line 123 of file types.hh.

Referenced by PS2Keyboard::keyPress(), and keySymToPs2().

◆ ExtendedKey

const uint8_t Ps2::ExtendedKey = 0xe0

Definition at line 79 of file types.cc.

Referenced by keySymToPs2().

◆ keys

bool bool std::list<uint8_t>& Ps2::keys

Definition at line 124 of file types.hh.

Referenced by PS2Keyboard::keyPress(), and keySymToPs2().

◆ keySymToPs2Byte

const uint16_t Ps2::keySymToPs2Byte[128]
static
Initial value:
= {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0029, 0x0116, 0x0152, 0x0126, 0x0125, 0x012e, 0x013d, 0x0052,
0x0146, 0x0145, 0x013e, 0x0155, 0x0041, 0x004e, 0x0049, 0x004a,
0x0045, 0x0016, 0x001e, 0x0026, 0x0025, 0x002e, 0x0036, 0x003d,
0x003e, 0x0046, 0x014c, 0x004c, 0x0141, 0x0055, 0x0149, 0x014a,
0x011e, 0x011c, 0x0132, 0x0121, 0x0123, 0x0124, 0x012b, 0x0134,
0x0133, 0x0143, 0x013b, 0x0142, 0x014b, 0x013a, 0x0131, 0x0144,
0x014d, 0x0115, 0x012d, 0x011b, 0x012c, 0x013c, 0x012a, 0x011d,
0x0122, 0x0135, 0x011a, 0x0054, 0x005d, 0x005b, 0x0136, 0x014e,
0x000e, 0x001c, 0x0032, 0x0021, 0x0023, 0x0024, 0x002b, 0x0034,
0x0033, 0x0043, 0x003b, 0x0042, 0x004b, 0x003a, 0x0031, 0x0044,
0x004d, 0x0015, 0x002d, 0x001b, 0x002c, 0x003c, 0x002a, 0x001d,
0x0022, 0x0035, 0x001a, 0x0154, 0x015d, 0x015b, 0x010e, 0x0000
}

Table to convert simple key symbols (0x00XX) into ps2 bytes.

Lower byte is the scan code to send and upper byte is if a modifier is required to generate it. The table generates us keyboard codes, (e.g. the guest is supposed to recognize the keyboard as en_US). A new table would be required for another locale.

Definition at line 57 of file types.cc.

Referenced by keySymToPs2().

◆ middleButton

Bitfield<2> Ps2::middleButton

Definition at line 109 of file types.hh.

◆ one

Bitfield<3> Ps2::one

Definition at line 110 of file types.hh.

Referenced by ThreadContext::compare().

◆ rightButton

Bitfield<1> Ps2::rightButton

Definition at line 108 of file types.hh.

◆ ShiftKey

const uint8_t Ps2::ShiftKey = 0x12

Definition at line 77 of file types.cc.

Referenced by keySymToPs2().

◆ UpperKeys

const uint32_t Ps2::UpperKeys = 0xff00

Definition at line 80 of file types.cc.

Referenced by keySymToPs2().

◆ xOverflow

Bitfield<6> Ps2::xOverflow

Definition at line 113 of file types.hh.

◆ xSign

Bitfield<4> Ps2::xSign

Definition at line 111 of file types.hh.

◆ yOverflow

Bitfield<7> Ps2::yOverflow

Definition at line 114 of file types.hh.

◆ ySign

Bitfield<5> Ps2::ySign

Definition at line 112 of file types.hh.


Generated on Wed Sep 30 2020 14:03:08 for gem5 by doxygen 1.8.17