nuttx compiler.h: Add location directive for code and data

The ability to locate data and code in different sections
   is becomming critical and common place in cores with multiple
   bus matrices and power domains, where DMA can be limited to
   a specific memory.
This commit is contained in:
David Sidrane 2020-06-04 06:34:33 -07:00 committed by Xiang Xiao
parent 871d5c6b72
commit b7ab9aa8f2
1 changed files with 16 additions and 0 deletions

View File

@ -103,10 +103,18 @@
# define farcall_function __attribute__ ((long_call))
/* Code locate */
# define locate_code(n) __attribute__ ((section(n)))
/* Data alignment */
# define aligned_data(n) __attribute__ ((aligned(n)))
/* Data location */
# define locate_data(n) __attribute__ ((section(n)))
/* The packed attribute informs GCC that the structure elements are packed,
* ignoring other alignment rules.
*/
@ -336,7 +344,9 @@
*/
# define noreturn_function
# define locate_code(n)
# define aligned_data(n)
# define locate_data(n)
# define begin_packed_struct
# define end_packed_struct
@ -475,6 +485,8 @@
# define noreturn_function
# define aligned_data(n)
# define locate_code(n)
# define locate_data(n)
# define begin_packed_struct
# define end_packed_struct
# define naked_function
@ -575,7 +587,9 @@
# define weak_const_function
# define noreturn_function
# define farcall_function
# define locate_code(n)
# define aligned_data(n)
# define locate_data(n)
# define begin_packed_struct __packed
# define end_packed_struct
# define reentrant_function
@ -628,6 +642,8 @@
# define noreturn_function
# define farcall_function
# define aligned_data(n)
# define locate_code(n)
# define locate_data(n)
# define begin_packed_struct
# define end_packed_struct
# define reentrant_function