syscall_emulation.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Mach Operating System
  3. * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University.
  4. * Copyright (c) 1993,1994 The University of Utah and
  5. * the Computer Systems Laboratory (CSL).
  6. * All rights reserved.
  7. *
  8. * Permission to use, copy, modify and distribute this software and its
  9. * documentation is hereby granted, provided that both the copyright
  10. * notice and this permission notice appear in all copies of the
  11. * software, derivative works or modified versions, and any portions
  12. * thereof, and that both notices appear in supporting documentation.
  13. *
  14. * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF
  15. * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
  16. * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
  17. * THIS SOFTWARE.
  18. *
  19. * Carnegie Mellon requests users of this software to return to
  20. *
  21. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  22. * School of Computer Science
  23. * Carnegie Mellon University
  24. * Pittsburgh PA 15213-3890
  25. *
  26. * any improvements or extensions that they make and grant Carnegie Mellon
  27. * the rights to redistribute these changes.
  28. */
  29. #ifndef _KERN_SYSCALL_EMULATION_H_
  30. #define _KERN_SYSCALL_EMULATION_H_
  31. #ifndef __ASSEMBLER__
  32. #include <mach/machine/vm_types.h>
  33. #include <kern/lock.h>
  34. #include <kern/task.h>
  35. typedef vm_offset_t eml_routine_t;
  36. typedef struct eml_dispatch {
  37. decl_simple_lock_data(, lock) /* lock for reference count */
  38. int ref_count; /* reference count */
  39. int disp_count; /* count of entries in vector */
  40. int disp_min; /* index of lowest entry in vector */
  41. eml_routine_t disp_vector[1]; /* first entry in array of dispatch */
  42. /* routines (array has disp_count */
  43. /* elements) */
  44. } *eml_dispatch_t;
  45. typedef vm_offset_t *emulation_vector_t; /* Variable-length array */
  46. #define EML_ROUTINE_NULL (eml_routine_t)0
  47. #define EML_DISPATCH_NULL (eml_dispatch_t)0
  48. #define EML_SUCCESS (0)
  49. #define EML_MOD (err_kern|err_sub(2))
  50. #define EML_BAD_TASK (EML_MOD|0x0001)
  51. #define EML_BAD_CNT (EML_MOD|0x0002)
  52. extern void eml_init(void);
  53. extern void eml_task_reference(task_t task, task_t parent);
  54. extern void eml_task_deallocate(task_t task);
  55. #endif /* __ASSEMBLER__ */
  56. #endif /* _KERN_SYSCALL_EMULATION_H_ */