diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-03-21 16:11:21 -0400 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-04-12 14:28:17 +0100 |
commit | b05cb51b0605fb7c614e8a78ef03b79eeb06c85a (patch) | |
tree | 8d94f2a794ce8a57d5599781b09b59026b1380aa /extras/mini-os/include | |
parent | 368fcb52643105d80c4705afa557647c8f7114c5 (diff) | |
download | xen-b05cb51b0605fb7c614e8a78ef03b79eeb06c85a.tar.gz xen-b05cb51b0605fb7c614e8a78ef03b79eeb06c85a.tar.bz2 xen-b05cb51b0605fb7c614e8a78ef03b79eeb06c85a.zip |
mini-os/tpmback: Replace UUID field with opaque pointer
Instead of only recording the UUID field, which may not be of interest
to all tpmback implementations, provide a user-settable opaque pointer
associated with the tpmback instance.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Diffstat (limited to 'extras/mini-os/include')
-rw-r--r-- | extras/mini-os/include/tpmback.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h index 3c11c347a3..a6cbbf1791 100644 --- a/extras/mini-os/include/tpmback.h +++ b/extras/mini-os/include/tpmback.h @@ -45,10 +45,10 @@ struct tpmcmd { domid_t domid; /* Domid of the frontend */ uint8_t locality; /* Locality requested by the frontend */ unsigned int handle; /* Handle of the frontend */ - unsigned char uuid[16]; /* uuid of the tpm interface */ + void *opaque; /* Opaque pointer taken from the tpmback instance */ - unsigned int req_len; /* Size of the command in buf - set by tpmback driver */ uint8_t* req; /* tpm command bits, allocated by driver, DON'T FREE IT */ + unsigned int req_len; /* Size of the command in buf - set by tpmback driver */ unsigned int resp_len; /* Size of the outgoing command, you set this before passing the cmd object to tpmback_resp */ uint8_t* resp; /* Buffer for response - YOU MUST ALLOCATE IT, YOU MUST ALSO FREE IT */ @@ -94,4 +94,9 @@ int tpmback_num_frontends(void); * The return value is internally allocated, so don't free it */ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle); +/* Get and set the opaque pointer for a tpmback instance */ +void* tpmback_get_opaque(domid_t domid, unsigned int handle); +/* Returns zero if successful, nonzero on failure (no such frontend) */ +int tpmback_set_opaque(domid_t domid, unsigned int handle, void* opaque); + #endif |