1 // angel.h - A limited emulation component for the Angel ROM monitor
2 // that features onthe ARM PID7T development board. -*- C++ -*-
4 // Copyright (C) 1999, 2000 Red Hat.
5 // This file is part of SID and is licensed under the GPL.
6 // See the file COPYING.SID for conditions for redistribution.
8 // Details of the Angel ROM monitor and, specifically, the system call
9 // interface, can be found in Chapter 8 of the ARM Software
10 // Development Toolkit Reference Guide (ARM part no. DUI 0041B).
15 // FIXME: Move to common area.
17 #ifdef HAVE_SYS_TYPES_H
18 #include <sys/types.h>
20 #ifdef HAVE_SYS_TIME_H
30 using sidutil::make_attribute;
31 using sidutil::parse_attribute;
33 class arm_angel: public gloss32
61 syscall_get_cmdline = 0x15,
63 syscall_report_exception = 0x18
67 exception_rte = 0x20022, // Runtime error.
68 exception_exit = 0x20026
72 uint32 heapBase, heapLimit;
73 uint32 stackBase, stackLimit;
77 // We need to do some extra processing at reset time.
80 // ABI-specifics, for getting syscall arguments and setting results.
81 // ??? Class by itself.
82 // ??? Perhaps this shouldn't be here at all as it's really an
83 // implementation detail (but lots of implementations will probably use it).
84 bool get_int_argument(unsigned index, int32& value);
85 bool set_int_result(int32 value);
86 bool set_error_result(int32 value);
88 // Return boolean indicating if cpu is requesting something we're to handle.
89 bool syscall_trap_p();
90 // Perform a system call trap.
93 // Convert host errno to target errno.
94 int host_to_target_errno (int errno_);
95 // Cover fn for set_error_result (host_to_target_errno (errcode)).
96 bool set_host_error_result (int32 errcode);
98 // Methods to handle the individual system calls.
102 void do_get_cmdline();
111 void do_report_exception();