<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 53, 文章 - 0, 評(píng)論 - 3, 引用 - 0
    數(shù)據(jù)加載中……

    kernel memory mapping summay

    kernel memory mapping summay

    Today, finally I become clear about the relationship between
    fixed mapping
    permanent kernel mapping
    temporary kernel mapping
    noncontiguous memory area mapping
    (I feel that most of the name is not appropriate, to some text, it will mislead the reader.)

    4G linear virtual address space is divided into two major part.
    kernel space mapping     [3G, 4G)
    user space mapping        [0, 3G)

    kernel space mapping is divided into more pieces
    linear mapping [3G, 3G + 896M)
    non linear mapping [3G + 896M + 8M, 4G)
    1. Fixed Mapping (wrong name, should be compile time mapping, the virtual address is decided in compile time. )
    2. Temporary mapping
    3. Permanent mapping
    4. noncontiguous memory area mapping (Vmalloc area)

    The following is the diagram for the reference.

    FIXADDR_TOP            (=0xfffff000)
     
                        fixed_addresses (temporary kernel mapping is part of it)
                         #define __FIXADDR_SIZE  (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
                    
    FIXADDR_START        (FIXADDR_TOP - __FIXADDR_SIZE)
                            
                        temp fixed addresses (used in boot time)
                         #define __FIXADDR_BOOT_SIZE     (__end_of_fixed_addresses << PAGE_SHIFT)
                    
    FIXADDR_BOOT_START    (FIXADDR_TOP - __FIXADDR_BOOT_SIZE)
                            
                        Persistent kmap area (4M)
     
    PKMAP_BASE            ( (FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK )
     
                         2*PAGE_SIZE
     
    VMALLOC_END            (PKMAP_BASE-2*PAGE_SIZE) or (FIXADDR_START-2*PAGE_SIZE)

                         noncontiguous memory area mapping (Vmalloc area)
                        
    VMALLOC_START        (((unsigned long) high_memory + 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1)) 

    high_memory            MIN (896M, phisical memory size)
     
    below the excerp of the source code.

    #ifdef CONFIG_X86_PAE
    #define LAST_PKMAP 512
    #else
    #define LAST_PKMAP 1024
    #endif
                                                                             
    #define VMALLOC_OFFSET  (8*1024*1024)
    #define VMALLOC_START   (((unsigned long) high_memory + \                         
                            2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))   
                                  
    #ifdef CONFIG_HIGHMEM                                             
    # define VMALLOC_END    (PKMAP_BASE-2*PAGE_SIZE)
    #else                                                                    
    # define VMALLOC_END    (FIXADDR_START-2*PAGE_SIZE)              
    #endif

    enum fixed_addresses {
            FIX_HOLE,
            FIX_VDSO,
            FIX_DBGP_BASE,
            FIX_EARLYCON_MEM_BASE,
    #ifdef CONFIG_X86_LOCAL_APIC
            FIX_APIC_BASE,  /* local (CPU) APIC) -- required for SMP or not */
    #endif
    #ifdef CONFIG_X86_IO_APIC
            FIX_IO_APIC_BASE_0,
            FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1,
    #endif
    #ifdef CONFIG_X86_VISWS_APIC
            FIX_CO_CPU,     /* Cobalt timer */
            FIX_CO_APIC,    /* Cobalt APIC Redirection Table */
            FIX_LI_PCIA,    /* Lithium PCI Bridge A */
            FIX_LI_PCIB,    /* Lithium PCI Bridge B */
    #endif
    #ifdef CONFIG_X86_F00F_BUG
            FIX_F00F_IDT,   /* Virtual mapping for IDT */
    #endif
    #ifdef CONFIG_X86_CYCLONE_TIMER
            FIX_CYCLONE_TIMER, /*cyclone timer register*/
    #endif
    #ifdef CONFIG_HIGHMEM
            FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
            FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
    #endif
    #ifdef CONFIG_ACPI
            FIX_ACPI_BEGIN,
            FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
    #endif
    #ifdef CONFIG_PCI_MMCONFIG
            FIX_PCIE_MCFG,
    #endif
    #ifdef CONFIG_PARAVIRT
            FIX_PARAVIRT_BOOTMAP,
    #endif
            __end_of_permanent_fixed_addresses,
            /* temporary boot-time mappings, used before ioremap() is functional */
    #define NR_FIX_BTMAPS   16
            FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
            FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
            FIX_WP_TEST,
            __end_of_fixed_addresses
    }

    posted on 2008-07-16 17:05 InPractice 閱讀(302) 評(píng)論(0)  編輯  收藏


    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 综合偷自拍亚洲乱中文字幕 | 99爱在线观看免费完整版| www.亚洲精品.com| 猫咪免费人成网站在线观看入口| 国产美女无遮挡免费视频网站| 99亚洲乱人伦aⅴ精品| 又色又污又黄无遮挡的免费视| 乱爱性全过程免费视频| 久久久久亚洲?V成人无码| 中文字幕免费观看全部电影| 亚洲精品一品区二品区三品区| 永久免费A∨片在线观看| 亚洲电影一区二区| 免费国产作爱视频网站| 亚洲乱妇老熟女爽到高潮的片| 国产一区二区三区在线免费| 国产乱子伦精品免费视频| 亚洲人成网址在线观看| 可以免费看的卡一卡二| 日日摸日日碰夜夜爽亚洲| 在线日韩日本国产亚洲| 最近2019免费中文字幕6| 亚洲 日韩 色 图网站| 亚洲免费日韩无码系列| 美女视频黄的免费视频网页 | 免费精品视频在线| 国产精品亚洲A∨天堂不卡| 亚洲免费观看网站| 国产亚洲精彩视频| 亚洲AV无码不卡在线播放| 免费精品国产自产拍在线观看图片 | 久久国产精品萌白酱免费| 亚洲免费在线视频播放| 日产国产精品亚洲系列| 最近中文字幕2019高清免费| 蜜臀亚洲AV无码精品国产午夜.| 国产亚洲3p无码一区二区| 免费A级毛片无码免费视| 搜日本一区二区三区免费高清视频| 久久亚洲精品无码aⅴ大香| 国产一区在线观看免费|