-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mpu, vectorbase: Protect the alternate vector base region
This PR disables writes to the alternate vector base region (0x00000000) in all cases. It also disables reads to the region if the alternate vector base is not opted into. This helps detect null pointer access/write attempts in homebrew, as these will now raise an exception.
- Loading branch information
1 parent
bb1e9e1
commit e9bfb29
Showing
4 changed files
with
80 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: Zlib | ||
// | ||
// Copyright (c) 2023 Antonio Niño Díaz | ||
|
||
#ifndef ARM9_SYSTEM_MPU_INTERNAL_H__ | ||
#define ARM9_SYSTEM_MPU_INTERNAL_H__ | ||
|
||
#define REGION_IO_REGISTERS 0 | ||
#define REGION_SYSTEM_ROM 1 | ||
#define REGION_ALT_VECTORS 2 | ||
#define REGION_SLOT_2_DSI_IWRAM 3 // DS: Slot-2 | DSi: Switchable IWRAM. | ||
#define REGION_ITCM 4 | ||
#define REGION_RAM_UNCACHED 5 | ||
#define REGION_RAM_CACHED 6 | ||
#define REGION_DTCM 7 | ||
|
||
#endif // ARM9_SYSTEM_MPU_INTERNAL_H__ |
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