/********************************************************************
 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
 * All Rights Reserved.
 * Confidential and Proprietary - Qualcomm Technologies, Inc.
 *********************************************************************/

#ifndef OFFTARGET_CLIENT_APIS_INC_QTEE_INIT_H_
#define OFFTARGET_CLIENT_APIS_INC_QTEE_INIT_H_

/**
  @brief APIs to initialize the off-target QTEE emulation environment
  @file  qtee_init.h

  @addtogroup client_api_qtee_init
  @{
*/

#include "object.h"
#include "stdbool.h"
#include <stdint.h>

/**
  Initialize the QTEE Emulation environment.
  
  Optionally, a path to a user config file can be passed and the settings in this file will
  overwrite the defaults. If the default settings are desired, a null pointer can be passed
  instead.
  
  @param[in] config Path to user config file. May be NULL to use default config.

  @return
  Object_OK on success \n
  Object_ERROR otherwise.
**/
int32_t qtee_emu_init(const char *config);

/**
  Deinitialize the QTEE Emulation environment.

  @return
  Object_OK on success \n
  Object_ERROR otherwise.
**/
int32_t qtee_emu_deinit(void);

/** @cond **/

/**
  Initialize the QTEE Emulation environment.

  Deprecated: Superseded by qtee_emu_init().

  @return
  Object_OK on success \n
  Object_ERROR otherwise.
**/
int32_t qtee_sdk_init(void);

/**
  Deinitialize the QTEE Emulation environment.

  Deprecated: Superseded by qtee_emu_deinit().

  @return
  Object_OK on success \n
  Object_ERROR otherwise.
**/
int32_t qtee_sdk_deinit(void);

/** @endcond **/

/** @} */

/**
  Perform sys call for following secure domain api's 
  (i)TASecStorageVersionInfo_taVersionDataFree()
  (ii)tzbsp_rollback_version_deinit().

  @return
  Object_OK on success
  Any other Error code on failure.
**/
int32_t mink_deinit_secure_domain_invoke_sys_call(void);

/* Create Buffer Loader/RequestTABuffer/gpAppClient/waitCBO Object*/
void qtee_gp_init(void);
/* Release Buffer Loader/RequestTABuffer/gpAppClient/waitCBO Object and unload files */
void qtee_gp_deinit(void);

/* Set value of global static variable qteeRescueMode=isRescueMode. */ 
void qtee_init_set_rescue_mode(bool isRescueMode);

/* Read and return the value of global static variable qteeRescueMode. */
bool qtee_init_get_rescue_mode(void);

/* Set value of global static variable qteeColdBootDone=isColdBootDone. */ 
void qtee_init_set_cold_boot_done(bool isColdBootDone);

/* Read and return the value of global static variable qteeColdBootDone. */
bool qtee_init_get_cold_boot_done(void);

#endif /* OFFTARGET_CLIENT_APIS_INC_QTEE_INIT_H_ */
