1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 27 unchanged lines hidden (view full) --- 36// The purpose of this code is to fake the loader & syscall mechanism 37// when there's no OS: thus there's no reason to use it in FULL_SYSTEM 38// mode when we do have an OS. 39// 40#include "config/full_system.hh" 41 42#if !FULL_SYSTEM 43 |
44#include <string> |
45#include <vector> 46 47#include "base/statistics.hh" |
48#include "mem/translating_port.hh" |
49#include "sim/host.hh" 50#include "sim/sim_object.hh" 51 52class ThreadContext; 53class SyscallDesc; 54class PageTable; 55class TranslatingPort; 56class System; 57class GDBListener; 58namespace TheISA 59{ 60 class RemoteGDB; 61} 62 |
63//This needs to be templated for cases where 32 bit pointers are needed. 64template<class AddrType> |
65void |
66copyStringArray(std::vector 67 AddrType array_ptr, AddrType data_ptr, 68 TranslatingPort* memPort) 69{ 70 AddrType data_ptr_swap; 71 for (int i = 0; i < strings.size(); ++i) { 72 data_ptr_swap = htog(data_ptr); 73 memPort->writeBlob(array_ptr, (uint8_t*)&data_ptr_swap, 74 sizeof(AddrType)); 75 memPort->writeString(data_ptr, strings[i].c_str()); 76 array_ptr += sizeof(AddrType); 77 data_ptr += strings[i].size() + 1; 78 } 79 // add NULL terminator 80 data_ptr = 0; |
81 |
82 memPort->writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType)); 83} 84 |
85class Process : public SimObject 86{ 87 public: 88 89 /// Pointer to object representing the system this process is 90 /// running on. 91 System *system; 92 --- 187 unchanged lines hidden --- |