/// Target uname() handler.
static SyscallReturn
-unameFunc32(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc32(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename, "m5.eecs.umich.edu");
strcpy(name->version, "#1 SMP Sat Dec 1 00:00:00 GMT 2012");
strcpy(name->machine, "armv7l");
- name.copyOut(tc->getVirtProxy());
return 0;
}
/// Target uname() handler.
static SyscallReturn
-unameFunc64(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc64(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename, "gem5");
strcpy(name->version, "#1 SMP Sat Dec 1 00:00:00 GMT 2012");
strcpy(name->machine, "armv8l");
- name.copyOut(tc->getVirtProxy());
return 0;
}
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename,"sim.gem5.org");
strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
strcpy(name->machine, "mips");
- name.copyOut(tc->getVirtProxy());
return 0;
}
case 45:
{
// GSI_IEEE_FP_CONTROL
- TypedBufferArg<uint64_t> fpcr(bufPtr);
+ VPtr<uint64_t> fpcr(bufPtr, tc);
// I don't think this exactly matches the HW FPCR
*fpcr = 0;
- fpcr.copyOut(tc->getVirtProxy());
return 0;
}
default:
case 14:
{
// SSI_IEEE_FP_CONTROL
- TypedBufferArg<uint64_t> fpcr(bufPtr);
+ ConstVPtr<uint64_t> fpcr(bufPtr, tc);
// I don't think this exactly matches the HW FPCR
fpcr.copyIn(tc->getVirtProxy());
DPRINTFR(SyscallVerbose, "sys_setsysinfo(SSI_IEEE_FP_CONTROL): "
- " setting FPCR to 0x%x\n", letoh(*(uint64_t*)fpcr));
+ " setting FPCR to 0x%x\n", letoh(*fpcr));
return 0;
}
default:
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename, "sim.gem5.org");
strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
strcpy(name->machine, "power");
- name.copyOut(tc->getVirtProxy());
return 0;
}
/// Target uname() handler.
static SyscallReturn
-unameFunc64(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc64(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename,"sim.gem5.org");
strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
strcpy(name->machine, "riscv64");
- name.copyOut(tc->getVirtProxy());
return 0;
}
/// Target uname() handler.
static SyscallReturn
-unameFunc32(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc32(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename,"sim.gem5.org");
strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
strcpy(name->machine, "riscv32");
- name.copyOut(tc->getVirtProxy());
return 0;
}
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename, "sim.gem5.org");
strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
strcpy(name->machine, "sparc");
- name.copyOut(tc->getVirtProxy());
-
return 0;
}
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<Solaris::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Solaris::utsname> name(utsname);
strcpy(name->sysname, "SunOS");
strcpy(name->nodename, "m5.eecs.umich.edu");
strcpy(name->version, "Generic_118558-21");
strcpy(name->machine, "sun4u");
- name.copyOut(tc->getVirtProxy());
-
return 0;
}
/// Target uname() handler.
static SyscallReturn
-unameFunc(SyscallDesc *desc, ThreadContext *tc, Addr utsname)
+unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<Linux::utsname> name)
{
auto process = tc->getProcessPtr();
- TypedBufferArg<Linux::utsname> name(utsname);
strcpy(name->sysname, "Linux");
strcpy(name->nodename, "sim.gem5.org");
strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
strcpy(name->machine, "x86_64");
- name.copyOut(tc->getVirtProxy());
-
return 0;
}
};
static SyscallReturn
-setThreadArea32Func(SyscallDesc *desc, ThreadContext *tc, Addr userDescPtr)
+setThreadArea32Func(SyscallDesc *desc, ThreadContext *tc,
+ VPtr<UserDesc32> userDesc)
{
const int minTLSEntry = 6;
const int numTLSEntries = 3;
assert((maxTLSEntry + 1) * sizeof(uint64_t) <= x86p->gdtSize());
- TypedBufferArg<UserDesc32> userDesc(userDescPtr);
TypedBufferArg<uint64_t>
gdt(x86p->gdtStart() + minTLSEntry * sizeof(uint64_t),
numTLSEntries * sizeof(uint64_t));
- if (!userDesc.copyIn(tc->getVirtProxy()))
- return -EFAULT;
-
if (!gdt.copyIn(tc->getVirtProxy()))
panic("Failed to copy in GDT for %s.\n", desc->name());
gdt[index] = (uint64_t)segDesc;
- if (!userDesc.copyOut(tc->getVirtProxy()))
- return -EFAULT;
if (!gdt.copyOut(tc->getVirtProxy()))
panic("Failed to copy out GDT for %s.\n", desc->name());