diff options
author | Shuo Liu <shuo.liu@intel.com> | 2024-11-12 18:30:15 +0800 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2024-11-14 14:29:18 +0000 |
commit | 97412d1929e88a929f73a229e40ca85a38168d7e (patch) | |
tree | 13549d8e57b4ae7b0d73157ef81e1727aeffe843 /src/cpu/x86/mtrr/earlymtrr.c | |
parent | 02cbfaa201209e4145aae8e475e923ed68052f3c (diff) |
cpu/x86/mtrr: Use fls/ffs from lib.h
Definitions of __fls/__ffs from lib.h and fms/fls from
cpu/x86/mtrr.h are duplicated. Use definition from lib.h which is
more generic.
Change-Id: Ic9c6f1027447b04627d7f21d777cbea142588093
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Suggested-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85104
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu/x86/mtrr/earlymtrr.c')
-rw-r--r-- | src/cpu/x86/mtrr/earlymtrr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/x86/mtrr/earlymtrr.c b/src/cpu/x86/mtrr/earlymtrr.c index a55b2dcc98..6c819a8c46 100644 --- a/src/cpu/x86/mtrr/earlymtrr.c +++ b/src/cpu/x86/mtrr/earlymtrr.c @@ -94,8 +94,8 @@ int var_mtrr_set(struct var_mtrr_context *ctx, uintptr_t addr, size_t size, int return -1; } - addr_lsb = fls(addr); - size_msb = fms(size); + addr_lsb = __ffs(addr); + size_msb = __fls(size); /* All MTRR entries need to have their base aligned to the mask size. The maximum size is calculated by a function of the |