OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [test_suite0/] [src/] [perf/] [timer.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Initialize platform timer virtual address
3
 *
4
 * Copyright (C) 2010 B Labs Ltd.
5
 *
6
 * Bahadir Balban
7
 */
8
#include <perf.h>
9
#include <linker.h>
10
#include <l4lib/macros.h>
11
#include L4LIB_INC_ARCH(syslib.h)
12
#include L4LIB_INC_ARCH(syscalls.h)
13
 
14
/* Note this must be obtained from the capability */
15
#define TIMER_PHYSICAL_BASE             0x10012000
16
 
17
unsigned long timer_base;
18
 
19
void perf_timer_init(void)
20
{
21
        int err;
22
        struct task_ids ids;
23
 
24
        l4_getid(&ids);
25
 
26
        /* Initialize timer base */
27
        timer_base = page_align_up(__stack);
28
 
29
        /* Map timer base */
30
        if ((err = l4_map((void *)TIMER_PHYSICAL_BASE,
31
                          (void *)timer_base,
32
                          1, MAP_USR_IO, ids.tid)) < 0) {
33
                printf("FATAL: Performance tests: Could not map "
34
                       "timer.\ntimer must be selected as a "
35
                       "container capability. err=%d\n",
36
                       err);
37
                BUG();
38
        }
39
}
40
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.