cpu: Add CPUArchState pointer to CPUState
The target-specific ENV_GET_CPU() macros have allowed us to navigate from CPUArchState to CPUState. The reverse direction was not supported. Avoid introducing CPU_GET_ENV() macros by initializing an untyped pointer that is initialized in derived instance_init functions. The field may not be called "env" due to it being poisoned. Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
1 parent
907a5e32f2
commit
c05efcb18e
16 files changed
+31
No files matched your search
@@ -71,6 +71,7 @@ struct kvm_run;
|
||||
* @created: Indicates whether the CPU thread has been successfully created.
|
||||
* @stop: Indicates a pending stop request.
|
||||
* @stopped: Indicates the CPU has been artificially stopped.
|
||||
* @env_ptr: Pointer to subclass-specific CPUArchState field.
|
||||
* @current_tb: Currently executing TB.
|
||||
* @kvm_fd: vCPU file descriptor for KVM.
|
||||
*
|
||||
@@ -100,6 +101,7 @@ struct CPUState {
|
||||
bool stopped;
|
||||
volatile sig_atomic_t exit_request;
|
||||
|
||||
void *env_ptr; /* CPUArchState */
|
||||
struct TranslationBlock *current_tb;
|
||||
|
||||
int kvm_fd;
|
||||
|
||||
Reference in new issue
Block a user