| 1508 | } |
| 1509 | |
| 1510 | U32 KThread::signalstack(U32 ss, U32 oss) { |
| 1511 | if (oss!=0) { |
| 1512 | if (!this->memory->canWrite(oss, 12)) { |
| 1513 | return -K_EFAULT; |
| 1514 | } |
| 1515 | memory->writed(oss, this->alternateStack); |
| 1516 | memory->writed(oss + 4, (this->alternateStack && this->inSignal) ? K_SS_ONSTACK : K_SS_DISABLE); |
| 1517 | memory->writed(oss + 8, this->alternateStackSize); |
| 1518 | } |
| 1519 | if (ss!=0) { |
| 1520 | if (!this->memory->canRead(ss, 12)) { |
| 1521 | return -K_EFAULT; |
| 1522 | } |
| 1523 | if (this->alternateStack && this->inSignal) { |
| 1524 | return -K_EPERM; |
| 1525 | } |
| 1526 | U32 flags = memory->readd(ss + 4); |
| 1527 | if (flags & K_SS_DISABLE) { |
| 1528 | this->alternateStack = 0; |
| 1529 | this->alternateStackSize = 0; |
| 1530 | } else { |
| 1531 | this->alternateStack = memory->readd(ss); |
| 1532 | this->alternateStackSize = memory->readd(ss + 8); |
| 1533 | } |
| 1534 | } |
| 1535 | return 0; |
| 1536 | } |
| 1537 | |
| 1538 | U64 KThread::getThreadUserTime() { |
| 1539 | #ifdef BOXEDWINE_MULTI_THREADED |
no test coverage detected