From: Ben Greear <greearb@candelatech.com>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: unresolved symbol: __udivdi3
Date: Fri, 19 Apr 2002 14:58:10 -0700 [thread overview]
Message-ID: <3CC092F2.8090009@candelatech.com> (raw)
In-Reply-To: <Pine.LNX.4.33L2.0204191408450.15597-100000@dragon.pdx.osdl.net>
Randy.Dunlap wrote:
> On Fri, 19 Apr 2002, Ben Greear wrote:
>
> | I would like to be able to devide 64bit numbers in a kernel module,
> | but I get unresolved symbols when trying to insmod.
> |
> | Does anyone have any ideas how to get around this little issue
> | (without the obvious of casting the hell out of all my __u64s
> | when doing division and throwing away precision.)?
>
> Did you look at linux/include/asm*/div64.h ?
I changed my code to look like this:
char *p = info->pg_result;
__u64 mbps = 0;
__u64 t1 = (info->pg_sofar*1000);
__u64 t2 = do_div(total, 1000);
__u64 pps = 0; /* do_div(t1, t2); */
t1 = (info->pg_sofar * 1000);
mbps = 0;/* do_div(t1, t2); */
/* mbps *= info->pkt_size; */
This code will load w/out problems. However, if I uncomment the do_div
on the line: __u64 pps = 0; /* do_div(t1, t2); */
then I get another unresolved symbol:
__umodi3
I'm guessing that there is some optimization the compiler is doing that
is using the mod operator somehow, but I am unsure about how to work around
this.
Thanks,
Ben
>
>
--
Ben Greear <greearb@candelatech.com> <Ben_Greear AT excite.com>
President of Candela Technologies Inc http://www.candelatech.com
ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear
next prev parent reply other threads:[~2002-04-19 21:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-19 21:03 unresolved symbol: __udivdi3 Ben Greear
2002-04-19 21:09 ` Randy.Dunlap
2002-04-19 21:58 ` Ben Greear [this message]
2002-04-19 21:56 ` David S. Miller
2002-04-19 22:12 ` Ben Greear
2002-04-19 23:33 ` Ben Greear
2002-04-19 23:42 ` Randy.Dunlap
2002-04-20 19:02 ` Chris Caputo
2002-04-25 6:15 ` Randy.Dunlap
2002-04-25 7:35 ` swap_free: Bad swap offset entry Robert Schelander
2002-04-25 14:05 ` Hugh Dickins
2002-04-19 21:38 ` unresolved symbol: __udivdi3 Andreas Dilger
2002-04-20 16:25 ` GOTO Masanori
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=3CC092F2.8090009@candelatech.com \
--to=greearb@candelatech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rddunlap@osdl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.