smapi_bios.S revision 109412
1/* $FreeBSD: head/sys/i386/bios/smapi_bios.S 109412 2003-01-17 08:10:18Z mdodd $ */
2
3#include <machine/asmacros.h>
4
5	.data
6smapi32_segment_tmp:	.word	0
7smapi32_offset_tmp:	.long	0
8	.text
9/*
10 * smapi32(input_param, output_param)
11 *	struct smapi_bios_parameter *input_parm;
12 *	struct smapi_bios_parameter *output_parm;
13 */
14ENTRY(smapi32)
15	pushl	%ebp			/* Save frame */
16	movl	%esp,%ebp
17
18	pushl	%ds
19	pushl	0x0c(%ebp)		/* Output Param */
20	pushl	%ds
21	pushl	0x08(%ebp)		/* Input Param */
22
23	movl	$0,%eax			/* Clear EAX (return 0) */
24	movw	%cs,smapi32_segment	/* Save CS */
25	lcall	*(smapi32_offset)
26
27	leave
28	ret
29
30/*
31 * smapi32(offset, segment, input_param, output_param)
32 *	u_int offset;
33 *	u_short segment;
34 *	struct smapi_bios_parameter *input_parm;
35 *	struct smapi_bios_parameter *output_parm;
36 */
37ENTRY(smapi32_new)
38	pushl	%ebp			/* Save frame */
39        movl    0x08(%esp),%ebp
40	movl	%ebp,smapi32_offset_tmp
41	movw	0x0c(%esp),%bp
42	movw	%bp,smapi32_segment_tmp
43
44	pushl	%ds
45	pushl	0x20(%ebp)		/* Output Param */
46	pushl	%ds
47	pushl	0x10(%ebp)		/* Input Param */
48
49	movl	$0,%eax
50	movw	%cs,smapi32_segment_tmp
51	lcall	*(smapi32_offset_tmp)
52
53	leave
54	ret
55