mtrr.h 793 B

123456789101112131415161718
  1. /* MTRR write-combining for MMIO framebuffer ranges. */
  2. #ifndef MTRR_H
  3. #define MTRR_H
  4. /* Program one variable-range MTRR as write-combining over [base, base+size),
  5. * or reuse an entry an earlier boot already left there. Returns 1 when a WC
  6. * range covering the request is in place and fills wc_base and wc_size with the
  7. * range that entry actually covers (it is size-aligned and rounded up);
  8. * returns 0 if the CPU lacks MTRR, has no free variable ranges, or the range
  9. * cannot be covered by a single size-aligned region. */
  10. int mtrr_set_wc(unsigned int base, unsigned int size,
  11. unsigned int *wc_base, unsigned int *wc_size);
  12. /* Effective MTRR type of a physical address (0 UC, 1 WC, 4 WT, 5 WP,
  13. * 6 WB), or -1 without usable MTRRs. */
  14. int mtrr_mem_type(unsigned int phys);
  15. #endif