liberis
Functions
v810.h File Reference

Functions to handle V810 specific functionality. More...

#include <eris/types.h>

Go to the source code of this file.

Functions

void cache_enable (void)
 Enable V810 cache.
void cache_disable (void)
 Disable V810 cache.
void cache_clear (int entry, int count)
 Clear select entries in the V810 cache.
void cache_dump (void *dumpaddr)
 Dump the V810 cache.
void cache_restore (void *restaddr)
 Restore the V810 cache.
int irq_enable (void)
 Enable V810 IRQs.
int irq_disable (void)
 Disable V810 IRQs.
void irq_restore (int on)
 Restore V810 IRQs.
void irq_set_level (int lv)
 Set minimum V810 maskable interrupt level.
void irq_set_mask (int mask)
 Set interrupt masking.
void irq_set_priority (u32 prio)
 Set priorities for each interrupt level.
int irq_get_level (void)
 Get minimum/current V810 maskable interrupt level.
u16 irq_get_mask (void)
 Get interrupt masking.
u32 irq_get_priority (void)
 Get priorities for each interrupt level.
void irq_set_handler (int level, void(*fn)(void))
 Set an IRQ handler.
void out32 (u32 port, u32 data)
 Output 32bit data.
void out16 (u32 port, u16 data)
 Output 16bit data.
void out8 (u32 port, u8 data)
 Output 8bit data.
u32 in32 (u32 port)
 Input 32bit data.
u16 in16 (u32 port)
 Input 16bit data.
u8 in8 (u32 port)
 Input 8bit data.

Detailed Description

Functions to handle V810 specific functionality.

Exposes functions for cache control, IRQ handling, and port usage.


Function Documentation

void cache_clear ( int  entry,
int  count 
)

Clear select entries in the V810 cache.

Parameters:
entryThe first entry in the cache to clear. (0 ~ 127)
countThe amount of entries to clear from the cache. (1 ~ 128)
void cache_disable ( void  )

Disable V810 cache.

See also:
cache_enable()
void cache_dump ( void *  dumpaddr)

Dump the V810 cache.

Parameters:
dumpaddrThe memory to dump the cache into. Must be 256 byte aligned.
See also:
cache_restore()
void cache_enable ( void  )

Enable V810 cache.

See also:
cache_disable()
void cache_restore ( void *  restaddr)

Restore the V810 cache.

Restores the V810 cache from a dump made with cache_dump().

Parameters:
restaddrThe memory to restore the cache from. Must be 256 byte aligned.
See also:
cache_dump()
u16 in16 ( u32  port)

Input 16bit data.

Parameters:
portPort to input from.
Returns:
Data input from the port.
See also:
in32(), in8()
u32 in32 ( u32  port)

Input 32bit data.

Parameters:
portPort to input from.
Returns:
Data input from the port.
See also:
in16(), in8()
u8 in8 ( u32  port)

Input 8bit data.

Parameters:
portPort to input from.
Returns:
Data input from the port.
See also:
in32(), in16()
int irq_disable ( void  )

Disable V810 IRQs.

Returns:
Returns whether or not IRQs were enabled before. Pass this to irq_restore() to restore the old IRQ status.
See also:
irq_enable(), irq_restore()
int irq_enable ( void  )

Enable V810 IRQs.

Returns:
Returns whether or not IRQs were enabled before. Pass this to irq_restore() to restore the old IRQ status.
See also:
irq_disable(), irq_restore()
int irq_get_level ( void  )

Get minimum/current V810 maskable interrupt level.

Gets the current/minimum (they're the same here) maskable interrupt level.

Returns:
Current/minimum maskable interrupt level.
See also:
irq_set_level()
u16 irq_get_mask ( void  )

Get interrupt masking.

Gets the interrupt masking for the interrupt levels 8 ~ 15.

Returns:
The mask on levels. bit0 is level 8, bit 7 is level 15, etc.
See also:
irq_set_mask()
u32 irq_get_priority ( void  )

Get priorities for each interrupt level.

Gets interrupt priorities for interrupt levels 8 ~ 15.

Returns:
The priority for levels. Each level gets 3 bits, with bit0~2 being level 15, and bit29~31 is level 8.
See also:
irq_set_priority()
void irq_restore ( int  on)

Restore V810 IRQs.

Parameters:
onWhether the IRQs should be turned on or off. A return value from irq_disable() or irq_enable() is also valid.
See also:
irq_enable(), irq_disable()
void irq_set_handler ( int  level,
void(*)(void)  fn 
)

Set an IRQ handler.

Sets a handler for a specific IRQ level.

Parameters:
levelThe level that this handler will correspond to.
fnThe handler that will be run when an interrupt with the correct level is signaled.
void irq_set_level ( int  lv)

Set minimum V810 maskable interrupt level.

Sets the minimum interrupt level that will be accepted by the interrupt handling in the V810. Any interrupts with a level below this will not be acknowledged.

Parameters:
lvMinimum V810 maskable interrupt level. (0 ~ 15)
See also:
irq_get_level()
void irq_set_mask ( int  mask)

Set interrupt masking.

Sets the interrupt masking for the interrupt levels 8 ~ 15.

Parameters:
maskThe mask on levels. bit0 is level 15, bit 7 is level 8, etc.
See also:
irq_get_mask()
void irq_set_priority ( u32  prio)

Set priorities for each interrupt level.

Sets interrupt priorities for interrupt levels 8 ~ 15.

Parameters:
prioThe priority for levels. Each level gets 3 bits, with bit0~2 being level 15, and bit29~31 is level 8.
See also:
irq_get_priority()
void out16 ( u32  port,
u16  data 
)

Output 16bit data.

Parameters:
portPort to output to.
dataData to be output through the port.
See also:
out32(), out8()
void out32 ( u32  port,
u32  data 
)

Output 32bit data.

Parameters:
portPort to output to.
dataData to be output through the port.
See also:
out16(), out8()
void out8 ( u32  port,
u8  data 
)

Output 8bit data.

Parameters:
portPort to output to.
dataData to be output through the port.
See also:
out32(), out16()
 All Files Functions Typedefs Enumerations Enumerator Defines