mi.h File Reference
#include <types.h>
#include <broadway.h>
Go to the source code of this file.
Detailed Description
An abstraction of the Memory Interface (MI). Has 4 protection zones that can be used to detect when writes, reads, or both happen upon specified regions of memory. Buggy.
Function Documentation
| void irq_mi_disable |
( |
u32 |
irq |
) |
|
| void irq_mi_enable |
( |
u32 |
irq |
) |
|
| int mi_initialize |
( |
void |
|
) |
|
Initialize the MI subsystem.
Initializes the MI subsystem, registers the handler for the MI interrupt and performs all other required initialization tasks.
- Returns:
- If initialization was successful, returns 1. Otherwise 0.
- See also:
- mi_shutdown()
| int mi_protect_region |
( |
void * |
addr, |
|
|
int |
size, |
|
|
BOOL |
r, |
|
|
BOOL |
w, |
|
|
int(*)(u32 irq, void *data) |
exec, |
|
|
void * |
data | |
|
) |
| | |
Protects a region of memory.
- Parameters:
-
| addr | the start address of the protected region. |
| size | how large the protected region is in bytes. |
| r | whether the memory region can be read from |
| w | whether the memory region can be written to |
| exec | the callback that is called when the region is accessed in a way that is not allowed. |
| data | data provided to the callback when it fires. |
- Returns:
- The region number used to protect the memory. This number is also which IRQ is fired when it is accessed badly. If -1, an error occurred trying to protect the region.
- See also:
- irq_mi_enable(), irq_mi_disable(), and mi_unprotect_region()
Shut down the MI subsystem.
Shuts down the MI subsystem, unregisters the handler for the MI interrupt and performs all other required shut down tasks.
- Returns:
- If shut down was successful, returns 1. Otherwise 0.
- See also:
- mi_initialize()
| int mi_unprotect_region |
( |
int |
rgn |
) |
|
Unprotects a region of memory.
- Parameters:
-
| rgn | the region number to unprotect. This is given when you protected the region. |
- Returns:
- Whether the unprotection worked.