EFI provides no clean way for device drivers to shut down in preparation for handover to a booted operating system. The platform firmware simply doesn't bother to call the drivers' Stop() methods. Instead, drivers must register an EVT_SIGNAL_EXIT_BOOT_SERVICES event to be signalled when ExitBootServices() is called, and clean up without any reference to the EFI driver model. Unfortunately, all timers silently stop working when ExitBootServices() is called. Even more unfortunately, and for no discernible reason, this happens before any EVT_SIGNAL_EXIT_BOOT_SERVICES events are signalled. The net effect of this entertaining design choice is that any timeout loops on the shutdown path (e.g. for gracefully closing outstanding TCP connections) may wait indefinitely. There is no way to report failure from currticks(), since the API lazily assumes that the host system continues to travel through time in the usual direction. Work around EFI's violation of this assumption by falling back to a simple free-running monotonic counter. Debugged-by: Maor Dickman <maord@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
214 |
|
214 |
|
215 |
|
215 |
|
216 |
|
216 |
|
|
217 |
|
|
217 |
|
218 |
|
218 |
|
219 |
|
219 |
|
220 |
|
|
|
||
35 |
|
35 |
|
36 |
|
36 |
|
37 |
|
37 |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
38 |
|
41 |
|
39 |
|
42 |
|
40 |
|
43 |
|
|
|
||
50 |
|
53 |
|
51 |
|
54 |
|
52 |
|
55 |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
53 |
|
63 |
|
54 |
|
64 |
|
55 |
|
65 |
|
|
|
||
70 |
|
70 |
|
71 |
|
71 |
|
72 |
|
72 |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
73 |
|
98 |
|
74 |
|
99 |
|
75 |
|
100 |
|