Changeset 66162 in vbox
- Timestamp:
- Mar 18, 2017 10:03:24 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114071
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66161 r66162 196 196 * and after are marked not-present. */ 197 197 uint8_t BS3_FAR *pbDataPg; 198 /** The flat address corresponding to pbDataPg. */ 199 uintptr_t uDataPgFlat; 200 /** The 16-bit address corresponding to pbDataPg. */ 201 RTFAR16 DataPgFar; 198 202 199 203 /** The name corresponding to bMode. */ … … 664 668 665 669 670 static unsigned Bs3Cfg1EncodeMemMod0Disp(PBS3CG1STATE pThis, bool fAddrOverride, unsigned off, uint8_t iReg, 671 uint8_t cbOp, BS3CG1OPLOC enmLocation) 672 { 673 pThis->aOperands[pThis->iRmOp].idxField = BS3CG1DST_INVALID; 674 pThis->aOperands[pThis->iRmOp].enmLocation = enmLocation; 675 pThis->aOperands[pThis->iRmOp].cbOp = cbOp; 676 pThis->aOperands[pThis->iRmOp].off = cbOp; 677 678 if ( BS3_MODE_IS_16BIT_CODE(pThis->bMode) 679 || (fAddrOverride && BS3_MODE_IS_32BIT_CODE(pThis->bMode)) ) 680 { 681 /* 682 * 16-bit code doing 16-bit or 32-bit addressing, 683 * or 32-bit code doing 16-bit addressing. 684 */ 685 unsigned iRing = 4; 686 if (BS3_MODE_IS_RM_OR_V86(pThis->bMode)) 687 while (iRing-- > 0) 688 pThis->aInitialCtxs[iRing].ds = pThis->DataPgFar.sel; 689 else 690 while (iRing-- > 0) 691 pThis->aInitialCtxs[iRing].ds = pThis->DataPgFar.sel | iRing; 692 if (!fAddrOverride || BS3_MODE_IS_32BIT_CODE(pThis->bMode)) 693 { 694 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, iReg, 6 /*disp16*/); 695 *(uint16_t *)&pThis->abCurInstr[off] = pThis->DataPgFar.off + X86_PAGE_SIZE - cbOp; 696 off += 2; 697 } 698 else 699 { 700 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, iReg, 5 /*disp32*/); 701 *(uint32_t *)&pThis->abCurInstr[off] = pThis->DataPgFar.off + X86_PAGE_SIZE - cbOp; 702 off += 4; 703 } 704 } 705 else 706 { 707 /* 708 * 32-bit code doing 32-bit addressing, 709 * or 64-bit code doing either 64-bit or 32-bit addressing. 710 */ 711 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, iReg, 5 /*disp32*/); 712 *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - cbOp; 713 714 /* In 64-bit mode we always have a rip relative encoding regardless of fAddrOverride. */ 715 if (BS3_MODE_IS_64BIT_CODE(pThis->bMode)) 716 *(uint32_t *)&pThis->abCurInstr[off] -= BS3_FP_OFF(&pThis->pbCodePg[X86_PAGE_SIZE]); 717 off += 4; 718 } 719 720 return off; 721 } 722 723 666 724 /** 667 725 * Encodes the next instruction. … … 676 734 { 677 735 unsigned off; 736 unsigned cbOp; 678 737 switch (pThis->enmEncoding) 679 738 { … … 687 746 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_CL; 688 747 } 689 else if (iEncoding == 1 || iEncoding == 2) 690 { 691 /** @todo need to figure out a more flexible way to do all this crap. */ 692 off = 0; 693 if (iEncoding == 2) 694 pThis->abCurInstr[off++] = 0x67; 695 off = Bs3Cg1InsertOpcodes(pThis, off); 696 if (BS3_MODE_IS_16BIT_CODE(pThis->bMode)) 697 { 698 #if ARCH_BITS == 16 /** @todo fixme */ 699 unsigned iRing = 4; 700 if (BS3_MODE_IS_RM_OR_V86(pThis->bMode)) 701 while (iRing-- > 0) 702 pThis->aInitialCtxs[iRing].ds = BS3_FP_SEG(pThis->pbDataPg); 703 else 704 while (iRing-- > 0) 705 pThis->aInitialCtxs[iRing].ds = BS3_FP_SEG(pThis->pbDataPg) | iRing; 706 #endif 707 if (iEncoding == 1) 708 { 709 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 6 /*disp16*/); 710 *(uint16_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - 1; 711 off += 2; 712 } 713 else 714 { 715 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 5 /*disp32*/); 716 *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - 1; 717 off += 4; 718 } 719 } 720 else 721 { 722 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 5 /*disp32*/); 723 *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - 1; 724 if (BS3_MODE_IS_64BIT_CODE(pThis->bMode)) 725 *(uint32_t *)&pThis->abCurInstr[off] -= BS3_FP_OFF(&pThis->pbCodePg[X86_PAGE_SIZE]); 726 off += 4; 727 } 728 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_CH; 729 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_INVALID; 730 pThis->aOperands[pThis->iRmOp ].enmLocation = BS3CG1OPLOC_MEM_RW; 731 pThis->aOperands[pThis->iRmOp ].off = 1; 732 733 if (BS3_MODE_IS_32BIT_CODE(pThis->bMode)) /* skip address size override */ 734 iEncoding++; 748 else if (iEncoding == 1) 749 { 750 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_CH; 751 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, 1, BS3CG1OPLOC_MEM_RW); 752 } 753 else if (iEncoding == 2 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386) 754 { 755 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_BH; 756 pThis->abCurInstr[0] = P_AZ; 757 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xDI, 1, BS3CG1OPLOC_MEM_RW); 735 758 } 736 759 else … … 749 772 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_CL; 750 773 } 751 else if (iEncoding == 1 || iEncoding == 2) 752 { 753 /** @todo need to figure out a more flexible way to do all this crap. */ 754 off = 0; 755 if (iEncoding == 2) 756 pThis->abCurInstr[off++] = 0x67; 757 off = Bs3Cg1InsertOpcodes(pThis, off); 758 if (BS3_MODE_IS_16BIT_CODE(pThis->bMode)) 759 { 760 #if ARCH_BITS == 16 /** @todo fixme */ 761 unsigned iRing = 4; 762 if (BS3_MODE_IS_RM_OR_V86(pThis->bMode)) 763 while (iRing-- > 0) 764 pThis->aInitialCtxs[iRing].ds = BS3_FP_SEG(pThis->pbDataPg); 765 else 766 while (iRing-- > 0) 767 pThis->aInitialCtxs[iRing].ds = BS3_FP_SEG(pThis->pbDataPg) | iRing; 768 #endif 769 if (iEncoding == 1) 770 { 771 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 6 /*disp16*/); 772 *(uint16_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - 1; 773 off += 2; 774 } 775 else 776 { 777 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 5 /*disp32*/); 778 *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - 1; 779 off += 4; 780 } 781 } 782 else 783 { 784 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 5 /*disp32*/); 785 *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - 1; 786 if (BS3_MODE_IS_64BIT_CODE(pThis->bMode)) 787 *(uint32_t *)&pThis->abCurInstr[off] -= BS3_FP_OFF(&pThis->pbCodePg[X86_PAGE_SIZE]); 788 off += 4; 789 } 790 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_CH; 791 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_INVALID; 792 pThis->aOperands[pThis->iRmOp ].enmLocation = BS3CG1OPLOC_MEM; 793 pThis->aOperands[pThis->iRmOp ].off = 1; 794 795 if (BS3_MODE_IS_32BIT_CODE(pThis->bMode)) /* skip address size override */ 796 iEncoding++; 774 else if (iEncoding == 1) 775 { 776 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_CH; 777 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, 1, BS3CG1OPLOC_MEM); 778 } 779 else if (iEncoding == 2 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386) 780 { 781 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_BH; 782 pThis->abCurInstr[0] = P_AZ; 783 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xDI, 1, BS3CG1OPLOC_MEM); 797 784 } 798 785 else 799 786 break; 787 pThis->cbCurInstr = off; 788 iEncoding++; 789 break; 790 791 case BS3CG1ENC_MODRM_Gv_Ev: 792 case BS3CG1ENC_MODRM_Ev_Gv: 793 if (iEncoding == 0) 794 { 795 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4; 796 off = Bs3Cg1InsertOpcodes(pThis, 0); 797 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX); 798 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBX; 799 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_OZ_RDX; 800 } 801 else if (iEncoding == 1) 802 { 803 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4; 804 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP; 805 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, cbOp, 806 pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW); 807 } 808 else if (iEncoding == 2 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386) 809 { 810 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 4 : 2; 811 pThis->abCurInstr[0] = P_OZ; 812 off = Bs3Cg1InsertOpcodes(pThis, 1); 813 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX); 814 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBX; 815 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_OZ_RDX; 816 pThis->aOperands[pThis->iRmOp ].enmLocation = BS3CG1OPLOC_CTX; 817 } 818 else if (iEncoding == 3) 819 { 820 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 4 : 2; 821 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RSI; 822 pThis->abCurInstr[0] = P_OZ; 823 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xSI, cbOp, 824 pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW); 825 } 826 else if (iEncoding == 4) 827 { 828 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4; 829 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RDI; 830 pThis->abCurInstr[0] = P_AZ; 831 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xDI, cbOp, 832 pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW); 833 } 834 else if (iEncoding == 5) 835 { 836 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 4 : 2; 837 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RSI; 838 pThis->abCurInstr[0] = P_OZ; 839 pThis->abCurInstr[1] = P_AZ; 840 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 2), X86_GREG_xSI, cbOp, 841 pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW); 842 } 843 else if (iEncoding == 6 && BS3_MODE_IS_64BIT_CODE(pThis->bMode)) 844 { 845 cbOp = 8; 846 pThis->abCurInstr[0] = REX_W___; 847 off = Bs3Cg1InsertOpcodes(pThis, 1); 848 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX); 849 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_RBX; 850 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_RDX; 851 pThis->aOperands[pThis->iRmOp ].enmLocation = BS3CG1OPLOC_CTX; 852 } 853 else 854 break; 855 pThis->aOperands[0].cbOp = cbOp; 856 pThis->aOperands[1].cbOp = cbOp; 857 pThis->cbOperand = cbOp; 858 pThis->cbCurInstr = off; 859 iEncoding++; 860 break; 861 862 case BS3CG1ENC_MODRM_Gv_Ma: 863 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4; 864 if (iEncoding == 0) 865 { 866 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP; 867 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM); 868 } 869 else if (iEncoding == 1 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386) 870 { 871 cbOp = cbOp == 2 ? 4 : 2; 872 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP; 873 pThis->abCurInstr[0] = P_OZ; 874 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM); 875 } 876 else if (iEncoding == 2) 877 { 878 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP; 879 pThis->abCurInstr[0] = P_AZ; 880 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM); 881 } 882 else if (iEncoding == 3) 883 { 884 cbOp = cbOp == 2 ? 4 : 2; 885 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP; 886 pThis->abCurInstr[0] = P_AZ; 887 pThis->abCurInstr[1] = P_OZ; 888 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 2), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM); 889 } 890 else 891 break; 892 pThis->aOperands[pThis->iRegOp].cbOp = cbOp; 893 pThis->cbOperand = cbOp; 800 894 pThis->cbCurInstr = off; 801 895 iEncoding++; … … 881 975 pThis->cbCurInstr = off; 882 976 iEncoding++; 883 break;884 885 case BS3CG1ENC_MODRM_Gv_Ev:886 case BS3CG1ENC_MODRM_Ev_Gv:887 if (iEncoding == 0)888 {889 off = Bs3Cg1InsertOpcodes(pThis, 0);890 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX);891 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBX;892 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_OZ_RDX;893 if (BS3_MODE_IS_16BIT_CODE(pThis->bMode))894 pThis->aOperands[0].cbOp = pThis->aOperands[1].cbOp = pThis->cbOperand = 2;895 else896 pThis->aOperands[0].cbOp = pThis->aOperands[1].cbOp = pThis->cbOperand = 4;897 }898 else if (iEncoding == 1 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386)899 {900 pThis->abCurInstr[0] = P_OZ;901 off = Bs3Cg1InsertOpcodes(pThis, 1);902 903 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX);904 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBX;905 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_OZ_RDX;906 if (!BS3_MODE_IS_16BIT_CODE(pThis->bMode))907 pThis->aOperands[0].cbOp = pThis->aOperands[1].cbOp = pThis->cbOperand = 2;908 else909 pThis->aOperands[0].cbOp = pThis->aOperands[1].cbOp = pThis->cbOperand = 4;910 }911 else if (iEncoding == 2 && BS3_MODE_IS_64BIT_CODE(pThis->bMode))912 {913 pThis->abCurInstr[0] = REX_W___;914 off = Bs3Cg1InsertOpcodes(pThis, 1);915 916 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX);917 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_RBX;918 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_RDX;919 pThis->aOperands[0].cbOp = pThis->aOperands[1].cbOp = pThis->cbOperand = 8;920 }921 else922 break;923 pThis->cbCurInstr = off;924 iEncoding++;925 break;926 927 case BS3CG1ENC_MODRM_Gv_Ma:928 if (iEncoding < 2)929 {930 /** @todo need to figure out a more flexible way to do all this crap. */931 uint8_t cbAddr = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4;932 uint8_t cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4;933 934 off = 0;935 if (iEncoding == 1)936 {937 pThis->abCurInstr[off++] = P_OZ;938 cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 4 : 2;939 }940 941 off = Bs3Cg1InsertOpcodes(pThis, off);942 943 if (cbAddr == 2)944 {945 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 6 /*disp16*/);946 *(uint16_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - cbOp * 2;947 }948 else949 {950 pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, X86_GREG_xBP, 5 /*disp32*/);951 *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - cbOp * 2;952 }953 off += cbAddr;954 955 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP;956 pThis->aOperands[pThis->iRegOp].cbOp = cbOp;957 pThis->aOperands[pThis->iRmOp ].cbOp = cbOp * 2;958 pThis->aOperands[pThis->iRmOp ].off = cbOp * 2;959 pThis->cbOperand = cbOp;960 961 #if ARCH_BITS == 16 /** @todo fixme */962 if (cbAddr == 2)963 {964 unsigned iRing = 4;965 if (BS3_MODE_IS_RM_OR_V86(pThis->bMode))966 while (iRing-- > 0)967 pThis->aInitialCtxs[iRing].ds = BS3_FP_SEG(pThis->pbDataPg);968 else969 while (iRing-- > 0)970 pThis->aInitialCtxs[iRing].ds = BS3_FP_SEG(pThis->pbDataPg) | iRing;971 }972 #endif973 pThis->cbCurInstr = off;974 iEncoding++;975 }976 977 break; 977 978 … … 1313 1314 PtrField.pu8 = &pThis->pbDataPg[X86_PAGE_SIZE - pThis->aOperands[idxOp].off]; 1314 1315 else 1315 PtrField.pu8 = pThis->MemOp.ab [1];1316 PtrField.pu8 = pThis->MemOp.ab; 1316 1317 break; 1317 1318 … … 1654 1655 unsigned iInstr; 1655 1656 BS3MEMKIND const enmMemKind = BS3_MODE_IS_RM_OR_V86(bMode) ? BS3MEMKIND_REAL 1656 : BS3_MODE_IS_16BIT_CODE(bMode) ? BS3MEMKIND_TILED : BS3MEMKIND_FLAT32;1657 : !BS3_MODE_IS_64BIT_CODE(bMode) ? BS3MEMKIND_TILED : BS3MEMKIND_FLAT32; 1657 1658 1658 1659 #if 0 … … 1707 1708 } 1708 1709 This.uCodePgFlat = Bs3SelPtrToFlat(This.pbCodePg); 1710 This.uDataPgFlat = Bs3SelPtrToFlat(This.pbDataPg); 1711 #if ARCH_BITS == 16 1712 This.DataPgFar.off = BS3_FP_OFF(This.pbDataPg); 1713 This.DataPgFar.sel = BS3_FP_SEG(This.pbDataPg); 1714 #else 1715 if (BS3_MODE_IS_RM_OR_V86(bMode)) 1716 *(uint32_t *)&This.DataPgFar = Bs3SelFlatDataToRealMode(This.uDataPgFlat); 1717 else if (!BS3_MODE_IS_64BIT_CODE(bMode)) 1718 *(uint32_t *)&This.DataPgFar = Bs3SelFlatDataToProtFar16(This.uDataPgFlat); 1719 else 1720 *(uint32_t *)&This.DataPgFar = 0; 1721 #endif 1709 1722 1710 1723 /* Create basic context for each target ring. In protected 16-bit code we need … … 1902 1915 Bs3TestSubDone(); 1903 1916 #if 0 1904 if (bMode >= BS3_MODE_P P16)1917 if (bMode >= BS3_MODE_PE16_32) 1905 1918 { 1906 1919 Bs3TestTerm();
Note:
See TracChangeset
for help on using the changeset viewer.