freemyipod r31 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r30‎ | r31 | r32 >
Date:23:39, 5 August 2010
Author:theseven
Status:new
Tags:
Comment:
The scheduler state can now be read via USB
Modified paths:
  • /embios/trunk/thread.h (modified) (history)
  • /embios/trunk/usb/usb.c (modified) (history)

Diff [purge]

Index: embios/trunk/usb/usb.c
@@ -451,6 +451,13 @@
452452 if (set_dbgaction(DBGACTION_CFLUSH, 0)) break;
453453 dbgactionconsoles = dbgrecvbuf[1];
454454 break;
 455+ case 15: // GET PROCESS INFO
 456+ dbgsendbuf[0] = 1;
 457+ dbgsendbuf[1] = SCHEDULER_THREAD_INFO_VERSION;
 458+ dbgsendbuf[2] = MAX_THREADS * sizeof(struct scheduler_thread);
 459+ memcpy(&dbgsendbuf[4], scheduler_threads, dbgrecvbuf[1]);
 460+ size = dbgrecvbuf[1] + 16;
 461+ break;
455462 default:
456463 dbgsendbuf[0] = 2;
457464 size = 16;
Index: embios/trunk/thread.h
@@ -67,6 +67,9 @@
6868 SYSTEM_THREAD
6969 };
7070
 71+
 72+#define SCHEDULER_THREAD_INFO_VERSION 1
 73+
7174 struct scheduler_thread
7275 {
7376 uint32_t regs[16];