aboutsummaryrefslogtreecommitdiff
path: root/linux-user/ioctls.h
diff options
context:
space:
mode:
authorFilip Bozuta <Filip.Bozuta@rt-rk.com>2020-01-15 20:36:39 +0100
committerLaurent Vivier <laurent@vivier.eu>2020-01-22 15:20:51 +0100
commit373b067ff077d92bf23abd2224b49cccf5dea846 (patch)
treebf0193c1e990c9f67785b6ca5ecbb383b60668d7 /linux-user/ioctls.h
parentabc81bf678941abfb1c003e71cc833bd8b46c7c6 (diff)
downloadqemu-373b067ff077d92bf23abd2224b49cccf5dea846.zip
qemu-373b067ff077d92bf23abd2224b49cccf5dea846.tar.gz
qemu-373b067ff077d92bf23abd2224b49cccf5dea846.tar.bz2
linux-user: Add support for getting/setting RTC PLL correction using ioctls
This patch implements functionalities of following ioctls: RTC_PLL_GET - Getting PLL correction Read the PLL correction for RTCs that support PLL. The PLL correction is returned in the following structure: struct rtc_pll_info { int pll_ctrl; /* placeholder for fancier control */ int pll_value; /* get/set correction value */ int pll_max; /* max +ve (faster) adjustment value */ int pll_min; /* max -ve (slower) adjustment value */ int pll_posmult; /* factor for +ve correction */ int pll_negmult; /* factor for -ve correction */ long pll_clock; /* base PLL frequency */ }; A pointer to this structure should be passed as the third ioctl's argument. RTC_PLL_SET - Setting PLL correction Sets the PLL correction for RTCs that support PLL. The PLL correction that is set is specified by the rtc_pll_info structure pointed to by the third ioctl's' argument. Implementation notes: All ioctls in this patch have a pointer to a structure rtc_pll_info as their third argument. All elements of this structure are of type 'int', except the last one that is of type 'long'. That is the reason why a separate target structure (target_rtc_pll_info) is defined in linux-user/syscall_defs. The rest of the implementation is straightforward. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com> Message-Id: <1579117007-7565-6-git-send-email-Filip.Bozuta@rt-rk.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/ioctls.h')
-rw-r--r--linux-user/ioctls.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index e4c1fbf..789764d 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -87,6 +87,8 @@
IOCTL(RTC_EPOCH_SET, IOC_W, TYPE_ULONG)
IOCTL(RTC_WKALM_RD, IOC_R, MK_PTR(MK_STRUCT(STRUCT_rtc_wkalrm)))
IOCTL(RTC_WKALM_SET, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtc_wkalrm)))
+ IOCTL(RTC_PLL_GET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_rtc_pll_info)))
+ IOCTL(RTC_PLL_SET, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtc_pll_info)))
IOCTL(BLKROSET, IOC_W, MK_PTR(TYPE_INT))
IOCTL(BLKROGET, IOC_R, MK_PTR(TYPE_INT))