From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 1 01:39:34 2008 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 F34FF106564A for ; Mon, 1 Dec 2008 01:39:33 +0000 (UTC) (envelope-from bsd.quest@googlemail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 834F78FC08 for ; Mon, 1 Dec 2008 01:39:33 +0000 (UTC) (envelope-from bsd.quest@googlemail.com) Received: by ey-out-2122.google.com with SMTP id 6so911464eyi.7 for ; Sun, 30 Nov 2008 17:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:reply-to:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=LNtxrJnah3LIoYo+XTblO89w2zzy9Qq3CZR7Um0A8G4=; b=ttYepeJlrkyLOdEZ7ubGIVD+NJ7u5y5jjyixDVu7owLG6JZOBFNnp+dtdKXhPdnv8J tGt9rxtePtLbRH8ARCK8/F25UcjiHu99xFkLQDPMQqWU5RjQeVfj22VMZwaABbjzga/l MWfvpLzYN6oeBHhhbjSz6hKsBB1eMH9JtAeQo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:reply-to:mail-followup-to :mime-version:content-type:content-disposition:user-agent; b=uSExmBRoldiKVeCljoeXKTTjuCxxheLubMFPQJF4/eiUXp4uOVErfTfWuQKMbIcZqO SdQoIMU0qq9gCL0LatRM9PwzkaXPeP6x4zankfvR3xyE8WGXmHC/I/gJ9q/kMbyT9hhF PZBBhOWHWfptxP2UjGCtpDPgyrs2nA/kgqnGU= Received: by 10.103.172.9 with SMTP id z9mr4283641muo.109.1228095571836; Sun, 30 Nov 2008 17:39:31 -0800 (PST) Received: from localhost (BAJ3022.baj.pppool.de [77.137.48.34]) by mx.google.com with ESMTPS id 14sm7351790muo.39.2008.11.30.17.39.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 30 Nov 2008 17:39:30 -0800 (PST) Date: Mon, 1 Dec 2008 02:38:51 +0100 From: Alexej Sokolov To: freebsd-hackers@freebsd.org Message-ID: <20081201013851.GA20549@debian.samsung.router> Mail-Followup-To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Subject: remapping kernel buffer in VMS of user process X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alexej Sokolov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 01:39:34 -0000 Hello, I would like to remap some buffers allocated in kernel space to memory space of certain process. For Example, in attach function of driver: static int driver_attach { ... struct vmspace *vms = some_thread->td_proc->p_vmspace; bufp = malloc (PAGE_SIZE, M_DEVBUF, M_NOWAIT); /* How to create in vms of some_thread->td_proc remapping of buffer pointed (in kernel) by bufp ? some_thread should access the buffer using its virtual user addresses and driver should access the same data using its kernel virtual addresses (bufp) */ ... } -- Alexej Sokolov