Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/mips/swtch.S
Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
*---------------------------------------------------------------------------- | *---------------------------------------------------------------------------- | ||||
*/ | */ | ||||
LEAF(MipsSwitchFPState) | LEAF(MipsSwitchFPState) | ||||
.set push | .set push | ||||
.set hardfloat | .set hardfloat | ||||
mfc0 t1, MIPS_COP_0_STATUS # Save old SR | mfc0 t1, MIPS_COP_0_STATUS # Save old SR | ||||
HAZARD_DELAY | HAZARD_DELAY | ||||
#if defined(__mips_n64) | #if defined(__mips_n32) || defined(__mips_n64) | ||||
or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR # enable the coprocessor | or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR # enable the coprocessor | ||||
#else | #else | ||||
or t0, t1, MIPS_SR_COP_1_BIT # enable the coprocessor | or t0, t1, MIPS_SR_COP_1_BIT # enable the coprocessor | ||||
#endif | #endif | ||||
mtc0 t0, MIPS_COP_0_STATUS | mtc0 t0, MIPS_COP_0_STATUS | ||||
HAZARD_DELAY | HAZARD_DELAY | ||||
ITLBNOPFIX | ITLBNOPFIX | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
*---------------------------------------------------------------------------- | *---------------------------------------------------------------------------- | ||||
*/ | */ | ||||
LEAF(MipsFPID) | LEAF(MipsFPID) | ||||
.set push | .set push | ||||
.set hardfloat | .set hardfloat | ||||
mfc0 t1, MIPS_COP_0_STATUS # Save the status register. | mfc0 t1, MIPS_COP_0_STATUS # Save the status register. | ||||
HAZARD_DELAY | HAZARD_DELAY | ||||
#if defined(__mips_n64) | #if defined(__mips_n32) || defined(__mips_n64) | ||||
or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR | or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR | ||||
#else | #else | ||||
or t0, t1, MIPS_SR_COP_1_BIT | or t0, t1, MIPS_SR_COP_1_BIT | ||||
#endif | #endif | ||||
mtc0 t0, MIPS_COP_0_STATUS # Enable the coprocessor | mtc0 t0, MIPS_COP_0_STATUS # Enable the coprocessor | ||||
HAZARD_DELAY | HAZARD_DELAY | ||||
ITLBNOPFIX | ITLBNOPFIX | ||||
cfc1 v0, MIPS_FPU_ID | cfc1 v0, MIPS_FPU_ID | ||||
Show All 22 Lines | |||||
*---------------------------------------------------------------------------- | *---------------------------------------------------------------------------- | ||||
*/ | */ | ||||
LEAF(MipsSaveCurFPState) | LEAF(MipsSaveCurFPState) | ||||
.set push | .set push | ||||
.set hardfloat | .set hardfloat | ||||
PTR_L a0, TD_PCB(a0) # get pointer to pcb for thread | PTR_L a0, TD_PCB(a0) # get pointer to pcb for thread | ||||
mfc0 t1, MIPS_COP_0_STATUS # Disable interrupts and | mfc0 t1, MIPS_COP_0_STATUS # Disable interrupts and | ||||
HAZARD_DELAY | HAZARD_DELAY | ||||
#if defined(__mips_n64) | #if defined(__mips_n32) || defined(__mips_n64) | ||||
or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR # enable the coprocessor | or t0, t1, MIPS_SR_COP_1_BIT | MIPS_SR_FR # enable the coprocessor | ||||
#else | #else | ||||
or t0, t1, MIPS_SR_COP_1_BIT # enable the coprocessor | or t0, t1, MIPS_SR_COP_1_BIT # enable the coprocessor | ||||
#endif | #endif | ||||
mtc0 t0, MIPS_COP_0_STATUS | mtc0 t0, MIPS_COP_0_STATUS | ||||
HAZARD_DELAY | HAZARD_DELAY | ||||
ITLBNOPFIX | ITLBNOPFIX | ||||
GET_CPU_PCPU(a1) | GET_CPU_PCPU(a1) | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |