|
|
大家好,我在接案子的时候遇到个bebug :从S4回来可以进入bios setup.
( Y& E- w5 G" V我的解法是这样的,在POST的过程中系统检测按键的时候,我加了段代码去判断PM_BASE+04h的BIT10 – bit12是否等于110b。% Q$ R: _3 K0 z \+ E( x# l0 }! T
代码如下:
# s, e3 M) h/ [' D8 H1 e( @( D1 A5 [VOID CheckForKey( EFI_EVENT Event, VOID *Context )' Q0 a! d9 _# ? r4 o( j
{1 `% ?+ s$ I$ c5 J" Q7 G
9 o% b: o6 j) @6 Y1 n………..
0 d: t8 ~/ E: s; D2 y UINT8 Data,Data1;
3 A4 m4 j! a) w
. p$ z* H$ s0 y0 ^+ L6 n Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &gCpuIo);
2 L2 P( Z T" d1 B' a/ J if (EFI_ERROR(Status)) return;' N. ?8 t' G0 w6 u. q8 g# ~1 B8 F8 ~
Status=gCpuIo->Io.Read (gCpuIo, EfiCpuIoWidthUint8, 0x405 , 1, &Data); //read PM BASE register 0x05,Get sleep type3 K! T9 o. z6 r2 h/ h. E
if((Data == 0x18)){
9 @% t, w. f8 F0 `, N! d+ L return;}9 F3 i6 I: ^0 L2 N
……….……." O/ c6 l% |9 I }: m
} ]" L: ]5 F& {, l u# M
可是仍然从S4回来可以进入bios setup.& M, m2 C6 M R; M
我想问1。PMBASE是不是在S4回来后被清空?
3 P8 ]' _/ j% P5 S) E# d# M. d 2.是何时被清空的?$ C6 q% n/ W( s1 O" r
谢谢 |
|