【问题标题】:What does `PAGE_ALIGN` do to and `unsigned int`? shouldn't it get an address?`PAGE_ALIGN` 对`unsigned int` 有什么作用?它不应该得到一个地址吗?
【发布时间】:2012-12-02 20:11:29
【问题描述】:

在一些帧缓冲区配置代码中,我看到了以下几行:

static unsigned int max_size = 0;

max_size = max(max_size, 8*(mi->xres * (mi->xres + mi->yres)));
    }

max_size = PAGE_ALIGN(max_size);

PAGE_ALIGNunsigned int 做了什么?它不应该得到一个地址吗?

mi is `struct fb_videomode *`

【问题讨论】:

    标签: c linux memory linux-kernel framebuffer


    【解决方案1】:

    它将大小向上舍入为页面大小的精确倍数(通常类似于 4k,但取决于实现)。

    在这种情况下,它不是应用于绝对地址,而是应用于大小 - 这可能会成为地址之间的差异。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-15
      • 2011-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-07
      • 1970-01-01
      相关资源
      最近更新 更多