函数源码 |
Source File:include\linux\bitops.h |
Create Date:2022-07-27 06:38:16 |
首页 | Copyright©Brick |
154 155 156 157 158 159 160 161 162 163 164 165 | /** * sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit * @value: value to sign extend * @index: 0 based bit index (0<=index<32) to sign bit * * This is safe to use for 16- and 8-bit types as well. */ static inline __s32 sign_extend32(__u32 value, int index) { __u8 shift = 31 - index; return (__s32)(value << shift) >> shift; } |