]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/TimerDxe/Timer.c
UefiCpuPkg/UefiCpuPkg.dec: Add two new PCDs for stack switch
[mirror_edk2.git] / Nt32Pkg / TimerDxe / Timer.c
index d9944414cf1a6aaf203e9b918b074e78d3f70d58..aa89f6c566dbfd660cfa261a04c5cca5fe9bcfef 100644 (file)
@@ -1,7 +1,7 @@
-/*++\r
+/**@file\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -21,7 +21,7 @@ Abstract:
   timer service.  In the future, the Thread creation should possibly be \r
   abstracted by the CPU architectural protocol\r
 \r
---*/\r
+**/\r
 \r
 #include "Timer.h"\r
 \r
@@ -497,7 +497,7 @@ Returns:
 \r
   EFI_SUCCESS       - The soft timer interrupt was generated.\r
 \r
-  EFI_UNSUPPORTEDT  - The platform does not support the generation of soft timer interrupts.\r
+  EFI_UNSUPPORTED   - The platform does not support the generation of soft timer interrupts.\r
 \r
 --*/\r
 {\r
@@ -536,7 +536,9 @@ Returns:
   EFI_STATUS  Status;\r
   UINTN       Result;\r
   EFI_HANDLE  Handle;\r
-\r
+  EFI_HANDLE  hSourceProcessHandle;\r
+  EFI_HANDLE  hSourceHandle;\r
+  EFI_HANDLE  hTargetProcessHandle;\r
   //\r
   // Make sure the Timer Architectural Protocol is not already installed in the system\r
   //\r
@@ -545,16 +547,19 @@ Returns:
   //\r
   // Get the CPU Architectural Protocol instance\r
   //\r
-  Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, &mCpu);\r
+  Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID**)&mCpu);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
   //  Get our handle so the timer tick thread can suspend\r
   //\r
+  hSourceProcessHandle = gWinNt->GetCurrentProcess ();\r
+  hSourceHandle        = gWinNt->GetCurrentThread ();\r
+  hTargetProcessHandle = gWinNt->GetCurrentProcess ();\r
   Result = gWinNt->DuplicateHandle (\r
-                    gWinNt->GetCurrentProcess (),\r
-                    gWinNt->GetCurrentThread (),\r
-                    gWinNt->GetCurrentProcess (),\r
+                    hSourceProcessHandle,\r
+                    hSourceHandle,\r
+                    hTargetProcessHandle,\r
                     &mNtMainThreadHandle,\r
                     0,\r
                     FALSE,\r