add some more casts to shut up gcc.
This commit is contained in:
parent
736ce53ae5
commit
6b64191106
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: emul.c,v 1.5 1999/11/06 20:18:50 eeh Exp $ */
|
||||
/* $NetBSD: emul.c,v 1.6 2000/04/06 12:49:00 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@ -52,8 +52,8 @@
|
||||
# define DPRINTF(a)
|
||||
#endif
|
||||
|
||||
#define GPR(tf, i) ((int32_t *) &tf->tf_global)[i]
|
||||
#define IPR(tf, i) ((int32_t *) tf->tf_out[6])[i - 16]
|
||||
#define GPR(tf, i) ((int32_t *)(u_long)&tf->tf_global)[i]
|
||||
#define IPR(tf, i) ((int32_t *)(u_long)tf->tf_out[6])[i - 16]
|
||||
#define FPR(p, i) ((int32_t) p->p_md.md_fpstate->fs_regs[i])
|
||||
|
||||
static __inline int readgpreg __P((struct trapframe64 *, int, void *));
|
||||
@ -209,17 +209,17 @@ muldiv(tf, code, rd, rs1, rs2)
|
||||
tf->tf_tstate &= ~(TSTATE_CCR);
|
||||
|
||||
if (*rd == 0)
|
||||
tf->tf_tstate |= (ICC_Z|XCC_Z) << TSTATE_CCR_SHIFT;
|
||||
tf->tf_tstate |= (u_int64_t)(ICC_Z|XCC_Z) << TSTATE_CCR_SHIFT;
|
||||
else {
|
||||
if (op.bits.sgn && *rd < 0)
|
||||
tf->tf_tstate |= (ICC_N|XCC_N) << TSTATE_CCR_SHIFT;
|
||||
tf->tf_tstate |= (u_int64_t)(ICC_N|XCC_N) << TSTATE_CCR_SHIFT;
|
||||
if (op.bits.div) {
|
||||
if (*rd * *rs2 != *rs1)
|
||||
tf->tf_tstate |= (ICC_V|XCC_V) << TSTATE_CCR_SHIFT;
|
||||
tf->tf_tstate |= (u_int64_t)(ICC_V|XCC_V) << TSTATE_CCR_SHIFT;
|
||||
}
|
||||
else {
|
||||
if (*rd / *rs2 != *rs1)
|
||||
tf->tf_tstate |= (ICC_V|XCC_V) << TSTATE_CCR_SHIFT;
|
||||
tf->tf_tstate |= (u_int64_t)(ICC_V|XCC_V) << TSTATE_CCR_SHIFT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -268,7 +268,7 @@ fixalign(p, tf)
|
||||
int error;
|
||||
|
||||
/* fetch and check the instruction that caused the fault */
|
||||
error = copyin((caddr_t) tf->tf_pc, &code.i_int, sizeof(code.i_int));
|
||||
error = copyin((caddr_t)(u_long)tf->tf_pc, &code.i_int, sizeof(code.i_int));
|
||||
if (error != 0) {
|
||||
DPRINTF(("fixalign: Bad instruction fetch\n"));
|
||||
return EINVAL;
|
||||
@ -345,13 +345,13 @@ fixalign(p, tf)
|
||||
}
|
||||
|
||||
if (size == 2)
|
||||
return copyout(&data.s[1], (caddr_t) rs1, size);
|
||||
return copyout(&data.s[1], (caddr_t)(u_long)rs1, size);
|
||||
else
|
||||
return copyout(&data.d, (caddr_t) rs1, size);
|
||||
return copyout(&data.d, (caddr_t)(u_long)rs1, size);
|
||||
}
|
||||
else { /* load */
|
||||
if (size == 2) {
|
||||
error = copyin((caddr_t) rs1, &data.s[1], size);
|
||||
error = copyin((caddr_t)(u_long)rs1, &data.s[1], size);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@ -362,7 +362,7 @@ fixalign(p, tf)
|
||||
data.s[0] = 0;
|
||||
}
|
||||
else
|
||||
error = copyin((caddr_t) rs1, &data.d, size);
|
||||
error = copyin((caddr_t)(u_long)rs1, &data.d, size);
|
||||
|
||||
if (error)
|
||||
return error;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: openfirm.c,v 1.8 1999/10/31 15:22:32 mrg Exp $ */
|
||||
/* $NetBSD: openfirm.c,v 1.9 2000/04/06 12:49:00 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
@ -458,7 +458,7 @@ OF_read(handle, addr, len)
|
||||
args.nreturns = 1;
|
||||
args.ihandle = HDL2CELL(handle);
|
||||
args.addr = ADR2CELL(addr);
|
||||
for (; len > 0; len -= l, addr += l) {
|
||||
for (; len > 0; len -= l, (char *)addr += l) {
|
||||
l = min(NBPG, len);
|
||||
args.len = l;
|
||||
if (openfirmware(&args) == -1)
|
||||
@ -507,7 +507,7 @@ Debugger();
|
||||
panic("OF_write");
|
||||
#endif
|
||||
}
|
||||
for (; len > 0; len -= l, addr += l) {
|
||||
for (; len > 0; len -= l, (char *)addr += l) {
|
||||
l = min(NBPG, len);
|
||||
args.len = l;
|
||||
if (openfirmware(&args) == -1)
|
||||
@ -615,8 +615,8 @@ OF_poweroff()
|
||||
}
|
||||
|
||||
void
|
||||
(*OF_set_callback(newfunc))()
|
||||
void (*newfunc)();
|
||||
(*OF_set_callback(newfunc))(void *)
|
||||
void (*newfunc)(void *);
|
||||
{
|
||||
struct {
|
||||
cell_t name;
|
||||
@ -690,7 +690,7 @@ void OF_sym2val(cells)
|
||||
args->result = -1;
|
||||
return;
|
||||
}
|
||||
symbol = (db_sym_t)args->symbol;
|
||||
symbol = (db_sym_t)(u_long)args->symbol;
|
||||
prom_printf("looking up symbol %s\n", symbol);
|
||||
db_symbol_values(symbol, (char**)NULL, &value);
|
||||
args->result = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.48 2000/03/16 02:37:00 eeh Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.49 2000/04/06 12:49:00 mrg Exp $ */
|
||||
#undef NO_VCACHE /* Don't forget the locked TLB in dostart */
|
||||
#define HWREF 1
|
||||
#undef BOOT_DEBUG
|
||||
@ -244,7 +244,9 @@ static int pmap_initialized;
|
||||
int avail_start, avail_end; /* These are used by ps & family */
|
||||
|
||||
static int ptelookup_va __P((vaddr_t va)); /* sun4u */
|
||||
#if notyet
|
||||
static void tsb_enter __P((int ctx, int64_t va, int64_t data));
|
||||
#endif
|
||||
static void pmap_pinit __P((struct pmap *));
|
||||
static void pmap_release __P((pmap_t));
|
||||
|
||||
@ -893,7 +895,7 @@ pmap_bootstrap(kernelstart, kernelend, maxctx)
|
||||
pmap_get_page(&newp);
|
||||
pmap_zero_page(newp);
|
||||
} while (!newp); /* Throw away page zero */
|
||||
pmap_kernel()->pm_segs=(paddr_t*)newp;
|
||||
pmap_kernel()->pm_segs=(paddr_t *)(u_long)newp;
|
||||
pmap_kernel()->pm_physaddr = newp;
|
||||
/* mark kernel context as busy */
|
||||
((paddr_t*)ctxbusy)[0] = (int)pmap_kernel()->pm_physaddr;
|
||||
@ -1128,7 +1130,7 @@ pmap_pinit(pm)
|
||||
}
|
||||
pm->pm_physaddr = (paddr_t)VM_PAGE_TO_PHYS(page);
|
||||
pmap_zero_page(pm->pm_physaddr);
|
||||
pm->pm_segs = (paddr_t*)pm->pm_physaddr;
|
||||
pm->pm_segs = (paddr_t *)(u_long)pm->pm_physaddr;
|
||||
if (!pm->pm_physaddr) panic("pmap_pinit");
|
||||
#ifdef NOTDEF_DEBUG
|
||||
printf("pmap_pinit: segs %p == %p\n", pm->pm_segs, (void*)page->phys_addr);
|
||||
@ -1189,18 +1191,18 @@ pmap_release(pm)
|
||||
for(i=0; i<STSZ; i++)
|
||||
if((pdir = (paddr_t *)ldxa(&pm->pm_segs[i], ASI_PHYS_CACHED))) {
|
||||
for (k=0; k<PDSZ; k++) {
|
||||
if ((ptbl = (paddr_t *)ldxa(&pdir[k], ASI_PHYS_CACHED))) {
|
||||
if ((ptbl = (paddr_t *)(u_long)ldxa(&pdir[k], ASI_PHYS_CACHED))) {
|
||||
for (j=0; j<PTSZ; j++) {
|
||||
int64_t data = ldxa(&ptbl[j], ASI_PHYS_CACHED);
|
||||
if (data&TLB_V &&
|
||||
IS_VM_PHYSADDR(data&TLB_PA_MASK)) {
|
||||
#ifdef DEBUG
|
||||
printf("pmap_release: pm=%p page %p still in use\n", pm,
|
||||
((long)i<<STSHIFT)|((long)k<<PDSHIFT)|((long)j<<PTSHIFT));
|
||||
printf("pmap_release: pm=%p page %llx still in use\n", pm,
|
||||
((u_int64_t)i<<STSHIFT)|((u_int64_t)k<<PDSHIFT)|((u_int64_t)j<<PTSHIFT));
|
||||
Debugger();
|
||||
#endif
|
||||
pmap_remove_pv(pm,
|
||||
((long)i<<STSHIFT)|((long)k<<PDSHIFT)|((long)j<<PTSHIFT),
|
||||
(long)((u_int64_t)i<<STSHIFT)|((long)k<<PDSHIFT)|((long)j<<PTSHIFT),
|
||||
data&TLB_PA_MASK);
|
||||
}
|
||||
}
|
||||
@ -1396,7 +1398,7 @@ pmap_kenter_pa(va, pa, prot)
|
||||
paddr_t pa;
|
||||
vm_prot_t prot;
|
||||
{
|
||||
return pmap_enter(pmap_kernel(), va, pa, prot, prot|PMAP_WIRED);
|
||||
pmap_enter(pmap_kernel(), va, pa, prot, prot|PMAP_WIRED);
|
||||
}
|
||||
#else
|
||||
void
|
||||
@ -1471,7 +1473,6 @@ pmap_kenter_pa(va, pa, prot)
|
||||
#endif
|
||||
tsb_enter(pm->pm_ctx, va, tte.data.data);
|
||||
ASSERT((tsb[i].data.data & TLB_NFO) == 0);
|
||||
#if 1
|
||||
#if 1
|
||||
/* this is correct */
|
||||
dcache_flush_page(va);
|
||||
@ -1479,7 +1480,6 @@ pmap_kenter_pa(va, pa, prot)
|
||||
/* Go totally crazy */
|
||||
blast_vcache();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
@ -1621,9 +1621,9 @@ pmap_enter(pm, va, pa, prot, flags)
|
||||
int flags;
|
||||
{
|
||||
pte_t tte;
|
||||
int s, i, aliased = 0;
|
||||
register pv_entry_t pv=NULL, npv;
|
||||
paddr_t pg;
|
||||
int i, aliased = 0;
|
||||
pv_entry_t pv = NULL;
|
||||
int size = 0; /* PMAP_SZ_TO_TTE(pa); */
|
||||
boolean_t wired = (flags & PMAP_WIRED) != 0;
|
||||
|
||||
@ -1691,7 +1691,10 @@ pmap_enter(pm, va, pa, prot, flags)
|
||||
#ifdef DEBUG
|
||||
enter_stats.ci ++;
|
||||
#endif
|
||||
/* tte.tag.tag = TSB_TAG(0,pm->pm_ctx,va); /* Not used any more. */
|
||||
/*
|
||||
* Not used any more.
|
||||
tte.tag.tag = TSB_TAG(0,pm->pm_ctx,va);
|
||||
*/
|
||||
tte.data.data = TSB_DATA(0, size, pa, pm == pmap_kernel(),
|
||||
(flags & VM_PROT_WRITE),
|
||||
(!(pa & PMAP_NC)),aliased,1,(pa & PMAP_LITTLE));
|
||||
@ -1733,14 +1736,16 @@ pmap_enter(pm, va, pa, prot, flags)
|
||||
}
|
||||
|
||||
#if 1
|
||||
if (pv) pmap_enter_pv(pm, va, pa);
|
||||
if (pv)
|
||||
pmap_enter_pv(pm, va, pa);
|
||||
#else
|
||||
if (pv) {
|
||||
/*
|
||||
* Enter the pmap and virtual address into the
|
||||
* physical to virtual map table.
|
||||
*/
|
||||
s = splimp();
|
||||
int npv;
|
||||
int s = splimp();
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & PDB_ENTER)
|
||||
printf("pmap_enter: pv %x: was %x/%x/%x ",
|
||||
@ -2431,7 +2436,9 @@ ptelookup_va(va)
|
||||
return (tsbptr/sizeof(pte_t));
|
||||
}
|
||||
|
||||
void tsb_enter(ctx, va, data)
|
||||
#if notyet
|
||||
void
|
||||
tsb_enter(ctx, va, data)
|
||||
int ctx;
|
||||
int64_t va;
|
||||
int64_t data;
|
||||
@ -2453,6 +2460,7 @@ void tsb_enter(ctx, va, data)
|
||||
tlb_flush_pte(va, ctx); /* Force reload -- protections may be changed */
|
||||
splx(s);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Do whatever is needed to sync the MOD/REF flags
|
||||
@ -2540,9 +2548,6 @@ pmap_clear_modify(pg)
|
||||
printf("pmap_clear_modify(): %p still modified!\n", pg);
|
||||
Debugger();
|
||||
}
|
||||
#endif
|
||||
out:
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_CHANGEPROT|PDB_REF))
|
||||
printf("pmap_clear_modify: page %lx %s\n", (long)pa,
|
||||
(changed?"was modified":"was not modified"));
|
||||
@ -2642,9 +2647,6 @@ pmap_clear_reference(pg)
|
||||
printf("pmap_clear_reference(): %p still referenced!\n", pg);
|
||||
Debugger();
|
||||
}
|
||||
#endif
|
||||
out:
|
||||
#ifdef DEBUG
|
||||
if (pmapdebug & (PDB_CHANGEPROT|PDB_REF))
|
||||
printf("pmap_clear_reference: page %lx %s\n", (long)pa,
|
||||
(changed?"was referenced":"was not referenced"));
|
||||
@ -3028,7 +3030,9 @@ pmap_page_protect(pg, prot)
|
||||
pv->pv_pmap = NULL;
|
||||
pv->pv_next = NULL;
|
||||
}
|
||||
#if 0
|
||||
skipit:
|
||||
#endif
|
||||
}
|
||||
splx(s);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user