src/hotspot/share/utilities/virtualizationSupport.hpp
author stefank
Mon, 25 Nov 2019 12:33:15 +0100
changeset 59252 623722a6aeb9
parent 54852 ddb27517396c
permissions -rw-r--r--
8234740: Harmonize parameter order in Atomic - cmpxchg Reviewed-by: rehn, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54852
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     1
/*
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     3
 * Copyright (c) 2019 SAP SE. All rights reserved.
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     5
 *
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     8
 * published by the Free Software Foundation.
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
     9
 *
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    14
 * accompanied this code).
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    15
 *
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    19
 *
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    22
 * questions.
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    23
 *
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    24
 */
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    25
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    26
#ifndef SHARE_UTILITIES_VIRTUALIZATIONSUPPORT_HPP
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    27
#define SHARE_UTILITIES_VIRTUALIZATIONSUPPORT_HPP
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    28
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    29
#include "utilities/ostream.hpp"
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    30
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    31
typedef enum {
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    32
  VMGUESTLIB_ERROR_SUCCESS = 0, // no error occured
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    33
  VMGUESTLIB_ERROR_OTHER,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    34
  VMGUESTLIB_ERROR_NOT_RUNNING_IN_VM,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    35
  VMGUESTLIB_ERROR_NOT_ENABLED,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    36
  VMGUESTLIB_ERROR_NOT_AVAILABLE,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    37
  VMGUESTLIB_ERROR_NO_INFO,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    38
  VMGUESTLIB_ERROR_MEMORY,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    39
  VMGUESTLIB_ERROR_BUFFER_TOO_SMALL,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    40
  VMGUESTLIB_ERROR_INVALID_HANDLE,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    41
  VMGUESTLIB_ERROR_INVALID_ARG,
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    42
  VMGUESTLIB_ERROR_UNSUPPORTED_VERSION
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    43
} VMGuestLibError;
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    44
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    45
// new SDK functions from VMWare SDK 6.0; need VMware Tools version 9.10 installed
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    46
typedef VMGuestLibError (*GuestLib_StatGet_t)(const char*, const char*, char**, size_t*);
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    47
typedef VMGuestLibError (*GuestLib_StatFree_t)(char*, size_t);
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    48
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    49
class VirtualizationSupport {
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    50
 public:
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    51
  static void initialize();
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    52
  static void print_virtualization_info(outputStream* st);
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    53
};
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    54
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    55
#endif
ddb27517396c 8222720: Provide extended VMWare/vSphere virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
diff changeset
    56