soc/intel/common/mrc_cache: Honor MRC data as a constant pointer

The MRC cache API has absolutely no reason to modify the data it is
asked to stash. Reflect that by taking all "data" parameters as
const void *.

Change-Id: I7a14ffd7d5726aa9aa5db81df82c06e7f87b9d9f
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14250
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
This commit is contained in:
Alexandru Gagniuc 2016-03-04 14:38:19 -08:00 committed by Martin Roth
parent 9c9bde3aa3
commit 1116fa86e3
3 changed files with 6 additions and 6 deletions

View File

@ -372,7 +372,7 @@ __attribute__((weak)) int mrc_cache_get_current(
}
/* Save the memory configuration data */
__attribute__((weak)) int mrc_cache_stash_data(void *data, size_t size)
__attribute__((weak)) int mrc_cache_stash_data(const void *data, size_t size)
{
printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__);
return -1;

View File

@ -162,7 +162,7 @@ int mrc_cache_get_current(const struct mrc_saved_data **cache)
return mrc_cache_get_current_with_version(cache, 0);
}
/* Fill in mrc_saved_data structure with payload. */
static void mrc_cache_fill(struct mrc_saved_data *cache, void *data,
static void mrc_cache_fill(struct mrc_saved_data *cache, const void *data,
size_t size, uint32_t version)
{
cache->signature = MRC_DATA_SIGNATURE;
@ -173,7 +173,7 @@ static void mrc_cache_fill(struct mrc_saved_data *cache, void *data,
cache->size);
}
int mrc_cache_stash_data_with_version(void *data, size_t size,
int mrc_cache_stash_data_with_version(const void *data, size_t size,
uint32_t version)
{
int cbmem_size;
@ -199,7 +199,7 @@ int mrc_cache_stash_data_with_version(void *data, size_t size,
return 0;
}
int mrc_cache_stash_data(void *data, size_t size)
int mrc_cache_stash_data(const void *data, size_t size)
{
return mrc_cache_stash_data_with_version(data, size, 0);
}

View File

@ -34,8 +34,8 @@ int mrc_cache_get_current_with_version(const struct mrc_saved_data **cache,
uint32_t version);
/* Stash the resulting MRC data to be saved in non-volatile storage later. */
int mrc_cache_stash_data(void *data, size_t size);
int mrc_cache_stash_data_with_version(void *data, size_t size,
int mrc_cache_stash_data(const void *data, size_t size);
int mrc_cache_stash_data_with_version(const void *data, size_t size,
uint32_t version);
#endif /* _COMMON_MRC_CACHE_H_ */