mi.h File Reference

#include <types.h>
#include <broadway.h>

Go to the source code of this file.

Functions

int mi_initialize (void)
 Initialize the MI subsystem.
int mi_shutdown (void)
 Shut down the MI subsystem.
int mi_protect_region (void *addr, int size, BOOL r, BOOL w, int(*exec)(u32 irq, void *data), void *data)
 Protects a region of memory.
int mi_unprotect_region (int rgn)
 Unprotects a region of memory.
void irq_mi_enable (u32 irq)
 Enables a specific MI IRQ.
void irq_mi_disable (u32 irq)
 Disables a specific MI IRQ.

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  ) 

Disables a specific MI IRQ.

Parameters:
irq the IRQ to disable
See also:
irq_mi_enable()
void irq_mi_enable ( u32  irq  ) 

Enables a specific MI IRQ.

Parameters:
irq the IRQ to enable
See also:
irq_mi_disable()
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()
int mi_shutdown ( void   ) 

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.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3