extern void rt_global_cli
(void);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Hard disables interrupts (cli) on the requesting cpu and acquires the global spinlock to the calling cpu so that any other cpu synchronizing by using the same call is blocked.

RETURN VALUE

None

ERRORS

None


extern void rt_global_sti

(void);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Hard enables interrupts (sti) on the calling cpu and releases the global lock.
 

RETURN VALUE

None

ERRORS

None


extern void rt_global_save_flags

(unsigned long *flags);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Saves the cpu interrupt flag (IF) and the global lock flag, in bits 9 and 0 of flags.

RETURN VALUE

None

ERRORS

None


extern void rt_global_restore_flags

(unsigned long flags);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Restores the cpu hard interrupt flag (IF) and the global lock flag as given by flags,  freeing or acquiring the global lock according to the state of the global flag bit.

RETURN VALUE

None

ERRORS

None


extern void send_ipi_shorthand

(unsigned int shorthand, int irq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Sends an interprocessor message to irq of all CPUs (if shorthand is equal to APIC_DEST_ALLINC), to all but itself (if shorthand is equal to APIC_DEST_ALLBUT) or only to itself (if shorthand is equal to APIC_DEST_SELF).

RETURN VALUE

None

ERRORS

None


extern void send_ipi_logical

(unsigned long dest, int irq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Sends an interprocessor message to irq of all CPUs defined by destdest is given by an unsigned long corresponding to a bitmask of the CPUs to be sent. It is used for local apics  programmed in flat logical mode,  so the max number of allowed CPUs is 8, a constraint that is valid for all functions and data of RTAI.  The flat logical mode is set when RTAI is installed by calling rt_mount_rtai.

RETURN VALUE

None

ERRORS

None


extern int rt_assign_irq_to_cpu

(int irq, int cpu);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Forces the assignment of the external interrupt irq to the CPU cpu.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned.

ERRORS

-EINVAL: irq is not a valid IRQ number.


extern int rt_reset_irq_to_sym_mode

(int irq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Resets the interrupt irq, previously forced to a specific CPU with a call to rt_assign_irq_to_cpu, to the symmetric  interrupts management. The symmetric mode distributes the IRQs over all the CPUs.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned.

ERRORS

-EINVAL: irq is not a valid IRQ number.


extern int rt_request_global_irq

(unsigned int irq, void (*handler)(void));
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Installs real time handler as an interrupt service routine for IRQ level irq.
handler is then invoked whenever interrupt number irq occurs. The interrupt service routine can be uninstalled using rt_free_global_irq.
The installed real time handler must take care of properly activating any Linux handler  using the same irq by calling rt_pend_linux_irq.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned .

ERRORS

-EINVAL: irq is not a valid IRQ number.
-EINVAL: handler is NULL
-EBUSY: irq already has a handler. You must first call rt_free_global_irq. to make the IRQ available


extern int rt_free_global_irq

(unsigned int irq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Uninstalls an interrupt service routine previously installed with a call to rt_request_global_irq.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned

ERRORS

-EINVAL: irq is not a valid IRQ number.


extern int request_RTirq
(unsigned int irq, void (*handler)(void));
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

This function is really a macro defined in rtai.h and is used to maintain compatibility with  programs developed by using our variant of RT_linux for 2.0.35; see rt_request_global_irq.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned .

ERRORS

-EINVAL: irq is not a valid IRQ number.
-EINVAL: handler is NULL.
-EBUSY: irq already has an handler. You must first call free_RTirq to make the IRQ available.


extern int free_RTirq

(unsigned int irq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

This function is really a macro defined in rtai.h and is used to maintain compatibility with  programs developed by using our variant of RT_linux for 2.0.35; see rt_free_global_irq.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned

ERRORS

-EINVAL: irq is not a valid IRQ number.


extern int rt_request_linux_irq

(unsigned int irq, void (*linux_handler)(int irq, void *dev_id, struct pt_regs *regs), char *linux_handler_id, void *dev_id);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Installs handler as an 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 run as a Linux irq handler. In this way a real time application can monitor Linux interrupts handling at is will. The handler appears at "cat /proc/interrupts".
The interrupt service routine can be uninstalled using rt_free_linux_irq.
This function receives the IRQ number irq, the name of the function handler, a name for /proc/interrupts linux_handler_id and the parameter  dev_id to pass to the interrupt handler, in the same way as the standard Linux irq request call.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned

ERRORS

-EINVAL: irq is not a valid IRQ number.


extern int rt_free_linux_irq

(unsigned int irq, void *dev_id);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Uninstalls an interrupt service routine previously installed with a call to rt_request_linux_irq.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned

ERRORS

-EINVAL: irq is not a valid IRQ number.


extern void rt_pend_linux_irq

(unsigned int irq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Appends a Linux irq for processing in Linux IRQ mode, i.e. with interrupts fully enabled..

RETURN VALUE

None

ERRORS

None


extern int rt_request_srq

(void *(handler)(void));
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Installs a system request handler as a system call to request a service from the kernel. System request 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. The system call can be uninstalled using rt_free_srq.

RETURN VALUE

The number of the assigned srq .

ERRORS

-EINVAL: handler is NULL.
-EBUSY: no srq  slot available.
 

ERRORS

None


extern int rt_free_srq

(unsigned int srq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Uninstall the system call, identified by srq  preturned by installing the related handler with a call to rt_request_srq.

RETURN VALUE

On success, 0 is returned. On failure, a negative value is returned

ERRORS

-EINVAL: srq is not a valid SRQ number.


extern void rt_pend_linux_srq

(unsigned int srq);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Appends a system call request srq to be used as a service request to the Linux kernel. srq is the return value of a call to rt_request_srq.

RETURN VALUE

None

ERRORS

None


extern void rt_request_timer

(void (*handler)(void), int tick);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Requests a timer of period tick, for a oneshot mode set tick to 0, and installs the routine handler as a real time interrupt service routine for the timer.

RETURN VALUE

None

ERRORS

None


extern void rt_free_timer

(void);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Uninstalls the timer previously set by rt_request_timer.

RETURN VALUE

None

ERRORS

None


extern void rt_mount_rtai

(void);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Initializes the real time application interface, i.e. grabs anything related to the hardware, data or service, pointed by at by the Real Time Hardware Abstraction Layer (struct rt_hal rthal;).

RETURN VALUE

None

ERRORS

None


extern void rt_umount_rtai

(void);
  
return to index
  

SYNOPSIS

#include "rtai.h"

DESCRIPTION

Unmounts the real time application interface previously installed by calling rt_mount_rtai,  resetting Linux to its normal state.

RETURN VALUE

None

ERRORS

None