Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpc/stand/hpcboot change debug printf method.
details: https://anonhg.NetBSD.org/src/rev/03ac848ac811
branches: trunk
changeset: 522107:03ac848ac811
user: uch <uch%NetBSD.org@localhost>
date: Mon Feb 11 17:01:09 2002 +0000
description:
change debug printf method.
diffstat:
sys/arch/hpc/stand/hpcboot/arch.cpp | 43 +-----------------------------------
sys/arch/hpc/stand/hpcboot/arch.h | 7 +-----
sys/arch/hpc/stand/hpcboot/hpcboot.h | 13 ++++++++++-
3 files changed, 14 insertions(+), 49 deletions(-)
diffs (109 lines):
diff -r 3aa90d6b83b3 -r 03ac848ac811 sys/arch/hpc/stand/hpcboot/arch.cpp
--- a/sys/arch/hpc/stand/hpcboot/arch.cpp Mon Feb 11 16:23:17 2002 +0000
+++ b/sys/arch/hpc/stand/hpcboot/arch.cpp Mon Feb 11 17:01:09 2002 +0000
@@ -1,4 +1,4 @@
-/* -*-C++-*- $NetBSD: arch.cpp,v 1.4 2002/02/04 17:31:34 uch Exp $ */
+/* -*-C++-*- $NetBSD: arch.cpp,v 1.5 2002/02/11 17:01:09 uch Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -163,44 +163,3 @@
return reinterpret_cast <BOOL(*)(LPVOID, DWORD)>
(_load_func(TEXT("UnlockPages")));
}
-
-//
-// Debug support.
-//
-void
-Architecture::_bitdisp(u_int32_t a, int s, int e, int m, int c)
-{
- u_int32_t j, j1;
- int i, n;
-
- n = 31; // 32bit only.
- j1 = 1 << n;
- e = e ? e : n;
- for (j = j1, i = n; j > 0; j >>=1, i--) {
- if (i > e || i < s) {
- DPRINTF((TEXT("%c"), a & j ? '+' : '-'));
- } else {
- DPRINTF((TEXT("%c"), a & j ? '|' : '.'));
- }
- }
- if (m) {
- DPRINTF((TEXT("[%s]"),(char*)m));
- }
- if (c) {
- for (j = j1, i = n; j > 0; j >>=1, i--) {
- if (!(i > e || i < s) &&(a & j)) {
- DPRINTF((TEXT(" %d"), i));
- }
- }
- }
- DPRINTF((TEXT(" [0x%08x] %d"), a, a));
- DPRINTF((TEXT("\n")));
-}
-
-void
-Architecture::_dbg_bit_print(u_int32_t reg, u_int32_t mask, const char *name)
-{
- static const char onoff[3] = "_x";
-
- DPRINTF((TEXT("%S[%c] "), name, onoff[reg & mask ? 1 : 0]));
-}
diff -r 3aa90d6b83b3 -r 03ac848ac811 sys/arch/hpc/stand/hpcboot/arch.h
--- a/sys/arch/hpc/stand/hpcboot/arch.h Mon Feb 11 16:23:17 2002 +0000
+++ b/sys/arch/hpc/stand/hpcboot/arch.h Mon Feb 11 17:01:09 2002 +0000
@@ -1,4 +1,4 @@
-/* -*-C++-*- $NetBSD: arch.h,v 1.2 2001/03/15 17:24:47 uch Exp $ */
+/* -*-C++-*- $NetBSD: arch.h,v 1.3 2002/02/11 17:01:09 uch Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -56,11 +56,6 @@
struct BootArgs *_boot_arg;
BOOL _debug;
- /* debug utility */
- void _bitdisp(u_int32_t, int, int, int, int);
- void _dbg_bit_print(u_int32_t, u_int32_t, const char *);
-#define bitdisp(a) _bitdisp((a), 0, 0, 0, 1)
-
public:
Architecture(Console *&, MemoryManager *&);
virtual ~Architecture(void);
diff -r 3aa90d6b83b3 -r 03ac848ac811 sys/arch/hpc/stand/hpcboot/hpcboot.h
--- a/sys/arch/hpc/stand/hpcboot/hpcboot.h Mon Feb 11 16:23:17 2002 +0000
+++ b/sys/arch/hpc/stand/hpcboot/hpcboot.h Mon Feb 11 17:01:09 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hpcboot.h,v 1.2 2002/02/04 17:32:36 uch Exp $ */
+/* $NetBSD: hpcboot.h,v 1.3 2002/02/11 17:01:09 uch Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -125,6 +125,12 @@
#define VOLATILE_REF(x) (*(volatile u_int32_t *)(x))
#define VOLATILE_REF16(x) (*(volatile u_int16_t *)(x))
#define VOLATILE_REF8(x) (*(volatile u_int8_t *)(x))
+#define _reg_read_1(a) (*(volatile u_int8_t *)(a))
+#define _reg_read_2(a) (*(volatile u_int16_t *)(a))
+#define _reg_read_4(a) (*(volatile u_int32_t *)(a))
+#define _reg_write_1(a, v) (*(volatile u_int8_t *)(a) = (v))
+#define _reg_write_2(a, v) (*(volatile u_int16_t *)(a) = (v))
+#define _reg_write_4(a, v) (*(volatile u_int32_t *)(a) = (v))
#ifdef ARM
#define ptokv(x) (x) /* UNCACHED FLAT */
@@ -148,6 +154,11 @@
/* ExtEscape */
#define GETVFRAMEPHYSICAL 6144
#define GETVFRAMELEN 6145
+
+/* debug utility */
+void _bitdisp(u_int32_t, int, int, int, int);
+void _dbg_bit_print(u_int32_t, u_int32_t, const char *);
+#define bitdisp(a) _bitdisp((a), 0, 0, 0, 1)
__END_DECLS
#endif /* _HPCBOOT_H_ */
Home |
Main Index |
Thread Index |
Old Index