|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH 4/4] hw/i386: Make vmmouse helpers static |
Date: | Tue, 5 May 2020 07:36:37 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 5/4/20 7:29 PM, Richard Henderson wrote:
On 5/4/20 1:33 AM, Philippe Mathieu-Daudé wrote:+++ b/hw/i386/vmport.c @@ -23,10 +23,10 @@ */ #include "qemu/osdep.h" #include "hw/isa/isa.h" -#include "hw/i386/pc.h" #include "sysemu/hw_accel.h" #include "qemu/log.h" #include "vmport.h" +#include "cpu.h" #include "trace.h"#define VMPORT_CMD_GETVERSION 0x0a@@ -109,27 +109,6 @@ static uint32_t vmport_cmd_ram_size(void *opaque, uint32_t addr) return ram_size; }-/* vmmouse helpers */-void vmmouse_get_data(uint32_t *data) -{ - X86CPU *cpu = X86_CPU(current_cpu); - CPUX86State *env = &cpu->env; - - data[0] = env->regs[R_EAX]; data[1] = env->regs[R_EBX]; - data[2] = env->regs[R_ECX]; data[3] = env->regs[R_EDX]; - data[4] = env->regs[R_ESI]; data[5] = env->regs[R_EDI]; -}Why are you adding "cpu.h" when removing code?
Because this file still use the X86 register definitions: static uint32_t vmport_cmd_get_version(void *opaque, uint32_t addr) { X86CPU *cpu = X86_CPU(current_cpu); cpu->env.regs[R_EBX] = VMPORT_MAGIC; return 6; }
Does that mean you don't need to add "cpu.h" to vmmouse.c?
Now both files vmmouse/vmport uses the X86 register definitions, but they don't use anything declared in "hw/i386/pc.h".
r~
[Prev in Thread] | Current Thread | [Next in Thread] |