URL
https://opencores.org/ocsvn/s6soc/s6soc/trunk
[/] [s6soc/] [trunk/] [sw/] [zipos/] [kernel.c] - Diff between revs 37 and 44
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 37 |
Rev 44 |
Line 260... |
Line 260... |
case TRAPID_WAIT:
|
case TRAPID_WAIT:
|
{ // The task wishes to wait on an interrupt
|
{ // The task wishes to wait on an interrupt
|
int ilist, timeout;
|
int ilist, timeout;
|
ilist = last_context[2];
|
ilist = last_context[2];
|
timeout= last_context[3];
|
timeout= last_context[3];
|
if (current->pending & ilist) {
|
|
last_context[1] = ilist & current->pending;
|
last_context[1] = ilist & current->pending;
|
|
if (current->pending & ilist) {
|
// Clear upon any read
|
// Clear upon any read
|
current->pending &= (~last_context[1]);
|
current->pending &= (~last_context[1]);
|
} else {
|
} else {
|
current->waitsig = ilist;
|
current->waitsig = ilist;
|
if (timeout != 0) {
|
if (timeout != 0) {
|
Line 286... |
Line 286... |
// Clear upon any read
|
// Clear upon any read
|
current->pending &= (~last_context[1]);
|
current->pending &= (~last_context[1]);
|
timeout = (unsigned)last_context[2];
|
timeout = (unsigned)last_context[2];
|
if (timeout) {
|
if (timeout) {
|
if ((int)timeout < 0)
|
if ((int)timeout < 0)
|
|
// Turn off any pending timeout
|
current->pending &= (~SWINT_TIMEOUT);
|
current->pending &= (~SWINT_TIMEOUT);
|
else
|
else
|
|
// Otherwise, start a timeout
|
|
// counter
|
current->timeout = milliseconds+timeout;
|
current->timeout = milliseconds+timeout;
|
}} break;
|
}} break;
|
case TRAPID_POST:
|
case TRAPID_POST:
|
kpost(tasklist, last_context[2]&(~0x07fff),
|
kpost(tasklist, last_context[2]&(~0x07fff),
|
milliseconds);
|
milliseconds);
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.