FreeBSD Bugzilla – Attachment 14694 Details for
Bug 27543
/proc/cpuinfo does not handle SMP hosts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.27 KB, created by
Jim.Pirzyk
on 2001-05-22 20:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jim.Pirzyk
Created:
2001-05-22 20:40:01 UTC
Size:
1.27 KB
patch
obsolete
>--- linprocfs_misc.c.orig Thu Dec 7 05:17:55 2000 >+++ linprocfs_misc.c Tue May 22 12:28:54 2001 >@@ -52,6 +52,7 @@ > #include <sys/tty.h> > #include <sys/vnode.h> > #include <sys/lock.h> >+#include <sys/sysctl.h> > > #include <vm/vm.h> > #include <vm/pmap.h> >@@ -174,7 +175,7 @@ > int xlen; > char psbuf[512]; /* XXX - conservative */ > int class; >- int i; >+ int ncpu, mib[2], i, cpucnt, olen=sizeof(ncpu), plen=0; > #if 0 > extern char *cpu_model; /* Yuck */ > #endif >@@ -217,14 +218,22 @@ > break; > } > >+ mib[0] = CTL_HW; mib[1] = HW_NCPU; >+ if (kernel_sysctl(p, mib, 2, &ncpu, &olen, NULL, 0, &plen)) >+ ncpu=1; /* Fake out if the sysctl failed */ >+ > ps = psbuf; >- ps += sprintf(ps, >+ >+ for (cpucnt = 0; cpucnt < ncpu; cpucnt++) { >+ if ( cpucnt ) ps += sprintf (ps, "\n"); >+ >+ ps += sprintf(ps, > "processor\t: %d\n" > "vendor_id\t: %.20s\n" > "cpu family\t: %d\n" > "model\t\t: %d\n" > "stepping\t: %d\n", >- 0, cpu_vendor, class, cpu, cpu_id & 0xf); >+ cpucnt, cpu_vendor, class, cpu, cpu_id & 0xf); > > ps += sprintf(ps, > "flags\t\t:"); >@@ -248,6 +257,7 @@ > (tsc_freq + 4999) / 1000000, > ((tsc_freq + 4999) / 10000) % 100); > } >+ } > > xlen = ps - psbuf; > xlen -= uio->uio_offset;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27543
: 14694