File tree Expand file tree Collapse file tree 2 files changed +16
-29
lines changed Expand file tree Collapse file tree 2 files changed +16
-29
lines changed Original file line number Diff line number Diff line change @@ -76,21 +76,14 @@ impl MmioSerialPort {
76
76
77
77
/// Sends a byte on the serial port.
78
78
pub fn send ( & mut self , data : u8 ) {
79
- let self_data = self . data . load ( Ordering :: Relaxed ) ;
80
- unsafe {
81
- match data {
82
- 8 | 0x7F => {
83
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
84
- self_data. write ( 8 ) ;
85
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
86
- self_data. write ( b' ' ) ;
87
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
88
- self_data. write ( 8 )
89
- }
90
- _ => {
91
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
92
- self_data. write ( data) ;
93
- }
79
+ match data {
80
+ 8 | 0x7F => {
81
+ self . send_raw ( 8 ) ;
82
+ self . send_raw ( b' ' ) ;
83
+ self . send_raw ( 8 ) ;
84
+ }
85
+ data => {
86
+ self . send_raw ( data) ;
94
87
}
95
88
}
96
89
}
Original file line number Diff line number Diff line change @@ -101,20 +101,14 @@ impl SerialPort {
101
101
102
102
/// Sends a byte on the serial port.
103
103
pub fn send ( & mut self , data : u8 ) {
104
- unsafe {
105
- match data {
106
- 8 | 0x7F => {
107
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
108
- x86:: io:: outb ( self . port_data ( ) , 8 ) ;
109
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
110
- x86:: io:: outb ( self . port_data ( ) , b' ' ) ;
111
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
112
- x86:: io:: outb ( self . port_data ( ) , 8 ) ;
113
- }
114
- _ => {
115
- wait_for ! ( self . line_sts( ) . contains( LineStsFlags :: OUTPUT_EMPTY ) ) ;
116
- x86:: io:: outb ( self . port_data ( ) , data) ;
117
- }
104
+ match data {
105
+ 8 | 0x7F => {
106
+ self . send_raw ( 8 ) ;
107
+ self . send_raw ( b' ' ) ;
108
+ self . send_raw ( 8 ) ;
109
+ }
110
+ data => {
111
+ self . send_raw ( data) ;
118
112
}
119
113
}
120
114
}
You can’t perform that action at this time.
0 commit comments