From: Scott Lovenberg <scott.lovenberg@gmail.com>
To: Shard Gupta <shard.kgp@gmail.com>
Cc: kernelnewbies@nl.linux.org, linux-kernel@vger.kernel.org
Subject: Re: Allocating memory in the form of 'BITS'
Date: Tue, 25 Mar 2008 06:36:55 -0400 [thread overview]
Message-ID: <47E8D5C7.4020600@gmail.com> (raw)
In-Reply-To: <983191750803250323k2e944fe0y53e4c0d69edde3b@mail.gmail.com>
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 '|'.
prev parent reply other threads:[~2008-03-25 10:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-25 10:23 Allocating memory in the form of 'BITS' Shard Gupta
2008-03-25 10:36 ` Scott Lovenberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47E8D5C7.4020600@gmail.com \
--to=scott.lovenberg@gmail.com \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shard.kgp@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox