Changeset 43055 in vbox
- Timestamp:
- Aug 28, 2012 11:50:20 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80390
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r43019 r43055 2979 2979 2980 2980 TEMPLATE_VBoxR0_USES += dtrace 2981 TEMPLATE_VBoxR0_DTRACE_HDR_FLAGS = --ring-0-context-agnostic 2982 TEMPLATE_VBoxR0_DTRACE_OBJ_FLAGS = --ring-0-context-agnostic 2981 2983 ifdef VBOX_WITH_DTRACE_R0 2982 2984 TEMPLATE_VBoxR0_DTRACETOOL = VBoxTpG -
trunk/src/bldprogs/VBoxTpG.cpp
r41362 r43055 144 144 static uint32_t g_fTypeContext = VTG_TYPE_CTX_R0; 145 145 static const char *g_pszContextDefine = "IN_RING0"; 146 static const char *g_pszContextDefine2 = NULL; 146 147 static bool g_fApplyCpp = false; 147 148 static uint32_t g_cVerbosity = 0; … … 297 298 apszArgs[iArg++] = g_pszAssemblerDefOpt; 298 299 apszArgs[iArg++] = g_pszContextDefine; 300 if (g_pszContextDefine2) 301 { 302 apszArgs[iArg++] = g_pszAssemblerDefOpt; 303 apszArgs[iArg++] = g_pszContextDefine2; 304 } 299 305 if (g_szAssemblerOsDef[0]) 300 306 { … … 310 316 apszArgs[iArg++] = pszTempAsm; 311 317 apszArgs[iArg] = NULL; 318 Assert(iArg <= RT_ELEMENTS(apszArgs)); 312 319 313 320 if (g_cVerbosity > 1) … … 458 465 " NAME(%%1):\n" 459 466 " %%endmacro\n" 460 " ; Section order hack!\n" 461 " ; With the ld64-97.17 linker there was a problem with it determin the section\n" 462 " ; order based on symbol references. The references to the start and end of the\n" 463 " ; __VTGPrLc section forced it in front of __VTGObj.\n" 464 " extern section$start$__VTG$__VTGObj\n" 465 " extern section$end$__VTG$__VTGObj\n" 466 " [section __VTG __VTGObj align=1024]\n" 467 " %%ifdef IN_RING3\n" 468 " %%define VTG_NEW_MACHO_LINKER\n" 469 " %%elif ARCH_BITS == 64\n" 470 " %%define VTG_NEW_MACHO_LINKER\n" 471 " %%elifdef IN_RING0_AGNOSTIC\n" 472 " %%define VTG_NEW_MACHO_LINKER\n" 473 " %%endif\n" 474 " %%ifdef VTG_NEW_MACHO_LINKER\n" 475 " ; Section order hack!\n" 476 " ; With the ld64-97.17 linker there was a problem with it determining the section\n" 477 " ; order based on symbol references. The references to the start and end of the\n" 478 " ; __VTGPrLc section forced it in front of __VTGObj, we want __VTGObj first.\n" 479 " extern section$start$__VTG$__VTGObj\n" 480 " extern section$end$__VTG$__VTGObj\n" 481 " %%else\n" 482 " ; Creating 32-bit kext of the type MH_OBJECT. No fancy section end/start symbols handy.\n" 483 " [section __VTG __VTGObj align=16]\n" 484 "VTG_GLOBAL g_aVTGObj_LinkerPleaseNoticeMe, data\n" 485 " [section __VTG __VTGPrLc.Begin align=16]\n" 486 "VTG_GLOBAL g_aVTGPrLc, data\n" 487 " [section __VTG __VTGPrLc align=16]\n" 488 "VTG_GLOBAL g_aVTGPrLc_LinkerPleaseNoticeMe, data\n" 489 " [section __VTG __VTGPrLc.End align=16]\n" 490 "VTG_GLOBAL g_aVTGPrLc_End, data\n" 491 " %%endif\n" 492 " [section __VTG __VTGObj]\n" 467 493 "\n" 468 494 "%%elifdef ASM_FORMAT_PE\n" … … 518 544 " dd 0\n" 519 545 " dd 0\n" 520 "%%ifdef ASM_FORMAT_MACHO ; Apple has a real decent linker!\n"521 " extern section$start$__VTG$__VTGPrLc\n"546 "%%ifdef VTG_NEW_MACHO_LINKER\n" 547 " extern section$start$__VTG$__VTGPrLc\n" 522 548 " RTCCPTR_DEF section$start$__VTG$__VTGPrLc\n" 523 549 " %%if ARCH_BITS == 32\n" 524 550 " dd 0\n" 525 551 " %%endif\n" 526 " extern section$end$__VTG$__VTGPrLc\n"552 " extern section$end$__VTG$__VTGPrLc\n" 527 553 " RTCCPTR_DEF section$end$__VTG$__VTGPrLc\n" 528 554 " %%if ARCH_BITS == 32\n" … … 547 573 ScmStreamPrintf(pStrm, 548 574 " dd 0%08xh, 0%08xh, 0%08xh, 0%08xh\n" 549 "%%ifdef ASM_FORMAT_MACHO\n"575 "%%ifdef VTG_NEW_MACHO_LINKER\n" 550 576 " RTCCPTR_DEF section$start$__VTG$__VTGObj\n" 551 577 " %%if ARCH_BITS == 32\n" … … 2178 2204 kVBoxTpGOpt_RawModeContext, 2179 2205 kVBoxTpGOpt_Ring0Context, 2206 kVBoxTpGOpt_Ring0ContextAgnostic, 2180 2207 kVBoxTpGOpt_Ring3Context, 2181 2208 kVBoxTpGOpt_End … … 2208 2235 { "--raw-mode-context", kVBoxTpGOpt_RawModeContext, RTGETOPT_REQ_NOTHING }, 2209 2236 { "--ring-0-context", kVBoxTpGOpt_Ring0Context, RTGETOPT_REQ_NOTHING }, 2237 { "--ring-0-context-agnostic", kVBoxTpGOpt_Ring0ContextAgnostic, RTGETOPT_REQ_NOTHING }, 2210 2238 { "--ring-3-context", kVBoxTpGOpt_Ring3Context, RTGETOPT_REQ_NOTHING }, 2211 2239 /** @todo We're missing a bunch of assembler options! */ … … 2365 2393 g_fTypeContext = VTG_TYPE_CTX_RC; 2366 2394 g_pszContextDefine = "IN_RC"; 2395 g_pszContextDefine2 = NULL; 2367 2396 break; 2368 2397 … … 2370 2399 g_fTypeContext = VTG_TYPE_CTX_R0; 2371 2400 g_pszContextDefine = "IN_RING0"; 2401 g_pszContextDefine2 = NULL; 2402 break; 2403 2404 case kVBoxTpGOpt_Ring0ContextAgnostic: 2405 g_fTypeContext = VTG_TYPE_CTX_R0; 2406 g_pszContextDefine = "IN_RING0_AGNOSTIC"; 2407 g_pszContextDefine2 = "IN_RING0"; 2372 2408 break; 2373 2409 … … 2375 2411 g_fTypeContext = VTG_TYPE_CTX_R3; 2376 2412 g_pszContextDefine = "IN_RING3"; 2413 g_pszContextDefine2 = NULL; 2377 2414 break; 2378 2415
Note:
See TracChangeset
for help on using the changeset viewer.