Commit cb141c23 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sn: Added call to pcireg_intr_status_get

From: Pat Gefre <pfg@sgi.com>

Added call to pcireg_intr_status_get
parent 38fc9a4c
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
* Copyright (C) 2003 Silicon Graphics, Inc. All rights reserved. * Copyright (C) 2003 Silicon Graphics, Inc. All rights reserved.
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#include <asm/sn/iograph.h> #include <asm/sn/iograph.h>
...@@ -24,51 +23,70 @@ ...@@ -24,51 +23,70 @@
uint64_t uint64_t
pcireg_control_get(void *ptr) pcireg_control_get(void *ptr)
{ {
uint64_t ret = 0; uint64_t ret = 0;
pic_t *bridge; pic_t *bridge;
if (IS_IOADDR(ptr))
bridge = (pic_t *) ptr;
else
bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
ret = ((pic_t *) bridge)->p_wid_control;
return ret;
}
/*
* Interrupt Status Register Access -- Read Only 0000_0100
*/
uint64_t
pcireg_intr_status_get(void *ptr)
{
short bridge_type;
pic_t *bridge;
uint64_t ret = 0;
if ( IS_IOADDR(ptr) ) if (IS_IOADDR(ptr))
bridge = (pic_t *)ptr; bridge = (pic_t *) ptr;
else else
bridge = (pic_t *)((pcibr_soft_t)(ptr))->bs_base; bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
ret = ((pic_t *)bridge)->p_wid_control; ret = ((pic_t *) bridge)->p_int_status;
return ret; return ret;
} }
void void
pcireg_intr_enable_bit_clr(void *ptr, uint64_t bits) pcireg_intr_enable_bit_clr(void *ptr, uint64_t bits)
{ {
pic_t *bridge; pic_t *bridge;
if ( IS_IOADDR(ptr) ) if (IS_IOADDR(ptr))
bridge = (pic_t *)ptr; bridge = (pic_t *) ptr;
else else
bridge = (pic_t *)((pcibr_soft_t)(ptr))->bs_base; bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
bridge->p_int_enable &= ~bits; bridge->p_int_enable &= ~bits;
} }
void void
pcireg_intr_enable_bit_set(void *ptr, uint64_t bits) pcireg_intr_enable_bit_set(void *ptr, uint64_t bits)
{ {
pic_t *bridge; pic_t *bridge;
if ( IS_IOADDR(ptr) ) if (IS_IOADDR(ptr))
bridge = (pic_t *)ptr; bridge = (pic_t *) ptr;
else else
bridge = (pic_t *)((pcibr_soft_t)(ptr))->bs_base; bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
bridge->p_int_enable |= bits; bridge->p_int_enable |= bits;
} }
void void
pcireg_intr_addr_addr_set(void *ptr, int int_n, uint64_t addr) pcireg_intr_addr_addr_set(void *ptr, int int_n, uint64_t addr)
{ {
pic_t *bridge; pic_t *bridge;
if ( IS_IOADDR(ptr) ) if (IS_IOADDR(ptr))
bridge = (pic_t *)ptr; bridge = (pic_t *) ptr;
else else
bridge = (pic_t *)((pcibr_soft_t)(ptr))->bs_base; bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
bridge->p_int_addr[int_n] &= ~(0x0000FFFFFFFFFFFF); bridge->p_int_addr[int_n] &= ~(0x0000FFFFFFFFFFFF);
bridge->p_int_addr[int_n] |= (addr & 0x0000FFFFFFFFFFFF); bridge->p_int_addr[int_n] |= (addr & 0x0000FFFFFFFFFFFF);
} }
...@@ -79,11 +97,11 @@ pcireg_intr_addr_addr_set(void *ptr, int int_n, uint64_t addr) ...@@ -79,11 +97,11 @@ pcireg_intr_addr_addr_set(void *ptr, int int_n, uint64_t addr)
void void
pcireg_force_intr_set(void *ptr, int int_n) pcireg_force_intr_set(void *ptr, int int_n)
{ {
pic_t *bridge; pic_t *bridge;
if ( IS_IOADDR(ptr) ) if (IS_IOADDR(ptr))
bridge = (pic_t *)ptr; bridge = (pic_t *) ptr;
else else
bridge = (pic_t *)((pcibr_soft_t)(ptr))->bs_base; bridge = (pic_t *) ((pcibr_soft_t) (ptr))->bs_base;
bridge->p_force_pin[int_n] = 1; bridge->p_force_pin[int_n] = 1;
} }
...@@ -262,7 +262,7 @@ sn_check_intr(int irq, pcibr_intr_t intr) { ...@@ -262,7 +262,7 @@ sn_check_intr(int irq, pcibr_intr_t intr) {
unsigned long irr_reg; unsigned long irr_reg;
regval = intr->bi_soft->bs_base->p_int_status_64; regval = pcireg_intr_status_get(intr->bi_soft->bs_base);
irr_reg_num = irq_to_vector(irq) / 64; irr_reg_num = irq_to_vector(irq) / 64;
irr_bit = irq_to_vector(irq) % 64; irr_bit = irq_to_vector(irq) % 64;
switch (irr_reg_num) { switch (irr_reg_num) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment