00001
00002
00003
00004
00005 #ifndef _GEM_AES_P_
00006 # define _GEM_AES_P_
00007
00008 # ifndef _GEMLIB_H_
00009 # include "mt_gem.h"
00010 # endif
00011
00012
00013 #if defined(__GNUC_INLINE__) && (__GNUC__ > 2 || __GNUC_MINOR__ > 5)
00014
00015 static inline void
00016 _aes_trap (AESPB * aespb)
00017 {
00018 __asm__ volatile (
00019 "move.l %0,d1\n\t"
00020 "move.w #200,d0\n\t"
00021 "trap #2"
00022 :
00023 : "a"(aespb)
00024 : "d0","d1","memory"
00025 );
00026 }
00027 #define AES_TRAP(aespb) _aes_trap(&aespb)
00028
00029 #else
00030
00031 #define AES_TRAP(aespb) aes(&aespb)
00032
00033 #endif
00034
00035
00036 #define AES_PARAMS(a,b,c,d,e) \
00037 static short aes_control[AES_CTRLMAX]={a,b,c,d,e}; \
00038 short aes_intin[AES_INTINMAX]; \
00039 short aes_intout[AES_INTOUTMAX]; \
00040 long aes_addrin[AES_ADDRINMAX]; \
00041 long aes_addrout[AES_ADDROUTMAX]; \
00042 \
00043 AESPB aes_params; \
00044 aes_params.control = &aes_control[0]; \
00045 aes_params.global = &global_aes[0]; \
00046 aes_params.intin = &aes_intin[0]; \
00047 aes_params.intout = &aes_intout[0]; \
00048 aes_params.addrin = &aes_addrin[0]; \
00049 aes_params.addrout = &aes_addrout[0]
00050
00051
00052 #endif
00053
00054
00055
00056
00057
00058 #define CHECK_NULLPTR 1