Deleted Added
sdiff udiff text old ( 6640:30d92d2b66a1 ) new ( 6701:4842482e1bd1 )
full compact
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007-2008 The Florida State University
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

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

45using namespace std;
46using namespace ArmISA;
47
48/// Target uname() handler.
49static SyscallReturn
50unameFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
51 ThreadContext *tc)
52{
53 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, 0));
54
55 strcpy(name->sysname, "Linux");
56 strcpy(name->nodename, "m5.eecs.umich.edu");
57 strcpy(name->release, "2.6.16.19");
58 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003");
59 strcpy(name->machine, "arm");
60
61 name.copyOut(tc->getMemPort());

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

412 /* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc),
413};
414
415/// Target set_tls() handler.
416static SyscallReturn
417setTLSFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
418 ThreadContext *tc)
419{
420 uint32_t tlsPtr = process->getSyscallArg(tc, 0);
421
422 tc->getMemPort()->writeBlob(ArmLinuxProcess::commPage + 0x0ff0,
423 (uint8_t *)&tlsPtr, sizeof(tlsPtr));
424 return 0;
425}
426
427SyscallDesc ArmLinuxProcess::privSyscallDescs[] = {
428 /* 1 */ SyscallDesc("breakpoint", unimplementedFunc),

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

506 {
507 0x08, 0x00, 0x9f, 0xe5, //ldr r0, [pc, #(16 - 8)]
508 0x0e, 0xf0, 0xa0, 0xe1 //usr_ret lr
509 };
510 tc->getMemPort()->writeBlob(commPage + 0x0fe0, get_tls, sizeof(get_tls));
511}
512
513ArmISA::IntReg
514ArmLinuxProcess::getSyscallArg(ThreadContext *tc, int i)
515{
516 // Linux apparently allows more parameter than the ABI says it should.
517 // This limit may need to be increased even further.
518 assert(i < 6);
519 return tc->readIntReg(ArgumentReg0 + i);
520}
521
522void
523ArmLinuxProcess::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val)
524{
525 // Linux apparently allows more parameter than the ABI says it should.
526 // This limit may need to be increased even further.
527 assert(i < 6);
528 tc->setIntReg(ArgumentReg0 + i, val);
529}