base: extend Vcpu_state for base-hw x86 virtualization

Changes are preliminary and will most certainly be removed when fully
enabling the virtualization feature on base-hw.

Ref #4826
This commit is contained in:
Benjamin Lamowski 2023-05-02 19:30:20 +02:00 committed by Christian Helmuth
parent 1e3836f8b5
commit b277b84e19

View File

@ -2,11 +2,12 @@
* \brief Virtual CPU context for x86 * \brief Virtual CPU context for x86
* \author Alexander Boettcher * \author Alexander Boettcher
* \author Christian Helmuth * \author Christian Helmuth
* \author Benjamin Lamowski
* \date 2018-10-09 * \date 2018-10-09
*/ */
/* /*
* Copyright (C) 2018-2021 Genode Labs GmbH * Copyright (C) 2018-2023 Genode Labs GmbH
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3. * under the terms of the GNU Affero General Public License version 3.
@ -81,6 +82,26 @@ class Genode::Vcpu_state
_charged = true; _charged = true;
_value = value; _value = value;
} }
/*
* Charge without changing value
*
* \noapi
*/
void set_charged() { _charged = true; }
/*
* Update value if not yet charged
*
* \noapi
*/
void update(T const &value)
{
if (!_charged) {
_value = value;
_charged = true;
}
}
}; };
struct Range struct Range