Deleted Added
sdiff udiff text old ( 11379:bfe4c2a8ad36 ) new ( 11380:3370547fa302 )
full compact
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;

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

37#include <string>
38
39#include "arch/utility.hh"
40#include "base/chunk_generator.hh"
41#include "base/trace.hh"
42#include "config/the_isa.hh"
43#include "cpu/base.hh"
44#include "cpu/thread_context.hh"
45#include "debug/SyscallBase.hh"
46#include "debug/SyscallVerbose.hh"
47#include "mem/page_table.hh"
48#include "sim/process.hh"
49#include "sim/sim_exit.hh"
50#include "sim/syscall_emul.hh"
51#include "sim/system.hh"
52
53using namespace std;
54using namespace TheISA;
55
56void
57SyscallDesc::doSyscall(int callnum, LiveProcess *process, ThreadContext *tc)
58{
59 if (DTRACE(SyscallBase)) {
60 int index = 0;
61 IntReg arg[6] M5_VAR_USED;
62
63 // we can't just put the calls to getSyscallArg() in the
64 // DPRINTF arg list, because C++ doesn't guarantee their order
65 for (int i = 0; i < 6; ++i)
66 arg[i] = process->getSyscallArg(tc, index);
67
68 // Linux supports up to six system call arguments through registers
69 // so we want to print all six. Check to the relevant man page to
70 // verify how many are actually used by a given system call.
71 DPRINTF_SYSCALL(Base,
72 "%s called w/arguments %d, %d, %d, %d, %d, %d\n",
73 name, arg[0], arg[1], arg[2], arg[3], arg[4],
74 arg[5]);
75 }
76
77 SyscallReturn retval = (*funcPtr)(this, callnum, process, tc);
78
79 if (retval.needsRetry()) {
80 DPRINTF_SYSCALL(Base, "%s needs retry\n", name);
81 } else {
82 DPRINTF_SYSCALL(Base, "%s returns %d\n", name,
83 retval.encodedValue());
84 }
85
86 if (!(flags & SyscallDesc::SuppressReturnValue) && !retval.needsRetry())
87 process->setSyscallReturn(tc, retval);
88}
89
90
91SyscallReturn

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

200 size_needed = PageBytes - size_needed;
201 tp.memsetBlob(next_page, zero, size_needed);
202 }
203 }
204 }
205 }
206
207 p->brk_point = new_brk;
208 DPRINTF_SYSCALL(Verbose, "brk: break point changed to: %#X\n",
209 p->brk_point);
210 return p->brk_point;
211}
212
213
214SyscallReturn
215closeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
216{
217 int index = 0;

--- 740 unchanged lines hidden ---