mirror of
https://github.com/openbsd/src.git
synced 2026-04-16 18:24:23 +00:00
remove unneeded CPUTYP ifdefs
ok deraadt@
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: kern_sched.c,v 1.114 2026/03/31 16:46:22 deraadt Exp $ */
|
||||
/* $OpenBSD: kern_sched.c,v 1.115 2026/04/08 12:40:12 jsg Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org>
|
||||
*
|
||||
@@ -878,17 +878,13 @@ sysctl_hwsmt(void *oldp, size_t *oldlenp, void *newp, size_t newlen)
|
||||
{
|
||||
int err, newsmt = 1, newblockcpu = 0;
|
||||
|
||||
#ifdef CPUTYP_SMT
|
||||
if (sched_blockcpu & CPUTYP_SMT)
|
||||
newsmt = 0;
|
||||
#endif
|
||||
err = sysctl_int_bounded(oldp, oldlenp, newp, newlen, &newsmt, 0, 1);
|
||||
if (err || newp == NULL)
|
||||
return err;
|
||||
#ifdef CPUTYP_SMT
|
||||
if (newsmt)
|
||||
newblockcpu &= ~CPUTYP_SMT;
|
||||
#endif
|
||||
return sched_cpuadjust(newblockcpu);
|
||||
}
|
||||
|
||||
@@ -898,22 +894,14 @@ sysctl_hwblockcpu(void *oldp, size_t *oldlenp, void *newp, size_t newlen)
|
||||
int err, newblockcpu;
|
||||
char type[8], *typ = type;
|
||||
|
||||
#ifdef CPUTYP_SMT
|
||||
if (sched_blockcpu & CPUTYP_SMT)
|
||||
*typ++ = 'S';
|
||||
#endif
|
||||
#ifdef CPUTYP_P
|
||||
if (sched_blockcpu & CPUTYP_P)
|
||||
*typ++ = 'P';
|
||||
#endif
|
||||
#ifdef CPUTYP_E
|
||||
if (sched_blockcpu & CPUTYP_E)
|
||||
*typ++ = 'E';
|
||||
#endif
|
||||
#ifdef CPUTYP_L
|
||||
if (sched_blockcpu & CPUTYP_L)
|
||||
*typ++ = 'L';
|
||||
#endif
|
||||
*typ = '\0';
|
||||
if (newp == NULL)
|
||||
return sysctl_rdstring(oldp, oldlenp, newp, type);
|
||||
@@ -923,26 +911,18 @@ sysctl_hwblockcpu(void *oldp, size_t *oldlenp, void *newp, size_t newlen)
|
||||
return err;
|
||||
for (newblockcpu = 0, typ = type; *typ; typ++) {
|
||||
switch (*typ) {
|
||||
#ifdef CPUTYP_SMT
|
||||
case 'S':
|
||||
newblockcpu |= CPUTYP_SMT;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CPUTYP_P
|
||||
case 'P':
|
||||
newblockcpu |= CPUTYP_P;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CPUTYP_P
|
||||
case 'E':
|
||||
newblockcpu |= CPUTYP_E;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CPUTYP_P
|
||||
case 'L':
|
||||
newblockcpu |= CPUTYP_L;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user