CVS commit: src/sys/arch/powerpc/powerpc
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.
CVS commit: src/sys/arch/powerpc/powerpc
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 -__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 */
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: andvar Date: Sun Sep 8 10:02:49 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: kgdb_machdep.c Log Message: include for the PSL_DR definition (for KGDB enabled build only). To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/powerpc/kgdb_machdep.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/kgdb_machdep.c diff -u src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.25 src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.26 --- src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.25 Tue Oct 24 20:21:12 2023 +++ src/sys/arch/powerpc/powerpc/kgdb_machdep.c Sun Sep 8 10:02:49 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: kgdb_machdep.c,v 1.25 2023/10/24 20:21:12 andvar Exp $ */ +/* $NetBSD: kgdb_machdep.c,v 1.26 2024/09/08 10:02:49 andvar Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.25 2023/10/24 20:21:12 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.26 2024/09/08 10:02:49 andvar Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: kgdb_machdep #include #include #include +#include #include #if defined (PPC_OEA) || defined (PPC_OEA601) || defined (PPC_OEA64_BRIDGE)
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: andvar Date: Sun Sep 8 10:02:49 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: kgdb_machdep.c Log Message: include for the PSL_DR definition (for KGDB enabled build only). To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/powerpc/kgdb_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: rin Date: Wed Jun 19 15:19:22 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: compat_13_machdep.c compat_16_machdep.c Log Message: powerpc64: Provide dummy stubs for compat1[36] as done for amd64. We haven't had working userland for powerpc64, and therefore compatible to 1.[36] is only useful for netbsd32. Fix build failure for evbppc64 for PR kern/58346 (my bug!). To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/powerpc/compat_13_machdep.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/powerpc/compat_16_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: rin Date: Wed Jun 19 15:19:22 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: compat_13_machdep.c compat_16_machdep.c Log Message: powerpc64: Provide dummy stubs for compat1[36] as done for amd64. We haven't had working userland for powerpc64, and therefore compatible to 1.[36] is only useful for netbsd32. Fix build failure for evbppc64 for PR kern/58346 (my bug!). To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/powerpc/compat_13_machdep.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/powerpc/compat_16_machdep.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/compat_13_machdep.c diff -u src/sys/arch/powerpc/powerpc/compat_13_machdep.c:1.22 src/sys/arch/powerpc/powerpc/compat_13_machdep.c:1.23 --- src/sys/arch/powerpc/powerpc/compat_13_machdep.c:1.22 Sun Mar 13 17:50:55 2022 +++ src/sys/arch/powerpc/powerpc/compat_13_machdep.c Wed Jun 19 15:19:22 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_13_machdep.c,v 1.22 2022/03/13 17:50:55 andvar Exp $ */ +/* $NetBSD: compat_13_machdep.c,v 1.23 2024/06/19 15:19:22 rin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.22 2022/03/13 17:50:55 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.23 2024/06/19 15:19:22 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -53,6 +53,22 @@ __KERNEL_RCSID(0, "$NetBSD: compat_13_ma #include +#ifdef _LP64 + +/* + * COMPAT_13 is useful only with COMPAT_NETBSD32. + */ + +int +compat_13_sys_sigreturn(struct lwp *l, +const struct compat_13_sys_sigreturn_args *uap, register_t *retval) +{ + + return ENOSYS; +} + +#else + int compat_13_sys_sigreturn(struct lwp *l, const struct compat_13_sys_sigreturn_args *uap, register_t *retval) @@ -104,3 +120,5 @@ compat_13_sys_sigreturn(struct lwp *l, return (EJUSTRETURN); } + +#endif /* !_LP64 */ Index: src/sys/arch/powerpc/powerpc/compat_16_machdep.c diff -u src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.25 src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.26 --- src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.25 Mon Jun 17 21:57:59 2024 +++ src/sys/arch/powerpc/powerpc/compat_16_machdep.c Wed Jun 19 15:19:22 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_16_machdep.c,v 1.25 2024/06/17 21:57:59 pgoyette Exp $ */ +/* $NetBSD: compat_16_machdep.c,v 1.26 2024/06/19 15:19:22 rin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.25 2024/06/17 21:57:59 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.26 2024/06/19 15:19:22 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_altivec.h" @@ -60,6 +60,29 @@ __KERNEL_RCSID(0, "$NetBSD: compat_16_ma #include #endif +#ifdef _LP64 + +/* + * COMPAT_16 is useful only with COMPAT_NETBSD32. + */ +void +sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask) +{ + + printf("sendsig_sigcontext: illegal\n"); + sigexit(curlwp, SIGILL); +} + +int +compat_16_sys___sigreturn14(struct lwp *l, +const struct compat_16_sys___sigreturn14_args *uap, register_t *retval) +{ + + return ENOSYS; +} + +#else + /* * Send a signal to process. */ @@ -253,3 +276,5 @@ compat_16_sys___sigreturn14(struct lwp * return (EJUSTRETURN); } + +#endif /* !_LP64 */
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: pgoyette Date: Mon Jun 17 21:57:59 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: compat_16_machdep.c Log Message: Add required include for compat_16 machdep code To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/powerpc/compat_16_machdep.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/compat_16_machdep.c diff -u src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.24 src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.25 --- src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.24 Sat May 27 21:38:06 2023 +++ src/sys/arch/powerpc/powerpc/compat_16_machdep.c Mon Jun 17 21:57:59 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_16_machdep.c,v 1.24 2023/05/27 21:38:06 andvar Exp $ */ +/* $NetBSD: compat_16_machdep.c,v 1.25 2024/06/17 21:57:59 pgoyette Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.24 2023/05/27 21:38:06 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.25 2024/06/17 21:57:59 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_altivec.h" @@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: compat_16_ma #include #include +#include #include #include #include
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: pgoyette Date: Mon Jun 17 21:57:59 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: compat_16_machdep.c Log Message: Add required include for compat_16 machdep code To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/powerpc/compat_16_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: jmcneill Date: Sat Jan 20 20:49:11 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: clock.c Log Message: powerpc: fix delay for large (> ~5sec) values When calculating the target timebase, promote '1000' on the RHS to ULL to force 64-bit calculation, otherwise 'n * 1000' will overflow. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/powerpc/clock.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/clock.c diff -u src/sys/arch/powerpc/powerpc/clock.c:1.17 src/sys/arch/powerpc/powerpc/clock.c:1.18 --- src/sys/arch/powerpc/powerpc/clock.c:1.17 Mon Jul 6 10:31:24 2020 +++ src/sys/arch/powerpc/powerpc/clock.c Sat Jan 20 20:49:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.17 2020/07/06 10:31:24 rin Exp $ */ +/* $NetBSD: clock.c,v 1.18 2024/01/20 20:49:11 jmcneill Exp $ */ /* $OpenBSD: clock.c,v 1.3 1997/10/13 13:42:53 pefo Exp $ */ /* @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.17 2020/07/06 10:31:24 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.18 2024/01/20 20:49:11 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -232,7 +232,7 @@ delay(unsigned int n) #endif /* !_ARCH_PPC64 */ { tb = mftb(); - tb += (n * 1000 + ns_per_tick - 1) / ns_per_tick; + tb += (n * 1000ULL + ns_per_tick - 1) / ns_per_tick; #ifdef _ARCH_PPC64 __asm volatile ("1: mftb %0; cmpld %0,%1; blt 1b;" : "=&r"(scratch) : "r"(tb)
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: jmcneill Date: Sat Jan 20 20:49:11 UTC 2024 Modified Files: src/sys/arch/powerpc/powerpc: clock.c Log Message: powerpc: fix delay for large (> ~5sec) values When calculating the target timebase, promote '1000' on the RHS to ULL to force 64-bit calculation, otherwise 'n * 1000' will overflow. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/powerpc/clock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: rin Date: Fri Dec 15 09:31:03 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: trap.c Log Message: powerpc/oea: trap: pmap_{pte,ste}_spill() even in the interrupt context Page table for oea is something like L2 TLB on memory; kernel and processes share its entries, and process entries can be spilled out. As done for MMU based on software-managed TLB, we need to restore such entries even in the interrupt context. Note that pmap_pte_spill() require no resouce to restore entries. Still-not-implemented pmap_ste_spill() for OEA64 should also. Part of PR kern/57621 To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sys/arch/powerpc/powerpc/trap.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/trap.c diff -u src/sys/arch/powerpc/powerpc/trap.c:1.164 src/sys/arch/powerpc/powerpc/trap.c:1.165 --- src/sys/arch/powerpc/powerpc/trap.c:1.164 Thu Oct 5 19:41:05 2023 +++ src/sys/arch/powerpc/powerpc/trap.c Fri Dec 15 09:31:02 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.164 2023/10/05 19:41:05 ad Exp $ */ +/* $NetBSD: trap.c,v 1.165 2023/12/15 09:31:02 rin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -35,7 +35,7 @@ #define __UCAS_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.164 2023/10/05 19:41:05 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.165 2023/12/15 09:31:02 rin Exp $"); #ifdef _KERNEL_OPT #include "opt_altivec.h" @@ -136,42 +136,40 @@ trap(struct trapframe *tf) ci->ci_ev_kdsi.ev_count++; - /* - * Only query UVM if no interrupts are active. - */ - if (ci->ci_idepth < 0) { - if ((va >> ADDR_SR_SHFT) == pcb->pcb_kmapsr) { -va &= ADDR_PIDX | ADDR_POFF; -va |= pcb->pcb_umapsr << ADDR_SR_SHFT; -map = &p->p_vmspace->vm_map; -#ifdef PPC_OEA64 -if ((tf->tf_dsisr & DSISR_NOTFOUND) && -vm_map_pmap(map)->pm_ste_evictions > 0 && -pmap_ste_spill(vm_map_pmap(map), - trunc_page(va), false)) { - return; -} + if ((va >> ADDR_SR_SHFT) == pcb->pcb_kmapsr) { + va &= ADDR_PIDX | ADDR_POFF; + va |= pcb->pcb_umapsr << ADDR_SR_SHFT; + map = &p->p_vmspace->vm_map; + } +#if defined(DIAGNOSTIC) && !defined(PPC_OEA64) + else if (__predict_false((va >> ADDR_SR_SHFT) == USER_SR)) { + printf("trap: kernel %s DSI trap @ %#lx by %#lx" + " (DSISR %#x): USER_SR unset\n", + (tf->tf_dsisr & DSISR_STORE) +? "write" : "read", + va, tf->tf_srr0, tf->tf_dsisr); + goto brain_damage2; + } #endif + else { + map = kernel_map; + } -if ((tf->tf_dsisr & DSISR_NOTFOUND) && -vm_map_pmap(map)->pm_evictions > 0 && -pmap_pte_spill(vm_map_pmap(map), - trunc_page(va), false)) { - return; -} -#if defined(DIAGNOSTIC) && !defined(PPC_OEA64) - } else if ((va >> ADDR_SR_SHFT) == USER_SR) { -printf("trap: kernel %s DSI trap @ %#lx by %#lx" -" (DSISR %#x): USER_SR unset\n", -(tf->tf_dsisr & DSISR_STORE) - ? "write" : "read", -va, tf->tf_srr0, tf->tf_dsisr); -goto brain_damage2; +#ifdef PPC_OEA64 + if ((tf->tf_dsisr & DSISR_NOTFOUND) && + vm_map_pmap(map)->pm_ste_evictions > 0 && + pmap_ste_spill(vm_map_pmap(map), trunc_page(va), false)) + return; #endif - } else { -map = kernel_map; - } + if ((tf->tf_dsisr & DSISR_NOTFOUND) && + vm_map_pmap(map)->pm_evictions > 0 && + pmap_pte_spill(vm_map_pmap(map), trunc_page(va), false)) + return; + /* + * Only query UVM if no interrupts are active. + */ + if (ci->ci_idepth < 0) { if (tf->tf_dsisr & DSISR_STORE) ftype = VM_PROT_WRITE; else
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: rin Date: Fri Dec 15 09:31:03 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: trap.c Log Message: powerpc/oea: trap: pmap_{pte,ste}_spill() even in the interrupt context Page table for oea is something like L2 TLB on memory; kernel and processes share its entries, and process entries can be spilled out. As done for MMU based on software-managed TLB, we need to restore such entries even in the interrupt context. Note that pmap_pte_spill() require no resouce to restore entries. Still-not-implemented pmap_ste_spill() for OEA64 should also. Part of PR kern/57621 To generate a diff of this commit: cvs rdiff -u -r1.164 -r1.165 src/sys/arch/powerpc/powerpc/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: andvar Date: Tue Oct 24 20:21:12 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: kgdb_machdep.c Log Message: declare batl for PPC_OEA601 only, since it is unused by OEA or OEA64_BRIDGE. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/powerpc/kgdb_machdep.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/kgdb_machdep.c diff -u src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.24 src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.25 --- src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.24 Mon Jul 6 11:05:54 2020 +++ src/sys/arch/powerpc/powerpc/kgdb_machdep.c Tue Oct 24 20:21:12 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: kgdb_machdep.c,v 1.24 2020/07/06 11:05:54 rin Exp $ */ +/* $NetBSD: kgdb_machdep.c,v 1.25 2023/10/24 20:21:12 andvar Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.24 2020/07/06 11:05:54 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.25 2023/10/24 20:21:12 andvar Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -84,7 +84,10 @@ kgdb_acc(vaddr_t va, size_t len) paddr_t pa; u_int msr; #if defined (PPC_OEA) || defined (PPC_OEA601) || defined (PPC_OEA64_BRIDGE) - u_int batu, batl; + u_int batu; +#ifdef PPC_OEA601 + u_int batl; +#endif #endif /* If translation is off, everything is fair game */
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: andvar Date: Tue Oct 24 20:21:12 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: kgdb_machdep.c Log Message: declare batl for PPC_OEA601 only, since it is unused by OEA or OEA64_BRIDGE. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/powerpc/kgdb_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Thu Apr 13 06:39:23 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: db_trace.c Log Message: powerpc/ddb: Fix one more load to use db_read_bytes. Fix some typos in crash(8) comments too. XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/arch/powerpc/powerpc/db_trace.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_trace.c diff -u src/sys/arch/powerpc/powerpc/db_trace.c:1.62 src/sys/arch/powerpc/powerpc/db_trace.c:1.63 --- src/sys/arch/powerpc/powerpc/db_trace.c:1.62 Wed Apr 12 19:47:41 2023 +++ src/sys/arch/powerpc/powerpc/db_trace.c Thu Apr 13 06:39:23 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: db_trace.c,v 1.62 2023/04/12 19:47:41 riastradh Exp $ */ +/* $NetBSD: db_trace.c,v 1.63 2023/04/13 06:39:23 riastradh Exp $ */ /* $OpenBSD: db_trace.c,v 1.3 1997/03/21 02:10:48 niklas Exp $ */ /* @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.62 2023/04/12 19:47:41 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.63 2023/04/13 06:39:23 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -188,7 +188,7 @@ db_stack_trace_print(db_expr_t addr, boo } } (*pr)("lid %d ", R(&l->l_lid)); - pcb = lwp_getpcb(l); + pcb = R(&l->l_addr); /* lwp_getpcb */ frame = (db_addr_t)R(&pcb->pcb_sp); (*pr)("at %p\n", frame); } else @@ -215,7 +215,7 @@ db_stack_trace_print(db_expr_t addr, boo (*pr)("0x%08lx: ", frame); if (lr + 4 == (db_addr_t) trapexit || -#if !defined(_KERNEL) || defined(PPC_BOOKE) /* XXX crash(*) */ +#if !defined(_KERNEL) || defined(PPC_BOOKE) /* XXX crash(8) */ lr + 4 == (db_addr_t) intrcall || #endif lr + 4 == (db_addr_t) sctrapexit) { @@ -230,14 +230,14 @@ db_stack_trace_print(db_expr_t addr, boo } switch (R(&tf->tf_exc)) { case EXC_DSI: -#ifdef PPC_OEA /* XXX crash(*) */ +#ifdef PPC_OEA /* XXX crash(8) */ (*pr)("DSI %s trap @ %#x by ", (R(&tf->tf_dsisr) & DSISR_STORE ? "write" : "read"), R(&tf->tf_dar)); #endif -#ifdef PPC_IBM4XX /* XXX crash(*) */ +#ifdef PPC_IBM4XX /* XXX crash(8) */ trapstr = "DSI"; dsi: (*pr)("%s %s trap @ %#x by ", trapstr,
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Thu Apr 13 06:39:23 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: db_trace.c Log Message: powerpc/ddb: Fix one more load to use db_read_bytes. Fix some typos in crash(8) comments too. XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/arch/powerpc/powerpc/db_trace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Wed Apr 12 19:47:41 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: db_disasm.c db_trace.c Log Message: powerpc/ddb: Use db_read_bytes, not direct pointer access. Mark some powerpc-variant ifdefs with XXX crash(8), not sure yet what to do about them. XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/powerpc/db_disasm.c cvs rdiff -u -r1.61 -r1.62 src/sys/arch/powerpc/powerpc/db_trace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Wed Apr 12 19:47:41 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: db_disasm.c db_trace.c Log Message: powerpc/ddb: Use db_read_bytes, not direct pointer access. Mark some powerpc-variant ifdefs with XXX crash(8), not sure yet what to do about them. XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/powerpc/db_disasm.c cvs rdiff -u -r1.61 -r1.62 src/sys/arch/powerpc/powerpc/db_trace.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_disasm.c diff -u src/sys/arch/powerpc/powerpc/db_disasm.c:1.30 src/sys/arch/powerpc/powerpc/db_disasm.c:1.31 --- src/sys/arch/powerpc/powerpc/db_disasm.c:1.30 Wed Apr 12 17:53:32 2023 +++ src/sys/arch/powerpc/powerpc/db_disasm.c Wed Apr 12 19:47:41 2023 @@ -1,8 +1,8 @@ -/* $NetBSD: db_disasm.c,v 1.30 2023/04/12 17:53:32 riastradh Exp $ */ +/* $NetBSD: db_disasm.c,v 1.31 2023/04/12 19:47:41 riastradh Exp $ */ /* $OpenBSD: db_disasm.c,v 1.2 1996/12/28 06:21:48 rahnds Exp $ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.30 2023/04/12 17:53:32 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.31 2023/04/12 19:47:41 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -1059,7 +1059,8 @@ db_disasm(db_addr_t loc, bool extended) { int class; instr_t opcode; - opcode = *(instr_t *)(loc); + + db_read_bytes(loc, sizeof(opcode), (char *)&opcode); class = opcode >> 26; (opcodes_base[class])(opcode, loc); Index: src/sys/arch/powerpc/powerpc/db_trace.c diff -u src/sys/arch/powerpc/powerpc/db_trace.c:1.61 src/sys/arch/powerpc/powerpc/db_trace.c:1.62 --- src/sys/arch/powerpc/powerpc/db_trace.c:1.61 Wed Apr 12 17:53:32 2023 +++ src/sys/arch/powerpc/powerpc/db_trace.c Wed Apr 12 19:47:41 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: db_trace.c,v 1.61 2023/04/12 17:53:32 riastradh Exp $ */ +/* $NetBSD: db_trace.c,v 1.62 2023/04/12 19:47:41 riastradh Exp $ */ /* $OpenBSD: db_trace.c,v 1.3 1997/03/21 02:10:48 niklas Exp $ */ /* @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.61 2023/04/12 17:53:32 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.62 2023/04/12 19:47:41 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -69,6 +69,13 @@ __KERNEL_RCSID(0, "$NetBSD: db_trace.c,v #include #include +#define R(P) \ +({ \ + __typeof__(*(P)) __db_tmp; \ + db_read_bytes((db_addr_t)(P), sizeof(*(P)), (char *)&__db_tmp); \ + __db_tmp; \ +}) + const struct db_variable db_regs[] = { { "r0", (long *)&ddb_regs.r[0], FCN_NULL, NULL }, { "r1", (long *)&ddb_regs.r[1], FCN_NULL, NULL }, @@ -109,7 +116,7 @@ const struct db_variable db_regs[] = { { "cr", (long *)&ddb_regs.cr,FCN_NULL, NULL }, { "xer", (long *)&ddb_regs.xer, FCN_NULL, NULL }, { "mq", (long *)&ddb_regs.mq,FCN_NULL, NULL }, -#ifdef PPC_IBM4XX +#ifdef PPC_IBM4XX /* XXX crash(8) */ { "dear", (long *)&ddb_regs.dear, FCN_NULL, NULL }, { "esr", (long *)&ddb_regs.esr, FCN_NULL, NULL }, { "pid", (long *)&ddb_regs.pid, FCN_NULL, NULL }, @@ -165,8 +172,8 @@ db_stack_trace_print(db_expr_t addr, boo if (lwpaddr) { l = (struct lwp *)addr; -p = l->l_proc; -(*pr)("trace: pid %d ", p->p_pid); +p = R(&l->l_proc); +(*pr)("trace: pid %d ", R(&p->p_pid)); } else { (*pr)("trace: pid %d ", (int)addr); p = db_proc_find((pid_t)addr); @@ -174,15 +181,15 @@ db_stack_trace_print(db_expr_t addr, boo (*pr)("not found\n"); return; } -l = LIST_FIRST(&p->p_lwps); +l = R(&LIST_FIRST(&p->p_lwps)); if (l == NULL) { (*pr)("trace: no LWP?\n"); return; } } - (*pr)("lid %d ", l->l_lid); + (*pr)("lid %d ", R(&l->l_lid)); pcb = lwp_getpcb(l); - frame = (db_addr_t)pcb->pcb_sp; + frame = (db_addr_t)R(&pcb->pcb_sp); (*pr)("at %p\n", frame); } else frame = (db_addr_t)addr; @@ -192,7 +199,7 @@ db_stack_trace_print(db_expr_t addr, boo for (;;) { if (frame < PAGE_SIZE) break; - frame = *(db_addr_t *)frame; + frame = R((db_addr_t *)frame); next_frame: args = (db_addr_t *)(frame + 8); if (frame < PAGE_SIZE) @@ -200,7 +207,7 @@ db_stack_trace_print(db_expr_t addr, boo if (count-- == 0) break; - lr = *(db_addr_t *)(frame + 4) - 4; + lr = R((db_addr_t *)(frame + 4)) - 4; if ((lr & 3) || (lr < 0x100)) { (*pr)("saved LR(0x%x) is invalid.", lr); break; @@ -208,36 +215,42 @@ db_stack_trace_print(db_expr_t addr, boo (*pr)("0x%08lx: ", frame); if (lr + 4 == (db_addr_t) trapexit || -#if !defined(_KERNEL) || defined(PPC_BOOKE) +#if !defined(_KERNEL) || defined(PPC_BOOKE) /* XXX crash(*) */ lr + 4 == (db_addr_t) intrcall || #endif lr + 4 == (db_addr_t
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Wed Mar 1 08:18:13 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: locore_subr.S Log Message: powerpc: Optimization: Omit needless membar when triggering softint. When we are triggering a softint, it can't already hold any mutexes. So any path to mutex_exit(mtx) must go via mutex_enter(mtx), which is always done with atomic r/m/w, and we need not issue any explicit barrier between ci->ci_curlwp = softlwp and a potential load of mtx->mtx_owner in mutex_exit. PR kern/57240 XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/powerpc/powerpc/locore_subr.S 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/locore_subr.S diff -u src/sys/arch/powerpc/powerpc/locore_subr.S:1.67 src/sys/arch/powerpc/powerpc/locore_subr.S:1.68 --- src/sys/arch/powerpc/powerpc/locore_subr.S:1.67 Thu Feb 23 14:56:11 2023 +++ src/sys/arch/powerpc/powerpc/locore_subr.S Wed Mar 1 08:18:13 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: locore_subr.S,v 1.67 2023/02/23 14:56:11 riastradh Exp $ */ +/* $NetBSD: locore_subr.S,v 1.68 2023/03/01 08:18:13 riastradh Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -418,9 +418,13 @@ _ENTRY(softint_fast_dispatch) sync /* XXX eieio */ /* for mutex_enter; see cpu_switchto */ #endif stptr %r3, CI_CURLWP(%r7) -#ifdef MULTIPROCESSOR - sync/* for mutex_enter; see cpu_switchto */ -#endif + /* + * No need for barrier after ci->ci_curlwp = softlwp -- when we + * enter a softint lwp, it can't be holding any mutexes, so it + * can't release any until after it has acquired them, so we + * need not participate in the protocol with mutex_vector_enter + * barriers here. + */ mr %r13, %r3 #ifdef PPC_BOOKE mtsprg2 %r3
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Wed Mar 1 08:18:13 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: locore_subr.S Log Message: powerpc: Optimization: Omit needless membar when triggering softint. When we are triggering a softint, it can't already hold any mutexes. So any path to mutex_exit(mtx) must go via mutex_enter(mtx), which is always done with atomic r/m/w, and we need not issue any explicit barrier between ci->ci_curlwp = softlwp and a potential load of mtx->mtx_owner in mutex_exit. PR kern/57240 XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/powerpc/powerpc/locore_subr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Thu Feb 23 14:56:12 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: locore_subr.S Log Message: powerpc: Add missing barriers in cpu_switchto. Details in comments. PR kern/57240 XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/powerpc/powerpc/locore_subr.S 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/locore_subr.S diff -u src/sys/arch/powerpc/powerpc/locore_subr.S:1.66 src/sys/arch/powerpc/powerpc/locore_subr.S:1.67 --- src/sys/arch/powerpc/powerpc/locore_subr.S:1.66 Wed Mar 16 09:48:23 2022 +++ src/sys/arch/powerpc/powerpc/locore_subr.S Thu Feb 23 14:56:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: locore_subr.S,v 1.66 2022/03/16 09:48:23 andvar Exp $ */ +/* $NetBSD: locore_subr.S,v 1.67 2023/02/23 14:56:11 riastradh Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -215,7 +215,32 @@ ENTRY(cpu_switchto) */ GET_CPUINFO(%r7) + + /* + * Issue barriers to coordinate mutex_exit on this CPU with + * mutex_vector_enter on another CPU. + * + * 1. Any prior mutex_exit by oldlwp must be visible to other + *CPUs before we set ci_curlwp := newlwp on this one, + *requiring a store-before-store barrier. + * + * 2. ci_curlwp := newlwp must be visible on all other CPUs + *before any subsequent mutex_exit by newlwp can even test + *whether there might be waiters, requiring a + *store-before-load barrier. + * + * See kern_mutex.c for details -- this is necessary for + * adaptive mutexes to detect whether the lwp is on the CPU in + * order to safely block without requiring atomic r/m/w in + * mutex_exit. + */ +#ifdef MULTIPROCESSOR + sync /* store-before-store XXX use eieio if available -- cheaper */ +#endif stptr %r31,CI_CURLWP(%r7) +#ifdef MULTIPROCESSOR + sync /* store-before-load */ +#endif mr %r13,%r31 #ifdef PPC_BOOKE mtsprg2 %r31 /* save curlwp in sprg2 */ @@ -389,7 +414,13 @@ _ENTRY(softint_fast_dispatch) * to a kernel thread */ +#ifdef MULTIPROCESSOR + sync /* XXX eieio */ /* for mutex_enter; see cpu_switchto */ +#endif stptr %r3, CI_CURLWP(%r7) +#ifdef MULTIPROCESSOR + sync/* for mutex_enter; see cpu_switchto */ +#endif mr %r13, %r3 #ifdef PPC_BOOKE mtsprg2 %r3 @@ -423,7 +454,13 @@ _ENTRY(softint_fast_dispatch) #endif GET_CPUINFO(%r7) +#ifdef MULTIPROCESSOR + sync /* XXX eieio */ /* for mutex_enter; see cpu_switchto */ +#endif stptr %r30, CI_CURLWP(%r7) +#ifdef MULTIPROCESSOR + sync/* for mutex_enter; see cpu_switchto */ +#endif mr %r13, %r30 #ifdef PPC_BOOKE mtsprg2 %r30
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Thu Feb 23 14:56:12 UTC 2023 Modified Files: src/sys/arch/powerpc/powerpc: locore_subr.S Log Message: powerpc: Add missing barriers in cpu_switchto. Details in comments. PR kern/57240 XXX pullup-8 XXX pullup-9 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/powerpc/powerpc/locore_subr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Mon Dec 12 13:26:47 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: Move the last remaining kernel printf to ofprint. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/powerpc/ofw_machdep.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/ofw_machdep.c diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.35 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.36 --- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.35 Sat Dec 10 13:15:00 2022 +++ src/sys/arch/powerpc/powerpc/ofw_machdep.c Mon Dec 12 13:26:46 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_machdep.c,v 1.35 2022/12/10 13:15:00 martin Exp $ */ +/* $NetBSD: ofw_machdep.c,v 1.36 2022/12/12 13:26:46 martin Exp $ */ /*- * Copyright (c) 2007, 2021 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.35 2022/12/10 13:15:00 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.36 2022/12/12 13:26:46 martin Exp $"); #include #include @@ -352,7 +352,7 @@ ofw_bootstrap_get_memory(void) error: #if defined (MAMBO) - printf("no memory, assuming 512MB\n"); + ofprint("no memory, assuming 512MB\n"); OFmem[0].start = 0x0; OFmem[0].size = 0x2000;
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Mon Dec 12 13:26:47 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: Move the last remaining kernel printf to ofprint. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/powerpc/ofw_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Sat Dec 10 13:15:00 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: Move some output to DEBUG-only state To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/arch/powerpc/powerpc/ofw_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Sat Dec 10 13:15:00 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: Move some output to DEBUG-only state To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/arch/powerpc/powerpc/ofw_machdep.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/ofw_machdep.c diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.34 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.35 --- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.34 Sat Dec 10 13:06:41 2022 +++ src/sys/arch/powerpc/powerpc/ofw_machdep.c Sat Dec 10 13:15:00 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_machdep.c,v 1.34 2022/12/10 13:06:41 martin Exp $ */ +/* $NetBSD: ofw_machdep.c,v 1.35 2022/12/10 13:15:00 martin Exp $ */ /*- * Copyright (c) 2007, 2021 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.34 2022/12/10 13:06:41 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.35 2022/12/10 13:15:00 martin Exp $"); #include #include @@ -254,7 +254,7 @@ ofw_bootstrap_get_memory(void) #endif OFmem[memcnt].start = addr; OFmem[memcnt].size = size; - ofprint("mem region %d start=%"PRIx64" size=%"PRIx64"\n", + DPRINTF("mem region %d start=%"PRIx64" size=%"PRIx64"\n", memcnt, addr, size); memcnt++; } @@ -317,7 +317,7 @@ ofw_bootstrap_get_memory(void) #endif OFavail[cnt].start = addr; OFavail[cnt].size = size; - ofprint("avail region %d start=%#"PRIx64" size=%#"PRIx64"\n", + DPRINTF("avail region %d start=%#"PRIx64" size=%#"PRIx64"\n", cnt, addr, size); cnt++; } @@ -423,7 +423,7 @@ ofw_bootstrap_get_translations(void) continue; } - ofprint("translation %d virt=%#"PRIx32 + DPRINTF("translation %d virt=%#"PRIx32 " phys=%#"PRIx64" size=%#"PRIx32" mode=%#"PRIx32"\n", idx, virt, phys, size, mode); @@ -488,7 +488,7 @@ ofw_bootstrap(void) ofw_real_mode = false; } } - ofprint("OpenFirmware running in %s-mode\n", + DPRINTF("OpenFirmware running in %s-mode\n", ofw_real_mode ? "real" : "virtual"); /* Get #address-cells and #size-cells to fetching memory info. */
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Sat Dec 10 13:06:41 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: Convert more kernel printfs that might happen very early (before kernel console is usable) to ofprint. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/powerpc/powerpc/ofw_machdep.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/ofw_machdep.c diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.33 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.34 --- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.33 Thu Nov 24 00:13:54 2022 +++ src/sys/arch/powerpc/powerpc/ofw_machdep.c Sat Dec 10 13:06:41 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_machdep.c,v 1.33 2022/11/24 00:13:54 macallan Exp $ */ +/* $NetBSD: ofw_machdep.c,v 1.34 2022/12/10 13:06:41 martin Exp $ */ /*- * Copyright (c) 2007, 2021 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.33 2022/11/24 00:13:54 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.34 2022/12/10 13:06:41 martin Exp $"); #include #include @@ -88,6 +88,11 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_machdep. #define DPRINTF while(0) printf #endif +#define ofpanic(FORMAT, ...) do {\ + ofprint(FORMAT __VA_OPT__(,) __VA_ARGS__); \ + panic(FORMAT __VA_OPT__(,) __VA_ARGS__); \ + } while (0) + int ofw_root; int ofw_chosen; @@ -185,7 +190,7 @@ ofw_bootstrap_console(void) return; nocons: - panic("No /chosen could be found!\n"); + ofpanic("No /chosen could be found!\n"); console_node = -1; } @@ -356,7 +361,7 @@ error: OFavail[0].size = 0x2000 - 0x3000; #else - panic("no memory?"); + ofpanic("no memory?"); #endif return; } @@ -375,19 +380,19 @@ ofw_bootstrap_get_translations(void) if (OF_getprop(ofw_chosen, "mmu", &mmu_ihandle, sizeof(mmu_ihandle)) <= 0) { - aprint_normal("No /chosen/mmu\n"); + ofprint("No /chosen/mmu\n"); return; } mmu_phandle = OF_instance_to_package(mmu_ihandle); proplen = OF_getproplen(mmu_phandle, "translations"); if (proplen <= 0) { - aprint_normal("No translations in /chosen/mmu\n"); + ofprint("No translations in /chosen/mmu\n"); return; } if (proplen > sizeof(regs)) { - panic("/chosen/mmu translations too large"); + ofpanic("/chosen/mmu translations too large"); } proplen = OF_getprop(mmu_phandle, "translations", regs, sizeof(regs)); @@ -406,11 +411,11 @@ ofw_bootstrap_get_translations(void) phys = (phys << 32) | *rp++; break; default: - panic("unexpected #address-cells"); + ofpanic("unexpected #address-cells"); } mode = *rp++; if (rp > ®s[nregs]) { - panic("unexpected OFW translations format"); + ofpanic("unexpected OFW translations format"); } /* Wouldn't expect this, but... */ @@ -418,16 +423,16 @@ ofw_bootstrap_get_translations(void) continue; } - aprint_normal("translation %d virt=%#"PRIx32 + ofprint("translation %d virt=%#"PRIx32 " phys=%#"PRIx64" size=%#"PRIx32" mode=%#"PRIx32"\n", idx, virt, phys, size, mode); if (sizeof(paddr_t) < 8 && phys >= 0x1ULL) { - panic("translation phys out of range"); + ofpanic("translation phys out of range"); } if (idx == OFW_MAX_TRANSLATIONS) { - panic("too many OFW translations"); + ofpanic("too many OFW translations"); } ofw_translations[idx].virt = virt;
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Sat Dec 10 13:06:41 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: Convert more kernel printfs that might happen very early (before kernel console is usable) to ofprint. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/powerpc/powerpc/ofw_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Mon Dec 5 16:03:50 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: process_machdep.c Log Message: Do not bother to set PSL_SE in l_md.md_flags - it is not checked anywhere. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/powerpc/powerpc/process_machdep.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/process_machdep.c diff -u src/sys/arch/powerpc/powerpc/process_machdep.c:1.42 src/sys/arch/powerpc/powerpc/process_machdep.c:1.43 --- src/sys/arch/powerpc/powerpc/process_machdep.c:1.42 Sat Mar 6 08:08:19 2021 +++ src/sys/arch/powerpc/powerpc/process_machdep.c Mon Dec 5 16:03:50 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.42 2021/03/06 08:08:19 rin Exp $ */ +/* $NetBSD: process_machdep.c,v 1.43 2022/12/05 16:03:50 martin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.42 2021/03/06 08:08:19 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.43 2022/12/05 16:03:50 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_altivec.h" @@ -138,10 +138,8 @@ process_sstep(struct lwp *l, int sstep) if (sstep) { tf->tf_srr1 |= PSL_SE; - l->l_md.md_flags |= PSL_SE; } else { tf->tf_srr1 &= ~PSL_SE; - l->l_md.md_flags &= ~PSL_SE; } return 0; #else
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Mon Dec 5 16:03:50 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: process_machdep.c Log Message: Do not bother to set PSL_SE in l_md.md_flags - it is not checked anywhere. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/powerpc/powerpc/process_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Mon Dec 5 16:01:03 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: vm_machdep.c Log Message: Do not copy l_md to the new lwp in cpu_lwp_fork - as discussed on tech-kern we do not want the child to inherit any of the flags in there. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/arch/powerpc/powerpc/vm_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: martin Date: Mon Dec 5 16:01:03 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: vm_machdep.c Log Message: Do not copy l_md to the new lwp in cpu_lwp_fork - as discussed on tech-kern we do not want the child to inherit any of the flags in there. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/arch/powerpc/powerpc/vm_machdep.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/vm_machdep.c diff -u src/sys/arch/powerpc/powerpc/vm_machdep.c:1.104 src/sys/arch/powerpc/powerpc/vm_machdep.c:1.105 --- src/sys/arch/powerpc/powerpc/vm_machdep.c:1.104 Mon Jul 6 10:52:12 2020 +++ src/sys/arch/powerpc/powerpc/vm_machdep.c Mon Dec 5 16:01:03 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.104 2020/07/06 10:52:12 rin Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.105 2022/12/05 16:01:03 martin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.104 2020/07/06 10:52:12 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.105 2022/12/05 16:01:03 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_altivec.h" @@ -95,8 +95,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp struct pcb * const pcb1 = lwp_getpcb(l1); struct pcb * const pcb2 = lwp_getpcb(l2); - /* Copy MD part of lwp and set up user trapframe pointer. */ - l2->l_md = l1->l_md; + /* Set up user trapframe pointer. */ l2->l_md.md_utf = trapframe(l2); /* Copy PCB. */
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Thu Nov 24 00:13:55 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: in ofprint() only append \r if the last character is \n To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/powerpc/ofw_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Thu Nov 24 00:13:55 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: in ofprint() only append \r if the last character is \n To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/powerpc/ofw_machdep.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/ofw_machdep.c diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.32 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.33 --- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.32 Thu Nov 24 00:07:48 2022 +++ src/sys/arch/powerpc/powerpc/ofw_machdep.c Thu Nov 24 00:13:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_machdep.c,v 1.32 2022/11/24 00:07:48 macallan Exp $ */ +/* $NetBSD: ofw_machdep.c,v 1.33 2022/11/24 00:13:54 macallan Exp $ */ /*- * Copyright (c) 2007, 2021 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.32 2022/11/24 00:07:48 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.33 2022/11/24 00:13:54 macallan Exp $"); #include #include @@ -115,7 +115,8 @@ void ofprint(const char *blah, ...) va_end(va); OF_write(console_instance, buf, len); /* Apple OF only does a newline on \n, so add an explicit CR */ - OF_write(console_instance, "\r", 1); + if ((len > 0) && (buf[len - 1] == '\n')) + OF_write(console_instance, "\r", 1); } static int
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: rin Date: Thu Jun 2 00:32:14 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: fix_unaligned.c Log Message: As a tiny optimization, rearrange cases as follows: (1) load/store of format D (base + disp) (2) load/store of format X (base + index) (3) lmw and stmw For clang-compiled userland (*), their frequencies are roughly, (1) > (2) >> (3) ~ 0. Improvement should be minor; we are already trapped in the alignment fault handler. (*) clang unconditionally emits unaligned memory access for powerpc. Undocumented -disable-ppc-unaligned option does not work... To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/powerpc/fix_unaligned.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: rin Date: Thu Jun 2 00:32:14 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: fix_unaligned.c Log Message: As a tiny optimization, rearrange cases as follows: (1) load/store of format D (base + disp) (2) load/store of format X (base + index) (3) lmw and stmw For clang-compiled userland (*), their frequencies are roughly, (1) > (2) >> (3) ~ 0. Improvement should be minor; we are already trapped in the alignment fault handler. (*) clang unconditionally emits unaligned memory access for powerpc. Undocumented -disable-ppc-unaligned option does not work... To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/powerpc/fix_unaligned.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/fix_unaligned.c diff -u src/sys/arch/powerpc/powerpc/fix_unaligned.c:1.1 src/sys/arch/powerpc/powerpc/fix_unaligned.c:1.2 --- src/sys/arch/powerpc/powerpc/fix_unaligned.c:1.1 Mon May 30 13:58:51 2022 +++ src/sys/arch/powerpc/powerpc/fix_unaligned.c Thu Jun 2 00:32:14 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: fix_unaligned.c,v 1.1 2022/05/30 13:58:51 rin Exp $ */ +/* $NetBSD: fix_unaligned.c,v 1.2 2022/06/02 00:32:14 rin Exp $ */ /* * Copyright (c) 2022 The NetBSD Foundation, Inc. @@ -51,7 +51,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fix_unaligned.c,v 1.1 2022/05/30 13:58:51 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fix_unaligned.c,v 1.2 2022/06/02 00:32:14 rin Exp $"); #include "opt_ddb.h" #include "opt_ppcarch.h" @@ -187,27 +187,55 @@ emul_unaligned(struct trapframe *tf, ksi int flags; switch (insn->i_any.i_opcd) { - case OPC_LMW: - UA_EVCNT_INCR(lmw); -#ifdef FIX_UNALIGNED_LSTMW + case OPC_LWZ: + UA_EVCNT_INCR(lwz); flags = UAF_LOAD; - if (do_lstmw(tf, insn, flags)) - goto fault; - return false; -#else - goto unknown; -#endif + break; - case OPC_STMW: - UA_EVCNT_INCR(stmw); -#ifdef FIX_UNALIGNED_LSTMW + case OPC_LWZU: + UA_EVCNT_INCR(lwzu); + flags = UAF_LOAD | UAF_UPDATE; + break; + + case OPC_STW: + UA_EVCNT_INCR(stw); flags = UAF_STORE; - if (do_lstmw(tf, insn, flags)) - goto fault; - return false; -#else - goto unknown; -#endif + break; + + case OPC_STWU: + UA_EVCNT_INCR(stwu); + flags = UAF_STORE | UAF_UPDATE; + break; + + case OPC_LHZ: + UA_EVCNT_INCR(lhz); + flags = UAF_LOAD | UAF_HALF; + break; + + case OPC_LHZU: + UA_EVCNT_INCR(lhzu); + flags = UAF_LOAD | UAF_HALF | UAF_UPDATE; + break; + + case OPC_LHA: + UA_EVCNT_INCR(lha); + flags = UAF_LOAD | UAF_HALF | UAF_ALGEBRA; + break; + + case OPC_LHAU: + UA_EVCNT_INCR(lhau); + flags = UAF_LOAD | UAF_HALF | UAF_ALGEBRA | UAF_UPDATE; + break; + + case OPC_STH: + UA_EVCNT_INCR(sth); + flags = UAF_STORE | UAF_HALF; + break; + + case OPC_STHU: + UA_EVCNT_INCR(sthu); + flags = UAF_STORE | UAF_HALF | UAF_UPDATE; + break; case OPC_integer_31: switch (insn->i_x.i_xo) { @@ -287,55 +315,27 @@ emul_unaligned(struct trapframe *tf, ksi } break; - case OPC_LWZ: - UA_EVCNT_INCR(lwz); + case OPC_LMW: + UA_EVCNT_INCR(lmw); +#ifdef FIX_UNALIGNED_LSTMW flags = UAF_LOAD; - break; - - case OPC_LWZU: - UA_EVCNT_INCR(lwzu); - flags = UAF_LOAD | UAF_UPDATE; - break; + if (do_lstmw(tf, insn, flags)) + goto fault; + return false; +#else + goto unknown; +#endif - case OPC_STW: - UA_EVCNT_INCR(stw); + case OPC_STMW: + UA_EVCNT_INCR(stmw); +#ifdef FIX_UNALIGNED_LSTMW flags = UAF_STORE; - break; - - case OPC_STWU: - UA_EVCNT_INCR(stwu); - flags = UAF_STORE | UAF_UPDATE; - break; - - case OPC_LHZ: - UA_EVCNT_INCR(lhz); - flags = UAF_LOAD | UAF_HALF; - break; - - case OPC_LHZU: - UA_EVCNT_INCR(lhzu); - flags = UAF_LOAD | UAF_HALF | UAF_UPDATE; - break; - - case OPC_LHA: - UA_EVCNT_INCR(lha); - flags = UAF_LOAD | UAF_HALF | UAF_ALGEBRA; - break; - - case OPC_LHAU: - UA_EVCNT_INCR(lhau); - flags = UAF_LOAD | UAF_HALF | UAF_ALGEBRA | UAF_UPDATE; - break; - - case OPC_STH: - UA_EVCNT_INCR(sth); - flags = UAF_STORE | UAF_HALF; - break; - - case OPC_STHU: - UA_EVCNT_INCR(sthu); - flags = UAF_STORE | UAF_HALF | UAF_UPDATE; - break; + if (do_lstmw(tf, insn, flags)) + goto fault; + return false; +#else + goto unknown; +#endif default: UA_EVCNT_INCR(unknown);
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: andvar Date: Wed Mar 16 09:48:23 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: locore_subr.S Log Message: s/frmae/frame/ To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/arch/powerpc/powerpc/locore_subr.S 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/locore_subr.S diff -u src/sys/arch/powerpc/powerpc/locore_subr.S:1.65 src/sys/arch/powerpc/powerpc/locore_subr.S:1.66 --- src/sys/arch/powerpc/powerpc/locore_subr.S:1.65 Sat Mar 6 08:34:58 2021 +++ src/sys/arch/powerpc/powerpc/locore_subr.S Wed Mar 16 09:48:23 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: locore_subr.S,v 1.65 2021/03/06 08:34:58 rin Exp $ */ +/* $NetBSD: locore_subr.S,v 1.66 2022/03/16 09:48:23 andvar Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -284,7 +284,7 @@ ENTRY(cpu_switchto) #if 1 addi %r1,%r1,CALLFRAMELEN #else - ldreg %r1,CFRAME_SP(%r1) /* pop stack frmae */ + ldreg %r1,CFRAME_SP(%r1) /* pop stack frame */ #endif ldreg %r0,CFRAME_LR(%r1) mtlr %r0
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: andvar Date: Wed Mar 16 09:48:23 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: locore_subr.S Log Message: s/frmae/frame/ To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/arch/powerpc/powerpc/locore_subr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Wed Feb 16 23:30:52 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: bus_dma.c Log Message: powerpc: Implement bus_dmamap_load_raw. Can probably delete some of the round-trips between bus addresses and physical addresses -- did these only to copy the logic already in _bus_dmamap_load_buffer. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/arch/powerpc/powerpc/bus_dma.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/bus_dma.c diff -u src/sys/arch/powerpc/powerpc/bus_dma.c:1.52 src/sys/arch/powerpc/powerpc/bus_dma.c:1.53 --- src/sys/arch/powerpc/powerpc/bus_dma.c:1.52 Mon Jul 6 10:31:24 2020 +++ src/sys/arch/powerpc/powerpc/bus_dma.c Wed Feb 16 23:30:52 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.52 2020/07/06 10:31:24 rin Exp $ */ +/* $NetBSD: bus_dma.c,v 1.53 2022/02/16 23:30:52 riastradh Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #define _POWERPC_BUS_DMA_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.52 2020/07/06 10:31:24 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.53 2022/02/16 23:30:52 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -401,12 +401,98 @@ _bus_dmamap_load_uio(bus_dma_tag_t t, bu /* * Like _bus_dmamap_load(), but for raw memory allocated with * bus_dmamem_alloc(). + * + * XXX This is too much copypasta of _bus_dmamap_load_buffer. */ int -_bus_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map, bus_dma_segment_t *segs, int nsegs, bus_size_t size, int flags) +_bus_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map, +bus_dma_segment_t *segs, int nsegs, bus_size_t size, int flags) { + bus_size_t sgsize, isgsize; + bus_size_t busaddr, curaddr, lastaddr, baddr, bmask; + int seg, iseg, first; + + if (size == 0) + return 0; + + lastaddr = 0; + bmask = ~(map->_dm_boundary - 1); + + first = 0; + iseg = 0; + busaddr = segs[iseg].ds_addr; + isgsize = segs[iseg].ds_len; + for (seg = 0; size > 0;) { + /* + * Get the physical address for this segment. + */ + curaddr = BUS_MEM_TO_PHYS(t, busaddr); + + /* + * If we're beyond the bounce threshold, notify + * the caller. + */ + if (map->_dm_bounce_thresh != 0 && + curaddr >= map->_dm_bounce_thresh) + return EINVAL; + + /* + * Compute the segment size, and adjust counts. + */ + sgsize = PAGE_SIZE - ((u_long)curaddr & PGOFSET); + sgsize = MIN(sgsize, isgsize); + sgsize = MIN(sgsize, size); + sgsize = MIN(sgsize, map->dm_maxsegsz); + + /* + * Make sure we don't cross any boundaries. + */ + if (map->_dm_boundary > 0) { + baddr = (curaddr + map->_dm_boundary) & bmask; + if (sgsize > (baddr - curaddr)) +sgsize = (baddr - curaddr); + } + + /* + * Insert chunk into a segment, coalescing with + * the previous segment if possible. + */ + if (first) { + map->dm_segs[seg].ds_addr = + PHYS_TO_BUS_MEM(t, curaddr); + map->dm_segs[seg].ds_len = sgsize; + first = 0; + } else { + if (curaddr == lastaddr && + (map->dm_segs[seg].ds_len + sgsize) <= + map->dm_maxsegsz && + (map->_dm_boundary == 0 || + (map->dm_segs[seg].ds_addr & bmask) == + (PHYS_TO_BUS_MEM(t, curaddr) & bmask))) +map->dm_segs[seg].ds_len += sgsize; + else { +if (++seg >= map->_dm_segcnt) + break; +map->dm_segs[seg].ds_addr = + PHYS_TO_BUS_MEM(t, curaddr); +map->dm_segs[seg].ds_len = sgsize; + } + } + + lastaddr = curaddr + sgsize; + size -= sgsize; + if ((isgsize -= sgsize) == 0) { + iseg++; + KASSERT(iseg < nsegs); + busaddr = segs[iseg].ds_addr; + isgsize = segs[iseg].ds_len; + } + } + + if (size > 0) + return EFBIG; - panic("_bus_dmamap_load_raw: not implemented"); + return 0; } /*
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: riastradh Date: Wed Feb 16 23:30:52 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: bus_dma.c Log Message: powerpc: Implement bus_dmamap_load_raw. Can probably delete some of the round-trips between bus addresses and physical addresses -- did these only to copy the logic already in _bus_dmamap_load_buffer. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/arch/powerpc/powerpc/bus_dma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Sat Jan 1 01:15:12 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: fixup.c Log Message: more KASSERT vs. DIAGNOSTIC fallout To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/powerpc/fixup.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Sat Jan 1 01:15:12 UTC 2022 Modified Files: src/sys/arch/powerpc/powerpc: fixup.c Log Message: more KASSERT vs. DIAGNOSTIC fallout To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/powerpc/fixup.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/fixup.c diff -u src/sys/arch/powerpc/powerpc/fixup.c:1.12 src/sys/arch/powerpc/powerpc/fixup.c:1.13 --- src/sys/arch/powerpc/powerpc/fixup.c:1.12 Mon Jul 6 10:31:24 2020 +++ src/sys/arch/powerpc/powerpc/fixup.c Sat Jan 1 01:15:11 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: fixup.c,v 1.12 2020/07/06 10:31:24 rin Exp $ */ +/* $NetBSD: fixup.c,v 1.13 2022/01/01 01:15:11 macallan Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fixup.c,v 1.12 2020/07/06 10:31:24 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fixup.c,v 1.13 2022/01/01 01:15:11 macallan Exp $"); #ifdef _KERNEL_OPT #include "opt_ppcarch.h" @@ -186,7 +186,9 @@ powerpc_fixup_stubs(uint32_t *start, uin break; } case OPC_STW: { +#ifdef DIAGNOSTIC KASSERT((i.i_d.i_rs == r_lr || i.i_d.i_rs == 31) && i.i_d.i_ra == 1); +#endif break; } case OPC_STWU: { @@ -195,8 +197,10 @@ powerpc_fixup_stubs(uint32_t *start, uin break; } case OPC_branch_19: { +#ifdef DIAGNOSTIC KASSERT(r_lr == -1 || i.i_int == 0x4e800421); KASSERT(r_lr != -1 || i.i_int == 0x4e800420); +#endif if (ctr == 0) { panic("%s: jump at %p to %p would " "branch to 0", __func__, insnp,
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: msaitoh Date: Wed Nov 10 16:02:49 UTC 2021 Modified Files: src/sys/arch/powerpc/powerpc: db_interface.c Log Message: s/Reseting/Resetting/ To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 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.57 src/sys/arch/powerpc/powerpc/db_interface.c:1.58 --- src/sys/arch/powerpc/powerpc/db_interface.c:1.57 Sat Jul 24 21:31:34 2021 +++ src/sys/arch/powerpc/powerpc/db_interface.c Wed Nov 10 16:02:48 2021 @@ -1,8 +1,8 @@ -/* $NetBSD: db_interface.c,v 1.57 2021/07/24 21:31:34 andvar Exp $ */ +/* $NetBSD: db_interface.c,v 1.58 2021/11/10 16:02:48 msaitoh Exp $ */ /* $OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.57 2021/07/24 21:31:34 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.58 2021/11/10 16:02:48 msaitoh Exp $"); #define USERACC @@ -814,7 +814,7 @@ static void db_ppcbooke_reset(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif) { - printf("Reseting...\n"); + printf("Resetting...\n"); (*cpu_md_ops.md_cpu_reset)(); }
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: msaitoh Date: Wed Nov 10 16:02:49 UTC 2021 Modified Files: src/sys/arch/powerpc/powerpc: db_interface.c Log Message: s/Reseting/Resetting/ To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 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.
Re: CVS commit: src/sys/arch/powerpc/powerpc
On 2020/02/18 6:55, Andrew Doran wrote: I corrected the cpu_ast() case. Yes it's curious why ibm4xx calls mi_userret() directly; that seems wrong (I have not changed it though). I think it definitely makes more sense to deal with OWEUPC before userret(). Thank you! Now, I'm working on fixing ibm4xx. IMO, there's no reason to use mi_userret() here, and I will commit a fix later with other commits. Thanks, rin
Re: CVS commit: src/sys/arch/powerpc/powerpc
On Wed, Feb 05, 2020 at 12:46:57PM +0900, Rin Okuyama wrote: > Hi, > > On 2019/12/06 5:55, Andrew Doran wrote: > > Module Name:src > > Committed By: ad > > Date: Thu Dec 5 20:55:24 UTC 2019 > > > > Modified Files: > > src/sys/arch/powerpc/powerpc: powerpc_machdep.c > > > > Log Message: > > Need to call userret() from cpu_ast(). > > > > > > To generate a diff of this commit: > > cvs rdiff -u -r1.74 -r1.75 src/sys/arch/powerpc/powerpc/powerpc_machdep.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/powerpc_machdep.c > > diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.74 > > src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.75 > > --- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.74 Sat Nov 23 > > 19:40:36 2019 > > +++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c Thu Dec 5 20:55:24 2019 > > @@ -1,4 +1,4 @@ > > -/* $NetBSD: powerpc_machdep.c,v 1.74 2019/11/23 19:40:36 ad Exp $ */ > > +/* $NetBSD: powerpc_machdep.c,v 1.75 2019/12/05 20:55:24 ad Exp $ */ > > /* > >* Copyright (C) 1995, 1996 Wolfgang Solfrank. > > @@ -32,7 +32,7 @@ > >*/ > > #include > > -__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.74 2019/11/23 19:40:36 > > ad Exp $"); > > +__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.75 2019/12/05 20:55:24 > > ad Exp $"); > > #include "opt_altivec.h" > > #include "opt_ddb.h" > > @@ -373,6 +373,8 @@ void > > cpu_ast(struct lwp *l, struct cpu_info *ci) > > { > > l->l_md.md_astpending = 0; /* we are about to do it */ > > + __insn_barrier(); > > + userret(l, l->l_md.md_utf); > > if (l->l_pflag & LP_OWEUPC) { > > l->l_pflag &= ~LP_OWEUPC; > > @@ -400,7 +402,7 @@ cpu_need_resched(struct cpu_info *ci, st > > cpu_send_ipi(cpu_index(ci), IPI_AST); > > #endif > > } else { > > - l->l_md.md_astpending = 1; /* force call to ast() > > */ > > + l->l_md.md_astpending = 1; /* force call to cpu_ast() */ > > } > > } > > > > This commit makes userret() called twice with AST; cpu_ast() is > invoked from > > booke/trap.c, > https://nxr.netbsd.org/xref/src/sys/arch/powerpc/booke/trap.c#815 > > ibm4xx/trap.c, and > https://nxr.netbsd.org/xref/src/sys/arch/powerpc/ibm4xx/trap.c#276 > > powerpc/trap.c. > https://nxr.netbsd.org/xref/src/sys/arch/powerpc/powerpc/trap.c#348 > > For all cases, userret() is called afterward. (Precisely speaking, > for ibm4xx, mi_userret(9) is used instead. This should probably be > replaced by userret().) > > Also, other ports test (l->l_pflag & LP_OWEUPC) before mi_userret(9). I corrected the cpu_ast() case. Yes it's curious why ibm4xx calls mi_userret() directly; that seems wrong (I have not changed it though). I think it definitely makes more sense to deal with OWEUPC before userret(). Andrew > Thanks, > rin
Re: CVS commit: src/sys/arch/powerpc/powerpc
Hi, On 2019/12/06 5:55, Andrew Doran wrote: Module Name:src Committed By: ad Date: Thu Dec 5 20:55:24 UTC 2019 Modified Files: src/sys/arch/powerpc/powerpc: powerpc_machdep.c Log Message: Need to call userret() from cpu_ast(). To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/arch/powerpc/powerpc/powerpc_machdep.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/powerpc_machdep.c diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.74 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.75 --- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.74 Sat Nov 23 19:40:36 2019 +++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c Thu Dec 5 20:55:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: powerpc_machdep.c,v 1.74 2019/11/23 19:40:36 ad Exp $ */ +/* $NetBSD: powerpc_machdep.c,v 1.75 2019/12/05 20:55:24 ad Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.74 2019/11/23 19:40:36 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.75 2019/12/05 20:55:24 ad Exp $"); #include "opt_altivec.h" #include "opt_ddb.h" @@ -373,6 +373,8 @@ void cpu_ast(struct lwp *l, struct cpu_info *ci) { l->l_md.md_astpending = 0; /* we are about to do it */ + __insn_barrier(); + userret(l, l->l_md.md_utf); if (l->l_pflag & LP_OWEUPC) { l->l_pflag &= ~LP_OWEUPC; @@ -400,7 +402,7 @@ cpu_need_resched(struct cpu_info *ci, st cpu_send_ipi(cpu_index(ci), IPI_AST); #endif } else { - l->l_md.md_astpending = 1; /* force call to ast() */ + l->l_md.md_astpending = 1; /* force call to cpu_ast() */ } } This commit makes userret() called twice with AST; cpu_ast() is invoked from booke/trap.c, https://nxr.netbsd.org/xref/src/sys/arch/powerpc/booke/trap.c#815 ibm4xx/trap.c, and https://nxr.netbsd.org/xref/src/sys/arch/powerpc/ibm4xx/trap.c#276 powerpc/trap.c. https://nxr.netbsd.org/xref/src/sys/arch/powerpc/powerpc/trap.c#348 For all cases, userret() is called afterward. (Precisely speaking, for ibm4xx, mi_userret(9) is used instead. This should probably be replaced by userret().) Also, other ports test (l->l_pflag & LP_OWEUPC) before mi_userret(9). Thanks, rin
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Sat Nov 16 00:16:56 UTC 2019 Modified Files: src/sys/arch/powerpc/powerpc: openfirm.c Log Message: fix pasto - don't limit OF_finddevice() to 32 characters now this works again To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/powerpc/openfirm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Sat Nov 16 00:16:56 UTC 2019 Modified Files: src/sys/arch/powerpc/powerpc: openfirm.c Log Message: fix pasto - don't limit OF_finddevice() to 32 characters now this works again To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/powerpc/openfirm.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/openfirm.c diff -u src/sys/arch/powerpc/powerpc/openfirm.c:1.28 src/sys/arch/powerpc/powerpc/openfirm.c:1.29 --- src/sys/arch/powerpc/powerpc/openfirm.c:1.28 Fri Nov 15 23:41:47 2019 +++ src/sys/arch/powerpc/powerpc/openfirm.c Sat Nov 16 00:16:55 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.c,v 1.28 2019/11/15 23:41:47 macallan Exp $ */ +/* $NetBSD: openfirm.c,v 1.29 2019/11/16 00:16:55 macallan Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -34,7 +34,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.28 2019/11/15 23:41:47 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.29 2019/11/16 00:16:55 macallan Exp $"); #include #include @@ -278,7 +278,7 @@ OF_finddevice(const char *name) }; ofw_stack(); - strncpy(OF_buf, name, 32); + strncpy(OF_buf, name, NBPG); args.device = OF_buf; if (openfirmware(&args) == -1) return -1;
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Fri Nov 15 23:41:47 UTC 2019 Modified Files: src/sys/arch/powerpc/powerpc: openfirm.c Log Message: stuff name parameters into OF_buf before calling OF now things like ofctl work on my TiBook with FIRMWORKSBUGS To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/powerpc/openfirm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: macallan Date: Fri Nov 15 23:41:47 UTC 2019 Modified Files: src/sys/arch/powerpc/powerpc: openfirm.c Log Message: stuff name parameters into OF_buf before calling OF now things like ofctl work on my TiBook with FIRMWORKSBUGS To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/powerpc/openfirm.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/openfirm.c diff -u src/sys/arch/powerpc/powerpc/openfirm.c:1.27 src/sys/arch/powerpc/powerpc/openfirm.c:1.28 --- src/sys/arch/powerpc/powerpc/openfirm.c:1.27 Tue Jan 8 07:46:11 2019 +++ src/sys/arch/powerpc/powerpc/openfirm.c Fri Nov 15 23:41:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.c,v 1.27 2019/01/08 07:46:11 mrg Exp $ */ +/* $NetBSD: openfirm.c,v 1.28 2019/11/15 23:41:47 macallan Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -34,7 +34,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.27 2019/01/08 07:46:11 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: openfirm.c,v 1.28 2019/11/15 23:41:47 macallan Exp $"); #include #include @@ -159,8 +159,9 @@ OF_getproplen(int handle, const char *pr }; ofw_stack(); + strncpy(OF_buf, prop, 32); args.phandle = handle; - args.prop = prop; + args.prop = OF_buf; if (openfirmware(&args) == -1) return -1; return args.proplen; @@ -187,16 +188,17 @@ OF_getprop(int handle, const char *prop, ofw_stack(); if (buflen > PAGE_SIZE) return -1; + strncpy(OF_buf, prop, 32); args.phandle = handle; - args.prop = prop; - args.buf = OF_buf; + args.prop = OF_buf; + args.buf = &OF_buf[33]; args.buflen = buflen; if (openfirmware(&args) == -1) return -1; if (args.size > buflen) args.size = buflen; if (args.size > 0) - ofbcopy(OF_buf, buf, args.size); + ofbcopy(&OF_buf[33], buf, args.size); return args.size; } @@ -250,12 +252,13 @@ OF_nextprop(int handle, const char *prop }; ofw_stack(); + strncpy(OF_buf, prop, 32); args.phandle = handle; - args.prop = prop; - args.buf = OF_buf; + args.prop = OF_buf; + args.buf = &OF_buf[33]; if (openfirmware(&args) == -1) return -1; - strncpy(nextprop, OF_buf, 32); + strncpy(nextprop, &OF_buf[33], 32); return args.flag; } @@ -275,7 +278,8 @@ OF_finddevice(const char *name) }; ofw_stack(); - args.device = name; + strncpy(OF_buf, name, 32); + args.device = OF_buf; if (openfirmware(&args) == -1) return -1; return args.phandle;
Re: CVS commit: src/sys/arch/powerpc/powerpc
In article <20140318143431.920a...@cvs.netbsd.org>, Michael Lorenz wrote: >-=-=-=-=-=- > >+#ifdef PPC_OEA601 >+static struct timecounter powerpc_601_timecounter = { >+ get_601_timecount, /* get_timecount */ >+ 0, /* no poll_pps */ >+ 0x7fff, /* counter_mask */ >+ 0, /* frequency */ >+ "rtc", /* name */ >+ 100,/* quality */ >+ NULL, /* tc_priv */ >+ NULL/* tc_next */ >+}; >+#endif >+ > static struct timecounter powerpc_timecounter = { > get_powerpc_timecount, /* get_timecount */ > 0, /* no poll_pps */ > 0x7fff, /* counter_mask */ > 0, /* frequency */ >-#if PPC_OEA601 >- "rtc", /* name */ >-#else > "mftb", /* name */ >-#endif > 100,/* quality */ > NULL, /* tc_priv */ > NULL/* tc_next */ Can we use c99 field initializers here instead of comments?!? christos
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: matt Date: Tue Mar 2 21:53:20 UTC 2010 Modified Files: src/sys/arch/powerpc/powerpc: kgdb_machdep.c Log Message: Add missing to a few files missed on the first pass. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/powerpc/kgdb_machdep.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/kgdb_machdep.c diff -u src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.21 src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.22 --- src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.21 Sun Jan 11 23:20:37 2009 +++ src/sys/arch/powerpc/powerpc/kgdb_machdep.c Tue Mar 2 21:53:20 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kgdb_machdep.c,v 1.21 2009/01/11 23:20:37 cegger Exp $ */ +/* $NetBSD: kgdb_machdep.c,v 1.22 2010/03/02 21:53:20 matt Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.21 2009/01/11 23:20:37 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.22 2010/03/02 21:53:20 matt Exp $"); #include "opt_ddb.h" @@ -54,8 +54,23 @@ #include #include -#include #include +#if defined (PPC_OEA) || defined (PPC_OEA601) || defined (PPC_OEA64_BRIDGE) +#include +#include + +#elif defined (PPC_OEA64) +#include + +#elif defined (PPC_IBM4XX) +#include + +#elif defined (PPC_BOOKE) +#include + +#else +#error unknown architecture +#endif /* * Determine if the memory at va..(va+len) is valid. @@ -66,7 +81,7 @@ vaddr_t last_va; paddr_t pa; u_int msr; -#if !defined (PPC_OEA64) && !defined (PPC_IBM4XX) +#if defined (PPC_OEA) || defined (PPC_OEA601) || defined (PPC_OEA64_BRIDGE) u_int batu, batl; #endif @@ -76,7 +91,7 @@ return 1; } -#if !defined (PPC_OEA64) && !defined (PPC_IBM4XX) +#if defined (PPC_OEA) || defined (PPC_OEA601) || defined (PPC_OEA64_BRIDGE) /* Now check battable registers */ #ifdef PPC_OEA601 if ((mfpvr() >> 16) == MPC601) { @@ -129,7 +144,7 @@ } #endif } -#endif /* !defined (PPC_OEA64) && !defined (PPC_IBM4XX) */ +#endif /* PPC_OEA || PPC_OEA601 || PPC_OEA64_BRIDGE */ #if defined(PPC_IBM4XX) /* Is it (supposed to be) TLB-reserved mapping? */ @@ -163,7 +178,7 @@ kgdb_signal(int type) { switch (type) { -#ifdef PPC_IBM4XX +#if defined (PPC_IBM4XX) || defined (PPC_BOOKE) case EXC_PIT: /* 40x - Programmable interval timer */ case EXC_FIT: /* 40x - Fixed interval timer */ return SIGALRM; @@ -178,7 +193,7 @@ return SIGSEGV; #endif -#if !defined(PPC_OEA64) && !defined (PPC_IBM4XX) +#if defined (PPC_OEA) || defined (PPC_OEA601) || defined (PPC_OEA64_BRIDGE) case EXC_PERF: /* 604/750/7400 - Performance monitoring */ case EXC_BPT: /* 604/750/7400 - Instruction breakpoint */ case EXC_SMI: /* 604/750/7400 - System management interrupt */
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: matt Date: Tue Mar 2 21:53:20 UTC 2010 Modified Files: src/sys/arch/powerpc/powerpc: kgdb_machdep.c Log Message: Add missing to a few files missed on the first pass. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/powerpc/kgdb_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: phx Date: Thu Jan 28 19:01:33 UTC 2010 Modified Files: src/sys/arch/powerpc/powerpc: db_disasm.c Log Message: Fixed some more instructions and their operands. Print the register-indirect operand with displacement in load/store instructions as d(rN). Conditional branches are printed with their simplified mnemonic (i.e. beq instead of bc x,y). Also append the branch-prediction flag +/-i. Print real labels for 16-bit branches instead of just an offset. Use the simplified mnemonic cmpw and cmpd, and much more enhancements... To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/powerpc/db_disasm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: phx Date: Thu Jan 28 12:45:01 UTC 2010 Modified Files: src/sys/arch/powerpc/powerpc: db_disasm.c db_interface.c Log Message: Reverted last commit for db_disasm.c and db_inteface.c. Sorry, erroneously commited them... To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/powerpc/db_disasm.c cvs rdiff -u -r1.41 -r1.42 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.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: phx Date: Thu Jan 28 12:37:45 UTC 2010 Modified Files: src/sys/arch/powerpc/powerpc: db_disasm.c db_interface.c pmap_subr.c Log Message: Fixed typo: PPC_OEA64_BIRDGE -> PPC_OEA64_BRIDGE To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/powerpc/db_disasm.c cvs rdiff -u -r1.40 -r1.41 src/sys/arch/powerpc/powerpc/db_interface.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/powerpc/pmap_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: jmmv Date: Mon Jan 18 23:35:51 UTC 2010 Modified Files: src/sys/arch/powerpc/powerpc: kobj_machdep.c powerpc_machdep.c Log Message: Define kobj_machdep and module_init_md empty functions so that powerpc kernels (at least macppc) with 'options MODULAR' can be built. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/powerpc/kobj_machdep.c cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/powerpc/powerpc_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.