PAL
A Platform Abstraction Layer connects the mbed-client with the underlying platform.
pal_configuration.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2016 ARM Limited. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 * Licensed under the Apache License, Version 2.0 (the License); you may
5 * not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17 
18 #ifndef _PAL_COFIGURATION_H
19 #define _PAL_COFIGURATION_H
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
26 #define PAL_NET_TCP_AND_TLS_SUPPORT true/* add pal support for TCP */
27 #define PAL_NET_ASYNCHRONOUS_SOCKET_API true/* add pal support for asynchronous sockets */
28 #define PAL_NET_DNS_SUPPORT true/* add pal support for DNS lookup */
29 
30 #define PAL_RTOS_64BIT_TICK_SUPPORTED false /* add pal support for asynchronous sockets */
31 #define PAL_UNIQUE_THREAD_PRIORITY (!defined(PAL_IGNORE_UNIQUE_THREAD_PRIORITY))/* if defined code skips the uniqueness priority check */
32 
34 #define PAL_MAX_NUMBER_OF_THREADS 7
35 
37 #define PAL_MAX_SUPORTED_NET_INTEFACES 5
38 
39 #ifdef __GNUC__ // we are compiling using GCC/G++
40  #define PAL_TARGET_POINTER_SIZE __SIZEOF_POINTER__
41  #ifdef __BYTE_ORDER
42  #if __BYTE_ORDER == __BIG_ENDIAN //if both are not defined it is TRUE!
43  #define PAL_COMPILATION_ENDIANITY 1 //define pal compilation endianity (0 is little endian, 1 is big endian)
44  #elif __BYTE_ORDER == __LITTLE_ENDIAN
45  #define PAL_COMPILATION_ENDIANITY 0//define pal compilation endianity (0 is little endian, 1 is big endian)
46  #else
47  #error missing endiantiy defintion for GCC
48  #endif
49 
50  #endif
51 #else
52  #ifdef __arm__ // we are compiling using the ARM compiler
53  #define PAL_TARGET_POINTER_SIZE __sizeof_ptr
54  #ifdef __BIG_ENDIAN
55  #define PAL_COMPILATION_ENDIANITY 1 //define pal compilation endianity (0 is little endian, 1 is big endian)
56  #else
57  #define PAL_COMPILATION_ENDIANITY 0 //define pal compilation endianity (0 is little endian, 1 is big endian)
58  #endif
59  #else
60  //#error neither ARMCC nor GCC used for compilation - not supported
61  #endif
62 
63 
64 #endif
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 #endif //_PAL_COFIGURATION_H