~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to modules/solaris/vmhgfs/backdoor_def.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-03-20 10:19:00 UTC
  • mfrom: (1.1.4 upstream) (2.4.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090320101900-1o604camiubq2de8
Tags: 2009.03.18-154848-2
Correcting patch system depends (Closes: #520493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********************************************************
 
2
 * Copyright (C) 1998 VMware, Inc. All rights reserved.
 
3
 *
 
4
 * The contents of this file are subject to the terms of the Common
 
5
 * Development and Distribution License (the "License") version 1.0
 
6
 * and no later version.  You may not use this file except in
 
7
 * compliance with the License.
 
8
 *
 
9
 * You can obtain a copy of the License at
 
10
 *         http://www.opensource.org/licenses/cddl1.php
 
11
 *
 
12
 * See the License for the specific language governing permissions
 
13
 * and limitations under the License.
 
14
 *
 
15
 *********************************************************/
 
16
 
 
17
/*
 
18
 * backdoor_def.h --
 
19
 *
 
20
 * This contains backdoor defines that can be included from
 
21
 * an assembly language file.
 
22
 */
 
23
 
 
24
 
 
25
 
 
26
#ifndef _BACKDOOR_DEF_H_
 
27
#define _BACKDOOR_DEF_H_
 
28
 
 
29
#define INCLUDE_ALLOW_MODULE
 
30
#define INCLUDE_ALLOW_USERLEVEL
 
31
#define INCLUDE_ALLOW_VMMEXT
 
32
#define INCLUDE_ALLOW_VMCORE
 
33
#define INCLUDE_ALLOW_VMKERNEL
 
34
#include "includeCheck.h"
 
35
 
 
36
/*
 
37
 * If you want to add a new low-level backdoor call for a guest userland
 
38
 * application, please consider using the GuestRpc mechanism instead. --hpreg
 
39
 */
 
40
 
 
41
#define BDOOR_MAGIC 0x564D5868
 
42
 
 
43
/* Low-bandwidth backdoor port. --hpreg */
 
44
 
 
45
#define BDOOR_PORT 0x5658
 
46
 
 
47
#define BDOOR_CMD_GETMHZ                   1
 
48
/*
 
49
 * BDOOR_CMD_APMFUNCTION is used by:
 
50
 *
 
51
 * o The FrobOS code, which instead should either program the virtual chipset
 
52
 *   (like the new BIOS code does, matthias offered to implement that), or not
 
53
 *   use any VM-specific code (which requires that we correctly implement
 
54
 *   "power off on CLI HLT" for SMP VMs, boris offered to implement that)
 
55
 *
 
56
 * o The old BIOS code, which will soon be jettisoned
 
57
 *
 
58
 *  --hpreg
 
59
 */
 
60
#define BDOOR_CMD_APMFUNCTION              2
 
61
#define BDOOR_CMD_GETDISKGEO               3
 
62
#define BDOOR_CMD_GETPTRLOCATION              4
 
63
#define BDOOR_CMD_SETPTRLOCATION              5
 
64
#define BDOOR_CMD_GETSELLENGTH             6
 
65
#define BDOOR_CMD_GETNEXTPIECE             7
 
66
#define BDOOR_CMD_SETSELLENGTH             8
 
67
#define BDOOR_CMD_SETNEXTPIECE             9
 
68
#define BDOOR_CMD_GETVERSION                  10
 
69
#define BDOOR_CMD_GETDEVICELISTELEMENT  11
 
70
#define BDOOR_CMD_TOGGLEDEVICE             12
 
71
#define BDOOR_CMD_GETGUIOPTIONS            13
 
72
#define BDOOR_CMD_SETGUIOPTIONS            14
 
73
#define BDOOR_CMD_GETSCREENSIZE            15
 
74
#define BDOOR_CMD_MONITOR_CONTROL       16
 
75
#define BDOOR_CMD_GETHWVERSION          17
 
76
#define BDOOR_CMD_OSNOTFOUND            18
 
77
#define BDOOR_CMD_GETUUID               19
 
78
#define BDOOR_CMD_GETMEMSIZE            20
 
79
#define BDOOR_CMD_HOSTCOPY              21 /* Devel only */
 
80
#define BDOOR_CMD_SERVICE_VM            22 /* prototype only */         
 
81
#define BDOOR_CMD_GETTIME               23 /* Deprecated. Use GETTIMEFULL. */
 
82
#define BDOOR_CMD_STOPCATCHUP           24
 
83
#define BDOOR_CMD_PUTCHR                25 /* Devel only */
 
84
#define BDOOR_CMD_ENABLE_MSG            26 /* Devel only */
 
85
#define BDOOR_CMD_GOTO_TCL              27 /* Devel only */
 
86
#define BDOOR_CMD_INITPCIOPROM          28
 
87
#define BDOOR_CMD_INT13                 29
 
88
#define BDOOR_CMD_MESSAGE               30
 
89
#define BDOOR_CMD_RSVD0                 31
 
90
#define BDOOR_CMD_RSVD1                 32
 
91
#define BDOOR_CMD_RSVD2                 33
 
92
#define BDOOR_CMD_ISACPIDISABLED        34
 
93
#define BDOOR_CMD_TOE                   35 /* Not in use */
 
94
#define BDOOR_CMD_ISMOUSEABSOLUTE       36
 
95
#define BDOOR_CMD_PATCH_SMBIOS_STRUCTS  37
 
96
#define BDOOR_CMD_MAPMEM                38 /* Devel only */
 
97
#define BDOOR_CMD_ABSPOINTER_DATA       39
 
98
#define BDOOR_CMD_ABSPOINTER_STATUS     40
 
99
#define BDOOR_CMD_ABSPOINTER_COMMAND    41
 
100
#define BDOOR_CMD_TIMER_SPONGE          42
 
101
#define BDOOR_CMD_PATCH_ACPI_TABLES     43
 
102
/* Catch-all to allow synchronous tests */
 
103
#define BDOOR_CMD_DEVEL_FAKEHARDWARE    44 /* Debug only - needed in beta */
 
104
#define BDOOR_CMD_GETHZ                 45
 
105
#define BDOOR_CMD_GETTIMEFULL           46
 
106
#define BDOOR_CMD_STATELOGGER           47
 
107
#define BDOOR_CMD_CHECKFORCEBIOSSETUP   48
 
108
#define BDOOR_CMD_LAZYTIMEREMULATION    49
 
109
#define BDOOR_CMD_BIOSBBS               50
 
110
#define BDOOR_CMD_VASSERT               51
 
111
#define BDOOR_CMD_ISGOSDARWIN           52
 
112
#define BDOOR_CMD_DEBUGEVENT            53
 
113
#define BDOOR_CMD_OSNOTMACOSXSERVER     54
 
114
#define BDOOR_CMD_GETTIMEFULL_WITH_LAG  55
 
115
#define BDOOR_CMD_ACPI_HOTPLUG_DEVICE   56
 
116
#define BDOOR_CMD_ACPI_HOTPLUG_MEMORY   57
 
117
#define BDOOR_CMD_ACPI_HOTPLUG_CBRET    58
 
118
#define BDOOR_CMD_GET_HOST_VIDEO_MODES  59
 
119
#define BDOOR_CMD_ACPI_HOTPLUG_CPU      60
 
120
#define BDOOR_CMD_MAX                   61
 
121
 
 
122
/* 
 
123
 * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command,
 
124
 * you must adhere to the semantics expected by the oldest Tools who use that
 
125
 * command. Specifically, do not alter the way in which the command modifies 
 
126
 * the registers. Otherwise backwards compatibility will suffer.
 
127
 */
 
128
 
 
129
/* High-bandwidth backdoor port. --hpreg */
 
130
 
 
131
#define BDOORHB_PORT 0x5659
 
132
 
 
133
#define BDOORHB_CMD_MESSAGE 0
 
134
#define BDOORHB_CMD_VASSERT 1
 
135
#define BDOORHB_CMD_MAX 2
 
136
 
 
137
/*
 
138
 * There is another backdoor which allows access to certain TSC-related
 
139
 * values using otherwise illegal PMC indices when the pseudo_perfctr
 
140
 * control flag is set.
 
141
 */
 
142
 
 
143
#define BDOOR_PMC_HW_TSC      0x10000
 
144
#define BDOOR_PMC_REAL_NS     0x10001
 
145
#define BDOOR_PMC_APPARENT_NS 0x10002
 
146
 
 
147
#define IS_BDOOR_PMC(index)  (((index) | 3) == 0x10003)
 
148
#define BDOOR_CMD(ecx)       ((ecx) & 0xffff)
 
149
 
 
150
 
 
151
#ifdef VMM
 
152
/*
 
153
 *----------------------------------------------------------------------
 
154
 *
 
155
 * Backdoor_CmdRequiresFullyValidVCPU --
 
156
 *
 
157
 *    A few backdoor commands require the full VCPU to be valid
 
158
 *    (including GDTR, IDTR, TR and LDTR). The rest get read/write
 
159
 *    access to GPRs and read access to Segment registers (selectors).
 
160
 *
 
161
 * Result:
 
162
 *    True iff VECX contains a command that require the full VCPU to
 
163
 *    be valid.
 
164
 *
 
165
 *----------------------------------------------------------------------
 
166
 */
 
167
static INLINE Bool
 
168
Backdoor_CmdRequiresFullyValidVCPU(unsigned cmd)
 
169
{
 
170
   return cmd == BDOOR_CMD_RSVD0 ||
 
171
          cmd == BDOOR_CMD_RSVD1 ||
 
172
          cmd == BDOOR_CMD_RSVD2;
 
173
}
 
174
#endif
 
175
 
 
176
#endif