use a regular global pointer for sharedmem

fetching the thread id requires coprocessor access which means doing funky switches between thumb and arm -
it's faster to just allocate a single pointer and do an indirect load when necessary
This commit is contained in:
Wolfvak 2020-07-23 23:46:15 -03:00
parent 3973ce57df
commit d7444e144a
2 changed files with 5 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#include "hid.h"
SystemSHMEM *shmemGlobalBase;
void main(int argc, char** argv, int entrypoint)
{

View File

@ -36,13 +36,15 @@ typedef struct {
#ifdef ARM9
#include <pxi.h>
extern SystemSHMEM *shmemGlobalBase;
static inline SystemSHMEM *ARM_GetSHMEM(void)
{
return (SystemSHMEM*)ARM_GetTID();
return shmemGlobalBase;
}
static inline void ARM_InitSHMEM(void)
{
ARM_SetTID(PXI_DoCMD(PXI_GET_SHMEM, NULL, 0));
shmemGlobalBase = (SystemSHMEM*)PXI_DoCMD(PXI_GET_SHMEM, NULL, 0);
}
#endif