Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/bus.h
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
#define BUS_SPACE_MAP_PREFETCHABLE 0x04 | #define BUS_SPACE_MAP_PREFETCHABLE 0x04 | ||||
#define BUS_SPACE_MAP_NONPOSTED 0x08 | #define BUS_SPACE_MAP_NONPOSTED 0x08 | ||||
#define BUS_SPACE_UNRESTRICTED (~0) | #define BUS_SPACE_UNRESTRICTED (~0) | ||||
#define BUS_SPACE_BARRIER_READ 0x01 | #define BUS_SPACE_BARRIER_READ 0x01 | ||||
#define BUS_SPACE_BARRIER_WRITE 0x02 | #define BUS_SPACE_BARRIER_WRITE 0x02 | ||||
#if defined(SAN_NEEDS_INTERCEPTORS) && !defined(SAN_RUNTIME) | |||||
#include <sys/bus_san.h> | |||||
#else | |||||
struct bus_space { | struct bus_space { | ||||
/* cookie */ | /* cookie */ | ||||
void *bs_cookie; | void *bs_cookie; | ||||
/* mapping/unmapping */ | /* mapping/unmapping */ | ||||
int (*bs_map) (void *, bus_addr_t, bus_size_t, | int (*bs_map) (void *, bus_addr_t, bus_size_t, | ||||
int, bus_space_handle_t *); | int, bus_space_handle_t *); | ||||
void (*bs_unmap) (void *, bus_space_handle_t, bus_size_t); | void (*bs_unmap) (void *, bus_space_handle_t, bus_size_t); | ||||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | struct bus_space { | ||||
int (*bs_poke_2)(void *, bus_space_handle_t, | int (*bs_poke_2)(void *, bus_space_handle_t, | ||||
bus_size_t, uint16_t); | bus_size_t, uint16_t); | ||||
int (*bs_poke_4)(void *, bus_space_handle_t, | int (*bs_poke_4)(void *, bus_space_handle_t, | ||||
bus_size_t, uint32_t); | bus_size_t, uint32_t); | ||||
int (*bs_poke_8)(void *, bus_space_handle_t, | int (*bs_poke_8)(void *, bus_space_handle_t, | ||||
bus_size_t, uint64_t); | bus_size_t, uint64_t); | ||||
}; | }; | ||||
#if defined(SAN_NEEDS_INTERCEPTORS) && !defined(SAN_RUNTIME) | |||||
#include <sys/bus_san.h> | |||||
#else | |||||
andrew: Can you split this out to a new review as we need it for other sanitizers, e.g. `KCSAN` | |||||
/* | /* | ||||
* Utility macros; INTERNAL USE ONLY. | * Utility macros; INTERNAL USE ONLY. | ||||
*/ | */ | ||||
#define __bs_c(a,b) __CONCAT(a,b) | #define __bs_c(a,b) __CONCAT(a,b) | ||||
#define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size) | #define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size) | ||||
#define __bs_rs(sz, t, h, o) \ | #define __bs_rs(sz, t, h, o) \ | ||||
(*(t)->__bs_opname(r,sz))((t)->bs_cookie, h, o) | (*(t)->__bs_opname(r,sz))((t)->bs_cookie, h, o) | ||||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | #define bus_space_set_multi_1(t, h, o, v, c) \ | ||||
__bs_set(sm,1,(t),(h),(o),(v),(c)) | __bs_set(sm,1,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_multi_2(t, h, o, v, c) \ | #define bus_space_set_multi_2(t, h, o, v, c) \ | ||||
__bs_set(sm,2,(t),(h),(o),(v),(c)) | __bs_set(sm,2,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_multi_4(t, h, o, v, c) \ | #define bus_space_set_multi_4(t, h, o, v, c) \ | ||||
__bs_set(sm,4,(t),(h),(o),(v),(c)) | __bs_set(sm,4,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_multi_8(t, h, o, v, c) \ | #define bus_space_set_multi_8(t, h, o, v, c) \ | ||||
__bs_set(sm,8,(t),(h),(o),(v),(c)) | __bs_set(sm,8,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_multi_stream_1(t, h, o, v, c) \ | |||||
bus_space_set_multi_1((t), (h), (o), (v), (c)) | |||||
#define bus_space_set_multi_stream_2(t, h, o, v, c) \ | |||||
bus_space_set_multi_2((t), (h), (o), (v), (c)) | |||||
#define bus_space_set_multi_stream_4(t, h, o, v, c) \ | |||||
bus_space_set_multi_4((t), (h), (o), (v), (c)) | |||||
#define bus_space_set_multi_stream_8(t, h, o, v, c) \ | |||||
bus_space_set_multi_8((t), (h), (o), (v), (c)) | |||||
/* | /* | ||||
* Set region operations. | * Set region operations. | ||||
*/ | */ | ||||
#define bus_space_set_region_1(t, h, o, v, c) \ | #define bus_space_set_region_1(t, h, o, v, c) \ | ||||
__bs_set(sr,1,(t),(h),(o),(v),(c)) | __bs_set(sr,1,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_region_2(t, h, o, v, c) \ | #define bus_space_set_region_2(t, h, o, v, c) \ | ||||
__bs_set(sr,2,(t),(h),(o),(v),(c)) | __bs_set(sr,2,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_region_4(t, h, o, v, c) \ | #define bus_space_set_region_4(t, h, o, v, c) \ | ||||
__bs_set(sr,4,(t),(h),(o),(v),(c)) | __bs_set(sr,4,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_region_8(t, h, o, v, c) \ | #define bus_space_set_region_8(t, h, o, v, c) \ | ||||
__bs_set(sr,8,(t),(h),(o),(v),(c)) | __bs_set(sr,8,(t),(h),(o),(v),(c)) | ||||
#define bus_space_set_region_stream_1(t, h, o, v, c) \ | |||||
bus_space_set_region_1((t), (h), (o), (v), (c)) | |||||
#define bus_space_set_region_stream_2(t, h, o, v, c) \ | |||||
bus_space_set_region_2((t), (h), (o), (v), (c)) | |||||
#define bus_space_set_region_stream_4(t, h, o, v, c) \ | |||||
bus_space_set_region_4((t), (h), (o), (v), (c)) | |||||
#define bus_space_set_region_stream_8(t, h, o, v, c) \ | |||||
bus_space_set_region_8((t), (h), (o), (v), (c)) | |||||
andrewUnsubmitted Done Inline ActionsCan you split the bus_space_set_multi_stream and bus_space_set_region_stream bits to a new review as they don't depend on KASAN andrew: Can you split the `bus_space_set_multi_stream` and `bus_space_set_region_stream` bits to a new… | |||||
/* | /* | ||||
* Copy operations. | * Copy operations. | ||||
*/ | */ | ||||
#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ | #define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ | ||||
__bs_copy(1, t, h1, o1, h2, o2, c) | __bs_copy(1, t, h1, o1, h2, o2, c) | ||||
#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ | #define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ | ||||
__bs_copy(2, t, h1, o1, h2, o2, c) | __bs_copy(2, t, h1, o1, h2, o2, c) | ||||
Show All 26 Lines |
Can you split this out to a new review as we need it for other sanitizers, e.g. KCSAN