File tree 2 files changed +10
-11
lines changed
2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,10 @@ impl IdtrBase {
13
13
limit : 0 ,
14
14
base_addr : 0 ,
15
15
} ;
16
- llvm_asm ! ( "sidt ($0)"
17
- :
18
- : "r" ( & mut info)
19
- : "memory"
20
- : "volatile" ) ;
16
+ asm ! (
17
+ "sidt fword ptr [{0}]" ,
18
+ in( reg) & mut info
19
+ ) ;
21
20
info. base_addr
22
21
}
23
22
}
@@ -35,11 +34,10 @@ impl GdtrBase {
35
34
pub fn read ( ) -> u64 {
36
35
unsafe {
37
36
let mut info = GdtInfo { size : 0 , offset : 0 } ;
38
- llvm_asm ! ( "sgdtq ($0)"
39
- :
40
- : "r" ( & mut info)
41
- : "memory"
42
- : "volatile" ) ;
37
+ asm ! (
38
+ "sgdt fword ptr [{0}]" ,
39
+ in( reg) & mut info
40
+ ) ;
43
41
info. offset
44
42
}
45
43
}
Original file line number Diff line number Diff line change @@ -384,7 +384,8 @@ pub fn busy_wait(duration: core::time::Duration) {
384
384
while now ( ) < start + duration {
385
385
unsafe {
386
386
// Relax the cpu
387
- llvm_asm ! ( "rep; nop" :: : "memory" ) ;
387
+ //llvm_asm!("rep; nop" ::: "memory");
388
+ asm ! ( "rep" , "nop" ) ;
388
389
}
389
390
}
390
391
}
You can’t perform that action at this time.
0 commit comments