[lib][minip] add reschedule arg to pktbuf_free

Make sure the zynq gem driver doesn't reschedule at interrupt time.

Change-Id: Ieaf56930253bf9e2ebb68001a62f986ea2a50a0c
This commit is contained in:
Travis Geiselbrecht
2015-04-29 15:52:03 -07:00
parent f536b1fc15
commit 73e39eab9a
4 changed files with 13 additions and 7 deletions

View File

@@ -100,17 +100,20 @@ static void debug_rx_handler(pktbuf_t *p)
}
}
static void free_completed_pbuf_frame(void) {
static int free_completed_pbuf_frame(void) {
pktbuf_t *p;
bool eof;
int ret = 0;
if (!list_is_empty(&queued_pbufs)) {
do {
p = list_remove_head_type(&queued_pbufs, pktbuf_t, list);
eof = p->eof;
pktbuf_free(p);
ret += pktbuf_free(p, false);
} while (!eof);
}
return ret;
}
void queue_pkts_in_tx_tbl(void) {
@@ -201,7 +204,9 @@ enum handler_return gem_int_handler(void *arg) {
/* A frame has been completed so we can clean up ownership of its buffers */
if (intr_status & INTR_TX_COMPLETE) {
free_completed_pbuf_frame();
if (free_completed_pbuf_frame() > 0) {
resched = true;
}
regs->tx_status |= TX_STATUS_COMPLETE;
}