/*!
 * In Samsung Ukraine R&D Center (SRK) under a contract between
 * LLC "Samsung Electronics Ukraine Company" (Kyiv, Ukraine)
 * and "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
 * Copyright: (c) Samsung Electronics Co, Ltd 2017. All rights reserved.
 *
 * Created on: Dec 05, 2017
 * Author: Pavel Marusyk <p.marusik@samsung.com>
 */

#ifndef _STACK_PROTECTION_H_
#define _STACK_PROTECTION_H_

#ifdef __cplusplus
extern "C" {
#endif // ifdef __cplusplus

#ifdef NO_STACK_CHK_IMPLEMENTED

#ifndef _TLAPI_EXTERN_C
#if defined(__cplusplus)
    #define _EXTERN_C                extern "C"
#else
    #define _EXTERN_C
#endif // defined(__cplusplus)
#define _TLAPI_EXTERN_C     _EXTERN_C
#endif // ifndef _TLAPI_EXTERN_C

#include <stdbool.h>
#include "mcUuid.h"
#include "tlStd.h"
#include "TlApi/TlApi.h"

/*
 * Initialize the stackprotector canary value
 * NOTE: this must only be called from start of trustlet
 */
void stack_protection_init(void);

#endif // ifndef NO_STACK_CHK_IMPLEMENTED

#ifdef __cplusplus
}
#endif // ifdef __cplusplus

#endif // _SWD_STACK_PROTECTION_H_
