/*
 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Created in Samsung Ukraine R&D Center (SRK) under a contract between
 * LLC "Samsung Electronics Ukraine Company" (Kiev, Ukraine)
 * and "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
 */

/**
 * @file TigerCounterDataStore.h
 * @brief Implements functionality of TEE internal and background synchronization counter.
 * @author Konstyantyn Volobuyev <k.volobuyev@samsung.com>
 * @author Viktor Kopp <v.kopp@samsung.com>
 * @date Created Jul 26, 2016
 * @date Modified Nov 15, 2017
 */

#ifndef TIGERCOUNTERDATASTORE_H
#define TIGERCOUNTERDATASTORE_H

#include "TigerTci.h"
#include "TzwCommon.h"

typedef uint64_t TigerCounter_t;

/**
 * @brief Sets counter to specified value
 * @param[in] Value to be assigned
 * @return status of the operation, e.g. TEE_SUCCESS on success.
 */
TEE_Result tigerSetCounter(TigerCounter_t val);

/**
 * @brief Gets counter's value
 * @param[out] Variable to assign
 * @return status of the operation, e.g. TEE_SUCCESS on success.
 */
TEE_Result tigerGetCounter(TigerCounter_t* val);

/**
 * @brief Increments counter
 * @return status of the operation, e.g. TEE_SUCCESS on success.
 */
TEE_Result tigerIncCounter();

///
/// NOTE: Below are obsolete functions. Do not use. Will be removed in subsequent versions.
///

/**
 * @brief Increased counter value and get increased counter value
 * @param[out] Variable to assign
 * @return status of the operation, e.g. TEE_SUCCESS on success.
 */
TEE_Result tigerGetIncCounter(TigerCounter_t* val);

#endif // TIGERCOUNTERDATASTORE_H
