blob: bd8571b4df6f239804386a02d3da642b530f9150 [file] [log] [blame]
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -07001// 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 Bendebury5bb7b9f2015-05-29 23:06:15 -07004
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -07005// THIS CODE IS GENERATED - DO NOT MODIFY!
6
7#ifndef TPM2_LOAD_FP_H
8#define TPM2_LOAD_FP_H
9
10#include "tpm_generated.h"
Vadim Bendebury5bb7b9f2015-05-29 23:06:15 -070011
12typedef struct {
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070013 TPMI_DH_OBJECT parentHandle;
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070014 TPM2B_PRIVATE inPrivate;
15 TPM2B_PUBLIC inPublic;
Vadim Bendebury5bb7b9f2015-05-29 23:06:15 -070016} Load_In;
17
18typedef struct {
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070019 TPM_HANDLE objectHandle;
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070020 TPM2B_NAME name;
Vadim Bendebury5bb7b9f2015-05-29 23:06:15 -070021} Load_Out;
22
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070023// Executes Load with request handles and parameters from
24// |in| and computes response handles and parameters to |out|.
25TPM_RC TPM2_Load(Load_In* in, Load_Out* out);
Vadim Bendebury5bb7b9f2015-05-29 23:06:15 -070026
Jocelyn Bohra4ed3aa2015-07-30 10:44:16 -070027// Initializes handle fields in |target| from |req_handles|. Unmarshals
28// parameter fields in |target| from |buffer|.
29TPM_RC Load_In_Unmarshal(Load_In* target,
30 TPM_HANDLE req_handles[],
31 BYTE** buffer,
32 INT32* size);
33
34// Marshals response handles and parameters from |source| to |buffer|. Computes
35// and marshals the size of the parameter area (parameter_size) if |tag| ==
36// TPM_ST_SESSIONS. Returns size of (parameter area + handle area) in bytes.
37// Does not include parameter_size field.
38UINT16 Load_Out_Marshal(Load_Out* source,
39 TPMI_ST_COMMAND_TAG tag,
40 BYTE** buffer,
41 INT32* size);
42
43// Unmarshals any request parameters starting at |req_parameter_buffer|.
44// Executes command. Marshals any response handles and parameters to the
45// global response buffer and computes |*res_handle_buffer_size| and
46// |*res_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals
47// parameter_size indicating the size of the parameter area. parameter_size
48// field is located between the handle area and parameter area.
49TPM_RC Exec_Load(TPMI_ST_COMMAND_TAG tag,
50 BYTE** req_parameter_buffer,
51 INT32* req_parameter_buffer_size,
52 TPM_HANDLE req_handles[],
53 UINT32* res_handle_buffer_size,
54 UINT32* res_parameter_buffer_size);
55
56#endif // TPM2_LOAD_FP_H