| X86_64_GET_MTRR(2) | System Calls Manual (x86_64) | X86_64_GET_MTRR(2) | 
x86_64_get_mtrr, x86_64_set_mtrr
  —
#include <sys/types.h>
#include <machine/sysarch.h>
#include <machine/mtrr.h>
int
  
  x86_64_get_mtrr(struct
    mtrr *mtrrp, int
    *n);
int
  
  x86_64_set_mtrr(struct
    mtrr *mtrrp, int
    *n);
mtrrp is a pointer to one or more mtrr
    structures, as described below. The n argument is a
    pointer to an integer containing the number of structures pointed to by
    mtrrp. For x86_64_set_mtrr()
    the integer pointed to by n will be updated to reflect
    the actual number of MTRRs successfully set. For
    x86_64_get_mtrr() no more than
    n structures will be copied out, and the integer value
    pointed to by n will be updated to reflect the actual
    number of valid structures retrieved. A NULL
    argument to mtrrp will result in just the number of
    MTRRs available being returned in the integer pointed to by
    n.
The argument mtrrp has the following structure:
struct mtrr {
        uint64_t base;
        uint64_t len;
        uint8_t type;
        int flags;
        pid_t owner;
};
The location of the mapping is described by its physical base address base and length len. Valid values for type are:
Valid values for flags are:
The owner member is the PID of the user process which claims the mapping. It is only valid if MTRR_PRIVATE is set in flags. To clear/reset MTRRs, use a flags field without MTRR_VALID set.
x86_64_get_mtrr() and
  x86_64_set_mtrr() were derived from their i386
  counterparts, which appeared in NetBSD 1.6.
| November 10, 2001 | NetBSD 9.4 |