Nits in kernel/xapic.cc

上级 77ec46a9
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#define DEASSERT 0x00000000 #define DEASSERT 0x00000000
#define LEVEL 0x00008000 // Level triggered #define LEVEL 0x00008000 // Level triggered
#define BCAST 0x00080000 // Send to all APICs, including self. #define BCAST 0x00080000 // Send to all APICs, including self.
// XXX(sbw) BUSY and DELIVS?
#define BUSY 0x00001000
#define FIXED 0x00000000 #define FIXED 0x00000000
#define ICRHI (0x0310/4) // Interrupt Command [63:32] #define ICRHI (0x0310/4) // Interrupt Command [63:32]
#define TIMER (0x0320/4) // Local Vector Table 0 (TIMER) #define TIMER (0x0320/4) // Local Vector Table 0 (TIMER)
...@@ -65,7 +63,7 @@ static int ...@@ -65,7 +63,7 @@ static int
xapicwait() xapicwait()
{ {
int i = 100000; int i = 100000;
while ((xapicr(ICRLO) & BUSY) != 0) { while ((xapicr(ICRLO) & DELIVS) != 0) {
nop_pause(); nop_pause();
i--; i--;
if (i == 0) { if (i == 0) {
...@@ -205,12 +203,10 @@ xapicstartap(hwid hwid, u32 addr) ...@@ -205,12 +203,10 @@ xapicstartap(hwid hwid, u32 addr)
xapicw(ICRHI, hwid.num<<24); xapicw(ICRHI, hwid.num<<24);
// XXX(sbw) why hwid.num in ICRLO? xapicw(ICRLO, INIT | LEVEL | ASSERT);
xapicw(ICRLO, hwid.num | INIT | LEVEL | ASSERT);
xapicwait(); xapicwait();
microdelay(10000); microdelay(10000);
// XXX(sbw) why hwid.num in ICRLO? xapicw(ICRLO, INIT | LEVEL);
xapicw(ICRLO, hwid.num |INIT | LEVEL);
xapicwait(); xapicwait();
microdelay(10000); // should be 10ms, but too slow in Bochs! microdelay(10000); // should be 10ms, but too slow in Bochs!
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论