summaryrefslogtreecommitdiff
path: root/firmware/target/arm/pp/usb-fw-pp502x.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-05-30 11:24:16 +0200
committerThomas Martitz <kugel@rockbox.org>2013-12-23 12:17:38 +0100
commit22e802e80048defd401462e062afcb10093ac793 (patch)
tree09d24f7eb2a3b18e6563e838398b2715394f7c4c /firmware/target/arm/pp/usb-fw-pp502x.c
parent64b9e1fa7b645daa36ca0018dc168d4f871fd538 (diff)
downloadrockbox-22e802e80048defd401462e062afcb10093ac793.tar.gz
rockbox-22e802e80048defd401462e062afcb10093ac793.zip
playback,talk: Share audiobuffer via core_alloc_maximum().
This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
Diffstat (limited to 'firmware/target/arm/pp/usb-fw-pp502x.c')
-rw-r--r--firmware/target/arm/pp/usb-fw-pp502x.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/firmware/target/arm/pp/usb-fw-pp502x.c b/firmware/target/arm/pp/usb-fw-pp502x.c
index 44cce14389..acbb221cfd 100644
--- a/firmware/target/arm/pp/usb-fw-pp502x.c
+++ b/firmware/target/arm/pp/usb-fw-pp502x.c
@@ -230,21 +230,6 @@ void usb_insert_int(void)
230} 230}
231#endif /* USB_STATUS_BY_EVENT */ 231#endif /* USB_STATUS_BY_EVENT */
232 232
233#ifdef HAVE_BOOTLOADER_USB_MODE
234/* Replacement function that returns all unused memory after the bootloader
235 * because the storage driver uses the audio buffer */
236extern unsigned char freebuffer[];
237extern unsigned char freebufferend[];
238unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size)
239{
240 if (buffer_size)
241 *buffer_size = freebufferend - freebuffer + 1;
242
243 return freebuffer;
244 (void)talk_buf;
245}
246#endif /* HAVE_BOOTLOADER_USB_MODE */
247
248void usb_drv_int_enable(bool enable) 233void usb_drv_int_enable(bool enable)
249{ 234{
250 /* enable/disable USB IRQ in CPU */ 235 /* enable/disable USB IRQ in CPU */