Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Vadim Bendebury | df6896c | 2015-05-29 22:48:49 -0700 | [diff] [blame] | 4 | |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 5 | // THIS CODE IS GENERATED - DO NOT MODIFY! |
| 6 | |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 7 | #ifndef TPM2_CREATEPRIMARY_FP_H_ |
| 8 | #define TPM2_CREATEPRIMARY_FP_H_ |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 9 | |
| 10 | #include "tpm_generated.h" |
Vadim Bendebury | df6896c | 2015-05-29 22:48:49 -0700 | [diff] [blame] | 11 | |
| 12 | typedef struct { |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 13 | TPMI_RH_HIERARCHY primaryHandle; |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 14 | TPM2B_SENSITIVE_CREATE inSensitive; |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 15 | TPM2B_PUBLIC inPublic; |
| 16 | TPM2B_DATA outsideInfo; |
| 17 | TPML_PCR_SELECTION creationPCR; |
Vadim Bendebury | df6896c | 2015-05-29 22:48:49 -0700 | [diff] [blame] | 18 | } CreatePrimary_In; |
| 19 | |
| 20 | typedef struct { |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 21 | TPM_HANDLE objectHandle; |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 22 | TPM2B_PUBLIC outPublic; |
| 23 | TPM2B_CREATION_DATA creationData; |
| 24 | TPM2B_DIGEST creationHash; |
| 25 | TPMT_TK_CREATION creationTicket; |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 26 | TPM2B_NAME name; |
Vadim Bendebury | df6896c | 2015-05-29 22:48:49 -0700 | [diff] [blame] | 27 | } CreatePrimary_Out; |
| 28 | |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 29 | // Executes CreatePrimary with request handles and parameters from |
| 30 | // |in| and computes response handles and parameters to |out|. |
| 31 | TPM_RC TPM2_CreatePrimary(CreatePrimary_In* in, CreatePrimary_Out* out); |
Vadim Bendebury | df6896c | 2015-05-29 22:48:49 -0700 | [diff] [blame] | 32 | |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 33 | // Initializes handle fields in |target| from |request_handles|. Unmarshals |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 34 | // parameter fields in |target| from |buffer|. |
| 35 | TPM_RC CreatePrimary_In_Unmarshal(CreatePrimary_In* target, |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 36 | TPM_HANDLE request_handles[], |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 37 | BYTE** buffer, |
| 38 | INT32* size); |
| 39 | |
| 40 | // Marshals response handles and parameters from |source| to |buffer|. Computes |
| 41 | // and marshals the size of the parameter area (parameter_size) if |tag| == |
| 42 | // TPM_ST_SESSIONS. Returns size of (parameter area + handle area) in bytes. |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 43 | // Return value does not include parameter_size field. |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 44 | UINT16 CreatePrimary_Out_Marshal(CreatePrimary_Out* source, |
| 45 | TPMI_ST_COMMAND_TAG tag, |
| 46 | BYTE** buffer, |
| 47 | INT32* size); |
| 48 | |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 49 | // Unmarshals any request parameters starting at |request_parameter_buffer|. |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 50 | // Executes command. Marshals any response handles and parameters to the |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 51 | // global response buffer and computes |*response_handle_buffer_size| and |
| 52 | // |*response_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 53 | // parameter_size indicating the size of the parameter area. parameter_size |
| 54 | // field is located between the handle area and parameter area. |
| 55 | TPM_RC Exec_CreatePrimary(TPMI_ST_COMMAND_TAG tag, |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 56 | BYTE** request_parameter_buffer, |
| 57 | INT32* request_parameter_buffer_size, |
| 58 | TPM_HANDLE request_handles[], |
| 59 | UINT32* response_handle_buffer_size, |
| 60 | UINT32* response_parameter_buffer_size); |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 61 | |
| 62 | #endif // TPM2_CREATEPRIMARY_FP_H |