]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix OS X build issues. Wrong slash direction in include path and unused variable...
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 May 2010 01:35:15 +0000 (01:35 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 May 2010 01:35:15 +0000 (01:35 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10498 6f19259b-4bc3-4df7-8a09-765794883524

ArmEbPkg/Include/ArmEb/ArmEb.h
ArmEbPkg/TimerDxe/Timer.c

index 0018e84eba2d1a77157f939bcc98a6876b072976..f855e6379d2f1a3f8e23458a32af34c032f93f8d 100755 (executable)
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __ARM_EB_H__\r
 #define __ARM_EB_H__\r
 \r
-#include <ArmEb\ArmEbUart.h>\r
-#include <ArmEb\ArmEbTimer.h>\r
+#include <ArmEb/ArmEbUart.h>\r
+#include <ArmEb/ArmEbTimer.h>\r
 \r
 #endif \r
index a034eef0f242b974704b953f7e49e7b3ad7ee836..12102a3c0b53ff926a32d435061a6cb5182313e6 100755 (executable)
@@ -75,7 +75,8 @@ TimerInterruptHandler (
   //
   OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
 
-  // clear the periodic interrupt\r
+  // clear the periodic interrupt
+
   MmioWrite32 (EB_SP804_TIMER0_BASE + SP804_TIMER_INT_CLR_REG, 0);
 
   // signal end of interrupt early to help avoid losing subsequent ticks from long duration handlers
@@ -173,32 +174,50 @@ TimerDriverSetTimerPeriod (
   )
 {
   EFI_STATUS  Status;
-  UINT64      TimerTicks;\r
+  UINT64      TimerTicks;
+
   
   // always disable the timer
   MmioAnd32 (EB_SP804_TIMER0_BASE + SP804_TIMER_CONTROL_REG, ~SP804_TIMER_CTRL_ENABLE);
 
   if (TimerPeriod == 0) {
-    // leave timer disabled from above, and...\r
-    // disable timer 0/1 interrupt for a TimerPeriod of 0\r
+    // leave timer disabled from above, and...
+
+    // disable timer 0/1 interrupt for a TimerPeriod of 0
+
     
     Status = gInterrupt->DisableInterruptSource (gInterrupt, gVector);    
   } else {  
-    // Convert TimerPeriod into 1MHz clock counts (us units = 100ns units / 10)\r
-    TimerTicks = DivU64x32 (TimerPeriod, 10);\r
-   \r
-    // if it's larger than 32-bits, pin to highest value\r
-    if (TimerTicks > 0xffffffff) {\r
-      TimerTicks = 0xffffffff;\r
-    }\r
-\r
-    // Program the SP804 timer with the new count value\r
-    MmioWrite32 (EB_SP804_TIMER0_BASE + SP804_TIMER_LOAD_REG, TimerTicks);\r
-    \r
-    // enable the timer\r
-    MmioOr32 (EB_SP804_TIMER0_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);\r
-\r
-    // enable timer 0/1 interrupts\r
+    // Convert TimerPeriod into 1MHz clock counts (us units = 100ns units / 10)
+
+    TimerTicks = DivU64x32 (TimerPeriod, 10);
+
+   
+
+    // if it's larger than 32-bits, pin to highest value
+
+    if (TimerTicks > 0xffffffff) {
+
+      TimerTicks = 0xffffffff;
+
+    }
+
+
+
+    // Program the SP804 timer with the new count value
+
+    MmioWrite32 (EB_SP804_TIMER0_BASE + SP804_TIMER_LOAD_REG, TimerTicks);
+
+    
+
+    // enable the timer
+
+    MmioOr32 (EB_SP804_TIMER0_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);
+
+
+
+    // enable timer 0/1 interrupts
+
     Status = gInterrupt->EnableInterruptSource (gInterrupt, gVector);    
   }
 
@@ -330,26 +349,29 @@ TimerInitialize (
 {
   EFI_HANDLE  Handle = NULL;
   EFI_STATUS  Status;
-  UINT32      TimerBaseAddress;
-
-  // configure free running timer (TIMER1) for 1MHz operation\r
-  \r
-  // AND disable clock, OR configure 1MHz clock\r
-  MmioAndThenOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER1_EN, SP810_SYS_CTRL_TIMER1_TIMCLK);  \r
-\r
-  // Renable timer\r
-  MmioOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER1_EN);  \r
-    \r
-\r
-  // configure timer 1 for free running operation, 32 bits, no prescaler, interrupt disabled\r
-  MmioWrite32 (EB_SP804_TIMER1_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1);\r
-\r
-  // enable the free running timer\r
-  MmioOr32 (EB_SP804_TIMER1_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);\r
-\r
-  // record free running tick value (should be close to 0xffffffff)\r
-  mLastTickCount = MmioRead32 (EB_SP804_TIMER1_BASE + SP804_TIMER_CURRENT_REG);\r
-\r
+
+
+  // configure free running timer (TIMER1) for 1MHz operation
+  
+
+  // AND disable clock, OR configure 1MHz clock
+  MmioAndThenOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER1_EN, SP810_SYS_CTRL_TIMER1_TIMCLK);  
+
+
+  // Renable timer
+  MmioOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER1_EN);  
+
+    
+  // configure timer 1 for free running operation, 32 bits, no prescaler, interrupt disabled
+  MmioWrite32 (EB_SP804_TIMER1_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1);
+
+  // enable the free running timer
+  MmioOr32 (EB_SP804_TIMER1_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);
+
+  // record free running tick value (should be close to 0xffffffff)
+  mLastTickCount = MmioRead32 (EB_SP804_TIMER1_BASE + SP804_TIMER_CURRENT_REG);
+
+
   // Disable the timer
   Status = TimerDriverSetTimerPeriod (&gTimer, 0);
   ASSERT_EFI_ERROR (Status);
@@ -358,18 +380,19 @@ TimerInitialize (
   gVector = EB_TIMER01_INTERRUPT_NUM;
   Status = gInterrupt->RegisterInterruptSource (gInterrupt, gVector, TimerInterruptHandler);
   ASSERT_EFI_ERROR (Status);
-\r
-\r
-  // configure periodic timer (TIMER0) for 1MHz operation\r
-  MmioAndThenOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER0_EN, SP810_SYS_CTRL_TIMER0_TIMCLK);\r
-\r
-  // Renable timer\r
-  MmioOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER0_EN);  \r
-\r
-  // configure timer 0 for periodic operation, 32 bits, no prescaler, and interrupt enabled\r
-  MmioWrite32 (EB_SP804_TIMER0_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_PERIODIC | SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1 | SP804_TIMER_CTRL_INT_ENABLE);\r
 
 
+  // configure periodic timer (TIMER0) for 1MHz operation
+  MmioAndThenOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, ~SP810_SYS_CTRL_TIMER0_EN, SP810_SYS_CTRL_TIMER0_TIMCLK);
+
+
+  // Renable timer
+  MmioOr32 (EB_SP810_CTRL_BASE + SP810_SYS_CTRL_REG, SP810_SYS_CTRL_TIMER0_EN);  
+
+
+  // configure timer 0 for periodic operation, 32 bits, no prescaler, and interrupt enabled
+  MmioWrite32 (EB_SP804_TIMER0_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_PERIODIC | SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1 | SP804_TIMER_CTRL_INT_ENABLE);
+
   // Set up default timer
   Status = TimerDriverSetTimerPeriod (&gTimer, FixedPcdGet32(PcdTimerPeriod)); // TIMER_DEFAULT_PERIOD
   ASSERT_EFI_ERROR (Status);