VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMGC/IOMGC.cpp@ 2483

Last change on this file since 2483 was 2231, checked in by vboxsync, 18 years ago

Partial 20576 commit

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/* $Id: IOMGC.cpp 2231 2007-04-19 14:02:03Z vboxsync $ */
2/** @file
3 * IOM - Input / Output Monitor - Guest Context.
4 */
5
6/*
7 * Copyright (C) 2006 InnoTek Systemberatung GmbH
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 as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * If you received this file as part of a commercial VirtualBox
18 * distribution, then only the terms of your commercial VirtualBox
19 * license agreement apply instead of the previous paragraph.
20 */
21
22
23/*******************************************************************************
24* Header Files *
25*******************************************************************************/
26#define LOG_GROUP LOG_GROUP_IOM
27#include <VBox/iom.h>
28#include <VBox/cpum.h>
29#include <VBox/pgm.h>
30#include <VBox/selm.h>
31#include <VBox/mm.h>
32#include <VBox/em.h>
33#include <VBox/pgm.h>
34#include <VBox/trpm.h>
35#include "IOMInternal.h"
36#include <VBox/vm.h>
37
38#include <VBox/dis.h>
39#include <VBox/disopcode.h>
40#include <VBox/param.h>
41#include <VBox/err.h>
42#include <iprt/assert.h>
43#include <VBox/log.h>
44#include <iprt/asm.h>
45#include <iprt/string.h>
46
47
48
49/**
50 * Attempts to service an IN/OUT instruction.
51 *
52 * The \#GP trap handler in GC will call this function if the opcode causing the
53 * trap is a in or out type instruction.
54 *
55 * @returns VBox status code.
56 *
57 * @param pVM The virtual machine (GC pointer ofcourse).
58 * @param pRegFrame Pointer to CPUMCTXCORE guest registers structure.
59 * @param pCpu Disassembler CPU state.
60 */
61IOMGCDECL(int) IOMGCIOPortHandler(PVM pVM, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu)
62{
63 switch (pCpu->pCurInstr->opcode)
64 {
65 case OP_IN:
66 return IOMInterpretIN(pVM, pRegFrame, pCpu);
67
68 case OP_OUT:
69 return IOMInterpretOUT(pVM, pRegFrame, pCpu);
70
71 case OP_INSB:
72 case OP_INSWD:
73 return IOMInterpretINS(pVM, pRegFrame, pCpu);
74
75 case OP_OUTSB:
76 case OP_OUTSWD:
77 return IOMInterpretOUTS(pVM, pRegFrame, pCpu);
78
79 /*
80 * The opcode wasn't know to us, freak out.
81 */
82 default:
83 AssertMsgFailed(("Unknown I/O port access opcode %d.\n", pCpu->pCurInstr->opcode));
84 return VERR_INTERNAL_ERROR;
85 }
86}
87
Note: See TracBrowser for help on using the repository browser.

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