|
Modules | |
| Hugemem implementation for 8-bit AVR. | |
Defines | |
| #define | HUGEMEM_NULL 0 |
| Hugemem null pointer, similar to NULL, but works across different platforms. | |
Typedefs | |
| typedef uint32_t | hugemem_ptr_t |
| Type to use for pointers to huge memory. | |
Functions | |
| hugemem_ptr_t | hugemem_alloc (struct physmem_pool *pool, phys_size_t size, unsigned int align_order) |
| Allocate a region of huge memory. | |
| static uint_fast8_t | hugemem_read8 (const hugemem_ptr_t from) |
| Read 8-bit value stored at huge memory address from. | |
| uint_fast16_t | hugemem_read16 (const hugemem_ptr_t from) |
| Read 16-bit value stored at huge memory address from. | |
| uint_fast32_t | hugemem_read32 (const hugemem_ptr_t from) |
| Read 32-bit value stored at huge memory address from. | |
| static void | hugemem_write8 (hugemem_ptr_t to, uint_fast8_t val) |
| Write 8-bit value val to huge memory address to. | |
| void | hugemem_write16 (hugemem_ptr_t to, uint_fast16_t val) |
| Write 16-bit value val to huge memory address to. | |
| void | hugemem_write32 (hugemem_ptr_t to, uint_fast32_t val) |
| Write 32-bit value val to huge memory address to. | |
| void | hugemem_read_block (void *to, const hugemem_ptr_t from, size_t size) |
| Read size bytes from huge memory address from into buffer at address to. | |
| void | hugemem_write_block (hugemem_ptr_t to, const void *from, size_t size) |
| Write size bytes from buffer at address from to huge memory address to. | |
Due to shortcomings of the GCC compiler for 8-bit AVR, custom functions are needed for access to data beyond the 64 kB boundary, i.e., addresses that are larger than 16-bit.
The definition of huge memory space can differ between architectures, so the implementation is architecture specific.
This module supplies functions for copying a number of bytes between huge and 64 kB data memory space, and is needed solely for code compatibility across compilers.
| #define HUGEMEM_NULL 0 |
Hugemem null pointer, similar to NULL, but works across different platforms.
Definition at line 66 of file hugemem.h.
Referenced by app_fonts_load(), hugemem_alloc(), and tank_loader().
| hugemem_ptr_t hugemem_alloc | ( | struct physmem_pool * | pool, | |
| phys_size_t | size, | |||
| unsigned int | align_order | |||
| ) |
Allocate a region of huge memory.
This function tries to allocate a block of huge memory from the given pool, at the highest possible address.
| pool | The huge memory pool to allocate from. | |
| size | The number of bytes to allocate. | |
| align_order | log2 of required alignment. |
Definition at line 55 of file hugemem.c.
References HUGEMEM_NULL, physmem_alloc(), and PHYSMEM_ALLOC_ERR.
| uint_fast16_t hugemem_read16 | ( | const hugemem_ptr_t | from | ) |
Read 16-bit value stored at huge memory address from.
Definition at line 44 of file arch_hugemem.c.
References CPU_REG.
| uint_fast32_t hugemem_read32 | ( | const hugemem_ptr_t | from | ) |
Read 32-bit value stored at huge memory address from.
Definition at line 62 of file arch_hugemem.c.
References CPU_REG.
| uint_fast8_t hugemem_read8 | ( | const hugemem_ptr_t | from | ) | [inline, static] |
Read 8-bit value stored at huge memory address from.
Definition at line 68 of file hugemem.h.
References CPU_REG.
Referenced by gfx_copy_hugemem_pixels_to_screen().
| void hugemem_read_block | ( | void * | to, | |
| const hugemem_ptr_t | from, | |||
| size_t | size | |||
| ) |
Read size bytes from huge memory address from into buffer at address to.
Definition at line 82 of file arch_hugemem.c.
References assert, and CPU_REG.
Referenced by app_files_load_worker(), app_fonts_load_worker(), and gfx_draw_char_hugemem().
| void hugemem_write16 | ( | hugemem_ptr_t | to, | |
| uint_fast16_t | val | |||
| ) |
Write 16-bit value val to huge memory address to.
Definition at line 104 of file arch_hugemem.c.
References CPU_REG.
| void hugemem_write32 | ( | hugemem_ptr_t | to, | |
| uint_fast32_t | val | |||
| ) |
Write 32-bit value val to huge memory address to.
Definition at line 118 of file arch_hugemem.c.
References CPU_REG.
| void hugemem_write8 | ( | hugemem_ptr_t | to, | |
| uint_fast8_t | val | |||
| ) | [inline, static] |
| void hugemem_write_block | ( | hugemem_ptr_t | to, | |
| const void * | from, | |||
| size_t | size | |||
| ) |
Write size bytes from buffer at address from to huge memory address to.
Definition at line 134 of file arch_hugemem.c.
References assert, and CPU_REG.
Referenced by load_to_hugemem_worker().
1.6.3