|
@@ -69,9 +69,11 @@ static void librm_test_prot_call ( void ) {
|
69
|
69
|
static void librm_test_exec ( void ) {
|
70
|
70
|
unsigned int i;
|
71
|
71
|
unsigned long timestamp;
|
72
|
|
- unsigned long started;
|
73
|
|
- unsigned long stopped;
|
74
|
|
- unsigned int discard_d;
|
|
72
|
+ uint32_t timestamp_lo;
|
|
73
|
+ uint32_t timestamp_hi;
|
|
74
|
+ uint32_t started;
|
|
75
|
+ uint32_t stopped;
|
|
76
|
+ uint32_t discard_d;
|
75
|
77
|
|
76
|
78
|
/* Profile mode transitions. We want to profile each
|
77
|
79
|
* direction of the transition separately, so perform an RDTSC
|
|
@@ -81,8 +83,12 @@ static void librm_test_exec ( void ) {
|
81
|
83
|
for ( i = 0 ; i < PROFILE_COUNT ; i++ ) {
|
82
|
84
|
profile_start ( &p2r_profiler );
|
83
|
85
|
__asm__ __volatile__ ( REAL_CODE ( "rdtsc\n\t" )
|
84
|
|
- : "=a" ( timestamp ), "=d" ( discard_d )
|
|
86
|
+ : "=a" ( timestamp_lo ),
|
|
87
|
+ "=d" ( timestamp_hi )
|
85
|
88
|
: );
|
|
89
|
+ timestamp = timestamp_lo;
|
|
90
|
+ if ( sizeof ( timestamp ) > sizeof ( timestamp_lo ) )
|
|
91
|
+ timestamp |= ( ( ( uint64_t ) timestamp_hi ) << 32 );
|
86
|
92
|
profile_start_at ( &r2p_profiler, timestamp );
|
87
|
93
|
profile_stop ( &r2p_profiler );
|
88
|
94
|
profile_stop_at ( &p2r_profiler, timestamp );
|
|
@@ -98,14 +104,14 @@ static void librm_test_exec ( void ) {
|
98
|
104
|
/* Profile complete protected-mode call cycle */
|
99
|
105
|
for ( i = 0 ; i < PROFILE_COUNT ; i++ ) {
|
100
|
106
|
__asm__ __volatile__ ( REAL_CODE ( "rdtsc\n\t"
|
101
|
|
- "movl %0, %2\n\t"
|
102
|
|
- "pushl %3\n\t"
|
|
107
|
+ "movl %k0, %k2\n\t"
|
|
108
|
+ "pushl %k3\n\t"
|
103
|
109
|
"pushw %%cs\n\t"
|
104
|
110
|
"call prot_call\n\t"
|
105
|
111
|
"addw $4, %%sp\n\t"
|
106
|
112
|
"rdtsc\n\t" )
|
107
|
113
|
: "=a" ( stopped ), "=d" ( discard_d ),
|
108
|
|
- "=r" ( started )
|
|
114
|
+ "=R" ( started )
|
109
|
115
|
: "i" ( librm_test_prot_call ) );
|
110
|
116
|
profile_start_at ( &prot_call_profiler, started );
|
111
|
117
|
profile_stop_at ( &prot_call_profiler, stopped );
|