summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-09-30 17:23:13 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-09-30 17:23:13 +0000
commit035529c487feb5a0e1d951b1ac8f82c23cfbff62 (patch)
treeeab78bdc524e60fd61c8626f6ce560c1357e7d76 /firmware
parent3f9a9a1a01df7c73b569232f96a4170ed8910ea2 (diff)
downloadrockbox-035529c487feb5a0e1d951b1ac8f82c23cfbff62.tar.gz
rockbox-035529c487feb5a0e1d951b1ac8f82c23cfbff62.zip
Enable auto reply for queue messages sent with queue_send. It's only nescessary to use queue_reply to return a value other than zero or to return a result before waiting on the queue again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14923 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/kernel.c20
-rw-r--r--firmware/pcm_record.c7
2 files changed, 18 insertions, 9 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c
index 77b0c6ffef..03be6db624 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -38,8 +38,6 @@ void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);
38static struct event_queue *all_queues[32] NOCACHEBSS_ATTR; 38static struct event_queue *all_queues[32] NOCACHEBSS_ATTR;
39static int num_queues NOCACHEBSS_ATTR; 39static int num_queues NOCACHEBSS_ATTR;
40 40
41void queue_wait(struct event_queue *q, struct event *ev) ICODE_ATTR;
42
43/**************************************************************************** 41/****************************************************************************
44 * Standard kernel stuff 42 * Standard kernel stuff
45 ****************************************************************************/ 43 ****************************************************************************/
@@ -234,7 +232,15 @@ void queue_wait(struct event_queue *q, struct event *ev)
234 int oldlevel; 232 int oldlevel;
235 unsigned int rd; 233 unsigned int rd;
236 234
237 oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); 235 oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
236
237#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
238 if(q->send && q->send->curr_sender)
239 {
240 /* auto-reply */
241 queue_release_sender(&q->send->curr_sender, 0);
242 }
243#endif
238 244
239 if (q->read == q->write) 245 if (q->read == q->write)
240 { 246 {
@@ -259,6 +265,14 @@ void queue_wait(struct event_queue *q, struct event *ev)
259void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks) 265void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks)
260{ 266{
261 int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); 267 int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
268
269#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
270 if (q->send && q->send->curr_sender)
271 {
272 /* auto-reply */
273 queue_release_sender(&q->send->curr_sender, 0);
274 }
275#endif
262 276
263 if (q->read == q->write && ticks > 0) 277 if (q->read == q->write && ticks > 0)
264 { 278 {
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index f3cb21e491..a5d0e51c30 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -1358,7 +1358,6 @@ static void pcmrec_stop(void)
1358 if (is_recording) 1358 if (is_recording)
1359 { 1359 {
1360 dma_lock = true; /* lock dma write position */ 1360 dma_lock = true; /* lock dma write position */
1361 queue_reply(&pcmrec_queue, 0);
1362 1361
1363 /* flush all available data first to avoid overflow while waiting 1362 /* flush all available data first to avoid overflow while waiting
1364 for encoding to finish */ 1363 for encoding to finish */
@@ -1519,15 +1518,11 @@ static void pcmrec_thread(void)
1519 if (is_recording) 1518 if (is_recording)
1520 break; 1519 break;
1521 pcmrec_close(); 1520 pcmrec_close();
1522 /* Be sure other threads are released if waiting */
1523 queue_clear(&pcmrec_queue);
1524 flush_interrupts = 0;
1525 usb_acknowledge(SYS_USB_CONNECTED_ACK); 1521 usb_acknowledge(SYS_USB_CONNECTED_ACK);
1526 usb_wait_for_disconnect(&pcmrec_queue); 1522 usb_wait_for_disconnect(&pcmrec_queue);
1523 flush_interrupts = 0;
1527 break; 1524 break;
1528 } /* end switch */ 1525 } /* end switch */
1529
1530 queue_reply(&pcmrec_queue, 0);
1531 } /* end while */ 1526 } /* end while */
1532} /* pcmrec_thread */ 1527} /* pcmrec_thread */
1533 1528