0

我经常发现 ioremap 只是使用 PAGE_SIZE 作为它的大小,如:

drivers/spi/spi-orion.c:715:        dir_acc->vaddr = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
drivers/gpu/ipu-v3/ipu-dmfc.c:182:  priv->base = devm_ioremap(dev, base, PAGE_SIZE);
drivers/gpu/ipu-v3/ipu-dp.c:338:    priv->base = devm_ioremap(dev, base, PAGE_SIZE);
drivers/gpu/ipu-v3/ipu-vdi.c:222:   vdi->base = devm_ioremap(dev, base, PAGE_SIZE);
drivers/gpu/ipu-v3/ipu-di.c:729:    di->base = devm_ioremap(dev, base, PAGE_SIZE);

是因为它应该至少映射 PAGE_SIZE,即使它的总长度小于 PAGE_SIZE?

4

0 回答 0