Re: Allocating memory in the form of 'BITS'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shard Gupta wrote:
Hello List,

I am writing a linux kernel module, and I want to allocates the memory
in a way so I can define each individual bit, like bitfield structure
in userspace.
Please tell me the way to do the same.

Thanks and regards,

Shard Gupta

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


If you want to set every bit to zero, you could use calloc(); otherwise, I think you'll need to use a bitmask and "<<", ">>" (bit shift left, right). You could also probably do a bitwise '&' and '|'.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux