Index: kernel/arch/ia32/src/smp/mps.c
===================================================================
--- kernel/arch/ia32/src/smp/mps.c	(revision 3ee8a07528aa466b40a362672714a05e936d396e)
+++ kernel/arch/ia32/src/smp/mps.c	(revision 4bb31f7fb268426f499400dc8b2d9f6c6d3aaf65)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2001-2005 Jakub Jermar
+ * Copyright (c) 2008 Jakub Jermar
  * All rights reserved.
  *
@@ -150,5 +150,5 @@
 	
 	/* count the checksum for the base table */
-	for (i=0,sum=0; i < ct->base_table_length; i++)
+	for (i = 0,sum = 0; i < ct->base_table_length; i++)
 		sum = (uint8_t) (sum + base[i]);
 		
@@ -157,5 +157,5 @@
 		
 	/* count the checksum for the extended table */
-	for (i=0,sum=0; i < ct->ext_table_length; i++)
+	for (i = 0, sum = 0; i < ct->ext_table_length; i++)
 		sum = (uint8_t) (sum + ext[i]);
 		
@@ -179,5 +179,6 @@
 	for (i = 0; i < 2; i++) {
 		for (j = 0; j < length[i]; j += 16) {
-			if (*((uint32_t *) &addr[i][j]) == FS_SIGNATURE && mps_fs_check(&addr[i][j])) {
+			if (*((uint32_t *) &addr[i][j]) ==
+			    FS_SIGNATURE && mps_fs_check(&addr[i][j])) {
 				fs = (struct mps_fs *) &addr[i][j];
 				goto fs_found;
@@ -228,53 +229,60 @@
 	cnt = 0;
 	cur = &ct->base_table[0];
-	for (i=0; i < ct->entry_count; i++) {
+	for (i = 0; i < ct->entry_count; i++) {
 		switch (*cur) {
-			/* Processor entry */
-			case 0:	
-				processor_entries = processor_entries ? processor_entries : (struct __processor_entry *) cur;
-				processor_entry_cnt++;
-				cnt += ct_processor_entry((struct __processor_entry *) cur);
-				cur += 20;
-				break;
-
-			/* Bus entry */
-			case 1:
-				bus_entries = bus_entries ? bus_entries : (struct __bus_entry *) cur;
-				bus_entry_cnt++;
-				ct_bus_entry((struct __bus_entry *) cur);
-				cur += 8;
-				break;
+		/* Processor entry */
+		case 0:	
+			processor_entries = processor_entries ?
+			    processor_entries :
+			    (struct __processor_entry *) cur;
+			processor_entry_cnt++;
+			cnt += ct_processor_entry((struct __processor_entry *)
+			    cur);
+			cur += 20;
+			break;
+
+		/* Bus entry */
+		case 1:
+			bus_entries = bus_entries ?
+			    bus_entries : (struct __bus_entry *) cur;
+			bus_entry_cnt++;
+			ct_bus_entry((struct __bus_entry *) cur);
+			cur += 8;
+			break;
 				
-			/* I/O Apic */
-			case 2:
-				io_apic_entries = io_apic_entries ? io_apic_entries : (struct __io_apic_entry *) cur;
+		/* I/O Apic */
+		case 2:
+			io_apic_entries = io_apic_entries ?
+			    io_apic_entries : (struct __io_apic_entry *) cur;
 				io_apic_entry_cnt++;
-				ct_io_apic_entry((struct __io_apic_entry *) cur);
-				cur += 8;
-				break;
+			ct_io_apic_entry((struct __io_apic_entry *) cur);
+			cur += 8;
+			break;
 				
-			/* I/O Interrupt Assignment */
-			case 3:
-				io_intr_entries = io_intr_entries ? io_intr_entries : (struct __io_intr_entry *) cur;
-				io_intr_entry_cnt++;
-				ct_io_intr_entry((struct __io_intr_entry *) cur);
-				cur += 8;
-				break;
-
-			/* Local Interrupt Assignment */
-			case 4:
-				l_intr_entries = l_intr_entries ? l_intr_entries : (struct __l_intr_entry *) cur;
-				l_intr_entry_cnt++;
-				ct_l_intr_entry((struct __l_intr_entry *) cur);
-				cur += 8;
-				break;
-
-			default:
-				/*
-				 * Something is wrong. Fallback to UP mode.
-				 */
-				 
-				printf("%s: ct badness\n", __func__);
-				return 1;
+		/* I/O Interrupt Assignment */
+		case 3:
+			io_intr_entries = io_intr_entries ?
+			    io_intr_entries : (struct __io_intr_entry *) cur;
+			io_intr_entry_cnt++;
+			ct_io_intr_entry((struct __io_intr_entry *) cur);
+			cur += 8;
+			break;
+
+		/* Local Interrupt Assignment */
+		case 4:
+			l_intr_entries = l_intr_entries ?
+			    l_intr_entries : (struct __l_intr_entry *) cur;
+			l_intr_entry_cnt++;
+			ct_l_intr_entry((struct __l_intr_entry *) cur);
+			cur += 8;
+			break;
+
+		default:
+			/*
+			 * Something is wrong. Fallback to UP mode.
+			 */
+
+			printf("%s: ct badness\n", __func__);
+			return 1;
 		}
 	}
@@ -302,8 +310,8 @@
 	 * Ignore processors which are not marked enabled.
 	 */
-	if ((pr->cpu_flags & (1<<0)) == 0)
+	if ((pr->cpu_flags & (1 << 0)) == 0)
 		return 0;
 	
-	apic_id_mask |= (1<<pr->l_apic_id); 
+	apic_id_mask |= (1 << pr->l_apic_id); 
 	return 1;
 }
@@ -342,27 +350,52 @@
 #ifdef MPSCT_VERBOSE
 	switch (iointr->intr_type) {
-	    case 0: printf("INT"); break;
-	    case 1: printf("NMI"); break;
-	    case 2: printf("SMI"); break;
-	    case 3: printf("ExtINT"); break;
-	}
-	putchar(',');
-	switch (iointr->poel&3) {
-	    case 0: printf("bus-like"); break;
-	    case 1: printf("active high"); break;
-	    case 2: printf("reserved"); break;
-	    case 3: printf("active low"); break;
-	}
-	putchar(',');
-	switch ((iointr->poel>>2)&3) {
-	    case 0: printf("bus-like"); break;
-	    case 1: printf("edge-triggered"); break;
-	    case 2: printf("reserved"); break;
-	    case 3: printf("level-triggered"); break;
+	case 0:
+		printf("INT");
+		break;
+	case 1:
+		printf("NMI");
+		break;
+	case 2:
+		printf("SMI");
+		break;
+	case 3:
+		printf("ExtINT");
+		break;
+	}
+	putchar(',');
+	switch (iointr->poel & 3) {
+	case 0:
+		printf("bus-like");
+		break;
+	case 1:
+		printf("active high");
+		break;
+	case 2:
+		printf("reserved");
+		break;
+	case 3:
+		printf("active low");
+		break;
+	}
+	putchar(',');
+	switch ((iointr->poel >> 2) & 3) {
+	case 0:
+		printf("bus-like");
+		break;
+	case 1:
+		printf("edge-triggered");
+		break;
+	case 2:
+		printf("reserved");
+		break;
+	case 3:
+		printf("level-triggered");
+		break;
 	}
 	putchar(',');
 	printf("bus%d,irq%d", iointr->src_bus_id, iointr->src_bus_irq);
 	putchar(',');
-	printf("io_apic%d,pin%d", iointr->dst_io_apic_id, iointr->dst_io_apic_pin);
+	printf("io_apic%d,pin%d", iointr->dst_io_apic_id,
+	    iointr->dst_io_apic_pin);
 	putchar('\n');	
 #endif
@@ -373,22 +406,46 @@
 #ifdef MPSCT_VERBOSE
 	switch (lintr->intr_type) {
-	    case 0: printf("INT"); break;
-	    case 1: printf("NMI"); break;
-	    case 2: printf("SMI"); break;
-	    case 3: printf("ExtINT"); break;
-	}
-	putchar(',');
-	switch (lintr->poel&3) {
-	    case 0: printf("bus-like"); break;
-	    case 1: printf("active high"); break;
-	    case 2: printf("reserved"); break;
-	    case 3: printf("active low"); break;
-	}
-	putchar(',');
-	switch ((lintr->poel>>2)&3) {
-	    case 0: printf("bus-like"); break;
-	    case 1: printf("edge-triggered"); break;
-	    case 2: printf("reserved"); break;
-	    case 3: printf("level-triggered"); break;
+	case 0:
+	    printf("INT");
+	    break;
+	case 1:
+	    printf("NMI");
+	    break;
+	case 2:
+	    printf("SMI");
+	    break;
+	case 3:
+	    printf("ExtINT");
+	    break;
+	}
+	putchar(',');
+	switch (lintr->poel & 3) {
+	case 0:
+	    printf("bus-like");
+	    break;
+	case 1:
+	    printf("active high");
+	    break;
+	case 2:
+	    printf("reserved");
+	    break;
+	case 3:
+	    printf("active low");
+	    break;
+	}
+	putchar(',');
+	switch ((lintr->poel >> 2) & 3) {
+	case 0:
+	    printf("bus-like");
+	    break;
+	case 1:
+	    printf("edge-triggered");
+	    break;
+	case 2:
+	    printf("reserved");
+	    break;
+	case 3:
+	    printf("level-triggered");
+	    break;
 	}
 	putchar(',');
@@ -405,9 +462,11 @@
 	uint8_t *cur;
 
-	for (cur = ext; cur < ext + ct->ext_table_length; cur += cur[CT_EXT_ENTRY_LEN]) {
+	for (cur = ext; cur < ext + ct->ext_table_length;
+	    cur += cur[CT_EXT_ENTRY_LEN]) {
 		switch (cur[CT_EXT_ENTRY_TYPE]) {
-			default:
-				printf("%p: skipping MP Configuration Table extended entry type %d\n", cur, cur[CT_EXT_ENTRY_TYPE]);
-				break;
+		default:
+			printf("%p: skipping MP Configuration Table extended "
+			    "entry type %d\n", cur, cur[CT_EXT_ENTRY_TYPE]);
+			break;
 		}
 	}
@@ -419,5 +478,6 @@
 	
 	for (i = 0; i < io_intr_entry_cnt; i++) {
-		if (io_intr_entries[i].src_bus_irq == irq && io_intr_entries[i].intr_type == 0)
+		if (io_intr_entries[i].src_bus_irq == irq &&
+		    io_intr_entries[i].intr_type == 0)
 			return io_intr_entries[i].dst_io_apic_pin;
 	}
