This commit is contained in:
red031000
2020-05-05 23:23:02 +01:00
parent 962b4e0e95
commit ec58acee76
5 changed files with 28 additions and 13 deletions

View File

@@ -1,13 +0,0 @@
.include "asm/macros.inc"
.include "global.inc"
.text
arm_func_start OS_GetDTCMAddress
OS_GetDTCMAddress: ; 0x020CC9A4
mrc p15, 0x0, r0, c9, c1, 0x0
ldr r1, _020CC9B4 ; =0xFFFFF000
and r0, r0, r1
bx lr
.balign 4
_020CC9B4: .word 0xFFFFF000

View File

@@ -7,6 +7,7 @@
#include "types.h"
#include "consts.h"
#include "OS_tcm.h"
#include "OS_spinLock.h"
#include "OS_thread.h"
#include "OS_protectionRegion.h"

12
arm9/lib/include/OS_tcm.h Normal file
View File

@@ -0,0 +1,12 @@
//
// Created by red031000 on 2020-05-05.
//
#ifndef POKEDIAMOND_OS_TCM_H
#define POKEDIAMOND_OS_TCM_H
#include "consts.h"
u32 OS_GetDTCMAddress();
#endif //POKEDIAMOND_OS_TCM_H

View File

@@ -55,6 +55,8 @@
#define OS_CONSOLE_SIZE_MASK 0x00000003
#define OS_CONSOLE_SIZE_4MB 0x00000001
#define OSi_TCM_REGION_BASE_MASK 0xfffff000
#define OSi_GetArenaInfo() (*(OSArenaInfo*)HW_ARENA_INFO_BUF)
#define OSi_TRUNC(n, a) (((u32) (n)) & ~((a) - 1))
#define OSi_ROUND(n, a) (((u32) (n) + (a) - 1) & ~((a) - 1))

13
arm9/lib/src/OS_tcm.c Normal file
View File

@@ -0,0 +1,13 @@
//
// Created by red031000 on 2020-05-05.
//
#include "OS_tcm.h"
#include "function_target.h"
ARM_FUNC asm u32 OS_GetDTCMAddress() {
mrc p15, 0x0, r0, c9, c1, 0x0
ldr r1, =OSi_TCM_REGION_BASE_MASK
and r0, r0, r1
bx lr
}