Hardware abstraction layer.


Detailed Description

v *

Basic architecture-dependent services used by the real-time nucleus.


Files

file  hal.c
 Adeos-based Real-Time Abstraction Layer for x86.

Functions

int rthal_enable_irq (unsigned irq)
 Enable an IRQ source.
int rthal_disable_irq (unsigned irq)
 Disable an IRQ source.
int rthal_request_linux_irq (unsigned irq, irqreturn_t(*handler)(int irq, void *dev_id, struct pt_regs *regs), char *name, void *dev_id)
 Install a shared Linux interrupt handler.
int rthal_release_linux_irq (unsigned irq, void *dev_id)
 Uninstall shared Linux interrupt handler.
int rthal_pend_linux_irq (unsigned irq)
 Pend an IRQ to Linux.
int rthal_request_srq (unsigned label, void(*handler)(void))
 Install a system request handler.
int rthal_release_srq (unsigned srq)
 Uninstall a system request handler.
int rthal_pend_linux_srq (unsigned srq)
 Append a Linux IRQ.


Function Documentation

int rthal_pend_linux_irq unsigned  irq  ) 
 

Pend an IRQ to Linux.

rthal_pend_linux_irq appends a Linux interrupt irq for processing in Linux IRQ mode, i.e. with hardware interrupts fully enabled.

int rthal_pend_linux_srq unsigned  srq  ) 
 

Append a Linux IRQ.

rthal_pend_linux_srq appends a system call request srq to be used as a service request to the Linux kernel.

Parameters:
srq is the value returned by rthal_request_srq.

int rthal_release_linux_irq unsigned  irq,
void *  dev_id
 

Uninstall shared Linux interrupt handler.

Parameters:
dev_id is to pass to the interrupt handler, in the same way as the standard Linux irq request call.
irq is the IRQ level of the interrupt handler to be freed.
Return values:
0 on success.
-EINVAL if irq is not a valid external IRQ number.

int rthal_release_srq unsigned  srq  ) 
 

Uninstall a system request handler.

rthal_release_srq uninstalls the specified system call srq, returned by installing the related handler with a previous call to rthal_request_srq().

Return values:
EINVAL if srq is invalid.

int rthal_request_linux_irq unsigned  irq,
irqreturn_t(*  handler)(int irq, void *dev_id, struct pt_regs *regs),
char *  name,
void *  dev_id
 

Install a shared Linux interrupt handler.

rthal_request_linux_irq installs function handler as a standard Linux interrupt service routine for IRQ level irq forcing Linux to share the IRQ with other interrupt handlers. The handler is appended to any already existing Linux handler for the same irq and is run by Linux irq as any of its handler. In this way a real time application can monitor Linux interrupts handling at its will. The handler appears in /proc/interrupts.

Parameters:
irq is the IRQ level to which the handler will be associated.
handler pointer on the interrupt service routine to be installed.
name is a name for /proc/interrupts.
dev_id is to pass to the interrupt handler, in the same way as the standard Linux irq request call.
The interrupt service routine can be uninstalled using rthal_release_linux_irq().

Return values:
0 on success.
-EINVAL if irq is not a valid external IRQ number or handler is NULL.

int rthal_request_srq unsigned  label,
void(*  handler)(void)
 

Install a system request handler.

rthal_request_srq installs a RTAI system request (srq) by assigning handler, the function to be called in kernel space following its activation by a call to rthal_pend_linux_srq(). handler is in practice used to request a service from the kernel. In fact Linux system requests cannot be used safely from RTAI so you can setup a handler that receives real time requests and safely executes them when Linux is running.

Returns:
the number of the assigned system request on success.
Return values:
-EINVAL if handler is NULL.
-EBUSY if no free srq slot is available.


Generated on Mon Aug 30 13:58:39 2004 for RTAI API by doxygen 1.3.8