Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4536
  • 博文数量: 2
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 0
  • 用 户 组: 普通用户
  • 注册时间: 2016-07-08 11:00
文章分类
文章存档

2016年(2)

我的朋友
最近访客

分类: LINUX

2016-07-22 09:58:44

原文地址:关于cache和write buffer 作者:瀚海书香

1. 关于cache和write buffer
       cache和write buffer都是内置于CPU内部的一小段高速存储器,cache中保存着最近一段时间被CPU使用过的内存数据,而write buffer则是用来应对内存的写操作的,将原本要写向内存的数据暂写到write buffer中,等到CPU空闲的时候,数据才会慢慢地被搬移到内存里。

2.关于cache、write buffer配置
   
3. 关于内核中配置
    /* non-cached, non-buffered*/
    #define pgprot_noncached(prot) \
        __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)

    /* non-cached, buffered*/
    #define pgprot_writecombine(prot) \
        __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)


    /* 支持DMA write buffer */
    #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
        #define pgprot_dmacoherent(prot) \
            __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE | L_PTE_XN)
        #define __HAVE_PHYS_MEM_ACCESS_PROT
        struct file;
        extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
                                     unsigned long size, pgprot_t vma_prot);
    #else
        #define pgprot_dmacoherent(prot) \
            __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED | L_PTE_XN)
    #endif
阅读(400) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~