mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
pirq_routing.h: fixed for gcc 3.x
printk.c: added hexdump function, conditionally compiled with CONFIG_HEXDUMP mptable.c: added mp table debug functions, conditionally compiled with CONFIG_DEBUG_MPTABLE. These use hexdump.
This commit is contained in:
parent
5dd09ff552
commit
5691f23e61
4 changed files with 29 additions and 1 deletions
|
@ -26,7 +26,7 @@ struct irq_routing_table {
|
|||
u32 miniport_data; /* Crap */
|
||||
u8 rfu[11];
|
||||
u8 checksum; /* Modulo 256 checksum must give zero */
|
||||
struct irq_info slots[0];
|
||||
struct irq_info slots[];
|
||||
} __attribute__((packed));
|
||||
|
||||
extern const struct irq_routing_table intel_irq_routing_table;
|
||||
|
|
|
@ -164,6 +164,11 @@ void smp_write_intsrc(struct mp_config_table *mc,
|
|||
mpc->mpc_dstapic = dstapic;
|
||||
mpc->mpc_dstirq = dstirq;
|
||||
smp_add_mpc_entry(mc, sizeof(*mpc));
|
||||
#if CONFIG_DEBUG_MPTABLE == 1
|
||||
printk_info("add intsrc srcbus 0x%x srcbusirq 0x%x, dstapic 0x%x, dstirq 0x%x\n",
|
||||
srcbus, srcbusirq, dstapic, dstirq);
|
||||
hexdump(__FUNCTION__, mpc, sizeof(*mpc));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -56,3 +56,22 @@ int do_printk(int msg_level, const char *fmt, ...)
|
|||
return i;
|
||||
}
|
||||
|
||||
#if (CONFIG_HEXDUMP == 1)
|
||||
void hexdump(char *name, unsigned char *buffer, int size)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (name)
|
||||
printk_info("==== %s ====\n", name);
|
||||
for(i = 0; i < size; i += 32) {
|
||||
int j;
|
||||
printk_info("%p:", buffer);
|
||||
for(j = 0; j < 32; j++) {
|
||||
printk_info("%02x ", *buffer++);
|
||||
}
|
||||
printk_info("\n");
|
||||
}
|
||||
printk_info("===\n");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -154,6 +154,10 @@ void *smp_write_config_table(void *v, unsigned long * processor_map)
|
|||
mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
|
||||
printk_debug("Wrote the mp table end at: %p - %p\n",
|
||||
mc, smp_next_mpe_entry(mc));
|
||||
#if CONFIG_DEBUG_MPTABLE == 1
|
||||
hexdump ("_MP_", 0x10, 0x20);
|
||||
hexdump("TABLE", mc, 0x1e4-0x20);
|
||||
#endif
|
||||
return smp_next_mpe_entry(mc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue