VirtualBox

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

Last change on this file since 45020 was 44806, checked in by vboxsync, 12 years ago

DevPS2.cpp++: Drop two critsects in favor of the default device critsect. This is simpler and avoid confusion as to the locking saftety of the PS2KByteFromKbd and PS2KByteToKbd interfaces exposed by PS2K and used by DevPS2. Misc cleanups (didn't do a full cleanup, sorry).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1/** @file
2 * PS/2 devices - Internal header file.
3 */
4
5/*
6 * Copyright (C) 2007-2012 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 */
16
17#ifndef PS2DEV_H
18#define PS2DEV_H
19
20/** The size of the PS2K structure filler.
21 * @note Must be at least as big as the real struct. Compile time assert
22 * makes sure this is so. */
23#define PS2K_STRUCT_FILLER 512
24
25/* Hide the internal structure. */
26#if !(defined(IN_PS2K) || defined(VBOX_DEVICE_STRUCT_TESTCASE))
27typedef struct PS2K
28{
29 uint8_t abFiller[PS2K_STRUCT_FILLER];
30} PS2K;
31#endif
32
33typedef struct PS2K *PPS2K;
34
35int PS2KByteToKbd(PPS2K pThis, uint8_t cmd);
36int PS2KByteFromKbd(PPS2K pThis, uint8_t *pVal);
37
38int PS2KConstruct(PPS2K pThis, PPDMDEVINS pDevIns, void *pParent, int iInstance);
39int PS2KAttach(PPS2K pThis, PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags);
40void PS2KReset(PPS2K pThis);
41void PS2KRelocate(PPS2K pThis, RTGCINTPTR offDelta, PPDMDEVINS pDevIns);
42void PS2KSaveState(PPS2K pThis, PSSMHANDLE pSSM);
43int PS2KLoadState(PPS2K pThis, PSSMHANDLE pSSM, uint32_t uVersion);
44
45void KBCUpdateInterrupts(void *pKbc);
46
47PS2K *KBDGetPS2KFromDevIns(PPDMDEVINS pDevIns);
48
49///@todo: This should live with the KBC implementation.
50/** AT to PC scancode translator state. */
51typedef enum
52{
53 XS_IDLE, /**< Starting state. */
54 XS_BREAK, /**< F0 break byte was received. */
55 XS_HIBIT /**< Break code still active. */
56} xlat_state_t;
57
58int32_t XlateAT2PC(int32_t state, uint8_t scanIn, uint8_t *pScanOut);
59
60#endif
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