Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
drivers
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Liam Naddell
drivers
Commits
beef1609
Commit
beef1609
authored
Mar 21, 2017
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use thread::yield_now instead of pause in ahcid, e1000d, and rtl8168d
Remove debugging from e1000d
parent
898ec5ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
20 deletions
+7
-20
ahcid/src/ahci/hba.rs
ahcid/src/ahci/hba.rs
+6
-10
e1000d/src/device.rs
e1000d/src/device.rs
+0
-9
rtl8168d/src/device.rs
rtl8168d/src/device.rs
+1
-1
No files found.
ahcid/src/ahci/hba.rs
View file @
beef1609
...
...
@@ -24,10 +24,6 @@ const HBA_SIG_ATAPI: u32 = 0xEB140101;
const
HBA_SIG_PM
:
u32
=
0x96690101
;
const
HBA_SIG_SEMB
:
u32
=
0xC33C0101
;
fn
pause
()
{
unsafe
{
asm!
(
"pause"
:
:
:
"memory"
:
"intel"
,
"volatile"
);
}
}
#[derive(Debug)]
pub
enum
HbaPortType
{
None
,
...
...
@@ -77,7 +73,7 @@ impl HbaPort {
pub
fn
start
(
&
mut
self
)
{
while
self
.cmd
.readf
(
HBA_PORT_CMD_CR
)
{
pause
();
thread
::
yield_now
();
}
self
.cmd
.writef
(
HBA_PORT_CMD_FRE
|
HBA_PORT_CMD_ST
,
true
);
...
...
@@ -87,7 +83,7 @@ impl HbaPort {
self
.cmd
.writef
(
HBA_PORT_CMD_ST
,
false
);
while
self
.cmd
.readf
(
HBA_PORT_CMD_FR
|
HBA_PORT_CMD_CR
)
{
pause
();
thread
::
yield_now
();
}
self
.cmd
.writef
(
HBA_PORT_CMD_FRE
,
false
);
...
...
@@ -163,7 +159,7 @@ impl HbaPort {
}
while
self
.tfd
.readf
((
ATA_DEV_BUSY
|
ATA_DEV_DRQ
)
as
u32
)
{
pause
();
thread
::
yield_now
();
}
self
.ci
.writef
(
1
<<
slot
,
true
);
...
...
@@ -171,7 +167,7 @@ impl HbaPort {
self
.start
();
while
(
self
.ci
.readf
(
1
<<
slot
)
||
self
.tfd
.readf
(
0x80
))
&&
self
.is
.read
()
&
HBA_PORT_IS_ERR
==
0
{
pause
();
thread
::
yield_now
();
}
self
.stop
();
...
...
@@ -299,7 +295,7 @@ impl HbaPort {
//print!("WAIT ATA_DEV_BUSY | ATA_DEV_DRQ\n");
}
while
self
.tfd
.readf
((
ATA_DEV_BUSY
|
ATA_DEV_DRQ
)
as
u32
)
{
pause
();
thread
::
yield_now
();
}
if
write
{
...
...
@@ -313,7 +309,7 @@ impl HbaPort {
//print!("{}", format!("WAIT CI {:X} in {:X}\n", 1 << slot, self.ci.read()));
}
while
(
self
.ci
.readf
(
1
<<
slot
)
||
self
.tfd
.readf
(
0x80
))
&&
self
.is
.read
()
&
HBA_PORT_IS_ERR
==
0
{
pause
();
thread
::
yield_now
();
if
write
{
//print!("{}", format!("WAIT CI {:X} TFD {:X} IS {:X} CMD {:X} SERR {:X}\n", self.ci.read(), self.tfd.read(), self.is.read(), self.cmd.read(), self.serr.read()));
}
...
...
e1000d/src/device.rs
View file @
beef1609
...
...
@@ -187,8 +187,6 @@ impl Scheme for Intel8254x {
return
Ok
(
i
);
}
unsafe
{
asm!
(
"pause"
:
:
:
"memory"
:
"intel"
,
"volatile"
);
}
}
}
...
...
@@ -348,13 +346,6 @@ impl Intel8254x {
// TIPG Packet Gap
// TODO ...
print!
(
"{}"
,
format!
(
" - CTRL: {:X}
\n
"
,
self
.read
(
CTRL
)));
print!
(
"{}"
,
format!
(
" - STS: {:X}
\n
"
,
self
.read
(
STATUS
)));
print!
(
"{}"
,
format!
(
" - RCTL: {:X}
\n
"
,
self
.read
(
RCTL
)));
print!
(
"{}"
,
format!
(
" - TCTL: {:X}
\n
"
,
self
.read
(
TCTL
)));
print!
(
"{}"
,
format!
(
" - IMS: {:X}
\n
"
,
self
.read
(
IMS
)));
print!
(
" - Waiting for link up
\n
"
);
while
self
.read
(
STATUS
)
&
2
!=
2
{
thread
::
yield_now
();
...
...
rtl8168d/src/device.rs
View file @
beef1609
...
...
@@ -140,7 +140,7 @@ impl SchemeMut for Rtl8168 {
}
}
unsafe
{
asm!
(
"pause"
:
:
:
"memory"
:
"intel"
,
"volatile"
);
}
thread
::
yield_now
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment