Now uses a macro to export global symbols.

Added the reboot() function from our kernel.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8654 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-08-25 15:38:26 +00:00
parent 30f0f48a33
commit d3a947b004
+18 -12
View File
@@ -4,14 +4,15 @@
*/ */
#define FUNCTION(x) .global x; .type x,@function; x
/* uint64 rdtsc() */ /* uint64 rdtsc() */
.global rdtsc FUNCTION(rdtsc):
rdtsc:
rdtsc rdtsc
ret ret
.global execute_n_instructions FUNCTION(execute_n_instructions):
execute_n_instructions:
movl 4(%esp), %ecx movl 4(%esp), %ecx
shrl $4, %ecx shrl $4, %ecx
.again: .again:
@@ -34,8 +35,7 @@ execute_n_instructions:
loop .again loop .again
ret ret
.global system_time FUNCTION(system_time):
system_time:
/* load 64-bit factor into %eax (low), %edx (high) */ /* load 64-bit factor into %eax (low), %edx (high) */
/* hand-assemble rdtsc -- read time stamp counter */ /* hand-assemble rdtsc -- read time stamp counter */
rdtsc /* time in %edx,%eax */ rdtsc /* time in %edx,%eax */
@@ -54,8 +54,7 @@ system_time:
popl %ebx popl %ebx
ret ret
.global cpuid FUNCTION(cpuid):
cpuid:
pushl %ebx pushl %ebx
pushl %edi pushl %edi
movl 12(%esp),%eax movl 12(%esp),%eax
@@ -69,16 +68,23 @@ cpuid:
popl %ebx popl %ebx
ret ret
.global get_eflags FUNCTION(get_eflags):
get_eflags:
pushfl pushfl
popl %eax popl %eax
ret ret
.global set_eflags FUNCTION(set_eflags):
set_eflags:
pushl 4(%esp) pushl 4(%esp)
popfl popfl
ret ret
null_idt_descr:
.word 0
.word 0,0
FUNCTION(reboot):
lidt null_idt_descr
int $0
done:
jmp done