freemyipod r471 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r470‎ | r471 | r472 >
Date:02:06, 22 January 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Add USB Monitor API to free all allocations held by the monitor thread
Modified paths:
  • /emcore/trunk/usb/usb.c (modified) (history)

Diff [purge]

Index: emcore/trunk/usb/usb.c
@@ -86,7 +86,8 @@
8787 DBGACTION_MEMALIGN,
8888 DBGACTION_REALLOC,
8989 DBGACTION_REOWNALLOC,
90 - DBGACTION_FREE
 90+ DBGACTION_FREE,
 91+ DBGACTION_FREEMONITOR
9192 };
9293
9394 static struct scheduler_thread dbgthread_handle IBSS_ATTR;
@@ -654,6 +655,9 @@
655656 if (set_dbgaction(DBGACTION_FREE, 0)) break;
656657 dbgactionaddr = dbgrecvbuf[1];
657658 break;
 659+ case 57: // FREE MONITOR ALLOCATIONS
 660+ if (set_dbgaction(DBGACTION_FREEMONITOR, 0)) break;
 661+ break;
658662 default:
659663 dbgsendbuf[0] = 2;
660664 size = 16;
@@ -971,6 +975,11 @@
972976 free((void*)dbgactionaddr);
973977 usb_drv_send_nonblocking(dbgendpoints[1], dbgasyncsendbuf, 16);
974978 break;
 979+ case DBGACTION_FREEMONITOR:
 980+ dbgasyncsendbuf[0] = 1;
 981+ dbgasyncsendbuf[1] = (uint32_t)free_all_of_thread(current_thread);
 982+ usb_drv_send_nonblocking(dbgendpoints[1], dbgasyncsendbuf, 16);
 983+ break;
975984 }
976985 dbgaction = DBGACTION_IDLE;
977986 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r473libemcore: Fix an obvious bug in free() and implement free_all() which implem...farthen02:45, 22 January 2011