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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [libl4/] [src/] [init.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Initialise system call offsets and utcb reference.
3
 *
4
 * Copyright (C) 2007-2009 Bahadir Bilgehan Balban
5
 */
6
#include <l4lib/kip.h>
7
#include L4LIB_INC_ARCH(syslib.h)
8
#include L4LIB_INC_ARCH(utcb.h)
9
#include <l4lib/ipcdefs.h>
10
#include <l4/macros.h>
11
#include INC_GLUE(memlayout.h)
12
#include <stdio.h>
13
 
14
__l4_ipc_t __l4_ipc = 0;
15
__l4_map_t __l4_map = 0;
16
__l4_unmap_t __l4_unmap = 0;
17
__l4_getid_t __l4_getid = 0;
18
__l4_thread_switch_t __l4_thread_switch = 0;
19
__l4_thread_control_t __l4_thread_control = 0;
20
__l4_ipc_control_t __l4_ipc_control = 0;
21
__l4_irq_control_t __l4_irq_control = 0;
22
__l4_exchange_registers_t __l4_exchange_registers = 0;
23
__l4_container_control_t __l4_container_control = 0;
24
__l4_capability_control_t __l4_capability_control = 0;
25
__l4_time_t __l4_time = 0;
26
__l4_mutex_control_t __l4_mutex_control = 0;
27
__l4_cache_control_t __l4_cache_control = 0;
28
 
29
struct kip *kip;
30
 
31
l4id_t pagerid;
32
 
33
/*
34
 * Reference to private UTCB of this thread.
35
 * Used only for pushing/reading ipc message registers.
36
 */
37
struct utcb **kip_utcb_ref;
38
 
39
 
40
void __l4_init(void)
41
{
42
        /* Kernel interface page */
43
        kip = l4_kernel_interface(0, 0, 0);
44
 
45
        /* Reference to utcb field of KIP */
46
        kip_utcb_ref = (struct utcb **)&kip->utcb;
47
 
48
        __l4_ipc =              (__l4_ipc_t)kip->ipc;
49
        __l4_map =              (__l4_map_t)kip->map;
50
        __l4_unmap =            (__l4_unmap_t)kip->unmap;
51
        __l4_getid =            (__l4_getid_t)kip->getid;
52
        __l4_thread_switch =    (__l4_thread_switch_t)kip->thread_switch;
53
        __l4_thread_control=    (__l4_thread_control_t)kip->thread_control;
54
        __l4_ipc_control=       (__l4_ipc_control_t)kip->ipc_control;
55
        __l4_irq_control=       (__l4_irq_control_t)kip->irq_control;
56
        __l4_exchange_registers =
57
                        (__l4_exchange_registers_t)kip->exchange_registers;
58
        __l4_capability_control =
59
                        (__l4_capability_control_t)kip->capability_control;
60
        __l4_container_control =
61
                        (__l4_container_control_t)kip->container_control;
62
        __l4_time =             (__l4_time_t)kip->time;
63
        __l4_mutex_control =    (__l4_mutex_control_t)kip->mutex_control;
64
        __l4_cache_control =    (__l4_cache_control_t)kip->cache_control;
65
}
66
 

powered by: WebSVN 2.1.0

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