Deleted Added
sdiff udiff text old ( 11387:8eeee90c69a8 ) new ( 11389:1e55f16160cb )
full compact
1/*
2 * Copyright (c) 2014 Advanced Micro Devices, Inc.
3 * Copyright (c) 2007 The Hewlett-Packard Development Company
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

--- 742 unchanged lines hidden (view full) ---

751 if (argv.size() < 1)
752 filename = "";
753 else
754 filename = argv[0];
755
756 //We want 16 byte alignment
757 uint64_t align = 16;
758
759 // load object file into target memory
760 objFile->loadSections(initVirtMem);
761
762 enum X86CpuFeature {
763 X86_OnboardFPU = 1 << 0,
764 X86_VirtualModeExtensions = 1 << 1,
765 X86_DebuggingExtensions = 1 << 2,
766 X86_PageSizeExtensions = 1 << 3,

--- 26 unchanged lines hidden (view full) ---

793 X86_StreamingSIMDExtensions2 = 1 << 26,
794 X86_CPUSelfSnoop = 1 << 27,
795
796 X86_HyperThreading = 1 << 28,
797 X86_AutomaticClockControl = 1 << 29,
798 X86_IA64Processor = 1 << 30
799 };
800
801 // Setup the auxilliary vectors. These will already have endian conversion.
802 // Auxilliary vectors are loaded only for elf formatted executables.
803 ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
804 if (elfObject) {
805 uint64_t features =
806 X86_OnboardFPU |
807 X86_VirtualModeExtensions |
808 X86_DebuggingExtensions |
809 X86_PageSizeExtensions |
810 X86_TimeStampCounter |

--- 26 unchanged lines hidden (view full) ---

837 //Bits which describe the system hardware capabilities
838 //XXX Figure out what these should be
839 auxv.push_back(auxv_t(M5_AT_HWCAP, features));
840 //The system page size
841 auxv.push_back(auxv_t(M5_AT_PAGESZ, X86ISA::PageBytes));
842 //Frequency at which times() increments
843 //Defined to be 100 in the kernel source.
844 auxv.push_back(auxv_t(M5_AT_CLKTCK, 100));
845 // For statically linked executables, this is the virtual address of the
846 // program header tables if they appear in the executable image
847 auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable()));
848 // This is the size of a program header entry from the elf file.
849 auxv.push_back(auxv_t(M5_AT_PHENT, elfObject->programHeaderSize()));
850 // This is the number of program headers from the original elf file.
851 auxv.push_back(auxv_t(M5_AT_PHNUM, elfObject->programHeaderCount()));
852 //This is the address of the elf "interpreter", It should be set
853 //to 0 for regular executables. It should be something else
854 //(not sure what) for dynamic libraries.
855 auxv.push_back(auxv_t(M5_AT_BASE, 0));
856
857 //XXX Figure out what this should be.
858 auxv.push_back(auxv_t(M5_AT_FLAGS, 0));
859 //The entry point to the program
860 auxv.push_back(auxv_t(M5_AT_ENTRY, objFile->entryPoint()));
861 //Different user and group IDs
862 auxv.push_back(auxv_t(M5_AT_UID, uid()));
863 auxv.push_back(auxv_t(M5_AT_EUID, euid()));
864 auxv.push_back(auxv_t(M5_AT_GID, gid()));

--- 144 unchanged lines hidden (view full) ---

1009 initVirtMem.writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
1010
1011 ThreadContext *tc = system->getThreadContext(contextIds[0]);
1012 //Set the stack pointer register
1013 tc->setIntReg(StackPointerReg, stack_min);
1014
1015 // There doesn't need to be any segment base added in since we're dealing
1016 // with the flat segmentation model.
1017 tc->pcState(objFile->entryPoint());
1018
1019 //Align the "stack_min" to a page boundary.
1020 stack_min = roundDown(stack_min, pageSize);
1021
1022// num_processes++;
1023}
1024
1025void

--- 64 unchanged lines hidden ---