HALT and RESET only in kernel mode

This commit is contained in:
folkert van heusden 2024-04-21 22:54:05 +02:00
parent ae00c95679
commit 5251cde04c
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

12
cpu.cpp
View file

@ -1627,7 +1627,10 @@ bool cpu::misc_operations(const uint16_t instr)
{
switch(instr) {
case 0b0000000000000000: // HALT
*event = EVENT_HALT;
if (getPSW_runmode() == 0) // only in kernel mode
*event = EVENT_HALT;
else
trap(4);
return true;
case 0b0000000000000001: // WAIT
@ -1681,8 +1684,11 @@ bool cpu::misc_operations(const uint16_t instr)
return true;
case 0b0000000000000101: // RESET
b->init();
init_interrupt_queue();
if (getPSW_runmode() == 0) { // only in kernel mode
b->init();
init_interrupt_queue();
}
return true;
}