process.hh (4111:65fffcb4fae9) process.hh (4117:2807cee7b892)
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
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>
44#include <vector>
45
46#include "base/statistics.hh"
45#include <vector>
46
47#include "base/statistics.hh"
48#include "mem/translating_port.hh"
47#include "sim/host.hh"
48#include "sim/sim_object.hh"
49
50class ThreadContext;
51class SyscallDesc;
52class PageTable;
53class TranslatingPort;
54class System;
55class GDBListener;
56namespace TheISA
57{
58 class RemoteGDB;
59}
60
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>
61void
65void
62copyStringArray(std::vector<std::string> &strings, Addr array_ptr,
63 Addr data_ptr, TranslatingPort* memPort, int ptr_size = sizeof(Addr));
66copyStringArray(std::vector &strings,
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;
64
81
82 memPort->writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType));
83}
84
65class Process : public SimObject
66{
67 public:
68
69 /// Pointer to object representing the system this process is
70 /// running on.
71 System *system;
72

--- 187 unchanged lines hidden ---
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 ---