thread_state.cc (8852:c744483edfcf) | thread_state.cc (8921:e53972f72165) |
---|---|
1/* 2 * Copyright (c) 2006 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; --- 87 unchanged lines hidden (view full) --- 96 baseCpu->schedule(quiesceEvent, quiesceEndTick); 97 if (kernelStats) 98 kernelStats->unserialize(cp, section); 99} 100 101void 102ThreadState::initMemProxies(ThreadContext *tc) 103{ | 1/* 2 * Copyright (c) 2006 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; --- 87 unchanged lines hidden (view full) --- 96 baseCpu->schedule(quiesceEvent, quiesceEndTick); 97 if (kernelStats) 98 kernelStats->unserialize(cp, section); 99} 100 101void 102ThreadState::initMemProxies(ThreadContext *tc) 103{ |
104 // Note that this only refers to the port on the CPU side and can 105 // safely be done at init() time even if the CPU is not connected 106 // (i.e. due to restoring from a checkpoint and later switching 107 // in. 108 if (physProxy == NULL) 109 // this cannot be done in the constructor as the thread state | 104 // The port proxies only refer to the data port on the CPU side 105 // and can safely be done at init() time even if the CPU is not 106 // connected, i.e. when restoring from a checkpoint and later 107 // switching the CPU in. 108 if (FullSystem) { 109 assert(physProxy == NULL); 110 // This cannot be done in the constructor as the thread state |
110 // itself is created in the base cpu constructor and the | 111 // itself is created in the base cpu constructor and the |
111 // getPort is a virtual function at the moment | 112 // getDataPort is a virtual function |
112 physProxy = new PortProxy(baseCpu->getDataPort()); | 113 physProxy = new PortProxy(baseCpu->getDataPort()); |
113 if (virtProxy == NULL) | 114 115 assert(virtProxy == NULL); |
114 virtProxy = new FSTranslatingPortProxy(tc); | 116 virtProxy = new FSTranslatingPortProxy(tc); |
117 } else { 118 assert(proxy == NULL); 119 proxy = new SETranslatingPortProxy(baseCpu->getDataPort(), 120 process, 121 SETranslatingPortProxy::NextPage); 122 } |
|
115} 116 117void 118ThreadState::profileClear() 119{ 120 if (profile) 121 profile->clear(); 122} 123 124void 125ThreadState::profileSample() 126{ 127 if (profile) 128 profile->sample(profileNode, profilePC); 129} | 123} 124 125void 126ThreadState::profileClear() 127{ 128 if (profile) 129 profile->clear(); 130} 131 132void 133ThreadState::profileSample() 134{ 135 if (profile) 136 profile->sample(profileNode, profilePC); 137} |
130 131SETranslatingPortProxy & 132ThreadState::getMemProxy() 133{ 134 if (proxy == NULL) 135 proxy = new SETranslatingPortProxy(baseCpu->getDataPort(), 136 process, 137 SETranslatingPortProxy::NextPage); 138 return *proxy; 139} | |