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 75Addr 76ProcessInfo::task(Addr ksp) const 77{ 78 Addr base = ksp & ~0x3fff; 79 if (base == ULL(0xfffffc0000000000)) 80 return 0; 81 82 Addr tsk; 83 84 VirtualPort *vp; 85 86 vp = tc->getVirtPort(); 87 tsk = vp->readGtoH<Addr>(base + task_off); |
88 89 return tsk; 90} 91 92int 93ProcessInfo::pid(Addr ksp) const 94{ 95 Addr task = this->task(ksp); 96 if (!task) 97 return -1; 98 99 uint16_t pd; 100 101 VirtualPort *vp; 102 103 vp = tc->getVirtPort(); 104 pd = vp->readGtoH<uint16_t>(task + pid_off); |
105 106 return pd; 107} 108 109string 110ProcessInfo::name(Addr ksp) const 111{ 112 Addr task = this->task(ksp); --- 238 unchanged lines hidden --- |