Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
interrupt.c File Reference
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/irq.h>
#include <asm/machdep.h>
#include <asm/udbg.h>
#include <asm/lv1call.h>
#include <asm/smp.h>
#include "platform.h"

Go to the source code of this file.

Data Structures

struct  ps3_bmp
 
struct  ps3_private
 

Macros

#define DBG   pr_devel
 
#define FAIL   pr_debug
 
#define PS3_BMP_MINALIGN   64
 
#define PS3_INVALID_OUTLET   ((irq_hw_number_t)-1)
 
#define PS3_PLUG_MAX   63
 

Functions

int ps3_irq_plug_setup (enum ps3_cpu_binding cpu, unsigned long outlet, unsigned int *virq)
 
 EXPORT_SYMBOL_GPL (ps3_irq_plug_setup)
 
int ps3_irq_plug_destroy (unsigned int virq)
 
 EXPORT_SYMBOL_GPL (ps3_irq_plug_destroy)
 
int ps3_event_receive_port_setup (enum ps3_cpu_binding cpu, unsigned int *virq)
 
 EXPORT_SYMBOL_GPL (ps3_event_receive_port_setup)
 
int ps3_event_receive_port_destroy (unsigned int virq)
 
int ps3_send_event_locally (unsigned int virq)
 
int ps3_sb_event_receive_port_setup (struct ps3_system_bus_device *dev, enum ps3_cpu_binding cpu, unsigned int *virq)
 
 EXPORT_SYMBOL (ps3_sb_event_receive_port_setup)
 
int ps3_sb_event_receive_port_destroy (struct ps3_system_bus_device *dev, unsigned int virq)
 
 EXPORT_SYMBOL (ps3_sb_event_receive_port_destroy)
 
int ps3_io_irq_setup (enum ps3_cpu_binding cpu, unsigned int interrupt_id, unsigned int *virq)
 
 EXPORT_SYMBOL_GPL (ps3_io_irq_setup)
 
int ps3_io_irq_destroy (unsigned int virq)
 
 EXPORT_SYMBOL_GPL (ps3_io_irq_destroy)
 
int ps3_vuart_irq_setup (enum ps3_cpu_binding cpu, void *virt_addr_bmp, unsigned int *virq)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_irq_setup)
 
int ps3_vuart_irq_destroy (unsigned int virq)
 
 EXPORT_SYMBOL_GPL (ps3_vuart_irq_destroy)
 
int ps3_spe_irq_setup (enum ps3_cpu_binding cpu, unsigned long spe_id, unsigned int class, unsigned int *virq)
 
int ps3_spe_irq_destroy (unsigned int virq)
 
void __init ps3_register_ipi_debug_brk (unsigned int cpu, unsigned int virq)
 
void __init ps3_register_ipi_irq (unsigned int cpu, unsigned int virq)
 
void __init ps3_init_IRQ (void)
 
void ps3_shutdown_IRQ (int cpu)
 

Macro Definition Documentation

#define DBG   pr_devel

Definition at line 36 of file interrupt.c.

#define FAIL   pr_debug

Definition at line 37 of file interrupt.c.

#define PS3_BMP_MINALIGN   64

struct ps3_bmp - a per cpu irq status and mask bitmap structure : 256 bit status bitmap indexed by plug : Alignment : 256 bit mask bitmap indexed by plug : Alignment

The HV maintains per SMT thread mappings of HV outlet to HV plug on behalf of the guest. These mappings are implemented as 256 bit guest supplied bitmaps indexed by plug number. The addresses of the bitmaps are registered with the HV through lv1_configure_irq_state_bitmap(). The HV requires that the 512 bits of status + mask not cross a page boundary. PS3_BMP_MINALIGN is used to define this minimal 64 byte alignment.

The HV supports 256 plugs per thread, assigned as {0..255}, for a total of 512 plugs supported on a processor. To simplify the logic this implementation equates HV plug value to Linux virq value, constrains each interrupt to have a system wide unique plug number, and limits the range of the plug values to map into the first dword of the bitmaps. This gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note that there is no constraint on how many in this set an individual thread can acquire.

The mask is declared as unsigned long so we can use set/clear_bit on it.

Definition at line 67 of file interrupt.c.

#define PS3_INVALID_OUTLET   ((irq_hw_number_t)-1)

Definition at line 625 of file interrupt.c.

#define PS3_PLUG_MAX   63

Definition at line 626 of file interrupt.c.

Function Documentation

EXPORT_SYMBOL ( ps3_sb_event_receive_port_setup  )
EXPORT_SYMBOL ( ps3_sb_event_receive_port_destroy  )
EXPORT_SYMBOL_GPL ( ps3_irq_plug_setup  )
EXPORT_SYMBOL_GPL ( ps3_irq_plug_destroy  )
EXPORT_SYMBOL_GPL ( ps3_event_receive_port_setup  )
EXPORT_SYMBOL_GPL ( ps3_io_irq_setup  )
EXPORT_SYMBOL_GPL ( ps3_io_irq_destroy  )
EXPORT_SYMBOL_GPL ( ps3_vuart_irq_setup  )
EXPORT_SYMBOL_GPL ( ps3_vuart_irq_destroy  )
int ps3_event_receive_port_destroy ( unsigned int  virq)

ps3_event_receive_port_destroy - Destroy an event receive port. : The assigned Linux virq.

Since ps3_event_receive_port_destroy destroys the receive port outlet, SB devices need to call disconnect_interrupt_event_receive_port() before this.

Definition at line 362 of file interrupt.c.

int ps3_event_receive_port_setup ( enum ps3_cpu_binding  cpu,
unsigned int virq 
)

ps3_event_receive_port_setup - Setup an event receive port. : enum ps3_cpu_binding indicating the cpu the interrupt should be serviced on. : The assigned Linux virq.

The virq can be used with lv1_connect_interrupt_event_receive_port() to arrange to receive interrupts from system-bus devices, or with ps3_send_event_locally() to signal events.

Definition at line 332 of file interrupt.c.

void __init ps3_init_IRQ ( void  )

Definition at line 750 of file interrupt.c.

int ps3_io_irq_destroy ( unsigned int  virq)

Definition at line 498 of file interrupt.c.

int ps3_io_irq_setup ( enum ps3_cpu_binding  cpu,
unsigned int  interrupt_id,
unsigned int virq 
)

ps3_io_irq_setup - Setup a system bus io irq. : enum ps3_cpu_binding indicating the cpu the interrupt should be serviced on. : The device interrupt id read from the system repository. : The assigned Linux virq.

An io irq represents a non-virtualized device interrupt. interrupt_id coresponds to the interrupt number of the interrupt controller.

Definition at line 477 of file interrupt.c.

int ps3_irq_plug_destroy ( unsigned int  virq)

ps3_irq_plug_destroy - Generic outlet and virq related teardown. : The assigned Linux virq.

Disconnects the irq plug and tears down virq. Do not call for system bus event interrupts setup with ps3_sb_event_receive_port_setup().

Definition at line 299 of file interrupt.c.

int ps3_irq_plug_setup ( enum ps3_cpu_binding  cpu,
unsigned long  outlet,
unsigned int virq 
)

ps3_irq_plug_setup - Generic outlet and virq related setup. : enum ps3_cpu_binding indicating the cpu the interrupt should be serviced on. : The HV outlet from the various create outlet routines. : The assigned Linux virq.

Sets up virq and connects the irq plug.

Definition at line 254 of file interrupt.c.

void __init ps3_register_ipi_debug_brk ( unsigned int  cpu,
unsigned int  virq 
)

Definition at line 692 of file interrupt.c.

void __init ps3_register_ipi_irq ( unsigned int  cpu,
unsigned int  virq 
)

Definition at line 702 of file interrupt.c.

int ps3_sb_event_receive_port_destroy ( struct ps3_system_bus_device dev,
unsigned int  virq 
)

Definition at line 432 of file interrupt.c.

int ps3_sb_event_receive_port_setup ( struct ps3_system_bus_device dev,
enum ps3_cpu_binding  cpu,
unsigned int virq 
)

ps3_sb_event_receive_port_setup - Setup a system bus event receive port. : enum ps3_cpu_binding indicating the cpu the interrupt should be serviced on. : The system bus device instance. : The assigned Linux virq.

An event irq represents a virtual device interrupt. The interrupt_id coresponds to the software interrupt number.

Definition at line 401 of file interrupt.c.

int ps3_send_event_locally ( unsigned int  virq)

Definition at line 385 of file interrupt.c.

void ps3_shutdown_IRQ ( int  cpu)

Definition at line 782 of file interrupt.c.

int ps3_spe_irq_destroy ( unsigned int  virq)

Definition at line 612 of file interrupt.c.

int ps3_spe_irq_setup ( enum ps3_cpu_binding  cpu,
unsigned long  spe_id,
unsigned int  class,
unsigned int virq 
)

Definition at line 590 of file interrupt.c.

int ps3_vuart_irq_destroy ( unsigned int  virq)

Definition at line 560 of file interrupt.c.

int ps3_vuart_irq_setup ( enum ps3_cpu_binding  cpu,
void virt_addr_bmp,
unsigned int virq 
)

ps3_vuart_irq_setup - Setup the system virtual uart virq. : enum ps3_cpu_binding indicating the cpu the interrupt should be serviced on. : The caller supplied virtual uart interrupt bitmap. : The assigned Linux virq.

The system supports only a single virtual uart, so multiple calls without freeing the interrupt will return a wrong state error.

Definition at line 534 of file interrupt.c.