harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rana Dasgupta" <rdasg...@gmail.com>
Subject Re: [DRLVM][PORT] correct API to retrieve processor number
Date Wed, 01 Nov 2006 23:35:43 GMT
   On Windows, there is a bunch of bugs.

   - On W2003 SP1, Vista, XP-64 GetLogicalProcessorInformation() is the
   recommended api. It returns # of cores on AMD and # of logical procs on
   - GetSystemInfo() is on XP-32 and Windows Server. It does not work in
   wow mode. I think GetNativeSystemInfo is needed.
   - For x64, the VC/VC++ the __cpuid() intrinsic returns
   wrong information

      The root cause is that the incorrect versions use the cpuid
instruction incorrectly. __cpuid() uses old style cpuid and takes input from
eax only instead of eax, ecx . GetSystemInfo() uses the registers in short
mode when doing cpuid, so I think it fails for wow. It is amazing how
Windows works at all!

On 11/1/06, Xiao-Feng Li <xiaofeng.li@gmail.com> wrote:
> On 11/1/06, Alexey Varlamov <alexey.v.varlamov@gmail.com> wrote:
> > Just a wild guess: this may be caused by x86 emulation on em64t
> > (x86_64). SDK docs advise to use GetNativeSystemInfo() in such case,
> > instead of currently used GetSystemInfo(). (See
> > vm\port\src\misc\win\sysinfo.c).
> >
> huh, I guess you are right, since my machine is X86-64bit. :-) I will
> try the API you pointed.
> Thanks,
> xiaofeng

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message