syscall.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. void mon_udelay(unsigned long);
  16. unsigned long mon_get_timer(unsigned long);
  17. #endif /* ifndef __ASSEMBLY__ */
  18. #define NR_SYSCALLS 11 /* number of syscalls */
  19. /*
  20. * Make sure these functions are in the same order as they
  21. * appear in the "examples/syscall.S" file !!!
  22. */
  23. #define SYSCALL_GETC 0
  24. #define SYSCALL_TSTC 1
  25. #define SYSCALL_PUTC 2
  26. #define SYSCALL_PUTS 3
  27. #define SYSCALL_PRINTF 4
  28. #define SYSCALL_INSTALL_HDLR 5
  29. #define SYSCALL_FREE_HDLR 6
  30. #define SYSCALL_MALLOC 7
  31. #define SYSCALL_FREE 8
  32. #define SYSCALL_UDELAY 9
  33. #define SYSCALL_GET_TIMER 10
  34. #endif