mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 09:32:52 +00:00
(psp pthreads) Buildfixes
This commit is contained in:
parent
a57df7d43f
commit
c4f06f2ef2
4
deps/pthreads/platform/helper/tls-helper.h
vendored
4
deps/pthreads/platform/helper/tls-helper.h
vendored
@ -29,9 +29,9 @@
|
||||
#ifndef _TLS_HELPER_H_
|
||||
#define _TLS_HELPER_H_
|
||||
|
||||
#include "pte_osal.h"
|
||||
#include "../../pte_osal.h"
|
||||
|
||||
/// @todo document..
|
||||
/* @todo document.. */
|
||||
|
||||
pte_osResult pteTlsGlobalInit(int maxEntries);
|
||||
void * pteTlsThreadInit(void);
|
||||
|
723
deps/pthreads/platform/psp/psp_osal.c
vendored
723
deps/pthreads/platform/psp/psp_osal.c
vendored
File diff suppressed because it is too large
Load Diff
9
deps/pthreads/platform/psp/psp_osal.h
vendored
9
deps/pthreads/platform/psp/psp_osal.h
vendored
@ -37,9 +37,6 @@ typedef SceUID pte_osMutexHandle;
|
||||
|
||||
#define OS_IS_HANDLE_VALID(x) ((x) > 0)
|
||||
|
||||
|
||||
|
||||
|
||||
#define OS_MAX_SIMUL_THREADS 10
|
||||
|
||||
#define OS_DEFAULT_PRIO 11
|
||||
@ -47,12 +44,12 @@ typedef SceUID pte_osMutexHandle;
|
||||
#define OS_MIN_PRIO 17
|
||||
#define OS_MAX_PRIO 32
|
||||
|
||||
//#define HAVE_THREAD_SAFE_ERRNO
|
||||
#if 0
|
||||
#define HAVE_THREAD_SAFE_ERRNO
|
||||
#endif
|
||||
|
||||
#define POLLING_DELAY_IN_us 100
|
||||
|
||||
|
||||
|
||||
#define OS_MAX_SEM_VALUE 254
|
||||
|
||||
int PspInterlockedExchange(int *ptarg, int val);
|
||||
|
7
deps/pthreads/platform/psp/pte_osal.h
vendored
7
deps/pthreads/platform/psp/pte_osal.h
vendored
@ -1,12 +1,9 @@
|
||||
|
||||
#ifndef _OS_SUPPORT_H_
|
||||
#define _OS_SUPPORT_H_
|
||||
|
||||
// Platform specific one must be included first
|
||||
/* Platform specific one must be included first */
|
||||
#include "psp_osal.h"
|
||||
|
||||
#include "pte_generic_osal.h"
|
||||
|
||||
|
||||
|
||||
#endif // _OS_SUPPORT_H
|
||||
#endif /* _OS_SUPPORT_H */
|
||||
|
50
deps/pthreads/platform/psp/pthread_main.c
vendored
50
deps/pthreads/platform/psp/pthread_main.c
vendored
@ -5,7 +5,6 @@
|
||||
#include <pspsdk.h>
|
||||
#include <pspctrl.h>
|
||||
|
||||
|
||||
PSP_MODULE_INFO("Pthread Test", 0, 1, 1);
|
||||
|
||||
extern void pte_test_main();
|
||||
@ -17,56 +16,49 @@ extern void pte_test_main();
|
||||
/* Exit callback */
|
||||
int exit_callback(int arg1, int arg2, void *common)
|
||||
{
|
||||
sceKernelExitGame();
|
||||
return 0;
|
||||
sceKernelExitGame();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Callback thread */
|
||||
int CallbackThread(SceSize args, void *argp)
|
||||
{
|
||||
int cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
|
||||
sceKernelRegisterExitCallback(cbid);
|
||||
|
||||
int cbid;
|
||||
sceKernelSleepThreadCB();
|
||||
|
||||
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
|
||||
sceKernelRegisterExitCallback(cbid);
|
||||
|
||||
sceKernelSleepThreadCB();
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sets up the callback thread and returns its thread id */
|
||||
int SetupCallbacks(void)
|
||||
{
|
||||
int thid = 0;
|
||||
|
||||
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
|
||||
if (thid >= 0)
|
||||
{
|
||||
int thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
|
||||
if (thid >= 0)
|
||||
sceKernelStartThread(thid, 0, 0);
|
||||
}
|
||||
|
||||
return thid;
|
||||
return thid;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
SceCtrlData pad;
|
||||
SceCtrlData pad;
|
||||
|
||||
pspDebugScreenInit();
|
||||
SetupCallbacks();
|
||||
pspDebugScreenInit();
|
||||
SetupCallbacks();
|
||||
|
||||
pte_test_main();
|
||||
pte_test_main();
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
sceCtrlReadBufferPositive(&pad, 1);
|
||||
if (pad.Buttons & PSP_CTRL_UP)
|
||||
{
|
||||
printf("Exiting...\n");
|
||||
return 0;
|
||||
}
|
||||
{
|
||||
printf("Exiting...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user