Deleted Added
sdiff udiff text old ( 2680:246e7104f744 ) new ( 2683:d6b72bb2ed97 )
full compact
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;

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

53 * pointer, etc. It also handles anything related to a specific
54 * thread's process, such as syscalls and checking valid addresses.
55 */
56template <class Impl>
57struct O3ThreadState : public ThreadState {
58 typedef ThreadContext::Status Status;
59 typedef typename Impl::FullCPU FullCPU;
60
61 private:
62 /** Pointer to the CPU. */
63 FullCPU *cpu;
64 public:
65 /** Whether or not the thread is currently in syscall mode, and
66 * thus able to be externally updated without squashing.
67 */
68 bool inSyscall;
69
70 /** Whether or not the thread is currently waiting on a trap, and
71 * thus able to be externally updated without squashing.
72 */
73 bool trapPending;
74
75#if FULL_SYSTEM
76 O3ThreadState(FullCPU *_cpu, int _thread_num, )
77 : ThreadState(-1, _thread_num),
78 inSyscall(0), trapPending(0)
79 { }
80#else
81 O3ThreadState(FullCPU *_cpu, int _thread_num, Process *_process, int _asid,
82 MemObject *mem)
83 : ThreadState(-1, _thread_num, mem, _process, _asid),
84 cpu(_cpu), inSyscall(0), trapPending(0)
85 { }
86#endif
87
88 /** Pointer to the ThreadContext of this thread. */
89 ThreadContext *tc;
90
91 /** Returns a pointer to the TC of this thread. */
92 ThreadContext *getTC() { return tc; }
93
94#if !FULL_SYSTEM
95 /** Handles the syscall. */
96 void syscall(int64_t callnum) { process->syscall(callnum, tc); }
97#endif
98};
99
100#endif // __CPU_O3_THREAD_STATE_HH__