From d3a947b004b2a3c83dd6260468b6c39132a7394b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 25 Aug 2004 15:38:26 +0000 Subject: [PATCH] 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 --- src/kernel/boot/platform/bios_ia32/support.S | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/kernel/boot/platform/bios_ia32/support.S b/src/kernel/boot/platform/bios_ia32/support.S index 3fea15e875..08fb412d6f 100644 --- a/src/kernel/boot/platform/bios_ia32/support.S +++ b/src/kernel/boot/platform/bios_ia32/support.S @@ -4,14 +4,15 @@ */ +#define FUNCTION(x) .global x; .type x,@function; x + + /* uint64 rdtsc() */ -.global rdtsc -rdtsc: +FUNCTION(rdtsc): rdtsc ret -.global execute_n_instructions -execute_n_instructions: +FUNCTION(execute_n_instructions): movl 4(%esp), %ecx shrl $4, %ecx .again: @@ -34,8 +35,7 @@ execute_n_instructions: loop .again ret -.global system_time -system_time: +FUNCTION(system_time): /* load 64-bit factor into %eax (low), %edx (high) */ /* hand-assemble rdtsc -- read time stamp counter */ rdtsc /* time in %edx,%eax */ @@ -54,8 +54,7 @@ system_time: popl %ebx ret -.global cpuid -cpuid: +FUNCTION(cpuid): pushl %ebx pushl %edi movl 12(%esp),%eax @@ -69,16 +68,23 @@ cpuid: popl %ebx ret -.global get_eflags -get_eflags: +FUNCTION(get_eflags): pushfl popl %eax ret -.global set_eflags -set_eflags: +FUNCTION(set_eflags): pushl 4(%esp) popfl ret +null_idt_descr: + .word 0 + .word 0,0 + +FUNCTION(reboot): + lidt null_idt_descr + int $0 +done: + jmp done