From 4623d790cc1d4dd2f4fc0e2cb2d7fc501e97995f Mon Sep 17 00:00:00 2001 From: Lephe Date: Wed, 27 Mar 2024 20:53:41 +0100 Subject: [PATCH] ubc: slight cleanup It is guaranteed by the driver model that drivers are powered on when gint is active. Sharing the driver isn't too useful because we can't remote debug in the OS world anyway, there's no USB driver there. --- include/gint/mpu/ubc.h | 13 ++++++++----- src/ubc/ubc.c | 9 --------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/include/gint/mpu/ubc.h b/include/gint/mpu/ubc.h index 4dacb87..5cefe8f 100644 --- a/include/gint/mpu/ubc.h +++ b/include/gint/mpu/ubc.h @@ -22,13 +22,15 @@ typedef volatile struct uint32_t SZ :3; /* Operand Size Select */ uint32_t :4; uint32_t CD :2; /* Bus Select */ - uint32_t ID :2; /* Instruction Fetch / Operand Access Select */ + uint32_t ID :2; /* Ins. Fetch / Operand Access Select */ uint32_t :1; uint32_t RW :2; /* Bus Command Select */ uint32_t CE :1; /* Channel Enable */ ); lword_union(CRR0, /* Match operation setting 0 */ - uint32_t :30; + uint32_t :18; + uint32_t _1 :1; /* Always set to 1 */ + uint32_t :11; uint32_t PCB :1; /* PC Break Select */ uint32_t BIE :1; /* Break Enable */ ); @@ -36,7 +38,6 @@ typedef volatile struct uint32_t CAMR0; /* Match address mask setting 0 */ pad(0x10); - lword_union(CBR1, /* Match condition setting 1 */ uint32_t MFE :1; /* Match Flag Enable */ uint32_t AIE :1; /* ASID Enable */ @@ -47,13 +48,15 @@ typedef volatile struct uint32_t ETBE :1; /* Execution Count Value Enable */ uint32_t :3; uint32_t CD :2; /* Bus Select */ - uint32_t ID :2; /* Instruction Fetch / Operand Access Select */ + uint32_t ID :2; /* Ins. Fetch / Operand Access Select */ uint32_t :1; uint32_t RW :2; /* Bus Command Select */ uint32_t CE :1; /* Channel Enable */ ); lword_union(CRR1, /* Match operation setting 1 */ - uint32_t :30; + uint32_t :18; + uint32_t _1 :1; /* Always set to 1 */ + uint32_t :11; uint32_t PCB :1; /* PC Break Select */ uint32_t BIE :1; /* Break Enable */ ); diff --git a/src/ubc/ubc.c b/src/ubc/ubc.c index 104879d..166c652 100644 --- a/src/ubc/ubc.c +++ b/src/ubc/ubc.c @@ -55,9 +55,6 @@ static void hpoweroff(void) } while (0) bool ubc_set_breakpoint(int channel, void* break_address, ubc_break_mode_t break_mode) { - if (!hpowered()) - hpoweron(); - uint32_t pcb = break_mode == UBC_BREAK_AFTER ? 1 : 0; if (channel == 0) { UBC_BREAK_CHANNEL(CBR0, CRR0, CAR0, CAMR0); @@ -73,9 +70,6 @@ bool ubc_set_breakpoint(int channel, void* break_address, ubc_break_mode_t break bool ubc_get_break_address(int channel, void** break_address) { - if (!hpowered()) - hpoweron(); - if (channel == 0 && UBC.CBR0.CE) { *break_address = (void*) UBC.CAR0; return true; @@ -89,9 +83,6 @@ bool ubc_get_break_address(int channel, void** break_address) bool ubc_disable_channel(int channel) { - if (!hpowered()) - hpoweron(); - if (channel == 0) { UBC.CBR0.CE = 0; return true;