From 331ac1b07896140a14dbb079b3cb907762cec218 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Wed, 16 Mar 2016 16:12:06 -0700 Subject: mtrr: Define a function for obtaining free var mtrr Instead of hard-coding var mtrr numbers in code, use this function to identify the first available variable mtrr. If no such mtrr is available, the function will return -1. Change-Id: I2a1e02cdb45c0ab7e30609641977471eaa2431fd Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/14115 Tested-by: build bot (Jenkins) Reviewed-by: Andrey Petrov --- src/include/cpu/x86/mtrr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/cpu') diff --git a/src/include/cpu/x86/mtrr.h b/src/include/cpu/x86/mtrr.h index d15873595e..4eb4f135c3 100644 --- a/src/include/cpu/x86/mtrr.h +++ b/src/include/cpu/x86/mtrr.h @@ -81,6 +81,7 @@ void x86_mtrr_check(void); #if !defined(__ASSEMBLER__) && defined(__PRE_RAM__) && !defined(__ROMCC__) void set_var_mtrr(unsigned reg, unsigned base, unsigned size, unsigned type); +int get_free_var_mtrr(void); #endif /* Align up to next power of 2, suitable for ROMCC and assembler too. -- cgit v1.2.3