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

View File

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