X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fenvironment.h;h=481ea733dba772dd08739f1222af6628601d59e0;hb=5fa62000db6d0b46ecdeadbeb50faf5197db49ef;hp=26b07120da152166f250ce69f1b9073e4ae58ec6;hpb=d3c5e8b2f5945d93de8f23b053e9dcd033983245;p=oweals%2Fu-boot.git diff --git a/include/environment.h b/include/environment.h index 26b07120da..481ea733db 100644 --- a/include/environment.h +++ b/include/environment.h @@ -79,28 +79,45 @@ # ifdef CFG_ENV_OFFSET_REDUND # define CFG_REDUNDAND_ENVIRONMENT # endif -# if defined(CONFIG_NAND_U_BOOT) -/* Use embedded environment in NAND boot versions */ +# ifdef CFG_ENV_IS_EMBEDDED # define ENV_IS_EMBEDDED 1 # endif #endif /* CFG_ENV_IS_IN_NAND */ +#ifdef USE_HOSTCC +# include +#else +# include +#endif #ifdef CFG_REDUNDAND_ENVIRONMENT -# define ENV_HEADER_SIZE (sizeof(unsigned long) + 1) +# define ENV_HEADER_SIZE (sizeof(uint32_t) + 1) #else -# define ENV_HEADER_SIZE (sizeof(unsigned long)) +# define ENV_HEADER_SIZE (sizeof(uint32_t)) #endif #define ENV_SIZE (CFG_ENV_SIZE - ENV_HEADER_SIZE) typedef struct environment_s { - unsigned long crc; /* CRC32 over data bytes */ + uint32_t crc; /* CRC32 over data bytes */ #ifdef CFG_REDUNDAND_ENVIRONMENT unsigned char flags; /* active/obsolete flags */ #endif unsigned char data[ENV_SIZE]; /* Environment data */ } env_t; +/* Function that returns a character from the environment */ +unsigned char env_get_char (int); + +/* Function that returns a pointer to a value from the environment */ +unsigned char *env_get_addr(int); +unsigned char env_get_char_memory (int index); + +/* Function that updates CRC of the enironment */ +void env_crc_update (void); + +/* [re]set to the default environment */ +void set_default_env(void); + #endif /* _ENVIRONMENT_H_ */