FreeBSD Bugzilla – Attachment 9867 Details for
Bug 20029
linprocfs does not accurately emulate Linux 2.2.x /proc/cpuinfo
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.49 KB, created by
brad
on 2000-07-19 07:40:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
brad
Created:
2000-07-19 07:40:00 UTC
Size:
3.49 KB
patch
obsolete
>*** /home/brad/linprocfs_misc.c Tue Jul 18 23:20:07 2000 >--- linprocfs_misc.c Tue Jul 18 22:50:25 2000 >*************** >*** 59,64 **** >--- 59,66 ---- > > #include <machine/md_var.h> > #include <machine/cputypes.h> >+ #include <machine/clock.h> >+ #include <machine/md_var.h> > > struct proc; > >*************** >*** 159,202 **** > int xlen; > int error; > char psbuf[512]; /* XXX - conservative */ >! char *class; > #if 0 > extern char *cpu_model; /* Yuck */ > #endif > > if (uio->uio_rw != UIO_READ) > return (EOPNOTSUPP); > > switch (cpu_class) { > case CPUCLASS_286: >! class = "286"; > break; > case CPUCLASS_386: >! class = "386"; > break; > case CPUCLASS_486: >! class = "486"; > break; > case CPUCLASS_586: >! class = "586"; > break; > case CPUCLASS_686: >! class = "686"; > break; > default: >! class = "unknown"; > break; > } > > ps = psbuf; > ps += sprintf(ps, > "processor : %d\n" >- "cpu : %.3s\n" >- "model : %.20s\n" > "vendor_id : %.20s\n" > "stepping : %d\n", >! 0, class, "unknown", cpu_vendor, cpu_id); > > xlen = ps - psbuf; > xlen -= uio->uio_offset; > ps = psbuf + uio->uio_offset; >--- 161,239 ---- > int xlen; > int error; > char psbuf[512]; /* XXX - conservative */ >! int class; >! int i; > #if 0 > extern char *cpu_model; /* Yuck */ > #endif >+ /* We default the flags to include all non-conflicting flags, >+ and the Intel versions of conflicting flags. Note the space >+ before each name; that is significant, and should be >+ preserved. */ >+ >+ static char *flags[] = {" fpu", " vme", " de", " pse", " tsc", >+ " msr", " pae", " mce", " cx8", " apic", >+ " sep", " sep", " mtrr", " pge", " mca", >+ " cmov", " pat", " pse36", " pn", " b19", >+ " b20", " b21", " mmxext", " mmx", " fxsr", >+ " xmm", " b26", " b27", " b28", " b29", >+ " 3dnowext", " 3dnow"}; > > if (uio->uio_rw != UIO_READ) > return (EOPNOTSUPP); > > switch (cpu_class) { > case CPUCLASS_286: >! class = 2; > break; > case CPUCLASS_386: >! class = 3; > break; > case CPUCLASS_486: >! class = 4; > break; > case CPUCLASS_586: >! class = 5; > break; > case CPUCLASS_686: >! class = 6; > break; > default: >! class = 0; > break; > } > > ps = psbuf; > ps += sprintf(ps, > "processor : %d\n" > "vendor_id : %.20s\n" >+ "cpu family : %d\n" >+ "model : %d\n" > "stepping : %d\n", >! 0, cpu_vendor, class, cpu, cpu_id & 0xf); > >+ ps += sprintf(ps, >+ "flags :"); >+ >+ if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { >+ flags[16] = " fcmov"; >+ } else if (!strcmp(cpu_vendor, "CyrixInstead")) { >+ flags[24] = " cxmmx"; >+ } >+ >+ for (i = 0; i < 32; i++) { >+ if (cpu_feature & (1 << i)) { >+ ps += sprintf(ps, flags[i]); >+ } >+ } >+ if (class >= 5) { >+ ps += sprintf(ps, "\ncpu MHz : %d.%02d\n", >+ (tsc_freq + 4999) / 1000000, >+ ((tsc_freq + 4999) / 10000) % 100); >+ } else { >+ ps += sprintf(ps, "\n"); >+ } >+ > xlen = ps - psbuf; > xlen -= uio->uio_offset; > ps = psbuf + 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 20029
: 9867