Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204640
b: refs/heads/master
c: 6f34b08
h: refs/heads/master
v: v3
  • Loading branch information
Michal Simek committed Aug 4, 2010
1 parent 81d17d6 commit d97ec1a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce3266c047389443d5f433d605c769e878cbe46e
refs/heads/master: 6f34b08f58f5097bb408e188e09cda75e61ee513
2 changes: 0 additions & 2 deletions trunk/arch/microblaze/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ void disable_early_printk(void);
void heartbeat(void);
void setup_heartbeat(void);

unsigned long long sched_clock(void);

# ifdef CONFIG_MMU
extern void mmu_reset(void);
extern void early_console_reg_tlb_alloc(unsigned int addr);
Expand Down
17 changes: 17 additions & 0 deletions trunk/arch/microblaze/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ static int __init microblaze_clocksource_init(void)
return 0;
}

/*
* We have to protect accesses before timer initialization
* and return 0 for sched_clock function below.
*/
static int timer_initialized;

void __init time_init(void)
{
u32 irq, i = 0;
Expand Down Expand Up @@ -289,4 +295,15 @@ void __init time_init(void)
#endif
microblaze_clocksource_init();
microblaze_clockevent_init();
timer_initialized = 1;
}

unsigned long long notrace sched_clock(void)
{
if (timer_initialized) {
struct clocksource *cs = &clocksource_microblaze;
cycle_t cyc = cs->read(NULL);
return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
}
return 0;
}

0 comments on commit d97ec1a

Please sign in to comment.