summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/hppa64/hppa64/pmap.c17
-rw-r--r--sys/arch/m88k/m88k/db_trace.c6
2 files changed, 11 insertions, 12 deletions
diff --git a/sys/arch/hppa64/hppa64/pmap.c b/sys/arch/hppa64/hppa64/pmap.c
index 49497df07a1..43cc943d358 100644
--- a/sys/arch/hppa64/hppa64/pmap.c
+++ b/sys/arch/hppa64/hppa64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.7 2009/04/14 16:01:04 oga Exp $ */
+/* $OpenBSD: pmap.c,v 1.8 2009/12/16 16:54:42 jasper Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -393,7 +393,6 @@ const pt_entry_t hppa_pgs[] = {
PTE_PG16M,
PTE_PG64M
};
-#define nhppa_pgs sizeof(hppa_pgs)/sizeof(hppa_pgs[0])
void
pmap_maphys(paddr_t spa, paddr_t epa)
@@ -407,22 +406,22 @@ pmap_maphys(paddr_t spa, paddr_t epa)
s = ffs(spa) - 12;
e = ffs(epa) - 12;
- if (s < e || (s == e && s / 2 < nhppa_pgs)) {
+ if (s < e || (s == e && s / 2 < nitems(hppa_pgs))) {
i = s / 2;
- if (i > nhppa_pgs)
- i = nhppa_pgs;
+ if (i > nitems(hppa_pgs))
+ i = nitems(hppa_pgs);
pa = spa;
spa = tpa = 0x1000 << ((i + 1) * 2);
} else if (s > e) {
i = e / 2;
- if (i > nhppa_pgs)
- i = nhppa_pgs;
+ if (i > nitems(hppa_pgs))
+ i = nitems(hppa_pgs);
epa = pa = epa & (0xfffff000 << ((i + 1) * 2));
tpa = epa;
} else {
i = s / 2;
- if (i > nhppa_pgs)
- i = nhppa_pgs;
+ if (i > nitems(hppa_pgs))
+ i = nitems(hppa_pgs);
pa = spa;
spa = tpa = epa;
}
diff --git a/sys/arch/m88k/m88k/db_trace.c b/sys/arch/m88k/m88k/db_trace.c
index 7909960d94d..b5201b9b6f6 100644
--- a/sys/arch/m88k/m88k/db_trace.c
+++ b/sys/arch/m88k/m88k/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.10 2007/11/17 05:36:23 miod Exp $ */
+/* $OpenBSD: db_trace.c,v 1.11 2009/12/16 16:54:43 jasper Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -165,8 +165,8 @@ m88k_instruction_info(u_int32_t instruction)
{ 0xfc00ffe0U, 0xf400fc00U, /* rte */ FLOW_CTRL},
{ 0xfc000000U, 0xf8000000U, /* tbnd */ 0},
};
-#define ctrl_count (sizeof(control)/sizeof(control[0]))
- for (ptr = &control[0]; ptr < &control[ctrl_count]; ptr++)
+
+ for (ptr = &control[0]; ptr < &control[nitems(control)]; ptr++)
if ((instruction & ptr->mask) == ptr->value)
return ptr->flags;
return 0;