VirtualBox

source: vbox/trunk/src/VBox/Devices/Input/PS2Dev.h@ 77807

Last change on this file since 77807 was 76565, checked in by vboxsync, 6 years ago

Devices: Use VBOX_INCLUDED_SRC_ as header guard prefix with scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Id: PS2Dev.h 76565 2019-01-01 04:23:20Z vboxsync $ */
2/** @file
3 * PS/2 devices - Internal header file.
4 */
5
6/*
7 * Copyright (C) 2007-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOX_INCLUDED_SRC_Input_PS2Dev_h
19#define VBOX_INCLUDED_SRC_Input_PS2Dev_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/** The size of the PS2K/PS2M structure fillers.
25 * @note Must be at least as big as the real struct. Compile time assert
26 * makes sure this is so. */
27#define PS2K_STRUCT_FILLER 512
28#define PS2M_STRUCT_FILLER 512
29
30/* Hide the internal structure. */
31#if !(defined(IN_PS2K) || defined(VBOX_DEVICE_STRUCT_TESTCASE))
32typedef struct PS2K
33{
34 uint8_t abFiller[PS2K_STRUCT_FILLER];
35} PS2K;
36#endif
37
38#if !(defined(IN_PS2M) || defined(VBOX_DEVICE_STRUCT_TESTCASE))
39typedef struct PS2M
40{
41 uint8_t abFiller[PS2M_STRUCT_FILLER];
42} PS2M;
43#endif
44
45/* Internal PS/2 Keyboard interface. */
46typedef struct PS2K *PPS2K;
47
48int PS2KByteToKbd(PPS2K pThis, uint8_t cmd);
49int PS2KByteFromKbd(PPS2K pThis, uint8_t *pVal);
50
51int PS2KConstruct(PPS2K pThis, PPDMDEVINS pDevIns, void *pParent, int iInstance, PCFGMNODE pCfg);
52int PS2KAttach(PPS2K pThis, PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags);
53void PS2KReset(PPS2K pThis);
54void PS2KRelocate(PPS2K pThis, RTGCINTPTR offDelta, PPDMDEVINS pDevIns);
55void PS2KSaveState(PPS2K pThis, PSSMHANDLE pSSM);
56int PS2KLoadState(PPS2K pThis, PSSMHANDLE pSSM, uint32_t uVersion);
57int PS2KLoadDone(PPS2K pThis, PSSMHANDLE pSSM);
58
59PS2K *KBDGetPS2KFromDevIns(PPDMDEVINS pDevIns);
60
61
62/* Internal PS/2 Auxiliary device interface. */
63typedef struct PS2M *PPS2M;
64
65int PS2MByteToAux(PPS2M pThis, uint8_t cmd);
66int PS2MByteFromAux(PPS2M pThis, uint8_t *pVal);
67
68int PS2MConstruct(PPS2M pThis, PPDMDEVINS pDevIns, void *pParent, int iInstance);
69int PS2MAttach(PPS2M pThis, PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags);
70void PS2MReset(PPS2M pThis);
71void PS2MRelocate(PPS2M pThis, RTGCINTPTR offDelta, PPDMDEVINS pDevIns);
72void PS2MSaveState(PPS2M pThis, PSSMHANDLE pSSM);
73int PS2MLoadState(PPS2M pThis, PSSMHANDLE pSSM, uint32_t uVersion);
74void PS2MFixupState(PPS2M pThis, uint8_t u8State, uint8_t u8Rate, uint8_t u8Proto);
75
76PS2M *KBDGetPS2MFromDevIns(PPDMDEVINS pDevIns);
77
78
79/* Shared keyboard/aux internal interface. */
80void KBCUpdateInterrupts(void *pKbc);
81
82
83///@todo: This should live with the KBC implementation.
84/** AT to PC scancode translator state. */
85typedef enum
86{
87 XS_IDLE, /**< Starting state. */
88 XS_BREAK, /**< F0 break byte was received. */
89 XS_HIBIT /**< Break code still active. */
90} xlat_state_t;
91
92int32_t XlateAT2PC(int32_t state, uint8_t scanIn, uint8_t *pScanOut);
93
94#endif /* !VBOX_INCLUDED_SRC_Input_PS2Dev_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette