All of lore.kernel.org
 help / color / mirror / Atom feed
* unresolved symbol litodp,dptoli,dpmul - floating point operations in kernel
@ 2003-10-10 13:59 durai
  2003-10-10 14:28 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: durai @ 2003-10-10 13:59 UTC (permalink / raw)
  To: mips

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

hello,
I am using a mips cross compiler (mips-linux-gcc, version 2.95.3) to build my driver
I am using some floating point operations in a wireless lan driver for a mips platform in ucLinux, When i load the driver I am getting unresolved symbols

> 
> insmod: unresolved symbol dptoli
> insmod: unresolved symbol dpmul
> insmod: unresolved symbol litodp

And somebody told me that we cannot use floating point operations in kernel code, but i desperately need to use floating point operations. 
please tell me how to use floating point operations in kernel code.

thanks & regards
durai

[-- Attachment #2: Type: text/html, Size: 1349 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: unresolved symbol litodp,dptoli,dpmul - floating point operations in kernel
  2003-10-10 13:59 unresolved symbol litodp,dptoli,dpmul - floating point operations in kernel durai
@ 2003-10-10 14:28 ` Geert Uytterhoeven
  2003-10-10 16:58   ` Jun Sun
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2003-10-10 14:28 UTC (permalink / raw)
  To: durai; +Cc: mips

On Fri, 10 Oct 2003, durai wrote:
> I am using a mips cross compiler (mips-linux-gcc, version 2.95.3) to build my driver
> I am using some floating point operations in a wireless lan driver for a mips platform in ucLinux, When i load the driver I am getting unresolved symbols
> 
> > 
> > insmod: unresolved symbol dptoli
> > insmod: unresolved symbol dpmul
> > insmod: unresolved symbol litodp
> 
> And somebody told me that we cannot use floating point operations in kernel code, but i desperately need to use floating point operations. 
> please tell me how to use floating point operations in kernel code.

Do not use floating point operations in kernel code.
Re-implement using fixed point or something like that.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: unresolved symbol litodp,dptoli,dpmul - floating point operations in kernel
  2003-10-10 14:28 ` Geert Uytterhoeven
@ 2003-10-10 16:58   ` Jun Sun
  2003-10-13 20:54     ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Jun Sun @ 2003-10-10 16:58 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: durai, mips, jsun

On Fri, Oct 10, 2003 at 04:28:27PM +0200, Geert Uytterhoeven wrote:
> On Fri, 10 Oct 2003, durai wrote:
> > I am using a mips cross compiler (mips-linux-gcc, version 2.95.3) to build my driver
> > I am using some floating point operations in a wireless lan driver for a mips platform in ucLinux, When i load the driver I am getting unresolved symbols
> > 
> > > 
> > > insmod: unresolved symbol dptoli
> > > insmod: unresolved symbol dpmul
> > > insmod: unresolved symbol litodp
> > 
> > And somebody told me that we cannot use floating point operations in kernel code, but i desperately need to use floating point operations. 
> > please tell me how to use floating point operations in kernel code.
> 
> Do not use floating point operations in kernel code.
> Re-implement using fixed point or something like that.
>

If you are really really desparate, something like the following
might work.

void use_fpu(void)
{
	if (is_fpu_owner()) {
		save_fp(current);
		loose_fpu();
		enable_fpu();
	}
	local_irq_save(flags);
	
	/* now use fpu and store the results */

	local_irq_restore(flags);
}

I like to emphsize this is just a hack and I am not even sure if it will work
at all.  If compiler complains you might have to change the
CC flag for that file or use fpu with inline assembly.

Jun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: unresolved symbol litodp,dptoli,dpmul - floating point operations in kernel
  2003-10-10 16:58   ` Jun Sun
@ 2003-10-13 20:54     ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2003-10-13 20:54 UTC (permalink / raw)
  To: Jun Sun; +Cc: Geert Uytterhoeven, durai, mips

On Fri, Oct 10, 2003 at 09:58:24AM -0700, Jun Sun wrote:

> > > > insmod: unresolved symbol dptoli
> > > > insmod: unresolved symbol dpmul
> > > > insmod: unresolved symbol litodp

> If you are really really desparate, something like the following
> might work.
> 
> void use_fpu(void)
> {
> 	if (is_fpu_owner()) {
> 		save_fp(current);
> 		loose_fpu();
> 		enable_fpu();
> 	}
> 	local_irq_save(flags);
> 	
> 	/* now use fpu and store the results */
> 
> 	local_irq_restore(flags);
> }
> 
> I like to emphsize this is just a hack and I am not even sure if it will work
> at all.  If compiler complains you might have to change the
> CC flag for that file or use fpu with inline assembly.

The symbols he was missing are used for software floating point.  Software
floating point in kernel space is perfectly ok since it doesn't use the FPU
so your hack isn't even needed.

  Ralf

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-13 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-10 13:59 unresolved symbol litodp,dptoli,dpmul - floating point operations in kernel durai
2003-10-10 14:28 ` Geert Uytterhoeven
2003-10-10 16:58   ` Jun Sun
2003-10-13 20:54     ` Ralf Baechle

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.