Re: share buffer between user and kernel?

Tommy Reynolds (reynolds@redhat.com)
Mon, 15 Oct 2001 11:12:19 -0500


It was a dark and stormy night. Suddenly "Peter T. Breuer" <ptb@it.uc3m.es> spoke:

> What is the currently approved method of sharing a buffer between
> user space and kernel space, so that I can avoid one or two
> copy_to/from_user?

Two basic choices here:

1) Allocate the buffer in kernel space and use the mmap() method to give the
user-space program access to it; and

2) Allocate the buffer in you user application program and use the KIOBUF method
to give the kernel and/or hardware access to your buffer. Look in
<linux/iobuf.h> for kernel-level inspiration.

---------------------------------------------+-----------------------------
Tommy Reynolds | mailto: <reynolds@redhat.com>
Red Hat, Inc., Embedded Development Services | Phone: +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX: +1.236.837.3839
Senior Software Developer | Mobile: +1.919.641.2923
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/