Deleted Added
sdiff udiff text old ( 6650:f23a18fec0ef ) new ( 6701:4842482e1bd1 )
full compact
1/*
2 * Copyright (c) 2005 The Regents of The University of Michigan
3 * Copyright (c) 2007 MIPS Technologies, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

46using namespace std;
47using namespace MipsISA;
48
49/// Target uname() handler.
50static SyscallReturn
51unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
52 ThreadContext *tc)
53{
54 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, 0));
55
56 strcpy(name->sysname, "Linux");
57 strcpy(name->nodename,"m5.eecs.umich.edu");
58 strcpy(name->release, "2.4.20");
59 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
60 strcpy(name->machine, "mips");
61
62 name.copyOut(tc->getMemPort());
63 return 0;
64}
65
66/// Target sys_getsysyinfo() handler. Even though this call is
67/// borrowed from Tru64, the subcases that get used appear to be
68/// different in practice from those used by Tru64 processes.
69static SyscallReturn
70sys_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
71 ThreadContext *tc)
72{
73 unsigned op = process->getSyscallArg(tc, 0);
74 // unsigned nbytes = process->getSyscallArg(tc, 2);
75
76 switch (op) {
77 case 45:
78 {
79 // GSI_IEEE_FP_CONTROL
80 TypedBufferArg<uint64_t> fpcr(process->getSyscallArg(tc, 1));
81 // I don't think this exactly matches the HW FPCR
82 *fpcr = 0;
83 fpcr.copyOut(tc->getMemPort());
84 return 0;
85 }
86 default:
87 cerr << "sys_getsysinfo: unknown op " << op << endl;
88 abort();
89 break;
90 }
91
92 return 1;
93}
94
95/// Target sys_setsysinfo() handler.
96static SyscallReturn
97sys_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
98 ThreadContext *tc)
99{
100 unsigned op = process->getSyscallArg(tc, 0);
101 // unsigned nbytes = process->getSyscallArg(tc, 2);
102
103 switch (op) {
104
105 case 14:
106 {
107 // SSI_IEEE_FP_CONTROL
108 TypedBufferArg<uint64_t> fpcr(process->getSyscallArg(tc, 1));
109 // I don't think this exactly matches the HW FPCR
110 fpcr.copyIn(tc->getMemPort());
111 DPRINTFR(SyscallVerbose, "sys_setsysinfo(SSI_IEEE_FP_CONTROL): "
112 " setting FPCR to 0x%x\n", gtoh(*(uint64_t*)fpcr));
113 return 0;
114 }
115 default:
116 cerr << "sys_setsysinfo: unknown op " << op << endl;

--- 315 unchanged lines hidden ---