SuperH Interfaces Guide

作者:

Paul Mundt

記憶體管理

SH-4

Store Queue API

void sq_flush_range(unsigned long start, unsigned int len)

Flush (prefetch) a specific SQ range

參數

unsigned long start

the store queue address to start flushing from

unsigned int len

the length to flush

描述

Flushes the store queue cache from start to start + len in a linear fashion.

unsigned long sq_remap(unsigned long phys, unsigned int size, const char *name, pgprot_t prot)

Map a physical address through the Store Queues

參數

unsigned long phys

Physical address of mapping.

unsigned int size

Length of mapping.

const char *name

User invoking mapping.

pgprot_t prot

Protection bits.

描述

Remaps the physical address phys through the next available store queue address of size length. name is logged at boot time as well as through the sysfs interface.

void sq_unmap(unsigned long vaddr)

Unmap a Store Queue allocation

參數

unsigned long vaddr

Pre-allocated Store Queue mapping.

描述

Unmaps the store queue allocation map that was previously created by sq_remap(). Also frees up the pte that was previously inserted into the kernel page table and discards the UTLB translation.

Machine Specific Interfaces

mach-dreamcast

int aica_rtc_gettimeofday(struct device *dev, struct rtc_time *tm)

Get the time from the AICA RTC

參數

struct device *dev

the RTC device (ignored)

struct rtc_time *tm

pointer to resulting RTC time structure

描述

Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.

int aica_rtc_settimeofday(struct device *dev, struct rtc_time *tm)

Set the AICA RTC to the current time

參數

struct device *dev

the RTC device (ignored)

struct rtc_time *tm

pointer to new RTC time structure

描述

Adjusts the given tv to the AICA Epoch and sets the RTC seconds counter.

mach-x3proto

int ilsel_enable(ilsel_source_t set)

Enable an ILSEL set.

參數

ilsel_source_t set

ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).

描述

Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest available interrupt level. Callers should take care to order callsites noting descending interrupt levels. Aliasing FPGA and external board IRQs need to use ilsel_enable_fixed().

The return value is an IRQ number that can later be taken down with ilsel_disable().

int ilsel_enable_fixed(ilsel_source_t set, unsigned int level)

Enable an ILSEL set at a fixed interrupt level

參數

ilsel_source_t set

ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).

unsigned int level

Interrupt level (1 - 15)

描述

Enables a given ILSEL source at a fixed interrupt level. Necessary both for level reservation as well as for aliased sources that only exist on special ILSEL#s.

Returns an IRQ number (as ilsel_enable()).

void ilsel_disable(unsigned int irq)

Disable an ILSEL set

參數

unsigned int irq

Bit position for ILSEL set value (retval from enable routines)

描述

Disable a previously enabled ILSEL set.

Busses

Maple

int maple_driver_register(struct maple_driver *drv)

register a maple driver

參數

struct maple_driver *drv

maple driver to be registered.

描述

Registers the passed in drv, while updating the bus type. Devices with matching function IDs will be automatically probed.

void maple_driver_unregister(struct maple_driver *drv)

unregister a maple driver.

參數

struct maple_driver *drv

maple driver to unregister.

描述

Cleans up after maple_driver_register(). To be invoked in the exit path of any module drivers.

void maple_getcond_callback(struct maple_device *dev, void (*callback)(struct mapleq *mq), unsigned long interval, unsigned long function)

setup handling MAPLE_COMMAND_GETCOND

參數

struct maple_device *dev

device responding

void (*callback) (struct mapleq *mq)

handler callback

unsigned long interval

interval in jiffies between callbacks

unsigned long function

the function code for the device

int maple_add_packet(struct maple_device *mdev, u32 function, u32 command, size_t length, void *data)

add a single instruction to the maple bus queue

參數

struct maple_device *mdev

maple device

u32 function

function on device being queried

u32 command

maple command to add

size_t length

length of command string (in 32 bit words)

void *data

remainder of command string