MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / signalstack

Method signalstack

source/kernel/kthread.cpp:1510–1536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1508}
1509
1510U32 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
1538U64 KThread::getThreadUserTime() {
1539#ifdef BOXEDWINE_MULTI_THREADED

Callers 1

syscall_sigaltstackFunction · 0.80

Calls 4

canWriteMethod · 0.45
writedMethod · 0.45
canReadMethod · 0.45
readdMethod · 0.45

Tested by

no test coverage detected