diff --git a/src/system/kernel/arch/arm/arch_timer.cpp b/src/system/kernel/arch/arm/arch_timer.cpp index 6c291ed6bb..01a6fb2f9a 100644 --- a/src/system/kernel/arch/arm/arch_timer.cpp +++ b/src/system/kernel/arch/arm/arch_timer.cpp @@ -29,7 +29,7 @@ #define PXA_TIMERS_PHYS_BASE 0x40A00000 -#define PXA_TIMERS_SIZE 0x000000C0 +#define PXA_TIMERS_SIZE B_PAGE_SIZE #define PXA_TIMERS_INTERRUPT 7 /* OST_4_11 */ #define PXA_OSSR 0x05 @@ -48,7 +48,7 @@ #define US2S(bt) ((bt) / 1000000ULL) #define US2MS(bt) ((bt) / 1000ULL) -static area_id sPxaTimersArea = B_ERROR; +static area_id sPxaTimersArea = -1; static uint32 *sPxaTimersBase = NULL; static bigtime_t sSystemTime = 0; @@ -107,6 +107,7 @@ arch_timer_clear_hardware_timer() int arch_init_timer(kernel_args *args) { + TRACE(("%s\n", __func__)); sPxaTimersArea = map_physical_memory("pxa_timers", PXA_TIMERS_PHYS_BASE, PXA_TIMERS_SIZE, 0, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, (void**)&sPxaTimersBase); @@ -126,6 +127,9 @@ arch_init_timer(kernel_args *args) bigtime_t system_time(void) { + if (sPxaTimersArea < 0) + return 0; + return (sPxaTimersBase != NULL) ? sSystemTime + sPxaTimersBase[PXA_OSCR5] : 0ULL;