ISF  1.1
Intelligent Sensing Framework
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Include/psp/coldfire_inline.h
Go to the documentation of this file.
00001 /*
00002  * 
00003  * Copyright (c) 2012, Freescale Semiconductor, Inc.
00004  * 
00005 */
00006 
00007 /*!
00008  * @file coldfire_inline.h
00009  * @brief Coldfire specific instruction header file.
00010  * 
00011  */
00012 
00013 #ifndef COLDFIRE_INLINE_H_
00014 #define COLDFIRE_INLINE_H_
00015 
00016 
00017 #include "psp_cpudef.h"
00018 
00019 
00020 #if PSP_MQX_CPU_IS_COLDFIRE
00021 
00022 // Find the first bit that is set in a 32 bit register
00023 __declspec(register_abi) inline asm uint_32 ff1(uint_32 bits) {
00024     ff1.l d0
00025 }
00026 // Find the first bit that is set in a 32 bit register
00027 __declspec(register_abi) inline asm uint_32 bitrev(uint_32 bits) {
00028     bitrev.l d0
00029 }
00030 
00031 #define ENABLE_INTERRUPTS asm { move.w SR,D0; andi.l #0xF8FF,D0; move.w D0,SR;  }
00032   /*!< Macro to enable all interrupts. */
00033 
00034 #define DISABLE_INTERRUPTS asm { move.w SR,D0; ori.l #0x0700,D0; move.w D0,SR;  }
00035   /*!< Macro to disable all interrupts. */
00036 
00037 #endif
00038 
00039 
00040 
00041 #endif /* COLDFIRE_INLINE_H_ */