read_tsc - mathfur/minix GitHub Wiki
呼出元
概要
- kernel/klib386.sにて定義
- CPUのサイクルカウンタを読む
引数
実装
.align 16
_read_tsc:
.data1 0x0f ! this is the RDTSC instruction
.data1 0x31 ! it places the TSC in EDX:EAX
push ebp ! スタックフレームのアドレスの値を退避する
mov ebp, 8(esp) !
mov (ebp), edx
mov ebp, 12(esp)
mov (ebp), eax
pop ebp
ret