Machine-translated by Google. Questions are authored in English.
Top

Discussion

Peripheral register accesses in a Linux driver are made with readl and writel rather than plain dereferences chiefly to

  • A.record every access in the kernel log
  • B.provide the barriers and ordering the device needs
  • C.convert the virtual address back to a physical one
  • D.check that the register is within the mapped range

Answer: B

The accessors carry the compiler and processor barriers appropriate to the architecture and handle byte order where it differs, which a bare pointer dereference does not. On some architectures the difference is decisive.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.