Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
r58459 r58466 29 29 ASM_PFX(SetCodeSelector): 30 30 movl 4(%esp), %ecx 31 subl $0x10, %esp 32 leal setCodeSelectorLongJump, %eax 31 subl $0x10, %esp 32 leal setCodeSelectorLongJump, %eax 33 33 movl %eax, (%esp) 34 34 movw %cx, 4(%esp) 35 .byte 0xFF, 0x2C, 0x24 # jmp *(%esp) note:(FWORD jmp) 35 .byte 0xFF, 0x2C, 0x24 # jmp *(%esp) note:(FWORD jmp) 36 36 setCodeSelectorLongJump: 37 addl $0x10, %esp 37 addl $0x10, %esp 38 38 ret 39 39 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuDxe/X64/CpuAsm.S
r58459 r58466 1 # TITLE CpuAsm.S: 1 # TITLE CpuAsm.S: 2 2 3 3 #------------------------------------------------------------------------------ … … 30 30 ASM_GLOBAL ASM_PFX(SetCodeSelector) 31 31 ASM_PFX(SetCodeSelector): 32 subq $0x10, %rsp 33 leaq L_setCodeSelectorLongJump(%rip), %rax 34 movq %rax, (%rsp) 32 subq $0x10, %rsp 33 leaq L_setCodeSelectorLongJump(%rip), %rax 34 movq %rax, (%rsp) 35 35 movw %cx, 4(%rsp) 36 36 .byte 0xFF, 0x2C, 0x24 # jmp (%rsp) note:fword jmp -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm
r58459 r58466 1 TITLE CpuAsm.asm: 1 TITLE CpuAsm.asm: 2 2 ;------------------------------------------------------------------------------ 3 3 ;* 4 4 ;* Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR> 5 ;* This program and the accompanying materials 6 ;* are licensed and made available under the terms and conditions of the BSD License 7 ;* which accompanies this distribution. The full text of the license may be found at 8 ;* http://opensource.org/licenses/bsd-license.php 9 ;* 10 ;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 ;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 ;* 5 ;* This program and the accompanying materials 6 ;* are licensed and made available under the terms and conditions of the BSD License 7 ;* which accompanies this distribution. The full text of the license may be found at 8 ;* http://opensource.org/licenses/bsd-license.php 9 ;* 10 ;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 ;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 ;* 13 13 ;* CpuAsm.asm 14 ;* 14 ;* 15 15 ;* Abstract: 16 16 ;* -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c
r58459 r58466 3 3 4 4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 73 73 Check parameters to a CPU I/O 2 Protocol service request. 74 74 75 The I/O operations are carried out exactly as requested. The caller is responsible 76 for satisfying any alignment and I/O width restrictions that a PI System on a 77 platform might require. For example on some platforms, width requests of 78 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 75 The I/O operations are carried out exactly as requested. The caller is responsible 76 for satisfying any alignment and I/O width restrictions that a PI System on a 77 platform might require. For example on some platforms, width requests of 78 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 79 79 be handled by the driver. 80 80 81 81 @param[in] MmioOperation TRUE for an MMIO operation, FALSE for I/O Port operation. 82 82 @param[in] Width Signifies the width of the I/O or Memory operation. 83 @param[in] Address The base address of the I/O operation. 84 @param[in] Count The number of I/O operations to perform. The number of 83 @param[in] Address The base address of the I/O operation. 84 @param[in] Count The number of I/O operations to perform. The number of 85 85 bytes moved is Width size * Count, starting at Address. 86 86 @param[in] Buffer For read operations, the destination buffer to store the results. … … 91 91 @retval EFI_INVALID_PARAMETER Buffer is NULL. 92 92 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 93 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 93 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 94 94 and Count is not valid for this PI system. 95 95 … … 136 136 return EFI_INVALID_PARAMETER; 137 137 } 138 138 139 139 // 140 140 // Check to see if Address is aligned … … 145 145 146 146 // 147 // Check to see if any address associated with this transfer exceeds the maximum 147 // Check to see if any address associated with this transfer exceeds the maximum 148 148 // allowed address. The maximum address implied by the parameters passed in is 149 149 // Address + Size * Count. If the following condition is met, then the transfer … … 152 152 // Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1 153 153 // 154 // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 154 // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 155 155 // can also be the maximum integer value supported by the CPU, this range 156 156 // check must be adjusted to avoid all oveflow conditions. 157 // 158 // The following form of the range check is equivalent but assumes that 157 // 158 // The following form of the range check is equivalent but assumes that 159 159 // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1). 160 160 // … … 164 164 return EFI_UNSUPPORTED; 165 165 } 166 } else { 166 } else { 167 167 MaxCount = RShiftU64 (Limit, Width); 168 168 if (MaxCount < (Count - 1)) { … … 188 188 Reads memory-mapped registers. 189 189 190 The I/O operations are carried out exactly as requested. The caller is responsible 191 for satisfying any alignment and I/O width restrictions that a PI System on a 192 platform might require. For example on some platforms, width requests of 193 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 190 The I/O operations are carried out exactly as requested. The caller is responsible 191 for satisfying any alignment and I/O width restrictions that a PI System on a 192 platform might require. For example on some platforms, width requests of 193 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 194 194 be handled by the driver. 195 196 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 197 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 195 196 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 197 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 198 198 each of the Count operations that is performed. 199 200 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 201 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 202 incremented for each of the Count operations that is performed. The read or 199 200 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 201 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 202 incremented for each of the Count operations that is performed. The read or 203 203 write operation is performed Count times on the same Address. 204 205 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 206 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 207 incremented for each of the Count operations that is performed. The read or 204 205 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 206 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 207 incremented for each of the Count operations that is performed. The read or 208 208 write operation is performed Count times from the first element of Buffer. 209 209 210 210 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 211 211 @param[in] Width Signifies the width of the I/O or Memory operation. 212 @param[in] Address The base address of the I/O operation. 213 @param[in] Count The number of I/O operations to perform. The number of 212 @param[in] Address The base address of the I/O operation. 213 @param[in] Count The number of I/O operations to perform. The number of 214 214 bytes moved is Width size * Count, starting at Address. 215 215 @param[out] Buffer For read operations, the destination buffer to store the results. … … 220 220 @retval EFI_INVALID_PARAMETER Buffer is NULL. 221 221 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 222 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 222 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 223 223 and Count is not valid for this PI system. 224 224 … … 268 268 Writes memory-mapped registers. 269 269 270 The I/O operations are carried out exactly as requested. The caller is responsible 271 for satisfying any alignment and I/O width restrictions that a PI System on a 272 platform might require. For example on some platforms, width requests of 273 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 270 The I/O operations are carried out exactly as requested. The caller is responsible 271 for satisfying any alignment and I/O width restrictions that a PI System on a 272 platform might require. For example on some platforms, width requests of 273 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 274 274 be handled by the driver. 275 276 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 277 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 275 276 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 277 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 278 278 each of the Count operations that is performed. 279 280 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 281 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 282 incremented for each of the Count operations that is performed. The read or 279 280 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 281 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 282 incremented for each of the Count operations that is performed. The read or 283 283 write operation is performed Count times on the same Address. 284 285 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 286 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 287 incremented for each of the Count operations that is performed. The read or 284 285 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 286 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 287 incremented for each of the Count operations that is performed. The read or 288 288 write operation is performed Count times from the first element of Buffer. 289 289 290 290 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 291 291 @param[in] Width Signifies the width of the I/O or Memory operation. 292 @param[in] Address The base address of the I/O operation. 293 @param[in] Count The number of I/O operations to perform. The number of 292 @param[in] Address The base address of the I/O operation. 293 @param[in] Count The number of I/O operations to perform. The number of 294 294 bytes moved is Width size * Count, starting at Address. 295 295 @param[in] Buffer For read operations, the destination buffer to store the results. … … 300 300 @retval EFI_INVALID_PARAMETER Buffer is NULL. 301 301 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 302 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 302 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 303 303 and Count is not valid for this PI system. 304 304 … … 348 348 Reads I/O registers. 349 349 350 The I/O operations are carried out exactly as requested. The caller is responsible 351 for satisfying any alignment and I/O width restrictions that a PI System on a 352 platform might require. For example on some platforms, width requests of 353 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 350 The I/O operations are carried out exactly as requested. The caller is responsible 351 for satisfying any alignment and I/O width restrictions that a PI System on a 352 platform might require. For example on some platforms, width requests of 353 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 354 354 be handled by the driver. 355 356 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 357 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 355 356 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 357 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 358 358 each of the Count operations that is performed. 359 360 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 361 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 362 incremented for each of the Count operations that is performed. The read or 359 360 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 361 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 362 incremented for each of the Count operations that is performed. The read or 363 363 write operation is performed Count times on the same Address. 364 365 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 366 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 367 incremented for each of the Count operations that is performed. The read or 364 365 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 366 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 367 incremented for each of the Count operations that is performed. The read or 368 368 write operation is performed Count times from the first element of Buffer. 369 369 370 370 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 371 371 @param[in] Width Signifies the width of the I/O or Memory operation. 372 @param[in] Address The base address of the I/O operation. 373 @param[in] Count The number of I/O operations to perform. The number of 372 @param[in] Address The base address of the I/O operation. 373 @param[in] Count The number of I/O operations to perform. The number of 374 374 bytes moved is Width size * Count, starting at Address. 375 375 @param[out] Buffer For read operations, the destination buffer to store the results. … … 380 380 @retval EFI_INVALID_PARAMETER Buffer is NULL. 381 381 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 382 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 382 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 383 383 and Count is not valid for this PI system. 384 384 … … 427 427 Write I/O registers. 428 428 429 The I/O operations are carried out exactly as requested. The caller is responsible 430 for satisfying any alignment and I/O width restrictions that a PI System on a 431 platform might require. For example on some platforms, width requests of 432 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 429 The I/O operations are carried out exactly as requested. The caller is responsible 430 for satisfying any alignment and I/O width restrictions that a PI System on a 431 platform might require. For example on some platforms, width requests of 432 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 433 433 be handled by the driver. 434 435 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 436 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 434 435 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 436 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 437 437 each of the Count operations that is performed. 438 439 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 440 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 441 incremented for each of the Count operations that is performed. The read or 438 439 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 440 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 441 incremented for each of the Count operations that is performed. The read or 442 442 write operation is performed Count times on the same Address. 443 444 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 445 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 446 incremented for each of the Count operations that is performed. The read or 443 444 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 445 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 446 incremented for each of the Count operations that is performed. The read or 447 447 write operation is performed Count times from the first element of Buffer. 448 448 449 449 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 450 450 @param[in] Width Signifies the width of the I/O or Memory operation. 451 @param[in] Address The base address of the I/O operation. 452 @param[in] Count The number of I/O operations to perform. The number of 451 @param[in] Address The base address of the I/O operation. 452 @param[in] Count The number of I/O operations to perform. The number of 453 453 bytes moved is Width size * Count, starting at Address. 454 454 @param[in] Buffer For read operations, the destination buffer to store the results. … … 459 459 @retval EFI_INVALID_PARAMETER Buffer is NULL. 460 460 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 461 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 461 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 462 462 and Count is not valid for this PI system. 463 463 464 464 **/ 465 465 EFI_STATUS … … 502 502 } 503 503 } 504 504 505 505 return EFI_SUCCESS; 506 506 } … … 509 509 The user Entry Point for module CpuIo2Dxe. The user code starts with this function. 510 510 511 @param[in] ImageHandle The firmware allocated handle for the EFI image. 511 @param[in] ImageHandle The firmware allocated handle for the EFI image. 512 512 @param[in] SystemTable A pointer to the EFI System Table. 513 513 514 514 @retval EFI_SUCCESS The entry point is executed successfully. 515 515 @retval other Some error occurs when executing this entry point. -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.h
r48674 r58466 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 30 30 Reads memory-mapped registers. 31 31 32 The I/O operations are carried out exactly as requested. The caller is responsible 33 for satisfying any alignment and I/O width restrictions that a PI System on a 34 platform might require. For example on some platforms, width requests of 35 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 36 be handled by the driver. 37 38 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 39 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 40 each of the Count operations that is performed. 41 42 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 43 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 44 incremented for each of the Count operations that is performed. The read or 45 write operation is performed Count times on the same Address. 46 47 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 48 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 49 incremented for each of the Count operations that is performed. The read or 50 write operation is performed Count times from the first element of Buffer. 51 52 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 53 @param[in] Width Signifies the width of the I/O or Memory operation. 54 @param[in] Address The base address of the I/O operation. 55 @param[in] Count The number of I/O operations to perform. The number of 32 The I/O operations are carried out exactly as requested. The caller is responsible 33 for satisfying any alignment and I/O width restrictions that a PI System on a 34 platform might require. For example on some platforms, width requests of 35 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 36 be handled by the driver. 37 38 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 39 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 40 each of the Count operations that is performed. 41 42 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 43 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 44 incremented for each of the Count operations that is performed. The read or 45 write operation is performed Count times on the same Address. 46 47 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 48 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 49 incremented for each of the Count operations that is performed. The read or 50 write operation is performed Count times from the first element of Buffer. 51 52 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 53 @param[in] Width Signifies the width of the I/O or Memory operation. 54 @param[in] Address The base address of the I/O operation. 55 @param[in] Count The number of I/O operations to perform. The number of 56 56 bytes moved is Width size * Count, starting at Address. 57 57 @param[out] Buffer For read operations, the destination buffer to store the results. … … 62 62 @retval EFI_INVALID_PARAMETER Buffer is NULL. 63 63 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 64 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 64 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 65 65 and Count is not valid for this PI system. 66 66 … … 79 79 Writes memory-mapped registers. 80 80 81 The I/O operations are carried out exactly as requested. The caller is responsible 82 for satisfying any alignment and I/O width restrictions that a PI System on a 83 platform might require. For example on some platforms, width requests of 84 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 85 be handled by the driver. 86 87 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 88 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 89 each of the Count operations that is performed. 90 91 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 92 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 93 incremented for each of the Count operations that is performed. The read or 94 write operation is performed Count times on the same Address. 95 96 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 97 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 98 incremented for each of the Count operations that is performed. The read or 99 write operation is performed Count times from the first element of Buffer. 100 101 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 102 @param[in] Width Signifies the width of the I/O or Memory operation. 103 @param[in] Address The base address of the I/O operation. 104 @param[in] Count The number of I/O operations to perform. The number of 81 The I/O operations are carried out exactly as requested. The caller is responsible 82 for satisfying any alignment and I/O width restrictions that a PI System on a 83 platform might require. For example on some platforms, width requests of 84 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 85 be handled by the driver. 86 87 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 88 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 89 each of the Count operations that is performed. 90 91 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 92 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 93 incremented for each of the Count operations that is performed. The read or 94 write operation is performed Count times on the same Address. 95 96 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 97 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 98 incremented for each of the Count operations that is performed. The read or 99 write operation is performed Count times from the first element of Buffer. 100 101 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 102 @param[in] Width Signifies the width of the I/O or Memory operation. 103 @param[in] Address The base address of the I/O operation. 104 @param[in] Count The number of I/O operations to perform. The number of 105 105 bytes moved is Width size * Count, starting at Address. 106 106 @param[in] Buffer For read operations, the destination buffer to store the results. … … 111 111 @retval EFI_INVALID_PARAMETER Buffer is NULL. 112 112 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 113 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 113 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 114 114 and Count is not valid for this PI system. 115 115 … … 128 128 Reads I/O registers. 129 129 130 The I/O operations are carried out exactly as requested. The caller is responsible 131 for satisfying any alignment and I/O width restrictions that a PI System on a 132 platform might require. For example on some platforms, width requests of 133 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 134 be handled by the driver. 135 136 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 137 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 138 each of the Count operations that is performed. 139 140 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 141 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 142 incremented for each of the Count operations that is performed. The read or 143 write operation is performed Count times on the same Address. 144 145 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 146 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 147 incremented for each of the Count operations that is performed. The read or 148 write operation is performed Count times from the first element of Buffer. 149 150 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 151 @param[in] Width Signifies the width of the I/O or Memory operation. 152 @param[in] Address The base address of the I/O operation. 153 @param[in] Count The number of I/O operations to perform. The number of 130 The I/O operations are carried out exactly as requested. The caller is responsible 131 for satisfying any alignment and I/O width restrictions that a PI System on a 132 platform might require. For example on some platforms, width requests of 133 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 134 be handled by the driver. 135 136 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 137 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 138 each of the Count operations that is performed. 139 140 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 141 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 142 incremented for each of the Count operations that is performed. The read or 143 write operation is performed Count times on the same Address. 144 145 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 146 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 147 incremented for each of the Count operations that is performed. The read or 148 write operation is performed Count times from the first element of Buffer. 149 150 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 151 @param[in] Width Signifies the width of the I/O or Memory operation. 152 @param[in] Address The base address of the I/O operation. 153 @param[in] Count The number of I/O operations to perform. The number of 154 154 bytes moved is Width size * Count, starting at Address. 155 155 @param[out] Buffer For read operations, the destination buffer to store the results. … … 160 160 @retval EFI_INVALID_PARAMETER Buffer is NULL. 161 161 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 162 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 162 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 163 163 and Count is not valid for this PI system. 164 164 … … 177 177 Write I/O registers. 178 178 179 The I/O operations are carried out exactly as requested. The caller is responsible 180 for satisfying any alignment and I/O width restrictions that a PI System on a 181 platform might require. For example on some platforms, width requests of 182 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 183 be handled by the driver. 184 185 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 186 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 187 each of the Count operations that is performed. 188 189 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 190 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 191 incremented for each of the Count operations that is performed. The read or 192 write operation is performed Count times on the same Address. 193 194 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 195 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 196 incremented for each of the Count operations that is performed. The read or 197 write operation is performed Count times from the first element of Buffer. 198 199 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 200 @param[in] Width Signifies the width of the I/O or Memory operation. 201 @param[in] Address The base address of the I/O operation. 202 @param[in] Count The number of I/O operations to perform. The number of 179 The I/O operations are carried out exactly as requested. The caller is responsible 180 for satisfying any alignment and I/O width restrictions that a PI System on a 181 platform might require. For example on some platforms, width requests of 182 EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will 183 be handled by the driver. 184 185 If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32, 186 or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for 187 each of the Count operations that is performed. 188 189 If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16, 190 EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is 191 incremented for each of the Count operations that is performed. The read or 192 write operation is performed Count times on the same Address. 193 194 If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16, 195 EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is 196 incremented for each of the Count operations that is performed. The read or 197 write operation is performed Count times from the first element of Buffer. 198 199 @param[in] This A pointer to the EFI_CPU_IO2_PROTOCOL instance. 200 @param[in] Width Signifies the width of the I/O or Memory operation. 201 @param[in] Address The base address of the I/O operation. 202 @param[in] Count The number of I/O operations to perform. The number of 203 203 bytes moved is Width size * Count, starting at Address. 204 204 @param[in] Buffer For read operations, the destination buffer to store the results. … … 209 209 @retval EFI_INVALID_PARAMETER Buffer is NULL. 210 210 @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. 211 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 212 and Count is not valid for this PI system. 213 211 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 212 and Count is not valid for this PI system. 213 214 214 **/ 215 215 EFI_STATUS -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf
r58459 r58466 19 19 FILE_GUID = A19B1FE7-C1BC-49F8-875F-54A5D542443F 20 20 MODULE_TYPE = DXE_DRIVER 21 VERSION_STRING = 1.0 21 VERSION_STRING = 1.0 22 22 ENTRY_POINT = CpuIo2Initialize 23 23 … … 31 31 CpuIo2Dxe.c 32 32 CpuIo2Dxe.h 33 33 34 34 [Packages] 35 35 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
r58459 r58466 3 3 4 4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 49 49 @param[in] MmioOperation TRUE for an MMIO operation, FALSE for I/O Port operation. 50 50 @param[in] Width Signifies the width of the I/O operations. 51 @param[in] Address The base address of the I/O operations. The caller is 52 responsible for aligning the Address if required. 51 @param[in] Address The base address of the I/O operations. The caller is 52 responsible for aligning the Address if required. 53 53 @param[in] Count The number of I/O operations to perform. 54 @param[in] Buffer For read operations, the destination buffer to store 55 the results. For write operations, the source buffer 54 @param[in] Buffer For read operations, the destination buffer to store 55 the results. For write operations, the source buffer 56 56 from which to write data. 57 57 … … 59 59 @retval EFI_UNSUPPORTED The Address is not valid for this system. 60 60 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 61 61 62 62 **/ 63 63 EFI_STATUS … … 93 93 return EFI_INVALID_PARAMETER; 94 94 } 95 96 // 97 // Check to see if any address associated with this transfer exceeds the maximum 95 96 // 97 // Check to see if any address associated with this transfer exceeds the maximum 98 98 // allowed address. The maximum address implied by the parameters passed in is 99 99 // Address + Size * Count. If the following condition is met, then the transfer … … 102 102 // Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1 103 103 // 104 // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 104 // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 105 105 // can also be the maximum integer value supported by the CPU, this range 106 106 // check must be adjusted to avoid all overflow conditions. 107 // 108 // The following form of the range check is equivalent but assumes that 107 // 108 // The following form of the range check is equivalent but assumes that 109 109 // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1). 110 110 // … … 114 114 return EFI_UNSUPPORTED; 115 115 } 116 } else { 116 } else { 117 117 MaxCount = RShiftU64 (Limit, Width); 118 118 if (MaxCount < (Count - 1)) { … … 123 123 } 124 124 } 125 125 126 126 // 127 127 // Check to see if Address is aligned … … 137 137 Reads memory-mapped registers. 138 138 139 The I/O operations are carried out exactly as requested. The caller is 140 responsible for any alignment and I/O width issues that the bus, device, 139 The I/O operations are carried out exactly as requested. The caller is 140 responsible for any alignment and I/O width issues that the bus, device, 141 141 platform, or type of I/O might require. 142 142 143 143 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 144 144 @param[in] Width Signifies the width of the I/O operations. 145 @param[in] Address The base address of the I/O operations. The caller is 146 responsible for aligning the Address if required. 145 @param[in] Address The base address of the I/O operations. The caller is 146 responsible for aligning the Address if required. 147 147 @param[in] Count The number of I/O operations to perform. 148 @param[out] Buffer For read operations, the destination buffer to store 149 the results. For write operations, the source buffer 148 @param[out] Buffer For read operations, the destination buffer to store 149 the results. For write operations, the source buffer 150 150 from which to write data. 151 151 … … 153 153 @retval EFI_UNSUPPORTED The Address is not valid for this system. 154 154 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 155 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 155 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 156 156 lack of resources 157 157 … … 197 197 Writes memory-mapped registers. 198 198 199 The I/O operations are carried out exactly as requested. The caller is 200 responsible for any alignment and I/O width issues that the bus, device, 199 The I/O operations are carried out exactly as requested. The caller is 200 responsible for any alignment and I/O width issues that the bus, device, 201 201 platform, or type of I/O might require. 202 202 203 203 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 204 204 @param[in] Width Signifies the width of the I/O operations. 205 @param[in] Address The base address of the I/O operations. The caller is 206 responsible for aligning the Address if required. 205 @param[in] Address The base address of the I/O operations. The caller is 206 responsible for aligning the Address if required. 207 207 @param[in] Count The number of I/O operations to perform. 208 @param[in] Buffer For read operations, the destination buffer to store 209 the results. For write operations, the source buffer 208 @param[in] Buffer For read operations, the destination buffer to store 209 the results. For write operations, the source buffer 210 210 from which to write data. 211 211 … … 213 213 @retval EFI_UNSUPPORTED The Address is not valid for this system. 214 214 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 215 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 215 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 216 216 lack of resources 217 217 … … 257 257 Reads I/O registers. 258 258 259 The I/O operations are carried out exactly as requested. The caller is 260 responsible for any alignment and I/O width issues that the bus, device, 259 The I/O operations are carried out exactly as requested. The caller is 260 responsible for any alignment and I/O width issues that the bus, device, 261 261 platform, or type of I/O might require. 262 262 263 263 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 264 264 @param[in] Width Signifies the width of the I/O operations. 265 @param[in] Address The base address of the I/O operations. The caller is 266 responsible for aligning the Address if required. 265 @param[in] Address The base address of the I/O operations. The caller is 266 responsible for aligning the Address if required. 267 267 @param[in] Count The number of I/O operations to perform. 268 @param[out] Buffer For read operations, the destination buffer to store 269 the results. For write operations, the source buffer 268 @param[out] Buffer For read operations, the destination buffer to store 269 the results. For write operations, the source buffer 270 270 from which to write data. 271 271 … … 273 273 @retval EFI_UNSUPPORTED The Address is not valid for this system. 274 274 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 275 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 275 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 276 276 lack of resources 277 277 … … 316 316 Write I/O registers. 317 317 318 The I/O operations are carried out exactly as requested. The caller is 319 responsible for any alignment and I/O width issues that the bus, device, 318 The I/O operations are carried out exactly as requested. The caller is 319 responsible for any alignment and I/O width issues that the bus, device, 320 320 platform, or type of I/O might require. 321 321 322 322 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 323 323 @param[in] Width Signifies the width of the I/O operations. 324 @param[in] Address The base address of the I/O operations. The caller is 325 responsible for aligning the Address if required. 324 @param[in] Address The base address of the I/O operations. The caller is 325 responsible for aligning the Address if required. 326 326 @param[in] Count The number of I/O operations to perform. 327 @param[in] Buffer For read operations, the destination buffer to store 328 the results. For write operations, the source buffer 327 @param[in] Buffer For read operations, the destination buffer to store 328 the results. For write operations, the source buffer 329 329 from which to write data. 330 330 … … 332 332 @retval EFI_UNSUPPORTED The Address is not valid for this system. 333 333 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 334 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 334 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 335 335 lack of resources 336 336 … … 371 371 } 372 372 } 373 373 374 374 return EFI_SUCCESS; 375 375 } … … 409 409 ); 410 410 ASSERT_EFI_ERROR (Status); 411 411 412 412 return Status; 413 413 } -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h
r48674 r58466 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 31 31 Reads memory-mapped registers. 32 32 33 The I/O operations are carried out exactly as requested. The caller is 34 responsible for any alignment and I/O width issues that the bus, device, 33 The I/O operations are carried out exactly as requested. The caller is 34 responsible for any alignment and I/O width issues that the bus, device, 35 35 platform, or type of I/O might require. 36 36 37 37 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 38 38 @param[in] Width Signifies the width of the I/O operations. 39 @param[in] Address The base address of the I/O operations. The caller is 40 responsible for aligning the Address if required. 39 @param[in] Address The base address of the I/O operations. The caller is 40 responsible for aligning the Address if required. 41 41 @param[in] Count The number of I/O operations to perform. 42 @param[out] Buffer For read operations, the destination buffer to store 43 the results. For write operations, the source buffer 42 @param[out] Buffer For read operations, the destination buffer to store 43 the results. For write operations, the source buffer 44 44 from which to write data. 45 45 … … 47 47 @retval EFI_UNSUPPORTED The Address is not valid for this system. 48 48 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 49 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 49 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 50 50 lack of resources 51 51 … … 64 64 Writes memory-mapped registers. 65 65 66 The I/O operations are carried out exactly as requested. The caller is 67 responsible for any alignment and I/O width issues that the bus, device, 66 The I/O operations are carried out exactly as requested. The caller is 67 responsible for any alignment and I/O width issues that the bus, device, 68 68 platform, or type of I/O might require. 69 69 70 70 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 71 71 @param[in] Width Signifies the width of the I/O operations. 72 @param[in] Address The base address of the I/O operations. The caller is 73 responsible for aligning the Address if required. 72 @param[in] Address The base address of the I/O operations. The caller is 73 responsible for aligning the Address if required. 74 74 @param[in] Count The number of I/O operations to perform. 75 @param[in] Buffer For read operations, the destination buffer to store 76 the results. For write operations, the source buffer 75 @param[in] Buffer For read operations, the destination buffer to store 76 the results. For write operations, the source buffer 77 77 from which to write data. 78 78 … … 80 80 @retval EFI_UNSUPPORTED The Address is not valid for this system. 81 81 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 82 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 82 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 83 83 lack of resources 84 84 … … 97 97 Reads I/O registers. 98 98 99 The I/O operations are carried out exactly as requested. The caller is 100 responsible for any alignment and I/O width issues that the bus, device, 99 The I/O operations are carried out exactly as requested. The caller is 100 responsible for any alignment and I/O width issues that the bus, device, 101 101 platform, or type of I/O might require. 102 102 103 103 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 104 104 @param[in] Width Signifies the width of the I/O operations. 105 @param[in] Address The base address of the I/O operations. The caller is 106 responsible for aligning the Address if required. 105 @param[in] Address The base address of the I/O operations. The caller is 106 responsible for aligning the Address if required. 107 107 @param[in] Count The number of I/O operations to perform. 108 @param[out] Buffer For read operations, the destination buffer to store 109 the results. For write operations, the source buffer 108 @param[out] Buffer For read operations, the destination buffer to store 109 the results. For write operations, the source buffer 110 110 from which to write data. 111 111 … … 113 113 @retval EFI_UNSUPPORTED The Address is not valid for this system. 114 114 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 115 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 115 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 116 116 lack of resources 117 117 … … 130 130 Write I/O registers. 131 131 132 The I/O operations are carried out exactly as requested. The caller is 133 responsible for any alignment and I/O width issues that the bus, device, 132 The I/O operations are carried out exactly as requested. The caller is 133 responsible for any alignment and I/O width issues that the bus, device, 134 134 platform, or type of I/O might require. 135 135 136 136 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance. 137 137 @param[in] Width Signifies the width of the I/O operations. 138 @param[in] Address The base address of the I/O operations. The caller is 139 responsible for aligning the Address if required. 138 @param[in] Address The base address of the I/O operations. The caller is 139 responsible for aligning the Address if required. 140 140 @param[in] Count The number of I/O operations to perform. 141 @param[in] Buffer For read operations, the destination buffer to store 142 the results. For write operations, the source buffer 141 @param[in] Buffer For read operations, the destination buffer to store 142 the results. For write operations, the source buffer 143 143 from which to write data. 144 144 … … 146 146 @retval EFI_UNSUPPORTED The Address is not valid for this system. 147 147 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. 148 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 148 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a 149 149 lack of resources 150 150 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
r58459 r58466 1 1 ## @file 2 # Produces the SMM CPU I/O 2 Protocol by using the services of the I/O Library. 2 # Produces the SMM CPU I/O 2 Protocol by using the services of the I/O Library. 3 3 # 4 4 # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> … … 25 25 # The following information is for reference only and not required by the build tools. 26 26 # 27 # VALID_ARCHITECTURES = IA32 X64 27 # VALID_ARCHITECTURES = IA32 X64 28 28 # 29 29 … … 31 31 CpuIo2Smm.c 32 32 CpuIo2Smm.h 33 33 34 34 [Packages] 35 35 MdePkg/MdePkg.dec … … 42 42 SmmServicesTableLib 43 43 BaseMemoryLib 44 44 45 45 [Protocols] 46 46 gEfiSmmCpuIo2ProtocolGuid ## PRODUCES -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIoPei/CpuIoPei.c
r58459 r58466 3 3 4 4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 53 53 NULL 54 54 }; 55 55 56 56 // 57 57 // Lookup table for increment values based on transfer widths … … 102 102 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 103 103 @retval EFI_INVALID_PARAMETER Buffer is NULL. 104 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 104 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 105 105 and Count is not valid for this EFI system. 106 106 107 107 **/ 108 108 EFI_STATUS … … 147 147 return EFI_INVALID_PARAMETER; 148 148 } 149 150 // 151 // Check to see if any address associated with this transfer exceeds the maximum 149 150 // 151 // Check to see if any address associated with this transfer exceeds the maximum 152 152 // allowed address. The maximum address implied by the parameters passed in is 153 153 // Address + Size * Count. If the following condition is met, then the transfer … … 156 156 // Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1 157 157 // 158 // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 158 // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count 159 159 // can also be the maximum integer value supported by the CPU, this range 160 160 // check must be adjusted to avoid all overflow conditions. 161 // 162 // The following form of the range check is equivalent but assumes that 161 // 162 // The following form of the range check is equivalent but assumes that 163 163 // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1). 164 164 // … … 168 168 return EFI_UNSUPPORTED; 169 169 } 170 } else { 170 } else { 171 171 MaxCount = RShiftU64 (Limit, Width); 172 172 if (MaxCount < (Count - 1)) { … … 177 177 } 178 178 } 179 179 180 180 return EFI_SUCCESS; 181 181 } … … 195 195 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 196 196 @retval EFI_INVALID_PARAMETER Buffer is NULL. 197 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 197 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 198 198 and Count is not valid for this EFI system. 199 199 … … 269 269 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 270 270 @retval EFI_INVALID_PARAMETER Buffer is NULL. 271 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 271 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 272 272 and Count is not valid for this EFI system. 273 273 … … 343 343 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 344 344 @retval EFI_INVALID_PARAMETER Buffer is NULL. 345 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 345 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 346 346 and Count is not valid for this EFI system. 347 347 … … 412 412 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 413 413 @retval EFI_INVALID_PARAMETER Buffer is NULL. 414 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 414 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 415 415 and Count is not valid for this EFI system. 416 416 … … 466 466 } 467 467 } 468 468 469 469 return EFI_SUCCESS; 470 470 } … … 473 473 8-bit I/O read operations. 474 474 475 @param[in] PeiServices An indirect pointer to the PEI Services Table published 475 @param[in] PeiServices An indirect pointer to the PEI Services Table published 476 476 by the PEI Foundation. 477 477 @param[in] This Pointer to local data for the interface. … … 494 494 16-bit I/O read operations. 495 495 496 @param[in] PeiServices An indirect pointer to the PEI Services Table published 496 @param[in] PeiServices An indirect pointer to the PEI Services Table published 497 497 by the PEI Foundation. 498 498 @param[in] This Pointer to local data for the interface. … … 516 516 32-bit I/O read operations. 517 517 518 @param[in] PeiServices An indirect pointer to the PEI Services Table published 518 @param[in] PeiServices An indirect pointer to the PEI Services Table published 519 519 by the PEI Foundation. 520 520 @param[in] This Pointer to local data for the interface. … … 538 538 64-bit I/O read operations. 539 539 540 @param[in] PeiServices An indirect pointer to the PEI Services Table published 540 @param[in] PeiServices An indirect pointer to the PEI Services Table published 541 541 by the PEI Foundation. 542 542 @param[in] This Pointer to local data for the interface. … … 560 560 8-bit I/O write operations. 561 561 562 @param[in] PeiServices An indirect pointer to the PEI Services Table published 562 @param[in] PeiServices An indirect pointer to the PEI Services Table published 563 563 by the PEI Foundation. 564 564 @param[in] This Pointer to local data for the interface. … … 582 582 16-bit I/O write operations. 583 583 584 @param[in] PeiServices An indirect pointer to the PEI Services Table published 584 @param[in] PeiServices An indirect pointer to the PEI Services Table published 585 585 by the PEI Foundation. 586 586 @param[in] This Pointer to local data for the interface. … … 604 604 32-bit I/O write operations. 605 605 606 @param[in] PeiServices An indirect pointer to the PEI Services Table published 606 @param[in] PeiServices An indirect pointer to the PEI Services Table published 607 607 by the PEI Foundation. 608 608 @param[in] This Pointer to local data for the interface. … … 626 626 64-bit I/O write operations. 627 627 628 @param[in] PeiServices An indirect pointer to the PEI Services Table published 628 @param[in] PeiServices An indirect pointer to the PEI Services Table published 629 629 by the PEI Foundation. 630 630 @param[in] This Pointer to local data for the interface. … … 648 648 8-bit memory read operations. 649 649 650 @param[in] PeiServices An indirect pointer to the PEI Services Table published 650 @param[in] PeiServices An indirect pointer to the PEI Services Table published 651 651 by the PEI Foundation. 652 652 @param[in] This Pointer to local data for the interface. … … 670 670 16-bit memory read operations. 671 671 672 @param[in] PeiServices An indirect pointer to the PEI Services Table published 672 @param[in] PeiServices An indirect pointer to the PEI Services Table published 673 673 by the PEI Foundation. 674 674 @param[in] This Pointer to local data for the interface. … … 692 692 32-bit memory read operations. 693 693 694 @param[in] PeiServices An indirect pointer to the PEI Services Table published 694 @param[in] PeiServices An indirect pointer to the PEI Services Table published 695 695 by the PEI Foundation. 696 696 @param[in] This Pointer to local data for the interface. … … 714 714 64-bit memory read operations. 715 715 716 @param[in] PeiServices An indirect pointer to the PEI Services Table published 716 @param[in] PeiServices An indirect pointer to the PEI Services Table published 717 717 by the PEI Foundation. 718 718 @param[in] This Pointer to local data for the interface. … … 736 736 8-bit memory write operations. 737 737 738 @param[in] PeiServices An indirect pointer to the PEI Services Table published 738 @param[in] PeiServices An indirect pointer to the PEI Services Table published 739 739 by the PEI Foundation. 740 740 @param[in] This Pointer to local data for the interface. … … 758 758 16-bit memory write operations. 759 759 760 @param[in] PeiServices An indirect pointer to the PEI Services Table published 760 @param[in] PeiServices An indirect pointer to the PEI Services Table published 761 761 by the PEI Foundation. 762 762 @param[in] This Pointer to local data for the interface. … … 780 780 32-bit memory write operations. 781 781 782 @param[in] PeiServices An indirect pointer to the PEI Services Table published 782 @param[in] PeiServices An indirect pointer to the PEI Services Table published 783 783 by the PEI Foundation. 784 784 @param[in] This Pointer to local data for the interface. … … 802 802 64-bit memory write operations. 803 803 804 @param[in] PeiServices An indirect pointer to the PEI Services Table published 804 @param[in] PeiServices An indirect pointer to the PEI Services Table published 805 805 by the PEI Foundation. 806 806 @param[in] This Pointer to local data for the interface. … … 827 827 828 828 @param[in] FileHandle Pointer to image file handle. 829 @param[in] PeiServices Pointer to PEI Services Table 829 @param[in] PeiServices Pointer to PEI Services Table 830 830 831 831 @retval EFI_SUCCESS CPU I/O PPI successfully installed … … 845 845 // 846 846 Status = PeiServicesRegisterForShadow (FileHandle); 847 847 848 848 // 849 849 // Make CpuIo pointer in PeiService table point to gCpuIoPpi 850 850 // 851 851 (*((EFI_PEI_SERVICES **)PeiServices))->CpuIo = &gCpuIoPpi; 852 852 853 853 if (Status == EFI_ALREADY_STARTED) { 854 854 // … … 860 860 ASSERT_EFI_ERROR (Status); 861 861 } 862 862 863 863 return EFI_SUCCESS; 864 864 } -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIoPei/CpuIoPei.h
r48674 r58466 3 3 4 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 12 13 13 **/ … … 41 41 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 42 42 @retval EFI_INVALID_PARAMETER Buffer is NULL. 43 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 43 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 44 44 and Count is not valid for this EFI system. 45 45 … … 70 70 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 71 71 @retval EFI_INVALID_PARAMETER Buffer is NULL. 72 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 72 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 73 73 and Count is not valid for this EFI system. 74 74 … … 99 99 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 100 100 @retval EFI_INVALID_PARAMETER Buffer is NULL. 101 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 101 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 102 102 and Count is not valid for this EFI system. 103 103 … … 128 128 @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system. 129 129 @retval EFI_INVALID_PARAMETER Buffer is NULL. 130 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 130 @retval EFI_UNSUPPORTED The address range specified by Address, Width, 131 131 and Count is not valid for this EFI system. 132 132 … … 146 146 8-bit I/O read operations. 147 147 148 @param[in] PeiServices An indirect pointer to the PEI Services Table published 148 @param[in] PeiServices An indirect pointer to the PEI Services Table published 149 149 by the PEI Foundation. 150 150 @param[in] This Pointer to local data for the interface. … … 164 164 16-bit I/O read operations. 165 165 166 @param[in] PeiServices An indirect pointer to the PEI Services Table published 166 @param[in] PeiServices An indirect pointer to the PEI Services Table published 167 167 by the PEI Foundation. 168 168 @param[in] This Pointer to local data for the interface. … … 183 183 32-bit I/O read operations. 184 184 185 @param[in] PeiServices An indirect pointer to the PEI Services Table published 185 @param[in] PeiServices An indirect pointer to the PEI Services Table published 186 186 by the PEI Foundation. 187 187 @param[in] This Pointer to local data for the interface. … … 202 202 64-bit I/O read operations. 203 203 204 @param[in] PeiServices An indirect pointer to the PEI Services Table published 204 @param[in] PeiServices An indirect pointer to the PEI Services Table published 205 205 by the PEI Foundation. 206 206 @param[in] This Pointer to local data for the interface. … … 221 221 8-bit I/O write operations. 222 222 223 @param[in] PeiServices An indirect pointer to the PEI Services Table published 223 @param[in] PeiServices An indirect pointer to the PEI Services Table published 224 224 by the PEI Foundation. 225 225 @param[in] This Pointer to local data for the interface. … … 240 240 16-bit I/O write operations. 241 241 242 @param[in] PeiServices An indirect pointer to the PEI Services Table published 242 @param[in] PeiServices An indirect pointer to the PEI Services Table published 243 243 by the PEI Foundation. 244 244 @param[in] This Pointer to local data for the interface. … … 259 259 32-bit I/O write operations. 260 260 261 @param[in] PeiServices An indirect pointer to the PEI Services Table published 261 @param[in] PeiServices An indirect pointer to the PEI Services Table published 262 262 by the PEI Foundation. 263 263 @param[in] This Pointer to local data for the interface. … … 278 278 64-bit I/O write operations. 279 279 280 @param[in] PeiServices An indirect pointer to the PEI Services Table published 280 @param[in] PeiServices An indirect pointer to the PEI Services Table published 281 281 by the PEI Foundation. 282 282 @param[in] This Pointer to local data for the interface. … … 297 297 8-bit memory read operations. 298 298 299 @param[in] PeiServices An indirect pointer to the PEI Services Table published 299 @param[in] PeiServices An indirect pointer to the PEI Services Table published 300 300 by the PEI Foundation. 301 301 @param[in] This Pointer to local data for the interface. … … 316 316 16-bit memory read operations. 317 317 318 @param[in] PeiServices An indirect pointer to the PEI Services Table published 318 @param[in] PeiServices An indirect pointer to the PEI Services Table published 319 319 by the PEI Foundation. 320 320 @param[in] This Pointer to local data for the interface. … … 335 335 32-bit memory read operations. 336 336 337 @param[in] PeiServices An indirect pointer to the PEI Services Table published 337 @param[in] PeiServices An indirect pointer to the PEI Services Table published 338 338 by the PEI Foundation. 339 339 @param[in] This Pointer to local data for the interface. … … 354 354 64-bit memory read operations. 355 355 356 @param[in] PeiServices An indirect pointer to the PEI Services Table published 356 @param[in] PeiServices An indirect pointer to the PEI Services Table published 357 357 by the PEI Foundation. 358 358 @param[in] This Pointer to local data for the interface. … … 373 373 8-bit memory write operations. 374 374 375 @param[in] PeiServices An indirect pointer to the PEI Services Table published 375 @param[in] PeiServices An indirect pointer to the PEI Services Table published 376 376 by the PEI Foundation. 377 377 @param[in] This Pointer to local data for the interface. … … 392 392 16-bit memory write operations. 393 393 394 @param[in] PeiServices An indirect pointer to the PEI Services Table published 394 @param[in] PeiServices An indirect pointer to the PEI Services Table published 395 395 by the PEI Foundation. 396 396 @param[in] This Pointer to local data for the interface. … … 411 411 32-bit memory write operations. 412 412 413 @param[in] PeiServices An indirect pointer to the PEI Services Table published 413 @param[in] PeiServices An indirect pointer to the PEI Services Table published 414 414 by the PEI Foundation. 415 415 @param[in] This Pointer to local data for the interface. … … 430 430 64-bit memory write operations. 431 431 432 @param[in] PeiServices An indirect pointer to the PEI Services Table published 432 @param[in] PeiServices An indirect pointer to the PEI Services Table published 433 433 by the PEI Foundation. 434 434 @param[in] This Pointer to local data for the interface. … … 445 445 IN UINT64 Data 446 446 ); 447 447 448 448 #endif -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/CpuIoPei/CpuIoPei.inf
r58459 r58466 19 19 FILE_GUID = AE265864-CF5D-41a8-913D-71C155E76442 20 20 MODULE_TYPE = PEIM 21 VERSION_STRING = 1.0 21 VERSION_STRING = 1.0 22 22 ENTRY_POINT = CpuIoInitialize 23 23 … … 31 31 CpuIoPei.c 32 32 CpuIoPei.h 33 33 34 34 [Packages] 35 35 MdePkg/MdePkg.dec -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Include/Library/LocalApicLib.h
r58459 r58466 83 83 84 84 In xAPIC mode, the initial local APIC ID may be different from current APIC ID. 85 In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 85 In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 86 86 the 32-bit local APIC ID is returned as initial APIC ID. 87 87 … … 119 119 Send a Fixed IPI to a specified target processor. 120 120 121 This function returns after the IPI has been accepted by the target processor. 121 This function returns after the IPI has been accepted by the target processor. 122 122 123 123 @param ApicId The local APIC ID of the target processor. … … 134 134 Send a Fixed IPI to all processors excluding self. 135 135 136 This function returns after the IPI has been accepted by the target processors. 136 This function returns after the IPI has been accepted by the target processors. 137 137 138 138 @param Vector The vector number of the interrupt being sent. … … 147 147 Send a SMI IPI to a specified target processor. 148 148 149 This function returns after the IPI has been accepted by the target processor. 149 This function returns after the IPI has been accepted by the target processor. 150 150 151 151 @param ApicId Specify the local APIC ID of the target processor. … … 160 160 Send a SMI IPI to all processors excluding self. 161 161 162 This function returns after the IPI has been accepted by the target processors. 162 This function returns after the IPI has been accepted by the target processors. 163 163 **/ 164 164 VOID … … 171 171 Send an INIT IPI to a specified target processor. 172 172 173 This function returns after the IPI has been accepted by the target processor. 173 This function returns after the IPI has been accepted by the target processor. 174 174 175 175 @param ApicId Specify the local APIC ID of the target processor. … … 184 184 Send an INIT IPI to all processors excluding self. 185 185 186 This function returns after the IPI has been accepted by the target processors. 186 This function returns after the IPI has been accepted by the target processors. 187 187 **/ 188 188 VOID … … 195 195 Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. 196 196 197 This function returns after the IPI has been accepted by the target processor. 197 This function returns after the IPI has been accepted by the target processor. 198 198 199 199 if StartupRoutine >= 1M, then ASSERT. … … 214 214 Send an INIT-Start-up-Start-up IPI sequence to all processors excluding self. 215 215 216 This function returns after the IPI has been accepted by the target processors. 216 This function returns after the IPI has been accepted by the target processors. 217 217 218 218 if StartupRoutine >= 1M, then ASSERT. … … 350 350 351 351 /** 352 Get the 32-bit address that a device should use to send a Message Signaled 352 Get the 32-bit address that a device should use to send a Message Signaled 353 353 Interrupt (MSI) to the Local APIC of the currently executing processor. 354 354 … … 356 356 **/ 357 357 UINT32 358 EFIAPI 358 EFIAPI 359 359 GetApicMsiAddress ( 360 360 VOID 361 361 ); 362 363 /** 364 Get the 64-bit data value that a device should use to send a Message Signaled 362 363 /** 364 Get the 64-bit data value that a device should use to send a Message Signaled 365 365 Interrupt (MSI) to the Local APIC of the currently executing processor. 366 366 367 367 If Vector is not in range 0x10..0xFE, then ASSERT(). 368 368 If DeliveryMode is not supported, then ASSERT(). 369 370 @param Vector The 8-bit interrupt vector associated with the MSI. 369 370 @param Vector The 8-bit interrupt vector associated with the MSI. 371 371 Must be in the range 0x10..0xFE 372 @param DeliveryMode A 3-bit value that specifies how the recept of the MSI 372 @param DeliveryMode A 3-bit value that specifies how the recept of the MSI 373 373 is handled. The only supported values are: 374 374 0: LOCAL_APIC_DELIVERY_MODE_FIXED … … 378 378 5: LOCAL_APIC_DELIVERY_MODE_INIT 379 379 7: LOCAL_APIC_DELIVERY_MODE_EXTINT 380 381 @param LevelTriggered TRUE specifies a level triggered interrupt. 380 381 @param LevelTriggered TRUE specifies a level triggered interrupt. 382 382 FALSE specifies an edge triggered interrupt. 383 383 @param AssertionLevel Ignored if LevelTriggered is FALSE. 384 TRUE specifies a level triggered interrupt that active 384 TRUE specifies a level triggered interrupt that active 385 385 when the interrupt line is asserted. 386 FALSE specifies a level triggered interrupt that active 386 FALSE specifies a level triggered interrupt that active 387 387 when the interrupt line is deasserted. 388 388 … … 390 390 **/ 391 391 UINT64 392 EFIAPI 392 EFIAPI 393 393 GetApicMsiValue ( 394 394 IN UINT8 Vector, … … 397 397 IN BOOLEAN AssertionLevel 398 398 ); 399 399 400 400 #endif 401 401 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
r58459 r58466 9 9 # which accompanies this distribution. The full text of the license may be found at 10 10 # http://opensource.org/licenses/bsd-license.php 11 # 11 # 12 12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 # 14 # 15 15 ## 16 16 … … 22 22 MODULE_TYPE = BASE 23 23 VERSION_STRING = 1.0 24 LIBRARY_CLASS = UefiCpuLib 24 LIBRARY_CLASS = UefiCpuLib 25 25 26 26 # -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseUefiCpuLib/Ia32/InitializeFpu.S
r48674 r58466 14 14 15 15 # 16 # Float control word initial value: 16 # Float control word initial value: 17 17 # all exceptions masked, double-precision, round-to-nearest 18 18 # … … 42 42 finit 43 43 fldcw ASM_PFX(mFpuControlWord) 44 44 45 45 # 46 46 # Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] = 1) to test … … 51 51 btl $25, %edx 52 52 jnc Done 53 53 54 54 # 55 55 # Set OSFXSR bit 9 in CR4 56 56 # 57 movl %cr4, %eax 57 movl %cr4, %eax 58 58 or $0x200, %eax 59 59 movl %eax, %cr4 60 60 61 61 # 62 62 # The processor should support SSE instruction and we can use -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseUefiCpuLib/Ia32/InitializeFpu.asm
r48674 r58466 10 10 ;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 11 ;* 12 ;* 12 ;* 13 13 ;------------------------------------------------------------------------------ 14 14 … … 18 18 .const 19 19 ; 20 ; Float control word initial value: 20 ; Float control word initial value: 21 21 ; all exceptions masked, double-precision, round-to-nearest 22 22 ; … … 26 26 ; all exceptions masked, round-to-nearest, flush to zero for masked underflow 27 27 ; 28 mMmxControlWord DD 01F80h 28 mMmxControlWord DD 01F80h 29 29 30 30 .xmm … … 48 48 finit 49 49 fldcw mFpuControlWord 50 50 51 51 ; 52 52 ; Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] = 1) to test … … 57 57 bt edx, 25 58 58 jnc Done 59 59 60 60 ; 61 61 ; Set OSFXSR bit 9 in CR4 … … 64 64 or eax, BIT9 65 65 mov cr4, eax 66 66 67 67 ; 68 68 ; The processor should support SSE instruction and we can use -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseUefiCpuLib/X64/InitializeFpu.S
r58459 r58466 28 28 # 29 29 finit 30 30 31 31 # 32 # Float control word initial value: 32 # Float control word initial value: 33 33 # all exceptions masked, double-precision, round-to-nearest 34 34 # 35 35 pushq $0x037F 36 lea (%rsp), %rax 36 lea (%rsp), %rax 37 37 fldcw (%rax) 38 38 popq %rax 39 39 40 40 # 41 41 # Set OSFXSR bit 9 in CR4 42 42 # 43 movq %cr4, %rax 43 movq %cr4, %rax 44 44 or $0x200, %rax 45 45 movq %rax, %cr4 … … 48 48 # Multimedia-extensions control word: 49 49 # all exceptions masked, round-to-nearest, flush to zero for masked underflow 50 # 50 # 51 51 pushq $0x01F80 52 52 lea (%rsp), %rax 53 53 ldmxcsr (%rax) 54 54 popq %rax 55 55 56 56 ret 57 57 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseUefiCpuLib/X64/InitializeFpu.asm
r58459 r58466 16 16 .const 17 17 ; 18 ; Float control word initial value: 18 ; Float control word initial value: 19 19 ; all exceptions masked, double-extended-precision, round-to-nearest 20 20 ; … … 24 24 ; all exceptions masked, round-to-nearest, flush to zero for masked underflow 25 25 ; 26 mMmxControlWord DD 01F80h 26 mMmxControlWord DD 01F80h 27 27 28 28 .code … … 42 42 ; Initialize floating point units 43 43 ; 44 ; The following opcodes stand for instruction 'finit' 44 ; The following opcodes stand for instruction 'finit' 45 45 ; to be supported by some 64-bit assemblers 46 46 ; 47 47 DB 9Bh, 0DBh, 0E3h 48 48 fldcw mFpuControlWord 49 49 50 50 ; 51 51 ; Set OSFXSR bit 9 in CR4 … … 56 56 57 57 ldmxcsr mMmxControlWord 58 58 59 59 ret 60 60 InitializeFloatingPointUnits ENDP -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c
r58459 r58466 40 40 { 41 41 MSR_IA32_APIC_BASE ApicBaseMsr; 42 42 43 43 ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE_ADDRESS); 44 44 45 45 return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHigh, 32)) + 46 46 (((UINTN)ApicBaseMsr.Bits.ApicBaseLow) << 12); … … 128 128 Send an IPI by writing to ICR. 129 129 130 This function returns after the IPI has been accepted by the target processor. 130 This function returns after the IPI has been accepted by the target processor. 131 131 132 132 @param IcrLow 32-bit value to be written to the low half of ICR. … … 241 241 242 242 In xAPIC mode, the initial local APIC ID may be different from current APIC ID. 243 In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 243 In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 244 244 the 32-bit local APIC ID is returned as initial APIC ID. 245 245 … … 264 264 265 265 // 266 // If CPUID Leaf B is supported, 266 // If CPUID Leaf B is supported, 267 267 // Then the initial 32-bit APIC ID = CPUID.0BH:EDX 268 268 // Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24] … … 291 291 292 292 ASSERT (GetApicMode () == LOCAL_APIC_MODE_XAPIC); 293 293 294 294 if ((ApicId = GetInitialApicId ()) < 0x100) { 295 295 // … … 320 320 Send a Fixed IPI to a specified target processor. 321 321 322 This function returns after the IPI has been accepted by the target processor. 322 This function returns after the IPI has been accepted by the target processor. 323 323 324 324 @param ApicId The local APIC ID of the target processor. … … 344 344 Send a Fixed IPI to all processors excluding self. 345 345 346 This function returns after the IPI has been accepted by the target processors. 346 This function returns after the IPI has been accepted by the target processors. 347 347 348 348 @param Vector The vector number of the interrupt being sent. … … 367 367 Send a SMI IPI to a specified target processor. 368 368 369 This function returns after the IPI has been accepted by the target processor. 369 This function returns after the IPI has been accepted by the target processor. 370 370 371 371 @param ApicId Specify the local APIC ID of the target processor. … … 388 388 Send a SMI IPI to all processors excluding self. 389 389 390 This function returns after the IPI has been accepted by the target processors. 390 This function returns after the IPI has been accepted by the target processors. 391 391 **/ 392 392 VOID … … 408 408 Send an INIT IPI to a specified target processor. 409 409 410 This function returns after the IPI has been accepted by the target processor. 410 This function returns after the IPI has been accepted by the target processor. 411 411 412 412 @param ApicId Specify the local APIC ID of the target processor. … … 429 429 Send an INIT IPI to all processors excluding self. 430 430 431 This function returns after the IPI has been accepted by the target processors. 431 This function returns after the IPI has been accepted by the target processors. 432 432 **/ 433 433 VOID … … 449 449 Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. 450 450 451 This function returns after the IPI has been accepted by the target processor. 451 This function returns after the IPI has been accepted by the target processor. 452 452 453 453 if StartupRoutine >= 1M, then ASSERT. … … 484 484 Send an INIT-Start-up-Start-up IPI sequence to all processors excluding self. 485 485 486 This function returns after the IPI has been accepted by the target processors. 486 This function returns after the IPI has been accepted by the target processors. 487 487 488 488 if StartupRoutine >= 1M, then ASSERT. … … 656 656 Dcr.Bits.DivideValue1 = (Divisor & 0x3); 657 657 Dcr.Bits.DivideValue2 = (Divisor >> 2); 658 WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32); 658 WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32); 659 659 } 660 660 … … 777 777 778 778 /** 779 Get the 32-bit address that a device should use to send a Message Signaled 779 Get the 32-bit address that a device should use to send a Message Signaled 780 780 Interrupt (MSI) to the Local APIC of the currently executing processor. 781 781 … … 783 783 **/ 784 784 UINT32 785 EFIAPI 785 EFIAPI 786 786 GetApicMsiAddress ( 787 787 VOID … … 791 791 792 792 // 793 // Return address for an MSI interrupt to be delivered only to the APIC ID 793 // Return address for an MSI interrupt to be delivered only to the APIC ID 794 794 // of the currently executing processor. 795 795 // … … 799 799 return MsiAddress.Uint32; 800 800 } 801 802 /** 803 Get the 64-bit data value that a device should use to send a Message Signaled 801 802 /** 803 Get the 64-bit data value that a device should use to send a Message Signaled 804 804 Interrupt (MSI) to the Local APIC of the currently executing processor. 805 805 806 806 If Vector is not in range 0x10..0xFE, then ASSERT(). 807 807 If DeliveryMode is not supported, then ASSERT(). 808 809 @param Vector The 8-bit interrupt vector associated with the MSI. 808 809 @param Vector The 8-bit interrupt vector associated with the MSI. 810 810 Must be in the range 0x10..0xFE 811 @param DeliveryMode A 3-bit value that specifies how the recept of the MSI 811 @param DeliveryMode A 3-bit value that specifies how the recept of the MSI 812 812 is handled. The only supported values are: 813 813 0: LOCAL_APIC_DELIVERY_MODE_FIXED … … 817 817 5: LOCAL_APIC_DELIVERY_MODE_INIT 818 818 7: LOCAL_APIC_DELIVERY_MODE_EXTINT 819 820 @param LevelTriggered TRUE specifies a level triggered interrupt. 819 820 @param LevelTriggered TRUE specifies a level triggered interrupt. 821 821 FALSE specifies an edge triggered interrupt. 822 822 @param AssertionLevel Ignored if LevelTriggered is FALSE. 823 TRUE specifies a level triggered interrupt that active 823 TRUE specifies a level triggered interrupt that active 824 824 when the interrupt line is asserted. 825 FALSE specifies a level triggered interrupt that active 825 FALSE specifies a level triggered interrupt that active 826 826 when the interrupt line is deasserted. 827 827 … … 829 829 **/ 830 830 UINT64 831 EFIAPI 831 EFIAPI 832 832 GetApicMsiValue ( 833 833 IN UINT8 Vector, … … 841 841 ASSERT (Vector >= 0x10 && Vector <= 0xFE); 842 842 ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3); 843 843 844 844 MsiData.Uint64 = 0; 845 845 MsiData.Bits.Vector = Vector; -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf
r58459 r58466 10 10 # which accompanies this distribution. The full text of the license may be found at 11 11 # http://opensource.org/licenses/bsd-license.php 12 # 12 # 13 13 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 14 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 # 15 # 16 16 ## 17 17 … … 23 23 MODULE_TYPE = BASE 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = LocalApicLib 25 LIBRARY_CLASS = LocalApicLib 26 26 27 27 # -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c
r58459 r58466 41 41 { 42 42 MSR_IA32_APIC_BASE ApicBaseMsr; 43 43 44 44 ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE_ADDRESS); 45 45 46 46 return (UINTN)(LShiftU64 ((UINT64) ApicBaseMsr.Bits.ApicBaseHigh, 32)) + 47 47 (((UINTN)ApicBaseMsr.Bits.ApicBaseLow) << 12); … … 167 167 Send an IPI by writing to ICR. 168 168 169 This function returns after the IPI has been accepted by the target processor. 169 This function returns after the IPI has been accepted by the target processor. 170 170 171 171 @param IcrLow 32-bit value to be written to the low half of ICR. … … 232 232 } else { 233 233 // 234 // For x2APIC, A single MSR write to the Interrupt Command Register is required for dispatching an 234 // For x2APIC, A single MSR write to the Interrupt Command Register is required for dispatching an 235 235 // interrupt in x2APIC mode. 236 236 // … … 331 331 332 332 In xAPIC mode, the initial local APIC ID may be different from current APIC ID. 333 In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 333 In x2APIC mode, the local APIC ID can't be changed and there is no concept of initial APIC ID. In this case, 334 334 the 32-bit local APIC ID is returned as initial APIC ID. 335 335 … … 352 352 AsmCpuid (CPUID_SIGNATURE, &MaxCpuIdIndex, NULL, NULL, NULL); 353 353 // 354 // If CPUID Leaf B is supported, 354 // If CPUID Leaf B is supported, 355 355 // Then the initial 32-bit APIC ID = CPUID.0BH:EDX 356 356 // Else the initial 8-bit APIC ID = CPUID.1:EBX[31:24] … … 406 406 Send a Fixed IPI to a specified target processor. 407 407 408 This function returns after the IPI has been accepted by the target processor. 408 This function returns after the IPI has been accepted by the target processor. 409 409 410 410 @param ApicId The local APIC ID of the target processor. … … 430 430 Send a Fixed IPI to all processors excluding self. 431 431 432 This function returns after the IPI has been accepted by the target processors. 432 This function returns after the IPI has been accepted by the target processors. 433 433 434 434 @param Vector The vector number of the interrupt being sent. … … 453 453 Send a SMI IPI to a specified target processor. 454 454 455 This function returns after the IPI has been accepted by the target processor. 455 This function returns after the IPI has been accepted by the target processor. 456 456 457 457 @param ApicId Specify the local APIC ID of the target processor. … … 474 474 Send a SMI IPI to all processors excluding self. 475 475 476 This function returns after the IPI has been accepted by the target processors. 476 This function returns after the IPI has been accepted by the target processors. 477 477 **/ 478 478 VOID … … 494 494 Send an INIT IPI to a specified target processor. 495 495 496 This function returns after the IPI has been accepted by the target processor. 496 This function returns after the IPI has been accepted by the target processor. 497 497 498 498 @param ApicId Specify the local APIC ID of the target processor. … … 515 515 Send an INIT IPI to all processors excluding self. 516 516 517 This function returns after the IPI has been accepted by the target processors. 517 This function returns after the IPI has been accepted by the target processors. 518 518 **/ 519 519 VOID … … 535 535 Send an INIT-Start-up-Start-up IPI sequence to a specified target processor. 536 536 537 This function returns after the IPI has been accepted by the target processor. 537 This function returns after the IPI has been accepted by the target processor. 538 538 539 539 if StartupRoutine >= 1M, then ASSERT. … … 570 570 Send an INIT-Start-up-Start-up IPI sequence to all processors excluding self. 571 571 572 This function returns after the IPI has been accepted by the target processors. 572 This function returns after the IPI has been accepted by the target processors. 573 573 574 574 if StartupRoutine >= 1M, then ASSERT. … … 742 742 Dcr.Bits.DivideValue1 = (Divisor & 0x3); 743 743 Dcr.Bits.DivideValue2 = (Divisor >> 2); 744 WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32); 744 WriteLocalApicReg (XAPIC_TIMER_DIVIDE_CONFIGURATION_OFFSET, Dcr.Uint32); 745 745 } 746 746 … … 863 863 864 864 /** 865 Get the 32-bit address that a device should use to send a Message Signaled 865 Get the 32-bit address that a device should use to send a Message Signaled 866 866 Interrupt (MSI) to the Local APIC of the currently executing processor. 867 867 … … 869 869 **/ 870 870 UINT32 871 EFIAPI 871 EFIAPI 872 872 GetApicMsiAddress ( 873 873 VOID … … 877 877 878 878 // 879 // Return address for an MSI interrupt to be delivered only to the APIC ID 879 // Return address for an MSI interrupt to be delivered only to the APIC ID 880 880 // of the currently executing processor. 881 881 // … … 885 885 return MsiAddress.Uint32; 886 886 } 887 888 /** 889 Get the 64-bit data value that a device should use to send a Message Signaled 887 888 /** 889 Get the 64-bit data value that a device should use to send a Message Signaled 890 890 Interrupt (MSI) to the Local APIC of the currently executing processor. 891 891 892 892 If Vector is not in range 0x10..0xFE, then ASSERT(). 893 893 If DeliveryMode is not supported, then ASSERT(). 894 895 @param Vector The 8-bit interrupt vector associated with the MSI. 894 895 @param Vector The 8-bit interrupt vector associated with the MSI. 896 896 Must be in the range 0x10..0xFE 897 @param DeliveryMode A 3-bit value that specifies how the recept of the MSI 897 @param DeliveryMode A 3-bit value that specifies how the recept of the MSI 898 898 is handled. The only supported values are: 899 899 0: LOCAL_APIC_DELIVERY_MODE_FIXED … … 903 903 5: LOCAL_APIC_DELIVERY_MODE_INIT 904 904 7: LOCAL_APIC_DELIVERY_MODE_EXTINT 905 906 @param LevelTriggered TRUE specifies a level triggered interrupt. 905 906 @param LevelTriggered TRUE specifies a level triggered interrupt. 907 907 FALSE specifies an edge triggered interrupt. 908 908 @param AssertionLevel Ignored if LevelTriggered is FALSE. 909 TRUE specifies a level triggered interrupt that active 909 TRUE specifies a level triggered interrupt that active 910 910 when the interrupt line is asserted. 911 FALSE specifies a level triggered interrupt that active 911 FALSE specifies a level triggered interrupt that active 912 912 when the interrupt line is deasserted. 913 913 … … 915 915 **/ 916 916 UINT64 917 EFIAPI 917 EFIAPI 918 918 GetApicMsiValue ( 919 919 IN UINT8 Vector, … … 927 927 ASSERT (Vector >= 0x10 && Vector <= 0xFE); 928 928 ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3); 929 929 930 930 MsiData.Uint64 = 0; 931 931 MsiData.Bits.Vector = Vector; -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf
r58459 r58466 10 10 # which accompanies this distribution. The full text of the license may be found at 11 11 # http://opensource.org/licenses/bsd-license.php 12 # 12 # 13 13 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 14 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 # 15 # 16 16 ## 17 17 … … 23 23 MODULE_TYPE = BASE 24 24 VERSION_STRING = 1.0 25 LIBRARY_CLASS = LocalApicLib 25 LIBRARY_CLASS = LocalApicLib 26 26 27 27 # -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c
r58464 r58466 25 25 26 26 // 27 // Define the maximum message length 27 // Define the maximum message length 28 28 // 29 29 #define MAX_DEBUG_MESSAGE_LENGTH 0x100 … … 33 33 34 34 @param Format Format string for the message to print. 35 @param ... Variable argument list whose contents are accessed 35 @param ... Variable argument list whose contents are accessed 36 36 based on the format string specified by Format. 37 37 … … 55 55 56 56 // 57 // Send the print string to a Serial Port 57 // Send the print string to a Serial Port 58 58 // 59 59 SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); … … 62 62 /** 63 63 Find and display image base address and return image base and its entry point. 64 64 65 65 @param CurrentEip Current instruction pointer. 66 66 @param EntryPoint Return module entry point if module header is found. 67 67 68 68 @return !0 Image base address. 69 69 @return 0 Image header cannot be found. 70 70 **/ 71 UINTN 71 UINTN 72 72 FindModuleImageBase ( 73 73 IN UINTN CurrentEip, … … 122 122 // 123 123 // Not found the image base, check the previous aligned address 124 // 124 // 125 125 Pe32Data -= mImageAlignSize; 126 126 } … … 142 142 /** 143 143 Read and save reserved vector information 144 144 145 145 @param[in] VectorInfo Pointer to reserved vector list. 146 146 @param[out] ReservedVector Pointer to reserved vector data buffer. 147 147 @param[in] VectorCount Vector number to be updated. 148 148 149 149 @return EFI_SUCCESS Read and save vector info successfully. 150 150 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
r58464 r58466 87 87 88 88 @param Format Format string for the message to print. 89 @param ... Variable argument list whose contents are accessed 89 @param ... Variable argument list whose contents are accessed 90 90 based on the format string specified by Format. 91 91 … … 100 100 /** 101 101 Find and display image base address and return image base and its entry point. 102 102 103 103 @param CurrentEip Current instruction pointer. 104 104 @param EntryPoint Return module entry point if module header is found. 105 105 106 106 @return !0 Image base address. 107 107 @return 0 Image header cannot be found. 108 108 **/ 109 UINTN 109 UINTN 110 110 FindModuleImageBase ( 111 111 IN UINTN CurrentEip, … … 129 129 130 130 @param[in] VectorInfo Pointer to reserved vector list. 131 132 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 131 132 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 133 133 with default exception handlers. 134 134 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 188 188 ArchSaveExceptionContext ( 189 189 IN UINTN ExceptionType, 190 IN EFI_SYSTEM_CONTEXT SystemContext 190 IN EFI_SYSTEM_CONTEXT SystemContext 191 191 ); 192 192 … … 201 201 ArchRestoreExceptionContext ( 202 202 IN UINTN ExceptionType, 203 IN EFI_SYSTEM_CONTEXT SystemContext 203 IN EFI_SYSTEM_CONTEXT SystemContext 204 204 ); 205 205 206 206 /** 207 207 Fix up the vector number and function address in the vector code. 208 208 209 209 @param[in] NewVectorAddr New vector handler address. 210 210 @param[in] VectorNum Index of vector. … … 222 222 /** 223 223 Read and save reserved vector information 224 224 225 225 @param[in] VectorInfo Pointer to reserved vector list. 226 226 @param[out] ReservedVector Pointer to reserved vector data buffer. 227 227 @param[in] VectorCount Vector number to be updated. 228 228 229 229 @return EFI_SUCCESS Read and save vector info successfully. 230 230 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
r58464 r58466 7 7 # which accompanies this distribution. The full text of the license may be found at 8 8 # http://opensource.org/licenses/bsd-license.php 9 # 9 # 10 10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 # 12 # 13 13 ## 14 14 … … 57 57 SynchronizationLib 58 58 LocalApicLib 59 PeCoffGetEntryPointLib 59 PeCoffGetEntryPointLib 60 60 MemoryAllocationLib 61 61 DebugLib -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
r58464 r58466 25 25 /** 26 26 Initializes all CPU exceptions entries and provides the default exception handlers. 27 27 28 28 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 29 29 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 30 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 30 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 31 31 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 32 32 33 33 @param[in] VectorInfo Pointer to reserved vector list. 34 35 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 34 35 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 36 36 with default exception handlers. 37 37 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 50 50 /** 51 51 Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers. 52 52 53 53 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 54 54 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 55 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 55 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 56 56 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 57 57 58 58 @param[in] VectorInfo Pointer to reserved vector list. 59 60 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 59 60 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 61 61 with default interrupt/exception handlers. 62 62 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 112 112 InterruptEntryCode = AllocatePool (TemplateMap.ExceptionStubHeaderSize * CPU_INTERRUPT_NUM); 113 113 ASSERT (InterruptEntryCode != NULL); 114 114 115 115 InterruptEntry = (UINTN) InterruptEntryCode; 116 116 for (Index = 0; Index < CPU_INTERRUPT_NUM; Index ++) { … … 140 140 Registers a function to be called from the processor interrupt handler. 141 141 142 This function registers and enables the handler specified by InterruptHandler for a processor 143 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 144 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 142 This function registers and enables the handler specified by InterruptHandler for a processor 143 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 144 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 145 145 The installed handler is called once for each processor interrupt or exception. 146 146 NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c
r58464 r58466 40 40 EFIAPI 41 41 CommonExceptionHandler ( 42 IN EFI_EXCEPTION_TYPE ExceptionType, 42 IN EFI_EXCEPTION_TYPE ExceptionType, 43 43 IN EFI_SYSTEM_CONTEXT SystemContext 44 44 ) … … 98 98 break; 99 99 } 100 100 101 101 if (mExternalInterruptHandler[ExceptionType] != NULL) { 102 102 (mExternalInterruptHandler[ExceptionType]) (ExceptionType, SystemContext); … … 110 110 // 111 111 // Display ExceptionType, CPU information and Image information 112 // 112 // 113 113 DumpCpuContent (ExceptionType, SystemContext); 114 114 // … … 192 192 } 193 193 } 194 194 195 195 // 196 196 // Save Interrupt number to global variable used for RegisterCpuInterruptHandler () … … 203 203 204 204 @param[in] VectorInfo Pointer to reserved vector list. 205 206 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 205 206 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 207 207 with default exception handlers. 208 208 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
r58464 r58466 58 58 ArchSaveExceptionContext ( 59 59 IN UINTN ExceptionType, 60 IN EFI_SYSTEM_CONTEXT SystemContext 60 IN EFI_SYSTEM_CONTEXT SystemContext 61 61 ) 62 62 { … … 73 73 // 74 74 Eflags.UintN = SystemContext.SystemContextIa32->Eflags; 75 Eflags.Bits.IF = 0; 75 Eflags.Bits.IF = 0; 76 76 SystemContext.SystemContextIa32->Eflags = Eflags.UintN; 77 77 // … … 90 90 ArchRestoreExceptionContext ( 91 91 IN UINTN ExceptionType, 92 IN EFI_SYSTEM_CONTEXT SystemContext 92 IN EFI_SYSTEM_CONTEXT SystemContext 93 93 ) 94 94 { -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.S
r58464 r58466 358 358 # Put Vector Number on stack and restore ECX 359 359 # 360 xchgl (%esp), %ecx 360 xchgl (%esp), %ecx 361 361 362 362 ErrorCodeAndVectorOnStack: … … 385 385 # is 16-byte aligned 386 386 # 387 andl $0x0fffffff0, %esp 387 andl $0x0fffffff0, %esp 388 388 subl $12, %esp 389 389 … … 391 391 pushl $0 # check EXCEPTION_HANDLER_CONTEXT.OldIdtHandler 392 392 pushl $0 # check EXCEPTION_HANDLER_CONTEXT.ExceptionDataFlag 393 393 394 394 #; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; 395 395 pushl %eax … … 406 406 movl %ss, %eax 407 407 pushl %eax 408 movzwl 16(%ebp), %eax 408 movzwl 16(%ebp), %eax 409 409 pushl %eax 410 410 movl %ds, %eax … … 426 426 movl 2(%esp), %eax 427 427 xchgl (%esp), %eax 428 andl $0x0FFFF, %eax 428 andl $0x0FFFF, %eax 429 429 movl %eax, 4(%esp) 430 430 … … 433 433 movl 2(%esp), %eax 434 434 xchgl (%esp), %eax 435 andl $0x0FFFF, %eax 435 andl $0x0FFFF, %eax 436 436 movl %eax, 4(%esp) 437 437 … … 588 588 # _AsmGetTemplateAddressMap ; 589 589 #---------------------------------------; 590 # 590 # 591 591 # Protocol prototype 592 592 # AsmGetTemplateAddressMap ( 593 593 # EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap 594 594 # ); 595 # 595 # 596 596 # Routine Description: 597 # 597 # 598 598 # Return address map of interrupt handler template so that C code can generate 599 599 # interrupt table. 600 # 600 # 601 601 # Arguments: 602 # 603 # 604 # Returns: 605 # 602 # 603 # 604 # Returns: 605 # 606 606 # Nothing 607 607 # 608 # 608 # 609 609 # Input: [ebp][0] = Original ebp 610 610 # [ebp][4] = Return address 611 # 611 # 612 612 # Output: Nothing 613 # 613 # 614 614 # Destroys: Nothing 615 615 #-----------------------------------------------------------------------------; -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.asm
r58464 r58466 54 54 db 6ah ; push 55 55 VectorNum: 56 db 0 ; 0 will be fixed 56 db 0 ; 0 will be fixed 57 57 push eax 58 58 mov eax, HookAfterStubHeaderEnd … … 194 194 push 0 ; clear EXCEPTION_HANDLER_CONTEXT.OldIdtHandler 195 195 push 0 ; clear EXCEPTION_HANDLER_CONTEXT.ExceptionDataFlag 196 196 197 197 ;; UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax; 198 198 push eax … … 374 374 jmp dword ptr [esp - 12] 375 375 376 DoReturn: 376 DoReturn: 377 377 cmp mDoFarReturnFlag, 0 ; Check if need to do far return instead of IRET 378 378 jz DoIret … … 393 393 ; _AsmGetTemplateAddressMap ; 394 394 ;----------------------------------------------------------------------------; 395 ; 395 ; 396 396 ; Protocol prototype 397 397 ; AsmGetTemplateAddressMap ( 398 398 ; EXCEPTION_HANDLER_TEMPLATE_MAP *AddressMap 399 399 ; ); 400 ; 400 ; 401 401 ; Routine Description: 402 ; 402 ; 403 403 ; Return address map of interrupt handler template so that C code can generate 404 404 ; interrupt table. 405 ; 405 ; 406 406 ; Arguments: 407 ; 408 ; 409 ; Returns: 410 ; 407 ; 408 ; 409 ; Returns: 410 ; 411 411 ; Nothing 412 412 ; 413 ; 413 ; 414 414 ; Input: [ebp][0] = Original ebp 415 415 ; [ebp][4] = Return address 416 ; 416 ; 417 417 ; Output: Nothing 418 ; 418 ; 419 419 ; Destroys: Nothing 420 420 ;-----------------------------------------------------------------------------; … … 428 428 mov dword ptr [ebx + 4h], (AsmIdtVectorEnd - AsmIdtVectorBegin) / 32 429 429 mov dword ptr [ebx + 8h], HookAfterStubBegin 430 430 431 431 popad 432 432 pop ebp -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
r58464 r58466 31 31 EFIAPI 32 32 CommonExceptionHandler ( 33 IN EFI_EXCEPTION_TYPE ExceptionType, 33 IN EFI_EXCEPTION_TYPE ExceptionType, 34 34 IN EFI_SYSTEM_CONTEXT SystemContext 35 35 ) … … 37 37 // 38 38 // Display ExceptionType, CPU information and Image information 39 // 39 // 40 40 DumpCpuContent (ExceptionType, SystemContext); 41 41 42 42 // 43 43 // Enter a dead loop. … … 48 48 /** 49 49 Initializes all CPU exceptions entries and provides the default exception handlers. 50 50 51 51 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 52 52 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 53 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 53 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 54 54 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 55 Note: Before invoking this API, caller must allocate memory for IDT table and load 55 Note: Before invoking this API, caller must allocate memory for IDT table and load 56 56 IDTR by AsmWriteIdtr(). 57 57 58 58 @param[in] VectorInfo Pointer to reserved vector list. 59 60 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 59 60 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 61 61 with default exception handlers. 62 62 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 70 70 ) 71 71 { 72 EFI_STATUS Status; 72 EFI_STATUS Status; 73 73 RESERVED_VECTORS_DATA ReservedVectorData[CPU_EXCEPTION_NUM]; 74 74 IA32_DESCRIPTOR IdtDescriptor; … … 127 127 /** 128 128 Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers. 129 129 130 130 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 131 131 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 132 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 132 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 133 133 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 134 134 135 135 @param[in] VectorInfo Pointer to reserved vector list. 136 137 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 136 137 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 138 138 with default interrupt/exception handlers. 139 139 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 153 153 Registers a function to be called from the processor interrupt handler. 154 154 155 This function registers and enables the handler specified by InterruptHandler for a processor 156 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 157 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 155 This function registers and enables the handler specified by InterruptHandler for a processor 156 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 157 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 158 158 The installed handler is called once for each processor interrupt or exception. 159 159 NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
r58464 r58466 7 7 # which accompanies this distribution. The full text of the license may be found at 8 8 # http://opensource.org/licenses/bsd-license.php 9 # 9 # 10 10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 # 12 # 13 13 ## 14 14 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
r58464 r58466 7 7 # which accompanies this distribution. The full text of the license may be found at 8 8 # http://opensource.org/licenses/bsd-license.php 9 # 9 # 10 10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 # 12 # 13 13 ## 14 14 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
r58464 r58466 16 16 #include "CpuExceptionCommon.h" 17 17 18 CONST UINTN mDoFarReturnFlag = 1; 18 CONST UINTN mDoFarReturnFlag = 1; 19 19 20 20 /** 21 21 Initializes all CPU exceptions entries and provides the default exception handlers. 22 22 23 23 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 24 24 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 25 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 25 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 26 26 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 27 27 28 28 @param[in] VectorInfo Pointer to reserved vector list. 29 30 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 29 30 @retval EFI_SUCCESS CPU Exception Entries have been successfully initialized 31 31 with default exception handlers. 32 32 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 45 45 /** 46 46 Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers. 47 47 48 48 Caller should try to get an array of interrupt and/or exception vectors that are in use and need to 49 49 persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. 50 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 50 If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. 51 51 If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. 52 52 53 53 @param[in] VectorInfo Pointer to reserved vector list. 54 55 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 54 55 @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized 56 56 with default interrupt/exception handlers. 57 57 @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. … … 71 71 Registers a function to be called from the processor interrupt handler. 72 72 73 This function registers and enables the handler specified by InterruptHandler for a processor 74 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 75 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 73 This function registers and enables the handler specified by InterruptHandler for a processor 74 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the 75 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. 76 76 The installed handler is called once for each processor interrupt or exception. 77 77 NOTE: This function should be invoked after InitializeCpuExceptionHandlers() or -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
r58464 r58466 30 30 IdtEntry->Bits.OffsetLow = (UINT16)(UINTN)InterruptHandler; 31 31 IdtEntry->Bits.OffsetHigh = (UINT16)((UINTN)InterruptHandler >> 16); 32 IdtEntry->Bits.OffsetUpper = (UINT32)((UINTN)InterruptHandler >> 32); 32 IdtEntry->Bits.OffsetUpper = (UINT32)((UINTN)InterruptHandler >> 32); 33 33 IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32; 34 34 } … … 58 58 ArchSaveExceptionContext ( 59 59 IN UINTN ExceptionType, 60 IN EFI_SYSTEM_CONTEXT SystemContext 60 IN EFI_SYSTEM_CONTEXT SystemContext 61 61 ) 62 62 { … … 75 75 // 76 76 Eflags.UintN = SystemContext.SystemContextX64->Rflags; 77 Eflags.Bits.IF = 0; 77 Eflags.Bits.IF = 0; 78 78 SystemContext.SystemContextX64->Rflags = Eflags.UintN; 79 79 // … … 92 92 ArchRestoreExceptionContext ( 93 93 IN UINTN ExceptionType, 94 IN EFI_SYSTEM_CONTEXT SystemContext 94 IN EFI_SYSTEM_CONTEXT SystemContext 95 95 ) 96 96 { -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
r58464 r58466 30 30 31 31 #ifdef __APPLE__ 32 # macros are different between GNU and Xcode as. 33 .macro IDT_MACRO 32 # macros are different between GNU and Xcode as. 33 .macro IDT_MACRO 34 34 push $0 35 35 #else … … 78 78 .byte 0x6a # push 79 79 PatchVectorNum: 80 .byte 0 # 0 will be fixed 80 .byte 0 # 0 will be fixed 81 81 .byte 0xe9 # jmp ASM_PFX(HookAfterStubHeaderEnd) 82 82 PatchFuncAddress: … … 234 234 pushq %rax 235 235 movq %cr4, %rax 236 orq $0x208, %rax 237 movq %rax, %cr4 238 pushq %rax 239 mov %cr3, %rax 240 pushq %rax 241 mov %cr2, %rax 236 orq $0x208, %rax 237 movq %rax, %cr4 238 pushq %rax 239 mov %cr3, %rax 240 pushq %rax 241 mov %cr2, %rax 242 242 pushq %rax 243 243 xorq %rax, %rax 244 244 pushq %rax 245 mov %cr0, %rax 245 mov %cr0, %rax 246 246 pushq %rax 247 247 … … 278 278 # and make sure RSP is 16-byte aligned 279 279 # 280 subq $40, %rsp 280 subq $40, %rsp 281 281 call ASM_PFX(CommonExceptionHandler) 282 282 addq $40, %rsp -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.asm
r58464 r58466 48 48 db 6ah ; push 49 49 @VectorNum: 50 db 0 ; 0 will be fixed 50 db 0 ; 0 will be fixed 51 51 push rax 52 52 mov rax, HookAfterStubHeaderEnd … … 90 90 ; +---------------------+ <-- RBP, 16-byte aligned 91 91 ; The follow algorithm is used for the common interrupt routine. 92 CommonInterruptEntry PROC PUBLIC 92 CommonInterruptEntry PROC PUBLIC 93 93 cli 94 94 pop rax … … 112 112 push [rsp] 113 113 mov qword ptr [rsp + 8], 0 114 @@: 114 @@: 115 115 push rbp 116 116 mov rbp, rsp … … 352 352 push rax 353 353 mov rax, rsp ; save old RSP to rax 354 mov rsp, [rsp + 20h] 354 mov rsp, [rsp + 20h] 355 355 push [rax + 10h] ; save CS in new location 356 356 push [rax + 8h] ; save EIP in new location -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
r58459 r58466 187 187 // 188 188 MtrrContext->InterruptState = SaveAndDisableInterrupts(); 189 189 190 190 // 191 191 // Enter no fill cache mode, CD=1(Bit30), NW=0 (Bit29) … … 225 225 { 226 226 // 227 // Flush all TLBs 227 // Flush all TLBs 228 228 // 229 229 CpuFlushTlb (); … … 238 238 // 239 239 AsmWriteCr4 (MtrrContext->Cr4); 240 240 241 241 // 242 242 // Restore original interrupt state … … 535 535 if (Attributes == VariableMtrr[Index].Type) { 536 536 // 537 // if the Mtrr range contain the request range, set a flag, then continue to 537 // if the Mtrr range contain the request range, set a flag, then continue to 538 538 // invalidate any MTRR of the same request range with higher priority cache type. 539 539 // … … 1568 1568 DEBUG((DEBUG_CACHE, "MTRR Settings\n")); 1569 1569 DEBUG((DEBUG_CACHE, "=============\n")); 1570 1570 1571 1571 MtrrGetAllMtrrs (&MtrrSettings); 1572 1572 DEBUG((DEBUG_CACHE, "MTRR Default Type: %016lx\n", MtrrSettings.MtrrDefType)); … … 1595 1595 if (MemoryType > CacheWriteBack) { 1596 1596 MemoryType = MTRR_CACHE_INVALID_TYPE; 1597 } 1597 } 1598 1598 if (MemoryType != PreviousMemoryType) { 1599 1599 if (PreviousMemoryType != MTRR_CACHE_INVALID_TYPE) { … … 1631 1631 DEBUG((DEBUG_CACHE, "%a:%016lx-", mMtrrMemoryCacheTypeShortName[MemoryType], Base)); 1632 1632 } 1633 1634 RangeBase = BASE_1MB; 1633 1634 RangeBase = BASE_1MB; 1635 1635 NoRangeBase = BASE_1MB; 1636 1636 RangeLimit = Limit; 1637 1637 NoRangeLimit = Limit; 1638 1638 1639 1639 for (Index = 0, Found = FALSE; Index < VariableMtrrCount; Index++) { 1640 1640 if ((MtrrSettings.Variables.Mtrr[Index].Mask & BIT11) == 0) { … … 1650 1650 Found = TRUE; 1651 1651 } 1652 1652 1653 1653 if (Base >= MtrrBase && MtrrBase > RangeBase) { 1654 1654 RangeBase = MtrrBase; … … 1663 1663 RangeLimit = MtrrLimit; 1664 1664 } 1665 1665 1666 1666 if (Base > MtrrLimit && NoRangeBase < MtrrLimit) { 1667 1667 NoRangeBase = MtrrLimit + 1; … … 1671 1671 } 1672 1672 } 1673 1673 1674 1674 if (Found) { 1675 1675 Base = RangeLimit + 1; -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
r58459 r58466 7 7 # which accompanies this distribution. The full text of the license may be found at 8 8 # http://opensource.org/licenses/bsd-license.php 9 # 9 # 10 10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 # 12 # 13 13 ## 14 14 … … 20 20 MODULE_TYPE = BASE 21 21 VERSION_STRING = 1.0 22 LIBRARY_CLASS = MtrrLib 22 LIBRARY_CLASS = MtrrLib 23 23 24 24 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/SecPeiDxeTimerLibUefiCpu/SecPeiDxeTimerLibUefiCpu.inf
r58459 r58466 4 4 # Timer Library that only uses CPU resources to provide calibrated delays 5 5 # on IA-32, x64, and IPF. 6 # Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can use this TimerLib 7 # in their initialization without any issues. They only have to be careful in 8 # the implementation of runtime services and SMI handlers. 6 # Note: A driver of type DXE_RUNTIME_DRIVER and DXE_SMM_DRIVER can use this TimerLib 7 # in their initialization without any issues. They only have to be careful in 8 # the implementation of runtime services and SMI handlers. 9 9 # Because CPU Local APIC and ITC could be programmed by OS, it cannot be 10 10 # used by SMM drivers and runtime drivers, ACPI timer is recommended for SMM -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/SecPeiDxeTimerLibUefiCpu/X86TimerLib.c
r58459 r58466 3 3 4 4 This library uses the local APIC library so that it supports x2APIC mode. 5 5 6 6 Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR> 7 7 This program and the accompanying materials -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf
r58464 r58466 1 1 ## @file 2 2 # Reset Vector 3 # 3 # 4 4 # This VTF requires build time fixups in order to find the SEC entry point. 5 5 # -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/ResetVector/FixupVtf/Vtf.nasmb
-
Property svn:eol-style
set to
native
-
Property svn:eol-style
set to
-
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb
-
Property svn:eol-style
set to
native
-
Property svn:eol-style
set to
-
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/UefiCpuPkg.dec
-
Property svn:eol-style
set to
native
r58459 r58466 38 38 ## 39 39 LocalApicLib|Include/Library/LocalApicLib.h 40 40 41 41 [Guids] 42 42 gUefiCpuPkgTokenSpaceGuid = { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa, 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }} -
Property svn:eol-style
set to
-
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/UefiCpuPkg.dsc
r58459 r58466 8 8 # which accompanies this distribution. The full text of the license may be found at 9 9 # http://opensource.org/licenses/bsd-license.php 10 # 10 # 11 11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. … … 52 52 LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf 53 53 ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf 54 CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf 54 CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf 55 55 56 56 [LibraryClasses.common.PEIM] … … 64 64 [LibraryClasses.IPF.PEIM] 65 65 PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf 66 66 67 67 [LibraryClasses.common.DXE_DRIVER] 68 68 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf … … 71 71 SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf 72 72 MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf 73 73 74 74 # 75 75 # Drivers/Libraries within this package … … 90 90 UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf 91 91 UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 92 UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf 92 UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf 93 93 UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf 94 94 -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.S
r58464 r58466 21 21 22 22 #------------------------------------------------------------------------------ 23 # 23 # 24 24 # VOID 25 25 # EFIAPI … … 35 35 movw %ax, %es 36 36 movw %ax, %fs 37 movw %ax, %gs 37 movw %ax, %gs 38 38 ret -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.asm
r58464 r58466 39 39 mov fs, ax 40 40 mov gs, ax 41 mov ss, ax 41 mov ss, ax 42 42 ret 43 43 AsmSetDataSelectors ENDP -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
r58459 r58466 113 113 UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU) 114 114 UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page 115 UINT64 MustBe1:1; // Must be 1 115 UINT64 MustBe1:1; // Must be 1 116 116 UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write 117 117 UINT64 Available:3; // Available for use by system software … … 137 137 UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU) 138 138 UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page 139 UINT64 MustBe1:1; // Must be 1 139 UINT64 MustBe1:1; // Must be 1 140 140 UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write 141 141 UINT64 Available:3; // Available for use by system software … … 156 156 /** 157 157 a ASM function to transfer control to OS. 158 158 159 159 @param S3WakingVector The S3 waking up vector saved in ACPI Facs table 160 @param AcpiLowMemoryBase a buffer under 1M which could be used during the transfer 160 @param AcpiLowMemoryBase a buffer under 1M which could be used during the transfer 161 161 **/ 162 162 typedef … … 464 464 465 465 // 466 // NOTE: Because Debug Timer interrupt and system interrupts will be disabled 466 // NOTE: Because Debug Timer interrupt and system interrupts will be disabled 467 467 // in BootScriptExecuteDxe, the rest code in S3ResumeBootOs() cannot be halted 468 468 // by soft debugger. … … 581 581 /** 582 582 Restore S3 page table because we do not trust ACPINvs content. 583 If BootScriptExector driver will not run in 64-bit mode, this function will do nothing. 583 If BootScriptExector driver will not run in 64-bit mode, this function will do nothing. 584 584 585 585 @param S3NvsPageTableAddress PageTableAddress in ACPINvs … … 623 623 PageMap = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress; 624 624 S3NvsPageTableAddress += SIZE_4KB; 625 625 626 626 Page1GSupport = FALSE; 627 627 if (PcdGetBool(PcdUse1GPageTable)) { … … 634 634 } 635 635 } 636 636 637 637 // 638 638 // Get physical address bits supported. … … 650 650 } 651 651 } 652 652 653 653 // 654 654 // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses. … … 677 677 NumberOfPdpEntriesNeeded = 512; 678 678 } 679 679 680 680 PageMapLevel4Entry = PageMap; 681 681 PageAddress = 0; … … 687 687 PageDirectoryPointerEntry = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress; 688 688 S3NvsPageTableAddress += SIZE_4KB; 689 689 690 690 // 691 691 // Make a PML4 Entry … … 697 697 if (Page1GSupport) { 698 698 PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry; 699 699 700 700 for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) { 701 701 // … … 712 712 // Each Directory Pointer entries points to a page of Page Directory entires. 713 713 // So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop. 714 // 714 // 715 715 PageDirectoryEntry = (PAGE_TABLE_ENTRY *)S3NvsPageTableAddress; 716 716 S3NvsPageTableAddress += SIZE_4KB; 717 717 718 718 // 719 719 // Fill in a Page Directory Pointer Entries … … 722 722 PageDirectoryPointerEntry->Bits.ReadWrite = 1; 723 723 PageDirectoryPointerEntry->Bits.Present = 1; 724 724 725 725 for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PageAddress += SIZE_2MB) { 726 726 // … … 782 782 // 783 783 // Send SMI to APs 784 // 784 // 785 785 SendSmiIpiAllExcludingSelf (); 786 786 // … … 797 797 if (!EFI_ERROR (Status)) { 798 798 DEBUG ((EFI_D_ERROR, "Close all SMRAM regions before executing boot script\n")); 799 799 800 800 for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { 801 801 Status = SmmAccess->Close ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); … … 803 803 804 804 DEBUG ((EFI_D_ERROR, "Lock all SMRAM regions before executing boot script\n")); 805 805 806 806 for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { 807 807 Status = SmmAccess->Lock ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); … … 817 817 // 818 818 // On some platform, such as ECP, a dispatch node in boot script table may execute a 32-bit PEIM which may need PeiServices 819 // pointer. So PeiServices need preserve in (IDTBase- sizeof (UINTN)). 819 // pointer. So PeiServices need preserve in (IDTBase- sizeof (UINTN)). 820 820 // 821 821 IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile); 822 822 // 823 823 // Make sure the newly allcated IDT align with 16-bytes 824 // 824 // 825 825 IdtBuffer = AllocatePages (EFI_SIZE_TO_PAGES((IdtDescriptor->Limit + 1) + 16)); 826 826 ASSERT (IdtBuffer != NULL); … … 828 828 // Additional 16 bytes allocated to save IA32 IDT descriptor and Pei Service Table Pointer 829 829 // IA32 IDT descriptor will be used to setup IA32 IDT table for 32-bit Framework Boot Script code 830 // 830 // 831 831 ZeroMem (IdtBuffer, 16); 832 832 AsmReadIdtr ((IA32_DESCRIPTOR *)IdtBuffer); … … 863 863 // 864 864 AsmReadIdtr (&PeiS3ResumeState->Idtr); 865 865 866 866 // 867 867 // Report Status Code to indicate S3 boot script execution … … 1000 1000 DEBUG (( EFI_D_ERROR, "Waking Vector = %x\n", ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable)))->FirmwareWakingVector)); 1001 1001 DEBUG (( EFI_D_ERROR, "AcpiS3Context->AcpiFacsTable = %x\n", AcpiS3Context->AcpiFacsTable)); 1002 DEBUG (( EFI_D_ERROR, "AcpiS3Context->IdtrProfile = %x\n", AcpiS3Context->IdtrProfile)); 1002 DEBUG (( EFI_D_ERROR, "AcpiS3Context->IdtrProfile = %x\n", AcpiS3Context->IdtrProfile)); 1003 1003 DEBUG (( EFI_D_ERROR, "AcpiS3Context->S3NvsPageTableAddress = %x\n", AcpiS3Context->S3NvsPageTableAddress)); 1004 1004 DEBUG (( EFI_D_ERROR, "AcpiS3Context->S3DebugBufferAddress = %x\n", AcpiS3Context->S3DebugBufferAddress)); … … 1089 1089 // 1090 1090 // update segment selectors per the new GDT. 1091 // 1091 // 1092 1092 AsmSetDataSelectors (DATA_SEGEMENT_SELECTOR); 1093 1093 // … … 1123 1123 1124 1124 This routine is to install EFI_PEI_S3_RESUME2_PPI. 1125 1125 1126 1126 @param FileHandle Handle of the file being invoked. 1127 1127 @param PeiServices Pointer to PEI Services table. -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.S
r58464 r58466 21 21 22 22 #------------------------------------------------------------------------------ 23 # 23 # 24 24 # VOID 25 25 # EFIAPI … … 34 34 movw %cx, %es 35 35 movw %cx, %fs 36 movw %cx, %gs 36 movw %cx, %gs 37 37 ret -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.asm
r58464 r58466 35 35 mov fs, cx 36 36 mov gs, cx 37 mov ss, cx 37 mov ss, cx 38 38 ret 39 39 AsmSetDataSelectors ENDP
Note:
See TracChangeset
for help on using the changeset viewer.