TD2 question I.4

Create userthread.cc content and call it from exception.cc
This commit is contained in:
Yorick Barbanneau 2021-11-14 21:51:18 +01:00
parent f18dd05339
commit c4a2d25163
4 changed files with 28 additions and 1 deletions

View file

@ -25,6 +25,10 @@
#include "system.h"
#include "syscall.h"
#ifdef CHANGED
#include "userthread.h"
#endif
//----------------------------------------------------------------------
// UpdatePC : Increments the Program Counter register in order to resume
// the user program immediately after the "syscall" instruction.
@ -210,6 +214,9 @@ ExceptionHandler (ExceptionType which)
}
case SC_ThreadCreate:
{
int f = machine->ReadRegister(4);
int args = machine->ReadRegister(5);
do_ThreadCreate(f, args);
break;
}
case SC_ThreadExit: