POK(kernelpart)
Main Page
Data Structures
Files
File List
Globals
arch.c
Go to the documentation of this file.
1
/*
2
* POK header
3
*
4
* The following file is a part of the POK project. Any modification should
5
* made according to the POK licence. You CANNOT use this file or a part of
6
* this file is this part of a file for your own project
7
*
8
* For more information on the POK licence, please see our LICENCE FILE
9
*
10
* Please follow the coding guidelines described in doc/CODING_GUIDELINES
11
*
12
* Copyright (c) 2007-2009 POK team
13
*
14
* Created by julien on Thu Jan 15 23:34:13 2009
15
*/
16
24
#include <
errno.h
>
25
#include <
core/partition.h
>
26
27
#include "
event.h
"
28
#include "
gdt.h
"
29
30
pok_ret_t
pok_arch_init
()
31
{
32
pok_gdt_init
();
33
pok_event_init
();
34
35
return
(
POK_ERRNO_OK
);
36
}
37
38
pok_ret_t
pok_arch_preempt_disable
()
39
{
40
asm
(
"cli"
);
41
return
(
POK_ERRNO_OK
);
42
}
43
44
pok_ret_t
pok_arch_preempt_enable
()
45
{
46
asm
(
"sti"
);
47
return
(
POK_ERRNO_OK
);
48
}
49
50
pok_ret_t
pok_arch_idle
()
51
{
52
while
(1)
53
{
54
asm
(
"hlt"
);
55
}
56
57
return
(
POK_ERRNO_OK
);
58
}
59
60
pok_ret_t
pok_arch_event_register
(
uint8_t
vector,
61
void
(*handler)(
void
))
62
{
63
pok_idt_set_gate
(vector,
64
GDT_CORE_CODE_SEGMENT
<< 3,
65
(
uint32_t
)handler,
66
IDTE_TRAP
,
67
3);
68
69
return
(
POK_ERRNO_OK
);
70
}
71
72
uint32_t
pok_thread_stack_addr
(
const
uint8_t
partition_id,
73
const
uint32_t
local_thread_id)
74
{
75
return
pok_partitions[partition_id].size - 4 - (local_thread_id * POK_USER_STACK_SIZE);
76
}
77
kernel
arch
x86
arch.c
Generated on Fri Jun 1 2012 19:07:12 for POK(kernelpart) by
1.8.1