process.cc (13983:0faf12cff9c4) process.cc (13995:5d459168a680)
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;

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

72};
73
74AlphaLinuxObjectFileLoader loader;
75
76} // anonymous namespace
77
78/// Target uname() handler.
79static SyscallReturn
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;

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

72};
73
74AlphaLinuxObjectFileLoader loader;
75
76} // anonymous namespace
77
78/// Target uname() handler.
79static SyscallReturn
80unameFunc(SyscallDesc *desc, int callnum, Process *process,
81 ThreadContext *tc)
80unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
82{
83 int index = 0;
81{
82 int index = 0;
83 auto process = tc->getProcessPtr();
84 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
85
86 strcpy(name->sysname, "Linux");
87 strcpy(name->nodename, "sim.gem5.org");
88 strcpy(name->release, "3.0.0");
89 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
90 strcpy(name->machine, "alpha");
91
92 name.copyOut(tc->getMemProxy());
93 return 0;
94}
95
96/// Target osf_getsysyinfo() handler. Even though this call is
97/// borrowed from Tru64, the subcases that get used appear to be
98/// different in practice from those used by Tru64 processes.
99static SyscallReturn
84 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
85
86 strcpy(name->sysname, "Linux");
87 strcpy(name->nodename, "sim.gem5.org");
88 strcpy(name->release, "3.0.0");
89 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
90 strcpy(name->machine, "alpha");
91
92 name.copyOut(tc->getMemProxy());
93 return 0;
94}
95
96/// Target osf_getsysyinfo() handler. Even though this call is
97/// borrowed from Tru64, the subcases that get used appear to be
98/// different in practice from those used by Tru64 processes.
99static SyscallReturn
100osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
101 ThreadContext *tc)
100osf_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
102{
103 int index = 0;
101{
102 int index = 0;
103 auto process = tc->getProcessPtr();
104 unsigned op = process->getSyscallArg(tc, index);
105 Addr bufPtr = process->getSyscallArg(tc, index);
106 // unsigned nbytes = process->getSyscallArg(tc, 2);
107
108 switch (op) {
109
110 case 45: { // GSI_IEEE_FP_CONTROL
111 TypedBufferArg<uint64_t> fpcr(bufPtr);

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

121 break;
122 }
123
124 return 1;
125}
126
127/// Target osf_setsysinfo() handler.
128static SyscallReturn
104 unsigned op = process->getSyscallArg(tc, index);
105 Addr bufPtr = process->getSyscallArg(tc, index);
106 // unsigned nbytes = process->getSyscallArg(tc, 2);
107
108 switch (op) {
109
110 case 45: { // GSI_IEEE_FP_CONTROL
111 TypedBufferArg<uint64_t> fpcr(bufPtr);

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

121 break;
122 }
123
124 return 1;
125}
126
127/// Target osf_setsysinfo() handler.
128static SyscallReturn
129osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
130 ThreadContext *tc)
129osf_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
131{
132 int index = 0;
130{
131 int index = 0;
132 auto process = tc->getProcessPtr();
133 unsigned op = process->getSyscallArg(tc, index);
134 Addr bufPtr = process->getSyscallArg(tc, index);
135 // unsigned nbytes = process->getSyscallArg(tc, 2);
136
137 switch (op) {
138
139 case 14: { // SSI_IEEE_FP_CONTROL
140 TypedBufferArg<uint64_t> fpcr(bufPtr);

--- 482 unchanged lines hidden ---
133 unsigned op = process->getSyscallArg(tc, index);
134 Addr bufPtr = process->getSyscallArg(tc, index);
135 // unsigned nbytes = process->getSyscallArg(tc, 2);
136
137 switch (op) {
138
139 case 14: { // SSI_IEEE_FP_CONTROL
140 TypedBufferArg<uint64_t> fpcr(bufPtr);

--- 482 unchanged lines hidden ---