From 1a8387eabadb16adae2b5a032611813587957ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 11 Feb 2019 10:12:35 +0200 Subject: cpu/intel/common: Split get_ia32_fsb() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is desireable to not have printk() inside a function body that can be used for udelay(). This avoids potential infinite recursion. Change-Id: Ie67fc2a8da8351f22794e4d36c55b887c298e8ca Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/31338 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: HAOUAS Elyes --- src/cpu/intel/common/fsb.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/cpu/intel/common') diff --git a/src/cpu/intel/common/fsb.c b/src/cpu/intel/common/fsb.c index 1f7c391a8f..92967859dd 100644 --- a/src/cpu/intel/common/fsb.c +++ b/src/cpu/intel/common/fsb.c @@ -18,7 +18,7 @@ #include #include -int get_ia32_fsb(void) +static int get_fsb(void) { struct cpuinfo_x86 c; static const short core_fsb[8] = { -1, 133, -1, 166, -1, 100, -1, -1 }; @@ -60,6 +60,14 @@ int get_ia32_fsb(void) break; } } + return ret; +} + +int get_ia32_fsb(void) +{ + int ret; + + ret = get_fsb(); if (ret == -1) printk(BIOS_ERR, "FSB not found\n"); if (ret == -2) -- cgit v1.2.3