system.cc (11463:d9e32a851e2e) system.cc (11538:55014a40512c)
1/*
1/*
2 * Copyright (c) 2010-2013 ARM Limited
2 * Copyright (c) 2010-2013, 2016 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

48#include "base/loader/dtb_object.hh"
49#include "base/loader/object_file.hh"
50#include "base/loader/symtab.hh"
51#include "cpu/base.hh"
52#include "cpu/pc_event.hh"
53#include "cpu/thread_context.hh"
54#include "debug/Loader.hh"
55#include "kern/linux/events.hh"
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

48#include "base/loader/dtb_object.hh"
49#include "base/loader/object_file.hh"
50#include "base/loader/symtab.hh"
51#include "cpu/base.hh"
52#include "cpu/pc_event.hh"
53#include "cpu/thread_context.hh"
54#include "debug/Loader.hh"
55#include "kern/linux/events.hh"
56#include "kern/linux/helpers.hh"
56#include "mem/fs_translating_port_proxy.hh"
57#include "mem/physical.hh"
58#include "sim/stat_control.hh"
59
60using namespace ArmISA;
61using namespace Linux;
62
63LinuxArmSystem::LinuxArmSystem(Params *p)
64 : GenericArmSystem(p), dumpStatsPCEvent(nullptr),
65 enableContextSwitchStatsDump(p->enable_context_switch_stats_dump),
66 taskFile(nullptr), kernelPanicEvent(nullptr), kernelOopsEvent(nullptr)
67{
57#include "mem/fs_translating_port_proxy.hh"
58#include "mem/physical.hh"
59#include "sim/stat_control.hh"
60
61using namespace ArmISA;
62using namespace Linux;
63
64LinuxArmSystem::LinuxArmSystem(Params *p)
65 : GenericArmSystem(p), dumpStatsPCEvent(nullptr),
66 enableContextSwitchStatsDump(p->enable_context_switch_stats_dump),
67 taskFile(nullptr), kernelPanicEvent(nullptr), kernelOopsEvent(nullptr)
68{
69 const std::string dmesg_output = name() + ".dmesg";
68 if (p->panic_on_panic) {
70 if (p->panic_on_panic) {
69 kernelPanicEvent = addKernelFuncEventOrPanic<PanicPCEvent>(
70 "panic", "Kernel panic in simulated kernel");
71 kernelPanicEvent = addKernelFuncEventOrPanic<Linux::KernelPanicEvent>(
72 "panic", "Kernel panic in simulated kernel", dmesg_output);
73 } else {
74 kernelPanicEvent = addKernelFuncEventOrPanic<Linux::DmesgDumpEvent>(
75 "panic", "Kernel panic in simulated kernel", dmesg_output);
71 }
72
73 if (p->panic_on_oops) {
76 }
77
78 if (p->panic_on_oops) {
74 kernelOopsEvent = addKernelFuncEventOrPanic<PanicPCEvent>(
75 "oops_exit", "Kernel oops in guest");
79 kernelOopsEvent = addKernelFuncEventOrPanic<Linux::KernelPanicEvent>(
80 "oops_exit", "Kernel oops in guest", dmesg_output);
81 } else {
82 kernelOopsEvent = addKernelFuncEventOrPanic<Linux::DmesgDumpEvent>(
83 "oops_exit", "Kernel oops in guest", dmesg_output);
76 }
77
78 // With ARM udelay() is #defined to __udelay
79 // newer kernels use __loop_udelay and __loop_const_udelay symbols
80 uDelaySkipEvent = addKernelFuncEvent<UDelayEvent>(
81 "__loop_udelay", "__udelay", 1000, 0);
82 if (!uDelaySkipEvent)
83 uDelaySkipEvent = addKernelFuncEventOrPanic<UDelayEvent>(

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

256 warn_once("Error out of identifiers for cache occupancy stats");
257 taskMap[pid] = ContextSwitchTaskId::Unknown;
258 } else {
259 taskMap[pid] = map_size;
260 }
261 }
262}
263
84 }
85
86 // With ARM udelay() is #defined to __udelay
87 // newer kernels use __loop_udelay and __loop_const_udelay symbols
88 uDelaySkipEvent = addKernelFuncEvent<UDelayEvent>(
89 "__loop_udelay", "__udelay", 1000, 0);
90 if (!uDelaySkipEvent)
91 uDelaySkipEvent = addKernelFuncEventOrPanic<UDelayEvent>(

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

264 warn_once("Error out of identifiers for cache occupancy stats");
265 taskMap[pid] = ContextSwitchTaskId::Unknown;
266 } else {
267 taskMap[pid] = map_size;
268 }
269 }
270}
271
272void
273LinuxArmSystem::dumpDmesg()
274{
275 Linux::dumpDmesg(getThreadContext(0), std::cout);
276}
277
264/** This function is called whenever the the kernel function
265 * "__switch_to" is called to change running tasks.
266 *
267 * r0 = task_struct of the previously running process
268 * r1 = task_info of the previously running process
269 * r2 = task_info of the next process to run
270 */
271void

--- 45 unchanged lines hidden ---
278/** This function is called whenever the the kernel function
279 * "__switch_to" is called to change running tasks.
280 *
281 * r0 = task_struct of the previously running process
282 * r1 = task_info of the previously running process
283 * r2 = task_info of the next process to run
284 */
285void

--- 45 unchanged lines hidden ---