Commit | Line | Data |
---|---|---|
aa41282e RSA |
1 | From: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> |
2 | Subject: audio.h: handling the float based function calls with aapcs | |
3 | ||
4 | Patch by David Henningsson <david.henningsson@canonical.com> | |
5 | ||
6 | Origin: vendor | |
7 | Forwarded: no | |
8 | ||
9 | diff --git a/hardware/audio.h b/hardware/audio.h | |
10 | index b1de42c..7a82d40 100644 | |
11 | --- a/hardware/audio.h | |
12 | +++ b/hardware/audio.h | |
13 | @@ -29,6 +29,12 @@ | |
14 | #include <system/audio.h> | |
15 | #include <hardware/audio_effect.h> | |
16 | ||
17 | +#ifdef __ARM_PCS_VFP | |
18 | +#define FP_ATTRIB __attribute__((pcs("aapcs"))) | |
19 | +#else | |
20 | +#define FP_ATTRIB | |
21 | +#endif | |
22 | + | |
23 | __BEGIN_DECLS | |
24 | ||
25 | /** | |
26 | @@ -235,7 +241,7 @@ struct audio_stream_out { | |
27 | * This method might produce multiple PCM outputs or hardware accelerated | |
28 | * codecs, such as MP3 or AAC. | |
29 | */ | |
30 | - int (*set_volume)(struct audio_stream_out *stream, float left, float right); | |
31 | + int (*set_volume)(struct audio_stream_out *stream, float left, float right) FP_ATTRIB; | |
32 | ||
33 | /** | |
34 | * Write audio buffer to driver. Returns number of bytes written, or a | |
35 | @@ -267,7 +273,7 @@ struct audio_stream_in { | |
36 | ||
37 | /** set the input gain for the audio driver. This method is for | |
38 | * for future use */ | |
39 | - int (*set_gain)(struct audio_stream_in *stream, float gain); | |
40 | + int (*set_gain)(struct audio_stream_in *stream, float gain) FP_ATTRIB; | |
41 | ||
42 | /** Read audio buffer in from audio driver. Returns number of bytes read, or a | |
43 | * negative status_t. If at least one frame was read prior to the error, | |
44 | @@ -346,14 +352,14 @@ struct audio_hw_device { | |
45 | int (*init_check)(const struct audio_hw_device *dev); | |
46 | ||
47 | /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */ | |
48 | - int (*set_voice_volume)(struct audio_hw_device *dev, float volume); | |
49 | + int (*set_voice_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB; | |
50 | ||
51 | /** | |
52 | * set the audio volume for all audio activities other than voice call. | |
53 | * Range between 0.0 and 1.0. If any value other than 0 is returned, | |
54 | * the software mixer will emulate this capability. | |
55 | */ | |
56 | - int (*set_master_volume)(struct audio_hw_device *dev, float volume); | |
57 | + int (*set_master_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB; | |
58 | ||
59 | /** | |
60 | * Get the current master volume value for the HAL, if the HAL supports | |
61 | @@ -362,7 +368,7 @@ struct audio_hw_device { | |
62 | * the initial master volume across all HALs. HALs which do not support | |
63 | * this method may leave it set to NULL. | |
64 | */ | |
65 | - int (*get_master_volume)(struct audio_hw_device *dev, float *volume); | |
66 | + int (*get_master_volume)(struct audio_hw_device *dev, float *volume) FP_ATTRIB; | |
67 | ||
68 | /** | |
69 | * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode | |
70 | -- | |
71 | 1.8.3.2 | |
72 |