Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_asan.c
Show All 38 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/asan.h> | #include <sys/asan.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/stack.h> | #include <sys/stack.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <machine/asan.h> | #include <machine/asan.h> | ||||
#include <machine/bus.h> | |||||
/* ASAN constants. Part of the compiler ABI. */ | /* ASAN constants. Part of the compiler ABI. */ | ||||
#define KASAN_SHADOW_MASK (KASAN_SHADOW_SCALE - 1) | #define KASAN_SHADOW_MASK (KASAN_SHADOW_SCALE - 1) | ||||
#define KASAN_ALLOCA_SCALE_SIZE 32 | #define KASAN_ALLOCA_SCALE_SIZE 32 | ||||
/* ASAN ABI version. */ | /* ASAN ABI version. */ | ||||
#if defined(__clang__) && (__clang_major__ - 0 >= 6) | #if defined(__clang__) && (__clang_major__ - 0 >= 6) | ||||
#define ASAN_ABI_VERSION 8 | #define ASAN_ABI_VERSION 8 | ||||
▲ Show 20 Lines • Show All 956 Lines • ▼ Show 20 Lines | |||||
ASAN_BUS_SET_FUNC(region, 2, uint16_t) | ASAN_BUS_SET_FUNC(region, 2, uint16_t) | ||||
ASAN_BUS_SET_FUNC(multi_stream, 2, uint16_t) | ASAN_BUS_SET_FUNC(multi_stream, 2, uint16_t) | ||||
ASAN_BUS_SET_FUNC(region_stream, 2, uint16_t) | ASAN_BUS_SET_FUNC(region_stream, 2, uint16_t) | ||||
ASAN_BUS_SET_FUNC(multi, 4, uint32_t) | ASAN_BUS_SET_FUNC(multi, 4, uint32_t) | ||||
ASAN_BUS_SET_FUNC(region, 4, uint32_t) | ASAN_BUS_SET_FUNC(region, 4, uint32_t) | ||||
ASAN_BUS_SET_FUNC(multi_stream, 4, uint32_t) | ASAN_BUS_SET_FUNC(multi_stream, 4, uint32_t) | ||||
ASAN_BUS_SET_FUNC(region_stream, 4, uint32_t) | ASAN_BUS_SET_FUNC(region_stream, 4, uint32_t) | ||||
#define ASAN_BUS_PEEK_FUNC(width, type) \ | |||||
int kasan_bus_space_peek_##width(bus_space_tag_t tag, \ | |||||
bus_space_handle_t hnd, bus_size_t offset, type *valuep) \ | |||||
{ \ | |||||
return (bus_space_peek_##width(tag, hnd, offset, \ | |||||
valuep)); \ | |||||
} | |||||
ASAN_BUS_PEEK_FUNC(1, uint8_t) | |||||
ASAN_BUS_PEEK_FUNC(2, uint16_t) | |||||
ASAN_BUS_PEEK_FUNC(4, uint32_t) | |||||
ASAN_BUS_PEEK_FUNC(8, uint64_t) | |||||
#define ASAN_BUS_POKE_FUNC(width, type) \ | |||||
int kasan_bus_space_poke_##width(bus_space_tag_t tag, \ | |||||
bus_space_handle_t hnd, bus_size_t offset, type value) \ | |||||
{ \ | |||||
return (bus_space_poke_##width(tag, hnd, offset, \ | |||||
value)); \ | |||||
} | |||||
ASAN_BUS_POKE_FUNC(1, uint8_t) | |||||
ASAN_BUS_POKE_FUNC(2, uint16_t) | |||||
ASAN_BUS_POKE_FUNC(4, uint32_t) | |||||
ASAN_BUS_POKE_FUNC(8, uint64_t) | |||||
/* -------------------------------------------------------------------------- */ | /* -------------------------------------------------------------------------- */ | ||||
void __asan_register_globals(struct __asan_global *, size_t); | void __asan_register_globals(struct __asan_global *, size_t); | ||||
void __asan_unregister_globals(struct __asan_global *, size_t); | void __asan_unregister_globals(struct __asan_global *, size_t); | ||||
void | void | ||||
__asan_register_globals(struct __asan_global *globals, size_t n) | __asan_register_globals(struct __asan_global *globals, size_t n) | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |