OSDN Git Service

2015/03/04 05:44
authorKoine Yuusuke(koinec) <koinec@users.sourceforge.jp>
Tue, 3 Mar 2015 20:51:10 +0000 (05:51 +0900)
committerKoine Yuusuke(koinec) <koinec@users.sourceforge.jp>
Tue, 3 Mar 2015 20:51:10 +0000 (05:51 +0900)
 * [libintel64asm] Initial Support for FreeBSD clang (Implicit Declaration Function Warning)

17 files changed:
libintel64asm/drd64_intel64.h
libintel64asm/drd64_intel64_asm.c
libintel64asm/drd64_intel64_asm_system.c
libintel64asm/drd64_intel64_asm_system.h
libintel64asm/drd64_intel64_common.c
libintel64asm/drd64_intel64_common.h
libintel64asm/drd64_intel64_db.c
libintel64asm/drd64_intel64_db.h
libintel64asm/drd64_intel64_dbcommon.c
libintel64asm/drd64_intel64_dbcommon.h
libintel64asm/drd64_intel64_dbfile.h
libintel64asm/drd64_intel64_debug.c
libintel64asm/drd64_intel64_disasm.c
libintel64asm/drd64_intel64_disasm.h
libintel64asm/drd64_intel64_error.c
libintel64asm/drd64_intel64_error.h
libintel64asm/test.asm

index bd50456..8d6f870 100644 (file)
@@ -39,6 +39,17 @@ DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
 
 #include"../include/drd64_types.h"
 
+#include"drd64_intel64_dbtype.h"
+#include"drd64_intel64_disasm.h"
+#include"drd64_intel64_db.h"
+#include"drd64_intel64_dbfile.h"
+#include"drd64_intel64_dbcommon.h"
+#include"drd64_intel64_common.h"
+#include"drd64_intel64_asm.h"
+#include"drd64_intel64_asm_system.h"
+#include"drd64_intel64_error.h"
+
+
 #define isBitFlag(m,n)  (((unsigned int)(((unsigned int)(m))&((unsigned int)(n))))==(n))
 
 
index d79421c..8c54a75 100644 (file)
@@ -35,11 +35,6 @@ Comment:  none
 ----------------------------------------------------------------------*/
 
 #include"drd64_intel64.h"
-#include"drd64_intel64_dbtype.h"
-#include"drd64_intel64_db.h"
-#include"drd64_intel64_asm.h"
-#include"drd64_intel64_disasm.h"
-#include"drd64_intel64_asm_system.h"
 #define DRD64_SRC_LIBINTEL64ASM_FUNC
 #include"../include/libintel64asm.h"
 
index 8695fef..ffb1c3b 100644 (file)
@@ -34,12 +34,8 @@ Function: Intel64 Line Assembler System Functions (Init./Term./etc)
 Comment:  none
 ----------------------------------------------------------------------*/
 
-#include"drd64_intel64.h"
-#include"drd64_intel64_dbtype.h"
-#include"drd64_intel64_asm.h"
-#include"drd64_intel64_disasm.h"
 #define DRD64_SRC_INTEL64_ASM_SYSTEM
-#include"drd64_intel64_asm_system.h"
+#include"drd64_intel64.h"
 
 static Drd64_Intel64_OperandNode       *pp_operandnode_base;
 static int                                                     i_operandnode_nums;
@@ -47,7 +43,8 @@ static        int                                                     i_operandnode_nums;
 
 /*----------------------------------------------------------------------
 ----------------------------------------------------------------------*/
-EXTERN int
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+int
        Drd64_Intel64_InitAssembleSystem(
                void)
 {
@@ -68,7 +65,8 @@ EXTERN int
 
 /*----------------------------------------------------------------------
 ----------------------------------------------------------------------*/
-EXTERN int
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+int
        Drd64_Intel64_TermAssembleSystem(
                void)
 {
@@ -83,7 +81,8 @@ EXTERN int
 
 /*----------------------------------------------------------------------
 ----------------------------------------------------------------------*/
-EXTERN Drd64_Intel64_OperandNode       *
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+Drd64_Intel64_OperandNode      *
        Drd64_Intel64_AllocOperandNode(
                void )
 {
@@ -105,7 +104,8 @@ EXTERN Drd64_Intel64_OperandNode    *
 
 /*----------------------------------------------------------------------
 ----------------------------------------------------------------------*/
-EXTERN int
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+int
        Drd64_Intel64_ResetOperandNode_Memory(
                void )
 {
index 00c3a28..c9d80ca 100644 (file)
@@ -35,28 +35,22 @@ Comment: none
 ----------------------------------------------------------------------*/
 
 #ifndef DRD64_HEADER_INTEL64_ASM_SYSTEM
+#define DRD64_HEADER_INTEL64_ASM_SYSTEM
 
 #ifndef DRD64_SRC_INTEL64_ASM_SYSTEM
-       #define EXTERN  extern
+       #define DRD64_INTEL64_ASM_SYSTEM_EXTERN extern
 #else
-       #define EXTERN
+       #define DRD64_INTEL64_ASM_SYSTEM_EXTERN
 #endif
 
-EXTERN int
-       Drd64_Intel64_InitAssembleSystem(
-               void);
-
-EXTERN int
-       Drd64_Intel64_TermAssembleSystem(
-               void);
-
-EXTERN Drd64_Intel64_OperandNode   *
-    Drd64_Intel64_AllocOperandNode(
-        void);
-
-EXTERN int
-    Drd64_Intel64_ResetOperandNode_Memory(
-        void);
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+       int Drd64_Intel64_InitAssembleSystem(void);
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+       int Drd64_Intel64_TermAssembleSystem(void);
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+       Drd64_Intel64_OperandNode *Drd64_Intel64_AllocOperandNode(void);
+DRD64_INTEL64_ASM_SYSTEM_EXTERN
+       int Drd64_Intel64_ResetOperandNode_Memory(void);
 
 #endif /* DRD64_HEADER_XXX */
 
index 8a0ef04..d46893f 100644 (file)
@@ -34,12 +34,12 @@ Function: Intel64 DisAsm/Asm Common Functions
 Comment: none
 ----------------------------------------------------------------------*/
 
-#include"drd64_intel64.h"
 #define        DRD64_SRC_INTEL64_COMMON
+#include"drd64_intel64.h"
 #include"drd64_intel64_common.h"
 
 /*----------------------------------------------------------------------
-static int
+int
     Drd64_DisAsmIntel64_ExtendValueBit(
         : Extend Value to Bits
 
@@ -47,7 +47,7 @@ static int
         int i_bit,          : [opt] bits
         int i_flag_sign)    : [opt] Flag Sign
 ----------------------------------------------------------------------*/
-EXTERN int
+DRD64_INTEL64_COMMON_EXTERN int
     Drd64_Intel64_Common_ExtendValueBit(
         Value *p_val,
         int i_bit,
index 35af802..77681ff 100644 (file)
@@ -35,18 +35,17 @@ Comment: none
 ----------------------------------------------------------------------*/
 
 #ifndef DRD64_HEADER_INTEL64_COMMON
+#define DRD64_HEADER_INTEL64_COMMON
 
 #ifndef DRD64_SRC_INTEL64_COMMON
-       #define EXTERN  extern
+       #define DRD64_INTEL64_COMMON_EXTERN     extern
 #else
-       #define EXTERN
+       #define DRD64_INTEL64_COMMON_EXTERN
 #endif
 
-EXTERN int
-    Drd64_Intel64_Common_ExtendValueBit(
-        Value *p_val,
-        int i_bit,
-        int i_flag_sign);
+DRD64_INTEL64_COMMON_EXTERN
+       int Drd64_Intel64_Common_ExtendValueBit(
+                       Value *p_val, int i_bit, int i_flag_sign);
 
 #endif /* DRD64_HEADER_XXX */
 
index 286571e..75255e7 100644 (file)
@@ -34,13 +34,8 @@ Function: INTEL64 Assembler DataBase
 Comment: none
 ----------------------------------------------------------------------*/
 
+#define        DRD64_SRC_INTEL64_DB
 #include"drd64_intel64.h"
-#include"drd64_intel64_dbtype.h"
-#include"drd64_intel64_db.h"
-#include"drd64_intel64_dbfile.h"
-#include"drd64_intel64_asm.h"
-#include"drd64_intel64_disasm.h"
-#include"drd64_intel64_dbcommon.h"
 
 /* Make Hash Table */
 /* Access & Search Function */
@@ -372,6 +367,7 @@ int
                int i_maxstr )          : Dest. Buf. Max Size
 
 -----------------------------------------------------------------------*/
+DRD64_INTEL64_DB_EXTERN
 int
        Drd64_Intel64db_GetRegisterString(
                Byte *p_regstr,
@@ -1107,6 +1103,7 @@ Byte
                Drd64_Intel64_AnalyzePacket *p_analyze) 
                        : [Dest][Src] Analyze Packet
 -----------------------------------------------------------------------*/
+DRD64_INTEL64_DB_EXTERN
 Byte
        Drd64_Intel64db_GetByteCodeType(
                Drd64_Intel64_AnalyzePacket *p_analyze)
@@ -1166,6 +1163,7 @@ Byte
                Byte b_bits)    : [opt] Judge Bit Mode (32/64)
 
 -----------------------------------------------------------------------*/
+DRD64_INTEL64_DB_EXTERN
 Byte
        Drd64_Intel64db_GetBytePrefixType(
                Byte b_code,
index b6b6acf..96b23b9 100644 (file)
@@ -38,10 +38,6 @@ Comment: none
 #ifndef DRD64_HEADER_INTEL64_DB
 #define DRD64_HEADER_INTEL64_DB
 
-#include"drd64_intel64.h"
-#include"drd64_intel64_dbtype.h"
-
-
 typedef struct {
        int             i_num;
        Byte    b_prefix;
@@ -70,6 +66,16 @@ typedef struct {
        Byte    b_hash;
 } Drd64_Intel64db_Record;
 
+#ifdef DRD64_SRC_INTEL64_DB
+       #define DRD64_INTEL64_DB_EXTERN
+#else
+       #define DRD64_INTEL64_DB_EXTERN extern
+#endif
+DRD64_INTEL64_DB_EXTERN
+       int     Drd64_Intel64db_GetRegisterString( Byte *p_regstr, Word w_regid, int i_maxstr );
+DRD64_INTEL64_DB_EXTERN
+       Byte Drd64_Intel64db_GetByteCodeType( Drd64_Intel64_AnalyzePacket *p_analyze);
+
 
 #endif /* DRD64_HEADER_INTEL64_DB */
 
index 7c4a0a8..e65fd70 100644 (file)
@@ -34,19 +34,15 @@ Function: Intel64 DataBase Common Functions
 Comment:  none
 ----------------------------------------------------------------------*/
 
-#include"drd64_intel64.h"
-#include"drd64_intel64_dbtype.h"
-#include"drd64_intel64_dbfile.h"
 #define        DRD64_SRC_INTEL64_DBCOMMON
-#include"drd64_intel64_dbcommon.h"
-#include"drd64_intel64_db.h"
+#include"drd64_intel64.h"
 
 /*----------------------------------------------------------------------
 int
     Drd64_Intel64_DBCommon_CalcHashValue(
         char    *pstr_value )
 ----------------------------------------------------------------------*/
-EXTERN int
+DRD64_INTEL64_DBCOMMON_EXTERN int
     Drd64_Intel64_DBCommon_CalcHashValue(
         char    *pstr_value )
 {
index 363ece4..9035c23 100644 (file)
@@ -15,14 +15,13 @@ Comment:
 #ifndef DRD64_HEADER_INTEL64_DBCOMMON
 
 #ifndef DRD64_SRC_INTEL64_DBCOMMON
-       #define EXTERN  extern
+       #define DRD64_INTEL64_DBCOMMON_EXTERN   extern
 #else
-       #define EXTERN
+       #define DRD64_INTEL64_DBCOMMON_EXTERN
 #endif
 
-EXTERN int
-    Drd64_Intel64_DBCommon_CalcHashValue(
-        char    *pstr_value );
+DRD64_INTEL64_DBCOMMON_EXTERN
+       int Drd64_Intel64_DBCommon_CalcHashValue(char *pstr_value );
 
 #endif /* DRD64_HEADER_XXX */
 
index 4d51205..e86345a 100644 (file)
@@ -39,7 +39,6 @@ Comment:  none
 #define DRD64_HEADER_INTEL64DBFILE
 
 #include"drd64_intel64.h"
-#include"drd64_intel64_db.h"
 
 #define        DRD64_INTEL64DB_HASH_MUL        137
 #define        DRD64_INTEL64DB_HASH_RADIX      69
index 59eadd3..a16e67e 100644 (file)
@@ -34,11 +34,8 @@ Function: Intel64 DisAsm/Asm Debug Fucntions
 Comment:  none
 ----------------------------------------------------------------------*/
 
-#include"drd64_intel64.h"
-#include"drd64_intel64_dbtype.h"
-#include"drd64_intel64_asm.h"
-#include"drd64_intel64_disasm.h"
 #define DRD64_SRC_LIBINTEL64ASM_FUNC
+#include"drd64_intel64.h"
 #include"../include/libintel64asm.h"
 
 
index e7f617d..aded609 100644 (file)
@@ -35,10 +35,6 @@ Comment: none
 ----------------------------------------------------------------------*/
 
 #include"drd64_intel64.h"
-#include"drd64_intel64_disasm.h"
-#include"drd64_intel64_dbtype.h"
-#include"drd64_intel64_db.h"
-#include"drd64_intel64_common.h"
 /*#include"drd64_intel64_debug.h"*/
 #define        DRD64_SRC_LIBINTEL64ASM_FUNC
 #include"../include/libintel64asm.h"
index d264b41..eff12ae 100644 (file)
@@ -37,10 +37,6 @@ Comment:  none
 #ifndef DRD64_HEADER_INTEL64_DISASM
 #define DRD64_HEADER_INTEL64_DISASM
 
-#include"drd64_intel64_dbtype.h"
-#include"drd64_intel64_db.h"
-#include"drd64_intel64_asm.h"
-
 typedef struct {
        unsigned        rm              : 3;
        unsigned        reg             : 3;
index 9580429..764c344 100644 (file)
@@ -34,9 +34,8 @@ Function:
 Comment: 
 ----------------------------------------------------------------------*/
 
-#include"drd64_intel64.h"
 #define DRD64_SRC_INTEL64_ERROR
-#include"drd64_intel64_error.h"
+#include"drd64_intel64.h"
 
 Drd64_Intel64_ErrorUnion       drd64_error;
 
index f50123a..af88e75 100644 (file)
@@ -38,9 +38,9 @@ Comment: none
 #define DRD64_HEADER_INTEL64_ERROR
 
 #ifndef DRD64_SRC_INTEL64_ERROR
-       #define EXTERN  extern
+       #define DRD64_INTEL64_ERROR_EXTERN      extern
 #else
-       #define EXTERN
+       #define DRD64_INTEL64_ERROR_EXTERN
 #endif
 
 typedef struct {
index d2511b9..a7ba34b 100644 (file)
@@ -10,7 +10,7 @@ BITS 64
        push    rax
        cmp             rax,rbx
        jb              02h
-       sldt    [rbx+02h]       
+       sldt    word [rbx+02h]  
        psrlq   mm0, 03h
        movq    mm1,mm0
        movd    mm0,[rcx+04h]
@@ -37,7 +37,7 @@ BITS 64
                
        mov             cr2, rsi
        mov             dr3, r11
-       sldt    [ebx*8+esp+02h] 
+       sldt    word [ebx*8+esp+02h]    
        movd    mm0,[ecx+04h]
        movsd   xmm0, [edx+ebx+12h]
        lss             eax, [12345678h]