CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: macallan Date: Thu Jul 1 22:57:45 UTC 2021 Modified Files: src/sys/arch/hppa/hppa: intr.c Log Message: fix off by one which resulted in all idle time reported as interrupt time final fix from nick@ To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/intr.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/hppa/hppa/intr.c diff -u src/sys/arch/hppa/hppa/intr.c:1.3 src/sys/arch/hppa/hppa/intr.c:1.4 --- src/sys/arch/hppa/hppa/intr.c:1.3 Sat May 4 13:04:36 2019 +++ src/sys/arch/hppa/hppa/intr.c Thu Jul 1 22:57:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $ */ +/* $NetBSD: intr.c,v 1.4 2021/07/01 22:57:45 macallan Exp $ */ /* $OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $ */ /* @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.4 2021/07/01 22:57:45 macallan Exp $"); #define __MUTEX_PRIVATE @@ -435,7 +435,7 @@ hppa_intr_dispatch(int ncpl, int eiem, s ib->ib_evcnt.ev_count++; arg = ib->ib_arg; if (arg == NULL) { - clkframe.cf_flags = (ci->ci_intr_depth ? + clkframe.cf_flags = (ci->ci_intr_depth > 1 ? TFF_INTR : 0); clkframe.cf_spl = ncpl; if (frame != NULL) {
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: macallan Date: Fri Oct 16 17:50:44 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: mainbus.c Log Message: support *_mmap() To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hppa/hppa/mainbus.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/hppa/hppa/mainbus.c diff -u src/sys/arch/hppa/hppa/mainbus.c:1.4 src/sys/arch/hppa/hppa/mainbus.c:1.5 --- src/sys/arch/hppa/hppa/mainbus.c:1.4 Fri Apr 26 18:37:24 2019 +++ src/sys/arch/hppa/hppa/mainbus.c Fri Oct 16 17:50:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.4 2019/04/26 18:37:24 skrll Exp $ */ +/* $NetBSD: mainbus.c,v 1.5 2020/10/16 17:50:44 macallan Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2019/04/26 18:37:24 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.5 2020/10/16 17:50:44 macallan Exp $"); #include "locators.h" #include "power.h" @@ -354,8 +354,7 @@ mbus_vaddr(void *v, bus_space_handle_t h paddr_t mbus_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags) { - - return -1; + return btop(addr + off); } uint8_t
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Sep 14 16:11:32 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: machdep.c Log Message: -Wno-error=array-bounds (missed from previous commit) To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hppa/hppa/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/hppa/hppa/machdep.c diff -u src/sys/arch/hppa/hppa/machdep.c:1.15 src/sys/arch/hppa/hppa/machdep.c:1.16 --- src/sys/arch/hppa/hppa/machdep.c:1.15 Tue Sep 8 06:13:53 2020 +++ src/sys/arch/hppa/hppa/machdep.c Mon Sep 14 16:11:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.15 2020/09/08 06:13:53 skrll Exp $ */ +/* $NetBSD: machdep.c,v 1.16 2020/09/14 16:11:32 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.15 2020/09/08 06:13:53 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2020/09/14 16:11:32 skrll Exp $"); #include "opt_cputype.h" #include "opt_ddb.h" @@ -489,19 +489,19 @@ hppa_init(paddr_t start, void *bi) DPRINTF(("SPID bits: 0x%x, error = %d\n", pdc_spidbits.spidbits, error)); /* Calculate the OS_HPMC handler checksums. */ - p = _hpmc; + p = os_hpmc; if (pdcproc_instr(p)) *p = 0x08000240; p[7] = ((char *) _hpmc_cont_end) - ((char *) _hpmc_cont); p[6] = (u_int) _hpmc_cont; p[5] = -(p[0] + p[1] + p[2] + p[3] + p[4] + p[6] + p[7]); p = _hpmc_cont; - q = (_hpmc_cont_end - 1); + q = os_hpmc_checksum; for (*q = 0; p < q; *q -= *(p++)); /* Calculate the OS_TOC handler checksum. */ p = (u_int *) _toc; - q = (_toc_end - 1); + q = os_toc_checksum; for (*q = 0; p < q; *q -= *(p++)); /* Install the OS_TOC handler. */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Sep 14 16:11:00 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: machdep.h trap.S Log Message: -Wno-error=array-bounds To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hppa/hppa/machdep.h cvs rdiff -u -r1.72 -r1.73 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/machdep.h diff -u src/sys/arch/hppa/hppa/machdep.h:1.18 src/sys/arch/hppa/hppa/machdep.h:1.19 --- src/sys/arch/hppa/hppa/machdep.h:1.18 Mon Apr 15 20:45:08 2019 +++ src/sys/arch/hppa/hppa/machdep.h Mon Sep 14 16:11:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.h,v 1.18 2019/04/15 20:45:08 skrll Exp $ */ +/* $NetBSD: machdep.h,v 1.19 2020/09/14 16:11:00 skrll Exp $ */ /* * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -95,11 +95,15 @@ void hppa_ktext_stw(vaddr_t, int); void hppa_ktext_stb(vaddr_t, char); /* Machine check handling. */ -extern u_int os_hpmc; +extern u_int os_hpmc[8]; extern u_int os_hpmc_cont; extern u_int os_hpmc_cont_end; +extern u_int os_hpmc_checksum[1]; + int os_toc(void); extern u_int os_toc_end; +extern u_int os_toc_checksum[1]; + void hppa_machine_check(int); /* BTLB handling. */ Index: src/sys/arch/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.72 src/sys/arch/hppa/hppa/trap.S:1.73 --- src/sys/arch/hppa/hppa/trap.S:1.72 Tue Apr 16 07:08:46 2019 +++ src/sys/arch/hppa/hppa/trap.S Mon Sep 14 16:11:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.72 2019/04/16 07:08:46 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.73 2020/09/14 16:11:00 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -841,8 +841,11 @@ L$check_do_rfi: nop nop nop + +ALTENTRY(os_hpmc_checksum) nop ALTENTRY(os_hpmc_cont_end) +ALTENTRY(os_toc_checksum) nop ALTENTRY(os_toc_end) EXIT(TLABEL(hpmc))
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Sep 8 06:13:53 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: machdep.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/hppa/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/hppa/hppa/machdep.c diff -u src/sys/arch/hppa/hppa/machdep.c:1.14 src/sys/arch/hppa/hppa/machdep.c:1.15 --- src/sys/arch/hppa/hppa/machdep.c:1.14 Thu Jun 11 19:20:43 2020 +++ src/sys/arch/hppa/hppa/machdep.c Tue Sep 8 06:13:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.14 2020/06/11 19:20:43 ad Exp $ */ +/* $NetBSD: machdep.c,v 1.15 2020/09/08 06:13:53 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.14 2020/06/11 19:20:43 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.15 2020/09/08 06:13:53 skrll Exp $"); #include "opt_cputype.h" #include "opt_ddb.h" @@ -497,7 +497,7 @@ hppa_init(paddr_t start, void *bi) p[5] = -(p[0] + p[1] + p[2] + p[3] + p[4] + p[6] + p[7]); p = _hpmc_cont; q = (_hpmc_cont_end - 1); - for(*q = 0; p < q; *q -= *(p++)); + for (*q = 0; p < q; *q -= *(p++)); /* Calculate the OS_TOC handler checksum. */ p = (u_int *) _toc;
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Apr 30 06:16:47 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Convert pmap_check_alias into a function that resolves any aliases issues to deal with the locking around entering a mapping of the same page with and alias issue in the same pmap (pmap lock already held in pmap_enter) This has the added benefit of only flushing the troublesome mappings. The locking could be simplified further here and an PV list iterator function with callback is probably useful. To generate a diff of this commit: cvs rdiff -u -r1.111 -r1.112 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.111 src/sys/arch/hppa/hppa/pmap.c:1.112 --- src/sys/arch/hppa/hppa/pmap.c:1.111 Thu Apr 16 09:51:56 2020 +++ src/sys/arch/hppa/hppa/pmap.c Thu Apr 30 06:16:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.111 2020/04/16 09:51:56 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.112 2020/04/30 06:16:47 skrll Exp $ */ /*- * Copyright (c) 2001, 2002, 2020 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.111 2020/04/16 09:51:56 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.112 2020/04/30 06:16:47 skrll Exp $"); #include "opt_cputype.h" @@ -184,7 +184,8 @@ static inline void pmap_pv_unlock(const static inline bool pmap_pv_locked(const struct vm_page_md *md); static inline void pmap_flush_page(struct vm_page *, bool); -static int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t); +static void pmap_resolve_alias(struct vm_page *, struct pmap *, vaddr_t, +pt_entry_t); static void pmap_syncicache_page(struct vm_page *, pmap_t, vaddr_t); static void pmap_page_physload(paddr_t, paddr_t); @@ -537,17 +538,126 @@ pmap_dump_pv(paddr_t pa) } #endif -static int -pmap_check_alias(struct vm_page *pg, vaddr_t va, pt_entry_t pte) +static void +pmap_resolve_alias(struct vm_page *pg, struct pmap *pm, vaddr_t va, +pt_entry_t pte) { - struct vm_page_md * const md = VM_PAGE_TO_MD(pg); - struct pv_entry *pve; - int ret = 0; UVMHIST_FUNC(__func__); - UVMHIST_CALLARGS(maphist, "pg %#jx va %#jx pte %#jx", (uintptr_t)pg, - va, pte, 0); + UVMHIST_CALLARGS(maphist, "pg %#jx pm %#jx va %#jx pte %#jx", + (uintptr_t)pg, (uintptr_t)pm, va, pte); + + struct vm_page_md * const md = VM_PAGE_TO_MD(pg); + struct pv_entry *pve, *npve, **pvp; + + restart: + pmap_pv_lock(md); + pvp = >pvh_list; + for (pve = md->pvh_list; pve; pve = npve) { + const pmap_t ppm = pve->pv_pmap; + const vaddr_t pva = pve->pv_va & PV_VAMASK; + + UVMHIST_LOG(maphist, "... pm %#jx va %#jx", (uintptr_t)ppm, + pva, 0, 0); + + npve = pve->pv_next; + + volatile pt_entry_t *pde; + pt_entry_t ppte; + if (pve->pv_va & PV_KENTER) { + /* Get the pte for this mapping */ + pde = pmap_pde_get(ppm->pm_pdir, pva); + ppte = pmap_pte_get(pde, pva); + } else { + /* + * We have to seamlessly get a hold on the pmap's lock + * while holding the PV head lock, to know that the + * mapping is still in place and we can operate on it. + * If that can't be had, drop the PV head lock, wait + * for the pmap's lock to become available, and then + * try again. + */ + UVMHIST_LOG(maphist, "... pm %#jx va %#jx... checking", + (uintptr_t)ppm, pva, 0, 0); + bool locked = true; + if (pm != ppm) { +pmap_reference(ppm); +locked = pmap_trylock(ppm); + } + + if (!locked) { +pmap_pv_unlock(md); +pmap_lock(ppm); +/* nothing */ +pmap_unlock(ppm); +pmap_destroy(ppm); + +UVMHIST_LOG(maphist, "... failed lock", 0, 0, 0, +0); +goto restart; + } + pde = pmap_pde_get(ppm->pm_pdir, pva); + ppte = pmap_pte_get(pde, pva); + + md->pvh_attrs |= pmap_pvh_attrs(ppte); + } + + const bool writeable = + ((pte | ppte) & PTE_PROT(TLB_WRITE)) != 0; + + if ((va & HPPA_PGAOFF) != (pva & HPPA_PGAOFF) && writeable) { + UVMHIST_LOG(maphist, + "aliased writeable mapping %#jx:%#jx", + ppm->pm_space, pva, 0, 0); + + pmap_pte_flush(ppm, pva, ppte); + if (ppte & PTE_PROT(TLB_WIRED)) +ppm->pm_stats.wired_count--; + ppm->pm_stats.resident_count--; + + if (pve->pv_va & PV_KENTER) { +/* + * This is an unmanaged mapping, it must be + * preserved. Move it back on the list and + * advance the end-of-list pointer. + */ +*pvp = pve; +pvp = >pv_next; + } else { +pmap_pte_set(pde, pva, 0); + +/* Remove pve from list */ +*pvp = npve; + +pmap_pv_unlock(md); +pmap_pv_free(pve); +if (pm != ppm) { + pmap_unlock(ppm); + pmap_destroy(ppm); + +} +UVMHIST_LOG(maphist, "... removed", 0, +0, 0, 0); +goto restart; + } + } else { + UVMHIST_LOG(maphist, "not aliased writeable mapping", +
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Apr 25 08:02:40 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Fix KASSERT that has been incorrect since revision 1.85 from 10 years ago. To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.114 src/sys/arch/hppa/hppa/trap.c:1.115 --- src/sys/arch/hppa/hppa/trap.c:1.114 Fri Dec 6 08:40:33 2019 +++ src/sys/arch/hppa/hppa/trap.c Sat Apr 25 08:02:39 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.114 2019/12/06 08:40:33 skrll Exp $ */ +/* $NetBSD: trap.c,v 1.115 2020/04/25 08:02:39 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.114 2019/12/06 08:40:33 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.115 2020/04/25 08:02:39 skrll Exp $"); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -851,7 +851,7 @@ do_onfault: } /* Never call uvm_fault in interrupt context. */ - KASSERT(curcpu()->ci_cpl == 0); + KASSERT(curcpu()->ci_intr_depth == 0); onfault = pcb->pcb_onfault; pcb->pcb_onfault = 0;
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Apr 16 05:22:59 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: More KNF To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.109 src/sys/arch/hppa/hppa/pmap.c:1.110 --- src/sys/arch/hppa/hppa/pmap.c:1.109 Wed Apr 15 15:50:15 2020 +++ src/sys/arch/hppa/hppa/pmap.c Thu Apr 16 05:22:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.109 2020/04/15 15:50:15 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.110 2020/04/16 05:22:59 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.109 2020/04/15 15:50:15 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.110 2020/04/16 05:22:59 skrll Exp $"); #include "opt_cputype.h" @@ -83,8 +83,8 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1 #include #include #include -#include #include +#include #include #include
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Apr 15 15:22:37 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Spaces to tabs To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.107 src/sys/arch/hppa/hppa/pmap.c:1.108 --- src/sys/arch/hppa/hppa/pmap.c:1.107 Wed Apr 15 09:41:09 2020 +++ src/sys/arch/hppa/hppa/pmap.c Wed Apr 15 15:22:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.107 2020/04/15 09:41:09 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.108 2020/04/15 15:22:37 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.107 2020/04/15 09:41:09 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.108 2020/04/15 15:22:37 skrll Exp $"); #include "opt_cputype.h" @@ -537,13 +537,13 @@ pmap_check_alias(struct vm_page *pg, vad (pte & PTE_PROT(TLB_WRITE))) { DPRINTF(PDB_FOLLOW|PDB_ALIAS, -("%s: aliased writable mapping 0x%x:0x%lx\n", -__func__, pve->pv_pmap->pm_space, pve->pv_va)); + ("%s: aliased writable mapping 0x%x:0x%lx\n", + __func__, pve->pv_pmap->pm_space, pve->pv_va)); ret++; } } -return (ret); + return (ret); } /* @@ -1295,7 +1295,7 @@ pmap_enter(pmap_t pmap, vaddr_t va, padd } panic("%s: no pv entries available", __func__); } -pte |= PTE_PROT(pmap_prot(pmap, prot)); + pte |= PTE_PROT(pmap_prot(pmap, prot)); if (pmap_check_alias(pg, va, pte)) pmap_page_remove(pg); pmap_pv_enter(pg, pve, pmap, va, ptp, 0);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Apr 15 09:41:09 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.106 src/sys/arch/hppa/hppa/pmap.c:1.107 --- src/sys/arch/hppa/hppa/pmap.c:1.106 Wed Apr 15 08:14:22 2020 +++ src/sys/arch/hppa/hppa/pmap.c Wed Apr 15 09:41:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.106 2020/04/15 08:14:22 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.107 2020/04/15 09:41:09 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,27 +65,27 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.106 2020/04/15 08:14:22 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.107 2020/04/15 09:41:09 skrll Exp $"); #include "opt_cputype.h" #include -#include -#include #include +#include #include +#include #include #include -#include -#include #include +#include +#include #include #include #include -#include -#include +#include +#include #include #include
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Apr 15 08:14:22 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: G/C a #include To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.105 src/sys/arch/hppa/hppa/pmap.c:1.106 --- src/sys/arch/hppa/hppa/pmap.c:1.105 Sun Mar 1 21:40:45 2020 +++ src/sys/arch/hppa/hppa/pmap.c Wed Apr 15 08:14:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.105 2020/03/01 21:40:45 ad Exp $ */ +/* $NetBSD: pmap.c,v 1.106 2020/04/15 08:14:22 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,13 +65,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105 2020/03/01 21:40:45 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.106 2020/04/15 08:14:22 skrll Exp $"); #include "opt_cputype.h" #include #include -#include #include #include #include
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: ad Date: Sat Mar 14 16:55:17 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: genassym.cf Log Message: Remove unused RW lock defs. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/genassym.cf 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/hppa/hppa/genassym.cf diff -u src/sys/arch/hppa/hppa/genassym.cf:1.3 src/sys/arch/hppa/hppa/genassym.cf:1.4 --- src/sys/arch/hppa/hppa/genassym.cf:1.3 Thu Feb 20 08:27:38 2020 +++ src/sys/arch/hppa/hppa/genassym.cf Sat Mar 14 16:55:17 2020 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.3 2020/02/20 08:27:38 skrll Exp $ +# $NetBSD: genassym.cf,v 1.4 2020/03/14 16:55:17 ad Exp $ # $OpenBSD: genassym.cf,v 1.18 2001/09/20 18:31:14 mickey Exp $ @@ -38,7 +38,6 @@ include "opt_multiprocessor.h" endif quote #define __MUTEX_PRIVATE -quote #define __RWLOCK_PRIVATE include include @@ -48,7 +47,6 @@ include include include include -include include include @@ -108,15 +106,6 @@ define MTX_LOCK offsetof(struct kmutex, define MTX_OWNER offsetof(struct kmutex, mtx_owner) define MTX_WAITERS offsetof(struct kmutex, mtx_waiters) -define RW_OWNER offsetof(struct krwlock, rw_owner) -define RW_WRITE_LOCKED RW_WRITE_LOCKED -define RW_WRITE_WANTED RW_WRITE_WANTED -define RW_READ_INCR RW_READ_INCR -define RW_HAS_WAITERS RW_HAS_WAITERS -define RW_THREAD RW_THREAD -define RW_READER RW_READER -define RW_WRITER RW_WRITER - # saved state fields struct trapframe member TF_FLAGS tf_flags
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: ad Date: Sun Mar 1 21:40:45 UTC 2020 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Give pmap uvm_objects an empty pagerops to avoid special casing in UVM. (This use of uvm_object causes a disproportionate amount of work.) To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.104 src/sys/arch/hppa/hppa/pmap.c:1.105 --- src/sys/arch/hppa/hppa/pmap.c:1.104 Mon Feb 24 20:42:18 2020 +++ src/sys/arch/hppa/hppa/pmap.c Sun Mar 1 21:40:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.104 2020/02/24 20:42:18 ad Exp $ */ +/* $NetBSD: pmap.c,v 1.105 2020/03/01 21:40:45 ad Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.104 2020/02/24 20:42:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105 2020/03/01 21:40:45 ad Exp $"); #include "opt_cputype.h" @@ -158,6 +158,10 @@ static kmutex_t pmaps_lock; u_int hppa_prot[8]; u_int sid_counter; +static const struct uvm_pagerops pmap_pager = { + /* nothing */ +}; + /* * Page 3-6 of the "PA-RISC 1.1 Architecture and Instruction Set * Reference Manual" (HP part number 09740-90039) defines equivalent @@ -696,7 +700,7 @@ pmap_bootstrap(vaddr_t vstart) memset(kpm, 0, sizeof(*kpm)); rw_init(>pm_obj_lock); - uvm_obj_init(>pm_obj, NULL, false, 1); + uvm_obj_init(>pm_obj, _pager, false, 1); uvm_obj_setlock(>pm_obj, >pm_obj_lock); kpm->pm_space = HPPA_SID_KERNEL; @@ -1059,7 +1063,7 @@ pmap_create(void) DPRINTF(PDB_FOLLOW|PDB_PMAP, ("%s: pmap = %p\n", __func__, pmap)); rw_init(>pm_obj_lock); - uvm_obj_init(>pm_obj, NULL, false, 1); + uvm_obj_init(>pm_obj, _pager, false, 1); uvm_obj_setlock(>pm_obj, >pm_obj_lock); mutex_enter(_lock);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Dec 6 08:40:34 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Simplify userret function signature. From ad@ To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.113 src/sys/arch/hppa/hppa/trap.c:1.114 --- src/sys/arch/hppa/hppa/trap.c:1.113 Fri Nov 29 18:27:32 2019 +++ src/sys/arch/hppa/hppa/trap.c Fri Dec 6 08:40:33 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.113 2019/11/29 18:27:32 ad Exp $ */ +/* $NetBSD: trap.c,v 1.114 2019/12/06 08:40:33 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.113 2019/11/29 18:27:32 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.114 2019/12/06 08:40:33 skrll Exp $"); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -198,9 +198,10 @@ u_int rctr_next_iioq; #endif static inline void -userret(struct lwp *l, register_t pc, u_quad_t oticks) +userret(struct lwp *l, struct trapframe *tf) { struct proc *p = l->l_proc; + int oticks = 0; /* XXX why zero? */ do { l->l_md.md_astpending = 0; @@ -214,7 +215,8 @@ userret(struct lwp *l, register_t pc, u_ if (p->p_stflag & PST_PROFIL) { extern int psratio; - addupc_task(l, pc, (int)(p->p_sticks - oticks) * psratio); + addupc_task(l, tf->tf_iioq_head, + (int)(p->p_sticks - oticks) * psratio); } } @@ -962,7 +964,7 @@ do_onfault: #endif if (type & T_USER) - userret(l, l->l_md.md_regs->tf_iioq_head, 0); + userret(l, l->l_md.md_regs); #ifdef DEBUG frame_sanity_check(__func__, __LINE__, type, frame, l); @@ -979,7 +981,7 @@ md_child_return(struct lwp *l) * Return values in the frame set by cpu_lwp_fork(). */ - userret(l, l->l_md.md_regs->tf_iioq_head, 0); + userret(l, l->l_md.md_regs); #ifdef DEBUG frame_sanity_check(__func__, __LINE__, 0, l->l_md.md_regs, l); #endif /* DEBUG */ @@ -992,7 +994,7 @@ void cpu_spawn_return(struct lwp *l) { - userret(l, l->l_md.md_regs->tf_iioq_head, 0); + userret(l, l->l_md.md_regs); #ifdef DEBUG frame_sanity_check(__func__, __LINE__, 0, l->l_md.md_regs, l); #endif /* DEBUG */ @@ -1264,7 +1266,7 @@ syscall(struct trapframe *frame, int *ar break; } - userret(l, frame->tf_iioq_head, 0); + userret(l, frame); #ifdef DIAGNOSTIC if (ci->ci_cpl != oldcpl) { @@ -1294,5 +1296,5 @@ startlwp(void *arg) KASSERT(error == 0); kmem_free(uc, sizeof(ucontext_t)); - userret(l, l->l_md.md_regs->tf_iioq_head, 0); + userret(l, l->l_md.md_regs); }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat May 4 13:04:36 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: intr.c Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/hppa/intr.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/hppa/hppa/intr.c diff -u src/sys/arch/hppa/hppa/intr.c:1.2 src/sys/arch/hppa/hppa/intr.c:1.3 --- src/sys/arch/hppa/hppa/intr.c:1.2 Mon Apr 15 20:45:08 2019 +++ src/sys/arch/hppa/hppa/intr.c Sat May 4 13:04:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.2 2019/04/15 20:45:08 skrll Exp $ */ +/* $NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $ */ /* $OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $ */ /* @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.2 2019/04/15 20:45:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $"); #define __MUTEX_PRIVATE @@ -502,7 +502,6 @@ hppa_intr_ipending(struct hppa_interrupt } } - return pending; }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Apr 26 18:37:24 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: mainbus.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/mainbus.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/hppa/hppa/mainbus.c diff -u src/sys/arch/hppa/hppa/mainbus.c:1.3 src/sys/arch/hppa/hppa/mainbus.c:1.4 --- src/sys/arch/hppa/hppa/mainbus.c:1.3 Mon Apr 15 20:45:08 2019 +++ src/sys/arch/hppa/hppa/mainbus.c Fri Apr 26 18:37:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.3 2019/04/15 20:45:08 skrll Exp $ */ +/* $NetBSD: mainbus.c,v 1.4 2019/04/26 18:37:24 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2019/04/15 20:45:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2019/04/26 18:37:24 skrll Exp $"); #include "locators.h" #include "power.h" @@ -249,7 +249,7 @@ mbus_map(void *v, bus_addr_t bpa, bus_si */ error = extent_alloc_region(hppa_io_extent, bpa, size, EX_NOWAIT); if (error) - return (error); + return error; /* * Map the region of I/O space. @@ -301,7 +301,7 @@ mbus_alloc(void *v, bus_addr_t rstart, b error = extent_alloc_subregion1(hppa_io_extent, rstart, rend, size, align, 0, boundary, EX_NOWAIT, ); if (error) - return (error); + return error; /* * Map the region of I/O space. @@ -758,7 +758,7 @@ mbus_dmamap_create(void *v, bus_size_t s map = malloc(mapsize, M_DMAMAP, (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK); if (!map) - return (ENOMEM); + return ENOMEM; memset(map, 0, mapsize); map->_dm_size = size; @@ -770,7 +770,7 @@ mbus_dmamap_create(void *v, bus_size_t s map->dm_nsegs = 0; *dmamp = map; - return (0); + return 0; } /* @@ -808,7 +808,7 @@ mbus_dmamap_load(void *v, bus_dmamap_t m map->dm_nsegs = 0; if (buflen > map->_dm_size) - return (EINVAL); + return EINVAL; if (p != NULL) { vm = p->p_vmspace; @@ -823,7 +823,7 @@ mbus_dmamap_load(void *v, bus_dmamap_t m map->dm_mapsize = buflen; map->dm_nsegs = seg + 1; } - return (error); + return error; } /* @@ -846,7 +846,7 @@ mbus_dmamap_load_mbuf(void *v, bus_dmama KASSERT(m0->m_flags & M_PKTHDR); if (m0->m_pkthdr.len > map->_dm_size) - return (EINVAL); + return EINVAL; first = 1; seg = 0; @@ -862,7 +862,7 @@ mbus_dmamap_load_mbuf(void *v, bus_dmama map->dm_mapsize = m0->m_pkthdr.len; map->dm_nsegs = seg + 1; } - return (error); + return error; } /* @@ -908,7 +908,7 @@ mbus_dmamap_load_uio(void *v, bus_dmamap map->dm_mapsize = uio->uio_resid; map->dm_nsegs = seg + 1; } - return (error); + return error; } /* @@ -960,7 +960,7 @@ mbus_dmamap_load_raw(void *v, bus_dmamap map->dm_nsegs = seg + 1; map->dm_mapsize = mapsize; - return (0); + return 0; } /* @@ -1070,7 +1070,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si if ((mlist = malloc(sizeof(*mlist), M_DEVBUF, (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL) - return (ENOMEM); + return ENOMEM; /* * Allocate physical pages from the VM system. @@ -1085,7 +1085,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si " failed", __func__, size, low, high, mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0)); free(mlist, M_DEVBUF); - return (error); + return error; } pa_next = 0; @@ -1097,7 +1097,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si if (++seg >= nsegs) { uvm_pglistfree(mlist); free(mlist, M_DEVBUF); -return (ENOMEM); +return ENOMEM; } segs[seg].ds_addr = pa; segs[seg].ds_len = PAGE_SIZE; @@ -1122,7 +1122,7 @@ mbus_dmamem_alloc(void *v, bus_size_t si * We now have physical pages, but no kernel virtual addresses yet. * These may be allocated in bus_dmamap_map. */ - return (0); + return 0; } void @@ -1161,7 +1161,7 @@ mbus_dmamem_map(void *v, bus_dma_segment /* Get a chunk of kernel virtual space. */ va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); if (__predict_false(va == 0)) - return (ENOMEM); + return ENOMEM; *kvap = (void *)va; @@ -1180,7 +1180,7 @@ mbus_dmamem_map(void *v, bus_dma_segment } } pmap_update(pmap_kernel()); - return (0); + return 0; } /* @@ -1219,11 +1219,11 @@ mbus_dmamem_mmap(void *v, bus_dma_segmen continue; } - return (btop((u_long)segs[i].ds_addr + off)); + return btop((u_long)segs[i].ds_addr + off); } /* Page not found. */ - return (-1); + return -1; } int @@ -1304,8 +1304,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, * Did we fit? */ if (buflen != 0) - return (EFBIG); /* XXX better return value here? */ - return (0); + return EFBIG; /* XXX better return value here? */ + return 0; } const struct hppa_bus_dma_tag hppa_dmatag = { @@ -1476,7 +1476,7 @@
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Apr 17 20:46:38 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: disksubr.c Log Message: Get a large enough buffer for the LIF DIR To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/disksubr.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/hppa/hppa/disksubr.c diff -u src/sys/arch/hppa/hppa/disksubr.c:1.3 src/sys/arch/hppa/hppa/disksubr.c:1.4 --- src/sys/arch/hppa/hppa/disksubr.c:1.3 Wed Apr 3 22:10:50 2019 +++ src/sys/arch/hppa/hppa/disksubr.c Wed Apr 17 20:46:38 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.3 2019/04/03 22:10:50 christos Exp $ */ +/* $NetBSD: disksubr.c,v 1.4 2019/04/17 20:46:38 skrll Exp $ */ /* $OpenBSD: disksubr.c,v 1.6 2000/10/18 21:00:34 mickey Exp $ */ @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.3 2019/04/03 22:10:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.4 2019/04/17 20:46:38 skrll Exp $"); #include #include @@ -228,7 +228,7 @@ readliflabel(struct buf *bp, void (*stra struct buf *dbp; struct hppa_lifdir *p; - dbp = geteblk(HPPA_LIF_DIRSIZE); + dbp = geteblk(lp->d_secsize); dbp->b_dev = bp->b_dev; /* read LIF directory */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Apr 16 20:33:36 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: locore.S Log Message: If arg3 is zero then fill it with the value of 'end'. Helps booting with qemu. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/hppa/locore.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/hppa/hppa/locore.S diff -u src/sys/arch/hppa/hppa/locore.S:1.2 src/sys/arch/hppa/hppa/locore.S:1.3 --- src/sys/arch/hppa/hppa/locore.S:1.2 Mon Apr 15 20:45:08 2019 +++ src/sys/arch/hppa/hppa/locore.S Tue Apr 16 20:33:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.2 2019/04/15 20:45:08 skrll Exp $ */ +/* $NetBSD: locore.S,v 1.3 2019/04/16 20:33:36 skrll Exp $ */ /* $OpenBSD: locore.S,v 1.158 2008/07/28 19:08:46 miod Exp $ */ /* @@ -174,6 +174,14 @@ ENTRY_NOPROFILE(start,0) stw %arg1,R%boothowto(%r1) ldil L%bootdev,%r1 stw %arg2,R%bootdev(%r1) + + comb,<> %r0, %arg3, 1f + nop + + ldil L%end, %arg3 + ldo R%end(%arg3), %arg3 + +1: ldil L%esym,%r1 stw %arg3,R%esym(%r1)
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Apr 16 07:08:46 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Fix a comment To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.71 src/sys/arch/hppa/hppa/trap.S:1.72 --- src/sys/arch/hppa/hppa/trap.S:1.71 Tue Apr 16 06:13:53 2019 +++ src/sys/arch/hppa/hppa/trap.S Tue Apr 16 07:08:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.71 2019/04/16 06:13:53 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.72 2019/04/16 07:08:46 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -908,7 +908,7 @@ hppa_fpu_emulate: /* * The hardware FPU is disabled, so we need to swap in the FPU state of - * the LWP whose uspace physical address in CR_UPADDR. We may also + * the LWP whose uspace physical address in CR_FPPADDR. We may also * need to swap out the FPU state of any LWP whose uspace physical * address is in curcpu()->ci_fpu_state. */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Apr 16 06:13:53 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.70 src/sys/arch/hppa/hppa/trap.S:1.71 --- src/sys/arch/hppa/hppa/trap.S:1.70 Sun Apr 14 08:23:20 2019 +++ src/sys/arch/hppa/hppa/trap.S Tue Apr 16 06:13:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.70 2019/04/14 08:23:20 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.71 2019/04/16 06:13:53 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -899,7 +899,7 @@ LEAF_ENTRY_NOPROFILE(TLABEL(emu)) hppa_fpu_emulate: /* - * We have a hardware FPU. If it is enabled, branch to emulate the + * We have a hardware FPU. If it is enabled, branch to emulate the * instruction. */ mfctl CR_CCR, %arg0
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 15 20:46:10 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: autoconf.c Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/autoconf.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/hppa/hppa/autoconf.c diff -u src/sys/arch/hppa/hppa/autoconf.c:1.3 src/sys/arch/hppa/hppa/autoconf.c:1.4 --- src/sys/arch/hppa/hppa/autoconf.c:1.3 Mon Apr 15 20:45:08 2019 +++ src/sys/arch/hppa/hppa/autoconf.c Mon Apr 15 20:46:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.3 2019/04/15 20:45:08 skrll Exp $ */ +/* $NetBSD: autoconf.c,v 1.4 2019/04/15 20:46:10 skrll Exp $ */ /* $OpenBSD: autoconf.c,v 1.15 2001/06/25 00:43:10 mickey Exp $ */ @@ -86,7 +86,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2019/04/15 20:45:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.4 2019/04/15 20:46:10 skrll Exp $"); #include "opt_kgdb.h" #include "opt_useleds.h" @@ -631,7 +631,6 @@ pdc_scanbus(device_t self, struct confar if (dev) hm->hm_registered = true; - } }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 15 20:45:08 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: autoconf.c copy.S db_machdep.c fpemu.S fpu.c hpt.h idle_machdep.c intr.c ipifuncs.c kgdb_hppa.c lock_stubs.S locore.S machdep.h mainbus.c pim.h sig_machdep.c sigcode.S support.S trap.c Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/hppa/autoconf.c \ src/sys/arch/hppa/hppa/idle_machdep.c src/sys/arch/hppa/hppa/mainbus.c cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hppa/hppa/copy.S cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hppa/hppa/db_machdep.c \ src/sys/arch/hppa/hppa/sigcode.S cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hppa/hppa/fpemu.S \ src/sys/arch/hppa/hppa/support.S cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hppa/hppa/fpu.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/hppa/hpt.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/hppa/intr.c \ src/sys/arch/hppa/hppa/locore.S src/sys/arch/hppa/hppa/pim.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hppa/hppa/ipifuncs.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hppa/hppa/kgdb_hppa.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hppa/hppa/lock_stubs.S \ src/sys/arch/hppa/hppa/sig_machdep.c cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hppa/hppa/machdep.h cvs rdiff -u -r1.110 -r1.111 src/sys/arch/hppa/hppa/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/hppa/hppa/autoconf.c diff -u src/sys/arch/hppa/hppa/autoconf.c:1.2 src/sys/arch/hppa/hppa/autoconf.c:1.3 --- src/sys/arch/hppa/hppa/autoconf.c:1.2 Wed Mar 26 17:57:17 2014 +++ src/sys/arch/hppa/hppa/autoconf.c Mon Apr 15 20:45:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.2 2014/03/26 17:57:17 christos Exp $ */ +/* $NetBSD: autoconf.c,v 1.3 2019/04/15 20:45:08 skrll Exp $ */ /* $OpenBSD: autoconf.c,v 1.15 2001/06/25 00:43:10 mickey Exp $ */ @@ -86,7 +86,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2014/03/26 17:57:17 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2019/04/15 20:45:08 skrll Exp $"); #include "opt_kgdb.h" #include "opt_useleds.h" @@ -271,12 +271,12 @@ hppa_led_blinker(void *arg) /* Set the LEDs. */ hppa_led_ctl(-1, leds, 0); - + /* NB: this assumes _HPPA_LED_FREQ is a power of two. */ led_cycle = (led_cycle + 1) & (_HPPA_LED_FREQ - 1); callout_reset(_led_callout, hz / _HPPA_LED_FREQ, hppa_led_blinker, (void *) led_cycle); - + } #endif /* USELEDS */ @@ -405,7 +405,7 @@ device_register(device_t dev, void *aux) * a ppb. */ struct pci_attach_args *paa = (struct pci_attach_args*)aux; - + if (paa->pa_device == PAGE0->mem_boot.pz_dp.dp_bc[3] && paa->pa_function == PAGE0->mem_boot.pz_dp.dp_bc[4]) { /* @@ -436,7 +436,7 @@ device_register(device_t dev, void *aux) boot_device == device_parent(pdev)) { struct scsipibus_attach_args *saa = aux; struct scsipi_periph *p = saa->sa_periph; - + if (p->periph_target == PAGE0->mem_boot.pz_dp.dp_layers[0] && p->periph_lun == PAGE0->mem_boot.pz_dp.dp_layers[1]) { /* This is the boot device. */ @@ -489,7 +489,7 @@ hppa_walkbus(struct confargs *ca) if (ca->ca_hpabase == 0) return; - + aprint_debug(">> Walking bus at HPA 0x%lx\n", ca->ca_hpabase); for (i = 0; i < ca->ca_nmodules; i++) { @@ -631,7 +631,7 @@ pdc_scanbus(device_t self, struct confar if (dev) hm->hm_registered = true; - + } } @@ -668,7 +668,7 @@ hppa_pdcmodule_create(struct hppa_pdcmod { struct hppa_pdcmodule *nhm, *ahm; int i; - + nhm = kmem_zalloc(sizeof(*nhm), KM_SLEEP); nhm->hm_registered = false; @@ -696,7 +696,7 @@ hppa_pdcmodule_create(struct hppa_pdcmod hm_link) { int check; int j, k; - + for (j = 0; j < 6; j++) { if (ahm->hm_dp.dp_bc[j] != -1) break; @@ -749,7 +749,7 @@ hppa_memmap_query(struct device_path *de int error; error = pdcproc_memmap(_memmap, devp); - + if (error < 0) return NULL; Index: src/sys/arch/hppa/hppa/idle_machdep.c diff -u src/sys/arch/hppa/hppa/idle_machdep.c:1.2 src/sys/arch/hppa/hppa/idle_machdep.c:1.3 --- src/sys/arch/hppa/hppa/idle_machdep.c:1.2 Thu May 17 14:51:19 2007 +++ src/sys/arch/hppa/hppa/idle_machdep.c Mon Apr 15 20:45:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: idle_machdep.c,v 1.2 2007/05/17 14:51:19 yamt Exp $ */ +/* $NetBSD: idle_machdep.c,v 1.3 2019/04/15 20:45:08 skrll Exp $ */ /* * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: idle_machdep.c,v 1.2 2007/05/17 14:51:19 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: idle_machdep.c,v 1.3 2019/04/15 20:45:08 skrll Exp $"); #include #include @@ -36,5 +36,5 @@ __KERNEL_RCSID(0, "$NetBSD: idle_machdep void cpu_idle(void) { - /* do nothing */ + /* do nothing */ } Index: src/sys/arch/hppa/hppa/mainbus.c diff -u
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 15 06:16:42 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: vm_machdep.c Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/arch/hppa/hppa/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/hppa/hppa/vm_machdep.c diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.54 src/sys/arch/hppa/hppa/vm_machdep.c:1.55 --- src/sys/arch/hppa/hppa/vm_machdep.c:1.54 Thu Mar 6 19:02:58 2014 +++ src/sys/arch/hppa/hppa/vm_machdep.c Mon Apr 15 06:16:42 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.54 2014/03/06 19:02:58 skrll Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.55 2019/04/15 06:16:42 skrll Exp $ */ /* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */ @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.54 2014/03/06 19:02:58 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.55 2019/04/15 06:16:42 skrll Exp $"); #include #include @@ -184,7 +184,7 @@ void cpu_lwp_free(struct lwp *l, int proc) { struct pcb *pcb = lwp_getpcb(l); - + /* * If this thread was using the FPU, disable the FPU and record * that it's unused.
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Apr 14 08:23:20 UTC 2019 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.69 src/sys/arch/hppa/hppa/trap.S:1.70 --- src/sys/arch/hppa/hppa/trap.S:1.69 Sat Mar 23 13:05:24 2019 +++ src/sys/arch/hppa/hppa/trap.S Sun Apr 14 08:23:20 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.69 2019/03/23 13:05:24 maxv Exp $ */ +/* $NetBSD: trap.S,v 1.70 2019/04/14 08:23:20 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -98,7 +98,7 @@ #include "opt_multiprocessor.h" #include "opt_cputype.h" -/* +/* * NOTICE: This is not a standalone file. To use it, #include it in * your port's locore.S, like so: * @@ -220,7 +220,7 @@ syscall_entry: ldw CI_PSW(%sr1, %t1), %t1 stw %r1, TF_CR15-TRAPFRAME_SIZEOF(%sr1, %t3) /* eiem ,bc (block copy cache control hint) */ stw %t1, TF_CR22-TRAPFRAME_SIZEOF(%sr1, %t3) /* ipsw */ - + mfsp %sr3, %t1 stw %t1, TF_SR3-TRAPFRAME_SIZEOF(%sr1, %t3) stw %ret0, TF_CR8-TRAPFRAME_SIZEOF(%sr1, %t3) /* pidr1 */ @@ -741,7 +741,7 @@ EXIT(os_toc) ENTRY_NOPROFILE(TLABEL(hpmc),0) ALTENTRY(os_hpmc_cont) ldi T_HPMC, %arg0 - + /* Disable interrupts. */ mtctl %r0, %eiem @@ -865,7 +865,7 @@ LEAF_ENTRY_NOPROFILE(TLABEL(emu)) */ mtctl %arg0, %tr2 mfctl %iir, %arg0 - + /* * If the opcode field in the instruction is 4, indicating a special * function unit SPOP instruction, branch to emulate an sfu. If the @@ -912,7 +912,7 @@ hppa_fpu_emulate: * need to swap out the FPU state of any LWP whose uspace physical * address is in curcpu()->ci_fpu_state. */ - + /* * So far, the CTRAP() macro has saved %r1 in %tr7, and the dispatching * above has saved %arg0 in tr2. Save the other registers that we want @@ -929,7 +929,7 @@ hppa_fpu_emulate: blr 0, %rp b hppa_fpu_swap nop - + /* Restore registers and rfi. */ mfctl %tr5, %rp mfctl %tr4, %arg1 @@ -1015,7 +1015,7 @@ ALTENTRY(hppa_fpu_swap) /* * Assuming that out and in aren't both NULL, we will have to run co- * processor instructions, so we'd better enable it. - * + * * Also, branch if there's no FPU state to swap out. */ mfctl CR_CCR, %r1 @@ -1775,7 +1775,7 @@ EXIT(hpti_l) LEAF_ENTRY_NOPROFILE(pbtlb_l) ; DR_PAGE0 rsm (PSW_R|PSW_I), %t4 - nop ! nop ! nop ! nop + nop ! nop ! nop ! nop ldil L%0xc041, %t1 ldo R%0xc041(%t1), %t1 dep %arg0, 30, 3, %t1
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Nov 14 10:58:04 UTC 2018 Modified Files: src/sys/arch/hppa/hppa: fpu.c machdep.c Log Message: Some fixes for QEMU/hppa. Don't call desidhash_l on pcxl2 as it doesn't support it. QEMU emulates this cpu and would trap on illegal instruction for the diag in desidhash_l Allow a FPU to be missing... more fixes are likely here. QEMU doesn't set C bit properly yet To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hppa/hppa/fpu.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hppa/hppa/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/hppa/hppa/fpu.c diff -u src/sys/arch/hppa/hppa/fpu.c:1.24 src/sys/arch/hppa/hppa/fpu.c:1.25 --- src/sys/arch/hppa/hppa/fpu.c:1.24 Fri Apr 6 12:21:59 2012 +++ src/sys/arch/hppa/hppa/fpu.c Wed Nov 14 10:58:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.24 2012/04/06 12:21:59 skrll Exp $ */ +/* $NetBSD: fpu.c,v 1.25 2018/11/14 10:58:04 skrll Exp $ */ /* * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.24 2012/04/06 12:21:59 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.25 2018/11/14 10:58:04 skrll Exp $"); #include #include @@ -144,6 +144,12 @@ hppa_fpu_bootstrap(u_int ccr_enable) /* See if we have a present and functioning hardware FPU. */ fpu_present = (ccr_enable & HPPA_FPUS) == HPPA_FPUS; + if (!fpu_present) { + fpu_csw = 0; + curcpu()->ci_fpu_state = 0; + + return; + } KASSERT(fpu_present); /* Initialize the FPU and get its version. */ Index: src/sys/arch/hppa/hppa/machdep.c diff -u src/sys/arch/hppa/hppa/machdep.c:1.8 src/sys/arch/hppa/hppa/machdep.c:1.9 --- src/sys/arch/hppa/hppa/machdep.c:1.8 Mon Sep 3 16:29:24 2018 +++ src/sys/arch/hppa/hppa/machdep.c Wed Nov 14 10:58:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.8 2018/09/03 16:29:24 riastradh Exp $ */ +/* $NetBSD: machdep.c,v 1.9 2018/11/14 10:58:04 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.8 2018/09/03 16:29:24 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2018/11/14 10:58:04 skrll Exp $"); #include "opt_cputype.h" #include "opt_ddb.h" @@ -374,7 +374,7 @@ const struct hppa_cpu_info cpu_types[] = { "PA7300LC", "Velociraptor", "PCXL2", hpcxl2, HPPA_CPU_PCXL2, HPPA_FTRS_TLBU | HPPA_FTRS_BTLBU | HPPA_FTRS_HVT, "1.1e", - desidhash_l, itlb_l, dtlb_l, itlbna_l, dtlbna_l, tlbd_l, + NULL, itlb_l, dtlb_l, itlbna_l, dtlbna_l, tlbd_l, ibtlb_g, NULL, pbtlb_g, hpti_g }, #endif #ifdef HP8000_CPU @@ -809,9 +809,6 @@ cpuid(void) if (hppa_cpu_info->hci_chip_name == NULL) panic("bad model string for 0x%x", pdc_model.hwmodel); - else if (hppa_cpu_info->desidhash == NULL) - panic("no kernel support for %s", - hppa_cpu_info->hci_chip_name); /* * TODO: HPT on 7200 is not currently supported @@ -825,7 +822,10 @@ cpuid(void) cpu_hpt_init = hppa_cpu_info->hptinit; cpu_desidhash = hppa_cpu_info->desidhash; - cpu_revision = (*cpu_desidhash)(); + if (cpu_desidhash) + cpu_revision = (*cpu_desidhash)(); + else + cpu_revision = 0; /* force strong ordering for now */ if (hppa_cpu_ispa20_p())
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Feb 21 10:42:16 UTC 2018 Modified Files: src/sys/arch/hppa/hppa: db_disasm.c Log Message: Avoid UB (shift of negative number) To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hppa/hppa/db_disasm.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/hppa/hppa/db_disasm.c diff -u src/sys/arch/hppa/hppa/db_disasm.c:1.16 src/sys/arch/hppa/hppa/db_disasm.c:1.17 --- src/sys/arch/hppa/hppa/db_disasm.c:1.16 Wed Jan 18 09:35:48 2012 +++ src/sys/arch/hppa/hppa/db_disasm.c Wed Feb 21 10:42:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.16 2012/01/18 09:35:48 skrll Exp $ */ +/* $NetBSD: db_disasm.c,v 1.17 2018/02/21 10:42:16 skrll Exp $ */ /* $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $ */ @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.16 2012/01/18 09:35:48 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.17 2018/02/21 10:42:16 skrll Exp $"); #include #include @@ -865,23 +865,23 @@ struct majoropcode { #define Bi2(i) BitfR(i,6,13,_b613) /* fragmented field collating macros */ -#define Ima5(i) (Ima5S(i) ? Ima5M(i) | (-1<<4) : Ima5M(i)) +#define Ima5(i) (Ima5S(i) ? Ima5M(i) | (int)(~__BITS(3,0)) : Ima5M(i)) -#define Imc5(i) (Imc5S(i) ? Imc5M(i) | (-1<<4) : Imc5M(i)) +#define Imc5(i) (Imc5S(i) ? Imc5M(i) | (int)(~__BITS(3,0)) : Imc5M(i)) -#define Disp(i) (DispS(i) ? DispM(i) | (-1<<13) : DispM(i)) +#define Disp(i) (DispS(i) ? DispM(i) | (int)(~__BITS(12,0)) : DispM(i)) #define Im21(i) (Im21S(i) << 31 | Im21H(i) << 20 | Im21M1(i) << 18 | \ Im21M2(i) << 13 | Im21L(i) << 11) -#define Im11(i) (Im11S(i) ? Im11M(i) | (-1<<10) : Im11M(i)) +#define Im11(i) (Im11S(i) ? Im11M(i) | (int)(~__BITS(9,0)) : Im11M(i)) #define Bdisp(i) ((OffS(i) ? (Off5(i)<<11 | Off11L(i)<<10|Off11H(i)) \ -/* branch displacement (bytes) */ | (-1 << 16) \ +/* branch displacement (bytes) */ | (int)(~__BITS(15,0)) \ : (Off5(i)<<11|Off11L(i)<<10|Off11H(i))) << 2) #define Cbdisp(i) ((OffS(i) ? (Off11L(i) << 10 | Off11H(i)) \ - /* compare/branch disp (bytes) */ | (-1 << 11) \ + /* compare/branch disp (bytes) */ | (int)(~__BITS(10,0)) \ :Off11L(i) << 10 | Off11H(i)) << 2) #define Sr(i) (SrH(i)<<2 | SrL(i))
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Apr 2 08:31:10 UTC 2017 Modified Files: src/sys/arch/hppa/hppa: machdep.c Log Message: PR/52129: NetBSD/hppa 7.1 fails to boot on 712/60 Add 712/* models to cpu_model_cpuid To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hppa/hppa/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/hppa/hppa/machdep.c diff -u src/sys/arch/hppa/hppa/machdep.c:1.6 src/sys/arch/hppa/hppa/machdep.c:1.7 --- src/sys/arch/hppa/hppa/machdep.c:1.6 Sun Oct 18 17:13:33 2015 +++ src/sys/arch/hppa/hppa/machdep.c Sun Apr 2 08:31:10 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.6 2015/10/18 17:13:33 maxv Exp $ */ +/* $NetBSD: machdep.c,v 1.7 2017/04/02 08:31:10 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.6 2015/10/18 17:13:33 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2017/04/02 08:31:10 skrll Exp $"); #include "opt_cputype.h" #include "opt_ddb.h" @@ -861,6 +861,9 @@ cpu_model_cpuid(int modelno) case HPPA_BOARD_HPE25: case HPPA_BOARD_HPE35: case HPPA_BOARD_HPE45: + case HPPA_BOARD_HP712_60: + case HPPA_BOARD_HP712_80: + case HPPA_BOARD_HP712_100: case HPPA_BOARD_HP715_80: case HPPA_BOARD_HP715_64: case HPPA_BOARD_HP715_100:
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: martin Date: Mon Mar 2 11:05:12 UTC 2015 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Send SIGBUS when accessing mmap() past end of file (handle EINVAL in fault path). While there, handle ENOMEM as well. To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.106 src/sys/arch/hppa/hppa/trap.c:1.107 --- src/sys/arch/hppa/hppa/trap.c:1.106 Thu Mar 6 19:02:58 2014 +++ src/sys/arch/hppa/hppa/trap.c Mon Mar 2 11:05:12 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.106 2014/03/06 19:02:58 skrll Exp $ */ +/* $NetBSD: trap.c,v 1.107 2015/03/02 11:05:12 martin Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.106 2014/03/06 19:02:58 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.107 2015/03/02 11:05:12 martin Exp $); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -79,6 +79,7 @@ __KERNEL_RCSID(0, $NetBSD: trap.c,v 1.1 #include sys/acct.h #include sys/signal.h #include sys/device.h +#include sys/kauth.h #include sys/kmem.h #include sys/userret.h @@ -881,9 +882,29 @@ do_onfault: user_backtrace(frame, l, type); #endif KSI_INIT_TRAP(ksi); -ksi.ksi_signo = SIGSEGV; -ksi.ksi_code = (ret == EACCES ? - SEGV_ACCERR : SEGV_MAPERR); +switch (ret) { +case EACCES: + ksi.ksi_signo = SIGSEGV; + ksi.ksi_code = SEGV_ACCERR; + break; +case ENOMEM: + ksi.ksi_signo = SIGKILL; + printf(UVM: pid %d (%s), uid %d + killed: out of swap\n, + p-p_pid, p-p_comm, + l-l_cred ? + kauth_cred_geteuid(l-l_cred) + : -1); + break; +case EINVAL: + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_ADRERR; + break; +default: + ksi.ksi_signo = SIGSEGV; + ksi.ksi_code = SEGV_MAPERR; + break; +} ksi.ksi_trap = type; ksi.ksi_addr = (void *)va; trapsignal(l, ksi);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Aug 8 07:30:51 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.98 src/sys/arch/hppa/hppa/pmap.c:1.99 --- src/sys/arch/hppa/hppa/pmap.c:1.98 Tue Feb 28 07:30:30 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Aug 8 07:30:51 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.98 2012/02/28 07:30:30 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.99 2014/08/08 07:30:51 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.98 2012/02/28 07:30:30 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.99 2014/08/08 07:30:51 skrll Exp $); #include opt_cputype.h @@ -157,7 +157,7 @@ u_int hppa_prot[8]; u_int sid_counter; /* - * Page 3-6 of the PA-RISC 1.1 Architecture and Instruction Set + * Page 3-6 of the PA-RISC 1.1 Architecture and Instruction Set * Reference Manual (HP part number 09740-90039) defines equivalent * and non-equivalent virtual addresses in the cache. * @@ -438,7 +438,7 @@ pmap_pte_flush(pmap_t pmap, vaddr_t va, if (pmap_hpt) { struct hpt_entry *hpt; hpt = pmap_hash(pmap, va); - if (hpt-hpt_valid + if (hpt-hpt_valid hpt-hpt_space == pmap-pm_space hpt-hpt_vpn == ((va 1) 0x7fff)) hpt-hpt_space = 0x; @@ -802,13 +802,13 @@ pmap_bootstrap(vaddr_t vstart) /* * The kernel text, data, and bss must be direct-mapped, - * because the kernel often runs in physical mode, and - * anyways the loader loaded the kernel into physical + * because the kernel often runs in physical mode, and + * anyways the loader loaded the kernel into physical * memory exactly where it was linked. * * All memory already allocated after bss, either by * our caller or by this function itself, must also be - * direct-mapped, because it's completely unmanaged + * direct-mapped, because it's completely unmanaged * and was allocated in physical mode. * * BTLB entries are used to do this direct mapping. @@ -869,7 +869,7 @@ pmap_bootstrap(vaddr_t vstart) /* Coalesce BTLB entries whenever possible. */ while (btlb_j 0 - btlb_entry_vm_prot[btlb_j] == + btlb_entry_vm_prot[btlb_j] == btlb_entry_vm_prot[btlb_j - 1] btlb_entry_size[btlb_j] == btlb_entry_size[btlb_j - 1] @@ -912,14 +912,14 @@ pmap_bootstrap(vaddr_t vstart) size = 1; btlb_entry_start[btlb_j] = addr; btlb_entry_size[btlb_j] = size; - btlb_entry_vm_prot[btlb_j] = + btlb_entry_vm_prot[btlb_j] = VM_PROT_READ | VM_PROT_WRITE; /* Move on. */ addr = btlb_entry_start[btlb_j] + btlb_entry_size[btlb_j]; btlb_j++; - } + } /* Now insert all of the BTLB entries. */ for (btlb_i = 0; btlb_i btlb_j; btlb_i++) { @@ -1029,7 +1029,7 @@ pmap_init(void) DPRINTF(PDB_FOLLOW|PDB_INIT, (%s(): done\n, __func__)); } -/* +/* * How much virtual space does this kernel have? */ void @@ -1536,7 +1536,7 @@ pmap_changebit(struct vm_page *pg, u_int struct pv_entry *pve; int res; - DPRINTF(PDB_FOLLOW|PDB_BITS, + DPRINTF(PDB_FOLLOW|PDB_BITS, (%s(%p, %x, %x)\n, __func__, pg, set, clear)); KASSERT((set clear) == 0);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri May 23 08:17:08 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: ipifuncs.c Log Message: Make this compile. Hi rmind! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/ipifuncs.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/hppa/hppa/ipifuncs.c diff -u src/sys/arch/hppa/hppa/ipifuncs.c:1.3 src/sys/arch/hppa/hppa/ipifuncs.c:1.4 --- src/sys/arch/hppa/hppa/ipifuncs.c:1.3 Mon May 19 22:47:53 2014 +++ src/sys/arch/hppa/hppa/ipifuncs.c Fri May 23 08:17:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ipifuncs.c,v 1.3 2014/05/19 22:47:53 rmind Exp $ */ +/* $NetBSD: ipifuncs.c,v 1.4 2014/05/23 08:17:08 skrll Exp $ */ /* $OpenBSD: ipi.c,v 1.4 2011/01/14 13:20:06 jsing Exp $ */ /* @@ -166,7 +166,7 @@ xc_send_ipi(struct cpu_info *ci) } void -cpu_ipi(struct cpu_info *) +cpu_ipi(struct cpu_info *ci) { KASSERT(kpreempt_disabled()); KASSERT(curcpu() != ci);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Mar 6 17:44:49 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: copy.S Log Message: Remove unnecessary %sr2 instructions in spstrcpy To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hppa/hppa/copy.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/hppa/hppa/copy.S diff -u src/sys/arch/hppa/hppa/copy.S:1.19 src/sys/arch/hppa/hppa/copy.S:1.20 --- src/sys/arch/hppa/hppa/copy.S:1.19 Sat Oct 1 15:50:46 2011 +++ src/sys/arch/hppa/hppa/copy.S Thu Mar 6 17:44:49 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: copy.S,v 1.19 2011/10/01 15:50:46 chs Exp $ */ +/* $NetBSD: copy.S,v 1.20 2014/03/06 17:44:49 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -156,7 +156,6 @@ LEAF_ENTRY(spstrcpy) stw %t2, PCB_ONFAULT(%r31) ldw HPPA_FRAME_ARG(4)(%sp), %ret1 /* size */ - mfsp %sr2, %ret0 /* XXX need this? */ mtsp %arg0, %sr1 mtsp %arg2, %sr2 copy %arg1, %arg0 /* save src */ @@ -175,7 +174,6 @@ L$spstrcpy_exit: L$spstrcpy_fault: /* reset fault handler */ stw %r0, PCB_ONFAULT(%r31) - mtsp %r0, %sr2 /* XXX need this? */ sub %arg1, %arg0, %arg1 ldw HPPA_FRAME_ARG(5)(%sp), %arg0 /* rsize */ comiclr,= 0, %arg0, %r0
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Mar 6 17:47:28 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: copy.S Log Message: Use %t2 instead of %ret1 for style sake only. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hppa/hppa/copy.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/hppa/hppa/copy.S diff -u src/sys/arch/hppa/hppa/copy.S:1.20 src/sys/arch/hppa/hppa/copy.S:1.21 --- src/sys/arch/hppa/hppa/copy.S:1.20 Thu Mar 6 17:44:49 2014 +++ src/sys/arch/hppa/hppa/copy.S Thu Mar 6 17:47:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: copy.S,v 1.20 2014/03/06 17:44:49 skrll Exp $ */ +/* $NetBSD: copy.S,v 1.21 2014/03/06 17:47:28 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -155,17 +155,17 @@ LEAF_ENTRY(spstrcpy) ldo R%L$spstrcpy_fault(%t2), %t2 stw %t2, PCB_ONFAULT(%r31) - ldw HPPA_FRAME_ARG(4)(%sp), %ret1 /* size */ + ldw HPPA_FRAME_ARG(4)(%sp), %t2 /* size */ mtsp %arg0, %sr1 mtsp %arg2, %sr2 copy %arg1, %arg0 /* save src */ L$spstrcpy_loop: - comb,=,n %r0, %ret1, L$spstrcpy_exit + comb,=,n %r0, %t2, L$spstrcpy_exit ldbs,ma 1(%sr1, %arg1), %t1 stbs,ma %t1, 1(%sr2, %arg3) comb, %r0, %t1, L$spstrcpy_loop - ldo -1(%ret1), %ret1 + ldo -1(%t2), %t2 L$spstrcpy_exit: comiclr,= 0, %t1, %ret0
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Mar 6 17:48:09 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: copy.S Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hppa/hppa/copy.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/hppa/hppa/copy.S diff -u src/sys/arch/hppa/hppa/copy.S:1.21 src/sys/arch/hppa/hppa/copy.S:1.22 --- src/sys/arch/hppa/hppa/copy.S:1.21 Thu Mar 6 17:47:28 2014 +++ src/sys/arch/hppa/hppa/copy.S Thu Mar 6 17:48:09 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: copy.S,v 1.21 2014/03/06 17:47:28 skrll Exp $ */ +/* $NetBSD: copy.S,v 1.22 2014/03/06 17:48:09 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -158,7 +158,7 @@ LEAF_ENTRY(spstrcpy) ldw HPPA_FRAME_ARG(4)(%sp), %t2 /* size */ mtsp %arg0, %sr1 mtsp %arg2, %sr2 - copy %arg1, %arg0 /* save src */ + copy %arg1, %arg0 /* save src */ L$spstrcpy_loop: comb,=,n %r0, %t2, L$spstrcpy_exit
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Feb 13 11:08:46 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: vm_machdep.c Log Message: Slight code re-arrangement. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/arch/hppa/hppa/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/hppa/hppa/vm_machdep.c diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.52 src/sys/arch/hppa/hppa/vm_machdep.c:1.53 --- src/sys/arch/hppa/hppa/vm_machdep.c:1.52 Wed Mar 7 22:10:50 2012 +++ src/sys/arch/hppa/hppa/vm_machdep.c Thu Feb 13 11:08:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.52 2012/03/07 22:10:50 skrll Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.53 2014/02/13 11:08:46 skrll Exp $ */ /* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.52 2012/03/07 22:10:50 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.53 2014/02/13 11:08:46 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -116,7 +116,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp uv = uvm_lwp_getuarea(l2); sp = (register_t)uv + PAGE_SIZE; - l2-l_md.md_regs = tf = (struct trapframe *)sp; + tf = l2-l_md.md_regs = (struct trapframe *)sp; sp += sizeof(struct trapframe); /* copy the l1's trapframe to l2 */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Feb 13 15:04:18 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Simplify cpu_spawn_return - setregs has done all the work already. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.104 src/sys/arch/hppa/hppa/trap.c:1.105 --- src/sys/arch/hppa/hppa/trap.c:1.104 Fri Oct 25 09:46:10 2013 +++ src/sys/arch/hppa/hppa/trap.c Thu Feb 13 15:04:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.104 2013/10/25 09:46:10 martin Exp $ */ +/* $NetBSD: trap.c,v 1.105 2014/02/13 15:04:18 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.104 2013/10/25 09:46:10 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.105 2014/02/13 15:04:18 skrll Exp $); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -983,27 +983,6 @@ child_return(void *arg) void cpu_spawn_return(struct lwp *l) { - struct proc *p = l-l_proc; - pmap_t pmap = p-p_vmspace-vm_map.pmap; - pa_space_t space = pmap-pm_space; - struct trapframe *tf = l-l_md.md_regs; - - /* Load all of the user's space registers. */ - tf-tf_sr0 = tf-tf_sr1 = tf-tf_sr3 = tf-tf_sr2 = - tf-tf_sr4 = tf-tf_sr5 = tf-tf_sr6 = space; - tf-tf_iisq_head = tf-tf_iisq_tail = space; - - /* Load the protection registers */ - tf-tf_pidr1 = tf-tf_pidr2 = pmap-pm_pid; - - /* - * theoretically these could be inherited from the father, - * but just in case. - */ - tf-tf_sr7 = HPPA_SID_KERNEL; - mfctl(CR_EIEM, tf-tf_eiem); - tf-tf_ipsw = PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I /* | PSW_L */ | - (curcpu()-ci_psw PSW_O); userret(l, l-l_md.md_regs-tf_iioq_head, 0); #ifdef DEBUG
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Feb 1 08:05:51 UTC 2014 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Deal with unaligned DIR32 relocs as found in debug information. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.13 src/sys/arch/hppa/hppa/kobj_machdep.c:1.14 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.13 Sat Nov 16 17:18:42 2013 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Sat Feb 1 08:05:51 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.13 2013/11/16 17:18:42 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.14 2014/02/01 08:05:51 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.13 2013/11/16 17:18:42 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.14 2014/02/01 08:05:51 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -97,6 +97,35 @@ RR(unsigned int x, unsigned int constant return R(x + RND(constant)) + (constant - RND(constant)); } +/* + * It is possible for the compiler to emit relocations for unaligned data. + * We handle this situation with these inlines. + */ +#define RELOC_ALIGNED_P(x) \ + (((uintptr_t)(x) (sizeof(void *) - 1)) == 0) + +static inline Elf_Addr +load_ptr(void *where) +{ + if (__predict_true(RELOC_ALIGNED_P(where))) + return *(Elf_Addr *)where; + else { + Elf_Addr res; + + (void)memcpy(res, where, sizeof(res)); + return res; + } +} + +static inline void +store_ptr(void *where, Elf_Addr val) +{ + if (__predict_true(RELOC_ALIGNED_P(where))) + *(Elf_Addr *)where = val; + else + (void)memcpy(where, val, sizeof(val)); +} + int kobj_reloc(kobj_t ko, uintptr_t relocbase, const void *data, bool isrela, bool local) @@ -185,7 +214,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas case R_TYPE(PCREL32): case R_TYPE(PLABEL32): case R_TYPE(SEGREL32): - *where = value; + store_ptr(where, value); break; case R_TYPE(DIR14R):
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Nov 16 17:18:42 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Support PCREL32 (for EH sections) To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.12 src/sys/arch/hppa/hppa/kobj_machdep.c:1.13 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.12 Fri Nov 15 06:32:17 2013 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Sat Nov 16 17:18:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.12 2013/11/15 06:32:17 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.13 2013/11/16 17:18:42 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.12 2013/11/15 06:32:17 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.13 2013/11/16 17:18:42 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -143,6 +143,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas value = RR(addr, value); break; + case R_TYPE(PCREL32): case R_TYPE(PCREL17F): /* symbol - PC - 8 + addend */ addr = kobj_sym_lookup(ko, symidx); @@ -181,6 +182,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas switch (rtype) { case R_TYPE(DIR32): + case R_TYPE(PCREL32): case R_TYPE(PLABEL32): case R_TYPE(SEGREL32): *where = value;
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Nov 15 06:32:17 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Simplify To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.11 src/sys/arch/hppa/hppa/kobj_machdep.c:1.12 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.11 Tue Aug 6 07:10:52 2013 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Fri Nov 15 06:32:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.11 2013/08/06 07:10:52 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.12 2013/11/15 06:32:17 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.11 2013/08/06 07:10:52 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.12 2013/11/15 06:32:17 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -137,12 +137,6 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas break; case R_TYPE(DIR17R): - /* RR(symbol, addend) */ - addr = kobj_sym_lookup(ko, symidx); - value = RR(addr, value); - value = 2; /* bottom two bits not needed */ - break; - case R_TYPE(DIR14R): /* RR(symbol, addend) */ addr = kobj_sym_lookup(ko, symidx); @@ -153,7 +147,6 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas /* symbol - PC - 8 + addend */ addr = kobj_sym_lookup(ko, symidx); value += addr - (Elf_Word)where - 8; - value = 2; /* bottom two bits not needed */ break; case R_TYPE(DPREL21L): @@ -202,6 +195,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas case R_TYPE(DIR17R): case R_TYPE(PCREL17F): + value = 2; /* bottom two bits not needed */ *where |= (((value 0x1) 16) 0) | /* w */ (((value 0x0f800) 11) 16) | /* w1 */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Oct 19 14:03:04 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: db_trace.c Log Message: #if 0 some unsed code which should probably be finished. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/hppa/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/hppa/hppa/db_trace.c diff -u src/sys/arch/hppa/hppa/db_trace.c:1.12 src/sys/arch/hppa/hppa/db_trace.c:1.13 --- src/sys/arch/hppa/hppa/db_trace.c:1.12 Wed Jan 18 09:35:48 2012 +++ src/sys/arch/hppa/hppa/db_trace.c Sat Oct 19 14:03:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: db_trace.c,v 1.12 2012/01/18 09:35:48 skrll Exp $ */ +/* $NetBSD: db_trace.c,v 1.13 2013/10/19 14:03:04 skrll Exp $ */ /* $OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.12 2012/01/18 09:35:48 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.13 2013/10/19 14:03:04 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -47,7 +47,9 @@ db_stack_trace_print(db_expr_t addr, boo const char *modif, void (*pr)(const char *, ...)) { register_t *fp, pc, rp; +#if 0 bool kernel_only = true; +#endif bool trace_thread = false; bool lwpaddr = false; db_sym_t sym; @@ -66,8 +68,10 @@ db_stack_trace_print(db_expr_t addr, boo } if (c == 't') trace_thread = true; +#if 0 if (c == 'u') kernel_only = false; +#endif } if (!have_addr) {
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Oct 19 14:02:29 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Use __unused on a variable used in a KASSERT To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.102 src/sys/arch/hppa/hppa/trap.c:1.103 --- src/sys/arch/hppa/hppa/trap.c:1.102 Sat Jul 13 10:29:37 2013 +++ src/sys/arch/hppa/hppa/trap.c Sat Oct 19 14:02:29 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.102 2013/07/13 10:29:37 skrll Exp $ */ +/* $NetBSD: trap.c,v 1.103 2013/10/19 14:02:29 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.102 2013/07/13 10:29:37 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.103 2013/10/19 14:02:29 skrll Exp $); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -1301,7 +1301,7 @@ startlwp(void *arg) { ucontext_t *uc = arg; lwp_t *l = curlwp; - int error; + int error __unused; error = cpu_setmcontext(l, uc-uc_mcontext, uc-uc_flags); KASSERT(error == 0);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Aug 6 06:40:43 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Re-order relocation in switch statement. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.7 src/sys/arch/hppa/hppa/kobj_machdep.c:1.8 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.7 Fri Jan 6 09:09:25 2012 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Tue Aug 6 06:40:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.7 2012/01/06 09:09:25 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.7 2012/01/06 09:09:25 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -132,22 +132,6 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas *where = value; break; - case R_TYPE(PLABEL32): - /* fptr(symbol) */ - addr = kobj_sym_lookup(ko, symidx); - if (*where != addr) - *where = addr; - break; - - case R_TYPE(DIR14R): - /* RR(symbol, addend) */ - addr = kobj_sym_lookup(ko, symidx); - value = RR(addr, value); - *where |= - (((value 0) 0x1fff) 1) | - (((value 13) 0x1) 0); - break; - case R_TYPE(DIR21L): /* LR(symbol, addend) */ addr = kobj_sym_lookup(ko, symidx); @@ -160,6 +144,15 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas (((value 11) 0x003) 12); break; + case R_TYPE(DIR14R): + /* RR(symbol, addend) */ + addr = kobj_sym_lookup(ko, symidx); + value = RR(addr, value); + *where |= + (((value 0) 0x1fff) 1) | + (((value 13) 0x1) 0); + break; + case R_TYPE(PCREL17F): /* symbol - PC - 8 + addend */ addr = kobj_sym_lookup(ko, symidx); @@ -173,6 +166,18 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas (((value 0x003ff) 1) 2); /* w2 */ break; + case R_TYPE(DPREL21L): + /* LR(symbol - GP, addend) */ + addr = kobj_sym_lookup(ko, symidx); + value = LR(addr - GP, value); + *where |= + (((value 31) 0x001) 0) | + (((value 20) 0x7ff) 1) | + (((value 18) 0x003) 14) | + (((value 13) 0x01f) 16) | + (((value 11) 0x003) 12); + break; + case R_TYPE(DPREL14R): /* RR(symbol - GP, addend) */ addr = kobj_sym_lookup(ko, symidx); @@ -183,16 +188,11 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas break; - case R_TYPE(DPREL21L): - /* LR(symbol - GP, addend) */ + case R_TYPE(PLABEL32): + /* fptr(symbol) */ addr = kobj_sym_lookup(ko, symidx); - value = LR(addr - GP, value); - *where |= - (((value 31) 0x001) 0) | - (((value 20) 0x7ff) 1) | - (((value 18) 0x003) 14) | - (((value 13) 0x01f) 16) | - (((value 11) 0x003) 12); + if (*where != addr) + *where = addr; break; case R_TYPE(SEGREL32):
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Aug 6 07:07:53 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Split the reloc evaluation from the value encoding part. Several relocs can share the value encoding part. Fixes the SEGREL32 relocs while here. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.8 src/sys/arch/hppa/hppa/kobj_machdep.c:1.9 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.8 Tue Aug 6 06:40:43 2013 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Tue Aug 6 07:07:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.8 2013/08/06 06:40:43 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -128,29 +128,18 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas /* symbol + addend */ addr = kobj_sym_lookup(ko, symidx); value += addr; - if (*where != value) - *where = value; break; case R_TYPE(DIR21L): /* LR(symbol, addend) */ addr = kobj_sym_lookup(ko, symidx); value = LR(addr, value); - *where |= - (((value 31) 0x001) 0) | - (((value 20) 0x7ff) 1) | - (((value 18) 0x003) 14) | - (((value 13) 0x01f) 16) | - (((value 11) 0x003) 12); break; case R_TYPE(DIR14R): /* RR(symbol, addend) */ addr = kobj_sym_lookup(ko, symidx); value = RR(addr, value); - *where |= - (((value 0) 0x1fff) 1) | - (((value 13) 0x1) 0); break; case R_TYPE(PCREL17F): @@ -158,41 +147,24 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas addr = kobj_sym_lookup(ko, symidx); value += addr - (Elf_Word)where - 8; value = 2; /* bottom two bits not needed */ - - *where |= - (((value 0x1) 16) 0) | /* w */ - (((value 0x0f800) 11) 16) | /* w1 */ - (((value 0x00400) 10) 2) | - (((value 0x003ff) 1) 2); /* w2 */ break; case R_TYPE(DPREL21L): /* LR(symbol - GP, addend) */ addr = kobj_sym_lookup(ko, symidx); value = LR(addr - GP, value); - *where |= - (((value 31) 0x001) 0) | - (((value 20) 0x7ff) 1) | - (((value 18) 0x003) 14) | - (((value 13) 0x01f) 16) | - (((value 11) 0x003) 12); break; case R_TYPE(DPREL14R): /* RR(symbol - GP, addend) */ addr = kobj_sym_lookup(ko, symidx); value = RR(addr - GP, value); - *where |= - (((value 0) 0x1fff) 1) | - (((value 13) 0x1) 0); break; - case R_TYPE(PLABEL32): /* fptr(symbol) */ addr = kobj_sym_lookup(ko, symidx); - if (*where != addr) - *where = addr; + value = addr; break; case R_TYPE(SEGREL32): @@ -200,14 +172,48 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas /* XXX SB */ addr = kobj_sym_lookup(ko, symidx); value += addr; - if (*where != addr) - *where = addr; break; default: printf(%s: unexpected relocation type %d\n, __func__, rtype); return -1; } + + switch (rtype) { + case R_TYPE(DIR32): + case R_TYPE(PLABEL32): + case R_TYPE(SEGREL32): + *where = value; + break; + + case R_TYPE(DIR14R): + case R_TYPE(DPREL14R): + *where |= + (((value 0) 0x1fff) 1) | + (((value 13) 0x1) 0); + break; + + case R_TYPE(PCREL17F): + *where |= + (((value 0x1) 16) 0) | /* w */ + (((value 0x0f800) 11) 16) | /* w1 */ + (((value 0x00400) 10) 2) | + (((value 0x003ff) 1) 2); /* w2 */ + break; + + case R_TYPE(DIR21L): + case R_TYPE(DPREL21L): + *where |= + (((value 31) 0x001) 0) | + (((value 20) 0x7ff) 1) | + (((value 18) 0x003) 14) | + (((value 13) 0x01f) 16) | + (((value 11) 0x003) 12); + break; + } + + + return 0; }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Aug 6 07:10:04 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Implement DIR17R. All the module tests pass now. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.9 src/sys/arch/hppa/hppa/kobj_machdep.c:1.10 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.9 Tue Aug 6 07:07:53 2013 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Tue Aug 6 07:10:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.9 2013/08/06 07:07:53 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -136,6 +136,13 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas value = LR(addr, value); break; + case R_TYPE(DIR17R): + /* RR(symbol, addend) */ + addr = kobj_sym_lookup(ko, symidx); + value = RR(addr, value); + value = 2; /* bottom two bits not needed */ + break; + case R_TYPE(DIR14R): /* RR(symbol, addend) */ addr = kobj_sym_lookup(ko, symidx); @@ -193,6 +200,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas (((value 13) 0x1) 0); break; + case R_TYPE(DIR17R): case R_TYPE(PCREL17F): *where |= (((value 0x1) 16) 0) | /* w */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Aug 6 07:10:52 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.10 src/sys/arch/hppa/hppa/kobj_machdep.c:1.11 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.10 Tue Aug 6 07:10:04 2013 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Tue Aug 6 07:10:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.11 2013/08/06 07:10:52 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.10 2013/08/06 07:10:04 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.11 2013/08/06 07:10:52 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -220,8 +220,6 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas break; } - - return 0; }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Jul 13 10:29:37 UTC 2013 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Use sy_invoke To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.101 src/sys/arch/hppa/hppa/trap.c:1.102 --- src/sys/arch/hppa/hppa/trap.c:1.101 Mon Apr 23 11:25:03 2012 +++ src/sys/arch/hppa/hppa/trap.c Sat Jul 13 10:29:37 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.101 2012/04/23 11:25:03 skrll Exp $ */ +/* $NetBSD: trap.c,v 1.102 2013/07/13 10:29:37 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.101 2012/04/23 11:25:03 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.102 2013/07/13 10:29:37 skrll Exp $); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -1237,17 +1237,8 @@ syscall(struct trapframe *frame, int *ar } #endif - error = 0; - if (__predict_false(p-p_trace_enabled)) { - error = trace_enter(code, args, callp-sy_narg); - if (error) - goto out; - } + error = sy_invoke(callp, l, args, rval, code); - rval[0] = 0; - rval[1] = 0; - error = sy_call(callp, l, args, rval); -out: switch (error) { case 0: l = curlwp; /* changes on exec() */ @@ -1286,9 +1277,6 @@ out: break; } - if (__predict_false(p-p_trace_enabled)) - trace_exit(code, rval, error); - userret(l, frame-tf_iioq_head, 0); #ifdef DIAGNOSTIC
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 23 11:25:03 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Pass the trap address in ksi_addr without privilege bits. Previously GDB would get confused by the trap address given when hitting the _rtld_debug_state breakpoint. To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.100 src/sys/arch/hppa/hppa/trap.c:1.101 --- src/sys/arch/hppa/hppa/trap.c:1.100 Fri Apr 6 12:21:59 2012 +++ src/sys/arch/hppa/hppa/trap.c Mon Apr 23 11:25:03 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.100 2012/04/06 12:21:59 skrll Exp $ */ +/* $NetBSD: trap.c,v 1.101 2012/04/23 11:25:03 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.100 2012/04/06 12:21:59 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.101 2012/04/23 11:25:03 skrll Exp $); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -685,7 +685,7 @@ do_onfault: ksi.ksi_signo = SIGTRAP; ksi.ksi_code = TRAP_TRACE; ksi.ksi_trap = trapnum; - ksi.ksi_addr = (void *)frame-tf_iioq_head; + ksi.ksi_addr = (void *)(frame-tf_iioq_head ~HPPA_PC_PRIV_MASK); #ifdef PTRACE ss_clear_breakpoints(l); if (opcode == SSBREAKPOINT) @@ -693,7 +693,6 @@ do_onfault: #endif /* pass to user debugger */ trapsignal(l, ksi); - break; #ifdef PTRACE @@ -704,7 +703,7 @@ do_onfault: ksi.ksi_signo = SIGTRAP; ksi.ksi_code = TRAP_TRACE; ksi.ksi_trap = trapnum; - ksi.ksi_addr = (void *)frame-tf_iioq_head; + ksi.ksi_addr = (void *)(frame-tf_iioq_head ~HPPA_PC_PRIV_MASK); /* pass to user debugger */ trapsignal(l, ksi);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Apr 6 13:09:32 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Remove unnecessary cache flushes. FP regs are stored in memory from a pool which is direct mapped and therefore available in virtual and physical modes. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.66 src/sys/arch/hppa/hppa/trap.S:1.67 --- src/sys/arch/hppa/hppa/trap.S:1.66 Fri Apr 6 12:21:59 2012 +++ src/sys/arch/hppa/hppa/trap.S Fri Apr 6 13:09:32 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.66 2012/04/06 12:21:59 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.67 2012/04/06 13:09:32 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -1094,19 +1094,6 @@ ALTENTRY(hppa_fpu_swap) fstds,ma %fr30, 8(%arg0) fstds%fr31, 0(%arg0) - ldo -248(%arg0), %arg0 - ldil L%dcache_stride, %r1 - ldw R%dcache_stride(%r1), %r1 - fdc,m %r1(%arg0) - fdc,m %r1(%arg0) - fdc,m %r1(%arg0) - fdc,m %r1(%arg0) - fdc,m %r1(%arg0) - fdc,m %r1(%arg0) - fdc,m %r1(%arg0) - fdc,m %r1(%arg0) - sync - L$fpu_swap_in: /* @@ -1160,18 +1147,6 @@ L$fpu_swap_in: fldds,ma -8(%arg1), %fr1 fldds 0(%arg1), %fr0 /* fr0 must be restored last */ - ldil L%dcache_stride, %r1 - ldw R%dcache_stride(%r1), %r1 - fdc,m %r1(%arg1) - fdc,m %r1(%arg1) - fdc,m %r1(%arg1) - fdc,m %r1(%arg1) - fdc,m %r1(%arg1) - fdc,m %r1(%arg1) - fdc,m %r1(%arg1) - fdc,m %r1(%arg1) - sync - L$fpu_swap_done: /* Increment the switch count and return. */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Apr 6 13:13:13 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Update comments to reflect that we always have a hardware FPU. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.67 src/sys/arch/hppa/hppa/trap.S:1.68 --- src/sys/arch/hppa/hppa/trap.S:1.67 Fri Apr 6 13:09:32 2012 +++ src/sys/arch/hppa/hppa/trap.S Fri Apr 6 13:13:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.67 2012/04/06 13:09:32 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.68 2012/04/06 13:13:13 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -911,10 +911,7 @@ LEAF_ENTRY_NOPROFILE(TLABEL(emu)) /* * If we're still here, this is a FPU coprocessor instruction. That we - * trapped to emulate it means one of three things. - * - * If we do not have a hardware FPU, we need to emulate this instr- - * uction. + * trapped to emulate it means one of two things. * * If we do have a hardware FPU but it is disabled, we trapped because * the current process' state is not loaded into the FPU. We load that @@ -925,12 +922,6 @@ LEAF_ENTRY_NOPROFILE(TLABEL(emu)) * emulate it. */ - /* - * As an optimization, hppa_fpu_bootstrap replaces this branch inst- - * ruction with a nop if there is a hardware FPU. - * - * Otherwise, this is the branch to emulate an FPU coprocessor. - */ hppa_fpu_emulate: /*
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Apr 5 16:13:47 UTC 2012 Added Files: src/sys/arch/hppa/hppa: ipifuncs.c Log Message: Commit work in progress ipi functions. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/hppa/hppa/ipifuncs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/hppa/hppa/ipifuncs.c diff -u /dev/null src/sys/arch/hppa/hppa/ipifuncs.c:1.1 --- /dev/null Thu Apr 5 16:13:47 2012 +++ src/sys/arch/hppa/hppa/ipifuncs.c Thu Apr 5 16:13:46 2012 @@ -0,0 +1,211 @@ +/* $NetBSD: ipifuncs.c,v 1.1 2012/04/05 16:13:46 skrll Exp $ */ +/* $OpenBSD: ipi.c,v 1.4 2011/01/14 13:20:06 jsing Exp $ */ + +/* + * Copyright (c) 2010 Joel Sing js...@openbsd.org + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include sys/param.h +#include sys/types.h +#include sys/systm.h +#include sys/mutex.h +#include sys/device.h +#include sys/atomic.h +#include sys/xcall.h + +#include machine/cpu.h +#include machine/cpufunc.h +#if 0 +#include machine/fpu.h +#endif +#include machine/iomod.h +#include machine/intr.h +#include machine/mutex.h +#include machine/reg.h +#include machine/int_fmtio.h + +#include hppa/hppa/cpuvar.h + +void hppa_ipi_nop(void); +void hppa_ipi_halt(void); +void hppa_ipi_xcall(void); + +void (*ipifunc[HPPA_NIPI])(void) = +{ + hppa_ipi_nop, + hppa_ipi_halt, + hppa_ipi_xcall +}; + +const char *ipinames[HPPA_NIPI] = { + nop ipi, + halt ipi, + xcall ipi +}; + +void +hppa_ipi_init(struct cpu_info *ci) +{ + struct cpu_softc *sc = ci-ci_softc; + int i; + + evcnt_attach_dynamic(sc-sc_evcnt_ipi, EVCNT_TYPE_INTR, + NULL, device_xname(sc-sc_dev), ipi); + + for (i = 0; i HPPA_NIPI; i++) { + evcnt_attach_dynamic(sc-sc_evcnt_which_ipi[i], + EVCNT_TYPE_INTR, NULL, device_xname(sc-sc_dev), + ipinames[i]); + } +} + +int +hppa_ipi_intr(void *arg) +{ + struct cpu_info *ci = curcpu(); + struct cpu_softc *sc = ci-ci_softc; + u_long ipi_pending; + int bit = 0; + +printf_nolog(%s: ci %p\n,__func__, curcpu()); + + /* Handle an IPI. */ + ipi_pending = atomic_swap_ulong(ci-ci_ipi, 0); + + KASSERT(ipi_pending); + + sc-sc_evcnt_ipi.ev_count++; + + while (ipi_pending) { + if (ipi_pending (1L bit)) { + sc-sc_evcnt_which_ipi[bit].ev_count++; + (*ipifunc[bit])(); + } + ipi_pending = ~(1L bit); + bit++; + } + + return 1; +} + +int +hppa_ipi_send(struct cpu_info *ci, u_long ipi) +{ + struct iomod *cpu; +printf_nolog(%s: made it\n, __func__); + KASSERT(ci-ci_flags CPUF_RUNNING); + + atomic_or_ulong(ci-ci_ipi, (1L ipi)); +printf_nolog(%s: after atomic\n,__func__); + + /* Send an IPI to the specified CPU by triggering EIR{1} (irq 30). */ + cpu = (struct iomod *)(ci-ci_hpa); + cpu-io_eir = 1; + membar_sync(); +printf_nolog(%s: after io_eir ci %p\n,__func__, curcpu()); + + return 0; +} + +int +hppa_ipi_broadcast(u_long ipi) +{ + CPU_INFO_ITERATOR cii; + struct cpu_info *ci; + int count = 0; + + for (CPU_INFO_FOREACH(cii, ci)) { + if (ci != curcpu() (ci-ci_flags CPUF_RUNNING)) + if (hppa_ipi_send(ci, ipi)) +count++; + } + + return count; +} + +void +hppa_ipi_nop(void) +{ +} + +void +hppa_ipi_halt(void) +{ + struct cpu_info *ci = curcpu(); + + /* Turn off interrupts and halt CPU. */ +// hppa_intr_disable(); + ci-ci_flags = ~CPUF_RUNNING; + + for (;;) + ; +} + +#if 0 +void +hppa_ipi_fpu_save(void) +{ + fpu_cpu_save(1); +} + +void +hppa_ipi_fpu_flush(void) +{ + fpu_cpu_save(0); +} + +#endif + +void +hppa_ipi_xcall(void) +{ + + xc_ipi_handler(); +} + +void +xc_send_ipi(struct cpu_info *ci) +{ + + KASSERT(kpreempt_disabled()); + KASSERT(curcpu() != ci); +Debugger(); + if (ci) { + /* Unicast: remote CPU. */ + hppa_ipi_send(ci, HPPA_IPI_XCALL); + } else { + /* Broadcast: all, but local CPU (caller will handle it). */ + hppa_ipi_broadcast(HPPA_IPI_XCALL); + } +} + +void hppa_ipi_counts(void); +void +hppa_ipi_counts(void) +{ + CPU_INFO_ITERATOR cii; + struct cpu_info *ci; + struct cpu_softc *sc; + + for (CPU_INFO_FOREACH(cii, ci)) { + if ((ci-ci_flags CPUF_RUNNING)) { + sc = ci-ci_softc; + printf(%s: ci %p cpuid %d total ipis % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_ipi.ev_count); + printf(%s: ci %p cpuid %d ipis bit 0 % PRIu64 \n, __func__, ci,
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Apr 5 16:16:01 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: ipifuncs.c Log Message: bah, remove a load of old (debug) code. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/hppa/ipifuncs.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/hppa/hppa/ipifuncs.c diff -u src/sys/arch/hppa/hppa/ipifuncs.c:1.1 src/sys/arch/hppa/hppa/ipifuncs.c:1.2 --- src/sys/arch/hppa/hppa/ipifuncs.c:1.1 Thu Apr 5 16:13:46 2012 +++ src/sys/arch/hppa/hppa/ipifuncs.c Thu Apr 5 16:16:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ipifuncs.c,v 1.1 2012/04/05 16:13:46 skrll Exp $ */ +/* $NetBSD: ipifuncs.c,v 1.2 2012/04/05 16:16:01 skrll Exp $ */ /* $OpenBSD: ipi.c,v 1.4 2011/01/14 13:20:06 jsing Exp $ */ /* @@ -79,8 +79,6 @@ hppa_ipi_intr(void *arg) u_long ipi_pending; int bit = 0; -printf_nolog(%s: ci %p\n,__func__, curcpu()); - /* Handle an IPI. */ ipi_pending = atomic_swap_ulong(ci-ci_ipi, 0); @@ -104,17 +102,14 @@ int hppa_ipi_send(struct cpu_info *ci, u_long ipi) { struct iomod *cpu; -printf_nolog(%s: made it\n, __func__); KASSERT(ci-ci_flags CPUF_RUNNING); atomic_or_ulong(ci-ci_ipi, (1L ipi)); -printf_nolog(%s: after atomic\n,__func__); /* Send an IPI to the specified CPU by triggering EIR{1} (irq 30). */ cpu = (struct iomod *)(ci-ci_hpa); cpu-io_eir = 1; membar_sync(); -printf_nolog(%s: after io_eir ci %p\n,__func__, curcpu()); return 0; } @@ -153,21 +148,6 @@ hppa_ipi_halt(void) ; } -#if 0 -void -hppa_ipi_fpu_save(void) -{ - fpu_cpu_save(1); -} - -void -hppa_ipi_fpu_flush(void) -{ - fpu_cpu_save(0); -} - -#endif - void hppa_ipi_xcall(void) { @@ -181,7 +161,7 @@ xc_send_ipi(struct cpu_info *ci) KASSERT(kpreempt_disabled()); KASSERT(curcpu() != ci); -Debugger(); + if (ci) { /* Unicast: remote CPU. */ hppa_ipi_send(ci, HPPA_IPI_XCALL); @@ -190,22 +170,3 @@ Debugger(); hppa_ipi_broadcast(HPPA_IPI_XCALL); } } - -void hppa_ipi_counts(void); -void -hppa_ipi_counts(void) -{ - CPU_INFO_ITERATOR cii; - struct cpu_info *ci; - struct cpu_softc *sc; - - for (CPU_INFO_FOREACH(cii, ci)) { - if ((ci-ci_flags CPUF_RUNNING)) { - sc = ci-ci_softc; - printf(%s: ci %p cpuid %d total ipis % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_ipi.ev_count); - printf(%s: ci %p cpuid %d ipis bit 0 % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_which_ipi[0].ev_count); - printf(%s: ci %p cpuid %d ipis bit 1 % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_which_ipi[1].ev_count); - printf(%s: ci %p cpuid %d ipis bit 2 % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_which_ipi[2].ev_count); - } - } -}
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Apr 5 19:44:29 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Whitespace in previous To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.64 src/sys/arch/hppa/hppa/trap.S:1.65 --- src/sys/arch/hppa/hppa/trap.S:1.64 Thu Apr 5 19:42:14 2012 +++ src/sys/arch/hppa/hppa/trap.S Thu Apr 5 19:44:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.64 2012/04/05 19:42:14 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.65 2012/04/05 19:44:29 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -1058,7 +1058,7 @@ ALTENTRY(hppa_fpu_swap) mfctl CR_CCR, %r1 depi 3, 25, 2, %r1 comb,= %r0, %arg0, L$fpu_swap_in - mtctl %r1,CR_CCR + mtctl %r1, CR_CCR /* * Swap out the current FPU state. @@ -1189,7 +1189,7 @@ L$fpu_no_swap_in: mfctl CR_CCR, %r1 depi 0, 25, 2, %r1 b L$fpu_swap_done - mtctl %r1, CR_CCR + mtctl %r1, CR_CCR EXIT(hppa_fpu_swapout) /* Construct the virtual address tag. */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Apr 3 11:43:37 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Remove unnecessary #includes. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.22 src/sys/arch/hppa/hppa/lock_stubs.S:1.23 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.22 Sun Jan 30 22:36:37 2011 +++ src/sys/arch/hppa/hppa/lock_stubs.S Tue Apr 3 11:43:36 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.22 2011/01/30 22:36:37 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.23 2012/04/03 11:43:36 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -31,8 +31,6 @@ #include opt_multiprocessor.h #include opt_lockdebug.h -#include opt_cputype.h -#include opt_ddb.h #define __MUTEX_PRIVATE
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Apr 3 14:13:27 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Re-arrange to deal with LOCKDEBUG/MULTIPROCESSOR properly. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.23 src/sys/arch/hppa/hppa/lock_stubs.S:1.24 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.23 Tue Apr 3 11:43:36 2012 +++ src/sys/arch/hppa/hppa/lock_stubs.S Tue Apr 3 14:13:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.23 2012/04/03 11:43:36 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.24 2012/04/03 14:13:26 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -49,10 +49,8 @@ * we don't need the overhead of interlocking. */ -#ifndef MULTIPROCESSOR - .global _lock_cas_ras_start - .global _lock_cas_ras_end +#ifndef LOCKDEBUG .global mutex_enter_crit_start .global mutex_enter_crit_end @@ -61,40 +59,9 @@ .import mutex_vector_exit, code .import mutex_wakeup, code -LEAF_ENTRY(_lock_cas) -_lock_cas_ras_start: - ldw 0(%arg0),%t1 - comb, %arg1, %t1, 1f - copy %t1,%ret0 -_lock_cas_ras_end: - stw %arg2, 0(%arg0) - copy %arg1,%ret0 -1: - bv,n %r0(%rp) - -EXIT(_lock_cas) - -STRONG_ALIAS(_atomic_cas_ulong,_lock_cas) -STRONG_ALIAS(atomic_cas_ulong,_lock_cas) -STRONG_ALIAS(_atomic_cas_32,_lock_cas) -STRONG_ALIAS(atomic_cas_32,_lock_cas) -STRONG_ALIAS(_atomic_cas_uint,_lock_cas) -STRONG_ALIAS(atomic_cas_uint,_lock_cas) -STRONG_ALIAS(_atomic_cas_ptr,_lock_cas) -STRONG_ALIAS(atomic_cas_ptr,_lock_cas) - -STRONG_ALIAS(_atomic_cas_ulong_ni,_lock_cas) -STRONG_ALIAS(atomic_cas_ulong_ni,_lock_cas) -STRONG_ALIAS(_atomic_cas_32_ni,_lock_cas) -STRONG_ALIAS(atomic_cas_32_ni,_lock_cas) -STRONG_ALIAS(_atomic_cas_uint_ni,_lock_cas) -STRONG_ALIAS(atomic_cas_uint_ni,_lock_cas) -STRONG_ALIAS(_atomic_cas_ptr_ni,_lock_cas) -STRONG_ALIAS(atomic_cas_ptr_ni,_lock_cas) - -#ifndef LOCKDEBUG /* * void mutex_exit(kmutex_t *mtx); + * */ LEAF_ENTRY(mutex_exit) @@ -193,6 +160,42 @@ EXIT(mutex_enter) #endif /* !LOCKDEBUG */ +#ifndef MULTIPROCESSOR + + .global _lock_cas_ras_start + .global _lock_cas_ras_end + +LEAF_ENTRY(_lock_cas) +_lock_cas_ras_start: + ldw 0(%arg0),%t1 + comb, %arg1, %t1, 1f + copy %t1,%ret0 +_lock_cas_ras_end: + stw %arg2,0(%arg0) + copy %arg1,%ret0 +1: + bv,n %r0(%rp) + +EXIT(_lock_cas) + +STRONG_ALIAS(_atomic_cas_ulong,_lock_cas) +STRONG_ALIAS(atomic_cas_ulong,_lock_cas) +STRONG_ALIAS(_atomic_cas_32,_lock_cas) +STRONG_ALIAS(atomic_cas_32,_lock_cas) +STRONG_ALIAS(_atomic_cas_uint,_lock_cas) +STRONG_ALIAS(atomic_cas_uint,_lock_cas) +STRONG_ALIAS(_atomic_cas_ptr,_lock_cas) +STRONG_ALIAS(atomic_cas_ptr,_lock_cas) + +STRONG_ALIAS(_atomic_cas_ulong_ni,_lock_cas) +STRONG_ALIAS(atomic_cas_ulong_ni,_lock_cas) +STRONG_ALIAS(_atomic_cas_32_ni,_lock_cas) +STRONG_ALIAS(atomic_cas_32_ni,_lock_cas) +STRONG_ALIAS(_atomic_cas_uint_ni,_lock_cas) +STRONG_ALIAS(atomic_cas_uint_ni,_lock_cas) +STRONG_ALIAS(_atomic_cas_ptr_ni,_lock_cas) +STRONG_ALIAS(atomic_cas_ptr_ni,_lock_cas) + #else /* !MULTIPROCESSOR */ /* @@ -292,5 +295,4 @@ STRONG_ALIAS(atomic_cas_uint_ni,_lock_ca STRONG_ALIAS(_atomic_cas_ptr_ni,_lock_cas_mp) STRONG_ALIAS(atomic_cas_ptr_ni,_lock_cas_mp) - #endif /* MULTIPROCESSOR */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Apr 3 14:15:47 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Comments. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.24 src/sys/arch/hppa/hppa/lock_stubs.S:1.25 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.24 Tue Apr 3 14:13:26 2012 +++ src/sys/arch/hppa/hppa/lock_stubs.S Tue Apr 3 14:15:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.24 2012/04/03 14:13:26 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.25 2012/04/03 14:15:47 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ LEAF_ENTRY(mutex_exit) ldi __SIMPLELOCK_RAW_UNLOCKED, %t2 /* unlocked = 1 */ ldo (MTX_LOCK + HPPA_LDCW_ALIGN - 1)(%arg0), %t3 - depi 0, 31, 4, %t3 + depi 0, 31, 4, %t3 /* bits[28-31] = 0 */ stw %t1, MTX_OWNER(%arg0) stw %t2, 0(%t3) /* %t3 is properly aligned */ sync @@ -265,7 +265,7 @@ _lock_cas_mp_spin: _lock_cas_mp_interlocked: ldw 0(%arg0), %ret0 - comclr, %arg1, %ret0, %r0 /* If *ptr != old, then nullify */ + comclr, %arg1, %ret0, %r0 /* If *ptr != old, then nullify */ stw %arg2, 0(%arg0) sync
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Apr 3 14:18:14 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Use GET_CURLWP To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.25 src/sys/arch/hppa/hppa/lock_stubs.S:1.26 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.25 Tue Apr 3 14:15:47 2012 +++ src/sys/arch/hppa/hppa/lock_stubs.S Tue Apr 3 14:18:14 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.25 2012/04/03 14:15:47 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.26 2012/04/03 14:18:14 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -37,6 +37,7 @@ #include machine/asm.h #include machine/mutex.h #include machine/reg.h +#include machine/cpu.h #include assym.h @@ -151,7 +152,7 @@ LEAF_ENTRY(mutex_enter) mutex_enter_crit_start: comib,= 0, %ret0, .Lenter_slowpath - mfctl CR_CURLWP, %t2 + GET_CURLWP(%t2) bv %r0(%rp) mutex_enter_crit_end:
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Apr 2 13:18:04 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: db_machdep.c Log Message: Fix crash(8) build on hppa. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hppa/hppa/db_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/hppa/hppa/db_machdep.c diff -u src/sys/arch/hppa/hppa/db_machdep.c:1.6 src/sys/arch/hppa/hppa/db_machdep.c:1.7 --- src/sys/arch/hppa/hppa/db_machdep.c:1.6 Thu Mar 29 20:31:49 2012 +++ src/sys/arch/hppa/hppa/db_machdep.c Mon Apr 2 13:18:04 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: db_machdep.c,v 1.6 2012/03/29 20:31:49 skrll Exp $ */ +/* $NetBSD: db_machdep.c,v 1.7 2012/04/02 13:18:04 skrll Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -30,18 +30,23 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.6 2012/03/29 20:31:49 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.7 2012/04/02 13:18:04 skrll Exp $); #include sys/param.h #include sys/lwp.h #include machine/db_machdep.h +#include machine/psl.h #include ddb/db_command.h #include ddb/db_output.h #include ddb/db_variables.h #include ddb/db_access.h +#ifndef _KERNEL +#include util.h +#endif + db_regs_t ddb_regs; const struct db_variable db_regs[] = { { flags, (long *)ddb_regs.tf_flags, FCN_NULL, NULL },
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Mar 29 20:31:49 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: db_machdep.c Log Message: Use PSW_BITS to decode the bits of the PSW in db_dump_trap To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/hppa/db_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/hppa/hppa/db_machdep.c diff -u src/sys/arch/hppa/hppa/db_machdep.c:1.5 src/sys/arch/hppa/hppa/db_machdep.c:1.6 --- src/sys/arch/hppa/hppa/db_machdep.c:1.5 Wed Jan 18 09:35:48 2012 +++ src/sys/arch/hppa/hppa/db_machdep.c Thu Mar 29 20:31:49 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: db_machdep.c,v 1.5 2012/01/18 09:35:48 skrll Exp $ */ +/* $NetBSD: db_machdep.c,v 1.6 2012/03/29 20:31:49 skrll Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.5 2012/01/18 09:35:48 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.6 2012/03/29 20:31:49 skrll Exp $); #include sys/param.h #include sys/lwp.h @@ -130,6 +130,7 @@ db_dump_trap(db_expr_t addr, bool have_a const char *cp = modif; bool lwpaddr = false; char c; + char buf[64]; tf = DDB_REGS; while ((c = *cp++) != 0) { @@ -186,7 +187,9 @@ db_dump_trap(db_expr_t addr, bool have_a db_printf(\n); db_printf(Other state\n); db_printf(eiem: %08x\n, tf-tf_eiem); - db_printf(ipsw: %08x\n, tf-tf_ipsw); + + snprintb(buf, sizeof(buf), PSW_BITS, tf-tf_ipsw); + db_printf(ipsw: %s\n, buf); db_printf(flags: %08x\n, tf-tf_flags); db_printf(sar:%08x\n, tf-tf_sar); db_printf(pidr1: %08x\n, tf-tf_pidr1); /* cr8 */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Mar 7 22:07:13 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.c vm_machdep.c Log Message: Deal with setting of space registers and protection ids for posix_spawn. Thanks to martin for the help. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/arch/hppa/hppa/trap.c cvs rdiff -u -r1.50 -r1.51 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.98 src/sys/arch/hppa/hppa/trap.c:1.99 --- src/sys/arch/hppa/hppa/trap.c:1.98 Sun Feb 19 21:06:08 2012 +++ src/sys/arch/hppa/hppa/trap.c Wed Mar 7 22:07:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.98 2012/02/19 21:06:08 rmind Exp $ */ +/* $NetBSD: trap.c,v 1.99 2012/03/07 22:07:13 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.98 2012/02/19 21:06:08 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.99 2012/03/07 22:07:13 skrll Exp $); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -998,7 +998,28 @@ child_return(void *arg) void cpu_spawn_return(struct lwp *l) { - + struct proc *p = l-l_proc; + pmap_t pmap = p-p_vmspace-vm_map.pmap; + pa_space_t space = pmap-pm_space; + struct trapframe *tf = l-l_md.md_regs; + + /* Load all of the user's space registers. */ + tf-tf_sr0 = tf-tf_sr1 = tf-tf_sr3 = tf-tf_sr2 = + tf-tf_sr4 = tf-tf_sr5 = tf-tf_sr6 = space; + tf-tf_iisq_head = tf-tf_iisq_tail = space; + + /* Load the protection registers */ + tf-tf_pidr1 = tf-tf_pidr2 = pmap-pm_pid; + + /* + * theoretically these could be inherited from the father, + * but just in case. + */ + tf-tf_sr7 = HPPA_SID_KERNEL; + mfctl(CR_EIEM, tf-tf_eiem); + tf-tf_ipsw = PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I /* | PSW_L */ | + (curcpu()-ci_psw PSW_O); + userret(l, l-l_md.md_regs-tf_iioq_head, 0); #ifdef DEBUG frame_sanity_check(__func__, __LINE__, 0, l-l_md.md_regs, l); Index: src/sys/arch/hppa/hppa/vm_machdep.c diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.50 src/sys/arch/hppa/hppa/vm_machdep.c:1.51 --- src/sys/arch/hppa/hppa/vm_machdep.c:1.50 Sun Feb 19 21:06:08 2012 +++ src/sys/arch/hppa/hppa/vm_machdep.c Wed Mar 7 22:07:13 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.50 2012/02/19 21:06:08 rmind Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.51 2012/03/07 22:07:13 skrll Exp $ */ /* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.50 2012/02/19 21:06:08 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.51 2012/03/07 22:07:13 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -81,9 +81,6 @@ void cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize, void (*func)(void *), void *arg) { - struct proc *p = l2-l_proc; - pmap_t pmap = p-p_vmspace-vm_map.pmap; - pa_space_t space = pmap-pm_space; struct pcb *pcb1, *pcb2; struct trapframe *tf; register_t sp, osp; @@ -128,22 +125,28 @@ cpu_lwp_fork(struct lwp *l1, struct lwp /* Fill out all the PAs we are going to need in locore. */ cpu_activate_pcb(l2); - /* Load all of the user's space registers. */ - tf-tf_sr0 = tf-tf_sr1 = tf-tf_sr3 = tf-tf_sr2 = - tf-tf_sr4 = tf-tf_sr5 = tf-tf_sr6 = space; - tf-tf_iisq_head = tf-tf_iisq_tail = space; - - /* Load the protection registers */ - tf-tf_pidr1 = tf-tf_pidr2 = pmap-pm_pid; - - /* - * theoretically these could be inherited from the father, - * but just in case. - */ - tf-tf_sr7 = HPPA_SID_KERNEL; - mfctl(CR_EIEM, tf-tf_eiem); - tf-tf_ipsw = PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I /* | PSW_L */ | - (curcpu()-ci_psw PSW_O); + if (__predict_true(l2-l_proc-p_vmspace != NULL)) { + struct proc *p = l2-l_proc; + pmap_t pmap = p-p_vmspace-vm_map.pmap; + pa_space_t space = pmap-pm_space; + + /* Load all of the user's space registers. */ + tf-tf_sr0 = tf-tf_sr1 = tf-tf_sr3 = tf-tf_sr2 = + tf-tf_sr4 = tf-tf_sr5 = tf-tf_sr6 = space; + tf-tf_iisq_head = tf-tf_iisq_tail = space; + + /* Load the protection registers */ + tf-tf_pidr1 = tf-tf_pidr2 = pmap-pm_pid; + + /* + * theoretically these could be inherited from the father, + * but just in case. + */ + tf-tf_sr7 = HPPA_SID_KERNEL; + mfctl(CR_EIEM, tf-tf_eiem); + tf-tf_ipsw = PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I /* | PSW_L */ | + (curcpu()-ci_psw PSW_O); + } /* * Set up return value registers as libc:fork() expects @@ -275,3 +278,130 @@ cpu_lwp_setprivate(lwp_t *l, void *addr) mtctl(addr, CR_TLS); return 0; } + + +#ifdef __HAVE_CPU_UAREA_ROUTINES +void * +cpu_uarea_alloc(bool system) +{ +#ifdef PMAP_MAP_POOLPAGE + struct pglist pglist; + int error; + + /* + * Allocate a new physically contiguous uarea which can be +
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Wed Mar 7 22:10:50 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: vm_machdep.c Log Message: Remove WIP code. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/arch/hppa/hppa/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/hppa/hppa/vm_machdep.c diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.51 src/sys/arch/hppa/hppa/vm_machdep.c:1.52 --- src/sys/arch/hppa/hppa/vm_machdep.c:1.51 Wed Mar 7 22:07:13 2012 +++ src/sys/arch/hppa/hppa/vm_machdep.c Wed Mar 7 22:10:50 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.51 2012/03/07 22:07:13 skrll Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.52 2012/03/07 22:10:50 skrll Exp $ */ /* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.51 2012/03/07 22:07:13 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.52 2012/03/07 22:10:50 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -279,129 +279,3 @@ cpu_lwp_setprivate(lwp_t *l, void *addr) return 0; } - -#ifdef __HAVE_CPU_UAREA_ROUTINES -void * -cpu_uarea_alloc(bool system) -{ -#ifdef PMAP_MAP_POOLPAGE - struct pglist pglist; - int error; - - /* - * Allocate a new physically contiguous uarea which can be - * direct-mapped. - */ - error = uvm_pglistalloc(USPACE, 0, ptoa(physmem), 0, 0, pglist, 1, 1); - if (error) { - if (!system) - return NULL; - panic(%s: uvm_pglistalloc failed: %d, __func__, error); - } - - /* - * Get the physical address from the first page. - */ - const struct vm_page * const pg = TAILQ_FIRST(pglist); - KASSERT(pg != NULL); - const paddr_t pa = VM_PAGE_TO_PHYS(pg); - - /* - * We need to return a direct-mapped VA for the pa. - */ - - return (void *)PMAP_MAP_POOLPAGE(pa); -#else - return NULL; -#endif -} - -/* - * Return true if we freed it, false if we didn't. - */ -bool -cpu_uarea_free(void *vva) -{ -#ifdef PMAP_UNMAP_POOLPAGE - vaddr_t va = (vaddr_t) vva; - if (va = VM_MIN_KERNEL_ADDRESS va VM_MAX_KERNEL_ADDRESS) - return false; - - /* - * Since the pages are physically contiguous, the vm_page structure - * will be as well. - */ - struct vm_page *pg = PHYS_TO_VM_PAGE(PMAP_UNMAP_POOLPAGE(va)); - KASSERT(pg != NULL); - for (size_t i = 0; i UPAGES; i++, pg++) { - uvm_pagefree(pg); - } - return true; -#else - return false; -#endif -} -#endif /* __HAVE_CPU_UAREA_ROUTINES */ - -#ifdef __HAVE_CPU_UAREA_ROUTINES -void * -cpu_uarea_alloc(bool system) -{ -#ifdef PMAP_MAP_POOLPAGE - struct pglist pglist; - int error; - - /* - * Allocate a new physically contiguous uarea which can be - * direct-mapped. - */ - error = uvm_pglistalloc(USPACE, 0, ptoa(physmem), 0, 0, pglist, 1, 1); - if (error) { - if (!system) - return NULL; - panic(%s: uvm_pglistalloc failed: %d, __func__, error); - } - - /* - * Get the physical address from the first page. - */ - const struct vm_page * const pg = TAILQ_FIRST(pglist); - KASSERT(pg != NULL); - const paddr_t pa = VM_PAGE_TO_PHYS(pg); - - /* - * We need to return a direct-mapped VA for the pa. - */ - - return (void *)PMAP_MAP_POOLPAGE(pa); -#else - return NULL; -#endif -} - -/* - * Return true if we freed it, false if we didn't. - */ -bool -cpu_uarea_free(void *vva) -{ -#ifdef PMAP_UNMAP_POOLPAGE - vaddr_t va = (vaddr_t) vva; - if (va = VM_MIN_KERNEL_ADDRESS va VM_MAX_KERNEL_ADDRESS) - return false; - - /* - * Since the pages are physically contiguous, the vm_page structure - * will be as well. - */ - struct vm_page *pg = PHYS_TO_VM_PAGE(PMAP_UNMAP_POOLPAGE(va)); - KASSERT(pg != NULL); - for (size_t i = 0; i UPAGES; i++, pg++) { - uvm_pagefree(pg); - } - return true; -#else - return false; -#endif -} -#endif /* __HAVE_CPU_UAREA_ROUTINES */ \ No newline at end of file
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Feb 28 07:30:30 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Fix PMAPDEBUG build To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.97 src/sys/arch/hppa/hppa/pmap.c:1.98 --- src/sys/arch/hppa/hppa/pmap.c:1.97 Fri Jan 6 20:55:28 2012 +++ src/sys/arch/hppa/hppa/pmap.c Tue Feb 28 07:30:30 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.97 2012/01/06 20:55:28 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.98 2012/02/28 07:30:30 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.97 2012/01/06 20:55:28 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.98 2012/02/28 07:30:30 skrll Exp $); #include opt_cputype.h @@ -1792,7 +1792,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v if (!pve) panic(%s: no pv entries available, __func__); DPRINTF(PDB_FOLLOW|PDB_ENTER, (%s(%lx, %lx, %x) TLB_KENTER\n, - _func__, va, pa, pte)); + __func__, va, pa, pte)); if (pmap_check_alias(pg, va, pte)) pmap_page_remove(pg);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Feb 26 08:28:58 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Enhance a comment. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.62 src/sys/arch/hppa/hppa/trap.S:1.63 --- src/sys/arch/hppa/hppa/trap.S:1.62 Tue Jan 3 06:18:24 2012 +++ src/sys/arch/hppa/hppa/trap.S Sun Feb 26 08:28:57 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.62 2012/01/03 06:18:24 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.63 2012/02/26 08:28:57 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -244,7 +244,7 @@ syscall_entry: GET_CURCPU_SPACE(%sr1, %t1) ldw CI_PSW(%sr1, %t1), %t1 - stw %r1, TF_CR15-TRAPFRAME_SIZEOF(%sr1, %t3) /* eiem ,bc */ + stw %r1, TF_CR15-TRAPFRAME_SIZEOF(%sr1, %t3) /* eiem ,bc (block copy cache control hint) */ stw %t1, TF_CR22-TRAPFRAME_SIZEOF(%sr1, %t3) /* ipsw */ mfsp %sr3, %t1
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: martin Date: Mon Feb 13 01:07:37 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.c Log Message: Add missing MD code for posix_spawn To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c diff -u src/sys/arch/hppa/hppa/trap.c:1.96 src/sys/arch/hppa/hppa/trap.c:1.97 --- src/sys/arch/hppa/hppa/trap.c:1.96 Sun Jan 23 09:44:59 2011 +++ src/sys/arch/hppa/hppa/trap.c Mon Feb 13 01:07:37 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.96 2011/01/23 09:44:59 skrll Exp $ */ +/* $NetBSD: trap.c,v 1.97 2012/02/13 01:07:37 martin Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.96 2011/01/23 09:44:59 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.97 2012/02/13 01:07:37 martin Exp $); /* #define INTRDEBUG */ /* #define TRAPDEBUG */ @@ -1003,6 +1003,19 @@ child_return(void *arg) #endif /* DEBUG */ } +/* + * Process the tail end of a posix_spawn() for the child. + */ +void +cpu_spawn_return(struct lwp *l) +{ + + userret(l, l-l_md.md_regs-tf_iioq_head, 0); +#ifdef DEBUG + frame_sanity_check(__func__, __LINE__, 0, l-l_md.md_regs, l); +#endif /* DEBUG */ +} + #ifdef PTRACE #include sys/ptrace.h
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Jan 17 10:56:56 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: db_trace.c Log Message: Remove comment that shouldn't have crept in. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hppa/hppa/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/hppa/hppa/db_trace.c diff -u src/sys/arch/hppa/hppa/db_trace.c:1.10 src/sys/arch/hppa/hppa/db_trace.c:1.11 --- src/sys/arch/hppa/hppa/db_trace.c:1.10 Mon Feb 28 21:24:25 2011 +++ src/sys/arch/hppa/hppa/db_trace.c Tue Jan 17 10:56:56 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: db_trace.c,v 1.10 2011/02/28 21:24:25 skrll Exp $ */ +/* $NetBSD: db_trace.c,v 1.11 2012/01/17 10:56:56 skrll Exp $ */ /* $OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.10 2011/02/28 21:24:25 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.11 2012/01/17 10:56:56 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -129,14 +129,6 @@ db_stack_trace_print(db_expr_t addr, boo db_printsym(pc, DB_STGY_PROC, pr); pr(\n); - /* XXX NH - unwind info here */ - /* aue = ue_find(pc); */ - - /* - * get rp? - * fp -= ue_total_frame_size(aue) - */ - /* * if a terminal frame then report the trapframe and continue * after it (if not the last one).
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Jan 17 12:08:43 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: db_disasm.c Log Message: Add some space to the output. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hppa/hppa/db_disasm.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/hppa/hppa/db_disasm.c diff -u src/sys/arch/hppa/hppa/db_disasm.c:1.13 src/sys/arch/hppa/hppa/db_disasm.c:1.14 --- src/sys/arch/hppa/hppa/db_disasm.c:1.13 Mon Jan 16 09:01:35 2012 +++ src/sys/arch/hppa/hppa/db_disasm.c Tue Jan 17 12:08:43 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.13 2012/01/16 09:01:35 skrll Exp $ */ +/* $NetBSD: db_disasm.c,v 1.14 2012/01/17 12:08:43 skrll Exp $ */ /* $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $ */ @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.13 2012/01/16 09:01:35 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.14 2012/01/17 12:08:43 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -1296,7 +1296,7 @@ iExInit(void) int addDasm(const struct inst *i, OFS ofs, union insn w) { - db_printf(%s\t%%r%d,%%r%d,%%r%d,addDCond(Cond4(w)), + db_printf(%s\t%%r%d, %%r%d, %%r%d,addDCond(Cond4(w)), Rsa(w),Rsb(w),Rtc(w)); return (1); } @@ -1307,9 +1307,9 @@ unitDasm(const struct inst *i, OFS ofs, { db_printf(unitDCond(Cond4(w))); if (Match(dcor) || Match(idcor)) - db_printf(\t%%r%d,%%r%d,Rsb(w),Rtc(w)); + db_printf(\t%%r%d, %%r%d,Rsb(w),Rtc(w)); else - db_printf(\t%%r%d,%%r%d,%%r%d,Rsa(w),Rsb(w),Rtc(w)); + db_printf(\t%%r%d, %%r%d, %%r%d,Rsa(w),Rsb(w),Rtc(w)); return (1); } @@ -1318,10 +1318,10 @@ int iaDasm(const struct inst *i, OFS ofs, union insn w) { if (Match(addi)) - db_printf(%s\t%d,%%r%d,%%r%d, + db_printf(%s\t%d, %%r%d, %%r%d, addDCond(Cond4(w)),Im11(w),Rsb(w),Rta(w)); else - db_printf(%s\t%d,%%r%d,%%r%d, + db_printf(%s\t%d, %%r%d, %%r%d, subDCond(Cond4(w)),Im11(w),Rsb(w),Rta(w)); return (1); } @@ -1331,10 +1331,10 @@ int shdDasm(const struct inst *i, OFS ofs, union insn w) { if (Match(vshd)) - db_printf(%s\t%%r%d,%%r%d,%%r%d, + db_printf(%s\t%%r%d, %%r%d, %%r%d, edDCond(Cond(w)), Rsa(w),Rsb(w),Rtc(w)); else - db_printf(%s\t%%r%d,%%r%d,%d,%%r%d, + db_printf(%s\t%%r%d, %%r%d, %d, %%r%d, edDCond(Cond(w)),Rsa(w),Rsb(w),31-Imd5(w),Rtc(w)); return (1); } @@ -1343,7 +1343,7 @@ shdDasm(const struct inst *i, OFS ofs, u int extrDasm(const struct inst *i, OFS ofs, union insn w) { - db_printf(%s\t%%r%d,%d,%d,%%r%d, + db_printf(%s\t%%r%d, %d, %d, %%r%d, edDCond(Cond(w)),Rsb(w),Imd5(w),32 - Rsc(w),Rta(w)); return (1); } @@ -1353,7 +1353,7 @@ extrDasm(const struct inst *i, OFS ofs, int vextrDasm(const struct inst *i, OFS ofs, union insn w) { - db_printf(%s\t%%r%d,%d,%%r%d, + db_printf(%s\t%%r%d, %d, %%r%d, edDCond(Cond(w)),Rsb(w),32 - Rsc(w),Rta(w)); return (1); } @@ -1363,7 +1363,7 @@ vextrDasm(const struct inst *i, OFS ofs, int depDasm(const struct inst *i, OFS ofs, union insn w) { - db_printf(%s\t%%r%d,%d,%d,%%r%d, + db_printf(%s\t%%r%d, %d, %d, %%r%d, edDCond(Cond(w)),Rsa(w),31 - Imd5(w),32 - Rsc(w),Rtb(w)); return (1); } @@ -1373,7 +1373,7 @@ depDasm(const struct inst *i, OFS ofs, u int vdepDasm(const struct inst *i, OFS ofs, union insn w) { - db_printf(%s\t%%r%d,%d,%%r%d, + db_printf(%s\t%%r%d, %d, %%r%d, edDCond(Cond(w)),Rsa(w),32 - Rsc(w),Rtb(w)); return (1); } @@ -1383,7 +1383,7 @@ vdepDasm(const struct inst *i, OFS ofs, int depiDasm(const struct inst *i, OFS ofs, union insn w) { - db_printf(%s\t%d,%d,%d,%%r%d, + db_printf(%s\t%d, %d, %d, %%r%d, edDCond(Cond(w)),Ima5(w),31 - Imd5(w),32 - Imc5A(w),Rtb(w)); return (1); } @@ -1392,7 +1392,7 @@ depiDasm(const struct inst *i, OFS ofs, int vdepiDasm(const struct inst *i, OFS ofs, union insn w) { - db_printf(%s\t%d,%d,%%r%d,edDCond(Cond(w)),Ima5(w),32-Imc5A(w),Rtb(w)); + db_printf(%s\t%d, %d, %%r%d,edDCond(Cond(w)),Ima5(w),32-Imc5A(w),Rtb(w)); return (1); } @@ -1517,14 +1517,14 @@ ldDasm(const struct inst *i, OFS ofs, un s[0] = '\0'; if (Rsb(w) == 0 Match(ldo)) { - db_printf(ldi\t%s%X,%%r%d,s,d,Rta(w)); + db_printf(ldi\t%s%X, %%r%d,s,d,Rta(w)); return (1); } db_printf(%s\t%s%s%X,i-mnem,(d 2048? R':), s, d); if (Dss(w)) - db_printf((%%sr%d,%%r%d),%%r%d,Dss(w),Rsb(w),Rta(w)); + db_printf((%%sr%d, %%r%d), %%r%d,Dss(w),Rsb(w),Rta(w)); else - db_printf((%%r%d),%%r%d,Rsb(w),Rta(w)); + db_printf((%%r%d), %%r%d,Rsb(w),Rta(w)); return (1); } @@ -1535,7 +1535,7 @@ stDasm(const struct inst *i, OFS ofs, un int d = Disp(w); char s[2]; - db_printf(\t%%r%d,,Rta(w)); + db_printf(\t%%r%d, ,Rta(w)); s[1] = '\0'; if (d 0) { @@ -1547,7 +1547,7 @@ stDasm(const struct inst *i, OFS ofs, un db_printf(%s%s%X, (d 2048? R':), s, d); if
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Jan 17 12:32:52 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: db_disasm.c Log Message: Fix the symbol lookup on branches, etc. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/hppa/db_disasm.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/hppa/hppa/db_disasm.c diff -u src/sys/arch/hppa/hppa/db_disasm.c:1.14 src/sys/arch/hppa/hppa/db_disasm.c:1.15 --- src/sys/arch/hppa/hppa/db_disasm.c:1.14 Tue Jan 17 12:08:43 2012 +++ src/sys/arch/hppa/hppa/db_disasm.c Tue Jan 17 12:32:52 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.14 2012/01/17 12:08:43 skrll Exp $ */ +/* $NetBSD: db_disasm.c,v 1.15 2012/01/17 12:32:52 skrll Exp $ */ /* $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $ */ @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.14 2012/01/17 12:08:43 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.15 2012/01/17 12:32:52 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -2233,7 +2233,7 @@ db_disasm(vaddr_t loc, bool flag) const struct majoropcode *m; u_int ext; union insn instruct; - OFS ofs = 0; + OFS ofs = loc; iExInit();
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Jan 16 09:01:35 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: db_disasm.c Log Message: Don't NULL deref on unknown subop, e.g. PA2.0 instruction. Print undefined instead of ???. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/hppa/db_disasm.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/hppa/hppa/db_disasm.c diff -u src/sys/arch/hppa/hppa/db_disasm.c:1.12 src/sys/arch/hppa/hppa/db_disasm.c:1.13 --- src/sys/arch/hppa/hppa/db_disasm.c:1.12 Tue Nov 3 05:07:26 2009 +++ src/sys/arch/hppa/hppa/db_disasm.c Mon Jan 16 09:01:35 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.12 2009/11/03 05:07:26 snj Exp $ */ +/* $NetBSD: db_disasm.c,v 1.13 2012/01/16 09:01:35 skrll Exp $ */ /* $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $ */ @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.12 2009/11/03 05:07:26 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.13 2012/01/16 09:01:35 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -2253,16 +2253,18 @@ db_disasm(vaddr_t loc, bool flag) else i = m-subops[ext]; - if (i-dasmfcn != coprDasm i-dasmfcn != diagDasm - i-dasmfcn != ariDasm i-dasmfcn != scDasm - i-dasmfcn != ldDasm) - db_printf(i-mnem); - if (i-dasmfcn) - (*i-dasmfcn)(i, ofs, instruct); - else if (i-mnem[0] == '?') - db_printf(???); + if (i) { + if (i-dasmfcn != coprDasm i-dasmfcn != diagDasm + i-dasmfcn != ariDasm i-dasmfcn != scDasm + i-dasmfcn != ldDasm) +db_printf(%s, i-mnem); + if (i-dasmfcn) +(*i-dasmfcn)(i, ofs, instruct); + } else { + db_printf(undefined subop); + } } else - db_printf(???); + db_printf(undefined); db_printf(\n); return (loc + sizeof(instruct));
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 08:03:16 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Style. To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.89 src/sys/arch/hppa/hppa/pmap.c:1.90 --- src/sys/arch/hppa/hppa/pmap.c:1.89 Fri Jan 6 07:59:07 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 08:03:16 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $); #include opt_cputype.h @@ -595,11 +595,13 @@ pmap_pv_remove(struct vm_page *pg, pmap_ KASSERT(pmap == pmap_kernel() || uvm_page_locked_p(pg)); for (pv = *(pve = md-pvh_list); - pv; pv = *(pve = (*pve)-pv_next)) + pv; pv = *(pve = (*pve)-pv_next)) { if (pv-pv_pmap == pmap (pv-pv_va PV_VAMASK) == va) { *pve = pv-pv_next; break; } + } + return (pv); }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 08:32:08 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Simplify code a little. To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.90 src/sys/arch/hppa/hppa/pmap.c:1.91 --- src/sys/arch/hppa/hppa/pmap.c:1.90 Fri Jan 6 08:03:16 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 08:32:08 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.91 2012/01/06 08:32:08 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.90 2012/01/06 08:03:16 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.91 2012/01/06 08:32:08 skrll Exp $); #include opt_cputype.h @@ -1698,6 +1698,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v { volatile pt_entry_t *pde; pt_entry_t pte, opte; + struct vm_page *pg; #ifdef PMAPDEBUG int opmapdebug = pmapdebug; @@ -1727,28 +1728,23 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v if (opte) pmap_pte_flush(pmap_kernel(), va, opte); - if (pmap_initialized) { - struct vm_page *pg; + + pg = pmap_initialized ? PHYS_TO_VM_PAGE(PTE_PAGE(pte)) : NULL; + if (pg != NULL) { + KASSERT(pa HPPA_IOBEGIN); - pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte)); - if (pg != NULL) { - KASSERT(pa HPPA_IOBEGIN); + struct pv_entry *pve; - struct pv_entry *pve; - - pve = pmap_pv_alloc(); - if (!pve) -panic(%s: no pv entries available, -__func__); - DPRINTF(PDB_FOLLOW|PDB_ENTER, - (%s(%lx, %lx, %x) TLB_KENTER\n, __func__, - va, pa, pte)); + pve = pmap_pv_alloc(); + if (!pve) + panic(%s: no pv entries available, __func__); + DPRINTF(PDB_FOLLOW|PDB_ENTER, (%s(%lx, %lx, %x) TLB_KENTER\n, + _func__, va, pa, pte)); - if (pmap_check_alias(pg, va, pte)) -pmap_page_remove(pg); - pmap_pv_enter(pg, pve, pmap_kernel(), va, NULL, - PV_KENTER); - } + if (pmap_check_alias(pg, va, pte)) + pmap_page_remove(pg); + + pmap_pv_enter(pg, pve, pmap_kernel(), va, NULL, PV_KENTER); } pmap_pte_set(pde, va, pte); @@ -1815,7 +1811,9 @@ pmap_kremove(vaddr_t va, vsize_t size) pmap_pte_flush(pmap, va, pte); pmap_pte_set(pde, va, 0); - if (pmap_initialized (pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte { + + pg = pmap_initialized ? PHYS_TO_VM_PAGE(PTE_PAGE(pte)) : NULL; + if (pg != NULL) { pve = pmap_pv_remove(pg, pmap, va); if (pve != NULL)
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 08:33:26 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Group the prototypes. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.91 src/sys/arch/hppa/hppa/pmap.c:1.92 --- src/sys/arch/hppa/hppa/pmap.c:1.91 Fri Jan 6 08:32:08 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 08:33:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.91 2012/01/06 08:32:08 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.92 2012/01/06 08:33:26 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.91 2012/01/06 08:32:08 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.92 2012/01/06 08:33:26 skrll Exp $); #include opt_cputype.h @@ -208,11 +208,12 @@ static inline struct pv_entry *pmap_pv_r vaddr_t); static inline void pmap_flush_page(struct vm_page *, bool); - -void pmap_copy_page(paddr_t, paddr_t); +static int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t); static void pmap_page_physload(paddr_t, paddr_t); +void pmap_copy_page(paddr_t, paddr_t); + #ifdef USE_HPT static inline struct hpt_entry *pmap_hash(pmap_t, vaddr_t); static inline uint32_t pmap_vtag(pmap_t, vaddr_t); @@ -227,8 +228,6 @@ void pmap_dump_table(pa_space_t, vaddr_t void pmap_dump_pv(paddr_t); #endif -static int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t); - #define IS_IOPAGE_P(pa) ((pa) = HPPA_IOBEGIN) /* un-invert PVF_REF */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 08:36:10 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Whitespace. hi perry. To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.92 src/sys/arch/hppa/hppa/pmap.c:1.93 --- src/sys/arch/hppa/hppa/pmap.c:1.92 Fri Jan 6 08:33:26 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 08:36:10 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.92 2012/01/06 08:33:26 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.93 2012/01/06 08:36:10 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.92 2012/01/06 08:33:26 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.93 2012/01/06 08:36:10 skrll Exp $); #include opt_cputype.h @@ -904,7 +904,7 @@ pmap_bootstrap(vaddr_t vstart) btlb_entry_size[btlb_j] = size; btlb_entry_vm_prot[btlb_j] = VM_PROT_READ | VM_PROT_WRITE; - + /* Move on. */ addr = btlb_entry_start[btlb_j] + btlb_entry_size[btlb_j]; @@ -1727,7 +1727,6 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v if (opte) pmap_pte_flush(pmap_kernel(), va, opte); - pg = pmap_initialized ? PHYS_TO_VM_PAGE(PTE_PAGE(pte)) : NULL; if (pg != NULL) { KASSERT(pa HPPA_IOBEGIN); @@ -1844,7 +1843,7 @@ pmap_hptdump(void) char buf[128]; snprintb(buf, sizeof(buf), TLB_BITS, hpt-hpt_tlbprot); - + db_printf(hpt@%p: %x{%sv=%x:%x},%s,%x\n, hpt, *(int *)hpt, (hpt-hpt_valid?ok,:), hpt-hpt_space, hpt-hpt_vpn 9,
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 08:38:11 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: More whitespace. To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.93 src/sys/arch/hppa/hppa/pmap.c:1.94 --- src/sys/arch/hppa/hppa/pmap.c:1.93 Fri Jan 6 08:36:10 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 08:38:11 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.93 2012/01/06 08:36:10 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.94 2012/01/06 08:38:11 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.93 2012/01/06 08:36:10 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.94 2012/01/06 08:38:11 skrll Exp $); #include opt_cputype.h @@ -945,9 +945,9 @@ pmap_bootstrap(vaddr_t vstart) availphysmem = 0; - pmap_page_physload(resvmem, atop(ksrx)); - pmap_page_physload(atop(kero), atop(ksrw)); - pmap_page_physload(atop(kerw), physmem); + pmap_page_physload(resvmem, atop(ksrx)); + pmap_page_physload(atop(kero), atop(ksrw)); + pmap_page_physload(atop(kerw), physmem); mutex_init(pmaps_lock, MUTEX_DEFAULT, IPL_NONE); @@ -1113,7 +1113,7 @@ pmap_destroy(pmap_t pmap) KASSERT(pg != pmap-pm_pdir_pg); pa = VM_PAGE_TO_PHYS(pg); - + DPRINTF(PDB_FOLLOW, (%s(%p): stray ptp 0x%lx w/ %d ents:, __func__, pmap, pa, pg-wire_count - 1)); @@ -1381,7 +1381,7 @@ pmap_write_protect(pmap_t pmap, vaddr_t VM_PAGE_TO_MD(pg); md-pvh_attrs |= pmap_pvh_attrs(pte); } - + pmap_pte_flush(pmap, sva, pte); pte = ~PTE_PROT(TLB_AR_MASK); pte |= pteprot; @@ -1809,7 +1809,7 @@ pmap_kremove(vaddr_t va, vsize_t size) pmap_pte_flush(pmap, va, pte); pmap_pte_set(pde, va, 0); - + pg = pmap_initialized ? PHYS_TO_VM_PAGE(PTE_PAGE(pte)) : NULL; if (pg != NULL) { pve = pmap_pv_remove(pg, pmap, va);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 08:48:43 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Add a KASSERT. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.94 src/sys/arch/hppa/hppa/pmap.c:1.95 --- src/sys/arch/hppa/hppa/pmap.c:1.94 Fri Jan 6 08:38:11 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 08:48:43 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.94 2012/01/06 08:38:11 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.95 2012/01/06 08:48:43 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.94 2012/01/06 08:38:11 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.95 2012/01/06 08:48:43 skrll Exp $); #include opt_cputype.h @@ -1487,6 +1487,7 @@ pmap_changebit(struct vm_page *pg, u_int DPRINTF(PDB_FOLLOW|PDB_BITS, (%s(%p, %x, %x)\n, __func__, pg, set, clear)); + KASSERT((set clear) == 0); KASSERT((set ~(PVF_REF|PVF_UNCACHEABLE)) == 0); KASSERT((clear ~(PVF_MOD|PVF_WRITE|PVF_UNCACHEABLE)) == 0);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 08:54:05 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Wrap a long line. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.95 src/sys/arch/hppa/hppa/pmap.c:1.96 --- src/sys/arch/hppa/hppa/pmap.c:1.95 Fri Jan 6 08:48:43 2012 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 08:54:05 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.95 2012/01/06 08:48:43 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.96 2012/01/06 08:54:05 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.95 2012/01/06 08:48:43 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.96 2012/01/06 08:54:05 skrll Exp $); #include opt_cputype.h @@ -1317,7 +1317,8 @@ pmap_remove(pmap_t pmap, vaddr_t sva, va if (pmap_initialized (pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte { -struct vm_page_md * const md = VM_PAGE_TO_MD(pg); +struct vm_page_md * const md = +VM_PAGE_TO_MD(pg); pve = pmap_pv_remove(pg, pmap, sva); md-pvh_attrs |= pmap_pvh_attrs(pte);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 09:09:25 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Flush the d-cache and i-cache to make sure the text area of the module is dealt with properly. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.6 src/sys/arch/hppa/hppa/kobj_machdep.c:1.7 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.6 Tue Dec 13 12:55:50 2011 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Fri Jan 6 09:09:25 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.6 2011/12/13 12:55:50 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.7 2012/01/06 09:09:25 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.6 2011/12/13 12:55:50 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.7 2012/01/06 09:09:25 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -215,8 +215,10 @@ int kobj_machdep(kobj_t ko, void *base, size_t size, bool load) { - if (load) + if (load) { fdcache(HPPA_SID_KERNEL, (vaddr_t)base, size); + ficache(HPPA_SID_KERNEL, (vaddr_t)base, size); + } return 0; }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Jan 6 07:59:07 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Make pmap_check_alias static To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.88 src/sys/arch/hppa/hppa/pmap.c:1.89 --- src/sys/arch/hppa/hppa/pmap.c:1.88 Fri Dec 30 07:41:58 2011 +++ src/sys/arch/hppa/hppa/pmap.c Fri Jan 6 07:59:07 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.88 2011/12/30 07:41:58 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.88 2011/12/30 07:41:58 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $); #include opt_cputype.h @@ -227,7 +227,7 @@ void pmap_dump_table(pa_space_t, vaddr_t void pmap_dump_pv(paddr_t); #endif -int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t); +static int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t); #define IS_IOPAGE_P(pa) ((pa) = HPPA_IOBEGIN) @@ -515,7 +515,7 @@ pmap_dump_pv(paddr_t pa) } #endif -int +static int pmap_check_alias(struct vm_page *pg, vaddr_t va, pt_entry_t pte) { struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Jan 3 06:18:25 UTC 2012 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Fix the CPU #ifdefs To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.61 src/sys/arch/hppa/hppa/trap.S:1.62 --- src/sys/arch/hppa/hppa/trap.S:1.61 Mon Jan 2 16:13:12 2012 +++ src/sys/arch/hppa/hppa/trap.S Tue Jan 3 06:18:24 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.61 2012/01/02 16:13:12 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.62 2012/01/03 06:18:24 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -640,7 +640,8 @@ LDILDO(tlbd_l) #endif #if defined(HP8000_CPU) || defined(HP8200_CPU) || \ -defined(HP8500_CPU) || defined(HP8600_CPU) +defined(HP8500_CPU) || defined(HP8600_CPU) || \ +defined(HP8700_CPU) LDILDO(itlb_u) LDILDO(itlbna_u) LDILDO(dtlb_u) @@ -1227,7 +1228,6 @@ EXIT(hppa_fpu_swapout) #define TLB_STATS_AFT(t) /**/ #endif -#if defined(HP7000_CPU) || defined(HP7100_CPU) || defined(HP7200_CPU) #define TLB_PULL(bits,lbl) ! \ /* space:pgaddr -- %r8:%r9 */ ! \ mfctl CR_VTOP, %r16 ! \ @@ -1250,6 +1250,36 @@ EXIT(hppa_fpu_swapout) addi 2, %r25, %r25 ! \ extru %r17, 24, 25, %r17 +/* + * possible optimizations: + * change pte to reduce number of shifts + * reorder to reduce stalls + */ +#define TLB_PULL_L(bits,lbl) ! \ + /* space:pgaddr -- %r8:%r9 */ ! \ + mfctl CR_VTOP, %r16 ! \ + ldwx,s %r8(%r16), %r17 /* space - page directory */ ! \ + extru %r9, 9, 10, %r25 ! \ + combt,=,n %r0, %r17, lbl ! \ + ldwx,s %r25(%r17), %r24 /* page - page table */ ! \ + extru %r9, 19, 10, %r16 ! \ + combt,=,n %r0, %r24, lbl ! \ + ldwx,s %r16(%r24), %r17 /* va - pa:prot */ ! \ + sh2addl %r16, %r24, %r25 ! \ + combt,=,n %r0, %r17, lbl ! \ + copy %r17, %r16 ! \ + depi (bits), 21+bits, 1+bits, %r17! \ + sub,= %r16, %r17, %r0 /* do not store if unchanged */ ! \ + stws %r17, 0(%r25) /* store back w/ the bits */ ! \ + shd %r17, %r0, 13, %r25 ! \ + dep %r8, 30, 15, %r25 /* mix0r the pid from the sid */! \ + dep %r0, 31, 12, %r17 /* needed ? */ ! \ + addi 2, %r25, %r25 ! \ + extru %r17, 24, 25, %r17 /* tlbbtop(%r17) */ ! \ + sync + +#if defined(HP7000_CPU) || defined(HP7100_CPU) || defined(HP7200_CPU) + .align 32 /* @@ -1404,34 +1434,6 @@ EXIT(TLABEL(dtlbna_s)) #define IDTLBAF(r) .word 0x04001440 | ((r) 16) #define IDTLBPF(r) .word 0x04001400 | ((r) 16) -/* - * possible optimizations: - * change pte to reduce number of shifts - * reorder to reduce stalls - */ -#define TLB_PULL_L(bits,lbl) ! \ - /* space:pgaddr -- %r8:%r9 */ ! \ - mfctl CR_VTOP, %r16 ! \ - ldwx,s %r8(%r16), %r17 /* space - page directory */ ! \ - extru %r9, 9, 10, %r25 ! \ - combt,=,n %r0, %r17, lbl ! \ - ldwx,s %r25(%r17), %r24 /* page - page table */ ! \ - extru %r9, 19, 10, %r16 ! \ - combt,=,n %r0, %r24, lbl ! \ - ldwx,s %r16(%r24), %r17 /* va - pa:prot */ ! \ - sh2addl %r16, %r24, %r25 ! \ - combt,=,n %r0, %r17, lbl ! \ - copy %r17, %r16 ! \ - depi (bits), 21+bits, 1+bits, %r17! \ - sub,= %r16, %r17, %r0 /* do not store if unchanged */ ! \ - stws %r17, 0(%r25) /* store back w/ the bits */ ! \ - shd %r17, %r0, 13, %r25 ! \ - dep %r8, 30, 15, %r25 /* mix0r the pid from the sid */! \ - dep %r0, 31, 12, %r17 /* needed ? */ ! \ - addi 2, %r25, %r25 ! \ - extru %r17, 24, 25, %r17 /* tlbbtop(%r17) */ ! \ - sync - .align 32 /* @@ -1605,7 +1607,10 @@ L$dtlb_done_l: EXIT(TLABEL(dtlb_l)) #endif /* defined(HP7100LC_CPU) || defined(HP7300LC_CPU) */ -#if defined(HP8000_CPU) || defined(HP8200_CPU) || defined(HP8500_CPU) +#if defined(HP8000_CPU) || defined(HP8200_CPU) || \ +defined(HP8500_CPU) || defined(HP8600_CPU) || \ +defined(HP8700_CPU) + .level 2.0w /* xlate 32bit-64bit pte */ @@ -1876,7 +1881,10 @@ EXIT(desidhash_l) #endif /* defined(HP7100LC_CPU) || defined(HP7300LC_CPU) */ -#if defined(HP8000_CPU) || defined(HP8200_CPU) || defined(HP8500_CPU) +#if defined(HP8000_CPU) || defined(HP8200_CPU) || \ +defined(HP8500_CPU) || defined(HP8600_CPU) || \ +defined(HP8700_CPU) + .level 2.0w LEAF_ENTRY_NOPROFILE(desidhash_u) MFCPU_U(2,28) @@ -1898,7 +1906,7 @@ LEAF_ENTRY_NOPROFILE(pbtlb_u) nop EXIT(pbtlb_u) .level 1.1 -#endif /* HP8000_CPU */ +#endif /* HP8000_CPU || HP8200_CPU || HP8500_CPU || HP8600_CPU || HP8700_CPU */ .align 64 .export TLABEL(all), entry
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Dec 31 08:34:49 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: db_machdep.c Log Message: Fix the usage/help for mach frame. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hppa/hppa/db_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/hppa/hppa/db_machdep.c diff -u src/sys/arch/hppa/hppa/db_machdep.c:1.3 src/sys/arch/hppa/hppa/db_machdep.c:1.4 --- src/sys/arch/hppa/hppa/db_machdep.c:1.3 Sat Jan 22 19:35:48 2011 +++ src/sys/arch/hppa/hppa/db_machdep.c Sat Dec 31 08:34:49 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: db_machdep.c,v 1.3 2011/01/22 19:35:48 skrll Exp $ */ +/* $NetBSD: db_machdep.c,v 1.4 2011/12/31 08:34:49 skrll Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.3 2011/01/22 19:35:48 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.4 2011/12/31 08:34:49 skrll Exp $); #include sys/param.h #include sys/lwp.h @@ -43,9 +43,9 @@ __KERNEL_RCSID(0, $NetBSD: db_machdep.c const struct db_command db_machine_command_table[] = { { DDB_ADD_CMD(frame, db_dump_trap, 0, Displays the contents of a trapframe, - [/u] [addr], + [/l] [addr], addr:\tdisplay this trap frame (current kernel frame otherwise)\n - /u:\tdisplay the current userland trap frame) }, + /l:\tdisplay the trap frame from lwp) }, { DDB_ADD_CMD(NULL, NULL, 0, NULL, NULL, NULL) } };
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Dec 29 22:13:24 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: No need for sync_caches - f[di]cache already issue the sync instruction. To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.85 src/sys/arch/hppa/hppa/pmap.c:1.86 --- src/sys/arch/hppa/hppa/pmap.c:1.85 Fri Dec 23 16:38:50 2011 +++ src/sys/arch/hppa/hppa/pmap.c Thu Dec 29 22:13:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.85 2011/12/23 16:38:50 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.86 2011/12/29 22:13:23 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.85 2011/12/23 16:38:50 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.86 2011/12/29 22:13:23 skrll Exp $); #include opt_cputype.h @@ -1593,9 +1593,7 @@ pmap_procwr(struct proc *p, vaddr_t va, pmap_t pmap = p-p_vmspace-vm_map.pmap; fdcache(pmap-pm_space, va, len); - sync_caches(); ficache(pmap-pm_space, va, len); - sync_caches(); } static inline void
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Dec 30 07:25:00 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Cope with userland mappings of unmanaged pages (i.e. device memory being mmap'ed), by properly making these mappings uncached, and correctly accounting their removal to not get stuck with leftover pte pages. From OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.86 src/sys/arch/hppa/hppa/pmap.c:1.87 --- src/sys/arch/hppa/hppa/pmap.c:1.86 Thu Dec 29 22:13:23 2011 +++ src/sys/arch/hppa/hppa/pmap.c Fri Dec 30 07:25:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.86 2011/12/29 22:13:23 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.87 2011/12/30 07:25:00 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.86 2011/12/29 22:13:23 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.87 2011/12/30 07:25:00 skrll Exp $); #include opt_cputype.h @@ -230,6 +230,8 @@ void pmap_dump_pv(paddr_t); void pmap_page_remove_locked(struct vm_page *); int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t); +#define IS_IOPAGE_P(pa) ((pa) = HPPA_IOBEGIN) + /* un-invert PVF_REF */ #define pmap_pvh_attrs(a) \ (((a) (PVF_MOD|PVF_REF)) ^ PVF_REF) @@ -503,6 +505,9 @@ pmap_dump_pv(paddr_t pa) struct pv_entry *pve; pg = PHYS_TO_VM_PAGE(pa); + if (pg == NULL) + return; + md = VM_PAGE_TO_MD(pg); db_printf(pg %p attr 0x%08x\n, pg, md-pvh_attrs); for (pve = md-pvh_list; pve; pve = pve-pv_next) @@ -1102,41 +1107,38 @@ pmap_destroy(pmap_t pmap) #ifdef DIAGNOSTIC while ((pg = TAILQ_FIRST(pmap-pm_obj.memq))) { pt_entry_t *pde, *epde; - struct vm_page *sheep; - struct pv_entry *haggis; - - if (pg == pmap-pm_pdir_pg) - continue; - + struct vm_page *spg; + struct pv_entry *pv, *npv; + paddr_t pa; + + KASSERT(pg != pmap-pm_pdir_pg); + pa = VM_PAGE_TO_PHYS(pg); + DPRINTF(PDB_FOLLOW, (%s(%p): stray ptp - 0x%lx w/ %d ents:, __func__, pmap, VM_PAGE_TO_PHYS(pg), + 0x%lx w/ %d ents:, __func__, pmap, pa, pg-wire_count - 1)); - pde = (pt_entry_t *)VM_PAGE_TO_PHYS(pg); - epde = (pt_entry_t *)(VM_PAGE_TO_PHYS(pg) + PAGE_SIZE); + pde = (pt_entry_t *)pa; + epde = (pt_entry_t *)(pa + PAGE_SIZE); for (; pde epde; pde++) { if (*pde == 0) continue; - sheep = PHYS_TO_VM_PAGE(PTE_PAGE(*pde)); - struct vm_page_md * const md = VM_PAGE_TO_MD(sheep); - for (haggis = md-pvh_list; haggis != NULL; ) -if (haggis-pv_pmap == pmap) { - - DPRINTF(PDB_FOLLOW, ( 0x%lx, - haggis-pv_va)); - - pmap_remove(pmap, - haggis-pv_va PV_VAMASK, - haggis-pv_va + PAGE_SIZE); - - /* - * exploit the sacred knowledge of - * lambeous ozzmosis - */ - haggis = md-pvh_list; -} else - haggis = haggis-pv_next; + spg = PHYS_TO_VM_PAGE(PTE_PAGE(*pde)); + if (spg == NULL) +continue; + + struct vm_page_md * const md = VM_PAGE_TO_MD(spg); + for (pv = md-pvh_list; pv != NULL; pv = npv) { +npv = pv-pv_next; +if (pv-pv_pmap != pmap) + continue; + +DPRINTF(PDB_FOLLOW, ( 0x%lx, pv-pv_va)); + +pmap_remove(pmap, pv-pv_va PV_VAMASK, +(pv-pv_va PV_VAMASK) + PAGE_SIZE); + } } DPRINTF(PDB_FOLLOW, (\n)); } @@ -1178,7 +1180,7 @@ pmap_enter(pmap_t pmap, vaddr_t va, padd volatile pt_entry_t *pde; pt_entry_t pte; struct vm_page *pg, *ptp = NULL; - struct pv_entry *pve; + struct pv_entry *pve = NULL; bool wired = (flags PMAP_WIRED) != 0; DPRINTF(PDB_FOLLOW|PDB_ENTER, @@ -1218,15 +1220,16 @@ pmap_enter(pmap_t pmap, vaddr_t va, padd } pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte)); - pve = pmap_pv_remove(pg, pmap, va); + if (pg != NULL) { + pve = pmap_pv_remove(pg, pmap, va); - struct vm_page_md * const md = VM_PAGE_TO_MD(pg); - md-pvh_attrs |= pmap_pvh_attrs(pte); + struct vm_page_md * const md = VM_PAGE_TO_MD(pg); + md-pvh_attrs |= pmap_pvh_attrs(pte); + } } else { DPRINTF(PDB_ENTER, (%s: new mapping 0x%lx - 0x%lx\n, __func__, va, pa)); pte = PTE_PROT(TLB_REFTRAP); - pve = NULL; pmap-pm_stats.resident_count++; if (wired) pmap-pm_stats.wired_count++; @@ -1254,6 +1257,8 @@ enter: /* preserve old ref mod */ pte = pa | PTE_PROT(pmap_prot(pmap, prot)) | (pte PTE_PROT(TLB_UNCACHEABLE|TLB_DIRTY|TLB_REFTRAP)); + if (IS_IOPAGE_P(pa)) + pte |= PTE_PROT(TLB_UNCACHEABLE); if (wired) pte |= PTE_PROT(TLB_WIRED); pmap_pte_set(pde, va, pte); @@ -1278,7 +1283,7 @@ pmap_remove(pmap_t pmap, vaddr_t sva, va struct pv_entry *pve; volatile pt_entry_t *pde = NULL; pt_entry_t pte; - struct vm_page *pg; + struct vm_page *pg, *ptp; vaddr_t
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Dec 30 07:41:58 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: G/C pmap_page_remove_locked prototype. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.87 src/sys/arch/hppa/hppa/pmap.c:1.88 --- src/sys/arch/hppa/hppa/pmap.c:1.87 Fri Dec 30 07:25:00 2011 +++ src/sys/arch/hppa/hppa/pmap.c Fri Dec 30 07:41:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.87 2011/12/30 07:25:00 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.88 2011/12/30 07:41:58 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.87 2011/12/30 07:25:00 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.88 2011/12/30 07:41:58 skrll Exp $); #include opt_cputype.h @@ -227,7 +227,6 @@ void pmap_dump_table(pa_space_t, vaddr_t void pmap_dump_pv(paddr_t); #endif -void pmap_page_remove_locked(struct vm_page *); int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t); #define IS_IOPAGE_P(pa) ((pa) = HPPA_IOBEGIN)
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Fri Dec 23 16:38:51 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.84 src/sys/arch/hppa/hppa/pmap.c:1.85 --- src/sys/arch/hppa/hppa/pmap.c:1.84 Fri Dec 23 16:35:00 2011 +++ src/sys/arch/hppa/hppa/pmap.c Fri Dec 23 16:38:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.84 2011/12/23 16:35:00 skrll Exp $ */ +/* $NetBSD: pmap.c,v 1.85 2011/12/23 16:38:50 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.84 2011/12/23 16:35:00 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.85 2011/12/23 16:38:50 skrll Exp $); #include opt_cputype.h @@ -1596,7 +1596,6 @@ pmap_procwr(struct proc *p, vaddr_t va, sync_caches(); ficache(pmap-pm_space, va, len); sync_caches(); - } static inline void
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Tue Dec 13 12:55:51 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: kobj_machdep.c Log Message: Fix DIR21L relocations where we missed a bit of 'b' Add support for DPREL relocations. Modulo debug information in modules /usr/tests/modules now passes all tests on NetBSD/hp700 (with a MODULAR kernel) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/hppa/kobj_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/hppa/hppa/kobj_machdep.c diff -u src/sys/arch/hppa/hppa/kobj_machdep.c:1.5 src/sys/arch/hppa/hppa/kobj_machdep.c:1.6 --- src/sys/arch/hppa/hppa/kobj_machdep.c:1.5 Thu Apr 30 15:34:24 2009 +++ src/sys/arch/hppa/hppa/kobj_machdep.c Tue Dec 13 12:55:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: kobj_machdep.c,v 1.5 2009/04/30 15:34:24 skrll Exp $ */ +/* $NetBSD: kobj_machdep.c,v 1.6 2011/12/13 12:55:50 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.5 2009/04/30 15:34:24 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: kobj_machdep.c,v 1.6 2011/12/13 12:55:50 skrll Exp $); #define ELFSIZE ARCH_ELFSIZE @@ -105,6 +105,9 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas Elf_Addr addr, value; Elf_Word rtype, symidx; const Elf_Rela *rela; + extern int __data_start; + + unsigned int GP = (int) __data_start; if (!isrela) { printf(kobj_reloc: only support RELA relocations\n); @@ -151,7 +154,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas value = LR(addr, value); *where |= (((value 31) 0x001) 0) | - (((value 20) 0x3ff) 1) | + (((value 20) 0x7ff) 1) | (((value 18) 0x003) 14) | (((value 13) 0x01f) 16) | (((value 11) 0x003) 12); @@ -170,11 +173,28 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas (((value 0x003ff) 1) 2); /* w2 */ break; -#if 0 - case R_TYPE(DPREL17F): + case R_TYPE(DPREL14R): + /* RR(symbol - GP, addend) */ + addr = kobj_sym_lookup(ko, symidx); + value = RR(addr - GP, value); + *where |= + (((value 0) 0x1fff) 1) | + (((value 13) 0x1) 0); + break; + + case R_TYPE(DPREL21L): + /* LR(symbol - GP, addend) */ + addr = kobj_sym_lookup(ko, symidx); + value = LR(addr - GP, value); + *where |= + (((value 31) 0x001) 0) | + (((value 20) 0x7ff) 1) | + (((value 18) 0x003) 14) | + (((value 13) 0x01f) 16) | + (((value 11) 0x003) 12); break; -#endif + case R_TYPE(SEGREL32): /* symbol - SB + addend */ /* XXX SB */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Dec 5 07:34:51 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: pmap.c Log Message: Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/arch/hppa/hppa/pmap.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/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.81 src/sys/arch/hppa/hppa/pmap.c:1.82 --- src/sys/arch/hppa/hppa/pmap.c:1.81 Sun Jun 12 03:35:41 2011 +++ src/sys/arch/hppa/hppa/pmap.c Mon Dec 5 07:34:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.81 2011/06/12 03:35:41 rmind Exp $ */ +/* $NetBSD: pmap.c,v 1.82 2011/12/05 07:34:50 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.81 2011/06/12 03:35:41 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.82 2011/12/05 07:34:50 skrll Exp $); #include opt_cputype.h @@ -1247,7 +1247,6 @@ pmap_enter(pmap_t pmap, vaddr_t va, padd if (pmap_check_alias(pg, va, pte)) pmap_page_remove(pg); pmap_pv_enter(pg, pve, pmap, va, ptp, 0); - } else if (pve) { pmap_pv_free(pve); } @@ -1316,7 +1315,6 @@ pmap_remove(pmap_t pmap, vaddr_t sva, va (pg = PHYS_TO_VM_PAGE(PTE_PAGE(pte { struct vm_page_md * const md = VM_PAGE_TO_MD(pg); - pve = pmap_pv_remove(pg, pmap, sva); md-pvh_attrs |= pmap_pvh_attrs(pte); @@ -1331,7 +1329,6 @@ pmap_remove(pmap_t pmap, vaddr_t sva, va DPRINTF(PDB_FOLLOW|PDB_REMOVE, (%s: leaving\n, __func__)); } - void pmap_write_protect(pmap_t pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot) { @@ -1569,7 +1566,6 @@ pmap_extract(pmap_t pmap, vaddr_t va, pa return false; } - /* * pmap_activate(lwp) * @@ -1592,7 +1588,6 @@ pmap_activate(struct lwp *l) mtctl(pmap-pm_pid, CR_PIDR2); } - static inline void pmap_flush_page(struct vm_page *pg, bool purge) {
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: chs Date: Sat Oct 1 15:50:46 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: copy.S Log Message: fix EXIT label for fusufault, caught by new binutils. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hppa/hppa/copy.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/hppa/hppa/copy.S diff -u src/sys/arch/hppa/hppa/copy.S:1.18 src/sys/arch/hppa/hppa/copy.S:1.19 --- src/sys/arch/hppa/hppa/copy.S:1.18 Wed Jul 7 01:18:39 2010 +++ src/sys/arch/hppa/hppa/copy.S Sat Oct 1 15:50:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: copy.S,v 1.18 2010/07/07 01:18:39 chs Exp $ */ +/* $NetBSD: copy.S,v 1.19 2011/10/01 15:50:46 chs Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -126,7 +126,7 @@ LEAF_ENTRY_NOPROFILE(fusufault) ALTENTRY(fusubadaddr) bv 0(%rp) ldi -1, %ret0 -EXIT(fusuexit) +EXIT(fusufault) FUX(fubyte, ldb) FUX(fusword, ldh)
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Mar 3 09:37:22 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: process_machdep.c Log Message: Deal with cr27 in process_{read,write}_regs To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hppa/hppa/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/hppa/hppa/process_machdep.c diff -u src/sys/arch/hppa/hppa/process_machdep.c:1.16 src/sys/arch/hppa/hppa/process_machdep.c:1.17 --- src/sys/arch/hppa/hppa/process_machdep.c:1.16 Fri Jan 14 02:06:26 2011 +++ src/sys/arch/hppa/hppa/process_machdep.c Thu Mar 3 09:37:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.16 2011/01/14 02:06:26 rmind Exp $ */ +/* $NetBSD: process_machdep.c,v 1.17 2011/03/03 09:37:21 skrll Exp $ */ /* $OpenBSD: process_machdep.c,v 1.3 1999/06/18 05:19:52 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: process_machdep.c,v 1.16 2011/01/14 02:06:26 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: process_machdep.c,v 1.17 2011/03/03 09:37:21 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -99,9 +99,9 @@ regs-r_sr6 = tf-tf_sr6; regs-r_sr7 = tf-tf_sr7; + regs-r_cr27 = tf-tf_cr27; #if 0 - regs-r_cr26 = tf-tf_xxx; - regs-r_cr27 = tf-tf_xxx; + regs-r_cr26 = tf-tf_cr26; #endif return 0; @@ -168,6 +168,11 @@ tf-tf_sr3 = regs-r_sr3; tf-tf_sr4 = regs-r_sr4; + tf-tf_cr27 = regs-r_cr27; +#if 0 + tf-tf_cr26 = regs-r_cr26; +#endif + return 0; }
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Feb 28 21:20:50 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Remove old/incorrect comment. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.58 src/sys/arch/hppa/hppa/trap.S:1.59 --- src/sys/arch/hppa/hppa/trap.S:1.58 Sat Feb 26 07:54:48 2011 +++ src/sys/arch/hppa/hppa/trap.S Mon Feb 28 21:20:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.58 2011/02/26 07:54:48 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.59 2011/02/28 21:20:50 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -1914,7 +1914,6 @@ * - tr7: old r1 */ - /* do not overwrite %tr4(%cr28) it contains the contents of r24 */ mtctl %t3, %tr2 GET_CURCPU(%t3)
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Feb 28 21:22:35 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Don't use %tr3 (aka cr27) in emu trap. cr27 is now used for lwp private info. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.59 src/sys/arch/hppa/hppa/trap.S:1.60 --- src/sys/arch/hppa/hppa/trap.S:1.59 Mon Feb 28 21:20:50 2011 +++ src/sys/arch/hppa/hppa/trap.S Mon Feb 28 21:22:35 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.59 2011/02/28 21:20:50 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.60 2011/02/28 21:22:35 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -955,7 +955,7 @@ * to use. hppa_fpu_swap deliberately uses only these registers and %r1 * and %arg0. */ - mtctl %arg1, %tr3 + mtctl %arg1, %tr4 mtctl %rp, %tr5 /* Call hppa_fpu_swap. */ @@ -968,7 +968,7 @@ /* Restore registers and rfi. */ mfctl %tr5, %rp - mfctl %tr3, %arg1 + mfctl %tr4, %arg1 mfctl %tr2, %arg0 mfctl %tr7, %r1 rfi
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Mon Feb 28 21:24:25 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: db_trace.c Log Message: Add the trapframe pointer to the syscall information. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hppa/hppa/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/hppa/hppa/db_trace.c diff -u src/sys/arch/hppa/hppa/db_trace.c:1.9 src/sys/arch/hppa/hppa/db_trace.c:1.10 --- src/sys/arch/hppa/hppa/db_trace.c:1.9 Thu Jul 1 02:38:27 2010 +++ src/sys/arch/hppa/hppa/db_trace.c Mon Feb 28 21:24:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: db_trace.c,v 1.9 2010/07/01 02:38:27 rmind Exp $ */ +/* $NetBSD: db_trace.c,v 1.10 2011/02/28 21:24:25 skrll Exp $ */ /* $OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.9 2010/07/01 02:38:27 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.10 2011/02/28 21:24:25 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -153,9 +153,9 @@ tf = (struct trapframe *)((char *)scargs - sizeof(*tf)); if (tf-tf_flags TFF_SYS) -pr(-- syscall #%d(%x, %x, %x, %x, ...)\n, +pr(-- syscall #%d(%x, %x, %x, %x, ...) (%p)\n, tf-tf_t1, scargs[1], scargs[2], -scargs[3], scargs[4]); +scargs[3], scargs[4], tf); else pr(-- trap #%d (%p) %s\n, tf-tf_flags 0x3f, tf, (tf-tf_flags T_USER)? from user :
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Feb 26 07:52:32 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: (Attempt to) bundle some stw/ldws and remove redundant CR_TLS save. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.55 src/sys/arch/hppa/hppa/trap.S:1.56 --- src/sys/arch/hppa/hppa/trap.S:1.55 Thu Feb 24 08:57:39 2011 +++ src/sys/arch/hppa/hppa/trap.S Sat Feb 26 07:52:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.55 2011/02/24 08:57:39 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.56 2011/02/26 07:52:32 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -508,13 +508,13 @@ mtctl %t2, %pidr4 #endif ldw TF_CR27(%sr3, %t3), %t1 + ldw TF_CR30(%sr3, %t3), %t2 mtctl %t1, CR_TLS + mtctl %t2, CR_FPPADDR ldw TF_CR0(%sr3, %t3), %t1 mtctl %t1, %rctr - ldw TF_CR30(%sr3, %t3), %t1 - mtctl %t1, CR_FPPADDR GET_CURCPU_SPACE(%sr3, %t3) @@ -2091,9 +2091,6 @@ stw %t1, TF_SR7(%sr3, %t3) stw %t2, TF_CR9(%sr3, %t3) - mfctl CR_TLS, %t1 - stw %t1, TF_CR27(%sr3, %t3) - mtsp %r0, %sr0 mtsp %r0, %sr1 mtsp %r0, %sr2 @@ -2201,10 +2198,10 @@ stw %t1, TF_CR24(%t3) stw %t2, TF_CR28(%t3) - mfctl CR_TLS, %t1 - stw %t1, TF_CR27(%t3) #endif + mfctl CR_TLS, %t1 mfctl CR_FPPADDR, %t2 + stw %t1, TF_CR27(%t3) stw %t2, TF_CR30(%t3) /*
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Feb 26 07:53:47 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Add a comment. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.56 src/sys/arch/hppa/hppa/trap.S:1.57 --- src/sys/arch/hppa/hppa/trap.S:1.56 Sat Feb 26 07:52:32 2011 +++ src/sys/arch/hppa/hppa/trap.S Sat Feb 26 07:53:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.56 2011/02/26 07:52:32 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.57 2011/02/26 07:53:47 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -2233,6 +2233,7 @@ bb,=,n %arg0, TFF_LAST_POS, L$trap_return nop + /* load curlwp's trapframe pointer */ GET_CURLWP(%t2) ldw L_MD(%t2), %t3
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Feb 26 07:54:48 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.57 src/sys/arch/hppa/hppa/trap.S:1.58 --- src/sys/arch/hppa/hppa/trap.S:1.57 Sat Feb 26 07:53:47 2011 +++ src/sys/arch/hppa/hppa/trap.S Sat Feb 26 07:54:48 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.57 2011/02/26 07:53:47 skrll Exp $ */ +/* $NetBSD: trap.S,v 1.58 2011/02/26 07:54:48 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -515,7 +515,6 @@ ldw TF_CR0(%sr3, %t3), %t1 mtctl %t1, %rctr - GET_CURCPU_SPACE(%sr3, %t3) /*
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Feb 24 08:57:39 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: trap.S Log Message: No need to save CR_TLS twice in the DDB case. hi joerg. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S diff -u src/sys/arch/hppa/hppa/trap.S:1.54 src/sys/arch/hppa/hppa/trap.S:1.55 --- src/sys/arch/hppa/hppa/trap.S:1.54 Thu Feb 24 04:28:45 2011 +++ src/sys/arch/hppa/hppa/trap.S Thu Feb 24 08:57:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.S,v 1.54 2011/02/24 04:28:45 joerg Exp $ */ +/* $NetBSD: trap.S,v 1.55 2011/02/24 08:57:39 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -382,9 +382,6 @@ mfctl %cr28, %arg1 stw %arg0, TF_CR24-TRAPFRAME_SIZEOF(%sr1, %t3) stw %arg1, TF_CR28-TRAPFRAME_SIZEOF(%sr1, %t3) - - mfctl CR_TLS, %arg0 - stw %arg0, TF_CR27-TRAPFRAME_SIZEOF(%sr1, %t3) #endif /* setup kernel context */
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Jan 30 09:58:03 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.18 src/sys/arch/hppa/hppa/lock_stubs.S:1.19 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.18 Sat Jan 22 19:10:16 2011 +++ src/sys/arch/hppa/hppa/lock_stubs.S Sun Jan 30 09:58:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.18 2011/01/22 19:10:16 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.19 2011/01/30 09:58:03 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ comb, %arg1, %t1, 1f copy %t1,%ret0 _lock_cas_ras_end: - stw %arg2,0(%arg0) + stw %arg2, 0(%arg0) copy %arg1,%ret0 1: bv,n %r0(%rp) @@ -103,10 +103,10 @@ /* * If its a spin mutex or unowned, we have to take the slow path. */ - ldi MUTEX_ADAPTIVE_UNOWNED,%t1 + ldi MUTEX_ADAPTIVE_UNOWNED, %t1 ldw MTX_OWNER(%arg0),%t2 - depi 0,27,1,%t2 /* bit27 = 0 */ - comb,= %t1,%t2,.Lexit_slowpath + depi 0, 27, 1, %t2 /* bit27 = 0 */ + comb,= %t1, %t2, .Lexit_slowpath nop /* @@ -114,11 +114,11 @@ * field and release the lock. */ - ldi 1,%t2/* unlocked = 1 */ + ldi 1, %t2/* unlocked = 1 */ ldo (MTX_LOCK + HPPA_LDCW_ALIGN - 1)(%arg0), %t3 depi 0, 31, 4, %t3 - stw %t1,MTX_OWNER(%arg0) - stw %t2,0(%t3) /* %t3 is properly aligned */ + stw %t1, MTX_OWNER(%arg0) + stw %t2, 0(%t3) /* %t3 is properly aligned */ sync /* @@ -126,8 +126,8 @@ * will happen in sequence. If it's set then trap into mutex_wakeup() * to wake up any threads sleeping on the lock. */ - ldb MTX_WAITERS(%arg0),%t4 - comib,= 0,%t4,.Lexit_done + ldb MTX_WAITERS(%arg0), %t4 + comib,= 0, %t4, .Lexit_done nop ldil L%mutex_wakeup, %t1 @@ -157,9 +157,9 @@ * mutex_vector_enter() if the owners field is not clear. */ - ldi MUTEX_ADAPTIVE_UNOWNED,%t1 - ldw MTX_OWNER(%arg0),%t2 - comb,=,n %t1,%t2,.Lmutexunowned + ldi MUTEX_ADAPTIVE_UNOWNED, %t1 + ldw MTX_OWNER(%arg0), %t2 + comb,=,n %t1, %t2, .Lmutexunowned .Lenter_slowpath: ldil L%mutex_vector_enter, %t1 @@ -184,13 +184,13 @@ ldcw 0(%t1), %ret0 mutex_enter_crit_start: - comib,= 0,%ret0,.Lenter_slowpath + comib,= 0, %ret0, .Lenter_slowpath mfctl CR_CURLWP, %t2 bv %r0(%rp) mutex_enter_crit_end: - stw %t2,MTX_OWNER(%arg0) + stw %t2, MTX_OWNER(%arg0) EXIT(mutex_enter) #endif /* !LOCKDEBUG */ @@ -222,8 +222,6 @@ #define I64 \ I8 I8 I8 I8 I8 I8 I8 I8 - - .section .data .align 4096 .export _lock_hash, data @@ -255,17 +253,17 @@ /* %t3 is the interlock address */ ldcw 0(%t3), %ret0 - comib,,n 0,%ret0, _lock_cas_mp_interlocked + comib,,n 0, %ret0, _lock_cas_mp_interlocked _lock_cas_mp_spin: - ldw 0(%t3),%ret0 - comib,= 0,%ret0, _lock_cas_mp_spin - nop + ldw 0(%t3), %ret0 + comib,= 0, %ret0, _lock_cas_mp_spin + nop ldcw 0(%t3), %ret0 - comib,= 0,%ret0, _lock_cas_mp_spin - nop + comib,= 0, %ret0, _lock_cas_mp_spin + nop _lock_cas_mp_interlocked: - ldw 0(%arg0),%ret0 + ldw 0(%arg0), %ret0 comclr, %arg1, %ret0, %r0 /* If *ptr != old, then nullify */ stw %arg2, 0(%arg0)
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Jan 30 10:09:23 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Don't use magic constant. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.19 src/sys/arch/hppa/hppa/lock_stubs.S:1.20 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.19 Sun Jan 30 09:58:03 2011 +++ src/sys/arch/hppa/hppa/lock_stubs.S Sun Jan 30 10:09:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.19 2011/01/30 09:58:03 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.20 2011/01/30 10:09:23 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -114,7 +114,7 @@ * field and release the lock. */ - ldi 1, %t2/* unlocked = 1 */ + ldi __SIMPLELOCK_RAW_UNLOCKED, %t2 /* unlocked = 1 */ ldo (MTX_LOCK + HPPA_LDCW_ALIGN - 1)(%arg0), %t3 depi 0, 31, 4, %t3 stw %t1, MTX_OWNER(%arg0)
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Jan 30 22:36:12 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Tweak a comment. Suggestion from rmind@. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.20 src/sys/arch/hppa/hppa/lock_stubs.S:1.21 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.20 Sun Jan 30 10:09:23 2011 +++ src/sys/arch/hppa/hppa/lock_stubs.S Sun Jan 30 22:36:12 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.20 2011/01/30 10:09:23 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.21 2011/01/30 22:36:12 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -152,9 +152,9 @@ LEAF_ENTRY(mutex_enter) /* - * It might be a spin lock, or might be already owned. - * We short circut the request and go straight into - * mutex_vector_enter() if the owners field is not clear. + * It might be a spin lock (c.f. MUTEX_SPIN_FLAG) or might be + * already owned. We short circut the request and go straight + * into mutex_vector_enter() if the owners field is not 'unowned'. */ ldi MUTEX_ADAPTIVE_UNOWNED, %t1
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sun Jan 30 22:36:38 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Grammar. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.21 src/sys/arch/hppa/hppa/lock_stubs.S:1.22 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.21 Sun Jan 30 22:36:12 2011 +++ src/sys/arch/hppa/hppa/lock_stubs.S Sun Jan 30 22:36:37 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.21 2011/01/30 22:36:12 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.22 2011/01/30 22:36:37 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ LEAF_ENTRY(mutex_exit) /* - * If its a spin mutex or unowned, we have to take the slow path. + * If it's a spin mutex or unowned, we have to take the slow path. */ ldi MUTEX_ADAPTIVE_UNOWNED, %t1 ldw MTX_OWNER(%arg0),%t2
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Jan 22 19:21:40 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: db_interface.c Log Message: Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hppa/hppa/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/hppa/hppa/db_interface.c diff -u src/sys/arch/hppa/hppa/db_interface.c:1.22 src/sys/arch/hppa/hppa/db_interface.c:1.23 --- src/sys/arch/hppa/hppa/db_interface.c:1.22 Fri Jun 4 09:25:18 2010 +++ src/sys/arch/hppa/hppa/db_interface.c Sat Jan 22 19:21:40 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.22 2010/06/04 09:25:18 skrll Exp $ */ +/* $NetBSD: db_interface.c,v 1.23 2011/01/22 19:21:40 skrll Exp $ */ /* $OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.22 2010/06/04 09:25:18 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.23 2011/01/22 19:21:40 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -60,70 +60,71 @@ db_regs_t ddb_regs; const struct db_variable db_regs[] = { - { flags, (long *)ddb_regs.tf_flags, FCN_NULL }, - { r1,(long *)ddb_regs.tf_r1, FCN_NULL }, - { rp,(long *)ddb_regs.tf_rp, FCN_NULL }, - { r3,(long *)ddb_regs.tf_r3, FCN_NULL }, - { r4,(long *)ddb_regs.tf_r4, FCN_NULL }, - { r5,(long *)ddb_regs.tf_r5, FCN_NULL }, - { r6,(long *)ddb_regs.tf_r6, FCN_NULL }, - { r7,(long *)ddb_regs.tf_r7, FCN_NULL }, - { r8,(long *)ddb_regs.tf_r8, FCN_NULL }, - { r9,(long *)ddb_regs.tf_r9, FCN_NULL }, - { r10, (long *)ddb_regs.tf_r10, FCN_NULL }, - { r11, (long *)ddb_regs.tf_r11, FCN_NULL }, - { r12, (long *)ddb_regs.tf_r12, FCN_NULL }, - { r13, (long *)ddb_regs.tf_r13, FCN_NULL }, - { r14, (long *)ddb_regs.tf_r14, FCN_NULL }, - { r15, (long *)ddb_regs.tf_r15, FCN_NULL }, - { r16, (long *)ddb_regs.tf_r16, FCN_NULL }, - { r17, (long *)ddb_regs.tf_r17, FCN_NULL }, - { r18, (long *)ddb_regs.tf_r18, FCN_NULL }, - { t4,(long *)ddb_regs.tf_t4, FCN_NULL }, - { t3,(long *)ddb_regs.tf_t3, FCN_NULL }, - { t2,(long *)ddb_regs.tf_t2, FCN_NULL }, - { t1,(long *)ddb_regs.tf_t1, FCN_NULL }, - { arg3, (long *)ddb_regs.tf_arg3, FCN_NULL }, - { arg2, (long *)ddb_regs.tf_arg2, FCN_NULL }, - { arg1, (long *)ddb_regs.tf_arg1, FCN_NULL }, - { arg0, (long *)ddb_regs.tf_arg0, FCN_NULL }, - { dp,(long *)ddb_regs.tf_dp,FCN_NULL }, - { ret0, (long *)ddb_regs.tf_ret0, FCN_NULL }, - { ret1, (long *)ddb_regs.tf_ret1, FCN_NULL }, - { sp,(long *)ddb_regs.tf_sp,FCN_NULL }, - { r31, (long *)ddb_regs.tf_r31, FCN_NULL }, - { sar, (long *)ddb_regs.tf_sar, FCN_NULL }, - - { eirr, (long *)ddb_regs.tf_eirr, FCN_NULL }, - { eiem, (long *)ddb_regs.tf_eiem, FCN_NULL }, - { iir, (long *)ddb_regs.tf_iir, FCN_NULL }, - { isr, (long *)ddb_regs.tf_isr, FCN_NULL }, - { ior, (long *)ddb_regs.tf_ior, FCN_NULL }, - { ipsw, (long *)ddb_regs.tf_ipsw, FCN_NULL }, - { iisqh, (long *)ddb_regs.tf_iisq_head, FCN_NULL }, - { iioqh, (long *)ddb_regs.tf_iioq_head, FCN_NULL }, - { iisqt, (long *)ddb_regs.tf_iisq_tail, FCN_NULL }, - { iioqt, (long *)ddb_regs.tf_iioq_tail, FCN_NULL }, - - { sr0, (long *)ddb_regs.tf_sr0, FCN_NULL }, - { sr1, (long *)ddb_regs.tf_sr1, FCN_NULL }, - { sr2, (long *)ddb_regs.tf_sr2, FCN_NULL }, - { sr3, (long *)ddb_regs.tf_sr3, FCN_NULL }, - { sr4, (long *)ddb_regs.tf_sr4, FCN_NULL }, - { sr5, (long *)ddb_regs.tf_sr5, FCN_NULL }, - { sr6, (long *)ddb_regs.tf_sr6, FCN_NULL }, - { sr7, (long *)ddb_regs.tf_sr7, FCN_NULL }, + { flags, (long *)ddb_regs.tf_flags, FCN_NULL }, + { r1, (long *)ddb_regs.tf_r1, FCN_NULL }, + { rp, (long *)ddb_regs.tf_rp, FCN_NULL }, + { r3, (long *)ddb_regs.tf_r3, FCN_NULL }, + { r4, (long *)ddb_regs.tf_r4, FCN_NULL }, + { r5, (long *)ddb_regs.tf_r5, FCN_NULL }, + { r6, (long *)ddb_regs.tf_r6, FCN_NULL }, + { r7, (long *)ddb_regs.tf_r7, FCN_NULL }, + { r8, (long *)ddb_regs.tf_r8, FCN_NULL }, + { r9, (long *)ddb_regs.tf_r9, FCN_NULL }, + { r10, (long *)ddb_regs.tf_r10, FCN_NULL }, + { r11, (long *)ddb_regs.tf_r11, FCN_NULL }, + { r12, (long *)ddb_regs.tf_r12, FCN_NULL }, + { r13, (long *)ddb_regs.tf_r13, FCN_NULL }, + { r14, (long *)ddb_regs.tf_r14, FCN_NULL }, + { r15, (long *)ddb_regs.tf_r15, FCN_NULL }, + { r16, (long *)ddb_regs.tf_r16, FCN_NULL }, + { r17, (long *)ddb_regs.tf_r17, FCN_NULL }, + { r18, (long *)ddb_regs.tf_r18, FCN_NULL }, + { t4, (long *)ddb_regs.tf_t4, FCN_NULL }, + { t3, (long *)ddb_regs.tf_t3, FCN_NULL }, + { t2, (long *)ddb_regs.tf_t2, FCN_NULL }, + { t1, (long *)ddb_regs.tf_t1, FCN_NULL }, + { arg3, (long *)ddb_regs.tf_arg3, FCN_NULL }, + { arg2, (long *)ddb_regs.tf_arg2, FCN_NULL }, + { arg1, (long *)ddb_regs.tf_arg1, FCN_NULL }, + { arg0,
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Sat Jan 22 20:24:48 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: db_interface.c Log Message: A couple more registers and their common usage. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hppa/hppa/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/hppa/hppa/db_interface.c diff -u src/sys/arch/hppa/hppa/db_interface.c:1.25 src/sys/arch/hppa/hppa/db_interface.c:1.26 --- src/sys/arch/hppa/hppa/db_interface.c:1.25 Sat Jan 22 19:35:48 2011 +++ src/sys/arch/hppa/hppa/db_interface.c Sat Jan 22 20:24:48 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.25 2011/01/22 19:35:48 skrll Exp $ */ +/* $NetBSD: db_interface.c,v 1.26 2011/01/22 20:24:48 skrll Exp $ */ /* $OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.25 2011/01/22 19:35:48 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.26 2011/01/22 20:24:48 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -62,8 +62,8 @@ const struct db_variable db_regs[] = { { flags, (long *)ddb_regs.tf_flags, FCN_NULL }, { r1, (long *)ddb_regs.tf_r1, FCN_NULL }, - { rp, (long *)ddb_regs.tf_rp, FCN_NULL }, - { r3, (long *)ddb_regs.tf_r3, FCN_NULL }, + { r2(rp), (long *)ddb_regs.tf_rp, FCN_NULL }, + { r3(fp), (long *)ddb_regs.tf_r3, FCN_NULL }, { r4, (long *)ddb_regs.tf_r4, FCN_NULL }, { r5, (long *)ddb_regs.tf_r5, FCN_NULL }, { r6, (long *)ddb_regs.tf_r6, FCN_NULL },
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Jan 20 19:49:23 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Tweak comment. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.14 src/sys/arch/hppa/hppa/lock_stubs.S:1.15 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.14 Thu Apr 30 07:01:27 2009 +++ src/sys/arch/hppa/hppa/lock_stubs.S Thu Jan 20 19:49:22 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.14 2009/04/30 07:01:27 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.15 2011/01/20 19:49:22 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ #include assym.h /* - * uintptr_t _lock_cas(volatile uintptr_t *val, uintptr_t old, uintptr_t new); + * uintptr_t _lock_cas(volatile uintptr_t *ptr, uintptr_t old, uintptr_t new); * * Perform an atomic compare-and-swap operation. *
CVS commit: src/sys/arch/hppa/hppa
Module Name:src Committed By: skrll Date: Thu Jan 20 19:50:41 UTC 2011 Modified Files: src/sys/arch/hppa/hppa: lock_stubs.S Log Message: Another comment tweak To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hppa/hppa/lock_stubs.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/hppa/hppa/lock_stubs.S diff -u src/sys/arch/hppa/hppa/lock_stubs.S:1.15 src/sys/arch/hppa/hppa/lock_stubs.S:1.16 --- src/sys/arch/hppa/hppa/lock_stubs.S:1.15 Thu Jan 20 19:49:22 2011 +++ src/sys/arch/hppa/hppa/lock_stubs.S Thu Jan 20 19:50:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.15 2011/01/20 19:49:22 skrll Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.16 2011/01/20 19:50:41 skrll Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -47,8 +47,8 @@ * * Perform an atomic compare-and-swap operation. * - * On single CPU systems, this can use a restartable sequence: - * there we don't need the overhead of interlocking. + * On single CPU systems this can use a restartable sequence as there + * we don't need the overhead of interlocking. */ #ifndef MULTIPROCESSOR