Work with HP/UX 9.00
[deliverable/binutils-gdb.git] / sim / ppc / emul_netbsd.c
1 /* This file is part of the program psim.
2
3 Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 */
20
21
22 #ifndef _EMUL_NETBSD_C_
23 #define _EMUL_NETBSD_C_
24
25
26 /* Note: this module is called via a table. There is no benefit in
27 making it inline */
28
29 #include "emul_generic.h"
30 #include "emul_netbsd.h"
31
32 #ifdef HAVE_STRING_H
33 #include <string.h>
34 #else
35 #ifdef HAVE_STRINGS_H
36 #include <strings.h>
37 #endif
38 #endif
39
40 #include <sys/types.h>
41 #include <sys/stat.h>
42 #include <stdio.h>
43 #include <signal.h>
44 #include <fcntl.h>
45 #include <sys/errno.h>
46 #include <sys/param.h>
47 #include <sys/time.h>
48 #include <sys/resource.h>
49 int getrusage();
50
51 #include <sys/ioctl.h>
52 #include <sys/mount.h>
53
54 #if HAVE_DIRENT_H
55 # include <dirent.h>
56 # define NAMLEN(dirent) strlen((dirent)->d_name)
57 #else
58 # define dirent direct
59 # define NAMLEN(dirent) (dirent)->d_namlen
60 # if HAVE_SYS_NDIR_H
61 # include <sys/ndir.h>
62 # endif
63 # if HAVE_SYS_DIR_H
64 # include <sys/dir.h>
65 # endif
66 # if HAVE_NDIR_H
67 # include <ndir.h>
68 # endif
69 #endif
70
71 #ifdef HAVE_UNISTD_H
72 #include <unistd.h>
73 #endif
74
75 #ifdef HAVE_STDLIB_H
76 #include <stdlib.h>
77 #endif
78
79 #define WITH_NetBSD_HOST (NetBSD >= 199306)
80 #if WITH_NetBSD_HOST /* here NetBSD as that is what we're emulating */
81 #include <sys/syscall.h> /* FIXME - should not be including this one */
82 #include <sys/sysctl.h>
83 extern int getdirentries(int fd, char *buf, int nbytes, long *basep);
84 #endif
85
86 #if (BSD < 199306) /* here BSD as just a bug */
87 extern int errno;
88 #endif
89
90 #ifndef STATIC_INLINE_EMUL_NETBSD
91 #define STATIC_INLINE_EMUL_NETBSD STATIC_INLINE
92 #endif
93
94
95 #if WITH_NetBSD_HOST
96 #define SYS(X) ASSERT(call == (SYS_##X))
97 #else
98 #define SYS(X)
99 #endif
100
101 #if WITH_NetBSD_HOST && (PATH_MAX != 1024)
102 #error "PATH_MAX not 1024"
103 #elif !defined(PATH_MAX)
104 #define PATH_MAX 1024
105 #endif
106
107
108 /* NetBSD's idea of what is needed to implement emulations */
109
110 struct _os_emul_data {
111 device *vm;
112 emul_syscall *syscalls;
113 };
114
115
116
117 STATIC_INLINE_EMUL_NETBSD void
118 write_stat(unsigned_word addr,
119 struct stat buf,
120 cpu *processor,
121 unsigned_word cia)
122 {
123 H2T(buf.st_dev);
124 H2T(buf.st_ino);
125 H2T(buf.st_mode);
126 H2T(buf.st_nlink);
127 H2T(buf.st_uid);
128 H2T(buf.st_gid);
129 H2T(buf.st_rdev);
130 H2T(buf.st_size);
131 H2T(buf.st_atime);
132 /* H2T(buf.st_spare1); */
133 H2T(buf.st_mtime);
134 /* H2T(buf.st_spare2); */
135 H2T(buf.st_ctime);
136 /* H2T(buf.st_spare3); */
137 H2T(buf.st_blksize);
138 H2T(buf.st_blocks);
139 #if WITH_NetBSD_HOST
140 H2T(buf.st_flags);
141 H2T(buf.st_gen);
142 #endif
143 emul_write_buffer(&buf, addr, sizeof(buf), processor, cia);
144 }
145
146
147 #if NetBSD
148 STATIC_INLINE_EMUL_NETBSD void
149 write_statfs(unsigned_word addr,
150 struct statfs buf,
151 cpu *processor,
152 unsigned_word cia)
153 {
154 H2T(buf.f_type);
155 H2T(buf.f_flags);
156 H2T(buf.f_bsize);
157 H2T(buf.f_iosize);
158 H2T(buf.f_blocks);
159 H2T(buf.f_bfree);
160 H2T(buf.f_bavail);
161 H2T(buf.f_files);
162 H2T(buf.f_ffree);
163 H2T(buf.f_fsid.val[0]);
164 H2T(buf.f_fsid.val[1]);
165 H2T(buf.f_owner);
166 /* f_spare[4]; */
167 /* f_fstypename[MFSNAMELEN]; */
168 /* f_mntonname[MNAMELEN]; */
169 /* f_mntfromname[MNAMELEN]; */
170 emul_write_buffer(&buf, addr, sizeof(buf), processor, cia);
171 }
172 #endif
173
174
175 STATIC_INLINE_EMUL_NETBSD void
176 write_timeval(unsigned_word addr,
177 struct timeval t,
178 cpu *processor,
179 unsigned_word cia)
180 {
181 H2T(t.tv_sec);
182 H2T(t.tv_usec);
183 emul_write_buffer(&t, addr, sizeof(t), processor, cia);
184 }
185
186
187 STATIC_INLINE_EMUL_NETBSD void
188 write_timezone(unsigned_word addr,
189 struct timezone tz,
190 cpu *processor,
191 unsigned_word cia)
192 {
193 H2T(tz.tz_minuteswest);
194 H2T(tz.tz_dsttime);
195 emul_write_buffer(&tz, addr, sizeof(tz), processor, cia);
196 }
197
198
199 #if WITH_NetBSD_HOST
200 STATIC_INLINE_EMUL_NETBSD void
201 write_direntries(unsigned_word addr,
202 char *buf,
203 int nbytes,
204 cpu *processor,
205 unsigned_word cia)
206 {
207 while (nbytes > 0) {
208 struct dirent *out;
209 struct dirent *in = (struct dirent*)buf;
210 ASSERT(in->d_reclen <= nbytes);
211 out = (struct dirent*)zalloc(in->d_reclen);
212 memcpy(out/*dest*/, in/*src*/, in->d_reclen);
213 H2T(out->d_fileno);
214 H2T(out->d_reclen);
215 H2T(out->d_type);
216 H2T(out->d_namlen);
217 emul_write_buffer(out, addr, in->d_reclen, processor, cia);
218 nbytes -= in->d_reclen;
219 addr += in->d_reclen;
220 buf += in->d_reclen;
221 zfree(out);
222 }
223 }
224 #endif
225
226
227 STATIC_INLINE_EMUL_NETBSD void
228 write_rusage(unsigned_word addr,
229 struct rusage rusage,
230 cpu *processor,
231 unsigned_word cia)
232 {
233 H2T(rusage.ru_utime.tv_sec); /* user time used */
234 H2T(rusage.ru_utime.tv_usec);
235 H2T(rusage.ru_stime.tv_sec); /* system time used */
236 H2T(rusage.ru_stime.tv_usec);
237 H2T(rusage.ru_maxrss); /* integral max resident set size */
238 H2T(rusage.ru_ixrss); /* integral shared text memory size */
239 H2T(rusage.ru_idrss); /* integral unshared data size */
240 H2T(rusage.ru_isrss); /* integral unshared stack size */
241 H2T(rusage.ru_minflt); /* page reclaims */
242 H2T(rusage.ru_majflt); /* page faults */
243 H2T(rusage.ru_nswap); /* swaps */
244 H2T(rusage.ru_inblock); /* block input operations */
245 H2T(rusage.ru_oublock); /* block output operations */
246 H2T(rusage.ru_msgsnd); /* messages sent */
247 H2T(rusage.ru_msgrcv); /* messages received */
248 H2T(rusage.ru_nsignals); /* signals received */
249 H2T(rusage.ru_nvcsw); /* voluntary context switches */
250 H2T(rusage.ru_nivcsw); /* involuntary context switches */
251 emul_write_buffer(&rusage, addr, sizeof(rusage), processor, cia);
252 }
253
254
255 static void
256 do_exit(os_emul_data *emul,
257 unsigned call,
258 const int arg0,
259 cpu *processor,
260 unsigned_word cia)
261 {
262 int status = (int)cpu_registers(processor)->gpr[arg0];
263 SYS(exit);
264 if (WITH_TRACE && ppc_trace[trace_os_emul])
265 printf_filtered ("%d)\n", status);
266
267 cpu_halt(processor, cia, was_exited, status);
268 }
269
270
271 static void
272 do_read(os_emul_data *emul,
273 unsigned call,
274 const int arg0,
275 cpu *processor,
276 unsigned_word cia)
277 {
278 void *scratch_buffer;
279 int d = (int)cpu_registers(processor)->gpr[arg0];
280 unsigned_word buf = cpu_registers(processor)->gpr[arg0+1];
281 int nbytes = cpu_registers(processor)->gpr[arg0+2];
282 int status;
283 SYS(read);
284
285 if (WITH_TRACE && ppc_trace[trace_os_emul])
286 printf_filtered ("%d, 0x%lx, %d", d, (long)buf, nbytes);
287
288 /* get a tempoary bufer */
289 scratch_buffer = zalloc(nbytes);
290
291 /* check if buffer exists by reading it */
292 emul_read_buffer(scratch_buffer, buf, nbytes, processor, cia);
293
294 /* read */
295 #if 0
296 if (d == 0) {
297 status = fread (scratch_buffer, 1, nbytes, stdin);
298 if (status == 0 && ferror (stdin))
299 status = -1;
300 }
301 #endif
302 status = read (d, scratch_buffer, nbytes);
303
304 if (status == -1) {
305 cpu_registers(processor)->gpr[0] = errno;
306 } else {
307 cpu_registers(processor)->gpr[3] = status;
308
309 if (status > 0)
310 emul_write_buffer(scratch_buffer, buf, status, processor, cia);
311 }
312
313 zfree(scratch_buffer);
314 }
315
316
317 static void
318 do_write(os_emul_data *emul,
319 unsigned call,
320 const int arg0,
321 cpu *processor,
322 unsigned_word cia)
323 {
324 void *scratch_buffer = NULL;
325 int nr_moved;
326 int d = (int)cpu_registers(processor)->gpr[arg0];
327 unsigned_word buf = cpu_registers(processor)->gpr[arg0+1];
328 int nbytes = cpu_registers(processor)->gpr[arg0+2];
329 int status;
330 SYS(write);
331
332 if (WITH_TRACE && ppc_trace[trace_os_emul])
333 printf_filtered ("%d, 0x%lx, %d", d, (long)buf, nbytes);
334
335 /* get a tempoary bufer */
336 scratch_buffer = zalloc(nbytes); /* FIXME - nbytes == 0 */
337
338 /* copy in */
339 nr_moved = vm_data_map_read_buffer(cpu_data_map(processor),
340 scratch_buffer,
341 buf,
342 nbytes);
343 if (nr_moved != nbytes) {
344 /* FIXME - should handle better */
345 error("system_call()write copy failed (nr_moved=%d != nbytes=%d)\n",
346 nr_moved, nbytes);
347 }
348
349 /* write */
350 status = write(d, scratch_buffer, nbytes);
351 emul_write_status(processor, status, errno);
352 zfree(scratch_buffer);
353 }
354
355
356 static void
357 do_open(os_emul_data *emul,
358 unsigned call,
359 const int arg0,
360 cpu *processor,
361 unsigned_word cia)
362 {
363 unsigned_word path_addr = cpu_registers(processor)->gpr[arg0];
364 char path_buf[PATH_MAX];
365 char *path = emul_read_string(path_buf, path_addr, PATH_MAX, processor, cia);
366 int flags = (int)cpu_registers(processor)->gpr[arg0+1];
367 int mode = (int)cpu_registers(processor)->gpr[arg0+2];
368
369 if (WITH_TRACE && ppc_trace[trace_os_emul])
370 printf_filtered ("0x%lx [%s], 0x%x, 0x%x", (long)path_addr, path, flags, mode);
371
372 SYS(open);
373 emul_write_status(processor, open(path, flags, mode), errno);
374 }
375
376
377 static void
378 do_close(os_emul_data *emul,
379 unsigned call,
380 const int arg0,
381 cpu *processor,
382 unsigned_word cia)
383 {
384 int d = (int)cpu_registers(processor)->gpr[arg0];
385
386 if (WITH_TRACE && ppc_trace[trace_os_emul])
387 printf_filtered ("%d", d);
388
389 SYS(close);
390 emul_write_status(processor, close(d), errno);
391 }
392
393
394 static void
395 do_break(os_emul_data *emul,
396 unsigned call,
397 const int arg0,
398 cpu *processor,
399 unsigned_word cia)
400 {
401 /* just pass this onto the `vm' device */
402 psim *system = cpu_system(processor);
403
404 if (WITH_TRACE && ppc_trace[trace_os_emul])
405 printf_filtered ("0x%lx", (long)cpu_registers(processor)->gpr[arg0]);
406
407 SYS(break);
408 device_ioctl(emul->vm,
409 system,
410 processor,
411 cia,
412 0, /*ioctl*/
413 NULL); /*ioctl-data*/
414 }
415
416
417 static void
418 do_getpid(os_emul_data *emul,
419 unsigned call,
420 const int arg0,
421 cpu *processor,
422 unsigned_word cia)
423 {
424 SYS(getpid);
425 cpu_registers(processor)->gpr[3] = (int)getpid();
426 }
427
428
429 static void
430 do_getuid(os_emul_data *emul,
431 unsigned call,
432 const int arg0,
433 cpu *processor,
434 unsigned_word cia)
435 {
436 SYS(getuid);
437 cpu_registers(processor)->gpr[3] = (int)getuid();
438 }
439
440
441 static void
442 do_geteuid(os_emul_data *emul,
443 unsigned call,
444 const int arg0,
445 cpu *processor,
446 unsigned_word cia)
447 {
448 SYS(geteuid);
449 cpu_registers(processor)->gpr[3] = (int)geteuid();
450 }
451
452
453 static void
454 do_kill(os_emul_data *emul,
455 unsigned call,
456 const int arg0,
457 cpu *processor,
458 unsigned_word cia)
459 {
460 pid_t pid = cpu_registers(processor)->gpr[arg0];
461 int sig = cpu_registers(processor)->gpr[arg0+1];
462
463 if (WITH_TRACE && ppc_trace[trace_os_emul])
464 printf_filtered ("%d, %d", (int)pid, sig);
465
466 SYS(kill);
467 printf_filtered("SYS_kill at 0x%lx - more to this than just being killed\n",
468 (long)cia);
469 cpu_halt(processor, cia, was_signalled, sig);
470 }
471
472
473 static void
474 do_dup(os_emul_data *emul,
475 unsigned call,
476 const int arg0,
477 cpu *processor,
478 unsigned_word cia)
479 {
480 int oldd = cpu_registers(processor)->gpr[arg0];
481 int status = dup(oldd);
482
483 if (WITH_TRACE && ppc_trace[trace_os_emul])
484 printf_filtered ("%d", oldd);
485
486 SYS(dup);
487 emul_write_status(processor, status, errno);
488 }
489
490
491 static void
492 do_getegid(os_emul_data *emul,
493 unsigned call,
494 const int arg0,
495 cpu *processor,
496 unsigned_word cia)
497 {
498 SYS(getegid);
499 cpu_registers(processor)->gpr[3] = (int)getegid();
500 }
501
502
503 static void
504 do_getgid(os_emul_data *emul,
505 unsigned call,
506 const int arg0,
507 cpu *processor,
508 unsigned_word cia)
509 {
510 SYS(getgid);
511 cpu_registers(processor)->gpr[3] = (int)getgid();
512 }
513
514
515 static void
516 do_sigprocmask(os_emul_data *emul,
517 unsigned call,
518 const int arg0,
519 cpu *processor,
520 unsigned_word cia)
521 {
522 natural_word how = cpu_registers(processor)->gpr[arg0];
523 unsigned_word set = cpu_registers(processor)->gpr[arg0+1];
524 unsigned_word oset = cpu_registers(processor)->gpr[arg0+2];
525 SYS(sigprocmask);
526
527 if (WITH_TRACE && ppc_trace[trace_os_emul])
528 printf_filtered ("%ld, 0x%ld, 0x%ld", (long)how, (long)set, (long)oset);
529
530 cpu_registers(processor)->gpr[3] = 0;
531 cpu_registers(processor)->gpr[4] = set;
532 }
533
534
535 static void
536 do_ioctl(os_emul_data *emul,
537 unsigned call,
538 const int arg0,
539 cpu *processor,
540 unsigned_word cia)
541 {
542 int d = cpu_registers(processor)->gpr[arg0];
543 unsigned request = cpu_registers(processor)->gpr[arg0+1];
544 unsigned_word argp_addr = cpu_registers(processor)->gpr[arg0+2];
545
546 #if !WITH_NetBSD_HOST
547 cpu_registers(processor)->gpr[arg0] = 0; /* just succeed */
548 #else
549 unsigned dir = request & IOC_DIRMASK;
550 int status;
551 SYS(ioctl);
552 /* what we haven't done */
553 if (dir & IOC_IN /* write into the io device */
554 || dir & IOC_OUT
555 || !(dir & IOC_VOID))
556 error("do_ioctl() read or write of parameter not implemented\n");
557 status = ioctl(d, request, NULL);
558 emul_write_status(processor, status, errno);
559 #endif
560
561 if (WITH_TRACE && ppc_trace[trace_os_emul])
562 printf_filtered ("%d, 0x%x, 0x%lx", d, request, (long)argp_addr);
563 }
564
565
566 static void
567 do_umask(os_emul_data *emul,
568 unsigned call,
569 const int arg0,
570 cpu *processor,
571 unsigned_word cia)
572 {
573 int mask = cpu_registers(processor)->gpr[arg0];
574
575 if (WITH_TRACE && ppc_trace[trace_os_emul])
576 printf_filtered ("0%o", mask);
577
578 SYS(umask);
579 cpu_registers(processor)->gpr[3] = umask(mask);
580 }
581
582
583 static void
584 do_dup2(os_emul_data *emul,
585 unsigned call,
586 const int arg0,
587 cpu *processor,
588 unsigned_word cia)
589 {
590 int oldd = cpu_registers(processor)->gpr[arg0];
591 int newd = cpu_registers(processor)->gpr[arg0+1];
592 int status = dup2(oldd, newd);
593
594 if (WITH_TRACE && ppc_trace[trace_os_emul])
595 printf_filtered ("%d, %d", oldd, newd);
596
597 SYS(dup2);
598 emul_write_status(processor, status, errno);
599 }
600
601
602 static void
603 do_fcntl(os_emul_data *emul,
604 unsigned call,
605 const int arg0,
606 cpu *processor,
607 unsigned_word cia)
608 {
609 int fd = cpu_registers(processor)->gpr[arg0];
610 int cmd = cpu_registers(processor)->gpr[arg0+1];
611 int arg = cpu_registers(processor)->gpr[arg0+2];
612 int status;
613
614 if (WITH_TRACE && ppc_trace[trace_os_emul])
615 printf_filtered ("%d, %d, %d", fd, cmd, arg);
616
617 SYS(fcntl);
618 status = fcntl(fd, cmd, arg);
619 emul_write_status(processor, status, errno);
620 }
621
622
623 static void
624 do_gettimeofday(os_emul_data *emul,
625 unsigned call,
626 const int arg0,
627 cpu *processor,
628 unsigned_word cia)
629 {
630 unsigned_word t_addr = cpu_registers(processor)->gpr[arg0];
631 unsigned_word tz_addr = cpu_registers(processor)->gpr[arg0+1];
632 struct timeval t;
633 struct timezone tz;
634 int status = gettimeofday((t_addr != 0 ? &t : NULL),
635 (tz_addr != 0 ? &tz : NULL));
636
637 if (WITH_TRACE && ppc_trace[trace_os_emul])
638 printf_filtered ("0x%lx, 0x%lx", (long)t_addr, (long)tz_addr);
639
640 SYS(gettimeofday);
641 emul_write_status(processor, status, errno);
642 if (status == 0) {
643 if (t_addr != 0)
644 write_timeval(t_addr, t, processor, cia);
645 if (tz_addr != 0)
646 write_timezone(tz_addr, tz, processor, cia);
647 }
648 }
649
650
651 static void
652 do_getrusage(os_emul_data *emul,
653 unsigned call,
654 const int arg0,
655 cpu *processor,
656 unsigned_word cia)
657 {
658 int who = cpu_registers(processor)->gpr[arg0];
659 unsigned_word rusage_addr = cpu_registers(processor)->gpr[arg0+1];
660 struct rusage rusage;
661 int status = getrusage(who, (rusage_addr != 0 ? &rusage : NULL));
662
663 if (WITH_TRACE && ppc_trace[trace_os_emul])
664 printf_filtered ("%d, 0x%lx", who, (long)rusage_addr);
665
666 SYS(getrusage);
667 emul_write_status(processor, status, errno);
668 if (status == 0) {
669 if (rusage_addr != 0)
670 write_rusage(rusage_addr, rusage, processor, cia);
671 }
672 }
673
674
675 #if !WITH_NetBSD_HOST
676 #define do_fstatfs 0
677 #else
678 static void
679 do_fstatfs(os_emul_data *emul,
680 unsigned call,
681 const int arg0,
682 cpu *processor,
683 unsigned_word cia)
684 {
685 int fd = cpu_registers(processor)->gpr[arg0];
686 unsigned_word buf_addr = cpu_registers(processor)->gpr[arg0+1];
687 struct statfs buf;
688 int status;
689
690 if (WITH_TRACE && ppc_trace[trace_os_emul])
691 printf_filtered ("%d, 0x%lx", fd, (long)buf_addr);
692
693 SYS(fstatfs);
694 status = fstatfs(fd, (buf_addr == 0 ? NULL : &buf));
695 emul_write_status(processor, status, errno);
696 if (status == 0) {
697 if (buf_addr != 0)
698 write_statfs(buf_addr, buf, processor, cia);
699 }
700 }
701 #endif
702
703
704 static void
705 do_stat(os_emul_data *emul,
706 unsigned call,
707 const int arg0,
708 cpu *processor,
709 unsigned_word cia)
710 {
711 char path_buf[PATH_MAX];
712 unsigned_word path_addr = cpu_registers(processor)->gpr[arg0];
713 unsigned_word stat_buf_addr = cpu_registers(processor)->gpr[arg0+1];
714 char *path = emul_read_string(path_buf, path_addr, PATH_MAX, processor, cia);
715 struct stat buf;
716 int status;
717 SYS(stat);
718 status = stat(path, &buf);
719 emul_write_status(processor, status, errno);
720 if (status == 0)
721 write_stat(stat_buf_addr, buf, processor, cia);
722 }
723
724
725 static void
726 do_fstat(os_emul_data *emul,
727 unsigned call,
728 const int arg0,
729 cpu *processor,
730 unsigned_word cia)
731 {
732 int fd = cpu_registers(processor)->gpr[arg0];
733 unsigned_word stat_buf_addr = cpu_registers(processor)->gpr[arg0+1];
734 struct stat buf;
735 SYS(fstat);
736 emul_write_status(processor, fstat(fd, &buf), errno);
737 write_stat(stat_buf_addr, buf, processor, cia);
738 }
739
740
741 static void
742 do_lstat(os_emul_data *emul,
743 unsigned call,
744 const int arg0,
745 cpu *processor,
746 unsigned_word cia)
747 {
748 char path_buf[PATH_MAX];
749 unsigned_word path_addr = cpu_registers(processor)->gpr[arg0];
750 char *path = emul_read_string(path_buf, path_addr, PATH_MAX, processor, cia);
751 unsigned_word stat_buf_addr = cpu_registers(processor)->gpr[arg0+1];
752 struct stat buf;
753 SYS(lstat);
754 emul_write_status(processor, stat(path, &buf), errno);
755 write_stat(stat_buf_addr, buf, processor, cia);
756 }
757
758
759 #if !WITH_NetBSD_HOST
760 #define do_getdirentries 0
761 #else
762 static void
763 do_getdirentries(os_emul_data *emul,
764 unsigned call,
765 const int arg0,
766 cpu *processor,
767 unsigned_word cia)
768 {
769 int fd = cpu_registers(processor)->gpr[arg0];
770 unsigned_word buf_addr = cpu_registers(processor)->gpr[arg0+1];
771 char *buf;
772 int nbytes = cpu_registers(processor)->gpr[arg0+2];
773 unsigned_word basep_addr = cpu_registers(processor)->gpr[arg0+3];
774 long basep;
775 int status;
776 SYS(getdirentries);
777 if (buf_addr != 0 && nbytes >= 0)
778 buf = zalloc(nbytes);
779 else
780 buf = NULL;
781 status = getdirentries(fd,
782 (buf_addr == 0 ? NULL : buf),
783 nbytes,
784 (basep_addr == 0 ? NULL : &basep));
785 emul_write_status(processor, status, errno);
786 if (basep_addr != 0)
787 emul_write_word(basep_addr, basep, processor, cia);
788 if (status > 0)
789 write_direntries(buf_addr, buf, status, processor, cia);
790 if (buf != NULL)
791 zfree(buf);
792 }
793 #endif
794
795
796 static void
797 do___syscall(os_emul_data *emul,
798 unsigned call,
799 const int arg0,
800 cpu *processor,
801 unsigned_word cia)
802 {
803 SYS(__syscall);
804 emul_do_system_call(emul,
805 emul->syscalls,
806 cpu_registers(processor)->gpr[arg0],
807 arg0 + 1,
808 processor,
809 cia);
810 }
811
812
813 static void
814 do_lseek(os_emul_data *emul,
815 unsigned call,
816 const int arg0,
817 cpu *processor,
818 unsigned_word cia)
819 {
820 int fildes = cpu_registers(processor)->gpr[arg0];
821 off_t offset = emul_read_gpr64(processor, arg0+2);
822 int whence = cpu_registers(processor)->gpr[arg0+4];
823 off_t status;
824 SYS(lseek);
825 status = lseek(fildes, offset, whence);
826 if (status == -1)
827 emul_write_status(processor, -1, errno);
828 else {
829 emul_write_gpr64(processor, 3, status);
830 }
831 }
832
833
834 static void
835 do___sysctl(os_emul_data *emul,
836 unsigned call,
837 const int arg0,
838 cpu *processor,
839 unsigned_word cia)
840 {
841 /* call the arguments by their real name */
842 unsigned_word name = cpu_registers(processor)->gpr[arg0];
843 natural_word namelen = cpu_registers(processor)->gpr[arg0+1];
844 unsigned_word oldp = cpu_registers(processor)->gpr[arg0+2];
845 unsigned_word oldlenp = cpu_registers(processor)->gpr[arg0+3];
846 natural_word oldlen;
847 natural_word mib;
848 natural_word int_val;
849 SYS(__sysctl);
850
851 /* pluck out the management information base id */
852 if (namelen < 1)
853 error("system_call()SYS___sysctl bad name[0]\n");
854 mib = vm_data_map_read_word(cpu_data_map(processor),
855 name,
856 processor,
857 cia);
858 name += sizeof(mib);
859
860 /* see what to do with it ... */
861 switch ((int)mib) {
862 case 6/*CTL_HW*/:
863 #if WITH_NetBSD_HOST && (CTL_HW != 6)
864 # error "CTL_HW"
865 #endif
866 if (namelen < 2)
867 error("system_call()SYS___sysctl - CTL_HW - bad name[1]\n");
868 mib = vm_data_map_read_word(cpu_data_map(processor),
869 name,
870 processor,
871 cia);
872 name += sizeof(mib);
873 switch ((int)mib) {
874 case 7/*HW_PAGESIZE*/:
875 #if WITH_NetBSD_HOST && (HW_PAGESIZE != 7)
876 # error "HW_PAGESIZE"
877 #endif
878 oldlen = vm_data_map_read_word(cpu_data_map(processor),
879 oldlenp,
880 processor,
881 cia);
882 if (sizeof(natural_word) > oldlen)
883 error("system_call()sysctl - CTL_HW.HW_PAGESIZE - to small\n");
884 int_val = 8192;
885 oldlen = sizeof(int_val);
886 emul_write_word(oldp, int_val, processor, cia);
887 emul_write_word(oldlenp, oldlen, processor, cia);
888 break;
889 default:
890 error("sysctl() CTL_HW.%d unknown\n", mib);
891 break;
892 }
893 break;
894 default:
895 error("sysctl() name[0]=%d unknown\n", (int)mib);
896 break;
897 }
898 cpu_registers(processor)->gpr[3] = 0;
899 }
900
901
902
903 static emul_syscall_descriptor netbsd_descriptors[] = {
904 /* 0 */ { 0, "syscall" },
905 /* 1 */ { do_exit, "exit" },
906 /* 2 */ { 0, "fork" },
907 /* 3 */ { do_read, "read" },
908 /* 4 */ { do_write, "write" },
909 /* 5 */ { do_open, "open" },
910 /* 6 */ { do_close, "close" },
911 /* 7 */ { 0, "wait4" },
912 { 0, }, /* 8 is old creat */
913 /* 9 */ { 0, "link" },
914 /* 10 */ { 0, "unlink" },
915 { 0, }, /* 11 is obsolete execv */
916 /* 12 */ { 0, "chdir" },
917 /* 13 */ { 0, "fchdir" },
918 /* 14 */ { 0, "mknod" },
919 /* 15 */ { 0, "chmod" },
920 /* 16 */ { 0, "chown" },
921 /* 17 */ { do_break, "break" },
922 /* 18 */ { 0, "getfsstat" },
923 { 0, }, /* 19 is old lseek */
924 /* 20 */ { do_getpid, "getpid" },
925 /* 21 */ { 0, "mount" },
926 /* 22 */ { 0, "unmount" },
927 /* 23 */ { 0, "setuid" },
928 /* 24 */ { do_getuid, "getuid" },
929 /* 25 */ { do_geteuid, "geteuid" },
930 /* 26 */ { 0, "ptrace" },
931 /* 27 */ { 0, "recvmsg" },
932 /* 28 */ { 0, "sendmsg" },
933 /* 29 */ { 0, "recvfrom" },
934 /* 30 */ { 0, "accept" },
935 /* 31 */ { 0, "getpeername" },
936 /* 32 */ { 0, "getsockname" },
937 /* 33 */ { 0, "access" },
938 /* 34 */ { 0, "chflags" },
939 /* 35 */ { 0, "fchflags" },
940 /* 36 */ { 0, "sync" },
941 /* 37 */ { do_kill, "kill" },
942 { 0, }, /* 38 is old stat */
943 /* 39 */ { 0, "getppid" },
944 { 0, }, /* 40 is old lstat */
945 /* 41 */ { do_dup, "dup" },
946 /* 42 */ { 0, "pipe" },
947 /* 43 */ { do_getegid, "getegid" },
948 /* 44 */ { 0, "profil" },
949 /* 45 */ { 0, "ktrace" },
950 /* 46 */ { 0, "sigaction" },
951 /* 47 */ { do_getgid, "getgid" },
952 /* 48 */ { do_sigprocmask, "sigprocmask" },
953 /* 49 */ { 0, "getlogin" },
954 /* 50 */ { 0, "setlogin" },
955 /* 51 */ { 0, "acct" },
956 /* 52 */ { 0, "sigpending" },
957 /* 53 */ { 0, "sigaltstack" },
958 /* 54 */ { do_ioctl, "ioctl" },
959 /* 55 */ { 0, "reboot" },
960 /* 56 */ { 0, "revoke" },
961 /* 57 */ { 0, "symlink" },
962 /* 58 */ { 0, "readlink" },
963 /* 59 */ { 0, "execve" },
964 /* 60 */ { do_umask, "umask" },
965 /* 61 */ { 0, "chroot" },
966 { 0, }, /* 62 is old fstat */
967 { 0, }, /* 63 is old getkerninfo */
968 { 0, }, /* 64 is old getpagesize */
969 /* 65 */ { 0, "msync" },
970 /* 66 */ { 0, "vfork" },
971 { 0, }, /* 67 is obsolete vread */
972 { 0, }, /* 68 is obsolete vwrite */
973 /* 69 */ { 0, "sbrk" },
974 /* 70 */ { 0, "sstk" },
975 { 0, }, /* 71 is old mmap */
976 /* 72 */ { 0, "vadvise" },
977 /* 73 */ { 0, "munmap" },
978 /* 74 */ { 0, "mprotect" },
979 /* 75 */ { 0, "madvise" },
980 { 0, }, /* 76 is obsolete vhangup */
981 { 0, }, /* 77 is obsolete vlimit */
982 /* 78 */ { 0, "mincore" },
983 /* 79 */ { 0, "getgroups" },
984 /* 80 */ { 0, "setgroups" },
985 /* 81 */ { 0, "getpgrp" },
986 /* 82 */ { 0, "setpgid" },
987 /* 83 */ { 0, "setitimer" },
988 { 0, }, /* 84 is old wait */
989 /* 85 */ { 0, "swapon" },
990 /* 86 */ { 0, "getitimer" },
991 { 0, }, /* 87 is old gethostname */
992 { 0, }, /* 88 is old sethostname */
993 { 0, }, /* 89 is old getdtablesize */
994 { do_dup2, "dup2" },
995 { 0, }, /* 91 */
996 /* 92 */ { do_fcntl, "fcntl" },
997 /* 93 */ { 0, "select" },
998 { 0, }, /* 94 */
999 /* 95 */ { 0, "fsync" },
1000 /* 96 */ { 0, "setpriority" },
1001 /* 97 */ { 0, "socket" },
1002 /* 98 */ { 0, "connect" },
1003 { 0, }, /* 99 is old accept */
1004 /* 100 */ { 0, "getpriority" },
1005 { 0, }, /* 101 is old send */
1006 { 0, }, /* 102 is old recv */
1007 /* 103 */ { 0, "sigreturn" },
1008 /* 104 */ { 0, "bind" },
1009 /* 105 */ { 0, "setsockopt" },
1010 /* 106 */ { 0, "listen" },
1011 { 0, }, /* 107 is obsolete vtimes */
1012 { 0, }, /* 108 is old sigvec */
1013 { 0, }, /* 109 is old sigblock */
1014 { 0, }, /* 110 is old sigsetmask */
1015 /* 111 */ { 0, "sigsuspend" },
1016 { 0, }, /* 112 is old sigstack */
1017 { 0, }, /* 113 is old recvmsg */
1018 { 0, }, /* 114 is old sendmsg */
1019 /* - is obsolete vtrace */ { 0, "vtrace 115" },
1020 /* 116 */ { do_gettimeofday, "gettimeofday" },
1021 /* 117 */ { do_getrusage, "getrusage" },
1022 /* 118 */ { 0, "getsockopt" },
1023 /* 119 */ { 0, "resuba" },
1024 /* 120 */ { 0, "readv" },
1025 /* 121 */ { 0, "writev" },
1026 /* 122 */ { 0, "settimeofday" },
1027 /* 123 */ { 0, "fchown" },
1028 /* 124 */ { 0, "fchmod" },
1029 { 0, }, /* 125 is old recvfrom */
1030 { 0, }, /* 126 is old setreuid */
1031 { 0, }, /* 127 is old setregid */
1032 /* 128 */ { 0, "rename" },
1033 { 0, }, /* 129 is old truncate */
1034 { 0, }, /* 130 is old ftruncate */
1035 /* 131 */ { 0, "flock" },
1036 /* 132 */ { 0, "mkfifo" },
1037 /* 133 */ { 0, "sendto" },
1038 /* 134 */ { 0, "shutdown" },
1039 /* 135 */ { 0, "socketpair" },
1040 /* 136 */ { 0, "mkdir" },
1041 /* 137 */ { 0, "rmdir" },
1042 /* 138 */ { 0, "utimes" },
1043 { 0, }, /* 139 is obsolete 4.2 sigreturn */
1044 /* 140 */ { 0, "adjtime" },
1045 { 0, }, /* 141 is old getpeername */
1046 { 0, }, /* 142 is old gethostid */
1047 { 0, }, /* 143 is old sethostid */
1048 { 0, }, /* 144 is old getrlimit */
1049 { 0, }, /* 145 is old setrlimit */
1050 { 0, }, /* 146 is old killpg */
1051 /* 147 */ { 0, "setsid" },
1052 /* 148 */ { 0, "quotactl" },
1053 { 0, }, /* 149 is old quota */
1054 { 0, }, /* 150 is old getsockname */
1055 { 0, }, /* 151 */
1056 { 0, }, /* 152 */
1057 { 0, }, /* 153 */
1058 { 0, }, /* 154 */
1059 /* 155 */ { 0, "nfssvc" },
1060 { 0, }, /* 156 is old getdirentries */
1061 /* 157 */ { 0, "statfs" },
1062 /* 158 */ { do_fstatfs, "fstatfs" },
1063 { 0, }, /* 159 */
1064 { 0, }, /* 160 */
1065 /* 161 */ { 0, "getfh" },
1066 { 0, }, /* 162 is old getdomainname */
1067 { 0, }, /* 163 is old setdomainname */
1068 { 0, }, /* 164 is old uname */
1069 /* 165 */ { 0, "sysarch" },
1070 { 0, }, /* 166 */
1071 { 0, }, /* 167 */
1072 { 0, }, /* 168 */
1073 /* 169 */ { 0, "semsys" },
1074 /* 170 */ { 0, "msgsys" },
1075 /* 171 */ { 0, "shmsys" },
1076 { 0, }, /* 172 */
1077 { 0, }, /* 173 */
1078 { 0, }, /* 174 */
1079 { 0, }, /* 175 */
1080 { 0, }, /* 176 */
1081 { 0, }, /* 177 */
1082 { 0, }, /* 178 */
1083 { 0, }, /* 179 */
1084 { 0, }, /* 180 */
1085 /* 181 */ { 0, "setgid" },
1086 /* 182 */ { 0, "setegid" },
1087 /* 183 */ { 0, "seteuid" },
1088 /* 184 */ { 0, "lfs_bmapv" },
1089 /* 185 */ { 0, "lfs_markv" },
1090 /* 186 */ { 0, "lfs_segclean" },
1091 /* 187 */ { 0, "lfs_segwait" },
1092 /* 188 */ { do_stat, "stat" },
1093 /* 189 */ { do_fstat, "fstat" },
1094 /* 190 */ { do_lstat, "lstat" },
1095 /* 191 */ { 0, "pathconf" },
1096 /* 192 */ { 0, "fpathconf" },
1097 { 0, }, /* 193 */
1098 /* 194 */ { 0, "getrlimit" },
1099 /* 195 */ { 0, "setrlimit" },
1100 /* 196 */ { do_getdirentries, "getdirentries" },
1101 /* 197 */ { 0, "mmap" },
1102 /* 198 */ { do___syscall, "__syscall" },
1103 /* 199 */ { do_lseek, "lseek" },
1104 /* 200 */ { 0, "truncate" },
1105 /* 201 */ { 0, "ftruncate" },
1106 /* 202 */ { do___sysctl, "__sysctl" },
1107 /* 203 */ { 0, "mlock" },
1108 /* 204 */ { 0, "munlock" },
1109 };
1110
1111 static char *(netbsd_error_names[]) = {
1112 /* 0 */ "ESUCCESS",
1113 /* 1 */ "EPERM",
1114 /* 2 */ "ENOENT",
1115 /* 3 */ "ESRCH",
1116 /* 4 */ "EINTR",
1117 /* 5 */ "EIO",
1118 /* 6 */ "ENXIO",
1119 /* 7 */ "E2BIG",
1120 /* 8 */ "ENOEXEC",
1121 /* 9 */ "EBADF",
1122 /* 10 */ "ECHILD",
1123 /* 11 */ "EDEADLK",
1124 /* 12 */ "ENOMEM",
1125 /* 13 */ "EACCES",
1126 /* 14 */ "EFAULT",
1127 /* 15 */ "ENOTBLK",
1128 /* 16 */ "EBUSY",
1129 /* 17 */ "EEXIST",
1130 /* 18 */ "EXDEV",
1131 /* 19 */ "ENODEV",
1132 /* 20 */ "ENOTDIR",
1133 /* 21 */ "EISDIR",
1134 /* 22 */ "EINVAL",
1135 /* 23 */ "ENFILE",
1136 /* 24 */ "EMFILE",
1137 /* 25 */ "ENOTTY",
1138 /* 26 */ "ETXTBSY",
1139 /* 27 */ "EFBIG",
1140 /* 28 */ "ENOSPC",
1141 /* 29 */ "ESPIPE",
1142 /* 30 */ "EROFS",
1143 /* 31 */ "EMLINK",
1144 /* 32 */ "EPIPE",
1145 /* 33 */ "EDOM",
1146 /* 34 */ "ERANGE",
1147 /* 35 */ "EAGAIN",
1148 /* 36 */ "EINPROGRESS",
1149 /* 37 */ "EALREADY",
1150 /* 38 */ "ENOTSOCK",
1151 /* 39 */ "EDESTADDRREQ",
1152 /* 40 */ "EMSGSIZE",
1153 /* 41 */ "EPROTOTYPE",
1154 /* 42 */ "ENOPROTOOPT",
1155 /* 43 */ "EPROTONOSUPPORT",
1156 /* 44 */ "ESOCKTNOSUPPORT",
1157 /* 45 */ "EOPNOTSUPP",
1158 /* 46 */ "EPFNOSUPPORT",
1159 /* 47 */ "EAFNOSUPPORT",
1160 /* 48 */ "EADDRINUSE",
1161 /* 49 */ "EADDRNOTAVAIL",
1162 /* 50 */ "ENETDOWN",
1163 /* 51 */ "ENETUNREACH",
1164 /* 52 */ "ENETRESET",
1165 /* 53 */ "ECONNABORTED",
1166 /* 54 */ "ECONNRESET",
1167 /* 55 */ "ENOBUFS",
1168 /* 56 */ "EISCONN",
1169 /* 57 */ "ENOTCONN",
1170 /* 58 */ "ESHUTDOWN",
1171 /* 59 */ "ETOOMANYREFS",
1172 /* 60 */ "ETIMEDOUT",
1173 /* 61 */ "ECONNREFUSED",
1174 /* 62 */ "ELOOP",
1175 /* 63 */ "ENAMETOOLONG",
1176 /* 64 */ "EHOSTDOWN",
1177 /* 65 */ "EHOSTUNREACH",
1178 /* 66 */ "ENOTEMPTY",
1179 /* 67 */ "EPROCLIM",
1180 /* 68 */ "EUSERS",
1181 /* 69 */ "EDQUOT",
1182 /* 70 */ "ESTALE",
1183 /* 71 */ "EREMOTE",
1184 /* 72 */ "EBADRPC",
1185 /* 73 */ "ERPCMISMATCH",
1186 /* 74 */ "EPROGUNAVAIL",
1187 /* 75 */ "EPROGMISMATCH",
1188 /* 76 */ "EPROCUNAVAIL",
1189 /* 77 */ "ENOLCK",
1190 /* 78 */ "ENOSYS",
1191 /* 79 */ "EFTYPE",
1192 /* 80 */ "EAUTH",
1193 /* 81 */ "ENEEDAUTH",
1194 /* 81 */ "ELAST",
1195 };
1196
1197 static char *(netbsd_signal_names[]) = {
1198 /* 0 */ 0,
1199 /* 1 */ "SIGHUP",
1200 /* 2 */ "SIGINT",
1201 /* 3 */ "SIGQUIT",
1202 /* 4 */ "SIGILL",
1203 /* 5 */ "SIGTRAP",
1204 /* 6 */ "SIGABRT",
1205 /* 7 */ "SIGEMT",
1206 /* 8 */ "SIGFPE",
1207 /* 9 */ "SIGKILL",
1208 /* 10 */ "SIGBUS",
1209 /* 11 */ "SIGSEGV",
1210 /* 12 */ "SIGSYS",
1211 /* 13 */ "SIGPIPE",
1212 /* 14 */ "SIGALRM",
1213 /* 15 */ "SIGTERM",
1214 /* 16 */ "SIGURG",
1215 /* 17 */ "SIGSTOP",
1216 /* 18 */ "SIGTSTP",
1217 /* 19 */ "SIGCONT",
1218 /* 20 */ "SIGCHLD",
1219 /* 21 */ "SIGTTIN",
1220 /* 22 */ "SIGTTOU",
1221 /* 23 */ "SIGIO",
1222 /* 24 */ "SIGXCPU",
1223 /* 25 */ "SIGXFSZ",
1224 /* 26 */ "SIGVTALRM",
1225 /* 27 */ "SIGPROF",
1226 /* 28 */ "SIGWINCH",
1227 /* 29 */ "SIGINFO",
1228 /* 30 */ "SIGUSR1",
1229 /* 31 */ "SIGUSR2",
1230 };
1231
1232 static emul_syscall emul_netbsd_syscalls = {
1233 netbsd_descriptors,
1234 sizeof(netbsd_descriptors) / sizeof(netbsd_descriptors[0]),
1235 netbsd_error_names,
1236 sizeof(netbsd_error_names) / sizeof(netbsd_error_names[0]),
1237 netbsd_signal_names,
1238 sizeof(netbsd_signal_names) / sizeof(netbsd_signal_names[0]),
1239 };
1240
1241
1242 /* NetBSD's os_emul interface, most are just passed on to the generic
1243 syscall stuff */
1244
1245 static os_emul_data *
1246 emul_netbsd_create(device *root,
1247 bfd *image,
1248 const char *name)
1249 {
1250 unsigned_word top_of_stack;
1251 unsigned stack_size;
1252 int elf_binary;
1253 os_emul_data *bsd_data;
1254 device *vm;
1255
1256 /* check that this emulation is really for us */
1257 if (name != NULL && strcmp(name, "netbsd") != 0)
1258 return NULL;
1259 if (image == NULL)
1260 return NULL;
1261
1262
1263 /* merge any emulation specific entries into the device tree */
1264
1265 /* establish a few defaults */
1266 if (image->xvec->flavour == bfd_target_elf_flavour) {
1267 elf_binary = 1;
1268 top_of_stack = 0xe0000000;
1269 stack_size = 0x00100000;
1270 }
1271 else {
1272 elf_binary = 0;
1273 top_of_stack = 0x20000000;
1274 stack_size = 0x00100000;
1275 }
1276
1277 /* options */
1278 emul_add_tree_options(root, image, "netbsd",
1279 (WITH_ENVIRONMENT == USER_ENVIRONMENT
1280 ? "user" : "virtual"));
1281
1282 /* virtual memory - handles growth of stack/heap */
1283 vm = device_tree_add_parsed(root, "/openprom/vm@0x%lx",
1284 (unsigned long)(top_of_stack - stack_size));
1285 device_tree_add_parsed(vm, "./stack-base 0x%lx",
1286 (unsigned long)(top_of_stack - stack_size));
1287 device_tree_add_parsed(vm, "./nr-bytes 0x%x", stack_size);
1288
1289 device_tree_add_parsed(root, "/openprom/vm/map-binary/file-name %s",
1290 bfd_get_filename(image));
1291
1292 /* finish the init */
1293 device_tree_add_parsed(root, "/openprom/init/register/pc 0x%lx",
1294 (unsigned long)bfd_get_start_address(image));
1295 device_tree_add_parsed(root, "/openprom/init/register/sp 0x%lx",
1296 (unsigned long)top_of_stack);
1297 device_tree_add_parsed(root, "/openprom/init/register/msr 0x%x",
1298 (device_find_boolean_property(root, "/options/little-endian?")
1299 ? msr_little_endian_mode
1300 : 0));
1301 device_tree_add_parsed(root, "/openprom/init/stack/stack-type %s",
1302 (elf_binary ? "elf" : "xcoff"));
1303
1304 /* finally our emulation data */
1305 bsd_data = ZALLOC(os_emul_data);
1306 bsd_data->vm = vm;
1307 bsd_data->syscalls = &emul_netbsd_syscalls;
1308 return bsd_data;
1309 }
1310
1311 static void
1312 emul_netbsd_init(os_emul_data *emul_data,
1313 int nr_cpus)
1314 {
1315 /* nothing yet */
1316 }
1317
1318 static void
1319 emul_netbsd_system_call(cpu *processor,
1320 unsigned_word cia,
1321 os_emul_data *emul_data)
1322 {
1323 emul_do_system_call(emul_data,
1324 emul_data->syscalls,
1325 cpu_registers(processor)->gpr[0],
1326 3, /*r3 contains arg0*/
1327 processor,
1328 cia);
1329 }
1330
1331 const os_emul emul_netbsd = {
1332 "netbsd",
1333 emul_netbsd_create,
1334 emul_netbsd_init,
1335 emul_netbsd_system_call,
1336 0, /*instruction_call*/
1337 0 /*data*/
1338 };
1339
1340 #endif _EMUL_NETBSD_C_
This page took 0.05844 seconds and 5 git commands to generate.