7b4d924f98
This issue was initially detected by PVS Studio (issue number V547) and fixed as part of Google Code-in 2019. The initial problem was the calculate_cpu_conversion_factor function which had been copied in the BIOS and EFI versions of the boot code. Further investigation led to more duplicated or very similar functions being identified. Introduce an arch_cpu.h for the x86 boot platform to group these things in a single place, and adjust the BIOS and EFI code to call into that. Note that the BIOS and EFI code is still a little platform specific, ideally there should be a boot_arch_cpu_init() function for each architecture as already done for openfirmware and u-boot. Also remove some irrelevant comments from copypasted files for other architectures, as that was filling my git grep with useless noise. Change-Id: I16d815f0bf015cec0b4e03cc14f3cc447c7164c5 Reviewed-on: https://review.haiku-os.org/c/haiku/+/1985 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
26 lines
401 B
C
26 lines
401 B
C
/*
|
|
* Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef BOOT_ARCH_CPU_H
|
|
#define BOOT_ARCH_CPU_H
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern void cpu_init(void);
|
|
|
|
void calculate_cpu_conversion_factor(uint8 channel);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* BOOT_ARCH_CPU_H */
|