[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 17/20] linux-user: Add support for FDGETFDCSTAT ioctl
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v5 17/20] linux-user: Add support for FDGETFDCSTAT ioctl |
Date: |
Tue, 14 Jan 2020 15:42:02 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 |
Le 13/01/2020 à 21:34, Aleksandar Markovic a écrit :
> From: Aleksandar Markovic <address@hidden>
>
> FDGETFDCSTAT's third agrument is a pointer to the structure:
>
> struct floppy_fdc_state {
> int spec1;
> int spec2;
> int dtr;
> unsigned char version;
> unsigned char dor;
> unsigned long address;
> unsigned int rawcmd:2;
> unsigned int reset:1;
> unsigned int need_configure:1;
> unsigned int perp_mode:2;
> unsigned int has_fifo:1;
> unsigned int driver_version;
> unsigned char track[4];
> };
>
> defined in Linux kernel header <linux/fd.h>.
>
> Since there is a fields of the structure of type 'unsigned long', there is
> a need to define "target_format_descr". Also, five fields rawcmd, reset,
> need_configure, perp_mode, and has_fifo are all just bitfields and are
> part od a single 'unsigned int' field.
>
> Signed-off-by: Aleksandar Markovic <address@hidden>
> ---
> linux-user/ioctls.h | 2 ++
> linux-user/syscall_defs.h | 18 ++++++++++++++++++
> linux-user/syscall_types.h | 12 ++++++++++++
> 3 files changed, 32 insertions(+)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index e754a6b..d72cd76 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -122,6 +122,8 @@
> IOCTL(FDSETMAXERRS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors)))
> IOCTL(FDGETMAXERRS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_floppy_max_errors)))
> IOCTL(FDRESET, 0, TYPE_NULL)
> + IOCTL(FDGETFDCSTAT, IOC_R,
> + MK_PTR(MK_STRUCT(STRUCT_target_floppy_fdc_state)))
> IOCTL(FDRAWCMD, 0, TYPE_NULL)
> IOCTL(FDTWADDLE, 0, TYPE_NULL)
> IOCTL(FDEJECT, 0, TYPE_NULL)
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index d85ab46..225dcfb 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -897,6 +897,23 @@ struct target_pollfd {
>
> /* From <linux/fd.h> */
>
> +struct target_floppy_fdc_state {
> + int spec1; /* spec1 value last used */
> + int spec2; /* spec2 value last used */
> + int dtr;
> + unsigned char version; /* FDC version code */
> + unsigned char dor;
> + abi_long address; /* io address */
s/abi_long/abi_ulong/
Thanks,
Laurent
- Re: [PATCH v5 11/20] linux-user: Add support for FS_IOC32_<GET|SET>VERSION ioctls, (continued)
- [PATCH v5 14/20] linux-user: Add support for FIFREEZE and FITHAW ioctls, Aleksandar Markovic, 2020/01/13
- [PATCH v5 13/20] linux-user: Add support for FITRIM ioctl, Aleksandar Markovic, 2020/01/13
- [PATCH v5 15/20] linux-user: Add support for FD<SETEMSGTRESH|SETMAXERRS|GETMAXERRS> ioctls, Aleksandar Markovic, 2020/01/13
- [PATCH v5 16/20] linux-user: Add support for FDFMT<BEG|TRK|END> ioctls, Aleksandar Markovic, 2020/01/13
- [PATCH v5 17/20] linux-user: Add support for FDGETFDCSTAT ioctl, Aleksandar Markovic, 2020/01/13
- Re: [PATCH v5 17/20] linux-user: Add support for FDGETFDCSTAT ioctl,
Laurent Vivier <=
- [PATCH v5 19/20] linux-user: Add support for KCOV_<ENABLE|DISABLE> ioctls, Aleksandar Markovic, 2020/01/13
- [PATCH v5 18/20] configure: Detect kcov support and introduce CONFIG_KCOV, Aleksandar Markovic, 2020/01/13
- [PATCH v5 20/20] linux-user: Add support for KCOV_INIT_TRACE ioctl, Aleksandar Markovic, 2020/01/13