smapi_bios.S revision 115679
1221828Sgrehan#include <machine/asm.h>
2221828Sgrehan__FBSDID("$FreeBSD: head/sys/i386/bios/smapi_bios.S 115679 2003-06-02 06:02:49Z obrien $");
3221828Sgrehan
4221828Sgrehan#include <machine/asmacros.h>
5221828Sgrehan
6221828Sgrehan	.text
7221828Sgrehan/*
8221828Sgrehan * smapi32(input_param, output_param)
9221828Sgrehan *	struct smapi_bios_parameter *input_parm;
10221828Sgrehan *	struct smapi_bios_parameter *output_parm;
11221828Sgrehan */
12221828SgrehanENTRY(smapi32)
13221828Sgrehan	pushl	%ebp			/* Save frame */
14221828Sgrehan	movl	%esp,%ebp
15221828Sgrehan
16221828Sgrehan	pushl	%ds
17221828Sgrehan	pushl	0x0c(%ebp)		/* Output Param */
18221828Sgrehan	pushl	%ds
19221828Sgrehan	pushl	0x08(%ebp)		/* Input Param */
20221828Sgrehan
21221828Sgrehan	movl	$0,%eax			/* Clear EAX (return 0) */
22221828Sgrehan	movw	%cs,smapi32_segment	/* Save CS */
23221828Sgrehan	lcall	*(smapi32_offset)
24221828Sgrehan
25221828Sgrehan	leave
26221828Sgrehan	ret
27221828Sgrehan
28221828Sgrehan/*
29221828Sgrehan * smapi32(offset, segment, input_param, output_param)
30221828Sgrehan *	u_int offset;
31221828Sgrehan *	u_short segment;
32221828Sgrehan *	struct smapi_bios_parameter *input_parm;
33221828Sgrehan *	struct smapi_bios_parameter *output_parm;
34221828Sgrehan */
35221828SgrehanENTRY(smapi32_new)
36221828Sgrehan	pushl	%ebp			/* Save frame */
37221828Sgrehan	movl	%esp,%ebp
38221828Sgrehan
39246109Sneel	movl	0x08(%ebp),%eax
40221828Sgrehan	movl	%eax,smapi32_offset
41221828Sgrehan	movw	0x0c(%ebp),%ax
42221828Sgrehan	movw	%ax,smapi32_segment
43221828Sgrehan
44221828Sgrehan	pushl	%ds
45221828Sgrehan	pushl	0x20(%ebp)		/* Output Param */
46221828Sgrehan	pushl	%ds
47221828Sgrehan	pushl	0x10(%ebp)		/* Input Param */
48221828Sgrehan
49221828Sgrehan	movl	$0,%eax
50221828Sgrehan	movw	%cs,smapi32_segment
51221828Sgrehan	lcall	*(smapi32_offset)
52221828Sgrehan
53221828Sgrehan	leave
54221828Sgrehan	ret
55221828Sgrehan