diff options
author | Alexey Makhalov <alexey.makhalov@broadcom.com> | 2024-06-13 12:16:44 -0700 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2024-06-25 17:15:47 +0200 |
commit | 54651bb4dcfea0949afe72775212511ec4193b85 (patch) | |
tree | 5904001fc44b7fd10b29d8f63ef937424a4dc5b6 /drivers/ptp | |
parent | 34bf25e820ae1ab38f9cd88834843ba76678a2fd (diff) | |
download | lwn-54651bb4dcfea0949afe72775212511ec4193b85.tar.gz lwn-54651bb4dcfea0949afe72775212511ec4193b85.zip |
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 <alexey.makhalov@broadcom.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240613191650.9913-3-alexey.makhalov@broadcom.com
Diffstat (limited to 'drivers/ptp')
-rw-r--r-- | drivers/ptp/ptp_vmw.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c index 7ec90359428a..20ab05c4daa8 100644 --- a/drivers/ptp/ptp_vmw.c +++ b/drivers/ptp/ptp_vmw.c @@ -14,7 +14,6 @@ #include <asm/hypervisor.h> #include <asm/vmware.h> -#define VMWARE_MAGIC 0x564D5868 #define VMWARE_CMD_PCLK(nr) ((nr << 16) | 97) #define VMWARE_CMD_PCLK_GETTIME VMWARE_CMD_PCLK(0) @@ -24,15 +23,10 @@ static struct ptp_clock *ptp_vmw_clock; static int ptp_vmw_pclk_read(u64 *ns) { - u32 ret, nsec_hi, nsec_lo, unused1, unused2, unused3; - - asm volatile (VMWARE_HYPERCALL : - "=a"(ret), "=b"(nsec_hi), "=c"(nsec_lo), "=d"(unused1), - "=S"(unused2), "=D"(unused3) : - "a"(VMWARE_MAGIC), "b"(0), - "c"(VMWARE_CMD_PCLK_GETTIME), "d"(0) : - "memory"); + u32 ret, nsec_hi, nsec_lo; + ret = vmware_hypercall3(VMWARE_CMD_PCLK_GETTIME, 0, + &nsec_hi, &nsec_lo); if (ret == 0) *ns = ((u64)nsec_hi << 32) | nsec_lo; return ret; |