LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2005, 07:27 AM   #1
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Oversized math in kernel modules?


I recently realized that simple C arithmetic operators (+-/*%) for operations that can't be done in a register require separately linked functions to work when compiling with gcc. What I mean by this is that a 64 bit integer operation on a 32 bit processor cannot be done in a register obviously, therefore gcc uses the function i.e. _divdi3 for division, etc. This is all fine unless you are using this operation in a kernel module where you can't link. Does anyone know of a way around this; perhaps the actual C functions that are used for the calculations? Thanks.
ta0kira
 
Old 07-21-2005, 11:20 AM   #2
-0-
Member
 
Registered: Nov 2004
Location: London uk
Distribution: Slack 10
Posts: 67

Rep: Reputation: 15
http://swox.com/gmp/


try that, or another bignum library, they're designed to work on large numbers.
 
Old 07-21-2005, 11:39 AM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Thanks.
ta0kira
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error while accessing math functions in kernel modules dypgrp Programming 0 01-19-2005 09:12 AM
kernel recompile questions(math & SCSI) name_in_use450 Linux - General 1 08-02-2004 01:46 PM
Kernel Modules and modules.conf init Linux - General 0 02-20-2004 06:51 PM
new kernel (2.4.22 up from 2.4.20-6) - missing modules - use old modules? Simon Bridge Linux - Software 1 02-04-2004 05:52 AM
Kernel modules: why are some kernel modules zipped? hampel Slackware 3 06-30-2003 06:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration