coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bouncebuf.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for bouncebuf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bounce_buffer
 

Macros

#define GEN_BB_READ   (1 << 0)
 
#define GEN_BB_WRITE   (1 << 1)
 
#define GEN_BB_RW   (GEN_BB_READ | GEN_BB_WRITE)
 
#define DMA_MINALIGN   (64)
 
#define ROUND(a, b)   (((a) + (b) - 1) & ~((b) - 1))
 
#define ALLOC_CACHE_ALIGN_BUFFER(type, name, size)
 
#define ARCH_DMA_MINALIGN   (DMA_MINALIGN)
 

Functions

int bounce_buffer_start (struct bounce_buffer *state, void *data, size_t len, unsigned int flags)
 bounce_buffer_start() – Start the bounce buffer session state: stores state passed between bounce_buffer_{start,stop} data: pointer to buffer to be aligned len: length of the buffer flags: flags describing the transaction, see above. More...
 
int bounce_buffer_stop (struct bounce_buffer *state)
 bounce_buffer_stop() – Finish the bounce buffer session state: stores state passed between bounce_buffer_{start,stop} More...
 

Macro Definition Documentation

◆ ALLOC_CACHE_ALIGN_BUFFER

#define ALLOC_CACHE_ALIGN_BUFFER (   type,
  name,
  size 
)
Value:
char __##name[ROUND(size * sizeof(type), DMA_MINALIGN) + \
DMA_MINALIGN - 1]; \
const char * name
Definition: mmu.c:92
#define DMA_MINALIGN
Definition: bouncebuf.h:74
#define ROUND(a, b)
Definition: bouncebuf.h:75
#define ALIGN_UP(x, a)
Definition: helpers.h:17
unsigned int type
Definition: edid.c:57
unsigned long uintptr_t
Definition: stdint.h:21

Definition at line 76 of file bouncebuf.h.

◆ ARCH_DMA_MINALIGN

#define ARCH_DMA_MINALIGN   (DMA_MINALIGN)

Definition at line 81 of file bouncebuf.h.

◆ DMA_MINALIGN

#define DMA_MINALIGN   (64)

Definition at line 74 of file bouncebuf.h.

◆ GEN_BB_READ

#define GEN_BB_READ   (1 << 0)

Definition at line 20 of file bouncebuf.h.

◆ GEN_BB_RW

#define GEN_BB_RW   (GEN_BB_READ | GEN_BB_WRITE)

Definition at line 37 of file bouncebuf.h.

◆ GEN_BB_WRITE

#define GEN_BB_WRITE   (1 << 1)

Definition at line 28 of file bouncebuf.h.

◆ ROUND

#define ROUND (   a,
 
)    (((a) + (b) - 1) & ~((b) - 1))

Definition at line 75 of file bouncebuf.h.

Function Documentation

◆ bounce_buffer_start()

int bounce_buffer_start ( struct bounce_buffer state,
void data,
size_t  len,
unsigned int  flags 
)

bounce_buffer_start() – Start the bounce buffer session state: stores state passed between bounce_buffer_{start,stop} data: pointer to buffer to be aligned len: length of the buffer flags: flags describing the transaction, see above.

Definition at line 32 of file bouncebuf.c.

References addr_aligned(), ARCH_DMA_MINALIGN, dcache_clean_invalidate_by_mva, GEN_BB_READ, memalign(), memcpy(), and ROUND.

Referenced by sdhci_send_command().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bounce_buffer_stop()

int bounce_buffer_stop ( struct bounce_buffer state)

bounce_buffer_stop() – Finish the bounce buffer session state: stores state passed between bounce_buffer_{start,stop}

Definition at line 61 of file bouncebuf.c.

References dcache_invalidate_by_mva, free(), GEN_BB_WRITE, and memcpy().

Referenced by sdhci_send_command().

Here is the call graph for this function:
Here is the caller graph for this function: