[PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32

Bin Meng posted 51 patches 3 years, 5 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Cédric Le Goater" <clg@kaod.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Gerd Hoffmann <kraxel@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Michael Roth <michael.roth@amd.com>, Konstantin Kostiuk <kkostiuk@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, Havard Skinnemoen <hskinnemoen@google.com>, Tyrone Ting <kfting@nuvoton.com>, Markus Armbruster <armbru@redhat.com>, Coiby Xu <Coiby.Xu@gmail.com>, Jason Wang <jasowang@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
[PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32
Posted by Bin Meng 3 years, 5 months ago
From: Bin Meng <bin.meng@windriver.com>

These headers and macros do not exist on Windows. Exclude them.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 backends/tpm/tpm_ioctl.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
index bd6c12cb86..d67bf0283b 100644
--- a/backends/tpm/tpm_ioctl.h
+++ b/backends/tpm/tpm_ioctl.h
@@ -9,8 +9,10 @@
 #ifndef TPM_IOCTL_H
 #define TPM_IOCTL_H
 
+#ifndef _WIN32
 #include <sys/uio.h>
 #include <sys/ioctl.h>
+#endif
 
 #ifdef HAVE_SYS_IOCCOM_H
 #include <sys/ioccom.h>
@@ -222,6 +224,7 @@ typedef struct ptm_setbuffersize ptm_setbuffersize;
 #define PTM_CAP_SET_DATAFD         (1 << 12)
 #define PTM_CAP_SET_BUFFERSIZE     (1 << 13)
 
+#ifndef _WIN32
 enum {
     PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
     PTM_INIT               = _IOWR('P', 1, ptm_init),
@@ -241,6 +244,7 @@ enum {
     PTM_SET_DATAFD         = _IOR('P', 15, ptm_res),
     PTM_SET_BUFFERSIZE     = _IOWR('P', 16, ptm_setbuffersize),
 };
+#endif
 
 /*
  * Commands used by the non-CUSE TPMs
-- 
2.34.1
Re: [PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32
Posted by Stefan Berger 3 years, 5 months ago

On 8/24/22 05:39, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> These headers and macros do not exist on Windows. Exclude them.
> 
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
> 
>   backends/tpm/tpm_ioctl.h | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
> index bd6c12cb86..d67bf0283b 100644
> --- a/backends/tpm/tpm_ioctl.h
> +++ b/backends/tpm/tpm_ioctl.h
> @@ -9,8 +9,10 @@
>   #ifndef TPM_IOCTL_H
>   #define TPM_IOCTL_H
> 
> +#ifndef _WIN32
>   #include <sys/uio.h>
>   #include <sys/ioctl.h>
> +#endif
> 
>   #ifdef HAVE_SYS_IOCCOM_H
>   #include <sys/ioccom.h>
> @@ -222,6 +224,7 @@ typedef struct ptm_setbuffersize ptm_setbuffersize;
>   #define PTM_CAP_SET_DATAFD         (1 << 12)
>   #define PTM_CAP_SET_BUFFERSIZE     (1 << 13)
> 
> +#ifndef _WIN32
>   enum {
>       PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
>       PTM_INIT               = _IOWR('P', 1, ptm_init),
> @@ -241,6 +244,7 @@ enum {
>       PTM_SET_DATAFD         = _IOR('P', 15, ptm_res),
>       PTM_SET_BUFFERSIZE     = _IOWR('P', 16, ptm_setbuffersize),
>   };
> +#endif
> 
>   /*
>    * Commands used by the non-CUSE TPMs

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Re: [PATCH 14/51] backends/tpm: Exclude headers and macros that don't exist on win32
Posted by Marc-André Lureau 3 years, 5 months ago
Hi

On Wed, Aug 24, 2022 at 5:26 PM Stefan Berger <stefanb@linux.ibm.com> wrote:

>
>
> On 8/24/22 05:39, Bin Meng wrote:
> > From: Bin Meng <bin.meng@windriver.com>
> >
> > These headers and macros do not exist on Windows. Exclude them.
> >
> > Signed-off-by: Bin Meng <bin.meng@windriver.com>
> > ---
> >
> >   backends/tpm/tpm_ioctl.h | 4 ++++
> >   1 file changed, 4 insertions(+)
> >
> > diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
> > index bd6c12cb86..d67bf0283b 100644
> > --- a/backends/tpm/tpm_ioctl.h
> > +++ b/backends/tpm/tpm_ioctl.h
> > @@ -9,8 +9,10 @@
> >   #ifndef TPM_IOCTL_H
> >   #define TPM_IOCTL_H
> >
> > +#ifndef _WIN32
> >   #include <sys/uio.h>
> >   #include <sys/ioctl.h>
> > +#endif
> >
> >   #ifdef HAVE_SYS_IOCCOM_H
> >   #include <sys/ioccom.h>
> > @@ -222,6 +224,7 @@ typedef struct ptm_setbuffersize ptm_setbuffersize;
> >   #define PTM_CAP_SET_DATAFD         (1 << 12)
> >   #define PTM_CAP_SET_BUFFERSIZE     (1 << 13)
> >
> > +#ifndef _WIN32
> >   enum {
> >       PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
> >       PTM_INIT               = _IOWR('P', 1, ptm_init),
> > @@ -241,6 +244,7 @@ enum {
> >       PTM_SET_DATAFD         = _IOR('P', 15, ptm_res),
> >       PTM_SET_BUFFERSIZE     = _IOWR('P', 16, ptm_setbuffersize),
> >   };
> > +#endif
> >
> >   /*
> >    * Commands used by the non-CUSE TPMs
>
> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
>
>
I guess it would be worthy to make libtpms/swtpm work under windows too,
but this is a larger goal.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

-- 
Marc-André Lureau