Deleted Added
sdiff udiff text old ( 5254:c555f8b07345 ) new ( 5499:8bfc7650c344 )
full compact
1/*
2 * Copyright (c) 2004-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;

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

65
66// if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_pid", addr))
67// panic("thread info not compiled into kernel\n");
68// pid_off = vp->readGtoH<int32_t>(addr);
69
70// if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr))
71// panic("thread info not compiled into kernel\n");
72// name_off = vp->readGtoH<int32_t>(addr);
73
74 tc->delVirtPort(vp);
75}
76
77Addr
78ProcessInfo::task(Addr ksp) const
79{
80 Addr base = ksp & ~0x3fff;
81 if (base == ULL(0xfffffc0000000000))
82 return 0;
83
84 Addr tsk;
85
86 VirtualPort *vp;
87
88 vp = tc->getVirtPort();
89 tsk = vp->readGtoH<Addr>(base + task_off);
90 tc->delVirtPort(vp);
91
92 return tsk;
93}
94
95int
96ProcessInfo::pid(Addr ksp) const
97{
98 Addr task = this->task(ksp);
99 if (!task)
100 return -1;
101
102 uint16_t pd;
103
104 VirtualPort *vp;
105
106 vp = tc->getVirtPort();
107 pd = vp->readGtoH<uint16_t>(task + pid_off);
108 tc->delVirtPort(vp);
109
110 return pd;
111}
112
113string
114ProcessInfo::name(Addr ksp) const
115{
116 Addr task = this->task(ksp);

--- 238 unchanged lines hidden ---