~ubuntu-branches/ubuntu/lucid/ffmpeg/lucid-security

« back to all changes in this revision

Viewing changes to libavcodec/x86/cpuid.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-03-13 09:18:28 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090313091828-n4ktby5eca487uhv
Tags: 3:0.svn20090303-1ubuntu1+unstripped1
merge from ubuntu.jaunty branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    int rval = 0;
43
43
    int eax, ebx, ecx, edx;
44
44
    int max_std_level, max_ext_level, std_caps=0, ext_caps=0;
 
45
 
 
46
#if ARCH_X86_32
45
47
    x86_reg a, c;
46
 
 
47
 
#if ARCH_X86_64
48
 
#define PUSHF "pushfq\n\t"
49
 
#define POPF "popfq\n\t"
50
 
#else
51
 
#define PUSHF "pushfl\n\t"
52
 
#define POPF "popfl\n\t"
53
 
#endif
54
48
    __asm__ volatile (
55
49
        /* See if CPUID instruction is supported ... */
56
50
        /* ... Get copies of EFLAGS into eax and ecx */
57
 
        PUSHF
 
51
        "pushfl\n\t"
58
52
        "pop %0\n\t"
59
53
        "mov %0, %1\n\t"
60
54
 
62
56
        /*     to the EFLAGS reg */
63
57
        "xor $0x200000, %0\n\t"
64
58
        "push %0\n\t"
65
 
        POPF
 
59
        "popfl\n\t"
66
60
 
67
61
        /* ... Get the (hopefully modified) EFLAGS */
68
 
        PUSHF
 
62
        "pushfl\n\t"
69
63
        "pop %0\n\t"
70
64
        : "=a" (a), "=c" (c)
71
65
        :
74
68
 
75
69
    if (a == c)
76
70
        return 0; /* CPUID not supported */
 
71
#endif
77
72
 
78
73
    cpuid(0, max_std_level, ebx, ecx, edx);
79
74