Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k/x68k Misc KNF and cosmetics.
details: https://anonhg.NetBSD.org/src/rev/7418c3dcba6f
branches: trunk
changeset: 765001:7418c3dcba6f
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sun May 15 17:27:49 2011 +0000
description:
Misc KNF and cosmetics.
diffstat:
sys/arch/x68k/x68k/machdep.c | 124 ++++++++++++++++++++++--------------------
1 files changed, 64 insertions(+), 60 deletions(-)
diffs (truncated from 347 to 300 lines):
diff -r 30de0cf7a774 -r 7418c3dcba6f sys/arch/x68k/x68k/machdep.c
--- a/sys/arch/x68k/x68k/machdep.c Sun May 15 17:13:23 2011 +0000
+++ b/sys/arch/x68k/x68k/machdep.c Sun May 15 17:27:49 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.175 2011/05/14 10:57:50 tsutsui Exp $ */
+/* $NetBSD: machdep.c,v 1.176 2011/05/15 17:27:49 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.175 2011/05/14 10:57:50 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.176 2011/05/15 17:27:49 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -131,8 +131,8 @@
int safepri = PSL_LOWIPL;
/* prototypes for local functions */
-void identifycpu(void);
-void initcpu(void);
+void identifycpu(void);
+void initcpu(void);
int cpu_dumpsize(void);
int cpu_dump(int (*)(dev_t, daddr_t, void *, size_t), daddr_t *);
void cpu_init_kcore_hdr(void);
@@ -144,7 +144,7 @@
/* functions called from locore.s */
void x68k_init(void);
void dumpsys(void);
-void straytrap(int, u_short);
+void straytrap(int, u_short);
void nmihand(struct frame);
void intrhand(int);
@@ -202,6 +202,7 @@
void
consinit(void)
{
+
/*
* bring graphics layer up.
*/
@@ -217,7 +218,7 @@
#endif
#if NKSYMS || defined(DDB) || defined(MODULAR)
ksyms_addsyms_elf((int)esym - (int)&end - sizeof(Elf32_Ehdr),
- (void *)&end, esym);
+ (void *)&end, esym);
#endif
#ifdef DDB
if (boothowto & RB_KDB)
@@ -263,7 +264,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;
@@ -319,7 +320,7 @@
char cpu_model[96]; /* max 85 chars */
static const char *fpu_descr[] = {
#ifdef FPU_EMULATE
- ", emulator FPU", /* 0 */
+ ", emulator FPU", /* 0 */
#else
", no math support", /* 0 */
#endif
@@ -399,7 +400,7 @@
else
fpu = ", unknown FPU";
sprintf(cpu_model, "X68%s (%s CPU%s%s, %s clock)",
- mach, cpu_type, mmu, fpu, clock);
+ mach, cpu_type, mmu, fpu, clock);
printf("%s\n", cpu_model);
}
@@ -410,16 +411,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;
@@ -487,7 +488,7 @@
printf("rebooting...\n");
DELAY(1000000);
doboot();
- /*NOTREACHED*/
+ /* NOTREACHED */
}
/*
@@ -530,7 +531,7 @@
/*
* Initialize pointer to kernel segment table.
*/
- m->sysseg_pa = (u_int32_t)(pmap_kernel()->pm_stpa);
+ m->sysseg_pa = (uint32_t)(pmap_kernel()->pm_stpa);
/*
* Initialize relocation value such that:
@@ -542,7 +543,7 @@
/*
* Define the end of the relocatable range.
*/
- m->relocend = (u_int32_t)&end;
+ m->relocend = (uint32_t)&end;
/*
* X68k has multiple RAM segments on some models.
@@ -550,9 +551,10 @@
m->ram_segs[0].start = lowram;
m->ram_segs[0].size = mem_size - lowram;
for (i = 1; i < vm_nphysseg; i++) {
- m->ram_segs[i].start = ctob(VM_PHYSMEM_PTR(i)->start);
- m->ram_segs[i].size = ctob(VM_PHYSMEM_PTR(i)->end
- - VM_PHYSMEM_PTR(i)->start);
+ m->ram_segs[i].start =
+ ctob(VM_PHYSMEM_PTR(i)->start);
+ m->ram_segs[i].size =
+ ctob(VM_PHYSMEM_PTR(i)->end - VM_PHYSMEM_PTR(i)->start);
}
}
@@ -599,7 +601,7 @@
/*
* These variables are needed by /sbin/savecore
*/
-u_int32_t dumpmag = 0x8fca0101; /* magic number */
+uint32_t dumpmag = 0x8fca0101; /* magic number */
int dumpsize = 0; /* pages */
long dumplo = 0; /* blocks */
@@ -767,12 +769,12 @@
#if defined(M68060)
extern void *vectab[256];
#if defined(M060SP)
- extern u_int8_t I_CALL_TOP[];
- extern u_int8_t FP_CALL_TOP[];
+ extern uint8_t I_CALL_TOP[];
+ extern uint8_t FP_CALL_TOP[];
#else
- extern u_int8_t illinst;
+ extern uint8_t illinst;
#endif
- extern u_int8_t fpfault;
+ extern uint8_t fpfault;
#endif
#ifdef MAPPEDCOPY
@@ -782,7 +784,7 @@
* page mapping (if not already set). We don't do this on
* VAC machines as it loses big time.
*/
- if ((int) mappedcopysize == -1) {
+ if ((int)mappedcopysize == -1) {
mappedcopysize = PAGE_SIZE;
}
#endif
@@ -816,8 +818,9 @@
void
straytrap(int pc, u_short evec)
{
+
printf("unexpected trap (vector offset %x) from %x\n",
- evec & 0xFFF, pc);
+ evec & 0xFFF, pc);
#if defined(DDB)
Debugger();
#endif
@@ -831,14 +834,14 @@
int i;
label_t faultbuf;
- nofault = (int *) &faultbuf;
+ nofault = (int *)&faultbuf;
if (setjmp((label_t *)nofault)) {
nofault = NULL;
- return(1);
+ return 1;
}
i = *(volatile short *)addr;
nofault = NULL;
- return(0);
+ return 0;
}
int
@@ -847,19 +850,20 @@
int i;
label_t faultbuf;
- nofault = (int *) &faultbuf;
+ nofault = (int *)&faultbuf;
if (setjmp((label_t *)nofault)) {
nofault = NULL;
- return(1);
+ return 1;
}
i = *(volatile char *)addr;
nofault = NULL;
- return(0);
+ return 0;
}
void
intrhand(int sr)
{
+
printf("intrhand: unexpected sr 0x%x\n", sr);
}
@@ -898,6 +902,7 @@
void
nmihand(struct frame frame)
{
+
intio_set_sysport_keyctrl(intio_get_sysport_keyctrl() | 0x04);
if (1) {
@@ -920,7 +925,7 @@
if (crashandburn) {
crashandburn = 0;
panic(panicstr ?
- "forced crash, nosync" : "forced crash");
+ "forced crash, nosync" : "forced crash");
}
crashandburn++;
callout_reset(&candbtimer_ch, candbdelay,
@@ -1027,49 +1032,49 @@
void *begin_check, *end_check;
label_t faultbuf;
- DPRINTF (("Enter mem_exists(%p, %x)\n", mem, basemax));
- DPRINTF ((" pmap_enter(%p, %p) for target... ", mem_v, mem));
+ DPRINTF(("Enter mem_exists(%p, %x)\n", mem, basemax));
+ DPRINTF((" pmap_enter(%p, %p) for target... ", mem_v, mem));
pmap_enter(pmap_kernel(), mem_v, (paddr_t)mem,
- VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|PMAP_WIRED);
+ VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|PMAP_WIRED);
pmap_update(pmap_kernel());
- DPRINTF ((" done.\n"));
+ DPRINTF((" done.\n"));
/* only 24bits are significant on normal X680x0 systems */
base = (void *)((u_long)mem & 0x00FFFFFF);
- DPRINTF ((" pmap_enter(%p, %p) for shadow... ", base_v, base));
+ DPRINTF((" pmap_enter(%p, %p) for shadow... ", base_v, base));
pmap_enter(pmap_kernel(), base_v, (paddr_t)base,
- VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|PMAP_WIRED);
+ VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|PMAP_WIRED);
pmap_update(pmap_kernel());
- DPRINTF ((" done.\n"));
+ DPRINTF((" done.\n"));
- m = (void*)mem_v;
- b = (void*)base_v;
+ m = (void *)mem_v;
+ b = (void *)base_v;
/* This is somewhat paranoid -- avoid overwriting myself */
__asm("lea %%pc@(begin_check_mem),%0" : "=a"(begin_check));
__asm("lea %%pc@(end_check_mem),%0" : "=a"(end_check));
if (base >= begin_check && base < end_check) {
- size_t off = (char*)end_check - (char*)begin_check;
+ size_t off = (char *)end_check - (char *)begin_check;
- DPRINTF ((" Adjusting the testing area.\n"));
+ DPRINTF((" Adjusting the testing area.\n"));
m -= off;
b -= off;
}
- nofault = (int *) &faultbuf;
- if (setjmp ((label_t *)nofault)) {
- nofault = (int *) 0;
Home |
Main Index |
Thread Index |
Old Index