RetroArch
Classes | Macros | Functions
platform.h File Reference

mbed TLS Platform abstraction layer More...

#include "config.h"
#include "platform_time.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Include dependency graph for platform.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mbedtls_platform_context
 Platform context structure. More...
 

Macros

#define mbedtls_free   free
 
#define mbedtls_calloc   calloc
 
#define mbedtls_fprintf   fprintf
 
#define mbedtls_printf   printf
 
#define mbedtls_snprintf   snprintf
 
#define mbedtls_exit   exit
 
#define MBEDTLS_EXIT_SUCCESS   MBEDTLS_PLATFORM_STD_EXIT_SUCCESS
 
#define MBEDTLS_EXIT_FAILURE   MBEDTLS_PLATFORM_STD_EXIT_FAILURE
 
SECTION: Module settings

The configuration options you can set for this module are in this section. Either change them in config.h or define them on the compiler command line.

#define MBEDTLS_PLATFORM_STD_SNPRINTF   snprintf
 
#define MBEDTLS_PLATFORM_STD_PRINTF   printf
 
#define MBEDTLS_PLATFORM_STD_FPRINTF   fprintf
 
#define MBEDTLS_PLATFORM_STD_CALLOC   calloc
 
#define MBEDTLS_PLATFORM_STD_FREE   free
 
#define MBEDTLS_PLATFORM_STD_EXIT   exit
 
#define MBEDTLS_PLATFORM_STD_TIME   time
 
#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS   EXIT_SUCCESS
 
#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE   EXIT_FAILURE
 
#define MBEDTLS_PLATFORM_STD_NV_SEED_READ   mbedtls_platform_std_nv_seed_read
 
#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE   mbedtls_platform_std_nv_seed_write
 
#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE   "seedfile"
 

Functions

int mbedtls_platform_setup (mbedtls_platform_context *ctx)
 Perform any platform initialisation operations. More...
 
void mbedtls_platform_teardown (mbedtls_platform_context *ctx)
 Perform any platform teardown operations. More...
 

Detailed Description

mbed TLS Platform abstraction layer

Copyright (C) 2006-2016, ARM Limited, All Rights Reserved SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

This file is part of mbed TLS (https://tls.mbed.org)

Macro Definition Documentation

◆ mbedtls_calloc

#define mbedtls_calloc   calloc

◆ mbedtls_exit

#define mbedtls_exit   exit

◆ MBEDTLS_EXIT_FAILURE

#define MBEDTLS_EXIT_FAILURE   MBEDTLS_PLATFORM_STD_EXIT_FAILURE

◆ MBEDTLS_EXIT_SUCCESS

#define MBEDTLS_EXIT_SUCCESS   MBEDTLS_PLATFORM_STD_EXIT_SUCCESS

◆ mbedtls_fprintf

#define mbedtls_fprintf   fprintf

◆ mbedtls_free

#define mbedtls_free   free

◆ MBEDTLS_PLATFORM_STD_CALLOC

#define MBEDTLS_PLATFORM_STD_CALLOC   calloc

Default allocator to use

◆ MBEDTLS_PLATFORM_STD_EXIT

#define MBEDTLS_PLATFORM_STD_EXIT   exit

Default exit to use

◆ MBEDTLS_PLATFORM_STD_EXIT_FAILURE

#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE   EXIT_FAILURE

Default exit value to use

◆ MBEDTLS_PLATFORM_STD_EXIT_SUCCESS

#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS   EXIT_SUCCESS

Default exit value to use

◆ MBEDTLS_PLATFORM_STD_FPRINTF

#define MBEDTLS_PLATFORM_STD_FPRINTF   fprintf

Default fprintf to use

◆ MBEDTLS_PLATFORM_STD_FREE

#define MBEDTLS_PLATFORM_STD_FREE   free

Default free to use

◆ MBEDTLS_PLATFORM_STD_NV_SEED_FILE

#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE   "seedfile"

◆ MBEDTLS_PLATFORM_STD_NV_SEED_READ

#define MBEDTLS_PLATFORM_STD_NV_SEED_READ   mbedtls_platform_std_nv_seed_read

◆ MBEDTLS_PLATFORM_STD_NV_SEED_WRITE

#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE   mbedtls_platform_std_nv_seed_write

◆ MBEDTLS_PLATFORM_STD_PRINTF

#define MBEDTLS_PLATFORM_STD_PRINTF   printf

Default printf to use

◆ MBEDTLS_PLATFORM_STD_SNPRINTF

#define MBEDTLS_PLATFORM_STD_SNPRINTF   snprintf

Default snprintf to use

◆ MBEDTLS_PLATFORM_STD_TIME

#define MBEDTLS_PLATFORM_STD_TIME   time

Default time to use

◆ mbedtls_printf

#define mbedtls_printf   printf

◆ mbedtls_snprintf

#define mbedtls_snprintf   snprintf

Function Documentation

◆ mbedtls_platform_setup()

int mbedtls_platform_setup ( mbedtls_platform_context ctx)

Perform any platform initialisation operations.

Parameters
ctxmbed TLS context
Returns
0 if successful
Note
This function is intended to allow platform specific initialisation, and should be called before any other library functions. Its implementation is platform specific, and by default, unless platform specific code is provided, it does nothing.

Its use and whether its necessary to be called is dependent on the platform.

Here is the call graph for this function:

◆ mbedtls_platform_teardown()

void mbedtls_platform_teardown ( mbedtls_platform_context ctx)

Perform any platform teardown operations.

Parameters
ctxmbed TLS context
Note
This function should be called after every other mbed TLS module has been correctly freed using the appropriate free function. Its implementation is platform specific, and by default, unless platform specific code is provided, it does nothing.

Its use and whether its necessary to be called is dependent on the platform.

Here is the call graph for this function: