mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
xtensa: remove asm struct expressions in header files
This commit is contained in:
parent
09b09fdb48
commit
9d257054c8
@ -71,10 +71,18 @@ We need to undef due to redefinition from xtruntime.h
|
||||
|
||||
#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__)
|
||||
|
||||
#ifdef __clang__
|
||||
#define STRUCT_BEGIN .set XT_STRUCT_OFFSET, 0
|
||||
#define STRUCT_FIELD(ctype,size,asname,name) .set asname, XT_STRUCT_OFFSET; .set XT_STRUCT_OFFSET, asname + size
|
||||
#define STRUCT_AFIELD(ctype,size,asname,name,n) .set asname, XT_STRUCT_OFFSET;\
|
||||
.set XT_STRUCT_OFFSET, asname + (size)*(n);
|
||||
#define STRUCT_END(sname) .set sname##Size, XT_STRUCT_OFFSET;
|
||||
#else // __clang__
|
||||
#define STRUCT_BEGIN .pushsection .text; .struct 0
|
||||
#define STRUCT_FIELD(ctype,size,asname,name) asname: .space size
|
||||
#define STRUCT_AFIELD(ctype,size,asname,name,n) asname: .space (size)*(n)
|
||||
#define STRUCT_END(sname) sname##Size:; .popsection
|
||||
#endif // __clang__
|
||||
|
||||
#else
|
||||
|
||||
|
@ -31,11 +31,24 @@
|
||||
|
||||
/* Macros that help define structures for both C and assembler: */
|
||||
#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__)
|
||||
|
||||
#ifdef __clang__
|
||||
#define STRUCT_BEGIN .set XT_STRUCT_OFFSET, 0
|
||||
#define STRUCT_FIELD(ctype,size,pre,name) .set pre##name, XT_STRUCT_OFFSET; .set XT_STRUCT_OFFSET, pre##name + size
|
||||
#define STRUCT_AFIELD(ctype,size,pre,name,n) .set pre##name, XT_STRUCT_OFFSET;\
|
||||
.set XT_STRUCT_OFFSET, pre##name + (size)*(n);
|
||||
#define STRUCT_AFIELD_A(ctype,size,align,pre,name,n) .set pre##name, XT_STRUCT_OFFSET\
|
||||
.ifgt (align-1); .set pre##name, XT_STRUCT_OFFSET + (align - (XT_STRUCT_OFFSET & (align-1))); .endif\
|
||||
.set XT_STRUCT_OFFSET, pre##name + (size)*(n);
|
||||
#define STRUCT_END(sname) .set sname##Size, XT_STRUCT_OFFSET;
|
||||
#else /* __clang__ */
|
||||
#define STRUCT_BEGIN .pushsection .text; .struct 0
|
||||
#define STRUCT_FIELD(ctype,size,pre,name) pre##name: .space size
|
||||
#define STRUCT_AFIELD(ctype,size,pre,name,n) pre##name: .if n ; .space (size)*(n) ; .endif
|
||||
#define STRUCT_AFIELD_A(ctype,size,align,pre,name,n) .balign align ; pre##name: .if n ; .space (size)*(n) ; .endif
|
||||
#define STRUCT_END(sname) sname##Size:; .popsection
|
||||
#endif /* __clang__ */
|
||||
|
||||
#else /*_ASMLANGUAGE||__ASSEMBLER__*/
|
||||
#define STRUCT_BEGIN typedef struct {
|
||||
#define STRUCT_FIELD(ctype,size,pre,name) ctype name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user