Skip to content

Commit 54651bb

Browse files
YustasSwampbp3tk0v
authored andcommitted
ptp/vmware: Use VMware hypercall API
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 34bf25e commit 54651bb

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/ptp/ptp_vmw.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <asm/hypervisor.h>
1515
#include <asm/vmware.h>
1616

17-
#define VMWARE_MAGIC 0x564D5868
1817
#define VMWARE_CMD_PCLK(nr) ((nr << 16) | 97)
1918
#define VMWARE_CMD_PCLK_GETTIME VMWARE_CMD_PCLK(0)
2019

@@ -24,15 +23,10 @@ static struct ptp_clock *ptp_vmw_clock;
2423

2524
static int ptp_vmw_pclk_read(u64 *ns)
2625
{
27-
u32 ret, nsec_hi, nsec_lo, unused1, unused2, unused3;
28-
29-
asm volatile (VMWARE_HYPERCALL :
30-
"=a"(ret), "=b"(nsec_hi), "=c"(nsec_lo), "=d"(unused1),
31-
"=S"(unused2), "=D"(unused3) :
32-
"a"(VMWARE_MAGIC), "b"(0),
33-
"c"(VMWARE_CMD_PCLK_GETTIME), "d"(0) :
34-
"memory");
26+
u32 ret, nsec_hi, nsec_lo;
3527

28+
ret = vmware_hypercall3(VMWARE_CMD_PCLK_GETTIME, 0,
29+
&nsec_hi, &nsec_lo);
3630
if (ret == 0)
3731
*ns = ((u64)nsec_hi << 32) | nsec_lo;
3832
return ret;

0 commit comments

Comments
 (0)