From 5fa669005c3779b7310bf6bfe43f741a3d8ae871 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 30 Aug 2021 17:42:00 +0000 Subject: builtin: Add math.h Add a "math.h" to "builtin" and rename "math.h" in the "core" directories to "fpu.h". "builtin" is the directory containing headers that mirror those in the standard library and is used for device builds. The host builds exclude the "builtin" directory and use the standard library. Without this change, building host tools such as "ectool" and attempting to include "math.h" would result in incorrectly picking up the "math.h" from the device "core" directory, not the standard library version. BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes Change-Id: Id6b2df42cb0ff5ec2cfc07aa8f29861da6804bdf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3130625 Reviewed-by: Daisuke Nojiri --- core/riscv-rv32i/include/fpu.h | 13 +++++++++++++ core/riscv-rv32i/include/math.h | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 core/riscv-rv32i/include/fpu.h delete mode 100644 core/riscv-rv32i/include/math.h (limited to 'core/riscv-rv32i') diff --git a/core/riscv-rv32i/include/fpu.h b/core/riscv-rv32i/include/fpu.h new file mode 100644 index 0000000000..25d83f228f --- /dev/null +++ b/core/riscv-rv32i/include/fpu.h @@ -0,0 +1,13 @@ +/* Copyright 2020 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Math utility functions for RISC-V */ + +#ifndef __CROS_EC_FPU_H +#define __CROS_EC_FPU_H + +float sqrtf(float x); + +#endif /* __CROS_EC_FPU_H */ diff --git a/core/riscv-rv32i/include/math.h b/core/riscv-rv32i/include/math.h deleted file mode 100644 index f17144762a..0000000000 --- a/core/riscv-rv32i/include/math.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright 2020 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/* Math utility functions for RISC-V */ - -#ifndef __CROS_EC_MATH_H -#define __CROS_EC_MATH_H - -float sqrtf(float x); - -#endif /* __CROS_EC_MATH_H */ -- cgit v1.2.1