Run net stack, jump to the osloop. Compiles, doesn't crash.
This commit is contained in:
@@ -8,26 +8,20 @@ sigjmp_buf trampoline;
|
||||
|
||||
|
||||
__attribute__((__stdcall__))
|
||||
uint32_t umka_new_sys_threads(void (*func)(void), void *stack, int type) {
|
||||
(void)type;
|
||||
(void)func;
|
||||
uint32_t umka_sched_add_thread(appdata_t *app) {
|
||||
fprintf(stderr, "umka_new_sys_threads before\n");
|
||||
// kos_slot_base[kos_task_count].fpu_state = malloc(4096);
|
||||
fprintf(stderr, "kos_task_count: %d\n", kos_task_count);
|
||||
if (!sigsetjmp(trampoline, 1)) {
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"mov esp, eax;"
|
||||
"push ecx"
|
||||
"mov esp, eax"
|
||||
:
|
||||
: "a"(stack),
|
||||
"c"(func)
|
||||
: "a"(app->saved_esp)
|
||||
: "memory");
|
||||
if (!sigsetjmp(*kos_slot_base[kos_task_count++].fpu_state, 1)) {
|
||||
if (!sigsetjmp(*app->fpu_state, 1)) {
|
||||
longjmp(trampoline, 1);
|
||||
} else {
|
||||
__asm__ __inline__ __volatile__ (
|
||||
"pop ecx;"
|
||||
"call ecx"
|
||||
"ret"
|
||||
:
|
||||
:
|
||||
: "memory");
|
||||
|
Reference in New Issue
Block a user