2 ** Copyright 2001-2004, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
6 #define FUNCTION(x) .global x; .type x,@function; x
12 /* this is loaded into eax:edx, lets move edx into the top of rax */
18 FUNCTION(execute_n_instructions):
41 FUNCTION(system_time):
44 /* load 64-bit factor into %eax (low), %edx (high) */
45 /* hand-assemble rdtsc -- read time stamp counter */
46 rdtsc /* time in %edx,%eax */
50 movl %edx, %ecx /* save high half */
51 mull %ebx /* truncate %eax, but keep %edx */
53 movl %edx, %ecx /* save high half of low */
55 /* now compute [%edx, %eax] + [%ecx], propagating carry */
56 subl %ebx, %ebx /* need zero to propagate carry */
66 mov %edi,%eax /* first arg, cpuid function */