Provide better access to compiler optimisations for the raw scheduler

ugfx_release_2.6
inmarket 2015-07-08 13:53:54 +10:00
parent 9d62e631cf
commit 8318e8dc29
4 changed files with 24 additions and 9 deletions

View File

@ -40,6 +40,7 @@
// #define INTERRUPTS_ON() optional_code // #define INTERRUPTS_ON() optional_code
// Options that (should where relevant) apply to all operating systems // Options that (should where relevant) apply to all operating systems
// #define GFX_COMPILER GFX_COMPILER_UNKNOWN
// #define GFX_NO_OS_INIT FALSE // #define GFX_NO_OS_INIT FALSE
// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine // #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine // #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine

View File

@ -229,18 +229,19 @@ void gfxSleepMicroseconds(delaytime_t ms) {
* For those it doesn't - read the compiler manuals and the library source code to * For those it doesn't - read the compiler manuals and the library source code to
* work out the correct macro values. * work out the correct macro values.
* You can use the debugger to work out the values for your compiler and put them here. * You can use the debugger to work out the values for your compiler and put them here.
* Defining these macros as constant values makes the system behaviour guaranteed but also * Defining these macros as constant values makes the system behavior guaranteed but also
* makes your code compiler and cpu architecture dependant. * makes your code compiler and cpu architecture dependent. It also saves a heap of code
* and a few bytes of RAM.
*/ */
#if 0 #if GFX_COMPILER == GFX_COMPILER_MINGW32
// Define your compiler constant values here.
// These example values are for mingw32 compiler (x86).
#define AUTO_DETECT_MASK FALSE #define AUTO_DETECT_MASK FALSE
#define STACK_DIR_UP FALSE #define STACK_DIR_UP FALSE
#define MASK1 0x00000011 #define MASK1 0x00000011
#define MASK2 0x00000000 #define MASK2 0x00000000
#define STACK_BASE 12 #define STACK_BASE 12
#else #else
// Use auto-detection of the stack frame format
// Assumes all the relevant stuff to be relocated is in the first 256 bytes of the jmpbuf.
#define AUTO_DETECT_MASK TRUE #define AUTO_DETECT_MASK TRUE
#define STACK_DIR_UP stackdirup // TRUE if the stack grow up instead of down #define STACK_DIR_UP stackdirup // TRUE if the stack grow up instead of down
#define MASK1 jmpmask1 // The 1st mask of jmp_buf elements that need relocation #define MASK1 jmpmask1 // The 1st mask of jmp_buf elements that need relocation

View File

@ -82,6 +82,18 @@
* @name GOS Optional Parameters * @name GOS Optional Parameters
* @{ * @{
*/ */
/**
* @brief Enable compiler specific code
* @details Defaults to GFX_COMPILER_UNKNOWN
* @note This is setting enables optimisations that are compiler specific. It does
* not need to be specified as reasonable defaults and various auto-detection
* will happen as required.
*/
#ifndef GFX_COMPILER
#define GFX_COMPILER GFX_COMPILER_UNKNOWN
#endif
#define GFX_COMPILER_UNKNOWN 0 // Unknown compiler
#define GFX_COMPILER_MINGW32 1 // MingW32 (x86) compiler for windows
/** /**
* @brief Should uGFX avoid initializing the operating system * @brief Should uGFX avoid initializing the operating system
* @details Defaults to FALSE * @details Defaults to FALSE

View File

@ -438,17 +438,18 @@ void gfxSleepMicroseconds(delaytime_t ms) {
* work out the correct macro values. * work out the correct macro values.
* You can use the debugger to work out the values for your compiler and put them here. * You can use the debugger to work out the values for your compiler and put them here.
* Defining these macros as constant values makes the system behavior guaranteed but also * Defining these macros as constant values makes the system behavior guaranteed but also
* makes your code compiler and cpu architecture dependent. * makes your code compiler and cpu architecture dependent. It also saves a heap of code
* and a few bytes of RAM.
*/ */
#if 0 #if GFX_COMPILER == GFX_COMPILER_MINGW32
// Define your compiler constant values here.
// These example values are for mingw32 compiler (x86).
#define AUTO_DETECT_MASK FALSE #define AUTO_DETECT_MASK FALSE
#define STACK_DIR_UP FALSE #define STACK_DIR_UP FALSE
#define MASK1 0x00000011 #define MASK1 0x00000011
#define MASK2 0x00000000 #define MASK2 0x00000000
#define STACK_BASE 12 #define STACK_BASE 12
#else #else
// Use auto-detection of the stack frame format
// Assumes all the relevant stuff to be relocated is in the first 256 bytes of the jmpbuf.
#define AUTO_DETECT_MASK TRUE #define AUTO_DETECT_MASK TRUE
#define STACK_DIR_UP stackdirup // TRUE if the stack grow up instead of down #define STACK_DIR_UP stackdirup // TRUE if the stack grow up instead of down
#define MASK1 jmpmask1 // The 1st mask of jmp_buf elements that need relocation #define MASK1 jmpmask1 // The 1st mask of jmp_buf elements that need relocation