process.cc (3079:13d9c24a7bba) process.cc (3114:7a4771b9b720)
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;

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

42
43using namespace std;
44using namespace AlphaISA;
45
46
47
48/// Target uname() handler.
49static 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;

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

42
43using namespace std;
44using namespace AlphaISA;
45
46
47
48/// Target uname() handler.
49static SyscallReturn
50unameFunc(SyscallDesc *desc, int callnum, Process *process,
50unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
51 ThreadContext *tc)
52{
53 TypedBufferArg<Linux::utsname> name(tc->getSyscallArg(0));
54
55 strcpy(name->sysname, "Linux");
56 strcpy(name->nodename, "m5.eecs.umich.edu");
57 strcpy(name->release, "2.4.20");
58 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
59 strcpy(name->machine, "alpha");
60
61 name.copyOut(tc->getMemPort());
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
51 ThreadContext *tc)
52{
53 TypedBufferArg<Linux::utsname> name(tc->getSyscallArg(0));
54
55 strcpy(name->sysname, "Linux");
56 strcpy(name->nodename, "m5.eecs.umich.edu");
57 strcpy(name->release, "2.4.20");
58 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
59 strcpy(name->machine, "alpha");
60
61 name.copyOut(tc->getMemPort());
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, Process *process,
69osf_getsysinfoFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
70 ThreadContext *tc)
71{
72 unsigned op = tc->getSyscallArg(0);
73 // unsigned nbytes = tc->getSyscallArg(2);
74
75 switch (op) {
76
77 case 45: { // GSI_IEEE_FP_CONTROL

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

88 break;
89 }
90
91 return 1;
92}
93
94/// Target osf_setsysinfo() handler.
95static SyscallReturn
70 ThreadContext *tc)
71{
72 unsigned op = tc->getSyscallArg(0);
73 // unsigned nbytes = tc->getSyscallArg(2);
74
75 switch (op) {
76
77 case 45: { // GSI_IEEE_FP_CONTROL

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

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

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

570
571AlphaLinuxProcess::AlphaLinuxProcess(const std::string &name,
572 ObjectFile *objFile,
573 System *system,
574 int stdin_fd,
575 int stdout_fd,
576 int stderr_fd,
577 std::vector<std::string> &argv,
97 ThreadContext *tc)
98{
99 unsigned op = tc->getSyscallArg(0);
100 // unsigned nbytes = tc->getSyscallArg(2);
101
102 switch (op) {
103
104 case 14: { // SSI_IEEE_FP_CONTROL

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

570
571AlphaLinuxProcess::AlphaLinuxProcess(const std::string &name,
572 ObjectFile *objFile,
573 System *system,
574 int stdin_fd,
575 int stdout_fd,
576 int stderr_fd,
577 std::vector<std::string> &argv,
578 std::vector<std::string> &envp)
578 std::vector<std::string> &envp,
579 uint64_t _uid,
580 uint64_t _euid,
581 uint64_t _gid,
582 uint64_t _egid,
583 uint64_t _pid,
584 uint64_t _ppid)
579 : AlphaLiveProcess(name, objFile, system, stdin_fd, stdout_fd,
585 : AlphaLiveProcess(name, objFile, system, stdin_fd, stdout_fd,
580 stderr_fd, argv, envp),
586 stderr_fd, argv, envp, _uid, _euid, _gid, _egid, _pid, _ppid),
581 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
582{
583 //init_regs->intRegFile[0] = 0;
584}
585
586
587
588SyscallDesc*
589AlphaLinuxProcess::getDesc(int callnum)
590{
591 if (callnum < 0 || callnum > Num_Syscall_Descs)
592 return NULL;
593 return &syscallDescs[callnum];
594}
587 Num_Syscall_Descs(sizeof(syscallDescs) / sizeof(SyscallDesc))
588{
589 //init_regs->intRegFile[0] = 0;
590}
591
592
593
594SyscallDesc*
595AlphaLinuxProcess::getDesc(int callnum)
596{
597 if (callnum < 0 || callnum > Num_Syscall_Descs)
598 return NULL;
599 return &syscallDescs[callnum];
600}