X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2Fcommon.h;h=9f67e9c63d67e3df582612ab9f363073f957109b;hb=f595a692ef1efccef616b8600a0087e23d6066fe;hp=59be119f56421c3369666ee72b9167e5e39e1b4f;hpb=b8b25ae01e13c655608fb6705574e5218b1a519f;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/common.h b/AcessNative/ld-acess_src/common.h index 59be119f..9f67e9c6 100644 --- a/AcessNative/ld-acess_src/common.h +++ b/AcessNative/ld-acess_src/common.h @@ -8,18 +8,19 @@ #include #include -extern int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value); +extern int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value, size_t *Size); extern void *Binary_LoadLibrary(const char *Path); extern void *Binary_Load(const char *Path, uintptr_t *EntryPoint); extern void Binary_SetReadyToUse(void *Base); // HACKS - So this can share the usermode elf.c -static inline void *GetSymbol(const char*sym, size_t*sz) +static inline int GetSymbol(const char *sym, void **val, size_t *sz) { uintptr_t rv; - if( Binary_GetSymbol(sym, &rv) ) - return NULL; - return (void*)rv; + if( !Binary_GetSymbol(sym, &rv, sz) ) + return 0; + *val = (void*)rv; + return 1; } static inline void *LoadLibrary(const char *Name, const char *SearchPath, char **envp) { @@ -30,6 +31,12 @@ static inline void AddLoaded(const char *Path, void *Base) Binary_SetReadyToUse(Base); } +static inline int _SysSetMemFlags(uintptr_t Addr, unsigned int flags, unsigned int mask) +{ + return 0; +} + + extern int AllocateMemory(uintptr_t VirtAddr, size_t ByteCount); extern uintptr_t FindFreeRange(size_t ByteCount, int MaxBits); @@ -49,7 +56,7 @@ typedef struct sBinFmt { char *Name; void *(*Load)(int fd); uintptr_t (*Relocate)(void *base); - int (*GetSymbol)(void*,char*,uintptr_t*); + int (*GetSymbol)(void*,char*,uintptr_t*,size_t*); } tBinFmt; #endif