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 smart debug message.



details:   https://anonhg.NetBSD.org/src/rev/1dafa77d4154
branches:  trunk
changeset: 521749:1dafa77d4154
user:      uch <uch%NetBSD.org@localhost>
date:      Mon Feb 04 17:32:02 2002 +0000

description:
smart debug message.

diffstat:

 sys/arch/hpc/stand/hpcboot/file_http.cpp |  20 ++++++++++++++------
 sys/arch/hpc/stand/hpcboot/file_ufs.cpp  |   6 +++---
 sys/arch/hpc/stand/hpcboot/hpcboot.cpp   |  23 ++++++++++++++---------
 sys/arch/hpc/stand/hpcboot/memory.cpp    |  18 ++++++++----------
 4 files changed, 39 insertions(+), 28 deletions(-)

diffs (248 lines):

diff -r a1fd3a1f52ac -r 1dafa77d4154 sys/arch/hpc/stand/hpcboot/file_http.cpp
--- a/sys/arch/hpc/stand/hpcboot/file_http.cpp  Mon Feb 04 17:31:34 2002 +0000
+++ b/sys/arch/hpc/stand/hpcboot/file_http.cpp  Mon Feb 04 17:32:02 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: file_http.cpp,v 1.5 2001/05/08 18:51:22 uch Exp $      */
+/*     $NetBSD: file_http.cpp,v 1.6 2002/02/04 17:32:02 uch Exp $      */
 
 /*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -72,7 +72,7 @@
        //    _memory_cache = FALSE; // not recomended.
        _buffer = 0;
        _reset_state();
-       DPRINTF((TEXT("File: HTTP\n")));
+       DPRINTF((TEXT("FileManager: HTTP\n")));
 }
 
 HttpFile::~HttpFile(void)
@@ -172,7 +172,7 @@
        return FALSE;
   
  connected:
-       DPRINTF((TEXT(" \"%S\"\n"), _server_name));
+       DPRINTF((TEXT("(%S) connected.\n"), _server_name));
        closesocket(h);
 
        return TRUE;
@@ -181,7 +181,9 @@
 BOOL
 HttpFile::open(const TCHAR *name, u_int32_t flag)
 {
+
        _reset_state();
+
        return _to_ascii(_ascii_filename, name, MAX_PATH);
 }
 
@@ -293,13 +295,16 @@
                        if (__stricmp(token, "content-length") == 0) {
                                token = strtok(0, sep);
                                sz = atoi(token);
-                               DPRINTF((TEXT("content-length=%d\n"), sz));
+                               DPRINTFN(1, (TEXT("content-length=%d\n"), sz));
                        } else
                                token = strtok(0, sep);
                }
        }
        header_size = cnt;
-       DPRINTF((TEXT("header %d byte contents %d byte\n"), header_size, sz));
+
+       DPRINTF((TEXT
+           ("open file http://%S%S - header %d byte contents %d byte\n"),
+           _server_name, _ascii_filename, header_size, sz));
 
        return sz;
 }
@@ -324,6 +329,7 @@
 void
 HttpFile::_set_request(void)
 {
+
        strcat(_request, _ascii_filename);
        strcat(_request, _req_host);
        strcat(_request, _server_name);
@@ -347,6 +353,7 @@
 Socket::Socket(struct sockaddr_in &sock)
        : _sockaddr(sock)
 {
+
        _socket = socket(AF_INET, SOCK_STREAM, 0);
        if (_socket != INVALID_SOCKET)
                connect(_socket,
@@ -356,6 +363,7 @@
 
 Socket::~Socket(void)
 { 
+
        if (_socket != INVALID_SOCKET)
                closesocket(_socket);
 }
diff -r a1fd3a1f52ac -r 1dafa77d4154 sys/arch/hpc/stand/hpcboot/file_ufs.cpp
--- a/sys/arch/hpc/stand/hpcboot/file_ufs.cpp   Mon Feb 04 17:31:34 2002 +0000
+++ b/sys/arch/hpc/stand/hpcboot/file_ufs.cpp   Mon Feb 04 17:32:02 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: file_ufs.cpp,v 1.1 2001/02/09 18:34:39 uch Exp $       */
+/*     $NetBSD: file_ufs.cpp,v 1.2 2002/02/04 17:32:02 uch Exp $       */
 
 /*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -62,7 +62,7 @@
        _f->f_dev = devsw;
        _debug = TRUE;
 
-       DPRINTF((TEXT("File: UFS\n")));
+       DPRINTF((TEXT("FileManager: UFS\n")));
 }
 
 UfsFile::~UfsFile(void)
diff -r a1fd3a1f52ac -r 1dafa77d4154 sys/arch/hpc/stand/hpcboot/hpcboot.cpp
--- a/sys/arch/hpc/stand/hpcboot/hpcboot.cpp    Mon Feb 04 17:31:34 2002 +0000
+++ b/sys/arch/hpc/stand/hpcboot/hpcboot.cpp    Mon Feb 04 17:32:02 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: hpcboot.cpp,v 1.4 2001/05/08 18:51:22 uch Exp $        */
+/*     $NetBSD: hpcboot.cpp,v 1.5 2002/02/04 17:32:02 uch Exp $        */
 
 /*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -101,17 +101,21 @@
        Boot &f = Boot::Instance();
 
        menu.progress();
-       if (!f.setup())
-               return;
+       if (!f.setup()) {
+               error_message = TEXT("architecture not supported.\n");
+               goto failed_exit;
+       }
 
        menu.progress();
-       if (!f.create())
-               return;
+       if (!f.create()) {
+               error_message = TEXT("architexture ops. not found.\n");
+               goto failed_exit;
+       }
 
        menu.progress();
        if (!f._arch->init()) {
                error_message = TEXT("architecture initialize failed.\n");
-               goto failed;
+               goto failed_exit;
        }
 
        f._arch->systemInfo();
@@ -120,7 +124,7 @@
        // kernel / file system image directory.
        if (!f._file->setRoot(f.args.fileRoot)) {
                error_message = TEXT("couldn't set root directory.\n");
-               goto failed;
+               goto failed_exit;
        }
 
        // open file system image.
@@ -129,7 +133,7 @@
                if (!f._file->open(f.args.mfsName)) {
                        error_message =
                            TEXT("couldn't open file system image.\n");
-                       goto failed;
+                       goto failed_exit;
                }
                sz = f._file->size();
                f._file->close();
@@ -205,6 +209,7 @@
        if (error_message == 0)
                error_message = TEXT("can't jump to kernel.\n");
        f._file->close();
+ failed_exit:
        MessageBox(menu._root->_window, error_message,
            TEXT("BOOT FAILED"), 0);
 }
diff -r a1fd3a1f52ac -r 1dafa77d4154 sys/arch/hpc/stand/hpcboot/memory.cpp
--- a/sys/arch/hpc/stand/hpcboot/memory.cpp     Mon Feb 04 17:31:34 2002 +0000
+++ b/sys/arch/hpc/stand/hpcboot/memory.cpp     Mon Feb 04 17:32:02 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: memory.cpp,v 1.4 2001/05/16 08:37:44 enami Exp $       */
+/*     $NetBSD: memory.cpp,v 1.5 2002/02/04 17:32:02 uch Exp $ */
 
 /*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -43,7 +43,7 @@
        : _cons(cons)
 {
        _debug = FALSE;
-       _page_size =pagesize;
+       _page_size = pagesize;
   
        int mask = _page_size;
        for (_page_shift = 0; !(mask & 1); _page_shift++)
@@ -51,8 +51,6 @@
 
        _page_per_region = WCE_REGION_SIZE / _page_size;
        _nbank = 0;
-       DPRINTF((TEXT("Page size %dbyte %dpages/region\n"),
-           _page_size , _page_per_region));
        _addr_table_idx = 0;
        _addr_table = 0;
        _memory = 0;
@@ -70,7 +68,7 @@
        struct MemoryManager::bank *b = &_bank[_nbank++];
        b->addr = paddr;
        b->size = psize;
-       DPRINTF((TEXT("Bank#%d 0x%08x size 0x%08x\n"), _nbank - 1,
+       DPRINTF((TEXT("[%d] 0x%08x size 0x%08x\n"), _nbank - 1,
            b->addr, b->size));
 }
 
@@ -86,7 +84,7 @@
        if (size == 0)
                return FALSE;
 
-  // reserve all virtual memory.
+       // reserve all virtual memory.
        vsize = roundRegion(size);
        npage = roundPage(size) / _page_size;
 
@@ -113,7 +111,7 @@
        }
        _memory = vbase;
 
-  // find physical address of allocated page.
+       // find physical address of allocated page.
        AddressTranslationTable *tab = _addr_table;
        _naddr_table = 0;
        for (i = 0; i < npage; i++) {
@@ -264,7 +262,7 @@
        _lock_pages     = lock_pages;
        _unlock_pages   = unlock_pages;
        _shift = shift;
-       DPRINTF((TEXT("use LockPages method.\n")));
+       DPRINTF((TEXT("MemoryManager: LockPages\n")));
 }
 
 MemoryManager_LockPages::~MemoryManager_LockPages(void)
@@ -294,7 +292,7 @@
        : MemoryManager(cons, pagesize)
 {
        _search_guess = 0;
-       DPRINTF((TEXT("use VirtualCopy method.\n")));
+       DPRINTF((TEXT("MemoryManager: VirtualCopy\n")));
 }
 
 MemoryManager_VirtualCopy::~MemoryManager_VirtualCopy(void)



Home | Main Index | Thread Index | Old Index