simplify pirq handling. Only apply consistency fixes on the copied version

of the pirq table.


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1604 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Stefan Reinauer 2004-06-07 10:25:42 +00:00
parent ab8ff84402
commit 0b607b39ba
3 changed files with 13 additions and 22 deletions

View File

@ -3,29 +3,24 @@
#include <string.h>
#if (DEBUG==1 && HAVE_PIRQ_TABLE==1)
void check_pirq_routing_table(void)
static void check_pirq_routing_table(struct irq_routing_table *rt)
{
const uint8_t *addr;
const struct irq_routing_table *rt;
uint8_t *addr = (uint8_t *)rt;
uint8_t sum=0;
int i;
uint8_t sum;
printk_info("Checking IRQ routing tables...\n");
printk_info("Checking IRQ routing table consistency...\n");
#if defined(IRQ_SLOT_COUNT)
if (sizeof(intel_irq_routing_table) != intel_irq_routing_table.size) {
if (sizeof(struct irq_routing_table) != rt->size) {
printk_warning("Inconsistent IRQ routing table size (0x%x/0x%x)\n",
sizeof(intel_irq_routing_table),
intel_irq_routing_table.size
sizeof(struct irq_routing_table),
rt->size
);
intel_irq_routing_table.size=sizeof(intel_irq_routing_table);
rt->size=sizeof(struct irq_routing_table);
}
#endif
rt = &intel_irq_routing_table;
addr = (uint8_t *)rt;
sum = 0;
for (i = 0; i < rt->size; i++)
sum += addr[i];
@ -43,7 +38,7 @@ void check_pirq_routing_table(void)
}
if (rt->signature != PIRQ_SIGNATURE || rt->version != PIRQ_VERSION ||
rt->size % 16 || rt->size < sizeof(struct irq_routing_table)) {
rt->size % 16 ) {
printk_warning("%s:%6d:%s() - "
"Interrupt Routing Table not valid\n",
__FILE__, __LINE__, __FUNCTION__);
@ -63,7 +58,7 @@ void check_pirq_routing_table(void)
printk_info("done.\n");
}
int verify_copy_pirq_routing_table(unsigned long addr)
static int verify_copy_pirq_routing_table(unsigned long addr)
{
int i;
uint8_t *rt_orig, *rt_curr;
@ -78,6 +73,9 @@ int verify_copy_pirq_routing_table(unsigned long addr)
}
}
printk_info("done\n");
check_pirq_routing_table((struct irq_routing_table *)addr);
return 0;
}
#else

View File

@ -46,7 +46,6 @@ struct lb_memory *write_tables(struct mem_range *mem, unsigned long *processor_m
low_table_end = 16;
post_code(0x9a);
check_pirq_routing_table();
/* This table must be betweeen 0xf0000 & 0x100000 */
rom_table_end = copy_pirq_routing_table(rom_table_end);

View File

@ -39,12 +39,6 @@ struct irq_routing_table {
extern const struct irq_routing_table intel_irq_routing_table;
#if (DEBUG==1 && HAVE_PIRQ_TABLE==1)
void check_pirq_routing_table(void);
#else
#define check_pirq_routing_table() do {} while(0)
#endif
#if HAVE_PIRQ_TABLE==1
unsigned long copy_pirq_routing_table(unsigned long start);
#else