From 6e76fff96961264e8c7213142966de6589092291 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 20 Mar 2015 09:42:05 -0500 Subject: program loading: provide one cache maintenance callback Instead of having 2 different functions to call when a program is loaded provide a single callback with flags parameter. The previous callbacks for cache management routines did this: for_each_program_segment: arch_program_segment_loaded(start, size); arch_program_loaded(); Now, use one callback instead: for_each_program_segment: arch_segment_loaded(start, size, SEG_FINAL?); Change-Id: I3811cba92e3355d172f605e4444f053321b07a2a Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/8838 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/include/program_loading.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/include/program_loading.h') diff --git a/src/include/program_loading.h b/src/include/program_loading.h index ca61c169d7..85ccd3cd46 100644 --- a/src/include/program_loading.h +++ b/src/include/program_loading.h @@ -23,11 +23,15 @@ #include #include -/* For each segment of a program loaded this function is called*/ -void arch_program_segment_loaded(uintptr_t start, size_t size); +enum { + /* Last segment of program. Can be used to take different actions for + * cache maintenance of a program load. */ + SEG_FINAL = 1 << 0, +}; -/* Upon completion of loading a program this function is called */ -void arch_program_loaded(void); +/* Called for each segment of a program loaded. The PROG_FLAG_FINAL will be + * set on the last segment loaded. */ +void arch_segment_loaded(uintptr_t start, size_t size, int flags); /************************ * ROMSTAGE LOADING * -- cgit v1.2.3