Use SCTL_MASK32 to determine that the sysctl call is from a 32bit

binary for kern.cp_time.

Approved by:	re
This commit is contained in:
Paul Saab 2005-06-30 17:17:29 +00:00
parent 4c4bfd6ed4
commit cff2e749e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147703

View File

@ -37,7 +37,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_compat.h"
#include "opt_hwpmc_hooks.h"
#include "opt_ntp.h"
#include "opt_watchdog.h"
@ -85,19 +84,15 @@ SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL)
/* Some of these don't belong here, but it's easiest to concentrate them. */
long cp_time[CPUSTATES];
#ifdef COMPAT_IA32
extern struct sysentvec ia32_freebsd_sysvec;
#endif
static int
sysctl_kern_cp_time(SYSCTL_HANDLER_ARGS)
{
int error;
#ifdef COMPAT_IA32
#ifdef SCTL_MASK32
int i;
unsigned int cp_time32[CPUSTATES];
if (req->td->td_proc->p_sysent == &ia32_freebsd_sysvec) {
if (req->flags & SCTL_MASK32) {
if (!req->oldptr)
return SYSCTL_OUT(req, 0, sizeof(cp_time32));
for (i = 0; i < CPUSTATES; i++)