Remove dead non retroarch platforms, prepare for second memcard
[pcsx_rearmed.git] / frontend / 3ds / pthread.h
index 836f4cb..2c2bf6b 100644 (file)
@@ -2,38 +2,29 @@
 #ifndef _3DS_PTHREAD_WRAP__
 #define _3DS_PTHREAD_WRAP__
 
-#include "3ds.h"
-#include "stdlib.h"
-#include "string.h"
-#include "stdio.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
 
+#include "3ds_utils.h"
 
 #define CTR_PTHREAD_STACK_SIZE 0x10000
 
 typedef struct
 {
-   Handle handle;
-   u32* stack;
+   int32_t handle;
+   uint32_t* stack;
 }pthread_t;
 typedef int pthread_attr_t;
 
-//#ifndef DEBUG_HOLD
-//#include "stdio.h"
-//void wait_for_input(void);
-
-//#define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0)
-//#endif
-
 static inline int pthread_create(pthread_t *thread,
       const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg)
 {
 
-//   DEBUG_HOLD();
-
    thread->stack =  linearMemAlign(CTR_PTHREAD_STACK_SIZE, 8);
 
-   svcCreateThread(&thread->handle, (ThreadFunc)start_routine,arg,
-                   (u32*)((u32)thread->stack + CTR_PTHREAD_STACK_SIZE),
+   svcCreateThread(&thread->handle, start_routine, arg,
+                   (uint32_t*)((uint32_t)thread->stack + CTR_PTHREAD_STACK_SIZE),
                    0x25, 1);
 
    return 1;
@@ -44,7 +35,6 @@ static inline int pthread_join(pthread_t thread, void **retval)
 {
    (void)retval;
 
-//   DEBUG_HOLD();
    if(svcWaitSynchronization(thread.handle, INT64_MAX))
       return -1;
 
@@ -58,11 +48,9 @@ static inline void pthread_exit(void *retval)
 {   
    (void)retval;
 
-//   DEBUG_HOLD();
    svcExitThread();
 }
 
-//#undef DEBUG_HOLD
 
 #endif //_3DS_PTHREAD_WRAP__