00001 00006 #ifndef _BINARY_H 00007 #define _BINARY_H 00008 00009 // === TYPES === 00017 typedef struct sBinaryPage 00018 { 00025 tPAddr Physical; 00026 tVAddr Virtual; 00027 Uint16 Size; 00028 Uint16 Flags; 00029 } __attribute__ ((packed)) tBinaryPage; 00030 00036 00037 #define BIN_PAGEFLAG_RO 0x0001 00038 00039 #define BIN_PAGEFLAG_EXEC 0x0002 00040 00060 typedef struct sBinary 00061 { 00062 struct sBinary *Next; 00063 00068 char *TruePath; 00073 char *Interpreter; 00077 Uint Entry; 00081 Uint Base; 00085 int ReferenceCount; 00089 int NumPages; 00094 tBinaryPage Pages[]; 00095 } tBinary; 00096 00106 typedef struct sBinaryType 00107 { 00112 struct sBinaryType *Next; 00119 Uint32 Ident; 00120 Uint32 Mask; 00121 char *Name; 00122 00131 tBinary *(*Load)(int FD); 00132 00146 int (*Relocate)(void *Base); 00147 00154 int (*GetSymbol)(void *Base, char *Name, Uint *Dest); 00155 } tBinaryType; 00156 00165 extern char *Binary_RegInterp(char *Path); 00166 00178 extern int Binary_RegisterType(tBinaryType *Type); 00179 00180 #endif