lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 25 Mar 2008 06:36:55 -0400
From:	Scott Lovenberg <scott.lovenberg@...il.com>
To:	Shard Gupta <shard.kgp@...il.com>
CC:	kernelnewbies@...linux.org, linux-kernel@...r.kernel.org
Subject: Re: Allocating memory in the form of 'BITS'

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@...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 '|'.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ