Tcl Source Code

Check-in [2153733cd7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:new version of cpuid, which doesn't use the edi register any more. Hopefully that works better on some Darwin.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-4-branch
Files: files | file ages | folders
SHA1: 2153733cd75dc123c2032445267cbc2ce1da89d9
User & Date: jan.nijtmans 2013-01-24 22:00:50
Context
2013-01-26
16:50
[Bug 3601804]: platformCPUID segmentation fault on Darwin check-in: 794facf36b user: jan.nijtmans tags: core-8-4-branch
2013-01-25
14:20
merge core-8-4-branch check-in: d8176de2a1 user: jan.nijtmans tags: bug-3562640
2013-01-24
22:01
new version of cpuid, which doesn't use the edi register any more. Hopefully that works better on so... check-in: 8750be345c user: jan.nijtmans tags: core-8-5-branch
22:00
new version of cpuid, which doesn't use the edi register any more. Hopefully that works better on so... check-in: 2153733cd7 user: jan.nijtmans tags: core-8-4-branch
21:28
revert [273bbe926d]: it doesn't work on i386 check-in: 47af426282 user: jan.nijtmans tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/tclUnixCompat.c.

689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
    unsigned int index,		/* Which CPUID value to retrieve. */
    unsigned int *regsPtr)	/* Registers after the CPUID. */
{
    int status = TCL_ERROR;

    /* See: <http://en.wikipedia.org/wiki/CPUID> */
#if defined(HAVE_CPUID)
    __asm__ __volatile__("mov %%ebx, %%edi     \n\t" /* save %ebx */
                 "cpuid            \n\t"
                 "mov %%ebx, %%esi   \n\t" /* save what cpuid just put in %ebx */
                 "mov %%edi, %%ebx  \n\t" /* restore the old %ebx */
                 : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
                 : "a"(index) : "edi");
    status = TCL_OK;
#endif
    return status;
}

/*
 * Local Variables:







|

<
|

|







689
690
691
692
693
694
695
696
697

698
699
700
701
702
703
704
705
706
707
    unsigned int index,		/* Which CPUID value to retrieve. */
    unsigned int *regsPtr)	/* Registers after the CPUID. */
{
    int status = TCL_ERROR;

    /* See: <http://en.wikipedia.org/wiki/CPUID> */
#if defined(HAVE_CPUID)
    __asm__ __volatile__("mov %%ebx, %%esi     \n\t" /* save %ebx */
                 "cpuid            \n\t"

                 "xchg %%esi, %%ebx   \n\t" /* restore the old %ebx */
                 : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
                 : "a"(index));
    status = TCL_OK;
#endif
    return status;
}

/*
 * Local Variables: