/* $NetBSD: load.cpp,v 1.15 2008/04/28 20:23:20 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by UCHIYAMA Yasushi.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
DPRINTF((TEXT("[file system image]\n")));
_load_segment(kv, sz, 0, sz);
return _load_success();
}
void
Loader::loadEnd(void)
{
/* tag chain end */
_load_segment_end();
}
void
Loader::tagDump(int n)
{
#ifdef PAGE_LINK_DUMP
struct PageTag *p, *op;
int i = 0;
DPRINTF((TEXT("page tag start physical address: 0x%08x\n"),
_page_tag_start));
p = reinterpret_cast <struct PageTag *>(_page_tag_start);
do {
if (i < n || p->src == ~0)
DPRINTF((TEXT("[%d] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
i, p->next, p->src, p->dst, p->sz));
else if (i == n)
DPRINTF((TEXT("[...]\n")));
op = p;
i++;
} while ((p = reinterpret_cast <struct PageTag *>(p->next)) != ~0);
DPRINTF((TEXT("[%d(last)] next 0x%08x src 0x%08x dst 0x%08x sz 0x%x\n"),
i - 1, op->next, op->src, op->dst, op->sz));
#endif // PAGE_LINK_DUMP
}