From df8a58895b66acb810e7a4e19d6d8742c9e92008 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 19 Aug 2020 02:07:25 -0700 Subject: [PATCH] arch: Make ThreadInfo::curThreadInfo virtual, protected. Also remove it's Alpha centric implementation. All existing ISAs will panic since they all define the guarding constant as false. Even if they defined it as true, this function assumes that there is necessarily a misc reg which can be read to find the current thread_info struct, and how the contents of that register should be manipulated. This code is already fairly fragile since it depends on things in the Linux kernel having certain names and relationships with each other, but that's a larger problem I don't want to fix right now. Change-Id: Ic107793ebcd25ee25c4d3713c84c1d2b5209f1a3 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32921 Reviewed-by: Andreas Sandberg Maintainer: Gabe Black Tested-by: kokoro --- src/arch/generic/linux/threadinfo.hh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/arch/generic/linux/threadinfo.hh b/src/arch/generic/linux/threadinfo.hh index 7bbf2dfdb..01271051c 100644 --- a/src/arch/generic/linux/threadinfo.hh +++ b/src/arch/generic/linux/threadinfo.hh @@ -71,22 +71,10 @@ class ThreadInfo ~ThreadInfo() {} - Addr + virtual Addr curThreadInfo() { - if (!TheISA::CurThreadInfoImplemented) - panic("curThreadInfo() not implemented for this ISA"); - - Addr addr = pcbb; - Addr sp; - - if (!addr) - addr = tc->readMiscRegNoEffect(TheISA::CurThreadInfoReg); - - PortProxy &p = tc->getPhysProxy(); - p.readBlob(addr, &sp, sizeof(Addr)); - - return sp & ~ULL(0x3fff); + panic("curThreadInfo() not implemented."); } Addr -- 2.30.2