aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/bios/smapi_bios.S
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/bios/smapi_bios.S')
-rw-r--r--sys/i386/bios/smapi_bios.S45
1 files changed, 17 insertions, 28 deletions
diff --git a/sys/i386/bios/smapi_bios.S b/sys/i386/bios/smapi_bios.S
index 3e24a4ed0ace..3a280055902b 100644
--- a/sys/i386/bios/smapi_bios.S
+++ b/sys/i386/bios/smapi_bios.S
@@ -3,11 +3,28 @@ __FBSDID("$FreeBSD$");
#include <machine/asmacros.h>
+/*
+ * This is cribbed from the Linux thinkpad-4.1 driver by
+ * Thomas Hood.
+ */
+
+ .align
+smapi32_entry: /* far pointer to SMAPI entry */
+ .globl smapi32_offset
+smapi32_offset: .long 0x00000000 /* set by caller */
+smapi32_segment: .word 0x0000 /* %cs stored here */
+
.text
/*
* smapi32(input_param, output_param)
* struct smapi_bios_parameter *input_parm;
* struct smapi_bios_parameter *output_parm;
+ *
+ * stack frame:
+ * 0x00 : saved ebp
+ * 0x04 : return EIP
+ * 0x08 : input_parm
+ * 0x0c : output_parm
*/
ENTRY(smapi32)
pushl %ebp /* Save frame */
@@ -24,31 +41,3 @@ ENTRY(smapi32)
leave
ret
-
-/*
- * smapi32(offset, segment, input_param, output_param)
- * u_int offset;
- * u_short segment;
- * struct smapi_bios_parameter *input_parm;
- * struct smapi_bios_parameter *output_parm;
- */
-ENTRY(smapi32_new)
- pushl %ebp /* Save frame */
- movl %esp,%ebp
-
- movl 0x08(%ebp),%eax
- movl %eax,smapi32_offset
- movw 0x0c(%ebp),%ax
- movw %ax,smapi32_segment
-
- pushl %ds
- pushl 0x20(%ebp) /* Output Param */
- pushl %ds
- pushl 0x10(%ebp) /* Input Param */
-
- movl $0,%eax
- movw %cs,smapi32_segment
- lcall *(smapi32_offset)
-
- leave
- ret