MCPcopy Create free account
hub / github.com/coreboot/coreboot / addr_aligned

Function addr_aligned

src/commonlib/storage/bouncebuf.c:12–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include <commonlib/bsd/stdlib.h>
11
12static int addr_aligned(struct bounce_buffer *state)
13{
14 const uint32_t align_mask = ARCH_DMA_MINALIGN - 1;
15
16 // Check if start is aligned
17 if ((uintptr_t)state->user_buffer & align_mask) {
18 sdhc_debug("Unaligned buffer address %p\n", state->user_buffer);
19 return 0;
20 }
21
22 // Check if length is aligned
23 if (state->len != state->len_aligned) {
24 sdhc_debug("Unaligned buffer length %zd\n", state->len);
25 return 0;
26 }
27
28 // Aligned
29 return 1;
30}
31
32int bounce_buffer_start(struct bounce_buffer *state, void *data,
33 size_t len, unsigned int flags)

Callers 1

bounce_buffer_startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected