mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
Make cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void.
There is no error to report. Requested by: attilio Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
39e04d7c8a
commit
4af58157b6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267814
|
@ -67,9 +67,9 @@ static d_ioctl_t cpuctl_ioctl;
|
|||
|
||||
static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd,
|
||||
struct thread *td);
|
||||
static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data,
|
||||
static void cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data,
|
||||
struct thread *td);
|
||||
static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
|
||||
static void cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
|
||||
struct thread *td);
|
||||
static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data,
|
||||
struct thread *td);
|
||||
|
@ -171,7 +171,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
|
|||
ret = cpuctl_do_msr(cpu, (cpuctl_msr_args_t *)data, cmd, td);
|
||||
break;
|
||||
case CPUCTL_CPUID:
|
||||
ret = cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td);
|
||||
cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td);
|
||||
ret = 0;
|
||||
break;
|
||||
case CPUCTL_UPDATE:
|
||||
ret = priv_check(td, PRIV_CPUCTL_UPDATE);
|
||||
|
@ -180,8 +181,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
|
|||
ret = cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td);
|
||||
break;
|
||||
case CPUCTL_CPUID_COUNT:
|
||||
ret = cpuctl_do_cpuid_count(cpu,
|
||||
(cpuctl_cpuid_count_args_t *)data, td);
|
||||
cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_count_args_t *)data,
|
||||
td);
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
ret = EINVAL;
|
||||
|
@ -194,7 +196,7 @@ cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
|
|||
/*
|
||||
* Actually perform cpuid operation.
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
|
||||
struct thread *td)
|
||||
{
|
||||
|
@ -213,21 +215,18 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
|
|||
set_cpu(cpu, td);
|
||||
cpuid_count(data->level, data->level_type, data->data);
|
||||
restore_cpu(oldcpu, is_bound, td);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
|
||||
{
|
||||
cpuctl_cpuid_count_args_t cdata;
|
||||
int error;
|
||||
|
||||
cdata.level = data->level;
|
||||
/* Override the level type. */
|
||||
cdata.level_type = 0;
|
||||
error = cpuctl_do_cpuid_count(cpu, &cdata, td);
|
||||
cpuctl_do_cpuid_count(cpu, &cdata, td);
|
||||
bcopy(cdata.data, data->data, sizeof(data->data)); /* Ignore error */
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -292,12 +291,7 @@ cpuctl_do_update(int cpu, cpuctl_update_args_t *data, struct thread *td)
|
|||
("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu));
|
||||
DPRINTF("[cpuctl,%d]: XXX %d", __LINE__, cpu);
|
||||
|
||||
ret = cpuctl_do_cpuid(cpu, &args, td);
|
||||
if (ret != 0) {
|
||||
DPRINTF("[cpuctl,%d]: cannot retrive cpuid info for cpu %d",
|
||||
__LINE__, cpu);
|
||||
return (ENXIO);
|
||||
}
|
||||
cpuctl_do_cpuid(cpu, &args, td);
|
||||
((uint32_t *)vendor)[0] = args.data[1];
|
||||
((uint32_t *)vendor)[1] = args.data[3];
|
||||
((uint32_t *)vendor)[2] = args.data[2];
|
||||
|
|
Loading…
Reference in a new issue