TD2 question I.4
Create userthread.cc content and call it from exception.cc
This commit is contained in:
parent
f18dd05339
commit
c4a2d25163
4 changed files with 28 additions and 1 deletions
|
@ -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:
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#ifdef CHANGED
|
||||
#include "copyright.h"
|
||||
#include "system.h"
|
||||
#include "userthread.h"
|
||||
#include "syscall.h"
|
||||
|
||||
int do_ThreadCreate(int f, int arg){
|
||||
DEBUG('x',"Enter do_ThreadCreate function\n");
|
||||
}
|
||||
|
||||
void do_ThreadExit(){
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,7 @@
|
|||
#ifdef CHANGED
|
||||
#include "copyright.h"
|
||||
#include "utility.h"
|
||||
|
||||
extern int do_ThreadCreate(int f, int arg);
|
||||
extern void do_ThreadExit();
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue