CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: christos Date: Mon Mar 24 19:57:47 UTC 2014 Modified Files: src/sys/arch/next68k/next68k: disksubr.c Log Message: fix memset bugs To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/next68k/next68k/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/next68k/next68k/disksubr.c diff -u src/sys/arch/next68k/next68k/disksubr.c:1.25 src/sys/arch/next68k/next68k/disksubr.c:1.26 --- src/sys/arch/next68k/next68k/disksubr.c:1.25 Mon Mar 16 19:11:13 2009 +++ src/sys/arch/next68k/next68k/disksubr.c Mon Mar 24 15:57:47 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.25 2009/03/16 23:11:13 dsl Exp $ */ +/* $NetBSD: disksubr.c,v 1.26 2014/03/24 19:57:47 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1993 @@ -37,7 +37,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.25 2009/03/16 23:11:13 dsl Exp $); +__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.26 2014/03/24 19:57:47 christos Exp $); #include sys/param.h #include sys/systm.h @@ -171,7 +171,7 @@ build_nextstep_label(struct next68k_disk unsigned short *checksum; - memset (ondisk, 0, sizeof (ondisk)); + memset (ondisk, 0, sizeof (*ondisk)); ondisk-cd_version = NEXT68K_LABEL_CD_V3; /* ondisk-cd_label_blkno = 0; */ @@ -272,7 +272,7 @@ build_nextstep_label(struct next68k_disk p-cp_minfree = 5; /* set some default */ p-cp_cpg = lp-d_partitions[nbp].p_cpg; } else { - memset (p, 0, sizeof(p)); + memset (p, 0, sizeof(*p); p-cp_size = -1; p-cp_offset = -1; p-cp_bsize = -1;
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: christos Date: Mon Mar 24 19:58:04 UTC 2014 Modified Files: src/sys/arch/next68k/next68k: disksubr.c machdep.c rtc.c trap.c Log Message: fix typo. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/next68k/next68k/disksubr.c cvs rdiff -u -r1.109 -r1.110 src/sys/arch/next68k/next68k/machdep.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/next68k/next68k/rtc.c cvs rdiff -u -r1.85 -r1.86 src/sys/arch/next68k/next68k/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/next68k/next68k/disksubr.c diff -u src/sys/arch/next68k/next68k/disksubr.c:1.26 src/sys/arch/next68k/next68k/disksubr.c:1.27 --- src/sys/arch/next68k/next68k/disksubr.c:1.26 Mon Mar 24 15:57:47 2014 +++ src/sys/arch/next68k/next68k/disksubr.c Mon Mar 24 15:58:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.26 2014/03/24 19:57:47 christos Exp $ */ +/* $NetBSD: disksubr.c,v 1.27 2014/03/24 19:58:04 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1993 @@ -37,7 +37,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.26 2014/03/24 19:57:47 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.27 2014/03/24 19:58:04 christos Exp $); #include sys/param.h #include sys/systm.h @@ -272,7 +272,7 @@ build_nextstep_label(struct next68k_disk p-cp_minfree = 5; /* set some default */ p-cp_cpg = lp-d_partitions[nbp].p_cpg; } else { - memset (p, 0, sizeof(*p); + memset (p, 0, sizeof(*p)); p-cp_size = -1; p-cp_offset = -1; p-cp_bsize = -1; Index: src/sys/arch/next68k/next68k/machdep.c diff -u src/sys/arch/next68k/next68k/machdep.c:1.109 src/sys/arch/next68k/next68k/machdep.c:1.110 --- src/sys/arch/next68k/next68k/machdep.c:1.109 Fri Aug 10 21:21:04 2012 +++ src/sys/arch/next68k/next68k/machdep.c Mon Mar 24 15:58:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.109 2012/08/11 01:21:04 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.110 2014/03/24 19:58:04 christos Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell @@ -40,7 +40,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.109 2012/08/11 01:21:04 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.110 2014/03/24 19:58:04 christos Exp $); #include opt_ddb.h #include opt_kgdb.h @@ -311,15 +311,12 @@ cpu_startup(void) initcpu(); } -/* - * Info for CTL_HW - */ -char cpu_model[124]; - void identifycpu(void) { - const char *mc; +/*###317 [cc] error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token%%%*/ + const char *mc, *mmu_str *fpu_str, *cache_str; +/*###318 [cc] error: unused variable 'len' [-Werror=unused-variable]%%%*/ int len; /* @@ -340,67 +337,74 @@ identifycpu(void) goto lose; } - sprintf(cpu_model, NeXT/MC680%s CPU,mc); - /* * ...and the MMU type. */ switch (mmutype) { case MMU_68040: case MMU_68030: - strcat(cpu_model, +MMU); +/*###344 [cc] error: 'mmu_str' undeclared (first use in this function)%%%*/ +/*###344 [cc] note: each undeclared identifier is reported only once for each function it appears in%%%*/ + mmu_str = +MMU; break; case MMU_68851: - strcat(cpu_model, , MC68851 MMU); + mmu_str = , MC68851 MMU; break; case MMU_HP: - strcat(cpu_model, , HP MMU); + mmu_str = , HP MMU; break; default: - printf(%s\nunknown MMU type %d\n, cpu_model, mmutype); + printf(MC680%s: unknown MMU type %d\n, mc, mmutype); panic(startup); } - len = strlen(cpu_model); - /* * ...and the FPU type. */ switch (fputype) { case FPU_68040: - len += sprintf(cpu_model + len, +FPU); +/*###362 [cc] error: 'fpu_str' undeclared (first use in this function)%%%*/ + fpu_str = +FPU; break; case FPU_68882: - len += sprintf(cpu_model + len, , MC68882 FPU); + fpu_str = , MC68882 FPU; break; case FPU_68881: - len += sprintf(cpu_model + len, , MHz MC68881 FPU); + fpu_str = , MHz MC68881 FPU; break; default: - len += sprintf(cpu_model + len, , unknown FPU); + fpu_str = , unknown FPU; } /* * ...and finally, the cache type. */ if (cputype == CPU_68040) - sprintf(cpu_model + len, , 4k on-chip physical I/D caches); +/*###378 [cc] error: 'cache_str' undeclared (first use in this function)%%%*/ + cache_str = , 4k on-chip physical I/D caches; else { #if defined(ENABLE_HP_CODE) switch (ectype) { case EC_VIRT: - sprintf(cpu_model + len, - , virtual-address cache); + cache_str = , virtual-address cache; break; case EC_PHYS: - sprintf(cpu_model + len, - , physical-address cache); + cache_str = , physical-address cache; + break; + default: + cache_str = ; break; } +#else + cache_str = ; #endif } - printf(%s\n, cpu_model); +/*###397 [cc] error: implicit declaration of function 'cpu_setmodel' [-Werror=implicit-function-declaration]%%%*/ + cpu_setmodel(NeXT/MC680%s CPU%s%s%s, mc,
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: tsutsui Date: Sat Mar 15 12:06:54 UTC 2014 Modified Files: src/sys/arch/next68k/next68k: 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.64 -r1.65 src/sys/arch/next68k/next68k/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/next68k/next68k/locore.s diff -u src/sys/arch/next68k/next68k/locore.s:1.64 src/sys/arch/next68k/next68k/locore.s:1.65 --- src/sys/arch/next68k/next68k/locore.s:1.64 Sun Mar 9 16:28:43 2014 +++ src/sys/arch/next68k/next68k/locore.s Sat Mar 15 12:06:54 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.64 2014/03/09 16:28:43 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.65 2014/03/15 12:06:54 tsutsui Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell @@ -507,192 +507,10 @@ Lenab3: */ #include m68k/m68k/trap_subr.s -#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
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: tsutsui Date: Sun Jan 5 06:30:48 UTC 2014 Modified Files: src/sys/arch/next68k/next68k: pmap_bootstrap.c Log Message: Move physmem calculations before nptpage initialization. Should fix next68k specific part of PR port-m68k/45915 (panic: pmap_enter_ptpage: can't get KPT page), and this is the last possible m68k MD part of this PR. Note this change is not tested on the actual machine (yet), but as noted in comment next68k/pmap_bootstrap.c is based on the mvme68k one which has been fixed by the similar diff. Should be pulled up to all netbsd-6 branches. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/next68k/next68k/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/next68k/next68k/pmap_bootstrap.c diff -u src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.42 src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.43 --- src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.42 Fri Feb 10 06:28:39 2012 +++ src/sys/arch/next68k/next68k/pmap_bootstrap.c Sun Jan 5 06:30:48 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.42 2012/02/10 06:28:39 mhitch Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.43 2014/01/05 06:30:48 tsutsui Exp $ */ /* * This file was taken from mvme68k/mvme68k/pmap_bootstrap.c @@ -45,7 +45,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.42 2012/02/10 06:28:39 mhitch Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.43 2014/01/05 06:30:48 tsutsui Exp $); #include opt_m68k_arch.h @@ -111,6 +111,42 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f #endif /* + * Initialize the mem_clusters[] array for the crash dump + * code. While we're at it, compute the total amount of + * physical memory in the system. + */ + for (i = 0; i VM_PHYSSEG_MAX; i++) { + if (RELOC(phys_seg_list[i].ps_start, paddr_t) == + RELOC(phys_seg_list[i].ps_end, paddr_t)) { + /* + * No more memory. + */ + break; + } + + /* + * Make sure these are properly rounded. + */ + RELOC(phys_seg_list[i].ps_start, paddr_t) = + m68k_round_page(RELOC(phys_seg_list[i].ps_start, + paddr_t)); + RELOC(phys_seg_list[i].ps_end, paddr_t) = + m68k_trunc_page(RELOC(phys_seg_list[i].ps_end, + paddr_t)); + + size = RELOC(phys_seg_list[i].ps_end, paddr_t) - + RELOC(phys_seg_list[i].ps_start, paddr_t); + + RELOC(mem_clusters[i].start, u_quad_t) = + RELOC(phys_seg_list[i].ps_start, paddr_t); + RELOC(mem_clusters[i].size, u_quad_t) = size; + + RELOC(physmem, int) += size PGSHIFT; + + RELOC(mem_cluster_cnt, int) += 1; + } + + /* * Calculate important physical addresses: * * lwp0upa lwp0 u-area UPAGES pages @@ -484,42 +520,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa; /* - * Initialize the mem_clusters[] array for the crash dump - * code. While we're at it, compute the total amount of - * physical memory in the system. - */ - for (i = 0; i VM_PHYSSEG_MAX; i++) { - if (RELOC(phys_seg_list[i].ps_start, paddr_t) == - RELOC(phys_seg_list[i].ps_end, paddr_t)) { - /* - * No more memory. - */ - break; - } - - /* - * Make sure these are properly rounded. - */ - RELOC(phys_seg_list[i].ps_start, paddr_t) = - m68k_round_page(RELOC(phys_seg_list[i].ps_start, - paddr_t)); - RELOC(phys_seg_list[i].ps_end, paddr_t) = - m68k_trunc_page(RELOC(phys_seg_list[i].ps_end, - paddr_t)); - - size = RELOC(phys_seg_list[i].ps_end, paddr_t) - - RELOC(phys_seg_list[i].ps_start, paddr_t); - - RELOC(mem_clusters[i].start, u_quad_t) = - RELOC(phys_seg_list[i].ps_start, paddr_t); - RELOC(mem_clusters[i].size, u_quad_t) = size; - - RELOC(physmem, int) += size PGSHIFT; - - RELOC(mem_cluster_cnt, int) += 1; - } - - /* * Scoot the start of available on-board RAM forward to * account for: *
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: tsutsui Date: Sat Aug 11 01:21:05 UTC 2012 Modified Files: src/sys/arch/next68k/next68k: machdep.c nextrom.c Log Message: Sprinkle extern to appease gcc -fno-common. To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/sys/arch/next68k/next68k/machdep.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/next68k/next68k/nextrom.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/next68k/next68k/machdep.c diff -u src/sys/arch/next68k/next68k/machdep.c:1.108 src/sys/arch/next68k/next68k/machdep.c:1.109 --- src/sys/arch/next68k/next68k/machdep.c:1.108 Sat Jul 28 19:08:24 2012 +++ src/sys/arch/next68k/next68k/machdep.c Sat Aug 11 01:21:04 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.108 2012/07/28 19:08:24 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.109 2012/08/11 01:21:04 tsutsui Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell @@ -40,7 +40,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.108 2012/07/28 19:08:24 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.109 2012/08/11 01:21:04 tsutsui Exp $); #include opt_ddb.h #include opt_kgdb.h @@ -115,7 +115,8 @@ __KERNEL_RCSID(0, $NetBSD: machdep.c,v #include ksyms.h int nsym; -char *ssym, *esym; +char *ssym; +extern char *esym; #define MAXMEM 64*1024 /* XXX - from cmap.h */ Index: src/sys/arch/next68k/next68k/nextrom.c diff -u src/sys/arch/next68k/next68k/nextrom.c:1.24 src/sys/arch/next68k/next68k/nextrom.c:1.25 --- src/sys/arch/next68k/next68k/nextrom.c:1.24 Sun Dec 18 04:29:32 2011 +++ src/sys/arch/next68k/next68k/nextrom.c Sat Aug 11 01:21:04 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: nextrom.c,v 1.24 2011/12/18 04:29:32 tsutsui Exp $ */ +/* $NetBSD: nextrom.c,v 1.25 2012/08/11 01:21:04 tsutsui Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell * All rights reserved. @@ -25,7 +25,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: nextrom.c,v 1.24 2011/12/18 04:29:32 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: nextrom.c,v 1.25 2012/08/11 01:21:04 tsutsui Exp $); #include opt_ddb.h #include opt_serial.h @@ -50,8 +50,8 @@ int mon_getc(void); int mon_putc(int); extern char etext[], edata[], end[]; -int nsym; -char *ssym, *esym; +extern int nsym; +extern char *ssym, *esym; volatile struct mon_global *mg;
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: tsutsui Date: Sun Dec 18 03:46:02 UTC 2011 Modified Files: src/sys/arch/next68k/next68k: nextrom.c Log Message: PR port-next68k/45719 from Jaime Fournier: Fix RELOC() (awful VA - PA conversion) usage introduced to appease gcc45 in rev 1.22. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/next68k/next68k/nextrom.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/next68k/next68k/nextrom.c diff -u src/sys/arch/next68k/next68k/nextrom.c:1.22 src/sys/arch/next68k/next68k/nextrom.c:1.23 --- src/sys/arch/next68k/next68k/nextrom.c:1.22 Sat Oct 1 15:59:01 2011 +++ src/sys/arch/next68k/next68k/nextrom.c Sun Dec 18 03:46:02 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: nextrom.c,v 1.22 2011/10/01 15:59:01 chs Exp $ */ +/* $NetBSD: nextrom.c,v 1.23 2011/12/18 03:46:02 tsutsui Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell * All rights reserved. @@ -25,7 +25,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: nextrom.c,v 1.22 2011/10/01 15:59:01 chs Exp $); +__KERNEL_RCSID(0, $NetBSD: nextrom.c,v 1.23 2011/12/18 03:46:02 tsutsui Exp $); #include opt_ddb.h #include opt_serial.h @@ -93,9 +93,9 @@ static char romprint_hextable[] = 01234 #define ROM_PUTX(v) \ do { \ (*MONRELOC(putcptr,MG_putc)) \ - (RELOC(romprint_hextable, const char *)[((v)4)0xf]); \ + (RELOC(romprint_hextable[((v)4)0xf], char)); \ (*MONRELOC(putcptr,MG_putc)) \ - (RELOC(romprint_hextable, const char *)[(v)0xf]); \ + (RELOC(romprint_hextable[(v)0xf], char)); \ } while(0); #else #define lookup_hex(v) ((v)9?('a'+(v)-0xa):('0'+(v)))
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: tsutsui Date: Sun Dec 18 04:29:32 UTC 2011 Modified Files: src/sys/arch/next68k/next68k: nextrom.c nextrom.h Log Message: Misc KNF and cosmetics. No binary changes. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/next68k/next68k/nextrom.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/next68k/next68k/nextrom.h 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/next68k/next68k/nextrom.c diff -u src/sys/arch/next68k/next68k/nextrom.c:1.23 src/sys/arch/next68k/next68k/nextrom.c:1.24 --- src/sys/arch/next68k/next68k/nextrom.c:1.23 Sun Dec 18 03:46:02 2011 +++ src/sys/arch/next68k/next68k/nextrom.c Sun Dec 18 04:29:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: nextrom.c,v 1.23 2011/12/18 03:46:02 tsutsui Exp $ */ +/* $NetBSD: nextrom.c,v 1.24 2011/12/18 04:29:32 tsutsui Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell * All rights reserved. @@ -25,7 +25,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: nextrom.c,v 1.23 2011/12/18 03:46:02 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: nextrom.c,v 1.24 2011/12/18 04:29:32 tsutsui Exp $); #include opt_ddb.h #include opt_serial.h @@ -56,12 +56,12 @@ char *ssym, *esym; volatile struct mon_global *mg; -#define MON(type, off) (*(type *)((u_int) (mg) + off)) +#define MON(type, off) (*(type *)((u_int) (mg) + off)) #define RELOC(v, t) (*((t *)((u_int)(v) + NEXT_RAMBASE))) #define MONRELOC(type, off) \ - (*(volatile type *)((u_int) RELOC(mg,volatile struct mon_global *) + off)) +(*(volatile type *)((u_int)RELOC(mg, volatile struct mon_global *) + off)) typedef int (*getcptr)(void); @@ -80,47 +80,49 @@ typedef int (*putcptr)(int); #else #define ROM_PUTC(c) \ - (*MONRELOC(putcptr,MG_putc))(c) + (*MONRELOC(putcptr, MG_putc))(c) #define ROM_PUTS(xs) \ - do { volatile const char *_s = xs + NEXT_RAMBASE; \ - while(_s *_s) (*MONRELOC(putcptr,MG_putc))(*_s++); \ - } while(0) + do {\ + volatile const char *_s = xs + NEXT_RAMBASE; \ + while (_s *_s) \ + (*MONRELOC(putcptr, MG_putc))(*_s++); \ + } while (/* CONSTCOND */0) /* Print a hex byte on the rom console */ #if 1 static char romprint_hextable[] = 0123456789abcdef@; -#define ROM_PUTX(v) \ - do { \ -(*MONRELOC(putcptr,MG_putc)) \ - (RELOC(romprint_hextable[((v)4)0xf], char)); \ -(*MONRELOC(putcptr,MG_putc)) \ - (RELOC(romprint_hextable[(v)0xf], char)); \ - } while(0); +#define ROM_PUTX(v) \ + do {\ + (*MONRELOC(putcptr, MG_putc))\ + (RELOC(romprint_hextable[((v)4)0xf], char)); \ + (*MONRELOC(putcptr, MG_putc))\ + (RELOC(romprint_hextable[(v)0xf], char)); \ + } while (/* CONSTCOND */0); #else -#define lookup_hex(v) ((v)9?('a'+(v)-0xa):('0'+(v))) +#define lookup_hex(v) ((v) 9 ? ('a' + (v) - 0xa) : ('0' + (v))) #define ROM_PUTX(v) \ - do { \ -(*MONRELOC(putcptr,MG_putc)) \ - (lookup_hex(((v)4)0xf)); \ -(*MONRELOC(putcptr,MG_putc)) \ - (lookup_hex((v)0xf)); \ - } while(0); + do {\ + (*MONRELOC(putcptr, MG_putc))\ + (lookup_hex(((v) 4) 0xf)); \ + (*MONRELOC(putcptr, MG_putc))\ + (lookup_hex((v) 0xf));\ + } while (/* CONSTCOND */0); #endif #endif -u_char rom_enetaddr[6]; -u_char rom_boot_dev[20]; -u_char rom_boot_arg[20]; -u_char rom_boot_info[20]; -u_char rom_boot_file[20]; -u_char rom_bootfile[MG_boot_how-MG_bootfile]; +uint8_t rom_enetaddr[6]; +uint8_t rom_boot_dev[20]; +uint8_t rom_boot_arg[20]; +uint8_t rom_boot_info[20]; +uint8_t rom_boot_file[20]; +uint8_t rom_bootfile[MG_boot_how - MG_bootfile]; char rom_machine_type; -u_char *rom_return_sp; +uint8_t *rom_return_sp; u_int rom_mon_stack; -u_char rom_image[0x2000]; -vm_offset_t rom_image_base; +uint8_t rom_image[0x2000]; +paddr_t rom_image_base; u_int rom_vbr; u_int rom_intrmask; u_int rom_intrstat; @@ -141,8 +143,8 @@ next68k_bootargs(unsigned char **args) const char *reloc_elfmag; #endif - RELOC(rom_return_sp,u_char *) = args[0]; - RELOC(mg,char *) = args[1]; + RELOC(rom_return_sp, uint8_t *) = args[0]; + RELOC(mg, char *) = args[1]; ROM_PUTS(Welcome to NetBSD/next68k\r\n); @@ -201,24 +203,24 @@ next68k_bootargs(unsigned char **args) ROM_PUTS(Constructing the segment list...\r\n); ROM_PUTS(machine type = 0x); - ROM_PUTX(MONRELOC(char,MG_machine_type)); + ROM_PUTX(MONRELOC(char, MG_machine_type)); ROM_PUTS(\r\nboard rev = 0x); - ROM_PUTX(MONRELOC(char,MG_board_rev)); + ROM_PUTX(MONRELOC(char, MG_board_rev)); ROM_PUTS(\r\ndmachip = 0x); - ROM_PUTX(MONRELOC(int,MG_dmachip)240xff); - ROM_PUTX(MONRELOC(int,MG_dmachip)160xff); - ROM_PUTX(MONRELOC(int,MG_dmachip)80xff); - ROM_PUTX(MONRELOC(int,MG_dmachip)00xff); + ROM_PUTX(MONRELOC(int, MG_dmachip) 24 0xff); + ROM_PUTX(MONRELOC(int, MG_dmachip) 16 0xff); + ROM_PUTX(MONRELOC(int, MG_dmachip) 8 0xff); + ROM_PUTX(MONRELOC(int, MG_dmachip) 0
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: tsutsui Date: Tue May 10 14:45:28 UTC 2011 Modified Files: src/sys/arch/next68k/next68k: autoconf.c machdep.c Log Message: Move isrinit() call from early next68k_init() to cpu_configure(9) since interrupt service routines would want evcnt(9). To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/next68k/next68k/autoconf.c cvs rdiff -u -r1.102 -r1.103 src/sys/arch/next68k/next68k/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/next68k/next68k/autoconf.c diff -u src/sys/arch/next68k/next68k/autoconf.c:1.24 src/sys/arch/next68k/next68k/autoconf.c:1.25 --- src/sys/arch/next68k/next68k/autoconf.c:1.24 Tue Feb 8 20:20:21 2011 +++ src/sys/arch/next68k/next68k/autoconf.c Tue May 10 14:45:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.24 2011/02/08 20:20:21 rmind Exp $ */ +/* $NetBSD: autoconf.c,v 1.25 2011/05/10 14:45:28 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -47,7 +47,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.24 2011/02/08 20:20:21 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.25 2011/05/10 14:45:28 tsutsui Exp $); #include sys/param.h #include sys/systm.h @@ -96,6 +96,9 @@ booted_device = NULL; /* set by device drivers (if found) */ + /* Initialize the interrupt handlers. */ + isrinit(); + #if 0 dma_rev = ((volatile u_char *)IIOV(NEXT_P_SCR1))[1]; switch (dma_rev) { Index: src/sys/arch/next68k/next68k/machdep.c diff -u src/sys/arch/next68k/next68k/machdep.c:1.102 src/sys/arch/next68k/next68k/machdep.c:1.103 --- src/sys/arch/next68k/next68k/machdep.c:1.102 Sat Mar 5 19:04:58 2011 +++ src/sys/arch/next68k/next68k/machdep.c Tue May 10 14:45:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.102 2011/03/05 19:04:58 joerg Exp $ */ +/* $NetBSD: machdep.c,v 1.103 2011/05/10 14:45:28 tsutsui Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell @@ -40,7 +40,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.102 2011/03/05 19:04:58 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.103 2011/05/10 14:45:28 tsutsui Exp $); #include opt_ddb.h #include opt_kgdb.h @@ -211,9 +211,6 @@ } } - /* Initialize the interrupt handlers. */ - isrinit(); - /* Calibrate the delay loop. */ next68k_calibrate_delay();
CVS commit: src/sys/arch/next68k/next68k
Module Name:src Committed By: joerg Date: Sat Mar 5 19:04:58 UTC 2011 Modified Files: src/sys/arch/next68k/next68k: machdep.c Log Message: p_psstr - p_psstrp To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sys/arch/next68k/next68k/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/next68k/next68k/machdep.c diff -u src/sys/arch/next68k/next68k/machdep.c:1.101 src/sys/arch/next68k/next68k/machdep.c:1.102 --- src/sys/arch/next68k/next68k/machdep.c:1.101 Tue Feb 8 20:20:21 2011 +++ src/sys/arch/next68k/next68k/machdep.c Sat Mar 5 19:04:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.101 2011/02/08 20:20:21 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.102 2011/03/05 19:04:58 joerg Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell @@ -40,7 +40,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.101 2011/02/08 20:20:21 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.102 2011/03/05 19:04:58 joerg Exp $); #include opt_ddb.h #include opt_kgdb.h @@ -339,7 +339,7 @@ frame-f_regs[D7] = 0; frame-f_regs[A0] = 0; frame-f_regs[A1] = 0; - frame-f_regs[A2] = (int)l-l_proc-p_psstr; + frame-f_regs[A2] = l-l_proc-p_psstrp; frame-f_regs[A3] = 0; frame-f_regs[A4] = 0; frame-f_regs[A5] = 0;