blob: 160a4fbd307a0cfbc01c2b92bd7bb0d6bc124538 [file] [log] [blame]
/*
* Copyright 2015 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef __TPM2_MARSHAL_FP_H
#define __TPM2_MARSHAL_FP_H
UINT16 Common_Marshal(void *source, BYTE **buffer, INT32 *size,
UINT16 type_size);
TPM_RC Common_Unmarshal(void *source, BYTE **buffer, INT32 *size,
UINT16 type_size);
#define MARSHAL_WRAPPER(name) \
static inline UINT16 name##_Marshal(void *x, BYTE **y, INT32 *z) { \
return Common_Marshal(x, y, z, sizeof(name)); \
}\
static inline TPM_RC name##_Unmarshal(void *x, BYTE **y, INT32 *z) { \
return Common_Unmarshal(x, y, z, sizeof(name)); \
}
MARSHAL_WRAPPER(TPM2B_DIGEST)
MARSHAL_WRAPPER(TPMI_ST_COMMAND_TAG)
MARSHAL_WRAPPER(TPMS_ATTEST)
MARSHAL_WRAPPER(TPMS_ECC_POINT)
MARSHAL_WRAPPER(TPM_CC)
MARSHAL_WRAPPER(TPM_HANDLE)
MARSHAL_WRAPPER(TPM_RC)
MARSHAL_WRAPPER(TPM_ST)
MARSHAL_WRAPPER(UINT32)
#endif // __TPM2_MARSHAL_FP_H