Joachim Worringen wrote:
> Again, porting drivers from Linux to Solaris... (just to separate the 
> issues).
>
> I need to copy data between kernel and user space, and wonder how those 
> two issues are handled on Solaris:
>
> 1. Check if a given user space address can be accessed for read or 
> write. I could imagine doing a dummy ddi_copyin() and check the return 
> code, but this seems not very elegant. It becomes worse for write 
> access. Linux has an "access_ok()" macro.
>
> 2. Determine if the current context is user-space or kernel, which means 
> if a given address is from user space or kernel space. I already managed 
> to work around this, but it would nevertheless be nice to know.
>
>   thanks, Joachim
>
>   
In Solaris you would need to use copyin(9F)/copyout(9F) or uiomove(9F) 
if you want to use uio. These routines will check the validity of user 
address and return appropriate errors.

Rao.

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to