Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: lib/Support/Unix/Memory.inc

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Support/Unix/Host.inc ('k') | lib/Support/Unix/Path.inc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- Unix/Memory.cpp - Generic UNIX System Configuration ------*- C++ -*-===// 1 //===- Unix/Memory.cpp - Generic UNIX System Configuration ------*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines some functions for various memory management utilities. 10 // This file defines some functions for various memory management utilities.
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 const intptr_t StartLine = ((intptr_t) Addr) & Mask; 326 const intptr_t StartLine = ((intptr_t) Addr) & Mask;
327 const intptr_t EndLine = ((intptr_t) Addr + Len + LineSize - 1) & Mask; 327 const intptr_t EndLine = ((intptr_t) Addr + Len + LineSize - 1) & Mask;
328 328
329 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) 329 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
330 asm volatile("dcbf 0, %0" : : "r"(Line)); 330 asm volatile("dcbf 0, %0" : : "r"(Line));
331 asm volatile("sync"); 331 asm volatile("sync");
332 332
333 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) 333 for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
334 asm volatile("icbi 0, %0" : : "r"(Line)); 334 asm volatile("icbi 0, %0" : : "r"(Line));
335 asm volatile("isync"); 335 asm volatile("isync");
336 // @LOCALMOD-START
337 # elif defined(__native_client__)
338 exit(1); // Native Client disallows JIT-compilation.
339 // @LOCALMOD-END
336 # elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__) 340 # elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__)
337 // FIXME: Can we safely always call this for __GNUC__ everywhere? 341 // FIXME: Can we safely always call this for __GNUC__ everywhere?
338 const char *Start = static_cast<const char *>(Addr); 342 const char *Start = static_cast<const char *>(Addr);
339 const char *End = Start + Len; 343 const char *End = Start + Len;
340 __clear_cache(const_cast<char *>(Start), const_cast<char *>(End)); 344 __clear_cache(const_cast<char *>(Start), const_cast<char *>(End));
341 # elif defined(__mips__) 345 # elif defined(__mips__)
342 const char *Start = static_cast<const char *>(Addr); 346 const char *Start = static_cast<const char *>(Addr);
343 # if defined(ANDROID) 347 # if defined(ANDROID)
344 // The declaration of "cacheflush" in Android bionic: 348 // The declaration of "cacheflush" in Android bionic:
345 // extern int cacheflush(long start, long end, long flags); 349 // extern int cacheflush(long start, long end, long flags);
346 const char *End = Start + Len; 350 const char *End = Start + Len;
347 long LStart = reinterpret_cast<long>(const_cast<char *>(Start)); 351 long LStart = reinterpret_cast<long>(const_cast<char *>(Start));
348 long LEnd = reinterpret_cast<long>(const_cast<char *>(End)); 352 long LEnd = reinterpret_cast<long>(const_cast<char *>(End));
349 cacheflush(LStart, LEnd, BCACHE); 353 cacheflush(LStart, LEnd, BCACHE);
350 # else 354 # else
351 cacheflush(const_cast<char *>(Start), Len, BCACHE); 355 cacheflush(const_cast<char *>(Start), Len, BCACHE);
352 # endif 356 # endif
353 # endif 357 # endif
354 358
355 #endif // end apple 359 #endif // end apple
356 360
357 ValgrindDiscardTranslations(Addr, Len); 361 ValgrindDiscardTranslations(Addr, Len);
358 } 362 }
359 363
360 } // namespace sys 364 } // namespace sys
361 } // namespace llvm 365 } // namespace llvm
OLDNEW
« no previous file with comments | « lib/Support/Unix/Host.inc ('k') | lib/Support/Unix/Path.inc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698