/*!
 * \file    tz_init_msg.h
 * \brief   header file for the payload msg structure
 * \author  Shyam Prasad
 * \date    11/15/2013
 *
 * <hr>
 * \section LICENSE
 * Copyright Samsung Electronics, Co. Ltd. B2B TIMA team. 2013 04
 * <hr>
 */
#ifndef TZ_INIT_MSG_H_
#define TZ_INIT_MSG_H_

#include "stdint.h"
#include "tz_msg.h"

#define TIMA_MSR_MAX_SIZE 	1024

/*!
 * Struct containing the input parameters for the init cmd
 *
 * \note
 *   - msr_size: size of the golden measurements or 0. 
 *				 0 - when initializing from secure memory.
 * 				 else contains size of the tima_measurement_info file
 *   - msr_buf : buffer dor the golden measurements
 *				 not used when initializing from secure memory
 *				 else it has the contents of the tima_measurement_info file
 */
typedef struct tz_init_cmd {
	uint32_t msr_size;
	uint8_t msr_buf[TIMA_MSR_MAX_SIZE];
} __attribute__ ((packed)) tz_init_cmd_t;

/*!
 * Struct containing the output parameters for the init cmd
 *
 * \note
 *   - return_code: TZ_COMMON_OK or a specific return code from the trustlet. 
 */
typedef struct tz_init_resp {
	uint32_t return_code;
} __attribute__ ((packed)) tz_init_resp_t;

/*!
 * Struct representiung the payload to the trustlet.
 *
 * \note
 *   - cmd  : contains input parameters
 *   - resp : contains output parameters
 */
typedef struct tz_init_payload {
	union init_payload_u{
		tz_init_cmd_t cmd;
		tz_init_resp_t resp;
	} __attribute__ ((packed)) payload;
} __attribute__ ((packed)) tz_init_payload_t;

#endif /* TZ_INIT_MSG_H_ */
