mirror of
git://projects.qi-hardware.com/iris.git
synced 2025-04-21 12:27:27 +03:00
almost working, just before major change
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
load = 0x80000000
|
||||
|
||||
ARCH_CXXFLAGS = -DNUM_THREADS=2
|
||||
ARCH_CXXFLAGS = -DNUM_THREADS=3
|
||||
ARCH_CPPFLAGS = -Imips -Wa,-mips32
|
||||
CROSS = mipsel-linux-gnu-
|
||||
OBJDUMP = $(CROSS)objdump
|
||||
|
||||
@@ -137,24 +137,26 @@ static void arch_invoke ():
|
||||
c3 = old_current->find_capability (old_current->arch.t7, &dummy)
|
||||
old_current->wait (c0, c1, c2, c3)
|
||||
if !target:
|
||||
if (old_current->arch.v0 & ~CAPABILITY_COPY) != ~CAPABILITY_COPY:
|
||||
panic (old_current->arch.v0, "debug")
|
||||
// There must be no action here.
|
||||
else:
|
||||
Capability::Context c
|
||||
c.cap[0] = old_current->find_capability (old_current->arch.a0, &c.copy[0])
|
||||
c.cap[1] = old_current->find_capability (old_current->arch.a1, &c.copy[1])
|
||||
c.cap[2] = old_current->find_capability (old_current->arch.a2, &c.copy[2])
|
||||
c.cap[3] = old_current->find_capability (old_current->arch.a3, &c.copy[3])
|
||||
c.data[0] = old_current->arch.t0
|
||||
c.data[1] = old_current->arch.t1
|
||||
c.data[2] = old_current->arch.t2
|
||||
c.data[3] = old_current->arch.t3
|
||||
target->invoke (&c)
|
||||
if do_schedule && !wait:
|
||||
// If the call was to schedule without wait, it isn't done yet.
|
||||
schedule ()
|
||||
else if old_current != current && (old_current->flags & (THREAD_FLAG_RUNNING | THREAD_FLAG_WAITING)) == THREAD_FLAG_RUNNING:
|
||||
// If the caller received an immediate reply from the kernel, it is no longer set as current. Don't let it lose its timeslice.
|
||||
current = old_current
|
||||
return
|
||||
Capability::Context c
|
||||
c.cap[0] = old_current->find_capability (old_current->arch.a0, &c.copy[0])
|
||||
c.cap[1] = old_current->find_capability (old_current->arch.a1, &c.copy[1])
|
||||
c.cap[2] = old_current->find_capability (old_current->arch.a2, &c.copy[2])
|
||||
c.cap[3] = old_current->find_capability (old_current->arch.a3, &c.copy[3])
|
||||
c.data[0] = old_current->arch.t0
|
||||
c.data[1] = old_current->arch.t1
|
||||
c.data[2] = old_current->arch.t2
|
||||
c.data[3] = old_current->arch.t3
|
||||
target->invoke (&c)
|
||||
if do_schedule && !wait:
|
||||
// If the call was to schedule without wait, it isn't done yet.
|
||||
schedule ()
|
||||
else if old_current != current && (old_current->flags & (THREAD_FLAG_RUNNING | THREAD_FLAG_WAITING)) == THREAD_FLAG_RUNNING:
|
||||
// If the caller received an immediate reply from the kernel, it is no longer set as current. Don't let it lose its timeslice.
|
||||
current = old_current
|
||||
|
||||
/// A general exception has occurred.
|
||||
Thread *exception ():
|
||||
@@ -211,7 +213,7 @@ Thread *exception ():
|
||||
break
|
||||
case 9:
|
||||
// Breakpoint.
|
||||
#if 1
|
||||
#if 0
|
||||
current->raise (ERR_BREAKPOINT, 0)
|
||||
#else
|
||||
current->pc += 4
|
||||
|
||||
Reference in New Issue
Block a user