[kernel] Add MXCSR handling, mask SIMD exceptions
Now threads inherit their MXCSR (sans exception state bits) SIMD settings from their creator. By default, all exceptions are masked, and both "to zero" flags are set.
This commit is contained in:
@@ -34,6 +34,15 @@ thread::thread(process &parent, uint8_t pri, uintptr_t rsp0) :
|
||||
m_tcb.rsp0 = rsp0;
|
||||
|
||||
m_creator = current_cpu().thread;
|
||||
|
||||
asm volatile ( "stmxcsr %0" : "=m"(m_mxcsr) );
|
||||
m_mxcsr
|
||||
.clear(mxcsr::IE)
|
||||
.clear(mxcsr::DE)
|
||||
.clear(mxcsr::ZE)
|
||||
.clear(mxcsr::OE)
|
||||
.clear(mxcsr::UE)
|
||||
.clear(mxcsr::PE);
|
||||
}
|
||||
|
||||
thread::~thread()
|
||||
|
||||
Reference in New Issue
Block a user