1 : // Copyright 2014 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #include "syzygy/agent/common/agent.h"
16 :
17 : #include <math.h>
18 :
19 : namespace agent {
20 : namespace common {
21 :
22 : // This is to ensure that we have our own version of the CRT so as not to
23 : // conflict with instrumented code.
24 : #ifdef _DLL
25 : #error Must be statically linked to the CRT.
26 : #endif
27 :
28 E : void InitializeCrt() {
29 : // Disable SSE2 instructions. This is to ensure that our instrumentation
30 : // doesn't inadvertently tinker with SSE2 registers via the CRT, causing
31 : // instrumented SSE2 enabled instructions to screw up.
32 E : const int kDisableSSE2 = 0;
33 E : _set_SSE2_enable(kDisableSSE2);
34 E : }
35 :
36 : } // namespace common
37 : } // namespace agent
|