Changeset d6dcdd2e in mainline for arch/ia32/include/cpuid.h


Ignore:
Timestamp:
2005-09-13T21:20:56Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
01e48c1
Parents:
b1cf98c
Message:

Optimize some assembler functions.

File:
1 edited

Legend:

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

    rb1cf98c rd6dcdd2e  
    4040
    4141extern int has_cpuid(void);
    42 extern void cpuid(__u32 cmd, cpu_info_t *info);
    4342
    44 extern __u64 rdtsc(void);
     43static inline void cpuid(__u32 cmd, struct cpu_info *info)
     44{
     45        __asm__ volatile (
     46                "movl %4, %%eax\n"
     47                "cpuid\n"
     48                "movl %%eax,%0\n"
     49                "movl %%ebx,%1\n"
     50                "movl %%ecx,%2\n"
     51                "movl %%edx,%3\n"
     52                : "=m" (info->cpuid_eax), "=m" (info->cpuid_ebx), "=m" (info->cpuid_ecx), "=m" (info->cpuid_edx)
     53                : "m" (cmd)
     54                : "eax", "ebx", "ecx", "edx"
     55        );
     56}
    4557
    4658#endif
Note: See TracChangeset for help on using the changeset viewer.