Commit Graph

151 Commits

Author SHA1 Message Date
Dandan Bi 367284e773 UefiCpuPkg: Make the comments align with the functions
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-12-14 21:34:42 +08:00
Jeff Fan 7d17ab47d1 UefiCpuPkg/CpuDxe: Fix duplicated status code report
If CPU Bist data is not zero, we will report Status code. But there is one bug
that will report each processor's status code duplicated with NumberOfData
times. This fix is to exchange the loop order on NumberOfData and
mNumberOfProcessors. It could make sure the report status code only once for
each processor.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
2016-09-14 08:54:24 +08:00
Jeff Fan f3b91fa04a UefiCpuPkg/CpuDxe: Fixed typo in function header to match PI spec
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
2016-08-17 20:08:01 +08:00
Jeff Fan 0a55f3bd65 UefiCpuPkg/CpuDxe: Remove PcdCpuMaxLogicalProcessorNumber consuming
v5:
  If PcdCpuMaxLogicalProcessorNumber is set to 1 on UP system,
  MpInitLibInitialize() will be invoked. This is one bug, we need to
  call MpInitLibInitialize() always and get the BSP information.
  Just to remove PcdCpuMaxLogicalProcessorNumber() consuming from this
  driver.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
2016-08-17 20:07:16 +08:00
Jeff Fan 39d49a73a5 UefiCpuPkg/CpuDxe: Remove unused codes and files
v5:
  1. Remove unused PcdCpuApStackSize and PcdCpuApInitTimeOutInMicroSeconds.

v4:
  1. Keep GDT table setup to fix IA32 S3 boot issue.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
2016-08-17 20:07:07 +08:00
Jeff Fan 0b9f0dd635 UefiCpuPkg/CpuDxe: Move SetMtrrsFromBuffer() location.
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
2016-08-17 20:07:00 +08:00
Jeff Fan 7fadaacd50 UefiCpuPkg/CpuDxe: Consume MpInitLib to produce CPU MP Protocol services
Consume MP Initialize library to produce CPU MP Protocol services to simply the
code.

v4:
  1. Update CpuDxe.c file header to mention it produces CPU Arch protocol.
  2. Update BistData type from UINT32 to EFI_HEALTH_FLAG.
  3. Move some header location from CpuMp.h to CpuDxe.h.

v3:
  1. Move the code Consume MpInitLib APIs to produce CPU MP Protocol from patch
     #40 to this patch.
  2. Add DxeMpInitLib.inf in DSC file

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
2016-08-17 20:06:56 +08:00
Jeff Fan afa7b97154 UefiCpuPkg/CpuDxe: StartupAllAPs in parallel mode
SetMemoryAttributes() will sync BSP's MTRRs settings to all APs by StartupAllAPs
service in serial mode. It may caused much performance impact if there are too
much processors in system. This update is to invoke StartupAllAps in parallel
mode. IA32 SDM does suggest to program MTRRs in parallel mode.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-07-20 11:13:25 +08:00
Liming Gao b85a6ffb44 UefiCpuPkg CpuDxe: Add nasm source file in CpuDxe.inf
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
2016-06-28 09:52:06 +08:00
Liming Gao 762e073a93 UefiCpuPkg CpuDxe: Convert Ia32/CpuAsm.asm to NASM
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert
Ia32/CpuAsm.asm to Ia32/CpuAsm.nasm

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
2016-06-28 09:52:06 +08:00
Jordan Justen 5999b89e22 UefiCpuPkg: Convert all .uni files to utf-8
To convert these files I ran:

$ python3 BaseTools/Scripts/ConvertUni.py UefiCpuPkg

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19264 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15 04:59:14 +00:00
Jordan Justen f73dd6f5bb UefiCpuPkg/CpuDxe: Don't use gBS->Stall
The CpuDxe driver may run before the gEfiMetronomeArchProtocolGuid
protocol is installed. gBS->Stall does not work until this arch
protocol is installed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18914 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-20 08:22:46 +00:00
Michael Kinney 0d4c1db81a UefiCpuPkg: CpuDxe: Update GDT to be consistent with DxeIplPeim
The PiSmmCpuDxeSmm module makes some assumptions about GDT selectors
that are based on the GDT layout from the DxeIplPeim.  For example,
the protected mode entry code and (where appropriate) the long mode
entry code in the UefiCpuPkg/PiSmmCpuDxeSmm/*/MpFuncs.* assembly
files, which are used during S3 resume, open-code segment selector
values that depend on DxeIplPeim's GDT layout.

This updates the CpuDxe module to use the same GDT layout as the
DxeIplPeim.  This enables modules that are dispatched after
CpuDxe to find, and potentially save and restore, a GDT layout that
matches that of DxeIplPeim.  The DxeIplPeim has a 2 GDT entries for
data selectors that are identical.  These are LINEAR_SEL (GDT Offset
0x08)and LINEAR_DATA64_SEL (GDT offset 0x30).  LINEAL_SEL is used for
for IA32 DXE and the LINEAR_DATA64_SEL is used for X64 DXE. This
duplicate data selector was added to the CpuDxe module to keep the
GDT and all selectors consistent.

Using a consistent GDT also improves debug experience.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Analyzed-by: Laszlo Ersek <lersek@redhat.com>
Link: http://article.gmane.org/gmane.comp.bios.edk2.devel/3568
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18710 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-30 17:32:27 +00:00
Laszlo Ersek 94941c8853 UefiCpuPkg: CpuDxe: broadcast MTRR changes to APs
The Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuArchDxe
driver applies any MTRR changes to APs, if the
EFI_MP_SERVICES_PROTOCOL is available. We should do the same.

Additionally, the broadcast should occur at MP startup as well,
not only when MTRR settings are changed. The inspiration is
taken from

  Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuMpDxe/

(see the EarlyMpInit() function and its call sites in
"ProcessorConfig.c").

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18632 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:08:47 +00:00
Michael Kinney 1aa6bf5289 UefiCpuPkg: CpuDxe: Wait for APs to enter idle loop
Address a race condition in first call to StartupAllAPs() with
SingleThread set to TRUE in the MP initialization.  If the APs
have not entered their idle loop before StartupAllAPs() is called,
then some of the APs will be in an unexpected state, and
StartupAllAPs() will hang.  This is the hang condition that is
only seen when SingleThread parameter is set to TRUE and
StartupAllAPs() is called very shortly after mAPsAlreadyInitFinished
is set to TRUE that releases the APs to complete their initialization.

An internal function has been added to check if all APs are in the
sleeping state in their idle loop.  On the first call to
StartupAllAPs(), this internal function is used in a loop to make
sure the APs are in a state that is compatible with the use of
StartupAllAPs().  PcdCpuApInitTimeOutInMicroSeconds is used as the
maximum wait time for the APs to enter their idle loop.  If all
APs have not entered their idle loop within the timeout, then
an ASSERT() is generated.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18631 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:08:28 +00:00
Michael Kinney 1e410eadd8 UefiCpuPkg: CpuDxe: Use PCD for AP detection timeout
Use PcdCpuApInitTimeOutInMicroSeconds instead of hardcoded 100ms for
the time to wait for all APs to respond to first INIT SIPI SIPI
wake request.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18630 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:08:11 +00:00
Michael Kinney 944f45ae2f UefiCpuPkg: Update CPU MP drivers to support single CPU configuration
Only perform AP detection if PcdCpuMaxLogicalProcessorNumber > 1
Only free AP related structures of they were allocated

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18629 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:07:52 +00:00
Star Zeng 21d0e75065 UefiCpuPkg CpuDxe: Sync up the settings of Execute Disable to APs
when stack NX has been enabled for BSP.

DxeIpl may have enabled Execute Disable for BSP,
APs need to get the status and sync up the settings,
otherwise EFI_MP_SERVICES_PROTOCOL->StartupAllAPs
may not work.

Got positive comments and test result from Laszlo
for the early draft patch, thanks.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18191 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-08 00:00:36 +00:00
Jeff Fan 13181dde42 UefiCpuPkg/CpuDxe: NumberOfData is not BOOLEAN type
Should check NumberOfData value instead of treat its value as one BOOLEAN type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Shuming Qiu <shuming.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17672 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-19 08:27:35 +00:00
Jeff Fan db61e16308 UefiCpuPkg/CpuDxe: Get CPU BIST information from Guided HOB
Get CPU BIST information from gEfiSecPlatformInformation2PpiGuid or
gEfiSecPlatformInformationPpiGuid Guided HOB and update the CPU healthy status
for CPU MP Service.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17641 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-16 02:55:54 +00:00
Scott Duplichan 718abab112 UefiCpuPkg: Avoid "error A2085" when DDK3790 tool chain is used
The DDK3790 tool chain fails when the PAUSE instruction is assembled:
error A2085: instruction or register not accepted in current CPU mode The solution is to use the .686 directive along with the .xmm directive.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17134 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-09 03:09:17 +00:00
Chen Fan 33f413f0d6 UefiCpuPkg/MpSerivce: add volatile qualifiers
For avoid the compiler optimizing the code, we let Parameter and Procedure in CpuData volatile.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17024 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:45:26 +00:00
Chen Fan 68f0674237 UefiCpuPkg/MpService: Put APs to sleep when not busy.
Add a new sleeping state for APs, when no procedure execution, put AP to sleep. when need to execute 
procedure, only need to wake up this AP by sent SIPI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17023 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:43:11 +00:00
Chen Fan e033a1a83e UefiCpuPkg/MpService: put AP to busy state when execution
CpuState should follow the process?

    Idle -> Ready -> Busy -> Finished
     ^                         |
     |                         |
     + - - - - - - - - - - - - +

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17022 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:38:16 +00:00
Chen Fan b302a9784c UefiCpuPkg/MpService: fix trivial typo in cpu state
CpuStateBuzy => CpuStateBusy

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17021 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-09 06:37:32 +00:00
Jeff Fan 7475d13829 Add typecast to fix VS2005 build issue.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16419 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-24 04:57:40 +00:00
Jeff Fan 3a5d9a3682 UefiCpuPkg : Fix CpuDxe build issue with VS2005 tool chain
!!() cannot pass VS2005 build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16404 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-19 05:15:06 +00:00
Chen Fan 9840b1299d UefiCpuPkg/CpuDxe: Put APs in wait for SIPI state at ExitBootServices
when gBS->ExitBootServices() is called, the APs should avoid to access
the unsafed buff datas which were allocated by boot services.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16397 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-17 14:54:09 +00:00
Chen Fan 4a50c27285 UefiCpuPkg/CpuDxe: install Mp Service protocol
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16371 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:30:18 +00:00
Jordan Justen dee9376ffc UefiCpuPkg/CpuDxe: Startup APs
This sequence should happen:
* CpuMp.c: Allocate a stack for the APs
* ApStartup.c: Send Start IPI to wake APs in 16-bit real mode
* MpAsm.S: AP enters CpuDxe driver code without stack
  - AP grabs a lock
  - AP sets up stack
  - AP calls CpuMp.c:ApEntryPointInC

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16370 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:30:09 +00:00
Chen Fan cd8c700b03 UefiCpuPkg/MpService: avoid dead lock caused by CheckAllAPsStatus
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16369 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:54 +00:00
Chen Fan 0e724fc198 UefiCpuPkg/MpService: avoid reset AP still hold a lock
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16368 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:40 +00:00
Chen Fan 232eb4c826 UefiCpuPkg/MpService: free the unused cpu data buffer
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16367 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:31 +00:00
Chen Fan ac9dbb3b03 UefiCpuPkg/CpuDxe: introduce ResetApStackless()
If timeout expires before AP returns from Procedure, the AP should
be terminated, we introduce ResetApStackLess() to send init IPI
to let AP exit Procedurce and re-available.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16366 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:13 +00:00
Chen Fan fe078dd57f UefiCpuPkg/CpuDxe: split out StartupCode from StartApsStackless()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16365 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:29:01 +00:00
Chen Fan e4aaf76428 UefiCpuPkg/MpService: avoid next timer getting into CheckAllAPsStatus()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16364 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:48 +00:00
Chen Fan d16cf36d2a UefiCpuPkg/MpService: Simply Lock usage
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16363 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:33 +00:00
Chen Fan acb2172d15 UefiCpuPkg/MpService: move settimer out to InitMpSystemData
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16362 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:20 +00:00
Chen Fan 9908a829d0 UefiCpuPkg/CpuDxe: Ap do loop routine to execute procedure
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16361 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:28:10 +00:00
Chen Fan b7c05ba517 UefiCpuPkg/CpuDxe: implement Mp Services:SwitchBSP()
by now, SwitchBSP() always return UNSUPPORTED

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16360 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:52 +00:00
Chen Fan 5fee172fb7 UefiCpuPkg/CpuDxe: implement Mp Services:StartupAllAPs()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16359 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:34 +00:00
Chen Fan 3f4f0af872 UefiCpuPkg/CpuDxe: implement Mp Protocol:StartupThisAP()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16358 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:21 +00:00
Chen Fan fa7ce675b9 UefiCpuPkg/CpuDxe: implement Mp Protocol:EnableDisableAP()
Due to the implementation of  AcquireSpinLock() is not MP safe,
so we should use AcquireSpinLockOrFail directly instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16357 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:27:09 +00:00
Chen Fan e7938b5a86 UefiCpuPkg/CpuDxe: implement Mp Services:GetProcessorInfo()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16356 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:53 +00:00
Chen Fan d894d8b704 UefiCpuPkg/CpuDxe: implement Mp Protocol:GetNumberOfProcessors()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16355 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:42 +00:00
Chen Fan cfa2fac1f6 UefiCpuPkg/CpuDxe: implement Mp Protocol: WhoAmI()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16354 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:32 +00:00
Chen Fan 03673ae11e UefiCpuPkg/CpuDxe: introduce MP_SYSTEM_DATA for Mp Service Protocol
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16353 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:23 +00:00
Chen Fan 003973d98c UefiCpuPkg/CpuDxe: introduce EFI_MP_SERVICES_PROTOCOL
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16352 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:13 +00:00
Chen Fan e343f8f7b3 UefiCpuPkg/CpuDxe: Switch Ap Stack to NewStack
All APs use the same common stack to initialization. after
initialization, APs should switch to the stack of its own.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16351 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:26:03 +00:00
Chen Fan 6a26a597a3 UefiCpuPkg/CpuDxe: introduce two PCD value
introduce PCD value: PcdCpuMaxLogicalProcessorNumber and PcdCpuApStackSize,
used for initialize APs stacks.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16350 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:25:48 +00:00
Jordan Justen 533263ee5a UefiCpuPkg/CpuDxe: Add StartApsStackless routine
This routine starts the APs and directs them to run the specified
code.

The specified code is entered without a stack being available.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16349 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:25:29 +00:00
Jordan Justen a1e8986d97 UefiCpuPkg/CpuDxe: Move GDT structures into CpuGdt.h
We'll want to use the structures for AP startup.

Note: It seems previously we were not using '#pragma pack ()' in
      CpuGdt.c.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16348 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:25:10 +00:00
Jordan Justen fab82c1873 UefiCpuPkg/CpuDxe: Add stackless assembly AP entry points
The AP startup code simply jumps into this code with the CpuDxe driver
without setting up a stack for the processor.

Therefore, this code must setup the stack before calling into C code.

This is the basic flow:
* AP enters CpuDxe driver code (AsmApEntryPoint) without stack
  - AP grabs a lock
  - AP sets up stack
  - AP calls CpuMp.c:ApEntryPointInC
  - If ApEntryPointInC returns, the lock is freed, and another AP may
    run
  - The AP C code may call AsmApDoneWithCommonStack to indicate that
    the AP is no longer using the stack, and another may therefore
    proceed to use the stack and then call ApEntryPointInC

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16347 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:24:59 +00:00
Jordan Justen 1535c888c6 UefiCpuPkg/CpuDxe: Add ApEntryPointInC
This is the function the AP assembly code will expect to call after
getting a lock and setting up the stack.

Only one AP will enter this routine at a time.

If ApEntryPointInC exits, then the assembly code will loop around to
grab the lock, setup the stack, and call ApEntryPointInC again.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16346 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:24:43 +00:00
Jordan Justen 6022e28cf7 UefiCpuPkg/CpuDxe: Add no-op InitializeMpSupport
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16345 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-13 18:24:25 +00:00
Gao, Liming ec482fa9ba UefiCpuPkg: Convert non DOS format files to DOS format
Module UNI and Package UNI files are not DOS format. Convert them to DOS format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16047 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-03 08:48:53 +00:00
Gao, Liming 9ddb2a2341 UefiCpuPkg: INF/DEC file updates to EDK II packages
2. Add MODULE_UNI_FILE file that contains the localized Abstract and Description of a module.
a. Addresses an information gap between INF files and the UEFI Distribution Packaging Specification XML schema
b. There will be an associated update to UPT in BaseTools to consume MODULE_UNI_FILE and associated UNI file during UDP creation that performs the INF -> XML conversion.
c. There will be an associated update to UPT in BaseTools to produce MODULE_UNI_FILE and associated UNI file during UDP installation that performs the XML -> INF conversion.

3. Add Module Extra UNI file that provides the localized Name of a module.
a. [UserExtensions.TianoCore."ExtraFiles"] provides an easy method for a module to specify extra files not listed in [Sources] or [Binaries] sections to be added to a UDP without having to list the files in the UPT package information data file.
b. There will be an associated update to UPT in BaseTools to package up files listed in [UserExtensions.TianoCore."ExtraFiles"] during UDP creation.
c. UNI file contains localized name of a module to go along with the localized Abstract and Description from the MODULE_UNI_FILE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15934 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28 05:11:06 +00:00
Gao, Liming e48e07424a UefiCpuPkg: INF/DEC file updates to EDK II packages
1. Usage information in INF file comment blocks are either incomplete or incorrect.  
This includes usage information for Protocols/PPIs/GUIDs/PCDs/HOBs/Events/BootModes.  
The syntax for usage information in comment blocks is defined in the EDK II Module Information (INF) Specification

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15933 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28 05:09:12 +00:00
Jeff Fan e41aad1521 1. Separated DxeSmmCpuExceptionHandlerLib.inf into 2 instance DxeCpuExceptionHandlerLib.inf and SmmCpuExceptionHandlerLib.inf.
2. Updated CPU Exception Handler Library instance according to the new CPU Exception Handler Library class definitions.
3. Updated CPU Exception Handler Library instance to handle the vector attributes defined in PI 1.2.1.

Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hot Tian <hot.tian@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14885 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-22 06:24:41 +00:00
Samer El-Haj-Mahmoud 79aca636ab Fix several DEBUG_ERROR messages that are unnecessarily verbose. Several of these are marked as DEBUG_ERROR when they are really not errors.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>
reviewed-by: Fan, Jeff <jeff.fan@intel.com>
reviewed-by: Tian, Feng <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14750 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-08 09:27:02 +00:00
lzeng14 ce68d3bc68 Add missing braces around initializer.
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qian Ouyang <qian.ouyang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13817 6f19259b-4bc3-4df7-8a09-765794883524
2012-10-11 02:15:23 +00:00
vanjeff be7256aeb0 Add type cast to avoid sign extension on x64 tip.
signed-off-by: Jeff Fan <jeff.fan@intel.com>
reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13709 6f19259b-4bc3-4df7-8a09-765794883524
2012-09-10 02:36:17 +00:00
rsun3 661cab5d6a UefiCpuPkg CpuDxe: Call UefiCpuLib.InitializeFloatingPointUnits () to initialize X87 FPU Control Word for BSP.
For a platform tip with 32-bit PEI+64-bit DXE, InitializeFloatingPointUnits () should be called for BSP in the DXE phase.

Signed-off-by: Sun Rui <rui.sun@intel.com>
Reviewed-by: Fan Jeff <jeff.fan@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13511 6f19259b-4bc3-4df7-8a09-765794883524
2012-07-06 05:49:53 +00:00
vanjeff 139259bcc2 Remove CPU dead loop code from IA32 assembly codes.
Signed-off-by: Fan Jeff <jeff.fan@intel.com>
Reviewed-by: Sun Rui <rui.sun@intel.com>


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13388 6f19259b-4bc3-4df7-8a09-765794883524
2012-05-31 01:34:44 +00:00
geekboy15a d4605c23ea UefiCpuPkg: Added code to enable Local APIC.
This patch enables interrupt delivery via the Local APIC as part of the initialization process.

Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Rosenbaum, Lee G <lee.g.rosenbaum@intel.com>
Reviewed-by: Sun Rui <rui.sun@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13338 6f19259b-4bc3-4df7-8a09-765794883524
2012-05-18 20:29:14 +00:00
vanjeff de4b64f714 Restore original IDT entry if RegisterInterruptHandler() was used to unregister user defined interrupt handler.
Signed-off-by: vanjeff
Reviewed-by: rsun3



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12719 6f19259b-4bc3-4df7-8a09-765794883524
2011-11-16 02:31:31 +00:00
vanjeff 2c4b1bdce7 Roll back the change on GetMemorySpaceAttributeFromMtrrType()'s parameter type, from MTRR_MEMORY_CACHE_TYPE to UINT8 since MtrrAttributes may be the value not belongs to MTRR_MEMORY_CACHE_TYPE.
Signed-off-by: vanjeff



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12609 6f19259b-4bc3-4df7-8a09-765794883524
2011-10-31 06:45:56 +00:00
vanjeff 91ec78241c 1. Introduce the API MtrrGetDefaultMemoryType () in Mtrr Library.
2. Invoke MtrrGetDefaultMemoryType() to get the default memory type instead of the hard code value in module.
3. Add go though for UC attributes.

Signed-off-by: vanjeff
Reviewed-by: rsun3

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12587 6f19259b-4bc3-4df7-8a09-765794883524
2011-10-28 06:01:55 +00:00
niruiyu a6ce6cf992 Fix typo that breaks the build.
Signed-off-by: niruiyu
Reviewed-by: vanjeff

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12002 6f19259b-4bc3-4df7-8a09-765794883524
2011-07-08 06:51:30 +00:00
andrewfish 4d0ceb8dca UefiCpuPkg: Fix X64 clang compiler/assembler warnings.
Signed-off-by: andrewfish
Reviewed-by: rsun3



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11996 6f19259b-4bc3-4df7-8a09-765794883524
2011-07-06 18:12:29 +00:00
jljusten 323940278e UefiCpuPkg/CpuDxe: Put CPU to sleep during Idle events
When the MdeModulePkg gCoreEventIdleGuid event is signaled,
CpuSleep is called.  This will cause the CPU to sleep until
the next interrupt occurs.

Signed-off-by: jljusten
Reviewed-by: mdkinney
Reviewed-by: rsun3

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11842 6f19259b-4bc3-4df7-8a09-765794883524
2011-06-16 23:28:16 +00:00
vanjeff 62ba7e1704 CpuDxe entry point () only register exception handlers unassigned before.
Signed-off-by: vanjeff
Reviewed-by: rsun3

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11699 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-25 02:35:34 +00:00
rsun3 4ec21e8b50 Per PI 1.2 errata B spec, for SetMemoryAttributes() service of CPU Architecture Protocol, EFI_INVALID_PARAMETER should be returned for cases:
If Attributes specifies a combination of memory attributes that cannot be set together, then EFI_INVALID_PARAMETER is returned. For example, if both EFI_MEMORY_UC and EFI_MEMORY_WT are set.

Signed-off-by: rsun3
Reviewed-by:  jyao1


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11694 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-24 01:56:29 +00:00
rsun3 24f7e42cb7 A complement fix for revision 11664 to update GCC assembly files : clear the direction flag in interrupt/exception handlers' assembly entry code before calling C functions to follow the UEFI calling convention.
Signed-off-by: rsun3
Reviewed-by:  jyao1


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11670 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-17 08:35:20 +00:00
rsun3 ad8cbf7197 Clear the direction flag in interrupt/exception handlers' assembly entry code before calling C functions to follow the UEFI calling convention.
Signed-off-by: rsun3
Reviewed-by:  jyao1


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11664 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-16 06:10:42 +00:00
mdkinney f877f3006e Add DEBUG() macros for DEBUG_CACHE to MTRR Library show all changes memory caches setting changes.
If DEBUG_PROPERTY_DEBUG_CODE_ENABLED is also set in PcdDebugPropertyMask, then the entire set of MTRRs will be displayed on every memory cache setting change.



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11231 6f19259b-4bc3-4df7-8a09-765794883524
2011-01-06 02:57:26 +00:00
rsun3 304a39b746 Fix a bug that the size of a gate descriptor in the IDT is 8 bytes. The size is 8 bytes in 32-bit mode, while it is 16 bytes in 64-bit mode. Replace the hard-coded size with a sizeof.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11177 6f19259b-4bc3-4df7-8a09-765794883524
2010-12-17 02:38:26 +00:00
ydong10 1e51d5954b Refine code to follow the coding style.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10992 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-01 09:00:23 +00:00
ydong10 c52acd89e8 Refine code to remove type converting warning.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10982 6f19259b-4bc3-4df7-8a09-765794883524
2010-10-26 07:52:31 +00:00
jljusten 557b970a2f UefiCpuPkg CpuDxe: Fix bug with CPU Arch RegisterInterruptHandler
The change in r10765 introduced an issue where inherited interrupt
handlers would override the driver's RegisterInterruptHandler
functionality.

DUET installs a IDT with 256 entries early in it's boot.  Therefore,
no interrupt handlers could be installed with DUET while using
UefiCpuPkg/CpuDxe (instead of DuetPkg/CpuDxe).

This change forces the IDT to be modified when RegisterInterruptHandler
is called to ensure the UEFI handler will be installed properly.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10972 6f19259b-4bc3-4df7-8a09-765794883524
2010-10-22 01:07:48 +00:00
xli24 5b7e61a0c5 Add explicit type cast to suppress possible warning of precession loss.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10783 6f19259b-4bc3-4df7-8a09-765794883524
2010-08-10 06:57:32 +00:00
mdkinney 0564ae5ee6 Inherit entries from previous IDT when new IDT is installed.
Update CS in each inherited IDT entry to match CS for the new GDT.


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10765 6f19259b-4bc3-4df7-8a09-765794883524
2010-08-03 04:54:44 +00:00
xli24 430fbbe096 Code refinement.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10647 6f19259b-4bc3-4df7-8a09-765794883524
2010-07-13 03:08:54 +00:00
rsun3 61ece967cb Skip restoration of DRx registers to support in-circuit emualators or debuggers set breakpoint in interrupt/exception context.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10573 6f19259b-4bc3-4df7-8a09-765794883524
2010-06-11 03:22:15 +00:00
hhtian 01a1c0fc9e Update the copyright notice format
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10429 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-24 12:25:26 +00:00
lgao4 712389b848 Update the modules with the different module GUID to avoid the different modules with the same module GUID.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10345 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-06 02:56:49 +00:00
xli24 947a573ada Add Checking for MTRR existence.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10223 6f19259b-4bc3-4df7-8a09-765794883524
2010-03-10 02:38:39 +00:00
xli24 5bdfa4e58a Add array index check to avoid potential buffer overflow.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10179 6f19259b-4bc3-4df7-8a09-765794883524
2010-03-04 06:38:22 +00:00
jljusten a495774f69 Remove svn:executable on *.c, *.h, *.asm, *.S, *.inf and *.asl*
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10087 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-25 18:17:41 +00:00
klu2 24321aa11e Clean up EFI_SPECIFICATION_VERSION and PI_SPECIFICATION_VERSION.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10077 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-25 16:50:12 +00:00
vanjeff dc8f418d71 roll back changing on save and restore interrupt status, it needn't doing.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10059 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-24 08:29:53 +00:00
lgao4 7b202cb0f9 1. Correct File header to ## @file
2. Remove unnecessary .common] postfix on section.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10051 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-23 23:58:38 +00:00
jljusten 6640eb366c UefiCpuPkg/CpuDxe: Fix build error
This driver was not building following the r9935 & r9941 changes.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9969 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-10 17:37:37 +00:00
jljusten 3e6374dfd8 UefiCpuPkg/CpuDxe: Remove unnecessary OvmfPkg dependency
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9967 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-10 17:36:50 +00:00
vanjeff ea99e00d76 a)Save and disable CPU interrupt before calling AsmWriteIdtr().
b)Restore CPU interrupt status after callng AsmWriteIdtr().


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9956 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-09 09:23:17 +00:00
jyao1 3b9be4164b Original MTRR lib hardcode VARIABLE_MTRR as 8. But it is 7 in Core2 if SMRR enabled, and 10 in latest Corei7.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9935 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-05 06:33:42 +00:00
qhuang8 c8adfe9ddc Use .p2align directive instead of ambiguous .align directive.
(Judging from the context, the original .align should means the power of two.)


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9156 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-20 08:05:49 +00:00
qhuang8 c2fd60f071 Update to make end-of-line consistent for all source files in MdePkg. There are no other updates besides that change.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9155 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-20 08:04:40 +00:00
gikidy 3668c083cd Remove ".intel_syntax", convert MASM to GAS.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9079 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-17 05:39:17 +00:00
gikidy db63aeea6d Remove ".intel_syntax", convert MASM to GAS.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9067 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-14 04:01:56 +00:00