OLD | NEW |
1 // Copyright 2014 Google Inc. All Rights Reserved. | 1 // Copyright 2014 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with 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 | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void asan_no_check(); | 133 void asan_no_check(); |
134 | 134 |
135 // The no-op string instruction memory access checker. | 135 // The no-op string instruction memory access checker. |
136 void asan_string_no_check(); | 136 void asan_string_no_check(); |
137 | 137 |
138 // The table containing the array of shadow memory references. This is made | 138 // The table containing the array of shadow memory references. This is made |
139 // visible so that it can be used by the memory interceptor patcher. The table | 139 // visible so that it can be used by the memory interceptor patcher. The table |
140 // itself will not be modified, but the pointers it points to will be. | 140 // itself will not be modified, but the pointers it points to will be. |
141 extern const void* asan_shadow_references[]; | 141 extern const void* asan_shadow_references[]; |
142 | 142 |
| 143 #ifndef _WIN64 |
143 #define DECLARE_MEM_INTERCEPT_FUNCTIONS(access_size, access_mode_str, \ | 144 #define DECLARE_MEM_INTERCEPT_FUNCTIONS(access_size, access_mode_str, \ |
144 access_mode_value) \ | 145 access_mode_value) \ |
145 void asan_redirect_##access_size##_byte_##access_mode_str(); \ | 146 void asan_redirect_##access_size##_byte_##access_mode_str(); \ |
146 void asan_check_##access_size##_byte_##access_mode_str##_2gb(); \ | 147 void asan_check_##access_size##_byte_##access_mode_str##_2gb(); \ |
147 void asan_check_##access_size##_byte_##access_mode_str##_4gb(); \ | 148 void asan_check_##access_size##_byte_##access_mode_str##_4gb(); \ |
148 void asan_redirect_##access_size##_byte_##access_mode_str##_no_flags(); \ | 149 void asan_redirect_##access_size##_byte_##access_mode_str##_no_flags(); \ |
149 void asan_check_##access_size##_byte_##access_mode_str##_no_flags_2gb(); \ | 150 void asan_check_##access_size##_byte_##access_mode_str##_no_flags_2gb(); \ |
150 void asan_check_##access_size##_byte_##access_mode_str##_no_flags_4gb(); | 151 void asan_check_##access_size##_byte_##access_mode_str##_no_flags_4gb(); |
151 | 152 |
152 // Declare all the memory interceptor functions. Note that these functions have | 153 // Declare all the memory interceptor functions. Note that these functions have |
153 // a custom calling convention, and can't be invoked directly. | 154 // a custom calling convention, and can't be invoked directly. |
154 ASAN_MEM_INTERCEPT_FUNCTIONS(DECLARE_MEM_INTERCEPT_FUNCTIONS) | 155 ASAN_MEM_INTERCEPT_FUNCTIONS(DECLARE_MEM_INTERCEPT_FUNCTIONS) |
155 | 156 |
156 #undef DECLARE_MEM_INTERCEPT_FUNCTIONS | 157 #undef DECLARE_MEM_INTERCEPT_FUNCTIONS |
157 | 158 |
158 #define DECLARE_STRING_INTERCEPT_FUNCTIONS(func, prefix, counter, dst_mode, \ | 159 #define DECLARE_STRING_INTERCEPT_FUNCTIONS(func, prefix, counter, dst_mode, \ |
159 src_mode, access_size, compare) \ | 160 src_mode, access_size, compare) \ |
160 void asan_redirect ## prefix ## access_size ## _byte_ ## func ## _access(); \ | 161 void asan_redirect ## prefix ## access_size ## _byte_ ## func ## _access(); \ |
161 void asan_check ## prefix ## access_size ## _byte_ ## func ## _access(); \ | 162 void asan_check ## prefix ## access_size ## _byte_ ## func ## _access(); \ |
162 | 163 |
163 // Declare all the string instruction interceptor functions. Note that these | 164 // Declare all the string instruction interceptor functions. Note that these |
164 // functions have a custom calling convention, and can't be invoked directly. | 165 // functions have a custom calling convention, and can't be invoked directly. |
165 ASAN_STRING_INTERCEPT_FUNCTIONS(DECLARE_STRING_INTERCEPT_FUNCTIONS) | 166 ASAN_STRING_INTERCEPT_FUNCTIONS(DECLARE_STRING_INTERCEPT_FUNCTIONS) |
166 | 167 |
167 #undef DECLARE_STRING_INTERCEPT_FUNCTIONS | 168 #undef DECLARE_STRING_INTERCEPT_FUNCTIONS |
| 169 #endif |
168 | 170 |
169 } // extern "C" | 171 } // extern "C" |
170 | 172 |
171 #endif // SYZYGY_AGENT_ASAN_MEMORY_INTERCEPTORS_H_ | 173 #endif // SYZYGY_AGENT_ASAN_MEMORY_INTERCEPTORS_H_ |
OLD | NEW |