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

template: Fix GetVBR for systems with caches enabled #267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yupferris
Copy link

Previously, the supervisor portion of GetVBR would be copied to the stack, but without then clearing caches, there would be no guarantee that the instruction cache would contain this data (it's most likely dirty in the data cache and not yet committed to memory). On my setup (060 fpu+mmu), this would consistently crash.

So, let's rewrite this code as inline asm in a function, which is cleaner (no more raw data words), avoids the unnecessary copy (to initialize a local variable which isn't actually required), and avoids an unnecessary cache clear (which would also work around the issue, but in an expensive way).

Fixes #256.

Previously, the supervisor portion of `GetVBR` would be copied to the stack, but without then clearing caches, there would be no guarantee that the instruction cache would contain this data (it's most likely dirty in the data cache and not yet committed to memory). On my setup (060 fpu+mmu), this would consistently crash.

So, let's rewrite this code as inline asm in a function, which is cleaner (no more raw data words), avoids the unnecessary copy (to initialize a local variable which isn't actually required), and avoids an unnecessary cache clear (which would also work around the issue, but in an expensive way).

Fixes BartmanAbyss#256.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clear Cache before VBR call in default demo.
1 participant