1 /*---------------------------------------------------------------------------*
2 Project: TwlSDK - OS
3 File: os_protectionUnit.c
4
5 Copyright 2003-2008 Nintendo. All rights reserved.
6
7 These coded instructions, statements, and computer programs contain
8 proprietary information of Nintendo of America Inc. and/or Nintendo
9 Company Ltd., and are protected by Federal copyright law. They may
10 not be disclosed to third parties or copied or duplicated in any form,
11 in whole or in part, without the prior written consent of Nintendo.
12
13 $Date:: 2008-09-18#$
14 $Rev: 8573 $
15 $Author: okubata_ryoma $
16 *---------------------------------------------------------------------------*/
17 #include <nitro/os.h>
18 #include <nitro/code32.h>
19
20 //======================================================================
21 // protection unit
22 //======================================================================
23 /*---------------------------------------------------------------------------*
24 Name: OS_EnableProtectionUnit
25
26 Description: enable protection unit
27
28 Arguments: None
29
30 Returns: None
31 *---------------------------------------------------------------------------*/
OS_EnableProtectionUnit(void)32 asm void OS_EnableProtectionUnit( void )
33 {
34 mrc p15, 0, r0, c1, c0, 0
35 orr r0, r0, #HW_C1_PROTECT_UNIT_ENABLE
36 mcr p15, 0, r0, c1, c0, 0
37 bx lr
38 }
39
40 /*---------------------------------------------------------------------------*
41 Name: OS_DisableProtectionUnit
42
43 Description: disable protection unit
44
45 Arguments: None
46
47 Returns: None
48 *---------------------------------------------------------------------------*/
OS_DisableProtectionUnit(void)49 asm void OS_DisableProtectionUnit( void )
50 {
51 mrc p15, 0, r0, c1, c0, 0
52 bic r0, r0, #HW_C1_PROTECT_UNIT_ENABLE
53 mcr p15, 0, r0, c1, c0, 0
54 bx lr
55 }
56
57 #include <nitro/codereset.h>
58