summaryrefslogtreecommitdiff
path: root/vm
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-12-14 02:35:47 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-15 17:12:33 +0100
commitad51c68171cb6a1cae15c61ca0218bbee2c05485 (patch)
treeab451409f5b33389f86cc039a14ff640aa1fefe7 /vm
parent3c26c30fd2a5bdec081384d45e42a7ea4e424846 (diff)
Use __builtin_ffs instead of libc provided ffs in vm_map.c
We already use this built-in in other places and this will move us closer to being able to build the kernel without libc. Message-Id: <Y5l80/VUFvJYZTjy@jupiter.tail36e24.ts.net>
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c
index ceeb91ee..4200a239 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -685,10 +685,10 @@ vm_map_find_entry_anywhere(struct vm_map *map,
if (((mask + 1) & mask) != 0) {
/* We have high bits in addition to the low bits */
- int first0 = ffs(~mask); /* First zero after low bits */
+ int first0 = __builtin_ffs(~mask); /* First zero after low bits */
vm_offset_t lowmask = (1UL << (first0-1)) - 1; /* low bits */
vm_offset_t himask = mask - lowmask; /* high bits */
- int second1 = ffs(himask); /* First one after low bits */
+ int second1 = __builtin_ffs(himask); /* First one after low bits */
max = 1UL << (second1-1);