CPUCTL(4) | Device Drivers Manual | CPUCTL(4) |
cpuctl
— cpuctl
pseudo device
To compile this driver into the kernel, place the following lines in your kernel configuration file:
device cpuctl
Alternatively, to load the driver as a module at boot time, place the following in loader.conf(5):
cpuctl_load="YES"
The special device /dev/cpuctl presents interface to the system CPU. It provides functionality to retrieve CPUID information, read/write machine specific registers (MSR) and perform CPU firmware updates.
For each CPU present in the system, the special device /dev/cpuctl%d with the appropriate index will be created. For multicore CPUs such a special device will be created for each core.
Currently, only i386 and amd64 processors are supported.
All of the supported operations are invoked using the ioctl(2) system call. Currently, the following ioctls are defined:
CPUCTL_RDMSR
cpuctl_msr_args_t *argsCPUCTL_WRMSR
cpuctl_msr_args_t *args<sys/cpuctl.h>
as:
typedef struct { int msr; /* MSR to read */ uint64_t data; } cpuctl_msr_args_t;
CPUCTL_MSRSBIT
cpuctl_msr_args_t *argsCPUCTL_MSRCBIT
cpuctl_msr_args_t *argsCPUCTL_CPUID
cpuctl_cpuid_args_t *argstypedef struct { int level; /* CPUID level */ uint32_t data[4]; } cpuctl_cpuid_args_t;
CPUCTL_CPUID_COUNT
request
with level_type set to 0.CPUCTL_CPUID_COUNT
cpuctl_cpuid_count_args_t *argstypedef struct { int level; /* CPUID level */ int level_type; /* CPUID level type */ uint32_t data[4]; } cpuctl_cpuid_count_args_t;
The data field is used to store the received CPUID data. That is, data[0] contains the value of %eax register after the CPUID instruction is executed, data[1] is for %ebx, data[2] for %ecx, and data[3] for %edx.
CPUCTL_UPDATE
cpuctl_update_args_t *args
<sys/cpuctl.h>
as:
typedef struct { void *data; size_t size; } cpuctl_update_args_t;
The data field should point to the firmware image of size size.
For additional information refer to cpuctl.h.
ENXIO
]EINVAL
]ENOMEM
]EFAULT
]The cpuctl
driver first appeared in
FreeBSD 7.2.
The cpuctl
module and this manual page
were written by Stanislav Sedov
<stas@FreeBSD.org>.
Yes, probably, report if any.
June 20, 2014 | Debian |