git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2af6772
)
AcessNative - Loads login process and runs again (shell doesn't spawn)
author
John Hodge
<
[email protected]
>
Wed, 3 Oct 2012 14:16:42 +0000
(22:16 +0800)
committer
John Hodge
<
[email protected]
>
Wed, 3 Oct 2012 14:16:42 +0000
(22:16 +0800)
AcessNative/acesskernel_src/server.c
patch
|
blob
|
history
AcessNative/acesskernel_src/threads.c
patch
|
blob
|
history
AcessNative/ld-acess_src/exports.c
patch
|
blob
|
history
BuildConf/x86_64/Makefile.cfg
patch
|
blob
|
history
diff --git
a/AcessNative/acesskernel_src/server.c
b/AcessNative/acesskernel_src/server.c
index
02aa290
..
2f6b46f
100644
(file)
--- a/
AcessNative/acesskernel_src/server.c
+++ b/
AcessNative/acesskernel_src/server.c
@@
-127,8
+127,15
@@
tClient *Server_GetClient(int ClientID)
int Server_WorkerThread(void *ClientPtr)
{
tClient *Client = ClientPtr;
int Server_WorkerThread(void *ClientPtr)
{
tClient *Client = ClientPtr;
-
+
+ Log_Debug("Server", "Worker %p", ClientPtr);
+
#if USE_TCP
#if USE_TCP
+
+ while( *((volatile typeof(Client->Socket)*)&Client->Socket) == 0 )
+ SDL_Delay(10);
+ Threads_SetThread( Client->ClientID );
+
for( ;; )
{
fd_set fds;
for( ;; )
{
fd_set fds;
@@
-137,11
+144,12
@@
int Server_WorkerThread(void *ClientPtr)
FD_SET(Client->Socket, &fds);
int rv = select(nfd, &fds, NULL, NULL, NULL); // TODO: Timeouts?
FD_SET(Client->Socket, &fds);
int rv = select(nfd, &fds, NULL, NULL, NULL); // TODO: Timeouts?
- if(rv <
=
0) {
+ if(rv < 0) {
perror("select");
continue ;
}
perror("select");
continue ;
}
-
+ Log_Debug("Server", "%p: rv=%i", Client, rv);
+
if( FD_ISSET(Client->Socket, &fds) )
{
const int ciMaxParamCount = 6;
if( FD_ISSET(Client->Socket, &fds) )
{
const int ciMaxParamCount = 6;
@@
-275,6
+283,8
@@
int Server_WorkerThread(void *ClientPtr)
free( retHeader );
}
#endif
free( retHeader );
}
#endif
+ Log_Notice("Server", "Terminated Worker %p", ClientPtr);
+ return 0;
}
int SyscallServer(void)
}
int SyscallServer(void)
@@
-386,7
+396,7
@@
int Server_ListenThread(void *Unused)
client->Socket = clientSock;
}
}
client->Socket = clientSock;
}
}
- Log_Debug("Server", "Client given PID %i
", authhdr.pid
);
+ Log_Debug("Server", "Client given PID %i
- info %p", authhdr.pid, client
);
len = send(clientSock, &authhdr, sizeof(authhdr), 0);
if( len != sizeof(authhdr) ) {
len = send(clientSock, &authhdr, sizeof(authhdr), 0);
if( len != sizeof(authhdr) ) {
diff --git
a/AcessNative/acesskernel_src/threads.c
b/AcessNative/acesskernel_src/threads.c
index
a7aace8
..
c31c5d0
100644
(file)
--- a/
AcessNative/acesskernel_src/threads.c
+++ b/
AcessNative/acesskernel_src/threads.c
@@
-120,6
+120,9
@@
tThread *Threads_CloneTCB(tThread *TemplateThread)
ret->ThreadName = strdup(TemplateThread->ThreadName);
ret->EventSem = SDL_CreateSemaphore(0);
ret->ThreadName = strdup(TemplateThread->ThreadName);
ret->EventSem = SDL_CreateSemaphore(0);
+ if( !ret->EventSem ) {
+ Log_Warning("Threads", "Semaphore creation failed - %s", SDL_GetError());
+ }
ret->WaitingThreads = NULL;
ret->WaitingThreadsEnd = NULL;
ret->WaitingThreads = NULL;
ret->WaitingThreadsEnd = NULL;
@@
-373,12
+376,22
@@
Uint32 Threads_WaitEvents(Uint32 Mask)
gpCurrentThread->WaitMask = Mask;
if( !(gpCurrentThread->Events & Mask) )
{
gpCurrentThread->WaitMask = Mask;
if( !(gpCurrentThread->Events & Mask) )
{
- SDL_SemWait( gpCurrentThread->EventSem );
+ do {
+ if( SDL_SemWait( gpCurrentThread->EventSem ) == -1 ) {
+ Log_Warning("Threads", "Wait on eventsem of %p, %p failed",
+ gpCurrentThread, gpCurrentThread->EventSem);
+ break;
+ }
+ } while(SDL_SemValue(gpCurrentThread->EventSem));
+ // NOTE: While loop catches multiple event occurances
+ Log_Debug("Threads", "Woken from nap (%i here)", SDL_SemValue(gpCurrentThread->EventSem));
}
rv = gpCurrentThread->Events & Mask;
gpCurrentThread->Events &= ~Mask;
gpCurrentThread->WaitMask = -1;
}
rv = gpCurrentThread->Events & Mask;
gpCurrentThread->Events &= ~Mask;
gpCurrentThread->WaitMask = -1;
-
+
+ Log_Debug("Threads", "- rv = %x", rv);
+
return rv;
}
return rv;
}
diff --git
a/AcessNative/ld-acess_src/exports.c
b/AcessNative/ld-acess_src/exports.c
index
fc336c8
..
55606a8
100644
(file)
--- a/
AcessNative/ld-acess_src/exports.c
+++ b/
AcessNative/ld-acess_src/exports.c
@@
-35,6
+35,9
@@
extern int AllocateMemory(uintptr_t VirtAddr, size_t ByteCount);
// === CONSTANTS ===
#define NATIVE_FILE_MASK 0x40000000
// === CONSTANTS ===
#define NATIVE_FILE_MASK 0x40000000
+// === GLOBALS ===
+int acess__errno;
+
// === CODE ===
// --- VFS Calls
int acess_chdir(const char *Path)
// === CODE ===
// --- VFS Calls
int acess_chdir(const char *Path)
@@
-303,7
+306,7
@@
void acess__exit(int Status)
// === Symbol List ===
// === Symbol List ===
-#define DEFSYM(name) {#name, acess_##name}
+#define DEFSYM(name) {#name,
&
acess_##name}
const tSym caBuiltinSymbols[] = {
DEFSYM(_exit),
const tSym caBuiltinSymbols[] = {
DEFSYM(_exit),
@@
-339,7
+342,9
@@
const tSym caBuiltinSymbols[] = {
DEFSYM(_SysAllocate),
DEFSYM(_SysDebug),
DEFSYM(_SysSetFaultHandler),
DEFSYM(_SysAllocate),
DEFSYM(_SysDebug),
DEFSYM(_SysSetFaultHandler),
- DEFSYM(_SysWaitEvent)
+ DEFSYM(_SysWaitEvent),
+
+ DEFSYM(_errno)
};
const int ciNumBuiltinSymbols = sizeof(caBuiltinSymbols)/sizeof(caBuiltinSymbols[0]);
};
const int ciNumBuiltinSymbols = sizeof(caBuiltinSymbols)/sizeof(caBuiltinSymbols[0]);
diff --git
a/BuildConf/x86_64/Makefile.cfg
b/BuildConf/x86_64/Makefile.cfg
index
ebca2d9
..
6aa3afc
100644
(file)
--- a/
BuildConf/x86_64/Makefile.cfg
+++ b/
BuildConf/x86_64/Makefile.cfg
@@
-1,6
+1,6
@@
-
#
PREFIX := x86_64-pc-elf
-PREFIX := x86_64-none-elf
+PREFIX := x86_64-pc-elf
+
#
PREFIX := x86_64-none-elf
CC := $(PREFIX)-gcc
LD := $(PREFIX)-ld
CC := $(PREFIX)-gcc
LD := $(PREFIX)-ld
UCC
git Repository :: git.ucc.asn.au