Lines Matching defs:state
105 * Maps state flavor to number of words in the state:
465 * Save the old thread`s kernel state or continuation,
507 * Load the rest of the user state for the new thread
539 * The initialized state will then be lazily faulted-in, if required.
564 * x86_SAVED_STATE32 - internal save/restore general register state on 32/64 bit processors
566 * x86_SAVED_STATE64 - internal save/restore general register state on 64 bit processors
568 * x86_THREAD_STATE32 - external set/get general register state on 32/64 bit processors
570 * x86_THREAD_STATE64 - external set/get general register state on 64 bit processors
572 * x86_SAVED_STATE - external set/get general register state on 32/64 bit processors
574 * x86_FLOAT_STATE32 - internal/external save/restore float and xmm state on 32/64 bit processors
576 * x86_FLOAT_STATE64 - internal/external save/restore float and xmm state on 64 bit processors
578 * x86_FLOAT_STATE - external save/restore float and xmm state on 32/64 bit processors
580 * x86_EXCEPTION_STATE32 - external get exception state on 32/64 bit processors
582 * x86_EXCEPTION_STATE64 - external get exception state on 64 bit processors
584 * x86_EXCEPTION_STATE - external get exception state on 323/64 bit processors
799 x86_saved_state32_t *state;
808 state = (x86_saved_state32_t *) tstate;
811 if (!valid_user_segment_selectors(state->cs,
812 state->ss,
813 state->ds,
814 state->es,
815 state->fs,
816 state->gs))
826 saved_state->edi = state->edi;
827 saved_state->esi = state->esi;
828 saved_state->ebp = state->ebp;
829 saved_state->uesp = state->uesp;
830 saved_state->ebx = state->ebx;
831 saved_state->edx = state->edx;
832 saved_state->ecx = state->ecx;
833 saved_state->eax = state->eax;
834 saved_state->eip = state->eip;
836 saved_state->efl = (state->efl & ~EFL_USER_CLEAR) | EFL_USER_SET;
843 if ((saved_state->efl & EFL_TF) && state->cs == SYSENTER_CS)
844 state->cs = SYSENTER_TF_CS;
852 saved_state->cs = state->cs;
853 saved_state->ss = state->ss;
854 saved_state->ds = state->ds;
855 saved_state->es = state->es;
856 saved_state->fs = state->fs;
857 saved_state->gs = state->gs;
864 x86_saved_state64_t *state;
873 state = (x86_saved_state64_t *) tstate;
882 if (!valid_user_code_selector(state->isf.cs))
886 if (!IS_USERADDR64_CANONICAL(state->isf.rsp) ||
887 !IS_USERADDR64_CANONICAL(state->isf.rip))
897 saved_state->r8 = state->r8;
898 saved_state->r9 = state->r9;
899 saved_state->r10 = state->r10;
900 saved_state->r11 = state->r11;
901 saved_state->r12 = state->r12;
902 saved_state->r13 = state->r13;
903 saved_state->r14 = state->r14;
904 saved_state->r15 = state->r15;
905 saved_state->rdi = state->rdi;
906 saved_state->rsi = state->rsi;
907 saved_state->rbp = state->rbp;
908 saved_state->rbx = state->rbx;
909 saved_state->rdx = state->rdx;
910 saved_state->rcx = state->rcx;
911 saved_state->rax = state->rax;
912 saved_state->isf.rsp = state->isf.rsp;
913 saved_state->isf.rip = state->isf.rip;
915 saved_state->isf.rflags = (state->isf.rflags & ~EFL_USER_CLEAR) | EFL_USER_SET;
923 saved_state->isf.cs = state->isf.cs;
924 saved_state->isf.ss = state->isf.ss;
925 saved_state->fs = state->fs;
926 saved_state->gs = state->gs;
955 x86_float_state_t *state;
960 state = (x86_float_state_t *)tstate;
961 if (state->fsh.flavor == x86_FLOAT_STATE64 && state->fsh.count == x86_FLOAT_STATE64_COUNT &&
963 return fpu_set_fxstate(thr_act, (thread_state_t)&state->ufs.fs64, x86_FLOAT_STATE64);
965 if (state->fsh.flavor == x86_FLOAT_STATE32 && state->fsh.count == x86_FLOAT_STATE32_COUNT &&
967 return fpu_set_fxstate(thr_act, (thread_state_t)&state->ufs.fs32, x86_FLOAT_STATE32);
996 x86_avx_state_t *state;
1001 state = (x86_avx_state_t *)tstate;
1002 if (state->ash.flavor == x86_AVX_STATE64 &&
1003 state->ash.count == x86_FLOAT_STATE64_COUNT &&
1006 (thread_state_t)&state->ufs.as64,
1009 if (state->ash.flavor == x86_FLOAT_STATE32 &&
1010 state->ash.count == x86_FLOAT_STATE32_COUNT &&
1013 (thread_state_t)&state->ufs.as32,
1043 x86_thread_state_t *state;
1048 state = (x86_thread_state_t *)tstate;
1050 if (state->tsh.flavor == x86_THREAD_STATE64 &&
1051 state->tsh.count == x86_THREAD_STATE64_COUNT &&
1053 return set_thread_state64(thr_act, &state->uts.ts64);
1054 } else if (state->tsh.flavor == x86_THREAD_STATE32 &&
1055 state->tsh.count == x86_THREAD_STATE32_COUNT &&
1057 return set_thread_state32(thr_act, &state->uts.ts32);
1065 x86_debug_state32_t *state;
1071 state = (x86_debug_state32_t *)tstate;
1073 ret = set_debug_state32(thr_act, state);
1079 x86_debug_state64_t *state;
1085 state = (x86_debug_state64_t *)tstate;
1087 ret = set_debug_state64(thr_act, state);
1093 x86_debug_state_t *state;
1099 state = (x86_debug_state_t *)tstate;
1100 if (state->dsh.flavor == x86_DEBUG_STATE64 &&
1101 state->dsh.count == x86_DEBUG_STATE64_COUNT &&
1103 ret = set_debug_state64(thr_act, &state->uds.ds64);
1106 if (state->dsh.flavor == x86_DEBUG_STATE32 &&
1107 state->dsh.count == x86_DEBUG_STATE32_COUNT &&
1109 ret = set_debug_state32(thr_act, &state->uds.ds32);
1182 x86_saved_state32_t *state;
1191 state = (x86_saved_state32_t *) tstate;
1197 *state = *saved_state;
1198 state->ds = saved_state->ds & 0xffff;
1199 state->es = saved_state->es & 0xffff;
1200 state->fs = saved_state->fs & 0xffff;
1201 state->gs = saved_state->gs & 0xffff;
1209 x86_saved_state64_t *state;
1218 state = (x86_saved_state64_t *)tstate;
1224 *state = *saved_state;
1225 state->fs = saved_state->fs & 0xffff;
1226 state->gs = saved_state->gs & 0xffff;
1260 x86_float_state_t *state;
1266 state = (x86_float_state_t *)tstate;
1273 state->fsh.flavor = x86_FLOAT_STATE64;
1274 state->fsh.count = x86_FLOAT_STATE64_COUNT;
1276 kret = fpu_get_fxstate(thr_act, (thread_state_t)&state->ufs.fs64, x86_FLOAT_STATE64);
1278 state->fsh.flavor = x86_FLOAT_STATE32;
1279 state->fsh.count = x86_FLOAT_STATE32_COUNT;
1281 kret = fpu_get_fxstate(thr_act, (thread_state_t)&state->ufs.fs32, x86_FLOAT_STATE32);
1316 x86_avx_state_t *state;
1322 state = (x86_avx_state_t *)tstate;
1324 bzero((char *)state, sizeof(x86_avx_state_t));
1326 state->ash.flavor = x86_AVX_STATE64;
1327 state->ash.count = x86_AVX_STATE64_COUNT;
1329 (thread_state_t)&state->ufs.as64,
1332 state->ash.flavor = x86_AVX_STATE32;
1333 state->ash.count = x86_AVX_STATE32_COUNT;
1335 (thread_state_t)&state->ufs.as32,
1373 x86_thread_state_t *state;
1378 state = (x86_thread_state_t *)tstate;
1380 bzero((char *)state, sizeof(x86_thread_state_t));
1383 state->tsh.flavor = x86_THREAD_STATE64;
1384 state->tsh.count = x86_THREAD_STATE64_COUNT;
1386 get_thread_state64(thr_act, &state->uts.ts64);
1388 state->tsh.flavor = x86_THREAD_STATE32;
1389 state->tsh.count = x86_THREAD_STATE32_COUNT;
1391 get_thread_state32(thr_act, &state->uts.ts32);
1412 * of this deprecated state.
1431 * of this deprecated state.
1439 x86_exception_state_t *state;
1444 state = (x86_exception_state_t *)tstate;
1446 bzero((char *)state, sizeof(x86_exception_state_t));
1449 state->esh.flavor = x86_EXCEPTION_STATE64;
1450 state->esh.count = x86_EXCEPTION_STATE64_COUNT;
1452 get_exception_state64(thr_act, &state->ues.es64);
1454 state->esh.flavor = x86_EXCEPTION_STATE32;
1455 state->esh.count = x86_EXCEPTION_STATE32_COUNT;
1457 get_exception_state32(thr_act, &state->ues.es32);
1493 x86_debug_state_t *state;
1498 state = (x86_debug_state_t *)tstate;
1500 bzero(state, sizeof *state);
1503 state->dsh.flavor = x86_DEBUG_STATE64;
1504 state->dsh.count = x86_DEBUG_STATE64_COUNT;
1506 get_debug_state64(thr_act, &state->uds.ds64);
1508 state->dsh.flavor = x86_DEBUG_STATE32;
1509 state->dsh.count = x86_DEBUG_STATE32_COUNT;
1511 get_debug_state32(thr_act, &state->uds.ds32);
1540 x86_thread_state32_t *state;
1547 state = (x86_thread_state32_t *) tstate;
1553 state->eax = saved_state->eax;
1554 state->ebx = saved_state->ebx;
1555 state->ecx = saved_state->ecx;
1556 state->edx = saved_state->edx;
1557 state->edi = saved_state->edi;
1558 state->esi = saved_state->esi;
1559 state->ebp = saved_state->ebp;
1560 state->esp = saved_state->uesp;
1561 state->eflags = saved_state->efl;
1562 state->eip = saved_state->eip;
1563 state->cs = saved_state->cs;
1564 state->ss = saved_state->ss;
1565 state->ds = saved_state->ds & 0xffff;
1566 state->es = saved_state->es & 0xffff;
1567 state->fs = saved_state->fs & 0xffff;
1568 state->gs = saved_state->gs & 0xffff;
1576 x86_thread_state64_t *state;
1583 state = (x86_thread_state64_t *) tstate;
1589 state->rax = saved_state->rax;
1590 state->rbx = saved_state->rbx;
1591 state->rcx = saved_state->rcx;
1592 state->rdx = saved_state->rdx;
1593 state->rdi = saved_state->rdi;
1594 state->rsi = saved_state->rsi;
1595 state->rbp = saved_state->rbp;
1596 state->rsp = saved_state->isf.rsp;
1597 state->r8 = saved_state->r8;
1598 state->r9 = saved_state->r9;
1599 state->r10 = saved_state->r10;
1600 state->r11 = saved_state->r11;
1601 state->r12 = saved_state->r12;
1602 state->r13 = saved_state->r13;
1603 state->r14 = saved_state->r14;
1604 state->r15 = saved_state->r15;
1606 state->rip = saved_state->isf.rip;
1607 state->rflags = saved_state->isf.rflags;
1608 state->cs = saved_state->isf.cs;
1609 state->fs = saved_state->fs & 0xffff;
1610 state->gs = saved_state->gs & 0xffff;
1617 x86_thread_state_t *state = NULL;
1622 state = (x86_thread_state_t *) tstate;
1627 state->tsh.flavor = x86_THREAD_STATE32;
1628 state->tsh.count = x86_THREAD_STATE32_COUNT;
1633 state->uts.ts32.eax = saved_state->eax;
1634 state->uts.ts32.ebx = saved_state->ebx;
1635 state->uts.ts32.ecx = saved_state->ecx;
1636 state->uts.ts32.edx = saved_state->edx;
1637 state->uts.ts32.edi = saved_state->edi;
1638 state->uts.ts32.esi = saved_state->esi;
1639 state->uts.ts32.ebp = saved_state->ebp;
1640 state->uts.ts32.esp = saved_state->uesp;
1641 state->uts.ts32.eflags = saved_state->efl;
1642 state->uts.ts32.eip = saved_state->eip;
1643 state->uts.ts32.cs = saved_state->cs;
1644 state->uts.ts32.ss = saved_state->ss;
1645 state->uts.ts32.ds = saved_state->ds & 0xffff;
1646 state->uts.ts32.es = saved_state->es & 0xffff;
1647 state->uts.ts32.fs = saved_state->fs & 0xffff;
1648 state->uts.ts32.gs = saved_state->gs & 0xffff;
1652 state->tsh.flavor = x86_THREAD_STATE64;
1653 state->tsh.count = x86_THREAD_STATE64_COUNT;
1658 state->uts.ts64.rax = saved_state->rax;
1659 state->uts.ts64.rbx = saved_state->rbx;
1660 state->uts.ts64.rcx = saved_state->rcx;
1661 state->uts.ts64.rdx = saved_state->rdx;
1662 state->uts.ts64.rdi = saved_state->rdi;
1663 state->uts.ts64.rsi = saved_state->rsi;
1664 state->uts.ts64.rbp = saved_state->rbp;
1665 state->uts.ts64.rsp = saved_state->isf.rsp;
1666 state->uts.ts64.r8 = saved_state->r8;
1667 state->uts.ts64.r9 = saved_state->r9;
1668 state->uts.ts64.r10 = saved_state->r10;
1669 state->uts.ts64.r11 = saved_state->r11;
1670 state->uts.ts64.r12 = saved_state->r12;
1671 state->uts.ts64.r13 = saved_state->r13;
1672 state->uts.ts64.r14 = saved_state->r14;
1673 state->uts.ts64.r15 = saved_state->r15;
1675 state->uts.ts64.rip = saved_state->isf.rip;
1676 state->uts.ts64.rflags = saved_state->isf.rflags;
1677 state->uts.ts64.cs = saved_state->isf.cs;
1678 state->uts.ts64.fs = saved_state->fs & 0xffff;
1679 state->uts.ts64.gs = saved_state->gs & 0xffff;
1681 panic("unknown thread state");
1702 * Reset the state saveareas. As we're resetting, we anticipate no
1744 "x86_64 saved state");
1749 "x86_64 debug state");
1755 "x86 saved state");
1759 "x86 debug state");
1813 * Print out user register state