KNF.
This commit is contained in:
parent
5dd9fe4aa5
commit
fae3e8e7c1
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: arch.cpp,v 1.2 2001/03/15 17:24:47 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: arch.cpp,v 1.3 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -81,7 +81,7 @@ Architecture::setupBootInfo(Loader &loader)
|
||||
_boot_arg = reinterpret_cast <struct BootArgs *>(v);
|
||||
|
||||
_boot_arg->argc = menu.setup_kernel_args(v + sizeof(struct BootArgs),
|
||||
p + sizeof(struct BootArgs));
|
||||
p + sizeof(struct BootArgs));
|
||||
_boot_arg->argv = ptokv(p + sizeof(struct BootArgs));
|
||||
menu.setup_bootinfo(_boot_arg->bi);
|
||||
_boot_arg->bi.bi_cnuse = _cons->getBootConsole();
|
||||
@ -91,8 +91,8 @@ Architecture::setupBootInfo(Loader &loader)
|
||||
|
||||
struct bootinfo &bi = _boot_arg->bi;
|
||||
DPRINTF((TEXT("framebuffer: %dx%d type=%d linebytes=%d addr=0x%08x\n"),
|
||||
bi.fb_width, bi.fb_height, bi.fb_type, bi.fb_line_bytes,
|
||||
bi.fb_addr));
|
||||
bi.fb_width, bi.fb_height, bi.fb_type, bi.fb_line_bytes,
|
||||
bi.fb_addr));
|
||||
DPRINTF((TEXT("console = %d\n"), bi.bi_cnuse));
|
||||
|
||||
return p;
|
||||
@ -104,9 +104,8 @@ Architecture::_load_func(const TCHAR * name)
|
||||
if (_dll == 0)
|
||||
_dll = LoadLibrary(TEXT("coredll.dll"));
|
||||
|
||||
return _dll
|
||||
? reinterpret_cast <void *>(GetProcAddress(_dll, name))
|
||||
: 0;
|
||||
return
|
||||
_dll ? reinterpret_cast <void *>(GetProcAddress(_dll, name)) : 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -120,27 +119,27 @@ Architecture::systemInfo(void)
|
||||
// inquire default setting.
|
||||
FrameBufferInfo fb(0, 0);
|
||||
DPRINTF((TEXT("[DISPLAY] %dx%d %dbpp\n"), fb.width(), fb.height(),
|
||||
fb.bpp()));
|
||||
fb.bpp()));
|
||||
|
||||
func = reinterpret_cast <int(*)(HDC, int, int, LPCSTR, int, LPSTR)>
|
||||
(_load_func(TEXT("ExtEscape")));
|
||||
(_load_func(TEXT("ExtEscape")));
|
||||
if (func == 0) {
|
||||
DPRINTF((TEXT("ExtEscape not found.\n")));
|
||||
return;
|
||||
}
|
||||
hdc = GetDC(0);
|
||||
ret = func(hdc, GETVFRAMEPHYSICAL, 0, 0, sizeof(u_int32_t),
|
||||
reinterpret_cast <char *>(&val));
|
||||
reinterpret_cast <char *>(&val));
|
||||
if (ret == 0)
|
||||
DPRINTF((TEXT("ExtEscape(GETVFRAMEPHYSICAL) not implemented.\n")));
|
||||
else if (ret < 0)
|
||||
DPRINTF((TEXT("ExtEscape(GETVFRAMEPHYSICAL) failure.\n")));
|
||||
else
|
||||
DPRINTF((TEXT("frame buffer physical address: 0x%08x\n"),
|
||||
val));
|
||||
val));
|
||||
|
||||
ret = func(hdc, GETVFRAMELEN, 0, 0, sizeof(u_int32_t),
|
||||
reinterpret_cast <char *>(&val));
|
||||
reinterpret_cast <char *>(&val));
|
||||
|
||||
if (ret == 0)
|
||||
DPRINTF((TEXT("ExtEscape(GETVFRAMELEN) not implemented.\n")));
|
||||
@ -156,13 +155,13 @@ Architecture::systemInfo(void)
|
||||
BOOL(*Architecture::_load_LockPages(void))(LPVOID, DWORD, PDWORD, int)
|
||||
{
|
||||
return reinterpret_cast <BOOL(*)(LPVOID, DWORD, PDWORD, int)>
|
||||
(_load_func(TEXT("LockPages")));
|
||||
(_load_func(TEXT("LockPages")));
|
||||
}
|
||||
|
||||
BOOL(*Architecture::_load_UnlockPages(void))(LPVOID, DWORD)
|
||||
{
|
||||
return reinterpret_cast <BOOL(*)(LPVOID, DWORD)>
|
||||
(_load_func(TEXT("UnlockPages")));
|
||||
(_load_func(TEXT("UnlockPages")));
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: arm_arch.cpp,v 1.2 2001/03/23 08:48:12 toshii Exp $ */
|
||||
/* $NetBSD: arm_arch.cpp,v 1.3 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -99,7 +99,7 @@ ARMArchitecture::setupLoader()
|
||||
// chcek 2nd bootloader size.
|
||||
if (sz > _mem->getPageSize()) {
|
||||
DPRINTF((TEXT("2nd bootloader size(%dbyte) is larger than page size(%d).\n"),
|
||||
sz, _mem->getPageSize()));
|
||||
sz, _mem->getPageSize()));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -110,10 +110,10 @@ ARMArchitecture::setupLoader()
|
||||
return FALSE;
|
||||
}
|
||||
DPRINTF((TEXT("2nd bootloader vaddr=0x%08x paddr=0x%08x\n"),
|
||||
(unsigned)v,(unsigned)_loader_addr));
|
||||
(unsigned)v,(unsigned)_loader_addr));
|
||||
|
||||
memcpy(reinterpret_cast <LPVOID>(v),
|
||||
reinterpret_cast <LPVOID>(BOOT_FUNC_START), sz);
|
||||
reinterpret_cast <LPVOID>(BOOT_FUNC_START), sz);
|
||||
DPRINTF((TEXT("2nd bootloader copy done.\n")));
|
||||
|
||||
return TRUE;
|
||||
@ -145,15 +145,15 @@ ARMArchitecture::testFramebuffer()
|
||||
paddr_t fbaddr_p = _mem->readPhysical4(0xb0100010); // 0xc0002e00
|
||||
// map frame buffer
|
||||
vaddr_t fbaddr_v = _mem->mapPhysicalPage(fbaddr_p, 0x50000,
|
||||
PAGE_READWRITE);
|
||||
PAGE_READWRITE);
|
||||
|
||||
// test frame buffer
|
||||
// test frame buffer
|
||||
int j, k;
|
||||
DI();
|
||||
for (j = 0; j < 480; j++)
|
||||
for (k = 0; k < 640; k++)
|
||||
VOLATILE_REF8(fbaddr_v + 0x200 + j * 640 + k)
|
||||
= j * k & 0xff;
|
||||
= j * k & 0xff;
|
||||
for (j = 120; j < 360; j++)
|
||||
for (k = 120; k < 520; k++)
|
||||
VOLATILE_REF8(fbaddr_v + 0x200 + j * 640 + k) = 0x3;
|
||||
@ -174,7 +174,7 @@ __BEGIN_MACRO \
|
||||
UTDR_PUTCHAR(c); \
|
||||
__END_MACRO
|
||||
vaddr_t uart =
|
||||
_mem->mapPhysicalPage(0x80050000, 0x100, PAGE_READWRITE);
|
||||
_mem->mapPhysicalPage(0x80050000, 0x100, PAGE_READWRITE);
|
||||
_('H');_('e');_('l');_('l');_('o');_(' ');
|
||||
_('W');_('o');_('r');_('l');_('d');_('\r');_('\n');
|
||||
_mem->unmapPhysicalPage(uart);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: arm_boot.cpp,v 1.3 2001/04/24 19:27:59 uch Exp $ */
|
||||
/* $NetBSD: arm_boot.cpp,v 1.4 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -111,7 +111,7 @@ ARMBoot::create()
|
||||
return FALSE;
|
||||
case MEMORY_MANAGER_LOCKPAGES:
|
||||
_mem = new MemoryManager_LockPages(lock_pages, unlock_pages,
|
||||
_cons, 4096);
|
||||
_cons, 4096);
|
||||
break;
|
||||
}
|
||||
_mem->setDebug() = args.memorymanagerDebug;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: arm_console.h,v 1.2 2001/04/24 19:28:00 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: arm_console.h,v 1.3 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -69,7 +69,8 @@ private:
|
||||
|
||||
void __putc(const char s) {
|
||||
__tx_busy(); // wait until previous transmit done.
|
||||
VOLATILE_REF8(_uart_transmit) = static_cast <u_int8_t>(0xff & s);
|
||||
VOLATILE_REF8(_uart_transmit) =
|
||||
static_cast <u_int8_t>(0xff & s);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: arm_mmu.cpp,v 1.1 2001/02/09 18:34:55 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: arm_mmu.cpp,v 1.2 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
#include <console.h>
|
||||
|
||||
MemoryManager_ArmMMU::MemoryManager_ArmMMU(Console *&cons,
|
||||
size_t pagesize)
|
||||
size_t pagesize)
|
||||
: MemoryManager(cons, pagesize)
|
||||
{
|
||||
DPRINTF((TEXT("Use ARM software MMU.\n")));
|
||||
@ -69,7 +69,7 @@ MemoryManager_ArmMMU::init(void)
|
||||
reg = GetCop15Reg2();
|
||||
_table_base = reg & ARM_MMU_TABLEBASE_MASK;
|
||||
DPRINTF((TEXT("page directory address=0x%08x->0x%08x(0x%08x)\n"),
|
||||
_table_base, readPhysical4(_table_base), reg));
|
||||
_table_base, readPhysical4(_table_base), reg));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -91,7 +91,7 @@ MemoryManager_ArmMMU::searchPage(vaddr_t vaddr)
|
||||
daddr = _table_base | ARM_MMU_TABLEINDEX(vaddr);
|
||||
desc1 = readPhysical4(daddr);
|
||||
DPRINTF((TEXT("1st level descriptor 0x%08x(addr 0x%08x)\n"),
|
||||
desc1, daddr));
|
||||
desc1, daddr));
|
||||
|
||||
switch(ARM_MMU_LEVEL1DESC_TRANSLATE_TYPE(desc1)) {
|
||||
default:
|
||||
@ -99,16 +99,16 @@ MemoryManager_ArmMMU::searchPage(vaddr_t vaddr)
|
||||
break;
|
||||
case ARM_MMU_LEVEL1DESC_TRANSLATE_SECTION:
|
||||
paddr = ARM_MMU_SECTION_BASE(desc1) |
|
||||
ARM_MMU_VADDR_SECTION_INDEX(vaddr);
|
||||
ARM_MMU_VADDR_SECTION_INDEX(vaddr);
|
||||
DPRINTF((TEXT("section Physical Address 0x%08x\n"), paddr));
|
||||
break;
|
||||
case ARM_MMU_LEVEL1DESC_TRANSLATE_PAGE:
|
||||
DPRINTF((TEXT("-> Level2 page descriptor.\n")));
|
||||
daddr = ARM_MMU_PTE_BASE(desc1) |
|
||||
ARM_MMU_VADDR_PTE_INDEX(vaddr);
|
||||
ARM_MMU_VADDR_PTE_INDEX(vaddr);
|
||||
desc2 = readPhysical4(daddr);
|
||||
DPRINTF((TEXT("2nd level descriptor 0x%08x(addr 0x%08x)\n"),
|
||||
desc2, daddr));
|
||||
desc2, daddr));
|
||||
switch(desc2 & 0x3) {
|
||||
default:
|
||||
DPRINTF((TEXT("2nd level descriptor fault.\n")));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: console.cpp,v 1.4 2001/04/24 19:27:59 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: console.cpp,v 1.5 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -87,7 +87,7 @@ BOOL
|
||||
SerialConsole::setupMultibyteBuffer()
|
||||
{
|
||||
size_t len = WideCharToMultiByte(CP_ACP, 0, _bufw, wcslen(_bufw),
|
||||
0, 0, 0, 0);
|
||||
0, 0, 0, 0);
|
||||
if (len + 1 > CONSOLE_BUFSIZE)
|
||||
return FALSE;
|
||||
if (!WideCharToMultiByte(CP_ACP, 0, _bufw, len, _bufm, len, 0, 0))
|
||||
@ -114,9 +114,9 @@ SerialConsole::openCOM1()
|
||||
int speed = HPC_PREFERENCE.serial_speed;
|
||||
|
||||
if (_handle == INVALID_HANDLE_VALUE) {
|
||||
_handle = CreateFile(TEXT("COM1:"),
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
_handle = CreateFile(TEXT("COM1:"),
|
||||
GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
|
||||
NULL);
|
||||
if (_handle == INVALID_HANDLE_VALUE) {
|
||||
Console::print(TEXT("couldn't open COM1\n"));
|
||||
return FALSE;
|
||||
@ -131,13 +131,12 @@ SerialConsole::openCOM1()
|
||||
dcb.BaudRate = speed;
|
||||
if (!SetCommState(_handle, &dcb)) {
|
||||
Console::print(TEXT("couldn't set baud rate to %s.\n"),
|
||||
speed);
|
||||
speed);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
Console::print(TEXT("BaudRate %d, ByteSize %#x, Parity %#x, StopBits %#x\n"),
|
||||
dcb.BaudRate, dcb.ByteSize, dcb.Parity,
|
||||
dcb.StopBits);
|
||||
dcb.BaudRate, dcb.ByteSize, dcb.Parity, dcb.StopBits);
|
||||
const char msg[] = "--------HPCBOOT--------\r\n";
|
||||
unsigned long wrote;
|
||||
WriteFile(_handle, msg, sizeof msg, &wrote, 0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: file.cpp,v 1.1 2001/02/09 18:34:36 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: file.cpp,v 1.2 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -73,7 +73,7 @@ File::_to_ascii(char *m, const TCHAR *w, size_t mlen)
|
||||
size_t len = WideCharToMultiByte(CP_ACP, 0, w, wcslen(w), 0, 0, 0, 0);
|
||||
if (len + 1 > mlen) {
|
||||
DPRINTF((TEXT("buffer insufficeint. %d > %d\n"),
|
||||
len + 1, mlen));
|
||||
len + 1, mlen));
|
||||
return FALSE;
|
||||
}
|
||||
int ret = WideCharToMultiByte(CP_ACP, 0, w, len, m, len, 0, 0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: file_fat.cpp,v 1.1 2001/02/09 18:34:37 uch Exp $ */
|
||||
/* $NetBSD: file_fat.cpp,v 1.2 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -68,10 +68,10 @@ FatFile::open(const TCHAR *name, u_int32_t flags)
|
||||
wcscat(_filename, name);
|
||||
// open it.
|
||||
_handle = CreateFile(_filename, GENERIC_READ | GENERIC_WRITE,
|
||||
0, 0, flags, 0, 0);
|
||||
0, 0, flags, 0, 0);
|
||||
if (_handle == INVALID_HANDLE_VALUE) {
|
||||
DPRINTF((TEXT("can't open \"%s\". cause = %d\n"),
|
||||
name, GetLastError()));
|
||||
name, GetLastError()));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: file_http.cpp,v 1.4 2001/04/30 13:43:31 uch Exp $ */
|
||||
/* $NetBSD: file_http.cpp,v 1.5 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -54,17 +54,17 @@ HttpFile::HttpFile(Console *&cons)
|
||||
_req_host(" HTTP/1.0\r\nHOST: "),
|
||||
_req_ua("\r\nUser-Agent: HPCBOOT/ZERO(1st impact; Windows CE; "
|
||||
#if defined MIPS
|
||||
"MIPS"
|
||||
"MIPS"
|
||||
#elif defined ARM
|
||||
"ARM"
|
||||
"ARM"
|
||||
#elif defined SH3
|
||||
"SH3"
|
||||
"SH3"
|
||||
#elif defined SH4
|
||||
"SH4"
|
||||
"SH4"
|
||||
#else
|
||||
"Unknown"
|
||||
"Unknown"
|
||||
#endif
|
||||
")\r\n\r\n")
|
||||
")\r\n\r\n")
|
||||
{
|
||||
_server_name[0] = '\0';
|
||||
_debug = TRUE;
|
||||
@ -135,7 +135,7 @@ HttpFile::setRoot(TCHAR *server)
|
||||
h = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (h == INVALID_SOCKET) {
|
||||
DPRINTF((TEXT("can't open socket. cause=%d\n"),
|
||||
WSAGetLastError()));
|
||||
WSAGetLastError()));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -153,18 +153,18 @@ HttpFile::setRoot(TCHAR *server)
|
||||
u_int8_t *b = &_sockaddr.sin_addr.S_un.S_un_b.s_b1;
|
||||
DPRINTF((TEXT("%d.%d.%d.%d "), b[0], b[1], b[2], b[3]));
|
||||
if (connect(h,(const struct sockaddr *)&_sockaddr,
|
||||
sizeof(struct sockaddr_in)) == 0)
|
||||
sizeof(struct sockaddr_in)) == 0)
|
||||
goto connected;
|
||||
} else {
|
||||
for (u_int8_t **addr_list =(u_int8_t **)entry->h_addr_list;
|
||||
*addr_list; addr_list++) {
|
||||
*addr_list; addr_list++) {
|
||||
u_int8_t *b = &_sockaddr.sin_addr.S_un.S_un_b.s_b1;
|
||||
for (int i = 0; i < 4; i++)
|
||||
b[i] = addr_list[0][i];
|
||||
|
||||
DPRINTF((TEXT("%d.%d.%d.%d "), b[0], b[1], b[2],b[3]));
|
||||
if (connect(h,(const struct sockaddr *)&_sockaddr,
|
||||
sizeof(struct sockaddr_in)) == 0)
|
||||
sizeof(struct sockaddr_in)) == 0)
|
||||
goto connected;
|
||||
}
|
||||
}
|
||||
@ -286,7 +286,7 @@ HttpFile::_parse_header(size_t &header_size)
|
||||
int cnt, ret;
|
||||
|
||||
for (cnt = 0;
|
||||
ret = _recv_buffer(h, __buf, TMP_BUFFER_SIZE); cnt += ret) {
|
||||
ret = _recv_buffer(h, __buf, TMP_BUFFER_SIZE); cnt += ret) {
|
||||
char sep[] = " :\r\n";
|
||||
char *token = strtok(__buf, sep);
|
||||
while (token) {
|
||||
@ -313,7 +313,7 @@ HttpFile::_recv_buffer(SOCKET h, char *buf, size_t size)
|
||||
cnt = recv(h, buf + total, size - total, 0);
|
||||
total += cnt;
|
||||
DPRINTFN(2,(TEXT("size %d readed %d byte(+%d)\n"),
|
||||
size, total, cnt));
|
||||
size, total, cnt));
|
||||
} while (total < size && cnt > 0);
|
||||
|
||||
|
||||
@ -334,9 +334,9 @@ static int
|
||||
__stricmp(const char *s1, const char *s2)
|
||||
{
|
||||
const unsigned char *us1 =
|
||||
reinterpret_cast <const unsigned char *>(s1);
|
||||
reinterpret_cast <const unsigned char *>(s1);
|
||||
const unsigned char *us2 =
|
||||
reinterpret_cast <const unsigned char *>(s2);
|
||||
reinterpret_cast <const unsigned char *>(s2);
|
||||
|
||||
while (tolower(*us1) == tolower(*us2++))
|
||||
if (*us1++ == '\0')
|
||||
@ -350,8 +350,8 @@ Socket::Socket(struct sockaddr_in &sock)
|
||||
_socket = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (_socket != INVALID_SOCKET)
|
||||
connect(_socket,
|
||||
reinterpret_cast <const struct sockaddr *>(&_sockaddr),
|
||||
sizeof(struct sockaddr_in));
|
||||
reinterpret_cast <const struct sockaddr *>(&_sockaddr),
|
||||
sizeof(struct sockaddr_in));
|
||||
}
|
||||
|
||||
Socket::~Socket(void)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: file_manager.cpp,v 1.1 2001/02/09 18:34:39 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: file_manager.cpp,v 1.2 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright(c) 1996, 2001 The NetBSD Foundation, Inc.
|
||||
@ -83,7 +83,7 @@ FileManager::open(const TCHAR *name, u_int32_t flags)
|
||||
_check_header(); // skip the .gz header
|
||||
|
||||
return TRUE;
|
||||
errout:
|
||||
errout:
|
||||
_file->close();
|
||||
return FALSE;
|
||||
}
|
||||
@ -128,7 +128,7 @@ FileManager::_read(void *buf, size_t len)
|
||||
}
|
||||
if (_stream->avail_out > 0) {
|
||||
got = _file->read(_stream->next_out,
|
||||
_stream->avail_out);
|
||||
_stream->avail_out);
|
||||
if (got == -1) {
|
||||
return(got);
|
||||
}
|
||||
@ -151,7 +151,7 @@ FileManager::_read(void *buf, size_t len)
|
||||
if (_z_err == Z_STREAM_END) {
|
||||
/* Check CRC and original size */
|
||||
_crc = crc32(_crc, start,(unsigned int)
|
||||
(_stream->next_out - start));
|
||||
(_stream->next_out - start));
|
||||
start = _stream->next_out;
|
||||
|
||||
if (_get_long() != _crc ||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hpcboot.cpp,v 1.3 2001/04/24 19:27:59 uch Exp $ */
|
||||
/* $NetBSD: hpcboot.cpp,v 1.4 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
int WINAPI
|
||||
WinMain(HINSTANCE instance, HINSTANCE prev_instance,
|
||||
LPTSTR cmd_line, int window_show)
|
||||
LPTSTR cmd_line, int window_show)
|
||||
{
|
||||
HpcMenuInterface::Instance(); // Menu System
|
||||
HpcBootApp *app = 0; // Application body.
|
||||
@ -128,7 +128,7 @@ hpcboot(void *arg)
|
||||
{
|
||||
if (!f._file->open(f.args.mfsName)) {
|
||||
error_message =
|
||||
TEXT("couldn't open file system image.\n");
|
||||
TEXT("couldn't open file system image.\n");
|
||||
goto failed;
|
||||
}
|
||||
sz = f._file->size();
|
||||
@ -170,7 +170,7 @@ hpcboot(void *arg)
|
||||
menu.progress();
|
||||
if (!f._loader->load()) {
|
||||
error_message =
|
||||
TEXT("couldn't load kernel image to memory.\n");
|
||||
TEXT("couldn't load kernel image to memory.\n");
|
||||
goto failed;
|
||||
}
|
||||
menu.progress();
|
||||
@ -194,7 +194,7 @@ hpcboot(void *arg)
|
||||
// jump to kernel entry.
|
||||
if (HPC_PREFERENCE.pause_before_boot) {
|
||||
if (MessageBox(menu._root->_window, TEXT("Push OK to boot."),
|
||||
TEXT("Last chance..."), MB_YESNO) != IDYES)
|
||||
TEXT("Last chance..."), MB_YESNO) != IDYES)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ hpcboot(void *arg)
|
||||
error_message = TEXT("can't jump to kernel.\n");
|
||||
f._file->close();
|
||||
MessageBox(menu._root->_window, error_message,
|
||||
TEXT("BOOT FAILED"), 0);
|
||||
TEXT("BOOT FAILED"), 0);
|
||||
}
|
||||
|
||||
//
|
||||
@ -221,7 +221,7 @@ HpcBootApp::run(void)
|
||||
// cancel auto-boot.
|
||||
if (HPC_PREFERENCE.auto_boot > 0 && _root &&
|
||||
(msg.message == WM_KEYDOWN ||
|
||||
msg.message == WM_LBUTTONDOWN)) {
|
||||
msg.message == WM_LBUTTONDOWN)) {
|
||||
_root->disableTimer();
|
||||
}
|
||||
if (!_root->isDialogMessage(msg)) {
|
||||
@ -240,7 +240,7 @@ HpcBootApp::registerClass(WNDPROC proc)
|
||||
|
||||
memset(&wc, 0, sizeof(WNDCLASS));
|
||||
wc_name = reinterpret_cast <TCHAR *>
|
||||
(LoadString(_instance, IDS_HPCMENU, 0, 0));
|
||||
(LoadString(_instance, IDS_HPCMENU, 0, 0));
|
||||
wc.lpfnWndProc = proc;
|
||||
wc.hInstance = _instance;
|
||||
wc.hIcon = LoadIcon(_instance, MAKEINTRESOURCE(IDI_ICON));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: hpcmenu.cpp,v 1.6 2001/04/24 19:27:59 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: hpcmenu.cpp,v 1.7 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -102,7 +102,7 @@ HpcMenuInterface::dir(int i)
|
||||
}
|
||||
|
||||
TCHAR *s = reinterpret_cast <TCHAR *>
|
||||
(LoadString(_root->_app._instance, res, 0, 0));
|
||||
(LoadString(_root->_app._instance, res, 0, 0));
|
||||
|
||||
return s;
|
||||
}
|
||||
@ -153,7 +153,7 @@ HpcMenuInterface::load()
|
||||
TCHAR filename[MAX_PATH];
|
||||
wsprintf(filename, TEXT("\\%s\\hpcboot.cnf"), path);
|
||||
HANDLE file = CreateFile(filename, GENERIC_READ, 0, 0, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, 0);
|
||||
FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if (file == INVALID_HANDLE_VALUE)
|
||||
return FALSE;
|
||||
|
||||
@ -184,8 +184,7 @@ HpcMenuInterface::save()
|
||||
TCHAR filename[MAX_PATH];
|
||||
wsprintf(filename, TEXT("\\%s\\hpcboot.cnf"), path);
|
||||
HANDLE file = CreateFile(filename, GENERIC_WRITE, 0, 0,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
|
||||
0);
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
DWORD cnt;
|
||||
WriteFile(file, &_pref, _pref._size, &cnt, 0);
|
||||
CloseHandle(file);
|
||||
@ -202,7 +201,7 @@ HpcMenuInterface::setup_kernel_args(vaddr_t v, paddr_t p)
|
||||
int argc = 0;
|
||||
kaddr_t *argv = reinterpret_cast <kaddr_t *>(v);
|
||||
char *loc = reinterpret_cast <char *>
|
||||
(v + sizeof(char **) * MAX_KERNEL_ARGS);
|
||||
(v + sizeof(char **) * MAX_KERNEL_ARGS);
|
||||
paddr_t locp = p + sizeof(char **) * MAX_KERNEL_ARGS;
|
||||
size_t len;
|
||||
TCHAR *w;
|
||||
@ -307,9 +306,9 @@ HpcMenuInterface::boot()
|
||||
for (; tab->cpu; tab++) {
|
||||
if (tab->cpu == cpu && tab->machine == machine) {
|
||||
MessageBox(_root->_window,
|
||||
tab->cause ? tab->cause :
|
||||
L"not supported yet.",
|
||||
TEXT("BOOT FAILED"), 0);
|
||||
tab->cause ? tab->cause :
|
||||
L"not supported yet.",
|
||||
TEXT("BOOT FAILED"), 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: hpcmenu.h,v 1.5 2001/04/24 19:27:59 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: hpcmenu.h,v 1.6 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -192,11 +192,11 @@ public:
|
||||
// platform
|
||||
TCHAR *platform_get(int n) {
|
||||
return reinterpret_cast <TCHAR *>
|
||||
(_platform(n, _PLATFORM_OP_GET));
|
||||
(_platform(n, _PLATFORM_OP_GET));
|
||||
}
|
||||
int platform_default(void) {
|
||||
return reinterpret_cast <int>
|
||||
(_platform(0, _PLATFORM_OP_DEFAULT));
|
||||
(_platform(0, _PLATFORM_OP_DEFAULT));
|
||||
}
|
||||
void platform_set(int n) { _platform(n, _PLATFORM_OP_SET); }
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: load.cpp,v 1.3 2001/03/22 18:23:08 uch Exp $ */
|
||||
/* $NetBSD: load.cpp,v 1.4 2001/05/08 18:51:22 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -103,12 +103,12 @@ Loader::tagDump(int n)
|
||||
int i = 0;
|
||||
|
||||
DPRINTF((TEXT("page tag start physical address: 0x%08x\n"),
|
||||
_page_tag_start));
|
||||
_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));
|
||||
i, p->next, p->src, p->dst, p->sz));
|
||||
else if (i == n)
|
||||
DPRINTF((TEXT("[...]\n")));
|
||||
op = p;
|
||||
@ -116,7 +116,7 @@ Loader::tagDump(int n)
|
||||
} 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));
|
||||
i - 1, op->next, op->src, op->dst, op->sz));
|
||||
#endif // PAGE_LINK_DUMP
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ Loader::_load_segment_end(void)
|
||||
{
|
||||
_opvec_prev->next = ~0; // terminate
|
||||
DPRINTF((TEXT("load link %d zero clear link %d.\n"),
|
||||
_nload_link, _n0clr_link));
|
||||
_nload_link, _n0clr_link));
|
||||
}
|
||||
|
||||
void
|
||||
@ -161,7 +161,7 @@ Loader::_load_segment(vaddr_t kv, vsize_t memsz, off_t fileofs, size_t filesz)
|
||||
vaddr_t kv_start = kv;
|
||||
|
||||
DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x ofs=0x%08x+0x%x\n"),
|
||||
kv, memsz, kv + memsz, fileofs, filesz));
|
||||
kv, memsz, kv + memsz, fileofs, filesz));
|
||||
_kernend = kv + memsz;
|
||||
|
||||
if (filesz) {
|
||||
@ -169,7 +169,7 @@ Loader::_load_segment(vaddr_t kv, vsize_t memsz, off_t fileofs, size_t filesz)
|
||||
for (j = 0; j < n; j++) {
|
||||
_opvec_prev = _pvec_prev;
|
||||
_pvec_prev = _load_page(kv, fileofs,
|
||||
_tpsz, _pvec_prev);
|
||||
_tpsz, _pvec_prev);
|
||||
kv += _tpsz;
|
||||
fileofs += _tpsz;
|
||||
++_nload_link;
|
||||
@ -193,8 +193,8 @@ Loader::_load_segment(vaddr_t kv, vsize_t memsz, off_t fileofs, size_t filesz)
|
||||
_pvec_prev->next = ptokv(_pvec_clr_paddr);
|
||||
#endif
|
||||
DPRINTF((TEXT("[zero clear] ->0x%08x+0x%08x=0x%08x\n"),
|
||||
_pvec_prev->dst, _pvec_prev->sz,
|
||||
_pvec_prev->dst + _pvec_prev->sz));
|
||||
_pvec_prev->dst, _pvec_prev->sz,
|
||||
_pvec_prev->dst + _pvec_prev->sz));
|
||||
_opvec_prev = _pvec_prev;
|
||||
_pvec_prev = _pvec_clr++;
|
||||
_pvec_clr_paddr += sizeof(struct PageTag);
|
||||
@ -210,7 +210,7 @@ Loader::_load_memory(vaddr_t kv, vsize_t memsz, void *data)
|
||||
paddr_t p, pvec_paddr;
|
||||
|
||||
DPRINTF((TEXT("\t->load 0x%08x+0x%08x=0x%08x\n"),
|
||||
kv, memsz, kv + memsz));
|
||||
kv, memsz, kv + memsz));
|
||||
if (memsz > _tpsz) {
|
||||
/* XXX failure */
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: load_coff.cpp,v 1.1 2001/02/09 18:34:45 uch Exp $ */
|
||||
/* $NetBSD: load_coff.cpp,v 1.2 2001/05/08 18:51:23 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -72,7 +72,7 @@ CoffLoader::memorySize()
|
||||
size_t sz = _ah->a_tsize + _ah->a_dsize;
|
||||
|
||||
DPRINTF((TEXT("file size: text 0x%x + data 0x%x = 0x%x byte\n"),
|
||||
_ah->a_tsize, _ah->a_dsize, sz));
|
||||
_ah->a_tsize, _ah->a_dsize, sz));
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: load_elf.cpp,v 1.2 2001/03/21 14:06:25 toshii Exp $ */
|
||||
/* $NetBSD: load_elf.cpp,v 1.3 2001/05/08 18:51:23 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -106,7 +106,8 @@ ElfLoader::load()
|
||||
Elf_Phdr *ph;
|
||||
Elf_Shdr *sh, *shstr, *shsym;
|
||||
off_t stroff = 0, symoff = 0, off;
|
||||
vaddr_t kv;
|
||||
vaddr_t kv;
|
||||
|
||||
size_t shstrsize;
|
||||
char buf[1024];
|
||||
int i;
|
||||
@ -120,7 +121,7 @@ ElfLoader::load()
|
||||
kv = ph->p_vaddr;
|
||||
off_t fileofs = ph->p_offset;
|
||||
DPRINTF((TEXT("[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
|
||||
i, kv, filesz, memsz));
|
||||
i, kv, filesz, memsz));
|
||||
_load_segment(kv, memsz, fileofs, filesz);
|
||||
kv += memsz;
|
||||
}
|
||||
@ -194,7 +195,7 @@ ElfLoader::read_header(void)
|
||||
if (_eh.e_ident[EI_DATA] != ELFDATA2LSB ||
|
||||
_eh.e_ident[EI_CLASS] != ELFCLASS32) {
|
||||
DPRINTF((TEXT("invalid class/data(%d/%d)\n"),
|
||||
_eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
|
||||
_eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -203,14 +204,14 @@ ElfLoader::read_header(void)
|
||||
ELF32_MACHDEP_ID_CASES;
|
||||
default:
|
||||
DPRINTF((TEXT("not a native architecture. machine = %d\n"),
|
||||
_eh.e_machine));
|
||||
_eh.e_machine));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Check object type */
|
||||
if (_eh.e_type != ET_EXEC) {
|
||||
DPRINTF((TEXT("not a executable file. type = %d\n"),
|
||||
_eh.e_type));
|
||||
_eh.e_type));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: load_elf.h,v 1.2 2001/03/21 14:06:25 toshii Exp $ */
|
||||
/* -*-C++-*- $NetBSD: load_elf.h,v 1.3 2001/05/08 18:51:23 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -49,10 +49,10 @@ private:
|
||||
|
||||
BOOL is_elf_file(void) {
|
||||
return
|
||||
_eh.e_ident[EI_MAG0] == ELFMAG0 &&
|
||||
_eh.e_ident[EI_MAG1] == ELFMAG1 &&
|
||||
_eh.e_ident[EI_MAG2] == ELFMAG2 &&
|
||||
_eh.e_ident[EI_MAG3] == ELFMAG3;
|
||||
_eh.e_ident[EI_MAG0] == ELFMAG0 &&
|
||||
_eh.e_ident[EI_MAG1] == ELFMAG1 &&
|
||||
_eh.e_ident[EI_MAG2] == ELFMAG2 &&
|
||||
_eh.e_ident[EI_MAG3] == ELFMAG3;
|
||||
}
|
||||
BOOL read_header(void);
|
||||
struct PageTag *load_page(vaddr_t, off_t, size_t, struct PageTag *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: memory.cpp,v 1.2 2001/03/25 17:14:53 uch Exp $ */
|
||||
/* $NetBSD: memory.cpp,v 1.3 2001/05/08 18:51:23 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -52,7 +52,7 @@ MemoryManager::MemoryManager(Console *&cons, size_t pagesize)
|
||||
_page_per_region = WCE_REGION_SIZE / _page_size;
|
||||
_nbank = 0;
|
||||
DPRINTF((TEXT("Page size %dbyte %dpages/region\n"),
|
||||
_page_size , _page_per_region));
|
||||
_page_size , _page_per_region));
|
||||
_addr_table_idx = 0;
|
||||
_addr_table = 0;
|
||||
_memory = 0;
|
||||
@ -71,7 +71,7 @@ MemoryManager::loadBank(paddr_t paddr, psize_t psize)
|
||||
b->addr = paddr;
|
||||
b->size = psize;
|
||||
DPRINTF((TEXT("Bank#%d 0x%08x size 0x%08x\n"), _nbank - 1,
|
||||
b->addr, b->size));
|
||||
b->addr, b->size));
|
||||
}
|
||||
|
||||
BOOL
|
||||
@ -92,20 +92,20 @@ MemoryManager::reservePage(vsize_t size, BOOL page_commit)
|
||||
|
||||
size_t tabsz = sizeof(struct AddressTranslationTable) * npage;
|
||||
_addr_table = static_cast <struct AddressTranslationTable *>
|
||||
(malloc(tabsz));
|
||||
(malloc(tabsz));
|
||||
if (_addr_table == NULL) {
|
||||
DPRINTF((TEXT("can't allocate memory for translation table.\n")));
|
||||
return FALSE;
|
||||
}
|
||||
DPRINTF((TEXT("address translation table %d pages.(%d byte)\n"), npage,
|
||||
tabsz));
|
||||
tabsz));
|
||||
|
||||
if (page_commit)
|
||||
vbase = vaddr_t(VirtualAlloc(0, vsize, MEM_RESERVE,
|
||||
PAGE_NOACCESS));
|
||||
PAGE_NOACCESS));
|
||||
else
|
||||
vbase = vaddr_t(VirtualAlloc(0, vsize, MEM_COMMIT,
|
||||
PAGE_READWRITE | PAGE_NOCACHE));
|
||||
PAGE_READWRITE | PAGE_NOCACHE));
|
||||
|
||||
if (vbase == 0) {
|
||||
DPRINTF((TEXT("can't allocate memory\n")));
|
||||
@ -137,7 +137,7 @@ MemoryManager::reservePage(vsize_t size, BOOL page_commit)
|
||||
} else {
|
||||
#ifdef MEMORY_MAP_DEBUG
|
||||
DPRINTF((TEXT("page %d vaddr=0x%08x paddr=0x%08x\n"),
|
||||
_naddr_table, vaddr, paddr));
|
||||
_naddr_table, vaddr, paddr));
|
||||
#endif
|
||||
tab->vaddr = vaddr;
|
||||
tab->paddr = paddr;
|
||||
@ -156,7 +156,7 @@ MemoryManager::reservePage(vsize_t size, BOOL page_commit)
|
||||
}
|
||||
#endif
|
||||
DPRINTF((TEXT("allocated %d page. mapped %d page.\n"), npage,
|
||||
_naddr_table));
|
||||
_naddr_table));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -187,7 +187,7 @@ MemoryManager::getTaggedPage(vaddr_t &vaddr, paddr_t &paddr)
|
||||
return FALSE;
|
||||
}
|
||||
AddressTranslationTable *tab =
|
||||
&_addr_table[_addr_table_idx++];
|
||||
&_addr_table[_addr_table_idx++];
|
||||
vaddr = tab->vaddr;
|
||||
paddr = tab->paddr;
|
||||
|
||||
@ -196,7 +196,7 @@ MemoryManager::getTaggedPage(vaddr_t &vaddr, paddr_t &paddr)
|
||||
|
||||
BOOL
|
||||
MemoryManager::getTaggedPage(vaddr_t &v, paddr_t &p,
|
||||
struct PageTag **pvec, paddr_t &pvec_paddr)
|
||||
struct PageTag **pvec, paddr_t &pvec_paddr)
|
||||
{
|
||||
if (!getTaggedPage(v, p))
|
||||
return FALSE;
|
||||
@ -220,14 +220,14 @@ MemoryManager::mapPhysicalPage(paddr_t paddr, psize_t size, u_int32_t flags)
|
||||
LPVOID p = VirtualAlloc(0, psize, MEM_RESERVE, PAGE_NOACCESS);
|
||||
|
||||
int ok = VirtualCopy(p, LPVOID(pstart >> 8), psize,
|
||||
flags | PAGE_NOCACHE | PAGE_PHYSICAL);
|
||||
flags | PAGE_NOCACHE | PAGE_PHYSICAL);
|
||||
if (!ok) {
|
||||
DPRINTF((TEXT("can't map physical address 0x%08x\n"), paddr));
|
||||
return ~0;
|
||||
}
|
||||
#if 0
|
||||
DPRINTF((TEXT("start=0x%08x end=0x%08x size=0x%08x return=0x%08x\n"),
|
||||
pstart, pend, psize, vaddr_t(p) + vaddr_t(paddr - pstart)));
|
||||
pstart, pend, psize, vaddr_t(p) + vaddr_t(paddr - pstart)));
|
||||
|
||||
#endif
|
||||
|
||||
@ -256,8 +256,8 @@ MemoryManager::readPhysical4(paddr_t paddr)
|
||||
//
|
||||
MemoryManager_LockPages::MemoryManager_LockPages
|
||||
(BOOL(*lock_pages)(LPVOID, DWORD, PDWORD, int),
|
||||
BOOL(*unlock_pages)(LPVOID, DWORD),
|
||||
Console *&cons, size_t pagesize, int shift)
|
||||
BOOL(*unlock_pages)(LPVOID, DWORD),
|
||||
Console *&cons, size_t pagesize, int shift)
|
||||
: MemoryManager(cons, pagesize)
|
||||
{
|
||||
_lock_pages = lock_pages;
|
||||
@ -289,7 +289,7 @@ MemoryManager_LockPages::searchPage(vaddr_t vaddr)
|
||||
// Use VirtualCopy()
|
||||
//
|
||||
MemoryManager_VirtualCopy::MemoryManager_VirtualCopy(Console *&cons,
|
||||
size_t pagesize)
|
||||
size_t pagesize)
|
||||
: MemoryManager(cons, pagesize)
|
||||
{
|
||||
_search_guess = 0;
|
||||
@ -350,10 +350,9 @@ MemoryManager_VirtualCopy::searchBank(int banknum)
|
||||
|
||||
for (paddr = pstart; paddr < pend; paddr += BLOCK_SIZE) {
|
||||
if (!VirtualCopy(ref, LPVOID(paddr >> 8), BLOCK_SIZE,
|
||||
PAGE_READONLY | PAGE_NOCACHE |
|
||||
PAGE_PHYSICAL)) {
|
||||
PAGE_READONLY | PAGE_NOCACHE | PAGE_PHYSICAL)) {
|
||||
DPRINTF((TEXT("can't map physical addr 0x%08x(->0x%08x)\n"),
|
||||
ref, paddr));
|
||||
ref, paddr));
|
||||
goto release;
|
||||
}
|
||||
|
||||
@ -363,7 +362,7 @@ MemoryManager_VirtualCopy::searchBank(int banknum)
|
||||
// decommit reference region.
|
||||
if (!VirtualFree(ref, BLOCK_SIZE, MEM_DECOMMIT)) {
|
||||
DPRINTF((TEXT("can't decommit addr 0x%08x(->0x%08x)\n"),
|
||||
ref, paddr));
|
||||
ref, paddr));
|
||||
goto release;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: memory.h,v 1.2 2001/03/25 17:14:53 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: memory.h,v 1.3 2001/05/08 18:51:23 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -131,7 +131,7 @@ public:
|
||||
// get tagged page from low address of pool.
|
||||
BOOL getTaggedPage(vaddr_t &vaddr, paddr_t &paddr);
|
||||
BOOL getTaggedPage(vaddr_t &v, paddr_t &p, struct PageTag **pvec,
|
||||
paddr_t &pvec_paddr);
|
||||
paddr_t &pvec_paddr);
|
||||
};
|
||||
|
||||
//
|
||||
@ -145,8 +145,7 @@ private:
|
||||
|
||||
public:
|
||||
MemoryManager_LockPages(BOOL(*)(LPVOID, DWORD, PDWORD, int),
|
||||
BOOL(*)(LPVOID, DWORD),
|
||||
Console *&, size_t, int = 0);
|
||||
BOOL(*)(LPVOID, DWORD), Console *&, size_t, int = 0);
|
||||
virtual ~MemoryManager_LockPages(void);
|
||||
paddr_t searchPage(vaddr_t vaddr);
|
||||
};
|
||||
@ -177,14 +176,14 @@ private:
|
||||
}
|
||||
BOOL checkMagic(vaddr_t v) {
|
||||
volatile u_int32_t *marker =(u_int32_t *)v;
|
||||
return(marker[0] == _magic0) &&(marker[1] == _magic1);
|
||||
return (marker[0] == _magic0) && (marker[1] == _magic1);
|
||||
}
|
||||
void clearMagic(void) {
|
||||
_magic_addr[0] = MAGIC_CHECK_DONE;
|
||||
_magic_addr[1] = MAGIC_CHECK_DONE;
|
||||
}
|
||||
vaddr_t checkMagicRegion(vaddr_t start, vsize_t size,
|
||||
vsize_t step = 8) {
|
||||
vsize_t step = 8) {
|
||||
for (vaddr_t ref = start; ref < start + size; ref += step)
|
||||
if (checkMagic(ref))
|
||||
return ref - start;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: menu.cpp,v 1.1 2001/04/24 19:28:00 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: menu.cpp,v 1.2 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -84,10 +84,10 @@ void
|
||||
MainTabWindow::_insert_item(HWND w, TCHAR *name, int id)
|
||||
{
|
||||
int idx = SendDlgItemMessage(w, id, CB_ADDSTRING, 0,
|
||||
reinterpret_cast <LPARAM>(name));
|
||||
reinterpret_cast <LPARAM>(name));
|
||||
if (idx != CB_ERR)
|
||||
SendDlgItemMessage(w, IDC_MAIN_DIR, CB_SETITEMDATA,
|
||||
idx, _item_idx++);
|
||||
idx, _item_idx++);
|
||||
}
|
||||
|
||||
void
|
||||
@ -107,15 +107,15 @@ MainTabWindow::init(HWND w)
|
||||
for (i = 0; entry = menu.dir(i); i++)
|
||||
_insert_item(w, entry, IDC_MAIN_DIR);
|
||||
SendDlgItemMessage(w, IDC_MAIN_DIR, CB_SETCURSEL, menu.dir_default(),
|
||||
0);
|
||||
0);
|
||||
// platform
|
||||
for (i = 0; entry = menu.platform_get(i); i++)
|
||||
_insert_item(w, entry, IDC_MAIN_PLATFORM);
|
||||
SendDlgItemMessage(w, IDC_MAIN_PLATFORM, CB_SETCURSEL,
|
||||
menu.platform_default(), 0);
|
||||
menu.platform_default(), 0);
|
||||
// kernel file name.
|
||||
Edit_SetText(GetDlgItem(w, IDC_MAIN_KERNEL), pref.kernel_user ?
|
||||
pref.kernel_user_file : TEXT("netbsd.gz"));
|
||||
pref.kernel_user_file : TEXT("netbsd.gz"));
|
||||
|
||||
// root file system.
|
||||
int fs = pref.rootfs + IDC_MAIN_ROOT_;
|
||||
@ -187,7 +187,7 @@ MainTabWindow::command(int id, int msg)
|
||||
switch (id) {
|
||||
case IDC_MAIN_OPTION_H:
|
||||
EnableWindow(_combobox_serial_speed,
|
||||
_is_checked(IDC_MAIN_OPTION_H));
|
||||
_is_checked(IDC_MAIN_OPTION_H));
|
||||
break;
|
||||
case IDC_MAIN_ROOT_WD:
|
||||
/* FALLTHROUGH */
|
||||
@ -213,11 +213,8 @@ OptionTabWindow::init(HWND w)
|
||||
TabWindow::init(_window);
|
||||
_spin_edit = GetDlgItem(_window, IDC_OPT_AUTO_INPUT);
|
||||
_spin = CreateUpDownControl(WS_CHILD | WS_BORDER | WS_VISIBLE |
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT,
|
||||
80, 0, 50, 50, _window,
|
||||
IDC_OPT_AUTO_UPDOWN,
|
||||
_app._instance, _spin_edit,
|
||||
60, 1, 30);
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT, 80, 0, 50, 50, _window,
|
||||
IDC_OPT_AUTO_UPDOWN, _app._instance, _spin_edit, 60, 1, 30);
|
||||
BOOL onoff = pref.auto_boot ? TRUE : FALSE;
|
||||
EnableWindow(_spin_edit, onoff);
|
||||
EnableWindow(_spin, onoff);
|
||||
@ -342,7 +339,7 @@ ConsoleTabWindow::init(HWND w)
|
||||
TabWindow::init(w);
|
||||
_edit = GetDlgItem(w, IDC_CONS_EDIT);
|
||||
MoveWindow(_edit, 5, 60, _rect.right - _rect.left - 10,
|
||||
_rect.bottom - _rect.top - 60, TRUE);
|
||||
_rect.bottom - _rect.top - 60, TRUE);
|
||||
Edit_FmtLines(_edit, TRUE);
|
||||
|
||||
// log file.
|
||||
@ -415,7 +412,7 @@ ConsoleTabWindow::_open_log_file()
|
||||
Edit_GetText(_filename_edit, filename, MAX_PATH);
|
||||
wsprintf(filepath, TEXT("\\%s\\%s"), path, filename);
|
||||
_logfile = CreateFile(filepath, GENERIC_WRITE, 0, 0,
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if (_logfile == INVALID_HANDLE_VALUE)
|
||||
return FALSE;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: platform.cpp,v 1.1 2001/02/09 18:34:57 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: platform.cpp,v 1.2 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -47,7 +47,7 @@ HpcMenuInterface::_platform(int n, enum _platform_op op)
|
||||
struct platid_name *name;
|
||||
|
||||
for (i = cnt = 0, name = platid_name_table;
|
||||
i < platid_name_table_size; i++, name++) {
|
||||
i < platid_name_table_size; i++, name++) {
|
||||
platid_t *mask = name->mask;
|
||||
if (mask->dw.dw0 == PLATID_WILD || mask->dw.dw1 == PLATID_WILD)
|
||||
continue;
|
||||
@ -74,4 +74,3 @@ HpcMenuInterface::_platform(int n, enum _platform_op op)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: rootwindow.cpp,v 1.2 2001/03/02 18:26:38 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: rootwindow.cpp,v 1.3 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -80,12 +80,11 @@ RootWindow::create(LPCREATESTRUCT aux)
|
||||
// so aux is NULL
|
||||
HINSTANCE inst = _app._instance;
|
||||
TCHAR *wc_name = reinterpret_cast <TCHAR *>
|
||||
(LoadString(inst, IDS_HPCMENU, 0, 0));
|
||||
(LoadString(inst, IDS_HPCMENU, 0, 0));
|
||||
|
||||
_window = CreateWindow(wc_name, wc_name, WS_VISIBLE,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
0, 0, inst, this);
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
0, 0, inst, this);
|
||||
if (!_window)
|
||||
return FALSE;
|
||||
|
||||
@ -124,7 +123,7 @@ RootWindow::proc(HWND w, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
tc_item.mask = TCIF_PARAM;
|
||||
TabCtrl_GetItem(_base->_window, tab_id, &tc_item);
|
||||
TabWindow *tab = reinterpret_cast <TabWindow *>
|
||||
(tc_item.lParam);
|
||||
(tc_item.lParam);
|
||||
switch(notify->code) {
|
||||
case TCN_SELCHANGING:
|
||||
tab->hide();
|
||||
@ -145,10 +144,9 @@ RootWindow::proc(HWND w, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
// inquire current options.
|
||||
menu.get_options();
|
||||
if (menu._pref.safety_message) {
|
||||
if (MessageBox
|
||||
(_window,
|
||||
TEXT("Data in memory will be lost.\n Are you sure?"),
|
||||
TEXT("WARNING"), MB_YESNO) != IDYES)
|
||||
if (MessageBox(_window,
|
||||
TEXT("Data in memory will be lost.\n Are you sure?"),
|
||||
TEXT("WARNING"), MB_YESNO) != IDYES)
|
||||
break;
|
||||
}
|
||||
boot:
|
||||
@ -257,12 +255,12 @@ BootButton::create(LPCREATESTRUCT aux)
|
||||
int cy = _root._button_height;
|
||||
|
||||
_window = CreateWindow(TEXT("BUTTON"), TEXT("BOOT"),
|
||||
BS_PUSHBUTTON | BS_NOTIFY |
|
||||
WS_VISIBLE | WS_CHILD | WS_TABSTOP,
|
||||
_rect.left, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(IDC_BOOTBUTTON),
|
||||
aux->hInstance,
|
||||
NULL);
|
||||
BS_PUSHBUTTON | BS_NOTIFY |
|
||||
WS_VISIBLE | WS_CHILD | WS_TABSTOP,
|
||||
_rect.left, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(IDC_BOOTBUTTON),
|
||||
aux->hInstance,
|
||||
NULL);
|
||||
|
||||
return IsWindow(_window) ? TRUE : FALSE;
|
||||
}
|
||||
@ -278,12 +276,12 @@ CancelButton::create(LPCREATESTRUCT aux)
|
||||
int x = _rect.right - BOOT_BUTTON_WIDTH;
|
||||
|
||||
_window = CreateWindow(TEXT("BUTTON"), TEXT("CANCEL"),
|
||||
BS_PUSHBUTTON | BS_NOTIFY | WS_TABSTOP |
|
||||
WS_VISIBLE | WS_CHILD,
|
||||
x, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(IDC_CANCELBUTTON),
|
||||
aux->hInstance,
|
||||
NULL);
|
||||
BS_PUSHBUTTON | BS_NOTIFY | WS_TABSTOP |
|
||||
WS_VISIBLE | WS_CHILD,
|
||||
x, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(IDC_CANCELBUTTON),
|
||||
aux->hInstance,
|
||||
NULL);
|
||||
return IsWindow(_window) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
@ -294,14 +292,14 @@ BOOL
|
||||
ProgressBar::create(LPCREATESTRUCT aux)
|
||||
{
|
||||
int cx = _rect.right - _rect.left
|
||||
- TABCTRL_TAB_WIDTH - BOOT_BUTTON_WIDTH * 2;
|
||||
- TABCTRL_TAB_WIDTH - BOOT_BUTTON_WIDTH * 2;
|
||||
int cy = _root._button_height;
|
||||
int x = _rect.left + BOOT_BUTTON_WIDTH;
|
||||
_window = CreateWindow(PROGRESS_CLASS, TEXT(""),
|
||||
WS_VISIBLE | WS_CHILD,
|
||||
x, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(IDC_PROGRESSBAR),
|
||||
aux->hInstance, NULL);
|
||||
WS_VISIBLE | WS_CHILD,
|
||||
x, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(IDC_PROGRESSBAR),
|
||||
aux->hInstance, NULL);
|
||||
SendMessage(_window, PBM_SETRANGE, 0, MAKELPARAM(0, 12));
|
||||
|
||||
return IsWindow(_window) ? TRUE : FALSE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: tabwindow.cpp,v 1.1 2001/02/09 18:35:02 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: tabwindow.cpp,v 1.2 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -50,19 +50,19 @@ TabWindowBase::create(LPCREATESTRUCT aux)
|
||||
int cx = _rect.right - _rect.left;
|
||||
int cy = _rect.bottom - _rect.top;
|
||||
_window = CreateWindow(WC_TABCONTROL, L"",
|
||||
WS_CHILD | WS_VISIBLE | WS_TABSTOP |
|
||||
WS_CLIPSIBLINGS | TCS_MULTILINE | TCS_VERTICAL,
|
||||
_rect.left, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(_id), aux->hInstance,
|
||||
NULL); // this is system window class
|
||||
WS_CHILD | WS_VISIBLE | WS_TABSTOP |
|
||||
WS_CLIPSIBLINGS | TCS_MULTILINE | TCS_VERTICAL,
|
||||
_rect.left, _rect.top, cx, cy, _parent_window,
|
||||
reinterpret_cast <HMENU>(_id), aux->hInstance,
|
||||
NULL); // this is system window class
|
||||
|
||||
if (!IsWindow(_window))
|
||||
return FALSE;
|
||||
|
||||
// set tab image.
|
||||
HIMAGELIST img = ImageList_Create(TABCTRL_TAB_IMAGE_WIDTH,
|
||||
TABCTRL_TAB_IMAGE_HEIGHT,
|
||||
ILC_COLOR, 3, 0);
|
||||
TABCTRL_TAB_IMAGE_HEIGHT,
|
||||
ILC_COLOR, 3, 0);
|
||||
_load_bitmap(img, L"IDI_HPCMENU_MAIN");
|
||||
_load_bitmap(img, L"IDI_HPCMENU_OPTION");
|
||||
_load_bitmap(img, L"IDI_HPCMENU_CONSOLE");
|
||||
@ -88,9 +88,9 @@ BOOL
|
||||
TabWindow::create(LPCREATESTRUCT unused)
|
||||
{
|
||||
_window = CreateDialogParam
|
||||
(_app._instance, _name, _base._window,
|
||||
reinterpret_cast <DLGPROC>(Window::_dlg_proc),
|
||||
reinterpret_cast <LPARAM>(this));
|
||||
(_app._instance, _name, _base._window,
|
||||
reinterpret_cast <DLGPROC>(Window::_dlg_proc),
|
||||
reinterpret_cast <LPARAM>(this));
|
||||
|
||||
return _window ? TRUE : FALSE;
|
||||
}
|
||||
@ -130,12 +130,12 @@ BOOL
|
||||
TabWindow::_is_checked(int id)
|
||||
{
|
||||
return SendDlgItemMessage(_window, id, BM_GETCHECK, 0, 0)
|
||||
? TRUE : FALSE;
|
||||
? TRUE : FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
TabWindow::_set_check(int id, BOOL onoff)
|
||||
{
|
||||
SendDlgItemMessage(_window, id, BM_SETCHECK,
|
||||
onoff ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
onoff ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: tabwindow.h,v 1.1 2001/02/09 18:35:03 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: tabwindow.h,v 1.2 2001/05/08 18:51:24 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -51,7 +51,7 @@ private:
|
||||
|
||||
public:
|
||||
explicit TabWindowBase(HpcBootApp &app, HWND parent,
|
||||
RECT &rect, int id)
|
||||
RECT &rect, int id)
|
||||
: Window(app, parent) {
|
||||
_rect = rect;
|
||||
_id = id;
|
||||
@ -106,7 +106,7 @@ public:
|
||||
// adjust my dialog size to tab-control
|
||||
void adjust(void) {
|
||||
MoveWindow(_window, _rect.left, 0, _rect.right - _rect.left,
|
||||
_rect.bottom - _rect.top, TRUE);
|
||||
_rect.bottom - _rect.top, TRUE);
|
||||
}
|
||||
virtual void hide(void) {
|
||||
ShowWindow(_window, SW_HIDE);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: mips_arch.cpp,v 1.1 2001/02/09 18:35:05 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: mips_arch.cpp,v 1.2 2001/05/08 18:51:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -104,7 +104,7 @@ MIPSArchitecture::setupLoader()
|
||||
cacheFlush();
|
||||
r0 = VOLATILE_REF(v);
|
||||
DPRINTF((TEXT("kernel address access test: %S\n"),
|
||||
r0 == TEST_MAGIC ? "OK" : "NG"));
|
||||
r0 == TEST_MAGIC ? "OK" : "NG"));
|
||||
SetKMode(_kmode);
|
||||
#endif // DEBUG_KERNADDR_ACCESS
|
||||
|
||||
@ -113,7 +113,7 @@ MIPSArchitecture::setupLoader()
|
||||
return FALSE;
|
||||
}
|
||||
DPRINTF((TEXT("2nd bootloader vaddr=0x%08x paddr=0x%08x\n"),
|
||||
(unsigned)v,(unsigned)_loader_addr));
|
||||
(unsigned)v,(unsigned)_loader_addr));
|
||||
|
||||
memcpy(LPVOID(v), LPVOID(_boot_func), _mem->getPageSize());
|
||||
DPRINTF((TEXT("2nd bootloader copy done.\n")));
|
||||
@ -143,7 +143,7 @@ MIPSArchitecture::jump(paddr_t info, paddr_t pvec)
|
||||
return;
|
||||
}
|
||||
DPRINTF((TEXT("jump to 0x%08x(info=0x%08x, pvec=0x%08x\n"),
|
||||
_loader_addr, info, pvec));
|
||||
_loader_addr, info, pvec));
|
||||
|
||||
// writeback whole D-cache and invalidate whole I-cache.
|
||||
// 2nd boot-loader access data via kseg0 which were writed via kuseg,
|
||||
@ -151,8 +151,8 @@ MIPSArchitecture::jump(paddr_t info, paddr_t pvec)
|
||||
|
||||
// jump to 2nd-loader(run kseg0)
|
||||
__asm(".set noreorder;"
|
||||
"jr a3;"
|
||||
"move sp, a2;"
|
||||
".set reorder", info, pvec, sp, _loader_addr);
|
||||
"jr a3;"
|
||||
"move sp, a2;"
|
||||
".set reorder", info, pvec, sp, _loader_addr);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: mips_boot.cpp,v 1.2 2001/04/24 19:28:00 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: mips_boot.cpp,v 1.3 2001/05/08 18:51:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -141,7 +141,7 @@ MIPSBoot::create()
|
||||
return FALSE;
|
||||
case MEMORY_MANAGER_LOCKPAGES:
|
||||
_mem = new MemoryManager_LockPages(lock_pages, unlock_pages,
|
||||
_cons, pagesz, shift);
|
||||
_cons, pagesz, shift);
|
||||
break;
|
||||
case MEMORY_MANAGER_VIRTUALCOPY:
|
||||
_mem = new MemoryManager_VirtualCopy(_cons, pagesz);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: mips_tx39.cpp,v 1.1 2001/02/09 18:35:06 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: mips_tx39.cpp,v 1.2 2001/05/08 18:51:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -60,7 +60,7 @@ TX39XX::init()
|
||||
|
||||
// set D-RAM information
|
||||
_mem->loadBank(0x04000000, // D-RAM bank 0/1
|
||||
0x04000000);
|
||||
0x04000000);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: mips_vr41.cpp,v 1.1 2001/02/09 18:35:07 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: mips_vr41.cpp,v 1.2 2001/05/08 18:51:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -60,7 +60,7 @@ VR41XX::init()
|
||||
|
||||
// set D-RAM information
|
||||
_mem->loadBank(0x80000000, // VR-specific VirtualCopy trick.
|
||||
0x04000000); // 64MByte
|
||||
0x04000000); // 64MByte
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sh_arch.cpp,v 1.6 2001/04/24 19:28:01 uch Exp $ */
|
||||
/* $NetBSD: sh_arch.cpp,v 1.7 2001/05/08 18:51:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -91,7 +91,7 @@ SHArchitecture::setupLoader()
|
||||
return FALSE;
|
||||
}
|
||||
DPRINTF((TEXT("2nd bootloader vaddr=0x%08x paddr=0x%08x\n"),
|
||||
(unsigned)v,(unsigned)_loader_addr));
|
||||
(unsigned)v,(unsigned)_loader_addr));
|
||||
|
||||
memcpy(LPVOID(v), LPVOID(_boot_func), _mem->getPageSize());
|
||||
DPRINTF((TEXT("2nd bootloader copy done.\n")));
|
||||
@ -114,7 +114,7 @@ SHArchitecture::jump(paddr_t info, paddr_t pvec)
|
||||
pvec = ptokv(pvec);
|
||||
_loader_addr = ptokv(_loader_addr);
|
||||
DPRINTF((TEXT("BootArgs 0x%08x Stack 0x%08x\nBooting kernel...\n"),
|
||||
info, sp));
|
||||
info, sp));
|
||||
|
||||
// Change to privilege-mode.
|
||||
SetKMode(1);
|
||||
@ -127,8 +127,8 @@ SHArchitecture::jump(paddr_t info, paddr_t pvec)
|
||||
|
||||
// jump to 2nd loader.(run P1) at this time I still use MMU.
|
||||
__asm("mov r6, r15\n"
|
||||
"jmp @r7\n"
|
||||
"nop\n", info, pvec, sp, _loader_addr);
|
||||
"jmp @r7\n"
|
||||
"nop\n", info, pvec, sp, _loader_addr);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
@ -138,9 +138,9 @@ suspendIntr(void)
|
||||
{
|
||||
u_int32_t sr;
|
||||
__asm("stc sr, r0\n"
|
||||
"mov.l r0, @r4\n"
|
||||
"or r5, r0\n"
|
||||
"ldc r0, sr\n", &sr, 0x000000f0);
|
||||
"mov.l r0, @r4\n"
|
||||
"or r5, r0\n"
|
||||
"ldc r0, sr\n", &sr, 0x000000f0);
|
||||
return sr & 0x000000f0;
|
||||
}
|
||||
|
||||
@ -149,9 +149,9 @@ void
|
||||
resumeIntr(u_int32_t s)
|
||||
{
|
||||
__asm("stc sr, r0\n"
|
||||
"and r5, r0\n"
|
||||
"or r4, r0\n"
|
||||
"ldc r0, sr\n", s, 0xffffff0f);
|
||||
"and r5, r0\n"
|
||||
"or r4, r0\n"
|
||||
"ldc r0, sr\n", s, 0xffffff0f);
|
||||
}
|
||||
|
||||
void
|
||||
@ -181,9 +181,9 @@ SHArchitecture::systemInfo()
|
||||
DPRINTF((TEXT("Cache ")));
|
||||
if (reg & CCR_CE)
|
||||
DPRINTF((TEXT("Enabled. %s-mode, P0/U0/P3 Write-%s, P1 Write-%s\n"),
|
||||
reg & CCR_RA ? TEXT("RAM") : TEXT("normal"),
|
||||
reg & CCR_WT ? TEXT("Through") : TEXT("Back"),
|
||||
reg & CCR_CB ? TEXT("Back") : TEXT("Through")));
|
||||
reg & CCR_RA ? TEXT("RAM") : TEXT("normal"),
|
||||
reg & CCR_WT ? TEXT("Through") : TEXT("Back"),
|
||||
reg & CCR_CB ? TEXT("Back") : TEXT("Through")));
|
||||
else
|
||||
DPRINTF((TEXT("Disabled.\n")));
|
||||
|
||||
@ -192,16 +192,16 @@ SHArchitecture::systemInfo()
|
||||
DPRINTF((TEXT("MMU ")));
|
||||
if (reg & MMUCR_AT)
|
||||
DPRINTF((TEXT("Enabled. %s index-mode, %s virtual storage mode\n"),
|
||||
reg & MMUCR_IX
|
||||
? TEXT("ASID + VPN") : TEXT("VPN only"),
|
||||
reg & MMUCR_SV ? TEXT("single") : TEXT("multiple")));
|
||||
reg & MMUCR_IX
|
||||
? TEXT("ASID + VPN") : TEXT("VPN only"),
|
||||
reg & MMUCR_SV ? TEXT("single") : TEXT("multiple")));
|
||||
else
|
||||
DPRINTF((TEXT("Disabled.\n")));
|
||||
|
||||
// Status register
|
||||
reg = 0;
|
||||
__asm("stc sr, r0\n"
|
||||
"mov.l r0, @r4", ®);
|
||||
"mov.l r0, @r4", ®);
|
||||
DPRINTF((TEXT("SR 0x%08x\n"), reg));
|
||||
|
||||
// BSC
|
||||
@ -258,7 +258,7 @@ SHArchitecture::icu_priority(void)
|
||||
DPRINTF((TEXT("----interrupt priority----\n")));
|
||||
for (tab = ipr_table; tab->name; tab++) {
|
||||
DPRINTF((TEXT("%-10S %d\n"), tab->name,
|
||||
(reg_read_2(tab->reg) >> tab->shift) & ICU_IPR_MASK));
|
||||
(reg_read_2(tab->reg) >> tab->shift) & ICU_IPR_MASK));
|
||||
}
|
||||
DPRINTF((TEXT("--------------------------\n")));
|
||||
}
|
||||
@ -282,24 +282,24 @@ SHArchitecture::icu_control(void)
|
||||
// NMI
|
||||
r = reg_read_2(ICU_ICR0_REG16);
|
||||
DPRINTF((TEXT("NMI(%S %S-edge),"),
|
||||
r & ICU_ICR0_NMIL ? "High" : "Low",
|
||||
r & ICU_ICR0_NMIE ? "raising" : "falling"));
|
||||
r & ICU_ICR0_NMIL ? "High" : "Low",
|
||||
r & ICU_ICR0_NMIE ? "raising" : "falling"));
|
||||
r = reg_read_2(ICU_ICR1_REG16);
|
||||
DPRINTF((TEXT(" %S maskable,"), r & ICU_ICR1_MAI ? "" : "never"));
|
||||
DPRINTF((TEXT(" SR.BL %S\n"),
|
||||
r & ICU_ICR1_BLMSK ? "ignored" : "maskable"));
|
||||
r & ICU_ICR1_BLMSK ? "ignored" : "maskable"));
|
||||
// IRQ0-5
|
||||
DPRINTF((TEXT("IRQ[3:0]pin : %S mode\n"),
|
||||
r & ICU_ICR1_IRQLVL ? "IRL 15level" : "IRQ[0:3]"));
|
||||
r & ICU_ICR1_IRQLVL ? "IRL 15level" : "IRQ[0:3]"));
|
||||
if (r & ICU_ICR1_IRQLVL) {
|
||||
DPRINTF((TEXT("IRLS[0:3] %S\n"),
|
||||
r & ICU_ICR1_IRLSEN ? "enabled" : "disabled"));
|
||||
r & ICU_ICR1_IRLSEN ? "enabled" : "disabled"));
|
||||
}
|
||||
// sense select
|
||||
for (int i = 5; i >= 0; i--) {
|
||||
DPRINTF((TEXT("IRQ[%d] %S\n"), i,
|
||||
sense_select [
|
||||
(r >>(i * 2)) & ICU_SENSE_SELECT_MASK]));
|
||||
sense_select [
|
||||
(r >>(i * 2)) & ICU_SENSE_SELECT_MASK]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -343,14 +343,14 @@ SHArchitecture::scif_dump(int bps)
|
||||
r8 = SHREG_SCSMR2;
|
||||
n = 1 <<((r8 & SCSMR2_CKS) << 1);
|
||||
DPRINTF((TEXT("mode: %dbit %S-parity %d stop bit clock PCLOCK/%d\n"),
|
||||
r8 & SCSMR2_CHR ? 7 : 8,
|
||||
r8 & SCSMR2_PE ? r8 & SCSMR2_OE ? "odd" : "even" : "non",
|
||||
r8 & SCSMR2_STOP ? 2 : 1,
|
||||
n));
|
||||
r8 & SCSMR2_CHR ? 7 : 8,
|
||||
r8 & SCSMR2_PE ? r8 & SCSMR2_OE ? "odd" : "even" : "non",
|
||||
r8 & SCSMR2_STOP ? 2 : 1,
|
||||
n));
|
||||
/* bit rate */
|
||||
r8 = SHREG_SCBRR2;
|
||||
DPRINTF((TEXT("SCBRR=%d(%dbps) estimated PCLOCK %dHz\n"), r8, bps,
|
||||
32 * bps *(r8 + 1) * n));
|
||||
32 * bps *(r8 + 1) * n));
|
||||
|
||||
/* control */
|
||||
#define DBG_BIT_PRINT(r, m) _dbg_bit_print(r, SCSCR2_##m, #m)
|
||||
@ -445,13 +445,13 @@ SHArchitecture::tmu_dump()
|
||||
/* TOCR timer output control register */
|
||||
r8 = reg_read_1(SH3_TOCR_REG8);
|
||||
DPRINTF((TEXT("TCLK = %S\n"),
|
||||
r8 & TOCR_TCOE ? "RTC output" : "input"));
|
||||
r8 & TOCR_TCOE ? "RTC output" : "input"));
|
||||
/* TSTR */
|
||||
r8 = reg_read_1(SH3_TSTR_REG8);
|
||||
DPRINTF((TEXT("Timer start(#0:2) [%c][%c][%c]\n"),
|
||||
r8 & TSTR_STR0 ? 'x' : '_',
|
||||
r8 & TSTR_STR1 ? 'x' : '_',
|
||||
r8 & TSTR_STR2 ? 'x' : '_'));
|
||||
r8 & TSTR_STR0 ? 'x' : '_',
|
||||
r8 & TSTR_STR1 ? 'x' : '_',
|
||||
r8 & TSTR_STR2 ? 'x' : '_'));
|
||||
|
||||
#define CHANNEL_DUMP(a, x) \
|
||||
tmu_channel_dump(x, SH##a##_TCOR##x##_REG, \
|
||||
@ -466,7 +466,7 @@ SHArchitecture::tmu_dump()
|
||||
|
||||
void
|
||||
SHArchitecture::tmu_channel_dump(int unit, paddr_t tcor, paddr_t tcnt,
|
||||
paddr_t tcr)
|
||||
paddr_t tcr)
|
||||
{
|
||||
u_int32_t r32;
|
||||
u_int16_t r16;
|
||||
@ -820,19 +820,19 @@ SHArchitecture::hd64461_dump(platid_t &platform)
|
||||
}
|
||||
|
||||
#ifdef SH7709TEST
|
||||
u_int32_t sh7707_fb_dma_addr;
|
||||
u_int16_t val;
|
||||
int s;
|
||||
u_int32_t sh7707_fb_dma_addr;
|
||||
u_int16_t val;
|
||||
int s;
|
||||
|
||||
s = suspendIntr();
|
||||
VOLATILE_REF16(SH7707_LCDAR_REG16) = SH7707_LCDAR_LCDDMR0;
|
||||
val = VOLATILE_REF16(SH7707_LCDDMR_REG16);
|
||||
sh7707_fb_dma_addr = val;
|
||||
VOLATILE_REF16(SH7707_LCDAR_REG16) = SH7707_LCDAR_LCDDMR1;
|
||||
val = VOLATILE_REF16(SH7707_LCDDMR_REG16);
|
||||
sh7707_fb_dma_addr |= (val << 16);
|
||||
resumeIntr(s);
|
||||
s = suspendIntr();
|
||||
VOLATILE_REF16(SH7707_LCDAR_REG16) = SH7707_LCDAR_LCDDMR0;
|
||||
val = VOLATILE_REF16(SH7707_LCDDMR_REG16);
|
||||
sh7707_fb_dma_addr = val;
|
||||
VOLATILE_REF16(SH7707_LCDAR_REG16) = SH7707_LCDAR_LCDDMR1;
|
||||
val = VOLATILE_REF16(SH7707_LCDDMR_REG16);
|
||||
sh7707_fb_dma_addr |= (val << 16);
|
||||
resumeIntr(s);
|
||||
|
||||
DPRINTF((TEXT("SH7707 frame buffer dma address: 0x%08x\n"),
|
||||
sh7707_fb_dma_addr));
|
||||
DPRINTF((TEXT("SH7707 frame buffer dma address: 0x%08x\n"),
|
||||
sh7707_fb_dma_addr));
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sh_boot.cpp,v 1.2 2001/04/24 19:28:01 uch Exp $ */
|
||||
/* $NetBSD: sh_boot.cpp,v 1.3 2001/05/08 18:51:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -129,7 +129,7 @@ SHBoot::create()
|
||||
break;
|
||||
case MEMORY_MANAGER_LOCKPAGES:
|
||||
_mem = new MemoryManager_LockPages(lock_pages, unlock_pages,
|
||||
_cons, PAGE_SIZE);
|
||||
_cons, PAGE_SIZE);
|
||||
break;
|
||||
}
|
||||
_mem->setDebug() = args.memorymanagerDebug;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*-C++-*- $NetBSD: sh_console.cpp,v 1.5 2001/04/24 19:28:01 uch Exp $ */
|
||||
/* -*-C++-*- $NetBSD: sh_console.cpp,v 1.6 2001/05/08 18:51:25 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -131,5 +131,3 @@ SHConsole::HD64461COMPrint(const char *buf)
|
||||
{
|
||||
HD64461COM_PRINT(buf);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user