• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /**
16  ****************************************************************************************
17  *
18  * @file arch.h
19  *
20  * @brief This file contains the definitions of the macros and functions that are
21  * architecture dependent.  The implementation of those is implemented in the
22  * appropriate architecture directory.
23  *
24  ****************************************************************************************
25  */
26 
27 #ifndef _ARCH_H_
28 #define _ARCH_H_
29 
30 /*
31  * INCLUDE FILES
32  ****************************************************************************************
33  */
34 #include "plf.h"           // SW configuration
35 
36 #include <stdint.h>        // standard integer definition
37 #include "compiler.h"      // inline functions
38 
39 /*
40  * CPU WORD SIZE
41  ****************************************************************************************
42  */
43 /// ARM is a 32-bit CPU
44 #define CPU_WORD_SIZE   4
45 
46 /*
47  * CPU Endianness
48  ****************************************************************************************
49  */
50 /// ARM is little endian
51 #define CPU_LE          1
52 
53 
54 /*
55  * DEFINES
56  ****************************************************************************************
57  */
58 #ifndef NULL
59 #define NULL (void *)0
60 #endif
61 
62 #ifndef MAX
63 #define MAX(a, b) ((a) > (b) ? (a) : (b))
64 #endif
65 
66 #ifndef MIN
67 #define MIN(a, b) ((a) < (b) ? (a) : (b))
68 #endif
69 
70 /*
71  * EXPORTED FUNCTION DECLARATION
72  ****************************************************************************************
73  */
74 
75 
76 /// Object allocated in shared memory - check linker script
77 #define __SHARED __attribute__ ((section("shram")))
78 
79 // required to define GLOBAL_INT_** macros as inline assembly. This file is included after
80 // definition of ASSERT macros as they are used inside ll.h
81 #include "ll.h"     // ll definitions
82 
83 #endif // _ARCH_H_
84