diff options
author | Andrew Schultz <alschult@umich.edu> | 2004-02-13 16:42:42 -0500 |
---|---|---|
committer | Andrew Schultz <alschult@umich.edu> | 2004-02-13 16:42:42 -0500 |
commit | 6391bfac543921e49469d74ea58de644d7a8f7cc (patch) | |
tree | 5eecd8fdf50590c9b8d8a622b90fff0c6ff2aff1 /arch | |
parent | 29eae76153c325e1b16785e65381075eaeaa7d3b (diff) | |
parent | 8232c9743df13416810316476500d0e13681677e (diff) | |
download | gem5-6391bfac543921e49469d74ea58de644d7a8f7cc.tar.xz |
Merge zizzer.eecs.umich.edu:/m5/Bitkeeper/m5
into zizzer.eecs.umich.edu:/z/alschult/linux
--HG--
extra : convert_revision : 2ea2bbd41f7e0c257b374d9cd0e37abaf6a7c170
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/alpha_linux_process.cc | 41 | ||||
-rw-r--r-- | arch/alpha/vtophys.cc | 29 | ||||
-rw-r--r-- | arch/alpha/vtophys.hh | 1 |
3 files changed, 56 insertions, 15 deletions
diff --git a/arch/alpha/alpha_linux_process.cc b/arch/alpha/alpha_linux_process.cc index ae197d1ac..b9eb42a21 100644 --- a/arch/alpha/alpha_linux_process.cc +++ b/arch/alpha/alpha_linux_process.cc @@ -106,6 +106,7 @@ class Linux { uint32_t st_uid; //!< owner's user ID uint32_t st_gid; //!< owner's group ID uint32_t st_rdev; //!< device number + int32_t _pad1; //!< for alignment int64_t st_size; //!< file size in bytes uint64_t st_atimeX; //!< time of last access uint64_t st_mtimeX; //!< time of last modification @@ -264,7 +265,7 @@ class Linux { // I don't think this exactly matches the HW FPCR *fpcr = 0; fpcr.copyOut(xc->mem); - return 1; + return 0; } default: @@ -273,7 +274,7 @@ class Linux { break; } - return 0; + return 1; } /// Target osf_setsysinfo() handler. @@ -292,7 +293,7 @@ class Linux { fpcr.copyIn(xc->mem); DPRINTFR(SyscallVerbose, "osf_setsysinfo(SSI_IEEE_FP_CONTROL): " " setting FPCR to 0x%x\n", *(uint64_t*)fpcr); - return 1; + return 0; } default: @@ -301,7 +302,7 @@ class Linux { break; } - return 0; + return 1; } /// Target fnctl() handler. @@ -810,6 +811,37 @@ SyscallDesc Linux::syscallDescs[] = { /* 391 */ SyscallDesc("removexattr", unimplementedFunc), /* 392 */ SyscallDesc("lremovexattr", unimplementedFunc), /* 393 */ SyscallDesc("fremovexattr", unimplementedFunc), + /* 394 */ SyscallDesc("futex", unimplementedFunc), + /* 395 */ SyscallDesc("sched_setaffinity", unimplementedFunc), + /* 396 */ SyscallDesc("sched_getaffinity", unimplementedFunc), + /* 397 */ SyscallDesc("tuxcall", unimplementedFunc), + /* 398 */ SyscallDesc("io_setup", unimplementedFunc), + /* 399 */ SyscallDesc("io_destroy", unimplementedFunc), + /* 400 */ SyscallDesc("io_getevents", unimplementedFunc), + /* 401 */ SyscallDesc("io_submit", unimplementedFunc), + /* 402 */ SyscallDesc("io_cancel", unimplementedFunc), + /* 403 */ SyscallDesc("unknown #403", unimplementedFunc), + /* 404 */ SyscallDesc("unknown #404", unimplementedFunc), + /* 405 */ SyscallDesc("exit_group", exitFunc), // exit all threads... + /* 406 */ SyscallDesc("lookup_dcookie", unimplementedFunc), + /* 407 */ SyscallDesc("sys_epoll_create", unimplementedFunc), + /* 408 */ SyscallDesc("sys_epoll_ctl", unimplementedFunc), + /* 409 */ SyscallDesc("sys_epoll_wait", unimplementedFunc), + /* 410 */ SyscallDesc("remap_file_pages", unimplementedFunc), + /* 411 */ SyscallDesc("set_tid_address", unimplementedFunc), + /* 412 */ SyscallDesc("restart_syscall", unimplementedFunc), + /* 413 */ SyscallDesc("fadvise64", unimplementedFunc), + /* 414 */ SyscallDesc("timer_create", unimplementedFunc), + /* 415 */ SyscallDesc("timer_settime", unimplementedFunc), + /* 416 */ SyscallDesc("timer_gettime", unimplementedFunc), + /* 417 */ SyscallDesc("timer_getoverrun", unimplementedFunc), + /* 418 */ SyscallDesc("timer_delete", unimplementedFunc), + /* 419 */ SyscallDesc("clock_settime", unimplementedFunc), + /* 420 */ SyscallDesc("clock_gettime", unimplementedFunc), + /* 421 */ SyscallDesc("clock_getres", unimplementedFunc), + /* 422 */ SyscallDesc("clock_nanosleep", unimplementedFunc), + /* 423 */ SyscallDesc("semtimedop", unimplementedFunc), + /* 424 */ SyscallDesc("tgkill", unimplementedFunc) }; const int Linux::Num_Syscall_Descs = @@ -838,4 +870,5 @@ AlphaLinuxProcess::AlphaLinuxProcess(const std::string &name, std::vector<std::string> &envp) : LiveProcess(name, objFile, stdin_fd, stdout_fd, stderr_fd, argv, envp) { + init_regs->intRegFile[0] = 0; } diff --git a/arch/alpha/vtophys.cc b/arch/alpha/vtophys.cc index a1afdb05b..5e14b06d3 100644 --- a/arch/alpha/vtophys.cc +++ b/arch/alpha/vtophys.cc @@ -96,18 +96,19 @@ vtophys(ExecContext *xc, Addr vaddr) { Addr ptbr = xc->regs.ipr[AlphaISA::IPR_PALtemp20]; Addr paddr = 0; - if (vaddr < ALPHA_K0SEG_BASE) { - DPRINTF(VtoPhys, "vtophys: invalid vaddr %#x", vaddr); - } else if (vaddr < ALPHA_K1SEG_BASE) { - paddr = ALPHA_K0SEG_TO_PHYS(vaddr); + if (PC_PAL(vaddr)) { + paddr = vaddr & ~ULL(1); + } else if (!ptbr) { + paddr = vaddr; } else { - if (!ptbr) - panic("vtophys: ptbr is not set on virtual lookup"); - - Addr pte = kernel_pte_lookup(xc->physmem, ptbr, vaddr); - uint64_t entry = xc->physmem->phys_read_qword(pte); - if (pte && entry_valid(entry)) - paddr = PMAP_PTE_PA(entry) | (vaddr & PGOFSET); + if (vaddr >= ALPHA_K0SEG_BASE && vaddr <= ALPHA_K0SEG_END) { + paddr = ALPHA_K0SEG_TO_PHYS(vaddr); + } else { + Addr pte = kernel_pte_lookup(xc->physmem, ptbr, vaddr); + uint64_t entry = xc->physmem->phys_read_qword(pte); + if (pte && entry_valid(entry)) + paddr = PMAP_PTE_PA(entry) | (vaddr & PGOFSET); + } } DPRINTF(VtoPhys, "vtophys(%#x) -> %#x\n", vaddr, paddr); @@ -116,6 +117,12 @@ vtophys(ExecContext *xc, Addr vaddr) } uint8_t * +ptomem(ExecContext *xc, Addr paddr, size_t len) +{ + return xc->physmem->dma_addr(paddr, len); +} + +uint8_t * vtomem(ExecContext *xc, Addr vaddr, size_t len) { Addr paddr = vtophys(xc, vaddr); diff --git a/arch/alpha/vtophys.hh b/arch/alpha/vtophys.hh index 47ee538a6..f5696e9c8 100644 --- a/arch/alpha/vtophys.hh +++ b/arch/alpha/vtophys.hh @@ -42,6 +42,7 @@ Addr kernel_pte_lookup(PhysicalMemory *pmem, Addr ptbr, Addr vaddr); Addr vtophys(PhysicalMemory *xc, Addr vaddr); Addr vtophys(ExecContext *xc, Addr vaddr); uint8_t *vtomem(ExecContext *xc, Addr vaddr, size_t len); +uint8_t *ptomem(ExecContext *xc, Addr paddr, size_t len); void CopyData(ExecContext *xc, void *dst, Addr vaddr, size_t len); void CopyString(ExecContext *xc, char *dst, Addr vaddr, size_t maxlen); |