![]() |
![]() |
#1 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
|
Enabling interrupts -> lockup?
So, I have this code, which is intended to enable copper interrupts:
Code:
KPrintF("a, %08lx 0x%04lx", custom, mask); custom->intreq = mask; KPrintF("b"); custom->intena = INTF_SETCLR | INTF_INTEN | mask; KPrintF("c"); Code:
a, 00DFF000 0x0010 b KPrintF("c");line. Interrupts are happening, I can see them if I add KPrintFs to my level 3 interrupt handler, but my mainline code seems to have stalled. I think I've taken over the system correctly. I'm stumped at how to debug this. Any hints? Edit: The interrupts that are happening are not mine, as I don't yet trigger any interrupts in my copper list... Edit 2: So, the interrupts I'm getting are VBLANKs, Code:
static __attribute__((interrupt)) void HandleLevel3Interrupt(void) { KPrintF("L3 0x%04lx", custom->intreqr & custom->intenar); } Code:
L3 0x0020 Code:
custom->intena = INTF_INTEN | INTF_ALL; // disable all interrupts custom->intreq = INTF_INTEN | INTF_ALL; // clear any interrupts that were pending Last edited by Ernst Blofeld; 19 November 2020 at 19:31. |
![]() |
![]() |
#2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,200
|
The blitter generates thw same interrupt as the copper. I hope that helps your diagnostics.
|
![]() |
![]() |
#3 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,068
|
1. order of operations matters
2. maybe the 3rd print is happening but it gets "interrupted" before it's finished (I don't know how exactly kprintf works) 3. clear corresponding intreq bit(s) in your interrupt handler, otherwise it will be perpetually called and lock up your main |
![]() |
![]() |
#4 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
|
Ok, I now know that I'm getting VERTB interrupts even though I've disabled them.
My interrupt handler looks like this: Code:
static __attribute__((interrupt)) void HandleLevel3Interrupt(void) { if (custom->intreqr & custom->intenar & INTF_COPER) { KPrintF("COPER"); custom->intreq = (UWORD) INTF_COPER; custom->intreq = (UWORD) INTF_COPER; Display_CopperInterrupt(); } if (custom->intreqr & custom->intenar & INTF_VERTB) { KPrintF("VERTB"); custom->intreq = (UWORD) INTF_VERTB; custom->intreq = (UWORD) INTF_VERTB; } } Code:
VERTB COPER VERTB COPER VERTB COPER ... Code:
move.w #32767,dff09a move.w #32767,dff09c Last edited by Ernst Blofeld; 20 November 2020 at 09:12. |
![]() |
![]() |
#5 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
|
Ok, I understand now. My startup code calls LoadView(NULL), which re-enables the VERTB interrupt.
Last edited by Ernst Blofeld; 20 November 2020 at 11:38. |
![]() |
![]() |
#6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,382
|
mixing the OS with hardware banging is tricky
![]() my code (in Bagman) calls LoadView/OwnBlitter then takes over the copperlist and all and never calls any OS routine ever... |
![]() |
![]() |
#7 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,643
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Keyboard, lockup | nikosidis | support.Hardware | 0 | 18 September 2020 08:34 |
Enabling Firecracker 24? | StrangeVoyager | support.WinUAE | 2 | 23 May 2019 21:24 |
Crash on enabling 68030 MMU with 3.0.0 | mark_k | support.WinUAE | 14 | 25 January 2015 14:09 |
A500 lockup - please help | Exi | support.Hardware | 7 | 29 July 2003 14:49 |
|
|