env: Allow to set default_environment[] from board code via compile option DEFAULT_ENV_IS_RW
This change allows board code to modify default_environment[] array when compile option DEFAULT_ENV_IS_RW is specified in board config file. Some board default variables depend on runtime configuration which is not known at compile time. Therefore allow to set default_environment[] array as non-const and allow board code to modify it when it is needed. Signed-off-by: Pali Rohár <pali@kernel.org> Acked-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
		
							parent
							
								
									3936fd9986
								
							
						
					
					
						commit
						93f4048bc2
					
				| 
						 | 
					@ -19,6 +19,8 @@ env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
#elif defined(DEFAULT_ENV_INSTANCE_STATIC)
 | 
					#elif defined(DEFAULT_ENV_INSTANCE_STATIC)
 | 
				
			||||||
static char default_environment[] = {
 | 
					static char default_environment[] = {
 | 
				
			||||||
 | 
					#elif defined(DEFAULT_ENV_IS_RW)
 | 
				
			||||||
 | 
					uchar default_environment[] = {
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
const uchar default_environment[] = {
 | 
					const uchar default_environment[] = {
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -111,7 +111,11 @@ typedef struct environment_s {
 | 
				
			||||||
extern env_t embedded_environment;
 | 
					extern env_t embedded_environment;
 | 
				
			||||||
#endif /* ENV_IS_EMBEDDED */
 | 
					#endif /* ENV_IS_EMBEDDED */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef DEFAULT_ENV_IS_RW
 | 
				
			||||||
 | 
					extern unsigned char default_environment[];
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
extern const unsigned char default_environment[];
 | 
					extern const unsigned char default_environment[];
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef DO_DEPS_ONLY
 | 
					#ifndef DO_DEPS_ONLY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue