Convert library asm files to GAS syntax
This commit is contained in:
@@ -104,7 +104,7 @@ SRCS= \
|
||||
fkey_ctl.c \
|
||||
tsc_util.c \
|
||||
report.c \
|
||||
read_tsc.s \
|
||||
read_tsc.S \
|
||||
read_tsc_64.c \
|
||||
ser_putc.c \
|
||||
stacktrace.c \
|
||||
|
||||
46
lib/libsys/read_tsc.S
Normal file
46
lib/libsys/read_tsc.S
Normal file
@@ -0,0 +1,46 @@
|
||||
/* */
|
||||
/* sections */
|
||||
|
||||
|
||||
.globl _read_tsc /* read the cycle counter (Pentium and up) */
|
||||
.text
|
||||
/**===========================================================================* */
|
||||
/* PUBLIC void read_tsc(unsigned long *high, unsigned long *low); */
|
||||
/* Read the cycle counter of the CPU. Pentium and up. */
|
||||
.balign 16
|
||||
_read_tsc:
|
||||
push %edx
|
||||
push %eax
|
||||
.byte 0x0f /* this is the RDTSC instruction */
|
||||
.byte 0x31 /* it places the TSC in EDX:EAX */
|
||||
push %ebp
|
||||
movl 16(%esp), %ebp
|
||||
movl %edx, (%ebp)
|
||||
movl 20(%esp), %ebp
|
||||
movl %eax, (%ebp)
|
||||
pop %ebp
|
||||
pop %eax
|
||||
pop %edx
|
||||
ret
|
||||
|
||||
/**===========================================================================* */
|
||||
/* PUBLIC void read_host_time_ns(unsigned long *high, unsigned long *low); */
|
||||
/* access real time in ns from host in vmware. */
|
||||
.balign 16
|
||||
_read_host_time_ns:
|
||||
pushl %edx
|
||||
pushl %eax
|
||||
pushl %ecx
|
||||
movl $0x10001, %ecx
|
||||
.byte 0x0f /* this is the RDTSC instruction */
|
||||
.byte 0x31 /* it places the TSC in EDX:EAX */
|
||||
pushl %ebp
|
||||
movl 20(%esp), %ebp
|
||||
movl %edx, (%ebp)
|
||||
movl 24(%esp), %ebp
|
||||
movl %eax, (%ebp)
|
||||
popl %ebp
|
||||
popl %ecx
|
||||
popl %eax
|
||||
popl %edx
|
||||
ret
|
||||
@@ -1,49 +0,0 @@
|
||||
#
|
||||
! sections
|
||||
|
||||
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||
|
||||
.define _read_tsc ! read the cycle counter (Pentium and up)
|
||||
|
||||
.sect .text
|
||||
!*===========================================================================*
|
||||
! PUBLIC void read_tsc(unsigned long *high, unsigned long *low);
|
||||
! Read the cycle counter of the CPU. Pentium and up.
|
||||
.align 16
|
||||
_read_tsc:
|
||||
push edx
|
||||
push eax
|
||||
.data1 0x0f ! this is the RDTSC instruction
|
||||
.data1 0x31 ! it places the TSC in EDX:EAX
|
||||
push ebp
|
||||
mov ebp, 16(esp)
|
||||
mov (ebp), edx
|
||||
mov ebp, 20(esp)
|
||||
mov (ebp), eax
|
||||
pop ebp
|
||||
pop eax
|
||||
pop edx
|
||||
ret
|
||||
|
||||
!*===========================================================================*
|
||||
! PUBLIC void read_host_time_ns(unsigned long *high, unsigned long *low);
|
||||
! access real time in ns from host in vmware.
|
||||
.align 16
|
||||
_read_host_time_ns:
|
||||
push edx
|
||||
push eax
|
||||
push ecx
|
||||
mov ecx, 0x10001
|
||||
.data1 0x0f ! this is the RDPMC instruction
|
||||
.data1 0x33 ! it places the result in EDX:EAX
|
||||
push ebp
|
||||
mov ebp, 20(esp)
|
||||
mov (ebp), edx
|
||||
mov ebp, 24(esp)
|
||||
mov (ebp), eax
|
||||
pop ebp
|
||||
pop ecx
|
||||
pop eax
|
||||
pop edx
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user