Changeset add04f7 in mainline for kernel/arch/ia32/include/cpuid.h


Ignore:
Timestamp:
2009-03-03T15:20:49Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f24d300
Parents:
deca67b
Message:

better inline assembler readability using the new symbolic syntax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/include/cpuid.h

    rdeca67b radd04f7  
    7575       
    7676        asm volatile (
    77                 "pushf\n"               /* read flags */
    78                 "popl %0\n"
    79                 "movl %0, %1\n"
     77                "pushf\n"                    /* read flags */
     78                "popl %[ret]\n"
     79                "movl %[ret], %[val]\n"
    8080               
    81                 "btcl $21, %1\n"        /* swap the ID bit */
     81                "btcl $21, %[val]\n"         /* swap the ID bit */
    8282               
    83                 "pushl %1\n"            /* propagate the change into flags */
     83                "pushl %[val]\n"             /* propagate the change into flags */
    8484                "popf\n"
    8585                "pushf\n"
    86                 "popl %1\n"
     86                "popl %[val]\n"
    8787               
    88                 "andl $(1 << 21), %0\n" /* interrested only in ID bit */
    89                 "andl $(1 << 21), %1\n"
    90                 "xorl %1, %0\n"
    91                 : "=r" (ret), "=r" (val)
     88                "andl $(1 << 21), %[ret]\n" /* interrested only in ID bit */
     89                "andl $(1 << 21), %[val]\n"
     90                "xorl %[val], %[ret]\n"
     91                : [ret] "=r" (ret), [val] "=r" (val)
    9292        );
    9393       
     
    9999        asm volatile (
    100100                "cpuid\n"
    101                 : "=a" (info->cpuid_eax), "=b" (info->cpuid_ebx), "=c" (info->cpuid_ecx), "=d" (info->cpuid_edx)
     101                : "=a" (info->cpuid_eax), "=b" (info->cpuid_ebx),
     102                  "=c" (info->cpuid_ecx), "=d" (info->cpuid_edx)
    102103                : "a" (cmd)
    103104        );
Note: See TracChangeset for help on using the changeset viewer.