process.cc (11877:5ea85692a53e) process.cc (13988:d579f9c76531)
1/*
2 * Copyright (c) 2003-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;

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

29 * Gabe Black
30 * Ali Saidi
31 */
32
33#include "arch/sparc/linux/process.hh"
34
35#include "arch/sparc/isa_traits.hh"
36#include "arch/sparc/registers.hh"
1/*
2 * Copyright (c) 2003-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;

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

29 * Gabe Black
30 * Ali Saidi
31 */
32
33#include "arch/sparc/linux/process.hh"
34
35#include "arch/sparc/isa_traits.hh"
36#include "arch/sparc/registers.hh"
37#include "base/loader/object_file.hh"
37#include "base/trace.hh"
38#include "cpu/thread_context.hh"
39#include "kern/linux/linux.hh"
40#include "sim/process.hh"
41#include "sim/syscall_desc.hh"
42#include "sim/syscall_emul.hh"
43
44using namespace std;
45using namespace SparcISA;
46
38#include "base/trace.hh"
39#include "cpu/thread_context.hh"
40#include "kern/linux/linux.hh"
41#include "sim/process.hh"
42#include "sim/syscall_desc.hh"
43#include "sim/syscall_emul.hh"
44
45using namespace std;
46using namespace SparcISA;
47
48namespace
49{
50
51class SparcLinuxObjectFileLoader : public ObjectFile::Loader
52{
53 public:
54 Process *
55 load(ProcessParams *params, ObjectFile *obj_file) override
56 {
57 auto arch = obj_file->getArch();
58 auto opsys = obj_file->getOpSys();
59
60 if (arch != ObjectFile::SPARC64 && arch != ObjectFile::SPARC32)
61 return nullptr;
62
63 if (opsys == ObjectFile::UnknownOpSys) {
64 warn("Unknown operating system; assuming Linux.");
65 opsys = ObjectFile::Linux;
66 }
67
68 if (opsys != ObjectFile::Linux)
69 return nullptr;
70
71 if (arch == ObjectFile::SPARC64)
72 return new Sparc64LinuxProcess(params, obj_file);
73 else
74 return new Sparc32LinuxProcess(params, obj_file);
75 }
76};
77
78SparcLinuxObjectFileLoader loader;
79
80} // anonymous namespace
81
47SyscallDesc*
48SparcLinuxProcess::getDesc(int callnum)
49{
50 if (callnum < 0 || callnum >= Num_Syscall_Descs)
51 return NULL;
52 return &syscallDescs[callnum];
53}
54

--- 42 unchanged lines hidden ---
82SyscallDesc*
83SparcLinuxProcess::getDesc(int callnum)
84{
85 if (callnum < 0 || callnum >= Num_Syscall_Descs)
86 return NULL;
87 return &syscallDescs[callnum];
88}
89

--- 42 unchanged lines hidden ---