2022-06-27 19:36:56 +02:00
|
|
|
/*
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
UMKa - User-Mode KolibriOS developer tools
|
|
|
|
|
|
|
|
Copyright (C) 2020,2022 Ivan Baravy <dunkaist@gmail.com>
|
|
|
|
*/
|
|
|
|
|
2020-05-08 23:50:54 +02:00
|
|
|
#include <setjmp.h>
|
2020-10-10 01:30:52 +02:00
|
|
|
#define __USE_GNU
|
|
|
|
#include <signal.h>
|
|
|
|
#include <stddef.h>
|
2022-05-24 21:22:12 +02:00
|
|
|
#include <stdlib.h>
|
2020-05-08 23:50:54 +02:00
|
|
|
|
2020-10-10 01:30:52 +02:00
|
|
|
sigset_t mask;
|
2020-05-08 23:50:54 +02:00
|
|
|
|
2020-10-10 01:30:52 +02:00
|
|
|
void reset_procmask(void) {
|
|
|
|
sigemptyset (&mask);
|
2023-01-30 07:24:23 +01:00
|
|
|
sigaddset (&mask, SIGALRM);
|
2020-10-10 01:30:52 +02:00
|
|
|
sigprocmask(SIG_UNBLOCK, &mask, NULL);
|
2020-05-08 23:50:54 +02:00
|
|
|
}
|
|
|
|
|
2020-10-14 05:30:01 +02:00
|
|
|
int get_fake_if(ucontext_t *ctx) {
|
2022-05-24 21:22:12 +02:00
|
|
|
// we fake IF with ID flag
|
2020-10-14 05:30:01 +02:00
|
|
|
return !(ctx->uc_mcontext.__gregs[REG_EFL] & (1 << 21));
|
2020-10-10 01:30:52 +02:00
|
|
|
}
|
2022-05-24 21:22:12 +02:00
|
|
|
|
|
|
|
void system_shutdown() {
|
|
|
|
exit(0);
|
|
|
|
}
|