conv.h 901 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* $Id: conv.h,v 1.4 1998/08/15 20:42:51 davem Exp $
  2. * conv.h: Utility macros for Solaris emulation
  3. *
  4. * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  5. */
  6. /* #define DEBUG_SOLARIS */
  7. #define DEBUG_SOLARIS_KMALLOC
  8. #ifndef __ASSEMBLY__
  9. #include <asm/unistd.h>
  10. /* Use this to get at 32-bit user passed pointers. */
  11. #define A(__x) \
  12. ({ unsigned long __ret; \
  13. __asm__ ("srl %0, 0, %0" \
  14. : "=r" (__ret) \
  15. : "0" (__x)); \
  16. (void __user *)__ret; \
  17. })
  18. extern unsigned sys_call_table[];
  19. extern unsigned sys_call_table32[];
  20. extern unsigned sunos_sys_table[];
  21. #define SYS(name) ((long)sys_call_table[__NR_##name])
  22. #define SUNOS(x) ((long)sunos_sys_table[x])
  23. #ifdef DEBUG_SOLARIS
  24. #define SOLD(s) printk("%s,%d,%s(): %s\n",__FILE__,__LINE__,__FUNCTION__,(s))
  25. #define SOLDD(s) printk("solaris: "); printk s
  26. #else
  27. #define SOLD(s)
  28. #define SOLDD(s)
  29. #endif
  30. #endif /* __ASSEMBLY__ */