1/* 2 * Copyright (c) 2011 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 250 unchanged lines hidden (view full) --- 259 260 // This function exits the thread context in the CPU and returns 261 // 1 if the CPU has no more active threads (meaning it's OK to exit); 262 // Used in syscall-emulation mode when a thread calls the exit syscall. 263 virtual int exit() { return 1; }; 264 265 /** function to compare two thread contexts (for debugging) */ 266 static void compare(ThreadContext *one, ThreadContext *two); |
267 268 /** @{ */ 269 /** 270 * Flat register interfaces 271 * 272 * Some architectures have different registers visible in 273 * different modes. Such architectures "flatten" a register (see 274 * flattenIntIndex() and flattenFloatIndex()) to map it into the 275 * gem5 register file. This interface provides a flat interface to 276 * the underlying register file, which allows for example 277 * serialization code to access all registers. 278 */ 279 280 virtual uint64_t readIntRegFlat(int idx) = 0; 281 virtual void setIntRegFlat(int idx, uint64_t val) = 0; 282 283 virtual FloatReg readFloatRegFlat(int idx) = 0; 284 virtual void setFloatRegFlat(int idx, FloatReg val) = 0; 285 286 virtual FloatRegBits readFloatRegBitsFlat(int idx) = 0; 287 virtual void setFloatRegBitsFlat(int idx, FloatRegBits val) = 0; 288 289 /** @} */ 290 |
291}; 292 293/** 294 * ProxyThreadContext class that provides a way to implement a 295 * ThreadContext without having to derive from it. ThreadContext is an 296 * abstract class, so anything that derives from it and uses its 297 * interface will pay the overhead of virtual function calls. This 298 * class is created to enable a user-defined Thread object to be used --- 149 unchanged lines hidden (view full) --- 448 449 // @todo: Fix this! 450 bool misspeculating() { return actualTC->misspeculating(); } 451 452 void syscall(int64_t callnum) 453 { actualTC->syscall(callnum); } 454 455 Counter readFuncExeInst() { return actualTC->readFuncExeInst(); } |
456 457 uint64_t readIntRegFlat(int idx) 458 { return actualTC->readIntRegFlat(idx); } 459 460 void setIntRegFlat(int idx, uint64_t val) 461 { actualTC->setIntRegFlat(idx, val); } 462 463 FloatReg readFloatRegFlat(int idx) 464 { return actualTC->readFloatRegFlat(idx); } 465 466 void setFloatRegFlat(int idx, FloatReg val) 467 { actualTC->setFloatRegFlat(idx, val); } 468 469 FloatRegBits readFloatRegBitsFlat(int idx) 470 { return actualTC->readFloatRegBitsFlat(idx); } 471 472 void setFloatRegBitsFlat(int idx, FloatRegBits val) 473 { actualTC->setFloatRegBitsFlat(idx, val); } |
474}; 475 476#endif |