Delete file meant for private branch
[official-gcc.git] / libsanitizer / asan / asan_mapping_myriad.h
blob6969e3a49310b05eda6fd179644fbfe1ef794654
1 //===-- asan_mapping_myriad.h -----------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of AddressSanitizer, an address sanity checker.
11 // Myriad-specific definitions for ASan memory mapping.
12 //===----------------------------------------------------------------------===//
13 #ifndef ASAN_MAPPING_MYRIAD_H
14 #define ASAN_MAPPING_MYRIAD_H
16 #define RAW_ADDR(mem) ((mem) & ~kMyriadCacheBitMask32)
17 #define MEM_TO_SHADOW(mem) \
18 (((RAW_ADDR(mem) - kLowMemBeg) >> SHADOW_SCALE) + (SHADOW_OFFSET))
20 #define kLowMemBeg kMyriadMemoryOffset32
21 #define kLowMemEnd (SHADOW_OFFSET - 1)
23 #define kLowShadowBeg SHADOW_OFFSET
24 #define kLowShadowEnd MEM_TO_SHADOW(kLowMemEnd)
26 #define kHighMemBeg 0
28 #define kHighShadowBeg 0
29 #define kHighShadowEnd 0
31 #define kMidShadowBeg 0
32 #define kMidShadowEnd 0
34 #define kShadowGapBeg (kLowShadowEnd + 1)
35 #define kShadowGapEnd kMyriadMemoryEnd32
37 #define kShadowGap2Beg 0
38 #define kShadowGap2End 0
40 #define kShadowGap3Beg 0
41 #define kShadowGap3End 0
43 namespace __asan {
45 static inline bool AddrIsInLowMem(uptr a) {
46 PROFILE_ASAN_MAPPING();
47 a = RAW_ADDR(a);
48 return a >= kLowMemBeg && a <= kLowMemEnd;
51 static inline bool AddrIsInLowShadow(uptr a) {
52 PROFILE_ASAN_MAPPING();
53 a = RAW_ADDR(a);
54 return a >= kLowShadowBeg && a <= kLowShadowEnd;
57 static inline bool AddrIsInMidMem(uptr a) {
58 PROFILE_ASAN_MAPPING();
59 return false;
62 static inline bool AddrIsInMidShadow(uptr a) {
63 PROFILE_ASAN_MAPPING();
64 return false;
67 static inline bool AddrIsInHighMem(uptr a) {
68 PROFILE_ASAN_MAPPING();
69 return false;
72 static inline bool AddrIsInHighShadow(uptr a) {
73 PROFILE_ASAN_MAPPING();
74 return false;
77 static inline bool AddrIsInShadowGap(uptr a) {
78 PROFILE_ASAN_MAPPING();
79 a = RAW_ADDR(a);
80 return a >= kShadowGapBeg && a <= kShadowGapEnd;
83 } // namespace __asan
85 #endif // ASAN_MAPPING_MYRIAD_H