stage_cache: make prog const in stage_cache_add()

The stage_cache_add() function should not be manipulating
the struct prog argument in anyway. Therefore, mark it as
const.

BUG=chrome-os-partner:43636
BRANCH=None
TEST=Built, booted, suspended, and resumed on glados.

Original-Change-Id: I4509e478d3c98247b9d776f6534b949d9ba6282c
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/290721
Original-Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>

Change-Id: Ibadc00a9e1cbbf12119def92d77a79077625fb85
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11192
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Aaron Durbin 2015-08-05 00:52:13 -05:00
parent ee9662824d
commit 54546c97c7
4 changed files with 5 additions and 4 deletions

View File

@ -30,7 +30,7 @@ enum {
}; };
/* Cache the loaded stage provided according to the parameters. */ /* Cache the loaded stage provided according to the parameters. */
void stage_cache_add(int stage_id, struct prog *stage); void stage_cache_add(int stage_id, const struct prog *stage);
/* Load the cached stage at given location returning the stage entry point. */ /* Load the cached stage at given location returning the stage entry point. */
void stage_cache_load_stage(int stage_id, struct prog *stage); void stage_cache_load_stage(int stage_id, struct prog *stage);
/* Fill in parameters for the external stage cache, if utilized. */ /* Fill in parameters for the external stage cache, if utilized. */

View File

@ -23,7 +23,7 @@
#include <string.h> #include <string.h>
/* Stage cache uses cbmem. */ /* Stage cache uses cbmem. */
void stage_cache_add(int stage_id, struct prog *stage) void stage_cache_add(int stage_id, const struct prog *stage)
{ {
struct stage_cache *meta; struct stage_cache *meta;
void *c; void *c;

View File

@ -62,7 +62,7 @@ static void stage_cache_recover(void)
printk(BIOS_DEBUG, "Unable to recover external stage cache.\n"); printk(BIOS_DEBUG, "Unable to recover external stage cache.\n");
} }
void stage_cache_add(int stage_id, struct prog *stage) void stage_cache_add(int stage_id, const struct prog *stage)
{ {
struct imd *imd; struct imd *imd;
const struct imd_entry *e; const struct imd_entry *e;

View File

@ -60,7 +60,8 @@ fail:
halt(); halt();
} }
void __attribute__((weak)) stage_cache_add(int stage_id, struct prog *stage) {} void __attribute__((weak)) stage_cache_add(int stage_id,
const struct prog *stage) {}
void __attribute__((weak)) stage_cache_load_stage(int stage_id, void __attribute__((weak)) stage_cache_load_stage(int stage_id,
struct prog *stage) {} struct prog *stage) {}
void __attribute__((weak)) ramstage_cache_invalid(void) {} void __attribute__((weak)) ramstage_cache_invalid(void) {}