Browse Source

Plan 9 from Bell Labs 2013-01-15

David du Colombier 11 years ago
parent
commit
bdade250ea
2 changed files with 12 additions and 3 deletions
  1. 1 0
      sys/games/lib/fortunes
  2. 11 3
      sys/src/9/pc/apic.c

+ 1 - 0
sys/games/lib/fortunes

@@ -4303,3 +4303,4 @@ Please contact the server administrator, root@localhost and inform them of the t
 Sorry, Ubuntu 12.04 has experienced an internal error. If you notice further problems, try restarting the computer.
 The real amount of storage available is a dangerously low 160 TB  - Argonne
 the rate at which apple fiddles with stuff is pretty amazing.  - quanstro
+**WARRANTY VOID IF BROKEN**

+ 11 - 3
sys/src/9/pc/apic.c

@@ -218,7 +218,7 @@ lapicinit(Apic* apic)
 
 	lvt = (lapicr(LapicVER)>>16) & 0xFF;
 	if(lvt >= 4)
-		lapicw(LapicPCINT, ApicIMASK);
+		lapicw(LapicPCINT, ApicIMASK|(VectorPIC+IrqPCINT));
 	lapicw(LapicERROR, VectorPIC+IrqERROR);
 	lapicw(LapicESR, 0);
 	lapicr(LapicESR);
@@ -425,8 +425,16 @@ lapicintroff(void)
 void
 lapicnmienable(void)
 {
+	/*
+	 * On the one hand the manual says the vector information
+	 * is ignored if the delivery mode is NMI, and on the other
+	 * a "Receive Illegal Vector" should be generated for a
+	 * vector in the range 0 through 15.
+	 * Some implementations generate the error interrupt if the
+	 * NMI vector is invalid, so always give a valid value.
+	 */
 	if (lapicbase)
-		lapicw(LapicPCINT, ApicNMI);
+		lapicw(LapicPCINT, ApicNMI|(VectorPIC+IrqPCINT));
 	else
 		print("lapicnmienable: no lapic\n");
 }
@@ -435,7 +443,7 @@ void
 lapicnmidisable(void)
 {
 	if (lapicbase)
-		lapicw(LapicPCINT, ApicIMASK);
+		lapicw(LapicPCINT, ApicIMASK|(VectorPIC+IrqPCINT));
 	else
 		print("lapicnmidisable: no lapic\n");
 }