vmcs_intel_x64_32bit_host_state_field.h
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef VMCS_INTEL_X64_32BIT_HOST_STATE_FIELD_H
23 #define VMCS_INTEL_X64_32BIT_HOST_STATE_FIELD_H
24 
25 #include <vmcs/vmcs_intel_x64.h>
26 
33 
34 // *INDENT-OFF*
35 
36 namespace intel_x64
37 {
38 namespace vmcs
39 {
40 
41 namespace host_ia32_sysenter_cs
42 {
43  constexpr const auto addr = 0x0000000000004C00UL;
44  constexpr const auto name = "host_ia32_sysenter_cs";
45 
46  inline bool exists() noexcept
47  { return true; }
48 
49  inline auto get()
50  { return get_vmcs_field(addr, name, exists()); }
51 
52  inline auto get_if_exists(bool verbose = false) noexcept
53  { return get_vmcs_field_if_exists(addr, name, verbose, exists()); }
54 
55  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
56  void set(T val) { set_vmcs_field(val, addr, name, exists()); }
57 
58  template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
59  void set_if_exists(T val, bool verbose = false) noexcept
60  { set_vmcs_field_if_exists(val, addr, name, verbose, exists()); }
61 }
62 
63 }
64 }
65 
66 // *INDENT-ON*
67 
68 #endif
auto get_vmcs_field_if_exists(T addr, const char *name, bool verbose, bool exists)
auto set_vmcs_field_if_exists(V val, A addr, const char *name, bool verbose, bool exists) noexcept
void uint64_t uint64_t uint64_t *rdx noexcept
auto set_vmcs_field(V val, A addr, const char *name, bool exists)
auto get_vmcs_field(T addr, const char *name, bool exists)
void set_if_exists(T val, bool verbose=false) noexcept