mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-04 17:09:09 +00:00
Fix missing includes and disable interrupts for pspSdkTotalFreeUserMemSize
This commit is contained in:
@@ -5,10 +5,14 @@
|
|||||||
*
|
*
|
||||||
* memory.c - Code to get accurate reporting of available (video) memory.
|
* memory.c - Code to get accurate reporting of available (video) memory.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2023 Ivy Bowling <motolegacy.git@gmail.com>
|
* Copyright (c) 2023 Ivy Bowling <motolegacy@proton.me>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <pspsdk.h>
|
||||||
|
|
||||||
static u32 _pspSdkGetMaxLineareMemorySize(void)
|
static u32 _pspSdkGetMaxLineareMemorySize(void)
|
||||||
{
|
{
|
||||||
u32 size, blocksize;
|
u32 size, blocksize;
|
||||||
@@ -45,6 +49,8 @@ SceSize pspSdkTotalFreeUserMemSize(void)
|
|||||||
ram = NULL;
|
ram = NULL;
|
||||||
size = count = 0;
|
size = count = 0;
|
||||||
|
|
||||||
|
int intc = pspSdkDisableInterrupts();
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
/* Check entry size */
|
/* Check entry size */
|
||||||
@@ -87,6 +93,8 @@ SceSize pspSdkTotalFreeUserMemSize(void)
|
|||||||
free(ram);
|
free(ram);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pspSdkEnableInterrupts(intc);
|
||||||
|
|
||||||
/* Amount we were able to allocate before running out, in bytes. */
|
/* Amount we were able to allocate before running out, in bytes. */
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
Reference in New Issue
Block a user