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 int index = 0; 54 TypedBufferArg<Linux::utsname> name(process->getSyscallArg(tc, index)); |
55 56 strcpy(name->sysname, "Linux"); 57 strcpy(name->nodename, "m5.eecs.umich.edu"); 58 strcpy(name->release, "2.6.16.19"); 59 strcpy(name->version, "#1 Mon Aug 18 11:32:15 EDT 2003"); 60 strcpy(name->machine, "arm"); 61 62 name.copyOut(tc->getMemPort()); --- 350 unchanged lines hidden (view full) --- 413 /* 346 */ SyscallDesc("epoll_pwait", unimplementedFunc), 414}; 415 416/// Target set_tls() handler. 417static SyscallReturn 418setTLSFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 419 ThreadContext *tc) 420{ |
421 int index = 0; 422 uint32_t tlsPtr = process->getSyscallArg(tc, index); |
423 424 tc->getMemPort()->writeBlob(ArmLinuxProcess::commPage + 0x0ff0, 425 (uint8_t *)&tlsPtr, sizeof(tlsPtr)); 426 return 0; 427} 428 429SyscallDesc ArmLinuxProcess::privSyscallDescs[] = { 430 /* 1 */ SyscallDesc("breakpoint", unimplementedFunc), --- 77 unchanged lines hidden (view full) --- 508 { 509 0x08, 0x00, 0x9f, 0xe5, //ldr r0, [pc, #(16 - 8)] 510 0x0e, 0xf0, 0xa0, 0xe1 //usr_ret lr 511 }; 512 tc->getMemPort()->writeBlob(commPage + 0x0fe0, get_tls, sizeof(get_tls)); 513} 514 515ArmISA::IntReg |
516ArmLinuxProcess::getSyscallArg(ThreadContext *tc, int &i) |
517{ 518 // Linux apparently allows more parameter than the ABI says it should. 519 // This limit may need to be increased even further. 520 assert(i < 6); |
521 return tc->readIntReg(ArgumentReg0 + i++); |
522} 523 524void 525ArmLinuxProcess::setSyscallArg(ThreadContext *tc, int i, ArmISA::IntReg val) 526{ 527 // Linux apparently allows more parameter than the ABI says it should. 528 // This limit may need to be increased even further. 529 assert(i < 6); 530 tc->setIntReg(ArgumentReg0 + i, val); 531} |