mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@181 b871894f-2f95-9b40-918c-086798483c85
91 lines
2.9 KiB
C
91 lines
2.9 KiB
C
/*---------------------------------------------------------------------------*
|
||
Project: CtrBrom - OS
|
||
File: os_protectionUnit.c
|
||
|
||
Copyright 2009 Nintendo. All rights reserved.
|
||
|
||
These coded instructions, statements, and computer programs contain
|
||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||
Company Ltd., and are protected by Federal copyright law. They may
|
||
not be disclosed to third parties or copied or duplicated in any form,
|
||
in whole or in part, without the prior written consent of Nintendo.
|
||
|
||
$Date:: $
|
||
$Rev$
|
||
$Author$
|
||
*---------------------------------------------------------------------------*/
|
||
#include <brom/os.h>
|
||
#include <brom/code32.h>
|
||
|
||
//======================================================================
|
||
// protection unit
|
||
//======================================================================
|
||
/*---------------------------------------------------------------------------*
|
||
Name: osEnableProtectionUnit
|
||
|
||
Description: enable protection unit
|
||
|
||
Arguments: None
|
||
|
||
Returns: None
|
||
*---------------------------------------------------------------------------*/
|
||
asm void osEnableProtectionUnit( void )
|
||
{
|
||
mrc p15, 0, r0, c1, c0, 0
|
||
orr r0, r0, #HW_C1_PROTECT_UNIT_ENABLE
|
||
mcr p15, 0, r0, c1, c0, 0
|
||
bx lr
|
||
}
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
Name: osDisableProtectionUnit
|
||
|
||
Description: disable protection unit
|
||
|
||
Arguments: None
|
||
|
||
Returns: None
|
||
*---------------------------------------------------------------------------*/
|
||
asm void osDisableProtectionUnit( void )
|
||
{
|
||
mrc p15, 0, r0, c1, c0, 0
|
||
bic r0, r0, #HW_C1_PROTECT_UNIT_ENABLE
|
||
mcr p15, 0, r0, c1, c0, 0
|
||
bx lr
|
||
}
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
Name: i_osFinalizeProtectionUnit
|
||
|
||
Description: finalize protection unit
|
||
|
||
Arguments: None
|
||
|
||
Returns: None
|
||
*---------------------------------------------------------------------------*/
|
||
asm void i_osFinalizeProtectionUnit( void )
|
||
{
|
||
// <20>v<EFBFBD><76><EFBFBD>e<EFBFBD>N<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD>L<EFBFBD><4C><EFBFBD>b<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BITCM <20><> DTCM<43>͗L<CD97><4C>
|
||
ldr r0, = HW_C1_ITCM_ENABLE | HW_C1_DTCM_ENABLE | HW_C1_EXCEPT_VEC_UPPER | HW_C1_SB1_BITSET
|
||
mcr p15, 0, r0, c1, c0, 0
|
||
|
||
// ITCM<43>̊<EFBFBD><CC8A>蓖<EFBFBD>Ă<EFBFBD><C482><EFBFBD><EFBFBD><EFBFBD>
|
||
// mov r0, #0
|
||
// mcr p15, 0, r0, c6, c5, 0
|
||
|
||
// DTCM<43>̊<EFBFBD><CC8A>蓖<EFBFBD>Ă<EFBFBD><C482><EFBFBD><EFBFBD><EFBFBD>
|
||
// mov r0,#0
|
||
// mcr p15, 0, r0, c9, c1, 0
|
||
|
||
// <20>L<EFBFBD><4C><EFBFBD>b<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
mov r0, #0
|
||
mcr p15, 0, r0, c7, c5, 0 // <20><><EFBFBD>߃L<DF83><4C><EFBFBD>b<EFBFBD>V<EFBFBD><56>
|
||
mcr p15, 0, r0, c7, c6, 0 // <20>f<EFBFBD>[<5B>^<5E>L<EFBFBD><4C><EFBFBD>b<EFBFBD>V<EFBFBD><56>
|
||
|
||
// <20><><EFBFBD>C<EFBFBD>g<EFBFBD>o<EFBFBD>b<EFBFBD>t<EFBFBD>@ <20>G<EFBFBD><47><EFBFBD>v<EFBFBD>e<EFBFBD>B<EFBFBD>҂<EFBFBD>
|
||
mcr p15, 0, r0, c7, c10, 4
|
||
|
||
bx lr
|
||
}
|
||
|