X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/f301a4a21f34bea6c41872258a9dab3263f04e2a..2efa79d3ec0630d6baf1cad13fc8f323d090da61:/LUFA/Common/Common.h diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index c2eeeade5..42662ef39 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -53,9 +53,7 @@ #define __LUFA_COMMON_H__ /* Macros: */ - #if !defined(__DOXYGEN__) - #define __INCLUDE_FROM_COMMON_H - #endif + #define __INCLUDE_FROM_COMMON_H /* Includes: */ #include @@ -82,9 +80,13 @@ typedef uint8_t uint_reg_t; - #define ARCH_LITTLE_ENDIAN + #define ARCH_HAS_EEPROM_ADDRESS_SPACE + #define ARCH_HAS_FLASH_ADDRESS_SPACE + #define ARCH_HAS_MULTI_ADDRESS_SPACE + #define ARCH_LITTLE_ENDIAN + #include "Endianness.h" - #elif (ARCH == ARCH_UC3B) + #elif (ARCH == ARCH_UC3) #include // === TODO: Find abstracted way to handle these === @@ -96,12 +98,12 @@ #define _delay_ms(x) #define memcmp_P(...) memcmp(__VA_ARGS__) #define memcpy_P(...) memcpy(__VA_ARGS__) - #define USE_RAM_DESCRIPTORS // ================================================== typedef uint32_t uint_reg_t; #define ARCH_BIG_ENDIAN + #include "Endianness.h" #else #error Unknown device architecture specified. @@ -214,6 +216,12 @@ */ #define GCC_FORCE_POINTER_ACCESS(StructPtr) __asm__ __volatile__("" : "=b" (StructPtr) : "0" (StructPtr)) + /** Forces GCC to create a memory barrier, ensuring that memory accesses are not reordered past the barrier point. + * This can be used before ordering-critical operations, to ensure that the compiler does not re-order the resulting + * assembly output in an unexpected manner on sections of code that are ordering-specific. + */ + #define GCC_MEMORY_BARRIER() __asm__ __volatile__("" ::: "memory"); + /* Inline Functions: */ /** Function to reverse the individual bits in a byte - i.e. bit 7 is moved to bit 0, bit 6 to bit 1, * etc.