1 From: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
2 Subject: audio.h: handling the float based function calls with aapcs
4 Patch by David Henningsson <david.henningsson@canonical.com>
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
14 #include <system/audio.h>
15 #include <hardware/audio_effect.h>
18 +#define FP_ATTRIB __attribute__((pcs("aapcs")))
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.
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;
34 * Write audio buffer to driver. Returns number of bytes written, or a
35 @@ -267,7 +273,7 @@ struct audio_stream_in {
37 /** set the input gain for the audio driver. This method is for
39 - int (*set_gain)(struct audio_stream_in *stream, float gain);
40 + int (*set_gain)(struct audio_stream_in *stream, float gain) FP_ATTRIB;
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);
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;
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.
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;
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.
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;
69 * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode