Merge ~binli/android-headers/+git/android-headers:versioned-headers into ~morphis/android-headers/+git/android-headers:versioned-headers

Proposed by Bin Li
Status: Merged
Merged at revision: a5b269b28818bbf108c889abe69035e56f516dc3
Proposed branch: ~binli/android-headers/+git/android-headers:versioned-headers
Merge into: ~morphis/android-headers/+git/android-headers:versioned-headers
Diff against target: 183 lines (+33/-15)
3 files modified
21/hardware/audio.h (+11/-5)
22/hardware/audio.h (+11/-5)
23/hardware/audio.h (+11/-5)
Reviewer Review Type Date Requested Status
You-Sheng Yang (community) Approve
Simon Fels Pending
Review via email: mp+291345@code.launchpad.net

Description of the change

Use FP_ATTRIB to make sure the floating point arguments are passed the right way.

Bugs: https://bugs.launchpad.net/zhongshan/+bug/1548954

To post a comment you must log in.
Revision history for this message
You-Sheng Yang (vicamo) wrote :

We'd like to fix all versions at once.

review: Needs Fixing
Revision history for this message
Bin Li (binli) wrote :

I also fixed the 21 and 23, please review again.

Revision history for this message
You-Sheng Yang (vicamo) :
review: Approve
Revision history for this message
Simon Fels (morphis) wrote :
Revision history for this message
Bin Li (binli) wrote :

Simon,

Got it, thanks a lot!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/21/hardware/audio.h b/21/hardware/audio.h
2index 763ca58..1d35459 100644
3--- a/21/hardware/audio.h
4+++ b/21/hardware/audio.h
5@@ -29,6 +29,12 @@
6 #include <system/audio.h>
7 #include <hardware/audio_effect.h>
8
9+#ifdef __ARM_PCS_VFP
10+#define FP_ATTRIB __attribute__((pcs("aapcs")))
11+#else
12+#define FP_ATTRIB
13+#endif
14+
15 __BEGIN_DECLS
16
17 /**
18@@ -287,7 +293,7 @@ struct audio_stream_out {
19 * This method might produce multiple PCM outputs or hardware accelerated
20 * codecs, such as MP3 or AAC.
21 */
22- int (*set_volume)(struct audio_stream_out *stream, float left, float right);
23+ int (*set_volume)(struct audio_stream_out *stream, float left, float right) FP_ATTRIB;
24
25 /**
26 * Write audio buffer to driver. Returns number of bytes written, or a
27@@ -405,7 +411,7 @@ struct audio_stream_in {
28
29 /** set the input gain for the audio driver. This method is for
30 * for future use */
31- int (*set_gain)(struct audio_stream_in *stream, float gain);
32+ int (*set_gain)(struct audio_stream_in *stream, float gain) FP_ATTRIB;
33
34 /** Read audio buffer in from audio driver. Returns number of bytes read, or a
35 * negative status_t. If at least one frame was read prior to the error,
36@@ -519,14 +525,14 @@ struct audio_hw_device {
37 int (*init_check)(const struct audio_hw_device *dev);
38
39 /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */
40- int (*set_voice_volume)(struct audio_hw_device *dev, float volume);
41+ int (*set_voice_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB;
42
43 /**
44 * set the audio volume for all audio activities other than voice call.
45 * Range between 0.0 and 1.0. If any value other than 0 is returned,
46 * the software mixer will emulate this capability.
47 */
48- int (*set_master_volume)(struct audio_hw_device *dev, float volume);
49+ int (*set_master_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB;
50
51 /**
52 * Get the current master volume value for the HAL, if the HAL supports
53@@ -535,7 +541,7 @@ struct audio_hw_device {
54 * the initial master volume across all HALs. HALs which do not support
55 * this method may leave it set to NULL.
56 */
57- int (*get_master_volume)(struct audio_hw_device *dev, float *volume);
58+ int (*get_master_volume)(struct audio_hw_device *dev, float *volume) FP_ATTRIB;
59
60 /**
61 * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode
62diff --git a/22/hardware/audio.h b/22/hardware/audio.h
63index 2389c09..4336894 100644
64--- a/22/hardware/audio.h
65+++ b/22/hardware/audio.h
66@@ -29,6 +29,12 @@
67 #include <system/audio.h>
68 #include <hardware/audio_effect.h>
69
70+#ifdef __ARM_PCS_VFP
71+#define FP_ATTRIB __attribute__((pcs("aapcs")))
72+#else
73+#define FP_ATTRIB
74+#endif
75+
76 __BEGIN_DECLS
77
78 /**
79@@ -290,7 +296,7 @@ struct audio_stream_out {
80 * This method might produce multiple PCM outputs or hardware accelerated
81 * codecs, such as MP3 or AAC.
82 */
83- int (*set_volume)(struct audio_stream_out *stream, float left, float right);
84+ int (*set_volume)(struct audio_stream_out *stream, float left, float right) FP_ATTRIB;
85
86 /**
87 * Write audio buffer to driver. Returns number of bytes written, or a
88@@ -408,7 +414,7 @@ struct audio_stream_in {
89
90 /** set the input gain for the audio driver. This method is for
91 * for future use */
92- int (*set_gain)(struct audio_stream_in *stream, float gain);
93+ int (*set_gain)(struct audio_stream_in *stream, float gain) FP_ATTRIB;
94
95 /** Read audio buffer in from audio driver. Returns number of bytes read, or a
96 * negative status_t. If at least one frame was read prior to the error,
97@@ -522,14 +528,14 @@ struct audio_hw_device {
98 int (*init_check)(const struct audio_hw_device *dev);
99
100 /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */
101- int (*set_voice_volume)(struct audio_hw_device *dev, float volume);
102+ int (*set_voice_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB;
103
104 /**
105 * set the audio volume for all audio activities other than voice call.
106 * Range between 0.0 and 1.0. If any value other than 0 is returned,
107 * the software mixer will emulate this capability.
108 */
109- int (*set_master_volume)(struct audio_hw_device *dev, float volume);
110+ int (*set_master_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB;
111
112 /**
113 * Get the current master volume value for the HAL, if the HAL supports
114@@ -538,7 +544,7 @@ struct audio_hw_device {
115 * the initial master volume across all HALs. HALs which do not support
116 * this method may leave it set to NULL.
117 */
118- int (*get_master_volume)(struct audio_hw_device *dev, float *volume);
119+ int (*get_master_volume)(struct audio_hw_device *dev, float *volume) FP_ATTRIB;
120
121 /**
122 * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode
123diff --git a/23/hardware/audio.h b/23/hardware/audio.h
124index 2389c09..4336894 100644
125--- a/23/hardware/audio.h
126+++ b/23/hardware/audio.h
127@@ -29,6 +29,12 @@
128 #include <system/audio.h>
129 #include <hardware/audio_effect.h>
130
131+#ifdef __ARM_PCS_VFP
132+#define FP_ATTRIB __attribute__((pcs("aapcs")))
133+#else
134+#define FP_ATTRIB
135+#endif
136+
137 __BEGIN_DECLS
138
139 /**
140@@ -290,7 +296,7 @@ struct audio_stream_out {
141 * This method might produce multiple PCM outputs or hardware accelerated
142 * codecs, such as MP3 or AAC.
143 */
144- int (*set_volume)(struct audio_stream_out *stream, float left, float right);
145+ int (*set_volume)(struct audio_stream_out *stream, float left, float right) FP_ATTRIB;
146
147 /**
148 * Write audio buffer to driver. Returns number of bytes written, or a
149@@ -408,7 +414,7 @@ struct audio_stream_in {
150
151 /** set the input gain for the audio driver. This method is for
152 * for future use */
153- int (*set_gain)(struct audio_stream_in *stream, float gain);
154+ int (*set_gain)(struct audio_stream_in *stream, float gain) FP_ATTRIB;
155
156 /** Read audio buffer in from audio driver. Returns number of bytes read, or a
157 * negative status_t. If at least one frame was read prior to the error,
158@@ -522,14 +528,14 @@ struct audio_hw_device {
159 int (*init_check)(const struct audio_hw_device *dev);
160
161 /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */
162- int (*set_voice_volume)(struct audio_hw_device *dev, float volume);
163+ int (*set_voice_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB;
164
165 /**
166 * set the audio volume for all audio activities other than voice call.
167 * Range between 0.0 and 1.0. If any value other than 0 is returned,
168 * the software mixer will emulate this capability.
169 */
170- int (*set_master_volume)(struct audio_hw_device *dev, float volume);
171+ int (*set_master_volume)(struct audio_hw_device *dev, float volume) FP_ATTRIB;
172
173 /**
174 * Get the current master volume value for the HAL, if the HAL supports
175@@ -538,7 +544,7 @@ struct audio_hw_device {
176 * the initial master volume across all HALs. HALs which do not support
177 * this method may leave it set to NULL.
178 */
179- int (*get_master_volume)(struct audio_hw_device *dev, float *volume);
180+ int (*get_master_volume)(struct audio_hw_device *dev, float *volume) FP_ATTRIB;
181
182 /**
183 * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode

Subscribers

People subscribed via source and target branches

to all changes: