CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Fri Aug 6 05:22:21 UTC 2021 Modified Files: src/sys/arch/hp300/hp300: machdep.c Log Message: Add comments how mm_md_physacc() for hp300 works. mm_md_physacc() for all other hp300 pmap based m68k ports that copied hp300 implemantation should have been fixed properly. XXX: no mm(9) man pages that describe MD implementation API definitions. To generate a diff of this commit: cvs rdiff -u -r1.234 -r1.235 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.234 src/sys/arch/hp300/hp300/machdep.c:1.235 --- src/sys/arch/hp300/hp300/machdep.c:1.234 Thu Jun 11 19:20:43 2020 +++ src/sys/arch/hp300/hp300/machdep.c Fri Aug 6 05:22:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.234 2020/06/11 19:20:43 ad Exp $ */ +/* $NetBSD: machdep.c,v 1.235 2021/08/06 05:22:21 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.234 2020/06/11 19:20:43 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.235 2021/08/06 05:22:21 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -1164,6 +1164,10 @@ int mm_md_physacc(paddr_t pa, vm_prot_t prot) { + /* + * On the hp300, physical RAM is always located at the end of + * the physical address space, i.e. from 0x to lowram. + */ return (pa < lowram || pa >= 0xfffc) ? EFAULT : 0; }
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sat Oct 16 16:41:45 UTC 2010 Modified Files: src/sys/arch/hp300/hp300: machdep.c Log Message: Prepare empty module_init_md() for options MODULAR. XXX: Should we get rid of cpu_exec_aout_makecmds() for COMPAT_NOMID and XXX: COMPAT_44? Who still keeps such rare ancient commands? To generate a diff of this commit: cvs rdiff -u -r1.211 -r1.212 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.211 src/sys/arch/hp300/hp300/machdep.c:1.212 --- src/sys/arch/hp300/hp300/machdep.c:1.211 Mon Feb 8 19:02:28 2010 +++ src/sys/arch/hp300/hp300/machdep.c Sat Oct 16 16:41:45 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.211 2010/02/08 19:02:28 joerg Exp $ */ +/* $NetBSD: machdep.c,v 1.212 2010/10/16 16:41:45 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.211 2010/02/08 19:02:28 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.212 2010/10/16 16:41:45 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -109,6 +109,7 @@ #include #include #include +#include #ifdef DDB #include @@ -1277,3 +1278,13 @@ return ENOEXEC; } + +#ifdef MODULAR +/* + * Push any modules loaded by the bootloader etc. + */ +void +module_init_md(void) +{ +} +#endif
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Wed Dec 2 15:51:13 UTC 2009 Modified Files: src/sys/arch/hp300/hp300: locore.s pmap_bootstrap.c Log Message: Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc. Tested on HP9000/382. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/sys/arch/hp300/hp300/locore.s cvs rdiff -u -r1.39 -r1.40 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.147 src/sys/arch/hp300/hp300/locore.s:1.148 --- src/sys/arch/hp300/hp300/locore.s:1.147 Thu Nov 26 00:19:17 2009 +++ src/sys/arch/hp300/hp300/locore.s Wed Dec 2 15:51:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.147 2009/11/26 00:19:17 matt Exp $ */ +/* $NetBSD: locore.s,v 1.148 2009/12/02 15:51:12 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -552,14 +552,13 @@ /* select the software page size now */ lea _ASM_LABEL(tmpstk),%sp | temporary stack jbsr _C_LABEL(uvm_setpagesize) | select software page size -/* set kernel stack, user SP, and initial pcb */ - lea _C_LABEL(lwp0),%a2 | grab lwp0.l_addr - movl %a2@(L_ADDR),%a1 | set kernel stack to end of area - lea %a1@(USPACE-4),%sp | and curlwp so that we don't - movl %a2,_C_LABEL(curlwp) | deref NULL in trap() +/* call final pmap setup which initialize lwp0, curlwp, and curpcb */ + jbsr _C_LABEL(pmap_bootstrap_finalize) +/* set kernel stack, user SP */ + movl _C_LABEL(lwp0uarea),%a1 | + lea %a1@(USPACE-4),%sp | set kernel stack to end of area movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP - movl %a1,_C_LABEL(curpcb) | lwp0 is running tstl _C_LABEL(fputype) | Have an FPU? jeq Lenab2 | No, skip. Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.39 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.40 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.39 Fri Nov 27 03:23:09 2009 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Wed Dec 2 15:51:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.39 2009/11/27 03:23:09 rmind Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.40 2009/12/02 15:51:12 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,10 +36,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.39 2009/11/27 03:23:09 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.40 2009/12/02 15:51:12 tsutsui Exp $"); #include -#include #include #include @@ -94,7 +93,7 @@ void pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) { - paddr_t kstpa, kptpa, kptmpa, lkptpa, p0upa; + paddr_t kstpa, kptpa, kptmpa, lkptpa, lwp0upa; u_int nptpages, kstsize; st_entry_t protoste, *ste; pt_entry_t protopte, *pte, *epte; @@ -116,7 +115,7 @@ * * lkptpa last kernel PT page 1 page * - * p0upa proc 0 u-area UPAGES pages + * lwp0upa lwp 0 u-area UPAGES pages * * The KVA corresponding to any of these PAs is: * (PA - firstpa + KERNBASE). @@ -131,7 +130,7 @@ nextpa += PAGE_SIZE; lkptpa = nextpa; nextpa += PAGE_SIZE; - p0upa = nextpa; + lwp0upa = nextpa; nextpa += USPACE; kptpa = nextpa; nptpages = RELOC(Sysptsize, int) + @@ -330,7 +329,7 @@ } /* * Validate PTEs for kernel data/bss, dynamic data allocated - * by us so far (nextpa - firstpa bytes), and pages for proc0 + * by us so far (nextpa - firstpa bytes), and pages for lwp0 * u-area and page table allocated below (RW). */ epte = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)]; @@ -395,21 +394,21 @@ (vaddr_t)RELOC(intiobase, char *) + MMUBASE; /* - * Setup u-area for process 0. + * Setup u-area for lwp 0. */ /* * Zero the u-area. * NOTE: `pte' and `epte' aren't PTEs here. */ - pte = (u_int *)p0upa; - epte = (u_int *)(p0upa + USPACE); + pte = (u_int *)lwp0upa; + epte = (u_int *)(lwp0upa + USPACE); while (pte < epte) *pte++ = 0; /* - * Remember the u-area address so it can be loaded in the - * proc struct p_addr field later. + * Remember the u-area address so it can be loaded in the lwp0 + * via uvm_lwp_setuarea() later in pmap_bootstrap_finalize(). */ - RELOC(lwp0.l_addr, struct user *) = (struct user *)(p0upa - firstpa); + RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa; /* * VM data structures are now initialized, set up data for
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sat Dec 12 16:37:22 UTC 2009 Modified Files: src/sys/arch/hp300/hp300: locore.s Log Message: Allow NetBSD/hp300 kernel work with PGSHIFT==13, i.e. 8KB/page. Tested on HP9000/382 with 68040. XXX: 8KB/page won't work on HP MMU machines (i.e. HP320 and HP350). To generate a diff of this commit: cvs rdiff -u -r1.149 -r1.150 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.149 src/sys/arch/hp300/hp300/locore.s:1.150 --- src/sys/arch/hp300/hp300/locore.s:1.149 Fri Dec 11 18:28:35 2009 +++ src/sys/arch/hp300/hp300/locore.s Sat Dec 12 16:37:22 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.149 2009/12/11 18:28:35 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.150 2009/12/12 16:37:22 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -523,7 +523,11 @@ .long 0x4e7b0007 | movc %d0,%dtt1 .word 0xf4d8 | cinva bc .word 0xf518 | pflusha +#if PGSHIFT == 13 + movl #0xc000,%d0 +#else movl #0x8000,%d0 +#endif .long 0x4e7b0003 | movc %d0,%tc movl #0x80008000,%d0 movc %d0,%cacr | turn on both caches @@ -532,7 +536,11 @@ movl #MMU_IEN+MMU_FPE,INTIOBASE+MMUBASE+MMUCMD | enable 68881 and i-cache RELOC(prototc, %a2) +#if PGSHIFT == 13 + movl #0x82d08b00,%a2@ | value to load TC with +#else movl #0x82c0aa00,%a2@ | value to load TC with +#endif pmove %a2@,%tc | load it jmp Lenab1:l | forced not be pc-relative Lhpmmu3:
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sun Dec 13 12:21:27 UTC 2009 Modified Files: src/sys/arch/hp300/hp300: genassym.cf locore.s Log Message: Replace a couple of magic numbers with proper macro. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/hp300/hp300/genassym.cf cvs rdiff -u -r1.151 -r1.152 src/sys/arch/hp300/hp300/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/hp300/hp300/genassym.cf diff -u src/sys/arch/hp300/hp300/genassym.cf:1.40 src/sys/arch/hp300/hp300/genassym.cf:1.41 --- src/sys/arch/hp300/hp300/genassym.cf:1.40 Thu Dec 10 05:10:01 2009 +++ src/sys/arch/hp300/hp300/genassym.cf Sun Dec 13 12:21:26 2009 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.40 2009/12/10 05:10:01 rmind Exp $ +# $NetBSD: genassym.cf,v 1.41 2009/12/13 12:21:26 tsutsui Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -203,6 +203,8 @@ define MMU_CEN MMU_CEN define MMU_IEN MMU_IEN define MMU_FPE MMU_FPE +define DC_FREEZE DC_FREEZE +define CACHE40_ON CACHE40_ON define CACHE_ON CACHE_ON define CACHE_OFF CACHE_OFF define CACHE_CLR CACHE_CLR Index: src/sys/arch/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.151 src/sys/arch/hp300/hp300/locore.s:1.152 --- src/sys/arch/hp300/hp300/locore.s:1.151 Sun Dec 13 11:24:02 2009 +++ src/sys/arch/hp300/hp300/locore.s Sun Dec 13 12:21:26 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.151 2009/12/13 11:24:02 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.152 2009/12/13 12:21:26 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -205,7 +205,7 @@ /* determine our CPU/MMU combo - check for all regardless of kernel config */ movl #INTIOBASE+MMUBASE,%a1 - movl #0x200,%d0 | data freeze bit + movl #DC_FREEZE,%d0 | data freeze bit movc %d0,%cacr | only exists on 68030 movc %cacr,%d0 | read it back tstl %d0 | zero? @@ -528,7 +528,7 @@ movl #0x8000,%d0 #endif .long 0x4e7b0003 | movc %d0,%tc - movl #0x80008000,%d0 + movl #CACHE40_ON,%d0 movc %d0,%cacr | turn on both caches jmp Lenab1:l | forced not be pc-relative Lmotommu2:
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sun Jan 2 05:18:04 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: pmap_bootstrap.c Log Message: Pull code that maps the kernel segment table cache invalidated for 040/060, to reduce diffs from other m68k ports. Tested on HP362 (030) and HP382 (040), and no visible performance difference. (what should we do per "for the 68040 not strictly necessary but recommended by Motorola" comment?) To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.47 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.48 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.47 Sat Dec 25 14:43:00 2010 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Sun Jan 2 05:18:04 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.47 2010/12/25 14:43:00 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.48 2011/01/02 05:18:04 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.47 2010/12/25 14:43:00 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.48 2011/01/02 05:18:04 tsutsui Exp $"); #include @@ -365,11 +365,11 @@ } /* * Validate PTEs for kernel data/bss, dynamic data allocated - * by us so far (nextpa - firstpa bytes), and pages for lwp0 + * by us so far (kstpa - firstpa bytes), and pages for lwp0 * u-area and page table allocated below (RW). */ epte = (pt_entry_t *)kptpa; - epte = &epte[m68k_btop(nextpa - firstpa)]; + epte = &epte[m68k_btop(kstpa - firstpa)]; protopte = (protopte & ~PG_PROT) | PG_RW; /* * Enable copy-back caching of data pages @@ -381,6 +381,23 @@ protopte += PAGE_SIZE; } /* + * map the kernel segment table cache invalidated for + * these machines (for the 68040 not strictly necessary, but + * recommended by Motorola; for the 68060 mandatory) + */ + epte = (pt_entry_t *)kptpa; + epte = &epte[m68k_btop(nextpa - firstpa)]; + protopte = (protopte & ~PG_PROT) | PG_RW; + if (RELOC(mmutype, int) == MMU_68040) { + protopte &= ~PG_CCB; + protopte |= PG_CIN; + } + while (pte < epte) { + *pte++ = protopte; + protopte += PAGE_SIZE; + } + + /* * Finally, validate the internal IO space PTEs (RW+CI). * We do this here since the 320/350 MMU registers (also * used, but to a lesser extent, on other models) are mapped
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Thu Jan 6 13:03:47 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: locore.s machdep.c pmap_bootstrap.c Log Message: Move bootinfo address initialization to locore.s and machdep.c to reduce MD quirks in pmap_bootstrap.c. Also print bootinfo_pa in consinit() so that we can see at least MMU is properly enabled after boot. Tested on HP382. To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/arch/hp300/hp300/locore.s cvs rdiff -u -r1.212 -r1.213 src/sys/arch/hp300/hp300/machdep.c cvs rdiff -u -r1.51 -r1.52 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.157 src/sys/arch/hp300/hp300/locore.s:1.158 --- src/sys/arch/hp300/hp300/locore.s:1.157 Mon Dec 27 15:39:07 2010 +++ src/sys/arch/hp300/hp300/locore.s Thu Jan 6 13:03:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.157 2010/12/27 15:39:07 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.158 2011/01/06 13:03:47 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -114,7 +114,7 @@ * VA 0. * * The bootloader places the bootinfo in this page, and we allocate - * a VA for it and map it in pmap_bootstrap(). + * a VA for it and map it later. */ .fill PAGE_SIZE/4,4,0 @@ -420,14 +420,17 @@ moveq #FC_USERD,%d0 | user space movc %d0,%sfc | as source movc %d0,%dfc | and destination of transfers +/* save the first PA as bootinfo_pa to map it to a virtual address later. */ + movl %a5,%d0 | lowram value from ROM via boot + RELOC(bootinfo_pa, %a0) + movl %d0,%a0@ | save the lowram as bootinfo PA /* initialize memory sizes (for pmap_bootstrap) */ movl #MAXADDR,%d1 | last page moveq #PGSHIFT,%d2 lsrl %d2,%d1 | convert to page (click) number RELOC(maxmem, %a0) movl %d1,%a0@ | save as maxmem - movl %a5,%d0 | lowram value from ROM via boot - lsrl %d2,%d0 | convert to page number + lsrl %d2,%d0 | convert the lowram to page number subl %d0,%d1 | compute amount of RAM present RELOC(physmem, %a0) movl %d1,%a0@ | and physmem Index: src/sys/arch/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.212 src/sys/arch/hp300/hp300/machdep.c:1.213 --- src/sys/arch/hp300/hp300/machdep.c:1.212 Sat Oct 16 16:41:45 2010 +++ src/sys/arch/hp300/hp300/machdep.c Thu Jan 6 13:03:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.212 2010/10/16 16:41:45 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.212 2010/10/16 16:41:45 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -249,6 +249,8 @@ * exists by searching for the MAGIC record. If it's not * there, disable bootinfo. */ + bootinfo_va = virtual_avail; + virtual_avail += PAGE_SIZE; pmap_enter(pmap_kernel(), bootinfo_va, bootinfo_pa, VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED); @@ -260,6 +262,7 @@ pmap_remove(pmap_kernel(), bootinfo_va, bootinfo_va + PAGE_SIZE); pmap_update(pmap_kernel()); + virtual_avail -= PAGE_SIZE; bootinfo_va = 0; } } @@ -287,7 +290,9 @@ /* * Issue a warning if the boot loader didn't provide bootinfo. */ - if (bootinfo_va == 0) + if (bootinfo_va != 0) + printf("bootinfo found at 0x%08lx\n", bootinfo_pa); + else printf("WARNING: boot loader did not provide bootinfo\n"); #if NKSYMS || defined(DDB) || defined(MODULAR) Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.51 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.51 Sun Jan 2 18:48:05 2011 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Thu Jan 6 13:03:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.51 2011/01/02 18:48:05 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.51 2011/01/02 18:48:05 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $"); #include #include @@ -52,8 +52,6 @@ extern char *etext; extern vaddr_t CLKbase, MMUbase; -extern paddr_t bootinfo_pa; -extern vaddr_t bootinfo_va; extern int maxmem, physmem; extern paddr_t avail_start, avail_end; @@ -339,16 +337,6 @@ epte = &pte[nptpages * NPTEPG]; while (pte < epte) *pte++ = PG_NV; - - /* - * The page of kernel text is zero-filled in locore.s, - * and not mapped (at VA 0). The boot loader places the - * bootinfo here after the kernel is loaded. Rememb
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Thu Jan 6 13:25:32 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: leds.c pmap_bootstrap.c Log Message: Move VA allocation of ledbase to leds.c just before pmap_enter(9) to reduce MD quirk in pmap_bootstrap.c. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/hp300/leds.c cvs rdiff -u -r1.52 -r1.53 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/leds.c diff -u src/sys/arch/hp300/hp300/leds.c:1.18 src/sys/arch/hp300/hp300/leds.c:1.19 --- src/sys/arch/hp300/hp300/leds.c:1.18 Sun Mar 4 05:59:49 2007 +++ src/sys/arch/hp300/hp300/leds.c Thu Jan 6 13:25:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: leds.c,v 1.18 2007/03/04 05:59:49 christos Exp $ */ +/* $NetBSD: leds.c,v 1.19 2011/01/06 13:25:32 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: leds.c,v 1.18 2007/03/04 05:59:49 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: leds.c,v 1.19 2011/01/06 13:25:32 tsutsui Exp $"); #include @@ -85,7 +85,7 @@ #include -extern void * ledbase; /* kva of LED page */ +static vaddr_t ledbase; /* kva of LED page */ uint8_t *ledaddr; /* actual address of LEDs */ static volatile uint8_t currentleds; /* current LED status */ @@ -96,10 +96,11 @@ ledinit(void) { - pmap_enter(pmap_kernel(), (vaddr_t)ledbase, (paddr_t)LED_ADDR, + ledbase = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_VAONLY); + pmap_enter(pmap_kernel(), ledbase, (paddr_t)LED_ADDR, VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED); pmap_update(pmap_kernel()); - ledaddr = (uint8_t *) ((long)ledbase | (LED_ADDR & PGOFSET)); + ledaddr = (uint8_t *)(ledbase | (LED_ADDR & PGOFSET)); } /* Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.53 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52 Thu Jan 6 13:03:47 2011 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Thu Jan 6 13:25:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $"); #include #include @@ -63,12 +63,10 @@ * CADDR1, CADDR2: pmap zero/copy operations * vmmap: /dev/mem, crash dumps, parity error checking * msgbufaddr: kernel message buffer - * ledbase: SPU LEDs */ void *CADDR1, *CADDR2; char *vmmap; void *msgbufaddr; -void *ledbase; void pmap_bootstrap(paddr_t, paddr_t); @@ -483,8 +481,6 @@ va += PAGE_SIZE; RELOC(vmmap, void *) = (void *)va; va += PAGE_SIZE; - RELOC(ledbase, void *) = (void *)va; - va += PAGE_SIZE; RELOC(msgbufaddr, void *) = (void *)va; va += m68k_round_page(MSGBUFSIZE); RELOC(virtual_avail, vaddr_t) = va;
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Thu Jan 6 14:19:54 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: machdep.c pmap_bootstrap.c Log Message: Move pmap_aliasmask initialization from pmap_bootstrap.c to machdep.c:hp300_init() before the first pmap(9) use. To generate a diff of this commit: cvs rdiff -u -r1.213 -r1.214 src/sys/arch/hp300/hp300/machdep.c cvs rdiff -u -r1.53 -r1.54 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.213 src/sys/arch/hp300/hp300/machdep.c:1.214 --- src/sys/arch/hp300/hp300/machdep.c:1.213 Thu Jan 6 13:03:47 2011 +++ src/sys/arch/hp300/hp300/machdep.c Thu Jan 6 14:19:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.214 2011/01/06 14:19:54 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.214 2011/01/06 14:19:54 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -221,6 +221,22 @@ extern paddr_t avail_start, avail_end; +#ifdef CACHE_HAVE_VAC + /* + * Determine VA aliasing distance if any + */ + switch (machineid) { + case HP_320: + pmap_aliasmask = 0x3fff; /* 16KB */ + break; + case HP_350: + pmap_aliasmask = 0x7fff; /* 32KB */ + break; + default: + break; + } +#endif + /* * Tell the VM system about available physical memory. The * hp300 only has one segment. Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.53 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.54 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.53 Thu Jan 6 13:25:32 2011 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Thu Jan 6 14:19:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.54 2011/01/06 14:19:54 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.54 2011/01/06 14:19:54 tsutsui Exp $"); #include #include @@ -457,18 +457,6 @@ RELOC(virtual_end, vaddr_t) = VM_MAX_KERNEL_ADDRESS; -#ifdef M68K_MMU_HP - /* - * Determine VA aliasing distance if any - */ - if (RELOC(ectype, int) == EC_VIRT) { - if (RELOC(machineid, int) == HP_320) - RELOC(pmap_aliasmask, int) = 0x3fff; /* 16k */ - else if (RELOC(machineid, int) == HP_350) - RELOC(pmap_aliasmask, int) = 0x7fff; /* 32k */ - } -#endif - /* * Allocate some fixed, special purpose kernel virtual addresses */
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sun Feb 6 14:26:10 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: trap.c Log Message: Remove trailing TABs. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/arch/hp300/hp300/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/hp300/hp300/trap.c diff -u src/sys/arch/hp300/hp300/trap.c:1.146 src/sys/arch/hp300/hp300/trap.c:1.147 --- src/sys/arch/hp300/hp300/trap.c:1.146 Mon Jan 17 14:53:42 2011 +++ src/sys/arch/hp300/hp300/trap.c Sun Feb 6 14:26:09 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.146 2011/01/17 14:53:42 tsutsui Exp $ */ +/* $NetBSD: trap.c,v 1.147 2011/02/06 14:26:09 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.146 2011/01/17 14:53:42 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.147 2011/02/06 14:26:09 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_execfmt.h" @@ -367,7 +367,7 @@ fp->f_stackadj = exframesize[fp->f_format]; fp->f_format = fp->f_vector = 0; fp->f_pc = (int)onfault; - fp->f_regs[D0] = rv; + fp->f_regs[D0] = rv; return; case T_BUSERR|T_USER: /* bus error */
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Wed Feb 9 09:29:57 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: autoconf.c Log Message: Remove leftover debug stuff. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/arch/hp300/hp300/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/hp300/hp300/autoconf.c diff -u src/sys/arch/hp300/hp300/autoconf.c:1.94 src/sys/arch/hp300/hp300/autoconf.c:1.95 --- src/sys/arch/hp300/hp300/autoconf.c:1.94 Tue Feb 8 20:20:13 2011 +++ src/sys/arch/hp300/hp300/autoconf.c Wed Feb 9 09:29:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.94 2011/02/08 20:20:13 rmind Exp $ */ +/* $NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $ */ /*- * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.94 2011/02/08 20:20:13 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $"); #include "dvbox.h" #include "gbox.h" @@ -764,7 +764,7 @@ #endif #if NCOM_DIO > 0 if (!dio_scan(com_dio_cnattach)) - ;//return; + return; #endif #if NDCM > 0 if (!dio_scan(dcmcnattach))
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Wed Feb 9 09:32:50 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: autoconf.c machdep.c Log Message: NHIL is no more. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/arch/hp300/hp300/autoconf.c cvs rdiff -u -r1.217 -r1.218 src/sys/arch/hp300/hp300/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/hp300/hp300/autoconf.c diff -u src/sys/arch/hp300/hp300/autoconf.c:1.95 src/sys/arch/hp300/hp300/autoconf.c:1.96 --- src/sys/arch/hp300/hp300/autoconf.c:1.95 Wed Feb 9 09:29:57 2011 +++ src/sys/arch/hp300/hp300/autoconf.c Wed Feb 9 09:32:49 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.96 2011/02/09 09:32:49 tsutsui Exp $ */ /*- * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.96 2011/02/09 09:32:49 tsutsui Exp $"); #include "dvbox.h" #include "gbox.h" @@ -827,7 +827,8 @@ dnkbdcnattach(bst, FRODO_BASE + FRODO_APCI_OFFSET(0)) #endif -#if NHIL > 0 +#if NHILKBD > 0 + /* not yet */ hilkbdcnattach(bst, HIL_BASE); #endif ; Index: src/sys/arch/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.217 src/sys/arch/hp300/hp300/machdep.c:1.218 --- src/sys/arch/hp300/hp300/machdep.c:1.217 Tue Feb 8 20:20:13 2011 +++ src/sys/arch/hp300/hp300/machdep.c Wed Feb 9 09:32:49 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.217 2011/02/08 20:20:13 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.218 2011/02/09 09:32:49 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.217 2011/02/08 20:20:13 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.218 2011/02/09 09:32:49 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -1022,7 +1022,8 @@ static int innmihand; /* simple mutex */ /* - * Level 7 interrupts can be caused by the keyboard or parity errors. + * Level 7 interrupts can be caused by HIL keyboards (in cooked mode only, + * but we run them in raw mode) or parity errors. */ void nmihand(struct frame frame) @@ -1033,57 +1034,12 @@ return; innmihand = 1; -#if NHIL > 0 - /* Check for keyboard ++. */ - if (kbdnmi()) { - printf("Got a keyboard NMI"); - - /* - * We can: - * - * - enter DDB - * - * - Start the crashandburn sequence - * - * - Ignore it. - */ -#ifdef DDB - printf(": entering debugger\n"); - Debugger(); -#else -#ifdef PANICBUTTON - if (panicbutton) { - /* XXX */ - callout_init(&candbtimer_ch, 0); - if (crashandburn) { -crashandburn = 0; -printf(": CRASH AND BURN!\n"); -panic("forced crash"); - } else { -/* Start the crashandburn sequence */ -printf("\n"); -crashandburn = 1; -callout_reset(&candbtimer_ch, hz / candbdiv, -candbtimer, NULL); - } - } else -#endif /* PANICBUTTON */ - printf(": ignoring\n"); -#endif /* DDB */ - - goto nmihand_out; /* no more work to do */ - } -#endif - if (parityerror(&frame)) return; /* panic?? */ printf("unexpected level 7 interrupt ignored\n"); -#if NHIL > 0 -nmihand_out: innmihand = 0; -#endif } /*
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sat Feb 12 03:43:50 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: bus_space.c Log Message: Use __func__ to print (correct) function names. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp300/hp300/bus_space.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/hp300/hp300/bus_space.c diff -u src/sys/arch/hp300/hp300/bus_space.c:1.17 src/sys/arch/hp300/hp300/bus_space.c:1.18 --- src/sys/arch/hp300/hp300/bus_space.c:1.17 Mon Apr 28 20:23:19 2008 +++ src/sys/arch/hp300/hp300/bus_space.c Sat Feb 12 03:43:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.17 2008/04/28 20:23:19 martin Exp $ */ +/* $NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.17 2008/04/28 20:23:19 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $"); #include #include @@ -66,7 +66,7 @@ } if (t->bustype != HP300_BUS_SPACE_DIO) - panic("bus_space_map: bad space tag"); + panic("%s: bad space tag", __FUNC__); /* * Allocate virtual address space from the extio extent map. @@ -112,7 +112,7 @@ /* * Not meaningful on any currently-supported hp300 bus. */ - panic("bus_space_free: shouldn't be here"); + panic("%s: shouldn't be here", __func__); } void @@ -130,7 +130,7 @@ } if (t->bustype != HP300_BUS_SPACE_DIO) - panic("bus_space_map: bad space tag"); + panic("%s: bad space tag", __func__); kva = m68k_trunc_page(bsh); offset = m68k_page_offset(bsh); @@ -139,7 +139,7 @@ #ifdef DIAGNOSTIC if (bsh < (vaddr_t)extiobase || bsh >= ((vaddr_t)extiobase + ptoa(EIOMAPSIZE))) - panic("bus_space_unmap: bad bus space handle"); + panic("%s: bad bus space handle", __func__); #endif /* @@ -152,8 +152,8 @@ */ if (extent_free(extio_ex, kva, size, EX_NOWAIT | (extio_ex_malloc_safe ? EX_MALLOCOK : 0))) - printf("bus_space_unmap: kva 0x%lx size 0x%lx: " - "can't free region\n", (u_long) bsh, size); + printf("%s: kva 0x%lx size 0x%lx: " + "can't free region\n", __func-_, (u_long)bsh, size); } /* ARGSUSED */ @@ -194,7 +194,7 @@ break; default: - panic("bus_space_probe: unupported data size %d", sz); + panic("%s: unupported data size %d", __func__, sz); /* NOTREACHED */ }
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sat Feb 12 04:52:28 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: bus_space.c Log Message: Umm, fix typo. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/hp300/bus_space.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/hp300/hp300/bus_space.c diff -u src/sys/arch/hp300/hp300/bus_space.c:1.18 src/sys/arch/hp300/hp300/bus_space.c:1.19 --- src/sys/arch/hp300/hp300/bus_space.c:1.18 Sat Feb 12 03:43:50 2011 +++ src/sys/arch/hp300/hp300/bus_space.c Sat Feb 12 04:52:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $ */ +/* $NetBSD: bus_space.c,v 1.19 2011/02/12 04:52:28 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.19 2011/02/12 04:52:28 tsutsui Exp $"); #include #include @@ -66,7 +66,7 @@ } if (t->bustype != HP300_BUS_SPACE_DIO) - panic("%s: bad space tag", __FUNC__); + panic("%s: bad space tag", __func__); /* * Allocate virtual address space from the extio extent map. @@ -153,7 +153,7 @@ if (extent_free(extio_ex, kva, size, EX_NOWAIT | (extio_ex_malloc_safe ? EX_MALLOCOK : 0))) printf("%s: kva 0x%lx size 0x%lx: " - "can't free region\n", __func-_, (u_long)bsh, size); + "can't free region\n", __func__, (u_long)bsh, size); } /* ARGSUSED */
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Thu Nov 3 15:13:02 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: locore.s Log Message: unifdef __ELF__ To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.159 src/sys/arch/hp300/hp300/locore.s:1.160 --- src/sys/arch/hp300/hp300/locore.s:1.159 Sun Mar 6 14:51:21 2011 +++ src/sys/arch/hp300/hp300/locore.s Thu Nov 3 15:13:02 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.159 2011/03/06 14:51:21 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.160 2011/11/03 15:13:02 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -1364,11 +1364,7 @@ ENTRY_NOPROFILE(_delay) * operations and that the loop will run from a single cache * half-line. */ -#ifdef __ELF__ .align 8 -#else - .align 3 -#endif L_delay: subl %d1,%d0 jgt L_delay
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Fri Nov 4 17:53:51 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: locore.s Log Message: Fix indent and some comments. To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.160 src/sys/arch/hp300/hp300/locore.s:1.161 --- src/sys/arch/hp300/hp300/locore.s:1.160 Thu Nov 3 15:13:02 2011 +++ src/sys/arch/hp300/hp300/locore.s Fri Nov 4 17:53:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.160 2011/11/03 15:13:02 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.161 2011/11/04 17:53:51 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -566,11 +566,11 @@ Lehighcode: * Should be running mapped from this point on */ Lenab1: - lea _ASM_LABEL(tmpstk),%sp | temporary stack + lea _ASM_LABEL(tmpstk),%sp | temporary stack /* call final pmap setup */ jbsr _C_LABEL(pmap_bootstrap_finalize) /* set kernel stack, user SP */ - movl _C_LABEL(lwp0uarea),%a1 | + movl _C_LABEL(lwp0uarea),%a1 | get lwp0 uarea lea %a1@(USPACE-4),%sp | set kernel stack to end of area movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP @@ -630,7 +630,7 @@ ENTRY_NOPROFILE(addrerr4060) movl %a0,%sp@(FR_SP) | in the savearea movl %sp@(FR_HW+8),%sp@- clrl %sp@- | dummy code - movl #T_ADDRERR,%sp@- | mark address error + movl #T_ADDRERR,%sp@- | mark address error jra _ASM_LABEL(faultstkadj) | and deal with it #endif @@ -780,7 +780,7 @@ Lismerr: Lmightnotbemerr: btst #3,%d1 | write protect bit set? jeq Lisberr1 | no: must be bus error - movl %sp@,%d0 | ssw into low word of %d0 + movl %sp@,%d0 | ssw into low word of %d0 andw #0xc0,%d0 | Write protect is set on page: cmpw #0x40,%d0 | was it read cycle? jne Lismerr | no, was not WPE, must be MMU fault @@ -982,7 +982,7 @@ Lkbrkpt: | Kernel-mode breakpoint or tra jls Lbrkpt2 | already on tmpstk | Copy frame to the temporary stack movl %sp,%a0 | %a0=src - lea _ASM_LABEL(tmpstk)-96,%a1 | a1=dst + lea _ASM_LABEL(tmpstk)-96,%a1 | %a1=dst movl %a1,%sp | %sp=new frame moveq #FR_SIZE,%d1 Lbrkpt1: @@ -1258,7 +1258,7 @@ Lslerr: moveq #-1,%d0 Lsldone: movl _C_LABEL(curpcb),%a1 | current pcb - clrl %a1@(PCB_ONFAULT) | clear fault address + clrl %a1@(PCB_ONFAULT) | clear fault address rts #endif @@ -1379,7 +1379,7 @@ ENTRY(m68881_save) tstb %a0@ | null state frame? jeq Lm68881sdone | yes, all done fmovem %fp0-%fp7,%a0@(FPF_REGS) | save FP general registers - fmovem %fpcr/%fpsr/%fpi,%a0@(FPF_FPCR) | save FP control registers + fmovem %fpcr/%fpsr/%fpi,%a0@(FPF_FPCR) | save FP control registers Lm68881sdone: rts @@ -1387,7 +1387,7 @@ ENTRY(m68881_restore) movl %sp@(4),%a0 | save area pointer tstb %a0@ | null state frame? jeq Lm68881rdone | yes, easy - fmovem %a0@(FPF_FPCR),%fpcr/%fpsr/%fpi | restore FP control registers + fmovem %a0@(FPF_FPCR),%fpcr/%fpsr/%fpi | restore FP control registers fmovem %a0@(FPF_REGS),%fp0-%fp7 | restore FP general registers Lm68881rdone: frestore %a0@ | restore state
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sat Nov 5 15:21:43 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: locore.s Log Message: bgt -> jgt for a short jump. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.161 src/sys/arch/hp300/hp300/locore.s:1.162 --- src/sys/arch/hp300/hp300/locore.s:1.161 Fri Nov 4 17:53:51 2011 +++ src/sys/arch/hp300/hp300/locore.s Sat Nov 5 15:21:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.161 2011/11/04 17:53:51 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.162 2011/11/05 15:21:43 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -988,7 +988,7 @@ Lkbrkpt: | Kernel-mode breakpoint or tra Lbrkpt1: movl %a0@+,%a1@+ subql #4,%d1 - bgt Lbrkpt1 + jgt Lbrkpt1 Lbrkpt2: | Call the trap handler for the kernel debugger.
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Tue May 10 14:38:08 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: autoconf.c machdep.c Log Message: Move intr_init() call from early hp300_init() to cpu_configure(9) since interrupt functions would want evcnt(9). To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/arch/hp300/hp300/autoconf.c cvs rdiff -u -r1.219 -r1.220 src/sys/arch/hp300/hp300/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/hp300/hp300/autoconf.c diff -u src/sys/arch/hp300/hp300/autoconf.c:1.97 src/sys/arch/hp300/hp300/autoconf.c:1.98 --- src/sys/arch/hp300/hp300/autoconf.c:1.97 Sat Feb 12 05:08:40 2011 +++ src/sys/arch/hp300/hp300/autoconf.c Tue May 10 14:38:08 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.97 2011/02/12 05:08:40 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $ */ /*- * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.97 2011/02/12 05:08:40 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $"); #include "dvbox.h" #include "gbox.h" @@ -282,6 +282,9 @@ /* Kick off autoconfiguration. */ (void)splhigh(); + /* Initialize the interrupt handlers. */ + intr_init(); + if (config_rootfound("mainbus", NULL) == NULL) panic("no mainbus found"); Index: src/sys/arch/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.219 src/sys/arch/hp300/hp300/machdep.c:1.220 --- src/sys/arch/hp300/hp300/machdep.c:1.219 Fri Mar 4 22:25:25 2011 +++ src/sys/arch/hp300/hp300/machdep.c Tue May 10 14:38:08 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.219 2011/03/04 22:25:25 joerg Exp $ */ +/* $NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.219 2011/03/04 22:25:25 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -203,9 +203,6 @@ uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); - /* Initialize the interrupt handlers. */ - intr_init(); - /* Calibrate the delay loop. */ hp300_calibrate_delay();
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sun May 15 16:57:08 UTC 2011 Modified Files: src/sys/arch/hp300/hp300: machdep.c Log Message: Misc KNF. To generate a diff of this commit: cvs rdiff -u -r1.220 -r1.221 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.220 src/sys/arch/hp300/hp300/machdep.c:1.221 --- src/sys/arch/hp300/hp300/machdep.c:1.220 Tue May 10 14:38:08 2011 +++ src/sys/arch/hp300/hp300/machdep.c Sun May 15 16:57:08 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.221 2011/05/15 16:57:08 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.221 2011/05/15 16:57:08 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -320,7 +320,7 @@ * Allocate a submap for physio */ phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - VM_PHYS_SIZE, 0, false, NULL); + VM_PHYS_SIZE, 0, false, NULL); #ifdef DEBUG pmapdebug = opmapdebug; @@ -587,16 +587,16 @@ { sysctl_createv(clog, 0, NULL, NULL, - CTLFLAG_PERMANENT, - CTLTYPE_NODE, "machdep", NULL, - NULL, 0, NULL, 0, - CTL_MACHDEP, CTL_EOL); + CTLFLAG_PERMANENT, + CTLTYPE_NODE, "machdep", NULL, + NULL, 0, NULL, 0, + CTL_MACHDEP, CTL_EOL); sysctl_createv(clog, 0, NULL, NULL, - CTLFLAG_PERMANENT, - CTLTYPE_STRUCT, "console_device", NULL, - sysctl_consdev, 0, NULL, sizeof(dev_t), - CTL_MACHDEP, CPU_CONSDEV, CTL_EOL); + CTLFLAG_PERMANENT, + CTLTYPE_STRUCT, "console_device", NULL, + sysctl_consdev, 0, NULL, sizeof(dev_t), + CTL_MACHDEP, CPU_CONSDEV, CTL_EOL); } int waittime = -1; @@ -657,7 +657,7 @@ printf("rebooting...\n"); DELAY(100); doboot(); - /*NOTREACHED*/ + /* NOTREACHED */ } /* @@ -943,13 +943,13 @@ int i; label_t faultbuf; - nofault = (int *) &faultbuf; + nofault = (int *)&faultbuf; if (setjmp((label_t *)nofault)) { - nofault = (int *) 0; + nofault = (int *)0; return 1; } i = *(volatile short *)addr; - nofault = (int *) 0; + nofault = (int *)0; return 0; } @@ -959,9 +959,9 @@ int i; label_t faultbuf; - nofault = (int *) &faultbuf; + nofault = (int *)&faultbuf; if (setjmp((label_t *)nofault)) { - nofault = (int *) 0; + nofault = (int *)0; return 1; } i = *(volatile char *)addr; @@ -1056,14 +1056,14 @@ { label_t faultbuf; - nofault = (int *) &faultbuf; + nofault = (int *)&faultbuf; if (setjmp((label_t *)nofault)) { - nofault = (int *) 0; + nofault = (int *)0; printf("Parity detection disabled\n"); return; } *PARREG = 1; - nofault = (int *) 0; + nofault = (int *)0; gotparmem = 1; } @@ -1088,7 +1088,7 @@ else if (USERMODE(fp->f_sr)) { printf("pid %d: parity error\n", curproc->p_pid); uprintf("sorry, pid %d killed due to memory parity error\n", - curproc->p_pid); + curproc->p_pid); psignal(curproc, SIGKILL); #ifdef DEBUG } else if (ignorekperr) { @@ -1159,7 +1159,7 @@ */ printf("Couldn't locate parity error\n"); found = 0; -done: + done: looking = 0; pmap_remove(pmap_kernel(), (vaddr_t)vmmap, (vaddr_t)&vmmap[PAGE_SIZE]); pmap_update(pmap_kernel());
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Fri Aug 10 12:29:59 UTC 2012 Modified Files: src/sys/arch/hp300/hp300: machdep.c Log Message: Appease gcc -fno-common: - remove initialzation of physmem since it's properly initialized before pmap_bootstrap() using a value passed from bootloader and sanity possible maximum value is not necessary Tested on HP382. To generate a diff of this commit: cvs rdiff -u -r1.225 -r1.226 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.225 src/sys/arch/hp300/hp300/machdep.c:1.226 --- src/sys/arch/hp300/hp300/machdep.c:1.225 Fri Jul 27 05:36:10 2012 +++ src/sys/arch/hp300/hp300/machdep.c Fri Aug 10 12:29:59 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.225 2012/07/27 05:36:10 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.225 2012/07/27 05:36:10 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -129,7 +129,6 @@ paddr_t bootinfo_pa; vaddr_t bootinfo_va; int maxmem; /* max memory per process */ -int physmem = MAXMEM; /* max supported memory, changes to actual */ extern u_int lowram; extern short exframesize[];
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sun Jan 17 17:49:55 UTC 2016 Modified Files: src/sys/arch/hp300/hp300: intr.c Log Message: Fix fatal "intr_dispatch: stray level 6 interrupt" panic by the GENERIC kernel on machines without arcofi(4) audio (i.e. all hp300 except HP425e). I failed to pull all necessary changes for arcofi(4) from OpenBSD and I should have tested 7.0_RC kernels on my HP382 too :-( Should be pulled up to netbsd-7 and netbsd-7-0. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp300/hp300/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/hp300/hp300/intr.c diff -u src/sys/arch/hp300/hp300/intr.c:1.41 src/sys/arch/hp300/hp300/intr.c:1.42 --- src/sys/arch/hp300/hp300/intr.c:1.41 Sun Aug 24 08:17:44 2014 +++ src/sys/arch/hp300/hp300/intr.c Sun Jan 17 17:49:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.41 2014/08/24 08:17:44 tsutsui Exp $ */ +/* $NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $ */ /*- * Copyright (c) 1996, 1997, 1999 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.41 2014/08/24 08:17:44 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $"); #define _HP300_INTR_H_PRIVATE @@ -199,9 +199,12 @@ intr_dispatch(int evec /* format | vecto list = &hp300_intr_list[ipl]; if (LIST_FIRST(&list->hi_q) == NULL) { - printf("intr_dispatch: ipl %d unexpected\n", ipl); - if (++unexpected > 10) - panic("intr_dispatch: too many unexpected interrupts"); + if (ipl != 6) { + printf("intr_dispatch: ipl %d unexpected\n", ipl); + if (++unexpected > 10) +panic("intr_dispatch:" +" too many unexpected interrupts"); + } return; }
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sat Sep 21 06:24:43 UTC 2013 Modified Files: src/sys/arch/hp300/hp300: pmap_bootstrap.c Log Message: Fix a build error on a kernel config without 68040 machines. Reported by Andrew Gillham on port-hp300@: http://mail-index.NetBSD.org/port-hp300/2013/09/09/msg77.html (I removed defined(68060) since hp300 doesn't have it) Should be pulled up to netbsd-6. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.57 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.58 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.57 Fri Feb 10 06:28:39 2012 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Sat Sep 21 06:24:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.57 2012/02/10 06:28:39 mhitch Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.58 2013/09/21 06:24:43 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.57 2012/02/10 06:28:39 mhitch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.58 2013/09/21 06:24:43 tsutsui Exp $"); #include #include @@ -411,8 +411,10 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f */ RELOC(Sysseg, st_entry_t *) = (st_entry_t *)(kstpa - firstpa); RELOC(Sysseg_pa, paddr_t) = kstpa; +#if defined(M68040) if (RELOC(mmutype, int) == MMU_68040) RELOC(protostfree, u_int) = stfree; +#endif /* * Sysptmap: base of kernel page table map */
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Sat Mar 15 09:26:36 UTC 2014 Modified Files: src/sys/arch/hp300/hp300: locore.s Log Message: Use common m68k/busaddrerr.s for bus error and address error handlers. No binary changes on GENERIC. To generate a diff of this commit: cvs rdiff -u -r1.169 -r1.170 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.169 src/sys/arch/hp300/hp300/locore.s:1.170 --- src/sys/arch/hp300/hp300/locore.s:1.169 Sun Mar 9 16:28:43 2014 +++ src/sys/arch/hp300/hp300/locore.s Sat Mar 15 09:26:36 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.169 2014/03/09 16:28:43 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.170 2014/03/15 09:26:36 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -621,192 +621,10 @@ Lnocache0: */ #include -#if defined(M68040) || defined(M68060) -ENTRY_NOPROFILE(addrerr4060) - clrl %sp@- | stack adjust count - moveml #0x,%sp@- | save user registers - movl %usp,%a0 | save the user SP - movl %a0,%sp@(FR_SP) | in the savearea - movl %sp@(FR_HW+8),%sp@- - clrl %sp@- | dummy code - movl #T_ADDRERR,%sp@- | mark address error - jra _ASM_LABEL(faultstkadj) | and deal with it -#endif - -#if defined(M68060) -ENTRY_NOPROFILE(buserr60) - clrl %sp@- | stack adjust count - moveml #0x,%sp@- | save user registers - movl %usp,%a0 | save the user SP - movl %a0,%sp@(FR_SP) | in the savearea - movel %sp@(FR_HW+12),%d0 | FSLW - btst #2,%d0 | branch prediction error? - jeq Lnobpe - movc %cacr,%d2 - orl #IC60_CABC,%d2 | clear all branch cache entries - movc %d2,%cacr - movl %d0,%d1 - andl #0x7ffd,%d1 - jeq _ASM_LABEL(faultstkadjnotrap2) -Lnobpe: -| we need to adjust for misaligned addresses - movl %sp@(FR_HW+8),%d1 | grab VA - btst #27,%d0 | check for mis-aligned access - jeq Lberr3 | no, skip - addl #28,%d1 | yes, get into next page - | operand case: 3, - | instruction case: 4+12+12 - andl #PG_FRAME,%d1 | and truncate -Lberr3: - movl %d1,%sp@- - movl %d0,%sp@- | code is FSLW now. - andw #0x1f80,%d0 - jeq Lberr60 | it is a bus error - movl #T_MMUFLT,%sp@- | show that we are an MMU fault - jra _ASM_LABEL(faultstkadj) | and deal with it -Lberr60: - tstl _C_LABEL(nofault) | catch bus error? - jeq Lisberr | no, handle as usual - movl _C_LABEL(nofault),%sp@- | yes, - jbsr _C_LABEL(longjmp) | longjmp(nofault) - /* NOTREACHED */ -#endif -#if defined(M68040) -ENTRY_NOPROFILE(buserr40) - clrl %sp@- | stack adjust count - moveml #0x,%sp@- | save user registers - movl %usp,%a0 | save the user SP - movl %a0,%sp@(FR_SP) | in the savearea - movl %sp@(FR_HW+20),%d1 | get fault address - moveq #0,%d0 - movw %sp@(FR_HW+12),%d0 | get SSW - btst #11,%d0 | check for mis-aligned - jeq Lbe1stpg | no skip - addl #3,%d1 | get into next page - andl #PG_FRAME,%d1 | and truncate -Lbe1stpg: - movl %d1,%sp@- | pass fault address. - movl %d0,%sp@- | pass SSW as code - btst #10,%d0 | test ATC - jeq Lberr40 | it is a bus error - movl #T_MMUFLT,%sp@- | show that we are an MMU fault - jra _ASM_LABEL(faultstkadj) | and deal with it -Lberr40: - tstl _C_LABEL(nofault) | catch bus error? - jeq Lisberr | no, handle as usual - movl _C_LABEL(nofault),%sp@- | yes, - jbsr _C_LABEL(longjmp) | longjmp(nofault) - /* NOTREACHED */ -#endif - -#if defined(M68020) || defined(M68030) -ENTRY_NOPROFILE(busaddrerr2030) - clrl %sp@- | stack adjust count - moveml #0x,%sp@- | save user registers - movl %usp,%a0 | save the user SP - movl %a0,%sp@(FR_SP) | in the savearea - moveq #0,%d0 - movw %sp@(FR_HW+10),%d0 | grab SSW for fault processing - btst #12,%d0 | RB set? - jeq LbeX0 | no, test RC - bset #14,%d0 | yes, must set FB - movw %d0,%sp@(FR_HW+10) | for hardware too -LbeX0: - btst #13,%d0 | RC set? - jeq LbeX1 | no, skip - bset #15,%d0 | yes, must set FC - movw %d0,%sp@(FR_HW+10) | for hardware too -LbeX1: - btst #8,%d0 | data fault? - jeq Lbe0 | no, check for hard cases - movl %sp@(FR_HW+16),%d1 | fault address is as given in frame - jra Lbe10 | thats it -Lbe0: - btst #4,%sp@(FR_HW+6) | long (type B) stack frame? - jne Lbe4 | yes, go handle - movl %sp@(FR_HW+2),%d1 | no, can use save PC - btst #14,%d0 | FB set? - jeq Lbe3 | no, try FC - addql #4,%d1 | yes, adjust address - jra Lbe10 | done -Lbe3: - btst #15,%d0 | FC set? - jeq Lbe10 | no, done - addql #2,%d1 | yes, adjust address - jra Lbe10 | done -Lbe4: - movl %sp@(FR_HW+36),%d1 | long format, use stage B address - btst #15,%d0 | FC set? - jeq Lbe10 | no, all done - subql #2,%d1 | yes, adjust address -Lbe10: - movl %d1,%sp@- | push fault VA - movl %d0,%sp@- | and padded SSW - movw %sp@(FR_HW+8+6),%d0 | get frame format/vector offset - andw #0x0FFF,%d0 | clear out frame format - cmpw #12,%d0 | address error vect
CVS commit: src/sys/arch/hp300/hp300
Module Name:src Committed By: tsutsui Date: Tue Apr 21 09:02:33 UTC 2020 Modified Files: src/sys/arch/hp300/hp300: machdep.c Log Message: Fix garbages in dmesg caused by uninitialized variables slipped in r1.228. Noticed in HP9000/362 dmesg: https://dmesgd.nycbug.org/index.cgi?do=view&id=5459 Should be pulled up to netbsd-8 and netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.232 -r1.233 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c diff -u src/sys/arch/hp300/hp300/machdep.c:1.232 src/sys/arch/hp300/hp300/machdep.c:1.233 --- src/sys/arch/hp300/hp300/machdep.c:1.232 Tue Dec 31 13:07:10 2019 +++ src/sys/arch/hp300/hp300/machdep.c Tue Apr 21 09:02:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.232 2019/12/31 13:07:10 ad Exp $ */ +/* $NetBSD: machdep.c,v 1.233 2020/04/21 09:02:33 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.232 2019/12/31 13:07:10 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2020/04/21 09:02:33 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -433,6 +433,7 @@ identifycpu(void) /* * ...and the FPU type. */ + fpu[0] = '\0'; switch (fputype) { case FPU_68040: strlcpy(fpu, "+FPU", sizeof(fpu)); @@ -458,6 +459,7 @@ identifycpu(void) /* * ...and finally, the cache type. */ + cache[0] = '\0'; if (cputype == CPU_68040) snprintf(cache, sizeof(cache), ", 4k on-chip physical I/D caches");