harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [DRLVM][PORT] correct API to retrieve processor number
Date Thu, 02 Nov 2006 01:00:51 GMT
Very informative! Thanks, Rana.

-xiaofeng

On 11/2/06, Rana Dasgupta <rdasgupt@gmail.com> wrote:
>    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
>    Intel.
>    - 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
> >
> >
>
>

Mime
View raw message