Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355824
b: refs/heads/master
c: b2deabe
h: refs/heads/master
v: v3
  • Loading branch information
Mark Rutland committed Jan 31, 2013
1 parent 38be4dc commit 66d431a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ba1cefc277865a0ac222f53bbbf2ebacad1559a
refs/heads/master: b2deabe3ba664a1ec47400c0ca285e951874e0cc
12 changes: 12 additions & 0 deletions trunk/arch/arm/include/asm/arch_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ static inline u64 arch_counter_get_cntvct(void)
asm volatile("mrrc p15, 1, %Q0, %R0, c14" : "=r" (cval));
return cval;
}

static inline void __cpuinit arch_counter_set_user_access(void)
{
u32 cntkctl;

asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl));

/* disable user access to everything */
cntkctl &= ~((3 << 8) | (7 << 0));

asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl));
}
#else
static inline int arch_timer_of_register(void)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/kernel/arch_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ static int __cpuinit arch_timer_setup(struct clock_event_device *clk)
enable_percpu_irq(arch_timer_ppi[PHYS_NONSECURE_PPI], 0);
}

arch_counter_set_user_access();

return 0;
}

Expand Down

0 comments on commit 66d431a

Please sign in to comment.