23 October 2021, 12:03 | #1 |
Registered User
Join Date: Dec 2007
Location: Aarhus / Denmark
Posts: 40
|
CacheClearU during Forbid
Is is safe to call CacheClearU() inside a Forbid() / Permit() pair? Can I be sure that the CacheClearU() call will not break the Forbid state? I know it doesn't for the ROM version of CacheClearU() (which just runs appropriate CPU instructions to clear the cache), but is this also the case for any turboboard / emulator environment which might patch CacheClearU()?
Context: In the default Shrinkler decrunch header, the decrunch code and crunched data are deallocated after decrunching is completed. Since the code doing this resides in the memory that is deallocated and A0/D0 need to be restored to make commandline arguments work, I push the entry point on the stack and wrap the deallocation in Forbid() / Permit() like this: Code:
jsr Forbid(a6) lea.l Header2-8(pc),a1 move.l (a1),d0 jsr FreeMem(a6) movem.l (a7)+,d0/a0 jmp Permit(a6) |
23 October 2021, 13:59 | #2 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
I don't see a single reason why a patched CacheClearU() should break a Forbid().
If it did it would simply be broken. |
23 October 2021, 14:08 | #3 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,214
|
That's a low-level function that should be callable from almost any CPU state, including from interrupt, and I would call an implementation that breaks the "forbid" quite defect. All the implementations I know (and I made) do not break this, neither Disable().
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Task exit: Forbid() without Permit() | dissident | Coders. System | 27 | 27 February 2019 10:46 |
Startup Code (from Icon ) - Forbid function | Asman | Coders. System | 2 | 04 January 2014 10:45 |
|
|