process.cc (11794:97eebddaae84) process.cc (11851:824055fe6b30)
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;

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

41#include "sim/syscall_desc.hh"
42#include "sim/syscall_emul.hh"
43
44using namespace std;
45using namespace AlphaISA;
46
47/// Target uname() handler.
48static 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;

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

41#include "sim/syscall_desc.hh"
42#include "sim/syscall_emul.hh"
43
44using namespace std;
45using namespace AlphaISA;
46
47/// Target uname() handler.
48static SyscallReturn
49unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
49unameFunc(SyscallDesc *desc, int callnum, Process *process,
50 ThreadContext *tc)
51{
52 int index = 0;
53 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
54
55 strcpy(name->sysname, "Linux");
56 strcpy(name->nodename, "sim.gem5.org");
57 strcpy(name->release, "3.0.0");
58 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
59 strcpy(name->machine, "alpha");
60
61 name.copyOut(tc->getMemProxy());
62 return 0;
63}
64
65/// Target osf_getsysyinfo() handler. Even though this call is
66/// borrowed from Tru64, the subcases that get used appear to be
67/// different in practice from those used by Tru64 processes.
68static SyscallReturn
50 ThreadContext *tc)
51{
52 int index = 0;
53 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index));
54
55 strcpy(name->sysname, "Linux");
56 strcpy(name->nodename, "sim.gem5.org");
57 strcpy(name->release, "3.0.0");
58 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
59 strcpy(name->machine, "alpha");
60
61 name.copyOut(tc->getMemProxy());
62 return 0;
63}
64
65/// Target osf_getsysyinfo() handler. Even though this call is
66/// borrowed from Tru64, the subcases that get used appear to be
67/// different in practice from those used by Tru64 processes.
68static SyscallReturn
69osf_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
69osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
70 ThreadContext *tc)
71{
72 int index = 0;
73 unsigned op = process->getSyscallArg(tc, index);
74 Addr bufPtr = process->getSyscallArg(tc, index);
75 // unsigned nbytes = process->getSyscallArg(tc, 2);
76
77 switch (op) {

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

90 break;
91 }
92
93 return 1;
94}
95
96/// Target osf_setsysinfo() handler.
97static SyscallReturn
70 ThreadContext *tc)
71{
72 int index = 0;
73 unsigned op = process->getSyscallArg(tc, index);
74 Addr bufPtr = process->getSyscallArg(tc, index);
75 // unsigned nbytes = process->getSyscallArg(tc, 2);
76
77 switch (op) {

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

90 break;
91 }
92
93 return 1;
94}
95
96/// Target osf_setsysinfo() handler.
97static SyscallReturn
98osf_setsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
98osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process,
99 ThreadContext *tc)
100{
101 int index = 0;
102 unsigned op = process->getSyscallArg(tc, index);
103 Addr bufPtr = process->getSyscallArg(tc, index);
104 // unsigned nbytes = process->getSyscallArg(tc, 2);
105
106 switch (op) {

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

567 /* 436 */ SyscallDesc("mq_notify", unimplementedFunc),
568 /* 437 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
569 /* 438 */ SyscallDesc("waitid", unimplementedFunc),
570 /* 439 */ SyscallDesc("add_key", unimplementedFunc),
571 /* 440 */ SyscallDesc("request_key", unimplementedFunc),
572 /* 441 */ SyscallDesc("keyctl", unimplementedFunc)
573};
574
99 ThreadContext *tc)
100{
101 int index = 0;
102 unsigned op = process->getSyscallArg(tc, index);
103 Addr bufPtr = process->getSyscallArg(tc, index);
104 // unsigned nbytes = process->getSyscallArg(tc, 2);
105
106 switch (op) {

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

567 /* 436 */ SyscallDesc("mq_notify", unimplementedFunc),
568 /* 437 */ SyscallDesc("mq_getsetattr", unimplementedFunc),
569 /* 438 */ SyscallDesc("waitid", unimplementedFunc),
570 /* 439 */ SyscallDesc("add_key", unimplementedFunc),
571 /* 440 */ SyscallDesc("request_key", unimplementedFunc),
572 /* 441 */ SyscallDesc("keyctl", unimplementedFunc)
573};
574
575AlphaLinuxProcess::AlphaLinuxProcess(LiveProcessParams * params,
575AlphaLinuxProcess::AlphaLinuxProcess(ProcessParams * params,
576 ObjectFile *objFile)
576 ObjectFile *objFile)
577 : AlphaLiveProcess(params, objFile),
577 : AlphaProcess(params, objFile),
578 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
579{
580 //init_regs->intRegFile[0] = 0;
581}
582
583
584
585SyscallDesc*
586AlphaLinuxProcess::getDesc(int callnum)
587{
588 if (callnum < 0 || callnum >= Num_Syscall_Descs)
589 return NULL;
590 return &syscallDescs[callnum];
591}
578 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
579{
580 //init_regs->intRegFile[0] = 0;
581}
582
583
584
585SyscallDesc*
586AlphaLinuxProcess::getDesc(int callnum)
587{
588 if (callnum < 0 || callnum >= Num_Syscall_Descs)
589 return NULL;
590 return &syscallDescs[callnum];
591}