process.cc (11794:97eebddaae84) process.cc (11851:824055fe6b30)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007-2008 The Florida State University
4 * Copyright (c) 2009 The University of Edinburgh
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

44#include "sim/syscall_emul.hh"
45#include "sim/system.hh"
46
47using namespace std;
48using namespace PowerISA;
49
50/// Target uname() handler.
51static SyscallReturn
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007-2008 The Florida State University
4 * Copyright (c) 2009 The University of Edinburgh
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

44#include "sim/syscall_emul.hh"
45#include "sim/system.hh"
46
47using namespace std;
48using namespace PowerISA;
49
50/// Target uname() handler.
51static SyscallReturn
52unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
52unameFunc(SyscallDesc *desc, int callnum, Process *process,
53 ThreadContext *tc)
54{
55 int index = 0;
56 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
57
58 strcpy(name->sysname, "Linux");
59 strcpy(name->nodename, "sim.gem5.org");
60 strcpy(name->release, "3.0.0");

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

410 /* 341 */ SyscallDesc("arm_sync_file_range", unimplementedFunc),
411 /* 342 */ SyscallDesc("tee", unimplementedFunc),
412 /* 343 */ SyscallDesc("vmsplice", unimplementedFunc),
413 /* 344 */ SyscallDesc("move_pages", unimplementedFunc),
414 /* 345 */ SyscallDesc("getcpu", unimplementedFunc),
415 /* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc),
416};
417
53 ThreadContext *tc)
54{
55 int index = 0;
56 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
57
58 strcpy(name->sysname, "Linux");
59 strcpy(name->nodename, "sim.gem5.org");
60 strcpy(name->release, "3.0.0");

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

410 /* 341 */ SyscallDesc("arm_sync_file_range", unimplementedFunc),
411 /* 342 */ SyscallDesc("tee", unimplementedFunc),
412 /* 343 */ SyscallDesc("vmsplice", unimplementedFunc),
413 /* 344 */ SyscallDesc("move_pages", unimplementedFunc),
414 /* 345 */ SyscallDesc("getcpu", unimplementedFunc),
415 /* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc),
416};
417
418PowerLinuxProcess::PowerLinuxProcess(LiveProcessParams * params,
418PowerLinuxProcess::PowerLinuxProcess(ProcessParams * params,
419 ObjectFile *objFile)
419 ObjectFile *objFile)
420 : PowerLiveProcess(params, objFile),
421 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
420 : PowerProcess(params, objFile),
421 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
422{
423}
424
425SyscallDesc*
426PowerLinuxProcess::getDesc(int callnum)
427{
428 if (callnum < 0 || callnum > Num_Syscall_Descs)
429 return NULL;
430
431 return &syscallDescs[callnum];
432}
433
434void
435PowerLinuxProcess::initState()
436{
422{
423}
424
425SyscallDesc*
426PowerLinuxProcess::getDesc(int callnum)
427{
428 if (callnum < 0 || callnum > Num_Syscall_Descs)
429 return NULL;
430
431 return &syscallDescs[callnum];
432}
433
434void
435PowerLinuxProcess::initState()
436{
437 PowerLiveProcess::initState();
437 PowerProcess::initState();
438}
439
440PowerISA::IntReg
441PowerLinuxProcess::getSyscallArg(ThreadContext *tc, int &i)
442{
443 // Linux apparently allows more parameter than the ABI says it should.
444 // This limit may need to be increased even further.
445 assert(i < 6);
446 return tc->readIntReg(ArgumentReg0 + i++);
447}
448
449void
450PowerLinuxProcess::setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val)
451{
452 // Linux apparently allows more parameter than the ABI says it should.
453 // This limit may need to be increased even further.
454 assert(i < 6);
455 tc->setIntReg(ArgumentReg0 + i, val);
456}
438}
439
440PowerISA::IntReg
441PowerLinuxProcess::getSyscallArg(ThreadContext *tc, int &i)
442{
443 // Linux apparently allows more parameter than the ABI says it should.
444 // This limit may need to be increased even further.
445 assert(i < 6);
446 return tc->readIntReg(ArgumentReg0 + i++);
447}
448
449void
450PowerLinuxProcess::setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val)
451{
452 // Linux apparently allows more parameter than the ABI says it should.
453 // This limit may need to be increased even further.
454 assert(i < 6);
455 tc->setIntReg(ArgumentReg0 + i, val);
456}