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
898ec5ac
Commit
898ec5ac
authored
Mar 21, 2017
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Yield unstead of pause in loops in rtl8168d
parent
3a8e40d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
rtl8168d/src/device.rs
rtl8168d/src/device.rs
+5
-3
No files found.
rtl8168d/src/device.rs
View file @
898ec5ac
use
std
::
mem
;
use
std
::
{
mem
,
thread
}
;
use
netutils
::
setcfg
;
use
syscall
::
error
::{
Error
,
EACCES
,
EWOULDBLOCK
,
Result
};
...
...
@@ -133,7 +133,7 @@ impl SchemeMut for Rtl8168 {
self
.regs.tppoll
.writef
(
1
<<
6
,
true
);
//Notify of normal priority packet
while
self
.regs.tppoll
.readf
(
1
<<
6
)
{
unsafe
{
asm!
(
"pause"
:
:
:
"memory"
:
"intel"
,
"volatile"
);
}
thread
::
yield_now
();
}
return
Ok
(
i
);
...
...
@@ -224,7 +224,9 @@ impl Rtl8168 {
// Reset - this will disable tx and rx, reinitialize FIFOs, and set the system buffer pointer to the initial value
self
.regs.cmd
.writef
(
1
<<
4
,
true
);
while
self
.regs.cmd
.readf
(
1
<<
4
)
{}
while
self
.regs.cmd
.readf
(
1
<<
4
)
{
thread
::
yield_now
();
}
// Set up rx buffers
for
i
in
0
..
self
.receive_ring
.len
()
{
...
...
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