summaryrefslogtreecommitdiff
path: root/core/cortex-m/llsr.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /core/cortex-m/llsr.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-voshyr-14637.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'core/cortex-m/llsr.c')
-rw-r--r--core/cortex-m/llsr.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/core/cortex-m/llsr.c b/core/cortex-m/llsr.c
deleted file mode 100644
index 0827121e97..0000000000
--- a/core/cortex-m/llsr.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright 2018 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.
- */
-
-/* Enable the use of right shift for uint64_t. */
-
-#include <console.h>
-#include <compile_time_macros.h>
-#include <stdint.h>
-
-union words {
- uint64_t u64;
- uint32_t w[2];
-};
-
-uint64_t __attribute__((used)) __aeabi_llsr(uint64_t v, uint32_t shift)
-{
- union words val;
- union words res;
-
- val.u64 = v;
- res.w[1] = val.w[1] >> shift;
- res.w[0] = val.w[0] >> shift;
- res.w[0] |= val.w[1] >> (shift - 32); /* Handle shift >= 32*/
- res.w[0] |= val.w[1] << (32 - shift); /* Handle shift <= 32*/
- return res.u64;
-}
-
-#ifdef CONFIG_LLSR_TEST
-
-static int command_llsr(int argc, char **argv)
-{
- /* Volatile to prevent compilier optimization from interfering. */
- volatile uint64_t start = 0x123456789ABCDEF0ull;
- uint32_t x;
-
- const struct {
- uint32_t shift_by;
- uint64_t result;
- } cases[] = {
- {0, start},
- {16, 0x123456789ABCull},
- {32, 0x12345678u},
- {48, 0x1234u},
- {64, 0u}
- };
-
- for (x = 0; x < ARRAY_SIZE(cases); ++x) {
- if ((start >> cases[x].shift_by) != cases[x].result) {
- ccprintf("FAILED %d\n", cases[x].shift_by);
- return EC_ERROR_UNKNOWN;
- }
- }
-
- ccprintf("SUCCESS\n");
- return EC_SUCCESS;
-}
-
-DECLARE_CONSOLE_COMMAND(
- llsrtest, command_llsr,
- "",
- "Run tests against the LLSR ABI. Prints SUCCESS or FAILURE.");
-
-#endif /* CONFIG_LLSR_TEST */