@ -333,7 +333,7 @@ function(group_to_string)
@@ -333,7 +333,7 @@ function(group_to_string)
endif ( )
set ( ${ STRING_STRING } "${${STRING_STRING}}\" ${ name } \": place in ${ ILINK_CURRENT_NAME } { block ${ name_clean } };\n " )
if ( DEFINED vma AND DEFINED lma AND NOT ${ noinit } )
if ( CONFIG_IAR_ZEPHYR_INIT AND DEFINED vma AND DEFINED lma AND NOT ${ noinit } )
set ( ${ STRING_STRING } "${${STRING_STRING}}\" ${ name } _init\ ": place in ${lma} { block ${name_clean}_init };\n" )
endif ( )
@ -792,32 +792,51 @@ function(section_to_string)
@@ -792,32 +792,51 @@ function(section_to_string)
list ( JOIN current_sections ", " SELECTORS )
set ( TEMP "${TEMP}\ndo not initialize {\n${SELECTORS}\n};" )
else ( )
# G e n e r a t e t h e _ i n i t b l o c k a n d t h e i n i t i a l i z e m a n u a l l y s t a t e m e n t .
# N o t e t h a t w e n e e d t o h a v e t h e X _ i n i t b l o c k d e f i n e d e v e n i f w e h a v e
# n o s e c t i o n s , s i n c e t h e r e w i l l c o m e a " p l a c e i n X X X " s t a t e m e n t l a t e r .
# " $ { T E M P } " i s t h e r e t o o k e e p t h e ' ; ' e l s e i t w i l l b e a l i s t
string ( REGEX REPLACE "(block[ \t\r\n]+)([^ \t\r\n]+)" "\\1\\2_init" INIT_TEMP "${TEMP}" )
string ( REGEX REPLACE "(rw)([ \t\r\n]+)(section[ \t\r\n]+)([^ \t\r\n,]+)" "\\1\\2\\3\\4_init" INIT_TEMP "${INIT_TEMP}" )
string ( REGEX REPLACE "(rw)([ \t\r\n]+)(section[ \t\r\n]+)" "ro\\2\\3" INIT_TEMP "${INIT_TEMP}" )
string ( REGEX REPLACE "alphabetical order, " "" INIT_TEMP "${INIT_TEMP}" )
string ( REGEX REPLACE "{ readwrite }" "{ }" INIT_TEMP "${INIT_TEMP}" )
# I f a n y c o n t e n t i s m a r k e d a s k e e p , i s h a s t o b e a p p l i e d t o t h e i n i t b l o c k
# t o o , e s p . f o r b l o c k s t h a t a r e n o t referenced ( e.g. empty blocks wiht min_size )
if ( to_be_kept )
list ( APPEND to_be_kept "block ${name_clean}_init" )
endif ( )
set ( TEMP "${TEMP}\n${INIT_TEMP}\n" )
if ( DEFINED current_sections )
set ( TEMP "${TEMP}\ninitialize manually with copy friendly\n" )
set ( TEMP "${TEMP}{\n" )
foreach ( section ${ current_sections } )
set ( TEMP "${TEMP} ${section},\n" )
endforeach ( )
set ( TEMP "${TEMP}};" )
set ( current_sections )
if ( CONFIG_IAR_DATA_INIT )
set ( TEMP "${TEMP}\ninitialize by copy\n" )
set ( TEMP "${TEMP}{\n" )
foreach ( section ${ current_sections } )
set ( TEMP "${TEMP} ${section},\n" )
endforeach ( )
set ( TEMP "${TEMP}};" )
set ( TEMP "${TEMP}\n\" ${ name } _init\ ": place in ${group_parent_lma} {\n" )
foreach ( section ${ current_sections } )
set ( TEMP "${TEMP} ${section}_init,\n" )
endforeach ( )
set ( TEMP "${TEMP}};" )
elseif ( CONFIG_IAR_ZEPHYR_INIT )
# G e n e r a t e t h e _ i n i t b l o c k a n d t h e i n i t i a l i z e m a n u a l l y s t a t e m e n t .
# N o t e t h a t w e n e e d t o h a v e t h e X _ i n i t b l o c k d e f i n e d e v e n i f w e h a v e
# n o s e c t i o n s , s i n c e t h e r e w i l l c o m e a " p l a c e i n X X X " s t a t e m e n t l a t e r .
# " $ { T E M P } " i s t h e r e t o o k e e p t h e ' ; ' e l s e i t w i l l b e a l i s t
string ( REGEX REPLACE "(block[ \t\r\n]+)([^ \t\r\n]+)" "\\1\\2_init" INIT_TEMP "${TEMP}" )
string ( REGEX REPLACE "(rw)([ \t\r\n]+)(section[ \t\r\n]+)([^ \t\r\n,]+)" "\\1\\2\\3\\4_init" INIT_TEMP "${INIT_TEMP}" )
string ( REGEX REPLACE "(rw)([ \t\r\n]+)(section[ \t\r\n]+)" "ro\\2\\3" INIT_TEMP "${INIT_TEMP}" )
string ( REGEX REPLACE "alphabetical order, " "" INIT_TEMP "${INIT_TEMP}" )
string ( REGEX REPLACE "{ readwrite }" "{ }" INIT_TEMP "${INIT_TEMP}" )
# I f a n y c o n t e n t i s m a r k e d a s k e e p , i s h a s t o b e a p p l i e d t o t h e i n i t b l o c k
# t o o , e s p . f o r b l o c k s t h a t a r e n o t referenced ( e.g. empty blocks wiht min_size )
if ( to_be_kept )
list ( APPEND to_be_kept "block ${name_clean}_init" )
endif ( )
set ( TEMP "${TEMP}\n${INIT_TEMP}\n" )
set ( TEMP "${TEMP}\ninitialize manually with copy friendly\n" )
set ( TEMP "${TEMP}{\n" )
foreach ( section ${ current_sections } )
set ( TEMP "${TEMP} ${section},\n" )
endforeach ( )
set ( TEMP "${TEMP}};" )
set ( current_sections )
endif ( )
endif ( )
set ( current_sections )
endif ( )
endif ( )