Skip to content

Commit

Permalink
virtio/net_device.lua: Remove unused code
Browse files Browse the repository at this point in the history
Remove the variable 'pagebits' and the function
'VirtioNetDevice:translate_physical_addr()'. These are not used and
they depend on parts of the core.memory API that I want to remove.
  • Loading branch information
lukego committed Feb 4, 2016
1 parent 071aaf7 commit 7bf8b3e
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/lib/virtio/net_device.lua
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,6 @@ function VirtioNetDevice:tx_signal_used()
end
end

local pagebits = memory.huge_page_bits

-- Cache of the latest referenced physical page.
function VirtioNetDevice:translate_physical_addr (addr)
local page = bit.rshift(addr, pagebits)
if page == self.last_virt_page then
return addr + self.last_virt_offset
end
local phys = memory.virtual_to_physical(addr)
self.last_virt_page = page
self.last_virt_offset = phys - addr
return phys
end

function VirtioNetDevice:map_from_guest (addr)
local result
local m = self.mem_table[0]
Expand Down

0 comments on commit 7bf8b3e

Please sign in to comment.