00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __sys_bitops_h__
00027 #define __sys_bitops_h__
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00034
00035
00036
00038
00039
00040
00041
00042 #if defined(CXX) || __GNUC__ >= 3
00043 # define ASMCONST
00044 #else
00045 # define ASMCONST const
00046 #endif
00047
00048
00049
00050
00051
00052
00053
00054
00055
00057
00059 #define bit_set(byte,bit) \
00060 __asm__ ASMCONST ( "bset %0,@%1\n" : : "i" (bit),"r" (byte))
00061
00063
00065 #define bit_clear(byte,bit) \
00066 __asm__ ASMCONST ( "bclr %0,@%1\n" : : "i" (bit),"r" (byte))
00067
00069
00071 #define bit_load(mask,bit) \
00072 __asm__ ASMCONST ( "bld %0,%1l\n" : : "i" (bit),"r" (mask):"cc")
00073
00075
00077 #define bit_iload(mask,bit) \
00078 __asm__ ASMCONST ( "bild %0,%1l\n" : : "i" (bit),"r" (mask):"cc")
00079
00081
00083 #define bit_store(byte,bit) \
00084 __asm__ ASMCONST ( "bst %0,@%1\n" : : "i" (bit),"r" (byte))
00085
00086 #ifdef __cplusplus
00087 }
00088 #endif
00089
00090 #endif // __sys_bitops_h__