Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct INT Flag 8 to set page table entries to the correct value rather than 1 #24

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/wire/zvm/zvm_features.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
self.LS = 0

-- Extended registers
for reg=0,31 do self["R"..reg] = 0 end

Check warning on line 60 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 60 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

-- Stack size register
self.ESZ = math.max(0,self.RAMSize-1)
Expand Down Expand Up @@ -370,7 +370,7 @@
if self.BusLock == 1 then return false end

-- Write to stack
self:WriteCell(self.ESP+self.SS, Value)

Check warning on line 373 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
self.ESP = self.ESP - 1

-- Stack check
Expand Down Expand Up @@ -398,7 +398,7 @@
return 0
end

local Value = self:ReadCell(self.ESP+self.SS)

Check warning on line 401 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
if Value then return Value
else self:Interrupt(6,self.ESP) return 0 end
end
Expand Down Expand Up @@ -521,13 +521,13 @@
local pageEntryOffset
if (index >= self.PTBE) or (index < 0)
then pageEntryOffset = self.PTBL
else pageEntryOffset = self.PTBL+(index+1)*2

Check warning on line 524 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 524 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 524 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
end

-- Read page entry
self.PCAP = 0 -- Stop infinite recursive page table lookup
local pagePermissionMask = self:ReadCell(pageEntryOffset+0)

Check warning on line 529 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
local pageMappedTo = self:ReadCell(pageEntryOffset+1)

Check warning on line 530 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
self.PCAP = 1

if (not pagePermissionMask) or (not pageMappedTo) then
Expand All @@ -552,21 +552,21 @@
--------------------------------------------------------------------------------
function ZVM:SetPageByIndex(index)
if self.PCAP == 1 then
if self.MF == 1 then
-- Find page entry offset
local pageEntryOffset
if (index >= self.PTBE) or (index < 0)
then pageEntryOffset = self.PTBL
else pageEntryOffset = self.PTBL+(index+1)*2
end

-- Write page entry
local pagePermissionMask,pageMappedTo = self:GetPagePermissions(index)
self.PCAP = 0 -- Stop possible infinite recursive page redirection
self:WriteCell(pageEntryOffset+0,pagePermissionMask)
self:WriteCell(pageEntryOffset+1,pageMappedTo)
self.PCAP = 1
end

Check warning on line 569 in lua/wire/zvm/zvm_features.lua

View workflow job for this annotation

GitHub Actions / lint

"Double if-statement"

Double if statement. Please combine the condition of this if statement with that of the outer if statement using `and`.
end
end

Expand Down Expand Up @@ -784,7 +784,7 @@
if FLAGS[7] == 1 then
self.PTBL = NewPTB
elseif FLAGS[8] == 1 then
self.PTBE = 1
self.PTBE = NewPTB
end

elseif self.PF == 1 then -- Compatibility extended mode
Expand Down
Loading