TinyVisor用ゲストUEFI-BIOSのソースツリーです。
EDK2のソースツリーの一部をexportして作成しました。
https://svn.code.sf.net/p/edk2/code/trunk/edk2
Revision | e92a03fa7fd95c940f93e0ec0388888db90b3560 (tree) |
---|---|
Time | 2016-01-01 16:49:43 |
Author | Yuichi Watanabe <yuichi_ <xy@ybb....> |
Commiter | Yuichi Watanabe <yuichi_ |
[patch 5/5] APIC timer の init count が 0 の場合は ffffffff に設定する。
@@ -263,6 +263,12 @@ | ||
263 | 263 | VOID |
264 | 264 | ); |
265 | 265 | |
266 | +VOID | |
267 | +EFIAPI | |
268 | +SetApicTimerInitCount ( | |
269 | + IN UINT32 InitCount | |
270 | + ); | |
271 | + | |
266 | 272 | /** |
267 | 273 | Read the current count value from the current-count register. |
268 | 274 |
@@ -645,6 +645,20 @@ | ||
645 | 645 | } |
646 | 646 | |
647 | 647 | /** |
648 | + Write a initial count value to the init-count register. | |
649 | + | |
650 | + @param InitCount a initial count Value to be written. | |
651 | +**/ | |
652 | +VOID | |
653 | +EFIAPI | |
654 | +SetApicTimerInitCount ( | |
655 | + IN UINT32 InitCount | |
656 | + ) | |
657 | +{ | |
658 | + WriteLocalApicReg (XAPIC_TIMER_INIT_COUNT_OFFSET, InitCount); | |
659 | +} | |
660 | + | |
661 | +/** | |
648 | 662 | Read the current count value from the current-count register. |
649 | 663 | |
650 | 664 | @return The current count value read from the current-count register. |
@@ -67,6 +67,10 @@ | ||
67 | 67 | // Delay and the Init Count. |
68 | 68 | // |
69 | 69 | InitCount = GetApicTimerInitCount (); |
70 | + if (InitCount == 0) { | |
71 | + SetApicTimerInitCount(0xffffffff); | |
72 | + InitCount = 0xffffffff; | |
73 | + } | |
70 | 74 | Times = Delay / (InitCount / 2); |
71 | 75 | Delay = Delay % (InitCount / 2); |
72 | 76 |