forked from enlightenment/enlightenment
cpufreq: freebsd fixes
This fixes a sysctlbyname lookup and adds a stub for the "pstate" command. Based on a patch contributed by Dmitry Luhtionov. @fix
This commit is contained in:
parent
fbad4c7fd8
commit
bc41e68f80
|
@ -57,9 +57,8 @@ main(int argc, char *argv[])
|
||||||
#elif defined __FreeBSD__
|
#elif defined __FreeBSD__
|
||||||
if (!strcmp(argv[1], "frequency"))
|
if (!strcmp(argv[1], "frequency"))
|
||||||
{
|
{
|
||||||
int new_frequency = atoi(argv[2]);
|
int newfreq = atoi(argv[2]);
|
||||||
size_t len = sizeof(new_frequency);
|
if (sysctlbyname("dev.cpu.0.freq", NULL, NULL, &newfreq, sizeof(newfreq)) == -1)
|
||||||
if (sysctlbyname("dev.cpu.0.freq", NULL, 0, &new_frequency, &len) == -1)
|
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Unable to open frequency interface for writing.\n");
|
fprintf(stderr, "Unable to open frequency interface for writing.\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -72,6 +71,11 @@ main(int argc, char *argv[])
|
||||||
fprintf(stderr, "Governors not (yet) implemented on FreeBSD.\n");
|
fprintf(stderr, "Governors not (yet) implemented on FreeBSD.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[1], "pstate"))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Pstates not (yet) implemented on FreeBSD.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Unknown command.\n");
|
fprintf(stderr, "Unknown command.\n");
|
||||||
|
|
Loading…
Reference in New Issue