1/*
2 * Copyright 2004, Axel D��rfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Copyright 2001, Travis Geiselbrecht. All rights reserved.
6 * Distributed under the terms of the NewOS License.
7 */
8
9#include <asm_defs.h>
10
11
12.text
13
14/* void get_current_cpuid(cpuid_info *info, uint32 eaxRegister,
15	uint32 ecxRegister) */
16FUNCTION(get_current_cpuid):
17 	pushl	%ebx
18 	pushl	%edi
19 	movl	12(%esp),%edi	/* first arg points to the cpuid_info structure */
20 	movl	16(%esp),%eax	/* second arg sets up eax */
21	movl	20(%esp),%ecx  /* third arg sets up ecx */
22 	cpuid
23 	movl	%eax,0(%edi)	/* copy the regs into the cpuid_info structure */
24 	movl	%ebx,4(%edi)
25 	movl	%edx,8(%edi)
26 	movl	%ecx,12(%edi)
27 	popl	%edi
28 	popl	%ebx
29 	xorl	%eax, %eax		/* return B_OK */
30 	ret
31FUNCTION_END(get_current_cpuid)
32
33
34/* unsigned int get_eflags(void) */
35FUNCTION(get_eflags):
36 	pushfl
37 	popl	%eax
38 	ret
39FUNCTION_END(get_eflags)
40
41
42/* void set_eflags(unsigned int val) */
43FUNCTION(set_eflags):
44 	pushl	4(%esp)
45 	popfl
46	ret
47FUNCTION_END(set_eflags)
48