From: Daris A Nevil <dnevil@snmc.com>
To: Tom Roberts <tjroberts@lucent.com>
Cc: "Justin (Gus) Hurwitz" <ghurwitz@dyndns.com>,
linuxppc-embedded@lists.linuxppc.org
Subject: Re: Non-cacheable memory
Date: Tue, 07 Aug 2001 11:34:09 -0700 [thread overview]
Message-ID: <3B7034A0.C55D871F@snmc.com> (raw)
In-Reply-To: 3B70104B.C1E6F8EC@lucent.com
Gus, Tom,
Here is the procedure I used to allocate pages and mark them as non-cached in
the 2.2.5 kernel (SNMC's QSLinux):
mem_addr = __get_free_page(GFP_KERNEL);
pte = va_to_pe(&init_task, mem_addr);
pte_val(*pte) |= _PAGE_NO_CACHE;
flush_tlb_page(current->mm_mmap, mem_addr);
I used these pages for SCC buffer descriptors, so they were never returned to
the system. I'm not sure if this is the preferred way, but it certainly works.
I have not tried this in the 2.4 kernel yet. The functions __get_free_page()
and flush_tlb_page() do exist in 2.4.4, but I could not locate va_to_pe() (I
think that was a macro in 2.2.5).
You may also want to look at the file linux/asm/pgalloc.h, esp. the functions
get_pgd_slow() and get_pgd_fast().
Regards,
Daris Nevil
Tom Roberts wrote:
> "Justin (Gus) Hurwitz" wrote:
> > Does the current 2_4_devel tree have support for allocating regions of
> > non-cachable memory? And, if so, what is the proper (or preferred) way of
> > doing this?
>
> What I did in 2.2.15 was to edit the main startup routine to call my driver
> directly so it could "eat up" a region of memory before Linux started its
> memory management. I then used a BAT to reference it uncached. Yes, this
> is ugly, and requires care in making sure the BAT effective address is
> otherwise unused by the kernel, but it works. This is on a MPC7400, and
> other PowerPC CPUs might not have BATs available....
--
Daris A Nevil
Simple Network Magic Corporation
401 Kentucky Lane
McKinney, TX 75069
214-793-7757
dnevil@snmc.com
www.snmc.com
quickstack.com
qslinux.org
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2001-08-07 18:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-07 18:49 Non-cacheable memory Justin (Gus) Hurwitz
2001-08-07 15:59 ` Tom Roberts
2001-08-07 18:34 ` Daris A Nevil [this message]
2001-08-09 22:49 ` Justin (Gus) Hurwitz
2001-08-09 19:27 ` Peter Desnoyers
2001-08-11 3:47 ` Dan Malek
2001-08-13 15:47 ` Peter Desnoyers
2001-08-14 21:26 ` Dan Malek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B7034A0.C55D871F@snmc.com \
--to=dnevil@snmc.com \
--cc=ghurwitz@dyndns.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=tjroberts@lucent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.