forked from Mirror/GodMode9
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:
parent
3973ce57df
commit
d7444e144a
@ -7,6 +7,7 @@
|
||||
|
||||
#include "hid.h"
|
||||
|
||||
SystemSHMEM *shmemGlobalBase;
|
||||
|
||||
void main(int argc, char** argv, int entrypoint)
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user