All of lore.kernel.org
 help / color / mirror / Atom feed
* Resolving physical addresses (change in 2.4.x?)
@ 2002-07-24  6:11 Christoph Baumann
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Baumann @ 2002-07-24  6:11 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-24 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1027491420.32334.linux-kernel2news@redhat.com>
2002-07-24 20:14 ` Resolving physical addresses (change in 2.4.x?) Pete Zaitcev
2002-07-24  6:11 Christoph Baumann

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.