Added svcQueryMemory

This commit is contained in:
plutoo 2014-10-27 00:07:07 +01:00
parent 1f413a7d44
commit 950ae0b2a4
2 changed files with 29 additions and 0 deletions

View File

@ -23,9 +23,22 @@ typedef enum {
MEMPERM_MAX =0xFFFFFFFF //force 4-byte
} MemPerm;
typedef struct {
u32 base_addr;
u32 size;
u32 perm;
u32 state;
} MemInfo;
typedef struct {
u32 flags;
} PageInfo;
u32* getThreadCommandBuffer(void);
s32 svcControlMemory(u32* addr_out, u32 addr0, u32 addr1, u32 size, MemOp op, MemPerm perm);
s32 svcQueryMemory(MemInfo* info, PageInfo* out, u32 addr);
void __attribute__((noreturn)) svcExitProcess();
s32 svcCreateThread(Handle* thread, ThreadFunc entrypoint, u32 arg, u32* stack_top, s32 thread_priority, s32 processor_id);
void __attribute__((noreturn)) svcExitThread();

View File

@ -22,6 +22,22 @@ svcControlMemory:
ldr r4, [sp], #4
bx lr
.global svcQueryMemory
.type svcQueryMemory, %function
svcQueryMemory:
stmfd sp!, {r0,r1,r4-r6}
svc 2
ldr r6, [sp]
str r1, [r6]
str r2, [r6,#4]
str r3, [r6,#8]
str r4, [r6,#0xc]
ldr r6, [sp,#4]
str r5, [r6]
add sp, sp, #8
ldmfd sp!, {r4-r6}
bx lr
.global svcExitProcess
.type svcExitProcess, %function
svcExitProcess: