diff options
author | mdodd <mdodd@FreeBSD.org> | 2003-01-17 08:10:18 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2003-01-17 08:10:18 +0000 |
commit | def7e1bda051583fcc3525070ac5429f314f7fcf (patch) | |
tree | 9569a08b4ce3cebe0d49d0bb941a139c6b6d5f61 /sys/i386/bios/smapi_bios.S | |
parent | 67dc3cf7fb55dd4317169204e4235cc4b359827c (diff) | |
download | FreeBSD-src-def7e1bda051583fcc3525070ac5429f314f7fcf.zip FreeBSD-src-def7e1bda051583fcc3525070ac5429f314f7fcf.tar.gz |
A driver for the System Management Application Program
Interface (SMAPI) BIOS, which is present on some IBM
Thinkpad models (560, 600, 770 to name a few.)
The SMAPI BIOS provides access to System Information,
System Configuration, and Power Management.
Diffstat (limited to 'sys/i386/bios/smapi_bios.S')
-rw-r--r-- | sys/i386/bios/smapi_bios.S | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sys/i386/bios/smapi_bios.S b/sys/i386/bios/smapi_bios.S new file mode 100644 index 0000000..2ada5c6 --- /dev/null +++ b/sys/i386/bios/smapi_bios.S @@ -0,0 +1,54 @@ +/* $FreeBSD$ */ + +#include <machine/asmacros.h> + + .data +smapi32_segment_tmp: .word 0 +smapi32_offset_tmp: .long 0 + .text +/* + * smapi32(input_param, output_param) + * struct smapi_bios_parameter *input_parm; + * struct smapi_bios_parameter *output_parm; + */ +ENTRY(smapi32) + pushl %ebp /* Save frame */ + movl %esp,%ebp + + pushl %ds + pushl 0x0c(%ebp) /* Output Param */ + pushl %ds + pushl 0x08(%ebp) /* Input Param */ + + movl $0,%eax /* Clear EAX (return 0) */ + movw %cs,smapi32_segment /* Save CS */ + lcall *(smapi32_offset) + + 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 0x08(%esp),%ebp + movl %ebp,smapi32_offset_tmp + movw 0x0c(%esp),%bp + movw %bp,smapi32_segment_tmp + + pushl %ds + pushl 0x20(%ebp) /* Output Param */ + pushl %ds + pushl 0x10(%ebp) /* Input Param */ + + movl $0,%eax + movw %cs,smapi32_segment_tmp + lcall *(smapi32_offset_tmp) + + leave + ret |