* Allocating memory in the form of 'BITS'
@ 2008-03-25 10:23 Shard Gupta
2008-03-25 10:36 ` Scott Lovenberg
0 siblings, 1 reply; 2+ messages in thread
From: Shard Gupta @ 2008-03-25 10:23 UTC (permalink / raw)
To: kernelnewbies, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Allocating memory in the form of 'BITS'
2008-03-25 10:23 Allocating memory in the form of 'BITS' Shard Gupta
@ 2008-03-25 10:36 ` Scott Lovenberg
0 siblings, 0 replies; 2+ messages in thread
From: Scott Lovenberg @ 2008-03-25 10:36 UTC (permalink / raw)
To: Shard Gupta; +Cc: kernelnewbies, linux-kernel
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@nl.linux.org
> 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 '|'.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-25 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-25 10:23 Allocating memory in the form of 'BITS' Shard Gupta
2008-03-25 10:36 ` Scott Lovenberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox