Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does "typedef __u16 __bitwise __le16;" mean in Linux kernel?

what does typedef __u16 __bitwise __le16; mean in Linux kernel?

actually, what does "le" mean here? I vaguely can see this is a unsigned 16bit int?

Thanks for your help.

like image 374
Anders Lind Avatar asked Mar 13 '12 08:03

Anders Lind


2 Answers

i found that (source) and that

Type Identifiers

The following type identifiers correspond to the u16, u32, and u64 types, except they are defined with the bitwise attribute, which is used to restrict their use as integers. The bitwise attribute is used by the sparse utility to make sure the variable is converted to the local processor type before other (unsafe) operations are performed on the variable.

The following types can be used for endian dependent variables after including the linux/kernel.h header file.

__le16
__le32  
__le64


__be16
__be32
__be64
like image 158
Pben Avatar answered Oct 19 '22 14:10

Pben


Short answer: It stands for little endian

Long answer: See the links in @Pben's answer

like image 27
Kimvais Avatar answered Oct 19 '22 14:10

Kimvais