floating-point in driver: what's the *right* way??
From: Dan Miller (dan_at_invalid.net)
Date: 09/16/05
- Previous message: Bill Waddington: "Re: Linux Device Drivers book examples"
- Next in thread: Rich Walker: "Re: floating-point in driver: what's the *right* way??"
- Reply: Rich Walker: "Re: floating-point in driver: what's the *right* way??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Sep 2005 12:13:24 -0500
We have a device driver which needs to do fairly extensive floating-point
math on an ongoing basis (doing carrier acquisition/tracking on RF RX
chips). In our current driver, which runs on kernel 2.2, we just
modified the math-library source code and linked it to our driver - not
recommended, I know, but it's been working.
However, now we want to upgrade to kernel 2.6, and it doesn't even
support type double in the driver... so I want to re-design our driver so
it does this work "correctly", at least with respect to math operations.
What I'd like to do is somehow pass a set of registers up to a user-space
daemon, have it run a set of computations, then pass modified register
set back down to the driver. Sort of a "reverse ioctl", where driver
calls an "ioctl" in the user-space module... of course, no such thing
exists explicitly, but is there some other way to do this??
One way that I've thought of, though it's pretty convoluted (and
certainly doesn't qualify for "kiss principle"), is:
1 register a separate interface (probably character) in the driver just
for the math operations
2 have user-space application call read() on that driver, which will put
it to sleep.
3 when the driver wants to run the set of math operations, it stuffs
relevant data into a buffer and wakes up the daemon.
4 daemon does the math, then write() modified buffer back to driver
5 repeat steps 2-4 as much as necessary.
However, not only is this convoluted as it stands, but we have up to 16
receiver cards in a chassis, so I'd need to have separate threads in the
daemon for each card!! (I already run a separate kernel thread for each
card, to manage this acquisition/tracking requirement).
Does anyone have any better ideas for solving these math requirements??
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
- Previous message: Bill Waddington: "Re: Linux Device Drivers book examples"
- Next in thread: Rich Walker: "Re: floating-point in driver: what's the *right* way??"
- Reply: Rich Walker: "Re: floating-point in driver: what's the *right* way??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|