syscall.h 951 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __MON_SYS_CALL_H__
  2. #define __MON_SYS_CALL_H__
  3. #ifndef __ASSEMBLY__
  4. #include <common.h>
  5. /* These are declarations of system calls available in C code */
  6. int mon_getc(void);
  7. int mon_tstc(void);
  8. void mon_putc(const char);
  9. void mon_puts(const char*);
  10. void mon_printf(const char* fmt, ...);
  11. void mon_install_hdlr(int, interrupt_handler_t*, void*);
  12. void mon_free_hdlr(int);
  13. void *mon_malloc(size_t);
  14. void mon_free(void*);
  15. #endif /* ifndef __ASSEMBLY__ */
  16. #define NR_SYSCALLS 9 /* number of syscalls */
  17. /*
  18. * Make sure these functions are in the same order as they
  19. * appear in the "examples/syscall.S" file !!!
  20. */
  21. #define SYSCALL_GETC 0
  22. #define SYSCALL_TSTC 1
  23. #define SYSCALL_PUTC 2
  24. #define SYSCALL_PUTS 3
  25. #define SYSCALL_PRINTF 4
  26. #define SYSCALL_INSTALL_HDLR 5
  27. #define SYSCALL_FREE_HDLR 6
  28. #define SYSCALL_MALLOC 7
  29. #define SYSCALL_FREE 8
  30. #endif