diff options
| author | wdfk-prog <[email protected]> | 2026-03-09 09:25:01 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-03-12 16:40:33 +0800 |
| commit | cda0a63ab56d9b46577a58958cb01418e2d668f2 (patch) | |
| tree | d5a47239b497c2573047ad80ba5ba07ce1d12c25 /components/drivers/include | |
| parent | b0af22a96ff58458aac3169c9b0f6834db547d94 (diff) | |
refactor(core): Move __rt_fls to kservice
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/dev_mmcsd_core.h | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/components/drivers/include/drivers/dev_mmcsd_core.h b/components/drivers/include/drivers/dev_mmcsd_core.h index 0e170a6695..a49867ed84 100644 --- a/components/drivers/include/drivers/dev_mmcsd_core.h +++ b/components/drivers/include/drivers/dev_mmcsd_core.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2023, RT-Thread Development Team + * Copyright (c) 2006-2026 RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -175,50 +175,6 @@ struct rt_mmcsd_req #define R5_STATUS(x) (x & 0xCB00) #define R5_IO_CURRENT_STATE(x) ((x & 0x3000) >> 12) - - -/** - * fls - find last (most-significant) bit set - * @x: the word to search - * - * This is defined the same way as ffs. - * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. - */ - -rt_inline rt_uint32_t __rt_fls(rt_uint32_t val) -{ - rt_uint32_t bit = 32; - - if (!val) - return 0; - if (!(val & 0xffff0000u)) - { - val <<= 16; - bit -= 16; - } - if (!(val & 0xff000000u)) - { - val <<= 8; - bit -= 8; - } - if (!(val & 0xf0000000u)) - { - val <<= 4; - bit -= 4; - } - if (!(val & 0xc0000000u)) - { - val <<= 2; - bit -= 2; - } - if (!(val & 0x80000000u)) - { - bit -= 1; - } - - return bit; -} - #define MMCSD_HOST_PLUGED 0 #define MMCSD_HOST_UNPLUGED 1 |
