- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I try hard to write a Linux driver module with IPP functions. But I failed to use ipp funcs in module. I attached my simple test code and makefile. Is there anybody to help me look into it and tell me how to use ipp functions in kernel-space correctly.
Thanks in advance,
Paul
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is some information about the IPP in kernel mode both Win OS and Linux: Link://software.intel.com/en-us/articles/code-samples-for-intel-integrated-performance-primitives-intel-ipp-library-71
Please check this directory(zip file) advanced-usage/application/ippsdrv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Paul,
Look please into IPP User's Guide for Linux. There's something about PIC and non-PIC libraries. Looks like for driver mode the non-PIC libraries are necessary. They should not contain offset tables.
Regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sergey,
You are right. non-PIC libraries are necessary for driver mode. But I still can't work. Some errors occured like the system log I posted. And I find an IPP official sample for driver mode "ippsdrv". But I failed to build it on my linux box, it seems like that some floating operations can be found in kernel space.
Paul
Sergey Khlystov (Intel) wrote:
Hi Paul,
Look please into IPP User's Guide for Linux. There's something about PIC and non-PIC libraries. Looks like for driver mode the non-PIC libraries are necessary. They should not contain offset tables.
Regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is qouted sentence from one of Linux dev forums regarding floating point code in driver|
"Basically you have to compile hardware floating-point capabilities into your module (with -mhard-float) and use two kernel functions kernel_fpu_begin() and kernel_fpu_end() "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use next define before including IPP
#define IPPAPI( type,name,arg ) extern type name arg __attribute__ ((regparm(0)));
or use -mregparm=3 for GCC cmd line. Linux kernel mode modules use different ABI - so called "fast call" that corresponds to Borland definition (passing parms are in eax, edx, ecx), not to MS one
regards
Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use next define before including IPP
#define IPPAPI( type,name,arg ) extern type name arg __attribute__ ((regparm(0)));
or use -mregparm=3 for GCC cmd line. Linux kernel mode modules use different ABI - so called "fast call" that corresponds to Borland definition (passing parms are in eax, edx, ecx), not to MS one
regards
Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry for "-mregparm=3" - this is not correct - this is default definition for all kenel mode APIs and you should show to compiler that IPP API has different from kernel mode ABI - so only __atribute__(regparm(0)) can help
regards
Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Igor,
so are these routines kernel_fpu_begin() and kernel_fpu_end() not used(called) from within IPP ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IPP functions are general purpose primitives, they don't have internaly any specific related to user or kernel mode execution. So it is user responsibility to wrapp IPP calls with kernel_fpu_begin()/end().
regards, Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Igor Astakhov (Intel) wrote:
IPP functions are general purpose primitives, they don't have internaly any specific related to user or kernel mode execution. So it is user responsibility to wrapp IPP calls with kernel_fpu_begin()/end().
regards, Igor
Thanks Igor for explaining this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Igor,
I used the "__atribute__(regparm(0))" method to fix my problem. Thank you.
And I appreciate all comments from Sergey and iliyapolak.
Paul
Igor Astakhov (Intel) wrote:
Use next define before including IPP
#define IPPAPI( type,name,arg ) extern type name arg __attribute__ ((regparm(0)));
or use -mregparm=3 for GCC cmd line. Linux kernel mode modules use different ABI - so called "fast call" that corresponds to Borland definition (passing parms are in eax, edx, ecx), not to MS one
regards
Igor
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »