Messages in this thread |  | | From | Daniel Phillips <> | Subject | Re: Calculating kernel logical address .. | Date | Sat, 7 Sep 2002 03:44:53 +0200 |
| |
On Friday 06 September 2002 05:34, Imran Badr wrote: > if (!pgd_none(*pgd)) { > pmd = pmd_offset(pgd, adr); > if (!pmd_none(*pmd)) { > ptep = pte_offset(pmd, adr); > pte = *ptep; > if(pte_present(pte)) { > kaddr = (unsigned long) page_address(pte_page(pte)); > kaddr |= (adr & (PAGE_SIZE - 1)); > } > } > } > > Will this code always give me correct kernel logical address? > > I will really appreciate any guidance.
It looks good to me. Note that somebody has added some new voodoo in 2.5 so that page table pages can be in highmem, with the result that the above code won't work in 2.5, whether or not highmem is configured.
-- Daniel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |