mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
Documentation: kernel-api: add bitmap operations from linux/bitmap.h
Add <linux/bitmap.h> to kernel-api Bitmap Operations section. Fix kernel-doc nitpicks in <linux/bitmap.h>. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Yury Norov <ynorov@caviumnetworks.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
416c751735
commit
404376af78
2 changed files with 8 additions and 4 deletions
|
@ -59,6 +59,9 @@ Bitmap Operations
|
||||||
.. kernel-doc:: lib/bitmap.c
|
.. kernel-doc:: lib/bitmap.c
|
||||||
:internal:
|
:internal:
|
||||||
|
|
||||||
|
.. kernel-doc:: include/linux/bitmap.h
|
||||||
|
:internal:
|
||||||
|
|
||||||
Command-line Parsing
|
Command-line Parsing
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
|
|
@ -360,8 +360,9 @@ static inline int bitmap_parse(const char *buf, unsigned int buflen,
|
||||||
return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
|
return __bitmap_parse(buf, buflen, 0, maskp, nmaskbits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* BITMAP_FROM_U64() - Represent u64 value in the format suitable for bitmap.
|
* BITMAP_FROM_U64() - Represent u64 value in the format suitable for bitmap.
|
||||||
|
* @n: u64 value
|
||||||
*
|
*
|
||||||
* Linux bitmaps are internally arrays of unsigned longs, i.e. 32-bit
|
* Linux bitmaps are internally arrays of unsigned longs, i.e. 32-bit
|
||||||
* integers in 32-bit environment, and 64-bit integers in 64-bit one.
|
* integers in 32-bit environment, and 64-bit integers in 64-bit one.
|
||||||
|
@ -392,14 +393,14 @@ static inline int bitmap_parse(const char *buf, unsigned int buflen,
|
||||||
((unsigned long) ((u64)(n) >> 32))
|
((unsigned long) ((u64)(n) >> 32))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* bitmap_from_u64 - Check and swap words within u64.
|
* bitmap_from_u64 - Check and swap words within u64.
|
||||||
* @mask: source bitmap
|
* @mask: source bitmap
|
||||||
* @dst: destination bitmap
|
* @dst: destination bitmap
|
||||||
*
|
*
|
||||||
* In 32-bit Big Endian kernel, when using (u32 *)(&val)[*]
|
* In 32-bit Big Endian kernel, when using ``(u32 *)(&val)[*]``
|
||||||
* to read u64 mask, we will get the wrong word.
|
* to read u64 mask, we will get the wrong word.
|
||||||
* That is "(u32 *)(&val)[0]" gets the upper 32 bits,
|
* That is ``(u32 *)(&val)[0]`` gets the upper 32 bits,
|
||||||
* but we expect the lower 32-bits of u64.
|
* but we expect the lower 32-bits of u64.
|
||||||
*/
|
*/
|
||||||
static inline void bitmap_from_u64(unsigned long *dst, u64 mask)
|
static inline void bitmap_from_u64(unsigned long *dst, u64 mask)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue