summaryrefslogtreecommitdiff
path: root/src/arch/ppc/lib/timer.c
blob: 6889d4b2e81070b2c4d486d976c2ee54f9e1b941 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Copyright 2000  AG Electronics Ltd. */
/* This code is distributed without warranty under the GPL v2 (see COPYING) */

#include <ppc.h>
#include <timer.h>
#include <clock.h>

unsigned long get_hz(void)
{
	return get_timer_freq();
}

unsigned long ticks_since_boot(void)
{
	extern unsigned long _get_ticks(void);
	return _get_ticks();
}

void udelay(int usecs)
{
	extern void _wait_ticks(unsigned long);
	unsigned long ticksperusec = get_hz() / 1000000;

	_wait_ticks(ticksperusec * usecs);
}