On 07/23/10 03:28 AM, James C. McPherson wrote:
On 23/07/10 07:14 PM, 邓宁 wrote:
Dear solaris gurus,
I have a stupid question when writing a program under solaris. In the
program, I want to use the system function ddi_fls() and ddi_ffs().
From its description at
http://docs.sun.com/app/docs/doc/819-2256/ddi-ffs-9f?q=StarOffice&s=t&a=view
<http://docs.sun.com/app/docs/doc/819-2256/ddi-ffs-9f?q=StarOffice&s=t&a=view>,
I think it can meet my requirement.
...
and got some error at linking stage:
Undefined symbol first referenced in file
ddi_ffs /var/tmp//ccu...
ddi_fls /var/tmp//...
ld: fatal: symbol referencing errors.
Can you show me how to use the ddi_XXXX() function in my userland code?
I did a quick check using cscope on the ON gate, and I cannot
find any example of these functions being used in userland.
All the usage I find of them is in the kernel ($SRC/uts).
When I read through $SRC/uts/common/sys/sunddi.h, I see that
those functions are contained within an
#ifdef _KERNEL
block, so it seems to me that the manpage (and WDD) is incorrect
because you cannot use these two functions outside of the kernel.
It says that you can call them from user *context*; that means "in the top half
of the device driver", not "from userland".
Everything in section 9 is kernel....9e for entry points provided by drivers, 9f
for functions drivers can call, 9s for kernel/ddi structs.
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss