mirror of
https://github.com/pret/pokediamond.git
synced 2026-08-14 21:15:39 -05:00
OS_tcm.c
This commit is contained in:
@@ -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
|
||||
@@ -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
12
arm9/lib/include/OS_tcm.h
Normal 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
|
||||
@@ -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
13
arm9/lib/src/OS_tcm.c
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user