qemu-patch-raspberry4/linux-user
Filip Bozuta abc81bf678 linux-user: Add support for getting/setting RTC wakeup alarm using ioctls
This patch implements functionalities of following ioctls:

RTC_WKALM_SET, RTC_WKALM_GET - Getting/Setting wakeup alarm

    Some RTCs support a more powerful alarm interface, using these
    ioctls to read or write the RTC's alarm time (respectively)
    with this structure:

        struct rtc_wkalrm {
            unsigned char enabled;
            unsigned char pending;
            struct rtc_time time;
        };

    The enabled flag is used to enable or disable the alarm
    interrupt, or to read its current status; when using these
    calls, RTC_AIE_ON and RTC_AIE_OFF are not used. The pending
    flag is used by RTC_WKALM_RD to report a pending interrupt
    (so it's mostly useless on Linux, except when talking to the
    RTC managed by EFI firmware). The time field is as used with
    RTC_ALM_READ and RTC_ALM_SET except that the tm_mday, tm_mon,
    and tm_year fields are also valid. A pointer to this structure
    should be passed as the third ioctl's argument.

Implementation notes:

    All ioctls in this patch have a pointer to a structure
    rtc_wkalrm as their third argument. That is the reason why
    corresponding definition is added in linux-user/syscall_types.h.
    Since all  elements of this structure are either of type
    'unsigned char' or 'struct rtc_time' (that was covered in one
    of previous patches), 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-5-git-send-email-Filip.Bozuta@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-01-22 15:20:11 +01:00
..
aarch64 target/arm: only update pc after semihosting completes 2020-01-09 11:41:29 +00:00
alpha linux-user/alpha: Set r20 secondary return value 2019-11-06 13:45:05 +01:00
arm semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
cris linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
generic linux-user: Introduce TARGET_HAVE_ARCH_STRUCT_FLOCK 2019-07-02 16:56:46 +02:00
host linux-user: Add safe_syscall for riscv64 host 2018-12-26 06:40:02 +11:00
hppa linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
i386 linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
m68k linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
microblaze linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
mips linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
mips64 Supply missing header guards 2019-06-12 13:20:21 +02:00
nios2 linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
openrisc linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
ppc target/ppc: Implement the VTB for HV access 2019-12-17 10:39:48 +11:00
riscv linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
s390x linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
sh4 linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
sparc linux-user/sparc: Fix cpu_clone_regs_* 2019-11-06 13:44:19 +01:00
sparc64 Supply missing header guards 2019-06-12 13:20:21 +02:00
tilegx linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
x86_64 Supply missing header guards 2019-06-12 13:20:21 +02:00
xtensa linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
cpu_loop-common.h cpu: Replace ENV_GET_CPU with env_cpu 2019-06-10 07:03:34 -07:00
elfload.c linux-user: Reserve space for brk 2020-01-22 15:00:03 +01:00
errno_defs.h Supply missing header guards 2019-06-12 13:20:21 +02:00
exit.c *-user: notify plugin of exit 2019-10-28 15:12:38 +00:00
fd-trans.c Fix unsigned integer underflow in fd-trans.c 2019-10-21 11:34:18 +02:00
fd-trans.h linux-user: move TargetFdTrans functions to their own file 2018-09-25 22:36:47 +02:00
flat.h Supply missing header guards 2019-06-12 13:20:21 +02:00
flatload.c linux-user/flatload: fix initial stack pointer alignment 2018-10-30 11:23:32 -07:00
ioctls.h linux-user: Add support for getting/setting RTC wakeup alarm using ioctls 2020-01-22 15:20:11 +01:00
linux_loop.h linux-user: Add loop control ioctls 2016-07-19 15:22:33 +03:00
linuxload.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
main.c tcg: Search includes from the project root source directory 2020-01-15 15:13:10 -10:00
Makefile.objs linux-user/m68k: remove simulator syscall interface 2019-06-26 17:14:41 +02:00
mmap.c linux-user: convert target_munmap debug to a tracepoint 2019-12-19 08:20:16 +00:00
qemu.h linux-user: Reserve space for brk 2020-01-22 15:00:03 +01:00
safe-syscall.S linux-user: Provide safe_syscall for fixing races between signals and syscalls 2016-05-27 14:49:51 +03:00
signal-common.h linux-user: Make sigaltstack stacks per-thread 2019-07-26 19:24:33 +02:00
signal.c linux-user: Make sigaltstack stacks per-thread 2019-07-26 19:24:33 +02:00
socket.h Supply missing header guards 2019-06-12 13:20:21 +02:00
strace.c linux-user/strace: Let print_sockaddr() have a 'last' argument 2019-10-21 15:37:04 +02:00
strace.list linux-user/strace: Improve bind() output 2019-10-21 15:37:04 +02:00
syscall.c linux-user: Add support for enabling/disabling RTC features using ioctls 2020-01-22 15:18:21 +01:00
syscall_defs.h linux-user: Add support for getting/setting RTC wakeup alarm using ioctls 2020-01-22 15:20:11 +01:00
syscall_types.h linux-user: Add support for getting/setting RTC wakeup alarm using ioctls 2020-01-22 15:20:11 +01:00
target_flat.h Supply missing header guards 2019-06-12 13:20:21 +02:00
trace-events linux-user: convert target_munmap debug to a tracepoint 2019-12-19 08:20:16 +00:00
uaccess.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
uname.c cpu: Replace ENV_GET_CPU with env_cpu 2019-06-10 07:03:34 -07:00
uname.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
vm86.c target/i386: Use env_cpu, env_archcpu 2019-06-10 07:03:42 -07:00