Module Name:    src
Committed By:   andvar
Date:           Sun Sep  8 10:09:48 UTC 2024

Modified Files:
        src/sys/arch/powerpc/powerpc: db_interface.c

Log Message:
juggle around DDB guarded blocks to make them consistent and make code
build with or without DDB/KGDB options enabled for powerpc.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/powerpc/powerpc/db_interface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/powerpc/db_interface.c
diff -u src/sys/arch/powerpc/powerpc/db_interface.c:1.60 src/sys/arch/powerpc/powerpc/db_interface.c:1.61
--- src/sys/arch/powerpc/powerpc/db_interface.c:1.60	Wed Oct 26 23:38:08 2022
+++ src/sys/arch/powerpc/powerpc/db_interface.c	Sun Sep  8 10:09:48 2024
@@ -1,8 +1,8 @@
-/*	$NetBSD: db_interface.c,v 1.60 2022/10/26 23:38:08 riastradh Exp $ */
+/*	$NetBSD: db_interface.c,v 1.61 2024/09/08 10:09:48 andvar Exp $ */
 /*	$OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $	*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.60 2022/10/26 23:38:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.61 2024/09/08 10:09:48 andvar Exp $");
 
 #define USERACC
 
@@ -73,6 +73,7 @@ db_regs_t ddb_regs;
 
 void ddb_trap(void);				/* Call into trap_subr.S */
 int ddb_trap_glue(struct trapframe *);		/* Called from trap_subr.S */
+#ifdef DDB
 #if defined (PPC_OEA) || defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
 static void db_show_bat(db_expr_t, bool, db_expr_t, const char *);
 static void db_show_mmu(db_expr_t, bool, db_expr_t, const char *);
@@ -102,7 +103,6 @@ static void db_ppcbooke_dumptlb(db_expr_
 static void db_mach_cpu(db_expr_t, bool, db_expr_t, const char *);
 #endif	/* MULTIPROCESSOR */
 
-#ifdef DDB
 const struct db_command db_machine_command_table[] = {
 #if defined (PPC_OEA) || defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
 	{ DDB_ADD_CMD("bat",	db_show_bat,		0,
@@ -252,7 +252,8 @@ kdb_trap(int type, void *v)
 	db_trap(type, 0);
 	cnpollc(0);
 	db_active--;
-#elif defined(KGDB)
+#endif
+#ifdef KGDB
 	if (!kgdb_trap(type, DDB_REGS)) {
 		rv = 0;
 		goto out;
@@ -304,6 +305,7 @@ kdb_trap(int type, void *v)
 	return rv;
 }
 
+#ifdef DDB
 #if defined (PPC_OEA) || defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
 static void
 print_battranslation(struct bat *bat, unsigned int blidx)
@@ -492,6 +494,7 @@ db_show_mmu(db_expr_t addr, bool have_ad
 #endif
 }
 #endif /* PPC_OEA || PPC_OEA64 || PPC_OEA64_BRIDGE */
+#endif /* DDB */
 
 #if defined(PPC_IBM4XX) || defined(PPC_BOOKE)
 db_addr_t
@@ -522,9 +525,8 @@ branch_taken(int inst, db_addr_t pc, db_
 }
 #endif /* PPC_IBM4XX || PPC_BOOKE */
 
-
-#ifdef PPC_IBM4XX
 #ifdef DDB
+#ifdef PPC_IBM4XX
 static void
 db_ppc4xx_ctx(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
 {
@@ -806,8 +808,6 @@ db_ppc4xx_useracc(db_expr_t addr, bool h
 }
 #endif
 
-#endif /* DDB */
-
 #endif /* PPC_IBM4XX */
 
 #ifdef PPC_BOOKE
@@ -904,3 +904,4 @@ db_mach_cpu(db_expr_t addr, bool have_ad
 	}
 }
 #endif	/* MULTIPROCESSOR */
+#endif /* DDB */

Reply via email to