summaryrefslogtreecommitdiffstats
path: root/sys/i386/bios/smapi_bios.S
blob: 2ada5c6b25eac017cb793d70217874b5c870a9e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
OpenPOWER on IntegriCloud