all: $(BIN)\r
\r
clean:\r
- $(RM) $(BIN) $(OBJ)\r
+ $(RM) $(BIN) $(OBJ) $(DEPFILES)\r
\r
$(BIN): $(OBJ)\r
@echo [LINK] -o $@\r
@echo [CC] -o $@\r
@$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)\r
@$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(PLATFORM) $<\r
+\r
+-include $(DEPFILES)\r
tRequestHeader errorHeader;
int retSize = 0;
int sentSize;
+ int cur_client_id = 0;
#if USE_TCP
#else
while( Client->CurrentRequest == NULL )
SDL_CondWait(Client->WaitFlag, Client->Mutex);
+ if(Client->ClientID != cur_client_id) {
+ Threads_SetThread( Client->ClientID );
+ cur_client_id = Client->ClientID;
+ }
+
Log_Debug("AcessSrv", "Worker %i takes %p",
Client->ClientID, Client->CurrentRequest);
tRequestHeader *req = (void*)data;
struct sockaddr_in addr;
uint clientSize = sizeof(addr);
- int length = recvfrom(gSocket, data, BUFSIZ, 0, (struct sockaddr*)&addr, &clientSize);
+ int length;
tClient *client;
+ length = recvfrom(gSocket, data, BUFSIZ, 0, (struct sockaddr*)&addr, &clientSize);
+
if( length == -1 ) {
perror("SyscallServer - recv");
break;
all: $(BIN)
clean:
- $(RM) $(BIN) $(OBJ)
+ $(RM) $(BIN) $(OBJ) $(DEPFILES)
$(BIN): link.ld.$(PLATFORM) $(OBJ)
# $(LD) -g -o $@ $(OBJ) -T link.ld.$(PLATFORM)
@echo Making Linker Script ($@)
@$(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x0[08][0-9]*\b/0x00100000/g' > $@
+-include $(DEPFILES)
+
}
}
- // TODO: Search list of loaded binaries
+ // Search list of loaded binaries
for(bin = gLoadedBinaries; bin; bin = bin->Next)
{
if( !bin->Ready ) continue;
* Acess v0.1\r
* ELF Executable Loader Code\r
*/\r
-#define DEBUG 1\r
+#define DEBUG 0\r
#include <stdlib.h>\r
#include <stdio.h>\r
#include <string.h>\r
continue;\r
if( phtab[i].VAddr < base )\r
base = phtab[i].VAddr;\r
- if( phtab[i].VAddr > max )\r
- max = phtab[i].VAddr;\r
+ if( phtab[i].VAddr + phtab[i].MemSize > max )\r
+ max = phtab[i].VAddr + phtab[i].MemSize;\r
}\r
\r
LOG("base = %08x, max = %08x\n", base, max);\r
pBuckets = PTR(hdr->misc.HashTable);\r
symtab = PTR(hdr->misc.SymTable);\r
\r
+// LOG("Base = %p : pBuckets = %p, symtab = %p\n", Base, pBuckets, symtab);\r
+ \r
if(!pBuckets || !symtab)\r
return 0;\r
\r
size_t acess_write(int FD, size_t Bytes, void *Src) {
if(FD & NATIVE_FILE_MASK)
return fwrite( Src, Bytes, 1, gaSyscall_LocalFPs[FD & (NATIVE_FILE_MASK-1)] );
- DEBUG("write(0x%x, 0x%x, %p(\"%.*s\"))", FD, Bytes, Src, Bytes, (char*)Src);
+ DEBUG("write(0x%x, 0x%x, %p\"%.*s\")", FD, Bytes, Src, Bytes, (char*)Src);
return _Syscall(SYS_WRITE, ">i >i >d", FD, Bytes, Bytes, Src);
}
// --- Error Handler
int acess__SysSetFaultHandler(int (*Handler)(int)) {
+ printf("TODO: Set fault handler (asked to set to %p)\n", Handler);
return 0;
}