Skip to content

Commit b3916e5

Browse files
committed
add: Definition of GetMemoryMode syscall
Update SetMemoryMode docs with new findings
1 parent 2029529 commit b3916e5

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

ee/kernel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ KERNEL_OBJS = ResetEE.o SetGsCrt.o $(EXEC_SYSCALLS) \
195195
SetPgifHandler.o SetVSyncFlag.o SetSyscall.o SifDmaStat.o iSifDmaStat.o \
196196
SifSetDma.o iSifSetDma.o SifSetDChain.o iSifSetDChain.o SifSetReg.o \
197197
SifGetReg.o $(EXECOSD_SYSCALL) Deci2Call.o PSMode.o MachineType.o GetMemorySize.o _GetGsDxDyOffset.o \
198-
_InitTLB.o SetMemoryMode.o \
198+
_InitTLB.o SetMemoryMode.o GetMemoryMode.o \
199199
SifWriteBackDCache.o _SyncDCache.o _InvalidDCache.o __errno.o errno.o \
200200
strncpy.o strlen.o memcpy.o memset.o __syscall.o GPfuncs.o _print.o
201201

ee/kernel/include/kernel.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,12 @@ extern void _GetGsDxDyOffset(int mode, int *dx, int *dy, int *dw, int *dh);
531531

532532
// Internal function for reinitializing the TLB, only present in later kernels. Please use InitTLB() instead to initialize the TLB with all kernels.
533533
extern int _InitTLB(void);
534-
/* (PSX only) Sets the memory size. 0 = 64MB mode, 1 = 32MB mode. The mode is only binding when either _InitTLB() or the PSX ExecPS2() syscall is called.
534+
/* (DESR kernels only) Sets the memory size. mode != 1 -> 64MB mode, mode == 1 -> 32MB mode.
535+
The mode is only binding when either _InitTLB() or the PSX ExecPS2() syscall is called.
535536
The stack pointer must remain in range of usable memory, or a TLB exception will occur. */
536537
extern int SetMemoryMode(int mode); // Arbitrarily named.
538+
/* (DESR kernels only) Get the value set by SetMemoryMode. */
539+
extern int GetMemoryMode(void); // Arbitrarily named.
537540

538541
extern void _SyncDCache(void *start, void *end);
539542
extern void _InvalidDCache(void *start, void *end);

ee/kernel/include/syscallnr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
#define __NR__InitTLB 0x82
157157
#define __NR_FindAddress 0x83
158158
#define __NR_SetMemoryMode 0x85
159+
#define __NR_GetMemoryMode 0x86
159160
#define __NR_ExecPSX 0x87
160161

161162
#endif /* __SYSCALLNR_H__ */

ee/kernel/src/kernel.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,10 @@ SYSCALL(_InitTLB)
665665
SYSCALL(SetMemoryMode)
666666
#endif
667667

668+
#ifdef F_GetMemoryMode
669+
SYSCALL(GetMemoryMode)
670+
#endif
671+
668672
#ifdef F_GPfuncs
669673
.text
670674
.align 2

0 commit comments

Comments
 (0)