diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2012-08-10 14:48:06 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-09-16 15:09:40 -0500 |
commit | 2f50c376a718ea6542b42e029a6735f719a8f407 (patch) | |
tree | f54c4c46d71f1a3226a3e12e69664614ce4db138 /src/kernel/syscall.C | |
parent | a0206bc94f427a1a4e3913fa9122b5530c5500ad (diff) | |
download | talos-hostboot-2f50c376a718ea6542b42e029a6735f719a8f407.tar.gz talos-hostboot-2f50c376a718ea6542b42e029a6735f719a8f407.zip |
Support for Non-zero HRMOR
Changes to kernel code to support detection and use of HRMOR
offset in memory
Changes to tooling to handle the real memory offset
New interface to retrieve the physical address that
corresponds to a virtual address
To test, run these commands before starting up Hostboot:
system_cmp0.cpu0_0_05_0.write-reg HRMOR 0x8000000
proc_venicechip_cmp0.phys_mem.del-map p8Proc0.l3_cache_ram 0 0
RTC: 46032
Change-Id: I50ab248f941218a3a14a8f0fc12a551b56dc7cf3
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1553
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/syscall.C')
-rw-r--r-- | src/kernel/syscall.C | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/src/kernel/syscall.C b/src/kernel/syscall.C index 94c6a5860..a38f08b78 100644 --- a/src/kernel/syscall.C +++ b/src/kernel/syscall.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/kernel/syscall.C $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2010-2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/kernel/syscall.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2010,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #include <assert.h> #include <errno.h> #include <kernel/cpu.H> @@ -92,6 +91,7 @@ namespace Systemcalls void MmRemovePages(task_t *t); void MmSetPermission(task_t *t); void MmAllocPages(task_t *t); + void MmVirtToPhys(task_t *t); syscall syscalls[] = @@ -130,6 +130,7 @@ namespace Systemcalls &MmRemovePages, // MM_REMOVE_PAGES &MmSetPermission, // MM_SET_PERMISSION &MmAllocPages, // MM_ALLOC_PAGES + &MmVirtToPhys, // MM_VIRT_TO_PHYS }; }; @@ -207,7 +208,7 @@ namespace Systemcalls if (status != NULL) { uint64_t addr = - VmmManager::findPhysicalAddress( + VmmManager::findKernelAddress( reinterpret_cast<uint64_t>(status)); if (addr == (static_cast<uint64_t>(-EFAULT))) @@ -222,7 +223,7 @@ namespace Systemcalls if (retval != NULL) { uint64_t addr = - VmmManager::findPhysicalAddress( + VmmManager::findKernelAddress( reinterpret_cast<uint64_t>(retval)); if (addr == (static_cast<uint64_t>(-EFAULT))) @@ -543,7 +544,7 @@ namespace Systemcalls // Set RC to success initially. TASK_SETRTN(t,0); - futex = VmmManager::findPhysicalAddress(futex); + futex = VmmManager::findKernelAddress(futex); if(futex == (static_cast<uint64_t>(-EFAULT))) { printk("Task %d terminated. No physical address found for address 0x%p", @@ -579,7 +580,7 @@ namespace Systemcalls case FUTEX_REQUEUE: // Wake (val) task(s) on futex && requeue remaining tasks on futex2 - futex2 = VmmManager::findPhysicalAddress(futex2); + futex2 = VmmManager::findKernelAddress(futex2); if(futex2 == (static_cast<uint64_t>(-EFAULT))) { printk("Task %d terminated. No physical address found for address 0x%p", @@ -779,5 +780,16 @@ namespace Systemcalls } } + + /** + * Return the physical address backing a virtual address + * @param[in] t: The task used + */ + void MmVirtToPhys(task_t* t) + { + uint64_t i_vaddr = (uint64_t)TASK_GETARG0(t); + uint64_t phys = VmmManager::findPhysicalAddress(i_vaddr); + TASK_SETRTN(t, phys); + } }; |