Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at f2aeea57504cbbc58da3c59b939fc16150087648 28 lines 533 B view raw
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Virtual PTP 1588 clock for use with KVM guests 4 * Copyright (C) 2019 ARM Ltd. 5 * All Rights Reserved 6 */ 7 8#include <linux/arm-smccc.h> 9#include <linux/ptp_kvm.h> 10 11#include <asm/arch_timer.h> 12#include <asm/hypervisor.h> 13 14int kvm_arch_ptp_init(void) 15{ 16 int ret; 17 18 ret = kvm_arm_hyp_service_available(ARM_SMCCC_KVM_FUNC_PTP); 19 if (ret <= 0) 20 return -EOPNOTSUPP; 21 22 return 0; 23} 24 25int kvm_arch_ptp_get_clock(struct timespec64 *ts) 26{ 27 return kvm_arch_ptp_get_crosststamp(NULL, ts, NULL); 28}