Merge pull request #1830 from erozenfeld/RotateBits
authorEugene Rozenfeld <erozen@microsoft.com>
Thu, 22 Oct 2015 22:37:41 +0000 (15:37 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Thu, 22 Oct 2015 22:37:41 +0000 (15:37 -0700)
     Generate efficient code for rotation patterns.

328 files changed:
CMakeLists.txt
Documentation/building/cross-building.md
Documentation/building/freebsd-instructions.md
Documentation/building/linux-instructions.md
Documentation/building/osx-instructions.md
Documentation/building/unix-test-instructions.md
THIRD-PARTY-NOTICES [new file with mode: 0644]
clr.coreclr.props
clr.defines.targets
netci.groovy
src/corefx/System.Globalization.Native/collation.cpp
src/debug/shared/dbgtransportsession.cpp
src/inc/clrconfigvalues.h
src/inc/eventtracebase.h
src/inc/random.h
src/inc/utilcode.h
src/mscorlib/LICENSE [deleted file]
src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
src/mscorlib/corefx/System/Globalization/CompareInfo.Unix.cs
src/mscorlib/mscorlib.shared.sources.props
src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs
src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs [new file with mode: 0644]
src/mscorlib/src/System/Globalization/IdnMapping.cs
src/mscorlib/src/System/Random.cs
src/pal/inc/pal.h
src/pal/prebuilt/inc/clrallevents.h
src/pal/prebuilt/inc/clrxplatevents.h
src/pal/prebuilt/inc/etmdummy.h
src/pal/src/CMakeLists.txt
src/pal/src/cruntime/misc.cpp
src/pal/src/eventprovider/lttng/eventprovdotnetruntime.cpp
src/pal/src/eventprovider/lttng/tpdotnetruntime.h
src/pal/src/include/pal/module.h
src/pal/src/loader/module.cpp
src/pal/src/misc/interlock.cpp [deleted file]
src/pal/src/misc/miscpalapi.cpp
src/pal/tests/palsuite/c_runtime/_rotl/test1/CMakeLists.txt
src/pal/tests/palsuite/c_runtime/_rotl/test1/test1.cpp [moved from src/pal/tests/palsuite/c_runtime/_rotl/test1/test1.c with 100% similarity]
src/pal/tests/palsuite/c_runtime/_rotr/test1/CMakeLists.txt
src/pal/tests/palsuite/c_runtime/_rotr/test1/test1.cpp [moved from src/pal/tests/palsuite/c_runtime/_rotr/test1/test1.c with 100% similarity]
src/pal/tests/palsuite/eventprovider/clralltestevents.cpp
src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/test.c with 84% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/test.c with 84% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchangePointer/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchangePointer/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchangePointer/test1/test.c with 98% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedExchange/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedExchange/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedExchange/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedExchange64/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedExchange64/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedExchange64/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedExchangePointer/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedExchangePointer/test1/InterlockedExchangePointer.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedExchangePointer/test1/InterlockedExchangePointer.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test1/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test1/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test1/test.c with 100% similarity]
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/CMakeLists.txt
src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/test.cpp [moved from src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/test.c with 100% similarity]
src/utilcode/guidfromname.cpp
src/vm/ClrEtwAll.man
src/vm/ClrEtwAllMeta.lst
src/vm/dllimport.cpp
src/vm/dllimport.h
src/vm/ecalllist.h
src/vm/eventtrace.cpp
src/vm/eventtracepriv.h
src/vm/mscorlib.cpp
src/vm/threads.cpp
src/vm/threads.inl
tests/src/Regressions/coreclr/0014/app.config [moved from tests/src/regressions/coreclr/72162/app.config with 100% similarity]
tests/src/Regressions/coreclr/0014/avtest.cs [moved from tests/src/regressions/coreclr/0014/avtest.cs with 100% similarity]
tests/src/Regressions/coreclr/0014/avtest.csproj [moved from tests/src/regressions/coreclr/0014/avtest.csproj with 100% similarity]
tests/src/Regressions/coreclr/0014/project.json [moved from tests/src/regressions/coreclr/72162/project.json with 100% similarity]
tests/src/Regressions/coreclr/0014/project.lock.json [moved from tests/src/regressions/coreclr/72162/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0018/ArrayCopy.csproj [moved from tests/src/regressions/coreclr/0018/ArrayCopy.csproj with 100% similarity]
tests/src/Regressions/coreclr/0018/app.config [moved from tests/src/regressions/coreclr/1549/app.config with 100% similarity]
tests/src/Regressions/coreclr/0018/arraycopy.cool [moved from tests/src/regressions/coreclr/0018/arraycopy.cool with 100% similarity]
tests/src/Regressions/coreclr/0018/project.json [moved from tests/src/regressions/coreclr/1549/project.json with 100% similarity]
tests/src/Regressions/coreclr/0018/project.lock.json [moved from tests/src/regressions/coreclr/1549/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0028/app.config [moved from tests/src/regressions/coreclr/1535/app.config with 100% similarity]
tests/src/Regressions/coreclr/0028/project.json [moved from tests/src/regressions/coreclr/1535/project.json with 100% similarity]
tests/src/Regressions/coreclr/0028/project.lock.json [moved from tests/src/regressions/coreclr/1535/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0028/thread08-simplified.cs [moved from tests/src/regressions/coreclr/0028/thread08-simplified.cs with 100% similarity]
tests/src/Regressions/coreclr/0028/thread08-simplified.csproj [moved from tests/src/regressions/coreclr/0028/thread08-simplified.csproj with 100% similarity]
tests/src/Regressions/coreclr/0041/app.config [moved from tests/src/regressions/coreclr/1534/app.config with 100% similarity]
tests/src/Regressions/coreclr/0041/body_double.cs [moved from tests/src/regressions/coreclr/0041/body_double.cs with 100% similarity]
tests/src/Regressions/coreclr/0041/expl_double_1.cs [moved from tests/src/regressions/coreclr/0041/expl_double_1.cs with 100% similarity]
tests/src/Regressions/coreclr/0041/expl_double_1.csproj [moved from tests/src/regressions/coreclr/0041/expl_double_1.csproj with 100% similarity]
tests/src/Regressions/coreclr/0041/project.json [moved from tests/src/regressions/coreclr/1534/project.json with 100% similarity]
tests/src/Regressions/coreclr/0041/project.lock.json [moved from tests/src/regressions/coreclr/1534/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0044/app.config [moved from tests/src/regressions/coreclr/1514/app.config with 100% similarity]
tests/src/Regressions/coreclr/0044/nullable.cs [moved from tests/src/regressions/coreclr/0044/nullable.cs with 100% similarity]
tests/src/Regressions/coreclr/0044/nullable.csproj [moved from tests/src/regressions/coreclr/0044/nullable.csproj with 100% similarity]
tests/src/Regressions/coreclr/0044/project.json [moved from tests/src/regressions/coreclr/1514/project.json with 100% similarity]
tests/src/Regressions/coreclr/0044/project.lock.json [moved from tests/src/regressions/coreclr/1514/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0046/app.config [moved from tests/src/regressions/coreclr/1402/app.config with 100% similarity]
tests/src/Regressions/coreclr/0046/istype.cs [moved from tests/src/regressions/coreclr/0046/istype.cs with 100% similarity]
tests/src/Regressions/coreclr/0046/istype.csproj [moved from tests/src/regressions/coreclr/0046/istype.csproj with 100% similarity]
tests/src/Regressions/coreclr/0046/project.json [moved from tests/src/regressions/coreclr/1402/project.json with 100% similarity]
tests/src/Regressions/coreclr/0046/project.lock.json [moved from tests/src/regressions/coreclr/1402/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0069/app.config [moved from tests/src/regressions/coreclr/1386/app.config with 100% similarity]
tests/src/Regressions/coreclr/0069/date.cs [moved from tests/src/regressions/coreclr/0069/date.cs with 100% similarity]
tests/src/Regressions/coreclr/0069/date.csproj [moved from tests/src/regressions/coreclr/0069/date.csproj with 100% similarity]
tests/src/Regressions/coreclr/0069/project.json [moved from tests/src/regressions/coreclr/1386/project.json with 100% similarity]
tests/src/Regressions/coreclr/0069/project.lock.json [moved from tests/src/regressions/coreclr/1386/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0075/LargeArrayTest.csproj [moved from tests/src/regressions/coreclr/0075/LargeArrayTest.csproj with 100% similarity]
tests/src/Regressions/coreclr/0075/app.config [moved from tests/src/regressions/coreclr/1380/app.config with 100% similarity]
tests/src/Regressions/coreclr/0075/largearraytest.cs [moved from tests/src/regressions/coreclr/0075/largearraytest.cs with 100% similarity]
tests/src/Regressions/coreclr/0075/project.json [moved from tests/src/regressions/coreclr/1380/project.json with 100% similarity]
tests/src/Regressions/coreclr/0075/project.lock.json [moved from tests/src/regressions/coreclr/1380/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0077/app.config [moved from tests/src/regressions/coreclr/1337/app.config with 100% similarity]
tests/src/Regressions/coreclr/0077/interlock.cs [moved from tests/src/regressions/coreclr/0077/interlock.cs with 100% similarity]
tests/src/Regressions/coreclr/0077/interlock.csproj [moved from tests/src/regressions/coreclr/0077/interlock.csproj with 100% similarity]
tests/src/Regressions/coreclr/0077/project.json [moved from tests/src/regressions/coreclr/1337/project.json with 100% similarity]
tests/src/Regressions/coreclr/0077/project.lock.json [moved from tests/src/regressions/coreclr/1337/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0080/app.config [moved from tests/src/regressions/coreclr/1333/app.config with 100% similarity]
tests/src/Regressions/coreclr/0080/delete_next_card_table.cs [moved from tests/src/regressions/coreclr/0080/delete_next_card_table.cs with 100% similarity]
tests/src/Regressions/coreclr/0080/delete_next_card_table.csproj [moved from tests/src/regressions/coreclr/0080/delete_next_card_table.csproj with 100% similarity]
tests/src/Regressions/coreclr/0080/project.json [moved from tests/src/regressions/coreclr/1333/project.json with 100% similarity]
tests/src/Regressions/coreclr/0080/project.lock.json [moved from tests/src/regressions/coreclr/1333/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0099/AboveStackLimit.csproj [moved from tests/src/regressions/coreclr/0099/AboveStackLimit.csproj with 100% similarity]
tests/src/Regressions/coreclr/0099/abovestacklimit.cs [moved from tests/src/regressions/coreclr/0099/abovestacklimit.cs with 100% similarity]
tests/src/Regressions/coreclr/0099/app.config [moved from tests/src/regressions/coreclr/1307/app.config with 100% similarity]
tests/src/Regressions/coreclr/0099/project.json [moved from tests/src/regressions/coreclr/1307/project.json with 100% similarity]
tests/src/Regressions/coreclr/0099/project.lock.json [moved from tests/src/regressions/coreclr/1307/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0138/app.config [moved from tests/src/regressions/coreclr/0968/app.config with 100% similarity]
tests/src/Regressions/coreclr/0138/pow3.cs [moved from tests/src/regressions/coreclr/0138/pow3.cs with 100% similarity]
tests/src/Regressions/coreclr/0138/pow3.csproj [moved from tests/src/regressions/coreclr/0138/pow3.csproj with 100% similarity]
tests/src/Regressions/coreclr/0138/project.json [moved from tests/src/regressions/coreclr/0968/project.json with 100% similarity]
tests/src/Regressions/coreclr/0138/project.lock.json [moved from tests/src/regressions/coreclr/0968/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0149/SampleAssembly.csproj [moved from tests/src/regressions/coreclr/0149/SampleAssembly.csproj with 100% similarity]
tests/src/Regressions/coreclr/0149/app.config [moved from tests/src/regressions/coreclr/0939/app.config with 100% similarity]
tests/src/Regressions/coreclr/0149/project.json [moved from tests/src/regressions/coreclr/0939/project.json with 100% similarity]
tests/src/Regressions/coreclr/0149/project.lock.json [moved from tests/src/regressions/coreclr/0939/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0149/sampleassembly.cs [moved from tests/src/regressions/coreclr/0149/sampleassembly.cs with 100% similarity]
tests/src/Regressions/coreclr/0198/CompEx.csproj [moved from tests/src/regressions/coreclr/0198/CompEx.csproj with 100% similarity]
tests/src/Regressions/coreclr/0198/app.config [moved from tests/src/regressions/coreclr/0857/app.config with 100% similarity]
tests/src/Regressions/coreclr/0198/compex.cs [moved from tests/src/regressions/coreclr/0198/compex.cs with 100% similarity]
tests/src/Regressions/coreclr/0198/project.json [moved from tests/src/regressions/coreclr/0857/project.json with 100% similarity]
tests/src/Regressions/coreclr/0198/project.lock.json [moved from tests/src/regressions/coreclr/0857/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0202/ThreadCulture.csproj [moved from tests/src/regressions/coreclr/0202/ThreadCulture.csproj with 100% similarity]
tests/src/Regressions/coreclr/0202/app.config [moved from tests/src/regressions/coreclr/0829/app.config with 100% similarity]
tests/src/Regressions/coreclr/0202/project.json [moved from tests/src/regressions/coreclr/0829/project.json with 100% similarity]
tests/src/Regressions/coreclr/0202/project.lock.json [moved from tests/src/regressions/coreclr/0829/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0202/threadculture.cs [moved from tests/src/regressions/coreclr/0202/threadculture.cs with 100% similarity]
tests/src/Regressions/coreclr/0211/app.config [moved from tests/src/regressions/coreclr/0828/app.config with 100% similarity]
tests/src/Regressions/coreclr/0211/genrecur.cs [moved from tests/src/regressions/coreclr/0211/genrecur.cs with 100% similarity]
tests/src/Regressions/coreclr/0211/genrecur.csproj [moved from tests/src/regressions/coreclr/0211/genrecur.csproj with 100% similarity]
tests/src/Regressions/coreclr/0211/project.json [moved from tests/src/regressions/coreclr/0828/project.json with 100% similarity]
tests/src/Regressions/coreclr/0211/project.lock.json [moved from tests/src/regressions/coreclr/0828/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0275/Marshal.csproj [moved from tests/src/regressions/coreclr/0275/Marshal.csproj with 100% similarity]
tests/src/Regressions/coreclr/0275/app.config [moved from tests/src/regressions/coreclr/0792/app.config with 100% similarity]
tests/src/Regressions/coreclr/0275/marshal.cs [moved from tests/src/regressions/coreclr/0275/marshal.cs with 100% similarity]
tests/src/Regressions/coreclr/0275/project.json [moved from tests/src/regressions/coreclr/0792/project.json with 100% similarity]
tests/src/Regressions/coreclr/0275/project.lock.json [moved from tests/src/regressions/coreclr/0792/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0308/ToLower.csproj [moved from tests/src/regressions/coreclr/0308/ToLower.csproj with 100% similarity]
tests/src/Regressions/coreclr/0308/app.config [moved from tests/src/regressions/coreclr/0694/app.config with 100% similarity]
tests/src/Regressions/coreclr/0308/project.json [moved from tests/src/regressions/coreclr/0694/project.json with 100% similarity]
tests/src/Regressions/coreclr/0308/project.lock.json [moved from tests/src/regressions/coreclr/0694/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0308/tolower.cs [moved from tests/src/regressions/coreclr/0308/tolower.cs with 100% similarity]
tests/src/Regressions/coreclr/0341/PlatformCode.csproj [moved from tests/src/regressions/coreclr/0341/PlatformCode.csproj with 100% similarity]
tests/src/Regressions/coreclr/0341/UserCode.csproj [moved from tests/src/regressions/coreclr/0341/UserCode.csproj with 100% similarity]
tests/src/Regressions/coreclr/0341/app.config [moved from tests/src/regressions/coreclr/0584/app.config with 100% similarity]
tests/src/Regressions/coreclr/0341/platformcode.cs [moved from tests/src/regressions/coreclr/0341/platformcode.cs with 100% similarity]
tests/src/Regressions/coreclr/0341/project.json [moved from tests/src/regressions/coreclr/0584/project.json with 100% similarity]
tests/src/Regressions/coreclr/0341/project.lock.json [moved from tests/src/regressions/coreclr/0584/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0341/usercode.cs [moved from tests/src/regressions/coreclr/0341/usercode.cs with 100% similarity]
tests/src/Regressions/coreclr/0342/app.config [moved from tests/src/regressions/coreclr/0583/app.config with 100% similarity]
tests/src/Regressions/coreclr/0342/project.json [moved from tests/src/regressions/coreclr/0583/project.json with 100% similarity]
tests/src/Regressions/coreclr/0342/project.lock.json [moved from tests/src/regressions/coreclr/0583/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0342/unsafe.cs [moved from tests/src/regressions/coreclr/0342/unsafe.cs with 100% similarity]
tests/src/Regressions/coreclr/0342/unsafe.csproj [moved from tests/src/regressions/coreclr/0342/unsafe.csproj with 100% similarity]
tests/src/Regressions/coreclr/0416/app.config [moved from tests/src/regressions/coreclr/0582/app.config with 100% similarity]
tests/src/Regressions/coreclr/0416/hello.cs [moved from tests/src/regressions/coreclr/0416/hello.cs with 100% similarity]
tests/src/Regressions/coreclr/0416/hello.csproj [moved from tests/src/regressions/coreclr/0416/hello.csproj with 100% similarity]
tests/src/Regressions/coreclr/0416/project.json [moved from tests/src/regressions/coreclr/0582/project.json with 100% similarity]
tests/src/Regressions/coreclr/0416/project.lock.json [moved from tests/src/regressions/coreclr/0582/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0433/app.config [moved from tests/src/regressions/coreclr/0576/app.config with 100% similarity]
tests/src/Regressions/coreclr/0433/assem.cs [moved from tests/src/regressions/coreclr/0433/assem.cs with 100% similarity]
tests/src/Regressions/coreclr/0433/assem.csproj [moved from tests/src/regressions/coreclr/0433/assem.csproj with 100% similarity]
tests/src/Regressions/coreclr/0433/project.json [moved from tests/src/regressions/coreclr/0576/project.json with 100% similarity]
tests/src/Regressions/coreclr/0433/project.lock.json [moved from tests/src/regressions/coreclr/0576/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0433/test.cs [moved from tests/src/regressions/coreclr/0433/test.cs with 100% similarity]
tests/src/Regressions/coreclr/0433/test.csproj [moved from tests/src/regressions/coreclr/0433/test.csproj with 100% similarity]
tests/src/Regressions/coreclr/0487/app.config [moved from tests/src/regressions/coreclr/0570/app.config with 100% similarity]
tests/src/Regressions/coreclr/0487/project.json [moved from tests/src/regressions/coreclr/0570/project.json with 100% similarity]
tests/src/Regressions/coreclr/0487/project.lock.json [moved from tests/src/regressions/coreclr/0570/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0487/test.cs [moved from tests/src/regressions/coreclr/0487/test.cs with 100% similarity]
tests/src/Regressions/coreclr/0487/test.csproj [moved from tests/src/regressions/coreclr/0487/test.csproj with 100% similarity]
tests/src/Regressions/coreclr/0570/Test570.csproj [moved from tests/src/regressions/coreclr/0570/Test570.csproj with 100% similarity]
tests/src/Regressions/coreclr/0570/app.config [moved from tests/src/regressions/coreclr/0487/app.config with 100% similarity]
tests/src/Regressions/coreclr/0570/project.json [moved from tests/src/regressions/coreclr/0487/project.json with 100% similarity]
tests/src/Regressions/coreclr/0570/project.lock.json [moved from tests/src/regressions/coreclr/0487/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0570/test570.cs [moved from tests/src/regressions/coreclr/0570/test570.cs with 100% similarity]
tests/src/Regressions/coreclr/0576/Test0576.csproj [moved from tests/src/regressions/coreclr/0576/Test0576.csproj with 100% similarity]
tests/src/Regressions/coreclr/0576/app.config [moved from tests/src/regressions/coreclr/0433/app.config with 100% similarity]
tests/src/Regressions/coreclr/0576/project.json [moved from tests/src/regressions/coreclr/0433/project.json with 100% similarity]
tests/src/Regressions/coreclr/0576/project.lock.json [moved from tests/src/regressions/coreclr/0433/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0576/test0576.cs [moved from tests/src/regressions/coreclr/0576/test0576.cs with 100% similarity]
tests/src/Regressions/coreclr/0582/app.config [moved from tests/src/regressions/coreclr/0416/app.config with 100% similarity]
tests/src/Regressions/coreclr/0582/csgen.1.cs [moved from tests/src/regressions/coreclr/0582/csgen.1.cs with 100% similarity]
tests/src/Regressions/coreclr/0582/csgen.1.csproj [moved from tests/src/regressions/coreclr/0582/csgen.1.csproj with 100% similarity]
tests/src/Regressions/coreclr/0582/project.json [moved from tests/src/regressions/coreclr/0416/project.json with 100% similarity]
tests/src/Regressions/coreclr/0582/project.lock.json [moved from tests/src/regressions/coreclr/0416/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0583/Test583.csproj [moved from tests/src/regressions/coreclr/0583/Test583.csproj with 100% similarity]
tests/src/Regressions/coreclr/0583/app.config [moved from tests/src/regressions/coreclr/0342/app.config with 100% similarity]
tests/src/Regressions/coreclr/0583/project.json [moved from tests/src/regressions/coreclr/0342/project.json with 100% similarity]
tests/src/Regressions/coreclr/0583/project.lock.json [moved from tests/src/regressions/coreclr/0342/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0583/test583.cs [moved from tests/src/regressions/coreclr/0583/test583.cs with 100% similarity]
tests/src/Regressions/coreclr/0584/Test584.csproj [moved from tests/src/regressions/coreclr/0584/Test584.csproj with 100% similarity]
tests/src/Regressions/coreclr/0584/app.config [moved from tests/src/regressions/coreclr/0341/app.config with 100% similarity]
tests/src/Regressions/coreclr/0584/project.json [moved from tests/src/regressions/coreclr/0341/project.json with 100% similarity]
tests/src/Regressions/coreclr/0584/project.lock.json [moved from tests/src/regressions/coreclr/0341/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0584/test584.cs [moved from tests/src/regressions/coreclr/0584/test584.cs with 100% similarity]
tests/src/Regressions/coreclr/0694/CriticalCode.csproj [moved from tests/src/regressions/coreclr/0694/CriticalCode.csproj with 100% similarity]
tests/src/Regressions/coreclr/0694/app.config [moved from tests/src/regressions/coreclr/0308/app.config with 100% similarity]
tests/src/Regressions/coreclr/0694/criticalcode.cs [moved from tests/src/regressions/coreclr/0694/criticalcode.cs with 100% similarity]
tests/src/Regressions/coreclr/0694/project.json [moved from tests/src/regressions/coreclr/0308/project.json with 100% similarity]
tests/src/Regressions/coreclr/0694/project.lock.json [moved from tests/src/regressions/coreclr/0308/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0792/Test0792.csproj [moved from tests/src/regressions/coreclr/0792/Test0792.csproj with 100% similarity]
tests/src/Regressions/coreclr/0792/app.config [moved from tests/src/regressions/coreclr/0275/app.config with 100% similarity]
tests/src/Regressions/coreclr/0792/project.json [moved from tests/src/regressions/coreclr/0275/project.json with 100% similarity]
tests/src/Regressions/coreclr/0792/project.lock.json [moved from tests/src/regressions/coreclr/0275/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0792/test0792.cs [moved from tests/src/regressions/coreclr/0792/test0792.cs with 100% similarity]
tests/src/Regressions/coreclr/0828/Test0828.csproj [moved from tests/src/regressions/coreclr/0828/Test0828.csproj with 100% similarity]
tests/src/Regressions/coreclr/0828/app.config [moved from tests/src/regressions/coreclr/0211/app.config with 100% similarity]
tests/src/Regressions/coreclr/0828/project.json [moved from tests/src/regressions/coreclr/0211/project.json with 100% similarity]
tests/src/Regressions/coreclr/0828/project.lock.json [moved from tests/src/regressions/coreclr/0211/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0828/test0828.cs [moved from tests/src/regressions/coreclr/0828/test0828.cs with 100% similarity]
tests/src/Regressions/coreclr/0829/Test0829.csproj [moved from tests/src/regressions/coreclr/0829/Test0829.csproj with 100% similarity]
tests/src/Regressions/coreclr/0829/app.config [moved from tests/src/regressions/coreclr/0202/app.config with 100% similarity]
tests/src/Regressions/coreclr/0829/project.json [moved from tests/src/regressions/coreclr/0202/project.json with 100% similarity]
tests/src/Regressions/coreclr/0829/project.lock.json [moved from tests/src/regressions/coreclr/0202/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0829/test0829.cs [moved from tests/src/regressions/coreclr/0829/test0829.cs with 100% similarity]
tests/src/Regressions/coreclr/0857/app.config [moved from tests/src/regressions/coreclr/0198/app.config with 100% similarity]
tests/src/Regressions/coreclr/0857/override.cs [moved from tests/src/regressions/coreclr/0857/override.cs with 100% similarity]
tests/src/Regressions/coreclr/0857/override.csproj [moved from tests/src/regressions/coreclr/0857/override.csproj with 100% similarity]
tests/src/Regressions/coreclr/0857/project.json [moved from tests/src/regressions/coreclr/0198/project.json with 100% similarity]
tests/src/Regressions/coreclr/0857/project.lock.json [moved from tests/src/regressions/coreclr/0198/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0939/app.config [moved from tests/src/regressions/coreclr/0149/app.config with 100% similarity]
tests/src/Regressions/coreclr/0939/project.json [moved from tests/src/regressions/coreclr/0149/project.json with 100% similarity]
tests/src/Regressions/coreclr/0939/project.lock.json [moved from tests/src/regressions/coreclr/0149/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0939/test0939.cs [moved from tests/src/regressions/coreclr/0939/test0939.cs with 100% similarity]
tests/src/Regressions/coreclr/0939/test0939.csproj [moved from tests/src/regressions/coreclr/0939/test0939.csproj with 100% similarity]
tests/src/Regressions/coreclr/0968/Test968.csproj [moved from tests/src/regressions/coreclr/0968/Test968.csproj with 100% similarity]
tests/src/Regressions/coreclr/0968/app.config [moved from tests/src/regressions/coreclr/0138/app.config with 100% similarity]
tests/src/Regressions/coreclr/0968/project.json [moved from tests/src/regressions/coreclr/0138/project.json with 100% similarity]
tests/src/Regressions/coreclr/0968/project.lock.json [moved from tests/src/regressions/coreclr/0138/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/0968/test968.cs [moved from tests/src/regressions/coreclr/0968/test968.cs with 100% similarity]
tests/src/Regressions/coreclr/1307/app.config [moved from tests/src/regressions/coreclr/0099/app.config with 100% similarity]
tests/src/Regressions/coreclr/1307/project.json [moved from tests/src/regressions/coreclr/0099/project.json with 100% similarity]
tests/src/Regressions/coreclr/1307/project.lock.json [moved from tests/src/regressions/coreclr/0099/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1307/test1307.cs [moved from tests/src/regressions/coreclr/1307/test1307.cs with 100% similarity]
tests/src/Regressions/coreclr/1307/test1307.csproj [moved from tests/src/regressions/coreclr/1307/test1307.csproj with 100% similarity]
tests/src/Regressions/coreclr/1333/app.config [moved from tests/src/regressions/coreclr/0080/app.config with 100% similarity]
tests/src/Regressions/coreclr/1333/project.json [moved from tests/src/regressions/coreclr/0080/project.json with 100% similarity]
tests/src/Regressions/coreclr/1333/project.lock.json [moved from tests/src/regressions/coreclr/0080/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1333/testClass.csproj [moved from tests/src/regressions/coreclr/1333/testClass.csproj with 100% similarity]
tests/src/Regressions/coreclr/1333/testInterface.csproj [moved from tests/src/regressions/coreclr/1333/testInterface.csproj with 100% similarity]
tests/src/Regressions/coreclr/1333/testclass.cs [moved from tests/src/regressions/coreclr/1333/testclass.cs with 100% similarity]
tests/src/Regressions/coreclr/1333/testinterface.cs [moved from tests/src/regressions/coreclr/1333/testinterface.cs with 100% similarity]
tests/src/Regressions/coreclr/1337/Test1337.csproj [moved from tests/src/regressions/coreclr/1337/Test1337.csproj with 100% similarity]
tests/src/Regressions/coreclr/1337/app.config [moved from tests/src/regressions/coreclr/0077/app.config with 100% similarity]
tests/src/Regressions/coreclr/1337/project.json [moved from tests/src/regressions/coreclr/0077/project.json with 100% similarity]
tests/src/Regressions/coreclr/1337/project.lock.json [moved from tests/src/regressions/coreclr/0077/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1337/test1337.cs [moved from tests/src/regressions/coreclr/1337/test1337.cs with 100% similarity]
tests/src/Regressions/coreclr/1380/app.config [moved from tests/src/regressions/coreclr/0075/app.config with 100% similarity]
tests/src/Regressions/coreclr/1380/forwarder1.cs [moved from tests/src/regressions/coreclr/1380/forwarder1.cs with 100% similarity]
tests/src/Regressions/coreclr/1380/forwarder1.csproj [moved from tests/src/regressions/coreclr/1380/forwarder1.csproj with 100% similarity]
tests/src/Regressions/coreclr/1380/project.json [moved from tests/src/regressions/coreclr/0075/project.json with 100% similarity]
tests/src/Regressions/coreclr/1380/project.lock.json [moved from tests/src/regressions/coreclr/0075/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1386/Co1727ctor_OO.csproj [moved from tests/src/regressions/coreclr/1386/Co1727ctor_OO.csproj with 100% similarity]
tests/src/Regressions/coreclr/1386/app.config [moved from tests/src/regressions/coreclr/0069/app.config with 100% similarity]
tests/src/Regressions/coreclr/1386/co1727ctor_oo.cs [moved from tests/src/regressions/coreclr/1386/co1727ctor_oo.cs with 100% similarity]
tests/src/Regressions/coreclr/1386/project.json [moved from tests/src/regressions/coreclr/0069/project.json with 100% similarity]
tests/src/Regressions/coreclr/1386/project.lock.json [moved from tests/src/regressions/coreclr/0069/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1402/Test1402.csproj [moved from tests/src/regressions/coreclr/1402/Test1402.csproj with 100% similarity]
tests/src/Regressions/coreclr/1402/app.config [moved from tests/src/regressions/coreclr/0046/app.config with 100% similarity]
tests/src/Regressions/coreclr/1402/project.json [moved from tests/src/regressions/coreclr/0046/project.json with 100% similarity]
tests/src/Regressions/coreclr/1402/project.lock.json [moved from tests/src/regressions/coreclr/0046/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1402/test1402.cs [moved from tests/src/regressions/coreclr/1402/test1402.cs with 100% similarity]
tests/src/Regressions/coreclr/1514/InterlockExchange.csproj [moved from tests/src/regressions/coreclr/1514/InterlockExchange.csproj with 100% similarity]
tests/src/Regressions/coreclr/1514/app.config [moved from tests/src/regressions/coreclr/0044/app.config with 100% similarity]
tests/src/Regressions/coreclr/1514/interlockexchange.cs [moved from tests/src/regressions/coreclr/1514/interlockexchange.cs with 100% similarity]
tests/src/Regressions/coreclr/1514/project.json [moved from tests/src/regressions/coreclr/0044/project.json with 100% similarity]
tests/src/Regressions/coreclr/1514/project.lock.json [moved from tests/src/regressions/coreclr/0044/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1534/Test1534.csproj [moved from tests/src/regressions/coreclr/1534/Test1534.csproj with 100% similarity]
tests/src/Regressions/coreclr/1534/app.config [moved from tests/src/regressions/coreclr/0041/app.config with 100% similarity]
tests/src/Regressions/coreclr/1534/project.json [moved from tests/src/regressions/coreclr/0041/project.json with 100% similarity]
tests/src/Regressions/coreclr/1534/project.lock.json [moved from tests/src/regressions/coreclr/0041/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1534/test1534.cs [moved from tests/src/regressions/coreclr/1534/test1534.cs with 100% similarity]
tests/src/Regressions/coreclr/1535/Test1535.csproj [moved from tests/src/regressions/coreclr/1535/Test1535.csproj with 100% similarity]
tests/src/Regressions/coreclr/1535/app.config [moved from tests/src/regressions/coreclr/0028/app.config with 100% similarity]
tests/src/Regressions/coreclr/1535/project.json [moved from tests/src/regressions/coreclr/0028/project.json with 100% similarity]
tests/src/Regressions/coreclr/1535/project.lock.json [moved from tests/src/regressions/coreclr/0028/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1535/test1535.cs [moved from tests/src/regressions/coreclr/1535/test1535.cs with 100% similarity]
tests/src/Regressions/coreclr/1549/Test1549.csproj [moved from tests/src/regressions/coreclr/1549/Test1549.csproj with 100% similarity]
tests/src/Regressions/coreclr/1549/app.config [moved from tests/src/regressions/coreclr/0018/app.config with 100% similarity]
tests/src/Regressions/coreclr/1549/project.json [moved from tests/src/regressions/coreclr/0018/project.json with 100% similarity]
tests/src/Regressions/coreclr/1549/project.lock.json [moved from tests/src/regressions/coreclr/0018/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/1549/test1549.cs [moved from tests/src/regressions/coreclr/1549/test1549.cs with 100% similarity]
tests/src/Regressions/coreclr/72162/Test72162.csproj [moved from tests/src/regressions/coreclr/72162/Test72162.csproj with 100% similarity]
tests/src/Regressions/coreclr/72162/app.config [moved from tests/src/regressions/coreclr/0014/app.config with 100% similarity]
tests/src/Regressions/coreclr/72162/project.json [moved from tests/src/regressions/coreclr/0014/project.json with 100% similarity]
tests/src/Regressions/coreclr/72162/project.lock.json [moved from tests/src/regressions/coreclr/0014/project.lock.json with 100% similarity]
tests/src/Regressions/coreclr/72162/test72162.cs [moved from tests/src/regressions/coreclr/72162/test72162.cs with 100% similarity]
tests/testsFailingOutsideWindows.txt

index 2ac0ebb..2803728 100644 (file)
@@ -221,6 +221,10 @@ if (WIN32 OR CLR_CMAKE_PLATFORM_LINUX)
   add_definitions(-DFEATURE_EVENT_TRACE=1)
 endif (WIN32 OR CLR_CMAKE_PLATFORM_LINUX)
 
+if (CLR_CMAKE_PLATFORM_LINUX)
+    add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
+endif (CLR_CMAKE_PLATFORM_LINUX)
+
 if(CLR_CMAKE_PLATFORM_UNIX)
     add_subdirectory(src/ToolBox/SOS/lldbplugin)
     add_subdirectory(src/pal)
index 7527d83..1caffba 100644 (file)
@@ -1,5 +1,5 @@
-Cross Compilation
-=================
+Cross Compilation for ARM
+=========================
 
 Through cross compilation, on Linux it is possible to build CoreCLR for ARM or ARM64.
 
@@ -39,4 +39,49 @@ And with:
 
     ben@ubuntu ~/git/coreclr/ $ ROOTFS_DIR=/home/ben/coreclr-cross/arm ./build.sh arm debug verbose clean cross
 
-As usual the resulting binaries will be found in `bin/Product/BuildOS.BuildArch.BuildType/`
\ No newline at end of file
+As usual the resulting binaries will be found in `bin/Product/BuildOS.BuildArch.BuildType/`
+
+Cross Compilation for Linux, FreeBSD, or OS X
+=============================================
+
+It is also possible to use a Windows machine to build the managed components of CoreCLR or CoreFX for Linux or OS X.  This can be useful when the build on the target platform fails, for example due to Mono issues.
+
+Build mscorlib on Windows
+-------------------------
+The following instructions assume you are on a Windows machine with a clone of the CoreCLR repo that has a correctly configured [environment](https://github.com/dotnet/coreclr/wiki/Windows-instructions#environment).
+
+To build mscorlib for Linux, run the following command:
+
+```
+D:\git\coreclr> build.cmd linuxmscorlib
+```
+
+The arguments `freebsdmscorlib` and `osxmscorlib` can be used instead to build mscorlib for FreeBSD or OS X.
+
+The output is at bin\Product\<BuildOS>.x64.Debug\mscorlib.dll.
+
+The CoreCLR native components need to be built on the target platform.  This can be done with the following command:
+
+```
+ellismg@linux:~/git/coreclr$ ./build.sh skipmscorlib
+```
+
+Build the Framework Managed Components on Windows
+-------------------------------------------------
+The following instructions assume you are on a Windows machine with a clone of the CoreFX repo.
+
+To build the CoreFX managed components for Linux, run the following command:
+
+```
+D:\git\corefx> build.cmd /p:OSGroup=Linux /p:SkipTests=true
+```
+
+`FreeBSD` and `OSX` can be used instead for the `OSGroup`.
+
+The output is at bin\<BuildOS>.AnyCPU.Debug.
+
+The CoreFX native components need to be built on the target platform.  This can be done with the following command:
+
+```
+ellismg@linux:~/git/corefx$ ./build.sh native
+```
index 0d28934..11d890d 100644 (file)
@@ -85,7 +85,7 @@ Build the Framework Native Components
 ======================================
 
 ```sh
-janhenke@freebsd-frankfurt:~/git/corefx$ src/Native/build.sh
+janhenke@freebsd-frankfurt:~/git/corefx$ ./build.sh native
 janhenke@freebsd-frankfurt:~/git/corefx$ cp bin/FreeBSD.x64.Debug/Native/*.so ~/coreclr-demo/runtime
 ```
 
index 837f609..25051f0 100644 (file)
@@ -84,52 +84,33 @@ ellismg@linux:~/git/coreclr$ mkdir -p ~/coreclr-demo/runtime
 ellismg@linux:~/git/coreclr$ cp bin/Product/Linux.x64.Debug/corerun ~/coreclr-demo/runtime
 ellismg@linux:~/git/coreclr$ cp bin/Product/Linux.x64.Debug/libcoreclr.so ~/coreclr-demo/runtime
 ellismg@linux:~/git/coreclr$ cp bin/Product/Linux.x64.Debug/mscorlib.dll ~/coreclr-demo/runtime
+ellismg@linux:~/git/coreclr$ cp bin/Product/Linux.x64.Debug/System.Globalization.Native.so ~/coreclr-demo/runtime
 ```
 
-(Alternative) Build the Microsoft Core Library on Windows
-=========================================================
-
-If the build fails (for example due to Mono issues), alternatively you can build it on Windows.
-You'll need a Windows machine with clone of the CoreCLR project.
-
-You will build mscorlib.dll out of the coreclr repository.
-From a regular command prompt window run:
+Build the Framework
+===================
 
 ```
-D:\git\coreclr> build.cmd linuxmscorlib
+ellismg@linux:~/git/corefx$ ./build.sh
 ```
 
-The output is placed in bin\Product\Linux.x64.Debug\mscorlib.dll. You'll want to copy this to the runtime folder on your Linux machine. (e.g. ~/coreclr-demo/runtime)
-
-Build the Framework Native Components
-======================================
+For the purposes of Hello World, you need to copy a few required files to the demo folder.
 
 ```
-ellismg@linux:~/git/corefx$ src/Native/build.sh
 ellismg@linux:~/git/corefx$ cp bin/Linux.x64.Debug/Native/*.so ~/coreclr-demo/runtime
+ellismg@linux:~/git/corefx$ cp bin/Linux.AnyCPU.Debug/System.Console/System.Console.dll ~/coreclr-demo/runtime
+ellismg@linux:~/git/corefx$ cp bin/Linux.AnyCPU.Debug/System.Diagnostics.Debug/System.Diagnostics.Debug.dll ~/coreclr-demo/runtime
 ```
 
-Build the Framework Managed Components
-======================================
-
-We don't _yet_ have support for building managed code on Linux, so you'll need a Windows machine with clones of CoreFX project.
-
-You will build the rest of the framework that out of the corefx repository.  
-You need to pass some special parameters to build.cmd when building out of the CoreFX repository.
-
-```
-D:\git\corefx> build.cmd /p:OSGroup=Linux /p:SkipTests=true
-```
-
-It's also possible to add `/t:rebuild` to the build.cmd to force it to delete the previously built assemblies.
-
-For the purposes of Hello World, you need to copy over both `bin\Linux.AnyCPU.Debug\System.Console\System.Console.dll` and `bin\Linux.AnyCPU.Debug\System.Diagnostics.Debug\System.Diagnostics.Debug.dll`  into the runtime folder on Linux. (e.g `~/coreclr-demo/runtime`).
-
-After you've done these steps, the runtime directory on Linux should look like this:
+The runtime directory should now look like the following:
 
 ```
 matell@linux:~$ ls ~/coreclr-demo/runtime/
-corerun  libcoreclr.so  mscorlib.dll  System.Console.dll  System.Diagnostics.Debug.dll System.Native.so
+corerun                       System.Globalization.Native.so
+libcoreclr.so                 System.Native.so
+mscorlib.dll                  System.Net.Http.Native.so
+System.Console.dll            System.Security.Cryptography.Native.so
+System.Diagnostics.Debug.dll
 ```
 
 Download Dependencies
index 00f3d94..86d9ab7 100644 (file)
@@ -69,8 +69,8 @@ NuGet is required to acquire any .NET assembly dependency that is not built by t
 
     dotnet-mbp:coreclr-demo richlander$ curl -L -O https://nuget.org/nuget.exe
 
-Build CoreCLR
-=============
+Build the Runtime and Microsoft Core Library
+============================================
 
 To Build CoreCLR, run build.sh from the root of the coreclr repo.
 
@@ -92,64 +92,34 @@ You will see several files. The interesting ones are:
 
 - `corerun`: The command line host. This program loads and starts the CoreCLR runtime and passes the managed program you want to run to it.
 - `libcoreclr.dylib`: The CoreCLR runtime itself.
+- `mscorlib.dll`: Microsoft Core Library (requires Mono).
 
 Copy the runtime and corerun into the demo directory.
 
     dotnet-mbp:coreclr richlander$ cp bin/Product/OSX.x64.Debug/corerun ~/coreclr-demo/runtime/
     dotnet-mbp:coreclr richlander$ cp bin/Product/OSX.x64.Debug/libcoreclr.dylib ~/coreclr-demo/runtime/
+       dotnet-mbp:coreclr richlander$ cp bin/Product/OSX.x64.Debug/mscorlib.dll ~/coreclr-demo/runtime/
+       dotnet-mbp:coreclr richlander$ cp bin/Product/OSX.x64.Debug/System.Globalization.Native.dylib ~/coreclr-demo/runtime/
 
-Build the Framework Native Components
-=====================================
-
-    dotnet-mbp:corefx richlander$ src/Native/build.sh
-    dotnet-mbp:corefx richlander$ cp bin/OSX.x64.Debug/Native/*.dylib ~/coreclr-demo/runtime
-
-Build the Framework Managed Components
-======================================
-
-While CoreFX can be built on OS X, building mscorlib still requires Windows.
-
-Build mscorlb
--------------
-
-The following instructions assume you are on a Windows machine with a clone of the CoreCLR repo and that has a correctly configured [environment](https://github.com/dotnet/coreclr/wiki/Windows-instructions#environment).
-
-You will need to copy binaries built on Windows to your Mac. Use whatever copying method works for you, such as a thumbdrive, a sync program or a cloud drive. To make this easy, copy files to a demo directory on Windows, so that you can copy all of the files to your Mac together.
-
-    C:\git\coreclr>mkdir \coreclr-demo
-
-Build mscorlib.dll out of the coreclr repository:
-
-    C:\git\coreclr>build.cmd osxmscorlib
-
-The output is placed in `bin\obj\OSX.x64.Debug`. Copy to the demo folder.
-
-    C:\git\coreclr>copy bin\obj\OSX.x64.Debug\mscorlib.dll \coreclr-demo
-
-Copy mscorlib
--------------
-
-Copy the newly built mscorlib.dll from `C:\coreclr-demo` to your Mac, in the `~/coreclr-demo/runtime/` directory.
-
-Build CoreFX
-------------
-
-Build the rest of the Framework out of the corefx directory on your Mac.
+Build the Framework
+===================
 
     dotnet-mbp:corefx richlander$ ./build.sh
 
+For the purposes of this demo, you need to copy a few required files to the demo folder.
 
-For the purposes of this demo, you need to copy a few required assemblies to the demo folder.
-
+       dotnet-mbp:corefx richlander$ cp bin/OSX.x64.Debug/Native/*.dylib ~/coreclr-demo/runtime
     dotnet-mbp:corefx richlander$ cp bin/OSX.AnyCPU.Debug/System.Console/System.Console.dll ~/coreclr-demo/runtime
     dotnet-mbp:corefx richlander$ cp bin/OSX.AnyCPU.Debug/System.Diagnostics.Debug/System.Diagnostics.Debug.dll ~/coreclr-demo/runtime
 
 The runtime directory should now look like the following:
 
     dotnet-mbp:~ richlander$ ls ~/coreclr-demo/runtime/
-    System.Console.dll              libcoreclr.dylib
-    System.Diagnostics.Debug.dll    mscorlib.dll
-    corerun
+    System.Console.dll                 System.Security.Cryptography.Native.dylib
+    System.Diagnostics.Debug.dll       corerun
+       System.Globalization.Native.dylib  libcoreclr.dylib
+       System.Native.dylib                mscorlib.dll
+       System.Net.Http.Native.dylib
 
 Download NuGet Packages
 =======================
index d891331..dc630e5 100644 (file)
@@ -32,12 +32,12 @@ Run tests:
 
 > ```bash
 > ~/coreclr$ tests/runtest.sh
->     --testRootDir="~/test/Windows_NT.x64.Debug"
->     --testNativeBinDir="~/coreclr/bin/obj/Linux.x64.Debug/tests"
->     --coreClrBinDir="~/coreclr/bin/Product/Linux.x64.Debug"
->     --mscorlibDir="/media/coreclr/bin/Product/Linux.x64.Debug"
->     --coreFxBinDir="~/corefx/bin/Linux.AnyCPU.Debug"
->     --coreFxNativeBinDir="~/corefx/bin/Linux.x64.Debug"
+>     --testRootDir=~/test/Windows_NT.x64.Debug
+>     --testNativeBinDir=~/coreclr/bin/obj/Linux.x64.Debug/tests
+>     --coreClrBinDir=~/coreclr/bin/Product/Linux.x64.Debug
+>     --mscorlibDir=/media/coreclr/bin/Product/Linux.x64.Debug
+>     --coreFxBinDir=~/corefx/bin/Linux.AnyCPU.Debug
+>     --coreFxNativeBinDir=~/corefx/bin/Linux.x64.Debug
 > ```
 
 Test results will go into:
diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES
new file mode 100644 (file)
index 0000000..dbde725
--- /dev/null
@@ -0,0 +1,38 @@
+.NET Core uses third-party libraries or other resources that may be
+distributed under licenses different than the .NET Core software.
+
+In the event that we accidentally failed to list a required notice, please
+bring it to our attention. Post an issue or email us:
+
+           dotnet@microsoft.com
+
+The attached notices are provided for information only.
+
+License notice for RFC 3492
+---------------------------
+
+Copyright (C) The Internet Society (2003).  All Rights Reserved.
+
+This document and translations of it may be copied and furnished to
+others, and derivative works that comment on or otherwise explain it
+or assist in its implementation may be prepared, copied, published
+and distributed, in whole or in part, without restriction of any
+kind, provided that the above copyright notice and this paragraph are
+included on all such copies and derivative works.  However, this
+document itself may not be modified in any way, such as by removing
+the copyright notice or references to the Internet Society or other
+Internet organizations, except as needed for the purpose of
+developing Internet standards in which case the procedures for
+copyrights defined in the Internet Standards process must be
+followed, or as required to translate it into languages other than
+English.
+
+The limited permissions granted above are perpetual and will not be
+revoked by the Internet Society or its successors or assigns.
+
+This document and the information contained herein is provided on an
+"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
index 819fd6f..2373b7b 100644 (file)
     <FeatureSvrGc Condition="'$(TargetArch)' != 'arm'">true</FeatureSvrGc>
   </PropertyGroup>
 
+  <PropertyGroup Condition="'$(TargetsLinux)' == 'true'">
+    <FeatureXplatEventSource>true</FeatureXplatEventSource>
+  </PropertyGroup>
+
   <PropertyGroup Condition="'$(TargetsUnix)' == 'true'">
     <FeaturePal>true</FeaturePal>
 
index 87ec8ac..879de92 100644 (file)
@@ -37,6 +37,7 @@
         <CDefines Condition="'$(FeatureDbgipcTransportVM)' == 'true'">$(CDefines);FEATURE_DBGIPC_TRANSPORT_VM</CDefines>
         <CDefines Condition="'$(FeatureDbgPublish)' == 'true'">$(CDefines);FEATURE_DBG_PUBLISH</CDefines>
         <CDefines Condition="'$(FeatureEventTrace)' == 'true'">$(CDefines);FEATURE_EVENT_TRACE</CDefines>
+        <CDefines Condition="'$(FeatureXplatEventSource)' == 'true'">$(CDefines);FEATURE_EVENTSOURCE_XPLAT</CDefines>
         <CDefines Condition="'$(FeatureExceptionDispatchInfo)' == 'true'">$(CDefines);FEATURE_EXCEPTIONDISPATCHINFO</CDefines>
         <CDefines Condition="'$(FeatureExceptionNotifications)' == 'true'">$(CDefines);FEATURE_EXCEPTION_NOTIFICATIONS</CDefines>
         <CDefines Condition="'$(FeatureFrameworkInternal)' == 'true'">$(CDefines);FEATURE_FRAMEWORK_INTERNAL</CDefines>
         <DefineConstants Condition="'$(FeatureNongenericCollections)' == 'true'">$(DefineConstants);FEATURE_NONGENERIC_COLLECTIONS</DefineConstants>
         <DefineConstants Condition="'$(FeatureNormIdnaOnly)' == 'true'">$(DefineConstants);FEATURE_NORM_IDNA_ONLY</DefineConstants>
         <DefineConstants Condition="'$(FeaturePal)' == 'true'">$(DefineConstants);FEATURE_PAL</DefineConstants>
+        <DefineConstants Condition="'$(FeatureXplatEventSource)' == 'true'">$(DefineConstants);FEATURE_EVENTSOURCE_XPLAT</DefineConstants>
         <DefineConstants Condition="'$(FeaturePerfmon)' == 'true'">$(DefineConstants);FEATURE_PERFMON</DefineConstants>
         <DefineConstants Condition="'$(FeaturePls)' == 'true'">$(DefineConstants);FEATURE_PLS</DefineConstants>
         <DefineConstants Condition="'$(FeatureRandomizedStringHashing)' == 'true'">$(DefineConstants);FEATURE_RANDOMIZED_STRING_HASHING</DefineConstants>
index 87e47bc..095565c 100644 (file)
@@ -24,9 +24,18 @@ def osGroupMap = ['Ubuntu':'Linux',
 // Innerloop build OS's
 def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'FreeBSD', 'CentOS7.1', 'OpenSUSE13.2']
 
-def static getBuildJobName(def configuration, def os) {
-    // Massage names a bit
-    return configuration.toLowerCase() + '_' + os.toLowerCase()
+def static getBuildJobName(def configuration, def architecture, def os) {
+    // If the architecture is x64, do not add that info into the build name.
+    // Need to change around some systems and other builds to pick up the right builds
+    // to do that.
+    
+    if (architecture == 'x64') {
+        return configuration.toLowerCase() + '_' + os.toLowerCase()
+    }
+    else {
+        // Massage names a bit
+        return architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
+    }
 }
 
 // **************************
@@ -36,91 +45,128 @@ def static getBuildJobName(def configuration, def os) {
 // **************************
 
 // Loop over the options and build up the innerloop build matrix
+// Default architecture is x64.  Right now that isn't built into the
+// build name.  We'll need to change that eventually, but for now leave as is.
+// x86 builds have the new build name
 
-['Debug', 'Release'].each { configuration ->
-    osList.each { os ->
-        // Calculate names
-        def lowerConfiguration = configuration.toLowerCase()
-        
-        // Calculate job name
-        def jobName = getBuildJobName(configuration, os)
-        def buildCommand = '';
-        
-        def osGroup = osGroupMap[os]
-        
-        // Calculate the build command
-        if (os == 'Windows_NT') {
-            // On Windows we build the mscorlibs too.
-            buildCommand = "build.cmd ${lowerConfiguration} && tests\\runtest.cmd ${lowerConfiguration} && build.cmd ${lowerConfiguration} linuxmscorlib && build.cmd ${lowerConfiguration} freebsdmscorlib && build.cmd ${lowerConfiguration} osxmscorlib"
-        }
-        else {
-            // On other OS's we skipmscorlib but run the pal tests
-            buildCommand = "./build.sh skipmscorlib verbose ${lowerConfiguration} && src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.x64.${configuration} \${WORKSPACE}/bin/paltestout"
-        }
-        
-        // Create the new job
-        def newCommitJob = job(Utilities.getFullJobName(project, jobName, false)) {
-            // Set the label.
-            label(machineLabelMap[os])
-            steps {
-                if (os == 'Windows_NT') {
-                    // Batch
-                    batchFile(buildCommand)
+['x64', 'x86'].each { architecture ->
+    ['Debug', 'Release'].each { configuration ->
+        osList.each { os ->
+            // Calculate names
+            def lowerConfiguration = configuration.toLowerCase()
+            
+            // Calculate job name
+            def jobName = getBuildJobName(configuration, architecture, os)
+            def buildCommands = [];
+            
+            def osGroup = osGroupMap[os]
+            
+            // Calculate the build commands
+            if (os == 'Windows_NT') {
+                // On Windows we build the mscorlibs too.
+                buildCommands += "build.cmd ${lowerConfiguration} ${architecture}"
+                
+                // If x64, we run tests
+                if (architecture == 'x64') {
+                    buildCommands += "tests\\runtest.cmd ${lowerConfiguration} ${architecture}"
                 }
-                else {
-                    // Shell
-                    shell(buildCommand)
+                
+                // Build the mscorlib for the other OS's
+                buildCommands += "build.cmd ${lowerConfiguration} ${architecture} linuxmscorlib"
+                buildCommands += "build.cmd ${lowerConfiguration} ${architecture} freebsdmscorlib"
+                buildCommands += "build.cmd ${lowerConfiguration} ${architecture} osxmscorlib"
+            }
+            else {
+                // On other OS's we skipmscorlib but run the pal tests
+                buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture}"
+                buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
+            }
+            
+            // Create the new job
+            def newCommitJob = job(Utilities.getFullJobName(project, jobName, false)) {
+                // Set the label.
+                label(machineLabelMap[os])
+                steps {
+                    if (os == 'Windows_NT') {
+                        buildCommands.each { buildCommand ->
+                            batchFile(buildCommand)
+                        }
+                    }
+                    else {
+                        buildCommands.each { buildCommand ->
+                            shell(buildCommand)
+                        }
+                    }
                 }
             }
-        }
 
-        // Add commit job options
-        Utilities.addScm(newCommitJob, project)
-        Utilities.addStandardNonPRParameters(newCommitJob)
-        Utilities.addGithubPushTrigger(newCommitJob)
-        
-        // Create the new PR job
-        
-        def newPRJob = job(Utilities.getFullJobName(project, jobName, true)) {
-            // Set the label.
-            label(machineLabelMap[os])
-            steps {
-                if (os == 'Windows_NT') {
-                    // Batch
-                    batchFile(buildCommand)
-                }
-                else {
-                    // Shell
-                    shell(buildCommand)
+            // Add commit job options
+            Utilities.addScm(newCommitJob, project)
+            Utilities.addStandardNonPRParameters(newCommitJob)
+            
+            // Add a push trigger.  Do not enable the push trigger for non-windows x86,
+            // which do not work at the moment.
+            if (architecture == 'x64' || osGroup == 'Windows_NT') {
+                Utilities.addGithubPushTrigger(newCommitJob)
+            }
+            
+            // Create the new PR job
+            
+            def newPRJob = job(Utilities.getFullJobName(project, jobName, true)) {
+                // Set the label.
+                label(machineLabelMap[os])
+                steps {
+                    if (os == 'Windows_NT') {
+                        buildCommands.each { buildCommand ->
+                            batchFile(buildCommand)
+                        }
+                    }
+                    else {
+                        buildCommands.each { buildCommand ->
+                            shell(buildCommand)
+                        }
+                    }
                 }
             }
-        }
-        
-        // Add a PR trigger.  For some OS's, create an explicit trigger
-        // PR's are run for everything except SuSE
-        if (os != 'OpenSUSE13.2') {
-            Utilities.addGithubPRTrigger(newPRJob, "${os} ${configuration} Build")
-        }
-        Utilities.addPRTestSCM(newPRJob, project)
-        Utilities.addStandardPRParameters(newPRJob, project)
-        
-        // Add common options:
-        
-        [newPRJob, newCommitJob].each { newJob ->
-            Utilities.addStandardOptions(newJob)
             
-            if (osGroup == 'Windows_NT') {
-                Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml')
-                Utilities.addArchival(newJob, "bin/Product/**,bin/tests/**", "bin/tests/obj/**")
-            } else {
-                // Add .NET results for the 
-                Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
-                Utilities.addArchival(newJob, "bin/Product/**")
-                Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**")
+            // Add a PR trigger.  For some OS's, create an explicit trigger
+            // PR's are run for everything except SuSE by default.  Add on-demand triggers 
+            // for everything else.  This probably deserves a bit of cleanup eventually once we
+            // have an easy way to do regex trigger phrases, to put in some more structured test phrases.
+            def triggerPhraseString = ''
+            if (os == 'OpenSUSE13.2' && architecture == 'x64') {
+                triggerPhraseString = '@dotnet-bot test suse'
+            } else if (architecture == 'x86' && osGroup == 'Windows_NT') {
+                triggerPhraseString = '@dotnet-bot test x86'
+            } else if (architecture == 'x86' && osGroup == 'Linux') {
+                triggerPhraseString = '@dotnet-bot test x86 linux'
+            } else if (architecture == 'x86' && osGroup == 'OSX') {
+                triggerPhraseString = '@dotnet-bot test x86 osx'
+            } else if (architecture == 'x86' && osGroup == 'FreeBSD') {
+                triggerPhraseString = '@dotnet-bot test x86 freebsd'
             }
-        }
-    }
-}
+            Utilities.addGithubPRTrigger(newPRJob, "${os} ${architecture} ${configuration} Build", triggerPhraseString)
+            Utilities.addPRTestSCM(newPRJob, project)
+            Utilities.addStandardPRParameters(newPRJob, project)
+            
+            // Add common options:
+            
+            [newPRJob, newCommitJob].each { newJob ->
+                Utilities.addStandardOptions(newJob)
+                
+                if (osGroup == 'Windows_NT') {
+                    Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml')
+                    Utilities.addArchival(newJob, "bin/Product/**,bin/tests/**", "bin/tests/obj/**")
+                } else {
+                    // Add .NET results for the 
+                    Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
+                    Utilities.addArchival(newJob, "bin/Product/**")
+                    Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**")
+                }
+            }
+        } // os
+    } // configuration
+} // architecture
 
 // Ubuntu cross compiled arm and arm64 builds
 // Scheduled for nightly and on-demand PR for now
@@ -188,101 +234,103 @@ def static getBuildJobName(def configuration, def os) {
 }
 
 // Create the Linux coreclr test leg for debug and release.
-// Put the OS's supported for coreclr cross testing here
-['Ubuntu'].each { os ->
-    [true, false].each { isPR ->
-        ['Debug', 'Release'].each { configuration ->
-            
-            def lowerConfiguration = configuration.toLowerCase()
-            def osGroup = osGroupMap[os]
-            def jobName = getBuildJobName(configuration, os) + "_tst"
-            def inputCoreCLRBuildName = Utilities.getFolderName(project) + '/' + 
-                Utilities.getFullJobName(project, getBuildJobName(configuration, os), isPR)
-            def inputWindowTestsBuildName = Utilities.getFolderName(project) + '/' + 
-                Utilities.getFullJobName(project, getBuildJobName(configuration, 'windows_nt'), isPR)
-            
-            def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
-                // Set the label.
-                label(machineLabelMap[os])
-                
-                // Add parameters for the inputs
+// Architectures
+['x64', 'x86'].each { architecture ->
+    // Put the OS's supported for coreclr cross testing here
+    ['Ubuntu'].each { os ->
+        [true, false].each { isPR ->
+            ['Debug', 'Release'].each { configuration ->
                 
-                parameters {
-                    stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
-                    stringParam('CORECLR_LINUX_BUILD', '', 'Build number to copy CoreCLR linux binaries from')
-                }
+                def lowerConfiguration = configuration.toLowerCase()
+                def osGroup = osGroupMap[os]
+                def jobName = getBuildJobName(configuration, architecture, os) + "_tst"
+                def inputCoreCLRBuildName = Utilities.getFolderName(project) + '/' + 
+                    Utilities.getFullJobName(project, getBuildJobName(configuration, architecture, os), isPR)
+                def inputWindowTestsBuildName = Utilities.getFolderName(project) + '/' + 
+                    Utilities.getFullJobName(project, getBuildJobName(configuration, architecture, 'windows_nt'), isPR)
                 
-                steps {
-                    // Set up the copies
+                def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
+                    // Set the label.
+                    label(machineLabelMap[os])
                     
-                    // Coreclr build we are trying to test
+                    // Add parameters for the inputs
                     
-                    copyArtifacts(inputCoreCLRBuildName) {
-                        excludePatterns('**/testResults.xml', '**/*.ni.dll')
-                        buildSelector {
-                            buildNumber('${CORECLR_LINUX_BUILD}')
-                        }
+                    parameters {
+                        stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
+                        stringParam('CORECLR_LINUX_BUILD', '', 'Build number to copy CoreCLR linux binaries from')
                     }
                     
-                    // Coreclr build containing the tests and mscorlib
-                    
-                    copyArtifacts(inputWindowTestsBuildName) {
-                        excludePatterns('**/testResults.xml', '**/*.ni.dll')
-                        buildSelector {
-                            buildNumber('${CORECLR_WINDOWS_BUILD}')
+                    steps {
+                        // Set up the copies
+                        
+                        // Coreclr build we are trying to test
+                        
+                        copyArtifacts(inputCoreCLRBuildName) {
+                            excludePatterns('**/testResults.xml', '**/*.ni.dll')
+                            buildSelector {
+                                buildNumber('${CORECLR_LINUX_BUILD}')
+                            }
                         }
-                    }
-                    
-                    // Corefx native components
-                    copyArtifacts("dotnet_corefx_linux_nativecomp_debug") {
-                        includePatterns('bin/**')
-                        buildSelector {
-                            latestSuccessful(true)
+                        
+                        // Coreclr build containing the tests and mscorlib
+                        
+                        copyArtifacts(inputWindowTestsBuildName) {
+                            excludePatterns('**/testResults.xml', '**/*.ni.dll')
+                            buildSelector {
+                                buildNumber('${CORECLR_WINDOWS_BUILD}')
+                            }
                         }
-                    }
-                    
-                    // Corefx linux binaries
-                    copyArtifacts("dotnet_corefx_linux_nativecomp_debug") {
-                        includePatterns('bin/Linux*/**')
-                        buildSelector {
-                            latestSuccessful(true)
+                        
+                        // Corefx native components
+                        copyArtifacts("dotnet_corefx_linux_nativecomp_debug") {
+                            includePatterns('bin/**')
+                            buildSelector {
+                                latestSuccessful(true)
+                            }
+                        }
+                        
+                        // Corefx linux binaries
+                        copyArtifacts("dotnet_corefx_linux_debug") {
+                            includePatterns('bin/Linux*/**')
+                            buildSelector {
+                                latestSuccessful(true)
+                            }
                         }
+                        
+                        // Execute the shell command
+                        
+                        shell("""
+    ./tests/runtest.sh \\
+        --testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
+        --testNativeBinDir=\"\${WORKSPACE}/bin/obj/Linux.${architecture}.${configuration}/tests\" \\
+        --coreClrBinDir=\"\${WORKSPACE}/bin/Product/Linux.${architecture}.${configuration}\" \\
+        --mscorlibDir=\"\${WORKSPACE}/bin/Product/Linux.${architecture}.${configuration}\" \\
+        --coreFxBinDir=\"\${WORKSPACE}/bin/Linux.AnyCPU.Debug\" \\
+        --coreFxNativeBinDir=\"\${WORKSPACE}/bin/Linux.${architecture}.Debug\"""")
                     }
-                    
-                    // Execute the shell command
-                    
-                    shell("""
-./tests/runtest.sh \\
-    --testRootDir='\${WORKSPACE}/bin/tests/Windows_NT.x64.Debug' \\
-    --testNativeBinDir='\${WORKSPACE}/bin/obj/Linux.x64.Debug/tests' \\
-    --coreClrBinDir='\${WORKSPACE}/bin/Product/Linux.x64.Debug' \\
-    --mscorlibDir='\${WORKSPACE}/bin/Product/Linux.x64.Debug' \\
-    --coreFxBinDir='\${WORKSPACE}/bin/Linux.AnyCPU.Debug' \\
-    --coreFxNativeBinDir='\${WORKSPACE}/bin/Linux.x64.Debug'""")
                 }
-            }
-            
-            if (!isPR) {
-                // Add rolling job options
-                Utilities.addScm(newJob, project)
-                Utilities.addStandardNonPRParameters(newJob)
-            }
-            else {
-                // Add PR job options
-                Utilities.addPRTestSCM(newJob, project)
-                Utilities.addStandardPRParameters(newJob, project)
-            }
-            Utilities.addStandardOptions(newJob)
-            Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
-            
-            // Create a build flow to join together the build and tests required to run this
-            // test.
-            // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
-            // Linux CoreCLR test
-            def flowJobName = getBuildJobName(configuration, os) + "_flow"
-            def fullTestJobName = Utilities.getFolderName(project) + '/' + newJob.name
-            def newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR)) {
-                buildFlow("""
+                
+                if (!isPR) {
+                    // Add rolling job options
+                    Utilities.addScm(newJob, project)
+                    Utilities.addStandardNonPRParameters(newJob)
+                }
+                else {
+                    // Add PR job options
+                    Utilities.addPRTestSCM(newJob, project)
+                    Utilities.addStandardPRParameters(newJob, project)
+                }
+                Utilities.addStandardOptions(newJob)
+                Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
+                
+                // Create a build flow to join together the build and tests required to run this
+                // test.
+                // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
+                // Linux CoreCLR test
+                def flowJobName = getBuildJobName(configuration, architecture, os) + "_flow"
+                def fullTestJobName = Utilities.getFolderName(project) + '/' + newJob.name
+                def newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR)) {
+                    buildFlow("""
 // Grab the checked out git commit hash so that it can be passed to the child
 // builds.
 gitCommit = build.environment.get('GIT_COMMIT')
@@ -291,31 +339,35 @@ parallel (
     { linuxBuildJob = build(params + [GitBranchOrCommit: gitCommit], '${inputCoreCLRBuildName}') },
     { windowsBuildJob = build(params + [GitBranchOrCommit: gitCommit], '${inputWindowTestsBuildName}') }
 )
-
+    
 // And then build the test build
 build(params + [CORECLR_LINUX_BUILD: linuxBuildJob.build.number, 
                 CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number, GitBranchOrCommit: gitCommit], '${fullTestJobName}')    
 """)
 
-                // Needs a workspace
-                configure {
-                    def buildNeedsWorkspace = it / 'buildNeedsWorkspace'
-                    buildNeedsWorkspace.setValue('true')
+                    // Needs a workspace
+                    configure {
+                        def buildNeedsWorkspace = it / 'buildNeedsWorkspace'
+                        buildNeedsWorkspace.setValue('true')
+                    }
                 }
-            }
             
-            if (isPR) {
-                Utilities.addPRTestSCM(newFlowJob, project)
-                Utilities.addStandardPRParameters(newFlowJob, project)
-                Utilities.addGithubPRTrigger(newFlowJob, "Linux ${configuration} Build and Test", '@dotnet-bot test linux')
-            }
-            else {
-                Utilities.addScm(newFlowJob, project)
-                Utilities.addStandardNonPRParameters(newFlowJob)
+                if (isPR) {
+                    Utilities.addPRTestSCM(newFlowJob, project)
+                    Utilities.addStandardPRParameters(newFlowJob, project)
+                    if (architecture == 'x64') {
+                        Utilities.addGithubPRTrigger(newFlowJob, "Linux ${architecture} ${configuration} Build and Test", '@dotnet-bot test linux')
+                    } else {
+                       Utilities.addGithubPRTrigger(newFlowJob, "Linux ${architecture} ${configuration} Build and Test", '@dotnet-bot test linux x86')
+                    }
+                }
+                else {
+                    Utilities.addScm(newFlowJob, project)
+                    Utilities.addStandardNonPRParameters(newFlowJob)
+                }
+                
+                Utilities.addStandardOptions(newFlowJob)
             }
-            
-            Utilities.addStandardOptions(newFlowJob)
         }
     }
-}
-
+}
\ No newline at end of file
index 7cf32b9..ca82a1b 100644 (file)
@@ -126,6 +126,79 @@ extern "C" int32_t LastIndexOf(
 }
 
 /*
+Static Function:
+AreEqualOrdinalIgnoreCase
+*/
+static bool AreEqualOrdinalIgnoreCase(UChar32 one, UChar32 two)
+{
+    // Return whether the two characters are identical or would be identical if they were upper-cased.
+
+    if (one == two)
+    {
+        return true;
+    }
+
+    if (one == 0x0131 || two == 0x0131)
+    {
+        // On Windows with InvariantCulture, the LATIN SMALL LETTER DOTLESS I (U+0131)
+        // capitalizes to itself, whereas with ICU it capitalizes to LATIN CAPITAL LETTER I (U+0049).
+        // We special case it to match the Windows invariant behavior.
+        return false;
+    }
+
+    return u_toupper(one) == u_toupper(two);
+}
+
+/*
+Function:
+IndexOfOrdinalIgnoreCase
+*/
+extern "C" int32_t
+IndexOfOrdinalIgnoreCase(
+    const UChar* lpTarget, int32_t cwTargetLength, 
+    const UChar* lpSource, int32_t cwSourceLength, 
+    int32_t findLast)
+{
+    int32_t result = -1;
+
+    int32_t endIndex = cwSourceLength - cwTargetLength;
+    assert(endIndex >= 0);
+
+    int32_t i = 0;
+    while (i <= endIndex)
+    {
+        int32_t srcIdx = i, trgIdx = 0;
+        const UChar *src = lpSource, *trg = lpTarget;
+        UChar32 srcCodepoint, trgCodepoint;
+
+        bool match = true;
+        while (trgIdx < cwTargetLength)
+        {
+            U16_NEXT(src, srcIdx, cwSourceLength, srcCodepoint);
+            U16_NEXT(trg, trgIdx, cwTargetLength, trgCodepoint);
+            if (!AreEqualOrdinalIgnoreCase(srcCodepoint, trgCodepoint))
+            {
+                match = false; 
+                break;
+            }
+        }
+
+        if (match) 
+        {
+            result = i;
+            if (!findLast)
+            {
+                break;
+            }
+        }
+
+        U16_FWD_1(lpSource, i, cwSourceLength);
+    }
+
+    return result;
+}
+
+/*
  Return value is a "Win32 BOOL" (1 = true, 0 = false)
  */
 extern "C" int32_t StartsWith(
index 664fe6f..83335d1 100644 (file)
@@ -2403,7 +2403,11 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent)
     case DB_IPCE_GET_GCHANDLE_INFO:
         cbAdditionalSize = sizeof(pEvent->GetGCHandleInfo);
         break;
-
+    
+    case DB_IPCE_CUSTOM_NOTIFICATION:
+        cbAdditionalSize = sizeof(pEvent->CustomNotification);
+        break;
+            
     default:
         printf("Unknown debugger event type: 0x%x\n", (pEvent->type & DB_IPCE_TYPE_MASK));
         _ASSERTE(!"Unknown debugger event type");
index 1b517fc..8f33e40 100644 (file)
@@ -1010,9 +1010,9 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ReadyToRun, W("ReadyToRun"), 1, "Enable/disabl
 RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ReadyToRun, W("ReadyToRun"), 0, "Enable/disable use of ReadyToRun native code") // Off by default for desktop
 #endif
 
-#if defined(FEATURE_PAL) && defined(FEATURE_EVENT_TRACE)
+#if defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)
 RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableEventLog, W("EnableEventLog"), 0, "Enable/disable use of EnableEventLogging mechanism ") // Off by default 
-#endif //defined(FEATURE_PAL) && defined(FEATURE_EVENT_TRACE)
+#endif //defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)
 
 //
 // Interop
index 19d1994..13810b0 100644 (file)
@@ -227,6 +227,21 @@ extern BOOL g_fEEIJWStartup;
 
 #define GetClrInstanceId()  (static_cast<UINT16>(g_nClrInstanceId))
 
+#if defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)
+
+#include "clrconfig.h"
+ class XplatEventLogger
+{
+    public:
+        inline static BOOL  IsEventLoggingEnabled()
+        {
+            static ConfigDWORD configEventLogging;
+            return configEventLogging.val(CLRConfig::EXTERNAL_EnableEventLog);
+        }
+};
+
+#endif //defined(FEATURE_EVENT_TRACE)
+
 #if defined(FEATURE_EVENT_TRACE)
 
 #ifndef  FEATURE_PAL
@@ -283,16 +298,6 @@ extern "C" {
 
 #elif defined(__LINUX__)
 
-#include "clrconfig.h"
- class XplatEventLogger
-{
-    public:
-        inline static BOOL  IsEventLoggingEnabled()
-        {
-            static ConfigDWORD configEventLogging;
-            return configEventLogging.val(CLRConfig::EXTERNAL_EnableEventLog);
-        }
-};
 #include "clrallevents.h"
 #else
 #error "A tracing System has not been enabled for this Platform"
index 56b7bbf..847c9b6 100644 (file)
@@ -7,8 +7,8 @@
 // 
 
 // 
-// Defines a random number generator, ripped off from the System.Random code in the BCL.  If you notice any problems,
-// please compare to the implementation in ndp\clr\src\bcl\system\random.cs.
+// Defines a random number generator, initially from the System.Random code in the BCL.  If you notice any problems,
+// please compare to the implementation in src\mscorlib\src\system\random.cs.
 //
 // Main advantages over rand() are:
 //
@@ -93,7 +93,6 @@ public:
         int mj, mk;
 
         //Initialize our Seed array.
-        //This algorithm comes from Numerical Recipes in C (2nd Ed.)
         mj = MSEED - abs(Seed);
         SeedArray[55]=mj;
         mk=1;
index e832441..981f900 100644 (file)
@@ -3208,8 +3208,16 @@ inline DWORD HashThreeToOne(DWORD a, DWORD b, DWORD c)
 {
     LIMITED_METHOD_DAC_CONTRACT;
 
-    // Current implementation taken from lookup3.c, by Bob Jenkins, May 2006
-    
+    /*
+    lookup3.c, by Bob Jenkins, May 2006, Public Domain.
+
+    These are functions for producing 32-bit hashes for hash table lookup.
+    hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() 
+    are externally useful functions.  Routines to test the hash are included 
+    if SELF_TEST is defined.  You can use this free for any purpose.  It's in
+    the public domain.  It has no warranty.
+    */
+
     #define rot32(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
     c ^= b; c -= rot32(b,14);
     a ^= c; a -= rot32(c,11);
diff --git a/src/mscorlib/LICENSE b/src/mscorlib/LICENSE
deleted file mode 100644 (file)
index 5ac9e0e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Microsoft
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
index b600fa5..c236c03 100644 (file)
@@ -19,6 +19,9 @@ internal static partial class Interop
         internal unsafe static extern int LastIndexOf(byte[] localeName, string target, char* pSource, int cwSourceLength, CompareOptions options);
 
         [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode)]
+        internal unsafe static extern int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast);
+
+        [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode)]
         [return: MarshalAs(UnmanagedType.Bool)]
         internal unsafe static extern bool StartsWith(byte[] localeName, string target, string source, int cwSourceLength, CompareOptions options);
 
index ba658d0..9a2a35c 100644 (file)
@@ -20,7 +20,7 @@ namespace System.Globalization
             m_sortNameAsUtf8 = System.Text.Encoding.UTF8.GetBytes(m_sortName);
         }
 
-        internal static int IndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
+        internal static unsafe int IndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
         {
             Contract.Assert(source != null);
             Contract.Assert(value != null);
@@ -30,33 +30,41 @@ namespace System.Globalization
                 return startIndex;
             }
 
-            // TODO (dotnet/corefx#3468): Move this into the shim so we don't have to do the ToUpper or call substring.
+            if (count < value.Length)
+            {
+                return -1;
+            }
 
             if (ignoreCase)
             {
-                source = source.ToUpper(CultureInfo.InvariantCulture);
-                value = value.ToUpper(CultureInfo.InvariantCulture);
+                fixed (char* pSource = source)
+                {
+                    int index = Interop.GlobalizationInterop.IndexOfOrdinalIgnoreCase(value, value.Length, pSource + startIndex, count, findLast: false);
+                    return index != -1 ?
+                        startIndex + index :
+                        -1;
+                }
             }
 
-            source = source.Substring(startIndex, count);
-
-            for (int i = 0; i + value.Length <= source.Length; i++)
+            int endIndex = startIndex + (count - value.Length);
+            for (int i = startIndex; i <= endIndex; i++)
             {
-                for (int j = 0; j < value.Length; j++) {
-                   if (source[i + j] != value[j]) {
-                       break;
-                   }
+                int valueIndex, sourceIndex;
+
+                for (valueIndex = 0, sourceIndex = i;
+                     valueIndex < value.Length && source[sourceIndex] == value[valueIndex];
+                     valueIndex++, sourceIndex++) ;
 
-                   if (j == value.Length - 1) {
-                       return i + startIndex;
-                   }
+                if (valueIndex == value.Length)
+                {
+                    return i;
                 }
             }
 
             return -1;
         }
 
-        internal static int LastIndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
+        internal static unsafe int LastIndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase)
         {
             Contract.Assert(source != null);
             Contract.Assert(value != null);
@@ -66,27 +74,41 @@ namespace System.Globalization
                 return startIndex;
             }
 
-            // TODO (dotnet/corefx#3468): Move this into the shim so we don't have to do the ToUpper or call substring.
+            if (count < value.Length)
+            {
+                return -1;
+            }
+
+            // startIndex is the index into source where we start search backwards from. 
+            // leftStartIndex is the index into source of the start of the string that is 
+            // count characters away from startIndex.
+            int leftStartIndex = startIndex - count + 1;
 
             if (ignoreCase)
             {
-                source = source.ToUpper(CultureInfo.InvariantCulture);
-                value = value.ToUpper(CultureInfo.InvariantCulture);
+                fixed (char* pSource = source)
+                {
+                    int lastIndex = Interop.GlobalizationInterop.IndexOfOrdinalIgnoreCase(value, value.Length, pSource + leftStartIndex, count, findLast: true);
+                    return lastIndex != -1 ?
+                        leftStartIndex + lastIndex :
+                        -1;
+                }
             }
 
-            source = source.Substring(startIndex - count + 1, count);
+            for (int i = startIndex - value.Length + 1; i >= leftStartIndex; i--)
+            {
+                int valueIndex, sourceIndex;
 
-            int last = -1;
+                for (valueIndex = 0, sourceIndex = i;
+                     valueIndex < value.Length && source[sourceIndex] == value[valueIndex];
+                     valueIndex++, sourceIndex++) ;
 
-            int cur = 0;
-            while ((cur = IndexOfOrdinal(source, value, last + 1, source.Length - last - 1, false)) != -1)
-            {
-                last = cur;
+                if (valueIndex == value.Length) {
+                    return i;
+                }
             }
 
-            return last >= 0 ?
-                last + startIndex - count + 1 :
-                -1;
+            return -1;
         }
 
         private unsafe int GetHashCodeOfStringCore(string source, CompareOptions options)
@@ -138,9 +160,9 @@ namespace System.Globalization
 
             fixed (char* pSource = source)
             {
-                int lastIndex = Interop.GlobalizationInterop.IndexOf(m_sortNameAsUtf8, target, pSource + startIndex, count, options);
+                int index = Interop.GlobalizationInterop.IndexOf(m_sortNameAsUtf8, target, pSource + startIndex, count, options);
 
-                return lastIndex != -1 ? lastIndex + startIndex : -1;
+                return index != -1 ? index + startIndex : -1;
             }
         }
 
index 13f58e2..f17226f 100644 (file)
     <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventDescriptor.cs" />
     <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventProvider.cs" />
     <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSource.cs" />
+    <DiagnosticsSources Condition="'$(FeatureXplatEventSource)' == 'true'" Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\XplatEventLogger.cs" />
     <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSourceException.cs" />
     <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\FrameworkEventSource.cs" />
     <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\StubEnvironment.cs" />
index ff5b8d5..1fc9a52 100644 (file)
@@ -250,6 +250,11 @@ namespace System.Diagnostics.Tracing
     /// </remarks>
     public partial class EventSource : IDisposable
     {
+
+#if FEATURE_EVENTSOURCE_XPLAT
+        private static readonly EventListener persistent_Xplat_Listener = XplatEventLogger.InitializePersistentListener();
+#endif //FEATURE_EVENTSOURCE_XPLAT
+
         /// <summary>
         /// The human-friendly name of the eventSource.  It defaults to the simple name of the class
         /// </summary>
diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs b/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs
new file mode 100644 (file)
index 0000000..94166f0
--- /dev/null
@@ -0,0 +1,141 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Collections.ObjectModel;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Text;
+using System.Runtime.InteropServices;
+
+using Contract = System.Diagnostics.Contracts.Contract;
+
+#if FEATURE_EVENTSOURCE_XPLAT
+
+namespace System.Diagnostics.Tracing
+{
+
+    internal  class XplatEventLogger : EventListener
+    {
+        public XplatEventLogger() {}
+        
+        private static bool initializedPersistentListener = false;
+
+        [System.Security.SecuritySafeCritical]
+        public static EventListener InitializePersistentListener()
+        {
+            try{
+
+                if (!initializedPersistentListener && XplatEventLogger.IsEventSourceLoggingEnabled())
+                {
+                    initializedPersistentListener = true;
+                    return new XplatEventLogger();
+                }
+            }
+            catch(Exception){}
+
+            return null;
+        }
+
+        [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+        private static extern bool IsEventSourceLoggingEnabled();
+
+        [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+        private static extern void LogEventSource(int eventID, string eventName, string eventSourceName, string payload);
+
+        static List<char> escape_seq = new List<char> { '\b', '\f', '\n', '\r', '\t', '\"', '\\' };
+        static Dictionary<char, string> seq_mapping = new Dictionary<char, string>()
+        {
+            {'\b', "b"},
+            {'\f', "f"},
+            {'\n', "n"},
+            {'\r', "r"},
+            {'\t', "t"},
+            {'\"', "\\\""},
+            {'\\', "\\\\"}
+        };
+
+        private static void minimalJsonserializer(string payload, StringBuilder sb)
+        {
+            foreach( var elem in payload)
+            {
+                if (escape_seq.Contains(elem))
+                {
+                    sb.Append("\\\\");
+                    sb.Append(seq_mapping[elem]);
+                }
+                else
+                {
+                    sb.Append(elem);
+                }
+            }
+        }
+
+        private static string Serialize(ReadOnlyCollection<string> payloadName, ReadOnlyCollection<object> payload, string sep = ", ")
+        {
+
+            if (payloadName == null || payload == null )
+                return String.Empty;
+
+            if (payloadName.Count == 0 || payload.Count == 0)
+                return String.Empty;
+
+            Contract.Assert(payloadName.Count == payload.Count);
+            
+            var sb = StringBuilderCache.Acquire();
+
+            sb.Append('{');
+            for (int i = 0; i < payloadName.Count; i++)
+            {
+                var fieldstr = payloadName[i].ToString();
+
+                sb.Append("\\\"");
+                sb.Append(fieldstr);
+                sb.Append("\\\"");
+                sb.Append(':');
+
+                var valuestr = payload[i] as string;
+
+                if( valuestr != null)
+                {
+                    sb.Append("\\\"");
+                    minimalJsonserializer(valuestr,sb);
+                    sb.Append("\\\"");
+                }
+                else
+                {
+                    sb.Append(payload[i].ToString());
+                }
+                
+                sb.Append(sep);
+
+            }
+
+             sb.Length -= sep.Length;
+             sb.Append('}');
+
+             return StringBuilderCache.GetStringAndRelease(sb);
+        }
+
+        internal protected  override void OnEventSourceCreated(EventSource eventSource)
+        {
+            EnableEvents(eventSource, EventLevel.LogAlways, EventKeywords.All, null);
+        }
+
+        internal protected  override void OnEventWritten(EventWrittenEventArgs eventData)
+        {
+            LogOnEventWritten(eventData);
+        }
+
+        [System.Security.SecuritySafeCritical]
+        private void LogOnEventWritten(EventWrittenEventArgs eventData)
+        {
+            string payload = "";
+            if (eventData.Payload != null)
+            {
+                payload = Serialize(eventData.PayloadNames, eventData.Payload);
+            }
+
+            LogEventSource( eventData.EventId, eventData.EventName,eventData.EventSource.Name,payload);
+        }
+    }
+}
+#endif //FEATURE_EVENTSOURCE_XPLAT
index fbbd4d0..4107cc1 100644 (file)
 //  RFC 3491 - Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)
 //  RFC 3492 - Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)
 //
+
+/*
+
+The punycode implementation is based on the sample code in RFC 3492
+        
+Copyright (C) The Internet Society (2003).  All Rights Reserved.
+
+This document and translations of it may be copied and furnished to
+others, and derivative works that comment on or otherwise explain it
+or assist in its implementation may be prepared, copied, published
+and distributed, in whole or in part, without restriction of any
+kind, provided that the above copyright notice and this paragraph are
+included on all such copies and derivative works.  However, this
+document itself may not be modified in any way, such as by removing
+the copyright notice or references to the Internet Society or other
+Internet organizations, except as needed for the purpose of
+developing Internet standards in which case the procedures for
+copyrights defined in the Internet Standards process must be
+followed, or as required to translate it into languages other than
+English.
+
+The limited permissions granted above are perpetual and will not be
+revoked by the Internet Society or its successors or assigns.
+
+This document and the information contained herein is provided on an
+"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
 namespace System.Globalization
 {
     using System;
index ef88431..59eb48c 100644 (file)
@@ -55,7 +55,6 @@ namespace System {
         int mj, mk;
     
         //Initialize our Seed array.
-        //This algorithm comes from Numerical Recipes in C (2nd Ed.)
         int subtraction = (Seed == Int32.MinValue) ? Int32.MaxValue : Math.Abs(Seed);
         mj = MSEED - subtraction;
         SeedArray[55]=mj;
index 7bddd88..6cc9978 100644 (file)
@@ -491,6 +491,26 @@ typedef long time_t;
 typedef DWORD (PALAPI *PTHREAD_START_ROUTINE)(LPVOID lpThreadParameter);
 typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
 
+
+/******************* Tracing Initialization *******************************/
+
+#if defined(__LINUX__)
+
+// Constructor priority is set to 200, which allows for constructors to
+// guarantee that they run before or after this constructor by setting
+// their priority appropriately.
+
+// Priority values must be greater than 100.  The lower the value,
+// the higher the priority.
+static
+void
+__attribute__((__unused__))
+__attribute__((constructor (200)))
+PAL_InitializeTracing(void);
+
+#endif
+
+
 /******************* PAL-Specific Entrypoints *****************************/
 
 PALIMPORT
@@ -5198,132 +5218,353 @@ typedef EXCEPTION_DISPOSITION (PALAPI *PVECTORED_EXCEPTION_HANDLER)(
 // significant set bit, or 0 if if mask is zero.
 //
 // The same is true for BitScanForward, except that the GCC function is __builtin_ffs.
-
+EXTERN_C
 PALIMPORT
+inline
 unsigned char
 PALAPI
 BitScanForward(
-             IN OUT PDWORD Index,
-             IN UINT qwMask);
+    IN OUT PDWORD Index,
+    IN UINT qwMask)
+{
+    unsigned char bRet = FALSE;
+    int iIndex = __builtin_ffsl(qwMask);
+    if (iIndex != 0)
+    {
+        // Set the Index after deducting unity
+        *Index = (DWORD)(iIndex - 1);
+        bRet = TRUE;
+    }
+
+    return bRet;
+}
 
+EXTERN_C
 PALIMPORT
-LONG
+inline
+unsigned char
 PALAPI
-InterlockedIncrement(
-             IN OUT LONG volatile *lpAddend);
+BitScanForward64(
+    IN OUT PDWORD Index,
+    IN UINT64 qwMask)
+{
+    unsigned char bRet = FALSE;
+    int iIndex = __builtin_ffsl(qwMask);
+    if (iIndex != 0)
+    {
+        // Set the Index after deducting unity
+        *Index = (DWORD)(iIndex - 1);
+        bRet = TRUE;
+    }
+
+    return bRet;
+}
 
+/*++
+Function:
+InterlockedIncrement
+
+The InterlockedIncrement function increments (increases by one) the
+value of the specified variable and checks the resulting value. The
+function prevents more than one thread from using the same variable
+simultaneously.
+
+Parameters
+
+lpAddend 
+[in/out] Pointer to the variable to increment. 
+
+Return Values
+
+The return value is the resulting incremented value. 
+
+--*/
+EXTERN_C
 PALIMPORT
+inline
 LONG
 PALAPI
-InterlockedDecrement(
-             IN OUT LONG volatile *lpAddend);
+InterlockedIncrement(
+    IN OUT LONG volatile *lpAddend)
+{
+    return __sync_add_and_fetch(lpAddend, (LONG)1);
+}
 
+EXTERN_C
 PALIMPORT
-LONG
+inline
+LONGLONG
 PALAPI
-InterlockedExchange(
-            IN OUT LONG volatile *Target,
-            IN LONG Value);
+InterlockedIncrement64(
+    IN OUT LONGLONG volatile *lpAddend)
+{
+    return __sync_add_and_fetch(lpAddend, (LONGLONG)1);
+}
+
+/*++
+Function:
+InterlockedDecrement
+
+The InterlockedDecrement function decrements (decreases by one) the
+value of the specified variable and checks the resulting value. The
+function prevents more than one thread from using the same variable
+simultaneously.
 
+Parameters
+
+lpAddend 
+[in/out] Pointer to the variable to decrement. 
+
+Return Values
+
+The return value is the resulting decremented value.
+
+--*/
+EXTERN_C
 PALIMPORT
+inline
 LONG
 PALAPI
-InterlockedCompareExchange(
-               IN OUT LONG volatile *Destination,
-               IN LONG Exchange,
-               IN LONG Comperand);
+InterlockedDecrement(
+    IN OUT LONG volatile *lpAddend)
+{
+    return __sync_sub_and_fetch(lpAddend, (LONG)1);
+}
 
+EXTERN_C
 PALIMPORT
-LONG
+inline
+LONGLONG
 PALAPI
-InterlockedCompareExchangeAcquire(
-               IN OUT LONG volatile *Destination,
-               IN LONG Exchange,
-               IN LONG Comperand);
+InterlockedDecrement64(
+    IN OUT LONGLONG volatile *lpAddend)
+{
+    return __sync_sub_and_fetch(lpAddend, (LONGLONG)1);
+}
+
+/*++
+Function:
+InterlockedExchange
 
+The InterlockedExchange function atomically exchanges a pair of
+values. The function prevents more than one thread from using the same
+variable simultaneously.
+
+Parameters
+
+Target 
+[in/out] Pointer to the value to exchange. The function sets
+this variable to Value, and returns its prior value.
+Value 
+[in] Specifies a new value for the variable pointed to by Target. 
+
+Return Values
+
+The function returns the initial value pointed to by Target. 
+
+--*/
+EXTERN_C
 PALIMPORT
+inline
 LONG
 PALAPI
-InterlockedCompareExchangeRelease(
-               IN OUT LONG volatile *Destination,
-               IN LONG Exchange,
-               IN LONG Comperand);
-               
+InterlockedExchange(
+    IN OUT LONG volatile *Target,
+    IN LONG Value)
+{
+    return __sync_swap(Target, Value);
+}
+
+EXTERN_C
 PALIMPORT
-LONG
+inline
+LONGLONG
 PALAPI
-InterlockedExchangeAdd(
-               IN OUT LONG volatile *Addend,
-               IN LONG Value);
-               
+InterlockedExchange64(
+    IN OUT LONGLONG volatile *Target,
+    IN LONGLONG Value)
+{
+    return __sync_swap(Target, Value);
+}
+
+/*++
+Function:
+InterlockedCompareExchange
+
+The InterlockedCompareExchange function performs an atomic comparison
+of the specified values and exchanges the values, based on the outcome
+of the comparison. The function prevents more than one thread from
+using the same variable simultaneously.
+
+If you are exchanging pointer values, this function has been
+superseded by the InterlockedCompareExchangePointer function.
+
+Parameters
+
+Destination     [in/out] Specifies the address of the destination value. The sign is ignored.
+Exchange        [in]     Specifies the exchange value. The sign is ignored.
+Comperand       [in]     Specifies the value to compare to Destination. The sign is ignored.
+
+Return Values
+
+The return value is the initial value of the destination.
+
+--*/
+EXTERN_C
 PALIMPORT
+inline
 LONG
 PALAPI
-InterlockedAnd(
-               IN OUT LONG volatile *Destination,
-               IN LONG Value);
+InterlockedCompareExchange(
+    IN OUT LONG volatile *Destination,
+    IN LONG Exchange,
+    IN LONG Comperand)
+{
+    return __sync_val_compare_and_swap(
+        Destination, /* The pointer to a variable whose value is to be compared with. */
+        Comperand, /* The value to be compared */
+        Exchange /* The value to be stored */);
+}
 
+EXTERN_C
 PALIMPORT
+inline
 LONG
 PALAPI
-InterlockedOr(
-              IN OUT LONG volatile *Destination,
-              IN LONG Value);
+InterlockedCompareExchangeAcquire(
+    IN OUT LONG volatile *Destination,
+    IN LONG Exchange,
+    IN LONG Comperand)
+{
+    // TODO: implement the version with only the acquire semantics
+    return __sync_val_compare_and_swap(
+        Destination, /* The pointer to a variable whose value is to be compared with. */
+        Comperand, /* The value to be compared */
+        Exchange /* The value to be stored */);
+}
 
+EXTERN_C
 PALIMPORT
-UCHAR
+inline
+LONG
 PALAPI
-InterlockedBitTestAndReset(
-               IN OUT LONG volatile *Base,
-               IN LONG Bit);
+InterlockedCompareExchangeRelease(
+    IN OUT LONG volatile *Destination,
+    IN LONG Exchange,
+    IN LONG Comperand)
+{
+    // TODO: implement the version with only the release semantics
+    return __sync_val_compare_and_swap(
+        Destination, /* The pointer to a variable whose value is to be compared with. */
+        Comperand, /* The value to be compared */
+        Exchange /* The value to be stored */);
+}
 
+// See the 32-bit variant in interlock2.s
+EXTERN_C
 PALIMPORT
-UCHAR
+inline
+LONGLONG
 PALAPI
-InterlockedBitTestAndSet(
-               IN OUT LONG volatile *Base,
-               IN LONG Bit);
+InterlockedCompareExchange64(
+    IN OUT LONGLONG volatile *Destination,
+    IN LONGLONG Exchange,
+    IN LONGLONG Comperand)
+{
+    return __sync_val_compare_and_swap(
+        Destination, /* The pointer to a variable whose value is to be compared with. */
+        Comperand, /* The value to be compared */
+        Exchange /* The value to be stored */);
+}
+
+/*++
+Function:
+InterlockedExchangeAdd
+
+The InterlockedExchangeAdd function atomically adds the value of 'Value'
+to the variable that 'Addend' points to.
+
+Parameters
 
+lpAddend
+[in/out] Pointer to the variable to to added.
+
+Return Values
+
+The return value is the original value that 'Addend' pointed to.
+
+--*/
+EXTERN_C
 PALIMPORT
-unsigned char
+inline
+LONG
 PALAPI
-BitScanForward64(
-             IN OUT PDWORD Index,
-             IN UINT64 qwMask);
+InterlockedExchangeAdd(
+    IN OUT LONG volatile *Addend,
+    IN LONG Value)
+{
+    return __sync_fetch_and_add(Addend, Value);
+}
 
+EXTERN_C
 PALIMPORT
+inline
 LONGLONG
 PALAPI
-InterlockedIncrement64(
-             IN OUT LONGLONG volatile *lpAddend);
+InterlockedExchangeAdd64(
+    IN OUT LONGLONG volatile *Addend,
+    IN LONGLONG Value)
+{
+    return __sync_fetch_and_add(Addend, Value);
+}
 
+EXTERN_C
 PALIMPORT
-LONGLONG
+inline
+LONG
 PALAPI
-InterlockedDecrement64(
-             IN OUT LONGLONG volatile *lpAddend);
+InterlockedAnd(
+    IN OUT LONG volatile *Destination,
+    IN LONG Value)
+{
+    return __sync_fetch_and_and(Destination, Value);
+}
 
+EXTERN_C
 PALIMPORT
-LONGLONG
+inline
+LONG
 PALAPI
-InterlockedExchange64(
-            IN OUT LONGLONG volatile *Target,
-            IN LONGLONG Value);
-            
+InterlockedOr(
+    IN OUT LONG volatile *Destination,
+    IN LONG Value)
+{
+    return __sync_fetch_and_or(Destination, Value);
+}
+
+EXTERN_C
 PALIMPORT
-LONGLONG
+inline
+UCHAR
 PALAPI
-InterlockedExchangeAdd64(
-               IN OUT LONGLONG volatile *Addend,
-               IN LONGLONG Value);
+InterlockedBitTestAndReset(
+    IN OUT LONG volatile *Base,
+    IN LONG Bit)
+{
+    return (InterlockedAnd(Base, ~(1 << Bit)) & (1 << Bit)) != 0;
+}
 
+EXTERN_C
 PALIMPORT
-LONGLONG
+inline
+UCHAR
 PALAPI
-InterlockedCompareExchange64(
-               IN OUT LONGLONG volatile *Destination,
-               IN LONGLONG Exchange,
-               IN LONGLONG Comperand);
+InterlockedBitTestAndSet(
+    IN OUT LONG volatile *Base,
+    IN LONG Bit)
+{
+    return (InterlockedOr(Base, (1 << Bit)) & (1 << Bit)) != 0;
+}
 
 #if defined(BIT64)
 #define InterlockedExchangePointer(Target, Value) \
@@ -5339,11 +5580,23 @@ InterlockedCompareExchange64(
     ((PVOID)(UINT_PTR)InterlockedCompareExchange((PLONG)(UINT_PTR)(Destination), (LONG)(UINT_PTR)(ExChange), (LONG)(UINT_PTR)(Comperand)))
 #endif
 
+/*++
+Function:
+MemoryBarrier
+
+The MemoryBarrier function creates a full memory barrier.
+
+--*/
+EXTERN_C
 PALIMPORT
+inline
 VOID
 PALAPI
 MemoryBarrier(
-    VOID);
+    VOID)
+{
+    __sync_synchronize();
+}
 
 PALIMPORT
 VOID
@@ -5912,13 +6165,47 @@ inline WCHAR *PAL_wcsstr(WCHAR *_S, const WCHAR *_P)
 }
 #endif
 
-PALIMPORT unsigned int __cdecl _rotl(unsigned int, int);
+/*++
+Function:
+_rotl
+
+See MSDN doc.
+--*/
+EXTERN_C
+PALIMPORT
+inline
+unsigned int __cdecl _rotl(unsigned int value, int shift)
+{
+    unsigned int retval = 0;
+
+    shift &= 0x1f;
+    retval = (value << shift) | (value >> (sizeof(int) * CHAR_BIT - shift));
+    return retval;
+}
+
 // On 64 bit unix, make the long an int.
 #ifdef BIT64
 #define _lrotl _rotl
 #endif // BIT64
 
-PALIMPORT unsigned int __cdecl _rotr(unsigned int, int);
+/*++
+Function:
+_rotr
+
+See MSDN doc.
+--*/
+EXTERN_C
+PALIMPORT
+inline
+unsigned int __cdecl _rotr(unsigned int value, int shift)
+{
+    unsigned int retval;
+
+    shift &= 0x1f;
+    retval = (value >> shift) | (value << (sizeof(int) * CHAR_BIT - shift));
+    return retval;
+}
+
 PALIMPORT int __cdecl abs(int);
 PALIMPORT double __cdecl fabs(double); 
 #ifndef PAL_STDCPP_COMPAT
@@ -6666,6 +6953,18 @@ public:
 #define MAKEDLLNAME(x) MAKEDLLNAME_A(x)
 #endif
 
+#define PAL_SHLIB_PREFIX "lib"
+
+#if __APPLE__
+#define PAL_SHLIB_SUFFIX ".dylib"
+#elif _AIX
+#define PAL_SHLIB_SUFFIX ".a"
+#elif _HPUX_
+#define PAL_SHLIB_SUFFIX ".sl"
+#else
+#define PAL_SHLIB_SUFFIX ".so"
+#endif
+
 #define DBG_EXCEPTION_HANDLED            ((DWORD   )0x00010001L)    
 #define DBG_CONTINUE                     ((DWORD   )0x00010002L)    
 #define DBG_EXCEPTION_NOT_HANDLED        ((DWORD   )0x80010001L)    
index 8bcb8f7..f56e3b0 100644 (file)
@@ -2246,6 +2246,19 @@ inline ULONG FireEtwCodeSymbols(
                   return FireEtXplatCodeSymbols(ModuleId,TotalChunks,ChunkNumber,ChunkLength,Chunk,ClrInstanceID);
 }
 
+inline BOOL EventEnabledEventSource() {return XplatEventLogger::IsEventLoggingEnabled() && EventXplatEnabledEventSource();}
+
+inline ULONG FireEtwEventSource(
+                  const signed int  EventID,
+                  PCWSTR  EventName,
+                  PCWSTR  EventSourceName,
+                  PCWSTR  Payload
+)
+{
+                  if (!EventEnabledEventSource()) {return ERROR_SUCCESS;}
+                  return FireEtXplatEventSource(EventID,EventName,EventSourceName,Payload);
+}
+
 inline BOOL EventEnabledCLRStackWalkDCStart() {return XplatEventLogger::IsEventLoggingEnabled() && EventXplatEnabledCLRStackWalkDCStart();}
 
 inline ULONG FireEtwCLRStackWalkDCStart(
index 52d35fc..2e37485 100644 (file)
@@ -1243,6 +1243,13 @@ extern "C" ULONG   FireEtXplatCodeSymbols(
                   const BYTE* Chunk,
                   const unsigned short  ClrInstanceID
 );
+extern "C" BOOL EventXplatEnabledEventSource();
+extern "C" ULONG   FireEtXplatEventSource(
+                  const signed int  EventID,
+                  PCWSTR  EventName,
+                  PCWSTR  EventSourceName,
+                  PCWSTR  Payload
+);
 extern "C" BOOL EventXplatEnabledCLRStackWalkDCStart();
 extern "C" ULONG   FireEtXplatCLRStackWalkDCStart(
                   const unsigned short  ClrInstanceID,
index 97c592e..272bce7 100644 (file)
@@ -177,6 +177,7 @@ This file is generated using the logic from <root>/src/inc/genXplatEtw.pl
 #define FireEtwDebugExceptionProcessingStart() 0
 #define FireEtwDebugExceptionProcessingEnd() 0
 #define FireEtwCodeSymbols(ModuleId, TotalChunks, ChunkNumber, ChunkLength, Chunk, ClrInstanceID) 0
+#define FireEtwEventSource(EventID, EventName, EventSourceName, Payload) 0
 #define FireEtwCLRStackWalkDCStart(ClrInstanceID, Reserved1, Reserved2, FrameCount, Stack) 0
 #define FireEtwMethodDCStart(MethodID, ModuleID, MethodStartAddress, MethodSize, MethodToken, MethodFlags) 0
 #define FireEtwMethodDCStart_V1(MethodID, ModuleID, MethodStartAddress, MethodSize, MethodToken, MethodFlags, ClrInstanceID) 0
index f1a2546..03b3ea6 100644 (file)
@@ -135,7 +135,6 @@ set(SOURCES
   misc/error.cpp
   misc/errorstrings.cpp
   misc/fmtmessage.cpp
-  misc/interlock.cpp
   misc/miscpalapi.cpp
   misc/msgbox.cpp
   misc/strutil.cpp
index 2c48214..fa8504f 100644 (file)
@@ -72,48 +72,6 @@ namespace CorUnix
 
 /*++
 Function:
-  _rotl
-
-See MSDN doc.
---*/
-unsigned int
-__cdecl 
-_rotl( unsigned int value, int shift )
-{
-    unsigned int retval = 0;
-
-    PERF_ENTRY(_rotl);
-    ENTRY("_rotl( value:%u shift=%d )\n", value, shift );   
-    shift &= 0x1f;
-    retval = ( value << shift ) | ( value >> ( sizeof( int ) * CHAR_BIT - shift ));
-    LOGEXIT("_rotl returns unsigned int %u\n", retval);
-    PERF_EXIT(_rotl);
-    return retval;
-}
-
-/*++
-Function:
-  _rotr
-
-See MSDN doc.
---*/
-unsigned int
-__cdecl 
-_rotr( unsigned int value, int shift )
-{
-    unsigned int retval;
-
-    PERF_ENTRY(_rotr);
-    ENTRY("_rotr( value:%u shift=%d )\n", value, shift );    
-    shift &= 0x1f;
-    retval = ( value >> shift ) | ( value << ( sizeof( int ) * CHAR_BIT - shift ) );
-    LOGEXIT("_rotr returns unsigned int %u\n", retval);
-    PERF_EXIT(_rotr);
-    return retval;
-}
-
-/*++
-Function:
   _gcvt_s
 
 See MSDN doc.
index 729053e..1a0a251 100644 (file)
@@ -5789,3 +5789,62 @@ extern "C" ULONG  FireEtXplatCodeSymbols(
 
 return Error;
 }
+extern "C" BOOL  EventXplatEnabledEventSource(){ return TRUE;}
+extern "C" ULONG  FireEtXplatEventSource(
+                  const signed int EventID,
+                  PCWSTR EventName,
+                  PCWSTR EventSourceName,
+                  PCWSTR Payload
+)
+{
+  ULONG Error = ERROR_WRITE_FAULT;
+    if (!EventXplatEnabledEventSource()){ return ERROR_SUCCESS;};
+    INT EventName_path_size = -1;
+    INT EventName_full_name_path_size = WideCharToMultiByte( CP_ACP, 0, EventName, -1, NULL, 0, NULL, NULL );
+    CHAR* EventName_full_name=NULL;
+    INT EventSourceName_path_size = -1;
+    INT EventSourceName_full_name_path_size = WideCharToMultiByte( CP_ACP, 0, EventSourceName, -1, NULL, 0, NULL, NULL );
+    CHAR* EventSourceName_full_name=NULL;
+    INT Payload_path_size = -1;
+    INT Payload_full_name_path_size = WideCharToMultiByte( CP_ACP, 0, Payload, -1, NULL, 0, NULL, NULL );
+    CHAR* Payload_full_name=NULL;
+
+    EventName_full_name = (CHAR*)malloc(EventName_full_name_path_size*sizeof(CHAR));
+    _ASSERTE(EventName_full_name != NULL);
+    if(EventName_full_name == NULL){goto LExit;}
+
+    EventName_path_size = WideCharToMultiByte( CP_ACP, 0, EventName, -1, EventName_full_name, EventName_full_name_path_size, NULL, NULL );
+    _ASSERTE(EventName_path_size == EventName_full_name_path_size );
+    if( EventName_path_size == 0 ){ Error = ERROR_INVALID_PARAMETER; goto LExit;}
+    EventSourceName_full_name = (CHAR*)malloc(EventSourceName_full_name_path_size*sizeof(CHAR));
+    _ASSERTE(EventSourceName_full_name != NULL);
+    if(EventSourceName_full_name == NULL){goto LExit;}
+
+    EventSourceName_path_size = WideCharToMultiByte( CP_ACP, 0, EventSourceName, -1, EventSourceName_full_name, EventSourceName_full_name_path_size, NULL, NULL );
+    _ASSERTE(EventSourceName_path_size == EventSourceName_full_name_path_size );
+    if( EventSourceName_path_size == 0 ){ Error = ERROR_INVALID_PARAMETER; goto LExit;}
+    Payload_full_name = (CHAR*)malloc(Payload_full_name_path_size*sizeof(CHAR));
+    _ASSERTE(Payload_full_name != NULL);
+    if(Payload_full_name == NULL){goto LExit;}
+
+    Payload_path_size = WideCharToMultiByte( CP_ACP, 0, Payload, -1, Payload_full_name, Payload_full_name_path_size, NULL, NULL );
+    _ASSERTE(Payload_path_size == Payload_full_name_path_size );
+    if( Payload_path_size == 0 ){ Error = ERROR_INVALID_PARAMETER; goto LExit;}
+                                
+     tracepoint(
+        DotNETRuntime,
+        EventSource,
+        EventID,
+        EventName_full_name,
+        EventSourceName_full_name,
+        Payload_full_name
+        );
+
+        Error = ERROR_SUCCESS;
+LExit:
+        if (Payload_full_name != NULL) {free(Payload_full_name);}
+        if (EventSourceName_full_name != NULL) {free(EventSourceName_full_name);}
+        if (EventName_full_name != NULL) {free(EventName_full_name);}
+
+return Error;
+}
index 0b3c8a7..6e56d2e 100644 (file)
@@ -26,6 +26,32 @@ This file is generated using the logic from <root>/src/inc/genXplatLttng.pl
 #include <lttng/tracepoint.h>
 
 
+#define EventSource_TRACEPOINT_ARGS \
+TP_ARGS(\
+        const signed int ,EventID,\
+        const char* ,EventName,\
+        const char* ,EventSourceName,\
+        const char* ,Payload\
+)
+TRACEPOINT_EVENT_CLASS(
+    DotNETRuntime,
+    EventSource,
+    EventSource_TRACEPOINT_ARGS,
+     TP_FIELDS(
+        ctf_integer(signed int,EventID,EventID)
+        ctf_string(EventName,EventName)
+        ctf_string(EventSourceName,EventSourceName)
+        ctf_string(Payload,Payload)
+    )
+)
+#define EventSourceT_TRACEPOINT_INSTANCE(name) \
+TRACEPOINT_EVENT_INSTANCE(\
+    DotNETRuntime,\
+    EventSource ,\
+    name ,\
+    EventSource_TRACEPOINT_ARGS \
+)
+
 #define StrongNameVerification_TRACEPOINT_ARGS \
 TP_ARGS(\
         const unsigned int ,VerificationFlags,\
@@ -3204,5 +3230,6 @@ T_TRACEPOINT_INSTANCE(DebugIPCEventEnd)
 T_TRACEPOINT_INSTANCE(DebugExceptionProcessingStart)
 T_TRACEPOINT_INSTANCE(DebugExceptionProcessingEnd)
 CodeSymbolsT_TRACEPOINT_INSTANCE(CodeSymbols)
+EventSourceT_TRACEPOINT_INSTANCE(EventSource)
 #endif /* LTTNG_CORECLR_HDotNETRuntime */
 #include <lttng/tracepoint-event.h>
index ce3eaa9..83c977e 100644 (file)
@@ -26,18 +26,6 @@ extern "C"
 {
 #endif // __cplusplus
 
-#define PAL_SHLIB_PREFIX "lib"
-
-#if __APPLE__
-#define PAL_SHLIB_SUFFIX ".dylib"
-#elif _AIX
-#define PAL_SHLIB_SUFFIX ".a"
-#elif _HPUX_
-#define PAL_SHLIB_SUFFIX ".sl"
-#else
-#define PAL_SHLIB_SUFFIX ".so"
-#endif
-
 typedef BOOL (__stdcall *PDLLMAIN)(HINSTANCE, DWORD, LPVOID);   /* entry point of module */
 typedef HINSTANCE (PALAPI *PREGISTER_MODULE)(LPCSTR);           /* used to create the HINSTANCE for above DLLMain entry point */
 typedef VOID (PALAPI *PUNREGISTER_MODULE)(HINSTANCE);           /* used to cleanup the HINSTANCE for above DLLMain entry point */
index 5dbe6cc..3a48183 100644 (file)
@@ -1611,8 +1611,6 @@ Return value :
 --*/
 static HMODULE LOADLoadLibrary(LPCSTR shortAsciiName, BOOL fDynamic)
 {
-    CHAR * fullLibraryName;
-    PathCharString fullLibraryNamePS;
     HMODULE module = NULL;
     HMODULE dl_handle = NULL;
 
@@ -1637,40 +1635,9 @@ static HMODULE LOADLoadLibrary(LPCSTR shortAsciiName, BOOL fDynamic)
     // See if file can be dlopen()ed; this should work even if it's already loaded
     {
         // See GetProcAddress for an explanation why we leave the PAL.
-        PAL_LeaveHolder holder; 
-        
-        // P/Invokes are often declared with variations on the actual library name.
-        // For example, it's common to leave off the extension/suffix of the library
-        // even if it has one, or to leave off a prefix like "lib" even if it has one
-        // (both of these are done typically to smooth over cross-platform differences). 
-        // We try to dlopen with such variations on the original.
-        const char* const formatStrings[4] = // used with args: PAL_SHLIB_PREFIX, shortAsciiName, PAL_SHLIB_SUFFIX
-        {
-            "%s%s%s",     // prefix+name+suffix
-            "%.0s%s%.0s", // name
-            "%.0s%s%s",   // name+suffix
-            "%s%s%.0s",   // prefix+name
-        };
-        const int skipPrefixing = strchr(shortAsciiName, '/') != NULL; // skip prefixing if the name is actually a path
-        for (int i = 0; i < 4; i++)
-        {
-            if (skipPrefixing && (i == 0 || i == 3)) // 0th and 3rd strings include prefixes
-                continue;
+        PAL_LeaveHolder holder;
 
-            _ASSERTE(dl_handle == nullptr);
-            fullLibraryName = fullLibraryNamePS.OpenStringBuffer(strlen(PAL_SHLIB_PREFIX)+strlen(shortAsciiName)+strlen(PAL_SHLIB_SUFFIX));
-            int size = snprintf(fullLibraryName, fullLibraryNamePS.GetSizeOf(), formatStrings[i], PAL_SHLIB_PREFIX, shortAsciiName, PAL_SHLIB_SUFFIX);
-            if (size < fullLibraryNamePS.GetSizeOf())
-            {
-                fullLibraryNamePS.CloseBuffer(size);
-                dl_handle = LOADLoadLibraryDirect(fullLibraryName, false /* setLastError */);
-                if (dl_handle != nullptr)
-                {
-                    shortAsciiName = fullLibraryName;
-                    break;
-                }
-            }
-        }
+        dl_handle = LOADLoadLibraryDirect(shortAsciiName, false /* setLastError */);
     }
 
     if (!dl_handle)
diff --git a/src/pal/src/misc/interlock.cpp b/src/pal/src/misc/interlock.cpp
deleted file mode 100644 (file)
index c63566a..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
-//
-
-/*++
-
-
-
-Module Name:
-
-    interlock.c
-
-Abstract:
-
-    Implementation of Interlocked functions for the Intel x86
-    platform. These functions are processor dependent.
-
-
-
---*/
-
-#include "pal/palinternal.h"
-
-
-//
-// We need the following methods to have volatile arguments for compatibility with Win32
-//
-#undef volatile
-
-
-/*++
-Function:
-  InterlockedIncrement
-
-The InterlockedIncrement function increments (increases by one) the
-value of the specified variable and checks the resulting value. The
-function prevents more than one thread from using the same variable
-simultaneously.
-
-Parameters
-
-lpAddend 
-       [in/out] Pointer to the variable to increment. 
-
-Return Values
-
-The return value is the resulting incremented value. 
-
---*/
-LONG
-PALAPI
-InterlockedIncrement(
-             IN OUT LONG volatile *lpAddend)
-{
-    return __sync_add_and_fetch(lpAddend, (LONG)1);
-}
-
-LONGLONG
-PALAPI
-InterlockedIncrement64(
-             IN OUT LONGLONG volatile *lpAddend)
-{
-    return __sync_add_and_fetch(lpAddend, (LONGLONG)1);
-}
-
-/*++
-Function:
-  InterlockedDecrement
-
-The InterlockedDecrement function decrements (decreases by one) the
-value of the specified variable and checks the resulting value. The
-function prevents more than one thread from using the same variable
-simultaneously.
-
-Parameters
-
-lpAddend 
-       [in/out] Pointer to the variable to decrement. 
-
-Return Values
-
-The return value is the resulting decremented value.
-
---*/
-LONG
-PALAPI
-InterlockedDecrement(
-             IN OUT LONG volatile *lpAddend)
-{
-    return __sync_sub_and_fetch(lpAddend, (LONG)1);
-}
-
-LONGLONG
-PALAPI
-InterlockedDecrement64(
-             IN OUT LONGLONG volatile *lpAddend)
-{
-    return __sync_sub_and_fetch(lpAddend, (LONGLONG)1);
-}
-
-/*++
-Function:
-  InterlockedExchange
-
-The InterlockedExchange function atomically exchanges a pair of
-values. The function prevents more than one thread from using the same
-variable simultaneously.
-
-Parameters
-
-Target 
-       [in/out] Pointer to the value to exchange. The function sets
-       this variable to Value, and returns its prior value.
-Value 
-       [in] Specifies a new value for the variable pointed to by Target. 
-
-Return Values
-
-The function returns the initial value pointed to by Target. 
-
---*/
-LONG
-PALAPI
-InterlockedExchange(
-            IN OUT LONG volatile *Target,
-            IN LONG Value)
-{
-    return __sync_swap(Target, Value);
-}
-
-LONGLONG
-PALAPI
-InterlockedExchange64(
-            IN OUT LONGLONG volatile *Target,
-            IN LONGLONG Value)
-{
-    return __sync_swap(Target, Value);
-}
-
-/*++
-Function:
-  InterlockedCompareExchange
-
-The InterlockedCompareExchange function performs an atomic comparison
-of the specified values and exchanges the values, based on the outcome
-of the comparison. The function prevents more than one thread from
-using the same variable simultaneously.
-
-If you are exchanging pointer values, this function has been
-superseded by the InterlockedCompareExchangePointer function.
-
-Parameters
-
-Destination     [in/out] Specifies the address of the destination value. The sign is ignored. 
-Exchange        [in]     Specifies the exchange value. The sign is ignored. 
-Comperand       [in]     Specifies the value to compare to Destination. The sign is ignored. 
-
-Return Values
-
-The return value is the initial value of the destination.
-
---*/
-LONG
-PALAPI
-InterlockedCompareExchange(
-               IN OUT LONG volatile *Destination,
-               IN LONG Exchange,
-               IN LONG Comperand)
-{
-    return __sync_val_compare_and_swap(
-        Destination, /* The pointer to a variable whose value is to be compared with. */
-        Comperand, /* The value to be compared */
-        Exchange /* The value to be stored */);
-}
-
-LONG
-PALAPI
-InterlockedCompareExchangeAcquire(
-               IN OUT LONG volatile *Destination,
-               IN LONG Exchange,
-               IN LONG Comperand)
-{
-    // TODO: implement the version with only the acquire semantics
-    return __sync_val_compare_and_swap(
-        Destination, /* The pointer to a variable whose value is to be compared with. */
-        Comperand, /* The value to be compared */
-        Exchange /* The value to be stored */);
-}
-
-LONG
-PALAPI
-InterlockedCompareExchangeRelease(
-               IN OUT LONG volatile *Destination,
-               IN LONG Exchange,
-               IN LONG Comperand)
-{
-    // TODO: implement the version with only the release semantics
-    return __sync_val_compare_and_swap(
-        Destination, /* The pointer to a variable whose value is to be compared with. */
-        Comperand, /* The value to be compared */
-        Exchange /* The value to be stored */);
-}
-               
-// See the 32-bit variant in interlock2.s
-LONGLONG
-PALAPI
-InterlockedCompareExchange64(
-               IN OUT LONGLONG volatile *Destination,
-               IN LONGLONG Exchange,
-               IN LONGLONG Comperand)
-{
-    return __sync_val_compare_and_swap(
-        Destination, /* The pointer to a variable whose value is to be compared with. */
-        Comperand, /* The value to be compared */
-        Exchange /* The value to be stored */);
-}
-
-/*++
-Function:
-InterlockedExchangeAdd
-
-The InterlockedExchangeAdd function atomically adds the value of 'Value'
-to the variable that 'Addend' points to.
-
-Parameters
-
-lpAddend
-[in/out] Pointer to the variable to to added.
-
-Return Values
-
-The return value is the original value that 'Addend' pointed to.
-
---*/
-LONG
-PALAPI
-InterlockedExchangeAdd(
-               IN OUT LONG volatile *Addend,
-               IN LONG Value)
-{
-    return __sync_fetch_and_add(Addend, Value);
-}
-
-LONGLONG
-PALAPI
-InterlockedExchangeAdd64(
-               IN OUT LONGLONG volatile *Addend,
-               IN LONGLONG Value)
-{
-    return __sync_fetch_and_add(Addend, Value);
-}
-             
-LONG
-PALAPI
-InterlockedAnd(
-               IN OUT LONG volatile *Destination,
-               IN LONG Value)
-{
-    return __sync_fetch_and_and(Destination, Value);
-}
-              
-LONG
-PALAPI
-InterlockedOr(
-              IN OUT LONG volatile *Destination,
-              IN LONG Value)
-{
-    return __sync_fetch_and_or(Destination, Value);
-}
-
-UCHAR
-PALAPI
-InterlockedBitTestAndReset(
-               IN OUT LONG volatile *Base,
-               IN LONG Bit)
-{
-    return (InterlockedAnd(Base, ~(1 << Bit)) & (1 << Bit)) != 0;
-}
-
-UCHAR
-PALAPI
-InterlockedBitTestAndSet(
-               IN OUT LONG volatile *Base,
-               IN LONG Bit)
-{
-    return (InterlockedOr(Base, (1 << Bit)) & (1 << Bit)) != 0;
-}
-
-/*++
-Function:
-MemoryBarrier
-
-The MemoryBarrier function creates a full memory barrier.
-
---*/
-void
-PALAPI
-MemoryBarrier(
-    VOID)
-{
-    __sync_synchronize();
-}
-
-#define volatile DoNotUseVolatileKeyword
index 0aeeb89..d225071 100644 (file)
@@ -50,6 +50,80 @@ SET_DEFAULT_DEBUG_CHANNEL(MISC);
 static const char RANDOM_DEVICE_NAME[] ="/dev/random";
 static const char URANDOM_DEVICE_NAME[]="/dev/urandom";
 
+
+/*++
+
+Initialization logic for LTTng tracepoint providers.
+
+--*/
+#if defined(__LINUX__)
+
+static const char tpLibName[] = "libcoreclrtraceptprovider.so";
+
+
+/*++
+
+NOTE: PAL_InitializeTracing MUST NOT depend on anything in the PAL itself
+as it is called prior to PAL initialization.
+
+--*/
+static
+void
+PAL_InitializeTracing(void)
+{
+    // Get the path to the currently executing shared object (libcoreclr.so).
+    Dl_info info;
+    int succeeded = dladdr((void *)PAL_InitializeTracing, &info);
+    if(!succeeded)
+    {
+        return;
+    }
+
+    // Copy the path and modify the shared object name to be the tracepoint provider.
+    char tpProvPath[MAX_LONGPATH];
+    int pathLen = strlen(info.dli_fname);
+    int tpLibNameLen = strlen(tpLibName);
+
+    // Find the length of the full path without the shared object name, including the trailing slash.
+    int lastTrailingSlashLen = -1;
+    for(int i=pathLen-1; i>=0; i--)
+    {
+        if(info.dli_fname[i] == '/')
+        {
+            lastTrailingSlashLen = i+1;
+            break;
+        }
+    }
+
+    // Make sure we found the last trailing slash.
+    if(lastTrailingSlashLen == -1)
+    {
+        return;
+    }
+
+    // Make sure that the final path is shorter than MAX_PATH.
+    // +1 ensures that the string can be NULL-terminated.
+    if((lastTrailingSlashLen + tpLibNameLen + 1) > MAX_LONGPATH)
+    {
+        return;
+    }
+
+    // Copy the path without the shared object name.
+    memcpy(&tpProvPath, info.dli_fname, lastTrailingSlashLen);
+
+    // Append the shared object name for the tracepoint provider.
+    memcpy(&tpProvPath[lastTrailingSlashLen], &tpLibName, tpLibNameLen);
+
+    // NULL-terminate the string.
+    tpProvPath[lastTrailingSlashLen + tpLibNameLen] = '\0';
+
+    // Load the tracepoint provider.
+    // It's OK if this fails - that just means that tracing dependencies aren't available.
+    dlopen(tpProvPath, RTLD_NOW | RTLD_GLOBAL);
+}
+
+#endif
+
 /*++
 
 Function :
@@ -159,51 +233,6 @@ PAL_GetPALDirectoryA(
     return bRet;
 }
 
-// Define _BitScanForward64 and BitScanForward
-// Per MSDN, BitScanForward64 will search the mask data from LSB to MSB for a set bit.
-// If one is found, its bit position is returned in the outPDWORD argument and 1 is returned.
-// Otherwise, 0 is returned.
-//
-// On GCC, the equivalent function is __builtin_ffsl. It returns 1+index of the least
-// significant set bit, or 0 if if mask is zero.
-unsigned char
-PALAPI
-BitScanForward64(
-        IN OUT PDWORD Index,
-        IN UINT64 qwMask)
-{
-    unsigned char bRet = FALSE;
-    int iIndex = __builtin_ffsl(qwMask);
-    if (iIndex != 0)
-    {
-        // Set the Index after deducting unity
-        *Index = (DWORD)(iIndex-1);
-        bRet = TRUE;
-    }
-
-    return bRet;
-}
-
-// On GCC, the equivalent function is __builtin_ffs. It returns 1+index of the least
-// significant set bit, or 0 if if mask is zero.
-unsigned char
-PALAPI
-BitScanForward(
-        IN OUT PDWORD Index,
-        IN UINT wMask)
-{
-    unsigned char bRet = FALSE;
-    int iIndex = __builtin_ffs(wMask);
-    if (iIndex != 0)
-    {
-        // Set the Index after deducting unity
-        *Index = (DWORD)(iIndex-1);
-        bRet = TRUE;
-    }
-    
-    return bRet;
-}
-
 BOOL
 PALAPI
 PAL_Random(
index fdf177c..bafaa23 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test1.c
+  test1.cpp
 )
 
 add_executable(paltest_rotl_test1
index 563d66b..c0c76fe 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test1.c
+  test1.cpp
 )
 
 add_executable(paltest_rotr_test1
index 0a572f1..7f4adc0 100644 (file)
@@ -1291,6 +1291,13 @@ win_UInt32,
 win_Binary,
 win_UInt16
 );
+ EventXplatEnabledEventSource();
+Error |= FireEtXplatEventSource(
+win_Int32,
+W(" Testing UnicodeString "),
+W(" Testing UnicodeString "),
+W(" Testing UnicodeString ")
+);
  EventXplatEnabledCLRStackWalkDCStart();
 Error |= FireEtXplatCLRStackWalkDCStart(
 win_UInt16,
index 6a94623..e5ba709 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedexchangeadd_test1
index 3dc8f29..a70802e 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedbit_test1
@@ -24,12 +24,12 @@ typedef struct tag_TEST_DATA
 
 TEST_DATA test_data[] =
 {
-    { 0x00000000,  3, 0x00000000, 0 },
-    { 0x12341234,  2, 0x12341230, 1 },
-    { 0x12341234,  3, 0x12341234, 0 },
-    { 0x12341234, 31, 0x12341234, 0 },
-    { 0x12341234, 28, 0x02341234, 1 },
-    { 0xffffffff, 28, 0xefffffff, 1 }
+    { (LONG)0x00000000,  3, (LONG)0x00000000, 0 },
+    { (LONG)0x12341234,  2, (LONG)0x12341230, 1 },
+    { (LONG)0x12341234,  3, (LONG)0x12341234, 0 },
+    { (LONG)0x12341234, 31, (LONG)0x12341234, 0 },
+    { (LONG)0x12341234, 28, (LONG)0x02341234, 1 },
+    { (LONG)0xffffffff, 28, (LONG)0xefffffff, 1 }
 };
 
 int __cdecl main(int argc, char *argv[]) {
index 64d6581..6b50a75 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedbit_test2
@@ -24,12 +24,12 @@ typedef struct tag_TEST_DATA
 
 TEST_DATA test_data[] =
 {
-    { 0x00000000,  2, 0x00000004, 0 },
-    { 0x12341234,  2, 0x12341234, 1 },
-    { 0x12341234,  3, 0x1234123c, 0 },
-    { 0x12341234, 31, 0x92341234, 0 },
-    { 0x12341234, 28, 0x12341234, 1 },
-    { 0xffffffff, 28, 0xffffffff, 1 }
+    { (LONG)0x00000000,  2, (LONG)0x00000004, 0 },
+    { (LONG)0x12341234,  2, (LONG)0x12341234, 1 },
+    { (LONG)0x12341234,  3, (LONG)0x1234123c, 0 },
+    { (LONG)0x12341234, 31, (LONG)0x92341234, 0 },
+    { (LONG)0x12341234, 28, (LONG)0x12341234, 1 },
+    { (LONG)0xffffffff, 28, (LONG)0xffffffff, 1 }
 };
 
 int __cdecl main(int argc, char *argv[]) {
index a3f4f74..d9e8672 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedcompareexchange_test1
index fdf0521..038d375 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedcompareexchange_test2
index 6000db2..722603e 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedcompareexchange64_test1
index 2a82236..f052ca0 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedcompareexchange64_test2
@@ -52,7 +52,7 @@ int __cdecl main(int argc, char *argv[])
        (5 in this case) 
     */
   
-    if((int)ReturnValue != 5) 
+    if((int)(size_t)ReturnValue != 5) 
     {
         Fail("ERROR: The return value should be the value of the "
              "variable before the exchange took place, which was 5.  "
index 8b6fbfd..6cd307d 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockeddecrement_test1
index 320019e..331d89d 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockeddecrement_test2
index c942a33..727a328 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockeddecrement64_test1
index d5462ca..ecea639 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockeddecrement64_test2
index 39911d2..a1a7f86 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedexchange_test1
index 832868e..3f4cd5e 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedexchange64_test1
index e43533d..b085896 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  InterlockedExchangePointer.c
+  InterlockedExchangePointer.cpp
 )
 
 add_executable(paltest_interlockedexchangepointer_test1
index 258d4bc..f87dc72 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedincrement_test1
index 124f95a..e8c5278 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedincrement_test2
index 2520ac5..d7bec46 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedincrement64_test1
index 4d85e40..be571a5 100644 (file)
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(SOURCES
-  test.c
+  test.cpp
 )
 
 add_executable(paltest_interlockedincrement64_test2
index dad72b5..d789b2b 100644 (file)
@@ -3,46 +3,73 @@
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
 //
 
-
 // GuidFromName
 
-// Algorithm from Internet Draft document "UUIDs and GUIDs"
-// By Paul J. Leach and Rich Sals, February 4, 1998.
-
-// This function has been adapted from the routines in the document
-//  uuid_create_from_name and format_uuid_v3
-
-// Changes from documented routines:
-// 1. Changed all instances of uuid_t to GUID.
-//      uuid_t field time_low is GUID field Data1.
-//      uuid_t field time_mid is GUID field Data2.
-//      uuid_t field time_hi_and_version is GUID field Data3.
-//      uuid_t field clock_seq_hi_and_reserved is GUID field Data4[0].
-//      uuid_t field clock_seq_low is GUID field Data4[1].
-//      uuid_t field node[6] is GUID field Data4[2] through Data4[8].
-//
-// 2. Use a c++ implementation of the md5 cryptographic hash function.
-//
-// 3. Implemented the htonl, htons, ntohl, ntohs socket routines as inlines.
-//
-// 4. Renamed variables and types to suit my biases.
-
-/*
-** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
-** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
-** Digital Equipment Corporation, Maynard, Mass.
-** To anyone who acknowledges that this file is provided "AS IS"
-** without any express or implied warranty: permission to use, copy,
-** modify, and distribute this file for any purpose is hereby
-** granted without fee, provided that the above copyright notices and
-** this notice appears in all source code copies, and that none of
-** the names of Open Software Foundation, Inc., Hewlett-Packard
-** Company, or Digital Equipment Corporation be used in advertising
-** or publicity pertaining to distribution of the software without
-** specific, written prior permission.  Neither Open Software
-** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment
-** Corporation makes any representations about the suitability of
-** this software for any purpose.
+/**
+
+Algorithm from Internet Draft document "UUIDs and GUIDs"
+By Paul J. Leach and Rich Sals, February 4, 1998.
+
+This function has been adapted from the routines in the document
+ uuid_create_from_name and format_uuid_v3
+
+Changes from documented routines:
+1. Changed all instances of uuid_t to GUID.
+     uuid_t field time_low is GUID field Data1.
+     uuid_t field time_mid is GUID field Data2.
+     uuid_t field time_hi_and_version is GUID field Data3.
+     uuid_t field clock_seq_hi_and_reserved is GUID field Data4[0].
+     uuid_t field clock_seq_low is GUID field Data4[1].
+     uuid_t field node[6] is GUID field Data4[2] through Data4[8].
+
+2. Use a c++ implementation of the md5 cryptographic hash function.
+
+3. Implemented the htonl, htons, ntohl, ntohs socket routines as inlines.
+
+4. Renamed variables and types to suit my biases.
+
+
+Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
+Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
+Digital Equipment Corporation, Maynard, Mass.
+To anyone who acknowledges that this file is provided "AS IS"
+without any express or implied warranty: permission to use, copy,
+modify, and distribute this file for any purpose is hereby
+granted without fee, provided that the above copyright notices and
+this notice appears in all source code copies, and that none of
+the names of Open Software Foundation, Inc., Hewlett-Packard
+Company, or Digital Equipment Corporation be used in advertising
+or publicity pertaining to distribution of the software without
+specific, written prior permission.  Neither Open Software
+Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment
+Corporation makes any representations about the suitability of
+this software for any purpose.
+
+
+Copyright(C) The Internet Society 1997. All Rights Reserved.
+
+This document and translations of it may be copied and furnished to others,
+and derivative works that comment on or otherwise explain it or assist in
+its implementation may be prepared, copied, published and distributed, in
+whole or in part, without restriction of any kind, provided that the above
+copyright notice and this paragraph are included on all such copies and
+derivative works.However, this document itself may not be modified in any
+way, such as by removing the copyright notice or references to the Internet
+Society or other Internet organizations, except as needed for the purpose of
+developing Internet standards in which case the procedures for copyrights
+defined in the Internet Standards process must be followed, or as required
+to translate it into languages other than English.
+
+The limited permissions granted above are perpetual and will not be revoked
+by the Internet Society or its successors or assigns.
+
+This document and the information contained herein is provided on an "AS IS"
+basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE
+DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY
+RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
+PARTICULAR PURPOSE.
 */
 
 #include "stdafx.h"
index ed9b25c..bbf4ce4 100644 (file)
 
                 <!--Templates-->
                 <templates>
+                    <template tid="EventSource">
+                        <data name="EventID" inType="win:Int32" />
+                        <data name="EventName" inType="win:UnicodeString" />
+                        <data name="EventSourceName" inType="win:UnicodeString" />
+                        <data name="Payload" inType="win:UnicodeString" />
+
+                        <UserData>
+                            <EventSource xmlns="myNs">
+                                <EventID> %1 </EventID>
+                                <EventName> %2 </EventName>
+                                <EventSourceName> %3 </EventSourceName>
+                                <Payload> %4 </Payload>
+                            </EventSource>
+                        </UserData>
+                    </template>
                     <template tid="StrongNameVerification">
                         <data name="VerificationFlags" inType="win:UInt32" outType="win:HexInt32"/>
                         <data name="ErrorCode" inType="win:UInt32" outType="win:HexInt32"/>
                            keywords="CodeSymbolsKeyword" opcode="win:Start" 
                            task="CodeSymbols"
                            symbol="CodeSymbols" message="$(string.RuntimePublisher.CodeSymbolsEventMessage)"/>
+                    
+                   <event value="270" version="0" level="win:Informational"  template="EventSource"
+                           opcode="win:Start"
+                           symbol="EventSource" />
                 </events>
             </provider>
 
index baa138d..042f7c8 100644 (file)
@@ -34,6 +34,7 @@
 ##########################
 # GarbageCollection events
 ##########################
+noclrinstanceid::::EventSource
 noclrinstanceid:GarbageCollection:::GCStart
 nostack:GarbageCollection:::GCStart
 nomac:GarbageCollection:::GCStart_V1
index 2247f44..17ff7d5 100644 (file)
@@ -6878,8 +6878,54 @@ HMODULE NDirect::LoadLibraryModuleViaHost(NDirectMethodDesc * pMD, AppDomain* pD
 }
 #endif //defined(FEATURE_HOST_ASSEMBLY_RESOLVER)
 
-/* static */
-HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTracker * pErrorTracker)
+// Try to load the module alongside the assembly where the PInvoke was declared.
+HMODULE NDirect::LoadFromPInvokeAssemblyDirectory(NDirectMethodDesc *pMD, LPCWSTR libName, DWORD flags, LoadLibErrorTracker *pErrorTracker)
+{
+    STANDARD_VM_CONTRACT;
+
+    HMODULE hmod = NULL;
+
+    Assembly* pAssembly = pMD->GetMethodTable()->GetAssembly();
+    SString path = pAssembly->GetManifestFile()->GetPath();
+
+    SString::Iterator lastPathSeparatorIter = path.End();
+    if (PEAssembly::FindLastPathSeparator(path, lastPathSeparatorIter))
+    {
+        lastPathSeparatorIter++;
+        path.Truncate(lastPathSeparatorIter);
+
+        path.Append(libName);
+        hmod = LocalLoadLibraryHelper(path, flags, pErrorTracker);
+    }
+
+    return hmod;
+}
+
+// Try to load the module from the native DLL search directories
+HMODULE NDirect::LoadFromNativeDllSearchDirectories(AppDomain* pDomain, LPCWSTR libName, DWORD flags, LoadLibErrorTracker *pErrorTracker)
+{
+    STANDARD_VM_CONTRACT;
+
+    HMODULE hmod = NULL;
+
+    if (pDomain->HasNativeDllSearchDirectories())
+    {
+        AppDomain::PathIterator pathIter = pDomain->IterateNativeDllSearchDirectories();
+        while (hmod == NULL && pathIter.Next())
+        {
+            SString qualifiedPath(*(pathIter.GetPath()));
+            qualifiedPath.Append(libName);
+            if (!Path::IsRelative(qualifiedPath))
+            {
+                hmod = LocalLoadLibraryHelper(qualifiedPath, flags, pErrorTracker);
+            }
+        }
+    }
+
+    return hmod;
+}
+
+HINSTANCE NDirect::LoadLibraryModule(NDirectMethodDesc * pMD, LoadLibErrorTracker * pErrorTracker)
 {
     CONTRACTL
     {
@@ -6964,7 +7010,7 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
         {
             W("mscorpe.dll"), W("mscorpe")
         };
-                
+
         for (int i = 0; i < COUNTOF(rgSxSAwareDlls); i++)
         {
             if (SString::_wcsicmp(wszLibName, rgSxSAwareDlls[i]) == 0)
@@ -7006,6 +7052,7 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
 
     DWORD dllImportSearchPathFlag = 0;
     BOOL searchAssemblyDirectory = TRUE;
+    bool libNameIsRelativePath = Path::IsRelative(wszLibName);
     if (hmod == NULL)
     {
 #ifndef FEATURE_CORECLR
@@ -7032,14 +7079,14 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
                 attributeIsFound = TRUE;
             }
         }
-                
+
         if (!attributeIsFound)
         {
             CheckUnificationList(pMD, &dllImportSearchPathFlag, &searchAssemblyDirectory);
         }
 #endif // !FEATURE_CORECLR
 
-        if (!Path::IsRelative(wszLibName))
+        if (!libNameIsRelativePath)
         {
             DWORD flags = loadWithAlteredPathFlags;
             if ((dllImportSearchPathFlag & LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR) != 0)
@@ -7053,34 +7100,19 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
         }
         else if (searchAssemblyDirectory)
         {
-            // Try to load the DLL alongside the assembly where the PInvoke was 
-            // declared using the path of the assembly.
-            Assembly* pAssembly = pMD->GetMethodTable()->GetAssembly();
-
-            SString path = pAssembly->GetManifestFile()->GetPath();
-            SString::Iterator i = path.End();
-
-            if (PEAssembly::FindLastPathSeparator(path, i))
-            {
-                i++;
-                path.Truncate(i);
-
-                path.Append(wszLibName);
-
-                hmod = LocalLoadLibraryHelper(path, loadWithAlteredPathFlags | dllImportSearchPathFlag, pErrorTracker);
-            }
+            hmod = LoadFromPInvokeAssemblyDirectory(pMD, wszLibName, loadWithAlteredPathFlags | dllImportSearchPathFlag, pErrorTracker);
 
 #ifndef FEATURE_CORECLR
             if (hmod == NULL)
-            {                
+            {
                 // Try to load the DLL alongside the assembly where the PInvoke was 
                 // declared using the codebase of the assembly. This is required for download
                 // and shadow copy scenarios.
                 const WCHAR* ptr;
-                SString codebase;                                            
+                SString codebase;
                 pAssembly->GetCodeBase(codebase);
                 DWORD dwCodebaseLength = codebase.GetCount();
-                                            
+
                 // Strip off the protocol
                 for (ptr = codebase.GetUnicode(); *ptr && *ptr != W(':'); ptr++);
 
@@ -7090,7 +7122,7 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
                     SString pathFromCodebase;
 
                     // After finding the colon move forward until no more forward slashes
-                    for(ptr++; *ptr && *ptr == W('/'); ptr++);
+                    for (ptr++; *ptr && *ptr == W('/'); ptr++);
                     if (*ptr) 
                     {
                         // Calculate the number of characters we are interested in
@@ -7103,9 +7135,9 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
 
                             if (tail > ptr) 
                             {
-                                for(;ptr <= tail; ptr++) 
+                                for (;ptr <= tail; ptr++) 
                                 {
-                                    if(*ptr == W('/')) 
+                                    if (*ptr == W('/')) 
                                         pathFromCodebase.Append(W('\\'));
                                     else
                                         pathFromCodebase.Append(*ptr);
@@ -7127,24 +7159,15 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
     }
 
 #ifdef FEATURE_CORECLR
-    if (hmod == NULL && pDomain->HasNativeDllSearchDirectories())
+    if (hmod == NULL)
     {
-        AppDomain::PathIterator i = pDomain->IterateNativeDllSearchDirectories();
-        while (hmod == NULL && i.Next())
-        {
-            SString qualifiedPath(*(i.GetPath()));
-            qualifiedPath.Append(wszLibName);
-            if (!Path::IsRelative(qualifiedPath))
-            {
-                hmod = LocalLoadLibraryHelper(qualifiedPath, loadWithAlteredPathFlags, pErrorTracker);
-            }
-        }
+        LoadFromNativeDllSearchDirectories(pDomain, wszLibName, loadWithAlteredPathFlags, pErrorTracker);
     }
+
 #endif // FEATURE_CORECLR
 
-    // Do we really need to do this. This call searches the application directory
-    // instead of the location for the library.
-    if(hmod == NULL)
+    // This call searches the application directory instead of the location for the library.
+    if (hmod == NULL)
     {
         hmod = LocalLoadLibraryHelper(wszLibName, dllImportSearchPathFlag, pErrorTracker);
     }
@@ -7178,6 +7201,48 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
         }
     }
 
+#ifdef FEATURE_PAL
+    if (hmod == NULL)
+    {
+        // P/Invokes are often declared with variations on the actual library name.
+        // For example, it's common to leave off the extension/suffix of the library
+        // even if it has one, or to leave off a prefix like "lib" even if it has one
+        // (both of these are typically done to smooth over cross-platform differences). 
+        // We try to dlopen with such variations on the original.
+        const char* const prefixSuffixCombinations[] =
+        {
+            "%s%s%s",     // prefix+name+suffix
+            "%.0s%s%s",   // name+suffix
+            "%s%s%.0s",   // prefix+name
+        };
+
+        const int NUMBER_OF_LIB_NAME_VARIATIONS = COUNTOF(prefixSuffixCombinations);
+
+        // Try to load from places we tried above, but this time with variations on the
+        // name including the prefix, suffix, and both.
+        for (int i = 0; i < NUMBER_OF_LIB_NAME_VARIATIONS; i++)
+        {
+            SString currLibNameVariation;
+            currLibNameVariation.Printf(prefixSuffixCombinations[i], PAL_SHLIB_PREFIX, name, PAL_SHLIB_SUFFIX);
+
+            if (libNameIsRelativePath && searchAssemblyDirectory)
+            {
+                hmod = LoadFromPInvokeAssemblyDirectory(pMD, currLibNameVariation, loadWithAlteredPathFlags | dllImportSearchPathFlag, pErrorTracker);
+                if (hmod != NULL)
+                    break;
+            }
+
+            hmod = LoadFromNativeDllSearchDirectories(pDomain, currLibNameVariation, loadWithAlteredPathFlags, pErrorTracker);
+            if (hmod != NULL)
+                break;
+
+            hmod = LocalLoadLibraryHelper(currLibNameVariation, dllImportSearchPathFlag, pErrorTracker);
+            if (hmod != NULL)
+                break;
+        }
+    }
+#endif // FEATURE_PAL
+
     // After all this, if we have a handle add it to the cache.
     if (hmod)
     {
@@ -7187,7 +7252,6 @@ HINSTANCE NDirect::LoadLibraryModule( NDirectMethodDesc * pMD, LoadLibErrorTrack
     return hmod.Extract();
 }
 
-
 //---------------------------------------------------------
 // Loads the DLL and finds the procaddress for an N/Direct call.
 //---------------------------------------------------------
@@ -7386,7 +7450,7 @@ EXTERN_C LPVOID STDCALL NDirectImportWorker(NDirectMethodDesc* pMD)
             //
 
             if (!pMD->GetModule()->GetSecurityDescriptor()->CanCallUnmanagedCode())
-               Security::ThrowSecurityException(g_SecurityPermissionClassName, SPFLAGSUNMANAGEDCODE);
+                Security::ThrowSecurityException(g_SecurityPermissionClassName, SPFLAGSUNMANAGEDCODE);
 
             if (!pMD->IsZapped())
             {
@@ -7401,7 +7465,7 @@ EXTERN_C LPVOID STDCALL NDirectImportWorker(NDirectMethodDesc* pMD)
 
             pMD->CheckRestore();
 
-               NDirect::NDirectLink(pMD);
+            NDirect::NDirectLink(pMD);
         }
     }
 
index 5b87427..c8f662a 100644 (file)
@@ -80,7 +80,7 @@ public:
     static LPVOID NDirectGetEntryPoint(NDirectMethodDesc *pMD, HINSTANCE hMod);
     static HMODULE LoadLibraryFromPath(LPCWSTR libraryPath);
     static HINSTANCE LoadLibraryModule(NDirectMethodDesc * pMD, LoadLibErrorTracker *pErrorTracker);
-    
+
 #ifndef FEATURE_CORECLR
     static VOID CheckUnificationList(NDirectMethodDesc * pMD, DWORD * pDllImportSearchPathFlag, BOOL * pSearchAssemblyDirectory);
 #endif // !FEATURE_CORECLR
@@ -133,6 +133,9 @@ public:
 private:
     NDirect() {LIMITED_METHOD_CONTRACT;};     // prevent "new"'s on this class
 
+    static HMODULE LoadFromNativeDllSearchDirectories(AppDomain* pDomain, LPCWSTR libName, DWORD flags, LoadLibErrorTracker *pErrorTracker);
+    static HMODULE LoadFromPInvokeAssemblyDirectory(NDirectMethodDesc *pMD, LPCWSTR libName, DWORD flags, LoadLibErrorTracker *pErrorTracker);
+
 #if defined(FEATURE_HOST_ASSEMBLY_RESOLVER)
     static HMODULE LoadLibraryModuleViaHost(NDirectMethodDesc * pMD, AppDomain* pDomain, const wchar_t* wszLibName);
 #endif //defined(FEATURE_HOST_ASSEMBLY_RESOLVER)
index 0b0e45c..26bc4b9 100644 (file)
@@ -2086,6 +2086,13 @@ FCFuncStart(gWindowsRuntimeBufferHelperFuncs)
 FCFuncEnd()
 #endif // ifdef FEATURE_COMINTEROP
 
+#if defined(FEATURE_EVENTSOURCE_XPLAT)
+FCFuncStart(gEventLogger)
+    QCFuncElement("IsEventSourceLoggingEnabled", XplatEventSourceLogger::IsEventSourceLoggingEnabled)
+    QCFuncElement("LogEventSource", XplatEventSourceLogger::LogEventSource)
+FCFuncEnd()
+#endif // defined(FEATURE_EVENTSOURCE_XPLAT)
+
 #ifdef FEATURE_COMINTEROP
 FCFuncStart(gRuntimeClassFuncs)
     FCFuncElement("GetRedirectedGetHashCodeMD", ComObject::GetRedirectedGetHashCodeMD)
@@ -2479,6 +2486,9 @@ FCClassElement("WindowsRuntimeMetadata", "System.Runtime.InteropServices.Windows
 #ifdef FEATURE_X509
 FCClassElement("X509Utils", "System.Security.Cryptography.X509Certificates", gX509CertificateFuncs)
 #endif // FEATURE_X509
+#if defined(FEATURE_EVENTSOURCE_XPLAT)
+FCClassElement("XplatEventLogger", "System.Diagnostics.Tracing", gEventLogger)
+#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
 #ifdef FEATURE_CAS_POLICY
 FCClassElement("Zone", "System.Security.Policy", gCOMSecurityZone)
 #endif // FEATURE_CAS_POLICY
index 90dbf0b..0e09665 100644 (file)
@@ -7390,4 +7390,31 @@ VOID ETW::EnumerationLog::EnumerationHelper(Module *moduleFilter, BaseDomain *do
     }    
 }
 
+#if defined(FEATURE_EVENTSOURCE_XPLAT)
+
+void QCALLTYPE XplatEventSourceLogger::LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload)
+{
+    QCALL_CONTRACT;
+
+    BEGIN_QCALL;
+    FireEtwEventSource(eventID, eventName, eventSourceName, payload);
+    END_QCALL;
+}
+
+BOOL QCALLTYPE XplatEventSourceLogger::IsEventSourceLoggingEnabled()
+{
+    QCALL_CONTRACT;
+
+    BOOL retVal = FALSE;
+
+    BEGIN_QCALL;
+    retVal = XplatEventLogger::IsEventLoggingEnabled();
+    END_QCALL;
+    
+    return retVal;
+
+}
+
+#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
+
 #endif // !FEATURE_REDHAWK
index 93c71b7..191f0d3 100644 (file)
@@ -408,3 +408,14 @@ private:
 
 
 #endif // __EVENTTRACEPRIV_H__
+
+#if defined(FEATURE_EVENTSOURCE_XPLAT)
+class XplatEventSourceLogger
+{
+public:
+    static void QCALLTYPE LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload);
+
+    static BOOL QCALLTYPE IsEventSourceLoggingEnabled();
+};
+
+#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
index 4853991..d600f7c 100644 (file)
 #include "windowsruntimebufferhelper.h"
 #endif
 
-#endif // CROSSGEN_MSCORLIB
+#if defined(FEATURE_EVENTSOURCE_XPLAT)
 
+#define __EVENTTRACEPRIV_H__
+#include "eventtracepriv.h"
+#undef __EVENTTRACEPRIV_H__
+#endif //defined(FEATURE_EVENTSOURCE_XPLAT)
 
+#endif // CROSSGEN_MSCORLIB
 
 
 #ifdef CROSSGEN_MSCORLIB
index 5e4c05f..2be41fc 100644 (file)
@@ -328,16 +328,6 @@ GVAL_IMPL_INIT(DWORD, gAppDomainTLSIndex, TLS_OUT_OF_INDEXES);   // index ( (-1)
 
 #ifndef DACCESS_COMPILE
 #ifdef FEATURE_IMPLICIT_TLS
-EXTERN_C Thread* STDCALL GetThread()
-{
-    return gCurrentThreadInfo.m_pThread;
-}
-
-EXTERN_C AppDomain* STDCALL GetAppDomain()
-{
-    return gCurrentThreadInfo.m_pAppDomain;
-}
-
 BOOL SetThread(Thread* t)
 {
        LIMITED_METHOD_CONTRACT
index d3d3405..db47ce8 100644 (file)
 #include "appdomain.hpp"
 #include "frames.h"
 
+#ifndef DACCESS_COMPILE
+#ifdef FEATURE_IMPLICIT_TLS
+
+#ifndef __llvm__
+EXTERN_C __declspec(thread) ThreadLocalInfo gCurrentThreadInfo;
+#else // !__llvm__
+EXTERN_C __thread ThreadLocalInfo gCurrentThreadInfo;
+#endif // !__llvm__
+
+EXTERN_C inline Thread* STDCALL GetThread()
+{
+    return gCurrentThreadInfo.m_pThread;
+}
+
+EXTERN_C inline AppDomain* STDCALL GetAppDomain()
+{
+    return gCurrentThreadInfo.m_pAppDomain;
+}
+
+#endif // FEATURE_IMPLICIT_TLS
+#endif // !DACCESS_COMPILE
+
 #ifdef ENABLE_GET_THREAD_GENERIC_FULL_CHECK
 // See code:GetThreadGenericFullCheck
 inline /* static */ BOOL Thread::ShouldEnforceEEThreadNotRequiredContracts()
index 282e300..7d952b6 100644 (file)
@@ -1,5 +1,4 @@
 Interop/ICastable/Castable.sh
-Interop/ReversePInvoke/Marshalling/MarshalBoolArray.sh
 JIT/Directed/lifetime/lifetime2.sh
 JIT/Directed/newarr/newarr.sh
 JIT/Directed/PREFIX/unaligned/1/arglist.sh