Re: Determining 32bit or 64bit OS from a running kernel module

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

 



On Wed, 23 Oct 2013 11:16:23 +0530, Saket Sinha said:

> I want to write a kernel module which depends on the kernel type (32 or 64
> bit)

In general, that's probably very bad software design.  If you're a module,
you probably shouldn't be mucking with stuff that's 32/64 bit dependent,
and you should be trying to write code that doesn't care (witness the botch that
most people make of ioctl parameters that aren't the same layout for 32 or
64 bit).

However, it's possible you have an actual sane use case for caring inside
a module.

> I know we have CONFIG_X86_64 and CONFIG_X86_32 for  x86 architecture but
> how do I exactly check it in my module code?

I'm totally failing to understand why '#ifdef CONFIG_X86_64' isn't sufficient?

Attachment: pgp0eLZ2LD0Qc.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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