staging: unisys: visorbus: move unisys_vmcall into visorchipset
The only one using unisys_vmcall was visorchipset.c, it can be moved into the visorchipset file directly instead of being in a header file. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fd1040997b
commit
88845f407c
@ -1354,6 +1354,25 @@ chipset_notready_uevent(struct controlvm_message_header *msg_hdr)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int unisys_vmcall(unsigned long tuple, unsigned long param)
|
||||||
|
{
|
||||||
|
int result = 0;
|
||||||
|
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
|
||||||
|
unsigned long reg_ebx;
|
||||||
|
unsigned long reg_ecx;
|
||||||
|
|
||||||
|
reg_ebx = param & 0xFFFFFFFF;
|
||||||
|
reg_ecx = param >> 32;
|
||||||
|
|
||||||
|
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
|
||||||
|
if (!(cpuid_ecx & 0x80000000))
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
|
__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
|
||||||
|
"a"(tuple), "b"(reg_ebx), "c"(reg_ecx));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
static unsigned int
|
static unsigned int
|
||||||
issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes)
|
issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes)
|
||||||
{
|
{
|
||||||
@ -1362,7 +1381,7 @@ issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes)
|
|||||||
u64 physaddr;
|
u64 physaddr;
|
||||||
|
|
||||||
physaddr = virt_to_phys(¶ms);
|
physaddr = virt_to_phys(¶ms);
|
||||||
unisys_vmcall(VMCALL_CONTROLVM_ADDR, physaddr, result);
|
result = unisys_vmcall(VMCALL_CONTROLVM_ADDR, physaddr);
|
||||||
if (VMCALL_SUCCESSFUL(result)) {
|
if (VMCALL_SUCCESSFUL(result)) {
|
||||||
*control_addr = params.address;
|
*control_addr = params.address;
|
||||||
*control_bytes = params.channel_bytes;
|
*control_bytes = params.channel_bytes;
|
||||||
|
@ -20,22 +20,6 @@
|
|||||||
* Virtualization. The VMCALLs are provided by Monitor and used by s-Par
|
* Virtualization. The VMCALLs are provided by Monitor and used by s-Par
|
||||||
* drivers running in a Linux guest partition.
|
* drivers running in a Linux guest partition.
|
||||||
*/
|
*/
|
||||||
static inline unsigned long
|
|
||||||
__unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
|
|
||||||
unsigned long reg_ecx)
|
|
||||||
{
|
|
||||||
unsigned long result = 0;
|
|
||||||
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
|
|
||||||
|
|
||||||
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
|
|
||||||
if (!(cpuid_ecx & 0x80000000))
|
|
||||||
return -EPERM;
|
|
||||||
|
|
||||||
__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
|
|
||||||
"a"(tuple), "b"(reg_ebx), "c"(reg_ecx));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned long
|
static inline unsigned long
|
||||||
__unisys_extended_vmcall_gnuc(unsigned long long tuple,
|
__unisys_extended_vmcall_gnuc(unsigned long long tuple,
|
||||||
unsigned long long reg_ebx,
|
unsigned long long reg_ebx,
|
||||||
@ -83,9 +67,6 @@ enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */
|
|||||||
|
|
||||||
#define unisys_extended_vmcall(tuple, reg_ebx, reg_ecx, reg_edx) \
|
#define unisys_extended_vmcall(tuple, reg_ebx, reg_ecx, reg_edx) \
|
||||||
__unisys_extended_vmcall_gnuc(tuple, reg_ebx, reg_ecx, reg_edx)
|
__unisys_extended_vmcall_gnuc(tuple, reg_ebx, reg_ecx, reg_edx)
|
||||||
#define unisys_vmcall(method, param, result) \
|
|
||||||
(result = __unisys_vmcall_gnuc((method), (param) & 0xFFFFFFFF, \
|
|
||||||
(param) >> 32))
|
|
||||||
|
|
||||||
/* Structures for IO VMCALLs */
|
/* Structures for IO VMCALLs */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user