�� �� laws (law) �拇������到: ��
: no you must use vmalloc_to_page which go though 3-4 level page table to get
: the page pointer, simple linear convert can't be correct if mem is alloced via 
: vmalloc...

��说vmalloc_to_page��2.5�����诤说�
����一��2.4�拇��,��一些�����发��2.4������实��vmalloc_to_page��应�墓��艿�


/* Given PGD from the address space's page table, return the kernel
 * virtual mapping of the physical memory mapped at ADR.
 */
static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr)
{
    unsigned long ret = 0UL;
    pmd_t *pmd;
    pte_t *ptep, pte;

    if (!pgd_none(*pgd)) {
        pmd = pmd_offset(pgd, adr);
        if (!pmd_none(*pmd)) {
            ptep = pte_offset(pmd, adr);
            pte = *ptep;
            if (pte_present(pte)) {
                ret = (unsigned long) page_address(pte_page(pte));
                ret |= (adr & (PAGE_SIZE - 1));
            }
        }
    }

    return ret;
}


/* Here we want the physical address of the memory.
 * This is used when initializing the contents of the
 * area and marking the pages as reserved.
 */
static inline unsigned long kvirt_to_pa(unsigned long adr)
{
    unsigned long va, kva, ret;

    va = VMALLOC_VMADDR(adr);
    kva = uvirt_to_kva(pgd_offset_k(va), va);
    ret = __pa(kva);
    return ret;
}

mem = vmalloc_32(size);
adr = (unsigned long) mem;
page = kvirt_to_pa(adr);
virt_to_page(__va(page))
�佣�玫���应��page页��������2.4����实�址��������懈����,����vmalloc实�史���������诖�只���堑投��存,�����歉叨��存,��为之���玫���page_address
/*
 * Permanent address of a page. Obviously must never be
 * called on a highmem page.
 */
#define page_address(page) ((page)->virtual)

��知��2.6��vmalloc_to_page�欠�也���������疲���
--

�� ��源:��水木���� http://newsmth.net��[FROM: 218.58.78.*]