grml...
[seabios.git] / src / entryfuncs.S
index 96a2fcfc77958594529f3d6d165a3bc79238ebd0..afc5e611944afb4ad9d3eb01800acbe59635b424 100644 (file)
@@ -67,6 +67,7 @@
         pushl %ecx
         pushl %edx
         pushl %ebx
+        pushl %ebp
         pushl %esi
         pushl %edi
         pushw %es
@@ -82,6 +83,7 @@
         popw %es
         popl %edi
         popl %esi
+        popl %ebp
         popl %ebx
         popl %edx
         popl %ecx
@@ -95,6 +97,7 @@
         pushl %ecx
         pushl %edx
         pushl %ebx
+        pushl %ebp
         pushl %esi
         pushl %edi
         pushw %es
         movw %cx, %ds
         movl %esp, %ebx         // Backup %esp, then zero high bits
         movzwl %sp, %esp
-        movl 24(%esp), %ecx     // Get calling function
-        movl %eax, 24(%esp)     // Save %eax
+        movl 28(%esp), %ecx     // Get calling function
+        movl %eax, 28(%esp)     // Save %eax
         movl %esp, %eax         // First arg is pointer to struct bregs
         calll *%ecx
         movl %ebx, %esp         // Restore %esp (including high bits)
         popw %es
         popl %edi
         popl %esi
+        popl %ebp
         popl %ebx
         popl %edx
         popl %ecx
         pushl %ecx
         pushl %edx
         pushl %ebx
+        pushl %ebp
         pushl %esi
         pushl %edi
         pushw %es
         popw %es
         popl %edi
         popl %esi
+        popl %ebp
         popl %ebx
         popl %edx
         popl %ecx
         xorw %ax, %ax
         movw %ax, %ss
         movl $ BUILD_STACK_ADDR , %esp
-        pushl $ \cfunc
+        movl $ \cfunc , %edx
         jmp transition32
         .endm
 
         .section .text.asm.\func
         .global \func
         .endm
+
+        // Declare an exported function
+        .macro EXPORTFUNC func
+        .section .text.asm.export.\func
+        .global \func
+        .endm