On 1/30/26 3:27 AM, Paolo Bonzini wrote:
On 1/30/26 04:20, Damien Zammit wrote:
From: Manolo de Medici <[email protected]>
The Hurd currently doesn't have any TPM driver, compilation fails
for missing symbols unless these are left undefined.
This is due to the missing _IO* symbols, not the TPM driver.
Fortunately, these are unused and the whole enum can be removed. Please
check if it's also possible to remove
#ifndef _WIN32
#include <sys/uio.h>
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_IOCCOM_H
#include <sys/ioccom.h>
#endif
So this file comes originally from swtpm here:
https://github.com/stefanberger/swtpm/blob/master/include/swtpm/tpm_ioctl.h
To keep them in sync as much as possible -- would this here work?
#ifndef _WIN32
#include <sys/uio.h>
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_IOCCOM_H
#include <sys/ioccom.h>
#endif
#ifdef __gnu_hurd__
#include <mach/x86_64/ioccom.h>
#endif
and then keep this as-is?
#if !defined(_WIN32)
enum {
PTM_GET_CAPABILITY = _IOR('P', 0, ptm_cap),
PTM_INIT = _IOWR('P', 1, ptm_init),
PTM_SHUTDOWN = _IOR('P', 2, ptm_res),
at the top of the file.
Paolo
Signed-off-by: Manolo de Medici <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
---
backends/tpm/tpm_ioctl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
index ee2dd15d35..e466311455 100644
--- a/backends/tpm/tpm_ioctl.h
+++ b/backends/tpm/tpm_ioctl.h
@@ -285,7 +285,7 @@ typedef struct ptm_lockstorage ptm_lockstorage;
#define PTM_CAP_SEND_COMMAND_HEADER (1 << 15)
#define PTM_CAP_LOCK_STORAGE (1 << 16)
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__GNU__)
enum {
PTM_GET_CAPABILITY = _IOR('P', 0, ptm_cap),
PTM_INIT = _IOWR('P', 1, ptm_init),