xref: /freebsd/sys/i386/bios/smapi_bios.S (revision 685dc743dc3b5645e34836464128e1c0558b404b)
10f0f21c3SDavid E. O'Brien#include <machine/asm.h>
2cba6ce36SMatthew N. Dodd/*
3cba6ce36SMatthew N. Dodd * This is cribbed from the Linux thinkpad-4.1 driver by
4cba6ce36SMatthew N. Dodd * Thomas Hood.
5cba6ce36SMatthew N. Dodd */
6cba6ce36SMatthew N. Dodd
7cba6ce36SMatthew N. Doddsmapi32_entry:					/* far pointer to SMAPI entry */
8cba6ce36SMatthew N. Dodd	.globl	smapi32_offset
9cba6ce36SMatthew N. Doddsmapi32_offset:		.long	0x00000000	/* set by caller */
10cba6ce36SMatthew N. Doddsmapi32_segment:	.word	0x0000		/* %cs stored here */
11cba6ce36SMatthew N. Dodd
127534ac7aSMatthew N. Dodd	.text
137534ac7aSMatthew N. Dodd/*
147534ac7aSMatthew N. Dodd * smapi32(input_param, output_param)
157534ac7aSMatthew N. Dodd *	struct smapi_bios_parameter *input_parm;
167534ac7aSMatthew N. Dodd *	struct smapi_bios_parameter *output_parm;
17cba6ce36SMatthew N. Dodd *
18cba6ce36SMatthew N. Dodd *	stack frame:
19cba6ce36SMatthew N. Dodd *		0x00 : saved ebp
20cba6ce36SMatthew N. Dodd *		0x04 : return EIP
21cba6ce36SMatthew N. Dodd *		0x08 : input_parm
22cba6ce36SMatthew N. Dodd *		0x0c : output_parm
237534ac7aSMatthew N. Dodd */
247534ac7aSMatthew N. DoddENTRY(smapi32)
257534ac7aSMatthew N. Dodd	pushl	%ebp			/* Save frame */
267534ac7aSMatthew N. Dodd	movl	%esp,%ebp
277534ac7aSMatthew N. Dodd
287534ac7aSMatthew N. Dodd	pushl	%ds
297534ac7aSMatthew N. Dodd	pushl	0x0c(%ebp)		/* Output Param */
307534ac7aSMatthew N. Dodd	pushl	%ds
317534ac7aSMatthew N. Dodd	pushl	0x08(%ebp)		/* Input Param */
327534ac7aSMatthew N. Dodd
337534ac7aSMatthew N. Dodd	movl	$0,%eax			/* Clear EAX (return 0) */
347534ac7aSMatthew N. Dodd	movw	%cs,smapi32_segment	/* Save CS */
357534ac7aSMatthew N. Dodd	lcall	*(smapi32_offset)
367534ac7aSMatthew N. Dodd
377534ac7aSMatthew N. Dodd	leave
387534ac7aSMatthew N. Dodd	ret
39*78599c32SConrad MeyerEND(smapi32)
40