Mercurial > mplayer.hg
annotate libdha/sysdep/AsmMacros_powerpc.h @ 18708:9e2b300db17b
Change free_sh_audio() to take demuxer and stream id as parameters
(same as new_sh_audio()) instead of sh_audio_t *, use those to remove
the pointer from demuxer->a_streams[] before freeing it.
Some demuxers use free_sh_audio() to undo the creation of an
already-allocated audio stream in case of error. These uses were unsafe
since free_sh_audio() freed the data structure but left the pointer in
demuxer->a_streams[], leading to double free later in free_demuxer()
(and perhaps use of the freed stream before that, I didn't check).
author | uau |
---|---|
date | Wed, 14 Jun 2006 14:05:59 +0000 |
parents | 6d544beb655e |
children |
rev | line source |
---|---|
4164 | 1 /* |
2 This file is based on: | |
3 $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $ | |
4 Modified for readability by Nick Kurshev | |
5 */ | |
6 | |
7 #ifndef __ASM_MACROS_POWERPC_H | |
8 #define __ASM_MACROS_POWERPC_H | |
9 | |
6635
704c0fbb8e80
oops forgot to commit, part of Bj«Órn Sandells libdha obsd ppc fixes.
atmos4
parents:
4164
diff
changeset
|
10 #if defined(Lynx) || defined(__OpenBSD__) |
4164 | 11 |
12 extern unsigned char *ioBase; | |
13 | |
14 static __inline__ volatile void eieio() | |
15 { | |
16 __asm__ __volatile__ ("eieio"); | |
17 } | |
18 | |
19 static __inline__ void outb(short port, unsigned char value) | |
20 { | |
6635
704c0fbb8e80
oops forgot to commit, part of Bj«Órn Sandells libdha obsd ppc fixes.
atmos4
parents:
4164
diff
changeset
|
21 *(unsigned char *)(ioBase + port) = value; eieio(); |
4164 | 22 } |
23 | |
24 static __inline__ void outw(short port, unsigned short value) | |
25 { | |
26 *(unsigned short *)(ioBase + port) = value; eieio(); | |
27 } | |
28 | |
29 static __inline__ void outl(short port, unsigned short value) | |
30 { | |
31 *(unsigned long *)(ioBase + port) = value; eieio(); | |
32 } | |
33 | |
34 static __inline__ unsigned char inb(short port) | |
35 { | |
36 unsigned char val; | |
37 val = *((unsigned char *)(ioBase + port)); eieio(); | |
38 return(val); | |
39 } | |
40 | |
41 static __inline__ unsigned short inw(short port) | |
42 { | |
43 unsigned short val; | |
44 val = *((unsigned short *)(ioBase + port)); eieio(); | |
45 return(val); | |
46 } | |
47 | |
48 static __inline__ unsigned long inl(short port) | |
49 { | |
50 unsigned long val; | |
51 val = *((unsigned long *)(ioBase + port)); eieio(); | |
52 return(val); | |
53 } | |
54 | |
55 #define intr_disable() | |
56 #define intr_enable() | |
57 | |
58 #endif | |
59 | |
60 #endif |