From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 20 20:05:14 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 545E0106566B for ; Tue, 20 Sep 2011 20:05:14 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id D945F8FC16 for ; Tue, 20 Sep 2011 20:05:13 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=yVKV3zusvCapyMfYJBNW2j35FMEuTKq6vh/tt/1L5+g= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=d1FtHp7U9EQA:10 a=WQU8e4WWZSUA:10 a=Q9fys5e9bTEA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=V_AnRJfqi--2y7o2DCcA:9 a=PUjeQqilurYA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 14131984; Tue, 20 Sep 2011 22:05:12 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org, geoffrey levand Date: Tue, 20 Sep 2011 22:02:19 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?utf-8?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?utf-8?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201109202202.19481.hselasky@c2i.net> Cc: Subject: Re: Sharing device driver between kernel and user space X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2011 20:05:14 -0000 On Tuesday 20 September 2011 20:35:57 geoffrey levand wrote: > Currently i'm developing VUART device drivers for PS3 architecture. VUART > is bi-directional FIFO queue between 2 logical partitions on PS3. I want > to use the device in the kernel and user space. During system boot PS3 > system has to read/write some data from/to the VUART devices and sometimes > i want to access the device from user space , e.g. with character device > driver by using read/write syscalls. The quuestion is what is the best > solution to share the device between kernel and user lands. One solution i > found would be to porohibit kernel access to the device as soon as a user > application opens the corresponding character device. And allow it again > when the application calls close syscall. The user space should have > higher priority then the kernel. Are there any better solutions for this > problem ? Forgot to mention that a VUART device cannot be accessed > simultaneously by user land and the kernel. The VUART devices are used by > PS3 management logical partition to provide different request/response > services and event notification to other logical partitions. E.g. setting > video mode or configuring audio outputs. > Have you looked at cuse4bsd in ports/multimedia/cuse4bsd-kmod ? --HPS