Skip to content

Commit ae79f76

Browse files
committed
Stop doing stupid shit
1 parent ec84c14 commit ae79f76

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

kernel/src/kernel/system/processor/processor.asm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ _checkForCPUID:
5454
_enableSSE:
5555
clts
5656
fninit
57+
fclex
58+
59+
push dword 0x037F
60+
fldcw [esp] ; load default control word
61+
add esp, 4
5762

5863
mov eax, cr0
5964
and eax, ~(1 << 2) ; clear CR0.EM coprocessor emulation

kernel/src/kernel/tasking/tasking.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,8 @@ void taskingSaveState(g_task* task, g_processor_state* state)
273273
// Save latest pointer to interrupt stack top
274274
task->state = state;
275275

276-
// Increase interruption counter
277-
task->interruptionLevel++;
278-
279276
// Save FPU state
280-
if(task->interruptionLevel == 0 && task->fpu.state)
277+
if(task->fpu.state)
281278
{
282279
processorSaveFpuState(task->fpu.state);
283280
task->fpu.stored = true;
@@ -290,9 +287,6 @@ void taskingRestoreState(g_task* task)
290287
if(!task)
291288
panic("%! tried to restore without a current task", "tasking");
292289

293-
// Decrease interruption counter
294-
task->interruptionLevel--;
295-
296290
// Switch to process address space
297291
if(task->overridePageDirectory)
298292
{
@@ -310,10 +304,8 @@ void taskingRestoreState(g_task* task)
310304
gdtSetTssEsp0(task->interruptStack.end);
311305

312306
// Restore FPU state
313-
if(task->interruptionLevel == 0 && task->fpu.stored)
314-
{
307+
if(task->fpu.stored)
315308
processorRestoreFpuState(task->fpu.state);
316-
}
317309
}
318310

319311
void taskingSchedule() { schedulerSchedule(taskingGetLocal()); }
@@ -454,7 +446,6 @@ void _taskingInitializeTask(g_task* task, g_process* process, g_security_level l
454446
task->process = process;
455447
task->securityLevel = level;
456448
task->status = G_TASK_STATUS_RUNNING;
457-
task->interruptionLevel = 1;
458449
waitQueueInitialize(&task->waitersJoin);
459450
mutexInitializeGlobal(&task->lock, __func__);
460451
}

0 commit comments

Comments
 (0)