Changeset 40597 in vbox for trunk/src/bldprogs/VBoxTpG.cpp
- Timestamp:
- Mar 23, 2012 6:08:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/VBoxTpG.cpp
r40594 r40597 188 188 static unsigned g_cAssemblerOptions = 0; 189 189 static const char *g_apszAssemblerOptions[32]; 190 static const char *g_pszProbeFnName = "SUPR0FireProbe"; 191 static bool g_fProbeFnImported = true; 190 192 /** @} */ 191 193 … … 724 726 ";\n" 725 727 "BEGINCODE\n" 726 "extern IMPNAME(SUPR0FireProbe)\n" /** @todo VBoxDrv may eventually need special handling wrt importing. */ 727 ); 728 "extern %sNAME(%s)\n", 729 g_fProbeFnImported ? "IMP" : "", 730 g_pszProbeFnName); 728 731 RTListForEach(&g_ProviderHead, pProvider, VTGPROVIDER, ListEntry) 729 732 { … … 772 775 } 773 776 else if (g_cBits == 32) 774 { 775 /** @todo Check that none of the first 5 arguments are larger than pointer or 776 * 32-bit!! */ 777 ScmStreamPrintf(pStrm, 777 /* Assumes the size of the arguments are no larger than a 778 pointer. This is asserted in the header. */ 779 ScmStreamPrintf(pStrm, g_fProbeFnImported ? 778 780 " mov edx, [eax + 4] ; idProbe\n" 779 " mov ecx, IMP( SUPR0FireProbe)\n"781 " mov ecx, IMP(%s)\n" 780 782 " mov [esp + 4], edx ; Replace pVTGProbeLoc with idProbe.\n" 781 " jmp ecx\n"); 782 } 783 " jmp ecx\n" 784 : 785 " mov edx, [eax + 4] ; idProbe\n" 786 " mov [esp + 4], edx ; Replace pVTGProbeLoc with idProbe.\n" 787 " jmp NAME(%s)\n" 788 , g_pszProbeFnName); 783 789 else if (fWin64) 784 ScmStreamPrintf(pStrm, 785 " mov rax, IMP( SUPR0FireProbe) wrt RIP\n"790 ScmStreamPrintf(pStrm, g_fProbeFnImported ? 791 " mov rax, IMP(%s) wrt RIP\n" 786 792 " mov ecx, [rcx + 4] ; idProbe replaces pVTGProbeLoc.\n" 787 " jmp rax\n"); 793 " jmp rax\n" 794 : 795 " mov ecx, [rcx + 4] ; idProbe replaces pVTGProbeLoc.\n" 796 " jmp NAME(SUPR0FireProbe)\n" 797 , g_pszProbeFnName); 788 798 else 789 ScmStreamPrintf(pStrm, 790 " lea rax, [IMP( SUPR0FireProbe) wrt RIP]\n" //??? macho64?799 ScmStreamPrintf(pStrm, g_fProbeFnImported ? 800 " lea rax, [IMP(%s) wrt RIP]\n" //??? macho64? 791 801 " mov edi, [rdi + 4] ; idProbe replaces pVTGProbeLoc.\n" 792 " jmp rax\n"); 802 " jmp rax\n" 803 : 804 " mov edi, [rdi + 4] ; idProbe replaces pVTGProbeLoc.\n" 805 " jmp NAME(SUPR0FireProbe)\n" 806 , g_pszProbeFnName); 793 807 794 808 ScmStreamPrintf(pStrm, … … 1816 1830 kVBoxTpGOpt_AssemblerOutputOpt, 1817 1831 kVBoxTpGOpt_AssemblerOption, 1832 kVBoxTpGOpt_ProbeFnName, 1833 kVBoxTpGOpt_ProbeFnImported, 1818 1834 kVBoxTpGOpt_End 1819 1835 }; … … 1836 1852 { "--assembler-output-opt", kVBoxTpGOpt_AssemblerOutputOpt, RTGETOPT_REQ_STRING }, 1837 1853 { "--assembler-option", kVBoxTpGOpt_AssemblerOption, RTGETOPT_REQ_STRING }, 1854 { "--probe-fn-name", kVBoxTpGOpt_ProbeFnName, RTGETOPT_REQ_STRING }, 1855 { "--probe-fn-imported", kVBoxTpGOpt_ProbeFnImported, RTGETOPT_REQ_BOOL }, 1838 1856 }; 1839 1857 … … 1932 1950 1933 1951 /* 1934 * Ou toptions.1952 * Our options. 1935 1953 */ 1936 1954 case kVBoxTpGOpt_Assembler: … … 1955 1973 g_apszAssemblerOptions[g_cAssemblerOptions] = ValueUnion.psz; 1956 1974 g_cAssemblerOptions++; 1975 break; 1976 1977 case kVBoxTpGOpt_ProbeFnName: 1978 g_pszProbeFnName = ValueUnion.psz; 1979 break; 1980 1981 case kVBoxTpGOpt_ProbeFnImported: 1982 g_pszProbeFnName = ValueUnion.psz; 1957 1983 break; 1958 1984
Note:
See TracChangeset
for help on using the changeset viewer.