os_emul.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* This file is part of the program psim.
  2. Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef _OS_EMUL_H_
  15. #define _OS_EMUL_H_
  16. typedef struct _os_emul os_emul;
  17. INLINE_OS_EMUL\
  18. (os_emul *) os_emul_create
  19. (const char *file_name,
  20. device *root);
  21. INLINE_OS_EMUL\
  22. (void) os_emul_init
  23. (os_emul *emulation,
  24. int nr_cpus);
  25. /* System-call emulation - for user code. Instead of trapping system
  26. calls to kernel mode, the simulator emulates the kernels behavour */
  27. INLINE_OS_EMUL\
  28. (void) os_emul_system_call
  29. (cpu *processor,
  30. unsigned_word cia);
  31. /* Instruction emulation - for kernel code. Extra (normally illegal)
  32. instructions are added to the instruction table that when executed
  33. call this emulation function. The instruction call emulator should
  34. verify the address that the instruction appears before emulating
  35. the required behavour. If the verification fails, a zero value
  36. should be returned (indicating instruction illegal). */
  37. INLINE_OS_EMUL\
  38. (int) os_emul_instruction_call
  39. (cpu *processor,
  40. unsigned_word cia,
  41. unsigned_word ra);
  42. #endif