diff options
author | Avi Kivity <avi@qumranet.com> | 2007-04-22 08:28:19 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-05-03 03:52:31 -0400 |
commit | 4c690a1e8667a84b61a6114a4ad293681f32cb11 (patch) | |
tree | ed5ffaedc83068a7cf791530a2f54483107f3d21 /drivers/kvm/x86_emulate.h | |
parent | 1165f5fec18c077bdba88e7125fd41f8e3617cb4 (diff) |
KVM: Allow passing 64-bit values to the emulated read/write API
This simplifies the API somewhat (by eliminating the special-case
cmpxchg8b on i386).
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86_emulate.h')
-rw-r--r-- | drivers/kvm/x86_emulate.h | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/drivers/kvm/x86_emulate.h b/drivers/kvm/x86_emulate.h index 5d41bd55125e..ea3407d7feee 100644 --- a/drivers/kvm/x86_emulate.h +++ b/drivers/kvm/x86_emulate.h | |||
@@ -59,8 +59,7 @@ struct x86_emulate_ops { | |||
59 | * @val: [OUT] Value read from memory, zero-extended to 'u_long'. | 59 | * @val: [OUT] Value read from memory, zero-extended to 'u_long'. |
60 | * @bytes: [IN ] Number of bytes to read from memory. | 60 | * @bytes: [IN ] Number of bytes to read from memory. |
61 | */ | 61 | */ |
62 | int (*read_std)(unsigned long addr, | 62 | int (*read_std)(unsigned long addr, void *val, |
63 | unsigned long *val, | ||
64 | unsigned int bytes, struct x86_emulate_ctxt * ctxt); | 63 | unsigned int bytes, struct x86_emulate_ctxt * ctxt); |
65 | 64 | ||
66 | /* | 65 | /* |
@@ -71,8 +70,7 @@ struct x86_emulate_ops { | |||
71 | * required). | 70 | * required). |
72 | * @bytes: [IN ] Number of bytes to write to memory. | 71 | * @bytes: [IN ] Number of bytes to write to memory. |
73 | */ | 72 | */ |
74 | int (*write_std)(unsigned long addr, | 73 | int (*write_std)(unsigned long addr, const void *val, |
75 | unsigned long val, | ||
76 | unsigned int bytes, struct x86_emulate_ctxt * ctxt); | 74 | unsigned int bytes, struct x86_emulate_ctxt * ctxt); |
77 | 75 | ||
78 | /* | 76 | /* |
@@ -82,7 +80,7 @@ struct x86_emulate_ops { | |||
82 | * @bytes: [IN ] Number of bytes to read from memory. | 80 | * @bytes: [IN ] Number of bytes to read from memory. |
83 | */ | 81 | */ |
84 | int (*read_emulated) (unsigned long addr, | 82 | int (*read_emulated) (unsigned long addr, |
85 | unsigned long *val, | 83 | void *val, |
86 | unsigned int bytes, | 84 | unsigned int bytes, |
87 | struct x86_emulate_ctxt * ctxt); | 85 | struct x86_emulate_ctxt * ctxt); |
88 | 86 | ||
@@ -94,7 +92,7 @@ struct x86_emulate_ops { | |||
94 | * @bytes: [IN ] Number of bytes to write to memory. | 92 | * @bytes: [IN ] Number of bytes to write to memory. |
95 | */ | 93 | */ |
96 | int (*write_emulated) (unsigned long addr, | 94 | int (*write_emulated) (unsigned long addr, |
97 | unsigned long val, | 95 | const void *val, |
98 | unsigned int bytes, | 96 | unsigned int bytes, |
99 | struct x86_emulate_ctxt * ctxt); | 97 | struct x86_emulate_ctxt * ctxt); |
100 | 98 | ||
@@ -107,29 +105,11 @@ struct x86_emulate_ops { | |||
107 | * @bytes: [IN ] Number of bytes to access using CMPXCHG. | 105 | * @bytes: [IN ] Number of bytes to access using CMPXCHG. |
108 | */ | 106 | */ |
109 | int (*cmpxchg_emulated) (unsigned long addr, | 107 | int (*cmpxchg_emulated) (unsigned long addr, |
110 | unsigned long old, | 108 | const void *old, |
111 | unsigned long new, | 109 | const void *new, |
112 | unsigned int bytes, | 110 | unsigned int bytes, |
113 | struct x86_emulate_ctxt * ctxt); | 111 | struct x86_emulate_ctxt * ctxt); |
114 | 112 | ||
115 | /* | ||
116 | * cmpxchg8b_emulated: Emulate an atomic (LOCKed) CMPXCHG8B operation on an | ||
117 | * emulated/special memory area. | ||
118 | * @addr: [IN ] Linear address to access. | ||
119 | * @old: [IN ] Value expected to be current at @addr. | ||
120 | * @new: [IN ] Value to write to @addr. | ||
121 | * NOTES: | ||
122 | * 1. This function is only ever called when emulating a real CMPXCHG8B. | ||
123 | * 2. This function is *never* called on x86/64 systems. | ||
124 | * 2. Not defining this function (i.e., specifying NULL) is equivalent | ||
125 | * to defining a function that always returns X86EMUL_UNHANDLEABLE. | ||
126 | */ | ||
127 | int (*cmpxchg8b_emulated) (unsigned long addr, | ||
128 | unsigned long old_lo, | ||
129 | unsigned long old_hi, | ||
130 | unsigned long new_lo, | ||
131 | unsigned long new_hi, | ||
132 | struct x86_emulate_ctxt * ctxt); | ||
133 | }; | 113 | }; |
134 | 114 | ||
135 | struct cpu_user_regs; | 115 | struct cpu_user_regs; |