~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to getcpuflags.s

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-09-07 15:57:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040907155757-pgypftl9bt2uqyyl
Tags: 0.59r-16
* layer2.c: Fix buffer overflow in layer2 decoder (CVE ID CAN-2004-0805).
* Makefile: Fix compiler options to build for generic targets on ARM,
  but optimise for xscale. Closes: #261255
* README.3DNOW, dct36_3dnow.s, dct64_3dnow.s, decode_3dnow.s,
  decode_i386.c, equalizer_3dnow.s, getcpuflags.s, layer3.c, mpg123.c,
  mpg123.h, tabinit.c, debian/rules: Apply patch by KIMURA Takuhiro and
  Syuuhei Kashiyama to fix errors in 3dnow-optimised decoding.
  Thanks to Alberto Garcia for the patch-merging. Closes: #242212
* debian/prerm: De-register mp3-decoder alternative. Closes: #222982
* debian/changelog: Convert to utf8.
* debian/control: Bump standards version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// getcpuflags.s - get CPUFLAGS
 
2
// KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> - until 31.Mar.1999
 
3
//                 <kim@comtec.co.jp>               - after  1.Apr.1999
 
4
 
 
5
// extern int getcpuid(void) 
 
6
// -> 0x00000000 (CPUID instruction not supported)
 
7
// or CPUFLAGS
 
8
 
 
9
.text
 
10
        .align 4
 
11
.globl getcpuflags
 
12
        .type    getcpuflags,@function
 
13
getcpuflags:
 
14
        pushl %ebp
 
15
        movl %esp,%ebp
 
16
        subl $4,%esp
 
17
        pushl %edx
 
18
        pushl %ecx
 
19
        pushl %ebx
 
20
        movl $0x80000000,%eax 
 
21
        
 
22
        pushfl
 
23
        pushfl
 
24
        popl %eax
 
25
        movl %eax,%ebx
 
26
        xorl $0x00200000,%eax
 
27
        pushl %eax
 
28
        popfl
 
29
        pushfl
 
30
        popl %eax
 
31
        popfl
 
32
        cmpl %ebx,%eax
 
33
        / for detect 3DNow! support (bit 31)
 
34
        movl $0x80000001,%eax
 
35
        cpuid
 
36
        movl %edx,%eax
 
37
        jmp .L1
 
38
        .align 4
 
39
.L0:    
 
40
        movl $0,%eax
 
41
        .align 4
 
42
.L1:
 
43
        movl %eax,-4(%esp)
 
44
        popl %ebx
 
45
        popl %ecx
 
46
        popl %edx
 
47
        movl %ebp,%esp
 
48
        popl %ebp
 
49
        ret