This seems to be preferred these days.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
__be16 tag;
__be32 length;
__be32 ordinal;
__be16 tag;
__be32 length;
__be32 ordinal;
-}__attribute__((packed));
struct tpm_output_header {
__be16 tag;
__be32 length;
__be32 return_code;
struct tpm_output_header {
__be16 tag;
__be32 length;
__be32 return_code;
-}__attribute__((packed));
struct stclear_flags_t {
__be16 tag;
struct stclear_flags_t {
__be16 tag;
u8 physicalPresence;
u8 physicalPresenceLock;
u8 bGlobalLock;
u8 physicalPresence;
u8 physicalPresenceLock;
u8 bGlobalLock;
-}__attribute__((packed));
struct tpm_version_t {
u8 Major;
u8 Minor;
u8 revMajor;
u8 revMinor;
struct tpm_version_t {
u8 Major;
u8 Minor;
u8 revMajor;
u8 revMinor;
-}__attribute__((packed));
struct tpm_version_1_2_t {
__be16 tag;
struct tpm_version_1_2_t {
__be16 tag;
u8 Minor;
u8 revMajor;
u8 revMinor;
u8 Minor;
u8 revMajor;
u8 revMinor;
-}__attribute__((packed));
struct timeout_t {
__be32 a;
__be32 b;
__be32 c;
__be32 d;
struct timeout_t {
__be32 a;
__be32 b;
__be32 c;
__be32 d;
-}__attribute__((packed));
struct duration_t {
__be32 tpm_short;
__be32 tpm_medium;
__be32 tpm_long;
struct duration_t {
__be32 tpm_short;
__be32 tpm_medium;
__be32 tpm_long;
-}__attribute__((packed));
struct permanent_flags_t {
__be16 tag;
struct permanent_flags_t {
__be16 tag;
u8 tpmEstablished;
u8 maintenanceDone;
u8 disableFullDALogicInfo;
u8 tpmEstablished;
u8 maintenanceDone;
u8 disableFullDALogicInfo;
-}__attribute__((packed));
typedef union {
struct permanent_flags_t perm_flags;
typedef union {
struct permanent_flags_t perm_flags;
__be32 cap;
__be32 subcap_size;
__be32 subcap;
__be32 cap;
__be32 subcap_size;
__be32 subcap;
-}__attribute__((packed));
struct tpm_getcap_params_out {
__be32 cap_size;
cap_t cap;
struct tpm_getcap_params_out {
__be32 cap_size;
cap_t cap;
-}__attribute__((packed));
struct tpm_readpubek_params_out {
u8 algorithm[4];
struct tpm_readpubek_params_out {
u8 algorithm[4];
__be32 keysize;
u8 modulus[256];
u8 checksum[20];
__be32 keysize;
u8 modulus[256];
u8 checksum[20];
-}__attribute__((packed));
typedef union {
struct tpm_input_header in;
typedef union {
struct tpm_input_header in;
#define TPM_DIGEST_SIZE 20
struct tpm_pcrread_out {
u8 pcr_result[TPM_DIGEST_SIZE];
#define TPM_DIGEST_SIZE 20
struct tpm_pcrread_out {
u8 pcr_result[TPM_DIGEST_SIZE];
-}__attribute__((packed));
struct tpm_pcrread_in {
__be32 pcr_idx;
struct tpm_pcrread_in {
__be32 pcr_idx;
-}__attribute__((packed));
struct tpm_pcrextend_in {
__be32 pcr_idx;
u8 hash[TPM_DIGEST_SIZE];
struct tpm_pcrextend_in {
__be32 pcr_idx;
u8 hash[TPM_DIGEST_SIZE];
-}__attribute__((packed));
/* 128 bytes is an arbitrary cap. This could be as large as TPM_BUFSIZE - 18
* bytes, but 128 is still a relatively large number of random bytes and
/* 128 bytes is an arbitrary cap. This could be as large as TPM_BUFSIZE - 18
* bytes, but 128 is still a relatively large number of random bytes and
struct tpm_getrandom_out {
__be32 rng_data_len;
u8 rng_data[TPM_MAX_RNG_DATA];
struct tpm_getrandom_out {
__be32 rng_data_len;
u8 rng_data[TPM_MAX_RNG_DATA];
-}__attribute__((packed));
struct tpm_getrandom_in {
__be32 num_bytes;
struct tpm_getrandom_in {
__be32 num_bytes;
-}__attribute__((packed));
struct tpm_startup_in {
__be16 startup_type;
struct tpm_startup_in {
__be16 startup_type;
struct tpm_cmd_t {
tpm_cmd_header header;
tpm_cmd_params params;
struct tpm_cmd_t {
tpm_cmd_header header;
tpm_cmd_params params;
-}__attribute__((packed));
ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *);
ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *);
u16 platform_class;
union {
struct client_hdr {
u16 platform_class;
union {
struct client_hdr {
- u32 log_max_len __attribute__ ((packed));
- u64 log_start_addr __attribute__ ((packed));
+ u32 log_max_len __packed;
+ u64 log_start_addr __packed;
} client;
struct server_hdr {
u16 reserved;
} client;
struct server_hdr {
u16 reserved;
- u64 log_max_len __attribute__ ((packed));
- u64 log_start_addr __attribute__ ((packed));
+ u64 log_max_len __packed;
+ u64 log_start_addr __packed;