forked from LumaTeam/Luma3DS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements all PRs of upstream at time of upload (except the pseudo-fix for a closed issue), and implements 3gx support from mariohackandglitch's fork. Also changes Rosalina to compile with -Os instead of -O2 to make the firm small enough to load.
- Loading branch information
Showing
63 changed files
with
3,208 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
#pragma once | ||
|
||
#include "types.h" | ||
#include "kernel.h" | ||
|
||
typedef struct | ||
{ | ||
u32 bits1_0 : 2; ///< 0b00 | ||
} Desc_TranslationFault; | ||
|
||
typedef struct | ||
{ | ||
u32 bits1_0 : 2; ///< 0b01 | ||
u32 sbz : 3; | ||
u32 domain : 4; | ||
u32 p : 1; | ||
u32 addr : 21; | ||
} Desc_CoarsePageTable; | ||
|
||
typedef struct | ||
{ | ||
u32 bits1_0 : 2; ///< 0b10 | ||
u32 b : 1; | ||
u32 c : 1; | ||
u32 xn : 1; | ||
u32 domain : 4; | ||
u32 p : 1; | ||
u32 ap : 2; | ||
u32 tex : 3; | ||
u32 apx : 1; | ||
u32 s : 1; | ||
u32 ng : 1; | ||
u32 bit18 : 1; ///< 0 | ||
u32 sbz : 1; | ||
u32 addr : 12; | ||
} Desc_Section; | ||
|
||
typedef struct | ||
{ | ||
u32 bits1_0 : 2; ///< 0b10 | ||
u32 b : 1; | ||
u32 c : 1; | ||
u32 xn : 1; | ||
u32 domain : 4; | ||
u32 p : 1; | ||
u32 ap : 2; | ||
u32 tex : 3; | ||
u32 sbz : 3; | ||
u32 bit18 : 1; ///< 1 | ||
u32 sbz2 : 5; | ||
u32 addr : 8; | ||
} Desc_Supersection; | ||
|
||
typedef struct | ||
{ | ||
u32 bits1_0 : 2; ///< 0b11 | ||
} Desc_Reserved; | ||
|
||
typedef struct | ||
{ | ||
u32 bits1_0 : 2; ///< 0b01 | ||
u32 b : 1; | ||
u32 c : 1; | ||
u32 ap : 2; | ||
u32 sbz : 3; | ||
u32 apx : 1; | ||
u32 s : 1; | ||
u32 ng : 1; | ||
u32 tex : 3; | ||
u32 xn : 1; | ||
u32 addr : 16; | ||
} Desc_LargePage; | ||
|
||
typedef struct | ||
{ | ||
u32 xn : 1; | ||
u32 bit1 : 1; ///< 1 | ||
u32 b : 1; | ||
u32 c : 1; | ||
u32 ap : 2; | ||
u32 tex : 3; | ||
u32 apx : 1; | ||
u32 s : 1; | ||
u32 ng : 1; | ||
u32 addr : 20; | ||
} Desc_SmallPage; | ||
|
||
typedef union | ||
{ | ||
u32 raw; | ||
|
||
Desc_TranslationFault translationFault; | ||
Desc_CoarsePageTable coarsePageTable; | ||
Desc_Section section; | ||
Desc_Supersection supersection; | ||
Desc_Reserved reserved; | ||
|
||
} L1Descriptor; | ||
|
||
typedef union | ||
{ | ||
u32 raw; | ||
|
||
Desc_TranslationFault translationFault; | ||
Desc_LargePage largePage; | ||
Desc_SmallPage smallPage; | ||
} L2Descriptor; | ||
|
||
typedef enum | ||
{ | ||
Descriptor_TranslationFault, | ||
Descriptor_CoarsePageTable, | ||
Descriptor_Section, | ||
Descriptor_Supersection, | ||
Descriptor_Reserved, | ||
Descriptor_LargePage, | ||
Descriptor_SmallPage | ||
} DescType; | ||
|
||
void L1MMUTable__RWXForAll(u32 *table); | ||
void L2MMUTable__RWXForAll(u32 *table); | ||
u32 L1MMUTable__GetPAFromVA(u32 *table, u32 va); | ||
u32 L2MMUTable__GetPAFromVA(u32 *table, u32 va); | ||
u32 L1MMUTable__GetAddressUserPerm(u32 *table, u32 va); | ||
u32 L2MMUTable__GetAddressUserPerm(u32 *table, u32 va); | ||
|
||
void KProcessHwInfo__SetMMUTableToRWX(KProcessHwInfo *hwInfo); | ||
u32 KProcessHwInfo__GetPAFromVA(KProcessHwInfo *hwInfo, u32 va); | ||
u32 KProcessHwInfo__GetAddressUserPerm(KProcessHwInfo *hwInfo, u32 va); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "utils.h" | ||
#include "kernel.h" | ||
#include "svc.h" | ||
|
||
/// Operations for svcControlProcess | ||
typedef enum ProcessOp | ||
{ | ||
PROCESSOP_GET_ALL_HANDLES, ///< List all handles of the process, varg3 can be either 0 to fetch all handles, or token of the type to fetch | ||
///< svcControlProcess(handle, PROCESSOP_GET_ALL_HANDLES, (u32)&outBuf, 0) | ||
PROCESSOP_SET_MMU_TO_RWX, ///< Set the whole memory of the process with rwx access | ||
///< svcControlProcess(handle, PROCESSOP_SET_MMU_TO_RWX, 0, 0) | ||
PROCESSOP_GET_ON_MEMORY_CHANGE_EVENT, | ||
PROCESSOP_GET_ON_EXIT_EVENT, | ||
PROCESSOP_GET_PA_FROM_VA, ///< Get the physical address of the va within the process | ||
///< svcControlProcess(handle, PROCESSOP_GET_PA_FROM_VA, (u32)&outPa, va) | ||
PROCESSOP_SCHEDULE_THREADS, | ||
} ProcessOp; | ||
|
||
Result ControlProcess(Handle process, ProcessOp op, u32 varg2, u32 varg3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.