Lines Matching refs:uptr
20 DECLARE_REAL(void *, memset, void *dest, int c, uptr n)
21 DECLARE_REAL(void *, memcpy, void *dest, const void *src, uptr n)
22 DECLARE_REAL(void *, memmove, void *dest, const void *src, uptr n)
26 u32 GetOriginIfPoisoned(uptr addr, uptr size) { in GetOriginIfPoisoned()
28 for (uptr i = 0; i < size; ++i) in GetOriginIfPoisoned()
29 if (s[i]) return *(u32 *)SHADOW_TO_ORIGIN(((uptr)s + i) & ~3UL); in GetOriginIfPoisoned()
33 void SetOriginIfPoisoned(uptr addr, uptr src_shadow, uptr size, in SetOriginIfPoisoned()
35 uptr dst_s = MEM_TO_SHADOW(addr); in SetOriginIfPoisoned()
36 uptr src_s = src_shadow; in SetOriginIfPoisoned()
37 uptr src_s_end = src_s + size; in SetOriginIfPoisoned()
43 void CopyOrigin(const void *dst, const void *src, uptr size, in CopyOrigin()
47 uptr d = (uptr)dst; in CopyOrigin()
48 uptr beg = d & ~3UL; in CopyOrigin()
51 u32 o = GetOriginIfPoisoned((uptr)src, d - beg); in CopyOrigin()
59 uptr end = (d + size) & ~3UL; in CopyOrigin()
65 u32 o = GetOriginIfPoisoned((uptr)src + (end - d), (d + size) - end); in CopyOrigin()
74 uptr s = ((uptr)src + 3) & ~3UL; in CopyOrigin()
98 void MoveShadowAndOrigin(const void *dst, const void *src, uptr size, in MoveShadowAndOrigin()
103 REAL(memmove)((void *)MEM_TO_SHADOW((uptr)dst), in MoveShadowAndOrigin()
104 (void *)MEM_TO_SHADOW((uptr)src), size); in MoveShadowAndOrigin()
108 void CopyShadowAndOrigin(const void *dst, const void *src, uptr size, in CopyShadowAndOrigin()
112 REAL(memcpy)((void *)MEM_TO_SHADOW((uptr)dst), in CopyShadowAndOrigin()
113 (void *)MEM_TO_SHADOW((uptr)src), size); in CopyShadowAndOrigin()
117 void CopyMemory(void *dst, const void *src, uptr size, StackTrace *stack) { in CopyMemory()
122 void SetShadow(const void *ptr, uptr size, u8 value) { in SetShadow()
123 uptr PageSize = GetPageSizeCached(); in SetShadow()
124 uptr shadow_beg = MEM_TO_SHADOW(ptr); in SetShadow()
125 uptr shadow_end = shadow_beg + size; in SetShadow()
130 uptr page_beg = RoundUpTo(shadow_beg, PageSize); in SetShadow()
131 uptr page_end = RoundDownTo(shadow_end, PageSize); in SetShadow()
147 void SetOrigin(const void *dst, uptr size, u32 origin) { in SetOrigin()
151 uptr x = MEM_TO_ORIGIN((uptr)dst); in SetOrigin()
152 uptr beg = x & ~3UL; // align down. in SetOrigin()
153 uptr end = (x + size + 3) & ~3UL; // align up. in SetOrigin()
161 for (uptr addr = beg; addr < (end & ~7UL); addr += 8) *(u64 *)addr = origin64; in SetOrigin()
165 void PoisonMemory(const void *dst, uptr size, StackTrace *stack) { in PoisonMemory()