]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user: Add support for getting/setting RTC PLL correction using ioctls
authorFilip Bozuta <Filip.Bozuta@rt-rk.com>
Wed, 15 Jan 2020 19:36:39 +0000 (20:36 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Wed, 22 Jan 2020 14:20:51 +0000 (15:20 +0100)
commit373b067ff077d92bf23abd2224b49cccf5dea846
treebf0193c1e990c9f67785b6ca5ecbb383b60668d7
parentabc81bf678941abfb1c003e71cc833bd8b46c7c6
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>
linux-user/ioctls.h
linux-user/syscall_defs.h
linux-user/syscall_types.h