From owner-freebsd-amd64@FreeBSD.ORG Sat Nov 1 13:33:53 2014 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A12F2FC for ; Sat, 1 Nov 2014 13:33:53 +0000 (UTC) Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB1AC865 for ; Sat, 1 Nov 2014 13:33:52 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id x19so2928906ier.30 for ; Sat, 01 Nov 2014 06:33:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=rdVz7viikNKteZ4c0IAMLA8mBg4AYbjYFF4/wUVTfWs=; b=P2rXQp0CBnpgwH/r9k+aiMEQ4szAVNqNTaWS8Bvsi86Ohw9y8UZw+3p67LkCG97oXW ioWb7//eKLjxSQwaawYLKVy0I6pNMq6+AJq99iHnxYENRmS3bxeByKi9I0KNsWeJN5/4 +aw2YVh/uEtqwrLQxVoJOFeHQ7vGPmad2Rq1zfUH+uhHOpJDNLD2oWM0Q90D2lok419x g5+wHvUkwtpJwP8QW6LiHdwx2Y5ud54n3Shf/mVu0KVCrf37i5AWz7psPZ924yDv5T7F y83QKuyPRWDAEPM1+tMAwbThUFX6Xmams4NrygE+qgSgxDF1u21BAAjRZ4usqRs70bnz onHA== X-Gm-Message-State: ALoCoQm7Vv5SIoFYQuj19iKIeJi8IbtH8eqyaT6PJ1S7+tVqJ/ciiC/H2yt6npeHZiUkXvVaTg93 MIME-Version: 1.0 X-Received: by 10.43.87.79 with SMTP id av15mr30142591icc.44.1414848353643; Sat, 01 Nov 2014 06:25:53 -0700 (PDT) Received: by 10.107.39.129 with HTTP; Sat, 1 Nov 2014 06:25:53 -0700 (PDT) In-Reply-To: <201410301353.05185.jhb@freebsd.org> References: <201410301208.50164.jhb@freebsd.org> <201410301353.05185.jhb@freebsd.org> Date: Sat, 1 Nov 2014 18:55:53 +0530 Message-ID: Subject: Re: memory type e820 From: Sourish Mazumder To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-amd64@freebsd.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2014 13:33:53 -0000 Hi John, I tried the pmap_mapdev() as suggested by you. Works perfectly. Thanks for the information. What is required, If I want to add this nvram memory to VM pages? On Thu, Oct 30, 2014 at 11:23 PM, John Baldwin wrote: > On Thursday, October 30, 2014 12:39:27 pm Sourish Mazumder wrote: > > Hi John, > > > > I want to make a block device out of this nvram memory. So, I will need > to > > perform memcpy() operation into this memory. > > Do I need to add this memory into the vm system, if I need to do > operations > > like memcpy(). > > Ah, so you just need to map it. The most expedient thing you can do for > this > is: > > void *p; > > p = pmap_mapdev(physaddr, len); > > (This uses an uncached mapping). > > When you are finished (e.g during a detach routine if you need to unload > the > driver) you can do: > > pmap_unmapdev((vm_offset_t)p, len); > > Note that for a PCI BAR you would do something different, but for a > resource > you discover via the SMAP and is x86 specific this is ok. > > -- > John Baldwin > -- Sourish Mazumder 9986309755