mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christoph Baumann" <cb@sorcus.com>
To: <linux-kernel@vger.kernel.org>
Subject: Resolving physical addresses (change in 2.4.x?)
Date: Wed, 24 Jul 2002 08:11:11 +0200	[thread overview]
Message-ID: <010f01c232d8$e9b56860$2b65a8c0@Mitarb> (raw)

Hi,

with a 2.2.19 kernel I used the routine below to resolve physical addresses
for preparing gather/scatter DMA. Using it on unmapped memory (allocated but
not yet used) it returned zero. Knowing this I could force the mapping of
such memory. Now with 2.4.x kernels I get something like 0x100000 for
unmapped pages.
Even recognizing these as unmapped and resolving anew, produced a frozen
machine once the DMA used these addresses. Was there a change in 2.4.x so
that my resolving routine now works incorrect?

/*resolve virt. addresses to phys.*/
unsigned long ch_get_physpage(unsigned long virtaddr)
{
  /*Stuff for browsing through the memory page tables*/
  pgd_t *pgd_t_dir;
  pmd_t *pmd_t_dir;
  pte_t *pte_t_dir;

  /*Get physical address*/
  pgd_t_dir=pgd_offset(current->mm,virtaddr);
  pmd_t_dir=pmd_offset(pgd_t_dir,virtaddr);
  pte_t_dir=pte_offset(pmd_t_dir,virtaddr);
  return virt_to_bus((void *)pte_page(*pte_t_dir));
}


Mit freundlichen Gruessen / Best regards
Dipl.-Phys. Christoph Baumann
---
SORCUS Computer GmbH
Im Breitspiel 11 c
D-69126 Heidelberg

Tel.: +49(0)6221/3206-0
Fax: +49(0)6221/3206-66


             reply	other threads:[~2002-07-24  6:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-24  6:11 Christoph Baumann [this message]
     [not found] <mailman.1027491420.32334.linux-kernel2news@redhat.com>
2002-07-24 20:14 ` Pete Zaitcev

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='010f01c232d8$e9b56860$2b65a8c0@Mitarb' \
    --to=cb@sorcus.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®