blob: 5a048c58277182339dc01828a7d5f135e5484e85 [file] [log] [blame]
/*
* Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
* All rights reserved.
*
* This software was developed by the University of Cambridge Computer
* Laboratory as part of the CTSRD Project, with support from the UK Higher
* Education Innovation Fund (HEIF).
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer;
* redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution;
* neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "arch/arm/freebsd/process.hh"
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/syscall.h>
#if !defined ( __GNU_LIBRARY__ )
#include <sys/sysctl.h>
#endif
#include <sys/types.h>
#include <utime.h>
#include "arch/arm/freebsd/freebsd.hh"
#include "arch/arm/isa_traits.hh"
#include "base/loader/object_file.hh"
#include "base/trace.hh"
#include "cpu/thread_context.hh"
#include "kern/freebsd/freebsd.hh"
#include "sim/process.hh"
#include "sim/syscall_desc.hh"
#include "sim/syscall_emul.hh"
#include "sim/system.hh"
using namespace std;
using namespace ArmISA;
namespace
{
class ArmFreebsdObjectFileLoader : public Process::Loader
{
public:
Process *
load(ProcessParams *params, ObjectFile *obj_file) override
{
auto arch = obj_file->getArch();
auto opsys = obj_file->getOpSys();
if (arch != ObjectFile::Arm && arch != ObjectFile::Thumb &&
arch != ObjectFile::Arm64) {
return nullptr;
}
if (opsys != ObjectFile::FreeBSD)
return nullptr;
if (arch == ObjectFile::Arm64)
return new ArmFreebsdProcess64(params, obj_file, arch);
else
return new ArmFreebsdProcess32(params, obj_file, arch);
}
};
ArmFreebsdObjectFileLoader loader;
} // anonymous namespace
static SyscallReturn
issetugidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
return 0;
}
#if !defined ( __GNU_LIBRARY__ )
static SyscallReturn
sysctlFunc(SyscallDesc *desc, int callnum, ThreadContext *tc)
{
int index = 0;
uint64_t ret;
auto process = tc->getProcessPtr();
Addr namep = process->getSyscallArg(tc, index);
size_t namelen = process->getSyscallArg(tc, index);
Addr oldp = process->getSyscallArg(tc, index);
Addr oldlenp = process->getSyscallArg(tc, index);
Addr newp = process->getSyscallArg(tc, index);
size_t newlen = process->getSyscallArg(tc, index);
BufferArg buf(namep, sizeof(size_t));
BufferArg buf2(oldp, sizeof(size_t));
BufferArg buf3(oldlenp, sizeof(size_t));
BufferArg buf4(newp, sizeof(size_t));
buf.copyIn(tc->getVirtProxy());
buf2.copyIn(tc->getVirtProxy());
buf3.copyIn(tc->getVirtProxy());
void *hnewp = NULL;
if (newp) {
buf4.copyIn(tc->getVirtProxy());
hnewp = (void *)buf4.bufferPtr();
}
uint32_t *hnamep = (uint32_t *)buf.bufferPtr();
void *holdp = (void *)buf2.bufferPtr();
size_t *holdlenp = (size_t *)buf3.bufferPtr();
ret = sysctl((int *)hnamep, namelen, holdp, holdlenp, hnewp, newlen);
buf.copyOut(tc->getVirtProxy());
buf2.copyOut(tc->getVirtProxy());
buf3.copyOut(tc->getVirtProxy());
if (newp)
buf4.copyOut(tc->getVirtProxy());
return (ret);
}
#endif
static SyscallDescABI<DefaultSyscallABI> syscallDescs32[] = {
/* 0 */ { "unused#000" },
/* 1 */ { "unused#001" },
/* 2 */ { "unused#002" },
/* 3 */ { "unused#003" },
/* 4 */ { "unused#004" },
/* 5 */ { "unused#005" },
/* 6 */ { "unused#006" },
/* 7 */ { "unused#007" },
/* 8 */ { "unused#008" },
/* 9 */ { "unused#009" },
/* 10 */ { "unused#010" },
/* 11 */ { "unused#011" },
/* 12 */ { "unused#012" },
/* 13 */ { "unused#013" },
/* 14 */ { "unused#014" },
/* 15 */ { "unused#015" },
/* 16 */ { "unused#016" },
/* 17 */ { "unused#017" },
/* 18 */ { "unused#018" },
/* 19 */ { "unused#019" },
/* 20 */ { "unused#020" },
/* 21 */ { "unused#021" },
/* 22 */ { "unused#022" },
/* 23 */ { "unused#023" },
/* 24 */ { "unused#024" },
/* 25 */ { "unused#025" },
/* 26 */ { "unused#026" },
/* 27 */ { "unused#027" },
/* 28 */ { "unused#028" },
/* 29 */ { "unused#029" },
/* 30 */ { "unused#030" },
/* 31 */ { "unused#031" },
/* 32 */ { "unused#032" },
/* 33 */ { "unused#033" },
/* 34 */ { "unused#034" },
/* 35 */ { "unused#035" },
/* 36 */ { "unused#036" },
/* 37 */ { "unused#037" },
/* 38 */ { "unused#038" },
/* 39 */ { "unused#039" },
/* 40 */ { "unused#040" },
/* 41 */ { "unused#041" },
/* 42 */ { "unused#042" },
/* 43 */ { "unused#043" },
/* 44 */ { "unused#044" },
/* 45 */ { "unused#045" },
/* 46 */ { "unused#046" },
/* 47 */ { "unused#047" },
/* 48 */ { "unused#048" },
/* 49 */ { "unused#049" },
/* 50 */ { "unused#050" },
/* 51 */ { "unused#051" },
/* 52 */ { "unused#052" },
/* 53 */ { "unused#053" },
/* 54 */ { "unused#054" },
/* 55 */ { "unused#055" },
/* 56 */ { "unused#056" },
/* 57 */ { "unused#057" },
/* 58 */ { "unused#058" },
/* 59 */ { "unused#059" },
/* 60 */ { "unused#060" },
/* 61 */ { "unused#061" },
/* 62 */ { "unused#062" },
/* 63 */ { "unused#063" },
/* 64 */ { "unused#064" },
/* 65 */ { "unused#065" },
/* 66 */ { "unused#066" },
/* 67 */ { "unused#067" },
/* 68 */ { "unused#068" },
/* 69 */ { "unused#069" },
/* 70 */ { "unused#070" },
/* 71 */ { "unused#071" },
/* 72 */ { "unused#072" },
/* 73 */ { "unused#073" },
/* 74 */ { "unused#074" },
/* 75 */ { "unused#075" },
/* 76 */ { "unused#076" },
/* 77 */ { "unused#077" },
/* 78 */ { "unused#078" },
/* 79 */ { "unused#079" },
/* 80 */ { "unused#080" },
/* 81 */ { "unused#081" },
/* 82 */ { "unused#082" },
/* 83 */ { "unused#083" },
/* 84 */ { "unused#084" },
/* 85 */ { "unused#085" },
/* 86 */ { "unused#086" },
/* 87 */ { "unused#087" },
/* 88 */ { "unused#088" },
/* 89 */ { "unused#089" },
/* 90 */ { "unused#090" },
/* 91 */ { "unused#091" },
/* 92 */ { "unused#092" },
/* 93 */ { "unused#093" },
/* 94 */ { "unused#094" },
/* 95 */ { "unused#095" },
/* 96 */ { "unused#096" },
/* 97 */ { "unused#097" },
/* 98 */ { "unused#098" },
/* 99 */ { "unused#099" },
/* 100 */ { "unused#100" },
/* 101 */ { "unused#101" },
/* 102 */ { "unused#102" },
/* 103 */ { "unused#103" },
/* 104 */ { "unused#104" },
/* 105 */ { "unused#105" },
/* 106 */ { "unused#106" },
/* 107 */ { "unused#107" },
/* 108 */ { "unused#108" },
/* 109 */ { "unused#109" },
/* 110 */ { "unused#110" },
/* 111 */ { "unused#111" },
/* 112 */ { "unused#112" },
/* 113 */ { "unused#113" },
/* 114 */ { "unused#114" },
/* 115 */ { "unused#115" },
/* 116 */ { "unused#116" },
/* 117 */ { "unused#117" },
/* 118 */ { "unused#118" },
/* 119 */ { "unused#119" },
/* 120 */ { "unused#120" },
/* 121 */ { "unused#121" },
/* 122 */ { "unused#122" },
/* 123 */ { "unused#123" },
/* 124 */ { "unused#124" },
/* 125 */ { "unused#125" },
/* 126 */ { "unused#126" },
/* 127 */ { "unused#127" },
/* 128 */ { "unused#128" },
/* 129 */ { "unused#129" },
/* 130 */ { "unused#130" },
/* 131 */ { "unused#131" },
/* 132 */ { "unused#132" },
/* 133 */ { "unused#133" },
/* 134 */ { "unused#134" },
/* 135 */ { "unused#135" },
/* 136 */ { "unused#136" },
/* 137 */ { "unused#137" },
/* 138 */ { "unused#138" },
/* 139 */ { "unused#139" },
/* 140 */ { "unused#140" },
/* 141 */ { "unused#141" },
/* 142 */ { "unused#142" },
/* 143 */ { "unused#143" },
/* 144 */ { "unused#144" },
/* 145 */ { "unused#145" },
/* 146 */ { "unused#146" },
/* 147 */ { "unused#147" },
/* 148 */ { "unused#148" },
/* 149 */ { "unused#149" },
/* 150 */ { "unused#150" },
/* 151 */ { "unused#151" },
/* 152 */ { "unused#152" },
/* 153 */ { "unused#153" },
/* 154 */ { "unused#154" },
/* 155 */ { "unused#155" },
/* 156 */ { "unused#156" },
/* 157 */ { "unused#157" },
/* 158 */ { "unused#158" },
/* 159 */ { "unused#159" },
/* 160 */ { "unused#160" },
/* 161 */ { "unused#161" },
/* 162 */ { "unused#162" },
/* 163 */ { "unused#163" },
/* 164 */ { "unused#164" },
/* 165 */ { "unused#165" },
/* 166 */ { "unused#166" },
/* 167 */ { "unused#167" },
/* 168 */ { "unused#168" },
/* 169 */ { "unused#169" },
/* 170 */ { "unused#170" },
/* 171 */ { "unused#171" },
/* 172 */ { "unused#172" },
/* 173 */ { "unused#173" },
/* 174 */ { "unused#174" },
/* 175 */ { "unused#175" },
/* 176 */ { "unused#176" },
/* 177 */ { "unused#177" },
/* 178 */ { "unused#178" },
/* 179 */ { "unused#179" },
/* 180 */ { "unused#180" },
/* 181 */ { "unused#181" },
/* 182 */ { "unused#182" },
/* 183 */ { "unused#183" },
/* 184 */ { "unused#184" },
/* 185 */ { "unused#185" },
/* 186 */ { "unused#186" },
/* 187 */ { "unused#187" },
/* 188 */ { "unused#188" },
/* 189 */ { "unused#189" },
/* 190 */ { "unused#190" },
/* 191 */ { "unused#191" },
/* 192 */ { "unused#192" },
/* 193 */ { "unused#193" },
/* 194 */ { "unused#194" },
/* 195 */ { "unused#195" },
/* 196 */ { "unused#196" },
/* 197 */ { "unused#197" },
/* 198 */ { "unused#198" },
/* 199 */ { "unused#199" },
/* 200 */ { "unused#200" },
/* 201 */ { "unused#201" },
/* 202 */ { "unused#202" },
/* 203 */ { "unused#203" },
/* 204 */ { "unused#204" },
/* 205 */ { "unused#205" },
/* 206 */ { "unused#206" },
/* 207 */ { "unused#207" },
/* 208 */ { "unused#208" },
/* 209 */ { "unused#209" },
/* 210 */ { "unused#210" },
/* 211 */ { "unused#211" },
/* 212 */ { "unused#212" },
/* 213 */ { "unused#213" },
/* 214 */ { "unused#214" },
/* 215 */ { "unused#215" },
/* 216 */ { "unused#216" },
/* 217 */ { "unused#217" },
/* 218 */ { "unused#218" },
/* 219 */ { "unused#219" },
/* 220 */ { "unused#220" },
/* 221 */ { "unused#221" },
/* 222 */ { "unused#222" },
/* 223 */ { "unused#223" },
/* 224 */ { "unused#224" },
/* 225 */ { "unused#225" },
/* 226 */ { "unused#226" },
/* 227 */ { "unused#227" },
/* 228 */ { "unused#228" },
/* 229 */ { "unused#229" },
/* 230 */ { "unused#230" },
/* 231 */ { "unused#231" },
/* 232 */ { "unused#232" },
/* 233 */ { "unused#233" },
/* 234 */ { "unused#234" },
/* 235 */ { "unused#235" },
/* 236 */ { "unused#236" },
/* 237 */ { "unused#237" },
/* 238 */ { "unused#238" },
/* 239 */ { "unused#239" },
/* 240 */ { "unused#240" },
/* 241 */ { "unused#241" },
/* 242 */ { "unused#242" },
/* 243 */ { "unused#243" },
/* 244 */ { "unused#244" },
/* 245 */ { "unused#245" },
/* 246 */ { "unused#246" },
/* 247 */ { "unused#247" },
/* 248 */ { "unused#248" },
/* 249 */ { "unused#249" },
/* 250 */ { "unused#250" },
/* 251 */ { "unused#251" },
/* 252 */ { "unused#252" },
/* 253 */ { "unused#253" },
/* 254 */ { "unused#254" },
/* 255 */ { "unused#255" },
/* 256 */ { "unused#256" },
/* 257 */ { "unused#257" },
/* 258 */ { "unused#258" },
/* 259 */ { "unused#259" },
/* 260 */ { "unused#260" },
/* 261 */ { "unused#261" },
/* 262 */ { "unused#262" },
/* 263 */ { "unused#263" },
/* 264 */ { "unused#264" },
/* 265 */ { "unused#265" },
/* 266 */ { "unused#266" },
/* 267 */ { "unused#267" },
/* 268 */ { "unused#268" },
/* 269 */ { "unused#269" },
/* 270 */ { "unused#270" },
/* 271 */ { "unused#271" },
/* 272 */ { "unused#272" },
/* 273 */ { "unused#273" },
/* 274 */ { "unused#274" },
/* 275 */ { "unused#275" },
/* 276 */ { "unused#276" },
/* 277 */ { "unused#277" },
/* 278 */ { "unused#278" },
/* 279 */ { "unused#279" },
/* 280 */ { "unused#280" },
/* 281 */ { "unused#281" },
/* 282 */ { "unused#282" },
/* 283 */ { "unused#283" },
/* 284 */ { "unused#284" },
/* 285 */ { "unused#285" },
/* 286 */ { "unused#286" },
/* 287 */ { "unused#287" },
/* 288 */ { "unused#288" },
/* 289 */ { "unused#289" },
/* 290 */ { "unused#290" },
/* 291 */ { "unused#291" },
/* 292 */ { "unused#292" },
/* 293 */ { "unused#293" },
/* 294 */ { "unused#294" },
/* 295 */ { "unused#295" },
/* 296 */ { "unused#296" },
/* 297 */ { "unused#297" },
/* 298 */ { "unused#298" },
/* 299 */ { "unused#299" },
/* 300 */ { "unused#300" },
/* 301 */ { "unused#301" },
/* 302 */ { "unused#302" },
/* 303 */ { "unused#303" },
/* 304 */ { "unused#304" },
/* 305 */ { "unused#305" },
/* 306 */ { "unused#306" },
/* 307 */ { "unused#307" },
/* 308 */ { "unused#308" },
/* 309 */ { "unused#309" },
/* 310 */ { "unused#310" },
/* 311 */ { "unused#311" },
/* 312 */ { "unused#312" },
/* 313 */ { "unused#313" },
/* 314 */ { "unused#314" },
/* 315 */ { "unused#315" },
/* 316 */ { "unused#316" },
/* 317 */ { "unused#317" },
/* 318 */ { "unused#318" },
/* 319 */ { "unused#319" },
/* 320 */ { "unused#320" },
/* 321 */ { "unused#321" },
/* 322 */ { "unused#322" },
/* 323 */ { "unused#323" },
/* 324 */ { "unused#324" },
/* 325 */ { "unused#325" },
/* 326 */ { "unused#326" },
/* 327 */ { "unused#327" },
/* 328 */ { "unused#328" },
/* 329 */ { "unused#329" },
/* 330 */ { "unused#330" },
/* 331 */ { "unused#331" },
/* 332 */ { "unused#332" },
/* 333 */ { "unused#333" },
/* 334 */ { "unused#334" },
/* 335 */ { "unused#335" },
/* 336 */ { "unused#336" },
/* 337 */ { "unused#337" },
/* 338 */ { "unused#338" },
/* 339 */ { "unused#339" },
/* 340 */ { "unused#340" },
/* 341 */ { "unused#341" },
/* 342 */ { "unused#342" },
/* 343 */ { "unused#343" },
/* 344 */ { "unused#344" },
/* 345 */ { "unused#345" },
/* 346 */ { "unused#346" },
/* 347 */ { "unused#347" },
/* 348 */ { "unused#348" },
/* 349 */ { "unused#349" },
/* 350 */ { "unused#350" },
/* 351 */ { "unused#351" },
/* 352 */ { "unused#352" },
/* 353 */ { "unused#353" },
/* 354 */ { "unused#354" },
/* 355 */ { "unused#355" },
/* 356 */ { "unused#356" },
/* 357 */ { "unused#357" },
/* 358 */ { "unused#358" },
/* 359 */ { "unused#359" },
/* 360 */ { "unused#360" },
/* 361 */ { "unused#361" },
/* 362 */ { "unused#362" },
/* 363 */ { "unused#363" },
/* 364 */ { "unused#364" },
/* 365 */ { "unused#365" },
/* 366 */ { "unused#366" },
/* 367 */ { "unused#367" },
/* 368 */ { "unused#368" },
/* 369 */ { "unused#369" },
/* 370 */ { "unused#370" },
/* 371 */ { "unused#371" },
/* 372 */ { "unused#372" },
/* 373 */ { "unused#373" },
/* 374 */ { "unused#374" },
/* 375 */ { "unused#375" },
/* 376 */ { "unused#376" },
/* 377 */ { "unused#377" },
/* 378 */ { "unused#378" },
/* 379 */ { "unused#379" },
/* 380 */ { "unused#380" },
/* 381 */ { "unused#381" },
/* 382 */ { "unused#382" },
/* 383 */ { "unused#383" },
/* 384 */ { "unused#384" },
/* 385 */ { "unused#385" },
/* 386 */ { "unused#386" },
/* 387 */ { "unused#387" },
/* 388 */ { "unused#388" },
/* 389 */ { "unused#389" },
/* 390 */ { "unused#390" },
/* 391 */ { "unused#391" },
/* 392 */ { "unused#392" },
/* 393 */ { "unused#393" },
/* 394 */ { "unused#394" },
/* 395 */ { "unused#395" },
/* 396 */ { "unused#396" },
/* 397 */ { "unused#397" },
/* 398 */ { "unused#398" },
/* 399 */ { "unused#399" },
/* 400 */ { "unused#400" },
/* 401 */ { "unused#401" },
/* 402 */ { "unused#402" },
/* 403 */ { "unused#403" },
/* 404 */ { "unused#404" },
/* 405 */ { "unused#405" },
/* 406 */ { "unused#406" },
/* 407 */ { "unused#407" },
/* 408 */ { "unused#408" },
/* 409 */ { "unused#409" },
/* 410 */ { "unused#410" },
/* 411 */ { "unused#411" },
/* 412 */ { "unused#412" },
/* 413 */ { "unused#413" },
/* 414 */ { "unused#414" },
/* 415 */ { "unused#415" },
/* 416 */ { "unused#416" },
/* 417 */ { "unused#417" },
/* 418 */ { "unused#418" },
/* 419 */ { "unused#419" },
/* 420 */ { "unused#420" },
/* 421 */ { "unused#421" },
/* 422 */ { "unused#422" },
/* 423 */ { "unused#423" },
/* 424 */ { "unused#424" },
/* 425 */ { "unused#425" },
/* 426 */ { "unused#426" },
/* 427 */ { "unused#427" },
/* 428 */ { "unused#428" },
/* 429 */ { "unused#429" },
/* 430 */ { "unused#430" },
/* 431 */ { "unused#431" },
/* 432 */ { "unused#432" },
/* 433 */ { "unused#433" },
/* 434 */ { "unused#434" },
/* 435 */ { "unused#435" },
/* 436 */ { "unused#436" },
/* 437 */ { "unused#437" },
/* 438 */ { "unused#438" },
/* 439 */ { "unused#439" },
/* 440 */ { "unused#440" },
/* 441 */ { "unused#441" },
/* 442 */ { "unused#442" },
/* 443 */ { "unused#443" },
/* 444 */ { "unused#444" },
/* 445 */ { "unused#445" },
/* 446 */ { "unused#446" },
/* 447 */ { "unused#447" },
/* 448 */ { "unused#448" },
/* 449 */ { "unused#449" },
/* 450 */ { "unused#450" },
/* 451 */ { "unused#451" },
/* 452 */ { "unused#452" },
/* 453 */ { "unused#453" },
/* 454 */ { "unused#454" },
/* 455 */ { "unused#455" },
/* 456 */ { "unused#456" },
/* 457 */ { "unused#457" },
/* 458 */ { "unused#458" },
/* 459 */ { "unused#459" },
/* 460 */ { "unused#460" },
/* 461 */ { "unused#461" },
/* 462 */ { "unused#462" },
/* 463 */ { "unused#463" },
/* 464 */ { "unused#464" },
/* 465 */ { "unused#465" },
/* 466 */ { "unused#466" },
/* 467 */ { "unused#467" },
/* 468 */ { "unused#468" },
/* 469 */ { "unused#469" },
/* 470 */ { "unused#470" },
/* 471 */ { "unused#471" },
/* 472 */ { "unused#472" },
/* 473 */ { "unused#473" },
/* 474 */ { "unused#474" },
/* 475 */ { "unused#475" },
/* 476 */ { "unused#476" },
/* 477 */ { "unused#477" },
/* 478 */ { "unused#478" },
/* 479 */ { "unused#479" },
/* 480 */ { "unused#480" },
/* 481 */ { "unused#481" },
/* 482 */ { "unused#482" },
/* 483 */ { "unused#483" },
/* 484 */ { "unused#484" },
/* 485 */ { "unused#485" },
/* 486 */ { "unused#486" },
/* 487 */ { "unused#487" },
/* 488 */ { "unused#488" },
/* 489 */ { "unused#489" },
/* 490 */ { "unused#490" },
/* 491 */ { "unused#491" },
/* 492 */ { "unused#492" },
/* 493 */ { "unused#493" },
/* 494 */ { "unused#494" },
/* 495 */ { "unused#495" },
/* 496 */ { "unused#496" },
/* 497 */ { "unused#497" },
/* 498 */ { "unused#498" },
/* 499 */ { "unused#499" },
/* 500 */ { "unused#500" },
/* 501 */ { "unused#501" },
/* 502 */ { "unused#502" },
/* 503 */ { "unused#503" },
/* 504 */ { "unused#504" },
/* 505 */ { "unused#505" },
/* 506 */ { "unused#506" },
/* 507 */ { "unused#507" },
/* 508 */ { "unused#508" },
/* 509 */ { "unused#509" },
/* 510 */ { "unused#510" },
/* 511 */ { "unused#511" },
/* 512 */ { "unused#512" },
/* 513 */ { "unused#513" },
/* 514 */ { "unused#514" },
/* 515 */ { "unused#515" },
/* 516 */ { "unused#516" },
/* 517 */ { "unused#517" },
/* 518 */ { "unused#518" },
/* 519 */ { "unused#519" },
/* 520 */ { "unused#520" },
/* 521 */ { "unused#521" },
/* 522 */ { "unused#522" },
/* 523 */ { "unused#523" },
/* 524 */ { "unused#524" },
/* 525 */ { "unused#525" },
/* 526 */ { "unused#526" },
/* 527 */ { "unused#527" },
/* 528 */ { "unused#528" },
/* 529 */ { "unused#529" },
/* 530 */ { "unused#530" },
/* 531 */ { "unused#531" },
/* 532 */ { "unused#532" },
/* 533 */ { "unused#533" },
/* 534 */ { "unused#534" },
/* 535 */ { "unused#535" },
/* 536 */ { "unused#536" },
/* 537 */ { "unused#537" },
/* 538 */ { "unused#538" },
/* 539 */ { "unused#539" },
/* 540 */ { "unused#540" },
/* 541 */ { "unused#541" },
/* 542 */ { "unused#542" },
/* 543 */ { "unused#543" },
/* 544 */ { "unused#544" },
/* 545 */ { "unused#545" },
/* 546 */ { "unused#546" },
/* 547 */ { "unused#547" },
};
static SyscallDescABI<DefaultSyscallABI> syscallDescs64[] = {
/* 0 */ { "unused#000" },
/* 1 */ { "exit", exitFunc },
/* 2 */ { "unused#002" },
/* 3 */ { "read", readFunc<ArmFreebsd64> },
/* 4 */ { "write", writeFunc<ArmFreebsd64> },
/* 5 */ { "unused#005" },
/* 6 */ { "unused#006" },
/* 7 */ { "unused#007" },
/* 8 */ { "unused#008" },
/* 9 */ { "unused#009" },
/* 10 */ { "unused#010" },
/* 11 */ { "unused#011" },
/* 12 */ { "unused#012" },
/* 13 */ { "unused#013" },
/* 14 */ { "unused#014" },
/* 15 */ { "unused#015" },
/* 16 */ { "unused#016" },
/* 17 */ { "obreak", brkFunc },
/* 18 */ { "unused#018" },
/* 19 */ { "unused#019" },
/* 20 */ { "unused#020" },
/* 21 */ { "unused#021" },
/* 22 */ { "unused#022" },
/* 23 */ { "unused#023" },
/* 24 */ { "unused#024" },
/* 25 */ { "unused#025" },
/* 26 */ { "unused#026" },
/* 27 */ { "unused#027" },
/* 28 */ { "unused#028" },
/* 29 */ { "unused#029" },
/* 30 */ { "unused#030" },
/* 31 */ { "unused#031" },
/* 32 */ { "unused#032" },
/* 33 */ { "unused#033" },
/* 34 */ { "unused#034" },
/* 35 */ { "unused#035" },
/* 36 */ { "unused#036" },
/* 37 */ { "unused#037" },
/* 38 */ { "unused#038" },
/* 39 */ { "unused#039" },
/* 40 */ { "unused#040" },
/* 41 */ { "unused#041" },
/* 42 */ { "unused#042" },
/* 43 */ { "unused#043" },
/* 44 */ { "unused#044" },
/* 45 */ { "unused#045" },
/* 46 */ { "unused#046" },
/* 47 */ { "unused#047" },
/* 48 */ { "unused#048" },
/* 49 */ { "unused#049" },
/* 50 */ { "unused#050" },
/* 51 */ { "unused#051" },
/* 52 */ { "unused#052" },
/* 53 */ { "unused#053" },
/* 54 */ { "ioctl", ioctlFunc<ArmFreebsd64> },
/* 55 */ { "unused#055" },
/* 56 */ { "unused#056" },
/* 57 */ { "unused#057" },
/* 58 */ { "readlink", readlinkFunc },
/* 59 */ { "unused#059" },
/* 60 */ { "unused#060" },
/* 61 */ { "unused#061" },
/* 62 */ { "unused#062" },
/* 63 */ { "unused#063" },
/* 64 */ { "unused#064" },
/* 65 */ { "unused#065" },
/* 66 */ { "unused#066" },
/* 67 */ { "unused#067" },
/* 68 */ { "unused#068" },
/* 69 */ { "unused#069" },
/* 70 */ { "unused#070" },
/* 71 */ { "unused#071" },
/* 72 */ { "unused#072" },
/* 73 */ { "unused#073" },
/* 74 */ { "unused#074" },
/* 75 */ { "unused#075" },
/* 76 */ { "unused#076" },
/* 77 */ { "unused#077" },
/* 78 */ { "unused#078" },
/* 79 */ { "unused#079" },
/* 80 */ { "unused#080" },
/* 81 */ { "unused#081" },
/* 82 */ { "unused#082" },
/* 83 */ { "unused#083" },
/* 84 */ { "unused#084" },
/* 85 */ { "unused#085" },
/* 86 */ { "unused#086" },
/* 87 */ { "unused#087" },
/* 88 */ { "unused#088" },
/* 89 */ { "unused#089" },
/* 90 */ { "unused#090" },
/* 91 */ { "unused#091" },
/* 92 */ { "unused#092" },
/* 93 */ { "unused#093" },
/* 94 */ { "unused#094" },
/* 95 */ { "unused#095" },
/* 96 */ { "unused#096" },
/* 97 */ { "unused#097" },
/* 98 */ { "unused#098" },
/* 99 */ { "unused#099" },
/* 100 */ { "unused#100" },
/* 101 */ { "unused#101" },
/* 102 */ { "unused#102" },
/* 103 */ { "unused#103" },
/* 104 */ { "unused#104" },
/* 105 */ { "unused#105" },
/* 106 */ { "unused#106" },
/* 107 */ { "unused#107" },
/* 108 */ { "unused#108" },
/* 109 */ { "unused#109" },
/* 110 */ { "unused#110" },
/* 111 */ { "unused#111" },
/* 112 */ { "unused#112" },
/* 113 */ { "unused#113" },
/* 114 */ { "unused#114" },
/* 115 */ { "unused#115" },
/* 116 */ { "unused#116" },
/* 117 */ { "getrusage", getrusageFunc<ArmFreebsd64> },
/* 118 */ { "unused#118" },
/* 119 */ { "unused#119" },
/* 120 */ { "unused#120" },
/* 121 */ { "unused#121" },
/* 122 */ { "unused#122" },
/* 123 */ { "unused#123" },
/* 124 */ { "unused#124" },
/* 125 */ { "unused#125" },
/* 126 */ { "unused#126" },
/* 127 */ { "unused#127" },
/* 128 */ { "unused#128" },
/* 129 */ { "unused#129" },
/* 130 */ { "unused#130" },
/* 131 */ { "unused#131" },
/* 132 */ { "unused#132" },
/* 133 */ { "unused#133" },
/* 134 */ { "unused#134" },
/* 135 */ { "unused#135" },
/* 136 */ { "unused#136" },
/* 137 */ { "unused#137" },
/* 138 */ { "unused#138" },
/* 139 */ { "unused#139" },
/* 140 */ { "unused#140" },
/* 141 */ { "unused#141" },
/* 142 */ { "unused#142" },
/* 143 */ { "unused#143" },
/* 144 */ { "unused#144" },
/* 145 */ { "unused#145" },
/* 146 */ { "unused#146" },
/* 147 */ { "unused#147" },
/* 148 */ { "unused#148" },
/* 149 */ { "unused#149" },
/* 150 */ { "unused#150" },
/* 151 */ { "unused#151" },
/* 152 */ { "unused#152" },
/* 153 */ { "unused#153" },
/* 154 */ { "unused#154" },
/* 155 */ { "unused#155" },
/* 156 */ { "unused#156" },
/* 157 */ { "unused#157" },
/* 158 */ { "unused#158" },
/* 159 */ { "unused#159" },
/* 160 */ { "unused#160" },
/* 161 */ { "unused#161" },
/* 162 */ { "unused#162" },
/* 163 */ { "unused#163" },
/* 164 */ { "unused#164" },
/* 165 */ { "unused#165" },
/* 166 */ { "unused#166" },
/* 167 */ { "unused#167" },
/* 168 */ { "unused#168" },
/* 169 */ { "unused#169" },
/* 170 */ { "unused#170" },
/* 171 */ { "unused#171" },
/* 172 */ { "unused#172" },
/* 173 */ { "unused#173" },
/* 174 */ { "unused#174" },
/* 175 */ { "unused#175" },
/* 176 */ { "unused#176" },
/* 177 */ { "unused#177" },
/* 178 */ { "unused#178" },
/* 179 */ { "unused#179" },
/* 180 */ { "unused#180" },
/* 181 */ { "unused#181" },
/* 182 */ { "unused#182" },
/* 183 */ { "unused#183" },
/* 184 */ { "unused#184" },
/* 185 */ { "unused#185" },
/* 186 */ { "unused#186" },
/* 187 */ { "unused#187" },
/* 188 */ { "unused#188" },
/* 189 */ { "fstat", fstatFunc<ArmFreebsd64> },
/* 190 */ { "unused#190" },
/* 191 */ { "unused#191" },
/* 192 */ { "unused#192" },
/* 193 */ { "unused#193" },
/* 194 */ { "unused#194" },
/* 195 */ { "unused#195" },
/* 196 */ { "unused#196" },
/* 197 */ { "unused#197" },
/* 198 */ { "unused#198" },
/* 199 */ { "unused#199" },
/* 200 */ { "unused#200" },
/* 201 */ { "unused#201" },
#if !defined ( __GNU_LIBRARY__ )
/* 202 */ { "sysctl", sysctlFunc },
#else
/* 202 */ { "sysctl" },
#endif
/* 203 */ { "unused#203" },
/* 204 */ { "unused#204" },
/* 205 */ { "unused#205" },
/* 206 */ { "unused#206" },
/* 207 */ { "unused#207" },
/* 208 */ { "unused#208" },
/* 209 */ { "unused#209" },
/* 210 */ { "unused#210" },
/* 211 */ { "unused#211" },
/* 212 */ { "unused#212" },
/* 213 */ { "unused#213" },
/* 214 */ { "unused#214" },
/* 215 */ { "unused#215" },
/* 216 */ { "unused#216" },
/* 217 */ { "unused#217" },
/* 218 */ { "unused#218" },
/* 219 */ { "unused#219" },
/* 220 */ { "unused#220" },
/* 221 */ { "unused#221" },
/* 222 */ { "unused#222" },
/* 223 */ { "unused#223" },
/* 224 */ { "unused#224" },
/* 225 */ { "unused#225" },
/* 226 */ { "unused#226" },
/* 227 */ { "unused#227" },
/* 228 */ { "unused#228" },
/* 229 */ { "unused#229" },
/* 230 */ { "unused#230" },
/* 231 */ { "unused#231" },
/* 232 */ { "unused#232" },
/* 233 */ { "unused#233" },
/* 234 */ { "unused#234" },
/* 235 */ { "unused#235" },
/* 236 */ { "unused#236" },
/* 237 */ { "unused#237" },
/* 238 */ { "unused#238" },
/* 239 */ { "unused#239" },
/* 240 */ { "unused#240" },
/* 241 */ { "unused#241" },
/* 242 */ { "unused#242" },
/* 243 */ { "unused#243" },
/* 244 */ { "unused#244" },
/* 245 */ { "unused#245" },
/* 246 */ { "unused#246" },
/* 247 */ { "unused#247" },
/* 248 */ { "unused#248" },
/* 249 */ { "unused#249" },
/* 250 */ { "unused#250" },
/* 251 */ { "unused#251" },
/* 252 */ { "unused#252" },
/* 253 */ { "issetugid", issetugidFunc },
/* 254 */ { "unused#254" },
/* 255 */ { "unused#255" },
/* 256 */ { "unused#256" },
/* 257 */ { "unused#257" },
/* 258 */ { "unused#258" },
/* 259 */ { "unused#259" },
/* 260 */ { "unused#260" },
/* 261 */ { "unused#261" },
/* 262 */ { "unused#262" },
/* 263 */ { "unused#263" },
/* 264 */ { "unused#264" },
/* 265 */ { "unused#265" },
/* 266 */ { "unused#266" },
/* 267 */ { "unused#267" },
/* 268 */ { "unused#268" },
/* 269 */ { "unused#269" },
/* 270 */ { "unused#270" },
/* 271 */ { "unused#271" },
/* 272 */ { "unused#272" },
/* 273 */ { "unused#273" },
/* 274 */ { "unused#274" },
/* 275 */ { "unused#275" },
/* 276 */ { "unused#276" },
/* 277 */ { "unused#277" },
/* 278 */ { "unused#278" },
/* 279 */ { "unused#279" },
/* 280 */ { "unused#280" },
/* 281 */ { "unused#281" },
/* 282 */ { "unused#282" },
/* 283 */ { "unused#283" },
/* 284 */ { "unused#284" },
/* 285 */ { "unused#285" },
/* 286 */ { "unused#286" },
/* 287 */ { "unused#287" },
/* 288 */ { "unused#288" },
/* 289 */ { "unused#289" },
/* 290 */ { "unused#290" },
/* 291 */ { "unused#291" },
/* 292 */ { "unused#292" },
/* 293 */ { "unused#293" },
/* 294 */ { "unused#294" },
/* 295 */ { "unused#295" },
/* 296 */ { "unused#296" },
/* 297 */ { "unused#297" },
/* 298 */ { "unused#298" },
/* 299 */ { "unused#299" },
/* 300 */ { "unused#300" },
/* 301 */ { "unused#301" },
/* 302 */ { "unused#302" },
/* 303 */ { "unused#303" },
/* 304 */ { "unused#304" },
/* 305 */ { "unused#305" },
/* 306 */ { "unused#306" },
/* 307 */ { "unused#307" },
/* 308 */ { "unused#308" },
/* 309 */ { "unused#309" },
/* 310 */ { "unused#310" },
/* 311 */ { "unused#311" },
/* 312 */ { "unused#312" },
/* 313 */ { "unused#313" },
/* 314 */ { "unused#314" },
/* 315 */ { "unused#315" },
/* 316 */ { "unused#316" },
/* 317 */ { "unused#317" },
/* 318 */ { "unused#318" },
/* 319 */ { "unused#319" },
/* 320 */ { "unused#320" },
/* 321 */ { "unused#321" },
/* 322 */ { "unused#322" },
/* 323 */ { "unused#323" },
/* 324 */ { "unused#324" },
/* 325 */ { "unused#325" },
/* 326 */ { "unused#326" },
/* 327 */ { "unused#327" },
/* 328 */ { "unused#328" },
/* 329 */ { "unused#329" },
/* 330 */ { "unused#330" },
/* 331 */ { "unused#331" },
/* 332 */ { "unused#332" },
/* 333 */ { "unused#333" },
/* 334 */ { "unused#334" },
/* 335 */ { "unused#335" },
/* 336 */ { "unused#336" },
/* 337 */ { "unused#337" },
/* 338 */ { "unused#338" },
/* 339 */ { "unused#339" },
/* 340 */ { "unused#340" },
/* 341 */ { "unused#341" },
/* 342 */ { "unused#342" },
/* 343 */ { "unused#343" },
/* 344 */ { "unused#344" },
/* 345 */ { "unused#345" },
/* 346 */ { "unused#346" },
/* 347 */ { "unused#347" },
/* 348 */ { "unused#348" },
/* 349 */ { "unused#349" },
/* 350 */ { "unused#350" },
/* 351 */ { "unused#351" },
/* 352 */ { "unused#352" },
/* 353 */ { "unused#353" },
/* 354 */ { "unused#354" },
/* 355 */ { "unused#355" },
/* 356 */ { "unused#356" },
/* 357 */ { "unused#357" },
/* 358 */ { "unused#358" },
/* 359 */ { "unused#359" },
/* 360 */ { "unused#360" },
/* 361 */ { "unused#361" },
/* 362 */ { "unused#362" },
/* 363 */ { "unused#363" },
/* 364 */ { "unused#364" },
/* 365 */ { "unused#365" },
/* 366 */ { "unused#366" },
/* 367 */ { "unused#367" },
/* 368 */ { "unused#368" },
/* 369 */ { "unused#369" },
/* 370 */ { "unused#370" },
/* 371 */ { "unused#371" },
/* 372 */ { "unused#372" },
/* 373 */ { "unused#373" },
/* 374 */ { "unused#374" },
/* 375 */ { "unused#375" },
/* 376 */ { "unused#376" },
/* 377 */ { "unused#377" },
/* 378 */ { "unused#378" },
/* 379 */ { "unused#379" },
/* 380 */ { "unused#380" },
/* 381 */ { "unused#381" },
/* 382 */ { "unused#382" },
/* 383 */ { "unused#383" },
/* 384 */ { "unused#384" },
/* 385 */ { "unused#385" },
/* 386 */ { "unused#386" },
/* 387 */ { "unused#387" },
/* 388 */ { "unused#388" },
/* 389 */ { "unused#389" },
/* 390 */ { "unused#390" },
/* 391 */ { "unused#391" },
/* 392 */ { "unused#392" },
/* 393 */ { "unused#393" },
/* 394 */ { "unused#394" },
/* 395 */ { "unused#395" },
/* 396 */ { "unused#396" },
/* 397 */ { "unused#397" },
/* 398 */ { "unused#398" },
/* 399 */ { "unused#399" },
/* 400 */ { "unused#400" },
/* 401 */ { "unused#401" },
/* 402 */ { "unused#402" },
/* 403 */ { "unused#403" },
/* 404 */ { "unused#404" },
/* 405 */ { "unused#405" },
/* 406 */ { "unused#406" },
/* 407 */ { "unused#407" },
/* 408 */ { "unused#408" },
/* 409 */ { "unused#409" },
/* 410 */ { "unused#410" },
/* 411 */ { "unused#411" },
/* 412 */ { "unused#412" },
/* 413 */ { "unused#413" },
/* 414 */ { "unused#414" },
/* 415 */ { "unused#415" },
/* 416 */ { "unused#416" },
/* 417 */ { "unused#417" },
/* 418 */ { "unused#418" },
/* 419 */ { "unused#419" },
/* 420 */ { "unused#420" },
/* 421 */ { "unused#421" },
/* 422 */ { "unused#422" },
/* 423 */ { "unused#423" },
/* 424 */ { "unused#424" },
/* 425 */ { "unused#425" },
/* 426 */ { "unused#426" },
/* 427 */ { "unused#427" },
/* 428 */ { "unused#428" },
/* 429 */ { "unused#429" },
/* 430 */ { "unused#430" },
/* 431 */ { "unused#431" },
/* 432 */ { "unused#432" },
/* 433 */ { "unused#433" },
/* 434 */ { "unused#434" },
/* 435 */ { "unused#435" },
/* 436 */ { "unused#436" },
/* 437 */ { "unused#437" },
/* 438 */ { "unused#438" },
/* 439 */ { "unused#439" },
/* 440 */ { "unused#440" },
/* 441 */ { "unused#441" },
/* 442 */ { "unused#442" },
/* 443 */ { "unused#443" },
/* 444 */ { "unused#444" },
/* 445 */ { "unused#445" },
/* 446 */ { "unused#446" },
/* 447 */ { "unused#447" },
/* 448 */ { "unused#448" },
/* 449 */ { "unused#449" },
/* 450 */ { "unused#450" },
/* 451 */ { "unused#451" },
/* 452 */ { "unused#452" },
/* 453 */ { "unused#453" },
/* 454 */ { "unused#454" },
/* 455 */ { "unused#455" },
/* 456 */ { "unused#456" },
/* 457 */ { "unused#457" },
/* 458 */ { "unused#458" },
/* 459 */ { "unused#459" },
/* 460 */ { "unused#460" },
/* 461 */ { "unused#461" },
/* 462 */ { "unused#462" },
/* 463 */ { "unused#463" },
/* 464 */ { "unused#464" },
/* 465 */ { "unused#465" },
/* 466 */ { "unused#466" },
/* 467 */ { "unused#467" },
/* 468 */ { "unused#468" },
/* 469 */ { "unused#469" },
/* 470 */ { "unused#470" },
/* 471 */ { "unused#471" },
/* 472 */ { "unused#472" },
/* 473 */ { "unused#473" },
/* 474 */ { "unused#474" },
/* 475 */ { "unused#475" },
/* 476 */ { "unused#476" },
/* 477 */ { "mmap", mmapFunc<ArmFreebsd64> },
/* 478 */ { "unused#478" },
/* 479 */ { "unused#479" },
/* 480 */ { "unused#480" },
/* 481 */ { "unused#481" },
/* 482 */ { "unused#482" },
/* 483 */ { "unused#483" },
/* 484 */ { "unused#484" },
/* 485 */ { "unused#485" },
/* 486 */ { "unused#486" },
/* 487 */ { "unused#487" },
/* 488 */ { "unused#488" },
/* 489 */ { "unused#489" },
/* 490 */ { "unused#490" },
/* 491 */ { "unused#491" },
/* 492 */ { "unused#492" },
/* 493 */ { "unused#493" },
/* 494 */ { "unused#494" },
/* 495 */ { "unused#495" },
/* 496 */ { "unused#496" },
/* 497 */ { "unused#497" },
/* 498 */ { "unused#498" },
/* 499 */ { "unused#499" },
/* 500 */ { "unused#500" },
/* 501 */ { "unused#501" },
/* 502 */ { "unused#502" },
/* 503 */ { "unused#503" },
/* 504 */ { "unused#504" },
/* 505 */ { "unused#505" },
/* 506 */ { "unused#506" },
/* 507 */ { "unused#507" },
/* 508 */ { "unused#508" },
/* 509 */ { "unused#509" },
/* 510 */ { "unused#510" },
/* 511 */ { "unused#511" },
/* 512 */ { "unused#512" },
/* 513 */ { "unused#513" },
/* 514 */ { "unused#514" },
/* 515 */ { "unused#515" },
/* 516 */ { "unused#516" },
/* 517 */ { "unused#517" },
/* 518 */ { "unused#518" },
/* 519 */ { "unused#519" },
/* 520 */ { "unused#520" },
/* 521 */ { "unused#521" },
/* 522 */ { "unused#522" },
/* 523 */ { "unused#523" },
/* 524 */ { "unused#524" },
/* 525 */ { "unused#525" },
/* 526 */ { "unused#526" },
/* 527 */ { "unused#527" },
/* 528 */ { "unused#528" },
/* 529 */ { "unused#529" },
/* 530 */ { "unused#530" },
/* 531 */ { "unused#531" },
/* 532 */ { "unused#532" },
/* 533 */ { "unused#533" },
/* 534 */ { "unused#534" },
/* 535 */ { "unused#535" },
/* 536 */ { "unused#536" },
/* 537 */ { "unused#537" },
/* 538 */ { "unused#538" },
/* 539 */ { "unused#539" },
/* 540 */ { "unused#540" },
/* 541 */ { "unused#541" },
/* 542 */ { "unused#542" },
/* 543 */ { "unused#543" },
/* 544 */ { "unused#544" },
/* 545 */ { "unused#545" },
/* 546 */ { "unused#546" },
/* 547 */ { "unused#547" },
};
ArmFreebsdProcess32::ArmFreebsdProcess32(ProcessParams * params,
ObjectFile *objFile, ObjectFile::Arch _arch)
: ArmProcess32(params, objFile, _arch)
{
SyscallTable table;
table.descs = syscallDescs32;
table.size = sizeof(syscallDescs32) / sizeof(SyscallDesc);
table.base = 0;
syscallTables.push_back(table);
}
ArmFreebsdProcess64::ArmFreebsdProcess64(ProcessParams * params,
ObjectFile *objFile, ObjectFile::Arch _arch)
: ArmProcess64(params, objFile, _arch)
{
SyscallTable table;
table.descs = syscallDescs64;
table.size = sizeof(syscallDescs64) / sizeof(SyscallDesc);
table.base = 0;
syscallTables.push_back(table);
}
SyscallDesc*
ArmFreebsdProcessBits::getFreebsdDesc(int callnum)
{
for (unsigned i = 0; i < syscallTables.size(); i++) {
SyscallDesc *desc = syscallTables[i].getDesc(callnum);
if (desc)
return desc;
}
return NULL;
}
SyscallDesc *
ArmFreebsdProcessBits::SyscallTable::getDesc(int callnum) const
{
int offset = callnum - base;
if (offset < 0 || offset >= size)
return NULL;
return &descs[offset];
}
SyscallDesc*
ArmFreebsdProcess32::getDesc(int callnum)
{
return getFreebsdDesc(callnum);
}
SyscallDesc*
ArmFreebsdProcess64::getDesc(int callnum)
{
return getFreebsdDesc(callnum);
}
void
ArmFreebsdProcess32::initState()
{
ArmProcess32::initState();
// The 32 bit equivalent of the comm page would be set up here.
}
void
ArmFreebsdProcess64::initState()
{
ArmProcess64::initState();
// The 64 bit equivalent of the comm page would be set up here.
}
void
ArmFreebsdProcess32::syscall(ThreadContext *tc, Fault *fault)
{
doSyscall(tc->readIntReg(INTREG_R7), tc, fault);
}
void
ArmFreebsdProcess64::syscall(ThreadContext *tc, Fault *fault)
{
doSyscall(tc->readIntReg(INTREG_X8), tc, fault);
}